diff --git a/.gitignore b/.gitignore index f75b610..a50c850 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,23 @@ .gemini .worktrees/ docs/ + +# Node +node_modules/ +dist/ +.svelte-kit/ +build/ +.env* +!.env.example + +# Rust +target/ +Cargo.lock +debug/ +release/ + +# Databases +*.db +*.db-journal +*.db-shm +*.db-wal diff --git a/GEMINI.md b/GEMINI.md index 722c57e..89bc9fd 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -2,6 +2,15 @@ TutorTool is a full-stack web application for tracking student attendance in tutoring sessions. It features a Rust backend and a SvelteKit frontend. + +## SuperLocalMemory (SLM) +- **Mandate**: Use SLM for all project-related memories, decisions, and context. +- **Workflow**: + - **Recall**: At the start of every session or when context is missing, use the `recall` tool with relevant keywords (e.g., `tutortool`, `architecture`). + - **Remember**: After implementing features, fixing bugs, or establishing new patterns, use the `remember` tool with appropriate tags. +- **Tools**: `remember`, `recall`, `list`, `get_status`. + + ## Project Overview - **Architecture**: Monorepo with a Rust backend (Axum) and a SvelteKit 5 frontend. @@ -13,6 +22,7 @@ TutorTool is a full-stack web application for tracking student attendance in tut - **Frontend**: - **Framework**: SvelteKit 5 using Svelte Runes (`$state`, `$derived`, etc.). - **Build Tool**: Vite. + - **Package Manager**: pnpm (preferred over npm). - **Styling**: Vanilla CSS (based on design handoff). - **API**: Centralized fetch wrapper in `src/lib/api.ts`. diff --git a/Makefile b/Makefile index 1c13dd1..c862163 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: dev dev-backend dev-frontend build test compose-up +.PHONY: dev dev-backend dev-frontend build test compose-up seed-demo dev: @echo "Starting backend and frontend in parallel..." @@ -8,10 +8,10 @@ dev-backend: cd backend && cargo run dev-frontend: - cd frontend && npm run dev + cd frontend && pnpm dev build: - cd frontend && npm run build + cd frontend && pnpm build cd backend && cargo build --release test: @@ -19,3 +19,7 @@ test: compose-up: docker-compose up --build + +seed-demo: + @echo "Seeding demo data..." + sqlite3 $${DATABASE_URL#sqlite:} < backend/migrations/demo_seed.sql diff --git a/backend/Cargo.lock b/backend/Cargo.lock deleted file mode 100644 index df391a0..0000000 --- a/backend/Cargo.lock +++ /dev/null @@ -1,2850 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "aho-corasick" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" - -[[package]] -name = "atoi" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" -dependencies = [ - "num-traits", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "attendance" -version = "0.1.0" -dependencies = [ - "axum", - "bcrypt", - "bytes", - "chrono", - "http-body-util", - "jsonwebtoken", - "rand 0.9.4", - "serde", - "serde_json", - "sqlx", - "thiserror", - "tokio", - "tower", - "tower-http", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "axum" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" -dependencies = [ - "axum-core", - "axum-macros", - "bytes", - "form_urlencoded", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "itoa", - "matchit", - "memchr", - "mime", - "multer", - "percent-encoding", - "pin-project-lite", - "serde_core", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-core" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "sync_wrapper", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-macros" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aa268c23bfbbd2c4363b9cd302a4f504fb2a9dfe7e3451d66f35dd392e20aca" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" - -[[package]] -name = "bcrypt" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523ab528ce3a7ada6597f8ccf5bd8d85ebe26d5edf311cad4d1d3cfb2d357ac6" -dependencies = [ - "base64", - "blowfish", - "getrandom 0.4.2", - "subtle", - "zeroize", -] - -[[package]] -name = "bitflags" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" -dependencies = [ - "serde_core", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "blowfish" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7" -dependencies = [ - "byteorder", - "cipher", -] - -[[package]] -name = "bumpalo" -version = "3.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" - -[[package]] -name = "cc" -version = "1.2.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" -dependencies = [ - "find-msvc-tools", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "chrono" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" -dependencies = [ - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-link", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" - -[[package]] -name = "crossbeam-queue" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "curve25519-dalek" -version = "4.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" -dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest", - "fiat-crypto", - "rustc_version", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "der" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "dotenvy" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" - -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest", - "elliptic-curve", - "rfc6979", - "signature", - "spki", -] - -[[package]] -name = "ed25519" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" -dependencies = [ - "pkcs8", - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" -dependencies = [ - "curve25519-dalek", - "ed25519", - "serde", - "sha2", - "subtle", - "zeroize", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" -dependencies = [ - "serde", -] - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "generic-array", - "group", - "hkdf", - "pem-rfc7468", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "etcetera" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" -dependencies = [ - "cfg-if", - "home", - "windows-sys 0.48.0", -] - -[[package]] -name = "event-listener" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "ff" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "fiat-crypto" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" - -[[package]] -name = "find-msvc-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" - -[[package]] -name = "flume" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" -dependencies = [ - "futures-core", - "futures-sink", - "spin", -] - -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - -[[package]] -name = "form_urlencoded" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures-channel" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" - -[[package]] -name = "futures-executor" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-intrusive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" -dependencies = [ - "futures-core", - "lock_api", - "parking_lot", -] - -[[package]] -name = "futures-io" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" - -[[package]] -name = "futures-sink" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" - -[[package]] -name = "futures-task" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" - -[[package]] -name = "futures-util" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" -dependencies = [ - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "libc", - "r-efi 5.3.0", - "wasip2", -] - -[[package]] -name = "getrandom" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" -dependencies = [ - "cfg-if", - "libc", - "r-efi 6.0.0", - "wasip2", - "wasip3", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] - -[[package]] -name = "hashbrown" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" - -[[package]] -name = "hashlink" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" -dependencies = [ - "hashbrown 0.15.5", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "home" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "http" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" -dependencies = [ - "bytes", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "http-range-header" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", -] - -[[package]] -name = "hyper-util" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" -dependencies = [ - "bytes", - "http", - "http-body", - "hyper", - "pin-project-lite", - "tokio", - "tower-service", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "icu_collections" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" -dependencies = [ - "displaydoc", - "potential_utf", - "utf8_iter", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locale_core" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" -dependencies = [ - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" - -[[package]] -name = "icu_properties" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" -dependencies = [ - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" - -[[package]] -name = "icu_provider" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" -dependencies = [ - "displaydoc", - "icu_locale_core", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", -] - -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - -[[package]] -name = "idna" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "indexmap" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" -dependencies = [ - "equivalent", - "hashbrown 0.17.0", - "serde", - "serde_core", -] - -[[package]] -name = "inout" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" -dependencies = [ - "generic-array", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - -[[package]] -name = "js-sys" -version = "0.3.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "jsonwebtoken" -version = "10.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0529410abe238729a60b108898784df8984c87f6054c9c4fcacc47e4803c1ce1" -dependencies = [ - "base64", - "ed25519-dalek", - "getrandom 0.2.17", - "hmac", - "js-sys", - "p256", - "p384", - "pem", - "rand 0.8.6", - "rsa", - "serde", - "serde_json", - "sha2", - "signature", - "simple_asn1", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] - -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - -[[package]] -name = "libc" -version = "0.2.186" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" - -[[package]] -name = "libm" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" - -[[package]] -name = "libredox" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" -dependencies = [ - "bitflags", - "libc", - "plain", - "redox_syscall 0.7.4", -] - -[[package]] -name = "libsqlite3-sys" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "litemap" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" - -[[package]] -name = "lock_api" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" - -[[package]] -name = "matchers" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" -dependencies = [ - "regex-automata", -] - -[[package]] -name = "matchit" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" - -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - -[[package]] -name = "memchr" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "mio" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.61.2", -] - -[[package]] -name = "multer" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" -dependencies = [ - "bytes", - "encoding_rs", - "futures-util", - "http", - "httparse", - "memchr", - "mime", - "spin", - "version_check", -] - -[[package]] -name = "nu-ansi-term" -version = "0.50.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" -dependencies = [ - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand 0.8.6", - "smallvec", - "zeroize", -] - -[[package]] -name = "num-conv" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "once_cell" -version = "1.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" - -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2", -] - -[[package]] -name = "p384" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2", -] - -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - -[[package]] -name = "parking_lot" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.18", - "smallvec", - "windows-link", -] - -[[package]] -name = "pem" -version = "3.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" -dependencies = [ - "base64", - "serde_core", -] - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "pin-project-lite" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" - -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der", - "pkcs8", - "spki", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" - -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - -[[package]] -name = "potential_utf" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" -dependencies = [ - "zerovec", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "r-efi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" - -[[package]] -name = "rand" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.17", -] - -[[package]] -name = "rand_core" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom 0.3.4", -] - -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_syscall" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f450ad9c3b1da563fb6948a8e0fb0fb9269711c9c73d9ea1de5058c79c8d643a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex-automata" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "rsa" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d" -dependencies = [ - "const-oid", - "digest", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core 0.6.4", - "signature", - "spki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "semver" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" -dependencies = [ - "itoa", - "serde", - "serde_core", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" -dependencies = [ - "errno", - "libc", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest", - "rand_core 0.6.4", -] - -[[package]] -name = "simple_asn1" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d585997b0ac10be3c5ee635f1bab02d512760d14b7c468801ac8a01d9ae5f1d" -dependencies = [ - "num-bigint", - "num-traits", - "thiserror", - "time", -] - -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" -dependencies = [ - "serde", -] - -[[package]] -name = "socket2" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "sqlx" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc" -dependencies = [ - "sqlx-core", - "sqlx-macros", - "sqlx-mysql", - "sqlx-postgres", - "sqlx-sqlite", -] - -[[package]] -name = "sqlx-core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6" -dependencies = [ - "base64", - "bytes", - "crc", - "crossbeam-queue", - "either", - "event-listener", - "futures-core", - "futures-intrusive", - "futures-io", - "futures-util", - "hashbrown 0.15.5", - "hashlink", - "indexmap", - "log", - "memchr", - "once_cell", - "percent-encoding", - "serde", - "serde_json", - "sha2", - "smallvec", - "thiserror", - "tokio", - "tokio-stream", - "tracing", - "url", -] - -[[package]] -name = "sqlx-macros" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" -dependencies = [ - "proc-macro2", - "quote", - "sqlx-core", - "sqlx-macros-core", - "syn", -] - -[[package]] -name = "sqlx-macros-core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b" -dependencies = [ - "dotenvy", - "either", - "heck", - "hex", - "once_cell", - "proc-macro2", - "quote", - "serde", - "serde_json", - "sha2", - "sqlx-core", - "sqlx-mysql", - "sqlx-postgres", - "sqlx-sqlite", - "syn", - "tokio", - "url", -] - -[[package]] -name = "sqlx-mysql" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" -dependencies = [ - "atoi", - "base64", - "bitflags", - "byteorder", - "bytes", - "crc", - "digest", - "dotenvy", - "either", - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "generic-array", - "hex", - "hkdf", - "hmac", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "percent-encoding", - "rand 0.8.6", - "rsa", - "serde", - "sha1", - "sha2", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "tracing", - "whoami", -] - -[[package]] -name = "sqlx-postgres" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" -dependencies = [ - "atoi", - "base64", - "bitflags", - "byteorder", - "crc", - "dotenvy", - "etcetera", - "futures-channel", - "futures-core", - "futures-util", - "hex", - "hkdf", - "hmac", - "home", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "rand 0.8.6", - "serde", - "serde_json", - "sha2", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "tracing", - "whoami", -] - -[[package]] -name = "sqlx-sqlite" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea" -dependencies = [ - "atoi", - "flume", - "futures-channel", - "futures-core", - "futures-executor", - "futures-intrusive", - "futures-util", - "libsqlite3-sys", - "log", - "percent-encoding", - "serde", - "serde_urlencoded", - "sqlx-core", - "thiserror", - "tracing", - "url", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" - -[[package]] -name = "stringprep" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" -dependencies = [ - "unicode-bidi", - "unicode-normalization", - "unicode-properties", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "2.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" - -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thiserror" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "time" -version = "0.3.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde_core", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" - -[[package]] -name = "time-macros" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinystr" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tinyvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.52.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67dee974fe86fd92cc45b7a95fdd2f99a36a6d7b0d431a231178d3d670bbcc6" -dependencies = [ - "bytes", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.61.2", -] - -[[package]] -name = "tokio-macros" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-stream" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tower" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" -dependencies = [ - "bitflags", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-body-util", - "http-range-header", - "httpdate", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex-automata", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "typenum" -version = "1.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" - -[[package]] -name = "unicase" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" - -[[package]] -name = "unicode-bidi" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" - -[[package]] -name = "unicode-ident" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" - -[[package]] -name = "unicode-normalization" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-properties" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "url" -version = "2.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", -] - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "valuable" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasip2" -version = "1.0.3+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" -dependencies = [ - "wit-bindgen 0.57.1", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen 0.51.0", -] - -[[package]] -name = "wasite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" - -[[package]] -name = "wasm-bindgen" -version = "0.2.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags", - "hashbrown 0.15.5", - "indexmap", - "semver", -] - -[[package]] -name = "whoami" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" -dependencies = [ - "libredox", - "wasite", -] - -[[package]] -name = "windows-core" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-implement" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-interface" -version = "0.59.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-result" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-strings" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen" -version = "0.57.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] - -[[package]] -name = "writeable" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" - -[[package]] -name = "yoke" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" -dependencies = [ - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerocopy" -version = "0.8.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zerofrom" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zeroize" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" - -[[package]] -name = "zerotrie" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", -] - -[[package]] -name = "zerovec" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zmij" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/backend/migrations/demo_seed.sql b/backend/migrations/demo_seed.sql new file mode 100644 index 0000000..c7d4c02 --- /dev/null +++ b/backend/migrations/demo_seed.sql @@ -0,0 +1,44 @@ +-- Demo Seed Data +-- Tutor/Admin Account (Password: admin) +INSERT OR IGNORE INTO tutors (id, name, email, password_hash) +VALUES (1, 'Demo Admin', 'admin@tutortool.com', '$2b$12$ted9u9ZsxbjhnWvTYsijMul138qhIKQG1RVsY8wGA3RFKZl8EaAsm'); + +-- Courses +INSERT OR IGNORE INTO courses (id, name, semester) +VALUES (1, 'Demo Course 101', 'Summer 2026'); + +-- Link Tutor to Course +INSERT OR IGNORE INTO tutor_courses (tutor_id, course_id) +VALUES (1, 1); + +-- Rooms +INSERT OR IGNORE INTO rooms (id, name, layout_json) +VALUES (1, 'Room A (Small)', '[ + {"id": "t1", "label": "T1", "x": 100, "y": 100, "width": 120, "height": 60, "type": "table"}, + {"id": "s1", "label": "1", "x": 110, "y": 110, "width": 40, "height": 40, "type": "seat"}, + {"id": "s2", "label": "2", "x": 170, "y": 110, "width": 40, "height": 40, "type": "seat"}, + {"id": "t2", "label": "T2", "x": 300, "y": 100, "width": 120, "height": 60, "type": "table"}, + {"id": "s3", "label": "3", "x": 310, "y": 110, "width": 40, "height": 40, "type": "seat"}, + {"id": "s4", "label": "4", "x": 370, "y": 110, "width": 40, "height": 40, "type": "seat"}, + {"id": "d1", "label": "Door", "x": 10, "y": 10, "width": 60, "height": 10, "type": "door"} +]'); + +-- Students +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (1, 1, 'Alice Smith'); +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (2, 1, 'Bob Jones'); +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (3, 1, 'Charlie Brown'); +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (4, 1, 'David Wilson'); +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (5, 1, 'Eve Taylor'); +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (6, 1, 'Frank Miller'); +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (7, 1, 'Grace Lee'); +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (8, 1, 'Heidi Davis'); +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (9, 1, 'Ivan Garcia'); +INSERT OR IGNORE INTO students (id, course_id, name) VALUES (10, 1, 'Judy Martinez'); + +-- Session (Today) +INSERT OR IGNORE INTO sessions (id, course_id, week_nr, date) +VALUES (1, 1, 1, date('now')); + +-- Slot (Active Demo Slot) +INSERT OR IGNORE INTO slots (id, session_id, room_id, tutor_id, start_time, end_time, status, code) +VALUES (1, 1, 1, 1, '08:00', '18:00', 'open', 'demo123'); diff --git a/conductor/demo-plan.md b/conductor/demo-plan.md new file mode 100644 index 0000000..cb4def6 --- /dev/null +++ b/conductor/demo-plan.md @@ -0,0 +1,39 @@ +# Demo Preparation & Seed Data Plan + +## Objective +Create an isolated, reproducible demo environment for presenting TutorTool on a Surface Pro 5 (Arch Linux) using Docker. This includes a robust set of seed data to simulate a live application state, which can also be utilized for local end-to-end testing. + +## Key Files & Context +- **Environment**: `docker-compose.yml` (existing) +- **Database**: SQLite (`data/attendance.db`) +- **New Files**: + - `backend/migrations/demo_seed.sql`: A standalone SQL script containing isolated test data. +- **Modified Files**: + - `Makefile`: Update to include a `seed-demo` target for easy execution. + +## Implementation Steps + +### 1. Workspace Isolation via Git Worktree +When implementing this plan, the Gemini CLI will automatically utilize its Git worktree feature to spawn a new isolated workspace (e.g., `feature/demo-seed`). This ensures the backend tooling modifications do not interfere with the `frontend-design-overhaul` worktree or the main branch. + +### 2. Create the Seed Data Script (`backend/migrations/demo_seed.sql`) +Create a SQL script that safely injects realistic demo data. It will use `INSERT OR IGNORE` or handle conflicts to ensure it can be run cleanly for both demo and testing purposes. +- **Admin/Tutor Account**: + - Name: "Demo Admin" + - Email: `admin@tutortool.com` + - Password Hash: A pre-calculated bcrypt hash for the password `admin`. +- **Course**: "Demo Course 101" (Semester: "Current"). +- **Room Layout**: A valid JSON SVG layout representing a small classroom with a few tables and seats. +- **Students**: Generate ~10 distinct student names linked to the course. +- **Session & Slot**: Create a session for the current date and an "open" slot linked to the demo room, ensuring the check-in feature can be demonstrated immediately without setup. + +### 3. Update Makefile +Add a `seed-demo` target to the existing `Makefile`. +- The target will execute the SQLite CLI to run `demo_seed.sql` against the local development database defined by the `DATABASE_URL` environment variable (defaulting to `sqlite:./dev.db` for local dev). + +### 4. Demo Run Guide +Provide a short set of instructions on how to start the environment using `docker-compose up` and the new seed command on the Surface Pro 5. + +## Verification & Testing +- **Execution**: Run `make seed-demo` against a fresh SQLite database to ensure no foreign key or syntax errors occur. +- **Authentication**: Verify that logging in with `admin@tutortool.com` / `admin` succeeds against the seeded database. diff --git a/frontend/.svelte-kit/ambient.d.ts b/frontend/.svelte-kit/ambient.d.ts deleted file mode 100644 index 38f289b..0000000 --- a/frontend/.svelte-kit/ambient.d.ts +++ /dev/null @@ -1,440 +0,0 @@ - -// this file is generated — do not edit it - - -/// - -/** - * This module provides access to environment variables that are injected _statically_ into your bundle at build time and are limited to _private_ access. - * - * | | Runtime | Build time | - * | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | - * | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) | - * | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) | - * - * Static environment variables are [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env` at build time and then statically injected into your bundle at build time, enabling optimisations like dead code elimination. - * - * **_Private_ access:** - * - * - This module cannot be imported into client-side code - * - This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured) - * - * For example, given the following build time environment: - * - * ```env - * ENVIRONMENT=production - * PUBLIC_BASE_URL=http://site.com - * ``` - * - * With the default `publicPrefix` and `privatePrefix`: - * - * ```ts - * import { ENVIRONMENT, PUBLIC_BASE_URL } from '$env/static/private'; - * - * console.log(ENVIRONMENT); // => "production" - * console.log(PUBLIC_BASE_URL); // => throws error during build - * ``` - * - * The above values will be the same _even if_ different values for `ENVIRONMENT` or `PUBLIC_BASE_URL` are set at runtime, as they are statically replaced in your code with their build time values. - */ -declare module '$env/static/private' { - export const SHELL: string; - export const npm_command: string; - export const UV_CACHE_DIR: string; - export const npm_config_userconfig: string; - export const COLORTERM: string; - export const HYPRLAND_CMD: string; - export const XDG_CONFIG_DIRS: string; - export const npm_config_cache: string; - export const LESS: string; - export const GREP_COLOR: string; - export const XDG_MENU_PREFIX: string; - export const XDG_BACKEND: string; - export const CLUTTER_BACKEND: string; - export const QT_WAYLAND_DISABLE_WINDOWDECORATION: string; - export const NODE: string; - export const SCIKIT_LEARN_DATA: string; - export const LC_ADDRESS: string; - export const SSH_AUTH_SOCK: string; - export const XDG_DATA_HOME: string; - export const XDG_CONFIG_HOME: string; - export const MEMORY_PRESSURE_WRITE: string; - export const COLOR: string; - export const npm_config_local_prefix: string; - export const DIFFPROG: string; - export const LC_MONETARY: string; - export const SSH_AGENT_PID: string; - export const ELECTRON_OZONE_PLATFORM_HINT: string; - export const HL_INITIAL_WORKSPACE_TOKEN: string; - export const KITTY_PID: string; - export const GREP_COLORS: string; - export const npm_config_globalconfig: string; - export const XCURSOR_SIZE: string; - export const EDITOR: string; - export const XDG_SEAT: string; - export const PWD: string; - export const XDG_SESSION_DESKTOP: string; - export const LOGNAME: string; - export const QT_QPA_PLATFORMTHEME: string; - export const XDG_SESSION_TYPE: string; - export const npm_config_init_module: string; - export const SYSTEMD_EXEC_PID: string; - export const _: string; - export const KITTY_PUBLIC_KEY: string; - export const MOTD_SHOWN: string; - export const HOME: string; - export const LC_PAPER: string; - export const LANG: string; - export const _JAVA_AWT_WM_NONREPARENTING: string; - export const LS_COLORS: string; - export const XDG_CURRENT_DESKTOP: string; - export const npm_package_version: string; - export const MEMORY_PRESSURE_WATCH: string; - export const WAYLAND_DISPLAY: string; - export const KITTY_WINDOW_ID: string; - export const MANROFFOPT: string; - export const INVOCATION_ID: string; - export const MANAGERPID: string; - export const INIT_CWD: string; - export const UWSM_WAIT_VARNAMES: string; - export const QT_QPA_PLATFORM: string; - export const XDG_CACHE_HOME: string; - export const npm_lifecycle_script: string; - export const npm_config_npm_version: string; - export const ANDROID_HOME: string; - export const TERM: string; - export const TERMINFO: string; - export const npm_package_name: string; - export const LESS_TERMCAP_mb: string; - export const LESS_TERMCAP_me: string; - export const LESS_TERMCAP_md: string; - export const npm_config_prefix: string; - export const ZDOTDIR: string; - export const USER: string; - export const GIT_PAGER: string; - export const SDL_VIDEODRIVER: string; - export const HYPRLAND_INSTANCE_SIGNATURE: string; - export const MANPAGER: string; - export const NOTIFY_SOCKET: string; - export const DISPLAY: string; - export const npm_lifecycle_event: string; - export const SHLVL: string; - export const LESS_TERMCAP_ue: string; - export const MOZ_ENABLE_WAYLAND: string; - export const LESS_TERMCAP_us: string; - export const PAGER: string; - export const LC_TELEPHONE: string; - export const ANDROID_SDK_ROOT: string; - export const LC_MESSAGES: string; - export const LC_MEASUREMENT: string; - export const XDG_VTNR: string; - export const XDG_SESSION_ID: string; - export const MANAGERPIDFDID: string; - export const npm_config_user_agent: string; - export const ROCM_PATH: string; - export const XDG_STATE_HOME: string; - export const npm_execpath: string; - export const LD_LIBRARY_PATH: string; - export const LC_CTYPE: string; - export const XDG_RUNTIME_DIR: string; - export const KITTY_LISTEN_ON: string; - export const GRIMBLAST_EDITOR: string; - export const GEMINI_CLI: string; - export const DEBUGINFOD_URLS: string; - export const npm_package_json: string; - export const LC_TIME: string; - export const HYPRCURSOR_THEME: string; - export const GEMINI_CLI_NO_RELAUNCH: string; - export const JOURNAL_STREAM: string; - export const LC_COLLATE: string; - export const XCURSOR_THEME: string; - export const XDG_DATA_DIRS: string; - export const GDK_BACKEND: string; - export const npm_config_noproxy: string; - export const PATH: string; - export const npm_config_node_gyp: string; - export const HSA_OVERRIDE_GFX_VERSION: string; - export const DBUS_SESSION_BUS_ADDRESS: string; - export const FZF_DEFAULT_OPTS: string; - export const npm_config_global_prefix: string; - export const HG: string; - export const MAIL: string; - export const UWSM_FINALIZE_VARNAMES: string; - export const KITTY_INSTALLATION_DIR: string; - export const npm_node_execpath: string; - export const LC_NUMERIC: string; - export const OLDPWD: string; - export const HYPRCURSOR_SIZE: string; - export const NODE_ENV: string; -} - -/** - * This module provides access to environment variables that are injected _statically_ into your bundle at build time and are _publicly_ accessible. - * - * | | Runtime | Build time | - * | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | - * | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) | - * | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) | - * - * Static environment variables are [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env` at build time and then statically injected into your bundle at build time, enabling optimisations like dead code elimination. - * - * **_Public_ access:** - * - * - This module _can_ be imported into client-side code - * - **Only** variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`) are included - * - * For example, given the following build time environment: - * - * ```env - * ENVIRONMENT=production - * PUBLIC_BASE_URL=http://site.com - * ``` - * - * With the default `publicPrefix` and `privatePrefix`: - * - * ```ts - * import { ENVIRONMENT, PUBLIC_BASE_URL } from '$env/static/public'; - * - * console.log(ENVIRONMENT); // => throws error during build - * console.log(PUBLIC_BASE_URL); // => "http://site.com" - * ``` - * - * The above values will be the same _even if_ different values for `ENVIRONMENT` or `PUBLIC_BASE_URL` are set at runtime, as they are statically replaced in your code with their build time values. - */ -declare module '$env/static/public' { - -} - -/** - * This module provides access to environment variables set _dynamically_ at runtime and that are limited to _private_ access. - * - * | | Runtime | Build time | - * | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | - * | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) | - * | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) | - * - * Dynamic environment variables are defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`. - * - * **_Private_ access:** - * - * - This module cannot be imported into client-side code - * - This module includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured) - * - * > [!NOTE] In `dev`, `$env/dynamic` includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter. - * - * > [!NOTE] To get correct types, environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed: - * > - * > ```env - * > MY_FEATURE_FLAG= - * > ``` - * > - * > You can override `.env` values from the command line like so: - * > - * > ```sh - * > MY_FEATURE_FLAG="enabled" npm run dev - * > ``` - * - * For example, given the following runtime environment: - * - * ```env - * ENVIRONMENT=production - * PUBLIC_BASE_URL=http://site.com - * ``` - * - * With the default `publicPrefix` and `privatePrefix`: - * - * ```ts - * import { env } from '$env/dynamic/private'; - * - * console.log(env.ENVIRONMENT); // => "production" - * console.log(env.PUBLIC_BASE_URL); // => undefined - * ``` - */ -declare module '$env/dynamic/private' { - export const env: { - SHELL: string; - npm_command: string; - UV_CACHE_DIR: string; - npm_config_userconfig: string; - COLORTERM: string; - HYPRLAND_CMD: string; - XDG_CONFIG_DIRS: string; - npm_config_cache: string; - LESS: string; - GREP_COLOR: string; - XDG_MENU_PREFIX: string; - XDG_BACKEND: string; - CLUTTER_BACKEND: string; - QT_WAYLAND_DISABLE_WINDOWDECORATION: string; - NODE: string; - SCIKIT_LEARN_DATA: string; - LC_ADDRESS: string; - SSH_AUTH_SOCK: string; - XDG_DATA_HOME: string; - XDG_CONFIG_HOME: string; - MEMORY_PRESSURE_WRITE: string; - COLOR: string; - npm_config_local_prefix: string; - DIFFPROG: string; - LC_MONETARY: string; - SSH_AGENT_PID: string; - ELECTRON_OZONE_PLATFORM_HINT: string; - HL_INITIAL_WORKSPACE_TOKEN: string; - KITTY_PID: string; - GREP_COLORS: string; - npm_config_globalconfig: string; - XCURSOR_SIZE: string; - EDITOR: string; - XDG_SEAT: string; - PWD: string; - XDG_SESSION_DESKTOP: string; - LOGNAME: string; - QT_QPA_PLATFORMTHEME: string; - XDG_SESSION_TYPE: string; - npm_config_init_module: string; - SYSTEMD_EXEC_PID: string; - _: string; - KITTY_PUBLIC_KEY: string; - MOTD_SHOWN: string; - HOME: string; - LC_PAPER: string; - LANG: string; - _JAVA_AWT_WM_NONREPARENTING: string; - LS_COLORS: string; - XDG_CURRENT_DESKTOP: string; - npm_package_version: string; - MEMORY_PRESSURE_WATCH: string; - WAYLAND_DISPLAY: string; - KITTY_WINDOW_ID: string; - MANROFFOPT: string; - INVOCATION_ID: string; - MANAGERPID: string; - INIT_CWD: string; - UWSM_WAIT_VARNAMES: string; - QT_QPA_PLATFORM: string; - XDG_CACHE_HOME: string; - npm_lifecycle_script: string; - npm_config_npm_version: string; - ANDROID_HOME: string; - TERM: string; - TERMINFO: string; - npm_package_name: string; - LESS_TERMCAP_mb: string; - LESS_TERMCAP_me: string; - LESS_TERMCAP_md: string; - npm_config_prefix: string; - ZDOTDIR: string; - USER: string; - GIT_PAGER: string; - SDL_VIDEODRIVER: string; - HYPRLAND_INSTANCE_SIGNATURE: string; - MANPAGER: string; - NOTIFY_SOCKET: string; - DISPLAY: string; - npm_lifecycle_event: string; - SHLVL: string; - LESS_TERMCAP_ue: string; - MOZ_ENABLE_WAYLAND: string; - LESS_TERMCAP_us: string; - PAGER: string; - LC_TELEPHONE: string; - ANDROID_SDK_ROOT: string; - LC_MESSAGES: string; - LC_MEASUREMENT: string; - XDG_VTNR: string; - XDG_SESSION_ID: string; - MANAGERPIDFDID: string; - npm_config_user_agent: string; - ROCM_PATH: string; - XDG_STATE_HOME: string; - npm_execpath: string; - LD_LIBRARY_PATH: string; - LC_CTYPE: string; - XDG_RUNTIME_DIR: string; - KITTY_LISTEN_ON: string; - GRIMBLAST_EDITOR: string; - GEMINI_CLI: string; - DEBUGINFOD_URLS: string; - npm_package_json: string; - LC_TIME: string; - HYPRCURSOR_THEME: string; - GEMINI_CLI_NO_RELAUNCH: string; - JOURNAL_STREAM: string; - LC_COLLATE: string; - XCURSOR_THEME: string; - XDG_DATA_DIRS: string; - GDK_BACKEND: string; - npm_config_noproxy: string; - PATH: string; - npm_config_node_gyp: string; - HSA_OVERRIDE_GFX_VERSION: string; - DBUS_SESSION_BUS_ADDRESS: string; - FZF_DEFAULT_OPTS: string; - npm_config_global_prefix: string; - HG: string; - MAIL: string; - UWSM_FINALIZE_VARNAMES: string; - KITTY_INSTALLATION_DIR: string; - npm_node_execpath: string; - LC_NUMERIC: string; - OLDPWD: string; - HYPRCURSOR_SIZE: string; - NODE_ENV: string; - [key: `PUBLIC_${string}`]: undefined; - [key: `${string}`]: string | undefined; - } -} - -/** - * This module provides access to environment variables set _dynamically_ at runtime and that are _publicly_ accessible. - * - * | | Runtime | Build time | - * | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | - * | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) | - * | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) | - * - * Dynamic environment variables are defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`. - * - * **_Public_ access:** - * - * - This module _can_ be imported into client-side code - * - **Only** variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`) are included - * - * > [!NOTE] In `dev`, `$env/dynamic` includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter. - * - * > [!NOTE] To get correct types, environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed: - * > - * > ```env - * > MY_FEATURE_FLAG= - * > ``` - * > - * > You can override `.env` values from the command line like so: - * > - * > ```sh - * > MY_FEATURE_FLAG="enabled" npm run dev - * > ``` - * - * For example, given the following runtime environment: - * - * ```env - * ENVIRONMENT=production - * PUBLIC_BASE_URL=http://example.com - * ``` - * - * With the default `publicPrefix` and `privatePrefix`: - * - * ```ts - * import { env } from '$env/dynamic/public'; - * console.log(env.ENVIRONMENT); // => undefined, not public - * console.log(env.PUBLIC_BASE_URL); // => "http://example.com" - * ``` - * - * ``` - * - * ``` - */ -declare module '$env/dynamic/public' { - export const env: { - [key: `PUBLIC_${string}`]: string | undefined; - } -} diff --git a/frontend/.svelte-kit/generated/client-optimized/app.js b/frontend/.svelte-kit/generated/client-optimized/app.js deleted file mode 100644 index 42e9286..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/app.js +++ /dev/null @@ -1,48 +0,0 @@ -export { matchers } from './matchers.js'; - -export const nodes = [ - () => import('./nodes/0'), - () => import('./nodes/1'), - () => import('./nodes/2'), - () => import('./nodes/3'), - () => import('./nodes/4'), - () => import('./nodes/5'), - () => import('./nodes/6'), - () => import('./nodes/7'), - () => import('./nodes/8'), - () => import('./nodes/9'), - () => import('./nodes/10'), - () => import('./nodes/11'), - () => import('./nodes/12') -]; - -export const server_loads = []; - -export const dictionary = { - "/": [3], - "/admin": [4,[2]], - "/admin/attendance": [5,[2]], - "/admin/courses": [6,[2]], - "/admin/export": [7,[2]], - "/admin/notes": [8,[2]], - "/admin/rooms": [9,[2]], - "/admin/sessions": [10,[2]], - "/login": [11], - "/s/[code]": [12] - }; - -export const hooks = { - handleError: (({ error }) => { console.error(error) }), - - reroute: (() => {}), - transport: {} -}; - -export const decoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.decode])); -export const encoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.encode])); - -export const hash = false; - -export const decode = (type, value) => decoders[type](value); - -export { default as root } from '../root.js'; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/matchers.js b/frontend/.svelte-kit/generated/client-optimized/matchers.js deleted file mode 100644 index f6bd30a..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/matchers.js +++ /dev/null @@ -1 +0,0 @@ -export const matchers = {}; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/0.js b/frontend/.svelte-kit/generated/client-optimized/nodes/0.js deleted file mode 100644 index fed1375..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/0.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/+layout.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/1.js b/frontend/.svelte-kit/generated/client-optimized/nodes/1.js deleted file mode 100644 index bf58bad..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/1.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/10.js b/frontend/.svelte-kit/generated/client-optimized/nodes/10.js deleted file mode 100644 index 82fa30b..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/10.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/sessions/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/11.js b/frontend/.svelte-kit/generated/client-optimized/nodes/11.js deleted file mode 100644 index f2b26cd..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/11.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/login/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/12.js b/frontend/.svelte-kit/generated/client-optimized/nodes/12.js deleted file mode 100644 index 37be5c2..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/12.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/s/[code]/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/2.js b/frontend/.svelte-kit/generated/client-optimized/nodes/2.js deleted file mode 100644 index 7b5a8c0..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/2.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/+layout.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/3.js b/frontend/.svelte-kit/generated/client-optimized/nodes/3.js deleted file mode 100644 index 1cb4f85..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/3.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/4.js b/frontend/.svelte-kit/generated/client-optimized/nodes/4.js deleted file mode 100644 index 1ed29fc..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/4.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/5.js b/frontend/.svelte-kit/generated/client-optimized/nodes/5.js deleted file mode 100644 index 6b07818..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/5.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/attendance/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/6.js b/frontend/.svelte-kit/generated/client-optimized/nodes/6.js deleted file mode 100644 index fa3f6bb..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/6.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/courses/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/7.js b/frontend/.svelte-kit/generated/client-optimized/nodes/7.js deleted file mode 100644 index 6d943a4..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/7.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/export/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/8.js b/frontend/.svelte-kit/generated/client-optimized/nodes/8.js deleted file mode 100644 index 6e870a3..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/8.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/notes/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client-optimized/nodes/9.js b/frontend/.svelte-kit/generated/client-optimized/nodes/9.js deleted file mode 100644 index 210de29..0000000 --- a/frontend/.svelte-kit/generated/client-optimized/nodes/9.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/rooms/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/app.js b/frontend/.svelte-kit/generated/client/app.js deleted file mode 100644 index 42e9286..0000000 --- a/frontend/.svelte-kit/generated/client/app.js +++ /dev/null @@ -1,48 +0,0 @@ -export { matchers } from './matchers.js'; - -export const nodes = [ - () => import('./nodes/0'), - () => import('./nodes/1'), - () => import('./nodes/2'), - () => import('./nodes/3'), - () => import('./nodes/4'), - () => import('./nodes/5'), - () => import('./nodes/6'), - () => import('./nodes/7'), - () => import('./nodes/8'), - () => import('./nodes/9'), - () => import('./nodes/10'), - () => import('./nodes/11'), - () => import('./nodes/12') -]; - -export const server_loads = []; - -export const dictionary = { - "/": [3], - "/admin": [4,[2]], - "/admin/attendance": [5,[2]], - "/admin/courses": [6,[2]], - "/admin/export": [7,[2]], - "/admin/notes": [8,[2]], - "/admin/rooms": [9,[2]], - "/admin/sessions": [10,[2]], - "/login": [11], - "/s/[code]": [12] - }; - -export const hooks = { - handleError: (({ error }) => { console.error(error) }), - - reroute: (() => {}), - transport: {} -}; - -export const decoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.decode])); -export const encoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.encode])); - -export const hash = false; - -export const decode = (type, value) => decoders[type](value); - -export { default as root } from '../root.js'; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/matchers.js b/frontend/.svelte-kit/generated/client/matchers.js deleted file mode 100644 index f6bd30a..0000000 --- a/frontend/.svelte-kit/generated/client/matchers.js +++ /dev/null @@ -1 +0,0 @@ -export const matchers = {}; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/0.js b/frontend/.svelte-kit/generated/client/nodes/0.js deleted file mode 100644 index fed1375..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/0.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/+layout.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/1.js b/frontend/.svelte-kit/generated/client/nodes/1.js deleted file mode 100644 index bf58bad..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/1.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/10.js b/frontend/.svelte-kit/generated/client/nodes/10.js deleted file mode 100644 index 82fa30b..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/10.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/sessions/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/11.js b/frontend/.svelte-kit/generated/client/nodes/11.js deleted file mode 100644 index f2b26cd..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/11.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/login/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/12.js b/frontend/.svelte-kit/generated/client/nodes/12.js deleted file mode 100644 index 37be5c2..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/12.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/s/[code]/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/2.js b/frontend/.svelte-kit/generated/client/nodes/2.js deleted file mode 100644 index 7b5a8c0..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/2.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/+layout.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/3.js b/frontend/.svelte-kit/generated/client/nodes/3.js deleted file mode 100644 index 1cb4f85..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/3.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/4.js b/frontend/.svelte-kit/generated/client/nodes/4.js deleted file mode 100644 index 1ed29fc..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/4.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/5.js b/frontend/.svelte-kit/generated/client/nodes/5.js deleted file mode 100644 index 6b07818..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/5.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/attendance/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/6.js b/frontend/.svelte-kit/generated/client/nodes/6.js deleted file mode 100644 index fa3f6bb..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/6.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/courses/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/7.js b/frontend/.svelte-kit/generated/client/nodes/7.js deleted file mode 100644 index 6d943a4..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/7.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/export/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/8.js b/frontend/.svelte-kit/generated/client/nodes/8.js deleted file mode 100644 index 6e870a3..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/8.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/notes/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/client/nodes/9.js b/frontend/.svelte-kit/generated/client/nodes/9.js deleted file mode 100644 index 210de29..0000000 --- a/frontend/.svelte-kit/generated/client/nodes/9.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/admin/rooms/+page.svelte"; \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/root.js b/frontend/.svelte-kit/generated/root.js deleted file mode 100644 index 4d1e892..0000000 --- a/frontend/.svelte-kit/generated/root.js +++ /dev/null @@ -1,3 +0,0 @@ -import { asClassComponent } from 'svelte/legacy'; -import Root from './root.svelte'; -export default asClassComponent(Root); \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/root.svelte b/frontend/.svelte-kit/generated/root.svelte deleted file mode 100644 index 1c16fc8..0000000 --- a/frontend/.svelte-kit/generated/root.svelte +++ /dev/null @@ -1,80 +0,0 @@ - - - - -{#if constructors[1]} - {@const Pyramid_0 = constructors[0]} - - - {#if constructors[2]} - {@const Pyramid_1 = constructors[1]} - - - - - - - {:else} - {@const Pyramid_1 = constructors[1]} - - - - {/if} - - -{:else} - {@const Pyramid_0 = constructors[0]} - - - -{/if} - -{#if mounted} -
- {#if navigated} - {title} - {/if} -
-{/if} \ No newline at end of file diff --git a/frontend/.svelte-kit/generated/server/internal.js b/frontend/.svelte-kit/generated/server/internal.js deleted file mode 100644 index 0ee50f9..0000000 --- a/frontend/.svelte-kit/generated/server/internal.js +++ /dev/null @@ -1,54 +0,0 @@ - -import root from '../root.js'; -import { set_building, set_prerendering } from '__sveltekit/environment'; -import { set_assets } from '$app/paths/internal/server'; -import { set_manifest, set_read_implementation } from '__sveltekit/server'; -import { set_private_env, set_public_env } from '../../../node_modules/@sveltejs/kit/src/runtime/shared-server.js'; - -export const options = { - app_template_contains_nonce: false, - async: false, - csp: {"mode":"auto","directives":{"upgrade-insecure-requests":false,"block-all-mixed-content":false},"reportOnly":{"upgrade-insecure-requests":false,"block-all-mixed-content":false}}, - csrf_check_origin: true, - csrf_trusted_origins: [], - embedded: false, - env_public_prefix: 'PUBLIC_', - env_private_prefix: '', - hash_routing: false, - hooks: null, // added lazily, via `get_hooks` - preload_strategy: "modulepreload", - root, - service_worker: false, - service_worker_options: undefined, - server_error_boundaries: false, - templates: { - app: ({ head, body, assets, nonce, env }) => "\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t" + head + "\n\t\n\t\n\t\t
" + body + "
\n\t\n\n", - error: ({ status, message }) => "\n\n\t\n\t\t\n\t\t" + message + "\n\n\t\t\n\t\n\t\n\t\t
\n\t\t\t" + status + "\n\t\t\t
\n\t\t\t\t

" + message + "

\n\t\t\t
\n\t\t
\n\t\n\n" - }, - version_hash: "eq7x7d" -}; - -export async function get_hooks() { - let handle; - let handleFetch; - let handleError; - let handleValidationError; - let init; - - - let reroute; - let transport; - - - return { - handle, - handleFetch, - handleError, - handleValidationError, - init, - reroute, - transport - }; -} - -export { set_assets, set_building, set_manifest, set_prerendering, set_private_env, set_public_env, set_read_implementation }; diff --git a/frontend/.svelte-kit/non-ambient.d.ts b/frontend/.svelte-kit/non-ambient.d.ts deleted file mode 100644 index 49acb9d..0000000 --- a/frontend/.svelte-kit/non-ambient.d.ts +++ /dev/null @@ -1,53 +0,0 @@ - -// this file is generated — do not edit it - - -declare module "svelte/elements" { - export interface HTMLAttributes { - 'data-sveltekit-keepfocus'?: true | '' | 'off' | undefined | null; - 'data-sveltekit-noscroll'?: true | '' | 'off' | undefined | null; - 'data-sveltekit-preload-code'?: - | true - | '' - | 'eager' - | 'viewport' - | 'hover' - | 'tap' - | 'off' - | undefined - | null; - 'data-sveltekit-preload-data'?: true | '' | 'hover' | 'tap' | 'off' | undefined | null; - 'data-sveltekit-reload'?: true | '' | 'off' | undefined | null; - 'data-sveltekit-replacestate'?: true | '' | 'off' | undefined | null; - } -} - -export {}; - - -declare module "$app/types" { - type MatcherParam = M extends (param : string) => param is (infer U extends string) ? U : string; - - export interface AppTypes { - RouteId(): "/" | "/admin" | "/admin/attendance" | "/admin/courses" | "/admin/export" | "/admin/notes" | "/admin/rooms" | "/admin/sessions" | "/login" | "/s" | "/s/[code]"; - RouteParams(): { - "/s/[code]": { code: string } - }; - LayoutParams(): { - "/": { code?: string }; - "/admin": Record; - "/admin/attendance": Record; - "/admin/courses": Record; - "/admin/export": Record; - "/admin/notes": Record; - "/admin/rooms": Record; - "/admin/sessions": Record; - "/login": Record; - "/s": { code?: string }; - "/s/[code]": { code: string } - }; - Pathname(): "/" | "/admin" | "/admin/attendance" | "/admin/courses" | "/admin/export" | "/admin/notes" | "/admin/rooms" | "/admin/sessions" | "/login" | `/s/${string}` & {}; - ResolvedPathname(): `${"" | `/${string}`}${ReturnType}`; - Asset(): string & {}; - } -} \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/.vite/manifest.json b/frontend/.svelte-kit/output/client/.vite/manifest.json deleted file mode 100644 index d596f5c..0000000 --- a/frontend/.svelte-kit/output/client/.vite/manifest.json +++ /dev/null @@ -1,300 +0,0 @@ -{ - ".svelte-kit/generated/client-optimized/app.js": { - "file": "_app/immutable/entry/app.CYjzVzWt.js", - "name": "entry/app", - "src": ".svelte-kit/generated/client-optimized/app.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_DXhpcOT6.js", - "_BMRk7WTg.js" - ], - "dynamicImports": [ - ".svelte-kit/generated/client-optimized/nodes/0.js", - ".svelte-kit/generated/client-optimized/nodes/1.js", - ".svelte-kit/generated/client-optimized/nodes/2.js", - ".svelte-kit/generated/client-optimized/nodes/3.js", - ".svelte-kit/generated/client-optimized/nodes/4.js", - ".svelte-kit/generated/client-optimized/nodes/5.js", - ".svelte-kit/generated/client-optimized/nodes/6.js", - ".svelte-kit/generated/client-optimized/nodes/7.js", - ".svelte-kit/generated/client-optimized/nodes/8.js", - ".svelte-kit/generated/client-optimized/nodes/9.js", - ".svelte-kit/generated/client-optimized/nodes/10.js", - ".svelte-kit/generated/client-optimized/nodes/11.js", - ".svelte-kit/generated/client-optimized/nodes/12.js" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/0.js": { - "file": "_app/immutable/nodes/0.Ddm7H9s-.js", - "name": "nodes/0", - "src": ".svelte-kit/generated/client-optimized/nodes/0.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_BMRk7WTg.js", - "_Dt4wv1ei.js" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/1.js": { - "file": "_app/immutable/nodes/1.DFtas2MP.js", - "name": "nodes/1", - "src": ".svelte-kit/generated/client-optimized/nodes/1.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_DKRuQnts.js", - "_BMRk7WTg.js" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/10.js": { - "file": "_app/immutable/nodes/10.BLeYuhst.js", - "name": "nodes/10", - "src": ".svelte-kit/generated/client-optimized/nodes/10.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_BMRk7WTg.js", - "_DNBIa2Bh.js" - ], - "css": [ - "_app/immutable/assets/10.BhkUjvVr.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/11.js": { - "file": "_app/immutable/nodes/11.DB6yXGVc.js", - "name": "nodes/11", - "src": ".svelte-kit/generated/client-optimized/nodes/11.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_DKRuQnts.js", - "_vL8MaPP-.js", - "_BMRk7WTg.js", - "_Dt4wv1ei.js", - "_DNBIa2Bh.js", - "_CS5Tuebd.js" - ], - "css": [ - "_app/immutable/assets/11.LkBq3xGq.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/12.js": { - "file": "_app/immutable/nodes/12.5DAleB6K.js", - "name": "nodes/12", - "src": ".svelte-kit/generated/client-optimized/nodes/12.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_DKRuQnts.js", - "_BMRk7WTg.js", - "_BYEkGdSH.js", - "_DNBIa2Bh.js" - ], - "css": [ - "_app/immutable/assets/12.BboNMIwd.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/2.js": { - "file": "_app/immutable/nodes/2.BZoTn0Qw.js", - "name": "nodes/2", - "src": ".svelte-kit/generated/client-optimized/nodes/2.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_DKRuQnts.js", - "_vL8MaPP-.js", - "_BMRk7WTg.js", - "_Dt4wv1ei.js", - "_CS5Tuebd.js" - ], - "css": [ - "_app/immutable/assets/2.BQQYIMLK.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/3.js": { - "file": "_app/immutable/nodes/3.CTDAi9vF.js", - "name": "nodes/3", - "src": ".svelte-kit/generated/client-optimized/nodes/3.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_DKRuQnts.js", - "_vL8MaPP-.js", - "_BMRk7WTg.js", - "_Dt4wv1ei.js", - "_CS5Tuebd.js" - ], - "css": [ - "_app/immutable/assets/3.Dzrf4zX4.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/4.js": { - "file": "_app/immutable/nodes/4.DmI7a2Dc.js", - "name": "nodes/4", - "src": ".svelte-kit/generated/client-optimized/nodes/4.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_BMRk7WTg.js", - "_DNBIa2Bh.js" - ], - "css": [ - "_app/immutable/assets/4.b2bZrlfC.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/5.js": { - "file": "_app/immutable/nodes/5.CFS15qnw.js", - "name": "nodes/5", - "src": ".svelte-kit/generated/client-optimized/nodes/5.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_BMRk7WTg.js", - "_DNBIa2Bh.js" - ], - "css": [ - "_app/immutable/assets/5.DDTZ5v3E.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/6.js": { - "file": "_app/immutable/nodes/6.yU_a9j7E.js", - "name": "nodes/6", - "src": ".svelte-kit/generated/client-optimized/nodes/6.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_BMRk7WTg.js", - "_DNBIa2Bh.js" - ], - "css": [ - "_app/immutable/assets/6.Bfx4fGBa.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/7.js": { - "file": "_app/immutable/nodes/7.CN50pfZX.js", - "name": "nodes/7", - "src": ".svelte-kit/generated/client-optimized/nodes/7.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_BMRk7WTg.js", - "_DNBIa2Bh.js" - ], - "css": [ - "_app/immutable/assets/7.DkoPrtit.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/8.js": { - "file": "_app/immutable/nodes/8.Bs7k9fxR.js", - "name": "nodes/8", - "src": ".svelte-kit/generated/client-optimized/nodes/8.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_BMRk7WTg.js", - "_BYEkGdSH.js", - "_DNBIa2Bh.js" - ], - "css": [ - "_app/immutable/assets/8.DigLoqRm.css" - ] - }, - ".svelte-kit/generated/client-optimized/nodes/9.js": { - "file": "_app/immutable/nodes/9.wReU4Q8t.js", - "name": "nodes/9", - "src": ".svelte-kit/generated/client-optimized/nodes/9.js", - "isEntry": true, - "imports": [ - "_egdMPJ-g.js", - "_BMRk7WTg.js", - "_BYEkGdSH.js", - "_DNBIa2Bh.js" - ], - "css": [ - "_app/immutable/assets/9.C7KB5jd4.css" - ] - }, - "_BMRk7WTg.js": { - "file": "_app/immutable/chunks/BMRk7WTg.js", - "name": "disclose-version" - }, - "_BYEkGdSH.js": { - "file": "_app/immutable/chunks/BYEkGdSH.js", - "name": "RoomCanvas", - "imports": [ - "_egdMPJ-g.js", - "_BMRk7WTg.js" - ], - "css": [ - "_app/immutable/assets/RoomCanvas.DJ9xbYNe.css" - ] - }, - "_CS5Tuebd.js": { - "file": "_app/immutable/chunks/CS5Tuebd.js", - "name": "auth", - "imports": [ - "_egdMPJ-g.js", - "_ChnYctHm.js" - ] - }, - "_ChnYctHm.js": { - "file": "_app/immutable/chunks/ChnYctHm.js", - "name": "index-client", - "imports": [ - "_egdMPJ-g.js" - ] - }, - "_DKRuQnts.js": { - "file": "_app/immutable/chunks/DKRuQnts.js", - "name": "client", - "imports": [ - "_egdMPJ-g.js", - "_ChnYctHm.js" - ] - }, - "_DNBIa2Bh.js": { - "file": "_app/immutable/chunks/DNBIa2Bh.js", - "name": "api", - "imports": [ - "_egdMPJ-g.js", - "_ChnYctHm.js", - "_CS5Tuebd.js" - ] - }, - "_DXhpcOT6.js": { - "file": "_app/immutable/chunks/DXhpcOT6.js", - "name": "preload-helper" - }, - "_Dt4wv1ei.js": { - "file": "_app/immutable/chunks/Dt4wv1ei.js", - "name": "legacy", - "imports": [ - "_egdMPJ-g.js" - ] - }, - "_RoomCanvas.DJ9xbYNe.css": { - "file": "_app/immutable/assets/RoomCanvas.DJ9xbYNe.css", - "src": "_RoomCanvas.DJ9xbYNe.css" - }, - "_egdMPJ-g.js": { - "file": "_app/immutable/chunks/egdMPJ-g.js", - "name": "index-client" - }, - "_vL8MaPP-.js": { - "file": "_app/immutable/chunks/vL8MaPP-.js", - "name": "navigation", - "imports": [ - "_DKRuQnts.js" - ] - }, - "node_modules/@sveltejs/kit/src/runtime/client/entry.js": { - "file": "_app/immutable/entry/start.DNbyqWQO.js", - "name": "entry/start", - "src": "node_modules/@sveltejs/kit/src/runtime/client/entry.js", - "isEntry": true, - "imports": [ - "_DKRuQnts.js" - ] - } -} \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/10.BhkUjvVr.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/10.BhkUjvVr.css deleted file mode 100644 index 92a8b96..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/10.BhkUjvVr.css +++ /dev/null @@ -1 +0,0 @@ -.course-selector.svelte-1x3d7ra{border-bottom:1px solid #eee;margin-bottom:20px;padding-bottom:20px}.add-session.svelte-1x3d7ra{background:#f8f9fa;border-radius:8px;margin-bottom:20px;padding:15px}.form-row.svelte-1x3d7ra{gap:10px;display:flex}.sessions-grid.svelte-1x3d7ra{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:20px;display:grid}.session-block.svelte-1x3d7ra{border:1px solid #ddd;border-radius:8px;overflow:hidden}.session-header.svelte-1x3d7ra{background:#eee;justify-content:space-between;align-items:center;padding:10px;display:flex}.slots-list.svelte-1x3d7ra{padding:10px}.slot-item.svelte-1x3d7ra{border-bottom:1px solid #f0f0f0;justify-content:space-between;padding:5px 0;display:flex}.delete-btn.svelte-1x3d7ra{color:#dc3545;cursor:pointer;background:0 0;border:none;font-weight:700}.modal-overlay.svelte-1x3d7ra{background:#00000080;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.modal.svelte-1x3d7ra{background:#fff;border-radius:8px;width:400px;padding:30px}.field.svelte-1x3d7ra{margin-bottom:15px}.field.svelte-1x3d7ra label:where(.svelte-1x3d7ra){margin-bottom:5px;display:block}.field.svelte-1x3d7ra input:where(.svelte-1x3d7ra),.field.svelte-1x3d7ra select:where(.svelte-1x3d7ra){width:100%;padding:8px}.modal-actions.svelte-1x3d7ra{justify-content:flex-end;gap:10px;margin-top:20px;display:flex}.primary.svelte-1x3d7ra{color:#fff;background:#007bff;border:none;border-radius:4px;padding:8px 16px} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/11.LkBq3xGq.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/11.LkBq3xGq.css deleted file mode 100644 index 8309da6..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/11.LkBq3xGq.css +++ /dev/null @@ -1 +0,0 @@ -.login-container.svelte-1x05zx6{border:1px solid #ccc;border-radius:8px;max-width:400px;margin:100px auto;padding:20px}.field.svelte-1x05zx6{margin-bottom:15px}label.svelte-1x05zx6{margin-bottom:5px;display:block}input.svelte-1x05zx6{box-sizing:border-box;width:100%;padding:8px}.error.svelte-1x05zx6{color:red;margin-bottom:15px}button.svelte-1x05zx6{color:#fff;cursor:pointer;background:#007bff;border:none;border-radius:4px;width:100%;padding:10px}button.svelte-1x05zx6:disabled{background:#ccc} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/12.BboNMIwd.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/12.BboNMIwd.css deleted file mode 100644 index 2a08ae7..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/12.BboNMIwd.css +++ /dev/null @@ -1 +0,0 @@ -.checkin-page.svelte-1gdz5lm{text-align:center;max-width:800px;margin:40px auto}.identity-selector.svelte-1gdz5lm{background:#f8f9fa;border-radius:8px;margin-bottom:20px;padding:20px}select.svelte-1gdz5lm{padding:8px;font-size:1.1em}.error.svelte-1gdz5lm{color:red}.success.svelte-1gdz5lm{color:#28a745;font-size:1.2em}.warning.svelte-1gdz5lm{color:#856404;background:#fff3cd;border-radius:4px;padding:10px}.map-container.svelte-1gdz5lm{margin-top:30px} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/2.BQQYIMLK.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/2.BQQYIMLK.css deleted file mode 100644 index b62d8f8..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/2.BQQYIMLK.css +++ /dev/null @@ -1 +0,0 @@ -nav.svelte-1qg5d05{background:#f8f9fa;border-bottom:1px solid #dee2e6;padding:10px 20px}.nav-content.svelte-1qg5d05{justify-content:space-between;align-items:center;max-width:1200px;margin:0 auto;display:flex}.links.svelte-1qg5d05 a:where(.svelte-1qg5d05){color:#333;margin-right:20px;text-decoration:none}.links.svelte-1qg5d05 a:where(.svelte-1qg5d05):hover{color:#007bff}main.svelte-1qg5d05{max-width:1200px;margin:20px auto;padding:0 20px} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/3.Dzrf4zX4.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/3.Dzrf4zX4.css deleted file mode 100644 index 705821a..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/3.Dzrf4zX4.css +++ /dev/null @@ -1 +0,0 @@ -.welcome.svelte-1uha8ag{text-align:center;background:#f8f9fa;border-radius:12px;max-width:600px;margin:100px auto;padding:40px}h1.svelte-1uha8ag{color:#333;margin-bottom:10px;font-size:2.5em}p.svelte-1uha8ag{color:#666;font-size:1.2em}.actions.svelte-1uha8ag{margin-top:40px}.btn.svelte-1uha8ag{color:#fff;background:#007bff;border-radius:6px;padding:12px 30px;font-weight:700;text-decoration:none}.footer.svelte-1uha8ag{color:#888;margin-top:60px;font-size:.9em} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/4.b2bZrlfC.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/4.b2bZrlfC.css deleted file mode 100644 index 8ba6d9b..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/4.b2bZrlfC.css +++ /dev/null @@ -1 +0,0 @@ -.course-selector.svelte-1jef3w8{margin-bottom:20px}.session-card.svelte-1jef3w8{border:1px solid #ddd;border-radius:8px;margin-bottom:15px;padding:15px}.slot-row.svelte-1jef3w8{border-top:1px solid #eee;justify-content:space-between;align-items:center;padding:10px 0;display:flex}.status-badge.svelte-1jef3w8{text-transform:uppercase;border-radius:12px;margin-right:10px;padding:2px 8px;font-size:.8em}.status-badge.closed.svelte-1jef3w8{color:#fff;background:#6c757d}.status-badge.open.svelte-1jef3w8{color:#fff;background:#28a745}.status-badge.locked.svelte-1jef3w8{color:#000;background:#ffc107}.checkin-code.svelte-1jef3w8{background:#f0f0f0;border-radius:4px;margin-left:10px;padding:2px 5px}.actions.svelte-1jef3w8 button:where(.svelte-1jef3w8){margin-left:5px} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/5.DDTZ5v3E.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/5.DDTZ5v3E.css deleted file mode 100644 index 7af6807..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/5.DDTZ5v3E.css +++ /dev/null @@ -1 +0,0 @@ -.selectors.svelte-190s2eg{margin-bottom:20px}select.svelte-190s2eg{margin-right:10px;padding:5px}.matrix-container.svelte-190s2eg{overflow-x:auto}table.svelte-190s2eg{border-collapse:collapse;background:#fff;width:100%}th.svelte-190s2eg,td.svelte-190s2eg{text-align:center;border:1px solid #ddd;padding:10px}th.svelte-190s2eg{background:#f8f9fa}.cell.svelte-190s2eg{cursor:pointer;width:60px;height:40px}.cell.svelte-190s2eg:hover{background:#f0f0f0}.cell.present.svelte-190s2eg{color:#155724;background:#d4edda;font-weight:700} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/6.Bfx4fGBa.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/6.Bfx4fGBa.css deleted file mode 100644 index e4d7384..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/6.Bfx4fGBa.css +++ /dev/null @@ -1 +0,0 @@ -.management-grid.svelte-nbog41{grid-template-columns:300px 1fr;gap:30px;display:grid}.course-item.svelte-nbog41{cursor:pointer;border:1px solid #eee;border-radius:4px;margin-bottom:5px;padding:10px}.course-item.selected.svelte-nbog41{background:#e7f1ff;border-color:#007bff}.student-actions.svelte-nbog41{background:#f8f9fa;border-radius:8px;margin-bottom:20px;padding:15px}.import-box.svelte-nbog41{margin-top:10px;font-size:.9em}table.svelte-nbog41{border-collapse:collapse;width:100%}th.svelte-nbog41,td.svelte-nbog41{text-align:left;border-bottom:1px solid #eee;padding:10px}input.svelte-nbog41{margin-right:5px;padding:6px} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/7.DkoPrtit.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/7.DkoPrtit.css deleted file mode 100644 index 69bd3d9..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/7.DkoPrtit.css +++ /dev/null @@ -1 +0,0 @@ -.export-grid.svelte-128ylb7{grid-template-columns:1fr 1fr;gap:40px;margin-top:20px;display:grid}.export-card.svelte-128ylb7{background:#f8f9fa;border:1px solid #dee2e6;border-radius:8px;margin:15px 0;padding:20px}.btn-group.svelte-128ylb7{gap:10px;display:flex}button.svelte-128ylb7{cursor:pointer;padding:8px 16px}button.small.svelte-128ylb7{padding:4px 8px;font-size:.9em}.session-export-row.svelte-128ylb7{border-bottom:1px solid #eee;justify-content:space-between;align-items:center;padding:8px 0;display:flex}select.svelte-128ylb7{width:100%;margin-bottom:10px;padding:8px} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/8.DigLoqRm.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/8.DigLoqRm.css deleted file mode 100644 index 95f6607..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/8.DigLoqRm.css +++ /dev/null @@ -1 +0,0 @@ -.selectors.svelte-1do7mxm{margin-bottom:20px}select.svelte-1do7mxm{margin-right:10px;padding:5px}.notes-container.svelte-1do7mxm{grid-template-columns:1fr 300px;gap:20px;display:grid}.note-editor.svelte-1do7mxm{background:#f8f9fa;border-radius:8px;padding:20px}textarea.svelte-1do7mxm{width:100%;height:100px;margin:10px 0}.primary.svelte-1do7mxm{color:#fff;background:#007bff;border:none;border-radius:4px;padding:8px 16px}.note-item.svelte-1do7mxm{border-bottom:1px solid #ddd;padding:5px 0;font-size:.9em}.note-item.svelte-1do7mxm p:where(.svelte-1do7mxm){margin:5px 0} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/9.C7KB5jd4.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/9.C7KB5jd4.css deleted file mode 100644 index a7ad813..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/9.C7KB5jd4.css +++ /dev/null @@ -1 +0,0 @@ -.management-grid.svelte-2e9svb{grid-template-columns:200px 1fr;gap:20px;display:grid}.room-item.svelte-2e9svb{cursor:pointer;border:1px solid #eee;border-radius:4px;margin-bottom:5px;padding:10px}.room-item.selected.svelte-2e9svb{background:#e7f1ff;border-color:#007bff}.editor-header.svelte-2e9svb{justify-content:space-between;align-items:center;margin-bottom:10px;display:flex}.toolbar.svelte-2e9svb button:where(.svelte-2e9svb){margin-right:5px}.save-btn.svelte-2e9svb{color:#fff;background:#28a745;border:none;border-radius:4px;padding:5px 15px}.canvas-container.svelte-2e9svb{gap:20px;display:flex}.properties-panel.svelte-2e9svb{background:#f8f9fa;border-radius:8px;width:200px;padding:15px}.field.svelte-2e9svb{margin-bottom:10px}.field.svelte-2e9svb label:where(.svelte-2e9svb){color:#666;font-size:.8em;display:block}.field.svelte-2e9svb input:where(.svelte-2e9svb){width:100%;padding:4px}.delete-btn.svelte-2e9svb{color:red;width:100%;margin-top:10px} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/assets/RoomCanvas.DJ9xbYNe.css b/frontend/.svelte-kit/output/client/_app/immutable/assets/RoomCanvas.DJ9xbYNe.css deleted file mode 100644 index 44ee6c8..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/assets/RoomCanvas.DJ9xbYNe.css +++ /dev/null @@ -1 +0,0 @@ -.room-canvas.svelte-1i40qao{-webkit-user-select:none;user-select:none;background:#fff;border:1px solid #ccc}.room-canvas.editable.svelte-1i40qao{cursor:crosshair}.element.svelte-1i40qao{cursor:pointer}.element.seat.svelte-1i40qao rect:where(.svelte-1i40qao){fill:#fff;stroke:#007bff;stroke-width:2px}.element.seat.svelte-1i40qao text:where(.svelte-1i40qao){fill:#007bff;font-size:14px;font-weight:700}.element.seat.occupied.svelte-1i40qao rect:where(.svelte-1i40qao){fill:#e7f1ff;stroke:#6c757d}.element.seat.occupied.svelte-1i40qao text:where(.svelte-1i40qao){fill:#6c757d}.element.seat.is-mine.svelte-1i40qao rect:where(.svelte-1i40qao){fill:#28a745;stroke:#1e7e34}.element.seat.is-mine.svelte-1i40qao text:where(.svelte-1i40qao){fill:#fff}.element.selected.svelte-1i40qao rect:where(.svelte-1i40qao){stroke:#ffc107;stroke-width:3px}.student-name.svelte-1i40qao{fill:#333;font-size:10px} diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/BMRk7WTg.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/BMRk7WTg.js deleted file mode 100644 index afdd2d0..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/BMRk7WTg.js +++ /dev/null @@ -1 +0,0 @@ -typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`); \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/BYEkGdSH.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/BYEkGdSH.js deleted file mode 100644 index 9517bfa..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/BYEkGdSH.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,E as r,F as i,I as a,J as o,L as s,Q as c,R as l,S as u,T as d,V as f,Y as p,_ as m,f as h,g,h as _,i as v,j as y,u as b,v as x,w as S,y as C}from"./egdMPJ-g.js";import"./BMRk7WTg.js";var w=u(``,1),T=u(` `),E=u(` `,1),D=u(``),O=u(`DOOR`,1),k=u(``),A=u(``);function j(u,S){p(S,!0);let j=v(S,`elements`,31,()=>l([])),M=v(S,`editable`,3,!1),N=v(S,`selectedId`,3,null),P=v(S,`occupiedSeatIds`,19,()=>[]),F=v(S,`mySeatId`,3,null),I=v(S,`studentNames`,19,()=>({})),L=f(null),R=0,z=0;function B(e,n){if(!M()){S.onElementClick?.(n);return}t(L,n.id,!0),R=e.clientX-n.x*40,z=e.clientY-n.y*40}function V(e){if(!n(L)||!M())return;let t=j().findIndex(e=>e.id===n(L));if(t===-1)return;let r=Math.round((e.clientX-R)/10)*10/40,i=Math.round((e.clientY-z)/10)*10/40;j(j()[t]={...j()[t],x:r,y:i},!0)}function H(){n(L)&&M()&&S.onLayoutChange?.(j()),t(L,null)}var U=A();let W;var G=i(U),K=t=>{var n=w(),r=a(n),o=i(r);b(o,`width`,40),b(o,`height`,40),b(i(o),`d`,`M 40 0 L 0 0 0 40`),e(o),e(r),c(),C(t,n)};m(G,e=>{M()&&e(K)}),_(s(G),17,j,g,(t,r)=>{var o=k();let c;var l=i(o),u=t=>{var o=E(),c=a(o),l=s(c),u=i(l,!0);e(l);var d=s(l),f=t=>{var a=T(),o=i(a,!0);e(a),y(()=>{b(a,`x`,n(r).width*40/2),b(a,`y`,n(r).height*40+15),x(o,I()[n(r).id])}),C(t,a)};m(d,e=>{I()[n(r).id]&&e(f)}),y(()=>{b(c,`width`,n(r).width*40),b(c,`height`,n(r).height*40),b(l,`x`,n(r).width*40/2),b(l,`y`,n(r).height*40/2),x(u,n(r).label)}),C(t,o)},f=e=>{var t=D();y(()=>{b(t,`width`,n(r).width*40),b(t,`height`,n(r).height*40)}),C(e,t)},p=e=>{var t=O(),i=a(t),o=s(i);y(()=>{b(i,`width`,n(r).width*40),b(i,`height`,n(r).height*40),b(o,`x`,n(r).width*40/2),b(o,`y`,n(r).height*40/2)}),C(e,t)};m(l,e=>{n(r).type===`seat`?e(u):n(r).type===`table`?e(f,1):n(r).type===`door`&&e(p,2)}),e(o),y(e=>{b(o,`transform`,`translate(${n(r).x*40}, ${n(r).y*40})`),c=h(o,0,`element ${n(r).type??``}`,`svelte-1i40qao`,c,e)},[()=>({selected:N()===n(r).id,occupied:n(r).type===`seat`&&P().includes(n(r).id),"is-mine":n(r).id===F()})]),d(`mousedown`,o,e=>B(e,n(r))),C(t,o)}),e(U),y(()=>W=h(U,0,`room-canvas svelte-1i40qao`,null,W,{editable:M()})),d(`mousemove`,U,V),d(`mouseup`,U,H),r(`mouseleave`,U,H),C(u,U),o()}S([`mousemove`,`mouseup`,`mousedown`]);export{j as t}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/CS5Tuebd.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/CS5Tuebd.js deleted file mode 100644 index b55bf7b..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/CS5Tuebd.js +++ /dev/null @@ -1 +0,0 @@ -import{K as e}from"./egdMPJ-g.js";import"./ChnYctHm.js";var t=e(localStorage.getItem(`token`));t.subscribe(e=>{e?localStorage.setItem(`token`,e):localStorage.removeItem(`token`)});function n(){t.set(null)}export{t as n,n as t}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/ChnYctHm.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/ChnYctHm.js deleted file mode 100644 index da7979b..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/ChnYctHm.js +++ /dev/null @@ -1 +0,0 @@ -import"./egdMPJ-g.js"; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/DKRuQnts.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/DKRuQnts.js deleted file mode 100644 index b67b4ec..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/DKRuQnts.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,D as t,K as n,O as r,V as i,k as a,n as o,t as s}from"./egdMPJ-g.js";import"./ChnYctHm.js";var c=class{constructor(e,t){this.status=e,typeof t==`string`?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}},l=class{constructor(e,t){try{new Headers({location:t})}catch{throw Error(`Invalid redirect location ${JSON.stringify(t)}: this string contains characters that cannot be used in HTTP headers`)}this.status=e,this.location=t}},u=class extends Error{constructor(e,t,n){super(n),this.status=e,this.text=t}};new URL(`sveltekit-internal://`);function d(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function f(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function p(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function h(){}function g(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}new TextEncoder,new TextDecoder;function _(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&y.delete(x(e)),v(e,t));var y=new Map;function ee(e,t){let n=x(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent),i=r.getAttribute(`data-ttl`);return i&&y.set(n,{body:e,init:t,ttl:1e3*Number(i)}),r.getAttribute(`data-b64`)!==null&&(e=_(e)),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function b(e,t,n){if(y.size>0){let t=x(e,n),r=y.get(t);if(r){if(performance.now(){let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return ae(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return ae(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=te.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return ae(e)}).join(``)}).join(``)}/?$`),params:t}}function S(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function re(e){return e.slice(1).split(`/`).filter(S)}function ie(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;ee).join(`/`),o=0),c===void 0)if(s.rest)c=``;else continue;if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0);continue}if(s.optional&&s.chained){o++;continue}return}if(!o)return r}function ae(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}function oe({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=ne(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return ie(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function se(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function ce(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var C=globalThis.__sveltekit_eq7x7d?.base??``,le=globalThis.__sveltekit_eq7x7d?.assets??C??``,ue=`1777346369869`,de=`sveltekit:snapshot`,fe=`sveltekit:scroll`,pe=`sveltekit:states`,w=`sveltekit:history`,T=`sveltekit:navigation`,E={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},me=location.origin;function he(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function D(){return{x:pageXOffset,y:pageYOffset}}function O(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var ge={...E,"":E.hover};function _e(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function ve(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=_e(e)}}function ye(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||we(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===me&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function be(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=O(s,`preload-code`)),i===null&&(i=O(s,`preload-data`)),t===null&&(t=O(s,`keepfocus`)),n===null&&(n=O(s,`noscroll`)),a===null&&(a=O(s,`reload`)),o===null&&(o=O(s,`replacestate`)),s=_e(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:ge[r??`off`],preload_data:ge[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function xe(e){let t=n(e),r=!0;function i(){r=!0,t.update(e=>e)}function a(e){r=!1,t.set(e)}function o(e){let n;return t.subscribe(t=>{(n===void 0||r&&t!==n)&&e(n=t)})}return{notify:i,set:a,subscribe:o}}var Se={v:h};function Ce(){let{set:e,subscribe:t}=n(!1);async function r(){clearTimeout(void 0);try{let t=await fetch(`${le}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let n=(await t.json()).version!==ue;return n&&(e(!0),Se.v(),clearTimeout(void 0)),n}catch{return!1}}return{subscribe:t,check:r}}function we(e,t,n){return e.origin!==me||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Te(e){}var Ee=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);new Set([...Ee,`entries`]);var De=new Set([...Ee]);new Set([...De,`actions`,`entries`]);function Oe(e){return e.filter(e=>e!=null)}function ke(e){return e instanceof c||e instanceof u?e.status:500}function Ae(e){return e instanceof u?e.text:`Internal Error`}var k,A,j,je=o.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(o.toString()),Me=`a:`;je?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Me)},A={current:null},j={current:!1}):(k=new class{#e=i({});get data(){return t(this.#e)}set data(t){e(this.#e,t)}#t=i(null);get form(){return t(this.#t)}set form(t){e(this.#t,t)}#n=i(null);get error(){return t(this.#n)}set error(t){e(this.#n,t)}#r=i({});get params(){return t(this.#r)}set params(t){e(this.#r,t)}#i=i({id:null});get route(){return t(this.#i)}set route(t){e(this.#i,t)}#a=i({});get state(){return t(this.#a)}set state(t){e(this.#a,t)}#o=i(-1);get status(){return t(this.#o)}set status(t){e(this.#o,t)}#s=i(new URL(Me));get url(){return t(this.#s)}set url(t){e(this.#s,t)}},A=new class{#e=i(null);get current(){return t(this.#e)}set current(t){e(this.#e,t)}},j=new class{#e=i(!1);get current(){return t(this.#e)}set current(t){e(this.#e,t)}},Se.v=()=>j.current=!0);function Ne(e){Object.assign(k,e)}var{onMount:Pe,tick:Fe}=s,Ie=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),M=null,N=se(`sveltekit:scroll`)??{},P=se(`sveltekit:snapshot`)??{},F={url:xe({}),page:xe({}),navigating:n(null),updated:Ce()};function Le(e){N[e]=D()}function Re(e,t){let n=e+1;for(;N[n];)delete N[n],n+=1;for(n=t+1;P[n];)delete P[n],n+=1}function I(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(h)}async function ze(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(C||`/`);e&&await e.update()}}var Be,Ve,L,R,He,z,B=[],V=[],H=null;function U(){H?.fork?.then(e=>e?.discard()),H=null}var W=new Map,Ue=new Set,We=new Set,G=new Set,K={branch:[],error:null,url:null,nav:null},Ge=!1,Ke=!1,qe=!0,q=!1,J=!1,Je=!1,Ye=!1,Xe,Y,X,Z,Ze=new Set,Qe=new Map;async function $e(e,t,n){globalThis.__sveltekit_eq7x7d&&(globalThis.__sveltekit_eq7x7d.query,globalThis.__sveltekit_eq7x7d.prerender),document.URL!==location.href&&(location.href=location.href),z=e,await e.hooks.init?.(),Be=oe(e),R=document.documentElement,He=t,Ve=e.nodes[0],L=e.nodes[1],Ve(),L(),Y=history.state?.[w],X=history.state?.[T],Y||(Y=X=Date.now(),history.replaceState({...history.state,[w]:Y,[T]:X},``));let r=N[Y];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await Ot(He,n)):(await Q({type:`enter`,url:he(z.hash?Pt(new URL(location.href)):location.href),replace_state:!0}),i()),Dt()}function et(){B.length=0,Ye=!1}function tt(e){V.some(e=>e?.snapshot)&&(P[e]=V.map(e=>e?.snapshot?.capture()))}function nt(e){P[e]?.forEach((e,t)=>{V[t]?.snapshot?.restore(e)})}function rt(){Le(Y),ce(fe,N),tt(X),ce(de,P)}async function it(e,t,n,r){let i;t.invalidateAll&&U(),await Q({type:`goto`,url:he(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Ye=!0,i=[],Qe.forEach((e,t)=>{for(let n of e.keys())i.push(t+`/`+n)})),t.invalidate&&t.invalidate.forEach(Et)}}),t.invalidateAll&&a().then(a).then(()=>{Qe.forEach((e,t)=>{e.forEach(({resource:e},n)=>{i?.includes(t+`/`+n)&&e.refresh?.()})})})}async function at(e){if(e.id!==H?.id){U();let t={};Ze.add(t),H={id:e.id,token:t,promise:ht({...e,preload:t}).then(e=>(Ze.delete(t),e.type===`loaded`&&e.state.error&&U(),e)),fork:null}}return H.promise}async function ot(e){let t=(await yt(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function st(e,t,n){let r={params:K.params,route:{id:K.route?.id??null},url:new URL(location.href)};K={...e.state,nav:r};let i=document.querySelector(`style[data-sveltekit]`);if(i&&i.remove(),Object.assign(k,e.props.page),Xe=new z.root({target:t,props:{...e.props,stores:F,components:V},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),nt(X),n){let e={from:null,to:{...r,scroll:N[Y]??D()},willUnload:!1,type:`enter`,complete:Promise.resolve()};G.forEach(t=>t(e))}Ke=!0}async function ct({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(C&&(e.pathname===C||e.pathname===C+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=d(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:Oe(n).map(e=>e.node.component),page:Nt(k)}};s!==void 0&&(l.props.form=s);let u={},f=!k,p=0;for(let e=0;et(new URL(e))))return!0;return!1}function ft(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function pt(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function mt({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Nt(k),constructors:[]}}}async function ht({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(H?.id===e)return Ze.delete(H.token),H.promise;let{errors:o,layouts:s,leaf:u}=i,d=[...s,u];o.forEach(e=>e?.().catch(h)),d.forEach(e=>e?.[1]().catch(h));let f=K.url?e!==xt(K.url):!1,p=K.route?i.id!==K.route.id:!1,m=pt(K.url,n),g=!1,_=d.map(async(e,t)=>{if(!e)return;let a=K.branch[t];return e[1]===a?.loader&&!dt(g,p,f,m,a.universal?.uses,r)?a:(g=!0,lt({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;nPromise.resolve({}),server_data_node:ft(null)}),{node:await L(),loader:L,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(e){if(e instanceof l)return it(new URL(e.location,location.href),{},0);throw e}}async function vt(e){let t=e.href;if(W.has(t))return W.get(t);let n;try{let r=(async()=>{let t=await z.hooks.reroute({url:new URL(e),fetch:async(t,n)=>ut(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);z.hash?n.hash=t:n.pathname=t,t=n}return t})();W.set(t,r),n=await r}catch{W.delete(t);return}return n}async function yt(e,t){if(e&&!we(e,C,z.hash)){let n=await vt(e);if(!n)return;let r=bt(n);for(let n of Be){let i=n.exec(r);if(i)return{id:xt(e),invalidating:t,route:n,params:p(i),url:e}}}}function bt(e){return f(z.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(C.length))||`/`}function xt(e){return(z.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function St({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=Mt(K,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return q||Ue.forEach(e=>e(c)),o?null:s}async function Q({type:e,url:t,popped:n,keepfocus:i,noscroll:o,replace_state:s,state:c={},redirect_count:l=0,nav_token:d={},accept:f=h,block:p=h,event:m}){let g=Z;Z=d;let _=await yt(t,!1),v=e===`enter`?Mt(K,_,t,e):St({url:t,type:e,delta:n?.delta,intent:_,scroll:n?.scroll,event:m});if(!v){p(),Z===d&&(Z=g);return}let y=Y,ee=X;f(),q=!0,Ke&&v.navigation.type!==`enter`&&F.navigating.set(A.current=v.navigation);let b=_&&await ht(_);if(!b){if(we(t,C,z.hash))return await I(t,s);b=await Ct(t,{id:null},await $(new u(404,`Not Found`,`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=_?.url||t,Z!==d)return v.reject(Error(`navigation aborted`)),!1;if(b.type===`redirect`){if(l<20){await Q({type:e,url:new URL(b.location,t),popped:n,keepfocus:i,noscroll:o,replace_state:s,state:c,redirect_count:l+1,nav_token:d}),v.fulfil(void 0);return}b=await _t({status:500,error:await $(Error(`Redirect loop`),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else b.props.page.status>=400&&await F.updated.check()&&(await ze(),await I(t,s));if(et(),Le(y),tt(ee),b.props.page.url.pathname!==t.pathname&&(t.pathname=b.props.page.url.pathname),c=n?n.state:c,!n){let e=+!s,n={[w]:Y+=e,[T]:X+=e,[pe]:c};(s?history.replaceState:history.pushState).call(history,n,``,t),s||Re(Y,X)}let x=_&&H?.id===_.id?H.fork:null;H?.fork&&!x&&U(),H=null,b.props.page.state=c;let te;if(Ke){let e=(await Promise.all(Array.from(We,e=>e(v.navigation)))).filter(e=>typeof e==`function`);if(e.length>0){function t(){e.forEach(e=>{G.delete(e)})}e.push(t),e.forEach(e=>{G.add(e)})}let n=v.navigation.to;K={...b.state,nav:{params:n.params,route:n.route,url:n.url}},b.props.page&&(b.props.page.url=t);let i=x&&await x;i?te=i.commit():(M=null,Xe.$set(b.props),M&&Object.assign(b.props.page,M),Ne(b.props.page),te=r?.()),Je=!0}else await st(b,He,!1);let{activeElement:ne}=document;await te,await a(),await a();let S=null;if(qe){let e=n?n.scroll:o?D():null;e?scrollTo(e.x,e.y):(S=t.hash&&document.getElementById(Ft(t)))?S.scrollIntoView():scrollTo(0,0)}let re=document.activeElement!==ne&&document.activeElement!==document.body;!i&&!re&&jt(t,!S),qe=!0,b.props.page&&(M&&Object.assign(b.props.page,M),Object.assign(k,b.props.page)),q=!1,e===`popstate`&&nt(X),v.fulfil(void 0),v.navigation.to&&(v.navigation.to.scroll=D()),G.forEach(e=>e(v.navigation)),F.navigating.set(A.current=null)}async function Ct(e,t,n,r,i){return e.origin===me&&e.pathname===location.pathname&&!Ge?await _t({status:r,error:n,url:e,route:t}):await I(e,i)}function wt(){let e,t={element:void 0,href:void 0},n;R.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{a(n,E.hover)},20)});function r(e){e.defaultPrevented||a(e.composedPath()[0],E.tap)}R.addEventListener(`mousedown`,r),R.addEventListener(`touchstart`,r,{passive:!0});let i=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(ot(new URL(t.target.href)),i.unobserve(t.target))},{threshold:0});async function a(e,r){let i=ve(e,R),a=i===t.element&&i?.href===t.href&&r>=n;if(!i||a)return;let{url:o,external:s,download:c}=ye(i,C,z.hash);if(s||c)return;let l=be(i),u=o&&xt(K.url)===xt(o);if(!(l.reload||u))if(r<=l.preload_data){t={element:i,href:i.href},n=E.tap;let e=await yt(o,!1);if(!e)return;at(e)}else r<=l.preload_code&&(t={element:i,href:i.href},n=r,ot(o))}function o(){i.disconnect();for(let e of R.querySelectorAll(`a`)){let{url:t,external:n,download:r}=ye(e,C,z.hash);if(n||r)continue;let a=be(e);a.reload||(a.preload_code===E.viewport&&i.observe(e),a.preload_code===E.eager&&ot(t))}}G.add(o),o()}function $(e,t){if(e instanceof c)return e.body;let n=ke(e),r=Ae(e);return z.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Tt(e,t={}){return e=new URL(he(e)),e.origin===me?it(e,t,0):Promise.reject(Error(`goto: invalid URL`))}function Et(e){if(typeof e==`function`)B.push(e);else{let{href:t}=new URL(e,location.href);B.push(e=>e.href===t)}}function Dt(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(rt(),!q){let e=Mt(K,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};Ue.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&rt()}),navigator.connection?.saveData||wt(),R.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=ve(t.composedPath()[0],R);if(!n)return;let{url:r,external:i,target:a,download:o}=ye(n,C,z.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=be(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol===`https:`||r.protocol===`http:`)||o)return;let[c,l]=(z.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l)){St({url:r,type:`link`,event:t})?q=!0:t.preventDefault();return}if(l!==void 0&&u){let[,i]=K.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(J=!0,Le(Y),e(r),!s.replace_state)return;J=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await Q({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),R.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(we(r,C,!1))return;let i=e.target,a=be(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),Q({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!At)if(t.state?.[`sveltekit:history`]){let n=t.state[w];if(Z={},n===Y)return;let r=N[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[T],s=K.url?m(location)===m(K.url):!1;if(o===X&&(Je||s)){i!==k.state&&(k.state=i),e(a),N[Y]=D(),r&&scrollTo(r.x,r.y),Y=n;return}let c=n-Y;await Q({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{Y=n,X=o},block:()=>{history.go(-c)},nav_token:Z,event:t})}else J||(e(new URL(location.href)),z.hash&&location.reload())}),addEventListener(`hashchange`,()=>{J&&(J=!1,history.replaceState({...history.state,[w]:++Y,[T]:X},``,location.href))});for(let e of document.querySelectorAll(`link`))Ie.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&F.navigating.set(A.current=null)});function e(e){K.url=k.url=e,F.page.set(Nt(k)),F.page.notify()}}async function Ot(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){Ge=!0;let u=new URL(location.href),d;({params:i={},route:a={id:null}}=await yt(u,!1)||{}),d=Be.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=kt(r.uses)),lt({loader:z.nodes[t],url:u,params:i,route:a,parent:async()=>{let t={};for(let r=0;r{let a=history.state;At=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),At=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t{if(r.rangeCount===e.length){for(let t=0;t{a=e,o=t});return s.catch(h),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:D()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function Nt(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Pt(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function Ft(e){let t;if(z.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{k as a,A as i,$e as n,j as o,F as r,Te as s,Tt as t}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/DNBIa2Bh.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/DNBIa2Bh.js deleted file mode 100644 index 61c6343..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/DNBIa2Bh.js +++ /dev/null @@ -1 +0,0 @@ -import{G as e}from"./egdMPJ-g.js";import"./ChnYctHm.js";import{n as t}from"./CS5Tuebd.js";var n=`/api`;async function r(r,i){let a=e(t),o=await fetch(n+r,{...i,headers:{"Content-Type":`application/json`,...a?{Authorization:`Bearer ${a}`}:{},...i?.headers}});if(o.status,!o.ok){let e=await o.json().catch(()=>({error:o.statusText}));throw Error(e.error||o.statusText)}return o.status===204?{}:o.json()}var i={auth:{login:(e,t)=>r(`/auth/login`,{method:`POST`,body:JSON.stringify({email:e,password:t})})},admin:{courses:{list:()=>r(`/admin/courses`),create:(e,t)=>r(`/admin/courses`,{method:`POST`,body:JSON.stringify({name:e,semester:t})}),listStudents:e=>r(`/admin/courses/${e}/students`),addStudent:(e,t)=>r(`/admin/courses/${e}/students`,{method:`POST`,body:JSON.stringify({name:t})}),importStudents:(r,i)=>{let a=new FormData;return a.append(`file`,i),fetch(`${n}/admin/courses/${r}/students/import`,{method:`POST`,headers:{Authorization:`Bearer ${e(t)}`},body:a}).then(e=>e.json())}},students:{delete:e=>r(`/admin/students/${e}`,{method:`DELETE`}),getAttendance:e=>r(`/admin/students/${e}/attendance`),getNotes:e=>r(`/admin/students/${e}/notes`)},rooms:{list:()=>r(`/admin/rooms`),create:(e,t)=>r(`/admin/rooms`,{method:`POST`,body:JSON.stringify({name:e,layout:t})}),get:e=>r(`/admin/rooms/${e}`),updateLayout:(e,t)=>r(`/admin/rooms/${e}/layout`,{method:`PUT`,body:JSON.stringify(t)})},sessions:{list:e=>r(`/admin/sessions?course_id=${e}`),create:(e,t,n)=>r(`/admin/sessions`,{method:`POST`,body:JSON.stringify({course_id:e,week_nr:t,date:n})}),getAttendance:e=>r(`/admin/sessions/${e}/attendance`)},slots:{create:(e,t,n,i,a)=>r(`/admin/slots`,{method:`POST`,body:JSON.stringify({session_id:e,tutor_id:t,start_time:n,end_time:i,room_id:a})}),updateStatus:(e,t)=>r(`/admin/slots/${e}/status`,{method:`PATCH`,body:JSON.stringify({status:t})}),delete:e=>r(`/admin/slots/${e}`,{method:`DELETE`}),addAttendance:(e,t)=>r(`/admin/slots/${e}/attendance`,{method:`POST`,body:JSON.stringify({student_id:t})}),deleteAttendance:(e,t)=>r(`/admin/slots/${e}/attendance/${t}`,{method:`DELETE`}),getNotes:e=>r(`/admin/slots/${e}/notes`),upsertNote:(e,t,n)=>r(`/admin/slots/${e}/notes/${t}`,{method:`PUT`,body:JSON.stringify({content:n})})},export:{sessionCsv:e=>`${n}/admin/export/session/${e}/csv`,sessionMd:e=>`${n}/admin/export/session/${e}/md`,courseCsv:e=>`${n}/admin/export/course/${e}/csv`,courseMd:e=>`${n}/admin/export/course/${e}/md`,backup:()=>`${n}/admin/backup`}},checkin:{getInfo:e=>r(`/api/checkin/${e}`),getStudents:e=>r(`/api/checkin/${e}/students`),post:(e,t,n)=>r(`/api/checkin`,{method:`POST`,body:JSON.stringify({code:e,student_id:t,seat_id:n})})}};export{i as t}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/DXhpcOT6.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/DXhpcOT6.js deleted file mode 100644 index 79afc17..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/DXhpcOT6.js +++ /dev/null @@ -1 +0,0 @@ -var e=`modulepreload`,t=function(e){return`/`+e},n={},r=function(r,i,a){let o=Promise.resolve();if(i&&i.length>0){let r=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}o=l(i.map(i=>{if(i=t(i,a),i in n)return;n[i]=!0;let o=i.endsWith(`.css`),s=o?`[rel="stylesheet"]`:``;if(a)for(let e=r.length-1;e>=0;e--){let t=r[e];if(t.href===i&&(!o||t.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${i}"]${s}`))return;let l=document.createElement(`link`);if(l.rel=o?`stylesheet`:e,o||(l.as=`script`),l.crossOrigin=``,l.href=i,c&&l.setAttribute(`nonce`,c),document.head.appendChild(l),o)return new Promise((e,t)=>{l.addEventListener(`load`,e),l.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${i}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(e=>{for(let t of e||[])t.status===`rejected`&&s(t.reason);return r().catch(s)})};export{r as t}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/Dt4wv1ei.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/Dt4wv1ei.js deleted file mode 100644 index 9269029..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/Dt4wv1ei.js +++ /dev/null @@ -1 +0,0 @@ -import{Z as e}from"./egdMPJ-g.js";e(); \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/egdMPJ-g.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/egdMPJ-g.js deleted file mode 100644 index 3dfc666..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/egdMPJ-g.js +++ /dev/null @@ -1,3 +0,0 @@ -var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=Array.isArray,r=Array.prototype.indexOf,i=Array.prototype.includes,a=Array.from,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,l=Object.prototype,u=Array.prototype,d=Object.getPrototypeOf,f=Object.isExtensible,p=()=>{};function m(e){return e()}function h(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}var _=1024,v=2048,y=4096,b=8192,x=16384,S=32768,ee=1<<25,C=65536,te=1<<19,ne=1<<20,re=1<<25,ie=65536,ae=1<<21,oe=1<<22,se=1<<23,ce=Symbol(`$state`),le=Symbol(`legacy props`),ue=Symbol(``),de=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},fe=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function pe(e){throw Error(`https://svelte.dev/e/experimental_async_required`)}function me(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function he(){throw Error(`https://svelte.dev/e/missing_context`)}function ge(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function _e(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function ve(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function ye(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function be(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function xe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Se(){throw Error(`https://svelte.dev/e/fork_discarded`)}function Ce(){throw Error(`https://svelte.dev/e/fork_timing`)}function we(){throw Error(`https://svelte.dev/e/get_abort_signal_outside_reaction`)}function Te(){throw Error(`https://svelte.dev/e/hydration_failed`)}function Ee(e){throw Error(`https://svelte.dev/e/lifecycle_legacy_only`)}function De(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Oe(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function ke(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ae(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function je(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Me(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ne={},w=Symbol(),Pe=`http://www.w3.org/1999/xhtml`;function Fe(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ie(e){console.warn(`https://svelte.dev/e/hydratable_missing_but_expected`)}function Le(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Re(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function ze(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var T=!1;function E(e){T=e}var D;function O(e){if(e===null)throw Le(),Ne;return D=e}function Be(){return O(z(D))}function Ve(e){if(T){if(z(D)!==null)throw Le(),Ne;D=e}}function He(e=1){if(T){for(var t=e,n=D;t--;)n=z(n);D=n}}function Ue(e=!0){for(var t=0,n=D;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=z(n);e&&n.remove(),n=i}}function We(e){if(!e||e.nodeType!==8)throw Le(),Ne;return e.data}function Ge(e){return e===this.v}function Ke(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function qe(e){return!Ke(e,this.v)}var k=!1,Je=!1;function Ye(){Je=!0}var A=null;function Xe(e){A=e}function Ze(){let e={};return[()=>(et(e)||he(),Qe(e)),t=>$e(e,t)]}function Qe(e){return at(`getContext`).get(e)}function $e(e,t){let n=at(`setContext`);if(k){var r=K.f;!U&&r&32&&!A.i||Oe()}return n.set(e,t),t}function et(e){return at(`hasContext`).has(e)}function tt(){return at(`getAllContexts`)}function nt(e,t=!1,n){A={p:A,i:!1,c:null,e:null,s:e,x:null,r:K,l:Je&&!t?{s:null,u:null,$:[]}:null}}function rt(e){var t=A,n=t.e;if(n!==null){t.e=null;for(var r of n)Kn(r)}return e!==void 0&&(t.x=e),t.i=!0,A=t.p,e??{}}function it(){return!Je||A!==null&&A.l===null}function at(e){return A===null&&me(e),A.c??=new Map(ot(A)||void 0)}function ot(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var st=[];function ct(){var e=st;st=[],h(e)}function lt(e){if(st.length===0&&!kt){var t=st;queueMicrotask(()=>{t===st&&ct()})}st.push(e)}function ut(){for(;st.length>0;)ct()}function dt(e){var t=K;if(t===null)return U.f|=se,e;if(!(t.f&32768)&&!(t.f&4))throw e;ft(e,t)}function ft(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var pt=~(v|y|_);function j(e,t){e.f=e.f&pt|t}function mt(e){e.f&512||e.deps===null?j(e,_):j(e,y)}function ht(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ie,ht(t.deps))}function gt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),ht(e.deps),j(e,_)}function _t(e,t,n){if(e==null)return t(void 0),n&&n(void 0),p;let r=jr(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}var vt=[];function yt(e,t=p){let n=null,r=new Set;function i(t){if(Ke(e,t)&&(e=t,n)){let t=!vt.length;for(let t of r)t[1](),vt.push(t,e);if(t){for(let e=0;e{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}function bt(e){let t;return _t(e,e=>t=e)(),t}var xt=!1,St=!1,Ct=Symbol();function wt(e,t,n){let r=n[t]??={store:null,source:gn(void 0),unsubscribe:p};if(r.store!==e&&!(Ct in n))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=p;else{var i=!0;r.unsubscribe=_t(e,e=>{i?r.source.v=e:I(r.source,e)}),i=!1}return e&&Ct in n?bt(e):Q(r.source)}function Tt(){let e={};function t(){Wn(()=>{for(var t in e)e[t].unsubscribe();o(e,Ct,{enumerable:!1,value:!0})})}return[e,t]}function Et(e){var t=St;try{return St=!1,[e(),St]}finally{St=t}}var M=new Set,N=null,Dt=null,P=null,Ot=null,kt=!1,At=!1,jt=null,Mt=null,Nt=0,Pt=1,Ft=class e{id=Pt++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Set;#r=new Map;#i=new Map;#a=null;#o=[];#s=[];#c=new Set;#l=new Set;#u=new Map;#d=new Set;is_fork=!1;#f=!1;#p=new Set;#m(){return this.is_fork||this.#i.size>0}#h(){for(let n of this.#p)for(let r of n.#i.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#u.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#u.has(e)||this.#u.set(e,{d:[],m:[]}),this.#d.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#u.get(e);if(n){this.#u.delete(e);for(var r of n.d)j(r,v),t(r);for(r of n.m)j(r,y),t(r)}this.#d.add(e)}#g(){if(Nt++>1e3&&(M.delete(this),Lt()),!this.#m()){for(let e of this.#c)this.#l.delete(e),j(e,v),this.schedule(e);for(let e of this.#l)j(e,y),this.schedule(e)}let t=this.#o;this.#o=[],this.apply();var n=jt=[],r=[],i=Mt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Wt(e),t}if(N=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(jt=null,Mt=null,this.#m()||this.#h()){this.#v(r),this.#v(n);for(let[e,t]of this.#u)Ut(e,t)}else{this.#r.size===0&&M.delete(this),this.#c.clear(),this.#l.clear();for(let e of this.#e)e(this);this.#e.clear(),Dt=this,Rt(r),Rt(n),Dt=null,this.#a?.resolve()}var o=N;if(this.#o.length>0){let e=o??=this;e.#o.push(...this.#o.filter(t=>!e.#o.includes(t)))}o!==null&&(M.add(o),o.#g()),k&&!M.has(this)&&this.#y()}#_(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#u.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):k&&i&16777224?n.push(r):xr(r)&&(i&16&&this.#l.add(r),Er(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(e){for(var t=0;t!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){if(e)for(let e of this.#d)l.unskip_effect(e,e=>{e.f&4194320?l.schedule(e):l.#v([e])});l.activate();var i=new Set,a=new Map;for(var o of t)zt(o,r,i,a);a=new Map;var s=[...l.current.keys()].filter(e=>this.current.has(e)?this.current.get(e)[0]!==e:!0);for(let e of this.#s)!(e.f&155648)&&Vt(e,s,a)&&(e.f&4194320?(j(e,v),l.schedule(e)):l.#c.add(e));if(l.#o.length>0){l.apply();for(var c of l.#o)l.#_(c,[],[]);l.#o=[]}l.deactivate()}}for(let e of M)e.#p.has(this)&&(e.#p.delete(this),e.#p.size===0&&!e.#m()&&(e.activate(),e.#g()))}increment(e,t){let n=this.#r.get(t)??0;if(this.#r.set(t,n+1),e){let e=this.#i.get(t)??0;this.#i.set(t,e+1)}}decrement(e,t,n){let r=this.#r.get(t)??0;if(r===1?this.#r.delete(t):this.#r.set(t,r-1),e){let e=this.#i.get(t)??0;e===1?this.#i.delete(t):this.#i.set(t,e-1)}this.#f||n||(this.#f=!0,lt(()=>{this.#f=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#c.add(t);for(let e of t)this.#l.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}on_fork_commit(e){this.#n.add(e)}run_fork_commit_callbacks(){for(let e of this.#n)e(this);this.#n.clear()}settled(){return(this.#a??=g()).promise}static ensure(){if(N===null){let t=N=new e;At||(M.add(N),kt||lt(()=>{N===t&&t.flush()}))}return N}apply(){if(!k||!this.is_fork&&M.size===1){P=null;return}P=new Map;for(let[e,[t]]of this.current)P.set(e,t);for(let n of M)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id0)){dn.clear();for(let e of F){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)F.has(n)&&(F.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Er(n)}}F.clear()}}F=null}}function zt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?zt(i,t,n,r):e&4194320&&!(e&2048)&&Vt(i,t,r)&&(j(i,v),Ht(i))}}function Bt(e,t){if(e.reactions!==null)for(let n of e.reactions){let e=n.f;e&2?Bt(n,t):e&131072&&(j(n,v),t.add(n))}}function Vt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(i.call(t,r))return!0;if(r.f&2&&Vt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function Ht(e){N.schedule(e)}function Ut(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),j(e,_);for(var n=e.first;n!==null;)Ut(n,t),n=n.next}}function Wt(e){j(e,_);for(var t=e.first;t!==null;)Wt(t),t=t.next}function Gt(e){k||pe(`fork`),N!==null&&Ce();var t=Ft.ensure();t.is_fork=!0,P=new Map;var n=!1,r=t.settled();return It(e),{commit:async()=>{if(n){await r;return}M.has(t)||Se(),n=!0,t.is_fork=!1;for(var[e,[i]]of t.current)e.v=i,e.wv=br();t.activate(),t.run_fork_commit_callbacks(),t.deactivate(),It(()=>{var e=new Set;for(var n of t.current.keys())Bt(n,e);fn(e),vn()}),t.flush(),await r},discard:()=>{for(var e of t.current.keys())e.wv=br();!n&&M.has(t)&&t.discard()}}}function Kt(e){let t=0,n=mn(0),r;return()=>{Un()&&(Q(n),Zn(()=>(t===0&&(r=jr(()=>e(()=>yn(n)))),t+=1,()=>{lt(()=>{--t,t===0&&(r?.(),r=void 0,yn(n))})})))}}var qt=C|te;function Jt(e,t,n,r){new Yt(e,t,n,r)}var Yt=class{parent;is_pending=!1;transform_error;#e;#t=T?D:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Kt(()=>(this.#m=mn(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=K;t.b=this,t.f|=128,n(e)},this.parent=K.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=$n(()=>{if(T){let e=this.#t;Be();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},qt),T&&(this.#e=D)}#g(){try{this.#a=V(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=V(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=V(()=>e(this.#e)),lt(()=>{var e=this.#c=document.createDocumentFragment(),t=L();e.append(t),this.#a=this.#x(()=>V(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,ar(this.#o,()=>{this.#o=null}),this.#b(N))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=V(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();lr(this.#a,e);let t=this.#n.pending;this.#o=V(()=>t(this.#e))}else this.#b(N)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){gt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=K,n=U,r=A;q(this.#i),G(this.#i),Xe(this.#i.ctx);try{return Ft.ensure(),e()}catch(e){return dt(e),null}finally{q(t),G(n),Xe(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&ar(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,lt(()=>{this.#d=!1,this.#m&&_n(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),Q(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;N?.is_fork?(this.#a&&N.skip_effect(this.#a),this.#o&&N.skip_effect(this.#o),this.#s&&N.skip_effect(this.#s),N.on_fork_commit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(H(this.#a),null),this.#o&&=(H(this.#o),null),this.#s&&=(H(this.#s),null),T&&(O(this.#t),He(),O(Ue()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){ze();return}r=!0,i&&Me(),this.#s!==null&&ar(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){ft(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return V(()=>{var t=K;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return ft(e,this.#i.parent),null}}))};lt(()=>{var t;try{t=this.transform_error(e)}catch(e){ft(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>ft(e,this.#i&&this.#i.parent)):o(t)})}};function Xt(e,t,n,r){let i=it()?en:rn;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=K,s=Zt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||ft(e,o)}Qt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=$t();function d(){Promise.all(n.map(e=>tn(e))).then(e=>l([...t.map(i),...e])).catch(e=>ft(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),Qt()}):d()}function Zt(){var e=K,t=U,n=A,r=N;return function(i=!0){q(e),G(t),Xe(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Qt(e=!0){q(null),G(null),Xe(null),e&&N?.deactivate()}function $t(){var e=K,t=e.b,n=N,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function en(e){var t=2|v;return K!==null&&(K.f|=te),{ctx:A,deps:null,effects:null,equals:Ge,f:t,fn:e,reactions:null,rv:0,v:w,wv:0,parent:K,ac:null}}function tn(e,t,n){let r=K;r===null&&ge();var i=void 0,a=mn(w),o=!U,s=new Map;return Xn(()=>{var t=K,n=g();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(Qt)}catch(e){n.reject(e),Qt()}var c=N;if(o){if(t.f&32768)var l=$t();if(r.b.is_rendered())s.get(c)?.reject(de),s.delete(c);else{for(let e of s.values())e.reject(de);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===de),!(n===de||t.f&16384)){if(c.activate(),n)a.f|=se,_n(a,n);else{a.f&8388608&&(a.f^=se),_n(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(de)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),Wn(()=>{for(let e of s.values())e.reject(de)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function nn(e){let t=en(e);return k||mr(t),t}function rn(e){let t=en(e);return t.equals=qe,t}function an(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!pn&&vn()}return t}function vn(){pn=!1;for(let e of un)e.f&1024&&j(e,y),xr(e)&&Er(e);un.clear()}function yn(e){I(e,e.v+1)}function bn(e,t,n){var r=e.reactions;if(r!==null)for(var i=it(),a=r.length,o=0;o{if(vr===c)return e();var t=U,n=vr;G(null),yr(c);var r=e();return G(t),yr(n),r};return i&&r.set(`length`,hn(e.length,o)),new Proxy(e,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&ke();var i=r.get(t);return i===void 0?f(()=>{var e=hn(n.value,o);return r.set(t,e),e}):I(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>hn(w,o));r.set(t,e),yn(a)}}else I(n,w),yn(a);return!0},get(t,n,i){if(n===ce)return e;var a=r.get(n),c=n in t;if(a===void 0&&(!c||s(t,n)?.writable)&&(a=f(()=>hn(xn(c?t[n]:w),o)),r.set(n,a)),a!==void 0){var l=Q(a);return l===w?void 0:l}return Reflect.get(t,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=Q(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==w)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===ce)return!0;var n=r.get(t),i=n!==void 0&&n.v!==w||Reflect.has(e,t);return(n!==void 0||K!==null&&(!i||s(e,t)?.writable))&&(n===void 0&&(n=f(()=>hn(i?xn(e[t]):w,o)),r.set(t,n)),Q(n)===w)?!1:i},set(e,t,n,c){var l=r.get(t),u=t in e;if(i&&t===`length`)for(var d=n;dhn(w,o)),r.set(d+``,p)):I(p,w)}if(l===void 0)(!u||s(e,t)?.writable)&&(l=f(()=>hn(void 0,o)),I(l,xn(n)),r.set(t,l));else{u=l.v!==w;var m=f(()=>xn(n));I(l,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(c,n),!u){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&I(g,_+1)}yn(a)}return!0},ownKeys(e){Q(a);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==w});for(var[n,i]of r)i.v!==w&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Ae()}})}function Sn(e){try{if(typeof e==`object`&&e&&ce in e)return e[ce]}catch{}return e}function Cn(e,t){return Object.is(Sn(e),Sn(t))}var wn,Tn,En,Dn;function On(){if(wn===void 0){wn=window,Tn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;En=s(t,`firstChild`).get,Dn=s(t,`nextSibling`).get,f(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),f(n)&&(n.__t=void 0)}}function L(e=``){return document.createTextNode(e)}function R(e){return En.call(e)}function z(e){return Dn.call(e)}function kn(e,t){if(!T)return R(e);var n=R(D);if(n===null)n=D.appendChild(L());else if(t&&n.nodeType!==3){var r=L();return n?.before(r),O(r),r}return t&&Fn(n),O(n),n}function An(e,t=!1){if(!T){var n=R(e);return n instanceof Comment&&n.data===``?z(n):n}if(t){if(D?.nodeType!==3){var r=L();return D?.before(r),O(r),r}Fn(D)}return D}function jn(e,t=1,n=!1){let r=T?D:e;for(var i;t--;)i=r,r=z(r);if(!T)return r;if(n){if(r?.nodeType!==3){var a=L();return r===null?i?.after(a):r.before(a),O(a),a}Fn(r)}return O(r),r}function Mn(e){e.textContent=``}function Nn(){return!k||F!==null?!1:(K.f&S)!==0}function Pn(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function Fn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function In(e){T&&R(e)!==null&&Mn(e)}var Ln=!1;function Rn(){Ln||(Ln=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function zn(e){var t=U,n=K;G(null),q(null);try{return e()}finally{G(t),q(n)}}function Bn(e,t,n,r=n){e.addEventListener(t,()=>zn(n));let i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),Rn()}function Vn(e){K===null&&(U===null&&be(e),ye()),fr&&ve(e)}function Hn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function B(e,t){var n=K;n!==null&&n.f&8192&&(e|=b);var r={ctx:A,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};N?.register_created_effect(r);var i=r;if(e&4)jt===null?Ft.ensure().schedule(r):jt.push(r);else if(t!==null){try{Er(r)}catch(e){throw H(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=C))}if(i!==null&&(i.parent=n,n!==null&&Hn(i,n),U!==null&&U.f&2&&!(e&64))){var a=U;(a.effects??=[]).push(i)}return r}function Un(){return U!==null&&!W}function Wn(e){let t=B(8,null);return j(t,_),t.teardown=e,t}function Gn(e){Vn(`$effect`);var t=K.f;if(!U&&t&32&&!(t&32768)){var n=A;(n.e??=[]).push(e)}else return Kn(e)}function Kn(e){return B(4|ne,e)}function qn(e){return Vn(`$effect.pre`),B(8|ne,e)}function Jn(e){Ft.ensure();let t=B(64|te,e);return(e={})=>new Promise(n=>{e.outro?ar(t,()=>{H(t),n(void 0)}):(H(t),n(void 0))})}function Yn(e){return B(4,e)}function Xn(e){return B(oe|te,e)}function Zn(e,t=0){return B(8|t,e)}function Qn(e,t=[],n=[],r=[]){Xt(r,t,n,t=>{B(8,()=>e(...t.map(Q)))})}function $n(e,t=0){return B(16|t,e)}function V(e){return B(32|te,e)}function er(e){var t=e.teardown;if(t!==null){let e=fr,n=U;pr(!0),G(null);try{t.call(null)}finally{pr(e),G(n)}}}function tr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&zn(()=>{e.abort(de)});var r=n.next;n.f&64?n.parent=null:H(n,t),n=r}}function nr(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||H(t),t=n}}function H(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(rr(e.nodes.start,e.nodes.end),n=!0),j(e,ee),tr(e,t&&!n),Tr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();er(e),e.f^=ee,e.f|=x;var i=e.parent;i!==null&&i.first!==null&&ir(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function rr(e,t){for(;e!==null;){var n=e===t?null:z(e);e.remove(),e=n}}function ir(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function ar(e,t,n=!0){var r=[];or(e,r,!0);var i=()=>{n&&H(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function or(e,t,n){if(!(e.f&8192)){e.f^=b;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;or(i,t,o?n:!1)}i=a}}}function sr(e){cr(e,!0)}function cr(e,t){if(e.f&8192){e.f^=b,e.f&1024||(j(e,v),Ft.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;cr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function lr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:z(n);t.append(n),n=i}}var ur=null,dr=!1,fr=!1;function pr(e){fr=e}var U=null,W=!1;function G(e){U=e}var K=null;function q(e){K=e}var J=null;function mr(e){U!==null&&(!k||U.f&2)&&(J===null?J=[e]:J.push(e))}var Y=null,X=0,Z=null;function hr(e){Z=e}var gr=1,_r=0,vr=_r;function yr(e){vr=e}function br(){return++gr}function xr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ie),t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&P===null&&j(e,_)}return!1}function Sr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!k&&J!==null&&i.call(J,e)))for(var a=0;a{e.ac.abort(de)}),e.ac=null);try{e.f|=ae;var u=e.fn,d=u();e.f|=S;var f=e.deps,p=N?.is_fork;if(Y!==null){var m;if(p||Tr(e,X),f!==null&&X>0)for(f.length=X+Y.length,m=0;m{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),It()}function Or(){return Ft.ensure().settled()}function Q(e){var t=(e.f&2)!=0;if(ur?.add(e),U!==null&&!W&&!(K!==null&&K.f&16384)&&(J===null||!i.call(J,e))){var n=U.deps;if(U.f&2097152)e.rv<_r&&(e.rv=_r,Y===null&&n!==null&&n[X]===e?X++:Y===null?Y=[e]:Y.push(e));else{(U.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[U]:i.call(r,U)||r.push(U)}}if(fr&&dn.has(e))return dn.get(e);if(t){var a=e;if(fr){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||Ar(a))&&(o=on(a)),dn.set(a,o),o}var s=(a.f&512)==0&&!W&&U!==null&&(dr||(U.f&512)!=0),c=(a.f&S)===0;xr(a)&&(s&&(a.f|=512),sn(a)),s&&!c&&(ln(a),kr(a))}if(P?.has(e))return P.get(e);if(e.f&8388608)throw e.v;return e.v}function kr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(ln(t),kr(t))}function Ar(e){if(e.v===w)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(dn.has(t)||t.f&2&&Ar(t))return!0;return!1}function jr(e){var t=W;try{return W=!0,e()}finally{W=t}}function Mr(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(ce in e)Nr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&ce in n&&Nr(n)}}}function Nr(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{Nr(e[n],t)}catch{}let n=d(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=c(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var Pr=[`touchstart`,`touchmove`];function Fr(e){return Pr.includes(e)}var Ir=Symbol(`events`),Lr=new Set,Rr=new Set;function zr(e,t,n,r={}){function i(e){if(r.capture||Wr.call(t,e),!e.cancelBubble)return zn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?lt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Br(e,t,n,r,i){var a={capture:r,passive:i},o=zr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Wn(()=>{t.removeEventListener(e,o,a)})}function Vr(e,t,n){(t[Ir]??={})[e]=n}function Hr(e){for(var t=0;t{throw e});throw p}}finally{e[Ir]=t,delete e.currentTarget,G(d),q(f)}}}var Gr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Kr(e){return Gr?.createHTML(e)??e}function qr(e){var t=Pn(`template`);return t.innerHTML=Kr(e.replaceAll(``,``)),t.content}function $(e,t){var n=K;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Jr(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(``);return()=>{if(T)return $(D,null),D;i===void 0&&(i=qr(a?e:``+e),n||(i=R(i)));var t=r||Tn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=R(t),s=t.lastChild;$(o,s)}else $(t,t);return t}}function Yr(e,t,n=`svg`){var r=!e.startsWith(``),i=(t&1)!=0,a=`<${n}>${r?e:``+e}`,o;return()=>{if(T)return $(D,null),D;if(!o){var e=R(qr(a));if(i)for(o=document.createDocumentFragment();R(e);)o.appendChild(R(e));else o=R(e)}var t=o.cloneNode(!0);if(i){var n=R(t),r=t.lastChild;$(n,r)}else $(t,t);return t}}function Xr(e,t){return Yr(e,t,`svg`)}function Zr(e=``){if(!T){var t=L(e+``);return $(t,t),t}var n=D;return n.nodeType===3?Fn(n):(n.before(n=L()),O(n)),$(n,n),n}function Qr(){if(T)return $(D,null),D;var e=document.createDocumentFragment(),t=document.createComment(``),n=L();return e.append(t,n),$(t,n),e}function $r(e,t){if(T){var n=K;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=D),Be();return}e!==null&&e.before(t)}function ei(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function ti(e,t){return ii(e,t)}function ni(e,t){On(),t.intro=t.intro??!1;let n=t.target,r=T,i=D;try{for(var a=R(n);a&&(a.nodeType!==8||a.data!==`[`);)a=z(a);if(!a)throw Ne;E(!0),O(a);let r=ii(e,{...t,anchor:a});return E(!1),r}catch(r){if(r instanceof Error&&r.message.split(` -`).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw r;return r!==Ne&&console.warn(`Failed to hydrate: `,r),t.recover===!1&&Te(),On(),Mn(n),E(!1),ti(e,t)}finally{E(r),O(i)}}var ri=new Map;function ii(e,{target:t,anchor:n,props:r={},events:i,context:o,intro:s=!0,transformError:c}){On();var l=void 0,u=Jn(()=>{var s=n??t.appendChild(L());Jt(s,{pending:()=>{}},t=>{nt({});var n=A;if(o&&(n.c=o),i&&(r.$$events=i),T&&$(t,null),l=e(t,r)||{},T&&(K.nodes.end=D,D===null||D.nodeType!==8||D.data!==`]`))throw Le(),Ne;rt()},c);var u=new Set,d=e=>{for(var n=0;n{for(var e of u)for(let n of[t,document]){var r=ri.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Wr),r.delete(e),r.size===0&&ri.delete(n)):r.set(e,i)}Rr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return ai.set(l,u),l}var ai=new WeakMap;function oi(e,t){let n=ai.get(e);return n?(ai.delete(e),n(t)):Promise.resolve()}var si=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)sr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(H(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();lr(r,t),t.append(L()),this.#n.set(e,{effect:r,fragment:t})}else H(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),ar(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(H(n.effect),this.#n.delete(e))};ensure(e,t){var n=N,r=Nn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=L();i.append(a),this.#n.set(e,{effect:V(()=>t(a)),fragment:i})}else this.#t.set(e,V(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else T&&(this.anchor=D),this.#a(n)}};function ci(e,t,n=!1){var r;T&&(r=D,Be());var i=new si(e),a=n?C:0;function o(e,t){if(T){var n=We(r);if(e!==parseInt(n.substring(1))){var a=Ue();O(a),i.anchor=a,E(!1),i.ensure(e,t),E(!0);return}}i.ensure(e,t)}$n(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function li(e,t){return t}function ui(e,t,n){for(var r=[],i=t.length,o,s=t.length,c=0;c{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;di(e,a(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=r.length===0&&n!==null;if(l){var u=n,d=u.parentNode;Mn(d),d.append(u),e.items.clear()}di(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function di(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var e=r();return n(e)?e:e==null?[]:a(e)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,hi(v,p,c,t,i),d!==null&&(p.length===0?d.f&33554432?(d.f^=re,_i(d,null,c)):sr(d):ar(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:$n(()=>{p=Q(f);var e=p.length;let n=!1;T&&We(c)===`[!`!=(e===0)&&(c=Ue(),O(c),E(!1),n=!0);for(var a=new Set,u=N,v=Nn(),y=0;ys(c)):(d=V(()=>s(fi??=L())),d.f|=re)),e>a.size&&_e(``,``,``),T&&e>0&&O(Ue()),!h)if(m.set(u,a),v){for(let[e,t]of l)a.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);n&&E(!0),Q(f)}),flags:t,items:l,pending:m,outrogroups:null,fallback:d};h=!1,T&&(c=D)}function mi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function hi(e,t,n,r,i){var o=(r&8)!=0,s=t.length,c=e.items,l=mi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v0){var ne=r&4&&s===0?n:null;if(o){for(v=0;v{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function gi(e,t,n,r,i,a,o,s){var c=o&1?o&16?mn(n):gn(n,!1,!1):null,l=o&2?mn(i):null;return{v:c,i:l,e:V(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function _i(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=z(r);if(a.before(r),r===i)return;r=o}}function vi(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function yi(e,t,n,r,i){T&&Be();var a=t.$$slots?.[n],o=!1;a===!0&&(a=t[n===`default`?`children`:n],o=!0),a===void 0?i!==null&&i(e):a(e,o?()=>r:r)}function bi(e){return(t,...n)=>{var r=e(...n),i;T?(i=D,Be()):(i=R(qr(r.render().trim())),t.before(i));let a=r.setup?.(i);$(i,i),typeof a==`function`&&Wn(a)}}function xi(e,t,n){var r;T&&(r=D,Be());var i=new si(e);$n(()=>{var e=t()??null;if(T&&We(r)===`[`!=(e!==null)){var a=Ue();O(a),i.anchor=a,E(!1),i.ensure(e,e&&(t=>n(t,e))),E(!0);return}i.ensure(e,e&&(t=>n(t,e)))},C)}var Si=[...` -\r\f\xA0\v`];function Ci(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Si.includes(r[o-1]))&&(s===r.length||Si.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function wi(e,t,n,r,i,a){var o=e.__className;if(T||o!==n||o===void 0){var s=Ci(n,r,a);(!T||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function Ti(e,t,r=!1){if(e.multiple){if(t==null)return;if(!n(t))return Re();for(var i of e.options)i.selected=t.includes(Oi(i));return}for(i of e.options)if(Cn(Oi(i),t)){i.selected=!0;return}(!r||t!==void 0)&&(e.selectedIndex=-1)}function Ei(e){var t=new MutationObserver(()=>{Ti(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Wn(()=>{t.disconnect()})}function Di(e,t,n=t){var r=new WeakSet,i=!0;Bn(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),Oi);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&Oi(o)}n(a),e.__value=a,N!==null&&r.add(N)}),Yn(()=>{var a=t();if(e===document.activeElement){var o=k?Dt:N;if(r.has(o))return}if(Ti(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=Oi(s),n(a))}e.__value=a,i=!1}),Ei(e)}function Oi(e){return`__value`in e?e.__value:e.value}var ki=Symbol(`is custom element`),Ai=Symbol(`is html`),ji=fe?`link`:`LINK`;function Mi(e){if(T){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Ni(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Ni(e,`checked`,null),e.checked=r}}};e.__on_r=n,lt(n),Rn()}}function Ni(e,t,n,r){var i=Pi(e);T&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ji)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[ue]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Ii(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Pi(e){return e.__attributes??={[ki]:e.nodeName.includes(`-`),[Ai]:e.namespaceURI===Pe}}var Fi=new Map;function Ii(e){var t=e.getAttribute(`is`)||e.nodeName,n=Fi.get(t);if(n)return n;Fi.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=c(i),r)r[o].set&&n.push(o);i=d(i)}return n}function Li(e,t,n=t){var r=new WeakSet;Bn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Ri(e)?zi(a):a,n(a),N!==null&&r.add(N),await Dr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(T&&e.defaultValue!==e.value||jr(t)==null&&e.value)&&(n(Ri(e)?zi(e.value):e.value),N!==null&&r.add(N)),Zn(()=>{var n=t();if(e===document.activeElement){var i=k?Dt:N;if(r.has(i))return}Ri(e)&&n===zi(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function Ri(e){var t=e.type;return t===`number`||t===`range`}function zi(e){return e===``?null:+e}function Bi(e,t){return e===t||e?.[ce]===t}function Vi(e={},t,n,r){var i=A.r,a=K;return Yn(()=>{var o,s;return Zn(()=>{o=s,s=r?.()||[],jr(()=>{e!==n(...s)&&(t(e,...s),o&&Bi(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Bi(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Hi(e){return function(...t){return t[0].preventDefault(),e?.apply(this,t)}}function Ui(e=!1){let t=A,n=t.l.u;if(!n)return;let r=()=>Mr(t.s);if(e){let e=0,n={},i=en(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>Q(i)}n.b.length&&qn(()=>{Wi(t,r),h(n.b)}),Gn(()=>{let e=jr(()=>n.m.map(m));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&Gn(()=>{Wi(t,r),h(n.a)})}function Wi(e,t){if(e.l.s)for(let t of e.l.s)Q(t);t()}function Gi(e,t,n,r){var i=!Je||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,c=r,l=!0,u=()=>(l&&(l=!1,c=o?jr(r):r),c);let d;if(a){var f=ce in e||le in e;d=s(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=Et(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&De(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?en:rn)(()=>(_=!1,h()));a&&Q(v);var y=K;return(function(e,t){if(arguments.length>0){let n=t?Q(v):i&&a?xn(e):e;return I(v,n),_=!0,c!==void 0&&(c=n),e}return fr&&_||y.f&16384?v.v:Q(v)})}function Ki(e){return class extends qi{constructor(t){super({component:e,...t})}}}var qi=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=gn(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return Q(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===le?!0:(Q(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return I(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?ni:ti)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),!k&&(!e?.props?.$$host||e.sync===!1)&&It(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||o(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{oi(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}};function Ji(e,t){if(k||pe(`hydratable`),T){let t=window.__svelte?.h;if(t?.has(e))return t.get(e);Ie(e)}return t()}var Yi=t({afterUpdate:()=>na,beforeUpdate:()=>ta,createContext:()=>Ze,createEventDispatcher:()=>ea,createRawSnippet:()=>bi,flushSync:()=>It,fork:()=>Gt,getAbortSignal:()=>Xi,getAllContexts:()=>tt,getContext:()=>Qe,hasContext:()=>et,hydratable:()=>Ji,hydrate:()=>ni,mount:()=>ti,onDestroy:()=>Qi,onMount:()=>Zi,setContext:()=>$e,settled:()=>Or,tick:()=>Dr,unmount:()=>oi,untrack:()=>jr});function Xi(){return U===null&&we(),(U.ac??=new AbortController).signal}function Zi(e){A===null&&me(`onMount`),Je&&A.l!==null?ra(A).m.push(e):Gn(()=>{let t=jr(e);if(typeof t==`function`)return t})}function Qi(e){A===null&&me(`onDestroy`),Zi(()=>()=>jr(e))}function $i(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function ea(){let e=A;return e===null&&me(`createEventDispatcher`),(t,r,i)=>{let a=e.s.$$events?.[t];if(a){let o=n(a)?a.slice():[a],s=$i(t,r,i);for(let t of o)t.call(e.x,s);return!s.defaultPrevented}return!0}}function ta(e){A===null&&me(`beforeUpdate`),A.l===null&&Ee(`beforeUpdate`),ra(A).b.push(e)}function na(e){A===null&&me(`afterUpdate`),A.l===null&&Ee(`afterUpdate`),ra(A).a.push(e)}function ra(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}export{Ve as $,jr as A,I as B,Zr as C,Q as D,Br as E,kn as F,bt as G,nn as H,An as I,rt as J,yt as K,jn as L,Gn as M,qn as N,Or as O,In as P,He as Q,xn as R,Xr as S,Vr as T,Tt as U,hn as V,wt as W,$e as X,nt as Y,Ye as Z,ci as _,Ui as a,Qr as b,Li as c,Di as d,wi as f,li as g,pi as h,Gi as i,Qn as j,Dr as k,Mi as l,yi as m,Zi as n,Hi as o,xi as p,Qe as q,Ki as r,Vi as s,Yi as t,Ni as u,ei as v,Hr as w,Jr as x,$r as y,gn as z}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/chunks/vL8MaPP-.js b/frontend/.svelte-kit/output/client/_app/immutable/chunks/vL8MaPP-.js deleted file mode 100644 index e33f8f2..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/chunks/vL8MaPP-.js +++ /dev/null @@ -1 +0,0 @@ -import"./DKRuQnts.js"; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/entry/app.CYjzVzWt.js b/frontend/.svelte-kit/output/client/_app/immutable/entry/app.CYjzVzWt.js deleted file mode 100644 index 6d6451f..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/entry/app.CYjzVzWt.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_app/immutable/nodes/0.Ddm7H9s-.js","_app/immutable/chunks/egdMPJ-g.js","_app/immutable/chunks/BMRk7WTg.js","_app/immutable/chunks/Dt4wv1ei.js","_app/immutable/nodes/1.DFtas2MP.js","_app/immutable/chunks/DKRuQnts.js","_app/immutable/chunks/ChnYctHm.js","_app/immutable/nodes/2.BZoTn0Qw.js","_app/immutable/chunks/vL8MaPP-.js","_app/immutable/chunks/CS5Tuebd.js","_app/immutable/assets/2.BQQYIMLK.css","_app/immutable/nodes/3.CTDAi9vF.js","_app/immutable/assets/3.Dzrf4zX4.css","_app/immutable/nodes/4.DmI7a2Dc.js","_app/immutable/chunks/DNBIa2Bh.js","_app/immutable/assets/4.b2bZrlfC.css","_app/immutable/nodes/5.CFS15qnw.js","_app/immutable/assets/5.DDTZ5v3E.css","_app/immutable/nodes/6.yU_a9j7E.js","_app/immutable/assets/6.Bfx4fGBa.css","_app/immutable/nodes/7.CN50pfZX.js","_app/immutable/assets/7.DkoPrtit.css","_app/immutable/nodes/8.Bs7k9fxR.js","_app/immutable/chunks/BYEkGdSH.js","_app/immutable/assets/RoomCanvas.DJ9xbYNe.css","_app/immutable/assets/8.DigLoqRm.css","_app/immutable/nodes/9.wReU4Q8t.js","_app/immutable/assets/9.C7KB5jd4.css","_app/immutable/nodes/10.BLeYuhst.js","_app/immutable/assets/10.BhkUjvVr.css","_app/immutable/nodes/11.DB6yXGVc.js","_app/immutable/assets/11.LkBq3xGq.css","_app/immutable/nodes/12.5DAleB6K.js","_app/immutable/assets/12.BboNMIwd.css"])))=>i.map(i=>d[i]); -import{$ as e,B as t,C as n,D as r,F as i,H as a,I as o,J as s,L as c,M as l,N as u,V as d,Y as f,_ as p,b as m,i as h,j as g,k as _,n as v,p as y,r as b,s as x,v as S,x as C,y as w}from"../chunks/egdMPJ-g.js";import{t as T}from"../chunks/DXhpcOT6.js";import"../chunks/BMRk7WTg.js";var E={},D=C(`
`),O=C(` `,1);function k(b,C){f(C,!0);let T=h(C,`components`,23,()=>[]),E=h(C,`data_0`,3,null),k=h(C,`data_1`,3,null),A=h(C,`data_2`,3,null);u(()=>C.stores.page.set(C.page)),l(()=>{C.stores,C.page,C.constructors,T(),C.form,E(),k(),A(),C.stores.page.notify()});let j=d(!1),M=d(!1),N=d(null);v(()=>{let e=C.stores.page.subscribe(()=>{r(j)&&(t(M,!0),_().then(()=>{t(N,document.title||`untitled page`,!0)}))});return t(j,!0),e});let P=a(()=>C.constructors[2]);var F=O(),I=o(F),L=e=>{let t=a(()=>C.constructors[0]);var n=m();y(o(n),()=>r(t),(e,t)=>{x(t(e,{get data(){return E()},get form(){return C.form},get params(){return C.page.params},children:(e,t)=>{var n=m(),i=o(n),s=e=>{let t=a(()=>C.constructors[1]);var n=m();y(o(n),()=>r(t),(e,t)=>{x(t(e,{get data(){return k()},get form(){return C.form},get params(){return C.page.params},children:(e,t)=>{var n=m();y(o(n),()=>r(P),(e,t)=>{x(t(e,{get data(){return A()},get form(){return C.form},get params(){return C.page.params}}),e=>T()[2]=e,()=>T()?.[2])}),w(e,n)},$$slots:{default:!0}}),e=>T()[1]=e,()=>T()?.[1])}),w(e,n)},c=e=>{let t=a(()=>C.constructors[1]);var n=m();y(o(n),()=>r(t),(e,t)=>{x(t(e,{get data(){return k()},get form(){return C.form},get params(){return C.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),w(e,n)};p(i,e=>{C.constructors[2]?e(s):e(c,-1)}),w(e,n)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),w(e,n)},R=e=>{let t=a(()=>C.constructors[0]);var n=m();y(o(n),()=>r(t),(e,t)=>{x(t(e,{get data(){return E()},get form(){return C.form},get params(){return C.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),w(e,n)};p(I,e=>{C.constructors[1]?e(L):e(R,-1)});var z=c(I,2),B=t=>{var a=D(),o=i(a),s=e=>{var t=n();g(()=>S(t,r(N))),w(e,t)};p(o,e=>{r(M)&&e(s)}),e(a),w(t,a)};p(z,e=>{r(j)&&e(B)}),w(b,F),s()}var A=b(k),j=[()=>T(()=>import(`../nodes/0.Ddm7H9s-.js`),__vite__mapDeps([0,1,2,3])),()=>T(()=>import(`../nodes/1.DFtas2MP.js`),__vite__mapDeps([4,1,5,6,2])),()=>T(()=>import(`../nodes/2.BZoTn0Qw.js`),__vite__mapDeps([7,1,5,6,8,2,3,9,10])),()=>T(()=>import(`../nodes/3.CTDAi9vF.js`),__vite__mapDeps([11,1,5,6,8,2,3,9,12])),()=>T(()=>import(`../nodes/4.DmI7a2Dc.js`),__vite__mapDeps([13,1,2,14,6,9,15])),()=>T(()=>import(`../nodes/5.CFS15qnw.js`),__vite__mapDeps([16,1,2,14,6,9,17])),()=>T(()=>import(`../nodes/6.yU_a9j7E.js`),__vite__mapDeps([18,1,2,14,6,9,19])),()=>T(()=>import(`../nodes/7.CN50pfZX.js`),__vite__mapDeps([20,1,2,14,6,9,21])),()=>T(()=>import(`../nodes/8.Bs7k9fxR.js`),__vite__mapDeps([22,1,2,23,24,14,6,9,25])),()=>T(()=>import(`../nodes/9.wReU4Q8t.js`),__vite__mapDeps([26,1,2,23,24,14,6,9,27])),()=>T(()=>import(`../nodes/10.BLeYuhst.js`),__vite__mapDeps([28,1,2,14,6,9,29])),()=>T(()=>import(`../nodes/11.DB6yXGVc.js`),__vite__mapDeps([30,1,5,6,8,2,3,14,9,31])),()=>T(()=>import(`../nodes/12.5DAleB6K.js`),__vite__mapDeps([32,1,5,6,2,23,24,14,9,33]))],M=[],N={"/":[3],"/admin":[4,[2]],"/admin/attendance":[5,[2]],"/admin/courses":[6,[2]],"/admin/export":[7,[2]],"/admin/notes":[8,[2]],"/admin/rooms":[9,[2]],"/admin/sessions":[10,[2]],"/login":[11],"/s/[code]":[12]},P={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},F=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.decode])),I=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.encode])),L=!1,R=(e,t)=>F[e](t);export{R as decode,F as decoders,N as dictionary,I as encoders,L as hash,P as hooks,E as matchers,j as nodes,A as root,M as server_loads}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/entry/start.DNbyqWQO.js b/frontend/.svelte-kit/output/client/_app/immutable/entry/start.DNbyqWQO.js deleted file mode 100644 index f459778..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/entry/start.DNbyqWQO.js +++ /dev/null @@ -1 +0,0 @@ -import{n as e,s as t}from"../chunks/DKRuQnts.js";export{t as load_css,e as start}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/0.Ddm7H9s-.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/0.Ddm7H9s-.js deleted file mode 100644 index 0bee457..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/0.Ddm7H9s-.js +++ /dev/null @@ -1 +0,0 @@ -import{I as e,b as t,m as n,y as r}from"../chunks/egdMPJ-g.js";import"../chunks/BMRk7WTg.js";import"../chunks/Dt4wv1ei.js";function i(i,a){var o=t();n(e(o),a,`default`,{},null),r(i,o)}export{i as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/1.DFtas2MP.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/1.DFtas2MP.js deleted file mode 100644 index fc3a4d6..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/1.DFtas2MP.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,F as t,I as n,J as r,L as i,Y as a,j as o,v as s,x as c,y as l}from"../chunks/egdMPJ-g.js";import{a as u,i as d,r as f}from"../chunks/DKRuQnts.js";import"../chunks/BMRk7WTg.js";var p={get data(){return u.data},get error(){return u.error},get form(){return u.form},get params(){return u.params},get route(){return u.route},get state(){return u.state},get status(){return u.status},get url(){return u.url}};Object.defineProperty({get from(){return d.current?d.current.from:null},get to(){return d.current?d.current.to:null},get type(){return d.current?d.current.type:null},get willUnload(){return d.current?d.current.willUnload:null},get delta(){return d.current?d.current.delta:null},get complete(){return d.current?d.current.complete:null}},`current`,{get(){throw Error(`Replace navigating.current. with navigating.`)}}),f.updated.check;var m=p,h=c(`

`,1);function g(c,u){a(u,!0);var d=h(),f=n(d),p=t(f,!0);e(f);var g=i(f,2),_=t(g,!0);e(g),o(()=>{s(p,m.status),s(_,m.error?.message)}),l(c,d),r()}export{g as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/10.BLeYuhst.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/10.BLeYuhst.js deleted file mode 100644 index 87f7072..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/10.BLeYuhst.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,F as r,I as i,J as a,L as o,M as s,R as c,T as l,V as u,Y as d,_ as f,c as p,d as m,g as h,h as g,j as _,l as v,n as y,v as b,w as x,x as S,y as C}from"../chunks/egdMPJ-g.js";import"../chunks/BMRk7WTg.js";import{t as w}from"../chunks/DNBIa2Bh.js";var T=S(``),E=S(`
`),D=S(`
`),O=S(``),k=S(``),A=S(`

Schedule Sessions & Slots

Add Session

`,1);function j(x,S){d(S,!0);let j=u(c([])),M=u(null),N=u(c([])),P=u(c([])),F=u(1),I=u(c(new Date().toISOString().split(`T`)[0])),L=u(null),R=u(null),z=u(null),B=u(`09:00`),V=u(`11:00`);y(async()=>{t(j,await w.admin.courses.list(),!0),t(N,await w.admin.rooms.list(),!0),n(j).length>0&&t(M,n(j)[0].id,!0)}),s(()=>{n(M)&&H(n(M))});async function H(e){t(P,await w.admin.sessions.list(e),!0)}async function U(){if(n(M))try{await w.admin.sessions.create(n(M),n(F),n(I)),H(n(M))}catch(e){alert(e)}}async function ee(){if(!(!n(L)||!n(R)))try{await w.admin.slots.create(n(L),n(R),n(B),n(V),n(z)||void 0),n(M)&&H(n(M)),t(L,null)}catch(e){alert(e)}}async function te(e){if(confirm(`Are you sure?`))try{await w.admin.slots.delete(e),n(M)&&H(n(M))}catch(e){alert(e)}}var W=A(),G=o(i(W),2),K=r(G),q=r(K),J=o(r(q),2);g(J,21,()=>n(j),h,(t,i)=>{var a=T(),o=r(a,!0);e(a);var s={};_(()=>{b(o,n(i).name),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),C(t,a)}),e(J),e(q);var Y=o(q,2),X=o(r(Y),2),Z=r(X);v(Z);var Q=o(Z,2);v(Q);var ne=o(Q,2);e(X),e(Y);var $=o(Y,2);g($,21,()=>n(P),h,(i,a)=>{var s=D(),c=r(s),u=r(c),d=r(u);e(u);var f=o(u),p=o(f);e(c);var m=o(c,2);g(m,21,()=>n(a).slots||[],h,(t,i)=>{var a=E(),s=r(a),c=r(s);e(s);var u=o(s,2);e(a),_(()=>b(c,`${n(i).start_time??``}-${n(i).end_time??``}`)),l(`click`,u,()=>te(n(i).id)),C(t,a)}),e(m),e(s),_(()=>{b(d,`Week ${n(a).week_nr??``}`),b(f,` (${n(a).date??``}) `)}),l(`click`,p,()=>t(L,n(a).id,!0)),C(i,s)}),e($),e(K);var re=o(K,2),ie=i=>{var a=k(),s=r(a),c=o(r(s),2),u=o(r(c),2);v(u),e(c);var d=o(c,2),f=o(r(d),2),y=r(f);y.value=(y.__value=null,``),g(o(y),17,()=>n(N),h,(t,i)=>{var a=O(),o=r(a,!0);e(a);var s={};_(()=>{b(o,n(i).name),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),C(t,a)}),e(f),e(d);var x=o(d,2),S=o(r(x),2);v(S),e(x);var w=o(x,2),T=o(r(w),2);v(T),e(w);var E=o(w,2),D=r(E),A=o(D,2);e(E),e(s),e(a),p(u,()=>n(R),e=>t(R,e)),m(f,()=>n(z),e=>t(z,e)),p(S,()=>n(B),e=>t(B,e)),p(T,()=>n(V),e=>t(V,e)),l(`click`,D,()=>t(L,null)),l(`click`,A,ee),C(i,a)};f(re,e=>{n(L)&&e(ie)}),e(G),m(J,()=>n(M),e=>t(M,e)),p(Z,()=>n(F),e=>t(F,e)),p(Q,()=>n(I),e=>t(I,e)),l(`click`,ne,U),C(x,W),a()}x([`click`]);export{j as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/11.DB6yXGVc.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/11.DB6yXGVc.js deleted file mode 100644 index 295aa47..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/11.DB6yXGVc.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,E as r,F as i,J as a,L as o,Y as s,_ as c,a as l,c as u,j as d,l as f,o as p,v as m,x as h,y as g,z as _}from"../chunks/egdMPJ-g.js";import{t as v}from"../chunks/DKRuQnts.js";import"../chunks/BMRk7WTg.js";import"../chunks/Dt4wv1ei.js";import{n as y}from"../chunks/CS5Tuebd.js";import"../chunks/vL8MaPP-.js";import{t as b}from"../chunks/DNBIa2Bh.js";var x=h(`

`),S=h(``);function C(h,C){s(C,!1);let w=_(``),T=_(``),E=_(``),D=_(!1);async function O(){t(D,!0),t(E,``);try{let e=await b.auth.login(n(w),n(T));y.set(e.token),v(`/admin`)}catch(e){t(E,e.message||`Invalid credentials`)}finally{t(D,!1)}}l();var k=S(),A=o(i(k),2),j=i(A),M=o(i(j),2);f(M),e(j);var N=o(j,2),P=o(i(N),2);f(P),e(N);var F=o(N,2),I=t=>{var r=x(),a=i(r,!0);e(r),d(()=>m(a,n(E))),g(t,r)};c(F,e=>{n(E)&&e(I)});var L=o(F,2),R=i(L,!0);e(L),e(A),e(k),d(()=>{L.disabled=n(D),m(R,n(D)?`Logging in...`:`Login`)}),u(M,()=>n(w),e=>t(w,e)),u(P,()=>n(T),e=>t(T,e)),r(`submit`,A,p(O)),g(h,k),a()}export{C as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/12.5DAleB6K.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/12.5DAleB6K.js deleted file mode 100644 index c977ec9..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/12.5DAleB6K.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,F as r,H as i,I as a,J as o,L as s,R as c,U as l,V as u,W as d,Y as f,_ as p,d as m,g as h,h as g,j as _,n as v,v as y,x as b,y as x}from"../chunks/egdMPJ-g.js";import{r as S}from"../chunks/DKRuQnts.js";import"../chunks/BMRk7WTg.js";import{t as C}from"../chunks/DNBIa2Bh.js";import{t as w}from"../chunks/BYEkGdSH.js";var T=()=>{let e=S;return{page:{subscribe:e.page.subscribe},navigating:{subscribe:e.navigating.subscribe},updated:e.updated}},E={subscribe(e){return T().page.subscribe(e)}},D=b(`

Loading...

`),O=b(`

`),k=b(`

Check-in is currently locked by the tutor.

`),A=b(``),j=b(`
`),M=b(`

You are checked in as

`),N=b(`

Select a seat to check in:

`,1),P=b(`
`);function F(b,S){f(S,!0);let T=()=>d(E,`$page`,F),[F,I]=l(),L=T().params.code,R=u(null),z=u(c([])),B=u(c([])),V=u(c([])),H=u(null),U=i(()=>n(B).find(e=>e.is_mine)),W=u(!0),G=u(``);v(async()=>{try{await K(),!n(U)&&n(R)?.status===`open`&&t(V,await C.checkin.getStudents(L),!0)}catch(e){t(G,e.message,!0)}finally{t(W,!1)}});async function K(){let e=await C.checkin.getInfo(L);t(R,e.slot,!0),t(z,e.layout||[],!0),t(B,e.attendances||[],!0)}async function q(e){if(!n(R)||n(R).status!==`open`||e.type!==`seat`||n(U)?.seat_id===e.id)return;let t=n(U)?.student_id||n(H);if(!t){alert(`Please select your name first`);return}try{await C.checkin.post(L,t,e.id),await K()}catch(e){alert(e.message)}}let J=i(()=>n(B).map(e=>e.seat_id).filter(e=>e!==null));var Y=P(),X=r(Y),Z=e=>{x(e,D())},Q=t=>{var i=O(),a=r(i,!0);e(i),_(()=>y(a,n(G))),x(t,i)},$=o=>{var c=N(),l=a(c),u=r(l);e(l);var d=s(l,2),f=e=>{x(e,k())};p(d,e=>{n(R).status===`locked`&&e(f)});var v=s(d,2),b=i=>{var a=j(),o=s(r(a),2),c=r(o);c.value=(c.__value=null,``),g(s(c),17,()=>n(V),h,(t,i)=>{var a=A(),o=r(a,!0);e(a);var s={};_(()=>{y(o,n(i).name),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),x(t,a)}),e(o),e(a),m(o,()=>n(H),e=>t(H,e)),x(i,a)},S=t=>{var i=M(),a=s(r(i)),o=r(a,!0);e(a),e(i),_(e=>y(o,e),[()=>n(V).find(e=>e.id===n(U).student_id)?.name||`Student`]),x(t,i)};p(v,e=>{!n(U)&&n(R).status===`open`?e(b):n(U)&&e(S,1)});var C=s(v,2),T=s(r(C),2);{let e=i(()=>n(U)?.seat_id);w(T,{get elements(){return n(z)},get occupiedSeatIds(){return n(J)},get mySeatId(){return n(e)},onElementClick:q})}e(C),_(()=>y(u,`Check-in: ${n(R).start_time??``} - ${n(R).end_time??``}`)),x(o,c)};p(X,e=>{n(W)?e(Z):n(G)?e(Q,1):n(R)&&e($,2)}),e(Y),x(b,Y),o(),I()}export{F as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/2.BZoTn0Qw.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/2.BZoTn0Qw.js deleted file mode 100644 index 55422c7..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/2.BZoTn0Qw.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,E as t,F as n,I as r,J as i,L as a,U as o,W as s,Y as c,_ as l,a as u,b as d,m as f,n as p,x as m,y as h}from"../chunks/egdMPJ-g.js";import{t as g}from"../chunks/DKRuQnts.js";import"../chunks/BMRk7WTg.js";import"../chunks/Dt4wv1ei.js";import{n as _,t as v}from"../chunks/CS5Tuebd.js";import"../chunks/vL8MaPP-.js";var y=m(`
`,1);function b(m,b){c(b,!1);let x=()=>s(_,`$token`,S),[S,C]=o();p(()=>{x()||g(`/login`)});function w(){v(),g(`/login`)}u();var T=d(),E=r(T),D=i=>{var o=y(),s=r(o),c=n(s),l=a(n(c),2);e(c),e(s);var u=a(s,2);f(n(u),b,`default`,{},null),e(u),t(`click`,l,w),h(i,o)};l(E,e=>{x()&&e(D)}),h(m,T),i(),C()}export{b as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/3.CTDAi9vF.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/3.CTDAi9vF.js deleted file mode 100644 index b4010da..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/3.CTDAi9vF.js +++ /dev/null @@ -1 +0,0 @@ -import{J as e,U as t,W as n,Y as r,a as i,n as a,x as o,y as s}from"../chunks/egdMPJ-g.js";import{t as c}from"../chunks/DKRuQnts.js";import"../chunks/BMRk7WTg.js";import"../chunks/Dt4wv1ei.js";import{n as l}from"../chunks/CS5Tuebd.js";import"../chunks/vL8MaPP-.js";var u=o(`

FPTutor Attendance

Efficiently tracking attendance and student observations.

`);function d(o,d){r(d,!1);let f=()=>n(l,`$token`,p),[p,m]=t();a(()=>{f()&&c(`/admin`)}),i(),s(o,u()),e(),m()}export{d as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/4.DmI7a2Dc.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/4.DmI7a2Dc.js deleted file mode 100644 index c24e10d..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/4.DmI7a2Dc.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,F as r,I as i,J as a,L as o,M as s,R as c,T as l,V as u,Y as d,_ as f,b as p,d as m,f as h,g,h as _,j as v,n as y,v as b,w as x,x as S,y as C}from"../chunks/egdMPJ-g.js";import"../chunks/BMRk7WTg.js";import{t as w}from"../chunks/DNBIa2Bh.js";var T=S(``),E=S(`

Loading sessions...

`),D=S(` `),O=S(``),k=S(` `,1),A=S(` `,1),j=S(`
`),M=S(`

No slots scheduled.

`),N=S(`

`),P=S(`
`),F=S(`

Admin Dashboard

`,1);function I(x,S){d(S,!0);let I=u(c([])),L=u(null),R=u(c([])),z=u(!1);y(async()=>{t(z,!0);try{t(I,await w.admin.courses.list(),!0),n(I).length>0&&t(L,n(I)[0].id,!0)}catch(e){console.error(e)}finally{t(z,!1)}}),s(()=>{n(L)!==null&&B(n(L))});async function B(e){t(z,!0);try{t(R,await w.admin.sessions.list(e),!0)}catch(e){console.error(e)}finally{t(z,!1)}}async function V(e,t){try{await w.admin.slots.updateStatus(e,t),n(L)&&B(n(L))}catch(e){alert(e)}}function H(e){let t=`${window.location.origin}/s/${e}`;navigator.clipboard.writeText(t),alert(`Link copied to clipboard`)}var U=F(),W=o(i(U),2),G=o(r(W),2);_(G,21,()=>n(I),g,(t,i)=>{var a=T(),o=r(a);e(a);var s={};v(()=>{b(o,`${n(i).name??``} (${n(i).semester??``})`),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),C(t,a)}),e(G),e(W);var K=o(W,2),q=e=>{C(e,E())},J=t=>{var a=P();_(a,21,()=>n(R),g,(t,a)=>{var s=N(),c=r(s),u=r(c);e(c);var d=o(c,2),m=r(d),y=t=>{var s=p();_(i(s),17,()=>n(a).slots,g,(t,a)=>{var s=j(),c=r(s),u=r(c),d=r(u,!0);e(u);var p=o(u,2),m=r(p);e(p);var g=o(p,2),_=t=>{var i=D(),o=r(i,!0);e(i),v(()=>b(o,n(a).code)),C(t,i)};f(g,e=>{n(a).code&&e(_)}),e(c);var y=o(c,2),x=r(y),S=e=>{var t=O();l(`click`,t,()=>V(n(a).id,`open`)),C(e,t)},w=e=>{var t=k(),r=i(t),s=o(r,2),c=o(s,2);l(`click`,r,()=>H(n(a).code)),l(`click`,s,()=>V(n(a).id,`locked`)),l(`click`,c,()=>V(n(a).id,`closed`)),C(e,t)},T=e=>{var t=A(),r=i(t),s=o(r,2);l(`click`,r,()=>V(n(a).id,`open`)),l(`click`,s,()=>V(n(a).id,`closed`)),C(e,t)};f(x,e=>{n(a).status===`closed`?e(S):n(a).status===`open`?e(w,1):n(a).status===`locked`&&e(T,2)}),e(y),e(s),v(()=>{h(u,1,`status-badge ${n(a).status??``}`,`svelte-1jef3w8`),b(d,n(a).status),b(m,`${n(a).start_time??``} - ${n(a).end_time??``}`)}),C(t,s)}),C(t,s)},x=e=>{C(e,M())};f(m,e=>{n(a).slots&&n(a).slots.length>0?e(y):e(x,-1)}),e(d),e(s),v(()=>b(u,`Week ${n(a).week_nr??``} - ${n(a).date??``}`)),C(t,s)}),e(a),C(t,a)};f(K,e=>{n(z)&&n(R).length===0?e(q):e(J,-1)}),m(G,()=>n(L),e=>t(L,e)),C(x,U),a()}x([`click`]);export{I as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/5.CFS15qnw.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/5.CFS15qnw.js deleted file mode 100644 index c6343af..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/5.CFS15qnw.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,F as r,H as i,I as a,J as o,L as s,M as c,R as l,T as u,V as d,Y as f,_ as p,d as m,f as h,g,h as _,j as v,n as y,v as b,w as x,x as S,y as C}from"../chunks/egdMPJ-g.js";import"../chunks/BMRk7WTg.js";import{t as w}from"../chunks/DNBIa2Bh.js";var T=S(``),E=S(``),D=S(``),O=S(` `),k=S(` `),A=S(` `),j=S(`
Student
`),M=S(`

Loading matrix...

`),N=S(`

Attendance Matrix

`,1);function P(x,S){f(S,!0);let P=d(l([])),F=d(null),I=d(l([])),L=d(null),R=d(null);y(async()=>{t(P,await w.admin.courses.list(),!0),n(P).length>0&&t(F,n(P)[0].id,!0)}),c(()=>{n(F)&&w.admin.sessions.list(n(F)).then(e=>{t(I,e,!0),n(I).length>0&&t(L,n(I)[0].id,!0)})}),c(()=>{n(L)&&w.admin.sessions.getAttendance(n(L)).then(e=>t(R,e,!0))});async function z(e,r){if(!n(R))return;let i=n(R).attendances.find(t=>t.slot_id===e&&t.student_id===r);try{i?await w.admin.slots.deleteAttendance(e,r):await w.admin.slots.addAttendance(e,r),t(R,await w.admin.sessions.getAttendance(n(L)),!0)}catch(e){alert(e)}}var B=N(),V=s(a(B),2),H=r(V);_(H,21,()=>n(P),g,(t,i)=>{var a=T(),o=r(a,!0);e(a);var s={};v(()=>{b(o,n(i).name),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),C(t,a)}),e(H);var U=s(H,2),W=i=>{var a=D();_(a,21,()=>n(I),g,(t,i)=>{var a=E(),o=r(a);e(a);var s={};v(()=>{b(o,`Week ${n(i).week_nr??``} (${n(i).date??``})`),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),C(t,a)}),e(a),m(a,()=>n(L),e=>t(L,e)),C(i,a)};p(U,e=>{n(I).length>0&&e(W)}),e(V);var G=s(V,2),K=t=>{var a=j(),o=r(a),c=r(o),l=r(c);_(s(r(l)),17,()=>n(R).slots,g,(t,i)=>{var a=O(),o=r(a,!0);e(a),v(()=>b(o,n(i).start_time)),C(t,a)}),e(l),e(c);var d=s(c);_(d,21,()=>n(R).students,g,(t,a)=>{var o=A(),c=r(o),l=r(c,!0);e(c),_(s(c),17,()=>n(R).slots,g,(t,o)=>{let s=i(()=>n(R).attendances.some(e=>e.slot_id===n(o).id&&e.student_id===n(a).id));var c=k();let l;var d=r(c,!0);e(c),v(()=>{l=h(c,1,`cell svelte-190s2eg`,null,l,{present:n(s)}),b(d,n(s)?`✓`:``)}),u(`click`,c,()=>z(n(o).id,n(a).id)),C(t,c)}),e(o),v(()=>b(l,n(a).name)),C(t,o)}),e(d),e(o),e(a),C(t,a)},q=e=>{C(e,M())};p(G,e=>{n(R)?e(K):e(q,-1)}),m(H,()=>n(F),e=>t(F,e)),C(x,B),o()}x([`click`]);export{P as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/6.yU_a9j7E.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/6.yU_a9j7E.js deleted file mode 100644 index 34bfd1a..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/6.yU_a9j7E.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,E as r,F as i,H as a,I as o,J as s,L as c,M as l,Q as u,R as d,T as f,V as p,Y as m,_ as h,c as g,f as _,g as v,h as y,j as b,l as x,n as S,s as C,v as w,w as T,x as E,y as D}from"../chunks/egdMPJ-g.js";import"../chunks/BMRk7WTg.js";import{t as O}from"../chunks/DNBIa2Bh.js";var k=E(`
`),A=E(` `),j=E(`

Import CSV (name header):
IDNameActions
`,1),M=E(`

Select a course to manage students.

`),N=E(`

Courses & Students

Manage Courses

`,1);function P(T,E){m(E,!0);let P=p(d([])),F=p(null),I=p(d([])),L=p(``),R=p(``),z=p(``);S(async()=>{await B()});async function B(){t(P,await O.admin.courses.list(),!0),n(P).length>0&&n(F)===null&&t(F,n(P)[0].id,!0)}l(()=>{n(F)!==null&&V(n(F))});async function V(e){t(I,await O.admin.courses.listStudents(e),!0)}async function H(){try{let e=await O.admin.courses.create(n(L),n(R));t(L,``),t(R,``),await B(),t(F,e.id,!0)}catch(e){alert(e)}}async function U(){if(n(F))try{await O.admin.courses.addStudent(n(F),n(z)),t(z,``),await V(n(F))}catch(e){alert(e)}}async function W(e){if(confirm(`Are you sure?`))try{await O.admin.students.delete(e),n(F)&&await V(n(F))}catch(e){alert(e)}}let G;async function ee(){if(!(!n(F)||!G.files?.[0]))try{await O.admin.courses.importStudents(n(F),G.files[0]),await V(n(F)),G.value=``}catch(e){alert(e)}}var K=N(),q=c(o(K),2),J=i(q),Y=c(i(J),2),X=i(Y);x(X);var Z=c(X,2);x(Z),u(2),e(Y);var Q=c(Y,2);y(Q,21,()=>n(P),v,(r,a)=>{var o=k();let s;var l=i(o),u=i(l,!0);e(l);var d=c(l);e(o),b(()=>{s=_(o,1,`course-item svelte-nbog41`,null,s,{selected:n(F)===n(a).id}),w(u,n(a).name),w(d,` (${n(a).semester??``})`)}),f(`click`,o,()=>t(F,n(a).id,!0)),D(r,o)}),e(Q),e(J);var $=c(J,2),te=i($),ne=s=>{let l=a(()=>n(P).find(e=>e.id===n(F)));var d=j(),p=o(d),m=i(p);e(p);var h=c(p,2),_=i(h),S=i(_);x(S),u(2),e(_);var T=c(_,2),E=c(i(T),2);C(E,e=>G=e,()=>G),e(T),e(h);var O=c(h,2),k=c(i(O));y(k,21,()=>n(I),v,(t,r)=>{var a=A(),o=i(a),s=i(o,!0);e(o);var l=c(o),u=i(l,!0);e(l);var d=c(l),p=i(d);e(d),e(a),b(()=>{w(s,n(r).id),w(u,n(r).name)}),f(`click`,p,()=>W(n(r).id)),D(t,a)}),e(k),e(O),b(()=>w(m,`Students in ${n(l)?.name??``}`)),r(`submit`,_,U),g(S,()=>n(z),e=>t(z,e)),f(`change`,E,ee),D(s,d)},re=e=>{D(e,M())};h(te,e=>{n(F)?e(ne):e(re,-1)}),e($),e(q),r(`submit`,Y,H),g(X,()=>n(L),e=>t(L,e)),g(Z,()=>n(R),e=>t(R,e)),D(T,K),s()}T([`click`,`change`]);export{P as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/7.CN50pfZX.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/7.CN50pfZX.js deleted file mode 100644 index 33a0c12..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/7.CN50pfZX.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,F as r,I as i,J as a,L as o,M as s,R as c,T as l,V as u,Y as d,_ as f,d as p,g as m,h,j as g,n as _,v,w as y,x as b,y as x}from"../chunks/egdMPJ-g.js";import"../chunks/BMRk7WTg.js";import{t as S}from"../chunks/DNBIa2Bh.js";var C=b(``),w=b(`
`),T=b(`

Full Attendance Matrix

All weeks, all students, includes bonus point calculation.

Weekly Exports

`,1),E=b(`

Export Data

Global

Full Database Backup

Download the latest SQLite database file.

Per Course

`,1);function D(y,b){d(b,!0);let D=u(c([])),O=u(null),k=u(c([]));_(async()=>{t(D,await S.admin.courses.list(),!0),n(D).length>0&&t(O,n(D)[0].id,!0)}),s(()=>{n(O)&&S.admin.sessions.list(n(O)).then(e=>t(k,e,!0))});var A=E(),j=o(i(A),2),M=r(j),N=o(r(M),2),P=o(r(N),4);e(N),e(M);var F=o(M,2),I=o(r(F),2);h(I,21,()=>n(D),m,(t,i)=>{var a=C(),o=r(a,!0);e(a);var s={};g(()=>{v(o,n(i).name),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),x(t,a)}),e(I);var L=o(I,2),R=t=>{var a=T(),s=i(a),c=o(r(s),4),u=r(c),d=o(u,2);e(c),e(s);var f=o(s,4);h(f,21,()=>n(k),m,(t,i)=>{var a=w(),s=r(a),c=r(s);e(s);var u=o(s,2),d=r(u),f=o(d,2);e(u),e(a),g(()=>v(c,`Week ${n(i).week_nr??``} (${n(i).date??``})`)),l(`click`,d,()=>window.open(S.admin.export.sessionCsv(n(i).id),`_blank`)),l(`click`,f,()=>window.open(S.admin.export.sessionMd(n(i).id),`_blank`)),x(t,a)}),e(f),l(`click`,u,()=>window.open(S.admin.export.courseCsv(n(O)),`_blank`)),l(`click`,d,()=>window.open(S.admin.export.courseMd(n(O)),`_blank`)),x(t,a)};f(L,e=>{n(O)&&e(R)}),e(F),e(j),l(`click`,P,()=>window.open(S.admin.export.backup(),`_blank`)),p(I,()=>n(O),e=>t(O,e)),x(y,A),a()}y([`click`]);export{D as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/8.Bs7k9fxR.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/8.Bs7k9fxR.js deleted file mode 100644 index 933a881..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/8.Bs7k9fxR.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,F as r,H as i,I as a,J as o,L as s,M as c,P as l,R as u,T as d,V as f,Y as p,_ as m,c as ee,d as h,g,h as _,j as v,n as y,v as b,w as x,x as S,y as C}from"../chunks/egdMPJ-g.js";import"../chunks/BMRk7WTg.js";import{t as w}from"../chunks/DNBIa2Bh.js";import{t as T}from"../chunks/BYEkGdSH.js";var E=S(``),te=S(``),ne=S(``),D=S(` `,1),re=S(`

Select a seat occupied by a student to leave a note.

`),O=S(`

`,1),k=S(`

Click a seat on the map to add or view notes.

`),A=S(`

`),ie=S(`

Seat Notes

Recent Notes

`,1);function j(x,S){p(S,!0);let j=f(u([])),M=f(null),N=f(u([])),P=f(null),F=f(u([])),I=f(null),L=f(u([])),R=f(u([])),z=f(u([])),B=f(u([]));y(async()=>{t(j,await w.admin.courses.list(),!0),n(j).length>0&&t(M,n(j)[0].id,!0)}),c(()=>{n(M)&&(w.admin.sessions.list(n(M)).then(e=>{t(N,e,!0),n(N).length>0&&t(P,n(N)[0].id,!0)}),w.admin.courses.listStudents(n(M)).then(e=>t(z,e,!0)))}),c(()=>{n(P)&&(t(F,n(N).find(e=>e.id===n(P))?.slots||[],!0),n(F).length>0&&t(I,n(F)[0].id,!0))}),c(()=>{if(n(I)){let e=n(F).find(e=>e.id===n(I));e?.room_id?w.admin.rooms.get(e.room_id).then(e=>t(L,e.layout,!0)):t(L,[],!0),w.admin.slots.getNotes(n(I)).then(e=>t(R,e,!0)),w.admin.sessions.getAttendance(n(P)).then(e=>{t(B,e.attendances.filter(e=>e.slot_id===n(I)),!0)})}});let V=f(null),H=f(``);function ae(e){if(e.type!==`seat`)return;t(V,e.id,!0);let r=n(B).find(t=>t.seat_id===e.id)?.student_id;r?t(H,n(R).find(e=>e.student_id===r)?.content||``,!0):t(H,``)}async function oe(){if(!n(I)||!n(V))return;let e=n(B).find(e=>e.seat_id===n(V))?.student_id;if(!e){alert(`No student at this seat`);return}try{await w.admin.slots.upsertNote(n(I),e,n(H)),t(R,await w.admin.slots.getNotes(n(I)),!0),t(V,null)}catch(e){alert(e)}}let U=i(()=>{let e={};return n(B).forEach(t=>{if(t.seat_id){let r=n(z).find(e=>e.id===t.student_id);e[t.seat_id]=r?.name||`Unknown`}}),e}),se=i(()=>n(B).map(e=>e.seat_id).filter(e=>e!==null));var W=ie(),G=s(a(W),2),K=r(G);_(K,21,()=>n(j),g,(t,i)=>{var a=E(),o=r(a,!0);e(a);var s={};v(()=>{b(o,n(i).name),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),C(t,a)}),e(K);var q=s(K,2);_(q,21,()=>n(N),g,(t,i)=>{var a=te(),o=r(a);e(a);var s={};v(()=>{b(o,`Week ${n(i).week_nr??``}`),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),C(t,a)}),e(q);var J=s(q,2);_(J,21,()=>n(F),g,(t,i)=>{var a=ne(),o=r(a);e(a);var s={};v(()=>{b(o,`${n(i).start_time??``} - ${n(i).end_time??``}`),s!==(s=n(i).id)&&(a.value=(a.__value=n(i).id)??``)}),C(t,a)}),e(J),e(G);var Y=s(G,2),X=r(Y);T(r(X),{get elements(){return n(L)},get occupiedSeatIds(){return n(se)},get selectedId(){return n(V)},get studentNames(){return n(U)},onElementClick:ae}),e(X);var Z=s(X,2),Q=r(Z),ce=o=>{let c=i(()=>n(U)[n(V)]);var u=O(),f=a(u),p=r(f);e(f);var h=s(f,2),g=e=>{var r=D(),i=a(r);l(i);var o=s(i,2);ee(i,()=>n(H),e=>t(H,e)),d(`click`,o,oe),C(e,r)},_=e=>{C(e,re())};m(h,e=>{n(c)?e(g):e(_,-1)});var y=s(h,2);v(()=>b(p,`Note for ${(n(c)||`Empty Seat`)??``}`)),d(`click`,y,()=>t(V,null)),C(o,u)},le=e=>{C(e,k())};m(Q,e=>{n(V)?e(ce):e(le,-1)});var $=s(Q,2);_(s(r($),2),17,()=>n(R),g,(t,i)=>{var a=A(),o=r(a),c=r(o);e(o);var l=s(o,2),u=r(l,!0);e(l),e(a),v(e=>{b(c,`${e??``}:`),b(u,n(i).content)},[()=>n(z).find(e=>e.id===n(i).student_id)?.name]),C(t,a)}),e($),e(Z),e(Y),h(K,()=>n(M),e=>t(M,e)),h(q,()=>n(P),e=>t(P,e)),h(J,()=>n(I),e=>t(I,e)),C(x,W),o()}x([`click`]);export{j as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/immutable/nodes/9.wReU4Q8t.js b/frontend/.svelte-kit/output/client/_app/immutable/nodes/9.wReU4Q8t.js deleted file mode 100644 index 31fc7bf..0000000 --- a/frontend/.svelte-kit/output/client/_app/immutable/nodes/9.wReU4Q8t.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,B as t,D as n,E as r,F as i,H as a,I as o,J as s,L as c,M as l,Q as u,R as d,T as f,V as p,Y as m,_ as h,c as g,f as _,g as v,h as y,j as b,l as x,n as S,v as C,w,x as T,y as E}from"../chunks/egdMPJ-g.js";import"../chunks/BMRk7WTg.js";import{t as D}from"../chunks/DNBIa2Bh.js";import{t as O}from"../chunks/BYEkGdSH.js";var k=T(`
`),A=T(`
`,1),j=T(`

Select an element to edit properties.

`),M=T(`

Properties

`,1),N=T(`

Select a room to edit its layout.

`),P=T(`

Room Layouts

Rooms

`,1);function F(w,T){m(T,!0);let F=p(d([])),I=p(null),L=p(null),R=p(``);S(async()=>{await z()});async function z(){t(F,await D.admin.rooms.list(),!0)}l(()=>{n(I)&&D.admin.rooms.get(n(I)).then(e=>t(L,e,!0))});async function B(){let e=[{id:`s1`,label:`1`,x:2,y:2,width:1,height:1,type:`seat`}];try{let r=await D.admin.rooms.create(n(R),e);t(R,``),await z(),t(I,r.id,!0)}catch(e){alert(e)}}async function V(){if(n(L))try{await D.admin.rooms.updateLayout(n(L).id,n(L).layout),alert(`Layout saved`)}catch(e){alert(e)}}function H(e){if(!n(L))return;let t={id:Math.random().toString(36).substr(2,9),label:e===`seat`?(n(L).layout.filter(e=>e.type===`seat`).length+1).toString():``,x:0,y:0,width:e===`table`?2:1,height:1,type:e};n(L).layout=[...n(L).layout,t]}let U=p(null),W=a(()=>n(L)?.layout.find(e=>e.id===n(U)));function G(){!n(L)||!n(U)||(n(L).layout=n(L).layout.filter(e=>e.id!==n(U)),t(U,null))}var K=P(),q=c(o(K),2),J=i(q),Y=c(i(J),2),X=i(Y);x(X),u(2),e(Y);var Z=c(Y,2);y(Z,21,()=>n(F),v,(r,a)=>{var o=k();let s;var c=i(o,!0);e(o),b(()=>{s=_(o,1,`room-item svelte-2e9svb`,null,s,{selected:n(I)===n(a).id}),C(c,n(a).name)}),f(`click`,o,()=>t(I,n(a).id,!0)),E(r,o)}),e(Z),e(J);var Q=c(J,2),$=i(Q),ee=r=>{var a=M(),s=o(a),l=i(s),u=i(l);e(l);var d=c(l,2),p=i(d),m=c(p,2),_=c(m,2),v=c(_,2);e(d),e(s);var y=c(s,2),S=i(y);O(S,{editable:!0,get selectedId(){return n(U)},onElementClick:e=>t(U,e.id,!0),get elements(){return n(L).layout},set elements(e){n(L).layout=e}});var w=c(S,2),T=c(i(w),2),D=t=>{var r=A(),a=o(r),s=c(i(a),2);x(s),e(a);var l=c(a,2),u=c(i(l),2);x(u),e(l);var d=c(l,2),p=c(i(d),2);x(p),e(d);var m=c(d,2);g(s,()=>n(W).label,e=>n(W).label=e),g(u,()=>n(W).width,e=>n(W).width=e),g(p,()=>n(W).height,e=>n(W).height=e),f(`click`,m,G),E(t,r)},k=e=>{E(e,j())};h(T,e=>{n(W)?e(D):e(k,-1)}),e(w),e(y),b(()=>C(u,`Editing: ${n(L).name??``}`)),f(`click`,p,()=>H(`seat`)),f(`click`,m,()=>H(`table`)),f(`click`,_,()=>H(`door`)),f(`click`,v,V),E(r,a)},te=e=>{E(e,N())};h($,e=>{n(L)?e(ee):e(te,-1)}),e(Q),e(q),r(`submit`,Y,B),g(X,()=>n(R),e=>t(R,e)),E(w,K),s()}w([`click`]);export{F as component}; \ No newline at end of file diff --git a/frontend/.svelte-kit/output/client/_app/version.json b/frontend/.svelte-kit/output/client/_app/version.json deleted file mode 100644 index ad3e10a..0000000 --- a/frontend/.svelte-kit/output/client/_app/version.json +++ /dev/null @@ -1 +0,0 @@ -{"version":"1777346369869"} \ No newline at end of file diff --git a/frontend/.svelte-kit/output/prerendered/dependencies/_app/env.js b/frontend/.svelte-kit/output/prerendered/dependencies/_app/env.js deleted file mode 100644 index f5427da..0000000 --- a/frontend/.svelte-kit/output/prerendered/dependencies/_app/env.js +++ /dev/null @@ -1 +0,0 @@ -export const env={} \ No newline at end of file diff --git a/frontend/.svelte-kit/output/server/.vite/manifest.json b/frontend/.svelte-kit/output/server/.vite/manifest.json deleted file mode 100644 index 26a459a..0000000 --- a/frontend/.svelte-kit/output/server/.vite/manifest.json +++ /dev/null @@ -1,322 +0,0 @@ -{ - ".svelte-kit/generated/server/internal.js": { - "file": "internal.js", - "name": "internal", - "src": ".svelte-kit/generated/server/internal.js", - "isEntry": true, - "imports": [ - "_environment.js", - "_internal.js" - ] - }, - "_RoomCanvas.BEv49FWI.css": { - "file": "_app/immutable/assets/RoomCanvas.BEv49FWI.css", - "src": "_RoomCanvas.BEv49FWI.css" - }, - "_RoomCanvas.js": { - "file": "chunks/RoomCanvas.js", - "name": "RoomCanvas", - "imports": [ - "_dev.js" - ], - "css": [ - "_app/immutable/assets/RoomCanvas.BEv49FWI.css" - ] - }, - "_api.js": { - "file": "chunks/api.js", - "name": "api", - "imports": [ - "_dev.js", - "_index-server2.js", - "_auth.js" - ] - }, - "_auth.js": { - "file": "chunks/auth.js", - "name": "auth", - "imports": [ - "_dev.js", - "_index-server2.js" - ] - }, - "_client.js": { - "file": "chunks/client.js", - "name": "client", - "imports": [ - "_index-server.js", - "_environment.js", - "_internal.js", - "_exports.js", - "_shared.js", - "_dev.js", - "_index-server2.js" - ] - }, - "_dev.js": { - "file": "chunks/dev.js", - "name": "dev" - }, - "_environment.js": { - "file": "chunks/environment.js", - "name": "environment" - }, - "_exports.js": { - "file": "chunks/exports.js", - "name": "exports" - }, - "_index-server.js": { - "file": "chunks/index-server.js", - "name": "index-server", - "imports": [ - "_dev.js" - ] - }, - "_index-server2.js": { - "file": "chunks/index-server2.js", - "name": "index-server", - "imports": [ - "_dev.js" - ] - }, - "_internal.js": { - "file": "chunks/internal.js", - "name": "internal", - "imports": [ - "_index-server.js", - "_environment.js", - "_dev.js" - ] - }, - "_navigation.js": { - "file": "chunks/navigation.js", - "name": "navigation", - "imports": [ - "_client.js" - ] - }, - "_shared.js": { - "file": "chunks/shared.js", - "name": "shared", - "imports": [ - "_index-server.js" - ] - }, - "_utils.js": { - "file": "chunks/utils.js", - "name": "utils", - "imports": [ - "_environment.js", - "_shared.js" - ] - }, - "node_modules/@sveltejs/kit/src/runtime/app/server/remote/index.js": { - "file": "remote-entry.js", - "name": "remote-entry", - "src": "node_modules/@sveltejs/kit/src/runtime/app/server/remote/index.js", - "isEntry": true, - "imports": [ - "_environment.js", - "_utils.js", - "_shared.js" - ] - }, - "node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte": { - "file": "entries/fallbacks/error.svelte.js", - "name": "entries/fallbacks/error.svelte", - "src": "node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_client.js", - "_dev.js" - ] - }, - "node_modules/@sveltejs/kit/src/runtime/server/index.js": { - "file": "index.js", - "name": "index", - "src": "node_modules/@sveltejs/kit/src/runtime/server/index.js", - "isEntry": true, - "imports": [ - "_environment.js", - "_internal.js", - "_utils.js", - "_exports.js", - "_shared.js", - "_dev.js", - "_index-server2.js" - ] - }, - "src/routes/+layout.svelte": { - "file": "entries/pages/_layout.svelte.js", - "name": "entries/pages/_layout.svelte", - "src": "src/routes/+layout.svelte", - "isEntry": true, - "imports": [ - "_dev.js" - ] - }, - "src/routes/+page.svelte": { - "file": "entries/pages/_page.svelte.js", - "name": "entries/pages/_page.svelte", - "src": "src/routes/+page.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_navigation.js", - "_client.js", - "_dev.js", - "_auth.js" - ], - "css": [ - "_app/immutable/assets/_page.Dzrf4zX4.css" - ] - }, - "src/routes/admin/+layout.svelte": { - "file": "entries/pages/admin/_layout.svelte.js", - "name": "entries/pages/admin/_layout.svelte", - "src": "src/routes/admin/+layout.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_navigation.js", - "_client.js", - "_dev.js", - "_auth.js" - ], - "css": [ - "_app/immutable/assets/_layout.BQQYIMLK.css" - ] - }, - "src/routes/admin/+page.svelte": { - "file": "entries/pages/admin/_page.svelte.js", - "name": "entries/pages/admin/_page.svelte", - "src": "src/routes/admin/+page.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_dev.js", - "_api.js" - ], - "css": [ - "_app/immutable/assets/_page.b2bZrlfC.css" - ] - }, - "src/routes/admin/attendance/+page.svelte": { - "file": "entries/pages/admin/attendance/_page.svelte.js", - "name": "entries/pages/admin/attendance/_page.svelte", - "src": "src/routes/admin/attendance/+page.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_dev.js", - "_api.js" - ], - "css": [ - "_app/immutable/assets/_page.DDTZ5v3E.css" - ] - }, - "src/routes/admin/courses/+page.svelte": { - "file": "entries/pages/admin/courses/_page.svelte.js", - "name": "entries/pages/admin/courses/_page.svelte", - "src": "src/routes/admin/courses/+page.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_dev.js", - "_api.js" - ], - "css": [ - "_app/immutable/assets/_page.Bfx4fGBa.css" - ] - }, - "src/routes/admin/export/+page.svelte": { - "file": "entries/pages/admin/export/_page.svelte.js", - "name": "entries/pages/admin/export/_page.svelte", - "src": "src/routes/admin/export/+page.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_dev.js", - "_api.js" - ], - "css": [ - "_app/immutable/assets/_page.DkoPrtit.css" - ] - }, - "src/routes/admin/notes/+page.svelte": { - "file": "entries/pages/admin/notes/_page.svelte.js", - "name": "entries/pages/admin/notes/_page.svelte", - "src": "src/routes/admin/notes/+page.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_dev.js", - "_RoomCanvas.js", - "_api.js" - ], - "css": [ - "_app/immutable/assets/_page.DigLoqRm.css" - ] - }, - "src/routes/admin/rooms/+page.svelte": { - "file": "entries/pages/admin/rooms/_page.svelte.js", - "name": "entries/pages/admin/rooms/_page.svelte", - "src": "src/routes/admin/rooms/+page.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_dev.js", - "_RoomCanvas.js", - "_api.js" - ], - "css": [ - "_app/immutable/assets/_page.C7KB5jd4.css" - ] - }, - "src/routes/admin/sessions/+page.svelte": { - "file": "entries/pages/admin/sessions/_page.svelte.js", - "name": "entries/pages/admin/sessions/_page.svelte", - "src": "src/routes/admin/sessions/+page.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_dev.js", - "_api.js" - ], - "css": [ - "_app/immutable/assets/_page.BhkUjvVr.css" - ] - }, - "src/routes/login/+page.svelte": { - "file": "entries/pages/login/_page.svelte.js", - "name": "entries/pages/login/_page.svelte", - "src": "src/routes/login/+page.svelte", - "isEntry": true, - "imports": [ - "_navigation.js", - "_dev.js", - "_api.js", - "_auth.js" - ], - "css": [ - "_app/immutable/assets/_page.LkBq3xGq.css" - ] - }, - "src/routes/s/[code]/+page.svelte": { - "file": "entries/pages/s/_code_/_page.svelte.js", - "name": "entries/pages/s/_code_/_page.svelte", - "src": "src/routes/s/[code]/+page.svelte", - "isEntry": true, - "imports": [ - "_index-server.js", - "_client.js", - "_dev.js", - "_RoomCanvas.js", - "_api.js" - ], - "css": [ - "_app/immutable/assets/_page.BboNMIwd.css" - ] - } -} \ No newline at end of file diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/RoomCanvas.BEv49FWI.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/RoomCanvas.BEv49FWI.css deleted file mode 100644 index dd32997..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/RoomCanvas.BEv49FWI.css +++ /dev/null @@ -1 +0,0 @@ -.room-canvas.svelte-1i40qao{user-select:none;background:#fff;border:1px solid #ccc}.room-canvas.editable.svelte-1i40qao{cursor:crosshair}.element.svelte-1i40qao{cursor:pointer}.element.seat.svelte-1i40qao rect:where(.svelte-1i40qao){fill:#fff;stroke:#007bff;stroke-width:2px}.element.seat.svelte-1i40qao text:where(.svelte-1i40qao){fill:#007bff;font-size:14px;font-weight:700}.element.seat.occupied.svelte-1i40qao rect:where(.svelte-1i40qao){fill:#e7f1ff;stroke:#6c757d}.element.seat.occupied.svelte-1i40qao text:where(.svelte-1i40qao){fill:#6c757d}.element.seat.is-mine.svelte-1i40qao rect:where(.svelte-1i40qao){fill:#28a745;stroke:#1e7e34}.element.seat.is-mine.svelte-1i40qao text:where(.svelte-1i40qao){fill:#fff}.element.selected.svelte-1i40qao rect:where(.svelte-1i40qao){stroke:#ffc107;stroke-width:3px}.student-name.svelte-1i40qao{fill:#333;font-size:10px} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_layout.BQQYIMLK.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_layout.BQQYIMLK.css deleted file mode 100644 index b62d8f8..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_layout.BQQYIMLK.css +++ /dev/null @@ -1 +0,0 @@ -nav.svelte-1qg5d05{background:#f8f9fa;border-bottom:1px solid #dee2e6;padding:10px 20px}.nav-content.svelte-1qg5d05{justify-content:space-between;align-items:center;max-width:1200px;margin:0 auto;display:flex}.links.svelte-1qg5d05 a:where(.svelte-1qg5d05){color:#333;margin-right:20px;text-decoration:none}.links.svelte-1qg5d05 a:where(.svelte-1qg5d05):hover{color:#007bff}main.svelte-1qg5d05{max-width:1200px;margin:20px auto;padding:0 20px} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.BboNMIwd.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.BboNMIwd.css deleted file mode 100644 index 2a08ae7..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.BboNMIwd.css +++ /dev/null @@ -1 +0,0 @@ -.checkin-page.svelte-1gdz5lm{text-align:center;max-width:800px;margin:40px auto}.identity-selector.svelte-1gdz5lm{background:#f8f9fa;border-radius:8px;margin-bottom:20px;padding:20px}select.svelte-1gdz5lm{padding:8px;font-size:1.1em}.error.svelte-1gdz5lm{color:red}.success.svelte-1gdz5lm{color:#28a745;font-size:1.2em}.warning.svelte-1gdz5lm{color:#856404;background:#fff3cd;border-radius:4px;padding:10px}.map-container.svelte-1gdz5lm{margin-top:30px} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.Bfx4fGBa.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.Bfx4fGBa.css deleted file mode 100644 index e4d7384..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.Bfx4fGBa.css +++ /dev/null @@ -1 +0,0 @@ -.management-grid.svelte-nbog41{grid-template-columns:300px 1fr;gap:30px;display:grid}.course-item.svelte-nbog41{cursor:pointer;border:1px solid #eee;border-radius:4px;margin-bottom:5px;padding:10px}.course-item.selected.svelte-nbog41{background:#e7f1ff;border-color:#007bff}.student-actions.svelte-nbog41{background:#f8f9fa;border-radius:8px;margin-bottom:20px;padding:15px}.import-box.svelte-nbog41{margin-top:10px;font-size:.9em}table.svelte-nbog41{border-collapse:collapse;width:100%}th.svelte-nbog41,td.svelte-nbog41{text-align:left;border-bottom:1px solid #eee;padding:10px}input.svelte-nbog41{margin-right:5px;padding:6px} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.BhkUjvVr.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.BhkUjvVr.css deleted file mode 100644 index 92a8b96..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.BhkUjvVr.css +++ /dev/null @@ -1 +0,0 @@ -.course-selector.svelte-1x3d7ra{border-bottom:1px solid #eee;margin-bottom:20px;padding-bottom:20px}.add-session.svelte-1x3d7ra{background:#f8f9fa;border-radius:8px;margin-bottom:20px;padding:15px}.form-row.svelte-1x3d7ra{gap:10px;display:flex}.sessions-grid.svelte-1x3d7ra{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:20px;display:grid}.session-block.svelte-1x3d7ra{border:1px solid #ddd;border-radius:8px;overflow:hidden}.session-header.svelte-1x3d7ra{background:#eee;justify-content:space-between;align-items:center;padding:10px;display:flex}.slots-list.svelte-1x3d7ra{padding:10px}.slot-item.svelte-1x3d7ra{border-bottom:1px solid #f0f0f0;justify-content:space-between;padding:5px 0;display:flex}.delete-btn.svelte-1x3d7ra{color:#dc3545;cursor:pointer;background:0 0;border:none;font-weight:700}.modal-overlay.svelte-1x3d7ra{background:#00000080;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.modal.svelte-1x3d7ra{background:#fff;border-radius:8px;width:400px;padding:30px}.field.svelte-1x3d7ra{margin-bottom:15px}.field.svelte-1x3d7ra label:where(.svelte-1x3d7ra){margin-bottom:5px;display:block}.field.svelte-1x3d7ra input:where(.svelte-1x3d7ra),.field.svelte-1x3d7ra select:where(.svelte-1x3d7ra){width:100%;padding:8px}.modal-actions.svelte-1x3d7ra{justify-content:flex-end;gap:10px;margin-top:20px;display:flex}.primary.svelte-1x3d7ra{color:#fff;background:#007bff;border:none;border-radius:4px;padding:8px 16px} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.C7KB5jd4.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.C7KB5jd4.css deleted file mode 100644 index a7ad813..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.C7KB5jd4.css +++ /dev/null @@ -1 +0,0 @@ -.management-grid.svelte-2e9svb{grid-template-columns:200px 1fr;gap:20px;display:grid}.room-item.svelte-2e9svb{cursor:pointer;border:1px solid #eee;border-radius:4px;margin-bottom:5px;padding:10px}.room-item.selected.svelte-2e9svb{background:#e7f1ff;border-color:#007bff}.editor-header.svelte-2e9svb{justify-content:space-between;align-items:center;margin-bottom:10px;display:flex}.toolbar.svelte-2e9svb button:where(.svelte-2e9svb){margin-right:5px}.save-btn.svelte-2e9svb{color:#fff;background:#28a745;border:none;border-radius:4px;padding:5px 15px}.canvas-container.svelte-2e9svb{gap:20px;display:flex}.properties-panel.svelte-2e9svb{background:#f8f9fa;border-radius:8px;width:200px;padding:15px}.field.svelte-2e9svb{margin-bottom:10px}.field.svelte-2e9svb label:where(.svelte-2e9svb){color:#666;font-size:.8em;display:block}.field.svelte-2e9svb input:where(.svelte-2e9svb){width:100%;padding:4px}.delete-btn.svelte-2e9svb{color:red;width:100%;margin-top:10px} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.DDTZ5v3E.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.DDTZ5v3E.css deleted file mode 100644 index 7af6807..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.DDTZ5v3E.css +++ /dev/null @@ -1 +0,0 @@ -.selectors.svelte-190s2eg{margin-bottom:20px}select.svelte-190s2eg{margin-right:10px;padding:5px}.matrix-container.svelte-190s2eg{overflow-x:auto}table.svelte-190s2eg{border-collapse:collapse;background:#fff;width:100%}th.svelte-190s2eg,td.svelte-190s2eg{text-align:center;border:1px solid #ddd;padding:10px}th.svelte-190s2eg{background:#f8f9fa}.cell.svelte-190s2eg{cursor:pointer;width:60px;height:40px}.cell.svelte-190s2eg:hover{background:#f0f0f0}.cell.present.svelte-190s2eg{color:#155724;background:#d4edda;font-weight:700} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.DigLoqRm.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.DigLoqRm.css deleted file mode 100644 index 95f6607..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.DigLoqRm.css +++ /dev/null @@ -1 +0,0 @@ -.selectors.svelte-1do7mxm{margin-bottom:20px}select.svelte-1do7mxm{margin-right:10px;padding:5px}.notes-container.svelte-1do7mxm{grid-template-columns:1fr 300px;gap:20px;display:grid}.note-editor.svelte-1do7mxm{background:#f8f9fa;border-radius:8px;padding:20px}textarea.svelte-1do7mxm{width:100%;height:100px;margin:10px 0}.primary.svelte-1do7mxm{color:#fff;background:#007bff;border:none;border-radius:4px;padding:8px 16px}.note-item.svelte-1do7mxm{border-bottom:1px solid #ddd;padding:5px 0;font-size:.9em}.note-item.svelte-1do7mxm p:where(.svelte-1do7mxm){margin:5px 0} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.DkoPrtit.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.DkoPrtit.css deleted file mode 100644 index 69bd3d9..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.DkoPrtit.css +++ /dev/null @@ -1 +0,0 @@ -.export-grid.svelte-128ylb7{grid-template-columns:1fr 1fr;gap:40px;margin-top:20px;display:grid}.export-card.svelte-128ylb7{background:#f8f9fa;border:1px solid #dee2e6;border-radius:8px;margin:15px 0;padding:20px}.btn-group.svelte-128ylb7{gap:10px;display:flex}button.svelte-128ylb7{cursor:pointer;padding:8px 16px}button.small.svelte-128ylb7{padding:4px 8px;font-size:.9em}.session-export-row.svelte-128ylb7{border-bottom:1px solid #eee;justify-content:space-between;align-items:center;padding:8px 0;display:flex}select.svelte-128ylb7{width:100%;margin-bottom:10px;padding:8px} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.Dzrf4zX4.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.Dzrf4zX4.css deleted file mode 100644 index 705821a..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.Dzrf4zX4.css +++ /dev/null @@ -1 +0,0 @@ -.welcome.svelte-1uha8ag{text-align:center;background:#f8f9fa;border-radius:12px;max-width:600px;margin:100px auto;padding:40px}h1.svelte-1uha8ag{color:#333;margin-bottom:10px;font-size:2.5em}p.svelte-1uha8ag{color:#666;font-size:1.2em}.actions.svelte-1uha8ag{margin-top:40px}.btn.svelte-1uha8ag{color:#fff;background:#007bff;border-radius:6px;padding:12px 30px;font-weight:700;text-decoration:none}.footer.svelte-1uha8ag{color:#888;margin-top:60px;font-size:.9em} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.LkBq3xGq.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.LkBq3xGq.css deleted file mode 100644 index 8309da6..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.LkBq3xGq.css +++ /dev/null @@ -1 +0,0 @@ -.login-container.svelte-1x05zx6{border:1px solid #ccc;border-radius:8px;max-width:400px;margin:100px auto;padding:20px}.field.svelte-1x05zx6{margin-bottom:15px}label.svelte-1x05zx6{margin-bottom:5px;display:block}input.svelte-1x05zx6{box-sizing:border-box;width:100%;padding:8px}.error.svelte-1x05zx6{color:red;margin-bottom:15px}button.svelte-1x05zx6{color:#fff;cursor:pointer;background:#007bff;border:none;border-radius:4px;width:100%;padding:10px}button.svelte-1x05zx6:disabled{background:#ccc} diff --git a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.b2bZrlfC.css b/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.b2bZrlfC.css deleted file mode 100644 index 8ba6d9b..0000000 --- a/frontend/.svelte-kit/output/server/_app/immutable/assets/_page.b2bZrlfC.css +++ /dev/null @@ -1 +0,0 @@ -.course-selector.svelte-1jef3w8{margin-bottom:20px}.session-card.svelte-1jef3w8{border:1px solid #ddd;border-radius:8px;margin-bottom:15px;padding:15px}.slot-row.svelte-1jef3w8{border-top:1px solid #eee;justify-content:space-between;align-items:center;padding:10px 0;display:flex}.status-badge.svelte-1jef3w8{text-transform:uppercase;border-radius:12px;margin-right:10px;padding:2px 8px;font-size:.8em}.status-badge.closed.svelte-1jef3w8{color:#fff;background:#6c757d}.status-badge.open.svelte-1jef3w8{color:#fff;background:#28a745}.status-badge.locked.svelte-1jef3w8{color:#000;background:#ffc107}.checkin-code.svelte-1jef3w8{background:#f0f0f0;border-radius:4px;margin-left:10px;padding:2px 5px}.actions.svelte-1jef3w8 button:where(.svelte-1jef3w8){margin-left:5px} diff --git a/frontend/.svelte-kit/output/server/chunks/RoomCanvas.js b/frontend/.svelte-kit/output/server/chunks/RoomCanvas.js deleted file mode 100644 index f09ab75..0000000 --- a/frontend/.svelte-kit/output/server/chunks/RoomCanvas.js +++ /dev/null @@ -1,43 +0,0 @@ -import { H as escape_html, V as attr, a as ensure_array_like, l as stringify, n as attr_class, r as bind_props } from "./dev.js"; -//#region src/lib/RoomCanvas.svelte -function RoomCanvas($$renderer, $$props) { - $$renderer.component(($$renderer) => { - let { elements = [], editable = false, onElementClick, onLayoutChange, selectedId = null, occupiedSeatIds = [], mySeatId = null, studentNames = {} } = $$props; - const GRID_SIZE = 40; - $$renderer.push(``); - if (editable) { - $$renderer.push(""); - $$renderer.push(``); - } else $$renderer.push(""); - $$renderer.push(``); - const each_array = ensure_array_like(elements); - for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) { - let el = each_array[$$index]; - $$renderer.push(``); - if (el.type === "seat") { - $$renderer.push(""); - $$renderer.push(`${escape_html(el.label)}`); - if (studentNames[el.id]) { - $$renderer.push(""); - $$renderer.push(`${escape_html(studentNames[el.id])}`); - } else $$renderer.push(""); - $$renderer.push(``); - } else if (el.type === "table") { - $$renderer.push(""); - $$renderer.push(``); - } else if (el.type === "door") { - $$renderer.push(""); - $$renderer.push(`DOOR`); - } else $$renderer.push(""); - $$renderer.push(``); - } - $$renderer.push(``); - bind_props($$props, { elements }); - }); -} -//#endregion -export { RoomCanvas as t }; diff --git a/frontend/.svelte-kit/output/server/chunks/api.js b/frontend/.svelte-kit/output/server/chunks/api.js deleted file mode 100644 index 3759352..0000000 --- a/frontend/.svelte-kit/output/server/chunks/api.js +++ /dev/null @@ -1,138 +0,0 @@ -import { D as get } from "./dev.js"; -import "./index-server2.js"; -import { t as token } from "./auth.js"; -//#region src/lib/api.ts -var BASE = "/api"; -async function request(path, init) { - const $token = get(token); - const res = await fetch(BASE + path, { - ...init, - headers: { - "Content-Type": "application/json", - ...$token ? { Authorization: `Bearer ${$token}` } : {}, - ...init?.headers - } - }); - if (res.status === 401 && false); - if (!res.ok) { - const error = await res.json().catch(() => ({ error: res.statusText })); - throw new Error(error.error || res.statusText); - } - if (res.status === 204) return {}; - return res.json(); -} -var api = { - auth: { login: (email, password) => request("/auth/login", { - method: "POST", - body: JSON.stringify({ - email, - password - }) - }) }, - admin: { - courses: { - list: () => request("/admin/courses"), - create: (name, semester) => request("/admin/courses", { - method: "POST", - body: JSON.stringify({ - name, - semester - }) - }), - listStudents: (course_id) => request(`/admin/courses/${course_id}/students`), - addStudent: (course_id, name) => request(`/admin/courses/${course_id}/students`, { - method: "POST", - body: JSON.stringify({ name }) - }), - importStudents: (course_id, file) => { - const formData = new FormData(); - formData.append("file", file); - return fetch(`${BASE}/admin/courses/${course_id}/students/import`, { - method: "POST", - headers: { "Authorization": `Bearer ${get(token)}` }, - body: formData - }).then((res) => res.json()); - } - }, - students: { - delete: (id) => request(`/admin/students/${id}`, { method: "DELETE" }), - getAttendance: (id) => request(`/admin/students/${id}/attendance`), - getNotes: (id) => request(`/admin/students/${id}/notes`) - }, - rooms: { - list: () => request("/admin/rooms"), - create: (name, layout) => request("/admin/rooms", { - method: "POST", - body: JSON.stringify({ - name, - layout - }) - }), - get: (id) => request(`/admin/rooms/${id}`), - updateLayout: (id, layout) => request(`/admin/rooms/${id}/layout`, { - method: "PUT", - body: JSON.stringify(layout) - }) - }, - sessions: { - list: (course_id) => request(`/admin/sessions?course_id=${course_id}`), - create: (course_id, week_nr, date) => request("/admin/sessions", { - method: "POST", - body: JSON.stringify({ - course_id, - week_nr, - date - }) - }), - getAttendance: (id) => request(`/admin/sessions/${id}/attendance`) - }, - slots: { - create: (session_id, tutor_id, start_time, end_time, room_id) => request("/admin/slots", { - method: "POST", - body: JSON.stringify({ - session_id, - tutor_id, - start_time, - end_time, - room_id - }) - }), - updateStatus: (id, status) => request(`/admin/slots/${id}/status`, { - method: "PATCH", - body: JSON.stringify({ status }) - }), - delete: (id) => request(`/admin/slots/${id}`, { method: "DELETE" }), - addAttendance: (id, student_id) => request(`/admin/slots/${id}/attendance`, { - method: "POST", - body: JSON.stringify({ student_id }) - }), - deleteAttendance: (slot_id, student_id) => request(`/admin/slots/${slot_id}/attendance/${student_id}`, { method: "DELETE" }), - getNotes: (id) => request(`/admin/slots/${id}/notes`), - upsertNote: (slot_id, student_id, content) => request(`/admin/slots/${slot_id}/notes/${student_id}`, { - method: "PUT", - body: JSON.stringify({ content }) - }) - }, - export: { - sessionCsv: (id) => `${BASE}/admin/export/session/${id}/csv`, - sessionMd: (id) => `${BASE}/admin/export/session/${id}/md`, - courseCsv: (id) => `${BASE}/admin/export/course/${id}/csv`, - courseMd: (id) => `${BASE}/admin/export/course/${id}/md`, - backup: () => `${BASE}/admin/backup` - } - }, - checkin: { - getInfo: (code) => request(`/api/checkin/${code}`), - getStudents: (code) => request(`/api/checkin/${code}/students`), - post: (code, student_id, seat_id) => request("/api/checkin", { - method: "POST", - body: JSON.stringify({ - code, - student_id, - seat_id - }) - }) - } -}; -//#endregion -export { api as t }; diff --git a/frontend/.svelte-kit/output/server/chunks/auth.js b/frontend/.svelte-kit/output/server/chunks/auth.js deleted file mode 100644 index 154f8eb..0000000 --- a/frontend/.svelte-kit/output/server/chunks/auth.js +++ /dev/null @@ -1,6 +0,0 @@ -import { k as writable } from "./dev.js"; -import "./index-server2.js"; -//#region src/lib/auth.ts -var token = writable(null); -//#endregion -export { token as t }; diff --git a/frontend/.svelte-kit/output/server/chunks/client.js b/frontend/.svelte-kit/output/server/chunks/client.js deleted file mode 100644 index 46f5218..0000000 --- a/frontend/.svelte-kit/output/server/chunks/client.js +++ /dev/null @@ -1,1448 +0,0 @@ -import { n as settled, r as tick$1, t as index_server_exports } from "./index-server.js"; -import { b as noop, f as get_message, h as base64_decode, n as TRAILING_SLASH_PARAM, p as get_status, t as INVALIDATED_PARAM, v as text_decoder } from "./shared.js"; -import { d as base } from "./environment.js"; -import { S as compact, f as make_trackable, g as add_data_suffix, h as noop_span, l as decode_params, p as normalize_path, s as hash, u as decode_pathname } from "./exports.js"; -import { Z as noop$1, k as writable } from "./dev.js"; -import "./index-server2.js"; -import "./internal.js"; -import { HttpError, Redirect, SvelteKitError } from "@sveltejs/kit/internal"; -import "@sveltejs/kit/internal/server"; -import * as devalue from "devalue"; -var STATES_KEY = "sveltekit:states"; -var HISTORY_INDEX = "sveltekit:history"; -var NAVIGATION_INDEX = "sveltekit:navigation"; -var PRELOAD_PRIORITIES = { - tap: 1, - hover: 2, - viewport: 3, - eager: 4, - off: -1, - false: -1 -}; -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/client/utils.js -var origin = ""; -/** @param {string | URL} url */ -function resolve_url(url) { - if (url instanceof URL) return url; - let baseURI = document.baseURI; - if (!baseURI) { - const baseTags = document.getElementsByTagName("base"); - baseURI = baseTags.length ? baseTags[0].href : document.URL; - } - return new URL(url, baseURI); -} -function scroll_state() { - return { - x: pageXOffset, - y: pageYOffset - }; -} -({ ...PRELOAD_PRIORITIES }), PRELOAD_PRIORITIES.hover; -/** @param {any} value */ -function notifiable_store(value) { - const store = writable(value); - let ready = true; - function notify() { - ready = true; - store.update((val) => val); - } - /** @param {any} new_value */ - function set(new_value) { - ready = false; - store.set(new_value); - } - /** @param {(value: any) => void} run */ - function subscribe(run) { - /** @type {any} */ - let old_value; - return store.subscribe((new_value) => { - if (old_value === void 0 || ready && new_value !== old_value) run(old_value = new_value); - }); - } - return { - notify, - set, - subscribe - }; -} -var updated_listener = { v: noop }; -function create_updated_store() { - const { set, subscribe } = writable(false); - return { - subscribe, - check: async () => false - }; -} -/** -* Is external if -* - origin different -* - path doesn't start with base -* - uses hash router and pathname is more than base -* @param {URL} url -* @param {string} base -* @param {boolean} hash_routing -*/ -function is_external_url(url, base, hash_routing) { - if (url.origin !== origin || !url.pathname.startsWith(base)) return true; - if (hash_routing) return url.pathname !== location.pathname; - return false; -} -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/client/state.svelte.js -var page; -var navigating; -var updated; -var is_legacy = noop$1.toString().includes("$$") || /function \w+\(\) \{\}/.test(noop$1.toString()); -var placeholder_url = "a:"; -if (is_legacy) { - page = { - data: {}, - form: null, - error: null, - params: {}, - route: { id: null }, - state: {}, - status: -1, - url: new URL(placeholder_url) - }; - navigating = { current: null }; - updated = { current: false }; -} else { - page = new class Page { - data = {}; - form = null; - error = null; - params = {}; - route = { id: null }; - state = {}; - status = -1; - url = new URL(placeholder_url); - }(); - navigating = new class Navigating { - current = null; - }(); - updated = new class Updated { - current = false; - }(); - updated_listener.v = () => updated.current = true; -} -/** -* @param {import('@sveltejs/kit').Page} new_page -*/ -function update(new_page) { - Object.assign(page, new_page); -} -var cache = /* @__PURE__ */ new Map(); -/** -* Should be called on the initial run of load functions that hydrate the page. -* Saves any requests with cache-control max-age to the cache. -* @param {URL | string} resource -* @param {RequestInit} [opts] -*/ -function initial_fetch(resource, opts) { - const selector = build_selector(resource, opts); - const script = document.querySelector(selector); - if (script?.textContent) { - script.remove(); - let { body, ...init } = JSON.parse(script.textContent); - const ttl = script.getAttribute("data-ttl"); - if (ttl) cache.set(selector, { - body, - init, - ttl: 1e3 * Number(ttl) - }); - if (script.getAttribute("data-b64") !== null) body = base64_decode(body); - return Promise.resolve(new Response(body, init)); - } - return window.fetch(resource, opts); -} -/** -* Tries to get the response from the cache, if max-age allows it, else does a fetch. -* @param {URL | string} resource -* @param {string} resolved -* @param {RequestInit} [opts] -*/ -function subsequent_fetch(resource, resolved, opts) { - if (cache.size > 0) { - const selector = build_selector(resource, opts); - const cached = cache.get(selector); - if (cached) { - if (performance.now() < cached.ttl && [ - "default", - "force-cache", - "only-if-cached", - void 0 - ].includes(opts?.cache)) return new Response(cached.body, cached.init); - cache.delete(selector); - } - } - return window.fetch(resolved, opts); -} -/** -* Build the cache key for a given request -* @param {URL | RequestInfo} resource -* @param {RequestInit} [opts] -*/ -function build_selector(resource, opts) { - let selector = `script[data-sveltekit-fetched][data-url=${JSON.stringify(resource instanceof Request ? resource.url : resource)}]`; - if (opts?.headers || opts?.body) { - /** @type {import('types').StrictBody[]} */ - const values = []; - if (opts.headers) values.push([...new Headers(opts.headers)].join(",")); - if (opts.body && (typeof opts.body === "string" || ArrayBuffer.isView(opts.body))) values.push(opts.body); - selector += `[data-hash="${hash(...values)}"]`; - } - return selector; -} -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/client/session-storage.js -/** -* Read a value from `sessionStorage` -* @param {string} key -* @param {(value: string) => any} parse -*/ -/* @__NO_SIDE_EFFECTS__ */ -function get(key, parse = JSON.parse) { - try { - return parse(sessionStorage[key]); - } catch {} -} -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/client/client.js -/** @import { RemoteQueryCacheEntry } from './remote-functions/query.svelte.js' */ -var { onMount, tick } = index_server_exports; -/** -* Set via transformError, reset and read at the end of navigate. -* Necessary because a navigation might succeed loading but during rendering -* an error occurs, at which point the navigation result needs to be overridden with the error result. -* TODO this is all very hacky, rethink for SvelteKit 3 where we can assume Svelte 5 and do an overhaul of client.js -* @type {{ error: App.Error, status: number } | null} -*/ -var rendering_error = null; -/** -* history index -> { x, y } -* @type {Record} -*/ -var scroll_positions = /* @__PURE__ */ get("sveltekit:scroll") ?? {}; -/** -* navigation index -> any -* @type {Record} -*/ -var snapshots = /* @__PURE__ */ get("sveltekit:snapshot") ?? {}; -var stores = { - url: /* @__PURE__ */ notifiable_store({}), - page: /* @__PURE__ */ notifiable_store({}), - navigating: /* @__PURE__ */ writable(null), - updated: /* @__PURE__ */ create_updated_store() -}; -/** @param {number} index */ -function update_scroll_positions(index) { - scroll_positions[index] = scroll_state(); -} -/** -* @param {number} current_history_index -* @param {number} current_navigation_index -*/ -function clear_onward_history(current_history_index, current_navigation_index) { - let i = current_history_index + 1; - while (scroll_positions[i]) { - delete scroll_positions[i]; - i += 1; - } - i = current_navigation_index + 1; - while (snapshots[i]) { - delete snapshots[i]; - i += 1; - } -} -/** -* Loads `href` the old-fashioned way, with a full page reload. -* Returns a `Promise` that never resolves (to prevent any -* subsequent work, e.g. history manipulation, from happening) -* @param {URL} url -* @param {boolean} [replace] If `true`, will replace the current `history` entry rather than creating a new one with `pushState` -*/ -function native_navigation(url, replace = false) { - if (replace) location.replace(url.href); - else location.href = url.href; - return new Promise(noop); -} -/** -* Checks whether a service worker is registered, and if it is, -* tries to update it. -*/ -async function update_service_worker() { - if ("serviceWorker" in navigator) { - const registration = await navigator.serviceWorker.getRegistration(base || "/"); - if (registration) await registration.update(); - } -} -/** @type {import('types').CSRRoute[]} All routes of the app. Only available when kit.router.resolution=client */ -var routes; -/** @type {import('types').CSRPageNodeLoader} */ -var default_layout_loader; -/** @type {import('types').CSRPageNodeLoader} */ -var default_error_loader; -/** @type {HTMLElement} */ -var target; -/** @type {import('./types.js').SvelteKitApp} */ -var app; -/** @type {Array<((url: URL) => boolean)>} */ -var invalidated = []; -/** -* An array of the `+layout.svelte` and `+page.svelte` component instances -* that currently live on the page — used for capturing and restoring snapshots. -* It's updated/manipulated through `bind:this` in `Root.svelte`. -* @type {import('svelte').SvelteComponent[]} -*/ -var components = []; -/** @type {{id: string, token: {}, promise: Promise, fork: Promise | null} | null} */ -var load_cache = null; -function discard_load_cache() { - load_cache?.fork?.then((f) => f?.discard()); - load_cache = null; -} -/** -* @type {Map>} -* Cache for client-side rerouting, since it could contain async calls which we want to -* avoid running multiple times which would slow down navigations (e.g. else preloading -* wouldn't help because on navigation it would be called again). Since `reroute` should be -* a pure function (i.e. always return the same) value it's safe to cache across navigations. -* The server reroute calls don't need to be cached because they are called using `import(...)` -* which is cached per the JS spec. -*/ -var reroute_cache = /* @__PURE__ */ new Map(); -/** -* Note on before_navigate_callbacks, on_navigate_callbacks and after_navigate_callbacks: -* do not re-assign as some closures keep references to these Sets -*/ -/** @type {Set<(navigation: import('@sveltejs/kit').BeforeNavigate) => void>} */ -var before_navigate_callbacks = /* @__PURE__ */ new Set(); -/** @type {Set<(navigation: import('@sveltejs/kit').OnNavigate) => import('types').MaybePromise<(() => void) | void>>} */ -var on_navigate_callbacks = /* @__PURE__ */ new Set(); -/** @type {Set<(navigation: import('@sveltejs/kit').AfterNavigate) => void>} */ -var after_navigate_callbacks = /* @__PURE__ */ new Set(); -/** @type {import('./types.js').NavigationState & { nav: import('@sveltejs/kit').NavigationEvent }} */ -var current = { - branch: [], - error: null, - url: null, - nav: null -}; -/** this being true means we SSR'd */ -var hydrated = false; -var started = false; -var autoscroll = true; -var is_navigating = false; -var force_invalidation = false; -/** @type {import('svelte').SvelteComponent} */ -var root; -/** @type {number} keeping track of the history index in order to prevent popstate navigation events if needed */ -var current_history_index; -/** @type {number} */ -var current_navigation_index; -/** @type {{}} */ -var token; -/** -* A set of tokens which are associated to current preloads. -* If a preload becomes a real navigation, it's removed from the set. -* If a preload token is in the set and the preload errors, the error -* handling logic (for example reloading) is skipped. -*/ -var preload_tokens = /* @__PURE__ */ new Set(); -/** -* @type {Map>>} -* A map of query id -> payload -> query internals for all active queries. -*/ -var query_map = /* @__PURE__ */ new Map(); -function reset_invalidation() { - invalidated.length = 0; - force_invalidation = false; -} -/** @param {number} index */ -function capture_snapshot(index) { - if (components.some((c) => c?.snapshot)) snapshots[index] = components.map((c) => c?.snapshot?.capture()); -} -/** @param {number} index */ -function restore_snapshot(index) { - snapshots[index]?.forEach((value, i) => { - components[i]?.snapshot?.restore(value); - }); -} -/** -* @param {string | URL} url -* @param {{ replaceState?: boolean; noScroll?: boolean; keepFocus?: boolean; invalidateAll?: boolean; invalidate?: Array boolean)>; state?: Record }} options -* @param {number} redirect_count -* @param {{}} [nav_token] -*/ -async function _goto(url, options, redirect_count, nav_token) { - /** @type {string[]} */ - let query_keys; - if (options.invalidateAll) discard_load_cache(); - await navigate({ - type: "goto", - url: resolve_url(url), - keepfocus: options.keepFocus, - noscroll: options.noScroll, - replace_state: options.replaceState, - state: options.state, - redirect_count, - nav_token, - accept: () => { - if (options.invalidateAll) { - force_invalidation = true; - query_keys = []; - query_map.forEach((entries, id) => { - for (const payload of entries.keys()) query_keys.push(id + "/" + payload); - }); - } - if (options.invalidate) options.invalidate.forEach(push_invalidated); - } - }); - if (options.invalidateAll) tick$1().then(tick$1).then(() => { - query_map.forEach((entries, id) => { - entries.forEach(({ resource }, payload) => { - if (query_keys?.includes(id + "/" + payload)) resource.refresh?.(); - }); - }); - }); -} -/** -* @param {import('./types.js').NavigationFinished} result -* @param {HTMLElement} target -* @param {boolean} hydrate -*/ -async function initialize(result, target, hydrate) { - /** @type {import('@sveltejs/kit').NavigationEvent} */ - const nav = { - params: current.params, - route: { id: current.route?.id ?? null }, - url: new URL(location.href) - }; - current = { - ...result.state, - nav - }; - const style = document.querySelector("style[data-sveltekit]"); - if (style) style.remove(); - Object.assign(page, result.props.page); - root = new app.root({ - target, - props: { - ...result.props, - stores, - components - }, - hydrate, - sync: false, - transformError: void 0 - }); - await Promise.resolve(); - restore_snapshot(current_navigation_index); - if (hydrate) { - /** @type {import('@sveltejs/kit').AfterNavigate} */ - const navigation = { - from: null, - to: { - ...nav, - scroll: scroll_positions[current_history_index] ?? scroll_state() - }, - willUnload: false, - type: "enter", - complete: Promise.resolve() - }; - after_navigate_callbacks.forEach((fn) => fn(navigation)); - } - started = true; -} -/** -* -* @param {{ -* url: URL; -* params: Record; -* branch: Array; -* errors?: Array; -* status: number; -* error: App.Error | null; -* route: import('types').CSRRoute | null; -* form?: Record | null; -* }} opts -*/ -async function get_navigation_result_from_branch({ url, params, branch, errors, status, error, route, form }) { - /** @type {import('types').TrailingSlash} */ - let slash = "never"; - if (base && (url.pathname === base || url.pathname === base + "/")) slash = "always"; - else for (const node of branch) if (node?.slash !== void 0) slash = node.slash; - url.pathname = normalize_path(url.pathname, slash); - url.search = url.search; - /** @type {import('./types.js').NavigationFinished} */ - const result = { - type: "loaded", - state: { - url, - params, - branch, - error, - route - }, - props: { - constructors: compact(branch).map((branch_node) => branch_node.node.component), - page: clone_page(page) - } - }; - if (form !== void 0) result.props.form = form; - let data = {}; - let data_changed = !page; - let p = 0; - for (let i = 0; i < Math.max(branch.length, current.branch.length); i += 1) { - const node = branch[i]; - const prev = current.branch[i]; - if (node?.data !== prev?.data) data_changed = true; - if (!node) continue; - data = { - ...data, - ...node.data - }; - if (data_changed) result.props[`data_${p}`] = data; - p += 1; - } - if (!current.url || url.href !== current.url.href || current.error !== error || form !== void 0 && form !== page.form || data_changed) result.props.page = { - error, - params, - route: { id: route?.id ?? null }, - state: {}, - status, - url: new URL(url), - form: form ?? null, - data: data_changed ? data : page.data - }; - return result; -} -/** -* Call the universal load function of the given node, if it exists. -* -* @param {{ -* loader: import('types').CSRPageNodeLoader; -* parent: () => Promise>; -* url: URL; -* params: Record; -* route: { id: string | null }; -* server_data_node: import('./types.js').DataNode | null; -* }} options -* @returns {Promise} -*/ -async function load_node({ loader, parent, url, params, route, server_data_node }) { - /** @type {Record | null} */ - let data = null; - let is_tracking = true; - /** @type {import('types').Uses} */ - const uses = { - dependencies: /* @__PURE__ */ new Set(), - params: /* @__PURE__ */ new Set(), - parent: false, - route: false, - url: false, - search_params: /* @__PURE__ */ new Set() - }; - const node = await loader(); - if (node.universal?.load) { - /** @param {string[]} deps */ - function depends(...deps) { - for (const dep of deps) { - const { href } = new URL(dep, url); - uses.dependencies.add(href); - } - } - /** @type {import('@sveltejs/kit').LoadEvent} */ - const load_input = { - tracing: { - enabled: false, - root: noop_span, - current: noop_span - }, - route: new Proxy(route, { get: (target, key) => { - if (is_tracking) uses.route = true; - return target[key]; - } }), - params: new Proxy(params, { get: (target, key) => { - if (is_tracking) uses.params.add(key); - return target[key]; - } }), - data: server_data_node?.data ?? null, - url: make_trackable(url, () => { - if (is_tracking) uses.url = true; - }, (param) => { - if (is_tracking) uses.search_params.add(param); - }, app.hash), - async fetch(resource, init) { - if (resource instanceof Request) init = { - body: resource.method === "GET" || resource.method === "HEAD" ? void 0 : await resource.blob(), - cache: resource.cache, - credentials: resource.credentials, - headers: [...resource.headers].length > 0 ? resource?.headers : void 0, - integrity: resource.integrity, - keepalive: resource.keepalive, - method: resource.method, - mode: resource.mode, - redirect: resource.redirect, - referrer: resource.referrer, - referrerPolicy: resource.referrerPolicy, - signal: resource.signal, - ...init - }; - const { resolved, promise } = resolve_fetch_url(resource, init, url); - if (is_tracking) depends(resolved.href); - return promise; - }, - setHeaders: noop, - depends, - parent() { - if (is_tracking) uses.parent = true; - return parent(); - }, - untrack(fn) { - is_tracking = false; - try { - return fn(); - } finally { - is_tracking = true; - } - } - }; - data = await node.universal.load.call(null, load_input) ?? null; - } - return { - node, - loader, - server: server_data_node, - universal: node.universal?.load ? { - type: "data", - data, - uses - } : null, - data: data ?? server_data_node?.data ?? null, - slash: node.universal?.trailingSlash ?? server_data_node?.slash - }; -} -/** -* @param {Request | string | URL} input -* @param {RequestInit | undefined} init -* @param {URL} url -*/ -function resolve_fetch_url(input, init, url) { - let requested = input instanceof Request ? input.url : input; - const resolved = new URL(requested, url); - if (resolved.origin === url.origin) requested = resolved.href.slice(url.origin.length); - return { - resolved, - promise: started ? subsequent_fetch(requested, resolved.href, init) : initial_fetch(requested, init) - }; -} -/** -* @param {boolean} parent_changed -* @param {boolean} route_changed -* @param {boolean} url_changed -* @param {Set} search_params_changed -* @param {import('types').Uses | undefined} uses -* @param {Record} params -*/ -function has_changed(parent_changed, route_changed, url_changed, search_params_changed, uses, params) { - if (force_invalidation) return true; - if (!uses) return false; - if (uses.parent && parent_changed) return true; - if (uses.route && route_changed) return true; - if (uses.url && url_changed) return true; - for (const tracked_params of uses.search_params) if (search_params_changed.has(tracked_params)) return true; - for (const param of uses.params) if (params[param] !== current.params[param]) return true; - for (const href of uses.dependencies) if (invalidated.some((fn) => fn(new URL(href)))) return true; - return false; -} -/** -* @param {import('types').ServerDataNode | import('types').ServerDataSkippedNode | null} node -* @param {import('./types.js').DataNode | null} [previous] -* @returns {import('./types.js').DataNode | null} -*/ -function create_data_node(node, previous) { - if (node?.type === "data") return node; - if (node?.type === "skip") return previous ?? null; - return null; -} -/** -* @param {URL | null} old_url -* @param {URL} new_url -*/ -function diff_search_params(old_url, new_url) { - if (!old_url) return new Set(new_url.searchParams.keys()); - const changed = new Set([...old_url.searchParams.keys(), ...new_url.searchParams.keys()]); - for (const key of changed) { - const old_values = old_url.searchParams.getAll(key); - const new_values = new_url.searchParams.getAll(key); - if (old_values.every((value) => new_values.includes(value)) && new_values.every((value) => old_values.includes(value))) changed.delete(key); - } - return changed; -} -/** -* @param {Omit & { error: App.Error }} opts -* @returns {import('./types.js').NavigationFinished} -*/ -function preload_error({ error, url, route, params }) { - return { - type: "loaded", - state: { - error, - url, - route, - params, - branch: [] - }, - props: { - page: clone_page(page), - constructors: [] - } - }; -} -/** -* @param {import('./types.js').NavigationIntent & { preload?: {} }} intent -* @returns {Promise} -*/ -async function load_route({ id, invalidating, url, params, route, preload }) { - if (load_cache?.id === id) { - preload_tokens.delete(load_cache.token); - return load_cache.promise; - } - const { errors, layouts, leaf } = route; - const loaders = [...layouts, leaf]; - errors.forEach((loader) => loader?.().catch(noop)); - loaders.forEach((loader) => loader?.[1]().catch(noop)); - /** @type {import('types').ServerNodesResponse | import('types').ServerRedirectNode | null} */ - let server_data = null; - const url_changed = current.url ? id !== get_page_key(current.url) : false; - const route_changed = current.route ? route.id !== current.route.id : false; - const search_params_changed = diff_search_params(current.url, url); - let parent_invalid = false; - { - const invalid_server_nodes = loaders.map((loader, i) => { - const previous = current.branch[i]; - const invalid = !!loader?.[0] && (previous?.loader !== loader[1] || has_changed(parent_invalid, route_changed, url_changed, search_params_changed, previous.server?.uses, params)); - if (invalid) parent_invalid = true; - return invalid; - }); - if (invalid_server_nodes.some(Boolean)) { - try { - server_data = await load_data(url, invalid_server_nodes); - } catch (error) { - const handled_error = await handle_error(error, { - url, - params, - route: { id } - }); - if (preload_tokens.has(preload)) return preload_error({ - error: handled_error, - url, - params, - route - }); - return load_root_error_page({ - status: get_status(error), - error: handled_error, - url, - route - }); - } - if (server_data.type === "redirect") return server_data; - } - } - const server_data_nodes = server_data?.nodes; - let parent_changed = false; - const branch_promises = loaders.map(async (loader, i) => { - if (!loader) return; - /** @type {import('./types.js').BranchNode | undefined} */ - const previous = current.branch[i]; - const server_data_node = server_data_nodes?.[i]; - if ((!server_data_node || server_data_node.type === "skip") && loader[1] === previous?.loader && !has_changed(parent_changed, route_changed, url_changed, search_params_changed, previous.universal?.uses, params)) return previous; - parent_changed = true; - if (server_data_node?.type === "error") throw server_data_node; - return load_node({ - loader: loader[1], - url, - params, - route, - parent: async () => { - const data = {}; - for (let j = 0; j < i; j += 1) Object.assign(data, (await branch_promises[j])?.data); - return data; - }, - server_data_node: create_data_node(server_data_node === void 0 && loader[0] ? { type: "skip" } : server_data_node ?? null, loader[0] ? previous?.server : void 0) - }); - }); - for (const p of branch_promises) p.catch(noop); - /** @type {Array} */ - const branch = []; - for (let i = 0; i < loaders.length; i += 1) if (loaders[i]) try { - branch.push(await branch_promises[i]); - } catch (err) { - if (err instanceof Redirect) return { - type: "redirect", - location: err.location - }; - if (preload_tokens.has(preload)) return preload_error({ - error: await handle_error(err, { - params, - url, - route: { id: route.id } - }), - url, - params, - route - }); - let status = get_status(err); - /** @type {App.Error} */ - let error; - if (server_data_nodes?.includes(err)) { - status = err.status ?? status; - error = err.error; - } else if (err instanceof HttpError) error = err.body; - else { - if (await stores.updated.check()) { - await update_service_worker(); - return await native_navigation(url); - } - error = await handle_error(err, { - params, - url, - route: { id: route.id } - }); - } - const error_load = await load_nearest_error_page(i, branch, errors); - if (error_load) return get_navigation_result_from_branch({ - url, - params, - branch: branch.slice(0, error_load.idx).concat(error_load.node), - errors, - status, - error, - route - }); - else return await server_fallback(url, { id: route.id }, error, status); - } - else branch.push(void 0); - return get_navigation_result_from_branch({ - url, - params, - branch, - errors, - status: 200, - error: null, - route, - form: invalidating ? void 0 : null - }); -} -/** -* @param {number} i Start index to backtrack from -* @param {Array} branch Branch to backtrack -* @param {Array} errors All error pages for this branch -* @returns {Promise<{idx: number; node: import('./types.js').BranchNode} | undefined>} -*/ -async function load_nearest_error_page(i, branch, errors) { - while (i--) if (errors[i]) { - let j = i; - while (!branch[j]) j -= 1; - try { - return { - idx: j + 1, - node: { - node: await errors[i](), - loader: errors[i], - data: {}, - server: null, - universal: null - } - }; - } catch { - continue; - } - } -} -/** -* @param {{ -* status: number; -* error: App.Error; -* url: URL; -* route: { id: string | null } -* }} opts -* @returns {Promise} -*/ -async function load_root_error_page({ status, error, url, route }) { - /** @type {Record} */ - const params = {}; - /** @type {import('types').ServerDataNode | null} */ - let server_data_node = null; - if (app.server_loads[0] === 0) try { - const server_data = await load_data(url, [true]); - if (server_data.type !== "data" || server_data.nodes[0] && server_data.nodes[0].type !== "data") throw 0; - server_data_node = server_data.nodes[0] ?? null; - } catch { - if (url.origin !== origin || url.pathname !== location.pathname || hydrated) await native_navigation(url); - } - try { - return get_navigation_result_from_branch({ - url, - params, - branch: [await load_node({ - loader: default_layout_loader, - url, - params, - route, - parent: () => Promise.resolve({}), - server_data_node: create_data_node(server_data_node) - }), { - node: await default_error_loader(), - loader: default_error_loader, - universal: null, - server: null, - data: null - }], - status, - error, - errors: [], - route: null - }); - } catch (error) { - if (error instanceof Redirect) return _goto(new URL(error.location, location.href), {}, 0); - throw error; - } -} -/** -* Resolve the relative rerouted URL for a client-side navigation -* @param {URL} url -* @returns {Promise} -*/ -async function get_rerouted_url(url) { - const href = url.href; - if (reroute_cache.has(href)) return reroute_cache.get(href); - let rerouted; - try { - const promise = (async () => { - let rerouted = await app.hooks.reroute({ - url: new URL(url), - fetch: async (input, init) => { - return resolve_fetch_url(input, init, url).promise; - } - }) ?? url; - if (typeof rerouted === "string") { - const tmp = new URL(url); - if (app.hash) tmp.hash = rerouted; - else tmp.pathname = rerouted; - rerouted = tmp; - } - return rerouted; - })(); - reroute_cache.set(href, promise); - rerouted = await promise; - } catch (e) { - reroute_cache.delete(href); - return; - } - return rerouted; -} -/** -* Resolve the full info (which route, params, etc.) for a client-side navigation from the URL, -* taking the reroute hook into account. If this isn't a client-side-navigation (or the URL is undefined), -* returns undefined. -* @param {URL | undefined} url -* @param {boolean} invalidating -* @returns {Promise} -*/ -async function get_navigation_intent(url, invalidating) { - if (!url) return; - if (is_external_url(url, base, app.hash)) return; - { - const rerouted = await get_rerouted_url(url); - if (!rerouted) return; - const path = get_url_path(rerouted); - for (const route of routes) { - const params = route.exec(path); - if (params) return { - id: get_page_key(url), - invalidating, - route, - params: decode_params(params), - url - }; - } - } -} -/** @param {URL} url */ -function get_url_path(url) { - return decode_pathname(app.hash ? url.hash.replace(/^#/, "").replace(/[?#].+/, "") : url.pathname.slice(base.length)) || "/"; -} -/** @param {URL} url */ -function get_page_key(url) { - return (app.hash ? url.hash.replace(/^#/, "") : url.pathname) + url.search; -} -/** -* @param {{ -* url: URL; -* type: import('@sveltejs/kit').Navigation["type"]; -* intent?: import('./types.js').NavigationIntent; -* delta?: number; -* event?: PopStateEvent | MouseEvent; -* scroll?: { x: number, y: number }; -* }} opts -*/ -function _before_navigate({ url, type, intent, delta, event, scroll }) { - let should_block = false; - const nav = create_navigation(current, intent, url, type, scroll ?? null); - if (delta !== void 0) nav.navigation.delta = delta; - if (event !== void 0) nav.navigation.event = event; - const cancellable = { - ...nav.navigation, - cancel: () => { - should_block = true; - nav.reject(/* @__PURE__ */ new Error("navigation cancelled")); - } - }; - if (!is_navigating) before_navigate_callbacks.forEach((fn) => fn(cancellable)); - return should_block ? null : nav; -} -/** -* @param {{ -* type: import('@sveltejs/kit').NavigationType; -* url: URL; -* popped?: { -* state: Record; -* scroll: { x: number, y: number }; -* delta: number; -* }; -* keepfocus?: boolean; -* noscroll?: boolean; -* replace_state?: boolean; -* state?: Record; -* redirect_count?: number; -* nav_token?: {}; -* accept?: () => void; -* block?: () => void; -* event?: Event -* }} opts -*/ -async function navigate({ type, url, popped, keepfocus, noscroll, replace_state, state = {}, redirect_count = 0, nav_token = {}, accept = noop, block = noop, event }) { - const prev_token = token; - token = nav_token; - const intent = await get_navigation_intent(url, false); - const nav = type === "enter" ? create_navigation(current, intent, url, type) : _before_navigate({ - url, - type, - delta: popped?.delta, - intent, - scroll: popped?.scroll, - event - }); - if (!nav) { - block(); - if (token === nav_token) token = prev_token; - return; - } - const previous_history_index = current_history_index; - const previous_navigation_index = current_navigation_index; - accept(); - is_navigating = true; - if (started && nav.navigation.type !== "enter") stores.navigating.set(navigating.current = nav.navigation); - let navigation_result = intent && await load_route(intent); - if (!navigation_result) if (is_external_url(url, base, app.hash)) return await native_navigation(url, replace_state); - else navigation_result = await server_fallback(url, { id: null }, await handle_error(new SvelteKitError(404, "Not Found", `Not found: ${url.pathname}`), { - url, - params: {}, - route: { id: null } - }), 404, replace_state); - url = intent?.url || url; - if (token !== nav_token) { - nav.reject(/* @__PURE__ */ new Error("navigation aborted")); - return false; - } - if (navigation_result.type === "redirect") { - if (redirect_count < 20) { - await navigate({ - type, - url: new URL(navigation_result.location, url), - popped, - keepfocus, - noscroll, - replace_state, - state, - redirect_count: redirect_count + 1, - nav_token - }); - nav.fulfil(void 0); - return; - } - navigation_result = await load_root_error_page({ - status: 500, - error: await handle_error(/* @__PURE__ */ new Error("Redirect loop"), { - url, - params: {}, - route: { id: null } - }), - url, - route: { id: null } - }); - } else if (navigation_result.props.page.status >= 400) { - if (await stores.updated.check()) { - await update_service_worker(); - await native_navigation(url, replace_state); - } - } - reset_invalidation(); - update_scroll_positions(previous_history_index); - capture_snapshot(previous_navigation_index); - if (navigation_result.props.page.url.pathname !== url.pathname) url.pathname = navigation_result.props.page.url.pathname; - state = popped ? popped.state : state; - if (!popped) { - const change = replace_state ? 0 : 1; - const entry = { - [HISTORY_INDEX]: current_history_index += change, - [NAVIGATION_INDEX]: current_navigation_index += change, - [STATES_KEY]: state - }; - (replace_state ? history.replaceState : history.pushState).call(history, entry, "", url); - if (!replace_state) clear_onward_history(current_history_index, current_navigation_index); - } - const load_cache_fork = intent && load_cache?.id === intent.id ? load_cache.fork : null; - if (load_cache?.fork && !load_cache_fork) discard_load_cache(); - load_cache = null; - navigation_result.props.page.state = state; - /** - * @type {Promise | undefined} - */ - let commit_promise; - if (started) { - const after_navigate = (await Promise.all(Array.from(on_navigate_callbacks, (fn) => fn(nav.navigation)))).filter( - /** @returns {value is () => void} */ - (value) => typeof value === "function" - ); - if (after_navigate.length > 0) { - function cleanup() { - after_navigate.forEach((fn) => { - after_navigate_callbacks.delete(fn); - }); - } - after_navigate.push(cleanup); - after_navigate.forEach((fn) => { - after_navigate_callbacks.add(fn); - }); - } - const target = nav.navigation.to; - current = { - ...navigation_result.state, - nav: { - params: target.params, - route: target.route, - url: target.url - } - }; - if (navigation_result.props.page) navigation_result.props.page.url = url; - const fork = load_cache_fork && await load_cache_fork; - if (fork) commit_promise = fork.commit(); - else { - rendering_error = null; - root.$set(navigation_result.props); - if (rendering_error) Object.assign(navigation_result.props.page, rendering_error); - update(navigation_result.props.page); - commit_promise = settled?.(); - } - } else await initialize(navigation_result, target, false); - const { activeElement } = document; - await commit_promise; - await tick$1(); - await tick$1(); - /** @type {Element | null | ''} */ - let deep_linked = null; - if (autoscroll) { - const scroll = popped ? popped.scroll : noscroll ? scroll_state() : null; - if (scroll) scrollTo(scroll.x, scroll.y); - else if (deep_linked = url.hash && document.getElementById(get_id(url))) deep_linked.scrollIntoView(); - else scrollTo(0, 0); - } - const changed_focus = document.activeElement !== activeElement && document.activeElement !== document.body; - if (!keepfocus && !changed_focus) reset_focus(url, !deep_linked); - autoscroll = true; - if (navigation_result.props.page) { - if (rendering_error) Object.assign(navigation_result.props.page, rendering_error); - Object.assign(page, navigation_result.props.page); - } - is_navigating = false; - if (type === "popstate") restore_snapshot(current_navigation_index); - nav.fulfil(void 0); - if (nav.navigation.to) nav.navigation.to.scroll = scroll_state(); - after_navigate_callbacks.forEach((fn) => fn(nav.navigation)); - stores.navigating.set(navigating.current = null); -} -/** -* Does a full page reload if it wouldn't result in an endless loop in the SPA case -* @param {URL} url -* @param {{ id: string | null }} route -* @param {App.Error} error -* @param {number} status -* @param {boolean} [replace_state] -* @returns {Promise} -*/ -async function server_fallback(url, route, error, status, replace_state) { - if (url.origin === origin && url.pathname === location.pathname && !hydrated) return await load_root_error_page({ - status, - error, - url, - route - }); - return await native_navigation(url, replace_state); -} -/** -* @param {unknown} error -* @param {import('@sveltejs/kit').NavigationEvent} event -* @returns {import('types').MaybePromise} -*/ -function handle_error(error, event) { - if (error instanceof HttpError) return error.body; - const status = get_status(error); - const message = get_message(error); - return app.hooks.handleError({ - error, - event, - status, - message - }) ?? { message }; -} -/** -* Allows you to navigate programmatically to a given route, with options such as keeping the current element focused. -* Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`. -* -* For external URLs, use `window.location = url` instead of calling `goto(url)`. -* -* @param {string | URL} url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app. -* @param {Object} [opts] Options related to the navigation -* @param {boolean} [opts.replaceState] If `true`, will replace the current `history` entry rather than creating a new one with `pushState` -* @param {boolean} [opts.noScroll] If `true`, the browser will maintain its scroll position rather than scrolling to the top of the page after navigation -* @param {boolean} [opts.keepFocus] If `true`, the currently focused element will retain focus after navigation. Otherwise, focus will be reset to the body -* @param {boolean} [opts.invalidateAll] If `true`, all `load` functions of the page will be rerun. See https://svelte.dev/docs/kit/load#rerunning-load-functions for more info on invalidation. -* @param {Array boolean)>} [opts.invalidate] Causes any load functions to re-run if they depend on one of the urls -* @param {App.PageState} [opts.state] An optional object that will be available as `page.state` -* @returns {Promise} -*/ -function goto(url, opts = {}) { - throw new Error("Cannot call goto(...) on the server"); -} -/** -* @param {string | URL | ((url: URL) => boolean)} resource The invalidated URL -*/ -function push_invalidated(resource) { - if (typeof resource === "function") invalidated.push(resource); - else { - const { href } = new URL(resource, location.href); - invalidated.push((url) => url.href === href); - } -} -/** -* @param {URL} url -* @param {boolean[]} invalid -* @returns {Promise} -*/ -async function load_data(url, invalid) { - const data_url = new URL(url); - data_url.pathname = add_data_suffix(url.pathname); - if (url.pathname.endsWith("/")) data_url.searchParams.append(TRAILING_SLASH_PARAM, "1"); - data_url.searchParams.append(INVALIDATED_PARAM, invalid.map((i) => i ? "1" : "0").join("")); - const res = await (0, window.fetch)(data_url.href, {}); - if (!res.ok) { - /** @type {string | undefined} */ - let message; - if (res.headers.get("content-type")?.includes("application/json")) message = await res.json(); - else if (res.status === 404) message = "Not Found"; - else if (res.status === 500) message = "Internal Error"; - throw new HttpError(res.status, message); - } - return new Promise(async (resolve) => { - /** - * Map of deferred promises that will be resolved by a subsequent chunk of data - * @type {Map} - */ - const deferreds = /* @__PURE__ */ new Map(); - const reader = res.body.getReader(); - /** - * @param {any} data - */ - function deserialize(data) { - return devalue.unflatten(data, { - ...app.decoders, - Promise: (id) => { - return new Promise((fulfil, reject) => { - deferreds.set(id, { - fulfil, - reject - }); - }); - } - }); - } - let text = ""; - while (true) { - const { done, value } = await reader.read(); - if (done && !text) break; - text += !value && text ? "\n" : text_decoder.decode(value, { stream: true }); - while (true) { - const split = text.indexOf("\n"); - if (split === -1) break; - const node = JSON.parse(text.slice(0, split)); - text = text.slice(split + 1); - if (node.type === "redirect") return resolve(node); - if (node.type === "data") { - node.nodes?.forEach((node) => { - if (node?.type === "data") { - node.uses = deserialize_uses(node.uses); - node.data = deserialize(node.data); - } - }); - resolve(node); - } else if (node.type === "chunk") { - const { id, data, error } = node; - const deferred = deferreds.get(id); - deferreds.delete(id); - if (error) deferred.reject(deserialize(error)); - else deferred.fulfil(deserialize(data)); - } - } - } - }); -} -/** -* @param {any} uses -* @return {import('types').Uses} -*/ -function deserialize_uses(uses) { - return { - dependencies: new Set(uses?.dependencies ?? []), - params: new Set(uses?.params ?? []), - parent: !!uses?.parent, - route: !!uses?.route, - url: !!uses?.url, - search_params: new Set(uses?.search_params ?? []) - }; -} -/** -* @param {URL} url -* @param {boolean} [scroll] -*/ -function reset_focus(url, scroll = true) { - const autofocus = document.querySelector("[autofocus]"); - if (autofocus) autofocus.focus(); - else { - const id = get_id(url); - if (id && document.getElementById(id)) { - const { x, y } = scroll_state(); - setTimeout(() => { - const history_state = history.state; - location.replace(new URL(`#${id}`, location.href)); - history.replaceState(history_state, "", url); - if (scroll) scrollTo(x, y); - }); - } else { - const root = document.body; - const tabindex = root.getAttribute("tabindex"); - root.tabIndex = -1; - root.focus({ - preventScroll: true, - focusVisible: false - }); - if (tabindex !== null) root.setAttribute("tabindex", tabindex); - else root.removeAttribute("tabindex"); - } - const selection = getSelection(); - if (selection && selection.type !== "None") { - /** @type {Range[]} */ - const ranges = []; - for (let i = 0; i < selection.rangeCount; i += 1) ranges.push(selection.getRangeAt(i)); - setTimeout(() => { - if (selection.rangeCount !== ranges.length) return; - for (let i = 0; i < selection.rangeCount; i += 1) { - const a = ranges[i]; - const b = selection.getRangeAt(i); - if (a.commonAncestorContainer !== b.commonAncestorContainer || a.startContainer !== b.startContainer || a.endContainer !== b.endContainer || a.startOffset !== b.startOffset || a.endOffset !== b.endOffset) return; - } - selection.removeAllRanges(); - }); - } - } -} -/** -* @template {import('@sveltejs/kit').NavigationType} T -* @param {import('./types.js').NavigationState} current -* @param {import('./types.js').NavigationIntent | undefined} intent -* @param {URL | null} url -* @param {T} type -* @param {{ x: number, y: number } | null} [target_scroll] The scroll position for the target (for popstate navigations) -*/ -function create_navigation(current, intent, url, type, target_scroll = null) { - /** @type {(value: any) => void} */ - let fulfil; - /** @type {(error: any) => void} */ - let reject; - const complete = new Promise((f, r) => { - fulfil = f; - reject = r; - }); - complete.catch(noop); - return { - navigation: { - from: { - params: current.params, - route: { id: current.route?.id ?? null }, - url: current.url, - scroll: scroll_state() - }, - to: url && { - params: intent?.params ?? null, - route: { id: intent?.route?.id ?? null }, - url, - scroll: target_scroll - }, - willUnload: !intent, - type, - complete - }, - fulfil, - reject - }; -} -/** -* TODO: remove this in 3.0 when the page store is also removed -* -* We need to assign a new page object so that subscribers are correctly notified. -* However, spreading `{ ...page }` returns an empty object so we manually -* assign to each property instead. -* -* @param {import('@sveltejs/kit').Page} page -*/ -function clone_page(page) { - return { - data: page.data, - error: page.error, - form: page.form, - params: page.params, - route: page.route, - state: page.state, - status: page.status, - url: page.url - }; -} -/** -* @param {URL} url -* @returns {string} -*/ -function get_id(url) { - let id; - if (app.hash) { - const [, , second] = url.hash.split("#", 3); - id = second ?? ""; - } else id = url.hash.slice(1); - return decodeURIComponent(id); -} -//#endregion -export { updated as a, page as i, stores as n, navigating as r, goto as t }; diff --git a/frontend/.svelte-kit/output/server/chunks/dev.js b/frontend/.svelte-kit/output/server/chunks/dev.js deleted file mode 100644 index 97606f7..0000000 --- a/frontend/.svelte-kit/output/server/chunks/dev.js +++ /dev/null @@ -1,4055 +0,0 @@ -import * as devalue from "devalue"; -import { clsx } from "clsx"; -//#region node_modules/svelte/src/internal/shared/errors.js -/** -* Cannot use `%name%(...)` unless the `experimental.async` compiler option is `true` -* @param {string} name -* @returns {never} -*/ -function experimental_async_required(name) { - throw new Error(`https://svelte.dev/e/experimental_async_required`); -} -/** -* `%name%(...)` can only be used during component initialisation -* @param {string} name -* @returns {never} -*/ -function lifecycle_outside_component(name) { - throw new Error(`https://svelte.dev/e/lifecycle_outside_component`); -} -/** -* Context was not set in a parent component -* @returns {never} -*/ -function missing_context() { - throw new Error(`https://svelte.dev/e/missing_context`); -} -//#endregion -//#region node_modules/svelte/src/internal/server/errors.js -/** -* The node API `AsyncLocalStorage` is not available, but is required to use async server rendering. -* @returns {never} -*/ -function async_local_storage_unavailable() { - const error = /* @__PURE__ */ new Error(`async_local_storage_unavailable\nThe node API \`AsyncLocalStorage\` is not available, but is required to use async server rendering.\nhttps://svelte.dev/e/async_local_storage_unavailable`); - error.name = "Svelte error"; - throw error; -} -/** -* Encountered asynchronous work while rendering synchronously. -* @returns {never} -*/ -function await_invalid() { - const error = /* @__PURE__ */ new Error(`await_invalid\nEncountered asynchronous work while rendering synchronously.\nhttps://svelte.dev/e/await_invalid`); - error.name = "Svelte error"; - throw error; -} -/** -* The `html` property of server render results has been deprecated. Use `body` instead. -* @returns {never} -*/ -function html_deprecated() { - const error = /* @__PURE__ */ new Error(`html_deprecated\nThe \`html\` property of server render results has been deprecated. Use \`body\` instead.\nhttps://svelte.dev/e/html_deprecated`); - error.name = "Svelte error"; - throw error; -} -/** -* Attempted to set `hydratable` with key `%key%` twice with different values. -* -* %stack% -* @param {string} key -* @param {string} stack -* @returns {never} -*/ -function hydratable_clobbering(key, stack) { - const error = /* @__PURE__ */ new Error(`hydratable_clobbering\nAttempted to set \`hydratable\` with key \`${key}\` twice with different values. - -${stack}\nhttps://svelte.dev/e/hydratable_clobbering`); - error.name = "Svelte error"; - throw error; -} -/** -* Failed to serialize `hydratable` data for key `%key%`. -* -* `hydratable` can serialize anything [`uneval` from `devalue`](https://npmjs.com/package/uneval) can, plus Promises. -* -* Cause: -* %stack% -* @param {string} key -* @param {string} stack -* @returns {never} -*/ -function hydratable_serialization_failed(key, stack) { - const error = /* @__PURE__ */ new Error(`hydratable_serialization_failed\nFailed to serialize \`hydratable\` data for key \`${key}\`. - -\`hydratable\` can serialize anything [\`uneval\` from \`devalue\`](https://npmjs.com/package/uneval) can, plus Promises. - -Cause: -${stack}\nhttps://svelte.dev/e/hydratable_serialization_failed`); - error.name = "Svelte error"; - throw error; -} -/** -* `csp.nonce` was set while `csp.hash` was `true`. These options cannot be used simultaneously. -* @returns {never} -*/ -function invalid_csp() { - const error = /* @__PURE__ */ new Error(`invalid_csp\n\`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.\nhttps://svelte.dev/e/invalid_csp`); - error.name = "Svelte error"; - throw error; -} -/** -* The `idPrefix` option cannot include `--`. -* @returns {never} -*/ -function invalid_id_prefix() { - const error = /* @__PURE__ */ new Error(`invalid_id_prefix\nThe \`idPrefix\` option cannot include \`--\`.\nhttps://svelte.dev/e/invalid_id_prefix`); - error.name = "Svelte error"; - throw error; -} -/** -* `%name%(...)` is not available on the server -* @param {string} name -* @returns {never} -*/ -function lifecycle_function_unavailable(name) { - const error = /* @__PURE__ */ new Error(`lifecycle_function_unavailable\n\`${name}(...)\` is not available on the server\nhttps://svelte.dev/e/lifecycle_function_unavailable`); - error.name = "Svelte error"; - throw error; -} -/** -* Could not resolve `render` context. -* @returns {never} -*/ -function server_context_required() { - const error = /* @__PURE__ */ new Error(`server_context_required\nCould not resolve \`render\` context.\nhttps://svelte.dev/e/server_context_required`); - error.name = "Svelte error"; - throw error; -} -//#endregion -//#region node_modules/svelte/src/internal/server/context.js -/** @import { SSRContext } from '#server' */ -/** @type {SSRContext | null} */ -var ssr_context = null; -/** @param {SSRContext | null} v */ -function set_ssr_context(v) { - ssr_context = v; -} -/** -* @template T -* @returns {[() => T, (context: T) => T]} -* @since 5.40.0 -*/ -function createContext() { - const key = {}; - return [() => { - if (!hasContext(key)) missing_context(); - return getContext(key); - }, (context) => setContext(key, context)]; -} -/** -* @template T -* @param {any} key -* @returns {T} -*/ -function getContext(key) { - return get_or_init_context_map("getContext").get(key); -} -/** -* @template T -* @param {any} key -* @param {T} context -* @returns {T} -*/ -function setContext(key, context) { - get_or_init_context_map("setContext").set(key, context); - return context; -} -/** -* @param {any} key -* @returns {boolean} -*/ -function hasContext(key) { - return get_or_init_context_map("hasContext").has(key); -} -/** @returns {Map} */ -function getAllContexts() { - return get_or_init_context_map("getAllContexts"); -} -/** -* @param {string} name -* @returns {Map} -*/ -function get_or_init_context_map(name) { - if (ssr_context === null) lifecycle_outside_component(name); - return ssr_context.c ??= new Map(get_parent_context(ssr_context) || void 0); -} -/** -* @param {Function} [fn] -*/ -function push$1(fn) { - ssr_context = { - p: ssr_context, - c: null, - r: null - }; -} -function pop$1() { - ssr_context = ssr_context.p; -} -/** -* @param {SSRContext} ssr_context -* @returns {Map | null} -*/ -function get_parent_context(ssr_context) { - let parent = ssr_context.p; - while (parent !== null) { - const context_map = parent.c; - if (context_map !== null) return context_map; - parent = parent.p; - } - return null; -} -//#endregion -//#region node_modules/svelte/src/internal/shared/utils.js -var is_array = Array.isArray; -var index_of = Array.prototype.indexOf; -var includes = Array.prototype.includes; -var array_from = Array.from; -var define_property = Object.defineProperty; -var get_descriptor = Object.getOwnPropertyDescriptor; -var object_prototype = Object.prototype; -var array_prototype = Array.prototype; -var get_prototype_of = Object.getPrototypeOf; -var is_extensible = Object.isExtensible; -var has_own_property = Object.prototype.hasOwnProperty; -var noop = () => {}; -/** @param {Function} fn */ -function run(fn) { - return fn(); -} -/** @param {Array<() => void>} arr */ -function run_all(arr) { - for (var i = 0; i < arr.length; i++) arr[i](); -} -/** -* TODO replace with Promise.withResolvers once supported widely enough -* @template [T=void] -*/ -function deferred() { - /** @type {(value: T) => void} */ - var resolve; - /** @type {(reason: any) => void} */ - var reject; - return { - promise: new Promise((res, rej) => { - resolve = res; - reject = rej; - }), - resolve, - reject - }; -} -var CLEAN = 1024; -var DIRTY = 2048; -var MAYBE_DIRTY = 4096; -var INERT = 8192; -var DESTROYED = 16384; -/** Set once a reaction has run for the first time */ -var REACTION_RAN = 32768; -/** Effect is in the process of getting destroyed. Can be observed in child teardown functions */ -var DESTROYING = 1 << 25; -/** -* 'Transparent' effects do not create a transition boundary. -* This is on a block effect 99% of the time but may also be on a branch effect if its parent block effect was pruned -*/ -var EFFECT_TRANSPARENT = 65536; -var EFFECT_PRESERVED = 1 << 19; -var USER_EFFECT = 1 << 20; -/** -* Tells that we marked this derived and its reactions as visited during the "mark as (maybe) dirty"-phase. -* Will be lifted during execution of the derived and during checking its dirty state (both are necessary -* because a derived might be checked but not executed). This is a pure performance optimization flag and -* should not be used for any other purpose! -*/ -var WAS_MARKED = 65536; -var REACTION_IS_UPDATING = 1 << 21; -var ERROR_VALUE = 1 << 23; -var STATE_SYMBOL = Symbol("$state"); -var LEGACY_PROPS = Symbol("legacy props"); -/** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */ -var STALE_REACTION = new class StaleReactionError extends Error { - name = "StaleReactionError"; - message = "The reaction that called `getAbortSignal()` was re-run or destroyed"; -}(); -globalThis.document?.contentType; -//#endregion -//#region node_modules/svelte/src/internal/server/abort-signal.js -/** @type {AbortController | null} */ -var controller = null; -function abort() { - controller?.abort(STALE_REACTION); - controller = null; -} -function getAbortSignal() { - return (controller ??= new AbortController()).signal; -} -//#endregion -//#region node_modules/svelte/src/internal/flags/index.js -/** True if experimental.async=true */ -var async_mode_flag = false; -/** True if we're not certain that we only have Svelte 5 code in the compilation */ -var legacy_mode_flag = false; -//#endregion -//#region node_modules/svelte/src/internal/server/render-context.js -/** @import { AsyncLocalStorage } from 'node:async_hooks' */ -/** @import { RenderContext } from '#server' */ -/** @type {Promise | null} */ -var current_render = null; -/** @type {RenderContext | null} */ -var context = null; -/** @returns {RenderContext} */ -function get_render_context() { - const store = context ?? als?.getStore(); - if (!store) server_context_required(); - return store; -} -/** -* @template T -* @param {() => Promise} fn -* @returns {Promise} -*/ -async function with_render_context(fn) { - context = { hydratable: { - lookup: /* @__PURE__ */ new Map(), - comparisons: [], - unresolved_promises: /* @__PURE__ */ new Map() - } }; - if (in_webcontainer()) { - const { promise, resolve } = deferred(); - const previous_render = current_render; - current_render = promise; - await previous_render; - return fn().finally(resolve); - } - try { - if (als === null) async_local_storage_unavailable(); - return als.run(context, fn); - } finally { - context = null; - } -} -/** @type {AsyncLocalStorage | null} */ -var als = null; -/** @type {Promise | null} */ -var als_import = null; -/** -* -* @returns {Promise} -*/ -function init_render_context() { - als_import ??= import("node:async_hooks").then((hooks) => { - als = new hooks.AsyncLocalStorage(); - }).then(noop, noop); - return als_import; -} -function in_webcontainer() { - return !!globalThis.process?.versions?.webcontainer; -} -/** -* @returns {string[]} -*/ -function get_stack() { - const limit = Error.stackTraceLimit; - Error.stackTraceLimit = Infinity; - const stack = (/* @__PURE__ */ new Error()).stack; - Error.stackTraceLimit = limit; - if (!stack) return []; - const lines = stack.split("\n"); - const new_lines = []; - for (let i = 0; i < lines.length; i++) { - const line = lines[i]; - const posixified = line.replaceAll("\\", "/"); - if (line.trim() === "Error") continue; - if (line.includes("validate_each_keys")) return []; - if (posixified.includes("svelte/src/internal") || posixified.includes("node_modules/.vite")) continue; - new_lines.push(line); - } - return new_lines; -} -//#endregion -//#region node_modules/svelte/src/constants.js -var HYDRATION_ERROR = {}; -var UNINITIALIZED = Symbol(); -/** -* A `hydratable` value with key `%key%` was created, but at least part of it was not used during the render. -* -* The `hydratable` was initialized in: -* %stack% -* @param {string} key -* @param {string} stack -*/ -function unresolved_hydratable(key, stack) { - console.warn(`https://svelte.dev/e/unresolved_hydratable`); -} -//#endregion -//#region node_modules/svelte/src/internal/server/hydration.js -var BLOCK_OPEN = ``; -var BLOCK_CLOSE = ``; -//#endregion -//#region node_modules/svelte/src/escaping.js -var ATTR_REGEX = /[&"<]/g; -var CONTENT_REGEX = /[&<]/g; -/** -* @template V -* @param {V} value -* @param {boolean} [is_attr] -*/ -function escape_html(value, is_attr) { - const str = String(value ?? ""); - const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX; - pattern.lastIndex = 0; - let escaped = ""; - let last = 0; - while (pattern.test(str)) { - const i = pattern.lastIndex - 1; - const ch = str[i]; - escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === "\"" ? """ : "<"); - last = i + 1; - } - return escaped + str.substring(last); -} -//#endregion -//#region node_modules/svelte/src/internal/shared/attributes.js -/** -* `
` should be rendered as `
` and _not_ -* `
`, which is equivalent to `
`. There -* may be other odd cases that need to be added to this list in future -* @type {Record>} -*/ -var replacements = { translate: new Map([[true, "yes"], [false, "no"]]) }; -/** -* @template V -* @param {string} name -* @param {V} value -* @param {boolean} [is_boolean] -* @returns {string} -*/ -function attr(name, value, is_boolean = false) { - if (name === "hidden" && value !== "until-found") is_boolean = true; - if (value == null || !value && is_boolean) return ""; - const normalized = has_own_property.call(replacements, name) && replacements[name].get(value) || value; - return ` ${name}${is_boolean ? `=""` : `="${escape_html(normalized, true)}"`}`; -} -/** -* Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values. -* TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does) -* @param {any} value -*/ -function clsx$1(value) { - if (typeof value === "object") return clsx(value); - else return value ?? ""; -} -var whitespace = [..." \n\r\f\xA0\v"]; -/** -* @param {any} value -* @param {string | null} [hash] -* @param {Record} [directives] -* @returns {string | null} -*/ -function to_class(value, hash, directives) { - var classname = value == null ? "" : "" + value; - if (hash) classname = classname ? classname + " " + hash : hash; - if (directives) { - for (var key of Object.keys(directives)) if (directives[key]) classname = classname ? classname + " " + key : key; - else if (classname.length) { - var len = key.length; - var a = 0; - while ((a = classname.indexOf(key, a)) >= 0) { - var b = a + len; - if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1); - else a = b; - } - } - } - return classname === "" ? null : classname; -} -/** -* -* @param {Record} styles -* @param {boolean} important -*/ -function append_styles(styles, important = false) { - var separator = important ? " !important;" : ";"; - var css = ""; - for (var key of Object.keys(styles)) { - var value = styles[key]; - if (value != null && value !== "") css += " " + key + ": " + value + separator; - } - return css; -} -/** -* @param {string} name -* @returns {string} -*/ -function to_css_name(name) { - if (name[0] !== "-" || name[1] !== "-") return name.toLowerCase(); - return name; -} -/** -* @param {any} value -* @param {Record | [Record, Record]} [styles] -* @returns {string | null} -*/ -function to_style(value, styles) { - if (styles) { - var new_style = ""; - /** @type {Record | undefined} */ - var normal_styles; - /** @type {Record | undefined} */ - var important_styles; - if (Array.isArray(styles)) { - normal_styles = styles[0]; - important_styles = styles[1]; - } else normal_styles = styles; - if (value) { - value = String(value).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim(); - /** @type {boolean | '"' | "'"} */ - var in_str = false; - var in_apo = 0; - var in_comment = false; - var reserved_names = []; - if (normal_styles) reserved_names.push(...Object.keys(normal_styles).map(to_css_name)); - if (important_styles) reserved_names.push(...Object.keys(important_styles).map(to_css_name)); - var start_index = 0; - var name_index = -1; - const len = value.length; - for (var i = 0; i < len; i++) { - var c = value[i]; - if (in_comment) { - if (c === "/" && value[i - 1] === "*") in_comment = false; - } else if (in_str) { - if (in_str === c) in_str = false; - } else if (c === "/" && value[i + 1] === "*") in_comment = true; - else if (c === "\"" || c === "'") in_str = c; - else if (c === "(") in_apo++; - else if (c === ")") in_apo--; - if (!in_comment && in_str === false && in_apo === 0) { - if (c === ":" && name_index === -1) name_index = i; - else if (c === ";" || i === len - 1) { - if (name_index !== -1) { - var name = to_css_name(value.substring(start_index, name_index).trim()); - if (!reserved_names.includes(name)) { - if (c !== ";") i++; - var property = value.substring(start_index, i).trim(); - new_style += " " + property + ";"; - } - } - start_index = i + 1; - name_index = -1; - } - } - } - } - if (normal_styles) new_style += append_styles(normal_styles); - if (important_styles) new_style += append_styles(important_styles, true); - new_style = new_style.trim(); - return new_style === "" ? null : new_style; - } - return value == null ? null : String(value); -} -/** -* Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state -* @returns {never} -*/ -function effect_update_depth_exceeded() { - throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`); -} -/** -* Failed to hydrate the application -* @returns {never} -*/ -function hydration_failed() { - throw new Error(`https://svelte.dev/e/hydration_failed`); -} -/** -* Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`. -* @returns {never} -*/ -function state_descriptors_fixed() { - throw new Error(`https://svelte.dev/e/state_descriptors_fixed`); -} -/** -* Cannot set prototype of `$state` object -* @returns {never} -*/ -function state_prototype_fixed() { - throw new Error(`https://svelte.dev/e/state_prototype_fixed`); -} -/** -* Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state` -* @returns {never} -*/ -function state_unsafe_mutation() { - throw new Error(`https://svelte.dev/e/state_unsafe_mutation`); -} -/** -* A `` `reset` function cannot be called while an error is still being handled -* @returns {never} -*/ -function svelte_boundary_reset_onerror() { - throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`); -} -/** -* Reading a derived belonging to a now-destroyed effect may result in stale values -*/ -function derived_inert() { - console.warn(`https://svelte.dev/e/derived_inert`); -} -/** -* Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location% -* @param {string | undefined | null} [location] -*/ -function hydration_mismatch(location) { - console.warn(`https://svelte.dev/e/hydration_mismatch`); -} -/** -* Tried to unmount a component that was not mounted -*/ -function lifecycle_double_unmount() { - console.warn(`https://svelte.dev/e/lifecycle_double_unmount`); -} -/** -* Tried to unmount a state proxy, rather than a component -*/ -function state_proxy_unmount() { - console.warn(`https://svelte.dev/e/state_proxy_unmount`); -} -/** -* A `` `reset` function only resets the boundary the first time it is called -*/ -function svelte_boundary_reset_noop() { - console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`); -} -//#endregion -//#region node_modules/svelte/src/internal/client/dom/hydration.js -/** @import { TemplateNode } from '#client' */ -/** -* Use this variable to guard everything related to hydration code so it can be treeshaken out -* if the user doesn't use the `hydrate` method and these code paths are therefore not needed. -*/ -var hydrating = false; -/** @param {boolean} value */ -function set_hydrating(value) { - hydrating = value; -} -/** -* The node that is currently being hydrated. This starts out as the first node inside the opening -* comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`. -* When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the -* time we leave the block it is the closing comment, which serves as the block's anchor. -* @type {TemplateNode} -*/ -var hydrate_node; -/** @param {TemplateNode | null} node */ -function set_hydrate_node(node) { - if (node === null) { - hydration_mismatch(); - throw HYDRATION_ERROR; - } - return hydrate_node = node; -} -function hydrate_next() { - return set_hydrate_node(/* @__PURE__ */ get_next_sibling(hydrate_node)); -} -function next(count = 1) { - if (hydrating) { - var i = count; - var node = hydrate_node; - while (i--) node = /* @__PURE__ */ get_next_sibling(node); - hydrate_node = node; - } -} -/** -* Skips or removes (depending on {@link remove}) all nodes starting at `hydrate_node` up until the next hydration end comment -* @param {boolean} remove -*/ -function skip_nodes(remove = true) { - var depth = 0; - var node = hydrate_node; - while (true) { - if (node.nodeType === 8) { - var data = node.data; - if (data === "]") { - if (depth === 0) return node; - depth -= 1; - } else if (data === "[" || data === "[!" || data[0] === "[" && !isNaN(Number(data.slice(1)))) depth += 1; - } - var next = /* @__PURE__ */ get_next_sibling(node); - if (remove) node.remove(); - node = next; - } -} -//#endregion -//#region node_modules/svelte/src/internal/client/reactivity/equality.js -/** @import { Equals } from '#client' */ -/** @type {Equals} */ -function equals(value) { - return value === this.v; -} -/** -* @param {unknown} a -* @param {unknown} b -* @returns {boolean} -*/ -function safe_not_equal(a, b) { - return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function"; -} -/** @type {Equals} */ -function safe_equals(value) { - return !safe_not_equal(value, this.v); -} -//#endregion -//#region node_modules/svelte/src/internal/client/context.js -/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */ -/** @type {ComponentContext | null} */ -var component_context = null; -/** @param {ComponentContext | null} context */ -function set_component_context(context) { - component_context = context; -} -/** -* @param {Record} props -* @param {any} runes -* @param {Function} [fn] -* @returns {void} -*/ -function push(props, runes = false, fn) { - component_context = { - p: component_context, - i: false, - c: null, - e: null, - s: props, - x: null, - r: active_effect, - l: legacy_mode_flag && !runes ? { - s: null, - u: null, - $: [] - } : null - }; -} -/** -* @template {Record} T -* @param {T} [component] -* @returns {T} -*/ -function pop(component) { - var context = component_context; - var effects = context.e; - if (effects !== null) { - context.e = null; - for (var fn of effects) create_user_effect(fn); - } - if (component !== void 0) context.x = component; - context.i = true; - component_context = context.p; - return component ?? {}; -} -/** @returns {boolean} */ -function is_runes() { - return !legacy_mode_flag || component_context !== null && component_context.l === null; -} -//#endregion -//#region node_modules/svelte/src/internal/client/dom/task.js -/** @type {Array<() => void>} */ -var micro_tasks = []; -function run_micro_tasks() { - var tasks = micro_tasks; - micro_tasks = []; - run_all(tasks); -} -/** -* @param {() => void} fn -*/ -function queue_micro_task(fn) { - if (micro_tasks.length === 0 && !is_flushing_sync) { - var tasks = micro_tasks; - queueMicrotask(() => { - if (tasks === micro_tasks) run_micro_tasks(); - }); - } - micro_tasks.push(fn); -} -/** -* Synchronously run any queued tasks. -*/ -function flush_tasks() { - while (micro_tasks.length > 0) run_micro_tasks(); -} -/** -* @param {unknown} error -*/ -function handle_error(error) { - var effect = active_effect; - if (effect === null) { - /** @type {Derived} */ active_reaction.f |= ERROR_VALUE; - return error; - } - if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error; - invoke_error_boundary(error, effect); -} -/** -* @param {unknown} error -* @param {Effect | null} effect -*/ -function invoke_error_boundary(error, effect) { - while (effect !== null) { - if ((effect.f & 128) !== 0) { - if ((effect.f & 32768) === 0) throw error; - try { - /** @type {Boundary} */ effect.b.error(error); - return; - } catch (e) { - error = e; - } - } - effect = effect.parent; - } - throw error; -} -//#endregion -//#region node_modules/svelte/src/internal/client/reactivity/status.js -/** @import { Derived, Signal } from '#client' */ -var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN); -/** -* @param {Signal} signal -* @param {number} status -*/ -function set_signal_status(signal, status) { - signal.f = signal.f & STATUS_MASK | status; -} -/** -* Set a derived's status to CLEAN or MAYBE_DIRTY based on its connection state. -* @param {Derived} derived -*/ -function update_derived_status(derived) { - if ((derived.f & 512) !== 0 || derived.deps === null) set_signal_status(derived, CLEAN); - else set_signal_status(derived, MAYBE_DIRTY); -} -//#endregion -//#region node_modules/svelte/src/internal/client/reactivity/utils.js -/** @import { Derived, Effect, Value } from '#client' */ -/** -* @param {Value[] | null} deps -*/ -function clear_marked(deps) { - if (deps === null) return; - for (const dep of deps) { - if ((dep.f & 2) === 0 || (dep.f & 65536) === 0) continue; - dep.f ^= WAS_MARKED; - clear_marked( - /** @type {Derived} */ - dep.deps - ); - } -} -/** -* @param {Effect} effect -* @param {Set} dirty_effects -* @param {Set} maybe_dirty_effects -*/ -function defer_effect(effect, dirty_effects, maybe_dirty_effects) { - if ((effect.f & 2048) !== 0) dirty_effects.add(effect); - else if ((effect.f & 4096) !== 0) maybe_dirty_effects.add(effect); - clear_marked(effect.deps); - set_signal_status(effect, CLEAN); -} -//#endregion -//#region node_modules/svelte/src/store/shared/index.js -/** @import { Readable, StartStopNotifier, Subscriber, Unsubscriber, Updater, Writable } from '../public.js' */ -/** @import { Stores, StoresValues, SubscribeInvalidateTuple } from '../private.js' */ -/** -* @type {Array | any>} -*/ -var subscriber_queue = []; -/** -* Creates a `Readable` store that allows reading by subscription. -* -* @template T -* @param {T} [value] initial value -* @param {StartStopNotifier} [start] -* @returns {Readable} -*/ -function readable(value, start) { - return { subscribe: writable(value, start).subscribe }; -} -/** -* Create a `Writable` store that allows both updating and reading by subscription. -* -* @template T -* @param {T} [value] initial value -* @param {StartStopNotifier} [start] -* @returns {Writable} -*/ -function writable(value, start = noop) { - /** @type {Unsubscriber | null} */ - let stop = null; - /** @type {Set>} */ - const subscribers = /* @__PURE__ */ new Set(); - /** - * @param {T} new_value - * @returns {void} - */ - function set(new_value) { - if (safe_not_equal(value, new_value)) { - value = new_value; - if (stop) { - const run_queue = !subscriber_queue.length; - for (const subscriber of subscribers) { - subscriber[1](); - subscriber_queue.push(subscriber, value); - } - if (run_queue) { - for (let i = 0; i < subscriber_queue.length; i += 2) subscriber_queue[i][0](subscriber_queue[i + 1]); - subscriber_queue.length = 0; - } - } - } - } - /** - * @param {Updater} fn - * @returns {void} - */ - function update(fn) { - set(fn(value)); - } - /** - * @param {Subscriber} run - * @param {() => void} [invalidate] - * @returns {Unsubscriber} - */ - function subscribe(run, invalidate = noop) { - /** @type {SubscribeInvalidateTuple} */ - const subscriber = [run, invalidate]; - subscribers.add(subscriber); - if (subscribers.size === 1) stop = start(set, update) || noop; - run(value); - return () => { - subscribers.delete(subscriber); - if (subscribers.size === 0 && stop) { - stop(); - stop = null; - } - }; - } - return { - set, - update, - subscribe - }; -} -/** -* Get the current value from a store by subscribing and immediately unsubscribing. -* -* @template T -* @param {Readable} store -* @returns {T} -*/ -function get$1(store) { - let value; - subscribe_to_store(store, (_) => value = _)(); - return value; -} -//#endregion -//#region node_modules/svelte/src/internal/client/reactivity/store.js -/** -* We set this to `true` when updating a store so that we correctly -* schedule effects if the update takes place inside a `$:` effect -*/ -var legacy_is_updating_store = false; -//#endregion -//#region node_modules/svelte/src/internal/client/reactivity/batch.js -/** @import { Fork } from 'svelte' */ -/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */ -/** @type {Set} */ -var batches = /* @__PURE__ */ new Set(); -/** @type {Batch | null} */ -var current_batch = null; -/** -* When time travelling (i.e. working in one batch, while other batches -* still have ongoing work), we ignore the real values of affected -* signals in favour of their values within the batch -* @type {Map | null} -*/ -var batch_values = null; -/** @type {Effect | null} */ -var last_scheduled_effect = null; -var is_flushing_sync = false; -var is_processing = false; -/** -* During traversal, this is an array. Newly created effects are (if not immediately -* executed) pushed to this array, rather than going through the scheduling -* rigamarole that would cause another turn of the flush loop. -* @type {Effect[] | null} -*/ -var collected_effects = null; -/** -* An array of effects that are marked during traversal as a result of a `set` -* (not `internal_set`) call. These will be added to the next batch and -* trigger another `batch.process()` -* @type {Effect[] | null} -* @deprecated when we get rid of legacy mode and stores, we can get rid of this -*/ -var legacy_updates = null; -var flush_count = 0; -var uid = 1; -var Batch = class Batch { - id = uid++; - /** - * The current values of any signals that are updated in this batch. - * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment) - * They keys of this map are identical to `this.#previous` - * @type {Map} - */ - current = /* @__PURE__ */ new Map(); - /** - * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place. - * They keys of this map are identical to `this.#current` - * @type {Map} - */ - previous = /* @__PURE__ */ new Map(); - /** - * When the batch is committed (and the DOM is updated), we need to remove old branches - * and append new ones by calling the functions added inside (if/each/key/etc) blocks - * @type {Set<(batch: Batch) => void>} - */ - #commit_callbacks = /* @__PURE__ */ new Set(); - /** - * If a fork is discarded, we need to destroy any effects that are no longer needed - * @type {Set<(batch: Batch) => void>} - */ - #discard_callbacks = /* @__PURE__ */ new Set(); - /** - * Callbacks that should run only when a fork is committed. - * @type {Set<(batch: Batch) => void>} - */ - #fork_commit_callbacks = /* @__PURE__ */ new Set(); - /** - * Async effects that are currently in flight - * @type {Map} - */ - #pending = /* @__PURE__ */ new Map(); - /** - * Async effects that are currently in flight, _not_ inside a pending boundary - * @type {Map} - */ - #blocking_pending = /* @__PURE__ */ new Map(); - /** - * A deferred that resolves when the batch is committed, used with `settled()` - * TODO replace with Promise.withResolvers once supported widely enough - * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} - */ - #deferred = null; - /** - * The root effects that need to be flushed - * @type {Effect[]} - */ - #roots = []; - /** - * Effects created while this batch was active. - * @type {Effect[]} - */ - #new_effects = []; - /** - * Deferred effects (which run after async work has completed) that are DIRTY - * @type {Set} - */ - #dirty_effects = /* @__PURE__ */ new Set(); - /** - * Deferred effects that are MAYBE_DIRTY - * @type {Set} - */ - #maybe_dirty_effects = /* @__PURE__ */ new Set(); - /** - * A map of branches that still exist, but will be destroyed when this batch - * is committed — we skip over these during `process`. - * The value contains child effects that were dirty/maybe_dirty before being reset, - * so they can be rescheduled if the branch survives. - * @type {Map} - */ - #skipped_branches = /* @__PURE__ */ new Map(); - /** - * Inverse of #skipped_branches which we need to tell prior batches to unskip them when committing - * @type {Set} - */ - #unskipped_branches = /* @__PURE__ */ new Set(); - is_fork = false; - #decrement_queued = false; - /** @type {Set} */ - #blockers = /* @__PURE__ */ new Set(); - #is_deferred() { - return this.is_fork || this.#blocking_pending.size > 0; - } - #is_blocked() { - for (const batch of this.#blockers) for (const effect of batch.#blocking_pending.keys()) { - var skipped = false; - var e = effect; - while (e.parent !== null) { - if (this.#skipped_branches.has(e)) { - skipped = true; - break; - } - e = e.parent; - } - if (!skipped) return true; - } - return false; - } - /** - * Add an effect to the #skipped_branches map and reset its children - * @param {Effect} effect - */ - skip_effect(effect) { - if (!this.#skipped_branches.has(effect)) this.#skipped_branches.set(effect, { - d: [], - m: [] - }); - this.#unskipped_branches.delete(effect); - } - /** - * Remove an effect from the #skipped_branches map and reschedule - * any tracked dirty/maybe_dirty child effects - * @param {Effect} effect - * @param {(e: Effect) => void} callback - */ - unskip_effect(effect, callback = (e) => this.schedule(e)) { - var tracked = this.#skipped_branches.get(effect); - if (tracked) { - this.#skipped_branches.delete(effect); - for (var e of tracked.d) { - set_signal_status(e, DIRTY); - callback(e); - } - for (e of tracked.m) { - set_signal_status(e, MAYBE_DIRTY); - callback(e); - } - } - this.#unskipped_branches.add(effect); - } - #process() { - if (flush_count++ > 1e3) { - batches.delete(this); - infinite_loop_guard(); - } - if (!this.#is_deferred()) { - for (const e of this.#dirty_effects) { - this.#maybe_dirty_effects.delete(e); - set_signal_status(e, DIRTY); - this.schedule(e); - } - for (const e of this.#maybe_dirty_effects) { - set_signal_status(e, MAYBE_DIRTY); - this.schedule(e); - } - } - const roots = this.#roots; - this.#roots = []; - this.apply(); - /** @type {Effect[]} */ - var effects = collected_effects = []; - /** @type {Effect[]} */ - var render_effects = []; - /** - * @type {Effect[]} - * @deprecated when we get rid of legacy mode and stores, we can get rid of this - */ - var updates = legacy_updates = []; - for (const root of roots) try { - this.#traverse(root, effects, render_effects); - } catch (e) { - reset_all(root); - throw e; - } - current_batch = null; - if (updates.length > 0) { - var batch = Batch.ensure(); - for (const e of updates) batch.schedule(e); - } - collected_effects = null; - legacy_updates = null; - if (this.#is_deferred() || this.#is_blocked()) { - this.#defer_effects(render_effects); - this.#defer_effects(effects); - for (const [e, t] of this.#skipped_branches) reset_branch(e, t); - } else { - if (this.#pending.size === 0) batches.delete(this); - this.#dirty_effects.clear(); - this.#maybe_dirty_effects.clear(); - for (const fn of this.#commit_callbacks) fn(this); - this.#commit_callbacks.clear(); - flush_queued_effects(render_effects); - flush_queued_effects(effects); - this.#deferred?.resolve(); - } - var next_batch = current_batch; - if (this.#roots.length > 0) { - const batch = next_batch ??= this; - batch.#roots.push(...this.#roots.filter((r) => !batch.#roots.includes(r))); - } - if (next_batch !== null) { - batches.add(next_batch); - next_batch.#process(); - } - if (async_mode_flag && !batches.has(this)) this.#commit(); - } - /** - * Traverse the effect tree, executing effects or stashing - * them for later execution as appropriate - * @param {Effect} root - * @param {Effect[]} effects - * @param {Effect[]} render_effects - */ - #traverse(root, effects, render_effects) { - root.f ^= CLEAN; - var effect = root.first; - while (effect !== null) { - var flags = effect.f; - var is_branch = (flags & 96) !== 0; - if (!(is_branch && (flags & 1024) !== 0 || (flags & 8192) !== 0 || this.#skipped_branches.has(effect)) && effect.fn !== null) { - if (is_branch) effect.f ^= CLEAN; - else if ((flags & 4) !== 0) effects.push(effect); - else if (async_mode_flag && (flags & 16777224) !== 0) render_effects.push(effect); - else if (is_dirty(effect)) { - if ((flags & 16) !== 0) this.#maybe_dirty_effects.add(effect); - update_effect(effect); - } - var child = effect.first; - if (child !== null) { - effect = child; - continue; - } - } - while (effect !== null) { - var next = effect.next; - if (next !== null) { - effect = next; - break; - } - effect = effect.parent; - } - } - } - /** - * @param {Effect[]} effects - */ - #defer_effects(effects) { - for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects); - } - /** - * Associate a change to a given source with the current - * batch, noting its previous and current values - * @param {Value} source - * @param {any} value - * @param {boolean} [is_derived] - */ - capture(source, value, is_derived = false) { - if (source.v !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, source.v); - if ((source.f & 8388608) === 0) { - this.current.set(source, [value, is_derived]); - batch_values?.set(source, value); - } - if (!this.is_fork) source.v = value; - } - activate() { - current_batch = this; - } - deactivate() { - current_batch = null; - batch_values = null; - } - flush() { - try { - is_processing = true; - current_batch = this; - this.#process(); - } finally { - flush_count = 0; - last_scheduled_effect = null; - collected_effects = null; - legacy_updates = null; - is_processing = false; - current_batch = null; - batch_values = null; - old_values.clear(); - } - } - discard() { - for (const fn of this.#discard_callbacks) fn(this); - this.#discard_callbacks.clear(); - this.#fork_commit_callbacks.clear(); - batches.delete(this); - } - /** - * @param {Effect} effect - */ - register_created_effect(effect) { - this.#new_effects.push(effect); - } - #commit() { - for (const batch of batches) { - var is_earlier = batch.id < this.id; - /** @type {Source[]} */ - var sources = []; - for (const [source, [value, is_derived]] of this.current) { - if (batch.current.has(source)) { - var batch_value = batch.current.get(source)[0]; - if (is_earlier && value !== batch_value) batch.current.set(source, [value, is_derived]); - else continue; - } - sources.push(source); - } - var others = [...batch.current.keys()].filter((s) => !this.current.has(s)); - if (others.length === 0) { - if (is_earlier) batch.discard(); - } else if (sources.length > 0) { - if (is_earlier) for (const unskipped of this.#unskipped_branches) batch.unskip_effect(unskipped, (e) => { - if ((e.f & 4194320) !== 0) batch.schedule(e); - else batch.#defer_effects([e]); - }); - batch.activate(); - /** @type {Set} */ - var marked = /* @__PURE__ */ new Set(); - /** @type {Map} */ - var checked = /* @__PURE__ */ new Map(); - for (var source of sources) mark_effects(source, others, marked, checked); - checked = /* @__PURE__ */ new Map(); - var current_unequal = [...batch.current.keys()].filter((c) => this.current.has(c) ? this.current.get(c)[0] !== c : true); - for (const effect of this.#new_effects) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) { - set_signal_status(effect, DIRTY); - batch.schedule(effect); - } else batch.#dirty_effects.add(effect); - if (batch.#roots.length > 0) { - batch.apply(); - for (var root of batch.#roots) batch.#traverse(root, [], []); - batch.#roots = []; - } - batch.deactivate(); - } - } - for (const batch of batches) if (batch.#blockers.has(this)) { - batch.#blockers.delete(this); - if (batch.#blockers.size === 0 && !batch.#is_deferred()) { - batch.activate(); - batch.#process(); - } - } - } - /** - * @param {boolean} blocking - * @param {Effect} effect - */ - increment(blocking, effect) { - let pending_count = this.#pending.get(effect) ?? 0; - this.#pending.set(effect, pending_count + 1); - if (blocking) { - let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0; - this.#blocking_pending.set(effect, blocking_pending_count + 1); - } - } - /** - * @param {boolean} blocking - * @param {Effect} effect - * @param {boolean} skip - whether to skip updates (because this is triggered by a stale reaction) - */ - decrement(blocking, effect, skip) { - let pending_count = this.#pending.get(effect) ?? 0; - if (pending_count === 1) this.#pending.delete(effect); - else this.#pending.set(effect, pending_count - 1); - if (blocking) { - let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0; - if (blocking_pending_count === 1) this.#blocking_pending.delete(effect); - else this.#blocking_pending.set(effect, blocking_pending_count - 1); - } - if (this.#decrement_queued || skip) return; - this.#decrement_queued = true; - queue_micro_task(() => { - this.#decrement_queued = false; - this.flush(); - }); - } - /** - * @param {Set} dirty_effects - * @param {Set} maybe_dirty_effects - */ - transfer_effects(dirty_effects, maybe_dirty_effects) { - for (const e of dirty_effects) this.#dirty_effects.add(e); - for (const e of maybe_dirty_effects) this.#maybe_dirty_effects.add(e); - dirty_effects.clear(); - maybe_dirty_effects.clear(); - } - /** @param {(batch: Batch) => void} fn */ - oncommit(fn) { - this.#commit_callbacks.add(fn); - } - /** @param {(batch: Batch) => void} fn */ - ondiscard(fn) { - this.#discard_callbacks.add(fn); - } - /** @param {(batch: Batch) => void} fn */ - on_fork_commit(fn) { - this.#fork_commit_callbacks.add(fn); - } - run_fork_commit_callbacks() { - for (const fn of this.#fork_commit_callbacks) fn(this); - this.#fork_commit_callbacks.clear(); - } - settled() { - return (this.#deferred ??= deferred()).promise; - } - static ensure() { - if (current_batch === null) { - const batch = current_batch = new Batch(); - if (!is_processing) { - batches.add(current_batch); - if (!is_flushing_sync) queue_micro_task(() => { - if (current_batch !== batch) return; - batch.flush(); - }); - } - } - return current_batch; - } - apply() { - if (!async_mode_flag || !this.is_fork && batches.size === 1) { - batch_values = null; - return; - } - batch_values = /* @__PURE__ */ new Map(); - for (const [source, [value]] of this.current) batch_values.set(source, value); - for (const batch of batches) { - if (batch === this || batch.is_fork) continue; - var intersects = false; - var differs = false; - if (batch.id < this.id) for (const [source, [, is_derived]] of batch.current) { - if (is_derived) continue; - intersects ||= this.current.has(source); - differs ||= !this.current.has(source); - } - if (intersects && differs) this.#blockers.add(batch); - else for (const [source, previous] of batch.previous) if (!batch_values.has(source)) batch_values.set(source, previous); - } - } - /** - * - * @param {Effect} effect - */ - schedule(effect) { - last_scheduled_effect = effect; - if (effect.b?.is_pending && (effect.f & 16777228) !== 0 && (effect.f & 32768) === 0) { - effect.b.defer_effect(effect); - return; - } - var e = effect; - while (e.parent !== null) { - e = e.parent; - var flags = e.f; - if (collected_effects !== null && e === active_effect) { - if (async_mode_flag) return; - if ((active_reaction === null || (active_reaction.f & 2) === 0) && !legacy_is_updating_store) return; - } - if ((flags & 96) !== 0) { - if ((flags & 1024) === 0) return; - e.f ^= CLEAN; - } - } - this.#roots.push(e); - } -}; -/** -* Synchronously flush any pending updates. -* Returns void if no callback is provided, otherwise returns the result of calling the callback. -* @template [T=void] -* @param {(() => T) | undefined} [fn] -* @returns {T} -*/ -function flushSync(fn) { - var was_flushing_sync = is_flushing_sync; - is_flushing_sync = true; - try { - var result; - if (fn) { - if (current_batch !== null && !current_batch.is_fork) current_batch.flush(); - result = fn(); - } - while (true) { - flush_tasks(); - if (current_batch === null) return result; - current_batch.flush(); - } - } finally { - is_flushing_sync = was_flushing_sync; - } -} -function infinite_loop_guard() { - try { - effect_update_depth_exceeded(); - } catch (error) { - invoke_error_boundary(error, last_scheduled_effect); - } -} -/** @type {Set | null} */ -var eager_block_effects = null; -/** -* @param {Array} effects -* @returns {void} -*/ -function flush_queued_effects(effects) { - var length = effects.length; - if (length === 0) return; - var i = 0; - while (i < length) { - var effect = effects[i++]; - if ((effect.f & 24576) === 0 && is_dirty(effect)) { - eager_block_effects = /* @__PURE__ */ new Set(); - update_effect(effect); - if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) unlink_effect(effect); - if (eager_block_effects?.size > 0) { - old_values.clear(); - for (const e of eager_block_effects) { - if ((e.f & 24576) !== 0) continue; - /** @type {Effect[]} */ - const ordered_effects = [e]; - let ancestor = e.parent; - while (ancestor !== null) { - if (eager_block_effects.has(ancestor)) { - eager_block_effects.delete(ancestor); - ordered_effects.push(ancestor); - } - ancestor = ancestor.parent; - } - for (let j = ordered_effects.length - 1; j >= 0; j--) { - const e = ordered_effects[j]; - if ((e.f & 24576) !== 0) continue; - update_effect(e); - } - } - eager_block_effects.clear(); - } - } - } - eager_block_effects = null; -} -/** -* This is similar to `mark_reactions`, but it only marks async/block effects -* depending on `value` and at least one of the other `sources`, so that -* these effects can re-run after another batch has been committed -* @param {Value} value -* @param {Source[]} sources -* @param {Set} marked -* @param {Map} checked -*/ -function mark_effects(value, sources, marked, checked) { - if (marked.has(value)) return; - marked.add(value); - if (value.reactions !== null) for (const reaction of value.reactions) { - const flags = reaction.f; - if ((flags & 2) !== 0) mark_effects(reaction, sources, marked, checked); - else if ((flags & 4194320) !== 0 && (flags & 2048) === 0 && depends_on(reaction, sources, checked)) { - set_signal_status(reaction, DIRTY); - schedule_effect(reaction); - } - } -} -/** -* @param {Reaction} reaction -* @param {Source[]} sources -* @param {Map} checked -*/ -function depends_on(reaction, sources, checked) { - const depends = checked.get(reaction); - if (depends !== void 0) return depends; - if (reaction.deps !== null) for (const dep of reaction.deps) { - if (includes.call(sources, dep)) return true; - if ((dep.f & 2) !== 0 && depends_on(dep, sources, checked)) { - checked.set(dep, true); - return true; - } - } - checked.set(reaction, false); - return false; -} -/** -* @param {Effect} effect -* @returns {void} -*/ -function schedule_effect(effect) { - /** @type {Batch} */ current_batch.schedule(effect); -} -/** -* Mark all the effects inside a skipped branch CLEAN, so that -* they can be correctly rescheduled later. Tracks dirty and maybe_dirty -* effects so they can be rescheduled if the branch survives. -* @param {Effect} effect -* @param {{ d: Effect[], m: Effect[] }} tracked -*/ -function reset_branch(effect, tracked) { - if ((effect.f & 32) !== 0 && (effect.f & 1024) !== 0) return; - if ((effect.f & 2048) !== 0) tracked.d.push(effect); - else if ((effect.f & 4096) !== 0) tracked.m.push(effect); - set_signal_status(effect, CLEAN); - var e = effect.first; - while (e !== null) { - reset_branch(e, tracked); - e = e.next; - } -} -/** -* Mark an entire effect tree clean following an error -* @param {Effect} effect -*/ -function reset_all(effect) { - set_signal_status(effect, CLEAN); - var e = effect.first; - while (e !== null) { - reset_all(e); - e = e.next; - } -} -//#endregion -//#region node_modules/svelte/src/reactivity/create-subscriber.js -/** -* Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity. -* It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`. -* -* If `subscribe` is called inside an effect (including indirectly, for example inside a getter), -* the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs. -* -* If `start` returns a cleanup function, it will be called when the effect is destroyed. -* -* If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects -* are active, and the returned teardown function will only be called when all effects are destroyed. -* -* It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery): -* -* ```js -* import { createSubscriber } from 'svelte/reactivity'; -* import { on } from 'svelte/events'; -* -* export class MediaQuery { -* #query; -* #subscribe; -* -* constructor(query) { -* this.#query = window.matchMedia(`(${query})`); -* -* this.#subscribe = createSubscriber((update) => { -* // when the `change` event occurs, re-run any effects that read `this.current` -* const off = on(this.#query, 'change', update); -* -* // stop listening when all the effects are destroyed -* return () => off(); -* }); -* } -* -* get current() { -* // This makes the getter reactive, if read in an effect -* this.#subscribe(); -* -* // Return the current state of the query, whether or not we're in an effect -* return this.#query.matches; -* } -* } -* ``` -* @param {(update: () => void) => (() => void) | void} start -* @since 5.7.0 -*/ -function createSubscriber(start) { - let subscribers = 0; - let version = source(0); - /** @type {(() => void) | void} */ - let stop; - return () => { - if (effect_tracking()) { - get(version); - render_effect(() => { - if (subscribers === 0) stop = untrack(() => start(() => increment(version))); - subscribers += 1; - return () => { - queue_micro_task(() => { - subscribers -= 1; - if (subscribers === 0) { - stop?.(); - stop = void 0; - increment(version); - } - }); - }; - }); - } - }; -} -//#endregion -//#region node_modules/svelte/src/internal/client/dom/blocks/boundary.js -/** @import { Effect, Source, TemplateNode, } from '#client' */ -/** -* @typedef {{ -* onerror?: (error: unknown, reset: () => void) => void; -* failed?: (anchor: Node, error: () => unknown, reset: () => () => void) => void; -* pending?: (anchor: Node) => void; -* }} BoundaryProps -*/ -var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED; -/** -* @param {TemplateNode} node -* @param {BoundaryProps} props -* @param {((anchor: Node) => void)} children -* @param {((error: unknown) => unknown) | undefined} [transform_error] -* @returns {void} -*/ -function boundary(node, props, children, transform_error) { - new Boundary(node, props, children, transform_error); -} -var Boundary = class { - /** @type {Boundary | null} */ - parent; - is_pending = false; - /** - * API-level transformError transform function. Transforms errors before they reach the `failed` snippet. - * Inherited from parent boundary, or defaults to identity. - * @type {(error: unknown) => unknown} - */ - transform_error; - /** @type {TemplateNode} */ - #anchor; - /** @type {TemplateNode | null} */ - #hydrate_open = hydrating ? hydrate_node : null; - /** @type {BoundaryProps} */ - #props; - /** @type {((anchor: Node) => void)} */ - #children; - /** @type {Effect} */ - #effect; - /** @type {Effect | null} */ - #main_effect = null; - /** @type {Effect | null} */ - #pending_effect = null; - /** @type {Effect | null} */ - #failed_effect = null; - /** @type {DocumentFragment | null} */ - #offscreen_fragment = null; - #local_pending_count = 0; - #pending_count = 0; - #pending_count_update_queued = false; - /** @type {Set} */ - #dirty_effects = /* @__PURE__ */ new Set(); - /** @type {Set} */ - #maybe_dirty_effects = /* @__PURE__ */ new Set(); - /** - * A source containing the number of pending async deriveds/expressions. - * Only created if `$effect.pending()` is used inside the boundary, - * otherwise updating the source results in needless `Batch.ensure()` - * calls followed by no-op flushes - * @type {Source | null} - */ - #effect_pending = null; - #effect_pending_subscriber = createSubscriber(() => { - this.#effect_pending = source(this.#local_pending_count); - return () => { - this.#effect_pending = null; - }; - }); - /** - * @param {TemplateNode} node - * @param {BoundaryProps} props - * @param {((anchor: Node) => void)} children - * @param {((error: unknown) => unknown) | undefined} [transform_error] - */ - constructor(node, props, children, transform_error) { - this.#anchor = node; - this.#props = props; - this.#children = (anchor) => { - var effect = active_effect; - effect.b = this; - effect.f |= 128; - children(anchor); - }; - this.parent = active_effect.b; - this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e); - this.#effect = block(() => { - if (hydrating) { - const comment = this.#hydrate_open; - hydrate_next(); - const server_rendered_pending = comment.data === "[!"; - if (comment.data.startsWith("[?")) { - const serialized_error = JSON.parse(comment.data.slice(2)); - this.#hydrate_failed_content(serialized_error); - } else if (server_rendered_pending) this.#hydrate_pending_content(); - else this.#hydrate_resolved_content(); - } else this.#render(); - }, flags); - if (hydrating) this.#anchor = hydrate_node; - } - #hydrate_resolved_content() { - try { - this.#main_effect = branch(() => this.#children(this.#anchor)); - } catch (error) { - this.error(error); - } - } - /** - * @param {unknown} error The deserialized error from the server's hydration comment - */ - #hydrate_failed_content(error) { - const failed = this.#props.failed; - if (!failed) return; - this.#failed_effect = branch(() => { - failed(this.#anchor, () => error, () => () => {}); - }); - } - #hydrate_pending_content() { - const pending = this.#props.pending; - if (!pending) return; - this.is_pending = true; - this.#pending_effect = branch(() => pending(this.#anchor)); - queue_micro_task(() => { - var fragment = this.#offscreen_fragment = document.createDocumentFragment(); - var anchor = create_text(); - fragment.append(anchor); - this.#main_effect = this.#run(() => { - return branch(() => this.#children(anchor)); - }); - if (this.#pending_count === 0) { - this.#anchor.before(fragment); - this.#offscreen_fragment = null; - pause_effect(this.#pending_effect, () => { - this.#pending_effect = null; - }); - this.#resolve(current_batch); - } - }); - } - #render() { - try { - this.is_pending = this.has_pending_snippet(); - this.#pending_count = 0; - this.#local_pending_count = 0; - this.#main_effect = branch(() => { - this.#children(this.#anchor); - }); - if (this.#pending_count > 0) { - var fragment = this.#offscreen_fragment = document.createDocumentFragment(); - move_effect(this.#main_effect, fragment); - const pending = this.#props.pending; - this.#pending_effect = branch(() => pending(this.#anchor)); - } else this.#resolve(current_batch); - } catch (error) { - this.error(error); - } - } - /** - * @param {Batch} batch - */ - #resolve(batch) { - this.is_pending = false; - batch.transfer_effects(this.#dirty_effects, this.#maybe_dirty_effects); - } - /** - * Defer an effect inside a pending boundary until the boundary resolves - * @param {Effect} effect - */ - defer_effect(effect) { - defer_effect(effect, this.#dirty_effects, this.#maybe_dirty_effects); - } - /** - * Returns `false` if the effect exists inside a boundary whose pending snippet is shown - * @returns {boolean} - */ - is_rendered() { - return !this.is_pending && (!this.parent || this.parent.is_rendered()); - } - has_pending_snippet() { - return !!this.#props.pending; - } - /** - * @template T - * @param {() => T} fn - */ - #run(fn) { - var previous_effect = active_effect; - var previous_reaction = active_reaction; - var previous_ctx = component_context; - set_active_effect(this.#effect); - set_active_reaction(this.#effect); - set_component_context(this.#effect.ctx); - try { - Batch.ensure(); - return fn(); - } catch (e) { - handle_error(e); - return null; - } finally { - set_active_effect(previous_effect); - set_active_reaction(previous_reaction); - set_component_context(previous_ctx); - } - } - /** - * Updates the pending count associated with the currently visible pending snippet, - * if any, such that we can replace the snippet with content once work is done - * @param {1 | -1} d - * @param {Batch} batch - */ - #update_pending_count(d, batch) { - if (!this.has_pending_snippet()) { - if (this.parent) this.parent.#update_pending_count(d, batch); - return; - } - this.#pending_count += d; - if (this.#pending_count === 0) { - this.#resolve(batch); - if (this.#pending_effect) pause_effect(this.#pending_effect, () => { - this.#pending_effect = null; - }); - if (this.#offscreen_fragment) { - this.#anchor.before(this.#offscreen_fragment); - this.#offscreen_fragment = null; - } - } - } - /** - * Update the source that powers `$effect.pending()` inside this boundary, - * and controls when the current `pending` snippet (if any) is removed. - * Do not call from inside the class - * @param {1 | -1} d - * @param {Batch} batch - */ - update_pending_count(d, batch) { - this.#update_pending_count(d, batch); - this.#local_pending_count += d; - if (!this.#effect_pending || this.#pending_count_update_queued) return; - this.#pending_count_update_queued = true; - queue_micro_task(() => { - this.#pending_count_update_queued = false; - if (this.#effect_pending) internal_set(this.#effect_pending, this.#local_pending_count); - }); - } - get_effect_pending() { - this.#effect_pending_subscriber(); - return get(this.#effect_pending); - } - /** @param {unknown} error */ - error(error) { - if (!this.#props.onerror && !this.#props.failed) throw error; - if (current_batch?.is_fork) { - if (this.#main_effect) current_batch.skip_effect(this.#main_effect); - if (this.#pending_effect) current_batch.skip_effect(this.#pending_effect); - if (this.#failed_effect) current_batch.skip_effect(this.#failed_effect); - current_batch.on_fork_commit(() => { - this.#handle_error(error); - }); - } else this.#handle_error(error); - } - /** - * @param {unknown} error - */ - #handle_error(error) { - if (this.#main_effect) { - destroy_effect(this.#main_effect); - this.#main_effect = null; - } - if (this.#pending_effect) { - destroy_effect(this.#pending_effect); - this.#pending_effect = null; - } - if (this.#failed_effect) { - destroy_effect(this.#failed_effect); - this.#failed_effect = null; - } - if (hydrating) { - set_hydrate_node(this.#hydrate_open); - next(); - set_hydrate_node(skip_nodes()); - } - var onerror = this.#props.onerror; - let failed = this.#props.failed; - var did_reset = false; - var calling_on_error = false; - const reset = () => { - if (did_reset) { - svelte_boundary_reset_noop(); - return; - } - did_reset = true; - if (calling_on_error) svelte_boundary_reset_onerror(); - if (this.#failed_effect !== null) pause_effect(this.#failed_effect, () => { - this.#failed_effect = null; - }); - this.#run(() => { - this.#render(); - }); - }; - /** @param {unknown} transformed_error */ - const handle_error_result = (transformed_error) => { - try { - calling_on_error = true; - onerror?.(transformed_error, reset); - calling_on_error = false; - } catch (error) { - invoke_error_boundary(error, this.#effect && this.#effect.parent); - } - if (failed) this.#failed_effect = this.#run(() => { - try { - return branch(() => { - var effect = active_effect; - effect.b = this; - effect.f |= 128; - failed(this.#anchor, () => transformed_error, () => reset); - }); - } catch (error) { - invoke_error_boundary(error, this.#effect.parent); - return null; - } - }); - }; - queue_micro_task(() => { - /** @type {unknown} */ - var result; - try { - result = this.transform_error(error); - } catch (e) { - invoke_error_boundary(e, this.#effect && this.#effect.parent); - return; - } - if (result !== null && typeof result === "object" && typeof result.then === "function") - /** @type {any} */ result.then( - handle_error_result, - /** @param {unknown} e */ - (e) => invoke_error_boundary(e, this.#effect && this.#effect.parent) - ); - else handle_error_result(result); - }); - } -}; -/** -* @param {Derived} derived -* @returns {void} -*/ -function destroy_derived_effects(derived) { - var effects = derived.effects; - if (effects !== null) { - derived.effects = null; - for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]); - } -} -/** -* @template T -* @param {Derived} derived -* @returns {T} -*/ -function execute_derived(derived) { - var value; - var prev_active_effect = active_effect; - var parent = derived.parent; - if (!is_destroying_effect && parent !== null && (parent.f & 24576) !== 0) { - derived_inert(); - return derived.v; - } - set_active_effect(parent); - try { - derived.f &= ~WAS_MARKED; - destroy_derived_effects(derived); - value = update_reaction(derived); - } finally { - set_active_effect(prev_active_effect); - } - return value; -} -/** -* @param {Derived} derived -* @returns {void} -*/ -function update_derived(derived) { - var value = execute_derived(derived); - if (!derived.equals(value)) { - derived.wv = increment_write_version(); - if (!current_batch?.is_fork || derived.deps === null) { - if (current_batch !== null) current_batch.capture(derived, value, true); - else derived.v = value; - if (derived.deps === null) { - set_signal_status(derived, CLEAN); - return; - } - } - } - if (is_destroying_effect) return; - if (batch_values !== null) { - if (effect_tracking() || current_batch?.is_fork) batch_values.set(derived, value); - } else update_derived_status(derived); -} -/** -* @param {Derived} derived -*/ -function freeze_derived_effects(derived) { - if (derived.effects === null) return; - for (const e of derived.effects) if (e.teardown || e.ac) { - e.teardown?.(); - e.ac?.abort(STALE_REACTION); - e.teardown = noop; - e.ac = null; - remove_reactions(e, 0); - destroy_effect_children(e); - } -} -/** -* @param {Derived} derived -*/ -function unfreeze_derived_effects(derived) { - if (derived.effects === null) return; - for (const e of derived.effects) if (e.teardown) update_effect(e); -} -//#endregion -//#region node_modules/svelte/src/internal/client/reactivity/sources.js -/** @import { Derived, Effect, Source, Value } from '#client' */ -/** @type {Set} */ -var eager_effects = /* @__PURE__ */ new Set(); -/** @type {Map} */ -var old_values = /* @__PURE__ */ new Map(); -var eager_effects_deferred = false; -/** -* @template V -* @param {V} v -* @param {Error | null} [stack] -* @returns {Source} -*/ -function source(v, stack) { - return { - f: 0, - v, - reactions: null, - equals, - rv: 0, - wv: 0 - }; -} -/** -* @template V -* @param {V} v -* @param {Error | null} [stack] -*/ -/* @__NO_SIDE_EFFECTS__ */ -function state(v, stack) { - const s = source(v, stack); - push_reaction_value(s); - return s; -} -/** -* @template V -* @param {V} initial_value -* @param {boolean} [immutable] -* @returns {Source} -*/ -/* @__NO_SIDE_EFFECTS__ */ -function mutable_source(initial_value, immutable = false, trackable = true) { - const s = source(initial_value); - if (!immutable) s.equals = safe_equals; - if (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) (component_context.l.s ??= []).push(s); - return s; -} -/** -* @template V -* @param {Source} source -* @param {V} value -* @param {boolean} [should_proxy] -* @returns {V} -*/ -function set(source, value, should_proxy = false) { - if (active_reaction !== null && (!untracking || (active_reaction.f & 131072) !== 0) && is_runes() && (active_reaction.f & 4325394) !== 0 && (current_sources === null || !includes.call(current_sources, source))) state_unsafe_mutation(); - return internal_set(source, should_proxy ? proxy(value) : value, legacy_updates); -} -/** -* @template V -* @param {Source} source -* @param {V} value -* @param {Effect[] | null} [updated_during_traversal] -* @returns {V} -*/ -function internal_set(source, value, updated_during_traversal = null) { - if (!source.equals(value)) { - old_values.set(source, is_destroying_effect ? value : source.v); - var batch = Batch.ensure(); - batch.capture(source, value); - if ((source.f & 2) !== 0) { - const derived = source; - if ((source.f & 2048) !== 0) execute_derived(derived); - if (batch_values === null) update_derived_status(derived); - } - source.wv = increment_write_version(); - mark_reactions(source, DIRTY, updated_during_traversal); - if (is_runes() && active_effect !== null && (active_effect.f & 1024) !== 0 && (active_effect.f & 96) === 0) if (untracked_writes === null) set_untracked_writes([source]); - else untracked_writes.push(source); - if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) flush_eager_effects(); - } - return value; -} -function flush_eager_effects() { - eager_effects_deferred = false; - for (const effect of eager_effects) { - if ((effect.f & 1024) !== 0) set_signal_status(effect, MAYBE_DIRTY); - if (is_dirty(effect)) update_effect(effect); - } - eager_effects.clear(); -} -/** -* Silently (without using `get`) increment a source -* @param {Source} source -*/ -function increment(source) { - set(source, source.v + 1); -} -/** -* @param {Value} signal -* @param {number} status should be DIRTY or MAYBE_DIRTY -* @param {Effect[] | null} updated_during_traversal -* @returns {void} -*/ -function mark_reactions(signal, status, updated_during_traversal) { - var reactions = signal.reactions; - if (reactions === null) return; - var runes = is_runes(); - var length = reactions.length; - for (var i = 0; i < length; i++) { - var reaction = reactions[i]; - var flags = reaction.f; - if (!runes && reaction === active_effect) continue; - var not_dirty = (flags & DIRTY) === 0; - if (not_dirty) set_signal_status(reaction, status); - if ((flags & 2) !== 0) { - var derived = reaction; - batch_values?.delete(derived); - if ((flags & 65536) === 0) { - if (flags & 512 && (active_effect === null || (active_effect.f & 2097152) === 0)) reaction.f |= WAS_MARKED; - mark_reactions(derived, MAYBE_DIRTY, updated_during_traversal); - } - } else if (not_dirty) { - var effect = reaction; - if ((flags & 16) !== 0 && eager_block_effects !== null) eager_block_effects.add(effect); - if (updated_during_traversal !== null) updated_during_traversal.push(effect); - else schedule_effect(effect); - } - } -} -/** -* @template T -* @param {T} value -* @returns {T} -*/ -function proxy(value) { - if (typeof value !== "object" || value === null || STATE_SYMBOL in value) return value; - const prototype = get_prototype_of(value); - if (prototype !== object_prototype && prototype !== array_prototype) return value; - /** @type {Map>} */ - var sources = /* @__PURE__ */ new Map(); - var is_proxied_array = is_array(value); - var version = /* @__PURE__ */ state(0); - var stack = null; - var parent_version = update_version; - /** - * Executes the proxy in the context of the reaction it was originally created in, if any - * @template T - * @param {() => T} fn - */ - var with_parent = (fn) => { - if (update_version === parent_version) return fn(); - var reaction = active_reaction; - var version = update_version; - set_active_reaction(null); - set_update_version(parent_version); - var result = fn(); - set_active_reaction(reaction); - set_update_version(version); - return result; - }; - if (is_proxied_array) sources.set("length", /* @__PURE__ */ state( - /** @type {any[]} */ - value.length, - stack - )); - return new Proxy(value, { - defineProperty(_, prop, descriptor) { - if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) state_descriptors_fixed(); - var s = sources.get(prop); - if (s === void 0) with_parent(() => { - var s = /* @__PURE__ */ state(descriptor.value, stack); - sources.set(prop, s); - return s; - }); - else set(s, descriptor.value, true); - return true; - }, - deleteProperty(target, prop) { - var s = sources.get(prop); - if (s === void 0) { - if (prop in target) { - const s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED, stack)); - sources.set(prop, s); - increment(version); - } - } else { - set(s, UNINITIALIZED); - increment(version); - } - return true; - }, - get(target, prop, receiver) { - if (prop === STATE_SYMBOL) return value; - var s = sources.get(prop); - var exists = prop in target; - if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) { - s = with_parent(() => { - return /* @__PURE__ */ state(proxy(exists ? target[prop] : UNINITIALIZED), stack); - }); - sources.set(prop, s); - } - if (s !== void 0) { - var v = get(s); - return v === UNINITIALIZED ? void 0 : v; - } - return Reflect.get(target, prop, receiver); - }, - getOwnPropertyDescriptor(target, prop) { - var descriptor = Reflect.getOwnPropertyDescriptor(target, prop); - if (descriptor && "value" in descriptor) { - var s = sources.get(prop); - if (s) descriptor.value = get(s); - } else if (descriptor === void 0) { - var source = sources.get(prop); - var value = source?.v; - if (source !== void 0 && value !== UNINITIALIZED) return { - enumerable: true, - configurable: true, - value, - writable: true - }; - } - return descriptor; - }, - has(target, prop) { - if (prop === STATE_SYMBOL) return true; - var s = sources.get(prop); - var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop); - if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) { - if (s === void 0) { - s = with_parent(() => { - return /* @__PURE__ */ state(has ? proxy(target[prop]) : UNINITIALIZED, stack); - }); - sources.set(prop, s); - } - if (get(s) === UNINITIALIZED) return false; - } - return has; - }, - set(target, prop, value, receiver) { - var s = sources.get(prop); - var has = prop in target; - if (is_proxied_array && prop === "length") for (var i = value; i < s.v; i += 1) { - var other_s = sources.get(i + ""); - if (other_s !== void 0) set(other_s, UNINITIALIZED); - else if (i in target) { - other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED, stack)); - sources.set(i + "", other_s); - } - } - if (s === void 0) { - if (!has || get_descriptor(target, prop)?.writable) { - s = with_parent(() => /* @__PURE__ */ state(void 0, stack)); - set(s, proxy(value)); - sources.set(prop, s); - } - } else { - has = s.v !== UNINITIALIZED; - var p = with_parent(() => proxy(value)); - set(s, p); - } - var descriptor = Reflect.getOwnPropertyDescriptor(target, prop); - if (descriptor?.set) descriptor.set.call(receiver, value); - if (!has) { - if (is_proxied_array && typeof prop === "string") { - var ls = sources.get("length"); - var n = Number(prop); - if (Number.isInteger(n) && n >= ls.v) set(ls, n + 1); - } - increment(version); - } - return true; - }, - ownKeys(target) { - get(version); - var own_keys = Reflect.ownKeys(target).filter((key) => { - var source = sources.get(key); - return source === void 0 || source.v !== UNINITIALIZED; - }); - for (var [key, source] of sources) if (source.v !== UNINITIALIZED && !(key in target)) own_keys.push(key); - return own_keys; - }, - setPrototypeOf() { - state_prototype_fixed(); - } - }); -} -//#endregion -//#region node_modules/svelte/src/internal/client/dom/operations.js -/** @type {Window} */ -var $window; -/** @type {() => Node | null} */ -var first_child_getter; -/** @type {() => Node | null} */ -var next_sibling_getter; -/** -* Initialize these lazily to avoid issues when using the runtime in a server context -* where these globals are not available while avoiding a separate server entry point -*/ -function init_operations() { - if ($window !== void 0) return; - $window = window; - /Firefox/.test(navigator.userAgent); - var element_prototype = Element.prototype; - var node_prototype = Node.prototype; - var text_prototype = Text.prototype; - first_child_getter = get_descriptor(node_prototype, "firstChild").get; - next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get; - if (is_extensible(element_prototype)) { - element_prototype.__click = void 0; - element_prototype.__className = void 0; - element_prototype.__attributes = null; - element_prototype.__style = void 0; - element_prototype.__e = void 0; - } - if (is_extensible(text_prototype)) text_prototype.__t = void 0; -} -/** -* @param {string} value -* @returns {Text} -*/ -function create_text(value = "") { - return document.createTextNode(value); -} -/** -* @template {Node} N -* @param {N} node -*/ -/* @__NO_SIDE_EFFECTS__ */ -function get_first_child(node) { - return first_child_getter.call(node); -} -/** -* @template {Node} N -* @param {N} node -*/ -/* @__NO_SIDE_EFFECTS__ */ -function get_next_sibling(node) { - return next_sibling_getter.call(node); -} -/** -* @template {Node} N -* @param {N} node -* @returns {void} -*/ -function clear_text_content(node) { - node.textContent = ""; -} -//#endregion -//#region node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js -/** -* @template T -* @param {() => T} fn -*/ -function without_reactive_context(fn) { - var previous_reaction = active_reaction; - var previous_effect = active_effect; - set_active_reaction(null); - set_active_effect(null); - try { - return fn(); - } finally { - set_active_reaction(previous_reaction); - set_active_effect(previous_effect); - } -} -//#endregion -//#region node_modules/svelte/src/internal/client/reactivity/effects.js -/** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */ -/** -* @param {Effect} effect -* @param {Effect} parent_effect -*/ -function push_effect(effect, parent_effect) { - var parent_last = parent_effect.last; - if (parent_last === null) parent_effect.last = parent_effect.first = effect; - else { - parent_last.next = effect; - effect.prev = parent_last; - parent_effect.last = effect; - } -} -/** -* @param {number} type -* @param {null | (() => void | (() => void))} fn -* @returns {Effect} -*/ -function create_effect(type, fn) { - var parent = active_effect; - if (parent !== null && (parent.f & 8192) !== 0) type |= INERT; - /** @type {Effect} */ - var effect = { - ctx: component_context, - deps: null, - nodes: null, - f: type | DIRTY | 512, - first: null, - fn, - last: null, - next: null, - parent, - b: parent && parent.b, - prev: null, - teardown: null, - wv: 0, - ac: null - }; - current_batch?.register_created_effect(effect); - /** @type {Effect | null} */ - var e = effect; - if ((type & 4) !== 0) if (collected_effects !== null) collected_effects.push(effect); - else Batch.ensure().schedule(effect); - else if (fn !== null) { - try { - update_effect(effect); - } catch (e) { - destroy_effect(effect); - throw e; - } - if (e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && (e.f & 524288) === 0) { - e = e.first; - if ((type & 16) !== 0 && (type & 65536) !== 0 && e !== null) e.f |= EFFECT_TRANSPARENT; - } - } - if (e !== null) { - e.parent = parent; - if (parent !== null) push_effect(e, parent); - if (active_reaction !== null && (active_reaction.f & 2) !== 0 && (type & 64) === 0) { - var derived = active_reaction; - (derived.effects ??= []).push(e); - } - } - return effect; -} -/** -* Internal representation of `$effect.tracking()` -* @returns {boolean} -*/ -function effect_tracking() { - return active_reaction !== null && !untracking; -} -/** -* @param {() => void | (() => void)} fn -*/ -function create_user_effect(fn) { - return create_effect(4 | USER_EFFECT, fn); -} -/** -* An effect root whose children can transition out -* @param {() => void} fn -* @returns {(options?: { outro?: boolean }) => Promise} -*/ -function component_root(fn) { - Batch.ensure(); - const effect = create_effect(64 | EFFECT_PRESERVED, fn); - return (options = {}) => { - return new Promise((fulfil) => { - if (options.outro) pause_effect(effect, () => { - destroy_effect(effect); - fulfil(void 0); - }); - else { - destroy_effect(effect); - fulfil(void 0); - } - }); - }; -} -/** -* @param {() => void | (() => void)} fn -* @returns {Effect} -*/ -function render_effect(fn, flags = 0) { - return create_effect(8 | flags, fn); -} -/** -* @param {(() => void)} fn -* @param {number} flags -*/ -function block(fn, flags = 0) { - return create_effect(16 | flags, fn); -} -/** -* @param {(() => void)} fn -*/ -function branch(fn) { - return create_effect(32 | EFFECT_PRESERVED, fn); -} -/** -* @param {Effect} effect -*/ -function execute_effect_teardown(effect) { - var teardown = effect.teardown; - if (teardown !== null) { - const previously_destroying_effect = is_destroying_effect; - const previous_reaction = active_reaction; - set_is_destroying_effect(true); - set_active_reaction(null); - try { - teardown.call(null); - } finally { - set_is_destroying_effect(previously_destroying_effect); - set_active_reaction(previous_reaction); - } - } -} -/** -* @param {Effect} signal -* @param {boolean} remove_dom -* @returns {void} -*/ -function destroy_effect_children(signal, remove_dom = false) { - var effect = signal.first; - signal.first = signal.last = null; - while (effect !== null) { - const controller = effect.ac; - if (controller !== null) without_reactive_context(() => { - controller.abort(STALE_REACTION); - }); - var next = effect.next; - if ((effect.f & 64) !== 0) effect.parent = null; - else destroy_effect(effect, remove_dom); - effect = next; - } -} -/** -* @param {Effect} signal -* @returns {void} -*/ -function destroy_block_effect_children(signal) { - var effect = signal.first; - while (effect !== null) { - var next = effect.next; - if ((effect.f & 32) === 0) destroy_effect(effect); - effect = next; - } -} -/** -* @param {Effect} effect -* @param {boolean} [remove_dom] -* @returns {void} -*/ -function destroy_effect(effect, remove_dom = true) { - var removed = false; - if ((remove_dom || (effect.f & 262144) !== 0) && effect.nodes !== null && effect.nodes.end !== null) { - remove_effect_dom(effect.nodes.start, effect.nodes.end); - removed = true; - } - set_signal_status(effect, DESTROYING); - destroy_effect_children(effect, remove_dom && !removed); - remove_reactions(effect, 0); - var transitions = effect.nodes && effect.nodes.t; - if (transitions !== null) for (const transition of transitions) transition.stop(); - execute_effect_teardown(effect); - effect.f ^= DESTROYING; - effect.f |= DESTROYED; - var parent = effect.parent; - if (parent !== null && parent.first !== null) unlink_effect(effect); - effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null; -} -/** -* -* @param {TemplateNode | null} node -* @param {TemplateNode} end -*/ -function remove_effect_dom(node, end) { - while (node !== null) { - /** @type {TemplateNode | null} */ - var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node); - node.remove(); - node = next; - } -} -/** -* Detach an effect from the effect tree, freeing up memory and -* reducing the amount of work that happens on subsequent traversals -* @param {Effect} effect -*/ -function unlink_effect(effect) { - var parent = effect.parent; - var prev = effect.prev; - var next = effect.next; - if (prev !== null) prev.next = next; - if (next !== null) next.prev = prev; - if (parent !== null) { - if (parent.first === effect) parent.first = next; - if (parent.last === effect) parent.last = prev; - } -} -/** -* When a block effect is removed, we don't immediately destroy it or yank it -* out of the DOM, because it might have transitions. Instead, we 'pause' it. -* It stays around (in memory, and in the DOM) until outro transitions have -* completed, and if the state change is reversed then we _resume_ it. -* A paused effect does not update, and the DOM subtree becomes inert. -* @param {Effect} effect -* @param {() => void} [callback] -* @param {boolean} [destroy] -*/ -function pause_effect(effect, callback, destroy = true) { - /** @type {TransitionManager[]} */ - var transitions = []; - pause_children(effect, transitions, true); - var fn = () => { - if (destroy) destroy_effect(effect); - if (callback) callback(); - }; - var remaining = transitions.length; - if (remaining > 0) { - var check = () => --remaining || fn(); - for (var transition of transitions) transition.out(check); - } else fn(); -} -/** -* @param {Effect} effect -* @param {TransitionManager[]} transitions -* @param {boolean} local -*/ -function pause_children(effect, transitions, local) { - if ((effect.f & 8192) !== 0) return; - effect.f ^= INERT; - var t = effect.nodes && effect.nodes.t; - if (t !== null) { - for (const transition of t) if (transition.is_global || local) transitions.push(transition); - } - var child = effect.first; - while (child !== null) { - var sibling = child.next; - if ((child.f & 64) === 0) { - var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0; - pause_children(child, transitions, transparent ? local : false); - } - child = sibling; - } -} -/** -* @param {Effect} effect -* @param {DocumentFragment} fragment -*/ -function move_effect(effect, fragment) { - if (!effect.nodes) return; - /** @type {TemplateNode | null} */ - var node = effect.nodes.start; - var end = effect.nodes.end; - while (node !== null) { - /** @type {TemplateNode | null} */ - var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node); - fragment.append(node); - node = next; - } -} -//#endregion -//#region node_modules/svelte/src/internal/client/legacy.js -/** -* @type {Set | null} -* @deprecated -*/ -var captured_signals = null; -//#endregion -//#region node_modules/svelte/src/internal/client/runtime.js -/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */ -var is_updating_effect = false; -var is_destroying_effect = false; -/** @param {boolean} value */ -function set_is_destroying_effect(value) { - is_destroying_effect = value; -} -/** @type {null | Reaction} */ -var active_reaction = null; -var untracking = false; -/** @param {null | Reaction} reaction */ -function set_active_reaction(reaction) { - active_reaction = reaction; -} -/** @type {null | Effect} */ -var active_effect = null; -/** @param {null | Effect} effect */ -function set_active_effect(effect) { - active_effect = effect; -} -/** -* When sources are created within a reaction, reading and writing -* them within that reaction should not cause a re-run -* @type {null | Source[]} -*/ -var current_sources = null; -/** @param {Value} value */ -function push_reaction_value(value) { - if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) if (current_sources === null) current_sources = [value]; - else current_sources.push(value); -} -/** -* The dependencies of the reaction that is currently being executed. In many cases, -* the dependencies are unchanged between runs, and so this will be `null` unless -* and until a new dependency is accessed — we track this via `skipped_deps` -* @type {null | Value[]} -*/ -var new_deps = null; -var skipped_deps = 0; -/** -* Tracks writes that the effect it's executed in doesn't listen to yet, -* so that the dependency can be added to the effect later on if it then reads it -* @type {null | Source[]} -*/ -var untracked_writes = null; -/** @param {null | Source[]} value */ -function set_untracked_writes(value) { - untracked_writes = value; -} -/** -* @type {number} Used by sources and deriveds for handling updates. -* Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing -**/ -var write_version = 1; -/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */ -var read_version = 0; -var update_version = read_version; -/** @param {number} value */ -function set_update_version(value) { - update_version = value; -} -function increment_write_version() { - return ++write_version; -} -/** -* Determines whether a derived or effect is dirty. -* If it is MAYBE_DIRTY, will set the status to CLEAN -* @param {Reaction} reaction -* @returns {boolean} -*/ -function is_dirty(reaction) { - var flags = reaction.f; - if ((flags & 2048) !== 0) return true; - if (flags & 2) reaction.f &= ~WAS_MARKED; - if ((flags & 4096) !== 0) { - var dependencies = reaction.deps; - var length = dependencies.length; - for (var i = 0; i < length; i++) { - var dependency = dependencies[i]; - if (is_dirty(dependency)) update_derived(dependency); - if (dependency.wv > reaction.wv) return true; - } - if ((flags & 512) !== 0 && batch_values === null) set_signal_status(reaction, CLEAN); - } - return false; -} -/** -* @param {Value} signal -* @param {Effect} effect -* @param {boolean} [root] -*/ -function schedule_possible_effect_self_invalidation(signal, effect, root = true) { - var reactions = signal.reactions; - if (reactions === null) return; - if (!async_mode_flag && current_sources !== null && includes.call(current_sources, signal)) return; - for (var i = 0; i < reactions.length; i++) { - var reaction = reactions[i]; - if ((reaction.f & 2) !== 0) schedule_possible_effect_self_invalidation(reaction, effect, false); - else if (effect === reaction) { - if (root) set_signal_status(reaction, DIRTY); - else if ((reaction.f & 1024) !== 0) set_signal_status(reaction, MAYBE_DIRTY); - schedule_effect(reaction); - } - } -} -/** @param {Reaction} reaction */ -function update_reaction(reaction) { - var previous_deps = new_deps; - var previous_skipped_deps = skipped_deps; - var previous_untracked_writes = untracked_writes; - var previous_reaction = active_reaction; - var previous_sources = current_sources; - var previous_component_context = component_context; - var previous_untracking = untracking; - var previous_update_version = update_version; - var flags = reaction.f; - new_deps = null; - skipped_deps = 0; - untracked_writes = null; - active_reaction = (flags & 96) === 0 ? reaction : null; - current_sources = null; - set_component_context(reaction.ctx); - untracking = false; - update_version = ++read_version; - if (reaction.ac !== null) { - without_reactive_context(() => { - /** @type {AbortController} */ reaction.ac.abort(STALE_REACTION); - }); - reaction.ac = null; - } - try { - reaction.f |= REACTION_IS_UPDATING; - var fn = reaction.fn; - var result = fn(); - reaction.f |= REACTION_RAN; - var deps = reaction.deps; - var is_fork = current_batch?.is_fork; - if (new_deps !== null) { - var i; - if (!is_fork) remove_reactions(reaction, skipped_deps); - if (deps !== null && skipped_deps > 0) { - deps.length = skipped_deps + new_deps.length; - for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i]; - } else reaction.deps = deps = new_deps; - if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) (deps[i].reactions ??= []).push(reaction); - } else if (!is_fork && deps !== null && skipped_deps < deps.length) { - remove_reactions(reaction, skipped_deps); - deps.length = skipped_deps; - } - if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction); - if (previous_reaction !== null && previous_reaction !== reaction) { - read_version++; - if (previous_reaction.deps !== null) for (let i = 0; i < previous_skipped_deps; i += 1) previous_reaction.deps[i].rv = read_version; - if (previous_deps !== null) for (const dep of previous_deps) dep.rv = read_version; - if (untracked_writes !== null) if (previous_untracked_writes === null) previous_untracked_writes = untracked_writes; - else previous_untracked_writes.push(...untracked_writes); - } - if ((reaction.f & 8388608) !== 0) reaction.f ^= ERROR_VALUE; - return result; - } catch (error) { - return handle_error(error); - } finally { - reaction.f ^= REACTION_IS_UPDATING; - new_deps = previous_deps; - skipped_deps = previous_skipped_deps; - untracked_writes = previous_untracked_writes; - active_reaction = previous_reaction; - current_sources = previous_sources; - set_component_context(previous_component_context); - untracking = previous_untracking; - update_version = previous_update_version; - } -} -/** -* @template V -* @param {Reaction} signal -* @param {Value} dependency -* @returns {void} -*/ -function remove_reaction(signal, dependency) { - let reactions = dependency.reactions; - if (reactions !== null) { - var index = index_of.call(reactions, signal); - if (index !== -1) { - var new_length = reactions.length - 1; - if (new_length === 0) reactions = dependency.reactions = null; - else { - reactions[index] = reactions[new_length]; - reactions.pop(); - } - } - } - if (reactions === null && (dependency.f & 2) !== 0 && (new_deps === null || !includes.call(new_deps, dependency))) { - var derived = dependency; - if ((derived.f & 512) !== 0) { - derived.f ^= 512; - derived.f &= ~WAS_MARKED; - } - if (derived.v !== UNINITIALIZED) update_derived_status(derived); - freeze_derived_effects(derived); - remove_reactions(derived, 0); - } -} -/** -* @param {Reaction} signal -* @param {number} start_index -* @returns {void} -*/ -function remove_reactions(signal, start_index) { - var dependencies = signal.deps; - if (dependencies === null) return; - for (var i = start_index; i < dependencies.length; i++) remove_reaction(signal, dependencies[i]); -} -/** -* @param {Effect} effect -* @returns {void} -*/ -function update_effect(effect) { - var flags = effect.f; - if ((flags & 16384) !== 0) return; - set_signal_status(effect, CLEAN); - var previous_effect = active_effect; - var was_updating_effect = is_updating_effect; - active_effect = effect; - is_updating_effect = true; - try { - if ((flags & 16777232) !== 0) destroy_block_effect_children(effect); - else destroy_effect_children(effect); - execute_effect_teardown(effect); - var teardown = update_reaction(effect); - effect.teardown = typeof teardown === "function" ? teardown : null; - effect.wv = write_version; - } finally { - is_updating_effect = was_updating_effect; - active_effect = previous_effect; - } -} -/** -* @template V -* @param {Value} signal -* @returns {V} -*/ -function get(signal) { - var is_derived = (signal.f & 2) !== 0; - captured_signals?.add(signal); - if (active_reaction !== null && !untracking) { - if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !includes.call(current_sources, signal))) { - var deps = active_reaction.deps; - if ((active_reaction.f & 2097152) !== 0) { - if (signal.rv < read_version) { - signal.rv = read_version; - if (new_deps === null && deps !== null && deps[skipped_deps] === signal) skipped_deps++; - else if (new_deps === null) new_deps = [signal]; - else new_deps.push(signal); - } - } else { - (active_reaction.deps ??= []).push(signal); - var reactions = signal.reactions; - if (reactions === null) signal.reactions = [active_reaction]; - else if (!includes.call(reactions, active_reaction)) reactions.push(active_reaction); - } - } - } - if (is_destroying_effect && old_values.has(signal)) return old_values.get(signal); - if (is_derived) { - var derived = signal; - if (is_destroying_effect) { - var value = derived.v; - if ((derived.f & 1024) === 0 && derived.reactions !== null || depends_on_old_values(derived)) value = execute_derived(derived); - old_values.set(derived, value); - return value; - } - var should_connect = (derived.f & 512) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & 512) !== 0); - var is_new = (derived.f & REACTION_RAN) === 0; - if (is_dirty(derived)) { - if (should_connect) derived.f |= 512; - update_derived(derived); - } - if (should_connect && !is_new) { - unfreeze_derived_effects(derived); - reconnect(derived); - } - } - if (batch_values?.has(signal)) return batch_values.get(signal); - if ((signal.f & 8388608) !== 0) throw signal.v; - return signal.v; -} -/** -* (Re)connect a disconnected derived, so that it is notified -* of changes in `mark_reactions` -* @param {Derived} derived -*/ -function reconnect(derived) { - derived.f |= 512; - if (derived.deps === null) return; - for (const dep of derived.deps) { - (dep.reactions ??= []).push(derived); - if ((dep.f & 2) !== 0 && (dep.f & 512) === 0) { - unfreeze_derived_effects(dep); - reconnect(dep); - } - } -} -/** @param {Derived} derived */ -function depends_on_old_values(derived) { - if (derived.v === UNINITIALIZED) return true; - if (derived.deps === null) return false; - for (const dep of derived.deps) { - if (old_values.has(dep)) return true; - if ((dep.f & 2) !== 0 && depends_on_old_values(dep)) return true; - } - return false; -} -/** -* When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect), -* any state read inside `fn` will not be treated as a dependency. -* -* ```ts -* $effect(() => { -* // this will run when `data` changes, but not when `time` changes -* save(data, { -* timestamp: untrack(() => time) -* }); -* }); -* ``` -* @template T -* @param {() => T} fn -* @returns {T} -*/ -function untrack(fn) { - var previous_untracking = untracking; - try { - untracking = true; - return fn(); - } finally { - untracking = previous_untracking; - } -} -//#endregion -//#region node_modules/svelte/src/store/utils.js -/** @import { Readable } from './public' */ -/** -* @template T -* @param {Readable | null | undefined} store -* @param {(value: T) => void} run -* @param {(value: T) => void} [invalidate] -* @returns {() => void} -*/ -function subscribe_to_store(store, run, invalidate) { - if (store == null) { - run(void 0); - if (invalidate) invalidate(void 0); - return noop; - } - const unsub = untrack(() => store.subscribe(run, invalidate)); - return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; -} -//#endregion -//#region node_modules/svelte/src/utils.js -/** -* Attributes that are boolean, i.e. they are present or not present. -*/ -var DOM_BOOLEAN_ATTRIBUTES = [ - "allowfullscreen", - "async", - "autofocus", - "autoplay", - "checked", - "controls", - "default", - "disabled", - "formnovalidate", - "indeterminate", - "inert", - "ismap", - "loop", - "multiple", - "muted", - "nomodule", - "novalidate", - "open", - "playsinline", - "readonly", - "required", - "reversed", - "seamless", - "selected", - "webkitdirectory", - "defer", - "disablepictureinpicture", - "disableremoteplayback" -]; -/** -* Returns `true` if `name` is a boolean attribute -* @param {string} name -*/ -function is_boolean_attribute(name) { - return DOM_BOOLEAN_ATTRIBUTES.includes(name); -} -[...DOM_BOOLEAN_ATTRIBUTES]; -/** -* Subset of delegated events which should be passive by default. -* These two are already passive via browser defaults on window, document and body. -* But since -* - we're delegating them -* - they happen often -* - they apply to mobile which is generally less performant -* we're marking them as passive by default for other elements, too. -*/ -var PASSIVE_EVENTS = ["touchstart", "touchmove"]; -/** -* Returns `true` if `name` is a passive event -* @param {string} name -*/ -function is_passive_event(name) { - return PASSIVE_EVENTS.includes(name); -} -//#endregion -//#region node_modules/svelte/src/internal/server/index.js -var INVALID_ATTR_NAME_CHAR_REGEX = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u; -/** -* Only available on the server and when compiling with the `server` option. -* Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app. -* @template {Record} Props -* @param {Component | ComponentType>} component -* @param {{ props?: Omit; context?: Map; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} [options] -* @returns {RenderOutput} -*/ -function render(component, options = {}) { - if (options.csp?.hash && options.csp.nonce) invalid_csp(); - return Renderer.render(component, options); -} -/** -* @param {Record} attrs -* @param {string} [css_hash] -* @param {Record} [classes] -* @param {Record} [styles] -* @param {number} [flags] -* @returns {string} -*/ -function attributes(attrs, css_hash, classes, styles, flags = 0) { - if (styles) attrs.style = to_style(attrs.style, styles); - if (attrs.class) attrs.class = clsx$1(attrs.class); - if (css_hash || classes) attrs.class = to_class(attrs.class, css_hash, classes); - let attr_str = ""; - let name; - const is_html = (flags & 1) === 0; - const lowercase = (flags & 2) === 0; - const is_input = (flags & 4) !== 0; - for (name of Object.keys(attrs)) { - if (typeof attrs[name] === "function") continue; - if (name[0] === "$" && name[1] === "$") continue; - if (INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue; - var value = attrs[name]; - var lower = name.toLowerCase(); - if (lowercase) name = lower; - if (lower.length > 2 && lower.startsWith("on")) continue; - if (is_input) { - if (name === "defaultvalue" || name === "defaultchecked") { - name = name === "defaultvalue" ? "value" : "checked"; - if (attrs[name]) continue; - } - } - attr_str += attr(name, value, is_html && is_boolean_attribute(name)); - } - return attr_str; -} -/** -* @param {unknown} value -* @returns {string} -*/ -function stringify(value) { - return typeof value === "string" ? value : value == null ? "" : value + ""; -} -/** -* @param {any} value -* @param {string | undefined} [hash] -* @param {Record} [directives] -*/ -function attr_class(value, hash, directives) { - var result = to_class(value, hash, directives); - return result ? ` class="${escape_html(result, true)}"` : ""; -} -/** -* @template V -* @param {Record} store_values -* @param {string} store_name -* @param {Store | null | undefined} store -* @returns {V} -*/ -function store_get(store_values, store_name, store) { - if (store_name in store_values && store_values[store_name][0] === store) return store_values[store_name][2]; - store_values[store_name]?.[1](); - store_values[store_name] = [ - store, - null, - void 0 - ]; - const unsub = subscribe_to_store( - store, - /** @param {any} v */ - (v) => store_values[store_name][2] = v - ); - store_values[store_name][1] = unsub; - return store_values[store_name][2]; -} -/** @param {Record} store_values */ -function unsubscribe_stores(store_values) { - for (const store_name of Object.keys(store_values)) store_values[store_name][1](); -} -/** -* @param {Renderer} renderer -* @param {Record} $$props -* @param {string} name -* @param {Record} slot_props -* @param {null | (() => void)} fallback_fn -* @returns {void} -*/ -function slot(renderer, $$props, name, slot_props, fallback_fn) { - var slot_fn = $$props.$$slots?.[name]; - if (slot_fn === true) slot_fn = $$props[name === "default" ? "children" : name]; - if (slot_fn !== void 0) slot_fn(renderer, slot_props); - else fallback_fn?.(); -} -/** -* Legacy mode: If the prop has a fallback and is bound in the -* parent component, propagate the fallback value upwards. -* @param {Record} props_parent -* @param {Record} props_now -*/ -function bind_props(props_parent, props_now) { - for (const key of Object.keys(props_now)) { - const initial_value = props_parent[key]; - const value = props_now[key]; - if (initial_value === void 0 && value !== void 0 && Object.getOwnPropertyDescriptor(props_parent, key)?.set) props_parent[key] = value; - } -} -/** @param {any} array_like_or_iterator */ -function ensure_array_like(array_like_or_iterator) { - if (array_like_or_iterator) return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator); - return []; -} -/** -* @template V -* @param {() => V} get_value -*/ -function once(get_value) { - let value = UNINITIALIZED; - return () => { - if (value === UNINITIALIZED) value = get_value(); - return value; - }; -} -/** -* @template T -* @param {()=>T} fn -* @returns {(new_value?: T) => (T | void)} -*/ -function derived(fn) { - const get_value = ssr_context === null ? fn : once(fn); - /** @type {T | undefined} */ - let updated_value; - return function(new_value) { - if (arguments.length === 0) return updated_value ?? get_value(); - updated_value = new_value; - return updated_value; - }; -} -//#endregion -//#region node_modules/svelte/src/internal/server/crypto.js -var text_encoder; -var crypto; -/** @param {string} module_name */ -var obfuscated_import = (module_name) => import( - /* @vite-ignore */ - module_name -); -/** @param {string} data */ -async function sha256(data) { - text_encoder ??= new TextEncoder(); - crypto ??= globalThis.crypto?.subtle?.digest ? globalThis.crypto : (await obfuscated_import("node:crypto")).webcrypto; - return base64_encode(await crypto.subtle.digest("SHA-256", text_encoder.encode(data))); -} -/** -* @param {Uint8Array} bytes -* @returns {string} -*/ -function base64_encode(bytes) { - if (globalThis.Buffer) return globalThis.Buffer.from(bytes).toString("base64"); - let binary = ""; - for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]); - return btoa(binary); -} -//#endregion -//#region node_modules/svelte/src/internal/server/renderer.js -/** @import { Component } from 'svelte' */ -/** @import { Csp, HydratableContext, RenderOutput, SSRContext, SyncRenderOutput, Sha256Source } from './types.js' */ -/** @import { MaybePromise } from '#shared' */ -/** @typedef {'head' | 'body'} RendererType */ -/** @typedef {{ [key in RendererType]: string }} AccumulatedContent */ -/** -* @typedef {string | Renderer} RendererItem -*/ -/** -* Renderers are basically a tree of `string | Renderer`s, where each `Renderer` in the tree represents -* work that may or may not have completed. A renderer can be {@link collect}ed to aggregate the -* content from itself and all of its children, but this will throw if any of the children are -* performing asynchronous work. To asynchronously collect a renderer, just `await` it. -* -* The `string` values within a renderer are always associated with the {@link type} of that renderer. To switch types, -* call {@link child} with a different `type` argument. -*/ -var Renderer = class Renderer { - /** - * The contents of the renderer. - * @type {RendererItem[]} - */ - #out = []; - /** - * Any `onDestroy` callbacks registered during execution of this renderer. - * @type {(() => void)[] | undefined} - */ - #on_destroy = void 0; - /** - * Whether this renderer is a component body. - * @type {boolean} - */ - #is_component_body = false; - /** - * If set, this renderer is an error boundary. When async collection - * of the children fails, the failed snippet is rendered instead. - * @type {{ - * failed: (renderer: Renderer, error: unknown, reset: () => void) => void; - * transformError: (error: unknown) => unknown; - * context: SSRContext | null; - * } | null} - */ - #boundary = null; - /** - * The type of string content that this renderer is accumulating. - * @type {RendererType} - */ - type; - /** @type {Renderer | undefined} */ - #parent; - /** - * Asynchronous work associated with this renderer - * @type {Promise | undefined} - */ - promise = void 0; - /** - * State which is associated with the content tree as a whole. - * It will be re-exposed, uncopied, on all children. - * @type {SSRState} - * @readonly - */ - global; - /** - * State that is local to the branch it is declared in. - * It will be shallow-copied to all children. - * - * @type {{ select_value: string | undefined }} - */ - local; - /** - * @param {SSRState} global - * @param {Renderer | undefined} [parent] - */ - constructor(global, parent) { - this.#parent = parent; - this.global = global; - this.local = parent ? { ...parent.local } : { select_value: void 0 }; - this.type = parent ? parent.type : "body"; - } - /** - * @param {(renderer: Renderer) => void} fn - */ - head(fn) { - const head = new Renderer(this.global, this); - head.type = "head"; - this.#out.push(head); - head.child(fn); - } - /** - * @param {Array>} blockers - * @param {(renderer: Renderer) => void} fn - */ - async_block(blockers, fn) { - this.#out.push(BLOCK_OPEN); - this.async(blockers, fn); - this.#out.push(BLOCK_CLOSE); - } - /** - * @param {Array>} blockers - * @param {(renderer: Renderer) => void} fn - */ - async(blockers, fn) { - let callback = fn; - if (blockers.length > 0) { - const context = ssr_context; - callback = (renderer) => { - return Promise.all(blockers).then(() => { - const previous_context = ssr_context; - try { - set_ssr_context(context); - return fn(renderer); - } finally { - set_ssr_context(previous_context); - } - }); - }; - } - this.child(callback); - } - /** - * @param {Array<() => void>} thunks - */ - run(thunks) { - const context = ssr_context; - let promise = Promise.resolve(thunks[0]()); - const promises = [promise]; - for (const fn of thunks.slice(1)) { - promise = promise.then(() => { - const previous_context = ssr_context; - set_ssr_context(context); - try { - return fn(); - } finally { - set_ssr_context(previous_context); - } - }); - promises.push(promise); - } - promise.catch(noop); - this.promise = promise; - return promises; - } - /** - * @param {(renderer: Renderer) => MaybePromise} fn - */ - child_block(fn) { - this.#out.push(BLOCK_OPEN); - this.child(fn); - this.#out.push(BLOCK_CLOSE); - } - /** - * Create a child renderer. The child renderer inherits the state from the parent, - * but has its own content. - * @param {(renderer: Renderer) => MaybePromise} fn - */ - child(fn) { - const child = new Renderer(this.global, this); - this.#out.push(child); - const parent = ssr_context; - set_ssr_context({ - ...ssr_context, - p: parent, - c: null, - r: child - }); - const result = fn(child); - set_ssr_context(parent); - if (result instanceof Promise) { - result.catch(noop); - result.finally(() => set_ssr_context(null)).catch(noop); - if (child.global.mode === "sync") await_invalid(); - child.promise = result; - } - return child; - } - /** - * Render children inside an error boundary. If the children throw and the API-level - * `transformError` transform handles the error (doesn't re-throw), the `failed` snippet is - * rendered instead. Otherwise the error propagates. - * - * @param {{ failed?: (renderer: Renderer, error: unknown, reset: () => void) => void }} props - * @param {(renderer: Renderer) => MaybePromise} children_fn - */ - boundary(props, children_fn) { - const child = new Renderer(this.global, this); - this.#out.push(child); - const parent_context = ssr_context; - if (props.failed) child.#boundary = { - failed: props.failed, - transformError: this.global.transformError, - context: parent_context - }; - set_ssr_context({ - ...ssr_context, - p: parent_context, - c: null, - r: child - }); - try { - const result = children_fn(child); - set_ssr_context(parent_context); - if (result instanceof Promise) { - if (child.global.mode === "sync") await_invalid(); - result.catch(noop); - child.promise = result; - } - } catch (error) { - set_ssr_context(parent_context); - const failed_snippet = props.failed; - if (!failed_snippet) throw error; - const result = this.global.transformError(error); - child.#out.length = 0; - child.#boundary = null; - if (result instanceof Promise) { - if (this.global.mode === "sync") await_invalid(); - child.promise = result.then((transformed) => { - set_ssr_context(parent_context); - child.#out.push(Renderer.#serialize_failed_boundary(transformed)); - failed_snippet(child, transformed, noop); - child.#out.push(BLOCK_CLOSE); - }); - child.promise.catch(noop); - } else { - child.#out.push(Renderer.#serialize_failed_boundary(result)); - failed_snippet(child, result, noop); - child.#out.push(BLOCK_CLOSE); - } - } - } - /** - * Create a component renderer. The component renderer inherits the state from the parent, - * but has its own content. It is treated as an ordering boundary for ondestroy callbacks. - * @param {(renderer: Renderer) => MaybePromise} fn - * @param {Function} [component_fn] - * @returns {void} - */ - component(fn, component_fn) { - push$1(component_fn); - const child = this.child(fn); - child.#is_component_body = true; - pop$1(); - } - /** - * @param {Record} attrs - * @param {(renderer: Renderer) => void} fn - * @param {string | undefined} [css_hash] - * @param {Record | undefined} [classes] - * @param {Record | undefined} [styles] - * @param {number | undefined} [flags] - * @param {boolean | undefined} [is_rich] - * @returns {void} - */ - select(attrs, fn, css_hash, classes, styles, flags, is_rich) { - const { value, ...select_attrs } = attrs; - this.push(``); - this.child((renderer) => { - renderer.local.select_value = value; - fn(renderer); - }); - this.push(`${is_rich ? "" : ""}`); - } - /** - * @param {Record} attrs - * @param {string | number | boolean | ((renderer: Renderer) => void)} body - * @param {string | undefined} [css_hash] - * @param {Record | undefined} [classes] - * @param {Record | undefined} [styles] - * @param {number | undefined} [flags] - * @param {boolean | undefined} [is_rich] - */ - option(attrs, body, css_hash, classes, styles, flags, is_rich) { - this.#out.push(` { - if (has_own_property.call(attrs, "value")) value = attrs.value; - if (value === this.local.select_value) renderer.#out.push(" selected=\"\""); - renderer.#out.push(`>${body}${is_rich ? "" : ""}`); - if (head) renderer.head((child) => child.push(head)); - }; - if (typeof body === "function") this.child((renderer) => { - const r = new Renderer(this.global, this); - body(r); - if (this.global.mode === "async") return r.#collect_content_async().then((content) => { - close(renderer, content.body.replaceAll("", ""), content); - }); - else { - const content = r.#collect_content(); - close(renderer, content.body.replaceAll("", ""), content); - } - }); - else close(this, body, { body: escape_html(body) }); - } - /** - * @param {(renderer: Renderer) => void} fn - */ - title(fn) { - const path = this.get_path(); - /** @param {string} head */ - const close = (head) => { - this.global.set_title(head, path); - }; - this.child((renderer) => { - const r = new Renderer(renderer.global, renderer); - fn(r); - if (renderer.global.mode === "async") return r.#collect_content_async().then((content) => { - close(content.head); - }); - else close(r.#collect_content().head); - }); - } - /** - * @param {string | (() => Promise)} content - */ - push(content) { - if (typeof content === "function") this.child(async (renderer) => renderer.push(await content())); - else this.#out.push(content); - } - /** - * @param {() => void} fn - */ - on_destroy(fn) { - (this.#on_destroy ??= []).push(fn); - } - /** - * @returns {number[]} - */ - get_path() { - return this.#parent ? [...this.#parent.get_path(), this.#parent.#out.indexOf(this)] : []; - } - /** - * @deprecated this is needed for legacy component bindings - */ - copy() { - const copy = new Renderer(this.global, this.#parent); - copy.#out = this.#out.map((item) => item instanceof Renderer ? item.copy() : item); - copy.promise = this.promise; - return copy; - } - /** - * @param {Renderer} other - * @deprecated this is needed for legacy component bindings - */ - subsume(other) { - if (this.global.mode !== other.global.mode) throw new Error("invariant: A renderer cannot switch modes. If you're seeing this, there's a compiler bug. File an issue!"); - this.local = other.local; - this.#out = other.#out.map((item, i) => { - const current = this.#out[i]; - if (current instanceof Renderer && item instanceof Renderer) { - current.subsume(item); - return current; - } - return item; - }); - this.promise = other.promise; - this.type = other.type; - } - get length() { - return this.#out.length; - } - /** - * Creates the hydration comment that marks the start of a failed boundary. - * The error is JSON-serialized and embedded inside an HTML comment for the client - * to parse during hydration. The JSON is escaped to prevent `-->` or ``; - } - /** - * Only available on the server and when compiling with the `server` option. - * Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app. - * @template {Record} Props - * @param {Component} component - * @param {{ props?: Omit; context?: Map; idPrefix?: string; csp?: Csp }} [options] - * @returns {RenderOutput} - */ - static render(component, options = {}) { - /** @type {AccumulatedContent | undefined} */ - let sync; - /** @type {Promise | undefined} */ - let async; - const result = {}; - Object.defineProperties(result, { - html: { get: () => { - return (sync ??= Renderer.#render(component, options)).body; - } }, - head: { get: () => { - return (sync ??= Renderer.#render(component, options)).head; - } }, - body: { get: () => { - return (sync ??= Renderer.#render(component, options)).body; - } }, - hashes: { value: { script: "" } }, - then: { value: (onfulfilled, onrejected) => { - if (!async_mode_flag) { - const result = sync ??= Renderer.#render(component, options); - const user_result = onfulfilled({ - head: result.head, - body: result.body, - html: result.body, - hashes: { script: [] } - }); - return Promise.resolve(user_result); - } - async ??= init_render_context().then(() => with_render_context(() => Renderer.#render_async(component, options))); - return async.then((result) => { - Object.defineProperty(result, "html", { get: () => { - html_deprecated(); - } }); - return onfulfilled(result); - }, onrejected); - } } - }); - return result; - } - /** - * Collect all of the `onDestroy` callbacks registered during rendering. In an async context, this is only safe to call - * after awaiting `collect_async`. - * - * Child renderers are "porous" and don't affect execution order, but component body renderers - * create ordering boundaries. Within a renderer, callbacks run in order until hitting a component boundary. - * @returns {Iterable<() => void>} - */ - *#collect_on_destroy() { - for (const component of this.#traverse_components()) yield* component.#collect_ondestroy(); - } - /** - * Performs a depth-first search of renderers, yielding the deepest components first, then additional components as we backtrack up the tree. - * @returns {Iterable} - */ - *#traverse_components() { - for (const child of this.#out) if (typeof child !== "string") yield* child.#traverse_components(); - if (this.#is_component_body) yield this; - } - /** - * @returns {Iterable<() => void>} - */ - *#collect_ondestroy() { - if (this.#on_destroy) for (const fn of this.#on_destroy) yield fn; - for (const child of this.#out) if (child instanceof Renderer && !child.#is_component_body) yield* child.#collect_ondestroy(); - } - /** - * Render a component. Throws if any of the children are performing asynchronous work. - * - * @template {Record} Props - * @param {Component} component - * @param {{ props?: Omit; context?: Map; idPrefix?: string }} options - * @returns {AccumulatedContent} - */ - static #render(component, options) { - var previous_context = ssr_context; - try { - const renderer = Renderer.#open_render("sync", component, options); - const content = renderer.#collect_content(); - return Renderer.#close_render(content, renderer); - } finally { - abort(); - set_ssr_context(previous_context); - } - } - /** - * Render a component. - * - * @template {Record} Props - * @param {Component} component - * @param {{ props?: Omit; context?: Map; idPrefix?: string; csp?: Csp }} options - * @returns {Promise} - */ - static async #render_async(component, options) { - const previous_context = ssr_context; - try { - const renderer = Renderer.#open_render("async", component, options); - const content = await renderer.#collect_content_async(); - const hydratables = await renderer.#collect_hydratables(); - if (hydratables !== null) content.head = hydratables + content.head; - return Renderer.#close_render(content, renderer); - } finally { - set_ssr_context(previous_context); - abort(); - } - } - /** - * Collect all of the code from the `out` array and return it as a string, or a promise resolving to a string. - * @param {AccumulatedContent} content - * @returns {AccumulatedContent} - */ - #collect_content(content = { - head: "", - body: "" - }) { - for (const item of this.#out) if (typeof item === "string") content[this.type] += item; - else if (item instanceof Renderer) item.#collect_content(content); - return content; - } - /** - * Collect all of the code from the `out` array and return it as a string. - * @param {AccumulatedContent} content - * @returns {Promise} - */ - async #collect_content_async(content = { - head: "", - body: "" - }) { - await this.promise; - for (const item of this.#out) if (typeof item === "string") content[this.type] += item; - else if (item instanceof Renderer) if (item.#boundary) { - /** @type {AccumulatedContent} */ - const boundary_content = { - head: "", - body: "" - }; - try { - await item.#collect_content_async(boundary_content); - content.head += boundary_content.head; - content.body += boundary_content.body; - } catch (error) { - const { context, failed, transformError } = item.#boundary; - set_ssr_context(context); - let transformed = await transformError(error); - const failed_renderer = new Renderer(item.global, item); - failed_renderer.type = item.type; - failed_renderer.#out.push(Renderer.#serialize_failed_boundary(transformed)); - failed(failed_renderer, transformed, noop); - failed_renderer.#out.push(BLOCK_CLOSE); - await failed_renderer.#collect_content_async(content); - } - } else await item.#collect_content_async(content); - return content; - } - async #collect_hydratables() { - const ctx = get_render_context().hydratable; - for (const [_, key] of ctx.unresolved_promises) unresolved_hydratable(key, ctx.lookup.get(key)?.stack ?? ""); - for (const comparison of ctx.comparisons) await comparison; - return await this.#hydratable_block(ctx); - } - /** - * @template {Record} Props - * @param {'sync' | 'async'} mode - * @param {import('svelte').Component} component - * @param {{ props?: Omit; context?: Map; idPrefix?: string; csp?: Csp; transformError?: (error: unknown) => unknown }} options - * @returns {Renderer} - */ - static #open_render(mode, component, options) { - if (options.idPrefix?.includes("--")) invalid_id_prefix(); - var previous_context = ssr_context; - try { - const renderer = new Renderer(new SSRState(mode, options.idPrefix ? options.idPrefix + "-" : "", options.csp, options.transformError)); - set_ssr_context({ - p: null, - c: options.context ?? null, - r: renderer - }); - renderer.push(BLOCK_OPEN); - component(renderer, options.props ?? {}); - renderer.push(BLOCK_CLOSE); - return renderer; - } finally { - set_ssr_context(previous_context); - } - } - /** - * @param {AccumulatedContent} content - * @param {Renderer} renderer - * @returns {AccumulatedContent & { hashes: { script: Sha256Source[] } }} - */ - static #close_render(content, renderer) { - for (const cleanup of renderer.#collect_on_destroy()) cleanup(); - let head = content.head + renderer.global.get_title(); - let body = content.body; - for (const { hash, code } of renderer.global.css) head += ``; - return { - head, - body, - hashes: { script: renderer.global.csp.script_hashes } - }; - } - /** - * @param {HydratableContext} ctx - */ - async #hydratable_block(ctx) { - if (ctx.lookup.size === 0) return null; - let entries = []; - let has_promises = false; - for (const [k, v] of ctx.lookup) { - if (v.promises) { - has_promises = true; - for (const p of v.promises) await p; - } - entries.push(`[${devalue.uneval(k)},${v.serialized}]`); - } - let prelude = `const h = (window.__svelte ??= {}).h ??= new Map();`; - if (has_promises) prelude = `const r = (v) => Promise.resolve(v); - ${prelude}`; - const body = ` - { - ${prelude} - - for (const [k, v] of [ - ${entries.join(",\n ")} - ]) { - h.set(k, v); - } - } - `; - let csp_attr = ""; - if (this.global.csp.nonce) csp_attr = ` nonce="${this.global.csp.nonce}"`; - else if (this.global.csp.hash) { - const hash = await sha256(body); - this.global.csp.script_hashes.push(`sha256-${hash}`); - } - return `\n\t\t${body}<\/script>`; - } -}; -var SSRState = class { - /** @readonly @type {Csp & { script_hashes: Sha256Source[] }} */ - csp; - /** @readonly @type {'sync' | 'async'} */ - mode; - /** @readonly @type {() => string} */ - uid; - /** @readonly @type {Set<{ hash: string; code: string }>} */ - css = /* @__PURE__ */ new Set(); - /** - * `transformError` passed to `render`. Called when an error boundary catches an error. - * Throws by default if unset in `render`. - * @type {(error: unknown) => unknown} - */ - transformError; - /** @type {{ path: number[], value: string }} */ - #title = { - path: [], - value: "" - }; - /** - * @param {'sync' | 'async'} mode - * @param {string} id_prefix - * @param {Csp} csp - * @param {((error: unknown) => unknown) | undefined} [transformError] - */ - constructor(mode, id_prefix = "", csp = { hash: false }, transformError) { - this.mode = mode; - this.csp = { - ...csp, - script_hashes: [] - }; - this.transformError = transformError ?? ((error) => { - throw error; - }); - let uid = 1; - this.uid = () => `${id_prefix}s${uid++}`; - } - get_title() { - return this.#title.value; - } - /** - * Performs a depth-first (lexicographic) comparison using the path. Rejects sets - * from earlier than or equal to the current value. - * @param {string} value - * @param {number[]} path - */ - set_title(value, path) { - const current = this.#title.path; - let i = 0; - let l = Math.min(path.length, current.length); - while (i < l && path[i] === current[i]) i += 1; - if (path[i] === void 0) return; - if (current[i] === void 0 || path[i] > current[i]) { - this.#title.path = path; - this.#title.value = value; - } - } -}; -//#endregion -//#region node_modules/svelte/src/internal/server/dev.js -function get_user_code_location() { - return get_stack().filter((line) => line.trim().startsWith("at ")).map((line) => line.replace(/\((.*):\d+:\d+\)$/, (_, file) => `(${file})`)).join("\n"); -} -//#endregion -export { createContext as $, component_context as A, hydration_failed as B, mutable_source as C, get$1 as D, flushSync as E, set_hydrate_node as F, async_mode_flag as G, escape_html as H, set_hydrating as I, STATE_SYMBOL as J, getAbortSignal as K, hydration_mismatch as L, push as M, hydrate_node as N, readable as O, hydrating as P, run as Q, lifecycle_double_unmount as R, init_operations as S, boundary as T, HYDRATION_ERROR as U, attr as V, get_render_context as W, define_property as X, array_from as Y, noop as Z, component_root as _, ensure_array_like as a, hydratable_clobbering as at, get_first_child as b, store_get as c, experimental_async_required as ct, is_passive_event as d, getAllContexts as et, active_effect as f, set_active_reaction as g, set_active_effect as h, derived as i, ssr_context as it, pop as j, writable as k, stringify as l, get as m, attr_class as n, hasContext as nt, render as o, hydratable_serialization_failed as ot, active_reaction as p, LEGACY_PROPS as q, bind_props as r, setContext as rt, slot as s, lifecycle_function_unavailable as st, get_user_code_location as t, getContext as tt, unsubscribe_stores as u, clear_text_content as v, set as w, get_next_sibling as x, create_text as y, state_proxy_unmount as z }; diff --git a/frontend/.svelte-kit/output/server/chunks/environment.js b/frontend/.svelte-kit/output/server/chunks/environment.js deleted file mode 100644 index ed14a3d..0000000 --- a/frontend/.svelte-kit/output/server/chunks/environment.js +++ /dev/null @@ -1,47 +0,0 @@ -//#region node_modules/@sveltejs/kit/src/runtime/app/paths/internal/server.js -var base = ""; -var assets = base; -var app_dir = "_app"; -var initial = { - base, - assets -}; -initial.base; -/** -* @param {{ base: string, assets: string }} paths -*/ -function override(paths) { - base = paths.base; - assets = paths.assets; -} -function reset() { - base = initial.base; - assets = initial.assets; -} -/** @param {string} path */ -function set_assets(path) { - assets = initial.assets = path; -} -/** -* `$env/dynamic/public` -* @type {Record} -*/ -var public_env = {}; -/** @param {any} error */ -var fix_stack_trace = (error) => error?.stack; -/** @type {(environment: Record) => void} */ -function set_private_env(environment) {} -/** @type {(environment: Record) => void} */ -function set_public_env(environment) { - public_env = environment; -} -//#endregion -//#region \0virtual:__sveltekit/environment -var version = "1777346369869"; -var prerendering = false; -function set_building() {} -function set_prerendering() { - prerendering = true; -} -//#endregion -export { fix_stack_trace as a, set_public_env as c, base as d, override as f, version as i, app_dir as l, set_assets as m, set_building as n, public_env as o, reset as p, set_prerendering as r, set_private_env as s, prerendering as t, assets as u }; diff --git a/frontend/.svelte-kit/output/server/chunks/exports.js b/frontend/.svelte-kit/output/server/chunks/exports.js deleted file mode 100644 index cbcc983..0000000 --- a/frontend/.svelte-kit/output/server/chunks/exports.js +++ /dev/null @@ -1,369 +0,0 @@ -//#region node_modules/@sveltejs/kit/src/utils/array.js -/** -* Removes nullish values from an array. -* -* @template T -* @param {Array} arr -*/ -function compact(arr) { - return arr.filter( - /** @returns {val is NonNullable} */ - (val) => val != null - ); -} -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/pathname.js -var DATA_SUFFIX = "/__data.json"; -var HTML_DATA_SUFFIX = ".html__data.json"; -/** @param {string} pathname */ -function has_data_suffix(pathname) { - return pathname.endsWith(DATA_SUFFIX) || pathname.endsWith(HTML_DATA_SUFFIX); -} -/** @param {string} pathname */ -function add_data_suffix(pathname) { - if (pathname.endsWith(".html")) return pathname.replace(/\.html$/, HTML_DATA_SUFFIX); - return pathname.replace(/\/$/, "") + DATA_SUFFIX; -} -/** @param {string} pathname */ -function strip_data_suffix(pathname) { - if (pathname.endsWith(HTML_DATA_SUFFIX)) return pathname.slice(0, -16) + ".html"; - return pathname.slice(0, -12); -} -var ROUTE_SUFFIX = "/__route.js"; -/** -* @param {string} pathname -* @returns {boolean} -*/ -function has_resolution_suffix(pathname) { - return pathname.endsWith(ROUTE_SUFFIX); -} -/** -* Convert a regular URL to a route to send to SvelteKit's server-side route resolution endpoint -* @param {string} pathname -* @returns {string} -*/ -function add_resolution_suffix(pathname) { - return pathname.replace(/\/$/, "") + ROUTE_SUFFIX; -} -/** -* @param {string} pathname -* @returns {string} -*/ -function strip_resolution_suffix(pathname) { - return pathname.slice(0, -11); -} -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/telemetry/noop.js -/** -* @type {Span} -*/ -var noop_span = { - spanContext() { - return noop_span_context; - }, - setAttribute() { - return this; - }, - setAttributes() { - return this; - }, - addEvent() { - return this; - }, - setStatus() { - return this; - }, - updateName() { - return this; - }, - end() { - return this; - }, - isRecording() { - return false; - }, - recordException() { - return this; - }, - addLink() { - return this; - }, - addLinks() { - return this; - } -}; -/** -* @type {SpanContext} -*/ -var noop_span_context = { - traceId: "", - spanId: "", - traceFlags: 0 -}; -//#endregion -//#region node_modules/@sveltejs/kit/src/utils/url.js -/** -* Matches a URI scheme. See https://www.rfc-editor.org/rfc/rfc3986#section-3.1 -* @type {RegExp} -*/ -var SCHEME = /^[a-z][a-z\d+\-.]+:/i; -var internal = new URL("sveltekit-internal://"); -/** -* @param {string} base -* @param {string} path -*/ -function resolve(base, path) { - if (path[0] === "/" && path[1] === "/") return path; - let url = new URL(base, internal); - url = new URL(path, url); - return url.protocol === internal.protocol ? url.pathname + url.search + url.hash : url.href; -} -/** -* @param {string} path -* @param {import('types').TrailingSlash} trailing_slash -*/ -function normalize_path(path, trailing_slash) { - if (path === "/" || trailing_slash === "ignore") return path; - if (trailing_slash === "never") return path.endsWith("/") ? path.slice(0, -1) : path; - else if (trailing_slash === "always" && !path.endsWith("/")) return path + "/"; - return path; -} -/** -* Decode pathname excluding %25 to prevent further double decoding of params -* @param {string} pathname -*/ -function decode_pathname(pathname) { - return pathname.split("%25").map(decodeURI).join("%25"); -} -/** @param {Record} params */ -function decode_params(params) { - for (const key in params) params[key] = decodeURIComponent(params[key]); - return params; -} -/** -* @param {URL} url -* @param {() => void} callback -* @param {(search_param: string) => void} search_params_callback -* @param {boolean} [allow_hash] -*/ -function make_trackable(url, callback, search_params_callback, allow_hash = false) { - const tracked = new URL(url); - Object.defineProperty(tracked, "searchParams", { - value: new Proxy(tracked.searchParams, { get(obj, key) { - if (key === "get" || key === "getAll" || key === "has") return (param, ...rest) => { - search_params_callback(param); - return obj[key](param, ...rest); - }; - callback(); - const value = Reflect.get(obj, key); - return typeof value === "function" ? value.bind(obj) : value; - } }), - enumerable: true, - configurable: true - }); - /** - * URL properties that could change during the lifetime of the page, - * which excludes things like `origin` - */ - const tracked_url_properties = [ - "href", - "pathname", - "search", - "toString", - "toJSON" - ]; - if (allow_hash) tracked_url_properties.push("hash"); - for (const property of tracked_url_properties) Object.defineProperty(tracked, property, { - get() { - callback(); - return url[property]; - }, - enumerable: true, - configurable: true - }); - tracked[Symbol.for("nodejs.util.inspect.custom")] = (_depth, opts, inspect) => { - return inspect(url, opts); - }; - tracked.searchParams[Symbol.for("nodejs.util.inspect.custom")] = (_depth, opts, inspect) => { - return inspect(url.searchParams, opts); - }; - if (!allow_hash) disable_hash(tracked); - return tracked; -} -/** -* Disallow access to `url.hash` on the server and in `load` -* @param {URL} url -*/ -function disable_hash(url) { - allow_nodejs_console_log(url); - Object.defineProperty(url, "hash", { get() { - throw new Error("Cannot access event.url.hash. Consider using `page.url.hash` inside a component instead"); - } }); -} -/** -* Disallow access to `url.search` and `url.searchParams` during prerendering -* @param {URL} url -*/ -function disable_search(url) { - allow_nodejs_console_log(url); - for (const property of ["search", "searchParams"]) Object.defineProperty(url, property, { get() { - throw new Error(`Cannot access url.${property} on a page with prerendering enabled`); - } }); -} -/** -* Allow URL to be console logged, bypassing disabled properties. -* @param {URL} url -*/ -function allow_nodejs_console_log(url) { - url[Symbol.for("nodejs.util.inspect.custom")] = (_depth, opts, inspect) => { - return inspect(new URL(url), opts); - }; -} -//#endregion -//#region node_modules/@sveltejs/kit/src/utils/hash.js -/** -* Hash using djb2 -* @param {import('types').StrictBody[]} values -*/ -function hash(...values) { - let hash = 5381; - for (const value of values) if (typeof value === "string") { - let i = value.length; - while (i) hash = hash * 33 ^ value.charCodeAt(--i); - } else if (ArrayBuffer.isView(value)) { - const buffer = new Uint8Array(value.buffer, value.byteOffset, value.byteLength); - let i = buffer.length; - while (i) hash = hash * 33 ^ buffer[--i]; - } else throw new TypeError("value must be a string or TypedArray"); - return (hash >>> 0).toString(36); -} -//#endregion -//#region node_modules/@sveltejs/kit/src/utils/routing.js -/** -* @param {RegExpMatchArray} match -* @param {import('types').RouteParam[]} params -* @param {Record} matchers -*/ -function exec(match, params, matchers) { - /** @type {Record} */ - const result = {}; - const values = match.slice(1); - const values_needing_match = values.filter((value) => value !== void 0); - let buffered = 0; - for (let i = 0; i < params.length; i += 1) { - const param = params[i]; - let value = values[i - buffered]; - if (param.chained && param.rest && buffered) { - value = values.slice(i - buffered, i + 1).filter((s) => s).join("/"); - buffered = 0; - } - if (value === void 0) if (param.rest) value = ""; - else continue; - if (!param.matcher || matchers[param.matcher](value)) { - result[param.name] = value; - const next_param = params[i + 1]; - const next_value = values[i + 1]; - if (next_param && !next_param.rest && next_param.optional && next_value && param.chained) buffered = 0; - if (!next_param && !next_value && Object.keys(result).length === values_needing_match.length) buffered = 0; - continue; - } - if (param.optional && param.chained) { - buffered++; - continue; - } - return; - } - if (buffered) return; - return result; -} -/** -* Find the first route that matches the given path -* @template {{pattern: RegExp, params: import('types').RouteParam[]}} Route -* @param {string} path - The decoded pathname to match -* @param {Route[]} routes -* @param {Record} matchers -* @returns {{ route: Route, params: Record } | null} -*/ -function find_route(path, routes, matchers) { - for (const route of routes) { - const match = route.pattern.exec(path); - if (!match) continue; - const matched = exec(match, route.params, matchers); - if (matched) return { - route, - params: decode_params(matched) - }; - } - return null; -} -//#endregion -//#region node_modules/@sveltejs/kit/src/utils/exports.js -/** -* @param {Set} expected -*/ -function validator(expected) { - /** - * @param {any} module - * @param {string} [file] - */ - function validate(module, file) { - if (!module) return; - for (const key in module) { - if (key[0] === "_" || expected.has(key)) continue; - const values = [...expected.values()]; - const hint = hint_for_supported_files(key, file?.slice(file.lastIndexOf("."))) ?? `valid exports are ${values.join(", ")}, or anything with a '_' prefix`; - throw new Error(`Invalid export '${key}'${file ? ` in ${file}` : ""} (${hint})`); - } - } - return validate; -} -/** -* @param {string} key -* @param {string} ext -* @returns {string | void} -*/ -function hint_for_supported_files(key, ext = ".js") { - const supported_files = []; - if (valid_layout_exports.has(key)) supported_files.push(`+layout${ext}`); - if (valid_page_exports.has(key)) supported_files.push(`+page${ext}`); - if (valid_layout_server_exports.has(key)) supported_files.push(`+layout.server${ext}`); - if (valid_page_server_exports.has(key)) supported_files.push(`+page.server${ext}`); - if (valid_server_exports.has(key)) supported_files.push(`+server${ext}`); - if (supported_files.length > 0) return `'${key}' is a valid export in ${supported_files.slice(0, -1).join(", ")}${supported_files.length > 1 ? " or " : ""}${supported_files.at(-1)}`; -} -var valid_layout_exports = new Set([ - "load", - "prerender", - "csr", - "ssr", - "trailingSlash", - "config" -]); -var valid_page_exports = new Set([...valid_layout_exports, "entries"]); -var valid_layout_server_exports = new Set([...valid_layout_exports]); -var valid_page_server_exports = new Set([ - ...valid_layout_server_exports, - "actions", - "entries" -]); -var valid_server_exports = new Set([ - "GET", - "POST", - "PATCH", - "PUT", - "DELETE", - "OPTIONS", - "HEAD", - "fallback", - "prerender", - "trailingSlash", - "config", - "entries" -]); -var validate_layout_exports = validator(valid_layout_exports); -var validate_page_exports = validator(valid_page_exports); -var validate_layout_server_exports = validator(valid_layout_server_exports); -var validate_page_server_exports = validator(valid_page_server_exports); -var validate_server_exports = validator(valid_server_exports); -//#endregion -export { compact as S, add_resolution_suffix as _, validate_server_exports as a, strip_data_suffix as b, SCHEME as c, disable_search as d, make_trackable as f, add_data_suffix as g, noop_span as h, validate_page_server_exports as i, decode_params as l, resolve as m, validate_layout_server_exports as n, find_route as o, normalize_path as p, validate_page_exports as r, hash as s, validate_layout_exports as t, decode_pathname as u, has_data_suffix as v, strip_resolution_suffix as x, has_resolution_suffix as y }; diff --git a/frontend/.svelte-kit/output/server/chunks/index-server.js b/frontend/.svelte-kit/output/server/chunks/index-server.js deleted file mode 100644 index 2835bcc..0000000 --- a/frontend/.svelte-kit/output/server/chunks/index-server.js +++ /dev/null @@ -1,145 +0,0 @@ -import { $ as createContext, G as async_mode_flag, K as getAbortSignal, Q as run, W as get_render_context, Z as noop, ct as experimental_async_required, et as getAllContexts, it as ssr_context, nt as hasContext, ot as hydratable_serialization_failed, rt as setContext, st as lifecycle_function_unavailable, tt as getContext } from "./dev.js"; -import * as devalue from "devalue"; -//#region \0rolldown/runtime.js -var __defProp = Object.defineProperty; -var __exportAll = (all, no_symbols) => { - let target = {}; - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); - return target; -}; -//#endregion -//#region node_modules/svelte/src/internal/server/hydratable.js -/** @import { HydratableLookupEntry } from '#server' */ -/** -* @template T -* @param {string} key -* @param {() => T} fn -* @returns {T} -*/ -function hydratable(key, fn) { - if (!async_mode_flag) experimental_async_required("hydratable"); - const { hydratable } = get_render_context(); - let entry = hydratable.lookup.get(key); - if (entry !== void 0) return entry.value; - const value = fn(); - entry = encode(key, value, hydratable.unresolved_promises); - hydratable.lookup.set(key, entry); - return value; -} -/** -* @param {string} key -* @param {any} value -* @param {Map, string>} [unresolved] -*/ -function encode(key, value, unresolved) { - /** @type {HydratableLookupEntry} */ - const entry = { - value, - serialized: "" - }; - let uid = 1; - entry.serialized = devalue.uneval(entry.value, (value, uneval) => { - if (is_promise(value)) { - const placeholder = `"${uid++}"`; - const p = value.then((v) => { - entry.serialized = entry.serialized.replace(placeholder, `r(${uneval(v)})`); - }).catch((devalue_error) => hydratable_serialization_failed(key, serialization_stack(entry.stack, devalue_error?.stack))); - unresolved?.set(p, key); - p.catch(() => {}).finally(() => unresolved?.delete(p)); - (entry.promises ??= []).push(p); - return placeholder; - } - }); - return entry; -} -/** -* @param {any} value -* @returns {value is Promise} -*/ -function is_promise(value) { - return Object.prototype.toString.call(value) === "[object Promise]"; -} -/** -* @param {string | undefined} root_stack -* @param {string | undefined} uneval_stack -*/ -function serialization_stack(root_stack, uneval_stack) { - let out = ""; - if (root_stack) out += root_stack + "\n"; - if (uneval_stack) out += "Caused by:\n" + uneval_stack + "\n"; - return out || ""; -} -//#endregion -//#region node_modules/svelte/src/internal/server/blocks/snippet.js -/** @import { Snippet } from 'svelte' */ -/** @import { Renderer } from '../renderer' */ -/** @import { Getters } from '#shared' */ -/** -* Create a snippet programmatically -* @template {unknown[]} Params -* @param {(...params: Getters) => { -* render: () => string -* setup?: (element: Element) => void | (() => void) -* }} fn -* @returns {Snippet} -*/ -function createRawSnippet(fn) { - return (renderer, ...args) => { - var getters = args.map((value) => () => value); - renderer.push(fn(...getters).render().trim()); - }; -} -//#endregion -//#region node_modules/svelte/src/index-server.js -/** @import { SSRContext } from '#server' */ -/** @import { Renderer } from './internal/server/renderer.js' */ -var index_server_exports = /* @__PURE__ */ __exportAll({ - afterUpdate: () => noop, - beforeUpdate: () => noop, - createContext: () => createContext, - createEventDispatcher: () => createEventDispatcher, - createRawSnippet: () => createRawSnippet, - flushSync: () => noop, - fork: () => fork, - getAbortSignal: () => getAbortSignal, - getAllContexts: () => getAllContexts, - getContext: () => getContext, - hasContext: () => hasContext, - hydratable: () => hydratable, - hydrate: () => hydrate, - mount: () => mount, - onDestroy: () => onDestroy, - onMount: () => noop, - setContext: () => setContext, - settled: () => settled, - tick: () => tick, - unmount: () => unmount, - untrack: () => run -}); -/** @param {() => void} fn */ -function onDestroy(fn) { - /** @type {Renderer} */ ssr_context.r.on_destroy(fn); -} -function createEventDispatcher() { - return noop; -} -function mount() { - lifecycle_function_unavailable("mount"); -} -function hydrate() { - lifecycle_function_unavailable("hydrate"); -} -function unmount() { - lifecycle_function_unavailable("unmount"); -} -function fork() { - lifecycle_function_unavailable("fork"); -} -async function tick() {} -async function settled() {} -//#endregion -export { hydratable as i, settled as n, tick as r, index_server_exports as t }; diff --git a/frontend/.svelte-kit/output/server/chunks/index-server2.js b/frontend/.svelte-kit/output/server/chunks/index-server2.js deleted file mode 100644 index b6d9f58..0000000 --- a/frontend/.svelte-kit/output/server/chunks/index-server2.js +++ /dev/null @@ -1,2 +0,0 @@ -import "./dev.js"; -export {}; diff --git a/frontend/.svelte-kit/output/server/chunks/internal.js b/frontend/.svelte-kit/output/server/chunks/internal.js deleted file mode 100644 index 50f5f7a..0000000 --- a/frontend/.svelte-kit/output/server/chunks/internal.js +++ /dev/null @@ -1,624 +0,0 @@ -import "./index-server.js"; -import "./environment.js"; -import { A as component_context, B as hydration_failed, C as mutable_source, E as flushSync, F as set_hydrate_node, G as async_mode_flag, I as set_hydrating, L as hydration_mismatch, M as push, N as hydrate_node, P as hydrating, S as init_operations, T as boundary, U as HYDRATION_ERROR, X as define_property, Y as array_from, _ as component_root, b as get_first_child, d as is_passive_event, f as active_effect, g as set_active_reaction, h as set_active_effect, i as derived, j as pop, m as get, o as render, p as active_reaction, q as LEGACY_PROPS, rt as setContext, v as clear_text_content, w as set, x as get_next_sibling, y as create_text } from "./dev.js"; -//#region \0virtual:__sveltekit/server -var read_implementation = null; -function set_read_implementation(fn) { - read_implementation = fn; -} -function set_manifest(_) {} -//#endregion -//#region node_modules/svelte/src/internal/client/dom/elements/events.js -/** -* Used on elements, as a map of event type -> event handler, -* and on events themselves to track which element handled an event -*/ -var event_symbol = Symbol("events"); -/** @type {Set} */ -var all_registered_events = /* @__PURE__ */ new Set(); -/** @type {Set<(events: Array) => void>} */ -var root_event_handles = /* @__PURE__ */ new Set(); -var last_propagated_event = null; -/** -* @this {EventTarget} -* @param {Event} event -* @returns {void} -*/ -function handle_event_propagation(event) { - var handler_element = this; - var owner_document = handler_element.ownerDocument; - var event_name = event.type; - var path = event.composedPath?.() || []; - var current_target = path[0] || event.target; - last_propagated_event = event; - var path_idx = 0; - var handled_at = last_propagated_event === event && event[event_symbol]; - if (handled_at) { - var at_idx = path.indexOf(handled_at); - if (at_idx !== -1 && (handler_element === document || handler_element === window)) { - event[event_symbol] = handler_element; - return; - } - var handler_idx = path.indexOf(handler_element); - if (handler_idx === -1) return; - if (at_idx <= handler_idx) path_idx = at_idx; - } - current_target = path[path_idx] || event.target; - if (current_target === handler_element) return; - define_property(event, "currentTarget", { - configurable: true, - get() { - return current_target || owner_document; - } - }); - var previous_reaction = active_reaction; - var previous_effect = active_effect; - set_active_reaction(null); - set_active_effect(null); - try { - /** - * @type {unknown} - */ - var throw_error; - /** - * @type {unknown[]} - */ - var other_errors = []; - while (current_target !== null) { - /** @type {null | Element} */ - var parent_element = current_target.assignedSlot || current_target.parentNode || current_target.host || null; - try { - var delegated = current_target[event_symbol]?.[event_name]; - if (delegated != null && (!current_target.disabled || event.target === current_target)) delegated.call(current_target, event); - } catch (error) { - if (throw_error) other_errors.push(error); - else throw_error = error; - } - if (event.cancelBubble || parent_element === handler_element || parent_element === null) break; - current_target = parent_element; - } - if (throw_error) { - for (let error of other_errors) queueMicrotask(() => { - throw error; - }); - throw throw_error; - } - } finally { - event[event_symbol] = handler_element; - delete event.currentTarget; - set_active_reaction(previous_reaction); - set_active_effect(previous_effect); - } -} -globalThis?.window?.trustedTypes; -//#endregion -//#region node_modules/svelte/src/internal/client/dom/template.js -/** -* @param {TemplateNode} start -* @param {TemplateNode | null} end -*/ -function assign_nodes(start, end) { - var effect = active_effect; - if (effect.nodes === null) effect.nodes = { - start, - end, - a: null, - t: null - }; -} -/** -* Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component. -* Transitions will play during the initial render unless the `intro` option is set to `false`. -* -* @template {Record} Props -* @template {Record} Exports -* @param {ComponentType> | Component} component -* @param {MountOptions} options -* @returns {Exports} -*/ -function mount(component, options) { - return _mount(component, options); -} -/** -* Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component -* -* @template {Record} Props -* @template {Record} Exports -* @param {ComponentType> | Component} component -* @param {{} extends Props ? { -* target: Document | Element | ShadowRoot; -* props?: Props; -* events?: Record any>; -* context?: Map; -* intro?: boolean; -* recover?: boolean; -* transformError?: (error: unknown) => unknown; -* } : { -* target: Document | Element | ShadowRoot; -* props: Props; -* events?: Record any>; -* context?: Map; -* intro?: boolean; -* recover?: boolean; -* transformError?: (error: unknown) => unknown; -* }} options -* @returns {Exports} -*/ -function hydrate(component, options) { - init_operations(); - options.intro = options.intro ?? false; - const target = options.target; - const was_hydrating = hydrating; - const previous_hydrate_node = hydrate_node; - try { - var anchor = /* @__PURE__ */ get_first_child(target); - while (anchor && (anchor.nodeType !== 8 || anchor.data !== "[")) anchor = /* @__PURE__ */ get_next_sibling(anchor); - if (!anchor) throw HYDRATION_ERROR; - set_hydrating(true); - set_hydrate_node(anchor); - const instance = _mount(component, { - ...options, - anchor - }); - set_hydrating(false); - return instance; - } catch (error) { - if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) throw error; - if (error !== HYDRATION_ERROR) console.warn("Failed to hydrate: ", error); - if (options.recover === false) hydration_failed(); - init_operations(); - clear_text_content(target); - set_hydrating(false); - return mount(component, options); - } finally { - set_hydrating(was_hydrating); - set_hydrate_node(previous_hydrate_node); - } -} -/** @type {Map>} */ -var listeners = /* @__PURE__ */ new Map(); -/** -* @template {Record} Exports -* @param {ComponentType> | Component} Component -* @param {MountOptions} options -* @returns {Exports} -*/ -function _mount(Component, { target, anchor, props = {}, events, context, intro = true, transformError }) { - init_operations(); - /** @type {Exports} */ - var component = void 0; - var unmount = component_root(() => { - var anchor_node = anchor ?? target.appendChild(create_text()); - boundary(anchor_node, { pending: () => {} }, (anchor_node) => { - push({}); - var ctx = component_context; - if (context) ctx.c = context; - if (events) - /** @type {any} */ props.$$events = events; - if (hydrating) assign_nodes(anchor_node, null); - component = Component(anchor_node, props) || {}; - if (hydrating) { - /** @type {Effect & { nodes: EffectNodes }} */ active_effect.nodes.end = hydrate_node; - if (hydrate_node === null || hydrate_node.nodeType !== 8 || hydrate_node.data !== "]") { - hydration_mismatch(); - throw HYDRATION_ERROR; - } - } - pop(); - }, transformError); - /** @type {Set} */ - var registered_events = /* @__PURE__ */ new Set(); - /** @param {Array} events */ - var event_handle = (events) => { - for (var i = 0; i < events.length; i++) { - var event_name = events[i]; - if (registered_events.has(event_name)) continue; - registered_events.add(event_name); - var passive = is_passive_event(event_name); - for (const node of [target, document]) { - var counts = listeners.get(node); - if (counts === void 0) { - counts = /* @__PURE__ */ new Map(); - listeners.set(node, counts); - } - var count = counts.get(event_name); - if (count === void 0) { - node.addEventListener(event_name, handle_event_propagation, { passive }); - counts.set(event_name, 1); - } else counts.set(event_name, count + 1); - } - } - }; - event_handle(array_from(all_registered_events)); - root_event_handles.add(event_handle); - return () => { - for (var event_name of registered_events) for (const node of [target, document]) { - var counts = listeners.get(node); - var count = counts.get(event_name); - if (--count == 0) { - node.removeEventListener(event_name, handle_event_propagation); - counts.delete(event_name); - if (counts.size === 0) listeners.delete(node); - } else counts.set(event_name, count); - } - root_event_handles.delete(event_handle); - if (anchor_node !== anchor) anchor_node.parentNode?.removeChild(anchor_node); - }; - }); - mounted_components.set(component, unmount); - return component; -} -/** -* References of the components that were mounted or hydrated. -* Uses a `WeakMap` to avoid memory leaks. -*/ -var mounted_components = /* @__PURE__ */ new WeakMap(); -/** -* Unmounts a component that was previously mounted using `mount` or `hydrate`. -* -* Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM. -* -* Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`). -* -* ```js -* import { mount, unmount } from 'svelte'; -* import App from './App.svelte'; -* -* const app = mount(App, { target: document.body }); -* -* // later... -* unmount(app, { outro: true }); -* ``` -* @param {Record} component -* @param {{ outro?: boolean }} [options] -* @returns {Promise} -*/ -function unmount(component, options) { - const fn = mounted_components.get(component); - if (fn) { - mounted_components.delete(component); - return fn(options); - } - return Promise.resolve(); -} -//#endregion -//#region node_modules/svelte/src/legacy/legacy-client.js -/** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */ -/** -* Takes the component function and returns a Svelte 4 compatible component constructor. -* -* @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5. -* -* @template {Record} Props -* @template {Record} Exports -* @template {Record} Events -* @template {Record} Slots -* -* @param {SvelteComponent | Component} component -* @returns {ComponentType & Exports>} -*/ -function asClassComponent$1(component) { - return class extends Svelte4Component { - /** @param {any} options */ - constructor(options) { - super({ - component, - ...options - }); - } - }; -} -/** -* Support using the component as both a class and function during the transition period -* @typedef {{new (o: ComponentConstructorOptions): SvelteComponent;(...args: Parameters>>): ReturnType, Record>>;}} LegacyComponentType -*/ -var Svelte4Component = class { - /** @type {any} */ - #events; - /** @type {Record} */ - #instance; - /** - * @param {ComponentConstructorOptions & { - * component: any; - * }} options - */ - constructor(options) { - var sources = /* @__PURE__ */ new Map(); - /** - * @param {string | symbol} key - * @param {unknown} value - */ - var add_source = (key, value) => { - var s = /* @__PURE__ */ mutable_source(value, false, false); - sources.set(key, s); - return s; - }; - const props = new Proxy({ - ...options.props || {}, - $$events: {} - }, { - get(target, prop) { - return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop))); - }, - has(target, prop) { - if (prop === LEGACY_PROPS) return true; - get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop))); - return Reflect.has(target, prop); - }, - set(target, prop, value) { - set(sources.get(prop) ?? add_source(prop, value), value); - return Reflect.set(target, prop, value); - } - }); - this.#instance = (options.hydrate ? hydrate : mount)(options.component, { - target: options.target, - anchor: options.anchor, - props, - context: options.context, - intro: options.intro ?? false, - recover: options.recover, - transformError: options.transformError - }); - if (!async_mode_flag && (!options?.props?.$$host || options.sync === false)) flushSync(); - this.#events = props.$$events; - for (const key of Object.keys(this.#instance)) { - if (key === "$set" || key === "$destroy" || key === "$on") continue; - define_property(this, key, { - get() { - return this.#instance[key]; - }, - /** @param {any} value */ - set(value) { - this.#instance[key] = value; - }, - enumerable: true - }); - } - this.#instance.$set = (next) => { - Object.assign(props, next); - }; - this.#instance.$destroy = () => { - unmount(this.#instance); - }; - } - /** @param {Record} props */ - $set(props) { - this.#instance.$set(props); - } - /** - * @param {string} event - * @param {(...args: any[]) => any} callback - * @returns {any} - */ - $on(event, callback) { - this.#events[event] = this.#events[event] || []; - /** @param {any[]} args */ - const cb = (...args) => callback.call(this, ...args); - this.#events[event].push(cb); - return () => { - this.#events[event] = this.#events[event].filter( - /** @param {any} fn */ - (fn) => fn !== cb - ); - }; - } - $destroy() { - this.#instance.$destroy(); - } -}; -//#endregion -//#region node_modules/svelte/src/legacy/legacy-server.js -/** @import { SvelteComponent } from '../index.js' */ -/** @import { Csp } from '#server' */ -/** @typedef {{ head: string, html: string, css: { code: string, map: null }; hashes?: { script: `sha256-${string}`[] } }} LegacyRenderResult */ -/** -* Takes a Svelte 5 component and returns a Svelte 4 compatible component constructor. -* -* @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5. -* -* @template {Record} Props -* @template {Record} Exports -* @template {Record} Events -* @template {Record} Slots -* -* @param {SvelteComponent} component -* @returns {typeof SvelteComponent & Exports} -*/ -function asClassComponent(component) { - const component_constructor = asClassComponent$1(component); - /** @type {(props?: {}, opts?: { $$slots?: {}; context?: Map; csp?: Csp; transformError?: (error: unknown) => unknown }) => LegacyRenderResult & PromiseLike } */ - const _render = (props, { context, csp, transformError } = {}) => { - const result = render(component, { - props, - context, - csp, - transformError - }); - const munged = Object.defineProperties({}, { - css: { value: { - code: "", - map: null - } }, - head: { get: () => result.head }, - html: { get: () => result.body }, - then: { - /** - * this is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function. - * - * @template TResult1 - * @template [TResult2=never] - * @param { (value: LegacyRenderResult) => TResult1 } onfulfilled - * @param { (reason: unknown) => TResult2 } onrejected - */ -value: (onfulfilled, onrejected) => { - if (!async_mode_flag) { - const user_result = onfulfilled({ - css: munged.css, - head: munged.head, - html: munged.html - }); - return Promise.resolve(user_result); - } - return result.then((result) => { - return onfulfilled({ - css: munged.css, - head: result.head, - html: result.body, - hashes: result.hashes - }); - }, onrejected); - } } - }); - return munged; - }; - component_constructor.render = _render; - return component_constructor; -} -//#endregion -//#region .svelte-kit/generated/root.svelte -function Root($$renderer, $$props) { - $$renderer.component(($$renderer) => { - let { stores, page, constructors, components = [], form, data_0 = null, data_1 = null, data_2 = null } = $$props; - setContext("__svelte__", stores); - stores.page.set(page); - const Pyramid_2 = derived(() => constructors[2]); - if (constructors[1]) { - $$renderer.push(""); - const Pyramid_0 = constructors[0]; - if (Pyramid_0) { - $$renderer.push(""); - Pyramid_0($$renderer, { - data: data_0, - form, - params: page.params, - children: ($$renderer) => { - if (constructors[2]) { - $$renderer.push(""); - const Pyramid_1 = constructors[1]; - if (Pyramid_1) { - $$renderer.push(""); - Pyramid_1($$renderer, { - data: data_1, - form, - params: page.params, - children: ($$renderer) => { - if (Pyramid_2()) { - $$renderer.push(""); - Pyramid_2()($$renderer, { - data: data_2, - form, - params: page.params - }); - $$renderer.push(""); - } else { - $$renderer.push(""); - $$renderer.push(""); - } - }, - $$slots: { default: true } - }); - $$renderer.push(""); - } else { - $$renderer.push(""); - $$renderer.push(""); - } - } else { - $$renderer.push(""); - const Pyramid_1 = constructors[1]; - if (Pyramid_1) { - $$renderer.push(""); - Pyramid_1($$renderer, { - data: data_1, - form, - params: page.params - }); - $$renderer.push(""); - } else { - $$renderer.push(""); - $$renderer.push(""); - } - } - $$renderer.push(``); - }, - $$slots: { default: true } - }); - $$renderer.push(""); - } else { - $$renderer.push(""); - $$renderer.push(""); - } - } else { - $$renderer.push(""); - const Pyramid_0 = constructors[0]; - if (Pyramid_0) { - $$renderer.push(""); - Pyramid_0($$renderer, { - data: data_0, - form, - params: page.params - }); - $$renderer.push(""); - } else { - $$renderer.push(""); - $$renderer.push(""); - } - } - $$renderer.push(` `); - $$renderer.push(""); - $$renderer.push(``); - }); -} -//#endregion -//#region .svelte-kit/generated/server/internal.js -var options = { - app_template_contains_nonce: false, - async: false, - csp: { - "mode": "auto", - "directives": { - "upgrade-insecure-requests": false, - "block-all-mixed-content": false - }, - "reportOnly": { - "upgrade-insecure-requests": false, - "block-all-mixed-content": false - } - }, - csrf_check_origin: true, - csrf_trusted_origins: [], - embedded: false, - env_public_prefix: "PUBLIC_", - env_private_prefix: "", - hash_routing: false, - hooks: null, - preload_strategy: "modulepreload", - root: asClassComponent(Root), - service_worker: false, - service_worker_options: void 0, - server_error_boundaries: false, - templates: { - app: ({ head, body, assets, nonce, env }) => "\n\n \n \n \n \n " + head + "\n \n \n
" + body + "
\n \n\n", - error: ({ status, message }) => "\n\n \n \n " + message + "\n\n \n \n \n
\n " + status + "\n
\n

" + message + "

\n
\n
\n \n\n" - }, - version_hash: "eq7x7d" -}; -async function get_hooks() { - let handle; - let handleFetch; - let handleError; - let handleValidationError; - let init; - let reroute; - let transport; - return { - handle, - handleFetch, - handleError, - handleValidationError, - init, - reroute, - transport - }; -} -//#endregion -export { set_read_implementation as a, set_manifest as i, options as n, read_implementation as r, get_hooks as t }; diff --git a/frontend/.svelte-kit/output/server/chunks/navigation.js b/frontend/.svelte-kit/output/server/chunks/navigation.js deleted file mode 100644 index 6852615..0000000 --- a/frontend/.svelte-kit/output/server/chunks/navigation.js +++ /dev/null @@ -1,2 +0,0 @@ -import "./client.js"; -export {}; diff --git a/frontend/.svelte-kit/output/server/chunks/shared.js b/frontend/.svelte-kit/output/server/chunks/shared.js deleted file mode 100644 index 51480e6..0000000 --- a/frontend/.svelte-kit/output/server/chunks/shared.js +++ /dev/null @@ -1,296 +0,0 @@ -import { i as hydratable } from "./index-server.js"; -import { HttpError, SvelteKitError } from "@sveltejs/kit/internal"; -import * as devalue from "devalue"; -//#region node_modules/@sveltejs/kit/src/utils/functions.js -function noop() {} -/** -* @template T -* @param {() => T} fn -*/ -function once(fn) { - let done = false; - /** @type T */ - let result; - return () => { - if (done) return result; - done = true; - return result = fn(); - }; -} -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/utils.js -var text_encoder = new TextEncoder(); -var text_decoder = new TextDecoder(); -/** -* Like node's path.relative, but without using node -* @param {string} from -* @param {string} to -*/ -function get_relative_path(from, to) { - const from_parts = from.split(/[/\\]/); - const to_parts = to.split(/[/\\]/); - from_parts.pop(); - while (from_parts[0] === to_parts[0]) { - from_parts.shift(); - to_parts.shift(); - } - let i = from_parts.length; - while (i--) from_parts[i] = ".."; - return from_parts.concat(to_parts).join("/"); -} -/** -* @param {Uint8Array} bytes -* @returns {string} -*/ -function base64_encode(bytes) { - if (globalThis.Buffer) return globalThis.Buffer.from(bytes).toString("base64"); - let binary = ""; - for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]); - return btoa(binary); -} -/** -* @param {string} encoded -* @returns {Uint8Array} -*/ -function base64_decode(encoded) { - if (globalThis.Buffer) { - const buffer = globalThis.Buffer.from(encoded, "base64"); - return new Uint8Array(buffer); - } - const binary = atob(encoded); - const bytes = new Uint8Array(binary.length); - for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i); - return bytes; -} -//#endregion -//#region node_modules/@sveltejs/kit/src/utils/error.js -/** -* @param {unknown} err -* @return {Error} -*/ -function coalesce_to_error(err) { - return err instanceof Error || err && err.name && err.message ? err : new Error(JSON.stringify(err)); -} -/** -* This is an identity function that exists to make TypeScript less -* paranoid about people throwing things that aren't errors, which -* frankly is not something we should care about -* @param {unknown} error -*/ -function normalize_error(error) { - return error; -} -/** -* @param {unknown} error -*/ -function get_status(error) { - return error instanceof HttpError || error instanceof SvelteKitError ? error.status : 500; -} -/** -* @param {unknown} error -*/ -function get_message(error) { - return error instanceof SvelteKitError ? error.text : "Internal Error"; -} -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/shared.js -/** @import { Transport } from '@sveltejs/kit' */ -/** -* @param {string} route_id -* @param {string} dep -*/ -function validate_depends(route_id, dep) { - const match = /^(moz-icon|view-source|jar):/.exec(dep); - if (match) console.warn(`${route_id}: Calling \`depends('${dep}')\` will throw an error in Firefox because \`${match[1]}\` is a special URI scheme`); -} -var INVALIDATED_PARAM = "x-sveltekit-invalidated"; -var TRAILING_SLASH_PARAM = "x-sveltekit-trailing-slash"; -/** -* @param {any} data -* @param {string} [location_description] -*/ -function validate_load_response(data, location_description) { - if (data != null && Object.getPrototypeOf(data) !== Object.prototype) throw new Error(`a load function ${location_description} returned ${typeof data !== "object" ? `a ${typeof data}` : data instanceof Response ? "a Response object" : Array.isArray(data) ? "an array" : "a non-plain object"}, but must return a plain object at the top level (i.e. \`return {...}\`)`); -} -/** -* Try to `devalue.stringify` the data object using the provided transport encoders. -* @param {any} data -* @param {Transport} transport -*/ -function stringify(data, transport) { - const encoders = Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.encode])); - return devalue.stringify(data, encoders); -} -var object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0"); -/** -* @param {unknown} thing -* @returns {thing is Record} -*/ -function is_plain_object(thing) { - if (typeof thing !== "object" || thing === null) return false; - const proto = Object.getPrototypeOf(thing); - return proto === Object.prototype || proto === null || Object.getPrototypeOf(proto) === null || Object.getOwnPropertyNames(proto).sort().join("\0") === object_proto_names; -} -/** -* @param {Record} value -* @param {Map} clones -*/ -function to_sorted(value, clones) { - const clone = Object.getPrototypeOf(value) === null ? Object.create(null) : {}; - clones.set(value, clone); - Object.defineProperty(clone, remote_arg_marker, { value: true }); - for (const key of Object.keys(value).sort()) { - const property = value[key]; - Object.defineProperty(clone, key, { - value: clones.get(property) ?? property, - enumerable: true, - configurable: true, - writable: true - }); - } - return clone; -} -var remote_object = "__skrao"; -var remote_map = "__skram"; -var remote_set = "__skras"; -var remote_regex_guard = "__skrag"; -var remote_arg_marker = Symbol(remote_object); -/** -* @param {Transport} transport -* @param {boolean} sort -* @param {Map} remote_arg_clones -*/ -function create_remote_arg_reducers(transport, sort, remote_arg_clones) { - /** @type {Record unknown>} */ - const remote_fns_reducers = { [remote_regex_guard]: (value) => { - if (value instanceof RegExp) throw new Error("Regular expressions are not valid remote function arguments"); - } }; - if (sort) { - /** @type {(value: unknown) => Array<[unknown, unknown]> | undefined} */ - remote_fns_reducers[remote_map] = (value) => { - if (!(value instanceof Map)) return; - /** @type {Array<[string, string]>} */ - const entries = []; - for (const [key, val] of value) entries.push([stringify(key), stringify(val)]); - return entries.sort(([a1, a2], [b1, b2]) => { - if (a1 < b1) return -1; - if (a1 > b1) return 1; - if (a2 < b2) return -1; - if (a2 > b2) return 1; - return 0; - }); - }; - /** @type {(value: unknown) => unknown[] | undefined} */ - remote_fns_reducers[remote_set] = (value) => { - if (!(value instanceof Set)) return; - /** @type {string[]} */ - const items = []; - for (const item of value) items.push(stringify(item)); - items.sort(); - return items; - }; - /** @type {(value: unknown) => Record | undefined} */ - remote_fns_reducers[remote_object] = (value) => { - if (!is_plain_object(value)) return; - if (Object.hasOwn(value, remote_arg_marker)) return; - if (remote_arg_clones.has(value)) return remote_arg_clones.get(value); - return to_sorted(value, remote_arg_clones); - }; - } - const all_reducers = { - ...Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.encode])), - ...remote_fns_reducers - }; - /** @type {(value: unknown) => string} */ - const stringify = (value) => devalue.stringify(value, all_reducers); - return all_reducers; -} -/** @param {Transport} transport */ -function create_remote_arg_revivers(transport) { - const remote_fns_revivers = { - /** @type {(value: unknown) => unknown} */ - [remote_object]: (value) => value, - /** @type {(value: unknown) => Map} */ - [remote_map]: (value) => { - if (!Array.isArray(value)) throw new Error("Invalid data for Map reviver"); - const map = /* @__PURE__ */ new Map(); - for (const item of value) { - if (!Array.isArray(item) || item.length !== 2 || typeof item[0] !== "string" || typeof item[1] !== "string") throw new Error("Invalid data for Map reviver"); - const [key, val] = item; - map.set(parse(key), parse(val)); - } - return map; - }, - /** @type {(value: unknown) => Set} */ - [remote_set]: (value) => { - if (!Array.isArray(value)) throw new Error("Invalid data for Set reviver"); - const set = /* @__PURE__ */ new Set(); - for (const item of value) { - if (typeof item !== "string") throw new Error("Invalid data for Set reviver"); - set.add(parse(item)); - } - return set; - } - }; - const all_revivers = { - ...Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.decode])), - ...remote_fns_revivers - }; - /** @type {(data: string) => unknown} */ - const parse = (data) => devalue.parse(data, all_revivers); - return all_revivers; -} -/** -* Stringifies the argument (if any) for a remote function in such a way that -* it is both a valid URL and a valid file name (necessary for prerendering). -* @param {any} value -* @param {Transport} transport -* @param {boolean} [sort] -*/ -function stringify_remote_arg(value, transport, sort = true) { - if (value === void 0) return ""; - const json_string = devalue.stringify(value, create_remote_arg_reducers(transport, sort, /* @__PURE__ */ new Map())); - return base64_encode(text_encoder.encode(json_string)).replaceAll("=", "").replaceAll("+", "-").replaceAll("/", "_"); -} -/** -* Parses the argument (if any) for a remote function -* @param {string} string -* @param {Transport} transport -*/ -function parse_remote_arg(string, transport) { - if (!string) return void 0; - const json_string = text_decoder.decode(base64_decode(string.replaceAll("-", "+").replaceAll("_", "/"))); - return devalue.parse(json_string, create_remote_arg_revivers(transport)); -} -/** -* @param {string} id -* @param {string} payload -*/ -function create_remote_key(id, payload) { - return id + "/" + payload; -} -/** -* @param {string} key -* @returns {{ id: string; payload: string }} -*/ -function split_remote_key(key) { - const i = key.lastIndexOf("/"); - if (i === -1) throw new Error(`Invalid remote key: ${key}`); - return { - id: key.slice(0, i), - payload: key.slice(i + 1) - }; -} -/** -* @template T -* @param {string} key -* @param {() => T} fn -* @returns {T} -* @deprecated TODO remove in SvelteKit 3.0 -*/ -function unfriendly_hydratable(key, fn) { - if (!hydratable) throw new Error("Remote functions require Svelte 5.44.0 or later"); - return hydratable(key, fn); -} -//#endregion -export { get_relative_path as _, split_remote_key as a, noop as b, unfriendly_hydratable as c, coalesce_to_error as d, get_message as f, base64_encode as g, base64_decode as h, parse_remote_arg as i, validate_depends as l, normalize_error as m, TRAILING_SLASH_PARAM as n, stringify as o, get_status as p, create_remote_key as r, stringify_remote_arg as s, INVALIDATED_PARAM as t, validate_load_response as u, text_decoder as v, once as x, text_encoder as y }; diff --git a/frontend/.svelte-kit/output/server/chunks/utils.js b/frontend/.svelte-kit/output/server/chunks/utils.js deleted file mode 100644 index ee51ad6..0000000 --- a/frontend/.svelte-kit/output/server/chunks/utils.js +++ /dev/null @@ -1,813 +0,0 @@ -import { d as coalesce_to_error, f as get_message, p as get_status, v as text_decoder } from "./shared.js"; -import "./environment.js"; -import { json, text } from "@sveltejs/kit"; -import { HttpError, SvelteKitError } from "@sveltejs/kit/internal"; -import { with_request_store } from "@sveltejs/kit/internal/server"; -import * as devalue from "devalue"; -//#region node_modules/@sveltejs/kit/src/constants.js -/** -* A fake asset path used in `vite dev` and `vite preview`, so that we can -* serve local assets while verifying that requests are correctly prefixed -*/ -var SVELTE_KIT_ASSETS = "/_svelte_kit_assets"; -var ENDPOINT_METHODS = [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "OPTIONS", - "HEAD" -]; -var MUTATIVE_METHODS = [ - "POST", - "PUT", - "PATCH", - "DELETE" -]; -var PAGE_METHODS = [ - "GET", - "POST", - "HEAD" -]; -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/form-utils.js -/** @import { RemoteForm } from '@sveltejs/kit' */ -/** @import { BinaryFormMeta, InternalRemoteFormIssue } from 'types' */ -/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ -/** -* Sets a value in a nested object using a path string, mutating the original object -* @param {Record} object -* @param {string} path_string -* @param {any} value -*/ -function set_nested_value(object, path_string, value) { - if (path_string.startsWith("n:")) { - path_string = path_string.slice(2); - value = value === "" ? void 0 : parseFloat(value); - } else if (path_string.startsWith("b:")) { - path_string = path_string.slice(2); - value = value === "on"; - } - deep_set(object, split_path(path_string), value); -} -/** -* Convert `FormData` into a POJO -* @param {FormData} data -*/ -function convert_formdata(data) { - /** @type {Record} */ - const result = {}; - for (let key of data.keys()) { - const is_array = key.endsWith("[]"); - /** @type {any[]} */ - let values = data.getAll(key); - if (is_array) key = key.slice(0, -2); - if (values.length > 1 && !is_array) throw new Error(`Form cannot contain duplicated keys — "${key}" has ${values.length} values`); - values = values.filter((entry) => typeof entry === "string" || entry.name !== "" || entry.size > 0); - if (key.startsWith("n:")) { - key = key.slice(2); - values = values.map((v) => v === "" ? void 0 : parseFloat(v)); - } else if (key.startsWith("b:")) { - key = key.slice(2); - values = values.map((v) => v === "on"); - } - set_nested_value(result, key, is_array ? values : values[0]); - } - return result; -} -var BINARY_FORM_CONTENT_TYPE = "application/x-sveltekit-formdata"; -var BINARY_FORM_VERSION = 0; -var HEADER_BYTES = 7; -/** -* @param {Request} request -* @returns {Promise<{ data: Record; meta: BinaryFormMeta; form_data: FormData | null }>} -*/ -async function deserialize_binary_form(request) { - if (request.headers.get("content-type") !== "application/x-sveltekit-formdata") { - const form_data = await request.formData(); - return { - data: convert_formdata(form_data), - meta: {}, - form_data - }; - } - if (!request.body) throw deserialize_error("no body"); - const content_length = parseInt(request.headers.get("content-length") ?? ""); - if (Number.isNaN(content_length)) throw deserialize_error("invalid Content-Length header"); - const reader = request.body.getReader(); - /** @type {Array | undefined>>} */ - const chunks = []; - /** - * @param {number} index - * @returns {Promise | undefined>} - */ - function get_chunk(index) { - if (index in chunks) return chunks[index]; - let i = chunks.length; - while (i <= index) { - chunks[i] = reader.read().then((chunk) => chunk.value); - i++; - } - return chunks[index]; - } - /** - * @param {number} offset - * @param {number} length - * @returns {Promise} - */ - async function get_buffer(offset, length) { - /** @type {Uint8Array} */ - let start_chunk; - let chunk_start = 0; - /** @type {number} */ - let chunk_index; - for (chunk_index = 0;; chunk_index++) { - const chunk = await get_chunk(chunk_index); - if (!chunk) return null; - const chunk_end = chunk_start + chunk.byteLength; - if (offset >= chunk_start && offset < chunk_end) { - start_chunk = chunk; - break; - } - chunk_start = chunk_end; - } - if (offset + length <= chunk_start + start_chunk.byteLength) return start_chunk.subarray(offset - chunk_start, offset + length - chunk_start); - const chunks = [start_chunk.subarray(offset - chunk_start)]; - let cursor = start_chunk.byteLength - offset + chunk_start; - while (cursor < length) { - chunk_index++; - let chunk = await get_chunk(chunk_index); - if (!chunk) return null; - if (chunk.byteLength > length - cursor) chunk = chunk.subarray(0, length - cursor); - chunks.push(chunk); - cursor += chunk.byteLength; - } - const buffer = new Uint8Array(length); - cursor = 0; - for (const chunk of chunks) { - buffer.set(chunk, cursor); - cursor += chunk.byteLength; - } - return buffer; - } - const header = await get_buffer(0, HEADER_BYTES); - if (!header) throw deserialize_error("too short"); - if (header[0] !== BINARY_FORM_VERSION) throw deserialize_error(`got version ${header[0]}, expected version ${BINARY_FORM_VERSION}`); - const header_view = new DataView(header.buffer, header.byteOffset, header.byteLength); - const data_length = header_view.getUint32(1, true); - if (HEADER_BYTES + data_length > content_length) throw deserialize_error("data overflow"); - const file_offsets_length = header_view.getUint16(5, true); - if (HEADER_BYTES + data_length + file_offsets_length > content_length) throw deserialize_error("file offset table overflow"); - const data_buffer = await get_buffer(HEADER_BYTES, data_length); - if (!data_buffer) throw deserialize_error("data too short"); - /** @type {Array} */ - let file_offsets; - /** @type {number} */ - let files_start_offset; - if (file_offsets_length > 0) { - const file_offsets_buffer = await get_buffer(HEADER_BYTES + data_length, file_offsets_length); - if (!file_offsets_buffer) throw deserialize_error("file offset table too short"); - const parsed_offsets = JSON.parse(text_decoder.decode(file_offsets_buffer)); - if (!Array.isArray(parsed_offsets) || parsed_offsets.some((n) => typeof n !== "number" || !Number.isInteger(n) || n < 0)) throw deserialize_error("invalid file offset table"); - file_offsets = parsed_offsets; - files_start_offset = HEADER_BYTES + data_length + file_offsets_length; - } - /** @type {Array<{ offset: number, size: number }>} */ - const file_spans = []; - const [data, meta] = devalue.parse(text_decoder.decode(data_buffer), { File: ([name, type, size, last_modified, index]) => { - if (typeof name !== "string" || typeof type !== "string" || typeof size !== "number" || typeof last_modified !== "number" || typeof index !== "number") throw deserialize_error("invalid file metadata"); - let offset = file_offsets[index]; - if (offset === void 0) throw deserialize_error("duplicate file offset table index"); - file_offsets[index] = void 0; - offset += files_start_offset; - if (offset + size > content_length) throw deserialize_error("file data overflow"); - file_spans.push({ - offset, - size - }); - return new Proxy(new LazyFile(name, type, size, last_modified, get_chunk, offset), { getPrototypeOf() { - return File.prototype; - } }); - } }); - file_spans.sort((a, b) => a.offset - b.offset || a.size - b.size); - for (let i = 1; i < file_spans.length; i++) { - const previous = file_spans[i - 1]; - const current = file_spans[i]; - const previous_end = previous.offset + previous.size; - if (previous_end < current.offset) throw deserialize_error("gaps in file data"); - if (previous_end > current.offset) throw deserialize_error("overlapping file data"); - } - (async () => { - let has_more = true; - while (has_more) has_more = !!await get_chunk(chunks.length); - })(); - return { - data, - meta, - form_data: null - }; -} -/** -* @param {string} message -*/ -function deserialize_error(message) { - return new SvelteKitError(400, "Bad Request", `Could not deserialize binary form: ${message}`); -} -/** @implements {File} */ -var LazyFile = class LazyFile { - /** @type {(index: number) => Promise | undefined>} */ - #get_chunk; - /** @type {number} */ - #offset; - /** - * @param {string} name - * @param {string} type - * @param {number} size - * @param {number} last_modified - * @param {(index: number) => Promise | undefined>} get_chunk - * @param {number} offset - */ - constructor(name, type, size, last_modified, get_chunk, offset) { - this.name = name; - this.type = type; - this.size = size; - this.lastModified = last_modified; - this.webkitRelativePath = ""; - this.#get_chunk = get_chunk; - this.#offset = offset; - this.arrayBuffer = this.arrayBuffer.bind(this); - this.bytes = this.bytes.bind(this); - this.slice = this.slice.bind(this); - this.stream = this.stream.bind(this); - this.text = this.text.bind(this); - } - /** @type {ArrayBuffer | undefined} */ - #buffer; - async arrayBuffer() { - this.#buffer ??= await new Response(this.stream()).arrayBuffer(); - return this.#buffer; - } - async bytes() { - return new Uint8Array(await this.arrayBuffer()); - } - /** - * @param {number=} start - * @param {number=} end - * @param {string=} contentType - */ - slice(start = 0, end = this.size, contentType = this.type) { - if (start < 0) start = Math.max(this.size + start, 0); - else start = Math.min(start, this.size); - if (end < 0) end = Math.max(this.size + end, 0); - else end = Math.min(end, this.size); - const size = Math.max(end - start, 0); - return new LazyFile(this.name, contentType, size, this.lastModified, this.#get_chunk, this.#offset + start); - } - stream() { - let cursor = 0; - let chunk_index = 0; - return new ReadableStream({ - start: async (controller) => { - let chunk_start = 0; - /** @type {Uint8Array} */ - let start_chunk; - for (chunk_index = 0;; chunk_index++) { - const chunk = await this.#get_chunk(chunk_index); - if (!chunk) return null; - const chunk_end = chunk_start + chunk.byteLength; - if (this.#offset >= chunk_start && this.#offset < chunk_end) { - start_chunk = chunk; - break; - } - chunk_start = chunk_end; - } - if (this.#offset + this.size <= chunk_start + start_chunk.byteLength) { - controller.enqueue(start_chunk.subarray(this.#offset - chunk_start, this.#offset + this.size - chunk_start)); - controller.close(); - } else { - controller.enqueue(start_chunk.subarray(this.#offset - chunk_start)); - cursor = start_chunk.byteLength - this.#offset + chunk_start; - } - }, - pull: async (controller) => { - chunk_index++; - let chunk = await this.#get_chunk(chunk_index); - if (!chunk) { - controller.error("incomplete file data"); - controller.close(); - return; - } - if (chunk.byteLength > this.size - cursor) chunk = chunk.subarray(0, this.size - cursor); - controller.enqueue(chunk); - cursor += chunk.byteLength; - if (cursor >= this.size) controller.close(); - } - }); - } - async text() { - return text_decoder.decode(await this.arrayBuffer()); - } -}; -var path_regex = /^[a-zA-Z_$]\w*(\.[a-zA-Z_$]\w*|\[\d+\])*$/; -/** -* @param {string} path -*/ -function split_path(path) { - if (!path_regex.test(path)) throw new Error(`Invalid path ${path}`); - return path.split(/\.|\[|\]/).filter(Boolean); -} -/** -* Check if a property key is dangerous and could lead to prototype pollution -* @param {string} key -*/ -function check_prototype_pollution(key) { - if (key === "__proto__" || key === "constructor" || key === "prototype") throw new Error(`Invalid key "${key}"`); -} -/** -* Sets a value in a nested object using an array of keys, mutating the original object. -* @param {Record} object -* @param {string[]} keys -* @param {any} value -*/ -function deep_set(object, keys, value) { - let current = object; - for (let i = 0; i < keys.length - 1; i += 1) { - const key = keys[i]; - check_prototype_pollution(key); - const is_array = /^\d+$/.test(keys[i + 1]); - const inner = Object.hasOwn(current, key) ? current[key] : void 0; - const exists = inner != null; - if (exists && is_array !== Array.isArray(inner)) throw new Error(`Invalid array key ${keys[i + 1]}`); - if (!exists) current[key] = is_array ? [] : {}; - current = current[key]; - } - const final_key = keys[keys.length - 1]; - check_prototype_pollution(final_key); - current[final_key] = value; -} -/** -* @param {StandardSchemaV1.Issue} issue -* @param {boolean} server Whether this issue came from server validation -*/ -function normalize_issue(issue, server = false) { - /** @type {InternalRemoteFormIssue} */ - const normalized = { - name: "", - path: [], - message: issue.message, - server - }; - if (issue.path !== void 0) { - let name = ""; - for (const segment of issue.path) { - const key = typeof segment === "object" ? segment.key : segment; - normalized.path.push(key); - if (typeof key === "number") name += `[${key}]`; - else if (typeof key === "string") name += name === "" ? key : "." + key; - } - normalized.name = name; - } - return normalized; -} -/** -* @param {InternalRemoteFormIssue[]} issues -*/ -function flatten_issues(issues) { - /** @type {Record} */ - const result = {}; - for (const issue of issues) { - (result.$ ??= []).push(issue); - let name = ""; - if (issue.path !== void 0) for (const key of issue.path) { - if (typeof key === "number") name += `[${key}]`; - else if (typeof key === "string") name += name === "" ? key : "." + key; - (result[name] ??= []).push(issue); - } - } - return result; -} -/** -* Gets a nested value from an object using a path array -* @param {Record} object -* @param {(string | number)[]} path -* @returns {any} -*/ -function deep_get(object, path) { - let current = object; - for (const key of path) { - if (current == null || typeof current !== "object") return current; - current = current[key]; - } - return current; -} -/** -* Creates a proxy-based field accessor for form data -* @param {any} target - Function or empty POJO -* @param {() => Record} get_input - Function to get current input data -* @param {(path: (string | number)[], value: any) => void} set_input - Function to set input data -* @param {() => Record} get_issues - Function to get current issues -* @param {(string | number)[]} path - Current access path -* @returns {any} Proxy object with name(), value(), and issues() methods -*/ -function create_field_proxy(target, get_input, set_input, get_issues, path = []) { - const get_value = () => { - return deep_get(get_input(), path); - }; - return new Proxy(target, { get(target, prop) { - if (typeof prop === "symbol") return target[prop]; - if (/^\d+$/.test(prop)) return create_field_proxy({}, get_input, set_input, get_issues, [...path, parseInt(prop, 10)]); - const key = build_path_string(path); - if (prop === "set") { - const set_func = function(newValue) { - set_input(path, newValue); - return newValue; - }; - return create_field_proxy(set_func, get_input, set_input, get_issues, [...path, prop]); - } - if (prop === "value") return create_field_proxy(get_value, get_input, set_input, get_issues, [...path, prop]); - if (prop === "issues" || prop === "allIssues") { - const issues_func = () => { - const all_issues = get_issues()[key === "" ? "$" : key]; - if (prop === "allIssues") return all_issues?.map((issue) => ({ - path: issue.path, - message: issue.message - })); - return all_issues?.filter((issue) => issue.name === key)?.map((issue) => ({ - path: issue.path, - message: issue.message - })); - }; - return create_field_proxy(issues_func, get_input, set_input, get_issues, [...path, prop]); - } - if (prop === "as") { - /** - * @param {string} type - * @param {string} [input_value] - */ - const as_func = (type, input_value) => { - const is_array = type === "file multiple" || type === "select multiple" || type === "checkbox" && typeof input_value === "string"; - /** @type {Record} */ - const base_props = { - name: (type === "number" || type === "range" ? "n:" : type === "checkbox" && !is_array ? "b:" : "") + key + (is_array ? "[]" : ""), - get "aria-invalid"() { - return key in get_issues() ? "true" : void 0; - } - }; - if (type !== "text" && type !== "select" && type !== "select multiple") base_props.type = type === "file multiple" ? "file" : type; - if (type === "submit" || type === "hidden") return Object.defineProperties(base_props, { value: { - value: input_value, - enumerable: true - } }); - if (type === "select" || type === "select multiple") return Object.defineProperties(base_props, { - multiple: { - value: is_array, - enumerable: true - }, - value: { - enumerable: true, - get() { - return get_value() ?? input_value; - } - } - }); - if (type === "checkbox" || type === "radio") return Object.defineProperties(base_props, { - value: { - value: input_value ?? "on", - enumerable: true - }, - checked: { - enumerable: true, - get() { - const value = get_value(); - if (type === "radio") return value === input_value; - if (is_array) return (value ?? []).includes(input_value); - return value; - } - } - }); - if (type === "file" || type === "file multiple") return Object.defineProperties(base_props, { - multiple: { - value: is_array, - enumerable: true - }, - files: { - enumerable: true, - get() { - const value = get_value(); - if (value instanceof File) { - if (typeof DataTransfer !== "undefined") { - const fileList = new DataTransfer(); - fileList.items.add(value); - return fileList.files; - } - return { - 0: value, - length: 1 - }; - } - if (Array.isArray(value) && value.every((f) => f instanceof File)) { - if (typeof DataTransfer !== "undefined") { - const fileList = new DataTransfer(); - value.forEach((file) => fileList.items.add(file)); - return fileList.files; - } - /** @type {any} */ - const fileListLike = { length: value.length }; - value.forEach((file, index) => { - fileListLike[index] = file; - }); - return fileListLike; - } - return null; - } - } - }); - return Object.defineProperties(base_props, { value: { - enumerable: true, - get() { - const value = get_value() ?? input_value; - return value != null ? String(value) : ""; - } - } }); - }; - return create_field_proxy(as_func, get_input, set_input, get_issues, [...path, "as"]); - } - return create_field_proxy({}, get_input, set_input, get_issues, [...path, prop]); - } }); -} -/** -* Builds a path string from an array of path segments -* @param {(string | number)[]} path -* @returns {string} -*/ -function build_path_string(path) { - let result = ""; - for (const segment of path) if (typeof segment === "number") result += `[${segment}]`; - else result += result === "" ? segment : "." + segment; - return result; -} -/** -* @param {RemoteForm} instance -* @deprecated remove in 3.0 -*/ -function throw_on_old_property_access(instance) { - Object.defineProperty(instance, "field", { value: (name) => { - const new_name = name.endsWith("[]") ? name.slice(0, -2) : name; - throw new Error(`\`form.field\` has been removed: Instead of \`\` do \`\``); - } }); - for (const property of ["input", "issues"]) Object.defineProperty(instance, property, { get() { - const new_name = property === "issues" ? "issues" : "value"; - return new Proxy({}, { get(_, prop) { - const prop_string = typeof prop === "string" ? prop : String(prop); - const old = prop_string.includes("[") || prop_string.includes(".") ? `['${prop_string}']` : `.${prop_string}`; - const replacement = `.${prop_string}.${new_name}()`; - throw new Error(`\`form.${property}\` has been removed: Instead of \`form.${property}${old}\` write \`form.fields${replacement}\``); - } }); - } }); -} -//#endregion -//#region node_modules/@sveltejs/kit/src/utils/http.js -/** -* Given an Accept header and a list of possible content types, pick -* the most suitable one to respond with -* @param {string} accept -* @param {string[]} types -*/ -function negotiate(accept, types) { - /** @type {Array<{ type: string, subtype: string, q: number, i: number }>} */ - const parts = []; - accept.split(",").forEach((str, i) => { - const match = /([^/ \t]+)\/([^; \t]+)[ \t]*(?:;[ \t]*q=([0-9.]+))?/.exec(str); - if (match) { - const [, type, subtype, q = "1"] = match; - parts.push({ - type, - subtype, - q: +q, - i - }); - } - }); - parts.sort((a, b) => { - if (a.q !== b.q) return b.q - a.q; - if (a.subtype === "*" !== (b.subtype === "*")) return a.subtype === "*" ? 1 : -1; - if (a.type === "*" !== (b.type === "*")) return a.type === "*" ? 1 : -1; - return a.i - b.i; - }); - let accepted; - let min_priority = Infinity; - for (const mimetype of types) { - const [type, subtype] = mimetype.split("/"); - const priority = parts.findIndex((part) => (part.type === type || part.type === "*") && (part.subtype === subtype || part.subtype === "*")); - if (priority !== -1 && priority < min_priority) { - accepted = mimetype; - min_priority = priority; - } - } - return accepted; -} -/** -* Returns `true` if the request contains a `content-type` header with the given type -* @param {Request} request -* @param {...string} types -*/ -function is_content_type(request, ...types) { - const type = request.headers.get("content-type")?.split(";", 1)[0].trim() ?? ""; - return types.includes(type.toLowerCase()); -} -/** -* @param {Request} request -*/ -function is_form_content_type(request) { - return is_content_type(request, "application/x-www-form-urlencoded", "multipart/form-data", "text/plain", BINARY_FORM_CONTENT_TYPE); -} -//#endregion -//#region node_modules/@sveltejs/kit/src/utils/misc.js -var s = JSON.stringify; -//#endregion -//#region node_modules/@sveltejs/kit/src/utils/escape.js -/** -* When inside a double-quoted attribute value, only `&` and `"` hold special meaning. -* @see https://html.spec.whatwg.org/multipage/parsing.html#attribute-value-(double-quoted)-state -* @type {Record} -*/ -var escape_html_attr_dict = { - "&": "&", - "\"": """ -}; -/** -* @type {Record} -*/ -var escape_html_dict = { - "&": "&", - "<": "<" -}; -var escape_html_attr_regex = new RegExp(`[${Object.keys(escape_html_attr_dict).join("")}]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]`, "g"); -var escape_html_regex = new RegExp(`[${Object.keys(escape_html_dict).join("")}]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]`, "g"); -/** -* Escapes unpaired surrogates (which are allowed in js strings but invalid in HTML) and -* escapes characters that are special. -* -* @param {string} str -* @param {boolean} [is_attr] -* @returns {string} escaped string -* @example const html = `...`; -*/ -function escape_html(str, is_attr) { - const dict = is_attr ? escape_html_attr_dict : escape_html_dict; - return str.replace(is_attr ? escape_html_attr_regex : escape_html_regex, (match) => { - if (match.length === 2) return match; - return dict[match] ?? `&#${match.charCodeAt(0)};`; - }); -} -//#endregion -//#region node_modules/@sveltejs/kit/src/runtime/server/utils.js -/** -* @param {Partial>} mod -* @param {import('types').HttpMethod} method -*/ -function method_not_allowed(mod, method) { - return text(`${method} method not allowed`, { - status: 405, - headers: { allow: allowed_methods(mod).join(", ") } - }); -} -/** @param {Partial>} mod */ -function allowed_methods(mod) { - const allowed = ENDPOINT_METHODS.filter((method) => method in mod); - if ("GET" in mod && !("HEAD" in mod)) allowed.push("HEAD"); - return allowed; -} -/** -* @param {import('types').SSROptions} options -*/ -function get_global_name(options) { - return `__sveltekit_${options.version_hash}`; -} -/** -* Return as a response that renders the error.html -* -* @param {import('types').SSROptions} options -* @param {number} status -* @param {string} message -*/ -function static_error_page(options, status, message) { - return text(options.templates.error({ - status, - message: escape_html(message) - }), { - headers: { "content-type": "text/html; charset=utf-8" }, - status - }); -} -/** -* @param {import('@sveltejs/kit').RequestEvent} event -* @param {import('types').RequestState} state -* @param {import('types').SSROptions} options -* @param {unknown} error -*/ -async function handle_fatal_error(event, state, options, error) { - error = error instanceof HttpError ? error : coalesce_to_error(error); - const status = get_status(error); - const body = await handle_error_and_jsonify(event, state, options, error); - const type = negotiate(event.request.headers.get("accept") || "text/html", ["application/json", "text/html"]); - if (event.isDataRequest || type === "application/json") return json(body, { status }); - return static_error_page(options, status, body.message); -} -/** -* @param {import('@sveltejs/kit').RequestEvent} event -* @param {import('types').RequestState} state -* @param {import('types').SSROptions} options -* @param {any} error -* @returns {Promise} -*/ -async function handle_error_and_jsonify(event, state, options, error) { - if (error instanceof HttpError) return { - message: "Unknown Error", - ...error.body - }; - const status = get_status(error); - const message = get_message(error); - return await with_request_store({ - event, - state - }, () => options.hooks.handleError({ - error, - event, - status, - message - })) ?? { message }; -} -/** -* @param {number} status -* @param {string} location -*/ -function redirect_response(status, location) { - return new Response(void 0, { - status, - headers: { location } - }); -} -/** -* @param {import('@sveltejs/kit').RequestEvent} event -* @param {Error & { path: string }} error -*/ -function clarify_devalue_error(event, error) { - if (error.path) return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error.message} (${error.path}). If you need to serialize/deserialize custom types, use transport hooks: https://svelte.dev/docs/kit/hooks#Universal-hooks-transport.`; - if (error.path === "") return `Data returned from \`load\` while rendering ${event.route.id} is not a plain object`; - return error.message; -} -/** -* @param {import('types').ServerDataNode} node -*/ -function serialize_uses(node) { - const uses = {}; - if (node.uses && node.uses.dependencies.size > 0) uses.dependencies = Array.from(node.uses.dependencies); - if (node.uses && node.uses.search_params.size > 0) uses.search_params = Array.from(node.uses.search_params); - if (node.uses && node.uses.params.size > 0) uses.params = Array.from(node.uses.params); - if (node.uses?.parent) uses.parent = 1; - if (node.uses?.route) uses.route = 1; - if (node.uses?.url) uses.url = 1; - return uses; -} -/** -* Returns `true` if the given path was prerendered -* @param {import('@sveltejs/kit').SSRManifest} manifest -* @param {string} pathname Should include the base and be decoded -*/ -function has_prerendered_path(manifest, pathname) { - return manifest._.prerendered_routes.has(pathname) || pathname.at(-1) === "/" && manifest._.prerendered_routes.has(pathname.slice(0, -1)); -} -/** -* Formats the error into a nice message with sanitized stack trace -* @param {number} status -* @param {Error} error -* @param {import('@sveltejs/kit').RequestEvent} event -*/ -function format_server_error(status, error, event) { - const formatted_text = `\n\x1b[1;31m[${status}] ${event.request.method} ${event.url.pathname}\x1b[0m`; - if (status === 404) return formatted_text; - return `${formatted_text}\n${error.stack}`; -} -/** -* Returns the filename without the extension. e.g., `+page.server`, `+page`, etc. -* @param {string | undefined} node_id -* @returns {string} -*/ -function get_node_type(node_id) { - const filename = (node_id?.split("/"))?.at(-1); - if (!filename) return "unknown"; - return filename.split(".").slice(0, -1).join("."); -} -/** -* Counts HTML comments that are not SSI directives (which start with ` -* -
- - diff --git a/frontend/node_modules/.bin/acorn b/frontend/node_modules/.bin/acorn deleted file mode 120000 index cf76760..0000000 --- a/frontend/node_modules/.bin/acorn +++ /dev/null @@ -1 +0,0 @@ -../acorn/bin/acorn \ No newline at end of file diff --git a/frontend/node_modules/.bin/nanoid b/frontend/node_modules/.bin/nanoid deleted file mode 120000 index e2be547..0000000 --- a/frontend/node_modules/.bin/nanoid +++ /dev/null @@ -1 +0,0 @@ -../nanoid/bin/nanoid.cjs \ No newline at end of file diff --git a/frontend/node_modules/.bin/rolldown b/frontend/node_modules/.bin/rolldown deleted file mode 120000 index 7725012..0000000 --- a/frontend/node_modules/.bin/rolldown +++ /dev/null @@ -1 +0,0 @@ -../rolldown/bin/cli.mjs \ No newline at end of file diff --git a/frontend/node_modules/.bin/svelte-check b/frontend/node_modules/.bin/svelte-check deleted file mode 120000 index 2d8d3dc..0000000 --- a/frontend/node_modules/.bin/svelte-check +++ /dev/null @@ -1 +0,0 @@ -../svelte-check/bin/svelte-check \ No newline at end of file diff --git a/frontend/node_modules/.bin/svelte-kit b/frontend/node_modules/.bin/svelte-kit deleted file mode 120000 index faccdd4..0000000 --- a/frontend/node_modules/.bin/svelte-kit +++ /dev/null @@ -1 +0,0 @@ -../@sveltejs/kit/svelte-kit.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/tsc b/frontend/node_modules/.bin/tsc deleted file mode 120000 index 0863208..0000000 --- a/frontend/node_modules/.bin/tsc +++ /dev/null @@ -1 +0,0 @@ -../typescript/bin/tsc \ No newline at end of file diff --git a/frontend/node_modules/.bin/tsgo b/frontend/node_modules/.bin/tsgo deleted file mode 120000 index 7660fb7..0000000 --- a/frontend/node_modules/.bin/tsgo +++ /dev/null @@ -1 +0,0 @@ -../@typescript/native-preview/bin/tsgo.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/tsserver b/frontend/node_modules/.bin/tsserver deleted file mode 120000 index f8f8f1a..0000000 --- a/frontend/node_modules/.bin/tsserver +++ /dev/null @@ -1 +0,0 @@ -../typescript/bin/tsserver \ No newline at end of file diff --git a/frontend/node_modules/.bin/vite b/frontend/node_modules/.bin/vite deleted file mode 120000 index 6d1e3be..0000000 --- a/frontend/node_modules/.bin/vite +++ /dev/null @@ -1 +0,0 @@ -../vite/bin/vite.js \ No newline at end of file diff --git a/frontend/node_modules/.package-lock.json b/frontend/node_modules/.package-lock.json deleted file mode 100644 index 8c2403d..0000000 --- a/frontend/node_modules/.package-lock.json +++ /dev/null @@ -1,871 +0,0 @@ -{ - "name": "frontend", - "version": "0.1.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@oxc-project/types": { - "version": "0.127.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.127.0.tgz", - "integrity": "sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/Boshen" - } - }, - "node_modules/@polka/url": { - "version": "1.0.0-next.29", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", - "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", - "dev": true, - "license": "MIT" - }, - "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.0.0-rc.17", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.17.tgz", - "integrity": "sha512-cLnjV3xfo7KslbU41Z7z8BH/E1y5mzUYzAqih1d1MDaIGZRCMqTijqLv76/P7fyHuvUcfGsIpqCdddbxLLK9rA==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.0-rc.17", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.17.tgz", - "integrity": "sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@standard-schema/spec": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", - "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@sveltejs/acorn-typescript": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.9.tgz", - "integrity": "sha512-lVJX6qEgs/4DOcRTpo56tmKzVPtoWAaVbL4hfO7t7NVwl9AAXzQR6cihesW1BmNMPl+bK6dreu2sOKBP2Q9CIA==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^8.9.0" - } - }, - "node_modules/@sveltejs/adapter-static": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.10.tgz", - "integrity": "sha512-7D9lYFWJmB7zxZyTE/qxjksvMqzMuYrrsyh1f4AlZqeZeACPRySjbC3aFiY55wb1tWUaKOQG9PVbm74JcN2Iew==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@sveltejs/kit": "^2.0.0" - } - }, - "node_modules/@sveltejs/kit": { - "version": "2.58.0", - "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.58.0.tgz", - "integrity": "sha512-kT9GCN8yJTkCK1W+Gi/bvGooWAM7y7WXP+yd+rf6QOIjyoK1ERPrMwSufXJUNu2pMWIqruhFvmz+LbOqsEmKmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@standard-schema/spec": "^1.0.0", - "@sveltejs/acorn-typescript": "^1.0.5", - "@types/cookie": "^0.6.0", - "acorn": "^8.14.1", - "cookie": "^0.6.0", - "devalue": "^5.6.4", - "esm-env": "^1.2.2", - "kleur": "^4.1.5", - "magic-string": "^0.30.5", - "mrmime": "^2.0.0", - "set-cookie-parser": "^3.0.0", - "sirv": "^3.0.0" - }, - "bin": { - "svelte-kit": "svelte-kit.js" - }, - "engines": { - "node": ">=18.13" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0", - "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0", - "svelte": "^4.0.0 || ^5.0.0-next.0", - "typescript": "^5.3.3 || ^6.0.0", - "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "@opentelemetry/api": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-7.0.0.tgz", - "integrity": "sha512-ILXmxC7HAsnkK2eslgPetrqqW1BKSL7LktsFgqzNj83MaivMGZzluWq32m25j2mDOjmSKX7GGWahePhuEs7P/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "deepmerge": "^4.3.1", - "magic-string": "^0.30.21", - "obug": "^2.1.0", - "vitefu": "^1.1.2" - }, - "engines": { - "node": "^20.19 || ^22.12 || >=24" - }, - "peerDependencies": { - "svelte": "^5.46.4", - "vite": "^8.0.0-beta.7 || ^8.0.0" - } - }, - "node_modules/@types/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/trusted-types": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", - "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@typescript/native-preview": { - "version": "7.0.0-dev.20260427.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview/-/native-preview-7.0.0-dev.20260427.1.tgz", - "integrity": "sha512-g6L7hed1Y2OGwAzZ+vXoGSvtJUdWUtTqtsn/16+UjYbu3+6pol0cggdWj26SFxI41R+jLfnT2+JGtoXRBdH+RQ==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsgo": "bin/tsgo.js" - }, - "engines": { - "node": ">=16.20.0" - }, - "optionalDependencies": { - "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260427.1", - "@typescript/native-preview-darwin-x64": "7.0.0-dev.20260427.1", - "@typescript/native-preview-linux-arm": "7.0.0-dev.20260427.1", - "@typescript/native-preview-linux-arm64": "7.0.0-dev.20260427.1", - "@typescript/native-preview-linux-x64": "7.0.0-dev.20260427.1", - "@typescript/native-preview-win32-arm64": "7.0.0-dev.20260427.1", - "@typescript/native-preview-win32-x64": "7.0.0-dev.20260427.1" - } - }, - "node_modules/@typescript/native-preview-linux-x64": { - "version": "7.0.0-dev.20260427.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-x64/-/native-preview-linux-x64-7.0.0-dev.20260427.1.tgz", - "integrity": "sha512-lqaA9oF9ZSw1jn87+Ncxo0Sf0d65eVXMjAD0z44ne7QKFRgWd+QpvK4AXAG4lxnFR+XdndWlVm6O1/tdvcG7xQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/acorn": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", - "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/aria-query": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz", - "integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/axobject-query": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", - "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, - "node_modules/devalue": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.7.1.tgz", - "integrity": "sha512-MUbZ586EgQqdRnC4yDrlod3BEdyvE4TapGYHMW2CiaW+KkkFmWEFqBUaLltEZCGi0iFXCEjRF0OjF0DV2QHjOA==", - "dev": true, - "license": "MIT" - }, - "node_modules/esm-env": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", - "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/esrap": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.2.5.tgz", - "integrity": "sha512-/yLB1538mag+dn0wsePTe8C0rDIjUOaJpMs2McodSzmM2msWcZsBSdRtg6HOBt0A/r82BN+Md3pgwSc/uWt2Ig==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "peerDependencies": { - "@typescript-eslint/types": "^8.2.0" - }, - "peerDependenciesMeta": { - "@typescript-eslint/types": { - "optional": true - } - } - }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/is-reference": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", - "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.6" - } - }, - "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/lightningcss": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", - "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "detect-libc": "^2.0.3" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "optionalDependencies": { - "lightningcss-android-arm64": "1.32.0", - "lightningcss-darwin-arm64": "1.32.0", - "lightningcss-darwin-x64": "1.32.0", - "lightningcss-freebsd-x64": "1.32.0", - "lightningcss-linux-arm-gnueabihf": "1.32.0", - "lightningcss-linux-arm64-gnu": "1.32.0", - "lightningcss-linux-arm64-musl": "1.32.0", - "lightningcss-linux-x64-gnu": "1.32.0", - "lightningcss-linux-x64-musl": "1.32.0", - "lightningcss-win32-arm64-msvc": "1.32.0", - "lightningcss-win32-x64-msvc": "1.32.0" - } - }, - "node_modules/lightningcss-linux-x64-gnu": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", - "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/locate-character": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", - "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", - "dev": true, - "license": "MIT" - }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/mrmime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", - "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/obug": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", - "integrity": "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==", - "dev": true, - "funding": [ - "https://github.com/sponsors/sxzz", - "https://opencollective.com/debug" - ], - "license": "MIT" - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postcss": { - "version": "8.5.12", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.12.tgz", - "integrity": "sha512-W62t/Se6rA0Az3DfCL0AqJwXuKwBeYg6nOaIgzP+xZ7N5BFCI7DYi1qs6ygUYT6rvfi6t9k65UMLJC+PHZpDAA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/rolldown": { - "version": "1.0.0-rc.17", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.17.tgz", - "integrity": "sha512-ZrT53oAKrtA4+YtBWPQbtPOxIbVDbxT0orcYERKd63VJTF13zPcgXTvD4843L8pcsI7M6MErt8QtON6lrB9tyA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@oxc-project/types": "=0.127.0", - "@rolldown/pluginutils": "1.0.0-rc.17" - }, - "bin": { - "rolldown": "bin/cli.mjs" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "optionalDependencies": { - "@rolldown/binding-android-arm64": "1.0.0-rc.17", - "@rolldown/binding-darwin-arm64": "1.0.0-rc.17", - "@rolldown/binding-darwin-x64": "1.0.0-rc.17", - "@rolldown/binding-freebsd-x64": "1.0.0-rc.17", - "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.17", - "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.17", - "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.17", - "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.17", - "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.17", - "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.17", - "@rolldown/binding-linux-x64-musl": "1.0.0-rc.17", - "@rolldown/binding-openharmony-arm64": "1.0.0-rc.17", - "@rolldown/binding-wasm32-wasi": "1.0.0-rc.17", - "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.17", - "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.17" - } - }, - "node_modules/sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - "dev": true, - "license": "MIT", - "dependencies": { - "mri": "^1.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/set-cookie-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.1.0.tgz", - "integrity": "sha512-kjnC1DXBHcxaOaOXBHBeRtltsDG2nUiUni+jP92M9gYdW12rsmx92UsfpH7o5tDRs7I1ZZPSQJQGv3UaRfCiuw==", - "dev": true, - "license": "MIT" - }, - "node_modules/sirv": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", - "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@polka/url": "^1.0.0-next.24", - "mrmime": "^2.0.0", - "totalist": "^3.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/svelte": { - "version": "5.55.5", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.55.5.tgz", - "integrity": "sha512-2uCs/LZ9us+AktdzYJM8OcxQ8qnPS1kpaO7syGT/MgO+6Qr1Ybl+TqPq+97u7PHqmmMlye5ZkoyXONy5mjjAbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/remapping": "^2.3.4", - "@jridgewell/sourcemap-codec": "^1.5.0", - "@sveltejs/acorn-typescript": "^1.0.5", - "@types/estree": "^1.0.5", - "@types/trusted-types": "^2.0.7", - "acorn": "^8.12.1", - "aria-query": "5.3.1", - "axobject-query": "^4.1.0", - "clsx": "^2.1.1", - "devalue": "^5.6.4", - "esm-env": "^1.2.1", - "esrap": "^2.2.4", - "is-reference": "^3.0.3", - "locate-character": "^3.0.0", - "magic-string": "^0.30.11", - "zimmerframe": "^1.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/svelte-check": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.4.6.tgz", - "integrity": "sha512-kP1zG81EWaFe9ZyTv4ZXv44Csi6Pkdpb7S3oj6m+K2ec/IcDg/a8LsFsnVLqm2nxtkSwsd5xPj/qFkTBgXHXjg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.25", - "chokidar": "^4.0.1", - "fdir": "^6.2.0", - "picocolors": "^1.0.0", - "sade": "^1.7.4" - }, - "bin": { - "svelte-check": "bin/svelte-check" - }, - "engines": { - "node": ">= 18.0.0" - }, - "peerDependencies": { - "svelte": "^4.0.0 || ^5.0.0-next.0", - "typescript": ">=5.0.0" - } - }, - "node_modules/tinyglobby": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", - "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.4" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/totalist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", - "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/typescript": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", - "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/vite": { - "version": "8.0.10", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.10.tgz", - "integrity": "sha512-rZuUu9j6J5uotLDs+cAA4O5H4K1SfPliUlQwqa6YEwSrWDZzP4rhm00oJR5snMewjxF5V/K3D4kctsUTsIU9Mw==", - "dev": true, - "license": "MIT", - "dependencies": { - "lightningcss": "^1.32.0", - "picomatch": "^4.0.4", - "postcss": "^8.5.10", - "rolldown": "1.0.0-rc.17", - "tinyglobby": "^0.2.16" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.1.0", - "esbuild": "^0.27.0 || ^0.28.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "@vitejs/devtools": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/vitefu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz", - "integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==", - "dev": true, - "license": "MIT", - "workspaces": [ - "tests/deps/*", - "tests/projects/*", - "tests/projects/workspace/packages/*" - ], - "peerDependencies": { - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "vite": { - "optional": true - } - } - }, - "node_modules/zimmerframe": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", - "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", - "dev": true, - "license": "MIT" - } - } -} diff --git a/frontend/node_modules/@jridgewell/gen-mapping/LICENSE b/frontend/node_modules/@jridgewell/gen-mapping/LICENSE deleted file mode 100644 index 1f6ce94..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2024 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/frontend/node_modules/@jridgewell/gen-mapping/README.md b/frontend/node_modules/@jridgewell/gen-mapping/README.md deleted file mode 100644 index 93692b1..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/README.md +++ /dev/null @@ -1,227 +0,0 @@ -# @jridgewell/gen-mapping - -> Generate source maps - -`gen-mapping` allows you to generate a source map during transpilation or minification. -With a source map, you're able to trace the original location in the source file, either in Chrome's -DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping]. - -You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This -provides the same `addMapping` and `setSourceContent` API. - -## Installation - -```sh -npm install @jridgewell/gen-mapping -``` - -## Usage - -```typescript -import { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping'; - -const map = new GenMapping({ - file: 'output.js', - sourceRoot: 'https://example.com/', -}); - -setSourceContent(map, 'input.js', `function foo() {}`); - -addMapping(map, { - // Lines start at line 1, columns at column 0. - generated: { line: 1, column: 0 }, - source: 'input.js', - original: { line: 1, column: 0 }, -}); - -addMapping(map, { - generated: { line: 1, column: 9 }, - source: 'input.js', - original: { line: 1, column: 9 }, - name: 'foo', -}); - -assert.deepEqual(toDecodedMap(map), { - version: 3, - file: 'output.js', - names: ['foo'], - sourceRoot: 'https://example.com/', - sources: ['input.js'], - sourcesContent: ['function foo() {}'], - mappings: [ - [ [0, 0, 0, 0], [9, 0, 0, 9, 0] ] - ], -}); - -assert.deepEqual(toEncodedMap(map), { - version: 3, - file: 'output.js', - names: ['foo'], - sourceRoot: 'https://example.com/', - sources: ['input.js'], - sourcesContent: ['function foo() {}'], - mappings: 'AAAA,SAASA', -}); -``` - -### Smaller Sourcemaps - -Not everything needs to be added to a sourcemap, and needless markings can cause signficantly -larger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will -intelligently determine if this marking adds useful information. If not, the marking will be -skipped. - -```typescript -import { maybeAddMapping } from '@jridgewell/gen-mapping'; - -const map = new GenMapping(); - -// Adding a sourceless marking at the beginning of a line isn't useful. -maybeAddMapping(map, { - generated: { line: 1, column: 0 }, -}); - -// Adding a new source marking is useful. -maybeAddMapping(map, { - generated: { line: 1, column: 0 }, - source: 'input.js', - original: { line: 1, column: 0 }, -}); - -// But adding another marking pointing to the exact same original location isn't, even if the -// generated column changed. -maybeAddMapping(map, { - generated: { line: 1, column: 9 }, - source: 'input.js', - original: { line: 1, column: 0 }, -}); - -assert.deepEqual(toEncodedMap(map), { - version: 3, - names: [], - sources: ['input.js'], - sourcesContent: [null], - mappings: 'AAAA', -}); -``` - -## Benchmarks - -``` -node v18.0.0 - -amp.js.map -Memory Usage: -gen-mapping: addSegment 5852872 bytes -gen-mapping: addMapping 7716042 bytes -source-map-js 6143250 bytes -source-map-0.6.1 6124102 bytes -source-map-0.8.0 6121173 bytes -Smallest memory usage is gen-mapping: addSegment - -Adding speed: -gen-mapping: addSegment x 441 ops/sec ±2.07% (90 runs sampled) -gen-mapping: addMapping x 350 ops/sec ±2.40% (86 runs sampled) -source-map-js: addMapping x 169 ops/sec ±2.42% (80 runs sampled) -source-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled) -source-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled) -Fastest is gen-mapping: addSegment - -Generate speed: -gen-mapping: decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled) -gen-mapping: encoded output x 663 ops/sec ±0.22% (98 runs sampled) -source-map-js: encoded output x 197 ops/sec ±0.45% (84 runs sampled) -source-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled) -source-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled) -Fastest is gen-mapping: decoded output - - -*** - - -babel.min.js.map -Memory Usage: -gen-mapping: addSegment 37578063 bytes -gen-mapping: addMapping 37212897 bytes -source-map-js 47638527 bytes -source-map-0.6.1 47690503 bytes -source-map-0.8.0 47470188 bytes -Smallest memory usage is gen-mapping: addMapping - -Adding speed: -gen-mapping: addSegment x 31.05 ops/sec ±8.31% (43 runs sampled) -gen-mapping: addMapping x 29.83 ops/sec ±7.36% (51 runs sampled) -source-map-js: addMapping x 20.73 ops/sec ±6.22% (38 runs sampled) -source-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled) -source-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled) -Fastest is gen-mapping: addSegment - -Generate speed: -gen-mapping: decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled) -gen-mapping: encoded output x 95.15 ops/sec ±2.98% (72 runs sampled) -source-map-js: encoded output x 15.20 ops/sec ±7.41% (33 runs sampled) -source-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled) -source-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled) -Fastest is gen-mapping: decoded output - - -*** - - -preact.js.map -Memory Usage: -gen-mapping: addSegment 416247 bytes -gen-mapping: addMapping 419824 bytes -source-map-js 1024619 bytes -source-map-0.6.1 1146004 bytes -source-map-0.8.0 1113250 bytes -Smallest memory usage is gen-mapping: addSegment - -Adding speed: -gen-mapping: addSegment x 13,755 ops/sec ±0.15% (98 runs sampled) -gen-mapping: addMapping x 13,013 ops/sec ±0.11% (101 runs sampled) -source-map-js: addMapping x 4,564 ops/sec ±0.21% (98 runs sampled) -source-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled) -source-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled) -Fastest is gen-mapping: addSegment - -Generate speed: -gen-mapping: decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled) -gen-mapping: encoded output x 14,368 ops/sec ±4.07% (82 runs sampled) -source-map-js: encoded output x 5,261 ops/sec ±0.21% (99 runs sampled) -source-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled) -source-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled) -Fastest is gen-mapping: decoded output - - -*** - - -react.js.map -Memory Usage: -gen-mapping: addSegment 975096 bytes -gen-mapping: addMapping 1102981 bytes -source-map-js 2918836 bytes -source-map-0.6.1 2885435 bytes -source-map-0.8.0 2874336 bytes -Smallest memory usage is gen-mapping: addSegment - -Adding speed: -gen-mapping: addSegment x 4,772 ops/sec ±0.15% (100 runs sampled) -gen-mapping: addMapping x 4,456 ops/sec ±0.13% (97 runs sampled) -source-map-js: addMapping x 1,618 ops/sec ±0.24% (97 runs sampled) -source-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled) -source-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled) -Fastest is gen-mapping: addSegment - -Generate speed: -gen-mapping: decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled) -gen-mapping: encoded output x 5,421 ops/sec ±1.60% (89 runs sampled) -source-map-js: encoded output x 2,113 ops/sec ±1.81% (98 runs sampled) -source-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled) -source-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled) -Fastest is gen-mapping: decoded output -``` - -[source-map]: https://www.npmjs.com/package/source-map -[trace-mapping]: https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping diff --git a/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs b/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs deleted file mode 100644 index bbb0cac..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs +++ /dev/null @@ -1,292 +0,0 @@ -// src/set-array.ts -var SetArray = class { - constructor() { - this._indexes = { __proto__: null }; - this.array = []; - } -}; -function cast(set) { - return set; -} -function get(setarr, key) { - return cast(setarr)._indexes[key]; -} -function put(setarr, key) { - const index = get(setarr, key); - if (index !== void 0) return index; - const { array, _indexes: indexes } = cast(setarr); - const length = array.push(key); - return indexes[key] = length - 1; -} -function remove(setarr, key) { - const index = get(setarr, key); - if (index === void 0) return; - const { array, _indexes: indexes } = cast(setarr); - for (let i = index + 1; i < array.length; i++) { - const k = array[i]; - array[i - 1] = k; - indexes[k]--; - } - indexes[key] = void 0; - array.pop(); -} - -// src/gen-mapping.ts -import { - encode -} from "@jridgewell/sourcemap-codec"; -import { TraceMap, decodedMappings } from "@jridgewell/trace-mapping"; - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; - -// src/gen-mapping.ts -var NO_NAME = -1; -var GenMapping = class { - constructor({ file, sourceRoot } = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - this.file = file; - this.sourceRoot = sourceRoot; - this._ignoreList = new SetArray(); - } -}; -function cast2(map) { - return map; -} -function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - return addSegmentInternal( - false, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -} -function addMapping(map, mapping) { - return addMappingInternal(false, map, mapping); -} -var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - return addSegmentInternal( - true, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -}; -var maybeAddMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping); -}; -function setSourceContent(map, source, content) { - const { - _sources: sources, - _sourcesContent: sourcesContent - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - sourcesContent[index] = content; -} -function setIgnore(map, source, ignore = true) { - const { - _sources: sources, - _sourcesContent: sourcesContent, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - if (index === sourcesContent.length) sourcesContent[index] = null; - if (ignore) put(ignoreList, index); - else remove(ignoreList, index); -} -function toDecodedMap(map) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - // _generatedRanges: generatedRanges, - } = cast2(map); - removeEmptyFinalLines(mappings); - return { - version: 3, - file: map.file || void 0, - names: names.array, - sourceRoot: map.sourceRoot || void 0, - sources: sources.array, - sourcesContent, - mappings, - // originalScopes, - // generatedRanges, - ignoreList: ignoreList.array - }; -} -function toEncodedMap(map) { - const decoded = toDecodedMap(map); - return Object.assign({}, decoded, { - // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), - // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), - mappings: encode(decoded.mappings) - }); -} -function fromMap(input) { - const map = new TraceMap(input); - const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); - putAll(cast2(gen)._names, map.names); - putAll(cast2(gen)._sources, map.sources); - cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); - cast2(gen)._mappings = decodedMappings(map); - if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); - return gen; -} -function allMappings(map) { - const out = []; - const { _mappings: mappings, _sources: sources, _names: names } = cast2(map); - for (let i = 0; i < mappings.length; i++) { - const line = mappings[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generated = { line: i + 1, column: seg[COLUMN] }; - let source = void 0; - let original = void 0; - let name = void 0; - if (seg.length !== 1) { - source = sources.array[seg[SOURCES_INDEX]]; - original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; - if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; - } - out.push({ generated, source, original, name }); - } - } - return out; -} -function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names - // _originalScopes: originalScopes, - } = cast2(map); - const line = getIndex(mappings, genLine); - const index = getColumnIndex(line, genColumn); - if (!source) { - if (skipable && skipSourceless(line, index)) return; - return insert(line, index, [genColumn]); - } - assert(sourceLine); - assert(sourceColumn); - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null; - if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { - return; - } - return insert( - line, - index, - name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn] - ); -} -function assert(_val) { -} -function getIndex(arr, index) { - for (let i = arr.length; i <= index; i++) { - arr[i] = []; - } - return arr[index]; -} -function getColumnIndex(line, genColumn) { - let index = line.length; - for (let i = index - 1; i >= 0; index = i--) { - const current = line[i]; - if (genColumn >= current[COLUMN]) break; - } - return index; -} -function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} -function removeEmptyFinalLines(mappings) { - const { length } = mappings; - let len = length; - for (let i = len - 1; i >= 0; len = i, i--) { - if (mappings[i].length > 0) break; - } - if (len < length) mappings.length = len; -} -function putAll(setarr, array) { - for (let i = 0; i < array.length; i++) put(setarr, array[i]); -} -function skipSourceless(line, index) { - if (index === 0) return true; - const prev = line[index - 1]; - return prev.length === 1; -} -function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { - if (index === 0) return false; - const prev = line[index - 1]; - if (prev.length === 1) return false; - return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); -} -function addMappingInternal(skipable, map, mapping) { - const { generated, source, original, name, content } = mapping; - if (!source) { - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - null, - null, - null, - null, - null - ); - } - assert(original); - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - source, - original.line - 1, - original.column, - name, - content - ); -} -export { - GenMapping, - addMapping, - addSegment, - allMappings, - fromMap, - maybeAddMapping, - maybeAddSegment, - setIgnore, - setSourceContent, - toDecodedMap, - toEncodedMap -}; -//# sourceMappingURL=gen-mapping.mjs.map diff --git a/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map b/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map deleted file mode 100644 index 4e37e45..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["../src/set-array.ts", "../src/gen-mapping.ts", "../src/sourcemap-segment.ts"], - "mappings": ";AAUO,IAAM,WAAN,MAAoC;AAAA,EAIzC,cAAc;AACZ,SAAK,WAAW,EAAE,WAAW,KAAK;AAClC,SAAK,QAAQ,CAAC;AAAA,EAChB;AACF;AAWA,SAAS,KAAoB,KAAgC;AAC3D,SAAO;AACT;AAKO,SAAS,IAAmB,QAAqB,KAA4B;AAClF,SAAO,KAAK,MAAM,EAAE,SAAS,GAAG;AAClC;AAMO,SAAS,IAAmB,QAAqB,KAAgB;AAEtE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW,QAAO;AAEhC,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAEhD,QAAM,SAAS,MAAM,KAAK,GAAG;AAC7B,SAAQ,QAAQ,GAAG,IAAI,SAAS;AAClC;AAgBO,SAAS,OAAsB,QAAqB,KAAc;AACvE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW;AAEzB,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAChD,WAAS,IAAI,QAAQ,GAAG,IAAI,MAAM,QAAQ,KAAK;AAC7C,UAAM,IAAI,MAAM,CAAC;AACjB,UAAM,IAAI,CAAC,IAAI;AACf,YAAQ,CAAC;AAAA,EACX;AACA,UAAQ,GAAG,IAAI;AACf,QAAM,IAAI;AACZ;;;AChFA;AAAA,EACE;AAAA,OAGK;AACP,SAAS,UAAU,uBAAuB;;;ACKnC,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;;;ADsB3B,IAAM,UAAU;AAKT,IAAM,aAAN,MAAiB;AAAA,EAWtB,YAAY,EAAE,MAAM,WAAW,IAAa,CAAC,GAAG;AAC9C,SAAK,SAAS,IAAI,SAAS;AAC3B,SAAK,WAAW,IAAI,SAAS;AAC7B,SAAK,kBAAkB,CAAC;AACxB,SAAK,YAAY,CAAC;AAGlB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,cAAc,IAAI,SAAS;AAAA,EAClC;AACF;AAgBA,SAASA,MAAK,KAAyB;AACrC,SAAO;AACT;AAoCO,SAAS,WACd,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAoCO,SAAS,WACd,KACA,SAOM;AACN,SAAO,mBAAmB,OAAO,KAAK,OAAmD;AAC3F;AAOO,IAAM,kBAAqC,CAChD,KACA,SACA,WACA,QACA,YACA,cACA,MACA,YACG;AACH,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOO,IAAM,kBAAqC,CAAC,KAAK,YAAY;AAClE,SAAO,mBAAmB,MAAM,KAAK,OAAmD;AAC1F;AAKO,SAAS,iBAAiB,KAAiB,QAAgB,SAA8B;AAC9F,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA;AAAA,EAEnB,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,iBAAe,KAAK,IAAI;AAE1B;AAEO,SAAS,UAAU,KAAiB,QAAgB,SAAS,MAAM;AACxE,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,aAAa;AAAA;AAAA,EAEf,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,MAAI,UAAU,eAAe,OAAQ,gBAAe,KAAK,IAAI;AAE7D,MAAI,OAAQ,KAAI,YAAY,KAAK;AAAA,MAC5B,QAAO,YAAY,KAAK;AAC/B;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,aAAa;AAAA;AAAA;AAAA,EAGf,IAAIA,MAAK,GAAG;AACZ,wBAAsB,QAAQ;AAE9B,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM,IAAI,QAAQ;AAAA,IAClB,OAAO,MAAM;AAAA,IACb,YAAY,IAAI,cAAc;AAAA,IAC9B,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA;AAAA;AAAA,IAGA,YAAY,WAAW;AAAA,EACzB;AACF;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM,UAAU,aAAa,GAAG;AAChC,SAAO,OAAO,OAAO,CAAC,GAAG,SAAS;AAAA;AAAA;AAAA,IAGhC,UAAU,OAAO,QAAQ,QAAgC;AAAA,EAC3D,CAAC;AACH;AAKO,SAAS,QAAQ,OAAmC;AACzD,QAAM,MAAM,IAAI,SAAS,KAAK;AAC9B,QAAM,MAAM,IAAI,WAAW,EAAE,MAAM,IAAI,MAAM,YAAY,IAAI,WAAW,CAAC;AAEzE,SAAOA,MAAK,GAAG,EAAE,QAAQ,IAAI,KAAK;AAClC,SAAOA,MAAK,GAAG,EAAE,UAAU,IAAI,OAAmB;AAClD,EAAAA,MAAK,GAAG,EAAE,kBAAkB,IAAI,kBAAkB,IAAI,QAAQ,IAAI,MAAM,IAAI;AAC5E,EAAAA,MAAK,GAAG,EAAE,YAAY,gBAAgB,GAAG;AAEzC,MAAI,IAAI,WAAY,QAAOA,MAAK,GAAG,EAAE,aAAa,IAAI,UAAU;AAEhE,SAAO;AACT;AAMO,SAAS,YAAY,KAA4B;AACtD,QAAM,MAAiB,CAAC;AACxB,QAAM,EAAE,WAAW,UAAU,UAAU,SAAS,QAAQ,MAAM,IAAIA,MAAK,GAAG;AAE1E,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,OAAO,SAAS,CAAC;AACvB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,YAAY,EAAE,MAAM,IAAI,GAAG,QAAQ,IAAI,MAAM,EAAE;AACrD,UAAI,SAA6B;AACjC,UAAI,WAA4B;AAChC,UAAI,OAA2B;AAE/B,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,QAAQ,MAAM,IAAI,aAAa,CAAC;AACzC,mBAAW,EAAE,MAAM,IAAI,WAAW,IAAI,GAAG,QAAQ,IAAI,aAAa,EAAE;AAEpE,YAAI,IAAI,WAAW,EAAG,QAAO,MAAM,MAAM,IAAI,WAAW,CAAC;AAAA,MAC3D;AAEA,UAAI,KAAK,EAAE,WAAW,QAAQ,UAAU,KAAK,CAAY;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO;AACT;AAGA,SAAS,mBACP,UACA,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA;AAAA,EAEV,IAAIA,MAAK,GAAG;AACZ,QAAM,OAAO,SAAS,UAAU,OAAO;AACvC,QAAM,QAAQ,eAAe,MAAM,SAAS;AAE5C,MAAI,CAAC,QAAQ;AACX,QAAI,YAAY,eAAe,MAAM,KAAK,EAAG;AAC7C,WAAO,OAAO,MAAM,OAAO,CAAC,SAAS,CAAC;AAAA,EACxC;AAIA,SAAe,UAAU;AACzB,SAAe,YAAY;AAE3B,QAAM,eAAe,IAAI,SAAS,MAAM;AACxC,QAAM,aAAa,OAAO,IAAI,OAAO,IAAI,IAAI;AAC7C,MAAI,iBAAiB,eAAe,OAAQ,gBAAe,YAAY,IAAI,4BAAW;AAGtF,MAAI,YAAY,WAAW,MAAM,OAAO,cAAc,YAAY,cAAc,UAAU,GAAG;AAC3F;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OACI,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU,IAC9D,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,EACxD;AACF;AAEA,SAAS,OAAU,MAAkC;AAErD;AAEA,SAAS,SAAY,KAAY,OAAoB;AACnD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,KAAK;AACxC,QAAI,CAAC,IAAI,CAAC;AAAA,EACZ;AACA,SAAO,IAAI,KAAK;AAClB;AAEA,SAAS,eAAe,MAA0B,WAA2B;AAC3E,MAAI,QAAQ,KAAK;AACjB,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,UAAM,UAAU,KAAK,CAAC;AACtB,QAAI,aAAa,QAAQ,MAAM,EAAG;AAAA,EACpC;AACA,SAAO;AACT;AAEA,SAAS,OAAU,OAAY,OAAe,OAAU;AACtD,WAAS,IAAI,MAAM,QAAQ,IAAI,OAAO,KAAK;AACzC,UAAM,CAAC,IAAI,MAAM,IAAI,CAAC;AAAA,EACxB;AACA,QAAM,KAAK,IAAI;AACjB;AAEA,SAAS,sBAAsB,UAAgC;AAC7D,QAAM,EAAE,OAAO,IAAI;AACnB,MAAI,MAAM;AACV,WAAS,IAAI,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK;AAC1C,QAAI,SAAS,CAAC,EAAE,SAAS,EAAG;AAAA,EAC9B;AACA,MAAI,MAAM,OAAQ,UAAS,SAAS;AACtC;AAEA,SAAS,OAAkC,QAAqB,OAAY;AAC1E,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,QAAQ,MAAM,CAAC,CAAC;AAC7D;AAEA,SAAS,eAAe,MAA0B,OAAwB;AAGxE,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAI3B,SAAO,KAAK,WAAW;AACzB;AAEA,SAAS,WACP,MACA,OACA,cACA,YACA,cACA,YACS;AAET,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAG3B,MAAI,KAAK,WAAW,EAAG,QAAO;AAI9B,SACE,iBAAiB,KAAK,aAAa,KACnC,eAAe,KAAK,WAAW,KAC/B,iBAAiB,KAAK,aAAa,KACnC,gBAAgB,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI;AAE5D;AAEA,SAAS,mBACP,UACA,KACA,SAOA;AACA,QAAM,EAAE,WAAW,QAAQ,UAAU,MAAM,QAAQ,IAAI;AACvD,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,OAAO;AAAA,MACjB,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAY,QAAQ;AACpB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;", - "names": ["cast"] -} diff --git a/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js b/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js deleted file mode 100644 index cb84af5..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js +++ /dev/null @@ -1,358 +0,0 @@ -(function (global, factory) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - factory(module, require('@jridgewell/sourcemap-codec'), require('@jridgewell/trace-mapping')); - module.exports = def(module); - } else if (typeof define === 'function' && define.amd) { - define(['module', '@jridgewell/sourcemap-codec', '@jridgewell/trace-mapping'], function(mod) { - factory.apply(this, arguments); - mod.exports = def(mod); - }); - } else { - const mod = { exports: {} }; - factory(mod, global.sourcemapCodec, global.traceMapping); - global = typeof globalThis !== 'undefined' ? globalThis : global || self; - global.genMapping = def(mod); - } - function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } -})(this, (function (module, require_sourcemapCodec, require_traceMapping) { -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// umd:@jridgewell/sourcemap-codec -var require_sourcemap_codec = __commonJS({ - "umd:@jridgewell/sourcemap-codec"(exports, module2) { - module2.exports = require_sourcemapCodec; - } -}); - -// umd:@jridgewell/trace-mapping -var require_trace_mapping = __commonJS({ - "umd:@jridgewell/trace-mapping"(exports, module2) { - module2.exports = require_traceMapping; - } -}); - -// src/gen-mapping.ts -var gen_mapping_exports = {}; -__export(gen_mapping_exports, { - GenMapping: () => GenMapping, - addMapping: () => addMapping, - addSegment: () => addSegment, - allMappings: () => allMappings, - fromMap: () => fromMap, - maybeAddMapping: () => maybeAddMapping, - maybeAddSegment: () => maybeAddSegment, - setIgnore: () => setIgnore, - setSourceContent: () => setSourceContent, - toDecodedMap: () => toDecodedMap, - toEncodedMap: () => toEncodedMap -}); -module.exports = __toCommonJS(gen_mapping_exports); - -// src/set-array.ts -var SetArray = class { - constructor() { - this._indexes = { __proto__: null }; - this.array = []; - } -}; -function cast(set) { - return set; -} -function get(setarr, key) { - return cast(setarr)._indexes[key]; -} -function put(setarr, key) { - const index = get(setarr, key); - if (index !== void 0) return index; - const { array, _indexes: indexes } = cast(setarr); - const length = array.push(key); - return indexes[key] = length - 1; -} -function remove(setarr, key) { - const index = get(setarr, key); - if (index === void 0) return; - const { array, _indexes: indexes } = cast(setarr); - for (let i = index + 1; i < array.length; i++) { - const k = array[i]; - array[i - 1] = k; - indexes[k]--; - } - indexes[key] = void 0; - array.pop(); -} - -// src/gen-mapping.ts -var import_sourcemap_codec = __toESM(require_sourcemap_codec()); -var import_trace_mapping = __toESM(require_trace_mapping()); - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; - -// src/gen-mapping.ts -var NO_NAME = -1; -var GenMapping = class { - constructor({ file, sourceRoot } = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - this.file = file; - this.sourceRoot = sourceRoot; - this._ignoreList = new SetArray(); - } -}; -function cast2(map) { - return map; -} -function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - return addSegmentInternal( - false, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -} -function addMapping(map, mapping) { - return addMappingInternal(false, map, mapping); -} -var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - return addSegmentInternal( - true, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -}; -var maybeAddMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping); -}; -function setSourceContent(map, source, content) { - const { - _sources: sources, - _sourcesContent: sourcesContent - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - sourcesContent[index] = content; -} -function setIgnore(map, source, ignore = true) { - const { - _sources: sources, - _sourcesContent: sourcesContent, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - if (index === sourcesContent.length) sourcesContent[index] = null; - if (ignore) put(ignoreList, index); - else remove(ignoreList, index); -} -function toDecodedMap(map) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - // _generatedRanges: generatedRanges, - } = cast2(map); - removeEmptyFinalLines(mappings); - return { - version: 3, - file: map.file || void 0, - names: names.array, - sourceRoot: map.sourceRoot || void 0, - sources: sources.array, - sourcesContent, - mappings, - // originalScopes, - // generatedRanges, - ignoreList: ignoreList.array - }; -} -function toEncodedMap(map) { - const decoded = toDecodedMap(map); - return Object.assign({}, decoded, { - // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), - // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), - mappings: (0, import_sourcemap_codec.encode)(decoded.mappings) - }); -} -function fromMap(input) { - const map = new import_trace_mapping.TraceMap(input); - const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); - putAll(cast2(gen)._names, map.names); - putAll(cast2(gen)._sources, map.sources); - cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); - cast2(gen)._mappings = (0, import_trace_mapping.decodedMappings)(map); - if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); - return gen; -} -function allMappings(map) { - const out = []; - const { _mappings: mappings, _sources: sources, _names: names } = cast2(map); - for (let i = 0; i < mappings.length; i++) { - const line = mappings[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generated = { line: i + 1, column: seg[COLUMN] }; - let source = void 0; - let original = void 0; - let name = void 0; - if (seg.length !== 1) { - source = sources.array[seg[SOURCES_INDEX]]; - original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; - if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; - } - out.push({ generated, source, original, name }); - } - } - return out; -} -function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names - // _originalScopes: originalScopes, - } = cast2(map); - const line = getIndex(mappings, genLine); - const index = getColumnIndex(line, genColumn); - if (!source) { - if (skipable && skipSourceless(line, index)) return; - return insert(line, index, [genColumn]); - } - assert(sourceLine); - assert(sourceColumn); - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null; - if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { - return; - } - return insert( - line, - index, - name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn] - ); -} -function assert(_val) { -} -function getIndex(arr, index) { - for (let i = arr.length; i <= index; i++) { - arr[i] = []; - } - return arr[index]; -} -function getColumnIndex(line, genColumn) { - let index = line.length; - for (let i = index - 1; i >= 0; index = i--) { - const current = line[i]; - if (genColumn >= current[COLUMN]) break; - } - return index; -} -function insert(array, index, value) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} -function removeEmptyFinalLines(mappings) { - const { length } = mappings; - let len = length; - for (let i = len - 1; i >= 0; len = i, i--) { - if (mappings[i].length > 0) break; - } - if (len < length) mappings.length = len; -} -function putAll(setarr, array) { - for (let i = 0; i < array.length; i++) put(setarr, array[i]); -} -function skipSourceless(line, index) { - if (index === 0) return true; - const prev = line[index - 1]; - return prev.length === 1; -} -function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { - if (index === 0) return false; - const prev = line[index - 1]; - if (prev.length === 1) return false; - return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); -} -function addMappingInternal(skipable, map, mapping) { - const { generated, source, original, name, content } = mapping; - if (!source) { - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - null, - null, - null, - null, - null - ); - } - assert(original); - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - source, - original.line - 1, - original.column, - name, - content - ); -} -})); -//# sourceMappingURL=gen-mapping.umd.js.map diff --git a/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map b/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map deleted file mode 100644 index b13750b..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["umd:@jridgewell/sourcemap-codec", "umd:@jridgewell/trace-mapping", "../src/gen-mapping.ts", "../src/set-array.ts", "../src/sourcemap-segment.ts"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,2CAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUO,IAAM,WAAN,MAAoC;AAAA,EAIzC,cAAc;AACZ,SAAK,WAAW,EAAE,WAAW,KAAK;AAClC,SAAK,QAAQ,CAAC;AAAA,EAChB;AACF;AAWA,SAAS,KAAoB,KAAgC;AAC3D,SAAO;AACT;AAKO,SAAS,IAAmB,QAAqB,KAA4B;AAClF,SAAO,KAAK,MAAM,EAAE,SAAS,GAAG;AAClC;AAMO,SAAS,IAAmB,QAAqB,KAAgB;AAEtE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW,QAAO;AAEhC,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAEhD,QAAM,SAAS,MAAM,KAAK,GAAG;AAC7B,SAAQ,QAAQ,GAAG,IAAI,SAAS;AAClC;AAgBO,SAAS,OAAsB,QAAqB,KAAc;AACvE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW;AAEzB,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAChD,WAAS,IAAI,QAAQ,GAAG,IAAI,MAAM,QAAQ,KAAK;AAC7C,UAAM,IAAI,MAAM,CAAC;AACjB,UAAM,IAAI,CAAC,IAAI;AACf,YAAQ,CAAC;AAAA,EACX;AACA,UAAQ,GAAG,IAAI;AACf,QAAM,IAAI;AACZ;;;ADhFA,6BAIO;AACP,2BAA0C;;;AEKnC,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;;;AFsB3B,IAAM,UAAU;AAKT,IAAM,aAAN,MAAiB;AAAA,EAWtB,YAAY,EAAE,MAAM,WAAW,IAAa,CAAC,GAAG;AAC9C,SAAK,SAAS,IAAI,SAAS;AAC3B,SAAK,WAAW,IAAI,SAAS;AAC7B,SAAK,kBAAkB,CAAC;AACxB,SAAK,YAAY,CAAC;AAGlB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,cAAc,IAAI,SAAS;AAAA,EAClC;AACF;AAgBA,SAASC,MAAK,KAAyB;AACrC,SAAO;AACT;AAoCO,SAAS,WACd,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAoCO,SAAS,WACd,KACA,SAOM;AACN,SAAO,mBAAmB,OAAO,KAAK,OAAmD;AAC3F;AAOO,IAAM,kBAAqC,CAChD,KACA,SACA,WACA,QACA,YACA,cACA,MACA,YACG;AACH,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOO,IAAM,kBAAqC,CAAC,KAAK,YAAY;AAClE,SAAO,mBAAmB,MAAM,KAAK,OAAmD;AAC1F;AAKO,SAAS,iBAAiB,KAAiB,QAAgB,SAA8B;AAC9F,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA;AAAA,EAEnB,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,iBAAe,KAAK,IAAI;AAE1B;AAEO,SAAS,UAAU,KAAiB,QAAgB,SAAS,MAAM;AACxE,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,aAAa;AAAA;AAAA,EAEf,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,MAAI,UAAU,eAAe,OAAQ,gBAAe,KAAK,IAAI;AAE7D,MAAI,OAAQ,KAAI,YAAY,KAAK;AAAA,MAC5B,QAAO,YAAY,KAAK;AAC/B;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,aAAa;AAAA;AAAA;AAAA,EAGf,IAAIA,MAAK,GAAG;AACZ,wBAAsB,QAAQ;AAE9B,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM,IAAI,QAAQ;AAAA,IAClB,OAAO,MAAM;AAAA,IACb,YAAY,IAAI,cAAc;AAAA,IAC9B,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA;AAAA;AAAA,IAGA,YAAY,WAAW;AAAA,EACzB;AACF;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM,UAAU,aAAa,GAAG;AAChC,SAAO,OAAO,OAAO,CAAC,GAAG,SAAS;AAAA;AAAA;AAAA,IAGhC,cAAU,+BAAO,QAAQ,QAAgC;AAAA,EAC3D,CAAC;AACH;AAKO,SAAS,QAAQ,OAAmC;AACzD,QAAM,MAAM,IAAI,8BAAS,KAAK;AAC9B,QAAM,MAAM,IAAI,WAAW,EAAE,MAAM,IAAI,MAAM,YAAY,IAAI,WAAW,CAAC;AAEzE,SAAOA,MAAK,GAAG,EAAE,QAAQ,IAAI,KAAK;AAClC,SAAOA,MAAK,GAAG,EAAE,UAAU,IAAI,OAAmB;AAClD,EAAAA,MAAK,GAAG,EAAE,kBAAkB,IAAI,kBAAkB,IAAI,QAAQ,IAAI,MAAM,IAAI;AAC5E,EAAAA,MAAK,GAAG,EAAE,gBAAY,sCAAgB,GAAG;AAEzC,MAAI,IAAI,WAAY,QAAOA,MAAK,GAAG,EAAE,aAAa,IAAI,UAAU;AAEhE,SAAO;AACT;AAMO,SAAS,YAAY,KAA4B;AACtD,QAAM,MAAiB,CAAC;AACxB,QAAM,EAAE,WAAW,UAAU,UAAU,SAAS,QAAQ,MAAM,IAAIA,MAAK,GAAG;AAE1E,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,OAAO,SAAS,CAAC;AACvB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,YAAY,EAAE,MAAM,IAAI,GAAG,QAAQ,IAAI,MAAM,EAAE;AACrD,UAAI,SAA6B;AACjC,UAAI,WAA4B;AAChC,UAAI,OAA2B;AAE/B,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,QAAQ,MAAM,IAAI,aAAa,CAAC;AACzC,mBAAW,EAAE,MAAM,IAAI,WAAW,IAAI,GAAG,QAAQ,IAAI,aAAa,EAAE;AAEpE,YAAI,IAAI,WAAW,EAAG,QAAO,MAAM,MAAM,IAAI,WAAW,CAAC;AAAA,MAC3D;AAEA,UAAI,KAAK,EAAE,WAAW,QAAQ,UAAU,KAAK,CAAY;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO;AACT;AAGA,SAAS,mBACP,UACA,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA;AAAA,EAEV,IAAIA,MAAK,GAAG;AACZ,QAAM,OAAO,SAAS,UAAU,OAAO;AACvC,QAAM,QAAQ,eAAe,MAAM,SAAS;AAE5C,MAAI,CAAC,QAAQ;AACX,QAAI,YAAY,eAAe,MAAM,KAAK,EAAG;AAC7C,WAAO,OAAO,MAAM,OAAO,CAAC,SAAS,CAAC;AAAA,EACxC;AAIA,SAAe,UAAU;AACzB,SAAe,YAAY;AAE3B,QAAM,eAAe,IAAI,SAAS,MAAM;AACxC,QAAM,aAAa,OAAO,IAAI,OAAO,IAAI,IAAI;AAC7C,MAAI,iBAAiB,eAAe,OAAQ,gBAAe,YAAY,IAAI,4BAAW;AAGtF,MAAI,YAAY,WAAW,MAAM,OAAO,cAAc,YAAY,cAAc,UAAU,GAAG;AAC3F;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OACI,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU,IAC9D,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,EACxD;AACF;AAEA,SAAS,OAAU,MAAkC;AAErD;AAEA,SAAS,SAAY,KAAY,OAAoB;AACnD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,KAAK;AACxC,QAAI,CAAC,IAAI,CAAC;AAAA,EACZ;AACA,SAAO,IAAI,KAAK;AAClB;AAEA,SAAS,eAAe,MAA0B,WAA2B;AAC3E,MAAI,QAAQ,KAAK;AACjB,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,UAAM,UAAU,KAAK,CAAC;AACtB,QAAI,aAAa,QAAQ,MAAM,EAAG;AAAA,EACpC;AACA,SAAO;AACT;AAEA,SAAS,OAAU,OAAY,OAAe,OAAU;AACtD,WAAS,IAAI,MAAM,QAAQ,IAAI,OAAO,KAAK;AACzC,UAAM,CAAC,IAAI,MAAM,IAAI,CAAC;AAAA,EACxB;AACA,QAAM,KAAK,IAAI;AACjB;AAEA,SAAS,sBAAsB,UAAgC;AAC7D,QAAM,EAAE,OAAO,IAAI;AACnB,MAAI,MAAM;AACV,WAAS,IAAI,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK;AAC1C,QAAI,SAAS,CAAC,EAAE,SAAS,EAAG;AAAA,EAC9B;AACA,MAAI,MAAM,OAAQ,UAAS,SAAS;AACtC;AAEA,SAAS,OAAkC,QAAqB,OAAY;AAC1E,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,QAAQ,MAAM,CAAC,CAAC;AAC7D;AAEA,SAAS,eAAe,MAA0B,OAAwB;AAGxE,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAI3B,SAAO,KAAK,WAAW;AACzB;AAEA,SAAS,WACP,MACA,OACA,cACA,YACA,cACA,YACS;AAET,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAG3B,MAAI,KAAK,WAAW,EAAG,QAAO;AAI9B,SACE,iBAAiB,KAAK,aAAa,KACnC,eAAe,KAAK,WAAW,KAC/B,iBAAiB,KAAK,aAAa,KACnC,gBAAgB,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI;AAE5D;AAEA,SAAS,mBACP,UACA,KACA,SAOA;AACA,QAAM,EAAE,WAAW,QAAQ,UAAU,MAAM,QAAQ,IAAI;AACvD,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,OAAO;AAAA,MACjB,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAY,QAAQ;AACpB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;", - "names": ["module", "module", "cast"] -} diff --git a/frontend/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts b/frontend/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts deleted file mode 100644 index 9ba936e..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types'; -export type { DecodedSourceMap, EncodedSourceMap, Mapping }; -export type Options = { - file?: string | null; - sourceRoot?: string | null; -}; -/** - * Provides the state to generate a sourcemap. - */ -export declare class GenMapping { - private _names; - private _sources; - private _sourcesContent; - private _mappings; - private _ignoreList; - file: string | null | undefined; - sourceRoot: string | null | undefined; - constructor({ file, sourceRoot }?: Options); -} -/** - * A low-level API to associate a generated position with an original source position. Line and - * column here are 0-based, unlike `addMapping`. - */ -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; -/** - * A high-level API to associate a generated position with an original source position. Line is - * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. - */ -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source?: null; - original?: null; - name?: null; - content?: null; -}): void; -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name?: null; - content?: string | null; -}): void; -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name: string; - content?: string | null; -}): void; -/** - * Same as `addSegment`, but will only add the segment if it generates useful information in the - * resulting map. This only works correctly if segments are added **in order**, meaning you should - * not add a segment with a lower generated line/column than one that came before. - */ -export declare const maybeAddSegment: typeof addSegment; -/** - * Same as `addMapping`, but will only add the mapping if it generates useful information in the - * resulting map. This only works correctly if mappings are added **in order**, meaning you should - * not add a mapping with a lower generated line/column than one that came before. - */ -export declare const maybeAddMapping: typeof addMapping; -/** - * Adds/removes the content of the source file to the source map. - */ -export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; -export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function toDecodedMap(map: GenMapping): DecodedSourceMap; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function toEncodedMap(map: GenMapping): EncodedSourceMap; -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -export declare function fromMap(input: SourceMapInput): GenMapping; -/** - * Returns an array of high-level mapping objects for every recorded segment, which could then be - * passed to the `source-map` library. - */ -export declare function allMappings(map: GenMapping): Mapping[]; diff --git a/frontend/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts b/frontend/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts deleted file mode 100644 index 6ed4354..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -type Key = string | number | symbol; -/** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ -export declare class SetArray { - private _indexes; - array: readonly T[]; - constructor(); -} -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export declare function get(setarr: SetArray, key: T): number | undefined; -/** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ -export declare function put(setarr: SetArray, key: T): number; -/** - * Pops the last added item out of the SetArray. - */ -export declare function pop(setarr: SetArray): void; -/** - * Removes the key, if it exists in the set. - */ -export declare function remove(setarr: SetArray, key: T): void; -export {}; diff --git a/frontend/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts b/frontend/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts deleted file mode 100644 index aa19fb5..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; -export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; -export declare const COLUMN = 0; -export declare const SOURCES_INDEX = 1; -export declare const SOURCE_LINE = 2; -export declare const SOURCE_COLUMN = 3; -export declare const NAMES_INDEX = 4; -export {}; diff --git a/frontend/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts b/frontend/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts deleted file mode 100644 index 8eb90fb..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment'; -export interface SourceMapV3 { - file?: string | null; - names: readonly string[]; - sourceRoot?: string; - sources: readonly (string | null)[]; - sourcesContent?: readonly (string | null)[]; - version: 3; - ignoreList?: readonly number[]; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: readonly SourceMapSegment[][]; -} -export interface Pos { - line: number; - column: number; -} -export interface OriginalPos extends Pos { - source: string; -} -export interface BindingExpressionRange { - start: Pos; - expression: string; -} -export type Mapping = { - generated: Pos; - source: undefined; - original: undefined; - name: undefined; -} | { - generated: Pos; - source: string; - original: Pos; - name: string; -} | { - generated: Pos; - source: string; - original: Pos; - name: undefined; -}; diff --git a/frontend/node_modules/@jridgewell/gen-mapping/package.json b/frontend/node_modules/@jridgewell/gen-mapping/package.json deleted file mode 100644 index 036f9b7..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@jridgewell/gen-mapping", - "version": "0.3.13", - "description": "Generate source maps", - "keywords": [ - "source", - "map" - ], - "main": "dist/gen-mapping.umd.js", - "module": "dist/gen-mapping.mjs", - "types": "types/gen-mapping.d.cts", - "files": [ - "dist", - "src", - "types" - ], - "exports": { - ".": [ - { - "import": { - "types": "./types/gen-mapping.d.mts", - "default": "./dist/gen-mapping.mjs" - }, - "default": { - "types": "./types/gen-mapping.d.cts", - "default": "./dist/gen-mapping.umd.js" - } - }, - "./dist/gen-mapping.umd.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "benchmark": "run-s build:code benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node --expose-gc benchmark/index.js", - "build": "run-s -n build:code build:types", - "build:code": "node ../../esbuild.mjs gen-mapping.ts", - "build:types": "run-s build:types:force build:types:emit build:types:mts", - "build:types:force": "rimraf tsconfig.build.tsbuildinfo", - "build:types:emit": "tsc --project tsconfig.build.json", - "build:types:mts": "node ../../mts-types.mjs", - "clean": "run-s -n clean:code clean:types", - "clean:code": "tsc --build --clean tsconfig.build.json", - "clean:types": "rimraf dist types", - "test": "run-s -n test:types test:only test:format", - "test:format": "prettier --check '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:types": "eslint '{src,test}/**/*.ts'", - "lint": "run-s -n lint:types lint:format", - "lint:format": "npm run test:format -- --write", - "lint:types": "npm run test:types -- --fix", - "prepublishOnly": "npm run-s -n build test" - }, - "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/gen-mapping", - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/sourcemaps.git", - "directory": "packages/gen-mapping" - }, - "author": "Justin Ridgewell ", - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } -} diff --git a/frontend/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts b/frontend/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts deleted file mode 100644 index ecc878c..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts +++ /dev/null @@ -1,614 +0,0 @@ -import { SetArray, put, remove } from './set-array'; -import { - encode, - // encodeGeneratedRanges, - // encodeOriginalScopes -} from '@jridgewell/sourcemap-codec'; -import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping'; - -import { - COLUMN, - SOURCES_INDEX, - SOURCE_LINE, - SOURCE_COLUMN, - NAMES_INDEX, -} from './sourcemap-segment'; - -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -// import type { OriginalScope, GeneratedRange } from '@jridgewell/sourcemap-codec'; -import type { SourceMapSegment } from './sourcemap-segment'; -import type { - DecodedSourceMap, - EncodedSourceMap, - Pos, - Mapping, - // BindingExpressionRange, - // OriginalPos, - // OriginalScopeInfo, - // GeneratedRangeInfo, -} from './types'; - -export type { DecodedSourceMap, EncodedSourceMap, Mapping }; - -export type Options = { - file?: string | null; - sourceRoot?: string | null; -}; - -const NO_NAME = -1; - -/** - * Provides the state to generate a sourcemap. - */ -export class GenMapping { - declare private _names: SetArray; - declare private _sources: SetArray; - declare private _sourcesContent: (string | null)[]; - declare private _mappings: SourceMapSegment[][]; - // private declare _originalScopes: OriginalScope[][]; - // private declare _generatedRanges: GeneratedRange[]; - declare private _ignoreList: SetArray; - declare file: string | null | undefined; - declare sourceRoot: string | null | undefined; - - constructor({ file, sourceRoot }: Options = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - // this._originalScopes = []; - // this._generatedRanges = []; - this.file = file; - this.sourceRoot = sourceRoot; - this._ignoreList = new SetArray(); - } -} - -interface PublicMap { - _names: GenMapping['_names']; - _sources: GenMapping['_sources']; - _sourcesContent: GenMapping['_sourcesContent']; - _mappings: GenMapping['_mappings']; - // _originalScopes: GenMapping['_originalScopes']; - // _generatedRanges: GenMapping['_generatedRanges']; - _ignoreList: GenMapping['_ignoreList']; -} - -/** - * Typescript doesn't allow friend access to private fields, so this just casts the map into a type - * with public access modifiers. - */ -function cast(map: unknown): PublicMap { - return map as any; -} - -/** - * A low-level API to associate a generated position with an original source position. Line and - * column here are 0-based, unlike `addMapping`. - */ -export function addSegment( - map: GenMapping, - genLine: number, - genColumn: number, - source?: null, - sourceLine?: null, - sourceColumn?: null, - name?: null, - content?: null, -): void; -export function addSegment( - map: GenMapping, - genLine: number, - genColumn: number, - source: string, - sourceLine: number, - sourceColumn: number, - name?: null, - content?: string | null, -): void; -export function addSegment( - map: GenMapping, - genLine: number, - genColumn: number, - source: string, - sourceLine: number, - sourceColumn: number, - name: string, - content?: string | null, -): void; -export function addSegment( - map: GenMapping, - genLine: number, - genColumn: number, - source?: string | null, - sourceLine?: number | null, - sourceColumn?: number | null, - name?: string | null, - content?: string | null, -): void { - return addSegmentInternal( - false, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content, - ); -} - -/** - * A high-level API to associate a generated position with an original source position. Line is - * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. - */ -export function addMapping( - map: GenMapping, - mapping: { - generated: Pos; - source?: null; - original?: null; - name?: null; - content?: null; - }, -): void; -export function addMapping( - map: GenMapping, - mapping: { - generated: Pos; - source: string; - original: Pos; - name?: null; - content?: string | null; - }, -): void; -export function addMapping( - map: GenMapping, - mapping: { - generated: Pos; - source: string; - original: Pos; - name: string; - content?: string | null; - }, -): void; -export function addMapping( - map: GenMapping, - mapping: { - generated: Pos; - source?: string | null; - original?: Pos | null; - name?: string | null; - content?: string | null; - }, -): void { - return addMappingInternal(false, map, mapping as Parameters[2]); -} - -/** - * Same as `addSegment`, but will only add the segment if it generates useful information in the - * resulting map. This only works correctly if segments are added **in order**, meaning you should - * not add a segment with a lower generated line/column than one that came before. - */ -export const maybeAddSegment: typeof addSegment = ( - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content, -) => { - return addSegmentInternal( - true, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content, - ); -}; - -/** - * Same as `addMapping`, but will only add the mapping if it generates useful information in the - * resulting map. This only works correctly if mappings are added **in order**, meaning you should - * not add a mapping with a lower generated line/column than one that came before. - */ -export const maybeAddMapping: typeof addMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping as Parameters[2]); -}; - -/** - * Adds/removes the content of the source file to the source map. - */ -export function setSourceContent(map: GenMapping, source: string, content: string | null): void { - const { - _sources: sources, - _sourcesContent: sourcesContent, - // _originalScopes: originalScopes, - } = cast(map); - const index = put(sources, source); - sourcesContent[index] = content; - // if (index === originalScopes.length) originalScopes[index] = []; -} - -export function setIgnore(map: GenMapping, source: string, ignore = true) { - const { - _sources: sources, - _sourcesContent: sourcesContent, - _ignoreList: ignoreList, - // _originalScopes: originalScopes, - } = cast(map); - const index = put(sources, source); - if (index === sourcesContent.length) sourcesContent[index] = null; - // if (index === originalScopes.length) originalScopes[index] = []; - if (ignore) put(ignoreList, index); - else remove(ignoreList, index); -} - -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export function toDecodedMap(map: GenMapping): DecodedSourceMap { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names, - _ignoreList: ignoreList, - // _originalScopes: originalScopes, - // _generatedRanges: generatedRanges, - } = cast(map); - removeEmptyFinalLines(mappings); - - return { - version: 3, - file: map.file || undefined, - names: names.array, - sourceRoot: map.sourceRoot || undefined, - sources: sources.array, - sourcesContent, - mappings, - // originalScopes, - // generatedRanges, - ignoreList: ignoreList.array, - }; -} - -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export function toEncodedMap(map: GenMapping): EncodedSourceMap { - const decoded = toDecodedMap(map); - return Object.assign({}, decoded, { - // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), - // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), - mappings: encode(decoded.mappings as SourceMapSegment[][]), - }); -} - -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -export function fromMap(input: SourceMapInput): GenMapping { - const map = new TraceMap(input); - const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); - - putAll(cast(gen)._names, map.names); - putAll(cast(gen)._sources, map.sources as string[]); - cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); - cast(gen)._mappings = decodedMappings(map) as GenMapping['_mappings']; - // TODO: implement originalScopes/generatedRanges - if (map.ignoreList) putAll(cast(gen)._ignoreList, map.ignoreList); - - return gen; -} - -/** - * Returns an array of high-level mapping objects for every recorded segment, which could then be - * passed to the `source-map` library. - */ -export function allMappings(map: GenMapping): Mapping[] { - const out: Mapping[] = []; - const { _mappings: mappings, _sources: sources, _names: names } = cast(map); - - for (let i = 0; i < mappings.length; i++) { - const line = mappings[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - - const generated = { line: i + 1, column: seg[COLUMN] }; - let source: string | undefined = undefined; - let original: Pos | undefined = undefined; - let name: string | undefined = undefined; - - if (seg.length !== 1) { - source = sources.array[seg[SOURCES_INDEX]]; - original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; - - if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; - } - - out.push({ generated, source, original, name } as Mapping); - } - } - - return out; -} - -// This split declaration is only so that terser can elminiate the static initialization block. -function addSegmentInternal( - skipable: boolean, - map: GenMapping, - genLine: number, - genColumn: number, - source: S, - sourceLine: S extends string ? number : null | undefined, - sourceColumn: S extends string ? number : null | undefined, - name: S extends string ? string | null | undefined : null | undefined, - content: S extends string ? string | null | undefined : null | undefined, -): void { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names, - // _originalScopes: originalScopes, - } = cast(map); - const line = getIndex(mappings, genLine); - const index = getColumnIndex(line, genColumn); - - if (!source) { - if (skipable && skipSourceless(line, index)) return; - return insert(line, index, [genColumn]); - } - - // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source - // isn't nullish. - assert(sourceLine); - assert(sourceColumn); - - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null; - // if (sourcesIndex === originalScopes.length) originalScopes[sourcesIndex] = []; - - if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { - return; - } - - return insert( - line, - index, - name - ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] - : [genColumn, sourcesIndex, sourceLine, sourceColumn], - ); -} - -function assert(_val: unknown): asserts _val is T { - // noop. -} - -function getIndex(arr: T[][], index: number): T[] { - for (let i = arr.length; i <= index; i++) { - arr[i] = []; - } - return arr[index]; -} - -function getColumnIndex(line: SourceMapSegment[], genColumn: number): number { - let index = line.length; - for (let i = index - 1; i >= 0; index = i--) { - const current = line[i]; - if (genColumn >= current[COLUMN]) break; - } - return index; -} - -function insert(array: T[], index: number, value: T) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} - -function removeEmptyFinalLines(mappings: SourceMapSegment[][]) { - const { length } = mappings; - let len = length; - for (let i = len - 1; i >= 0; len = i, i--) { - if (mappings[i].length > 0) break; - } - if (len < length) mappings.length = len; -} - -function putAll(setarr: SetArray, array: T[]) { - for (let i = 0; i < array.length; i++) put(setarr, array[i]); -} - -function skipSourceless(line: SourceMapSegment[], index: number): boolean { - // The start of a line is already sourceless, so adding a sourceless segment to the beginning - // doesn't generate any useful information. - if (index === 0) return true; - - const prev = line[index - 1]; - // If the previous segment is also sourceless, then adding another sourceless segment doesn't - // genrate any new information. Else, this segment will end the source/named segment and point to - // a sourceless position, which is useful. - return prev.length === 1; -} - -function skipSource( - line: SourceMapSegment[], - index: number, - sourcesIndex: number, - sourceLine: number, - sourceColumn: number, - namesIndex: number, -): boolean { - // A source/named segment at the start of a line gives position at that genColumn - if (index === 0) return false; - - const prev = line[index - 1]; - - // If the previous segment is sourceless, then we're transitioning to a source. - if (prev.length === 1) return false; - - // If the previous segment maps to the exact same source position, then this segment doesn't - // provide any new position information. - return ( - sourcesIndex === prev[SOURCES_INDEX] && - sourceLine === prev[SOURCE_LINE] && - sourceColumn === prev[SOURCE_COLUMN] && - namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME) - ); -} - -function addMappingInternal( - skipable: boolean, - map: GenMapping, - mapping: { - generated: Pos; - source: S; - original: S extends string ? Pos : null | undefined; - name: S extends string ? string | null | undefined : null | undefined; - content: S extends string ? string | null | undefined : null | undefined; - }, -) { - const { generated, source, original, name, content } = mapping; - if (!source) { - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - null, - null, - null, - null, - null, - ); - } - assert(original); - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - source as string, - original.line - 1, - original.column, - name, - content, - ); -} - -/* -export function addOriginalScope( - map: GenMapping, - data: { - start: Pos; - end: Pos; - source: string; - kind: string; - name?: string; - variables?: string[]; - }, -): OriginalScopeInfo { - const { start, end, source, kind, name, variables } = data; - const { - _sources: sources, - _sourcesContent: sourcesContent, - _originalScopes: originalScopes, - _names: names, - } = cast(map); - const index = put(sources, source); - if (index === sourcesContent.length) sourcesContent[index] = null; - if (index === originalScopes.length) originalScopes[index] = []; - - const kindIndex = put(names, kind); - const scope: OriginalScope = name - ? [start.line - 1, start.column, end.line - 1, end.column, kindIndex, put(names, name)] - : [start.line - 1, start.column, end.line - 1, end.column, kindIndex]; - if (variables) { - scope.vars = variables.map((v) => put(names, v)); - } - const len = originalScopes[index].push(scope); - return [index, len - 1, variables]; -} -*/ - -// Generated Ranges -/* -export function addGeneratedRange( - map: GenMapping, - data: { - start: Pos; - isScope: boolean; - originalScope?: OriginalScopeInfo; - callsite?: OriginalPos; - }, -): GeneratedRangeInfo { - const { start, isScope, originalScope, callsite } = data; - const { - _originalScopes: originalScopes, - _sources: sources, - _sourcesContent: sourcesContent, - _generatedRanges: generatedRanges, - } = cast(map); - - const range: GeneratedRange = [ - start.line - 1, - start.column, - 0, - 0, - originalScope ? originalScope[0] : -1, - originalScope ? originalScope[1] : -1, - ]; - if (originalScope?.[2]) { - range.bindings = originalScope[2].map(() => [[-1]]); - } - if (callsite) { - const index = put(sources, callsite.source); - if (index === sourcesContent.length) sourcesContent[index] = null; - if (index === originalScopes.length) originalScopes[index] = []; - range.callsite = [index, callsite.line - 1, callsite.column]; - } - if (isScope) range.isScope = true; - generatedRanges.push(range); - - return [range, originalScope?.[2]]; -} - -export function setEndPosition(range: GeneratedRangeInfo, pos: Pos) { - range[0][2] = pos.line - 1; - range[0][3] = pos.column; -} - -export function addBinding( - map: GenMapping, - range: GeneratedRangeInfo, - variable: string, - expression: string | BindingExpressionRange, -) { - const { _names: names } = cast(map); - const bindings = (range[0].bindings ||= []); - const vars = range[1]; - - const index = vars!.indexOf(variable); - const binding = getIndex(bindings, index); - - if (typeof expression === 'string') binding[0] = [put(names, expression)]; - else { - const { start } = expression; - binding.push([put(names, expression.expression), start.line - 1, start.column]); - } -} -*/ diff --git a/frontend/node_modules/@jridgewell/gen-mapping/src/set-array.ts b/frontend/node_modules/@jridgewell/gen-mapping/src/set-array.ts deleted file mode 100644 index a2a73a5..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/src/set-array.ts +++ /dev/null @@ -1,82 +0,0 @@ -type Key = string | number | symbol; - -/** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ -export class SetArray { - declare private _indexes: Record; - declare array: readonly T[]; - - constructor() { - this._indexes = { __proto__: null } as any; - this.array = []; - } -} - -interface PublicSet { - array: T[]; - _indexes: SetArray['_indexes']; -} - -/** - * Typescript doesn't allow friend access to private fields, so this just casts the set into a type - * with public access modifiers. - */ -function cast(set: SetArray): PublicSet { - return set as any; -} - -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export function get(setarr: SetArray, key: T): number | undefined { - return cast(setarr)._indexes[key]; -} - -/** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ -export function put(setarr: SetArray, key: T): number { - // The key may or may not be present. If it is present, it's a number. - const index = get(setarr, key); - if (index !== undefined) return index; - - const { array, _indexes: indexes } = cast(setarr); - - const length = array.push(key); - return (indexes[key] = length - 1); -} - -/** - * Pops the last added item out of the SetArray. - */ -export function pop(setarr: SetArray): void { - const { array, _indexes: indexes } = cast(setarr); - if (array.length === 0) return; - - const last = array.pop()!; - indexes[last] = undefined; -} - -/** - * Removes the key, if it exists in the set. - */ -export function remove(setarr: SetArray, key: T): void { - const index = get(setarr, key); - if (index === undefined) return; - - const { array, _indexes: indexes } = cast(setarr); - for (let i = index + 1; i < array.length; i++) { - const k = array[i]; - array[i - 1] = k; - indexes[k]!--; - } - indexes[key] = undefined; - array.pop(); -} diff --git a/frontend/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts b/frontend/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts deleted file mode 100644 index fb296dd..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts +++ /dev/null @@ -1,16 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; - -export type SourceMapSegment = - | [GeneratedColumn] - | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] - | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; - -export const COLUMN = 0; -export const SOURCES_INDEX = 1; -export const SOURCE_LINE = 2; -export const SOURCE_COLUMN = 3; -export const NAMES_INDEX = 4; diff --git a/frontend/node_modules/@jridgewell/gen-mapping/src/types.ts b/frontend/node_modules/@jridgewell/gen-mapping/src/types.ts deleted file mode 100644 index b087f70..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/src/types.ts +++ /dev/null @@ -1,61 +0,0 @@ -// import type { GeneratedRange, OriginalScope } from '@jridgewell/sourcemap-codec'; -import type { SourceMapSegment } from './sourcemap-segment'; - -export interface SourceMapV3 { - file?: string | null; - names: readonly string[]; - sourceRoot?: string; - sources: readonly (string | null)[]; - sourcesContent?: readonly (string | null)[]; - version: 3; - ignoreList?: readonly number[]; -} - -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; - // originalScopes: string[]; - // generatedRanges: string; -} - -export interface DecodedSourceMap extends SourceMapV3 { - mappings: readonly SourceMapSegment[][]; - // originalScopes: readonly OriginalScope[][]; - // generatedRanges: readonly GeneratedRange[]; -} - -export interface Pos { - line: number; // 1-based - column: number; // 0-based -} - -export interface OriginalPos extends Pos { - source: string; -} - -export interface BindingExpressionRange { - start: Pos; - expression: string; -} - -// export type OriginalScopeInfo = [number, number, string[] | undefined]; -// export type GeneratedRangeInfo = [GeneratedRange, string[] | undefined]; - -export type Mapping = - | { - generated: Pos; - source: undefined; - original: undefined; - name: undefined; - } - | { - generated: Pos; - source: string; - original: Pos; - name: string; - } - | { - generated: Pos; - source: string; - original: Pos; - name: undefined; - }; diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts b/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts deleted file mode 100644 index 7618d85..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts +++ /dev/null @@ -1,89 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.cts'; -export type { DecodedSourceMap, EncodedSourceMap, Mapping }; -export type Options = { - file?: string | null; - sourceRoot?: string | null; -}; -/** - * Provides the state to generate a sourcemap. - */ -export declare class GenMapping { - private _names; - private _sources; - private _sourcesContent; - private _mappings; - private _ignoreList; - file: string | null | undefined; - sourceRoot: string | null | undefined; - constructor({ file, sourceRoot }?: Options); -} -/** - * A low-level API to associate a generated position with an original source position. Line and - * column here are 0-based, unlike `addMapping`. - */ -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; -/** - * A high-level API to associate a generated position with an original source position. Line is - * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. - */ -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source?: null; - original?: null; - name?: null; - content?: null; -}): void; -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name?: null; - content?: string | null; -}): void; -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name: string; - content?: string | null; -}): void; -/** - * Same as `addSegment`, but will only add the segment if it generates useful information in the - * resulting map. This only works correctly if segments are added **in order**, meaning you should - * not add a segment with a lower generated line/column than one that came before. - */ -export declare const maybeAddSegment: typeof addSegment; -/** - * Same as `addMapping`, but will only add the mapping if it generates useful information in the - * resulting map. This only works correctly if mappings are added **in order**, meaning you should - * not add a mapping with a lower generated line/column than one that came before. - */ -export declare const maybeAddMapping: typeof addMapping; -/** - * Adds/removes the content of the source file to the source map. - */ -export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; -export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function toDecodedMap(map: GenMapping): DecodedSourceMap; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function toEncodedMap(map: GenMapping): EncodedSourceMap; -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -export declare function fromMap(input: SourceMapInput): GenMapping; -/** - * Returns an array of high-level mapping objects for every recorded segment, which could then be - * passed to the `source-map` library. - */ -export declare function allMappings(map: GenMapping): Mapping[]; -//# sourceMappingURL=gen-mapping.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map b/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map deleted file mode 100644 index 8a2b183..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AAwBR;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AAcR;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAqBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts b/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts deleted file mode 100644 index bbc0d89..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts +++ /dev/null @@ -1,89 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.mts'; -export type { DecodedSourceMap, EncodedSourceMap, Mapping }; -export type Options = { - file?: string | null; - sourceRoot?: string | null; -}; -/** - * Provides the state to generate a sourcemap. - */ -export declare class GenMapping { - private _names; - private _sources; - private _sourcesContent; - private _mappings; - private _ignoreList; - file: string | null | undefined; - sourceRoot: string | null | undefined; - constructor({ file, sourceRoot }?: Options); -} -/** - * A low-level API to associate a generated position with an original source position. Line and - * column here are 0-based, unlike `addMapping`. - */ -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; -/** - * A high-level API to associate a generated position with an original source position. Line is - * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. - */ -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source?: null; - original?: null; - name?: null; - content?: null; -}): void; -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name?: null; - content?: string | null; -}): void; -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name: string; - content?: string | null; -}): void; -/** - * Same as `addSegment`, but will only add the segment if it generates useful information in the - * resulting map. This only works correctly if segments are added **in order**, meaning you should - * not add a segment with a lower generated line/column than one that came before. - */ -export declare const maybeAddSegment: typeof addSegment; -/** - * Same as `addMapping`, but will only add the mapping if it generates useful information in the - * resulting map. This only works correctly if mappings are added **in order**, meaning you should - * not add a mapping with a lower generated line/column than one that came before. - */ -export declare const maybeAddMapping: typeof addMapping; -/** - * Adds/removes the content of the source file to the source map. - */ -export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; -export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function toDecodedMap(map: GenMapping): DecodedSourceMap; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function toEncodedMap(map: GenMapping): EncodedSourceMap; -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -export declare function fromMap(input: SourceMapInput): GenMapping; -/** - * Returns an array of high-level mapping objects for every recorded segment, which could then be - * passed to the `source-map` library. - */ -export declare function allMappings(map: GenMapping): Mapping[]; -//# sourceMappingURL=gen-mapping.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map b/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map deleted file mode 100644 index 8a2b183..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AAwBR;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AAcR;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAqBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts b/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts deleted file mode 100644 index 5d8cda3..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts +++ /dev/null @@ -1,33 +0,0 @@ -type Key = string | number | symbol; -/** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ -export declare class SetArray { - private _indexes; - array: readonly T[]; - constructor(); -} -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export declare function get(setarr: SetArray, key: T): number | undefined; -/** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ -export declare function put(setarr: SetArray, key: T): number; -/** - * Pops the last added item out of the SetArray. - */ -export declare function pop(setarr: SetArray): void; -/** - * Removes the key, if it exists in the set. - */ -export declare function remove(setarr: SetArray, key: T): void; -export {}; -//# sourceMappingURL=set-array.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map b/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map deleted file mode 100644 index c52b8bc..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts b/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts deleted file mode 100644 index 5d8cda3..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts +++ /dev/null @@ -1,33 +0,0 @@ -type Key = string | number | symbol; -/** - * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the - * index of the `key` in the backing array. - * - * This is designed to allow synchronizing a second array with the contents of the backing array, - * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, - * and there are never duplicates. - */ -export declare class SetArray { - private _indexes; - array: readonly T[]; - constructor(); -} -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export declare function get(setarr: SetArray, key: T): number | undefined; -/** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ -export declare function put(setarr: SetArray, key: T): number; -/** - * Pops the last added item out of the SetArray. - */ -export declare function pop(setarr: SetArray): void; -/** - * Removes the key, if it exists in the set. - */ -export declare function remove(setarr: SetArray, key: T): void; -export {}; -//# sourceMappingURL=set-array.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map b/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map deleted file mode 100644 index c52b8bc..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts b/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts deleted file mode 100644 index 6886295..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts +++ /dev/null @@ -1,13 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; -export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; -export declare const COLUMN = 0; -export declare const SOURCES_INDEX = 1; -export declare const SOURCE_LINE = 2; -export declare const SOURCE_COLUMN = 3; -export declare const NAMES_INDEX = 4; -export {}; -//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map b/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map deleted file mode 100644 index 23cdc45..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts b/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts deleted file mode 100644 index 6886295..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts +++ /dev/null @@ -1,13 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; -export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; -export declare const COLUMN = 0; -export declare const SOURCES_INDEX = 1; -export declare const SOURCE_LINE = 2; -export declare const SOURCE_COLUMN = 3; -export declare const NAMES_INDEX = 4; -export {}; -//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map b/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map deleted file mode 100644 index 23cdc45..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.cts b/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.cts deleted file mode 100644 index 58da00a..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.cts +++ /dev/null @@ -1,44 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.cts'; -export interface SourceMapV3 { - file?: string | null; - names: readonly string[]; - sourceRoot?: string; - sources: readonly (string | null)[]; - sourcesContent?: readonly (string | null)[]; - version: 3; - ignoreList?: readonly number[]; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: readonly SourceMapSegment[][]; -} -export interface Pos { - line: number; - column: number; -} -export interface OriginalPos extends Pos { - source: string; -} -export interface BindingExpressionRange { - start: Pos; - expression: string; -} -export type Mapping = { - generated: Pos; - source: undefined; - original: undefined; - name: undefined; -} | { - generated: Pos; - source: string; - original: Pos; - name: string; -} | { - generated: Pos; - source: string; - original: Pos; - name: undefined; -}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map b/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map deleted file mode 100644 index 159e734..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAGlB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAC;CAGzC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAKD,MAAM,MAAM,OAAO,GACf;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.mts b/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.mts deleted file mode 100644 index e9837eb..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.mts +++ /dev/null @@ -1,44 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.mts'; -export interface SourceMapV3 { - file?: string | null; - names: readonly string[]; - sourceRoot?: string; - sources: readonly (string | null)[]; - sourcesContent?: readonly (string | null)[]; - version: 3; - ignoreList?: readonly number[]; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: readonly SourceMapSegment[][]; -} -export interface Pos { - line: number; - column: number; -} -export interface OriginalPos extends Pos { - source: string; -} -export interface BindingExpressionRange { - start: Pos; - expression: string; -} -export type Mapping = { - generated: Pos; - source: undefined; - original: undefined; - name: undefined; -} | { - generated: Pos; - source: string; - original: Pos; - name: string; -} | { - generated: Pos; - source: string; - original: Pos; - name: undefined; -}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map b/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map deleted file mode 100644 index 159e734..0000000 --- a/frontend/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAGlB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAC;CAGzC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAKD,MAAM,MAAM,OAAO,GACf;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/LICENSE b/frontend/node_modules/@jridgewell/remapping/LICENSE deleted file mode 100644 index 1f6ce94..0000000 --- a/frontend/node_modules/@jridgewell/remapping/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2024 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/frontend/node_modules/@jridgewell/remapping/README.md b/frontend/node_modules/@jridgewell/remapping/README.md deleted file mode 100644 index 6d092d7..0000000 --- a/frontend/node_modules/@jridgewell/remapping/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# @jridgewell/remapping - -> Remap sequential sourcemaps through transformations to point at the original source code - -Remapping allows you to take the sourcemaps generated through transforming your code and "remap" -them to the original source locations. Think "my minified code, transformed with babel and bundled -with webpack", all pointing to the correct location in your original source code. - -With remapping, none of your source code transformations need to be aware of the input's sourcemap, -they only need to generate an output sourcemap. This greatly simplifies building custom -transformations (think a find-and-replace). - -## Installation - -```sh -npm install @jridgewell/remapping -``` - -## Usage - -```typescript -function remapping( - map: SourceMap | SourceMap[], - loader: (file: string, ctx: LoaderContext) => (SourceMap | null | undefined), - options?: { excludeContent: boolean, decodedMappings: boolean } -): SourceMap; - -// LoaderContext gives the loader the importing sourcemap, tree depth, the ability to override the -// "source" location (where child sources are resolved relative to, or the location of original -// source), and the ability to override the "content" of an original source for inclusion in the -// output sourcemap. -type LoaderContext = { - readonly importer: string; - readonly depth: number; - source: string; - content: string | null | undefined; -} -``` - -`remapping` takes the final output sourcemap, and a `loader` function. For every source file pointer -in the sourcemap, the `loader` will be called with the resolved path. If the path itself represents -a transformed file (it has a sourcmap associated with it), then the `loader` should return that -sourcemap. If not, the path will be treated as an original, untransformed source code. - -```js -// Babel transformed "helloworld.js" into "transformed.js" -const transformedMap = JSON.stringify({ - file: 'transformed.js', - // 1st column of 2nd line of output file translates into the 1st source - // file, line 3, column 2 - mappings: ';CAEE', - sources: ['helloworld.js'], - version: 3, -}); - -// Uglify minified "transformed.js" into "transformed.min.js" -const minifiedTransformedMap = JSON.stringify({ - file: 'transformed.min.js', - // 0th column of 1st line of output file translates into the 1st source - // file, line 2, column 1. - mappings: 'AACC', - names: [], - sources: ['transformed.js'], - version: 3, -}); - -const remapped = remapping( - minifiedTransformedMap, - (file, ctx) => { - - // The "transformed.js" file is an transformed file. - if (file === 'transformed.js') { - // The root importer is empty. - console.assert(ctx.importer === ''); - // The depth in the sourcemap tree we're currently loading. - // The root `minifiedTransformedMap` is depth 0, and its source children are depth 1, etc. - console.assert(ctx.depth === 1); - - return transformedMap; - } - - // Loader will be called to load transformedMap's source file pointers as well. - console.assert(file === 'helloworld.js'); - // `transformed.js`'s sourcemap points into `helloworld.js`. - console.assert(ctx.importer === 'transformed.js'); - // This is a source child of `transformed`, which is a source child of `minifiedTransformedMap`. - console.assert(ctx.depth === 2); - return null; - } -); - -console.log(remapped); -// { -// file: 'transpiled.min.js', -// mappings: 'AAEE', -// sources: ['helloworld.js'], -// version: 3, -// }; -``` - -In this example, `loader` will be called twice: - -1. `"transformed.js"`, the first source file pointer in the `minifiedTransformedMap`. We return the - associated sourcemap for it (its a transformed file, after all) so that sourcemap locations can - be traced through it into the source files it represents. -2. `"helloworld.js"`, our original, unmodified source code. This file does not have a sourcemap, so - we return `null`. - -The `remapped` sourcemap now points from `transformed.min.js` into locations in `helloworld.js`. If -you were to read the `mappings`, it says "0th column of the first line output line points to the 1st -column of the 2nd line of the file `helloworld.js`". - -### Multiple transformations of a file - -As a convenience, if you have multiple single-source transformations of a file, you may pass an -array of sourcemap files in the order of most-recent transformation sourcemap first. Note that this -changes the `importer` and `depth` of each call to our loader. So our above example could have been -written as: - -```js -const remapped = remapping( - [minifiedTransformedMap, transformedMap], - () => null -); - -console.log(remapped); -// { -// file: 'transpiled.min.js', -// mappings: 'AAEE', -// sources: ['helloworld.js'], -// version: 3, -// }; -``` - -### Advanced control of the loading graph - -#### `source` - -The `source` property can overridden to any value to change the location of the current load. Eg, -for an original source file, it allows us to change the location to the original source regardless -of what the sourcemap source entry says. And for transformed files, it allows us to change the -relative resolving location for child sources of the loaded sourcemap. - -```js -const remapped = remapping( - minifiedTransformedMap, - (file, ctx) => { - - if (file === 'transformed.js') { - // We pretend the transformed.js file actually exists in the 'src/' directory. When the nested - // source files are loaded, they will now be relative to `src/`. - ctx.source = 'src/transformed.js'; - return transformedMap; - } - - console.assert(file === 'src/helloworld.js'); - // We could futher change the source of this original file, eg, to be inside a nested directory - // itself. This will be reflected in the remapped sourcemap. - ctx.source = 'src/nested/transformed.js'; - return null; - } -); - -console.log(remapped); -// { -// …, -// sources: ['src/nested/helloworld.js'], -// }; -``` - - -#### `content` - -The `content` property can be overridden when we encounter an original source file. Eg, this allows -you to manually provide the source content of the original file regardless of whether the -`sourcesContent` field is present in the parent sourcemap. It can also be set to `null` to remove -the source content. - -```js -const remapped = remapping( - minifiedTransformedMap, - (file, ctx) => { - - if (file === 'transformed.js') { - // transformedMap does not include a `sourcesContent` field, so usually the remapped sourcemap - // would not include any `sourcesContent` values. - return transformedMap; - } - - console.assert(file === 'helloworld.js'); - // We can read the file to provide the source content. - ctx.content = fs.readFileSync(file, 'utf8'); - return null; - } -); - -console.log(remapped); -// { -// …, -// sourcesContent: [ -// 'console.log("Hello world!")', -// ], -// }; -``` - -### Options - -#### excludeContent - -By default, `excludeContent` is `false`. Passing `{ excludeContent: true }` will exclude the -`sourcesContent` field from the returned sourcemap. This is mainly useful when you want to reduce -the size out the sourcemap. - -#### decodedMappings - -By default, `decodedMappings` is `false`. Passing `{ decodedMappings: true }` will leave the -`mappings` field in a [decoded state](https://github.com/rich-harris/sourcemap-codec) instead of -encoding into a VLQ string. diff --git a/frontend/node_modules/@jridgewell/remapping/dist/remapping.mjs b/frontend/node_modules/@jridgewell/remapping/dist/remapping.mjs deleted file mode 100644 index 8b7009c..0000000 --- a/frontend/node_modules/@jridgewell/remapping/dist/remapping.mjs +++ /dev/null @@ -1,144 +0,0 @@ -// src/build-source-map-tree.ts -import { TraceMap } from "@jridgewell/trace-mapping"; - -// src/source-map-tree.ts -import { GenMapping, maybeAddSegment, setIgnore, setSourceContent } from "@jridgewell/gen-mapping"; -import { traceSegment, decodedMappings } from "@jridgewell/trace-mapping"; -var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false); -var EMPTY_SOURCES = []; -function SegmentObject(source, line, column, name, content, ignore) { - return { source, line, column, name, content, ignore }; -} -function Source(map, sources, source, content, ignore) { - return { - map, - sources, - source, - content, - ignore - }; -} -function MapSource(map, sources) { - return Source(map, sources, "", null, false); -} -function OriginalSource(source, content, ignore) { - return Source(null, EMPTY_SOURCES, source, content, ignore); -} -function traceMappings(tree) { - const gen = new GenMapping({ file: tree.map.file }); - const { sources: rootSources, map } = tree; - const rootNames = map.names; - const rootMappings = decodedMappings(map); - for (let i = 0; i < rootMappings.length; i++) { - const segments = rootMappings[i]; - for (let j = 0; j < segments.length; j++) { - const segment = segments[j]; - const genCol = segment[0]; - let traced = SOURCELESS_MAPPING; - if (segment.length !== 1) { - const source2 = rootSources[segment[1]]; - traced = originalPositionFor( - source2, - segment[2], - segment[3], - segment.length === 5 ? rootNames[segment[4]] : "" - ); - if (traced == null) continue; - } - const { column, line, name, content, source, ignore } = traced; - maybeAddSegment(gen, i, genCol, source, line, column, name); - if (source && content != null) setSourceContent(gen, source, content); - if (ignore) setIgnore(gen, source, true); - } - } - return gen; -} -function originalPositionFor(source, line, column, name) { - if (!source.map) { - return SegmentObject(source.source, line, column, name, source.content, source.ignore); - } - const segment = traceSegment(source.map, line, column); - if (segment == null) return null; - if (segment.length === 1) return SOURCELESS_MAPPING; - return originalPositionFor( - source.sources[segment[1]], - segment[2], - segment[3], - segment.length === 5 ? source.map.names[segment[4]] : name - ); -} - -// src/build-source-map-tree.ts -function asArray(value) { - if (Array.isArray(value)) return value; - return [value]; -} -function buildSourceMapTree(input, loader) { - const maps = asArray(input).map((m) => new TraceMap(m, "")); - const map = maps.pop(); - for (let i = 0; i < maps.length; i++) { - if (maps[i].sources.length > 1) { - throw new Error( - `Transformation map ${i} must have exactly one source file. -Did you specify these with the most recent transformation maps first?` - ); - } - } - let tree = build(map, loader, "", 0); - for (let i = maps.length - 1; i >= 0; i--) { - tree = MapSource(maps[i], [tree]); - } - return tree; -} -function build(map, loader, importer, importerDepth) { - const { resolvedSources, sourcesContent, ignoreList } = map; - const depth = importerDepth + 1; - const children = resolvedSources.map((sourceFile, i) => { - const ctx = { - importer, - depth, - source: sourceFile || "", - content: void 0, - ignore: void 0 - }; - const sourceMap = loader(ctx.source, ctx); - const { source, content, ignore } = ctx; - if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth); - const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null; - const ignored = ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i) : false; - return OriginalSource(source, sourceContent, ignored); - }); - return MapSource(map, children); -} - -// src/source-map.ts -import { toDecodedMap, toEncodedMap } from "@jridgewell/gen-mapping"; -var SourceMap = class { - constructor(map, options) { - const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); - this.version = out.version; - this.file = out.file; - this.mappings = out.mappings; - this.names = out.names; - this.ignoreList = out.ignoreList; - this.sourceRoot = out.sourceRoot; - this.sources = out.sources; - if (!options.excludeContent) { - this.sourcesContent = out.sourcesContent; - } - } - toString() { - return JSON.stringify(this); - } -}; - -// src/remapping.ts -function remapping(input, loader, options) { - const opts = typeof options === "object" ? options : { excludeContent: !!options, decodedMappings: false }; - const tree = buildSourceMapTree(input, loader); - return new SourceMap(traceMappings(tree), opts); -} -export { - remapping as default -}; -//# sourceMappingURL=remapping.mjs.map diff --git a/frontend/node_modules/@jridgewell/remapping/dist/remapping.mjs.map b/frontend/node_modules/@jridgewell/remapping/dist/remapping.mjs.map deleted file mode 100644 index 66801e6..0000000 --- a/frontend/node_modules/@jridgewell/remapping/dist/remapping.mjs.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["../src/build-source-map-tree.ts", "../src/source-map-tree.ts", "../src/source-map.ts", "../src/remapping.ts"], - "mappings": ";AAAA,SAAS,gBAAgB;;;ACAzB,SAAS,YAAY,iBAAiB,WAAW,wBAAwB;AACzE,SAAS,cAAc,uBAAuB;AA+B9C,IAAM,qBAAqC,8BAAc,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK;AACpF,IAAM,gBAA2B,CAAC;AAElC,SAAS,cACP,QACA,MACA,QACA,MACA,SACA,QACwB;AACxB,SAAO,EAAE,QAAQ,MAAM,QAAQ,MAAM,SAAS,OAAO;AACvD;AAgBA,SAAS,OACP,KACA,SACA,QACA,SACA,QACS;AACT,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAMO,SAAS,UAAU,KAAe,SAA+B;AACtE,SAAO,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK;AAC7C;AAMO,SAAS,eACd,QACA,SACA,QACgB;AAChB,SAAO,OAAO,MAAM,eAAe,QAAQ,SAAS,MAAM;AAC5D;AAMO,SAAS,cAAc,MAA6B;AAGzD,QAAM,MAAM,IAAI,WAAW,EAAE,MAAM,KAAK,IAAI,KAAK,CAAC;AAClD,QAAM,EAAE,SAAS,aAAa,IAAI,IAAI;AACtC,QAAM,YAAY,IAAI;AACtB,QAAM,eAAe,gBAAgB,GAAG;AAExC,WAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;AAC5C,UAAM,WAAW,aAAa,CAAC;AAE/B,aAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,YAAM,UAAU,SAAS,CAAC;AAC1B,YAAM,SAAS,QAAQ,CAAC;AACxB,UAAI,SAAwC;AAI5C,UAAI,QAAQ,WAAW,GAAG;AACxB,cAAMA,UAAS,YAAY,QAAQ,CAAC,CAAC;AACrC,iBAAS;AAAA,UACPA;AAAA,UACA,QAAQ,CAAC;AAAA,UACT,QAAQ,CAAC;AAAA,UACT,QAAQ,WAAW,IAAI,UAAU,QAAQ,CAAC,CAAC,IAAI;AAAA,QACjD;AAIA,YAAI,UAAU,KAAM;AAAA,MACtB;AAEA,YAAM,EAAE,QAAQ,MAAM,MAAM,SAAS,QAAQ,OAAO,IAAI;AAExD,sBAAgB,KAAK,GAAG,QAAQ,QAAQ,MAAM,QAAQ,IAAI;AAC1D,UAAI,UAAU,WAAW,KAAM,kBAAiB,KAAK,QAAQ,OAAO;AACpE,UAAI,OAAQ,WAAU,KAAK,QAAQ,IAAI;AAAA,IACzC;AAAA,EACF;AAEA,SAAO;AACT;AAMO,SAAS,oBACd,QACA,MACA,QACA,MAC+B;AAC/B,MAAI,CAAC,OAAO,KAAK;AACf,WAAO,cAAc,OAAO,QAAQ,MAAM,QAAQ,MAAM,OAAO,SAAS,OAAO,MAAM;AAAA,EACvF;AAEA,QAAM,UAAU,aAAa,OAAO,KAAK,MAAM,MAAM;AAGrD,MAAI,WAAW,KAAM,QAAO;AAG5B,MAAI,QAAQ,WAAW,EAAG,QAAO;AAEjC,SAAO;AAAA,IACL,OAAO,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACzB,QAAQ,CAAC;AAAA,IACT,QAAQ,CAAC;AAAA,IACT,QAAQ,WAAW,IAAI,OAAO,IAAI,MAAM,QAAQ,CAAC,CAAC,IAAI;AAAA,EACxD;AACF;;;ADpKA,SAAS,QAAW,OAAqB;AACvC,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO;AACjC,SAAO,CAAC,KAAK;AACf;AAae,SAAR,mBACL,OACA,QACe;AACf,QAAM,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,MAAM,IAAI,SAAS,GAAG,EAAE,CAAC;AAC1D,QAAM,MAAM,KAAK,IAAI;AAErB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,QAAQ,SAAS,GAAG;AAC9B,YAAM,IAAI;AAAA,QACR,sBAAsB,CAAC;AAAA;AAAA,MAEzB;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC;AACnC,WAAS,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK;AACzC,WAAO,UAAU,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AAAA,EAClC;AACA,SAAO;AACT;AAEA,SAAS,MACP,KACA,QACA,UACA,eACe;AACf,QAAM,EAAE,iBAAiB,gBAAgB,WAAW,IAAI;AAExD,QAAM,QAAQ,gBAAgB;AAC9B,QAAM,WAAW,gBAAgB,IAAI,CAAC,YAA2B,MAAuB;AAKtF,UAAM,MAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA,QAAQ,cAAc;AAAA,MACtB,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAIA,UAAM,YAAY,OAAO,IAAI,QAAQ,GAAG;AAExC,UAAM,EAAE,QAAQ,SAAS,OAAO,IAAI;AAGpC,QAAI,UAAW,QAAO,MAAM,IAAI,SAAS,WAAW,MAAM,GAAG,QAAQ,QAAQ,KAAK;AAMlF,UAAM,gBACJ,YAAY,SAAY,UAAU,iBAAiB,eAAe,CAAC,IAAI;AACzE,UAAM,UAAU,WAAW,SAAY,SAAS,aAAa,WAAW,SAAS,CAAC,IAAI;AACtF,WAAO,eAAe,QAAQ,eAAe,OAAO;AAAA,EACtD,CAAC;AAED,SAAO,UAAU,KAAK,QAAQ;AAChC;;;AExFA,SAAS,cAAc,oBAAoB;AAS3C,IAAqB,YAArB,MAA+B;AAAA,EAU7B,YAAY,KAAiB,SAAkB;AAC7C,UAAM,MAAM,QAAQ,kBAAkB,aAAa,GAAG,IAAI,aAAa,GAAG;AAC1E,SAAK,UAAU,IAAI;AACnB,SAAK,OAAO,IAAI;AAChB,SAAK,WAAW,IAAI;AACpB,SAAK,QAAQ,IAAI;AACjB,SAAK,aAAa,IAAI;AACtB,SAAK,aAAa,IAAI;AAEtB,SAAK,UAAU,IAAI;AACnB,QAAI,CAAC,QAAQ,gBAAgB;AAC3B,WAAK,iBAAiB,IAAI;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,WAAmB;AACjB,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B;AACF;;;ACLe,SAAR,UACL,OACA,QACA,SACW;AACX,QAAM,OACJ,OAAO,YAAY,WAAW,UAAU,EAAE,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,MAAM;AAC9F,QAAM,OAAO,mBAAmB,OAAO,MAAM;AAC7C,SAAO,IAAI,UAAU,cAAc,IAAI,GAAG,IAAI;AAChD;", - "names": ["source"] -} diff --git a/frontend/node_modules/@jridgewell/remapping/dist/remapping.umd.js b/frontend/node_modules/@jridgewell/remapping/dist/remapping.umd.js deleted file mode 100644 index 077eb4d..0000000 --- a/frontend/node_modules/@jridgewell/remapping/dist/remapping.umd.js +++ /dev/null @@ -1,212 +0,0 @@ -(function (global, factory) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - factory(module, require('@jridgewell/gen-mapping'), require('@jridgewell/trace-mapping')); - module.exports = def(module); - } else if (typeof define === 'function' && define.amd) { - define(['module', '@jridgewell/gen-mapping', '@jridgewell/trace-mapping'], function(mod) { - factory.apply(this, arguments); - mod.exports = def(mod); - }); - } else { - const mod = { exports: {} }; - factory(mod, global.genMapping, global.traceMapping); - global = typeof globalThis !== 'undefined' ? globalThis : global || self; - global.remapping = def(mod); - } - function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } -})(this, (function (module, require_genMapping, require_traceMapping) { -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// umd:@jridgewell/trace-mapping -var require_trace_mapping = __commonJS({ - "umd:@jridgewell/trace-mapping"(exports, module2) { - module2.exports = require_traceMapping; - } -}); - -// umd:@jridgewell/gen-mapping -var require_gen_mapping = __commonJS({ - "umd:@jridgewell/gen-mapping"(exports, module2) { - module2.exports = require_genMapping; - } -}); - -// src/remapping.ts -var remapping_exports = {}; -__export(remapping_exports, { - default: () => remapping -}); -module.exports = __toCommonJS(remapping_exports); - -// src/build-source-map-tree.ts -var import_trace_mapping2 = __toESM(require_trace_mapping()); - -// src/source-map-tree.ts -var import_gen_mapping = __toESM(require_gen_mapping()); -var import_trace_mapping = __toESM(require_trace_mapping()); -var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false); -var EMPTY_SOURCES = []; -function SegmentObject(source, line, column, name, content, ignore) { - return { source, line, column, name, content, ignore }; -} -function Source(map, sources, source, content, ignore) { - return { - map, - sources, - source, - content, - ignore - }; -} -function MapSource(map, sources) { - return Source(map, sources, "", null, false); -} -function OriginalSource(source, content, ignore) { - return Source(null, EMPTY_SOURCES, source, content, ignore); -} -function traceMappings(tree) { - const gen = new import_gen_mapping.GenMapping({ file: tree.map.file }); - const { sources: rootSources, map } = tree; - const rootNames = map.names; - const rootMappings = (0, import_trace_mapping.decodedMappings)(map); - for (let i = 0; i < rootMappings.length; i++) { - const segments = rootMappings[i]; - for (let j = 0; j < segments.length; j++) { - const segment = segments[j]; - const genCol = segment[0]; - let traced = SOURCELESS_MAPPING; - if (segment.length !== 1) { - const source2 = rootSources[segment[1]]; - traced = originalPositionFor( - source2, - segment[2], - segment[3], - segment.length === 5 ? rootNames[segment[4]] : "" - ); - if (traced == null) continue; - } - const { column, line, name, content, source, ignore } = traced; - (0, import_gen_mapping.maybeAddSegment)(gen, i, genCol, source, line, column, name); - if (source && content != null) (0, import_gen_mapping.setSourceContent)(gen, source, content); - if (ignore) (0, import_gen_mapping.setIgnore)(gen, source, true); - } - } - return gen; -} -function originalPositionFor(source, line, column, name) { - if (!source.map) { - return SegmentObject(source.source, line, column, name, source.content, source.ignore); - } - const segment = (0, import_trace_mapping.traceSegment)(source.map, line, column); - if (segment == null) return null; - if (segment.length === 1) return SOURCELESS_MAPPING; - return originalPositionFor( - source.sources[segment[1]], - segment[2], - segment[3], - segment.length === 5 ? source.map.names[segment[4]] : name - ); -} - -// src/build-source-map-tree.ts -function asArray(value) { - if (Array.isArray(value)) return value; - return [value]; -} -function buildSourceMapTree(input, loader) { - const maps = asArray(input).map((m) => new import_trace_mapping2.TraceMap(m, "")); - const map = maps.pop(); - for (let i = 0; i < maps.length; i++) { - if (maps[i].sources.length > 1) { - throw new Error( - `Transformation map ${i} must have exactly one source file. -Did you specify these with the most recent transformation maps first?` - ); - } - } - let tree = build(map, loader, "", 0); - for (let i = maps.length - 1; i >= 0; i--) { - tree = MapSource(maps[i], [tree]); - } - return tree; -} -function build(map, loader, importer, importerDepth) { - const { resolvedSources, sourcesContent, ignoreList } = map; - const depth = importerDepth + 1; - const children = resolvedSources.map((sourceFile, i) => { - const ctx = { - importer, - depth, - source: sourceFile || "", - content: void 0, - ignore: void 0 - }; - const sourceMap = loader(ctx.source, ctx); - const { source, content, ignore } = ctx; - if (sourceMap) return build(new import_trace_mapping2.TraceMap(sourceMap, source), loader, source, depth); - const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null; - const ignored = ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i) : false; - return OriginalSource(source, sourceContent, ignored); - }); - return MapSource(map, children); -} - -// src/source-map.ts -var import_gen_mapping2 = __toESM(require_gen_mapping()); -var SourceMap = class { - constructor(map, options) { - const out = options.decodedMappings ? (0, import_gen_mapping2.toDecodedMap)(map) : (0, import_gen_mapping2.toEncodedMap)(map); - this.version = out.version; - this.file = out.file; - this.mappings = out.mappings; - this.names = out.names; - this.ignoreList = out.ignoreList; - this.sourceRoot = out.sourceRoot; - this.sources = out.sources; - if (!options.excludeContent) { - this.sourcesContent = out.sourcesContent; - } - } - toString() { - return JSON.stringify(this); - } -}; - -// src/remapping.ts -function remapping(input, loader, options) { - const opts = typeof options === "object" ? options : { excludeContent: !!options, decodedMappings: false }; - const tree = buildSourceMapTree(input, loader); - return new SourceMap(traceMappings(tree), opts); -} -})); -//# sourceMappingURL=remapping.umd.js.map diff --git a/frontend/node_modules/@jridgewell/remapping/dist/remapping.umd.js.map b/frontend/node_modules/@jridgewell/remapping/dist/remapping.umd.js.map deleted file mode 100644 index d5e0786..0000000 --- a/frontend/node_modules/@jridgewell/remapping/dist/remapping.umd.js.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["umd:@jridgewell/trace-mapping", "umd:@jridgewell/gen-mapping", "../src/remapping.ts", "../src/build-source-map-tree.ts", "../src/source-map-tree.ts", "../src/source-map.ts"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,2CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,yCAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAC,wBAAyB;;;ACAzB,yBAAyE;AACzE,2BAA8C;AA+B9C,IAAM,qBAAqC,8BAAc,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK;AACpF,IAAM,gBAA2B,CAAC;AAElC,SAAS,cACP,QACA,MACA,QACA,MACA,SACA,QACwB;AACxB,SAAO,EAAE,QAAQ,MAAM,QAAQ,MAAM,SAAS,OAAO;AACvD;AAgBA,SAAS,OACP,KACA,SACA,QACA,SACA,QACS;AACT,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAMO,SAAS,UAAU,KAAe,SAA+B;AACtE,SAAO,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK;AAC7C;AAMO,SAAS,eACd,QACA,SACA,QACgB;AAChB,SAAO,OAAO,MAAM,eAAe,QAAQ,SAAS,MAAM;AAC5D;AAMO,SAAS,cAAc,MAA6B;AAGzD,QAAM,MAAM,IAAI,8BAAW,EAAE,MAAM,KAAK,IAAI,KAAK,CAAC;AAClD,QAAM,EAAE,SAAS,aAAa,IAAI,IAAI;AACtC,QAAM,YAAY,IAAI;AACtB,QAAM,mBAAe,sCAAgB,GAAG;AAExC,WAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;AAC5C,UAAM,WAAW,aAAa,CAAC;AAE/B,aAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,YAAM,UAAU,SAAS,CAAC;AAC1B,YAAM,SAAS,QAAQ,CAAC;AACxB,UAAI,SAAwC;AAI5C,UAAI,QAAQ,WAAW,GAAG;AACxB,cAAMC,UAAS,YAAY,QAAQ,CAAC,CAAC;AACrC,iBAAS;AAAA,UACPA;AAAA,UACA,QAAQ,CAAC;AAAA,UACT,QAAQ,CAAC;AAAA,UACT,QAAQ,WAAW,IAAI,UAAU,QAAQ,CAAC,CAAC,IAAI;AAAA,QACjD;AAIA,YAAI,UAAU,KAAM;AAAA,MACtB;AAEA,YAAM,EAAE,QAAQ,MAAM,MAAM,SAAS,QAAQ,OAAO,IAAI;AAExD,8CAAgB,KAAK,GAAG,QAAQ,QAAQ,MAAM,QAAQ,IAAI;AAC1D,UAAI,UAAU,WAAW,KAAM,0CAAiB,KAAK,QAAQ,OAAO;AACpE,UAAI,OAAQ,mCAAU,KAAK,QAAQ,IAAI;AAAA,IACzC;AAAA,EACF;AAEA,SAAO;AACT;AAMO,SAAS,oBACd,QACA,MACA,QACA,MAC+B;AAC/B,MAAI,CAAC,OAAO,KAAK;AACf,WAAO,cAAc,OAAO,QAAQ,MAAM,QAAQ,MAAM,OAAO,SAAS,OAAO,MAAM;AAAA,EACvF;AAEA,QAAM,cAAU,mCAAa,OAAO,KAAK,MAAM,MAAM;AAGrD,MAAI,WAAW,KAAM,QAAO;AAG5B,MAAI,QAAQ,WAAW,EAAG,QAAO;AAEjC,SAAO;AAAA,IACL,OAAO,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACzB,QAAQ,CAAC;AAAA,IACT,QAAQ,CAAC;AAAA,IACT,QAAQ,WAAW,IAAI,OAAO,IAAI,MAAM,QAAQ,CAAC,CAAC,IAAI;AAAA,EACxD;AACF;;;ADpKA,SAAS,QAAW,OAAqB;AACvC,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO;AACjC,SAAO,CAAC,KAAK;AACf;AAae,SAAR,mBACL,OACA,QACe;AACf,QAAM,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,MAAM,IAAI,+BAAS,GAAG,EAAE,CAAC;AAC1D,QAAM,MAAM,KAAK,IAAI;AAErB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,QAAQ,SAAS,GAAG;AAC9B,YAAM,IAAI;AAAA,QACR,sBAAsB,CAAC;AAAA;AAAA,MAEzB;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC;AACnC,WAAS,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK;AACzC,WAAO,UAAU,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AAAA,EAClC;AACA,SAAO;AACT;AAEA,SAAS,MACP,KACA,QACA,UACA,eACe;AACf,QAAM,EAAE,iBAAiB,gBAAgB,WAAW,IAAI;AAExD,QAAM,QAAQ,gBAAgB;AAC9B,QAAM,WAAW,gBAAgB,IAAI,CAAC,YAA2B,MAAuB;AAKtF,UAAM,MAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA,QAAQ,cAAc;AAAA,MACtB,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAIA,UAAM,YAAY,OAAO,IAAI,QAAQ,GAAG;AAExC,UAAM,EAAE,QAAQ,SAAS,OAAO,IAAI;AAGpC,QAAI,UAAW,QAAO,MAAM,IAAI,+BAAS,WAAW,MAAM,GAAG,QAAQ,QAAQ,KAAK;AAMlF,UAAM,gBACJ,YAAY,SAAY,UAAU,iBAAiB,eAAe,CAAC,IAAI;AACzE,UAAM,UAAU,WAAW,SAAY,SAAS,aAAa,WAAW,SAAS,CAAC,IAAI;AACtF,WAAO,eAAe,QAAQ,eAAe,OAAO;AAAA,EACtD,CAAC;AAED,SAAO,UAAU,KAAK,QAAQ;AAChC;;;AExFA,IAAAC,sBAA2C;AAS3C,IAAqB,YAArB,MAA+B;AAAA,EAU7B,YAAY,KAAiB,SAAkB;AAC7C,UAAM,MAAM,QAAQ,sBAAkB,kCAAa,GAAG,QAAI,kCAAa,GAAG;AAC1E,SAAK,UAAU,IAAI;AACnB,SAAK,OAAO,IAAI;AAChB,SAAK,WAAW,IAAI;AACpB,SAAK,QAAQ,IAAI;AACjB,SAAK,aAAa,IAAI;AACtB,SAAK,aAAa,IAAI;AAEtB,SAAK,UAAU,IAAI;AACnB,QAAI,CAAC,QAAQ,gBAAgB;AAC3B,WAAK,iBAAiB,IAAI;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,WAAmB;AACjB,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B;AACF;;;AHLe,SAAR,UACL,OACA,QACA,SACW;AACX,QAAM,OACJ,OAAO,YAAY,WAAW,UAAU,EAAE,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,MAAM;AAC9F,QAAM,OAAO,mBAAmB,OAAO,MAAM;AAC7C,SAAO,IAAI,UAAU,cAAc,IAAI,GAAG,IAAI;AAChD;", - "names": ["module", "module", "import_trace_mapping", "source", "import_gen_mapping"] -} diff --git a/frontend/node_modules/@jridgewell/remapping/package.json b/frontend/node_modules/@jridgewell/remapping/package.json deleted file mode 100644 index ed00441..0000000 --- a/frontend/node_modules/@jridgewell/remapping/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@jridgewell/remapping", - "version": "2.3.5", - "description": "Remap sequential sourcemaps through transformations to point at the original source code", - "keywords": [ - "source", - "map", - "remap" - ], - "main": "dist/remapping.umd.js", - "module": "dist/remapping.mjs", - "types": "types/remapping.d.cts", - "files": [ - "dist", - "src", - "types" - ], - "exports": { - ".": [ - { - "import": { - "types": "./types/remapping.d.mts", - "default": "./dist/remapping.mjs" - }, - "default": { - "types": "./types/remapping.d.cts", - "default": "./dist/remapping.umd.js" - } - }, - "./dist/remapping.umd.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "benchmark": "run-s build:code benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node --expose-gc benchmark/index.js", - "build": "run-s -n build:code build:types", - "build:code": "node ../../esbuild.mjs remapping.ts", - "build:types": "run-s build:types:force build:types:emit build:types:mts", - "build:types:force": "rimraf tsconfig.build.tsbuildinfo", - "build:types:emit": "tsc --project tsconfig.build.json", - "build:types:mts": "node ../../mts-types.mjs", - "clean": "run-s -n clean:code clean:types", - "clean:code": "tsc --build --clean tsconfig.build.json", - "clean:types": "rimraf dist types", - "test": "run-s -n test:types test:only test:format", - "test:format": "prettier --check '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:types": "eslint '{src,test}/**/*.ts'", - "lint": "run-s -n lint:types lint:format", - "lint:format": "npm run test:format -- --write", - "lint:types": "npm run test:types -- --fix", - "prepublishOnly": "npm run-s -n build test" - }, - "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/remapping", - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/sourcemaps.git", - "directory": "packages/remapping" - }, - "author": "Justin Ridgewell ", - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "devDependencies": { - "source-map": "0.6.1" - } -} diff --git a/frontend/node_modules/@jridgewell/remapping/src/build-source-map-tree.ts b/frontend/node_modules/@jridgewell/remapping/src/build-source-map-tree.ts deleted file mode 100644 index 3e0262b..0000000 --- a/frontend/node_modules/@jridgewell/remapping/src/build-source-map-tree.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { TraceMap } from '@jridgewell/trace-mapping'; - -import { OriginalSource, MapSource } from './source-map-tree'; - -import type { Sources, MapSource as MapSourceType } from './source-map-tree'; -import type { SourceMapInput, SourceMapLoader, LoaderContext } from './types'; - -function asArray(value: T | T[]): T[] { - if (Array.isArray(value)) return value; - return [value]; -} - -/** - * Recursively builds a tree structure out of sourcemap files, with each node - * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of - * `OriginalSource`s and `SourceMapTree`s. - * - * Every sourcemap is composed of a collection of source files and mappings - * into locations of those source files. When we generate a `SourceMapTree` for - * the sourcemap, we attempt to load each source file's own sourcemap. If it - * does not have an associated sourcemap, it is considered an original, - * unmodified source file. - */ -export default function buildSourceMapTree( - input: SourceMapInput | SourceMapInput[], - loader: SourceMapLoader, -): MapSourceType { - const maps = asArray(input).map((m) => new TraceMap(m, '')); - const map = maps.pop()!; - - for (let i = 0; i < maps.length; i++) { - if (maps[i].sources.length > 1) { - throw new Error( - `Transformation map ${i} must have exactly one source file.\n` + - 'Did you specify these with the most recent transformation maps first?', - ); - } - } - - let tree = build(map, loader, '', 0); - for (let i = maps.length - 1; i >= 0; i--) { - tree = MapSource(maps[i], [tree]); - } - return tree; -} - -function build( - map: TraceMap, - loader: SourceMapLoader, - importer: string, - importerDepth: number, -): MapSourceType { - const { resolvedSources, sourcesContent, ignoreList } = map; - - const depth = importerDepth + 1; - const children = resolvedSources.map((sourceFile: string | null, i: number): Sources => { - // The loading context gives the loader more information about why this file is being loaded - // (eg, from which importer). It also allows the loader to override the location of the loaded - // sourcemap/original source, or to override the content in the sourcesContent field if it's - // an unmodified source file. - const ctx: LoaderContext = { - importer, - depth, - source: sourceFile || '', - content: undefined, - ignore: undefined, - }; - - // Use the provided loader callback to retrieve the file's sourcemap. - // TODO: We should eventually support async loading of sourcemap files. - const sourceMap = loader(ctx.source, ctx); - - const { source, content, ignore } = ctx; - - // If there is a sourcemap, then we need to recurse into it to load its source files. - if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth); - - // Else, it's an unmodified source file. - // The contents of this unmodified source file can be overridden via the loader context, - // allowing it to be explicitly null or a string. If it remains undefined, we fall back to - // the importing sourcemap's `sourcesContent` field. - const sourceContent = - content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; - const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false; - return OriginalSource(source, sourceContent, ignored); - }); - - return MapSource(map, children); -} diff --git a/frontend/node_modules/@jridgewell/remapping/src/remapping.ts b/frontend/node_modules/@jridgewell/remapping/src/remapping.ts deleted file mode 100644 index c0f8b0d..0000000 --- a/frontend/node_modules/@jridgewell/remapping/src/remapping.ts +++ /dev/null @@ -1,42 +0,0 @@ -import buildSourceMapTree from './build-source-map-tree'; -import { traceMappings } from './source-map-tree'; -import SourceMap from './source-map'; - -import type { SourceMapInput, SourceMapLoader, Options } from './types'; -export type { - SourceMapSegment, - EncodedSourceMap, - EncodedSourceMap as RawSourceMap, - DecodedSourceMap, - SourceMapInput, - SourceMapLoader, - LoaderContext, - Options, -} from './types'; -export type { SourceMap }; - -/** - * Traces through all the mappings in the root sourcemap, through the sources - * (and their sourcemaps), all the way back to the original source location. - * - * `loader` will be called every time we encounter a source file. If it returns - * a sourcemap, we will recurse into that sourcemap to continue the trace. If - * it returns a falsey value, that source file is treated as an original, - * unmodified source file. - * - * Pass `excludeContent` to exclude any self-containing source file content - * from the output sourcemap. - * - * Pass `decodedMappings` to receive a SourceMap with decoded (instead of - * VLQ encoded) mappings. - */ -export default function remapping( - input: SourceMapInput | SourceMapInput[], - loader: SourceMapLoader, - options?: boolean | Options, -): SourceMap { - const opts = - typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false }; - const tree = buildSourceMapTree(input, loader); - return new SourceMap(traceMappings(tree), opts); -} diff --git a/frontend/node_modules/@jridgewell/remapping/src/source-map-tree.ts b/frontend/node_modules/@jridgewell/remapping/src/source-map-tree.ts deleted file mode 100644 index 935240f..0000000 --- a/frontend/node_modules/@jridgewell/remapping/src/source-map-tree.ts +++ /dev/null @@ -1,172 +0,0 @@ -import { GenMapping, maybeAddSegment, setIgnore, setSourceContent } from '@jridgewell/gen-mapping'; -import { traceSegment, decodedMappings } from '@jridgewell/trace-mapping'; - -import type { TraceMap } from '@jridgewell/trace-mapping'; - -export type SourceMapSegmentObject = { - column: number; - line: number; - name: string; - source: string; - content: string | null; - ignore: boolean; -}; - -export type OriginalSource = { - map: null; - sources: Sources[]; - source: string; - content: string | null; - ignore: boolean; -}; - -export type MapSource = { - map: TraceMap; - sources: Sources[]; - source: string; - content: null; - ignore: false; -}; - -export type Sources = OriginalSource | MapSource; - -const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false); -const EMPTY_SOURCES: Sources[] = []; - -function SegmentObject( - source: string, - line: number, - column: number, - name: string, - content: string | null, - ignore: boolean, -): SourceMapSegmentObject { - return { source, line, column, name, content, ignore }; -} - -function Source( - map: TraceMap, - sources: Sources[], - source: '', - content: null, - ignore: false, -): MapSource; -function Source( - map: null, - sources: Sources[], - source: string, - content: string | null, - ignore: boolean, -): OriginalSource; -function Source( - map: TraceMap | null, - sources: Sources[], - source: string | '', - content: string | null, - ignore: boolean, -): Sources { - return { - map, - sources, - source, - content, - ignore, - } as any; -} - -/** - * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes - * (which may themselves be SourceMapTrees). - */ -export function MapSource(map: TraceMap, sources: Sources[]): MapSource { - return Source(map, sources, '', null, false); -} - -/** - * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive - * segment tracing ends at the `OriginalSource`. - */ -export function OriginalSource( - source: string, - content: string | null, - ignore: boolean, -): OriginalSource { - return Source(null, EMPTY_SOURCES, source, content, ignore); -} - -/** - * traceMappings is only called on the root level SourceMapTree, and begins the process of - * resolving each mapping in terms of the original source files. - */ -export function traceMappings(tree: MapSource): GenMapping { - // TODO: Eventually support sourceRoot, which has to be removed because the sources are already - // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. - const gen = new GenMapping({ file: tree.map.file }); - const { sources: rootSources, map } = tree; - const rootNames = map.names; - const rootMappings = decodedMappings(map); - - for (let i = 0; i < rootMappings.length; i++) { - const segments = rootMappings[i]; - - for (let j = 0; j < segments.length; j++) { - const segment = segments[j]; - const genCol = segment[0]; - let traced: SourceMapSegmentObject | null = SOURCELESS_MAPPING; - - // 1-length segments only move the current generated column, there's no source information - // to gather from it. - if (segment.length !== 1) { - const source = rootSources[segment[1]]; - traced = originalPositionFor( - source, - segment[2], - segment[3], - segment.length === 5 ? rootNames[segment[4]] : '', - ); - - // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a - // respective segment into an original source. - if (traced == null) continue; - } - - const { column, line, name, content, source, ignore } = traced; - - maybeAddSegment(gen, i, genCol, source, line, column, name); - if (source && content != null) setSourceContent(gen, source, content); - if (ignore) setIgnore(gen, source, true); - } - } - - return gen; -} - -/** - * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own - * child SourceMapTrees, until we find the original source map. - */ -export function originalPositionFor( - source: Sources, - line: number, - column: number, - name: string, -): SourceMapSegmentObject | null { - if (!source.map) { - return SegmentObject(source.source, line, column, name, source.content, source.ignore); - } - - const segment = traceSegment(source.map, line, column); - - // If we couldn't find a segment, then this doesn't exist in the sourcemap. - if (segment == null) return null; - // 1-length segments only move the current generated column, there's no source information - // to gather from it. - if (segment.length === 1) return SOURCELESS_MAPPING; - - return originalPositionFor( - source.sources[segment[1]], - segment[2], - segment[3], - segment.length === 5 ? source.map.names[segment[4]] : name, - ); -} diff --git a/frontend/node_modules/@jridgewell/remapping/src/source-map.ts b/frontend/node_modules/@jridgewell/remapping/src/source-map.ts deleted file mode 100644 index 5156086..0000000 --- a/frontend/node_modules/@jridgewell/remapping/src/source-map.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping'; - -import type { GenMapping } from '@jridgewell/gen-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Options } from './types'; - -/** - * A SourceMap v3 compatible sourcemap, which only includes fields that were - * provided to it. - */ -export default class SourceMap { - declare file?: string | null; - declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; - declare sourceRoot?: string; - declare names: string[]; - declare sources: (string | null)[]; - declare sourcesContent?: (string | null)[]; - declare version: 3; - declare ignoreList: number[] | undefined; - - constructor(map: GenMapping, options: Options) { - const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); - this.version = out.version; // SourceMap spec says this should be first. - this.file = out.file; - this.mappings = out.mappings as SourceMap['mappings']; - this.names = out.names as SourceMap['names']; - this.ignoreList = out.ignoreList as SourceMap['ignoreList']; - this.sourceRoot = out.sourceRoot; - - this.sources = out.sources as SourceMap['sources']; - if (!options.excludeContent) { - this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent']; - } - } - - toString(): string { - return JSON.stringify(this); - } -} diff --git a/frontend/node_modules/@jridgewell/remapping/src/types.ts b/frontend/node_modules/@jridgewell/remapping/src/types.ts deleted file mode 100644 index 384961d..0000000 --- a/frontend/node_modules/@jridgewell/remapping/src/types.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; - -export type { - SourceMapSegment, - DecodedSourceMap, - EncodedSourceMap, -} from '@jridgewell/trace-mapping'; - -export type { SourceMapInput }; - -export type LoaderContext = { - readonly importer: string; - readonly depth: number; - source: string; - content: string | null | undefined; - ignore: boolean | undefined; -}; - -export type SourceMapLoader = ( - file: string, - ctx: LoaderContext, -) => SourceMapInput | null | undefined | void; - -export type Options = { - excludeContent?: boolean; - decodedMappings?: boolean; -}; diff --git a/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts b/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts deleted file mode 100644 index e089aea..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts +++ /dev/null @@ -1,15 +0,0 @@ -import type { MapSource as MapSourceType } from './source-map-tree.cts'; -import type { SourceMapInput, SourceMapLoader } from './types.cts'; -/** - * Recursively builds a tree structure out of sourcemap files, with each node - * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of - * `OriginalSource`s and `SourceMapTree`s. - * - * Every sourcemap is composed of a collection of source files and mappings - * into locations of those source files. When we generate a `SourceMapTree` for - * the sourcemap, we attempt to load each source file's own sourcemap. If it - * does not have an associated sourcemap, it is considered an original, - * unmodified source file. - */ -export = function buildSourceMapTree(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader): MapSourceType; -//# sourceMappingURL=build-source-map-tree.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts.map b/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts.map deleted file mode 100644 index 38e4290..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"build-source-map-tree.d.ts","sourceRoot":"","sources":["../src/build-source-map-tree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,SAAS,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAO9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,GACtB,aAAa,CAkBf"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts b/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts deleted file mode 100644 index 746ac5f..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts +++ /dev/null @@ -1,15 +0,0 @@ -import type { MapSource as MapSourceType } from './source-map-tree.mts'; -import type { SourceMapInput, SourceMapLoader } from './types.mts'; -/** - * Recursively builds a tree structure out of sourcemap files, with each node - * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of - * `OriginalSource`s and `SourceMapTree`s. - * - * Every sourcemap is composed of a collection of source files and mappings - * into locations of those source files. When we generate a `SourceMapTree` for - * the sourcemap, we attempt to load each source file's own sourcemap. If it - * does not have an associated sourcemap, it is considered an original, - * unmodified source file. - */ -export default function buildSourceMapTree(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader): MapSourceType; -//# sourceMappingURL=build-source-map-tree.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts.map b/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts.map deleted file mode 100644 index 38e4290..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"build-source-map-tree.d.ts","sourceRoot":"","sources":["../src/build-source-map-tree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,SAAS,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAO9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,GACtB,aAAa,CAkBf"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/remapping.d.cts b/frontend/node_modules/@jridgewell/remapping/types/remapping.d.cts deleted file mode 100644 index 2022784..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/remapping.d.cts +++ /dev/null @@ -1,21 +0,0 @@ -import SourceMap from './source-map.cts'; -import type { SourceMapInput, SourceMapLoader, Options } from './types.cts'; -export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types.cts'; -export type { SourceMap }; -/** - * Traces through all the mappings in the root sourcemap, through the sources - * (and their sourcemaps), all the way back to the original source location. - * - * `loader` will be called every time we encounter a source file. If it returns - * a sourcemap, we will recurse into that sourcemap to continue the trace. If - * it returns a falsey value, that source file is treated as an original, - * unmodified source file. - * - * Pass `excludeContent` to exclude any self-containing source file content - * from the output sourcemap. - * - * Pass `decodedMappings` to receive a SourceMap with decoded (instead of - * VLQ encoded) mappings. - */ -export = function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap; -//# sourceMappingURL=remapping.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/remapping.d.cts.map b/frontend/node_modules/@jridgewell/remapping/types/remapping.d.cts.map deleted file mode 100644 index 9f2fd0e..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/remapping.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"remapping.d.ts","sourceRoot":"","sources":["../src/remapping.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACxE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,IAAI,YAAY,EAChC,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAC1B,SAAS,CAKX"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/remapping.d.mts b/frontend/node_modules/@jridgewell/remapping/types/remapping.d.mts deleted file mode 100644 index 95c4066..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/remapping.d.mts +++ /dev/null @@ -1,21 +0,0 @@ -import SourceMap from './source-map.mts'; -import type { SourceMapInput, SourceMapLoader, Options } from './types.mts'; -export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types.mts'; -export type { SourceMap }; -/** - * Traces through all the mappings in the root sourcemap, through the sources - * (and their sourcemaps), all the way back to the original source location. - * - * `loader` will be called every time we encounter a source file. If it returns - * a sourcemap, we will recurse into that sourcemap to continue the trace. If - * it returns a falsey value, that source file is treated as an original, - * unmodified source file. - * - * Pass `excludeContent` to exclude any self-containing source file content - * from the output sourcemap. - * - * Pass `decodedMappings` to receive a SourceMap with decoded (instead of - * VLQ encoded) mappings. - */ -export default function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap; -//# sourceMappingURL=remapping.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/remapping.d.mts.map b/frontend/node_modules/@jridgewell/remapping/types/remapping.d.mts.map deleted file mode 100644 index 9f2fd0e..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/remapping.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"remapping.d.ts","sourceRoot":"","sources":["../src/remapping.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACxE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,IAAI,YAAY,EAChC,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAC1B,SAAS,CAKX"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts b/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts deleted file mode 100644 index 440f65b..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts +++ /dev/null @@ -1,46 +0,0 @@ -import { GenMapping } from '@jridgewell/gen-mapping'; -import type { TraceMap } from '@jridgewell/trace-mapping'; -export type SourceMapSegmentObject = { - column: number; - line: number; - name: string; - source: string; - content: string | null; - ignore: boolean; -}; -export type OriginalSource = { - map: null; - sources: Sources[]; - source: string; - content: string | null; - ignore: boolean; -}; -export type MapSource = { - map: TraceMap; - sources: Sources[]; - source: string; - content: null; - ignore: false; -}; -export type Sources = OriginalSource | MapSource; -/** - * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes - * (which may themselves be SourceMapTrees). - */ -export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource; -/** - * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive - * segment tracing ends at the `OriginalSource`. - */ -export declare function OriginalSource(source: string, content: string | null, ignore: boolean): OriginalSource; -/** - * traceMappings is only called on the root level SourceMapTree, and begins the process of - * resolving each mapping in terms of the original source files. - */ -export declare function traceMappings(tree: MapSource): GenMapping; -/** - * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own - * child SourceMapTrees, until we find the original source map. - */ -export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null; -//# sourceMappingURL=source-map-tree.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts.map b/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts.map deleted file mode 100644 index e7cbfb9..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"source-map-tree.d.ts","sourceRoot":"","sources":["../src/source-map-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgD,MAAM,yBAAyB,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AA8CjD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,CAEtE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,EAAE,OAAO,GACd,cAAc,CAEhB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAyCzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,sBAAsB,GAAG,IAAI,CAmB/B"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts b/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts deleted file mode 100644 index 440f65b..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts +++ /dev/null @@ -1,46 +0,0 @@ -import { GenMapping } from '@jridgewell/gen-mapping'; -import type { TraceMap } from '@jridgewell/trace-mapping'; -export type SourceMapSegmentObject = { - column: number; - line: number; - name: string; - source: string; - content: string | null; - ignore: boolean; -}; -export type OriginalSource = { - map: null; - sources: Sources[]; - source: string; - content: string | null; - ignore: boolean; -}; -export type MapSource = { - map: TraceMap; - sources: Sources[]; - source: string; - content: null; - ignore: false; -}; -export type Sources = OriginalSource | MapSource; -/** - * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes - * (which may themselves be SourceMapTrees). - */ -export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource; -/** - * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive - * segment tracing ends at the `OriginalSource`. - */ -export declare function OriginalSource(source: string, content: string | null, ignore: boolean): OriginalSource; -/** - * traceMappings is only called on the root level SourceMapTree, and begins the process of - * resolving each mapping in terms of the original source files. - */ -export declare function traceMappings(tree: MapSource): GenMapping; -/** - * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own - * child SourceMapTrees, until we find the original source map. - */ -export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null; -//# sourceMappingURL=source-map-tree.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts.map b/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts.map deleted file mode 100644 index e7cbfb9..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"source-map-tree.d.ts","sourceRoot":"","sources":["../src/source-map-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgD,MAAM,yBAAyB,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AA8CjD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,CAEtE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,EAAE,OAAO,GACd,cAAc,CAEhB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAyCzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,sBAAsB,GAAG,IAAI,CAmB/B"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/source-map.d.cts b/frontend/node_modules/@jridgewell/remapping/types/source-map.d.cts deleted file mode 100644 index fdb7eed..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/source-map.d.cts +++ /dev/null @@ -1,19 +0,0 @@ -import type { GenMapping } from '@jridgewell/gen-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Options } from './types.cts'; -/** - * A SourceMap v3 compatible sourcemap, which only includes fields that were - * provided to it. - */ -export = class SourceMap { - file?: string | null; - mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; - sourceRoot?: string; - names: string[]; - sources: (string | null)[]; - sourcesContent?: (string | null)[]; - version: 3; - ignoreList: number[] | undefined; - constructor(map: GenMapping, options: Options); - toString(): string; -} -//# sourceMappingURL=source-map.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/source-map.d.cts.map b/frontend/node_modules/@jridgewell/remapping/types/source-map.d.cts.map deleted file mode 100644 index 593daf8..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/source-map.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"source-map.d.ts","sourceRoot":"","sources":["../src/source-map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;gBAE7B,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;IAe7C,QAAQ,IAAI,MAAM;CAGnB"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/source-map.d.mts b/frontend/node_modules/@jridgewell/remapping/types/source-map.d.mts deleted file mode 100644 index 52ebba2..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/source-map.d.mts +++ /dev/null @@ -1,19 +0,0 @@ -import type { GenMapping } from '@jridgewell/gen-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Options } from './types.mts'; -/** - * A SourceMap v3 compatible sourcemap, which only includes fields that were - * provided to it. - */ -export default class SourceMap { - file?: string | null; - mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; - sourceRoot?: string; - names: string[]; - sources: (string | null)[]; - sourcesContent?: (string | null)[]; - version: 3; - ignoreList: number[] | undefined; - constructor(map: GenMapping, options: Options); - toString(): string; -} -//# sourceMappingURL=source-map.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/source-map.d.mts.map b/frontend/node_modules/@jridgewell/remapping/types/source-map.d.mts.map deleted file mode 100644 index 593daf8..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/source-map.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"source-map.d.ts","sourceRoot":"","sources":["../src/source-map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;gBAE7B,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;IAe7C,QAAQ,IAAI,MAAM;CAGnB"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/types.d.cts b/frontend/node_modules/@jridgewell/remapping/types/types.d.cts deleted file mode 100644 index eeb320f..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/types.d.cts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping'; -export type { SourceMapInput }; -export type LoaderContext = { - readonly importer: string; - readonly depth: number; - source: string; - content: string | null | undefined; - ignore: boolean | undefined; -}; -export type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void; -export type Options = { - excludeContent?: boolean; - decodedMappings?: boolean; -}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/types.d.cts.map b/frontend/node_modules/@jridgewell/remapping/types/types.d.cts.map deleted file mode 100644 index 4f8647e..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/types.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,aAAa,KACf,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/types.d.mts b/frontend/node_modules/@jridgewell/remapping/types/types.d.mts deleted file mode 100644 index eeb320f..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/types.d.mts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping'; -export type { SourceMapInput }; -export type LoaderContext = { - readonly importer: string; - readonly depth: number; - source: string; - content: string | null | undefined; - ignore: boolean | undefined; -}; -export type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void; -export type Options = { - excludeContent?: boolean; - decodedMappings?: boolean; -}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/remapping/types/types.d.mts.map b/frontend/node_modules/@jridgewell/remapping/types/types.d.mts.map deleted file mode 100644 index 4f8647e..0000000 --- a/frontend/node_modules/@jridgewell/remapping/types/types.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,aAAa,KACf,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/resolve-uri/LICENSE b/frontend/node_modules/@jridgewell/resolve-uri/LICENSE deleted file mode 100644 index 0a81b2a..0000000 --- a/frontend/node_modules/@jridgewell/resolve-uri/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2019 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/resolve-uri/README.md b/frontend/node_modules/@jridgewell/resolve-uri/README.md deleted file mode 100644 index 2fe70df..0000000 --- a/frontend/node_modules/@jridgewell/resolve-uri/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# @jridgewell/resolve-uri - -> Resolve a URI relative to an optional base URI - -Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths. - -## Installation - -```sh -npm install @jridgewell/resolve-uri -``` - -## Usage - -```typescript -function resolve(input: string, base?: string): string; -``` - -```js -import resolve from '@jridgewell/resolve-uri'; - -resolve('foo', 'https://example.com'); // => 'https://example.com/foo' -``` - -| Input | Base | Resolution | Explanation | -|-----------------------|-------------------------|--------------------------------|--------------------------------------------------------------| -| `https://example.com` | _any_ | `https://example.com/` | Input is normalized only | -| `//example.com` | `https://base.com/` | `https://example.com/` | Input inherits the base's protocol | -| `//example.com` | _rest_ | `//example.com/` | Input is normalized only | -| `/example` | `https://base.com/` | `https://base.com/example` | Input inherits the base's origin | -| `/example` | `//base.com/` | `//base.com/example` | Input inherits the base's host and remains protocol relative | -| `/example` | _rest_ | `/example` | Input is normalized only | -| `example` | `https://base.com/dir/` | `https://base.com/dir/example` | Input is joined with the base | -| `example` | `https://base.com/file` | `https://base.com/example` | Input is joined with the base without its file | -| `example` | `//base.com/dir/` | `//base.com/dir/example` | Input is joined with the base's last directory | -| `example` | `//base.com/file` | `//base.com/example` | Input is joined with the base without its file | -| `example` | `/base/dir/` | `/base/dir/example` | Input is joined with the base's last directory | -| `example` | `/base/file` | `/base/example` | Input is joined with the base without its file | -| `example` | `base/dir/` | `base/dir/example` | Input is joined with the base's last directory | -| `example` | `base/file` | `base/example` | Input is joined with the base without its file | diff --git a/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs b/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs deleted file mode 100644 index e958e88..0000000 --- a/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +++ /dev/null @@ -1,232 +0,0 @@ -// Matches the scheme of a URL, eg "http://" -const schemeRegex = /^[\w+.-]+:\/\//; -/** - * Matches the parts of a URL: - * 1. Scheme, including ":", guaranteed. - * 2. User/password, including "@", optional. - * 3. Host, guaranteed. - * 4. Port, including ":", optional. - * 5. Path, including "/", optional. - * 6. Query, including "?", optional. - * 7. Hash, including "#", optional. - */ -const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; -/** - * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start - * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). - * - * 1. Host, optional. - * 2. Path, which may include "/", guaranteed. - * 3. Query, including "?", optional. - * 4. Hash, including "#", optional. - */ -const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; -function isAbsoluteUrl(input) { - return schemeRegex.test(input); -} -function isSchemeRelativeUrl(input) { - return input.startsWith('//'); -} -function isAbsolutePath(input) { - return input.startsWith('/'); -} -function isFileUrl(input) { - return input.startsWith('file:'); -} -function isRelative(input) { - return /^[.?#]/.test(input); -} -function parseAbsoluteUrl(input) { - const match = urlRegex.exec(input); - return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); -} -function parseFileUrl(input) { - const match = fileRegex.exec(input); - const path = match[2]; - return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); -} -function makeUrl(scheme, user, host, port, path, query, hash) { - return { - scheme, - user, - host, - port, - path, - query, - hash, - type: 7 /* Absolute */, - }; -} -function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - url.type = 6 /* SchemeRelative */; - return url; - } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); - url.scheme = ''; - url.host = ''; - url.type = 5 /* AbsolutePath */; - return url; - } - if (isFileUrl(input)) - return parseFileUrl(input); - if (isAbsoluteUrl(input)) - return parseAbsoluteUrl(input); - const url = parseAbsoluteUrl('http://foo.com/' + input); - url.scheme = ''; - url.host = ''; - url.type = input - ? input.startsWith('?') - ? 3 /* Query */ - : input.startsWith('#') - ? 2 /* Hash */ - : 4 /* RelativePath */ - : 1 /* Empty */; - return url; -} -function stripPathFilename(path) { - // If a path ends with a parent directory "..", then it's a relative path with excess parent - // paths. It's not a file, so we can't strip it. - if (path.endsWith('/..')) - return path; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); -} -function mergePaths(url, base) { - normalizePath(base, base.type); - // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative - // path). - if (url.path === '/') { - url.path = base.path; - } - else { - // Resolution happens relative to the base path's directory, not the file. - url.path = stripPathFilename(base.path) + url.path; - } -} -/** - * The path can have empty directories "//", unneeded parents "foo/..", or current directory - * "foo/.". We need to normalize to a standard representation. - */ -function normalizePath(url, type) { - const rel = type <= 4 /* RelativePath */; - const pieces = url.path.split('/'); - // We need to preserve the first piece always, so that we output a leading slash. The item at - // pieces[0] is an empty string. - let pointer = 1; - // Positive is the number of real directories we've output, used for popping a parent directory. - // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". - let positive = 0; - // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will - // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a - // real directory, we won't need to append, unless the other conditions happen again. - let addTrailingSlash = false; - for (let i = 1; i < pieces.length; i++) { - const piece = pieces[i]; - // An empty directory, could be a trailing slash, or just a double "//" in the path. - if (!piece) { - addTrailingSlash = true; - continue; - } - // If we encounter a real directory, then we don't need to append anymore. - addTrailingSlash = false; - // A current directory, which we can always drop. - if (piece === '.') - continue; - // A parent directory, we need to see if there are any real directories we can pop. Else, we - // have an excess of parents, and we'll need to keep the "..". - if (piece === '..') { - if (positive) { - addTrailingSlash = true; - positive--; - pointer--; - } - else if (rel) { - // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute - // URL, protocol relative URL, or an absolute path, we don't need to keep excess. - pieces[pointer++] = piece; - } - continue; - } - // We've encountered a real directory. Move it to the next insertion pointer, which accounts for - // any popped or dropped directories. - pieces[pointer++] = piece; - positive++; - } - let path = ''; - for (let i = 1; i < pointer; i++) { - path += '/' + pieces[i]; - } - if (!path || (addTrailingSlash && !path.endsWith('/..'))) { - path += '/'; - } - url.path = path; -} -/** - * Attempts to resolve `input` URL/path relative to `base`. - */ -function resolve(input, base) { - if (!input && !base) - return ''; - const url = parseUrl(input); - let inputType = url.type; - if (base && inputType !== 7 /* Absolute */) { - const baseUrl = parseUrl(base); - const baseType = baseUrl.type; - switch (inputType) { - case 1 /* Empty */: - url.hash = baseUrl.hash; - // fall through - case 2 /* Hash */: - url.query = baseUrl.query; - // fall through - case 3 /* Query */: - case 4 /* RelativePath */: - mergePaths(url, baseUrl); - // fall through - case 5 /* AbsolutePath */: - // The host, user, and port are joined, you can't copy one without the others. - url.user = baseUrl.user; - url.host = baseUrl.host; - url.port = baseUrl.port; - // fall through - case 6 /* SchemeRelative */: - // The input doesn't have a schema at least, so we need to copy at least that over. - url.scheme = baseUrl.scheme; - } - if (baseType > inputType) - inputType = baseType; - } - normalizePath(url, inputType); - const queryHash = url.query + url.hash; - switch (inputType) { - // This is impossible, because of the empty checks at the start of the function. - // case UrlType.Empty: - case 2 /* Hash */: - case 3 /* Query */: - return queryHash; - case 4 /* RelativePath */: { - // The first char is always a "/", and we need it to be relative. - const path = url.path.slice(1); - if (!path) - return queryHash || '.'; - if (isRelative(base || input) && !isRelative(path)) { - // If base started with a leading ".", or there is no base and input started with a ".", - // then we need to ensure that the relative path starts with a ".". We don't know if - // relative starts with a "..", though, so check before prepending. - return './' + path + queryHash; - } - return path + queryHash; - } - case 5 /* AbsolutePath */: - return url.path + queryHash; - default: - return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; - } -} - -export { resolve as default }; -//# sourceMappingURL=resolve-uri.mjs.map diff --git a/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map b/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map deleted file mode 100644 index 1de97d0..0000000 --- a/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-uri.mjs","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nconst enum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":"AAAA;AACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;;;;;;;;AAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;AAE5F;;;;;;;;;AASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;AAuBpF,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;IACpC,OAAO,OAAO,CACZ,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,EACf,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;IACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACtB,OAAO,OAAO,CACZ,OAAO,EACP,EAAE,EACF,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,EAAE,EACF,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,EACxC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CACd,MAAc,EACd,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,KAAa,EACb,IAAY;IAEZ,OAAO;QACL,MAAM;QACN,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,IAAI;QACJ,IAAI;KACL,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa;IAC7B,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;QAC9B,MAAM,GAAG,GAAG,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;QAC9C,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,0BAA0B;QAClC,OAAO,GAAG,CAAC;KACZ;IAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE;QACzB,MAAM,GAAG,GAAG,gBAAgB,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;QACvD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;QACd,GAAG,CAAC,IAAI,wBAAwB;QAChC,OAAO,GAAG,CAAC;KACZ;IAED,IAAI,SAAS,CAAC,KAAK,CAAC;QAAE,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjD,IAAI,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAEzD,MAAM,GAAG,GAAG,gBAAgB,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;IACxD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IACd,GAAG,CAAC,IAAI,GAAG,KAAK;UACZ,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;cAEnB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;;wBAGT;IAClB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;;;IAGrC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,UAAU,CAAC,GAAQ,EAAE,IAAS;IACrC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;;IAI/B,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE;QACpB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;KACtB;SAAM;;QAEL,GAAG,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC;KACpD;AACH,CAAC;AAED;;;;AAIA,SAAS,aAAa,CAAC,GAAQ,EAAE,IAAa;IAC5C,MAAM,GAAG,GAAG,IAAI,yBAAyB;IACzC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;;;IAInC,IAAI,OAAO,GAAG,CAAC,CAAC;;;IAIhB,IAAI,QAAQ,GAAG,CAAC,CAAC;;;;IAKjB,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;;QAGxB,IAAI,CAAC,KAAK,EAAE;YACV,gBAAgB,GAAG,IAAI,CAAC;YACxB,SAAS;SACV;;QAGD,gBAAgB,GAAG,KAAK,CAAC;;QAGzB,IAAI,KAAK,KAAK,GAAG;YAAE,SAAS;;;QAI5B,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,IAAI,QAAQ,EAAE;gBACZ,gBAAgB,GAAG,IAAI,CAAC;gBACxB,QAAQ,EAAE,CAAC;gBACX,OAAO,EAAE,CAAC;aACX;iBAAM,IAAI,GAAG,EAAE;;;gBAGd,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;aAC3B;YACD,SAAS;SACV;;;QAID,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;QAC1B,QAAQ,EAAE,CAAC;KACZ;IAED,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE;QAChC,IAAI,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;KACzB;IACD,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;QACxD,IAAI,IAAI,GAAG,CAAC;KACb;IACD,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;AAClB,CAAC;AAED;;;SAGwB,OAAO,CAAC,KAAa,EAAE,IAAwB;IACrE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC;IAEzB,IAAI,IAAI,IAAI,SAAS,uBAAuB;QAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;QAE9B,QAAQ,SAAS;YACf;gBACE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;YAG1B;gBACE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;;YAG5B,mBAAmB;YACnB;gBACE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;;YAG3B;;gBAEE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;YAG1B;;gBAEE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;SAC/B;QACD,IAAI,QAAQ,GAAG,SAAS;YAAE,SAAS,GAAG,QAAQ,CAAC;KAChD;IAED,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAE9B,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC;IACvC,QAAQ,SAAS;;;QAIf,kBAAkB;QAClB;YACE,OAAO,SAAS,CAAC;QAEnB,2BAA2B;;YAEzB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,CAAC,IAAI;gBAAE,OAAO,SAAS,IAAI,GAAG,CAAC;YAEnC,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;;;;gBAIlD,OAAO,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;aAChC;YAED,OAAO,IAAI,GAAG,SAAS,CAAC;SACzB;QAED;YACE,OAAO,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;QAE9B;YACE,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;KACpF;AACH;;;;"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js b/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js deleted file mode 100644 index a783049..0000000 --- a/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +++ /dev/null @@ -1,240 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory()); -})(this, (function () { 'use strict'; - - // Matches the scheme of a URL, eg "http://" - const schemeRegex = /^[\w+.-]+:\/\//; - /** - * Matches the parts of a URL: - * 1. Scheme, including ":", guaranteed. - * 2. User/password, including "@", optional. - * 3. Host, guaranteed. - * 4. Port, including ":", optional. - * 5. Path, including "/", optional. - * 6. Query, including "?", optional. - * 7. Hash, including "#", optional. - */ - const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; - /** - * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start - * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). - * - * 1. Host, optional. - * 2. Path, which may include "/", guaranteed. - * 3. Query, including "?", optional. - * 4. Hash, including "#", optional. - */ - const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; - function isAbsoluteUrl(input) { - return schemeRegex.test(input); - } - function isSchemeRelativeUrl(input) { - return input.startsWith('//'); - } - function isAbsolutePath(input) { - return input.startsWith('/'); - } - function isFileUrl(input) { - return input.startsWith('file:'); - } - function isRelative(input) { - return /^[.?#]/.test(input); - } - function parseAbsoluteUrl(input) { - const match = urlRegex.exec(input); - return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); - } - function parseFileUrl(input) { - const match = fileRegex.exec(input); - const path = match[2]; - return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); - } - function makeUrl(scheme, user, host, port, path, query, hash) { - return { - scheme, - user, - host, - port, - path, - query, - hash, - type: 7 /* Absolute */, - }; - } - function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - url.type = 6 /* SchemeRelative */; - return url; - } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); - url.scheme = ''; - url.host = ''; - url.type = 5 /* AbsolutePath */; - return url; - } - if (isFileUrl(input)) - return parseFileUrl(input); - if (isAbsoluteUrl(input)) - return parseAbsoluteUrl(input); - const url = parseAbsoluteUrl('http://foo.com/' + input); - url.scheme = ''; - url.host = ''; - url.type = input - ? input.startsWith('?') - ? 3 /* Query */ - : input.startsWith('#') - ? 2 /* Hash */ - : 4 /* RelativePath */ - : 1 /* Empty */; - return url; - } - function stripPathFilename(path) { - // If a path ends with a parent directory "..", then it's a relative path with excess parent - // paths. It's not a file, so we can't strip it. - if (path.endsWith('/..')) - return path; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); - } - function mergePaths(url, base) { - normalizePath(base, base.type); - // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative - // path). - if (url.path === '/') { - url.path = base.path; - } - else { - // Resolution happens relative to the base path's directory, not the file. - url.path = stripPathFilename(base.path) + url.path; - } - } - /** - * The path can have empty directories "//", unneeded parents "foo/..", or current directory - * "foo/.". We need to normalize to a standard representation. - */ - function normalizePath(url, type) { - const rel = type <= 4 /* RelativePath */; - const pieces = url.path.split('/'); - // We need to preserve the first piece always, so that we output a leading slash. The item at - // pieces[0] is an empty string. - let pointer = 1; - // Positive is the number of real directories we've output, used for popping a parent directory. - // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". - let positive = 0; - // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will - // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a - // real directory, we won't need to append, unless the other conditions happen again. - let addTrailingSlash = false; - for (let i = 1; i < pieces.length; i++) { - const piece = pieces[i]; - // An empty directory, could be a trailing slash, or just a double "//" in the path. - if (!piece) { - addTrailingSlash = true; - continue; - } - // If we encounter a real directory, then we don't need to append anymore. - addTrailingSlash = false; - // A current directory, which we can always drop. - if (piece === '.') - continue; - // A parent directory, we need to see if there are any real directories we can pop. Else, we - // have an excess of parents, and we'll need to keep the "..". - if (piece === '..') { - if (positive) { - addTrailingSlash = true; - positive--; - pointer--; - } - else if (rel) { - // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute - // URL, protocol relative URL, or an absolute path, we don't need to keep excess. - pieces[pointer++] = piece; - } - continue; - } - // We've encountered a real directory. Move it to the next insertion pointer, which accounts for - // any popped or dropped directories. - pieces[pointer++] = piece; - positive++; - } - let path = ''; - for (let i = 1; i < pointer; i++) { - path += '/' + pieces[i]; - } - if (!path || (addTrailingSlash && !path.endsWith('/..'))) { - path += '/'; - } - url.path = path; - } - /** - * Attempts to resolve `input` URL/path relative to `base`. - */ - function resolve(input, base) { - if (!input && !base) - return ''; - const url = parseUrl(input); - let inputType = url.type; - if (base && inputType !== 7 /* Absolute */) { - const baseUrl = parseUrl(base); - const baseType = baseUrl.type; - switch (inputType) { - case 1 /* Empty */: - url.hash = baseUrl.hash; - // fall through - case 2 /* Hash */: - url.query = baseUrl.query; - // fall through - case 3 /* Query */: - case 4 /* RelativePath */: - mergePaths(url, baseUrl); - // fall through - case 5 /* AbsolutePath */: - // The host, user, and port are joined, you can't copy one without the others. - url.user = baseUrl.user; - url.host = baseUrl.host; - url.port = baseUrl.port; - // fall through - case 6 /* SchemeRelative */: - // The input doesn't have a schema at least, so we need to copy at least that over. - url.scheme = baseUrl.scheme; - } - if (baseType > inputType) - inputType = baseType; - } - normalizePath(url, inputType); - const queryHash = url.query + url.hash; - switch (inputType) { - // This is impossible, because of the empty checks at the start of the function. - // case UrlType.Empty: - case 2 /* Hash */: - case 3 /* Query */: - return queryHash; - case 4 /* RelativePath */: { - // The first char is always a "/", and we need it to be relative. - const path = url.path.slice(1); - if (!path) - return queryHash || '.'; - if (isRelative(base || input) && !isRelative(path)) { - // If base started with a leading ".", or there is no base and input started with a ".", - // then we need to ensure that the relative path starts with a ".". We don't know if - // relative starts with a "..", though, so check before prepending. - return './' + path + queryHash; - } - return path + queryHash; - } - case 5 /* AbsolutePath */: - return url.path + queryHash; - default: - return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; - } - } - - return resolve; - -})); -//# sourceMappingURL=resolve-uri.umd.js.map diff --git a/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map b/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map deleted file mode 100644 index 70a37f2..0000000 --- a/frontend/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve-uri.umd.js","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nconst enum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":";;;;;;IAAA;IACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAErC;;;;;;;;;;IAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;IAE5F;;;;;;;;;IASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;IAuBpF,SAAS,aAAa,CAAC,KAAa;QAClC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,SAAS,mBAAmB,CAAC,KAAa;QACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,SAAS,cAAc,CAAC,KAAa;QACnC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED,SAAS,SAAS,CAAC,KAAa;QAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,SAAS,UAAU,CAAC,KAAa;QAC/B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,SAAS,gBAAgB,CAAC,KAAa;QACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;QACpC,OAAO,OAAO,CACZ,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,EACf,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;IACJ,CAAC;IAED,SAAS,YAAY,CAAC,KAAa;QACjC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,OAAO,OAAO,CACZ,OAAO,EACP,EAAE,EACF,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,EAAE,EACF,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,EACxC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;IACJ,CAAC;IAED,SAAS,OAAO,CACd,MAAc,EACd,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,KAAa,EACb,IAAY;QAEZ,OAAO;YACL,MAAM;YACN,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,KAAK;YACL,IAAI;YACJ,IAAI;SACL,CAAC;IACJ,CAAC;IAED,SAAS,QAAQ,CAAC,KAAa;QAC7B,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;YAC9B,MAAM,GAAG,GAAG,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;YAC9C,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,0BAA0B;YAClC,OAAO,GAAG,CAAC;SACZ;QAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE;YACzB,MAAM,GAAG,GAAG,gBAAgB,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;YACvD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,IAAI,wBAAwB;YAChC,OAAO,GAAG,CAAC;SACZ;QAED,IAAI,SAAS,CAAC,KAAK,CAAC;YAAE,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,aAAa,CAAC,KAAK,CAAC;YAAE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAEzD,MAAM,GAAG,GAAG,gBAAgB,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;QACxD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;QACd,GAAG,CAAC,IAAI,GAAG,KAAK;cACZ,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;kBAEnB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;;4BAGT;QAClB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,SAAS,iBAAiB,CAAC,IAAY;;;QAGrC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,SAAS,UAAU,CAAC,GAAQ,EAAE,IAAS;QACrC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;;QAI/B,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE;YACpB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACtB;aAAM;;YAEL,GAAG,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC;SACpD;IACH,CAAC;IAED;;;;IAIA,SAAS,aAAa,CAAC,GAAQ,EAAE,IAAa;QAC5C,MAAM,GAAG,GAAG,IAAI,yBAAyB;QACzC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;;;QAInC,IAAI,OAAO,GAAG,CAAC,CAAC;;;QAIhB,IAAI,QAAQ,GAAG,CAAC,CAAC;;;;QAKjB,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;;YAGxB,IAAI,CAAC,KAAK,EAAE;gBACV,gBAAgB,GAAG,IAAI,CAAC;gBACxB,SAAS;aACV;;YAGD,gBAAgB,GAAG,KAAK,CAAC;;YAGzB,IAAI,KAAK,KAAK,GAAG;gBAAE,SAAS;;;YAI5B,IAAI,KAAK,KAAK,IAAI,EAAE;gBAClB,IAAI,QAAQ,EAAE;oBACZ,gBAAgB,GAAG,IAAI,CAAC;oBACxB,QAAQ,EAAE,CAAC;oBACX,OAAO,EAAE,CAAC;iBACX;qBAAM,IAAI,GAAG,EAAE;;;oBAGd,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;iBAC3B;gBACD,SAAS;aACV;;;YAID,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;YAC1B,QAAQ,EAAE,CAAC;SACZ;QAED,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE;YAChC,IAAI,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;SACzB;QACD,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;YACxD,IAAI,IAAI,GAAG,CAAC;SACb;QACD,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAED;;;aAGwB,OAAO,CAAC,KAAa,EAAE,IAAwB;QACrE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QAE/B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC;QAEzB,IAAI,IAAI,IAAI,SAAS,uBAAuB;YAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;YAE9B,QAAQ,SAAS;gBACf;oBACE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;gBAG1B;oBACE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;;gBAG5B,mBAAmB;gBACnB;oBACE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;;gBAG3B;;oBAEE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;oBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;oBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;gBAG1B;;oBAEE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;aAC/B;YACD,IAAI,QAAQ,GAAG,SAAS;gBAAE,SAAS,GAAG,QAAQ,CAAC;SAChD;QAED,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAE9B,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC;QACvC,QAAQ,SAAS;;;YAIf,kBAAkB;YAClB;gBACE,OAAO,SAAS,CAAC;YAEnB,2BAA2B;;gBAEzB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAE/B,IAAI,CAAC,IAAI;oBAAE,OAAO,SAAS,IAAI,GAAG,CAAC;gBAEnC,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;;;;oBAIlD,OAAO,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;iBAChC;gBAED,OAAO,IAAI,GAAG,SAAS,CAAC;aACzB;YAED;gBACE,OAAO,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;YAE9B;gBACE,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;SACpF;IACH;;;;;;;;"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts b/frontend/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts deleted file mode 100644 index b7f0b3b..0000000 --- a/frontend/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Attempts to resolve `input` URL/path relative to `base`. - */ -export default function resolve(input: string, base: string | undefined): string; diff --git a/frontend/node_modules/@jridgewell/resolve-uri/package.json b/frontend/node_modules/@jridgewell/resolve-uri/package.json deleted file mode 100644 index 02a4c51..0000000 --- a/frontend/node_modules/@jridgewell/resolve-uri/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@jridgewell/resolve-uri", - "version": "3.1.2", - "description": "Resolve a URI relative to an optional base URI", - "keywords": [ - "resolve", - "uri", - "url", - "path" - ], - "author": "Justin Ridgewell ", - "license": "MIT", - "repository": "https://github.com/jridgewell/resolve-uri", - "main": "dist/resolve-uri.umd.js", - "module": "dist/resolve-uri.mjs", - "types": "dist/types/resolve-uri.d.ts", - "exports": { - ".": [ - { - "types": "./dist/types/resolve-uri.d.ts", - "browser": "./dist/resolve-uri.umd.js", - "require": "./dist/resolve-uri.umd.js", - "import": "./dist/resolve-uri.mjs" - }, - "./dist/resolve-uri.umd.js" - ], - "./package.json": "./package.json" - }, - "files": [ - "dist" - ], - "engines": { - "node": ">=6.0.0" - }, - "scripts": { - "prebuild": "rm -rf dist", - "build": "run-s -n build:*", - "build:rollup": "rollup -c rollup.config.js", - "build:ts": "tsc --project tsconfig.build.json", - "lint": "run-s -n lint:*", - "lint:prettier": "npm run test:lint:prettier -- --write", - "lint:ts": "npm run test:lint:ts -- --fix", - "pretest": "run-s build:rollup", - "test": "run-s -n test:lint test:only", - "test:debug": "mocha --inspect-brk", - "test:lint": "run-s -n test:lint:*", - "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", - "test:lint:ts": "eslint '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:coverage": "c8 mocha", - "test:watch": "mocha --watch", - "prepublishOnly": "npm run preversion", - "preversion": "run-s test build" - }, - "devDependencies": { - "@jridgewell/resolve-uri-latest": "npm:@jridgewell/resolve-uri@*", - "@rollup/plugin-typescript": "8.3.0", - "@typescript-eslint/eslint-plugin": "5.10.0", - "@typescript-eslint/parser": "5.10.0", - "c8": "7.11.0", - "eslint": "8.7.0", - "eslint-config-prettier": "8.3.0", - "mocha": "9.2.0", - "npm-run-all": "4.1.5", - "prettier": "2.5.1", - "rollup": "2.66.0", - "typescript": "4.5.5" - } -} diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/LICENSE b/frontend/node_modules/@jridgewell/sourcemap-codec/LICENSE deleted file mode 100644 index 1f6ce94..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2024 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/README.md b/frontend/node_modules/@jridgewell/sourcemap-codec/README.md deleted file mode 100644 index b3e0708..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/README.md +++ /dev/null @@ -1,264 +0,0 @@ -# @jridgewell/sourcemap-codec - -Encode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). - - -## Why? - -Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap. - -This package makes the process slightly easier. - - -## Installation - -```bash -npm install @jridgewell/sourcemap-codec -``` - - -## Usage - -```js -import { encode, decode } from '@jridgewell/sourcemap-codec'; - -var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); - -assert.deepEqual( decoded, [ - // the first line (of the generated code) has no mappings, - // as shown by the starting semi-colon (which separates lines) - [], - - // the second line contains four (comma-separated) segments - [ - // segments are encoded as you'd expect: - // [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ] - - // i.e. the first segment begins at column 2, and maps back to the second column - // of the second line (both zero-based) of the 0th source, and uses the 0th - // name in the `map.names` array - [ 2, 0, 2, 2, 0 ], - - // the remaining segments are 4-length rather than 5-length, - // because they don't map a name - [ 4, 0, 2, 4 ], - [ 6, 0, 2, 5 ], - [ 7, 0, 2, 7 ] - ], - - // the final line contains two segments - [ - [ 2, 1, 10, 19 ], - [ 12, 1, 11, 20 ] - ] -]); - -var encoded = encode( decoded ); -assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); -``` - -## Benchmarks - -``` -node v20.10.0 - -amp.js.map - 45120 segments - -Decode Memory Usage: -local code 5815135 bytes -@jridgewell/sourcemap-codec 1.4.15 5868160 bytes -sourcemap-codec 5492584 bytes -source-map-0.6.1 13569984 bytes -source-map-0.8.0 6390584 bytes -chrome dev tools 8011136 bytes -Smallest memory usage is sourcemap-codec - -Decode speed: -decode: local code x 492 ops/sec ±1.22% (90 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 499 ops/sec ±1.16% (89 runs sampled) -decode: sourcemap-codec x 376 ops/sec ±1.66% (89 runs sampled) -decode: source-map-0.6.1 x 34.99 ops/sec ±0.94% (48 runs sampled) -decode: source-map-0.8.0 x 351 ops/sec ±0.07% (95 runs sampled) -chrome dev tools x 165 ops/sec ±0.91% (86 runs sampled) -Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 - -Encode Memory Usage: -local code 444248 bytes -@jridgewell/sourcemap-codec 1.4.15 623024 bytes -sourcemap-codec 8696280 bytes -source-map-0.6.1 8745176 bytes -source-map-0.8.0 8736624 bytes -Smallest memory usage is local code - -Encode speed: -encode: local code x 796 ops/sec ±0.11% (97 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 795 ops/sec ±0.25% (98 runs sampled) -encode: sourcemap-codec x 231 ops/sec ±0.83% (86 runs sampled) -encode: source-map-0.6.1 x 166 ops/sec ±0.57% (86 runs sampled) -encode: source-map-0.8.0 x 203 ops/sec ±0.45% (88 runs sampled) -Fastest is encode: local code,encode: @jridgewell/sourcemap-codec 1.4.15 - - -*** - - -babel.min.js.map - 347793 segments - -Decode Memory Usage: -local code 35424960 bytes -@jridgewell/sourcemap-codec 1.4.15 35424696 bytes -sourcemap-codec 36033464 bytes -source-map-0.6.1 62253704 bytes -source-map-0.8.0 43843920 bytes -chrome dev tools 45111400 bytes -Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 - -Decode speed: -decode: local code x 38.18 ops/sec ±5.44% (52 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 38.36 ops/sec ±5.02% (52 runs sampled) -decode: sourcemap-codec x 34.05 ops/sec ±4.45% (47 runs sampled) -decode: source-map-0.6.1 x 4.31 ops/sec ±2.76% (15 runs sampled) -decode: source-map-0.8.0 x 55.60 ops/sec ±0.13% (73 runs sampled) -chrome dev tools x 16.94 ops/sec ±3.78% (46 runs sampled) -Fastest is decode: source-map-0.8.0 - -Encode Memory Usage: -local code 2606016 bytes -@jridgewell/sourcemap-codec 1.4.15 2626440 bytes -sourcemap-codec 21152576 bytes -source-map-0.6.1 25023928 bytes -source-map-0.8.0 25256448 bytes -Smallest memory usage is local code - -Encode speed: -encode: local code x 127 ops/sec ±0.18% (83 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 128 ops/sec ±0.26% (83 runs sampled) -encode: sourcemap-codec x 29.31 ops/sec ±2.55% (53 runs sampled) -encode: source-map-0.6.1 x 18.85 ops/sec ±3.19% (36 runs sampled) -encode: source-map-0.8.0 x 19.34 ops/sec ±1.97% (36 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 - - -*** - - -preact.js.map - 1992 segments - -Decode Memory Usage: -local code 261696 bytes -@jridgewell/sourcemap-codec 1.4.15 244296 bytes -sourcemap-codec 302816 bytes -source-map-0.6.1 939176 bytes -source-map-0.8.0 336 bytes -chrome dev tools 587368 bytes -Smallest memory usage is source-map-0.8.0 - -Decode speed: -decode: local code x 17,782 ops/sec ±0.32% (97 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 17,863 ops/sec ±0.40% (100 runs sampled) -decode: sourcemap-codec x 12,453 ops/sec ±0.27% (101 runs sampled) -decode: source-map-0.6.1 x 1,288 ops/sec ±1.05% (96 runs sampled) -decode: source-map-0.8.0 x 9,289 ops/sec ±0.27% (101 runs sampled) -chrome dev tools x 4,769 ops/sec ±0.18% (100 runs sampled) -Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 - -Encode Memory Usage: -local code 262944 bytes -@jridgewell/sourcemap-codec 1.4.15 25544 bytes -sourcemap-codec 323048 bytes -source-map-0.6.1 507808 bytes -source-map-0.8.0 507480 bytes -Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 - -Encode speed: -encode: local code x 24,207 ops/sec ±0.79% (95 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 24,288 ops/sec ±0.48% (96 runs sampled) -encode: sourcemap-codec x 6,761 ops/sec ±0.21% (100 runs sampled) -encode: source-map-0.6.1 x 5,374 ops/sec ±0.17% (99 runs sampled) -encode: source-map-0.8.0 x 5,633 ops/sec ±0.32% (99 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec 1.4.15,encode: local code - - -*** - - -react.js.map - 5726 segments - -Decode Memory Usage: -local code 678816 bytes -@jridgewell/sourcemap-codec 1.4.15 678816 bytes -sourcemap-codec 816400 bytes -source-map-0.6.1 2288864 bytes -source-map-0.8.0 721360 bytes -chrome dev tools 1012512 bytes -Smallest memory usage is local code - -Decode speed: -decode: local code x 6,178 ops/sec ±0.19% (98 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 6,261 ops/sec ±0.22% (100 runs sampled) -decode: sourcemap-codec x 4,472 ops/sec ±0.90% (99 runs sampled) -decode: source-map-0.6.1 x 449 ops/sec ±0.31% (95 runs sampled) -decode: source-map-0.8.0 x 3,219 ops/sec ±0.13% (100 runs sampled) -chrome dev tools x 1,743 ops/sec ±0.20% (99 runs sampled) -Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 - -Encode Memory Usage: -local code 140960 bytes -@jridgewell/sourcemap-codec 1.4.15 159808 bytes -sourcemap-codec 969304 bytes -source-map-0.6.1 930520 bytes -source-map-0.8.0 930248 bytes -Smallest memory usage is local code - -Encode speed: -encode: local code x 8,013 ops/sec ±0.19% (100 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 7,989 ops/sec ±0.20% (101 runs sampled) -encode: sourcemap-codec x 2,472 ops/sec ±0.21% (99 runs sampled) -encode: source-map-0.6.1 x 2,200 ops/sec ±0.17% (99 runs sampled) -encode: source-map-0.8.0 x 2,220 ops/sec ±0.37% (99 runs sampled) -Fastest is encode: local code - - -*** - - -vscode.map - 2141001 segments - -Decode Memory Usage: -local code 198955264 bytes -@jridgewell/sourcemap-codec 1.4.15 199175352 bytes -sourcemap-codec 199102688 bytes -source-map-0.6.1 386323432 bytes -source-map-0.8.0 244116432 bytes -chrome dev tools 293734280 bytes -Smallest memory usage is local code - -Decode speed: -decode: local code x 3.90 ops/sec ±22.21% (15 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 3.95 ops/sec ±23.53% (15 runs sampled) -decode: sourcemap-codec x 3.82 ops/sec ±17.94% (14 runs sampled) -decode: source-map-0.6.1 x 0.61 ops/sec ±7.81% (6 runs sampled) -decode: source-map-0.8.0 x 9.54 ops/sec ±0.28% (28 runs sampled) -chrome dev tools x 2.18 ops/sec ±10.58% (10 runs sampled) -Fastest is decode: source-map-0.8.0 - -Encode Memory Usage: -local code 13509880 bytes -@jridgewell/sourcemap-codec 1.4.15 13537648 bytes -sourcemap-codec 32540104 bytes -source-map-0.6.1 127531040 bytes -source-map-0.8.0 127535312 bytes -Smallest memory usage is local code - -Encode speed: -encode: local code x 20.10 ops/sec ±0.19% (38 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 20.26 ops/sec ±0.32% (38 runs sampled) -encode: sourcemap-codec x 5.44 ops/sec ±1.64% (18 runs sampled) -encode: source-map-0.6.1 x 2.30 ops/sec ±4.79% (10 runs sampled) -encode: source-map-0.8.0 x 2.46 ops/sec ±6.53% (10 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 -``` - -# License - -MIT diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs b/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs deleted file mode 100644 index 532bab3..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +++ /dev/null @@ -1,423 +0,0 @@ -// src/vlq.ts -var comma = ",".charCodeAt(0); -var semicolon = ";".charCodeAt(0); -var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -var intToChar = new Uint8Array(64); -var charToInt = new Uint8Array(128); -for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - intToChar[i] = c; - charToInt[c] = i; -} -function decodeInteger(reader, relative) { - let value = 0; - let shift = 0; - let integer = 0; - do { - const c = reader.next(); - integer = charToInt[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - const shouldNegate = value & 1; - value >>>= 1; - if (shouldNegate) { - value = -2147483648 | -value; - } - return relative + value; -} -function encodeInteger(builder, num, relative) { - let delta = num - relative; - delta = delta < 0 ? -delta << 1 | 1 : delta << 1; - do { - let clamped = delta & 31; - delta >>>= 5; - if (delta > 0) clamped |= 32; - builder.write(intToChar[clamped]); - } while (delta > 0); - return num; -} -function hasMoreVlq(reader, max) { - if (reader.pos >= max) return false; - return reader.peek() !== comma; -} - -// src/strings.ts -var bufLength = 1024 * 16; -var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { - decode(buf) { - const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); - return out.toString(); - } -} : { - decode(buf) { - let out = ""; - for (let i = 0; i < buf.length; i++) { - out += String.fromCharCode(buf[i]); - } - return out; - } -}; -var StringWriter = class { - constructor() { - this.pos = 0; - this.out = ""; - this.buffer = new Uint8Array(bufLength); - } - write(v) { - const { buffer } = this; - buffer[this.pos++] = v; - if (this.pos === bufLength) { - this.out += td.decode(buffer); - this.pos = 0; - } - } - flush() { - const { buffer, out, pos } = this; - return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; - } -}; -var StringReader = class { - constructor(buffer) { - this.pos = 0; - this.buffer = buffer; - } - next() { - return this.buffer.charCodeAt(this.pos++); - } - peek() { - return this.buffer.charCodeAt(this.pos); - } - indexOf(char) { - const { buffer, pos } = this; - const idx = buffer.indexOf(char, pos); - return idx === -1 ? buffer.length : idx; - } -}; - -// src/scopes.ts -var EMPTY = []; -function decodeOriginalScopes(input) { - const { length } = input; - const reader = new StringReader(input); - const scopes = []; - const stack = []; - let line = 0; - for (; reader.pos < length; reader.pos++) { - line = decodeInteger(reader, line); - const column = decodeInteger(reader, 0); - if (!hasMoreVlq(reader, length)) { - const last = stack.pop(); - last[2] = line; - last[3] = column; - continue; - } - const kind = decodeInteger(reader, 0); - const fields = decodeInteger(reader, 0); - const hasName = fields & 1; - const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; - let vars = EMPTY; - if (hasMoreVlq(reader, length)) { - vars = []; - do { - const varsIndex = decodeInteger(reader, 0); - vars.push(varsIndex); - } while (hasMoreVlq(reader, length)); - } - scope.vars = vars; - scopes.push(scope); - stack.push(scope); - } - return scopes; -} -function encodeOriginalScopes(scopes) { - const writer = new StringWriter(); - for (let i = 0; i < scopes.length; ) { - i = _encodeOriginalScopes(scopes, i, writer, [0]); - } - return writer.flush(); -} -function _encodeOriginalScopes(scopes, index, writer, state) { - const scope = scopes[index]; - const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; - if (index > 0) writer.write(comma); - state[0] = encodeInteger(writer, startLine, state[0]); - encodeInteger(writer, startColumn, 0); - encodeInteger(writer, kind, 0); - const fields = scope.length === 6 ? 1 : 0; - encodeInteger(writer, fields, 0); - if (scope.length === 6) encodeInteger(writer, scope[5], 0); - for (const v of vars) { - encodeInteger(writer, v, 0); - } - for (index++; index < scopes.length; ) { - const next = scopes[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeOriginalScopes(scopes, index, writer, state); - } - writer.write(comma); - state[0] = encodeInteger(writer, endLine, state[0]); - encodeInteger(writer, endColumn, 0); - return index; -} -function decodeGeneratedRanges(input) { - const { length } = input; - const reader = new StringReader(input); - const ranges = []; - const stack = []; - let genLine = 0; - let definitionSourcesIndex = 0; - let definitionScopeIndex = 0; - let callsiteSourcesIndex = 0; - let callsiteLine = 0; - let callsiteColumn = 0; - let bindingLine = 0; - let bindingColumn = 0; - do { - const semi = reader.indexOf(";"); - let genColumn = 0; - for (; reader.pos < semi; reader.pos++) { - genColumn = decodeInteger(reader, genColumn); - if (!hasMoreVlq(reader, semi)) { - const last = stack.pop(); - last[2] = genLine; - last[3] = genColumn; - continue; - } - const fields = decodeInteger(reader, 0); - const hasDefinition = fields & 1; - const hasCallsite = fields & 2; - const hasScope = fields & 4; - let callsite = null; - let bindings = EMPTY; - let range; - if (hasDefinition) { - const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); - definitionScopeIndex = decodeInteger( - reader, - definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 - ); - definitionSourcesIndex = defSourcesIndex; - range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; - } else { - range = [genLine, genColumn, 0, 0]; - } - range.isScope = !!hasScope; - if (hasCallsite) { - const prevCsi = callsiteSourcesIndex; - const prevLine = callsiteLine; - callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); - const sameSource = prevCsi === callsiteSourcesIndex; - callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); - callsiteColumn = decodeInteger( - reader, - sameSource && prevLine === callsiteLine ? callsiteColumn : 0 - ); - callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; - } - range.callsite = callsite; - if (hasMoreVlq(reader, semi)) { - bindings = []; - do { - bindingLine = genLine; - bindingColumn = genColumn; - const expressionsCount = decodeInteger(reader, 0); - let expressionRanges; - if (expressionsCount < -1) { - expressionRanges = [[decodeInteger(reader, 0)]]; - for (let i = -1; i > expressionsCount; i--) { - const prevBl = bindingLine; - bindingLine = decodeInteger(reader, bindingLine); - bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); - const expression = decodeInteger(reader, 0); - expressionRanges.push([expression, bindingLine, bindingColumn]); - } - } else { - expressionRanges = [[expressionsCount]]; - } - bindings.push(expressionRanges); - } while (hasMoreVlq(reader, semi)); - } - range.bindings = bindings; - ranges.push(range); - stack.push(range); - } - genLine++; - reader.pos = semi + 1; - } while (reader.pos < length); - return ranges; -} -function encodeGeneratedRanges(ranges) { - if (ranges.length === 0) return ""; - const writer = new StringWriter(); - for (let i = 0; i < ranges.length; ) { - i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); - } - return writer.flush(); -} -function _encodeGeneratedRanges(ranges, index, writer, state) { - const range = ranges[index]; - const { - 0: startLine, - 1: startColumn, - 2: endLine, - 3: endColumn, - isScope, - callsite, - bindings - } = range; - if (state[0] < startLine) { - catchupLine(writer, state[0], startLine); - state[0] = startLine; - state[1] = 0; - } else if (index > 0) { - writer.write(comma); - } - state[1] = encodeInteger(writer, range[1], state[1]); - const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); - encodeInteger(writer, fields, 0); - if (range.length === 6) { - const { 4: sourcesIndex, 5: scopesIndex } = range; - if (sourcesIndex !== state[2]) { - state[3] = 0; - } - state[2] = encodeInteger(writer, sourcesIndex, state[2]); - state[3] = encodeInteger(writer, scopesIndex, state[3]); - } - if (callsite) { - const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; - if (sourcesIndex !== state[4]) { - state[5] = 0; - state[6] = 0; - } else if (callLine !== state[5]) { - state[6] = 0; - } - state[4] = encodeInteger(writer, sourcesIndex, state[4]); - state[5] = encodeInteger(writer, callLine, state[5]); - state[6] = encodeInteger(writer, callColumn, state[6]); - } - if (bindings) { - for (const binding of bindings) { - if (binding.length > 1) encodeInteger(writer, -binding.length, 0); - const expression = binding[0][0]; - encodeInteger(writer, expression, 0); - let bindingStartLine = startLine; - let bindingStartColumn = startColumn; - for (let i = 1; i < binding.length; i++) { - const expRange = binding[i]; - bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); - bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); - encodeInteger(writer, expRange[0], 0); - } - } - } - for (index++; index < ranges.length; ) { - const next = ranges[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeGeneratedRanges(ranges, index, writer, state); - } - if (state[0] < endLine) { - catchupLine(writer, state[0], endLine); - state[0] = endLine; - state[1] = 0; - } else { - writer.write(comma); - } - state[1] = encodeInteger(writer, endColumn, state[1]); - return index; -} -function catchupLine(writer, lastLine, line) { - do { - writer.write(semicolon); - } while (++lastLine < line); -} - -// src/sourcemap-codec.ts -function decode(mappings) { - const { length } = mappings; - const reader = new StringReader(mappings); - const decoded = []; - let genColumn = 0; - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - do { - const semi = reader.indexOf(";"); - const line = []; - let sorted = true; - let lastCol = 0; - genColumn = 0; - while (reader.pos < semi) { - let seg; - genColumn = decodeInteger(reader, genColumn); - if (genColumn < lastCol) sorted = false; - lastCol = genColumn; - if (hasMoreVlq(reader, semi)) { - sourcesIndex = decodeInteger(reader, sourcesIndex); - sourceLine = decodeInteger(reader, sourceLine); - sourceColumn = decodeInteger(reader, sourceColumn); - if (hasMoreVlq(reader, semi)) { - namesIndex = decodeInteger(reader, namesIndex); - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; - } else { - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; - } - } else { - seg = [genColumn]; - } - line.push(seg); - reader.pos++; - } - if (!sorted) sort(line); - decoded.push(line); - reader.pos = semi + 1; - } while (reader.pos <= length); - return decoded; -} -function sort(line) { - line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[0] - b[0]; -} -function encode(decoded) { - const writer = new StringWriter(); - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) writer.write(semicolon); - if (line.length === 0) continue; - let genColumn = 0; - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - if (j > 0) writer.write(comma); - genColumn = encodeInteger(writer, segment[0], genColumn); - if (segment.length === 1) continue; - sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); - sourceLine = encodeInteger(writer, segment[2], sourceLine); - sourceColumn = encodeInteger(writer, segment[3], sourceColumn); - if (segment.length === 4) continue; - namesIndex = encodeInteger(writer, segment[4], namesIndex); - } - } - return writer.flush(); -} -export { - decode, - decodeGeneratedRanges, - decodeOriginalScopes, - encode, - encodeGeneratedRanges, - encodeOriginalScopes -}; -//# sourceMappingURL=sourcemap-codec.mjs.map diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map b/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map deleted file mode 100644 index c276844..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["../src/vlq.ts", "../src/strings.ts", "../src/scopes.ts", "../src/sourcemap-codec.ts"], - "mappings": ";AAEO,IAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,IAAM,YAAY,IAAI,WAAW,CAAC;AAEzC,IAAM,QAAQ;AACd,IAAM,YAAY,IAAI,WAAW,EAAE;AACnC,IAAM,YAAY,IAAI,WAAW,GAAG;AAEpC,SAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,IAAI,MAAM,WAAW,CAAC;AAC5B,YAAU,CAAC,IAAI;AACf,YAAU,CAAC,IAAI;AACjB;AAEO,SAAS,cAAc,QAAsB,UAA0B;AAC5E,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,KAAG;AACD,UAAM,IAAI,OAAO,KAAK;AACtB,cAAU,UAAU,CAAC;AACrB,cAAU,UAAU,OAAO;AAC3B,aAAS;AAAA,EACX,SAAS,UAAU;AAEnB,QAAM,eAAe,QAAQ;AAC7B,aAAW;AAEX,MAAI,cAAc;AAChB,YAAQ,cAAc,CAAC;AAAA,EACzB;AAEA,SAAO,WAAW;AACpB;AAEO,SAAS,cAAc,SAAuB,KAAa,UAA0B;AAC1F,MAAI,QAAQ,MAAM;AAElB,UAAQ,QAAQ,IAAK,CAAC,SAAS,IAAK,IAAI,SAAS;AACjD,KAAG;AACD,QAAI,UAAU,QAAQ;AACtB,eAAW;AACX,QAAI,QAAQ,EAAG,YAAW;AAC1B,YAAQ,MAAM,UAAU,OAAO,CAAC;AAAA,EAClC,SAAS,QAAQ;AAEjB,SAAO;AACT;AAEO,SAAS,WAAW,QAAsB,KAAa;AAC5D,MAAI,OAAO,OAAO,IAAK,QAAO;AAC9B,SAAO,OAAO,KAAK,MAAM;AAC3B;;;ACtDA,IAAM,YAAY,OAAO;AAGzB,IAAM,KACJ,OAAO,gBAAgB,cACH,oBAAI,YAAY,IAChC,OAAO,WAAW,cAChB;AAAA,EACE,OAAO,KAAyB;AAC9B,UAAM,MAAM,OAAO,KAAK,IAAI,QAAQ,IAAI,YAAY,IAAI,UAAU;AAClE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF,IACA;AAAA,EACE,OAAO,KAAyB;AAC9B,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,aAAO,OAAO,aAAa,IAAI,CAAC,CAAC;AAAA,IACnC;AACA,WAAO;AAAA,EACT;AACF;AAED,IAAM,eAAN,MAAmB;AAAA,EAAnB;AACL,eAAM;AACN,SAAQ,MAAM;AACd,SAAQ,SAAS,IAAI,WAAW,SAAS;AAAA;AAAA,EAEzC,MAAM,GAAiB;AACrB,UAAM,EAAE,OAAO,IAAI;AACnB,WAAO,KAAK,KAAK,IAAI;AACrB,QAAI,KAAK,QAAQ,WAAW;AAC1B,WAAK,OAAO,GAAG,OAAO,MAAM;AAC5B,WAAK,MAAM;AAAA,IACb;AAAA,EACF;AAAA,EAEA,QAAgB;AACd,UAAM,EAAE,QAAQ,KAAK,IAAI,IAAI;AAC7B,WAAO,MAAM,IAAI,MAAM,GAAG,OAAO,OAAO,SAAS,GAAG,GAAG,CAAC,IAAI;AAAA,EAC9D;AACF;AAEO,IAAM,eAAN,MAAmB;AAAA,EAIxB,YAAY,QAAgB;AAH5B,eAAM;AAIJ,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,KAAK;AAAA,EAC1C;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,GAAG;AAAA,EACxC;AAAA,EAEA,QAAQ,MAAsB;AAC5B,UAAM,EAAE,QAAQ,IAAI,IAAI;AACxB,UAAM,MAAM,OAAO,QAAQ,MAAM,GAAG;AACpC,WAAO,QAAQ,KAAK,OAAO,SAAS;AAAA,EACtC;AACF;;;AC7DA,IAAM,QAAe,CAAC;AA+Bf,SAAS,qBAAqB,OAAgC;AACnE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA0B,CAAC;AACjC,QAAM,QAAyB,CAAC;AAChC,MAAI,OAAO;AAEX,SAAO,OAAO,MAAM,QAAQ,OAAO,OAAO;AACxC,WAAO,cAAc,QAAQ,IAAI;AACjC,UAAM,SAAS,cAAc,QAAQ,CAAC;AAEtC,QAAI,CAAC,WAAW,QAAQ,MAAM,GAAG;AAC/B,YAAM,OAAO,MAAM,IAAI;AACvB,WAAK,CAAC,IAAI;AACV,WAAK,CAAC,IAAI;AACV;AAAA,IACF;AAEA,UAAM,OAAO,cAAc,QAAQ,CAAC;AACpC,UAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,UAAM,UAAU,SAAS;AAEzB,UAAM,QACJ,UAAU,CAAC,MAAM,QAAQ,GAAG,GAAG,MAAM,cAAc,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,QAAQ,GAAG,GAAG,IAAI;AAG5F,QAAI,OAAc;AAClB,QAAI,WAAW,QAAQ,MAAM,GAAG;AAC9B,aAAO,CAAC;AACR,SAAG;AACD,cAAM,YAAY,cAAc,QAAQ,CAAC;AACzC,aAAK,KAAK,SAAS;AAAA,MACrB,SAAS,WAAW,QAAQ,MAAM;AAAA,IACpC;AACA,UAAM,OAAO;AAEb,WAAO,KAAK,KAAK;AACjB,UAAM,KAAK,KAAK;AAAA,EAClB;AAEA,SAAO;AACT;AAEO,SAAS,qBAAqB,QAAiC;AACpE,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,sBAAsB,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAAA,EAClD;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,sBACP,QACA,OACA,QACA,OAGQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM,EAAE,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,KAAK,IAAI;AAElF,MAAI,QAAQ,EAAG,QAAO,MAAM,KAAK;AAEjC,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AACpD,gBAAc,QAAQ,aAAa,CAAC;AACpC,gBAAc,QAAQ,MAAM,CAAC;AAE7B,QAAM,SAAS,MAAM,WAAW,IAAI,IAAS;AAC7C,gBAAc,QAAQ,QAAQ,CAAC;AAC/B,MAAI,MAAM,WAAW,EAAG,eAAc,QAAQ,MAAM,CAAC,GAAG,CAAC;AAEzD,aAAW,KAAK,MAAM;AACpB,kBAAc,QAAQ,GAAG,CAAC;AAAA,EAC5B;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,sBAAsB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC5D;AAEA,SAAO,MAAM,KAAK;AAClB,QAAM,CAAC,IAAI,cAAc,QAAQ,SAAS,MAAM,CAAC,CAAC;AAClD,gBAAc,QAAQ,WAAW,CAAC;AAElC,SAAO;AACT;AAEO,SAAS,sBAAsB,OAAiC;AACrE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA2B,CAAC;AAClC,QAAM,QAA0B,CAAC;AAEjC,MAAI,UAAU;AACd,MAAI,yBAAyB;AAC7B,MAAI,uBAAuB;AAC3B,MAAI,uBAAuB;AAC3B,MAAI,eAAe;AACnB,MAAI,iBAAiB;AACrB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAEpB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,QAAI,YAAY;AAEhB,WAAO,OAAO,MAAM,MAAM,OAAO,OAAO;AACtC,kBAAY,cAAc,QAAQ,SAAS;AAE3C,UAAI,CAAC,WAAW,QAAQ,IAAI,GAAG;AAC7B,cAAM,OAAO,MAAM,IAAI;AACvB,aAAK,CAAC,IAAI;AACV,aAAK,CAAC,IAAI;AACV;AAAA,MACF;AAEA,YAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,YAAM,gBAAgB,SAAS;AAC/B,YAAM,cAAc,SAAS;AAC7B,YAAM,WAAW,SAAS;AAE1B,UAAI,WAA4B;AAChC,UAAI,WAAsB;AAC1B,UAAI;AACJ,UAAI,eAAe;AACjB,cAAM,kBAAkB,cAAc,QAAQ,sBAAsB;AACpE,+BAAuB;AAAA,UACrB;AAAA,UACA,2BAA2B,kBAAkB,uBAAuB;AAAA,QACtE;AAEA,iCAAyB;AACzB,gBAAQ,CAAC,SAAS,WAAW,GAAG,GAAG,iBAAiB,oBAAoB;AAAA,MAC1E,OAAO;AACL,gBAAQ,CAAC,SAAS,WAAW,GAAG,CAAC;AAAA,MACnC;AAEA,YAAM,UAAU,CAAC,CAAC;AAElB,UAAI,aAAa;AACf,cAAM,UAAU;AAChB,cAAM,WAAW;AACjB,+BAAuB,cAAc,QAAQ,oBAAoB;AACjE,cAAM,aAAa,YAAY;AAC/B,uBAAe,cAAc,QAAQ,aAAa,eAAe,CAAC;AAClE,yBAAiB;AAAA,UACf;AAAA,UACA,cAAc,aAAa,eAAe,iBAAiB;AAAA,QAC7D;AAEA,mBAAW,CAAC,sBAAsB,cAAc,cAAc;AAAA,MAChE;AACA,YAAM,WAAW;AAEjB,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,mBAAW,CAAC;AACZ,WAAG;AACD,wBAAc;AACd,0BAAgB;AAChB,gBAAM,mBAAmB,cAAc,QAAQ,CAAC;AAChD,cAAI;AACJ,cAAI,mBAAmB,IAAI;AACzB,+BAAmB,CAAC,CAAC,cAAc,QAAQ,CAAC,CAAC,CAAC;AAC9C,qBAAS,IAAI,IAAI,IAAI,kBAAkB,KAAK;AAC1C,oBAAM,SAAS;AACf,4BAAc,cAAc,QAAQ,WAAW;AAC/C,8BAAgB,cAAc,QAAQ,gBAAgB,SAAS,gBAAgB,CAAC;AAChF,oBAAM,aAAa,cAAc,QAAQ,CAAC;AAC1C,+BAAiB,KAAK,CAAC,YAAY,aAAa,aAAa,CAAC;AAAA,YAChE;AAAA,UACF,OAAO;AACL,+BAAmB,CAAC,CAAC,gBAAgB,CAAC;AAAA,UACxC;AACA,mBAAS,KAAK,gBAAgB;AAAA,QAChC,SAAS,WAAW,QAAQ,IAAI;AAAA,MAClC;AACA,YAAM,WAAW;AAEjB,aAAO,KAAK,KAAK;AACjB,YAAM,KAAK,KAAK;AAAA,IAClB;AAEA;AACA,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,MAAM;AAEtB,SAAO;AACT;AAEO,SAAS,sBAAsB,QAAkC;AACtE,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,uBAAuB,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAAA,EACrE;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,uBACP,QACA,OACA,QACA,OASQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM;AAAA,IACJ,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,MAAM,CAAC,IAAI,WAAW;AACxB,gBAAY,QAAQ,MAAM,CAAC,GAAG,SAAS;AACvC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,WAAW,QAAQ,GAAG;AACpB,WAAO,MAAM,KAAK;AAAA,EACpB;AAEA,QAAM,CAAC,IAAI,cAAc,QAAQ,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAEnD,QAAM,UACH,MAAM,WAAW,IAAI,IAAS,MAAM,WAAW,IAAS,MAAM,UAAU,IAAS;AACpF,gBAAc,QAAQ,QAAQ,CAAC;AAE/B,MAAI,MAAM,WAAW,GAAG;AACtB,UAAM,EAAE,GAAG,cAAc,GAAG,YAAY,IAAI;AAC5C,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,aAAa,MAAM,CAAC,CAAC;AAAA,EACxD;AAEA,MAAI,UAAU;AACZ,UAAM,EAAE,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,IAAI,MAAM;AAC9D,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AACX,YAAM,CAAC,IAAI;AAAA,IACb,WAAW,aAAa,MAAM,CAAC,GAAG;AAChC,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,UAAU,MAAM,CAAC,CAAC;AACnD,UAAM,CAAC,IAAI,cAAc,QAAQ,YAAY,MAAM,CAAC,CAAC;AAAA,EACvD;AAEA,MAAI,UAAU;AACZ,eAAW,WAAW,UAAU;AAC9B,UAAI,QAAQ,SAAS,EAAG,eAAc,QAAQ,CAAC,QAAQ,QAAQ,CAAC;AAChE,YAAM,aAAa,QAAQ,CAAC,EAAE,CAAC;AAC/B,oBAAc,QAAQ,YAAY,CAAC;AACnC,UAAI,mBAAmB;AACvB,UAAI,qBAAqB;AACzB,eAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,cAAM,WAAW,QAAQ,CAAC;AAC1B,2BAAmB,cAAc,QAAQ,SAAS,CAAC,GAAI,gBAAgB;AACvE,6BAAqB,cAAc,QAAQ,SAAS,CAAC,GAAI,kBAAkB;AAC3E,sBAAc,QAAQ,SAAS,CAAC,GAAI,CAAC;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,uBAAuB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC7D;AAEA,MAAI,MAAM,CAAC,IAAI,SAAS;AACtB,gBAAY,QAAQ,MAAM,CAAC,GAAG,OAAO;AACrC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,OAAO;AACL,WAAO,MAAM,KAAK;AAAA,EACpB;AACA,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AAEpD,SAAO;AACT;AAEA,SAAS,YAAY,QAAsB,UAAkB,MAAc;AACzE,KAAG;AACD,WAAO,MAAM,SAAS;AAAA,EACxB,SAAS,EAAE,WAAW;AACxB;;;ACtUO,SAAS,OAAO,UAAqC;AAC1D,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,QAAQ;AACxC,QAAM,UAA6B,CAAC;AACpC,MAAI,YAAY;AAChB,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,UAAM,OAAsB,CAAC;AAC7B,QAAI,SAAS;AACb,QAAI,UAAU;AACd,gBAAY;AAEZ,WAAO,OAAO,MAAM,MAAM;AACxB,UAAI;AAEJ,kBAAY,cAAc,QAAQ,SAAS;AAC3C,UAAI,YAAY,QAAS,UAAS;AAClC,gBAAU;AAEV,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAe,cAAc,QAAQ,YAAY;AACjD,qBAAa,cAAc,QAAQ,UAAU;AAC7C,uBAAe,cAAc,QAAQ,YAAY;AAEjD,YAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAa,cAAc,QAAQ,UAAU;AAC7C,gBAAM,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU;AAAA,QACtE,OAAO;AACL,gBAAM,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,QAC1D;AAAA,MACF,OAAO;AACL,cAAM,CAAC,SAAS;AAAA,MAClB;AAEA,WAAK,KAAK,GAAG;AACb,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,OAAQ,MAAK,IAAI;AACtB,YAAQ,KAAK,IAAI;AACjB,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,OAAO;AAEvB,SAAO;AACT;AAEA,SAAS,KAAK,MAA0B;AACtC,OAAK,KAAK,cAAc;AAC1B;AAEA,SAAS,eAAe,GAAqB,GAA6B;AACxE,SAAO,EAAE,CAAC,IAAI,EAAE,CAAC;AACnB;AAIO,SAAS,OAAO,SAA8C;AACnE,QAAM,SAAS,IAAI,aAAa;AAChC,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,QAAI,IAAI,EAAG,QAAO,MAAM,SAAS;AACjC,QAAI,KAAK,WAAW,EAAG;AAEvB,QAAI,YAAY;AAEhB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,UAAU,KAAK,CAAC;AACtB,UAAI,IAAI,EAAG,QAAO,MAAM,KAAK;AAE7B,kBAAY,cAAc,QAAQ,QAAQ,CAAC,GAAG,SAAS;AAEvD,UAAI,QAAQ,WAAW,EAAG;AAC1B,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAC7D,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AACzD,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAE7D,UAAI,QAAQ,WAAW,EAAG;AAC1B,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO,OAAO,MAAM;AACtB;", - "names": [] -} diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js b/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js deleted file mode 100644 index 2d8e459..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +++ /dev/null @@ -1,464 +0,0 @@ -(function (global, factory) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - factory(module); - module.exports = def(module); - } else if (typeof define === 'function' && define.amd) { - define(['module'], function(mod) { - factory.apply(this, arguments); - mod.exports = def(mod); - }); - } else { - const mod = { exports: {} }; - factory(mod); - global = typeof globalThis !== 'undefined' ? globalThis : global || self; - global.sourcemapCodec = def(mod); - } - function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } -})(this, (function (module) { -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/sourcemap-codec.ts -var sourcemap_codec_exports = {}; -__export(sourcemap_codec_exports, { - decode: () => decode, - decodeGeneratedRanges: () => decodeGeneratedRanges, - decodeOriginalScopes: () => decodeOriginalScopes, - encode: () => encode, - encodeGeneratedRanges: () => encodeGeneratedRanges, - encodeOriginalScopes: () => encodeOriginalScopes -}); -module.exports = __toCommonJS(sourcemap_codec_exports); - -// src/vlq.ts -var comma = ",".charCodeAt(0); -var semicolon = ";".charCodeAt(0); -var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -var intToChar = new Uint8Array(64); -var charToInt = new Uint8Array(128); -for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - intToChar[i] = c; - charToInt[c] = i; -} -function decodeInteger(reader, relative) { - let value = 0; - let shift = 0; - let integer = 0; - do { - const c = reader.next(); - integer = charToInt[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - const shouldNegate = value & 1; - value >>>= 1; - if (shouldNegate) { - value = -2147483648 | -value; - } - return relative + value; -} -function encodeInteger(builder, num, relative) { - let delta = num - relative; - delta = delta < 0 ? -delta << 1 | 1 : delta << 1; - do { - let clamped = delta & 31; - delta >>>= 5; - if (delta > 0) clamped |= 32; - builder.write(intToChar[clamped]); - } while (delta > 0); - return num; -} -function hasMoreVlq(reader, max) { - if (reader.pos >= max) return false; - return reader.peek() !== comma; -} - -// src/strings.ts -var bufLength = 1024 * 16; -var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { - decode(buf) { - const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); - return out.toString(); - } -} : { - decode(buf) { - let out = ""; - for (let i = 0; i < buf.length; i++) { - out += String.fromCharCode(buf[i]); - } - return out; - } -}; -var StringWriter = class { - constructor() { - this.pos = 0; - this.out = ""; - this.buffer = new Uint8Array(bufLength); - } - write(v) { - const { buffer } = this; - buffer[this.pos++] = v; - if (this.pos === bufLength) { - this.out += td.decode(buffer); - this.pos = 0; - } - } - flush() { - const { buffer, out, pos } = this; - return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; - } -}; -var StringReader = class { - constructor(buffer) { - this.pos = 0; - this.buffer = buffer; - } - next() { - return this.buffer.charCodeAt(this.pos++); - } - peek() { - return this.buffer.charCodeAt(this.pos); - } - indexOf(char) { - const { buffer, pos } = this; - const idx = buffer.indexOf(char, pos); - return idx === -1 ? buffer.length : idx; - } -}; - -// src/scopes.ts -var EMPTY = []; -function decodeOriginalScopes(input) { - const { length } = input; - const reader = new StringReader(input); - const scopes = []; - const stack = []; - let line = 0; - for (; reader.pos < length; reader.pos++) { - line = decodeInteger(reader, line); - const column = decodeInteger(reader, 0); - if (!hasMoreVlq(reader, length)) { - const last = stack.pop(); - last[2] = line; - last[3] = column; - continue; - } - const kind = decodeInteger(reader, 0); - const fields = decodeInteger(reader, 0); - const hasName = fields & 1; - const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; - let vars = EMPTY; - if (hasMoreVlq(reader, length)) { - vars = []; - do { - const varsIndex = decodeInteger(reader, 0); - vars.push(varsIndex); - } while (hasMoreVlq(reader, length)); - } - scope.vars = vars; - scopes.push(scope); - stack.push(scope); - } - return scopes; -} -function encodeOriginalScopes(scopes) { - const writer = new StringWriter(); - for (let i = 0; i < scopes.length; ) { - i = _encodeOriginalScopes(scopes, i, writer, [0]); - } - return writer.flush(); -} -function _encodeOriginalScopes(scopes, index, writer, state) { - const scope = scopes[index]; - const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; - if (index > 0) writer.write(comma); - state[0] = encodeInteger(writer, startLine, state[0]); - encodeInteger(writer, startColumn, 0); - encodeInteger(writer, kind, 0); - const fields = scope.length === 6 ? 1 : 0; - encodeInteger(writer, fields, 0); - if (scope.length === 6) encodeInteger(writer, scope[5], 0); - for (const v of vars) { - encodeInteger(writer, v, 0); - } - for (index++; index < scopes.length; ) { - const next = scopes[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeOriginalScopes(scopes, index, writer, state); - } - writer.write(comma); - state[0] = encodeInteger(writer, endLine, state[0]); - encodeInteger(writer, endColumn, 0); - return index; -} -function decodeGeneratedRanges(input) { - const { length } = input; - const reader = new StringReader(input); - const ranges = []; - const stack = []; - let genLine = 0; - let definitionSourcesIndex = 0; - let definitionScopeIndex = 0; - let callsiteSourcesIndex = 0; - let callsiteLine = 0; - let callsiteColumn = 0; - let bindingLine = 0; - let bindingColumn = 0; - do { - const semi = reader.indexOf(";"); - let genColumn = 0; - for (; reader.pos < semi; reader.pos++) { - genColumn = decodeInteger(reader, genColumn); - if (!hasMoreVlq(reader, semi)) { - const last = stack.pop(); - last[2] = genLine; - last[3] = genColumn; - continue; - } - const fields = decodeInteger(reader, 0); - const hasDefinition = fields & 1; - const hasCallsite = fields & 2; - const hasScope = fields & 4; - let callsite = null; - let bindings = EMPTY; - let range; - if (hasDefinition) { - const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); - definitionScopeIndex = decodeInteger( - reader, - definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 - ); - definitionSourcesIndex = defSourcesIndex; - range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; - } else { - range = [genLine, genColumn, 0, 0]; - } - range.isScope = !!hasScope; - if (hasCallsite) { - const prevCsi = callsiteSourcesIndex; - const prevLine = callsiteLine; - callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); - const sameSource = prevCsi === callsiteSourcesIndex; - callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); - callsiteColumn = decodeInteger( - reader, - sameSource && prevLine === callsiteLine ? callsiteColumn : 0 - ); - callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; - } - range.callsite = callsite; - if (hasMoreVlq(reader, semi)) { - bindings = []; - do { - bindingLine = genLine; - bindingColumn = genColumn; - const expressionsCount = decodeInteger(reader, 0); - let expressionRanges; - if (expressionsCount < -1) { - expressionRanges = [[decodeInteger(reader, 0)]]; - for (let i = -1; i > expressionsCount; i--) { - const prevBl = bindingLine; - bindingLine = decodeInteger(reader, bindingLine); - bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); - const expression = decodeInteger(reader, 0); - expressionRanges.push([expression, bindingLine, bindingColumn]); - } - } else { - expressionRanges = [[expressionsCount]]; - } - bindings.push(expressionRanges); - } while (hasMoreVlq(reader, semi)); - } - range.bindings = bindings; - ranges.push(range); - stack.push(range); - } - genLine++; - reader.pos = semi + 1; - } while (reader.pos < length); - return ranges; -} -function encodeGeneratedRanges(ranges) { - if (ranges.length === 0) return ""; - const writer = new StringWriter(); - for (let i = 0; i < ranges.length; ) { - i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); - } - return writer.flush(); -} -function _encodeGeneratedRanges(ranges, index, writer, state) { - const range = ranges[index]; - const { - 0: startLine, - 1: startColumn, - 2: endLine, - 3: endColumn, - isScope, - callsite, - bindings - } = range; - if (state[0] < startLine) { - catchupLine(writer, state[0], startLine); - state[0] = startLine; - state[1] = 0; - } else if (index > 0) { - writer.write(comma); - } - state[1] = encodeInteger(writer, range[1], state[1]); - const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); - encodeInteger(writer, fields, 0); - if (range.length === 6) { - const { 4: sourcesIndex, 5: scopesIndex } = range; - if (sourcesIndex !== state[2]) { - state[3] = 0; - } - state[2] = encodeInteger(writer, sourcesIndex, state[2]); - state[3] = encodeInteger(writer, scopesIndex, state[3]); - } - if (callsite) { - const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; - if (sourcesIndex !== state[4]) { - state[5] = 0; - state[6] = 0; - } else if (callLine !== state[5]) { - state[6] = 0; - } - state[4] = encodeInteger(writer, sourcesIndex, state[4]); - state[5] = encodeInteger(writer, callLine, state[5]); - state[6] = encodeInteger(writer, callColumn, state[6]); - } - if (bindings) { - for (const binding of bindings) { - if (binding.length > 1) encodeInteger(writer, -binding.length, 0); - const expression = binding[0][0]; - encodeInteger(writer, expression, 0); - let bindingStartLine = startLine; - let bindingStartColumn = startColumn; - for (let i = 1; i < binding.length; i++) { - const expRange = binding[i]; - bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); - bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); - encodeInteger(writer, expRange[0], 0); - } - } - } - for (index++; index < ranges.length; ) { - const next = ranges[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeGeneratedRanges(ranges, index, writer, state); - } - if (state[0] < endLine) { - catchupLine(writer, state[0], endLine); - state[0] = endLine; - state[1] = 0; - } else { - writer.write(comma); - } - state[1] = encodeInteger(writer, endColumn, state[1]); - return index; -} -function catchupLine(writer, lastLine, line) { - do { - writer.write(semicolon); - } while (++lastLine < line); -} - -// src/sourcemap-codec.ts -function decode(mappings) { - const { length } = mappings; - const reader = new StringReader(mappings); - const decoded = []; - let genColumn = 0; - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - do { - const semi = reader.indexOf(";"); - const line = []; - let sorted = true; - let lastCol = 0; - genColumn = 0; - while (reader.pos < semi) { - let seg; - genColumn = decodeInteger(reader, genColumn); - if (genColumn < lastCol) sorted = false; - lastCol = genColumn; - if (hasMoreVlq(reader, semi)) { - sourcesIndex = decodeInteger(reader, sourcesIndex); - sourceLine = decodeInteger(reader, sourceLine); - sourceColumn = decodeInteger(reader, sourceColumn); - if (hasMoreVlq(reader, semi)) { - namesIndex = decodeInteger(reader, namesIndex); - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; - } else { - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; - } - } else { - seg = [genColumn]; - } - line.push(seg); - reader.pos++; - } - if (!sorted) sort(line); - decoded.push(line); - reader.pos = semi + 1; - } while (reader.pos <= length); - return decoded; -} -function sort(line) { - line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[0] - b[0]; -} -function encode(decoded) { - const writer = new StringWriter(); - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) writer.write(semicolon); - if (line.length === 0) continue; - let genColumn = 0; - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - if (j > 0) writer.write(comma); - genColumn = encodeInteger(writer, segment[0], genColumn); - if (segment.length === 1) continue; - sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); - sourceLine = encodeInteger(writer, segment[2], sourceLine); - sourceColumn = encodeInteger(writer, segment[3], sourceColumn); - if (segment.length === 4) continue; - namesIndex = encodeInteger(writer, segment[4], namesIndex); - } - } - return writer.flush(); -} -})); -//# sourceMappingURL=sourcemap-codec.umd.js.map diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map b/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map deleted file mode 100644 index abc18d2..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["../src/sourcemap-codec.ts", "../src/vlq.ts", "../src/strings.ts", "../src/scopes.ts"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,IAAM,YAAY,IAAI,WAAW,CAAC;AAEzC,IAAM,QAAQ;AACd,IAAM,YAAY,IAAI,WAAW,EAAE;AACnC,IAAM,YAAY,IAAI,WAAW,GAAG;AAEpC,SAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,IAAI,MAAM,WAAW,CAAC;AAC5B,YAAU,CAAC,IAAI;AACf,YAAU,CAAC,IAAI;AACjB;AAEO,SAAS,cAAc,QAAsB,UAA0B;AAC5E,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,KAAG;AACD,UAAM,IAAI,OAAO,KAAK;AACtB,cAAU,UAAU,CAAC;AACrB,cAAU,UAAU,OAAO;AAC3B,aAAS;AAAA,EACX,SAAS,UAAU;AAEnB,QAAM,eAAe,QAAQ;AAC7B,aAAW;AAEX,MAAI,cAAc;AAChB,YAAQ,cAAc,CAAC;AAAA,EACzB;AAEA,SAAO,WAAW;AACpB;AAEO,SAAS,cAAc,SAAuB,KAAa,UAA0B;AAC1F,MAAI,QAAQ,MAAM;AAElB,UAAQ,QAAQ,IAAK,CAAC,SAAS,IAAK,IAAI,SAAS;AACjD,KAAG;AACD,QAAI,UAAU,QAAQ;AACtB,eAAW;AACX,QAAI,QAAQ,EAAG,YAAW;AAC1B,YAAQ,MAAM,UAAU,OAAO,CAAC;AAAA,EAClC,SAAS,QAAQ;AAEjB,SAAO;AACT;AAEO,SAAS,WAAW,QAAsB,KAAa;AAC5D,MAAI,OAAO,OAAO,IAAK,QAAO;AAC9B,SAAO,OAAO,KAAK,MAAM;AAC3B;;;ACtDA,IAAM,YAAY,OAAO;AAGzB,IAAM,KACJ,OAAO,gBAAgB,cACH,oBAAI,YAAY,IAChC,OAAO,WAAW,cAChB;AAAA,EACE,OAAO,KAAyB;AAC9B,UAAM,MAAM,OAAO,KAAK,IAAI,QAAQ,IAAI,YAAY,IAAI,UAAU;AAClE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF,IACA;AAAA,EACE,OAAO,KAAyB;AAC9B,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,aAAO,OAAO,aAAa,IAAI,CAAC,CAAC;AAAA,IACnC;AACA,WAAO;AAAA,EACT;AACF;AAED,IAAM,eAAN,MAAmB;AAAA,EAAnB;AACL,eAAM;AACN,SAAQ,MAAM;AACd,SAAQ,SAAS,IAAI,WAAW,SAAS;AAAA;AAAA,EAEzC,MAAM,GAAiB;AACrB,UAAM,EAAE,OAAO,IAAI;AACnB,WAAO,KAAK,KAAK,IAAI;AACrB,QAAI,KAAK,QAAQ,WAAW;AAC1B,WAAK,OAAO,GAAG,OAAO,MAAM;AAC5B,WAAK,MAAM;AAAA,IACb;AAAA,EACF;AAAA,EAEA,QAAgB;AACd,UAAM,EAAE,QAAQ,KAAK,IAAI,IAAI;AAC7B,WAAO,MAAM,IAAI,MAAM,GAAG,OAAO,OAAO,SAAS,GAAG,GAAG,CAAC,IAAI;AAAA,EAC9D;AACF;AAEO,IAAM,eAAN,MAAmB;AAAA,EAIxB,YAAY,QAAgB;AAH5B,eAAM;AAIJ,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,KAAK;AAAA,EAC1C;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,GAAG;AAAA,EACxC;AAAA,EAEA,QAAQ,MAAsB;AAC5B,UAAM,EAAE,QAAQ,IAAI,IAAI;AACxB,UAAM,MAAM,OAAO,QAAQ,MAAM,GAAG;AACpC,WAAO,QAAQ,KAAK,OAAO,SAAS;AAAA,EACtC;AACF;;;AC7DA,IAAM,QAAe,CAAC;AA+Bf,SAAS,qBAAqB,OAAgC;AACnE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA0B,CAAC;AACjC,QAAM,QAAyB,CAAC;AAChC,MAAI,OAAO;AAEX,SAAO,OAAO,MAAM,QAAQ,OAAO,OAAO;AACxC,WAAO,cAAc,QAAQ,IAAI;AACjC,UAAM,SAAS,cAAc,QAAQ,CAAC;AAEtC,QAAI,CAAC,WAAW,QAAQ,MAAM,GAAG;AAC/B,YAAM,OAAO,MAAM,IAAI;AACvB,WAAK,CAAC,IAAI;AACV,WAAK,CAAC,IAAI;AACV;AAAA,IACF;AAEA,UAAM,OAAO,cAAc,QAAQ,CAAC;AACpC,UAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,UAAM,UAAU,SAAS;AAEzB,UAAM,QACJ,UAAU,CAAC,MAAM,QAAQ,GAAG,GAAG,MAAM,cAAc,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,QAAQ,GAAG,GAAG,IAAI;AAG5F,QAAI,OAAc;AAClB,QAAI,WAAW,QAAQ,MAAM,GAAG;AAC9B,aAAO,CAAC;AACR,SAAG;AACD,cAAM,YAAY,cAAc,QAAQ,CAAC;AACzC,aAAK,KAAK,SAAS;AAAA,MACrB,SAAS,WAAW,QAAQ,MAAM;AAAA,IACpC;AACA,UAAM,OAAO;AAEb,WAAO,KAAK,KAAK;AACjB,UAAM,KAAK,KAAK;AAAA,EAClB;AAEA,SAAO;AACT;AAEO,SAAS,qBAAqB,QAAiC;AACpE,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,sBAAsB,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAAA,EAClD;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,sBACP,QACA,OACA,QACA,OAGQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM,EAAE,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,KAAK,IAAI;AAElF,MAAI,QAAQ,EAAG,QAAO,MAAM,KAAK;AAEjC,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AACpD,gBAAc,QAAQ,aAAa,CAAC;AACpC,gBAAc,QAAQ,MAAM,CAAC;AAE7B,QAAM,SAAS,MAAM,WAAW,IAAI,IAAS;AAC7C,gBAAc,QAAQ,QAAQ,CAAC;AAC/B,MAAI,MAAM,WAAW,EAAG,eAAc,QAAQ,MAAM,CAAC,GAAG,CAAC;AAEzD,aAAW,KAAK,MAAM;AACpB,kBAAc,QAAQ,GAAG,CAAC;AAAA,EAC5B;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,sBAAsB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC5D;AAEA,SAAO,MAAM,KAAK;AAClB,QAAM,CAAC,IAAI,cAAc,QAAQ,SAAS,MAAM,CAAC,CAAC;AAClD,gBAAc,QAAQ,WAAW,CAAC;AAElC,SAAO;AACT;AAEO,SAAS,sBAAsB,OAAiC;AACrE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA2B,CAAC;AAClC,QAAM,QAA0B,CAAC;AAEjC,MAAI,UAAU;AACd,MAAI,yBAAyB;AAC7B,MAAI,uBAAuB;AAC3B,MAAI,uBAAuB;AAC3B,MAAI,eAAe;AACnB,MAAI,iBAAiB;AACrB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAEpB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,QAAI,YAAY;AAEhB,WAAO,OAAO,MAAM,MAAM,OAAO,OAAO;AACtC,kBAAY,cAAc,QAAQ,SAAS;AAE3C,UAAI,CAAC,WAAW,QAAQ,IAAI,GAAG;AAC7B,cAAM,OAAO,MAAM,IAAI;AACvB,aAAK,CAAC,IAAI;AACV,aAAK,CAAC,IAAI;AACV;AAAA,MACF;AAEA,YAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,YAAM,gBAAgB,SAAS;AAC/B,YAAM,cAAc,SAAS;AAC7B,YAAM,WAAW,SAAS;AAE1B,UAAI,WAA4B;AAChC,UAAI,WAAsB;AAC1B,UAAI;AACJ,UAAI,eAAe;AACjB,cAAM,kBAAkB,cAAc,QAAQ,sBAAsB;AACpE,+BAAuB;AAAA,UACrB;AAAA,UACA,2BAA2B,kBAAkB,uBAAuB;AAAA,QACtE;AAEA,iCAAyB;AACzB,gBAAQ,CAAC,SAAS,WAAW,GAAG,GAAG,iBAAiB,oBAAoB;AAAA,MAC1E,OAAO;AACL,gBAAQ,CAAC,SAAS,WAAW,GAAG,CAAC;AAAA,MACnC;AAEA,YAAM,UAAU,CAAC,CAAC;AAElB,UAAI,aAAa;AACf,cAAM,UAAU;AAChB,cAAM,WAAW;AACjB,+BAAuB,cAAc,QAAQ,oBAAoB;AACjE,cAAM,aAAa,YAAY;AAC/B,uBAAe,cAAc,QAAQ,aAAa,eAAe,CAAC;AAClE,yBAAiB;AAAA,UACf;AAAA,UACA,cAAc,aAAa,eAAe,iBAAiB;AAAA,QAC7D;AAEA,mBAAW,CAAC,sBAAsB,cAAc,cAAc;AAAA,MAChE;AACA,YAAM,WAAW;AAEjB,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,mBAAW,CAAC;AACZ,WAAG;AACD,wBAAc;AACd,0BAAgB;AAChB,gBAAM,mBAAmB,cAAc,QAAQ,CAAC;AAChD,cAAI;AACJ,cAAI,mBAAmB,IAAI;AACzB,+BAAmB,CAAC,CAAC,cAAc,QAAQ,CAAC,CAAC,CAAC;AAC9C,qBAAS,IAAI,IAAI,IAAI,kBAAkB,KAAK;AAC1C,oBAAM,SAAS;AACf,4BAAc,cAAc,QAAQ,WAAW;AAC/C,8BAAgB,cAAc,QAAQ,gBAAgB,SAAS,gBAAgB,CAAC;AAChF,oBAAM,aAAa,cAAc,QAAQ,CAAC;AAC1C,+BAAiB,KAAK,CAAC,YAAY,aAAa,aAAa,CAAC;AAAA,YAChE;AAAA,UACF,OAAO;AACL,+BAAmB,CAAC,CAAC,gBAAgB,CAAC;AAAA,UACxC;AACA,mBAAS,KAAK,gBAAgB;AAAA,QAChC,SAAS,WAAW,QAAQ,IAAI;AAAA,MAClC;AACA,YAAM,WAAW;AAEjB,aAAO,KAAK,KAAK;AACjB,YAAM,KAAK,KAAK;AAAA,IAClB;AAEA;AACA,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,MAAM;AAEtB,SAAO;AACT;AAEO,SAAS,sBAAsB,QAAkC;AACtE,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,uBAAuB,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAAA,EACrE;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,uBACP,QACA,OACA,QACA,OASQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM;AAAA,IACJ,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,MAAM,CAAC,IAAI,WAAW;AACxB,gBAAY,QAAQ,MAAM,CAAC,GAAG,SAAS;AACvC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,WAAW,QAAQ,GAAG;AACpB,WAAO,MAAM,KAAK;AAAA,EACpB;AAEA,QAAM,CAAC,IAAI,cAAc,QAAQ,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAEnD,QAAM,UACH,MAAM,WAAW,IAAI,IAAS,MAAM,WAAW,IAAS,MAAM,UAAU,IAAS;AACpF,gBAAc,QAAQ,QAAQ,CAAC;AAE/B,MAAI,MAAM,WAAW,GAAG;AACtB,UAAM,EAAE,GAAG,cAAc,GAAG,YAAY,IAAI;AAC5C,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,aAAa,MAAM,CAAC,CAAC;AAAA,EACxD;AAEA,MAAI,UAAU;AACZ,UAAM,EAAE,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,IAAI,MAAM;AAC9D,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AACX,YAAM,CAAC,IAAI;AAAA,IACb,WAAW,aAAa,MAAM,CAAC,GAAG;AAChC,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,UAAU,MAAM,CAAC,CAAC;AACnD,UAAM,CAAC,IAAI,cAAc,QAAQ,YAAY,MAAM,CAAC,CAAC;AAAA,EACvD;AAEA,MAAI,UAAU;AACZ,eAAW,WAAW,UAAU;AAC9B,UAAI,QAAQ,SAAS,EAAG,eAAc,QAAQ,CAAC,QAAQ,QAAQ,CAAC;AAChE,YAAM,aAAa,QAAQ,CAAC,EAAE,CAAC;AAC/B,oBAAc,QAAQ,YAAY,CAAC;AACnC,UAAI,mBAAmB;AACvB,UAAI,qBAAqB;AACzB,eAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,cAAM,WAAW,QAAQ,CAAC;AAC1B,2BAAmB,cAAc,QAAQ,SAAS,CAAC,GAAI,gBAAgB;AACvE,6BAAqB,cAAc,QAAQ,SAAS,CAAC,GAAI,kBAAkB;AAC3E,sBAAc,QAAQ,SAAS,CAAC,GAAI,CAAC;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,uBAAuB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC7D;AAEA,MAAI,MAAM,CAAC,IAAI,SAAS;AACtB,gBAAY,QAAQ,MAAM,CAAC,GAAG,OAAO;AACrC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,OAAO;AACL,WAAO,MAAM,KAAK;AAAA,EACpB;AACA,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AAEpD,SAAO;AACT;AAEA,SAAS,YAAY,QAAsB,UAAkB,MAAc;AACzE,KAAG;AACD,WAAO,MAAM,SAAS;AAAA,EACxB,SAAS,EAAE,WAAW;AACxB;;;AHtUO,SAAS,OAAO,UAAqC;AAC1D,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,QAAQ;AACxC,QAAM,UAA6B,CAAC;AACpC,MAAI,YAAY;AAChB,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,UAAM,OAAsB,CAAC;AAC7B,QAAI,SAAS;AACb,QAAI,UAAU;AACd,gBAAY;AAEZ,WAAO,OAAO,MAAM,MAAM;AACxB,UAAI;AAEJ,kBAAY,cAAc,QAAQ,SAAS;AAC3C,UAAI,YAAY,QAAS,UAAS;AAClC,gBAAU;AAEV,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAe,cAAc,QAAQ,YAAY;AACjD,qBAAa,cAAc,QAAQ,UAAU;AAC7C,uBAAe,cAAc,QAAQ,YAAY;AAEjD,YAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAa,cAAc,QAAQ,UAAU;AAC7C,gBAAM,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU;AAAA,QACtE,OAAO;AACL,gBAAM,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,QAC1D;AAAA,MACF,OAAO;AACL,cAAM,CAAC,SAAS;AAAA,MAClB;AAEA,WAAK,KAAK,GAAG;AACb,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,OAAQ,MAAK,IAAI;AACtB,YAAQ,KAAK,IAAI;AACjB,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,OAAO;AAEvB,SAAO;AACT;AAEA,SAAS,KAAK,MAA0B;AACtC,OAAK,KAAK,cAAc;AAC1B;AAEA,SAAS,eAAe,GAAqB,GAA6B;AACxE,SAAO,EAAE,CAAC,IAAI,EAAE,CAAC;AACnB;AAIO,SAAS,OAAO,SAA8C;AACnE,QAAM,SAAS,IAAI,aAAa;AAChC,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,QAAI,IAAI,EAAG,QAAO,MAAM,SAAS;AACjC,QAAI,KAAK,WAAW,EAAG;AAEvB,QAAI,YAAY;AAEhB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,UAAU,KAAK,CAAC;AACtB,UAAI,IAAI,EAAG,QAAO,MAAM,KAAK;AAE7B,kBAAY,cAAc,QAAQ,QAAQ,CAAC,GAAG,SAAS;AAEvD,UAAI,QAAQ,WAAW,EAAG;AAC1B,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAC7D,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AACzD,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAE7D,UAAI,QAAQ,WAAW,EAAG;AAC1B,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO,OAAO,MAAM;AACtB;", - "names": [] -} diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/package.json b/frontend/node_modules/@jridgewell/sourcemap-codec/package.json deleted file mode 100644 index da55137..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@jridgewell/sourcemap-codec", - "version": "1.5.5", - "description": "Encode/decode sourcemap mappings", - "keywords": [ - "sourcemap", - "vlq" - ], - "main": "dist/sourcemap-codec.umd.js", - "module": "dist/sourcemap-codec.mjs", - "types": "types/sourcemap-codec.d.cts", - "files": [ - "dist", - "src", - "types" - ], - "exports": { - ".": [ - { - "import": { - "types": "./types/sourcemap-codec.d.mts", - "default": "./dist/sourcemap-codec.mjs" - }, - "default": { - "types": "./types/sourcemap-codec.d.cts", - "default": "./dist/sourcemap-codec.umd.js" - } - }, - "./dist/sourcemap-codec.umd.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "benchmark": "run-s build:code benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node --expose-gc benchmark/index.js", - "build": "run-s -n build:code build:types", - "build:code": "node ../../esbuild.mjs sourcemap-codec.ts", - "build:types": "run-s build:types:force build:types:emit build:types:mts", - "build:types:force": "rimraf tsconfig.build.tsbuildinfo", - "build:types:emit": "tsc --project tsconfig.build.json", - "build:types:mts": "node ../../mts-types.mjs", - "clean": "run-s -n clean:code clean:types", - "clean:code": "tsc --build --clean tsconfig.build.json", - "clean:types": "rimraf dist types", - "test": "run-s -n test:types test:only test:format", - "test:format": "prettier --check '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:types": "eslint '{src,test}/**/*.ts'", - "lint": "run-s -n lint:types lint:format", - "lint:format": "npm run test:format -- --write", - "lint:types": "npm run test:types -- --fix", - "prepublishOnly": "npm run-s -n build test" - }, - "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/sourcemap-codec", - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/sourcemaps.git", - "directory": "packages/sourcemap-codec" - }, - "author": "Justin Ridgewell ", - "license": "MIT" -} diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts b/frontend/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts deleted file mode 100644 index d194c2f..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts +++ /dev/null @@ -1,345 +0,0 @@ -import { StringReader, StringWriter } from './strings'; -import { comma, decodeInteger, encodeInteger, hasMoreVlq, semicolon } from './vlq'; - -const EMPTY: any[] = []; - -type Line = number; -type Column = number; -type Kind = number; -type Name = number; -type Var = number; -type SourcesIndex = number; -type ScopesIndex = number; - -type Mix = (A & O) | (B & O); - -export type OriginalScope = Mix< - [Line, Column, Line, Column, Kind], - [Line, Column, Line, Column, Kind, Name], - { vars: Var[] } ->; - -export type GeneratedRange = Mix< - [Line, Column, Line, Column], - [Line, Column, Line, Column, SourcesIndex, ScopesIndex], - { - callsite: CallSite | null; - bindings: Binding[]; - isScope: boolean; - } ->; -export type CallSite = [SourcesIndex, Line, Column]; -type Binding = BindingExpressionRange[]; -export type BindingExpressionRange = [Name] | [Name, Line, Column]; - -export function decodeOriginalScopes(input: string): OriginalScope[] { - const { length } = input; - const reader = new StringReader(input); - const scopes: OriginalScope[] = []; - const stack: OriginalScope[] = []; - let line = 0; - - for (; reader.pos < length; reader.pos++) { - line = decodeInteger(reader, line); - const column = decodeInteger(reader, 0); - - if (!hasMoreVlq(reader, length)) { - const last = stack.pop()!; - last[2] = line; - last[3] = column; - continue; - } - - const kind = decodeInteger(reader, 0); - const fields = decodeInteger(reader, 0); - const hasName = fields & 0b0001; - - const scope: OriginalScope = ( - hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind] - ) as OriginalScope; - - let vars: Var[] = EMPTY; - if (hasMoreVlq(reader, length)) { - vars = []; - do { - const varsIndex = decodeInteger(reader, 0); - vars.push(varsIndex); - } while (hasMoreVlq(reader, length)); - } - scope.vars = vars; - - scopes.push(scope); - stack.push(scope); - } - - return scopes; -} - -export function encodeOriginalScopes(scopes: OriginalScope[]): string { - const writer = new StringWriter(); - - for (let i = 0; i < scopes.length; ) { - i = _encodeOriginalScopes(scopes, i, writer, [0]); - } - - return writer.flush(); -} - -function _encodeOriginalScopes( - scopes: OriginalScope[], - index: number, - writer: StringWriter, - state: [ - number, // GenColumn - ], -): number { - const scope = scopes[index]; - const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; - - if (index > 0) writer.write(comma); - - state[0] = encodeInteger(writer, startLine, state[0]); - encodeInteger(writer, startColumn, 0); - encodeInteger(writer, kind, 0); - - const fields = scope.length === 6 ? 0b0001 : 0; - encodeInteger(writer, fields, 0); - if (scope.length === 6) encodeInteger(writer, scope[5], 0); - - for (const v of vars) { - encodeInteger(writer, v, 0); - } - - for (index++; index < scopes.length; ) { - const next = scopes[index]; - const { 0: l, 1: c } = next; - if (l > endLine || (l === endLine && c >= endColumn)) { - break; - } - index = _encodeOriginalScopes(scopes, index, writer, state); - } - - writer.write(comma); - state[0] = encodeInteger(writer, endLine, state[0]); - encodeInteger(writer, endColumn, 0); - - return index; -} - -export function decodeGeneratedRanges(input: string): GeneratedRange[] { - const { length } = input; - const reader = new StringReader(input); - const ranges: GeneratedRange[] = []; - const stack: GeneratedRange[] = []; - - let genLine = 0; - let definitionSourcesIndex = 0; - let definitionScopeIndex = 0; - let callsiteSourcesIndex = 0; - let callsiteLine = 0; - let callsiteColumn = 0; - let bindingLine = 0; - let bindingColumn = 0; - - do { - const semi = reader.indexOf(';'); - let genColumn = 0; - - for (; reader.pos < semi; reader.pos++) { - genColumn = decodeInteger(reader, genColumn); - - if (!hasMoreVlq(reader, semi)) { - const last = stack.pop()!; - last[2] = genLine; - last[3] = genColumn; - continue; - } - - const fields = decodeInteger(reader, 0); - const hasDefinition = fields & 0b0001; - const hasCallsite = fields & 0b0010; - const hasScope = fields & 0b0100; - - let callsite: CallSite | null = null; - let bindings: Binding[] = EMPTY; - let range: GeneratedRange; - if (hasDefinition) { - const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); - definitionScopeIndex = decodeInteger( - reader, - definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0, - ); - - definitionSourcesIndex = defSourcesIndex; - range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex] as GeneratedRange; - } else { - range = [genLine, genColumn, 0, 0] as GeneratedRange; - } - - range.isScope = !!hasScope; - - if (hasCallsite) { - const prevCsi = callsiteSourcesIndex; - const prevLine = callsiteLine; - callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); - const sameSource = prevCsi === callsiteSourcesIndex; - callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); - callsiteColumn = decodeInteger( - reader, - sameSource && prevLine === callsiteLine ? callsiteColumn : 0, - ); - - callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; - } - range.callsite = callsite; - - if (hasMoreVlq(reader, semi)) { - bindings = []; - do { - bindingLine = genLine; - bindingColumn = genColumn; - const expressionsCount = decodeInteger(reader, 0); - let expressionRanges: BindingExpressionRange[]; - if (expressionsCount < -1) { - expressionRanges = [[decodeInteger(reader, 0)]]; - for (let i = -1; i > expressionsCount; i--) { - const prevBl = bindingLine; - bindingLine = decodeInteger(reader, bindingLine); - bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); - const expression = decodeInteger(reader, 0); - expressionRanges.push([expression, bindingLine, bindingColumn]); - } - } else { - expressionRanges = [[expressionsCount]]; - } - bindings.push(expressionRanges); - } while (hasMoreVlq(reader, semi)); - } - range.bindings = bindings; - - ranges.push(range); - stack.push(range); - } - - genLine++; - reader.pos = semi + 1; - } while (reader.pos < length); - - return ranges; -} - -export function encodeGeneratedRanges(ranges: GeneratedRange[]): string { - if (ranges.length === 0) return ''; - - const writer = new StringWriter(); - - for (let i = 0; i < ranges.length; ) { - i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); - } - - return writer.flush(); -} - -function _encodeGeneratedRanges( - ranges: GeneratedRange[], - index: number, - writer: StringWriter, - state: [ - number, // GenLine - number, // GenColumn - number, // DefSourcesIndex - number, // DefScopesIndex - number, // CallSourcesIndex - number, // CallLine - number, // CallColumn - ], -): number { - const range = ranges[index]; - const { - 0: startLine, - 1: startColumn, - 2: endLine, - 3: endColumn, - isScope, - callsite, - bindings, - } = range; - - if (state[0] < startLine) { - catchupLine(writer, state[0], startLine); - state[0] = startLine; - state[1] = 0; - } else if (index > 0) { - writer.write(comma); - } - - state[1] = encodeInteger(writer, range[1], state[1]); - - const fields = - (range.length === 6 ? 0b0001 : 0) | (callsite ? 0b0010 : 0) | (isScope ? 0b0100 : 0); - encodeInteger(writer, fields, 0); - - if (range.length === 6) { - const { 4: sourcesIndex, 5: scopesIndex } = range; - if (sourcesIndex !== state[2]) { - state[3] = 0; - } - state[2] = encodeInteger(writer, sourcesIndex, state[2]); - state[3] = encodeInteger(writer, scopesIndex, state[3]); - } - - if (callsite) { - const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite!; - if (sourcesIndex !== state[4]) { - state[5] = 0; - state[6] = 0; - } else if (callLine !== state[5]) { - state[6] = 0; - } - state[4] = encodeInteger(writer, sourcesIndex, state[4]); - state[5] = encodeInteger(writer, callLine, state[5]); - state[6] = encodeInteger(writer, callColumn, state[6]); - } - - if (bindings) { - for (const binding of bindings) { - if (binding.length > 1) encodeInteger(writer, -binding.length, 0); - const expression = binding[0][0]; - encodeInteger(writer, expression, 0); - let bindingStartLine = startLine; - let bindingStartColumn = startColumn; - for (let i = 1; i < binding.length; i++) { - const expRange = binding[i]; - bindingStartLine = encodeInteger(writer, expRange[1]!, bindingStartLine); - bindingStartColumn = encodeInteger(writer, expRange[2]!, bindingStartColumn); - encodeInteger(writer, expRange[0]!, 0); - } - } - } - - for (index++; index < ranges.length; ) { - const next = ranges[index]; - const { 0: l, 1: c } = next; - if (l > endLine || (l === endLine && c >= endColumn)) { - break; - } - index = _encodeGeneratedRanges(ranges, index, writer, state); - } - - if (state[0] < endLine) { - catchupLine(writer, state[0], endLine); - state[0] = endLine; - state[1] = 0; - } else { - writer.write(comma); - } - state[1] = encodeInteger(writer, endColumn, state[1]); - - return index; -} - -function catchupLine(writer: StringWriter, lastLine: number, line: number) { - do { - writer.write(semicolon); - } while (++lastLine < line); -} diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts b/frontend/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts deleted file mode 100644 index a81f894..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { comma, decodeInteger, encodeInteger, hasMoreVlq, semicolon } from './vlq'; -import { StringWriter, StringReader } from './strings'; - -export { - decodeOriginalScopes, - encodeOriginalScopes, - decodeGeneratedRanges, - encodeGeneratedRanges, -} from './scopes'; -export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes'; - -export type SourceMapSegment = - | [number] - | [number, number, number, number] - | [number, number, number, number, number]; -export type SourceMapLine = SourceMapSegment[]; -export type SourceMapMappings = SourceMapLine[]; - -export function decode(mappings: string): SourceMapMappings { - const { length } = mappings; - const reader = new StringReader(mappings); - const decoded: SourceMapMappings = []; - let genColumn = 0; - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - - do { - const semi = reader.indexOf(';'); - const line: SourceMapLine = []; - let sorted = true; - let lastCol = 0; - genColumn = 0; - - while (reader.pos < semi) { - let seg: SourceMapSegment; - - genColumn = decodeInteger(reader, genColumn); - if (genColumn < lastCol) sorted = false; - lastCol = genColumn; - - if (hasMoreVlq(reader, semi)) { - sourcesIndex = decodeInteger(reader, sourcesIndex); - sourceLine = decodeInteger(reader, sourceLine); - sourceColumn = decodeInteger(reader, sourceColumn); - - if (hasMoreVlq(reader, semi)) { - namesIndex = decodeInteger(reader, namesIndex); - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; - } else { - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; - } - } else { - seg = [genColumn]; - } - - line.push(seg); - reader.pos++; - } - - if (!sorted) sort(line); - decoded.push(line); - reader.pos = semi + 1; - } while (reader.pos <= length); - - return decoded; -} - -function sort(line: SourceMapSegment[]) { - line.sort(sortComparator); -} - -function sortComparator(a: SourceMapSegment, b: SourceMapSegment): number { - return a[0] - b[0]; -} - -export function encode(decoded: SourceMapMappings): string; -export function encode(decoded: Readonly): string; -export function encode(decoded: Readonly): string { - const writer = new StringWriter(); - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) writer.write(semicolon); - if (line.length === 0) continue; - - let genColumn = 0; - - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - if (j > 0) writer.write(comma); - - genColumn = encodeInteger(writer, segment[0], genColumn); - - if (segment.length === 1) continue; - sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); - sourceLine = encodeInteger(writer, segment[2], sourceLine); - sourceColumn = encodeInteger(writer, segment[3], sourceColumn); - - if (segment.length === 4) continue; - namesIndex = encodeInteger(writer, segment[4], namesIndex); - } - } - - return writer.flush(); -} diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/src/strings.ts b/frontend/node_modules/@jridgewell/sourcemap-codec/src/strings.ts deleted file mode 100644 index d161965..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/src/strings.ts +++ /dev/null @@ -1,65 +0,0 @@ -const bufLength = 1024 * 16; - -// Provide a fallback for older environments. -const td = - typeof TextDecoder !== 'undefined' - ? /* #__PURE__ */ new TextDecoder() - : typeof Buffer !== 'undefined' - ? { - decode(buf: Uint8Array): string { - const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); - return out.toString(); - }, - } - : { - decode(buf: Uint8Array): string { - let out = ''; - for (let i = 0; i < buf.length; i++) { - out += String.fromCharCode(buf[i]); - } - return out; - }, - }; - -export class StringWriter { - pos = 0; - private out = ''; - private buffer = new Uint8Array(bufLength); - - write(v: number): void { - const { buffer } = this; - buffer[this.pos++] = v; - if (this.pos === bufLength) { - this.out += td.decode(buffer); - this.pos = 0; - } - } - - flush(): string { - const { buffer, out, pos } = this; - return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; - } -} - -export class StringReader { - pos = 0; - declare private buffer: string; - - constructor(buffer: string) { - this.buffer = buffer; - } - - next(): number { - return this.buffer.charCodeAt(this.pos++); - } - - peek(): number { - return this.buffer.charCodeAt(this.pos); - } - - indexOf(char: string): number { - const { buffer, pos } = this; - const idx = buffer.indexOf(char, pos); - return idx === -1 ? buffer.length : idx; - } -} diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts b/frontend/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts deleted file mode 100644 index a42c681..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { StringReader, StringWriter } from './strings'; - -export const comma = ','.charCodeAt(0); -export const semicolon = ';'.charCodeAt(0); - -const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; -const intToChar = new Uint8Array(64); // 64 possible chars. -const charToInt = new Uint8Array(128); // z is 122 in ASCII - -for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - intToChar[i] = c; - charToInt[c] = i; -} - -export function decodeInteger(reader: StringReader, relative: number): number { - let value = 0; - let shift = 0; - let integer = 0; - - do { - const c = reader.next(); - integer = charToInt[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - - const shouldNegate = value & 1; - value >>>= 1; - - if (shouldNegate) { - value = -0x80000000 | -value; - } - - return relative + value; -} - -export function encodeInteger(builder: StringWriter, num: number, relative: number): number { - let delta = num - relative; - - delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; - do { - let clamped = delta & 0b011111; - delta >>>= 5; - if (delta > 0) clamped |= 0b100000; - builder.write(intToChar[clamped]); - } while (delta > 0); - - return num; -} - -export function hasMoreVlq(reader: StringReader, max: number) { - if (reader.pos >= max) return false; - return reader.peek() !== comma; -} diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts b/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts deleted file mode 100644 index c583c75..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts +++ /dev/null @@ -1,50 +0,0 @@ -type Line = number; -type Column = number; -type Kind = number; -type Name = number; -type Var = number; -type SourcesIndex = number; -type ScopesIndex = number; -type Mix = (A & O) | (B & O); -export type OriginalScope = Mix<[ - Line, - Column, - Line, - Column, - Kind -], [ - Line, - Column, - Line, - Column, - Kind, - Name -], { - vars: Var[]; -}>; -export type GeneratedRange = Mix<[ - Line, - Column, - Line, - Column -], [ - Line, - Column, - Line, - Column, - SourcesIndex, - ScopesIndex -], { - callsite: CallSite | null; - bindings: Binding[]; - isScope: boolean; -}>; -export type CallSite = [SourcesIndex, Line, Column]; -type Binding = BindingExpressionRange[]; -export type BindingExpressionRange = [Name] | [Name, Line, Column]; -export declare function decodeOriginalScopes(input: string): OriginalScope[]; -export declare function encodeOriginalScopes(scopes: OriginalScope[]): string; -export declare function decodeGeneratedRanges(input: string): GeneratedRange[]; -export declare function encodeGeneratedRanges(ranges: GeneratedRange[]): string; -export {}; -//# sourceMappingURL=scopes.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map b/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map deleted file mode 100644 index 630e647..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,MAAM,GAAG,MAAM,CAAC;AACrB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,GAAG,CAC7B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;CAAC,EAClC;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,IAAI;CAAC,EACxC;IAAE,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,GAAG,CAC9B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;CAAC,EAC5B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,YAAY;IAAE,WAAW;CAAC,EACvD;IACE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CACF,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,KAAK,OAAO,GAAG,sBAAsB,EAAE,CAAC;AACxC,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAyCnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAQpE;AA2CD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAoGrE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAUtE"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts b/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts deleted file mode 100644 index c583c75..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts +++ /dev/null @@ -1,50 +0,0 @@ -type Line = number; -type Column = number; -type Kind = number; -type Name = number; -type Var = number; -type SourcesIndex = number; -type ScopesIndex = number; -type Mix = (A & O) | (B & O); -export type OriginalScope = Mix<[ - Line, - Column, - Line, - Column, - Kind -], [ - Line, - Column, - Line, - Column, - Kind, - Name -], { - vars: Var[]; -}>; -export type GeneratedRange = Mix<[ - Line, - Column, - Line, - Column -], [ - Line, - Column, - Line, - Column, - SourcesIndex, - ScopesIndex -], { - callsite: CallSite | null; - bindings: Binding[]; - isScope: boolean; -}>; -export type CallSite = [SourcesIndex, Line, Column]; -type Binding = BindingExpressionRange[]; -export type BindingExpressionRange = [Name] | [Name, Line, Column]; -export declare function decodeOriginalScopes(input: string): OriginalScope[]; -export declare function encodeOriginalScopes(scopes: OriginalScope[]): string; -export declare function decodeGeneratedRanges(input: string): GeneratedRange[]; -export declare function encodeGeneratedRanges(ranges: GeneratedRange[]): string; -export {}; -//# sourceMappingURL=scopes.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map b/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map deleted file mode 100644 index 630e647..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,MAAM,GAAG,MAAM,CAAC;AACrB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,GAAG,CAC7B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;CAAC,EAClC;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,IAAI;CAAC,EACxC;IAAE,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,GAAG,CAC9B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;CAAC,EAC5B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,YAAY;IAAE,WAAW;CAAC,EACvD;IACE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CACF,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,KAAK,OAAO,GAAG,sBAAsB,EAAE,CAAC;AACxC,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAyCnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAQpE;AA2CD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAoGrE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAUtE"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts b/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts deleted file mode 100644 index 5f35e22..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -export { decodeOriginalScopes, encodeOriginalScopes, decodeGeneratedRanges, encodeGeneratedRanges, } from './scopes.cts'; -export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes.cts'; -export type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; -export type SourceMapLine = SourceMapSegment[]; -export type SourceMapMappings = SourceMapLine[]; -export declare function decode(mappings: string): SourceMapMappings; -export declare function encode(decoded: SourceMapMappings): string; -export declare function encode(decoded: Readonly): string; -//# sourceMappingURL=sourcemap-codec.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map b/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map deleted file mode 100644 index 7123d52..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-codec.d.ts","sourceRoot":"","sources":["../src/sourcemap-codec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,CAAC,MAAM,CAAC,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAEhD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiD1D;AAUD,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC3D,wBAAgB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts b/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts deleted file mode 100644 index 199fb9f..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts +++ /dev/null @@ -1,9 +0,0 @@ -export { decodeOriginalScopes, encodeOriginalScopes, decodeGeneratedRanges, encodeGeneratedRanges, } from './scopes.mts'; -export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes.mts'; -export type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; -export type SourceMapLine = SourceMapSegment[]; -export type SourceMapMappings = SourceMapLine[]; -export declare function decode(mappings: string): SourceMapMappings; -export declare function encode(decoded: SourceMapMappings): string; -export declare function encode(decoded: Readonly): string; -//# sourceMappingURL=sourcemap-codec.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map b/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map deleted file mode 100644 index 7123d52..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-codec.d.ts","sourceRoot":"","sources":["../src/sourcemap-codec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,CAAC,MAAM,CAAC,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAEhD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiD1D;AAUD,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC3D,wBAAgB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts b/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts deleted file mode 100644 index 62faceb..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts +++ /dev/null @@ -1,16 +0,0 @@ -export declare class StringWriter { - pos: number; - private out; - private buffer; - write(v: number): void; - flush(): string; -} -export declare class StringReader { - pos: number; - private buffer; - constructor(buffer: string); - next(): number; - peek(): number; - indexOf(char: string): number; -} -//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map b/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map deleted file mode 100644 index d3602da..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAuBA,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,MAAM,CAA6B;IAE3C,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAStB,KAAK,IAAI,MAAM;CAIhB;AAED,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,QAAgB,MAAM,CAAS;gBAEnB,MAAM,EAAE,MAAM;IAI1B,IAAI,IAAI,MAAM;IAId,IAAI,IAAI,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK9B"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts b/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts deleted file mode 100644 index 62faceb..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts +++ /dev/null @@ -1,16 +0,0 @@ -export declare class StringWriter { - pos: number; - private out; - private buffer; - write(v: number): void; - flush(): string; -} -export declare class StringReader { - pos: number; - private buffer; - constructor(buffer: string); - next(): number; - peek(): number; - indexOf(char: string): number; -} -//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map b/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map deleted file mode 100644 index d3602da..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAuBA,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,MAAM,CAA6B;IAE3C,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAStB,KAAK,IAAI,MAAM;CAIhB;AAED,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,QAAgB,MAAM,CAAS;gBAEnB,MAAM,EAAE,MAAM;IAI1B,IAAI,IAAI,MAAM;IAId,IAAI,IAAI,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK9B"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts b/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts deleted file mode 100644 index dbd6602..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts +++ /dev/null @@ -1,7 +0,0 @@ -import type { StringReader, StringWriter } from './strings.cts'; -export declare const comma: number; -export declare const semicolon: number; -export declare function decodeInteger(reader: StringReader, relative: number): number; -export declare function encodeInteger(builder: StringWriter, num: number, relative: number): number; -export declare function hasMoreVlq(reader: StringReader, max: number): boolean; -//# sourceMappingURL=vlq.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map b/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map deleted file mode 100644 index 6fdc356..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vlq.d.ts","sourceRoot":"","sources":["../src/vlq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,eAAO,MAAM,KAAK,QAAoB,CAAC;AACvC,eAAO,MAAM,SAAS,QAAoB,CAAC;AAY3C,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY1F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,WAG3D"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts b/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts deleted file mode 100644 index 2c739bc..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts +++ /dev/null @@ -1,7 +0,0 @@ -import type { StringReader, StringWriter } from './strings.mts'; -export declare const comma: number; -export declare const semicolon: number; -export declare function decodeInteger(reader: StringReader, relative: number): number; -export declare function encodeInteger(builder: StringWriter, num: number, relative: number): number; -export declare function hasMoreVlq(reader: StringReader, max: number): boolean; -//# sourceMappingURL=vlq.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map b/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map deleted file mode 100644 index 6fdc356..0000000 --- a/frontend/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vlq.d.ts","sourceRoot":"","sources":["../src/vlq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,eAAO,MAAM,KAAK,QAAoB,CAAC;AACvC,eAAO,MAAM,SAAS,QAAoB,CAAC;AAY3C,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY1F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,WAG3D"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/LICENSE b/frontend/node_modules/@jridgewell/trace-mapping/LICENSE deleted file mode 100644 index 1f6ce94..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2024 Justin Ridgewell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/frontend/node_modules/@jridgewell/trace-mapping/README.md b/frontend/node_modules/@jridgewell/trace-mapping/README.md deleted file mode 100644 index 9fc0ed0..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/README.md +++ /dev/null @@ -1,348 +0,0 @@ -# @jridgewell/trace-mapping - -> Trace the original position through a source map - -`trace-mapping` allows you to take the line and column of an output file and trace it to the -original location in the source file through a source map. - -You may already be familiar with the [`source-map`][source-map] package's `SourceMapConsumer`. This -provides the same `originalPositionFor` and `generatedPositionFor` API, without requiring WASM. - -## Installation - -```sh -npm install @jridgewell/trace-mapping -``` - -## Usage - -```typescript -import { - TraceMap, - originalPositionFor, - generatedPositionFor, - sourceContentFor, - isIgnored, -} from '@jridgewell/trace-mapping'; - -const tracer = new TraceMap({ - version: 3, - sources: ['input.js'], - sourcesContent: ['content of input.js'], - names: ['foo'], - mappings: 'KAyCIA', - ignoreList: [], -}); - -// Lines start at line 1, columns at column 0. -const traced = originalPositionFor(tracer, { line: 1, column: 5 }); -assert.deepEqual(traced, { - source: 'input.js', - line: 42, - column: 4, - name: 'foo', -}); - -const content = sourceContentFor(tracer, traced.source); -assert.strictEqual(content, 'content for input.js'); - -const generated = generatedPositionFor(tracer, { - source: 'input.js', - line: 42, - column: 4, -}); -assert.deepEqual(generated, { - line: 1, - column: 5, -}); - -const ignored = isIgnored(tracer, 'input.js'); -assert.equal(ignored, false); -``` - -We also provide a lower level API to get the actual segment that matches our line and column. Unlike -`originalPositionFor`, `traceSegment` uses a 0-base for `line`: - -```typescript -import { traceSegment } from '@jridgewell/trace-mapping'; - -// line is 0-base. -const traced = traceSegment(tracer, /* line */ 0, /* column */ 5); - -// Segments are [outputColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] -// Again, line is 0-base and so is sourceLine -assert.deepEqual(traced, [5, 0, 41, 4, 0]); -``` - -### SectionedSourceMaps - -The sourcemap spec defines a special `sections` field that's designed to handle concatenation of -output code with associated sourcemaps. This type of sourcemap is rarely used (no major build tool -produces it), but if you are hand coding a concatenation you may need it. We provide an `AnyMap` -helper that can receive either a regular sourcemap or a `SectionedSourceMap` and returns a -`TraceMap` instance: - -```typescript -import { AnyMap } from '@jridgewell/trace-mapping'; -const fooOutput = 'foo'; -const barOutput = 'bar'; -const output = [fooOutput, barOutput].join('\n'); - -const sectioned = new AnyMap({ - version: 3, - sections: [ - { - // 0-base line and column - offset: { line: 0, column: 0 }, - // fooOutput's sourcemap - map: { - version: 3, - sources: ['foo.js'], - names: ['foo'], - mappings: 'AAAAA', - }, - }, - { - // barOutput's sourcemap will not affect the first line, only the second - offset: { line: 1, column: 0 }, - map: { - version: 3, - sources: ['bar.js'], - names: ['bar'], - mappings: 'AAAAA', - }, - }, - ], -}); - -const traced = originalPositionFor(sectioned, { - line: 2, - column: 0, -}); - -assert.deepEqual(traced, { - source: 'bar.js', - line: 1, - column: 0, - name: 'bar', -}); -``` - -## Benchmarks - -``` -node v20.10.0 - -amp.js.map - 45120 segments - -Memory Usage: -trace-mapping decoded 414164 bytes -trace-mapping encoded 6274352 bytes -source-map-js 10968904 bytes -source-map-0.6.1 17587160 bytes -source-map-0.8.0 8812155 bytes -Chrome dev tools 8672912 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 205 ops/sec ±0.19% (88 runs sampled) -trace-mapping: encoded JSON input x 405 ops/sec ±1.47% (88 runs sampled) -trace-mapping: decoded Object input x 4,645 ops/sec ±0.15% (98 runs sampled) -trace-mapping: encoded Object input x 458 ops/sec ±1.63% (91 runs sampled) -source-map-js: encoded Object input x 75.48 ops/sec ±1.64% (67 runs sampled) -source-map-0.6.1: encoded Object input x 39.37 ops/sec ±1.44% (53 runs sampled) -Chrome dev tools: encoded Object input x 150 ops/sec ±1.76% (79 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 44,946 ops/sec ±0.16% (99 runs sampled) -trace-mapping: encoded originalPositionFor x 37,995 ops/sec ±1.81% (89 runs sampled) -source-map-js: encoded originalPositionFor x 9,230 ops/sec ±1.36% (93 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 8,057 ops/sec ±0.84% (96 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 28,198 ops/sec ±1.12% (91 runs sampled) -Chrome dev tools: encoded originalPositionFor x 46,276 ops/sec ±1.35% (95 runs sampled) -Fastest is Chrome dev tools: encoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 204,406 ops/sec ±0.19% (97 runs sampled) -trace-mapping: encoded originalPositionFor x 196,695 ops/sec ±0.24% (99 runs sampled) -source-map-js: encoded originalPositionFor x 11,948 ops/sec ±0.94% (99 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 10,730 ops/sec ±0.36% (100 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 51,427 ops/sec ±0.21% (98 runs sampled) -Chrome dev tools: encoded originalPositionFor x 162,615 ops/sec ±0.18% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -babel.min.js.map - 347793 segments - -Memory Usage: -trace-mapping decoded 18504 bytes -trace-mapping encoded 35428008 bytes -source-map-js 51676808 bytes -source-map-0.6.1 63367136 bytes -source-map-0.8.0 43158400 bytes -Chrome dev tools 50721552 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 17.82 ops/sec ±6.35% (35 runs sampled) -trace-mapping: encoded JSON input x 31.57 ops/sec ±7.50% (43 runs sampled) -trace-mapping: decoded Object input x 867 ops/sec ±0.74% (94 runs sampled) -trace-mapping: encoded Object input x 33.83 ops/sec ±7.66% (46 runs sampled) -source-map-js: encoded Object input x 6.58 ops/sec ±3.31% (20 runs sampled) -source-map-0.6.1: encoded Object input x 4.23 ops/sec ±3.43% (15 runs sampled) -Chrome dev tools: encoded Object input x 22.14 ops/sec ±3.79% (41 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 78,234 ops/sec ±1.48% (29 runs sampled) -trace-mapping: encoded originalPositionFor x 60,761 ops/sec ±1.35% (21 runs sampled) -source-map-js: encoded originalPositionFor x 51,448 ops/sec ±2.17% (89 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 47,221 ops/sec ±1.99% (15 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 84,002 ops/sec ±1.45% (27 runs sampled) -Chrome dev tools: encoded originalPositionFor x 106,457 ops/sec ±1.38% (37 runs sampled) -Fastest is Chrome dev tools: encoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 930,943 ops/sec ±0.25% (99 runs sampled) -trace-mapping: encoded originalPositionFor x 843,545 ops/sec ±0.34% (97 runs sampled) -source-map-js: encoded originalPositionFor x 114,510 ops/sec ±1.37% (36 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 87,412 ops/sec ±0.72% (92 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 197,709 ops/sec ±0.89% (59 runs sampled) -Chrome dev tools: encoded originalPositionFor x 688,983 ops/sec ±0.33% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -preact.js.map - 1992 segments - -Memory Usage: -trace-mapping decoded 33136 bytes -trace-mapping encoded 254240 bytes -source-map-js 837488 bytes -source-map-0.6.1 961928 bytes -source-map-0.8.0 54384 bytes -Chrome dev tools 709680 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 3,709 ops/sec ±0.13% (99 runs sampled) -trace-mapping: encoded JSON input x 6,447 ops/sec ±0.22% (101 runs sampled) -trace-mapping: decoded Object input x 83,062 ops/sec ±0.23% (100 runs sampled) -trace-mapping: encoded Object input x 14,980 ops/sec ±0.28% (100 runs sampled) -source-map-js: encoded Object input x 2,544 ops/sec ±0.16% (99 runs sampled) -source-map-0.6.1: encoded Object input x 1,221 ops/sec ±0.37% (97 runs sampled) -Chrome dev tools: encoded Object input x 4,241 ops/sec ±0.39% (93 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 91,028 ops/sec ±0.14% (94 runs sampled) -trace-mapping: encoded originalPositionFor x 84,348 ops/sec ±0.26% (98 runs sampled) -source-map-js: encoded originalPositionFor x 26,998 ops/sec ±0.23% (98 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 18,049 ops/sec ±0.26% (100 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 41,916 ops/sec ±0.28% (98 runs sampled) -Chrome dev tools: encoded originalPositionFor x 88,616 ops/sec ±0.14% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 319,960 ops/sec ±0.16% (100 runs sampled) -trace-mapping: encoded originalPositionFor x 302,153 ops/sec ±0.18% (100 runs sampled) -source-map-js: encoded originalPositionFor x 35,574 ops/sec ±0.19% (100 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 19,943 ops/sec ±0.12% (101 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 54,648 ops/sec ±0.20% (99 runs sampled) -Chrome dev tools: encoded originalPositionFor x 278,319 ops/sec ±0.17% (102 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -react.js.map - 5726 segments - -Memory Usage: -trace-mapping decoded 10872 bytes -trace-mapping encoded 681512 bytes -source-map-js 2563944 bytes -source-map-0.6.1 2150864 bytes -source-map-0.8.0 88680 bytes -Chrome dev tools 1149576 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 1,887 ops/sec ±0.28% (99 runs sampled) -trace-mapping: encoded JSON input x 4,749 ops/sec ±0.48% (97 runs sampled) -trace-mapping: decoded Object input x 74,236 ops/sec ±0.11% (99 runs sampled) -trace-mapping: encoded Object input x 5,752 ops/sec ±0.38% (100 runs sampled) -source-map-js: encoded Object input x 806 ops/sec ±0.19% (97 runs sampled) -source-map-0.6.1: encoded Object input x 418 ops/sec ±0.33% (94 runs sampled) -Chrome dev tools: encoded Object input x 1,524 ops/sec ±0.57% (92 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 620,201 ops/sec ±0.33% (96 runs sampled) -trace-mapping: encoded originalPositionFor x 579,548 ops/sec ±0.35% (97 runs sampled) -source-map-js: encoded originalPositionFor x 230,983 ops/sec ±0.62% (54 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 158,145 ops/sec ±0.80% (46 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 343,801 ops/sec ±0.55% (96 runs sampled) -Chrome dev tools: encoded originalPositionFor x 659,649 ops/sec ±0.49% (98 runs sampled) -Fastest is Chrome dev tools: encoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 2,368,079 ops/sec ±0.32% (98 runs sampled) -trace-mapping: encoded originalPositionFor x 2,134,039 ops/sec ±2.72% (87 runs sampled) -source-map-js: encoded originalPositionFor x 290,120 ops/sec ±2.49% (82 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 187,613 ops/sec ±0.86% (49 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 479,569 ops/sec ±0.65% (96 runs sampled) -Chrome dev tools: encoded originalPositionFor x 2,048,414 ops/sec ±0.24% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -vscode.map - 2141001 segments - -Memory Usage: -trace-mapping decoded 5206584 bytes -trace-mapping encoded 208370336 bytes -source-map-js 278493008 bytes -source-map-0.6.1 391564048 bytes -source-map-0.8.0 257508787 bytes -Chrome dev tools 291053000 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 1.63 ops/sec ±33.88% (9 runs sampled) -trace-mapping: encoded JSON input x 3.29 ops/sec ±36.13% (13 runs sampled) -trace-mapping: decoded Object input x 103 ops/sec ±0.93% (77 runs sampled) -trace-mapping: encoded Object input x 5.42 ops/sec ±28.54% (19 runs sampled) -source-map-js: encoded Object input x 1.07 ops/sec ±13.84% (7 runs sampled) -source-map-0.6.1: encoded Object input x 0.60 ops/sec ±2.43% (6 runs sampled) -Chrome dev tools: encoded Object input x 2.61 ops/sec ±22.00% (11 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 257,019 ops/sec ±0.97% (93 runs sampled) -trace-mapping: encoded originalPositionFor x 179,163 ops/sec ±0.83% (92 runs sampled) -source-map-js: encoded originalPositionFor x 73,337 ops/sec ±1.35% (87 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 38,797 ops/sec ±1.66% (88 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 107,758 ops/sec ±1.94% (45 runs sampled) -Chrome dev tools: encoded originalPositionFor x 188,550 ops/sec ±1.85% (79 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 447,621 ops/sec ±3.64% (94 runs sampled) -trace-mapping: encoded originalPositionFor x 323,698 ops/sec ±5.20% (88 runs sampled) -source-map-js: encoded originalPositionFor x 78,387 ops/sec ±1.69% (89 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 41,016 ops/sec ±3.01% (25 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 124,204 ops/sec ±0.90% (92 runs sampled) -Chrome dev tools: encoded originalPositionFor x 230,087 ops/sec ±2.61% (93 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor -``` - -[source-map]: https://www.npmjs.com/package/source-map diff --git a/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs b/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs deleted file mode 100644 index 73a95c7..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +++ /dev/null @@ -1,493 +0,0 @@ -// src/trace-mapping.ts -import { encode, decode } from "@jridgewell/sourcemap-codec"; - -// src/resolve.ts -import resolveUri from "@jridgewell/resolve-uri"; - -// src/strip-filename.ts -function stripFilename(path) { - if (!path) return ""; - const index = path.lastIndexOf("/"); - return path.slice(0, index + 1); -} - -// src/resolve.ts -function resolver(mapUrl, sourceRoot) { - const from = stripFilename(mapUrl); - const prefix = sourceRoot ? sourceRoot + "/" : ""; - return (source) => resolveUri(prefix + (source || ""), from); -} - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; -var REV_GENERATED_LINE = 1; -var REV_GENERATED_COLUMN = 2; - -// src/sort.ts -function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) return mappings; - if (!owned) mappings = mappings.slice(); - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; -} -function nextUnsortedSegmentLine(mappings, start) { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) return i; - } - return mappings.length; -} -function isSorted(line) { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN] < line[j - 1][COLUMN]) { - return false; - } - } - return true; -} -function sortSegments(line, owned) { - if (!owned) line = line.slice(); - return line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[COLUMN] - b[COLUMN]; -} - -// src/by-source.ts -function buildBySources(decoded, memos) { - const sources = memos.map(() => []); - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - if (seg.length === 1) continue; - const sourceIndex2 = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - const source = sources[sourceIndex2]; - const segs = source[sourceLine] || (source[sourceLine] = []); - segs.push([sourceColumn, i, seg[COLUMN]]); - } - } - for (let i = 0; i < sources.length; i++) { - const source = sources[i]; - for (let j = 0; j < source.length; j++) { - const line = source[j]; - if (line) line.sort(sortComparator); - } - } - return sources; -} - -// src/binary-search.ts -var found = false; -function binarySearch(haystack, needle, low, high) { - while (low <= high) { - const mid = low + (high - low >> 1); - const cmp = haystack[mid][COLUMN] - needle; - if (cmp === 0) { - found = true; - return mid; - } - if (cmp < 0) { - low = mid + 1; - } else { - high = mid - 1; - } - } - found = false; - return low - 1; -} -function upperBound(haystack, needle, index) { - for (let i = index + 1; i < haystack.length; index = i++) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} -function lowerBound(haystack, needle, index) { - for (let i = index - 1; i >= 0; index = i--) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} -function memoizedState() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1 - }; -} -function memoizedBinarySearch(haystack, needle, state, key) { - const { lastKey, lastNeedle, lastIndex } = state; - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; - return lastIndex; - } - if (needle >= lastNeedle) { - low = lastIndex === -1 ? 0 : lastIndex; - } else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return state.lastIndex = binarySearch(haystack, needle, low, high); -} - -// src/types.ts -function parse(map) { - return typeof map === "string" ? JSON.parse(map) : map; -} - -// src/flatten-map.ts -var FlattenMap = function(map, mapUrl) { - const parsed = parse(map); - if (!("sections" in parsed)) { - return new TraceMap(parsed, mapUrl); - } - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - const ignoreList = []; - recurse( - parsed, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - 0, - 0, - Infinity, - Infinity - ); - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - ignoreList - }; - return presortedDecodedMap(joined); -}; -function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { - const { sections } = input; - for (let i = 0; i < sections.length; i++) { - const { map, offset } = sections[i]; - let sl = stopLine; - let sc = stopColumn; - if (i + 1 < sections.length) { - const nextOffset = sections[i + 1].offset; - sl = Math.min(stopLine, lineOffset + nextOffset.line); - if (sl === stopLine) { - sc = Math.min(stopColumn, columnOffset + nextOffset.column); - } else if (sl < stopLine) { - sc = columnOffset + nextOffset.column; - } - } - addSection( - map, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - lineOffset + offset.line, - columnOffset + offset.column, - sl, - sc - ); - } -} -function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { - const parsed = parse(input); - if ("sections" in parsed) return recurse(...arguments); - const map = new TraceMap(parsed, mapUrl); - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; - append(sources, resolvedSources); - append(names, map.names); - if (contents) append(sourcesContent, contents); - else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); - if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); - for (let i = 0; i < decoded.length; i++) { - const lineI = lineOffset + i; - if (lineI > stopLine) return; - const out = getLine(mappings, lineI); - const cOffset = i === 0 ? columnOffset : 0; - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN]; - if (lineI === stopLine && column >= stopColumn) return; - if (seg.length === 1) { - out.push([column]); - continue; - } - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - out.push( - seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]] - ); - } - } -} -function append(arr, other) { - for (let i = 0; i < other.length; i++) arr.push(other[i]); -} -function getLine(arr, index) { - for (let i = arr.length; i <= index; i++) arr[i] = []; - return arr[index]; -} - -// src/trace-mapping.ts -var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; -var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; -var LEAST_UPPER_BOUND = -1; -var GREATEST_LOWER_BOUND = 1; -var TraceMap = class { - constructor(map, mapUrl) { - const isString = typeof map === "string"; - if (!isString && map._decodedMemo) return map; - const parsed = parse(map); - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names || []; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; - const resolve = resolver(mapUrl, sourceRoot); - this.resolvedSources = sources.map(resolve); - const { mappings } = parsed; - if (typeof mappings === "string") { - this._encoded = mappings; - this._decoded = void 0; - } else if (Array.isArray(mappings)) { - this._encoded = void 0; - this._decoded = maybeSort(mappings, isString); - } else if (parsed.sections) { - throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); - } else { - throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); - } - this._decodedMemo = memoizedState(); - this._bySources = void 0; - this._bySourceMemos = void 0; - } -}; -function cast(map) { - return map; -} -function encodedMappings(map) { - var _a, _b; - return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = encode(cast(map)._decoded); -} -function decodedMappings(map) { - var _a; - return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded)); -} -function traceSegment(map, line, column) { - const decoded = decodedMappings(map); - if (line >= decoded.length) return null; - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - GREATEST_LOWER_BOUND - ); - return index === -1 ? null : segments[index]; -} -function originalPositionFor(map, needle) { - let { line, column, bias } = needle; - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - const decoded = decodedMappings(map); - if (line >= decoded.length) return OMapping(null, null, null, null); - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - bias || GREATEST_LOWER_BOUND - ); - if (index === -1) return OMapping(null, null, null, null); - const segment = segments[index]; - if (segment.length === 1) return OMapping(null, null, null, null); - const { names, resolvedSources } = map; - return OMapping( - resolvedSources[segment[SOURCES_INDEX]], - segment[SOURCE_LINE] + 1, - segment[SOURCE_COLUMN], - segment.length === 5 ? names[segment[NAMES_INDEX]] : null - ); -} -function generatedPositionFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); -} -function allGeneratedPositionsFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); -} -function eachMapping(map, cb) { - const decoded = decodedMappings(map); - const { names, resolvedSources } = map; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generatedLine = i + 1; - const generatedColumn = seg[0]; - let source = null; - let originalLine = null; - let originalColumn = null; - let name = null; - if (seg.length !== 1) { - source = resolvedSources[seg[1]]; - originalLine = seg[2] + 1; - originalColumn = seg[3]; - } - if (seg.length === 5) name = names[seg[4]]; - cb({ - generatedLine, - generatedColumn, - source, - originalLine, - originalColumn, - name - }); - } - } -} -function sourceIndex(map, source) { - const { sources, resolvedSources } = map; - let index = sources.indexOf(source); - if (index === -1) index = resolvedSources.indexOf(source); - return index; -} -function sourceContentFor(map, source) { - const { sourcesContent } = map; - if (sourcesContent == null) return null; - const index = sourceIndex(map, source); - return index === -1 ? null : sourcesContent[index]; -} -function isIgnored(map, source) { - const { ignoreList } = map; - if (ignoreList == null) return false; - const index = sourceIndex(map, source); - return index === -1 ? false : ignoreList.includes(index); -} -function presortedDecodedMap(map, mapUrl) { - const tracer = new TraceMap(clone(map, []), mapUrl); - cast(tracer)._decoded = map.mappings; - return tracer; -} -function decodedMap(map) { - return clone(map, decodedMappings(map)); -} -function encodedMap(map) { - return clone(map, encodedMappings(map)); -} -function clone(map, mappings) { - return { - version: map.version, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings, - ignoreList: map.ignoreList || map.x_google_ignoreList - }; -} -function OMapping(source, line, column, name) { - return { source, line, column, name }; -} -function GMapping(line, column) { - return { line, column }; -} -function traceSegmentInternal(segments, memo, line, column, bias) { - let index = memoizedBinarySearch(segments, column, memo, line); - if (found) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } else if (bias === LEAST_UPPER_BOUND) index++; - if (index === -1 || index === segments.length) return -1; - return index; -} -function sliceGeneratedPositions(segments, memo, line, column, bias) { - let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); - if (!found && bias === LEAST_UPPER_BOUND) min++; - if (min === -1 || min === segments.length) return []; - const matchedColumn = found ? column : segments[min][COLUMN]; - if (!found) min = lowerBound(segments, matchedColumn, min); - const max = upperBound(segments, matchedColumn, min); - const result = []; - for (; min <= max; min++) { - const segment = segments[min]; - result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); - } - return result; -} -function generatedPosition(map, source, line, column, bias, all) { - var _a, _b; - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - const { sources, resolvedSources } = map; - let sourceIndex2 = sources.indexOf(source); - if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); - if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); - const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState)); - const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos)); - const segments = generated[sourceIndex2][line]; - if (segments == null) return all ? [] : GMapping(null, null); - const memo = bySourceMemos[sourceIndex2]; - if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); - const index = traceSegmentInternal(segments, memo, line, column, bias); - if (index === -1) return GMapping(null, null); - const segment = segments[index]; - return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); -} -export { - FlattenMap as AnyMap, - FlattenMap, - GREATEST_LOWER_BOUND, - LEAST_UPPER_BOUND, - TraceMap, - allGeneratedPositionsFor, - decodedMap, - decodedMappings, - eachMapping, - encodedMap, - encodedMappings, - generatedPositionFor, - isIgnored, - originalPositionFor, - presortedDecodedMap, - sourceContentFor, - traceSegment -}; -//# sourceMappingURL=trace-mapping.mjs.map diff --git a/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map b/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map deleted file mode 100644 index a789581..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["../src/trace-mapping.ts", "../src/resolve.ts", "../src/strip-filename.ts", "../src/sourcemap-segment.ts", "../src/sort.ts", "../src/by-source.ts", "../src/binary-search.ts", "../src/types.ts", "../src/flatten-map.ts"], - "mappings": ";AAAA,SAAS,QAAQ,cAAc;;;ACA/B,OAAO,gBAAgB;;;ACGR,SAAR,cAA+B,MAAyC;AAC7E,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,QAAQ,KAAK,YAAY,GAAG;AAClC,SAAO,KAAK,MAAM,GAAG,QAAQ,CAAC;AAChC;;;ADHe,SAAR,SACL,QACA,YACS;AACT,QAAM,OAAO,cAAc,MAAM;AAIjC,QAAM,SAAS,aAAa,aAAa,MAAM;AAE/C,SAAO,CAAC,WAAW,WAAW,UAAU,UAAU,KAAK,IAAI;AAC7D;;;AEAO,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;;;AClBrB,SAAR,UACL,UACA,OACsB;AACtB,QAAM,gBAAgB,wBAAwB,UAAU,CAAC;AACzD,MAAI,kBAAkB,SAAS,OAAQ,QAAO;AAI9C,MAAI,CAAC,MAAO,YAAW,SAAS,MAAM;AAEtC,WAAS,IAAI,eAAe,IAAI,SAAS,QAAQ,IAAI,wBAAwB,UAAU,IAAI,CAAC,GAAG;AAC7F,aAAS,CAAC,IAAI,aAAa,SAAS,CAAC,GAAG,KAAK;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,SAAS,wBAAwB,UAAgC,OAAuB;AACtF,WAAS,IAAI,OAAO,IAAI,SAAS,QAAQ,KAAK;AAC5C,QAAI,CAAC,SAAS,SAAS,CAAC,CAAC,EAAG,QAAO;AAAA,EACrC;AACA,SAAO,SAAS;AAClB;AAEA,SAAS,SAAS,MAAmC;AACnD,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,EAAE,MAAM,GAAG;AACzC,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,aAAa,MAA0B,OAAoC;AAClF,MAAI,CAAC,MAAO,QAAO,KAAK,MAAM;AAC9B,SAAO,KAAK,KAAK,cAAc;AACjC;AAEO,SAAS,eAA4D,GAAM,GAAc;AAC9F,SAAO,EAAE,MAAM,IAAI,EAAE,MAAM;AAC7B;;;ACnCe,SAAR,eACL,SACA,OACU;AACV,QAAM,UAAoB,MAAM,IAAI,MAAM,CAAC,CAAC;AAE5C,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,UAAI,IAAI,WAAW,EAAG;AAEtB,YAAMA,eAAc,IAAI,aAAa;AACrC,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AAEtC,YAAM,SAAS,QAAQA,YAAW;AAClC,YAAM,OAAQ,4CAAuB,CAAC;AACtC,WAAK,KAAK,CAAC,cAAc,GAAG,IAAI,MAAM,CAAC,CAAC;AAAA,IAC1C;AAAA,EACF;AAEA,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,SAAS,QAAQ,CAAC;AACxB,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,YAAM,OAAO,OAAO,CAAC;AACrB,UAAI,KAAM,MAAK,KAAK,cAAc;AAAA,IACpC;AAAA,EACF;AAEA,SAAO;AACT;;;AC/BO,IAAI,QAAQ;AAkBZ,SAAS,aACd,UACA,QACA,KACA,MACQ;AACR,SAAO,OAAO,MAAM;AAClB,UAAM,MAAM,OAAQ,OAAO,OAAQ;AACnC,UAAM,MAAM,SAAS,GAAG,EAAE,MAAM,IAAI;AAEpC,QAAI,QAAQ,GAAG;AACb,cAAQ;AACR,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,GAAG;AACX,YAAM,MAAM;AAAA,IACd,OAAO;AACL,aAAO,MAAM;AAAA,IACf;AAAA,EACF;AAEA,UAAQ;AACR,SAAO,MAAM;AACf;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,IAAI,SAAS,QAAQ,QAAQ,KAAK;AACxD,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,gBAA2B;AACzC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAMO,SAAS,qBACd,UACA,QACA,OACA,KACQ;AACR,QAAM,EAAE,SAAS,YAAY,UAAU,IAAI;AAE3C,MAAI,MAAM;AACV,MAAI,OAAO,SAAS,SAAS;AAC7B,MAAI,QAAQ,SAAS;AACnB,QAAI,WAAW,YAAY;AACzB,cAAQ,cAAc,MAAM,SAAS,SAAS,EAAE,MAAM,MAAM;AAC5D,aAAO;AAAA,IACT;AAEA,QAAI,UAAU,YAAY;AAExB,YAAM,cAAc,KAAK,IAAI;AAAA,IAC/B,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,UAAU;AAChB,QAAM,aAAa;AAEnB,SAAQ,MAAM,YAAY,aAAa,UAAU,QAAQ,KAAK,IAAI;AACpE;;;ACHO,SAAS,MAAS,KAA4B;AACnD,SAAO,OAAO,QAAQ,WAAW,KAAK,MAAM,GAAG,IAAK;AACtD;;;ACvFO,IAAM,aAAyB,SAAU,KAAK,QAAQ;AAC3D,QAAM,SAAS,MAAM,GAA8B;AAEnD,MAAI,EAAE,cAAc,SAAS;AAC3B,WAAO,IAAI,SAAS,QAA2D,MAAM;AAAA,EACvF;AAEA,QAAM,WAAiC,CAAC;AACxC,QAAM,UAAoB,CAAC;AAC3B,QAAM,iBAAoC,CAAC;AAC3C,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAuB,CAAC;AAE9B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAA2B;AAAA,IAC/B,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,oBAAoB,MAAM;AACnC;AAEA,SAAS,QACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,EAAE,SAAS,IAAI;AACrB,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,EAAE,KAAK,OAAO,IAAI,SAAS,CAAC;AAElC,QAAI,KAAK;AACT,QAAI,KAAK;AACT,QAAI,IAAI,IAAI,SAAS,QAAQ;AAC3B,YAAM,aAAa,SAAS,IAAI,CAAC,EAAE;AACnC,WAAK,KAAK,IAAI,UAAU,aAAa,WAAW,IAAI;AAEpD,UAAI,OAAO,UAAU;AACnB,aAAK,KAAK,IAAI,YAAY,eAAe,WAAW,MAAM;AAAA,MAC5D,WAAW,KAAK,UAAU;AACxB,aAAK,eAAe,WAAW;AAAA,MACjC;AAAA,IACF;AAEA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,OAAO;AAAA,MACpB,eAAe,OAAO;AAAA,MACtB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,WACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,cAAc,OAAQ,QAAO,QAAQ,GAAI,SAAmD;AAEhG,QAAM,MAAM,IAAI,SAAS,QAAQ,MAAM;AACvC,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,cAAc,MAAM;AAC1B,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,iBAAiB,gBAAgB,UAAU,YAAY,QAAQ,IAAI;AAE3E,SAAO,SAAS,eAAe;AAC/B,SAAO,OAAO,IAAI,KAAK;AAEvB,MAAI,SAAU,QAAO,gBAAgB,QAAQ;AAAA,MACxC,UAAS,IAAI,GAAG,IAAI,gBAAgB,QAAQ,IAAK,gBAAe,KAAK,IAAI;AAE9E,MAAI,QAAS,UAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,IAAK,YAAW,KAAK,QAAQ,CAAC,IAAI,aAAa;AAEhG,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,QAAQ,aAAa;AAM3B,QAAI,QAAQ,SAAU;AAItB,UAAM,MAAM,QAAQ,UAAU,KAAK;AAGnC,UAAM,UAAU,MAAM,IAAI,eAAe;AAEzC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,YAAM,SAAS,UAAU,IAAI,MAAM;AAInC,UAAI,UAAU,YAAY,UAAU,WAAY;AAEhD,UAAI,IAAI,WAAW,GAAG;AACpB,YAAI,KAAK,CAAC,MAAM,CAAC;AACjB;AAAA,MACF;AAEA,YAAM,eAAe,gBAAgB,IAAI,aAAa;AACtD,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AACtC,UAAI;AAAA,QACF,IAAI,WAAW,IACX,CAAC,QAAQ,cAAc,YAAY,YAAY,IAC/C,CAAC,QAAQ,cAAc,YAAY,cAAc,cAAc,IAAI,WAAW,CAAC;AAAA,MACrF;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,OAAU,KAAU,OAAY;AACvC,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,KAAK,MAAM,CAAC,CAAC;AAC1D;AAEA,SAAS,QAAW,KAAY,OAAoB;AAClD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,IAAK,KAAI,CAAC,IAAI,CAAC;AACpD,SAAO,IAAI,KAAK;AAClB;;;ARhHA,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AAEjB,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAI7B,IAAM,WAAN,MAAoC;AAAA,EAkBzC,YAAY,KAAyB,QAAwB;AAC3D,UAAM,WAAW,OAAO,QAAQ;AAChC,QAAI,CAAC,YAAa,IAAyC,aAAc,QAAO;AAEhF,UAAM,SAAS,MAAM,GAAwC;AAE7D,UAAM,EAAE,SAAS,MAAM,OAAO,YAAY,SAAS,eAAe,IAAI;AACtE,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,QAAQ,SAAS,CAAC;AACvB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,iBAAiB;AACtB,SAAK,aAAa,OAAO,cAAe,OAAkB,uBAAuB;AAEjF,UAAM,UAAU,SAAS,QAAQ,UAAU;AAC3C,SAAK,kBAAkB,QAAQ,IAAI,OAAO;AAE1C,UAAM,EAAE,SAAS,IAAI;AACrB,QAAI,OAAO,aAAa,UAAU;AAChC,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB,WAAW,MAAM,QAAQ,QAAQ,GAAG;AAClC,WAAK,WAAW;AAChB,WAAK,WAAW,UAAU,UAAU,QAAQ;AAAA,IAC9C,WAAY,OAAyC,UAAU;AAC7D,YAAM,IAAI,MAAM,4EAA4E;AAAA,IAC9F,OAAO;AACL,YAAM,IAAI,MAAM,uBAAuB,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IACjE;AAEA,SAAK,eAAe,cAAc;AAClC,SAAK,aAAa;AAClB,SAAK,iBAAiB;AAAA,EACxB;AACF;AAMA,SAAS,KAAK,KAAyB;AACrC,SAAO;AACT;AAKO,SAAS,gBAAgB,KAA6C;AAzJ7E;AA0JE,UAAQ,gBAAK,GAAG,GAAE,aAAV,eAAU,WAAa,OAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAKO,SAAS,gBAAgB,KAAuD;AAhKvF;AAiKE,UAAQ,UAAK,GAAG,GAAE,aAAV,GAAU,WAAa,OAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAMO,SAAS,aACd,KACA,MACA,QACmC;AACnC,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO;AAEnC,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,UAAU,KAAK,OAAO,SAAS,KAAK;AAC7C;AAOO,SAAS,oBACd,KACA,QAC0C;AAC1C,MAAI,EAAE,MAAM,QAAQ,KAAK,IAAI;AAC7B;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAElE,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAExD,QAAM,UAAU,SAAS,KAAK;AAC9B,MAAI,QAAQ,WAAW,EAAG,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAEhE,QAAM,EAAE,OAAO,gBAAgB,IAAI;AACnC,SAAO;AAAA,IACL,gBAAgB,QAAQ,aAAa,CAAC;AAAA,IACtC,QAAQ,WAAW,IAAI;AAAA,IACvB,QAAQ,aAAa;AAAA,IACrB,QAAQ,WAAW,IAAI,MAAM,QAAQ,WAAW,CAAC,IAAI;AAAA,EACvD;AACF;AAKO,SAAS,qBACd,KACA,QAC4C;AAC5C,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AACvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,sBAAsB,KAAK;AACzF;AAKO,SAAS,yBAAyB,KAAe,QAA0C;AAChG,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AAEvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,mBAAmB,IAAI;AACrF;AAKO,SAAS,YAAY,KAAe,IAA0C;AACnF,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,OAAO,gBAAgB,IAAI;AAEnC,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,gBAAgB,IAAI;AAC1B,YAAM,kBAAkB,IAAI,CAAC;AAC7B,UAAI,SAAS;AACb,UAAI,eAAe;AACnB,UAAI,iBAAiB;AACrB,UAAI,OAAO;AACX,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,gBAAgB,IAAI,CAAC,CAAC;AAC/B,uBAAe,IAAI,CAAC,IAAI;AACxB,yBAAiB,IAAI,CAAC;AAAA,MACxB;AACA,UAAI,IAAI,WAAW,EAAG,QAAO,MAAM,IAAI,CAAC,CAAC;AAEzC,SAAG;AAAA,QACD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAgB;AAAA,IAClB;AAAA,EACF;AACF;AAEA,SAAS,YAAY,KAAe,QAAwB;AAC1D,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAI,QAAQ,QAAQ,QAAQ,MAAM;AAClC,MAAI,UAAU,GAAI,SAAQ,gBAAgB,QAAQ,MAAM;AACxD,SAAO;AACT;AAKO,SAAS,iBAAiB,KAAe,QAA+B;AAC7E,QAAM,EAAE,eAAe,IAAI;AAC3B,MAAI,kBAAkB,KAAM,QAAO;AACnC,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,OAAO,eAAe,KAAK;AACnD;AAKO,SAAS,UAAU,KAAe,QAAyB;AAChE,QAAM,EAAE,WAAW,IAAI;AACvB,MAAI,cAAc,KAAM,QAAO;AAC/B,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,QAAQ,WAAW,SAAS,KAAK;AACzD;AAMO,SAAS,oBAAoB,KAAuB,QAA2B;AACpF,QAAM,SAAS,IAAI,SAAS,MAAM,KAAK,CAAC,CAAC,GAAG,MAAM;AAClD,OAAK,MAAM,EAAE,WAAW,IAAI;AAC5B,SAAO;AACT;AAMO,SAAS,WACd,KACkF;AAClF,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAMO,SAAS,WAAW,KAAiC;AAC1D,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAEA,SAAS,MACP,KACA,UACwD;AACxD,SAAO;AAAA,IACL,SAAS,IAAI;AAAA,IACb,MAAM,IAAI;AAAA,IACV,OAAO,IAAI;AAAA,IACX,YAAY,IAAI;AAAA,IAChB,SAAS,IAAI;AAAA,IACb,gBAAgB,IAAI;AAAA,IACpB;AAAA,IACA,YAAY,IAAI,cAAe,IAAe;AAAA,EAChD;AACF;AASA,SAAS,SACP,QACA,MACA,QACA,MAC0C;AAC1C,SAAO,EAAE,QAAQ,MAAM,QAAQ,KAAK;AACtC;AAIA,SAAS,SACP,MACA,QAC4C;AAC5C,SAAO,EAAE,MAAM,OAAO;AACxB;AAgBA,SAAS,qBACP,UACA,MACA,MACA,QACA,MACQ;AACR,MAAI,QAAQ,qBAAqB,UAAU,QAAQ,MAAM,IAAI;AAC7D,MAAI,OAAS;AACX,aAAS,SAAS,oBAAoB,aAAa,YAAY,UAAU,QAAQ,KAAK;AAAA,EACxF,WAAW,SAAS,kBAAmB;AAEvC,MAAI,UAAU,MAAM,UAAU,SAAS,OAAQ,QAAO;AACtD,SAAO;AACT;AAEA,SAAS,wBACP,UACA,MACA,MACA,QACA,MACoB;AACpB,MAAI,MAAM,qBAAqB,UAAU,MAAM,MAAM,QAAQ,oBAAoB;AAQjF,MAAI,CAAC,SAAW,SAAS,kBAAmB;AAE5C,MAAI,QAAQ,MAAM,QAAQ,SAAS,OAAQ,QAAO,CAAC;AAKnD,QAAM,gBAAgB,QAAU,SAAS,SAAS,GAAG,EAAE,MAAM;AAG7D,MAAI,CAAC,MAAS,OAAM,WAAW,UAAU,eAAe,GAAG;AAC3D,QAAM,MAAM,WAAW,UAAU,eAAe,GAAG;AAEnD,QAAM,SAAS,CAAC;AAChB,SAAO,OAAO,KAAK,OAAO;AACxB,UAAM,UAAU,SAAS,GAAG;AAC5B,WAAO,KAAK,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC,CAAC;AAAA,EACtF;AACA,SAAO;AACT;AAkBA,SAAS,kBACP,KACA,QACA,MACA,QACA,MACA,KACiE;AA5dnE;AA6dE;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAIC,eAAc,QAAQ,QAAQ,MAAM;AACxC,MAAIA,iBAAgB,GAAI,CAAAA,eAAc,gBAAgB,QAAQ,MAAM;AACpE,MAAIA,iBAAgB,GAAI,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE7D,QAAM,iBAAiB,UAAK,GAAG,GAAE,mBAAV,GAAU,iBAAmB,QAAQ,IAAI,aAAa;AAC7E,QAAM,aAAa,UAAK,GAAG,GAAE,eAAV,GAAU,aAAe,eAAe,gBAAgB,GAAG,GAAG,aAAa;AAE9F,QAAM,WAAW,UAAUA,YAAW,EAAE,IAAI;AAC5C,MAAI,YAAY,KAAM,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE3D,QAAM,OAAO,cAAcA,YAAW;AAEtC,MAAI,IAAK,QAAO,wBAAwB,UAAU,MAAM,MAAM,QAAQ,IAAI;AAE1E,QAAM,QAAQ,qBAAqB,UAAU,MAAM,MAAM,QAAQ,IAAI;AACrE,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,IAAI;AAE5C,QAAM,UAAU,SAAS,KAAK;AAC9B,SAAO,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC;AAChF;", - "names": ["sourceIndex", "sourceIndex"] -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js b/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js deleted file mode 100644 index 0387ae3..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +++ /dev/null @@ -1,559 +0,0 @@ -(function (global, factory) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - factory(module, require('@jridgewell/resolve-uri'), require('@jridgewell/sourcemap-codec')); - module.exports = def(module); - } else if (typeof define === 'function' && define.amd) { - define(['module', '@jridgewell/resolve-uri', '@jridgewell/sourcemap-codec'], function(mod) { - factory.apply(this, arguments); - mod.exports = def(mod); - }); - } else { - const mod = { exports: {} }; - factory(mod, global.resolveURI, global.sourcemapCodec); - global = typeof globalThis !== 'undefined' ? globalThis : global || self; - global.traceMapping = def(mod); - } - function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } -})(this, (function (module, require_resolveURI, require_sourcemapCodec) { -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// umd:@jridgewell/sourcemap-codec -var require_sourcemap_codec = __commonJS({ - "umd:@jridgewell/sourcemap-codec"(exports, module2) { - module2.exports = require_sourcemapCodec; - } -}); - -// umd:@jridgewell/resolve-uri -var require_resolve_uri = __commonJS({ - "umd:@jridgewell/resolve-uri"(exports, module2) { - module2.exports = require_resolveURI; - } -}); - -// src/trace-mapping.ts -var trace_mapping_exports = {}; -__export(trace_mapping_exports, { - AnyMap: () => FlattenMap, - FlattenMap: () => FlattenMap, - GREATEST_LOWER_BOUND: () => GREATEST_LOWER_BOUND, - LEAST_UPPER_BOUND: () => LEAST_UPPER_BOUND, - TraceMap: () => TraceMap, - allGeneratedPositionsFor: () => allGeneratedPositionsFor, - decodedMap: () => decodedMap, - decodedMappings: () => decodedMappings, - eachMapping: () => eachMapping, - encodedMap: () => encodedMap, - encodedMappings: () => encodedMappings, - generatedPositionFor: () => generatedPositionFor, - isIgnored: () => isIgnored, - originalPositionFor: () => originalPositionFor, - presortedDecodedMap: () => presortedDecodedMap, - sourceContentFor: () => sourceContentFor, - traceSegment: () => traceSegment -}); -module.exports = __toCommonJS(trace_mapping_exports); -var import_sourcemap_codec = __toESM(require_sourcemap_codec()); - -// src/resolve.ts -var import_resolve_uri = __toESM(require_resolve_uri()); - -// src/strip-filename.ts -function stripFilename(path) { - if (!path) return ""; - const index = path.lastIndexOf("/"); - return path.slice(0, index + 1); -} - -// src/resolve.ts -function resolver(mapUrl, sourceRoot) { - const from = stripFilename(mapUrl); - const prefix = sourceRoot ? sourceRoot + "/" : ""; - return (source) => (0, import_resolve_uri.default)(prefix + (source || ""), from); -} - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; -var REV_GENERATED_LINE = 1; -var REV_GENERATED_COLUMN = 2; - -// src/sort.ts -function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) return mappings; - if (!owned) mappings = mappings.slice(); - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; -} -function nextUnsortedSegmentLine(mappings, start) { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) return i; - } - return mappings.length; -} -function isSorted(line) { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN] < line[j - 1][COLUMN]) { - return false; - } - } - return true; -} -function sortSegments(line, owned) { - if (!owned) line = line.slice(); - return line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[COLUMN] - b[COLUMN]; -} - -// src/by-source.ts -function buildBySources(decoded, memos) { - const sources = memos.map(() => []); - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - if (seg.length === 1) continue; - const sourceIndex2 = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - const source = sources[sourceIndex2]; - const segs = source[sourceLine] || (source[sourceLine] = []); - segs.push([sourceColumn, i, seg[COLUMN]]); - } - } - for (let i = 0; i < sources.length; i++) { - const source = sources[i]; - for (let j = 0; j < source.length; j++) { - const line = source[j]; - if (line) line.sort(sortComparator); - } - } - return sources; -} - -// src/binary-search.ts -var found = false; -function binarySearch(haystack, needle, low, high) { - while (low <= high) { - const mid = low + (high - low >> 1); - const cmp = haystack[mid][COLUMN] - needle; - if (cmp === 0) { - found = true; - return mid; - } - if (cmp < 0) { - low = mid + 1; - } else { - high = mid - 1; - } - } - found = false; - return low - 1; -} -function upperBound(haystack, needle, index) { - for (let i = index + 1; i < haystack.length; index = i++) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} -function lowerBound(haystack, needle, index) { - for (let i = index - 1; i >= 0; index = i--) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} -function memoizedState() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1 - }; -} -function memoizedBinarySearch(haystack, needle, state, key) { - const { lastKey, lastNeedle, lastIndex } = state; - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; - return lastIndex; - } - if (needle >= lastNeedle) { - low = lastIndex === -1 ? 0 : lastIndex; - } else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return state.lastIndex = binarySearch(haystack, needle, low, high); -} - -// src/types.ts -function parse(map) { - return typeof map === "string" ? JSON.parse(map) : map; -} - -// src/flatten-map.ts -var FlattenMap = function(map, mapUrl) { - const parsed = parse(map); - if (!("sections" in parsed)) { - return new TraceMap(parsed, mapUrl); - } - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - const ignoreList = []; - recurse( - parsed, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - 0, - 0, - Infinity, - Infinity - ); - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - ignoreList - }; - return presortedDecodedMap(joined); -}; -function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { - const { sections } = input; - for (let i = 0; i < sections.length; i++) { - const { map, offset } = sections[i]; - let sl = stopLine; - let sc = stopColumn; - if (i + 1 < sections.length) { - const nextOffset = sections[i + 1].offset; - sl = Math.min(stopLine, lineOffset + nextOffset.line); - if (sl === stopLine) { - sc = Math.min(stopColumn, columnOffset + nextOffset.column); - } else if (sl < stopLine) { - sc = columnOffset + nextOffset.column; - } - } - addSection( - map, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - lineOffset + offset.line, - columnOffset + offset.column, - sl, - sc - ); - } -} -function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { - const parsed = parse(input); - if ("sections" in parsed) return recurse(...arguments); - const map = new TraceMap(parsed, mapUrl); - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; - append(sources, resolvedSources); - append(names, map.names); - if (contents) append(sourcesContent, contents); - else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); - if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); - for (let i = 0; i < decoded.length; i++) { - const lineI = lineOffset + i; - if (lineI > stopLine) return; - const out = getLine(mappings, lineI); - const cOffset = i === 0 ? columnOffset : 0; - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN]; - if (lineI === stopLine && column >= stopColumn) return; - if (seg.length === 1) { - out.push([column]); - continue; - } - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - out.push( - seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]] - ); - } - } -} -function append(arr, other) { - for (let i = 0; i < other.length; i++) arr.push(other[i]); -} -function getLine(arr, index) { - for (let i = arr.length; i <= index; i++) arr[i] = []; - return arr[index]; -} - -// src/trace-mapping.ts -var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; -var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; -var LEAST_UPPER_BOUND = -1; -var GREATEST_LOWER_BOUND = 1; -var TraceMap = class { - constructor(map, mapUrl) { - const isString = typeof map === "string"; - if (!isString && map._decodedMemo) return map; - const parsed = parse(map); - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names || []; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; - const resolve = resolver(mapUrl, sourceRoot); - this.resolvedSources = sources.map(resolve); - const { mappings } = parsed; - if (typeof mappings === "string") { - this._encoded = mappings; - this._decoded = void 0; - } else if (Array.isArray(mappings)) { - this._encoded = void 0; - this._decoded = maybeSort(mappings, isString); - } else if (parsed.sections) { - throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); - } else { - throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); - } - this._decodedMemo = memoizedState(); - this._bySources = void 0; - this._bySourceMemos = void 0; - } -}; -function cast(map) { - return map; -} -function encodedMappings(map) { - var _a, _b; - return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = (0, import_sourcemap_codec.encode)(cast(map)._decoded); -} -function decodedMappings(map) { - var _a; - return (_a = cast(map))._decoded || (_a._decoded = (0, import_sourcemap_codec.decode)(cast(map)._encoded)); -} -function traceSegment(map, line, column) { - const decoded = decodedMappings(map); - if (line >= decoded.length) return null; - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - GREATEST_LOWER_BOUND - ); - return index === -1 ? null : segments[index]; -} -function originalPositionFor(map, needle) { - let { line, column, bias } = needle; - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - const decoded = decodedMappings(map); - if (line >= decoded.length) return OMapping(null, null, null, null); - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - bias || GREATEST_LOWER_BOUND - ); - if (index === -1) return OMapping(null, null, null, null); - const segment = segments[index]; - if (segment.length === 1) return OMapping(null, null, null, null); - const { names, resolvedSources } = map; - return OMapping( - resolvedSources[segment[SOURCES_INDEX]], - segment[SOURCE_LINE] + 1, - segment[SOURCE_COLUMN], - segment.length === 5 ? names[segment[NAMES_INDEX]] : null - ); -} -function generatedPositionFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); -} -function allGeneratedPositionsFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); -} -function eachMapping(map, cb) { - const decoded = decodedMappings(map); - const { names, resolvedSources } = map; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const generatedLine = i + 1; - const generatedColumn = seg[0]; - let source = null; - let originalLine = null; - let originalColumn = null; - let name = null; - if (seg.length !== 1) { - source = resolvedSources[seg[1]]; - originalLine = seg[2] + 1; - originalColumn = seg[3]; - } - if (seg.length === 5) name = names[seg[4]]; - cb({ - generatedLine, - generatedColumn, - source, - originalLine, - originalColumn, - name - }); - } - } -} -function sourceIndex(map, source) { - const { sources, resolvedSources } = map; - let index = sources.indexOf(source); - if (index === -1) index = resolvedSources.indexOf(source); - return index; -} -function sourceContentFor(map, source) { - const { sourcesContent } = map; - if (sourcesContent == null) return null; - const index = sourceIndex(map, source); - return index === -1 ? null : sourcesContent[index]; -} -function isIgnored(map, source) { - const { ignoreList } = map; - if (ignoreList == null) return false; - const index = sourceIndex(map, source); - return index === -1 ? false : ignoreList.includes(index); -} -function presortedDecodedMap(map, mapUrl) { - const tracer = new TraceMap(clone(map, []), mapUrl); - cast(tracer)._decoded = map.mappings; - return tracer; -} -function decodedMap(map) { - return clone(map, decodedMappings(map)); -} -function encodedMap(map) { - return clone(map, encodedMappings(map)); -} -function clone(map, mappings) { - return { - version: map.version, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings, - ignoreList: map.ignoreList || map.x_google_ignoreList - }; -} -function OMapping(source, line, column, name) { - return { source, line, column, name }; -} -function GMapping(line, column) { - return { line, column }; -} -function traceSegmentInternal(segments, memo, line, column, bias) { - let index = memoizedBinarySearch(segments, column, memo, line); - if (found) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } else if (bias === LEAST_UPPER_BOUND) index++; - if (index === -1 || index === segments.length) return -1; - return index; -} -function sliceGeneratedPositions(segments, memo, line, column, bias) { - let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); - if (!found && bias === LEAST_UPPER_BOUND) min++; - if (min === -1 || min === segments.length) return []; - const matchedColumn = found ? column : segments[min][COLUMN]; - if (!found) min = lowerBound(segments, matchedColumn, min); - const max = upperBound(segments, matchedColumn, min); - const result = []; - for (; min <= max; min++) { - const segment = segments[min]; - result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); - } - return result; -} -function generatedPosition(map, source, line, column, bias, all) { - var _a, _b; - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - const { sources, resolvedSources } = map; - let sourceIndex2 = sources.indexOf(source); - if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); - if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); - const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState)); - const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos)); - const segments = generated[sourceIndex2][line]; - if (segments == null) return all ? [] : GMapping(null, null); - const memo = bySourceMemos[sourceIndex2]; - if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); - const index = traceSegmentInternal(segments, memo, line, column, bias); - if (index === -1) return GMapping(null, null); - const segment = segments[index]; - return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); -} -})); -//# sourceMappingURL=trace-mapping.umd.js.map diff --git a/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map b/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map deleted file mode 100644 index 68b0c77..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["umd:@jridgewell/sourcemap-codec", "umd:@jridgewell/resolve-uri", "../src/trace-mapping.ts", "../src/resolve.ts", "../src/strip-filename.ts", "../src/sourcemap-segment.ts", "../src/sort.ts", "../src/by-source.ts", "../src/binary-search.ts", "../src/types.ts", "../src/flatten-map.ts"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,yCAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA+B;;;ACA/B,yBAAuB;;;ACGR,SAAR,cAA+B,MAAyC;AAC7E,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,QAAQ,KAAK,YAAY,GAAG;AAClC,SAAO,KAAK,MAAM,GAAG,QAAQ,CAAC;AAChC;;;ADHe,SAAR,SACL,QACA,YACS;AACT,QAAM,OAAO,cAAc,MAAM;AAIjC,QAAM,SAAS,aAAa,aAAa,MAAM;AAE/C,SAAO,CAAC,eAAW,mBAAAC,SAAW,UAAU,UAAU,KAAK,IAAI;AAC7D;;;AEAO,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;;;AClBrB,SAAR,UACL,UACA,OACsB;AACtB,QAAM,gBAAgB,wBAAwB,UAAU,CAAC;AACzD,MAAI,kBAAkB,SAAS,OAAQ,QAAO;AAI9C,MAAI,CAAC,MAAO,YAAW,SAAS,MAAM;AAEtC,WAAS,IAAI,eAAe,IAAI,SAAS,QAAQ,IAAI,wBAAwB,UAAU,IAAI,CAAC,GAAG;AAC7F,aAAS,CAAC,IAAI,aAAa,SAAS,CAAC,GAAG,KAAK;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,SAAS,wBAAwB,UAAgC,OAAuB;AACtF,WAAS,IAAI,OAAO,IAAI,SAAS,QAAQ,KAAK;AAC5C,QAAI,CAAC,SAAS,SAAS,CAAC,CAAC,EAAG,QAAO;AAAA,EACrC;AACA,SAAO,SAAS;AAClB;AAEA,SAAS,SAAS,MAAmC;AACnD,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,EAAE,MAAM,GAAG;AACzC,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,aAAa,MAA0B,OAAoC;AAClF,MAAI,CAAC,MAAO,QAAO,KAAK,MAAM;AAC9B,SAAO,KAAK,KAAK,cAAc;AACjC;AAEO,SAAS,eAA4D,GAAM,GAAc;AAC9F,SAAO,EAAE,MAAM,IAAI,EAAE,MAAM;AAC7B;;;ACnCe,SAAR,eACL,SACA,OACU;AACV,QAAM,UAAoB,MAAM,IAAI,MAAM,CAAC,CAAC;AAE5C,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,UAAI,IAAI,WAAW,EAAG;AAEtB,YAAMC,eAAc,IAAI,aAAa;AACrC,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AAEtC,YAAM,SAAS,QAAQA,YAAW;AAClC,YAAM,OAAQ,4CAAuB,CAAC;AACtC,WAAK,KAAK,CAAC,cAAc,GAAG,IAAI,MAAM,CAAC,CAAC;AAAA,IAC1C;AAAA,EACF;AAEA,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,SAAS,QAAQ,CAAC;AACxB,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,YAAM,OAAO,OAAO,CAAC;AACrB,UAAI,KAAM,MAAK,KAAK,cAAc;AAAA,IACpC;AAAA,EACF;AAEA,SAAO;AACT;;;AC/BO,IAAI,QAAQ;AAkBZ,SAAS,aACd,UACA,QACA,KACA,MACQ;AACR,SAAO,OAAO,MAAM;AAClB,UAAM,MAAM,OAAQ,OAAO,OAAQ;AACnC,UAAM,MAAM,SAAS,GAAG,EAAE,MAAM,IAAI;AAEpC,QAAI,QAAQ,GAAG;AACb,cAAQ;AACR,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,GAAG;AACX,YAAM,MAAM;AAAA,IACd,OAAO;AACL,aAAO,MAAM;AAAA,IACf;AAAA,EACF;AAEA,UAAQ;AACR,SAAO,MAAM;AACf;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,IAAI,SAAS,QAAQ,QAAQ,KAAK;AACxD,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,gBAA2B;AACzC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAMO,SAAS,qBACd,UACA,QACA,OACA,KACQ;AACR,QAAM,EAAE,SAAS,YAAY,UAAU,IAAI;AAE3C,MAAI,MAAM;AACV,MAAI,OAAO,SAAS,SAAS;AAC7B,MAAI,QAAQ,SAAS;AACnB,QAAI,WAAW,YAAY;AACzB,cAAQ,cAAc,MAAM,SAAS,SAAS,EAAE,MAAM,MAAM;AAC5D,aAAO;AAAA,IACT;AAEA,QAAI,UAAU,YAAY;AAExB,YAAM,cAAc,KAAK,IAAI;AAAA,IAC/B,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,UAAU;AAChB,QAAM,aAAa;AAEnB,SAAQ,MAAM,YAAY,aAAa,UAAU,QAAQ,KAAK,IAAI;AACpE;;;ACHO,SAAS,MAAS,KAA4B;AACnD,SAAO,OAAO,QAAQ,WAAW,KAAK,MAAM,GAAG,IAAK;AACtD;;;ACvFO,IAAM,aAAyB,SAAU,KAAK,QAAQ;AAC3D,QAAM,SAAS,MAAM,GAA8B;AAEnD,MAAI,EAAE,cAAc,SAAS;AAC3B,WAAO,IAAI,SAAS,QAA2D,MAAM;AAAA,EACvF;AAEA,QAAM,WAAiC,CAAC;AACxC,QAAM,UAAoB,CAAC;AAC3B,QAAM,iBAAoC,CAAC;AAC3C,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAuB,CAAC;AAE9B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAA2B;AAAA,IAC/B,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,oBAAoB,MAAM;AACnC;AAEA,SAAS,QACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,EAAE,SAAS,IAAI;AACrB,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,EAAE,KAAK,OAAO,IAAI,SAAS,CAAC;AAElC,QAAI,KAAK;AACT,QAAI,KAAK;AACT,QAAI,IAAI,IAAI,SAAS,QAAQ;AAC3B,YAAM,aAAa,SAAS,IAAI,CAAC,EAAE;AACnC,WAAK,KAAK,IAAI,UAAU,aAAa,WAAW,IAAI;AAEpD,UAAI,OAAO,UAAU;AACnB,aAAK,KAAK,IAAI,YAAY,eAAe,WAAW,MAAM;AAAA,MAC5D,WAAW,KAAK,UAAU;AACxB,aAAK,eAAe,WAAW;AAAA,MACjC;AAAA,IACF;AAEA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,OAAO;AAAA,MACpB,eAAe,OAAO;AAAA,MACtB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,WACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,cAAc,OAAQ,QAAO,QAAQ,GAAI,SAAmD;AAEhG,QAAM,MAAM,IAAI,SAAS,QAAQ,MAAM;AACvC,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,cAAc,MAAM;AAC1B,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,iBAAiB,gBAAgB,UAAU,YAAY,QAAQ,IAAI;AAE3E,SAAO,SAAS,eAAe;AAC/B,SAAO,OAAO,IAAI,KAAK;AAEvB,MAAI,SAAU,QAAO,gBAAgB,QAAQ;AAAA,MACxC,UAAS,IAAI,GAAG,IAAI,gBAAgB,QAAQ,IAAK,gBAAe,KAAK,IAAI;AAE9E,MAAI,QAAS,UAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,IAAK,YAAW,KAAK,QAAQ,CAAC,IAAI,aAAa;AAEhG,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,QAAQ,aAAa;AAM3B,QAAI,QAAQ,SAAU;AAItB,UAAM,MAAM,QAAQ,UAAU,KAAK;AAGnC,UAAM,UAAU,MAAM,IAAI,eAAe;AAEzC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,YAAM,SAAS,UAAU,IAAI,MAAM;AAInC,UAAI,UAAU,YAAY,UAAU,WAAY;AAEhD,UAAI,IAAI,WAAW,GAAG;AACpB,YAAI,KAAK,CAAC,MAAM,CAAC;AACjB;AAAA,MACF;AAEA,YAAM,eAAe,gBAAgB,IAAI,aAAa;AACtD,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AACtC,UAAI;AAAA,QACF,IAAI,WAAW,IACX,CAAC,QAAQ,cAAc,YAAY,YAAY,IAC/C,CAAC,QAAQ,cAAc,YAAY,cAAc,cAAc,IAAI,WAAW,CAAC;AAAA,MACrF;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,OAAU,KAAU,OAAY;AACvC,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,KAAK,MAAM,CAAC,CAAC;AAC1D;AAEA,SAAS,QAAW,KAAY,OAAoB;AAClD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,IAAK,KAAI,CAAC,IAAI,CAAC;AACpD,SAAO,IAAI,KAAK;AAClB;;;ARhHA,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AAEjB,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAI7B,IAAM,WAAN,MAAoC;AAAA,EAkBzC,YAAY,KAAyB,QAAwB;AAC3D,UAAM,WAAW,OAAO,QAAQ;AAChC,QAAI,CAAC,YAAa,IAAyC,aAAc,QAAO;AAEhF,UAAM,SAAS,MAAM,GAAwC;AAE7D,UAAM,EAAE,SAAS,MAAM,OAAO,YAAY,SAAS,eAAe,IAAI;AACtE,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,QAAQ,SAAS,CAAC;AACvB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,iBAAiB;AACtB,SAAK,aAAa,OAAO,cAAe,OAAkB,uBAAuB;AAEjF,UAAM,UAAU,SAAS,QAAQ,UAAU;AAC3C,SAAK,kBAAkB,QAAQ,IAAI,OAAO;AAE1C,UAAM,EAAE,SAAS,IAAI;AACrB,QAAI,OAAO,aAAa,UAAU;AAChC,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB,WAAW,MAAM,QAAQ,QAAQ,GAAG;AAClC,WAAK,WAAW;AAChB,WAAK,WAAW,UAAU,UAAU,QAAQ;AAAA,IAC9C,WAAY,OAAyC,UAAU;AAC7D,YAAM,IAAI,MAAM,4EAA4E;AAAA,IAC9F,OAAO;AACL,YAAM,IAAI,MAAM,uBAAuB,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IACjE;AAEA,SAAK,eAAe,cAAc;AAClC,SAAK,aAAa;AAClB,SAAK,iBAAiB;AAAA,EACxB;AACF;AAMA,SAAS,KAAK,KAAyB;AACrC,SAAO;AACT;AAKO,SAAS,gBAAgB,KAA6C;AAzJ7E;AA0JE,UAAQ,gBAAK,GAAG,GAAE,aAAV,eAAU,eAAa,+BAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAKO,SAAS,gBAAgB,KAAuD;AAhKvF;AAiKE,UAAQ,UAAK,GAAG,GAAE,aAAV,GAAU,eAAa,+BAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAMO,SAAS,aACd,KACA,MACA,QACmC;AACnC,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO;AAEnC,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,UAAU,KAAK,OAAO,SAAS,KAAK;AAC7C;AAOO,SAAS,oBACd,KACA,QAC0C;AAC1C,MAAI,EAAE,MAAM,QAAQ,KAAK,IAAI;AAC7B;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAElE,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAExD,QAAM,UAAU,SAAS,KAAK;AAC9B,MAAI,QAAQ,WAAW,EAAG,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAEhE,QAAM,EAAE,OAAO,gBAAgB,IAAI;AACnC,SAAO;AAAA,IACL,gBAAgB,QAAQ,aAAa,CAAC;AAAA,IACtC,QAAQ,WAAW,IAAI;AAAA,IACvB,QAAQ,aAAa;AAAA,IACrB,QAAQ,WAAW,IAAI,MAAM,QAAQ,WAAW,CAAC,IAAI;AAAA,EACvD;AACF;AAKO,SAAS,qBACd,KACA,QAC4C;AAC5C,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AACvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,sBAAsB,KAAK;AACzF;AAKO,SAAS,yBAAyB,KAAe,QAA0C;AAChG,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AAEvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,mBAAmB,IAAI;AACrF;AAKO,SAAS,YAAY,KAAe,IAA0C;AACnF,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,OAAO,gBAAgB,IAAI;AAEnC,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,gBAAgB,IAAI;AAC1B,YAAM,kBAAkB,IAAI,CAAC;AAC7B,UAAI,SAAS;AACb,UAAI,eAAe;AACnB,UAAI,iBAAiB;AACrB,UAAI,OAAO;AACX,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,gBAAgB,IAAI,CAAC,CAAC;AAC/B,uBAAe,IAAI,CAAC,IAAI;AACxB,yBAAiB,IAAI,CAAC;AAAA,MACxB;AACA,UAAI,IAAI,WAAW,EAAG,QAAO,MAAM,IAAI,CAAC,CAAC;AAEzC,SAAG;AAAA,QACD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAgB;AAAA,IAClB;AAAA,EACF;AACF;AAEA,SAAS,YAAY,KAAe,QAAwB;AAC1D,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAI,QAAQ,QAAQ,QAAQ,MAAM;AAClC,MAAI,UAAU,GAAI,SAAQ,gBAAgB,QAAQ,MAAM;AACxD,SAAO;AACT;AAKO,SAAS,iBAAiB,KAAe,QAA+B;AAC7E,QAAM,EAAE,eAAe,IAAI;AAC3B,MAAI,kBAAkB,KAAM,QAAO;AACnC,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,OAAO,eAAe,KAAK;AACnD;AAKO,SAAS,UAAU,KAAe,QAAyB;AAChE,QAAM,EAAE,WAAW,IAAI;AACvB,MAAI,cAAc,KAAM,QAAO;AAC/B,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,QAAQ,WAAW,SAAS,KAAK;AACzD;AAMO,SAAS,oBAAoB,KAAuB,QAA2B;AACpF,QAAM,SAAS,IAAI,SAAS,MAAM,KAAK,CAAC,CAAC,GAAG,MAAM;AAClD,OAAK,MAAM,EAAE,WAAW,IAAI;AAC5B,SAAO;AACT;AAMO,SAAS,WACd,KACkF;AAClF,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAMO,SAAS,WAAW,KAAiC;AAC1D,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAEA,SAAS,MACP,KACA,UACwD;AACxD,SAAO;AAAA,IACL,SAAS,IAAI;AAAA,IACb,MAAM,IAAI;AAAA,IACV,OAAO,IAAI;AAAA,IACX,YAAY,IAAI;AAAA,IAChB,SAAS,IAAI;AAAA,IACb,gBAAgB,IAAI;AAAA,IACpB;AAAA,IACA,YAAY,IAAI,cAAe,IAAe;AAAA,EAChD;AACF;AASA,SAAS,SACP,QACA,MACA,QACA,MAC0C;AAC1C,SAAO,EAAE,QAAQ,MAAM,QAAQ,KAAK;AACtC;AAIA,SAAS,SACP,MACA,QAC4C;AAC5C,SAAO,EAAE,MAAM,OAAO;AACxB;AAgBA,SAAS,qBACP,UACA,MACA,MACA,QACA,MACQ;AACR,MAAI,QAAQ,qBAAqB,UAAU,QAAQ,MAAM,IAAI;AAC7D,MAAI,OAAS;AACX,aAAS,SAAS,oBAAoB,aAAa,YAAY,UAAU,QAAQ,KAAK;AAAA,EACxF,WAAW,SAAS,kBAAmB;AAEvC,MAAI,UAAU,MAAM,UAAU,SAAS,OAAQ,QAAO;AACtD,SAAO;AACT;AAEA,SAAS,wBACP,UACA,MACA,MACA,QACA,MACoB;AACpB,MAAI,MAAM,qBAAqB,UAAU,MAAM,MAAM,QAAQ,oBAAoB;AAQjF,MAAI,CAAC,SAAW,SAAS,kBAAmB;AAE5C,MAAI,QAAQ,MAAM,QAAQ,SAAS,OAAQ,QAAO,CAAC;AAKnD,QAAM,gBAAgB,QAAU,SAAS,SAAS,GAAG,EAAE,MAAM;AAG7D,MAAI,CAAC,MAAS,OAAM,WAAW,UAAU,eAAe,GAAG;AAC3D,QAAM,MAAM,WAAW,UAAU,eAAe,GAAG;AAEnD,QAAM,SAAS,CAAC;AAChB,SAAO,OAAO,KAAK,OAAO;AACxB,UAAM,UAAU,SAAS,GAAG;AAC5B,WAAO,KAAK,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC,CAAC;AAAA,EACtF;AACA,SAAO;AACT;AAkBA,SAAS,kBACP,KACA,QACA,MACA,QACA,MACA,KACiE;AA5dnE;AA6dE;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAIC,eAAc,QAAQ,QAAQ,MAAM;AACxC,MAAIA,iBAAgB,GAAI,CAAAA,eAAc,gBAAgB,QAAQ,MAAM;AACpE,MAAIA,iBAAgB,GAAI,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE7D,QAAM,iBAAiB,UAAK,GAAG,GAAE,mBAAV,GAAU,iBAAmB,QAAQ,IAAI,aAAa;AAC7E,QAAM,aAAa,UAAK,GAAG,GAAE,eAAV,GAAU,aAAe,eAAe,gBAAgB,GAAG,GAAG,aAAa;AAE9F,QAAM,WAAW,UAAUA,YAAW,EAAE,IAAI;AAC5C,MAAI,YAAY,KAAM,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE3D,QAAM,OAAO,cAAcA,YAAW;AAEtC,MAAI,IAAK,QAAO,wBAAwB,UAAU,MAAM,MAAM,QAAQ,IAAI;AAE1E,QAAM,QAAQ,qBAAqB,UAAU,MAAM,MAAM,QAAQ,IAAI;AACrE,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,IAAI;AAE5C,QAAM,UAAU,SAAS,KAAK;AAC9B,SAAO,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC;AAChF;", - "names": ["module", "module", "resolveUri", "sourceIndex", "sourceIndex"] -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/package.json b/frontend/node_modules/@jridgewell/trace-mapping/package.json deleted file mode 100644 index 9d3a1c0..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@jridgewell/trace-mapping", - "version": "0.3.31", - "description": "Trace the original position through a source map", - "keywords": [ - "source", - "map" - ], - "main": "dist/trace-mapping.umd.js", - "module": "dist/trace-mapping.mjs", - "types": "types/trace-mapping.d.cts", - "files": [ - "dist", - "src", - "types" - ], - "exports": { - ".": [ - { - "import": { - "types": "./types/trace-mapping.d.mts", - "default": "./dist/trace-mapping.mjs" - }, - "default": { - "types": "./types/trace-mapping.d.cts", - "default": "./dist/trace-mapping.umd.js" - } - }, - "./dist/trace-mapping.umd.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "benchmark": "run-s build:code benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node --expose-gc benchmark/index.mjs", - "build": "run-s -n build:code build:types", - "build:code": "node ../../esbuild.mjs trace-mapping.ts", - "build:types": "run-s build:types:force build:types:emit build:types:mts", - "build:types:force": "rimraf tsconfig.build.tsbuildinfo", - "build:types:emit": "tsc --project tsconfig.build.json", - "build:types:mts": "node ../../mts-types.mjs", - "clean": "run-s -n clean:code clean:types", - "clean:code": "tsc --build --clean tsconfig.build.json", - "clean:types": "rimraf dist types", - "test": "run-s -n test:types test:only test:format", - "test:format": "prettier --check '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:types": "eslint '{src,test}/**/*.ts'", - "lint": "run-s -n lint:types lint:format", - "lint:format": "npm run test:format -- --write", - "lint:types": "npm run test:types -- --fix", - "prepublishOnly": "npm run-s -n build test" - }, - "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping", - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/sourcemaps.git", - "directory": "packages/trace-mapping" - }, - "author": "Justin Ridgewell ", - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/src/binary-search.ts b/frontend/node_modules/@jridgewell/trace-mapping/src/binary-search.ts deleted file mode 100644 index c1144ad..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/src/binary-search.ts +++ /dev/null @@ -1,115 +0,0 @@ -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; -import { COLUMN } from './sourcemap-segment'; - -export type MemoState = { - lastKey: number; - lastNeedle: number; - lastIndex: number; -}; - -export let found = false; - -/** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ -export function binarySearch( - haystack: SourceMapSegment[] | ReverseSegment[], - needle: number, - low: number, - high: number, -): number { - while (low <= high) { - const mid = low + ((high - low) >> 1); - const cmp = haystack[mid][COLUMN] - needle; - - if (cmp === 0) { - found = true; - return mid; - } - - if (cmp < 0) { - low = mid + 1; - } else { - high = mid - 1; - } - } - - found = false; - return low - 1; -} - -export function upperBound( - haystack: SourceMapSegment[] | ReverseSegment[], - needle: number, - index: number, -): number { - for (let i = index + 1; i < haystack.length; index = i++) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} - -export function lowerBound( - haystack: SourceMapSegment[] | ReverseSegment[], - needle: number, - index: number, -): number { - for (let i = index - 1; i >= 0; index = i--) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} - -export function memoizedState(): MemoState { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1, - }; -} - -/** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ -export function memoizedBinarySearch( - haystack: SourceMapSegment[] | ReverseSegment[], - needle: number, - state: MemoState, - key: number, -): number { - const { lastKey, lastNeedle, lastIndex } = state; - - let low = 0; - let high = haystack.length - 1; - if (key === lastKey) { - if (needle === lastNeedle) { - found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; - return lastIndex; - } - - if (needle >= lastNeedle) { - // lastIndex may be -1 if the previous needle was not found. - low = lastIndex === -1 ? 0 : lastIndex; - } else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - - return (state.lastIndex = binarySearch(haystack, needle, low, high)); -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/src/by-source.ts b/frontend/node_modules/@jridgewell/trace-mapping/src/by-source.ts deleted file mode 100644 index 1da6af0..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/src/by-source.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment'; -import { sortComparator } from './sort'; - -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; - -export type Source = ReverseSegment[][]; - -// Rebuilds the original source files, with mappings that are ordered by source line/column instead -// of generated line/column. -export default function buildBySources( - decoded: readonly SourceMapSegment[][], - memos: unknown[], -): Source[] { - const sources: Source[] = memos.map(() => []); - - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - if (seg.length === 1) continue; - - const sourceIndex = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - - const source = sources[sourceIndex]; - const segs = (source[sourceLine] ||= []); - segs.push([sourceColumn, i, seg[COLUMN]]); - } - } - - for (let i = 0; i < sources.length; i++) { - const source = sources[i]; - for (let j = 0; j < source.length; j++) { - const line = source[j]; - if (line) line.sort(sortComparator); - } - } - - return sources; -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts b/frontend/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts deleted file mode 100644 index 61ac40c..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts +++ /dev/null @@ -1,192 +0,0 @@ -import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping'; -import { - COLUMN, - SOURCES_INDEX, - SOURCE_LINE, - SOURCE_COLUMN, - NAMES_INDEX, -} from './sourcemap-segment'; -import { parse } from './types'; - -import type { - DecodedSourceMap, - DecodedSourceMapXInput, - EncodedSourceMapXInput, - SectionedSourceMapXInput, - SectionedSourceMapInput, - SectionXInput, - Ro, -} from './types'; -import type { SourceMapSegment } from './sourcemap-segment'; - -type FlattenMap = { - new (map: Ro, mapUrl?: string | null): TraceMap; - (map: Ro, mapUrl?: string | null): TraceMap; -}; - -export const FlattenMap: FlattenMap = function (map, mapUrl) { - const parsed = parse(map as SectionedSourceMapInput); - - if (!('sections' in parsed)) { - return new TraceMap(parsed as DecodedSourceMapXInput | EncodedSourceMapXInput, mapUrl); - } - - const mappings: SourceMapSegment[][] = []; - const sources: string[] = []; - const sourcesContent: (string | null)[] = []; - const names: string[] = []; - const ignoreList: number[] = []; - - recurse( - parsed, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - 0, - 0, - Infinity, - Infinity, - ); - - const joined: DecodedSourceMap = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - ignoreList, - }; - - return presortedDecodedMap(joined); -} as FlattenMap; - -function recurse( - input: SectionedSourceMapXInput, - mapUrl: string | null | undefined, - mappings: SourceMapSegment[][], - sources: string[], - sourcesContent: (string | null)[], - names: string[], - ignoreList: number[], - lineOffset: number, - columnOffset: number, - stopLine: number, - stopColumn: number, -) { - const { sections } = input; - for (let i = 0; i < sections.length; i++) { - const { map, offset } = sections[i]; - - let sl = stopLine; - let sc = stopColumn; - if (i + 1 < sections.length) { - const nextOffset = sections[i + 1].offset; - sl = Math.min(stopLine, lineOffset + nextOffset.line); - - if (sl === stopLine) { - sc = Math.min(stopColumn, columnOffset + nextOffset.column); - } else if (sl < stopLine) { - sc = columnOffset + nextOffset.column; - } - } - - addSection( - map, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - lineOffset + offset.line, - columnOffset + offset.column, - sl, - sc, - ); - } -} - -function addSection( - input: SectionXInput['map'], - mapUrl: string | null | undefined, - mappings: SourceMapSegment[][], - sources: string[], - sourcesContent: (string | null)[], - names: string[], - ignoreList: number[], - lineOffset: number, - columnOffset: number, - stopLine: number, - stopColumn: number, -) { - const parsed = parse(input); - if ('sections' in parsed) return recurse(...(arguments as unknown as Parameters)); - - const map = new TraceMap(parsed, mapUrl); - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; - - append(sources, resolvedSources); - append(names, map.names); - - if (contents) append(sourcesContent, contents); - else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); - - if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); - - for (let i = 0; i < decoded.length; i++) { - const lineI = lineOffset + i; - - // We can only add so many lines before we step into the range that the next section's map - // controls. When we get to the last line, then we'll start checking the segments to see if - // they've crossed into the column range. But it may not have any columns that overstep, so we - // still need to check that we don't overstep lines, too. - if (lineI > stopLine) return; - - // The out line may already exist in mappings (if we're continuing the line started by a - // previous section). Or, we may have jumped ahead several lines to start this section. - const out = getLine(mappings, lineI); - // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the - // map can be multiple lines), it doesn't. - const cOffset = i === 0 ? columnOffset : 0; - - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - const column = cOffset + seg[COLUMN]; - - // If this segment steps into the column range that the next section's map controls, we need - // to stop early. - if (lineI === stopLine && column >= stopColumn) return; - - if (seg.length === 1) { - out.push([column]); - continue; - } - - const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - out.push( - seg.length === 4 - ? [column, sourcesIndex, sourceLine, sourceColumn] - : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]], - ); - } - } -} - -function append(arr: T[], other: T[]) { - for (let i = 0; i < other.length; i++) arr.push(other[i]); -} - -function getLine(arr: T[][], index: number): T[] { - for (let i = arr.length; i <= index; i++) arr[i] = []; - return arr[index]; -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/src/resolve.ts b/frontend/node_modules/@jridgewell/trace-mapping/src/resolve.ts deleted file mode 100644 index 30bfa3b..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/src/resolve.ts +++ /dev/null @@ -1,16 +0,0 @@ -import resolveUri from '@jridgewell/resolve-uri'; -import stripFilename from './strip-filename'; - -type Resolve = (source: string | null) => string; -export default function resolver( - mapUrl: string | null | undefined, - sourceRoot: string | undefined, -): Resolve { - const from = stripFilename(mapUrl); - // The sourceRoot is always treated as a directory, if it's not empty. - // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 - // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 - const prefix = sourceRoot ? sourceRoot + '/' : ''; - - return (source) => resolveUri(prefix + (source || ''), from); -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/src/sort.ts b/frontend/node_modules/@jridgewell/trace-mapping/src/sort.ts deleted file mode 100644 index 5d016cb..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/src/sort.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { COLUMN } from './sourcemap-segment'; - -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; - -export default function maybeSort( - mappings: SourceMapSegment[][], - owned: boolean, -): SourceMapSegment[][] { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) return mappings; - - // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If - // not, we do not want to modify the consumer's input array. - if (!owned) mappings = mappings.slice(); - - for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { - mappings[i] = sortSegments(mappings[i], owned); - } - return mappings; -} - -function nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) return i; - } - return mappings.length; -} - -function isSorted(line: SourceMapSegment[]): boolean { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN] < line[j - 1][COLUMN]) { - return false; - } - } - return true; -} - -function sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] { - if (!owned) line = line.slice(); - return line.sort(sortComparator); -} - -export function sortComparator(a: T, b: T): number { - return a[COLUMN] - b[COLUMN]; -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts b/frontend/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts deleted file mode 100644 index 94f1b6a..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts +++ /dev/null @@ -1,23 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; - -type GeneratedLine = number; - -export type SourceMapSegment = - | [GeneratedColumn] - | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] - | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; - -export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; - -export const COLUMN = 0; -export const SOURCES_INDEX = 1; -export const SOURCE_LINE = 2; -export const SOURCE_COLUMN = 3; -export const NAMES_INDEX = 4; - -export const REV_GENERATED_LINE = 1; -export const REV_GENERATED_COLUMN = 2; diff --git a/frontend/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts b/frontend/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts deleted file mode 100644 index 2c88980..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Removes everything after the last "/", but leaves the slash. - */ -export default function stripFilename(path: string | undefined | null): string { - if (!path) return ''; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts b/frontend/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts deleted file mode 100644 index 0b793d5..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts +++ /dev/null @@ -1,502 +0,0 @@ -import { encode, decode } from '@jridgewell/sourcemap-codec'; - -import resolver from './resolve'; -import maybeSort from './sort'; -import buildBySources from './by-source'; -import { - memoizedState, - memoizedBinarySearch, - upperBound, - lowerBound, - found as bsFound, -} from './binary-search'; -import { - COLUMN, - SOURCES_INDEX, - SOURCE_LINE, - SOURCE_COLUMN, - NAMES_INDEX, - REV_GENERATED_LINE, - REV_GENERATED_COLUMN, -} from './sourcemap-segment'; -import { parse } from './types'; - -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; -import type { - SourceMapV3, - DecodedSourceMap, - EncodedSourceMap, - InvalidOriginalMapping, - OriginalMapping, - InvalidGeneratedMapping, - GeneratedMapping, - SourceMapInput, - Needle, - SourceNeedle, - SourceMap, - EachMapping, - Bias, - XInput, - SectionedSourceMap, - Ro, -} from './types'; -import type { Source } from './by-source'; -import type { MemoState } from './binary-search'; - -export type { SourceMapSegment } from './sourcemap-segment'; -export type { - SourceMap, - DecodedSourceMap, - EncodedSourceMap, - Section, - SectionedSourceMap, - SourceMapV3, - Bias, - EachMapping, - GeneratedMapping, - InvalidGeneratedMapping, - InvalidOriginalMapping, - Needle, - OriginalMapping, - OriginalMapping as Mapping, - SectionedSourceMapInput, - SourceMapInput, - SourceNeedle, - XInput, - EncodedSourceMapXInput, - DecodedSourceMapXInput, - SectionedSourceMapXInput, - SectionXInput, -} from './types'; - -interface PublicMap { - _encoded: TraceMap['_encoded']; - _decoded: TraceMap['_decoded']; - _decodedMemo: TraceMap['_decodedMemo']; - _bySources: TraceMap['_bySources']; - _bySourceMemos: TraceMap['_bySourceMemos']; -} - -const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; -const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; - -export const LEAST_UPPER_BOUND = -1; -export const GREATEST_LOWER_BOUND = 1; - -export { FlattenMap, FlattenMap as AnyMap } from './flatten-map'; - -export class TraceMap implements SourceMap { - declare version: SourceMapV3['version']; - declare file: SourceMapV3['file']; - declare names: SourceMapV3['names']; - declare sourceRoot: SourceMapV3['sourceRoot']; - declare sources: SourceMapV3['sources']; - declare sourcesContent: SourceMapV3['sourcesContent']; - declare ignoreList: SourceMapV3['ignoreList']; - - declare resolvedSources: string[]; - declare private _encoded: string | undefined; - - declare private _decoded: SourceMapSegment[][] | undefined; - declare private _decodedMemo: MemoState; - - declare private _bySources: Source[] | undefined; - declare private _bySourceMemos: MemoState[] | undefined; - - constructor(map: Ro, mapUrl?: string | null) { - const isString = typeof map === 'string'; - if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap; - - const parsed = parse(map as Exclude); - - const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; - this.version = version; - this.file = file; - this.names = names || []; - this.sourceRoot = sourceRoot; - this.sources = sources; - this.sourcesContent = sourcesContent; - this.ignoreList = parsed.ignoreList || (parsed as XInput).x_google_ignoreList || undefined; - - const resolve = resolver(mapUrl, sourceRoot); - this.resolvedSources = sources.map(resolve); - - const { mappings } = parsed; - if (typeof mappings === 'string') { - this._encoded = mappings; - this._decoded = undefined; - } else if (Array.isArray(mappings)) { - this._encoded = undefined; - this._decoded = maybeSort(mappings, isString); - } else if ((parsed as unknown as SectionedSourceMap).sections) { - throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); - } else { - throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); - } - - this._decodedMemo = memoizedState(); - this._bySources = undefined; - this._bySourceMemos = undefined; - } -} - -/** - * Typescript doesn't allow friend access to private fields, so this just casts the map into a type - * with public access modifiers. - */ -function cast(map: unknown): PublicMap { - return map as any; -} - -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -export function encodedMappings(map: TraceMap): EncodedSourceMap['mappings'] { - return (cast(map)._encoded ??= encode(cast(map)._decoded!)); -} - -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -export function decodedMappings(map: TraceMap): Readonly { - return (cast(map)._decoded ||= decode(cast(map)._encoded!)); -} - -/** - * A low-level API to find the segment associated with a generated line/column (think, from a - * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. - */ -export function traceSegment( - map: TraceMap, - line: number, - column: number, -): Readonly | null { - const decoded = decodedMappings(map); - - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) return null; - - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - GREATEST_LOWER_BOUND, - ); - - return index === -1 ? null : segments[index]; -} - -/** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ -export function originalPositionFor( - map: TraceMap, - needle: Needle, -): OriginalMapping | InvalidOriginalMapping { - let { line, column, bias } = needle; - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - - const decoded = decodedMappings(map); - - // It's common for parent source maps to have pointers to lines that have no - // mapping (like a "//# sourceMappingURL=") at the end of the child file. - if (line >= decoded.length) return OMapping(null, null, null, null); - - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - bias || GREATEST_LOWER_BOUND, - ); - - if (index === -1) return OMapping(null, null, null, null); - - const segment = segments[index]; - if (segment.length === 1) return OMapping(null, null, null, null); - - const { names, resolvedSources } = map; - return OMapping( - resolvedSources[segment[SOURCES_INDEX]], - segment[SOURCE_LINE] + 1, - segment[SOURCE_COLUMN], - segment.length === 5 ? names[segment[NAMES_INDEX]] : null, - ); -} - -/** - * Finds the generated line/column position of the provided source/line/column source position. - */ -export function generatedPositionFor( - map: TraceMap, - needle: SourceNeedle, -): GeneratedMapping | InvalidGeneratedMapping { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); -} - -/** - * Finds all generated line/column positions of the provided source/line/column source position. - */ -export function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[] { - const { source, line, column, bias } = needle; - // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. - return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); -} - -/** - * Iterates each mapping in generated position order. - */ -export function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void { - const decoded = decodedMappings(map); - const { names, resolvedSources } = map; - - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - for (let j = 0; j < line.length; j++) { - const seg = line[j]; - - const generatedLine = i + 1; - const generatedColumn = seg[0]; - let source = null; - let originalLine = null; - let originalColumn = null; - let name = null; - if (seg.length !== 1) { - source = resolvedSources[seg[1]]; - originalLine = seg[2] + 1; - originalColumn = seg[3]; - } - if (seg.length === 5) name = names[seg[4]]; - - cb({ - generatedLine, - generatedColumn, - source, - originalLine, - originalColumn, - name, - } as EachMapping); - } - } -} - -function sourceIndex(map: TraceMap, source: string): number { - const { sources, resolvedSources } = map; - let index = sources.indexOf(source); - if (index === -1) index = resolvedSources.indexOf(source); - return index; -} - -/** - * Retrieves the source content for a particular source, if its found. Returns null if not. - */ -export function sourceContentFor(map: TraceMap, source: string): string | null { - const { sourcesContent } = map; - if (sourcesContent == null) return null; - const index = sourceIndex(map, source); - return index === -1 ? null : sourcesContent[index]; -} - -/** - * Determines if the source is marked to ignore by the source map. - */ -export function isIgnored(map: TraceMap, source: string): boolean { - const { ignoreList } = map; - if (ignoreList == null) return false; - const index = sourceIndex(map, source); - return index === -1 ? false : ignoreList.includes(index); -} - -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -export function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap { - const tracer = new TraceMap(clone(map, []), mapUrl); - cast(tracer)._decoded = map.mappings; - return tracer; -} - -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export function decodedMap( - map: TraceMap, -): Omit & { mappings: readonly SourceMapSegment[][] } { - return clone(map, decodedMappings(map)); -} - -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export function encodedMap(map: TraceMap): EncodedSourceMap { - return clone(map, encodedMappings(map)); -} - -function clone( - map: TraceMap | DecodedSourceMap, - mappings: T, -): T extends string ? EncodedSourceMap : DecodedSourceMap { - return { - version: map.version, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings, - ignoreList: map.ignoreList || (map as XInput).x_google_ignoreList, - } as any; -} - -function OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping; -function OMapping( - source: string, - line: number, - column: number, - name: string | null, -): OriginalMapping; -function OMapping( - source: string | null, - line: number | null, - column: number | null, - name: string | null, -): OriginalMapping | InvalidOriginalMapping { - return { source, line, column, name } as any; -} - -function GMapping(line: null, column: null): InvalidGeneratedMapping; -function GMapping(line: number, column: number): GeneratedMapping; -function GMapping( - line: number | null, - column: number | null, -): GeneratedMapping | InvalidGeneratedMapping { - return { line, column } as any; -} - -function traceSegmentInternal( - segments: SourceMapSegment[], - memo: MemoState, - line: number, - column: number, - bias: Bias, -): number; -function traceSegmentInternal( - segments: ReverseSegment[], - memo: MemoState, - line: number, - column: number, - bias: Bias, -): number; -function traceSegmentInternal( - segments: SourceMapSegment[] | ReverseSegment[], - memo: MemoState, - line: number, - column: number, - bias: Bias, -): number { - let index = memoizedBinarySearch(segments, column, memo, line); - if (bsFound) { - index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); - } else if (bias === LEAST_UPPER_BOUND) index++; - - if (index === -1 || index === segments.length) return -1; - return index; -} - -function sliceGeneratedPositions( - segments: ReverseSegment[], - memo: MemoState, - line: number, - column: number, - bias: Bias, -): GeneratedMapping[] { - let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); - - // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in - // insertion order) segment that matched. Even if we did respect the bias when tracing, we would - // still need to call `lowerBound()` to find the first segment, which is slower than just looking - // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the - // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to - // match LEAST_UPPER_BOUND. - if (!bsFound && bias === LEAST_UPPER_BOUND) min++; - - if (min === -1 || min === segments.length) return []; - - // We may have found the segment that started at an earlier column. If this is the case, then we - // need to slice all generated segments that match _that_ column, because all such segments span - // to our desired column. - const matchedColumn = bsFound ? column : segments[min][COLUMN]; - - // The binary search is not guaranteed to find the lower bound when a match wasn't found. - if (!bsFound) min = lowerBound(segments, matchedColumn, min); - const max = upperBound(segments, matchedColumn, min); - - const result = []; - for (; min <= max; min++) { - const segment = segments[min]; - result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); - } - return result; -} - -function generatedPosition( - map: TraceMap, - source: string, - line: number, - column: number, - bias: Bias, - all: false, -): GeneratedMapping | InvalidGeneratedMapping; -function generatedPosition( - map: TraceMap, - source: string, - line: number, - column: number, - bias: Bias, - all: true, -): GeneratedMapping[]; -function generatedPosition( - map: TraceMap, - source: string, - line: number, - column: number, - bias: Bias, - all: boolean, -): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] { - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - - const { sources, resolvedSources } = map; - let sourceIndex = sources.indexOf(source); - if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source); - if (sourceIndex === -1) return all ? [] : GMapping(null, null); - - const bySourceMemos = (cast(map)._bySourceMemos ||= sources.map(memoizedState)); - const generated = (cast(map)._bySources ||= buildBySources(decodedMappings(map), bySourceMemos)); - - const segments = generated[sourceIndex][line]; - if (segments == null) return all ? [] : GMapping(null, null); - - const memo = bySourceMemos[sourceIndex]; - - if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); - - const index = traceSegmentInternal(segments, memo, line, column, bias); - if (index === -1) return GMapping(null, null); - - const segment = segments[index]; - return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/src/types.ts b/frontend/node_modules/@jridgewell/trace-mapping/src/types.ts deleted file mode 100644 index 730a61f..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/src/types.ts +++ /dev/null @@ -1,114 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment'; -import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping'; - -export interface SourceMapV3 { - file?: string | null; - names: string[]; - sourceRoot?: string; - sources: (string | null)[]; - sourcesContent?: (string | null)[]; - version: 3; - ignoreList?: number[]; -} - -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} - -export interface DecodedSourceMap extends SourceMapV3 { - mappings: SourceMapSegment[][]; -} - -export interface Section { - offset: { line: number; column: number }; - map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; -} - -export interface SectionedSourceMap { - file?: string | null; - sections: Section[]; - version: 3; -} - -export type OriginalMapping = { - source: string | null; - line: number; - column: number; - name: string | null; -}; - -export type InvalidOriginalMapping = { - source: null; - line: null; - column: null; - name: null; -}; - -export type GeneratedMapping = { - line: number; - column: number; -}; -export type InvalidGeneratedMapping = { - line: null; - column: null; -}; - -export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; - -export type XInput = { x_google_ignoreList?: SourceMapV3['ignoreList'] }; -export type EncodedSourceMapXInput = EncodedSourceMap & XInput; -export type DecodedSourceMapXInput = DecodedSourceMap & XInput; -export type SectionedSourceMapXInput = Omit & { - sections: SectionXInput[]; -}; -export type SectionXInput = Omit & { - map: SectionedSourceMapInput; -}; - -export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; -export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; - -export type Needle = { line: number; column: number; bias?: Bias }; -export type SourceNeedle = { source: string; line: number; column: number; bias?: Bias }; - -export type EachMapping = - | { - generatedLine: number; - generatedColumn: number; - source: null; - originalLine: null; - originalColumn: null; - name: null; - } - | { - generatedLine: number; - generatedColumn: number; - source: string | null; - originalLine: number; - originalColumn: number; - name: string | null; - }; - -export abstract class SourceMap { - declare version: SourceMapV3['version']; - declare file: SourceMapV3['file']; - declare names: SourceMapV3['names']; - declare sourceRoot: SourceMapV3['sourceRoot']; - declare sources: SourceMapV3['sources']; - declare sourcesContent: SourceMapV3['sourcesContent']; - declare resolvedSources: SourceMapV3['sources']; - declare ignoreList: SourceMapV3['ignoreList']; -} - -export type Ro = - T extends Array - ? V[] | Readonly | RoArray | Readonly> - : T extends object - ? T | Readonly | RoObject | Readonly> - : T; -type RoArray = Ro[]; -type RoObject = { [K in keyof T]: T[K] | Ro }; - -export function parse(map: T): Exclude { - return typeof map === 'string' ? JSON.parse(map) : (map as Exclude); -} diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts b/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts deleted file mode 100644 index b7bb85c..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts +++ /dev/null @@ -1,33 +0,0 @@ -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.cts'; -export type MemoState = { - lastKey: number; - lastNeedle: number; - lastIndex: number; -}; -export declare let found: boolean; -/** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ -export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; -export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; -export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; -export declare function memoizedState(): MemoState; -/** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ -export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; -//# sourceMappingURL=binary-search.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map deleted file mode 100644 index 648e84c..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../src/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,IAAI,KAAK,SAAQ,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAmBR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,aAAa,IAAI,SAAS,CAMzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAsBR"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts b/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts deleted file mode 100644 index 19e1e6b..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts +++ /dev/null @@ -1,33 +0,0 @@ -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.mts'; -export type MemoState = { - lastKey: number; - lastNeedle: number; - lastIndex: number; -}; -export declare let found: boolean; -/** - * A binary search implementation that returns the index if a match is found. - * If no match is found, then the left-index (the index associated with the item that comes just - * before the desired index) is returned. To maintain proper sort order, a splice would happen at - * the next index: - * - * ```js - * const array = [1, 3]; - * const needle = 2; - * const index = binarySearch(array, needle, (item, needle) => item - needle); - * - * assert.equal(index, 0); - * array.splice(index + 1, 0, needle); - * assert.deepEqual(array, [1, 2, 3]); - * ``` - */ -export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; -export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; -export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; -export declare function memoizedState(): MemoState; -/** - * This overly complicated beast is just to record the last tested line/column and the resulting - * index, allowing us to skip a few tests if mappings are monotonically increasing. - */ -export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; -//# sourceMappingURL=binary-search.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map deleted file mode 100644 index 648e84c..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../src/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,IAAI,KAAK,SAAQ,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAmBR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,aAAa,IAAI,SAAS,CAMzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAsBR"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts b/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts deleted file mode 100644 index da49693..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.cts'; -export type Source = ReverseSegment[][]; -export = function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[]; -//# sourceMappingURL=by-source.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map deleted file mode 100644 index 32d2a7a..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"by-source.d.ts","sourceRoot":"","sources":["../src/by-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,cAAc,EAAE,EAAE,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EAAE,EACtC,KAAK,EAAE,OAAO,EAAE,GACf,MAAM,EAAE,CA4BV"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts b/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts deleted file mode 100644 index f361049..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts'; -export type Source = ReverseSegment[][]; -export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[]; -//# sourceMappingURL=by-source.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map deleted file mode 100644 index 32d2a7a..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"by-source.d.ts","sourceRoot":"","sources":["../src/by-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,cAAc,EAAE,EAAE,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EAAE,EACtC,KAAK,EAAE,OAAO,EAAE,GACf,MAAM,EAAE,CA4BV"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts b/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts deleted file mode 100644 index 433d849..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { TraceMap } from './trace-mapping.cts'; -import type { SectionedSourceMapInput, Ro } from './types.cts'; -type FlattenMap = { - new (map: Ro, mapUrl?: string | null): TraceMap; - (map: Ro, mapUrl?: string | null): TraceMap; -}; -export declare const FlattenMap: FlattenMap; -export {}; -//# sourceMappingURL=flatten-map.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map deleted file mode 100644 index 994b208..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"flatten-map.d.ts","sourceRoot":"","sources":["../src/flatten-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAUjF,OAAO,KAAK,EAKV,uBAAuB,EAEvB,EAAE,EACH,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG;IAChB,KAAK,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IACzE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAsCV,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts b/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts deleted file mode 100644 index 444a1be..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts +++ /dev/null @@ -1,9 +0,0 @@ -import { TraceMap } from './trace-mapping.mts'; -import type { SectionedSourceMapInput, Ro } from './types.mts'; -type FlattenMap = { - new (map: Ro, mapUrl?: string | null): TraceMap; - (map: Ro, mapUrl?: string | null): TraceMap; -}; -export declare const FlattenMap: FlattenMap; -export {}; -//# sourceMappingURL=flatten-map.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map deleted file mode 100644 index 994b208..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"flatten-map.d.ts","sourceRoot":"","sources":["../src/flatten-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAUjF,OAAO,KAAK,EAKV,uBAAuB,EAEvB,EAAE,EACH,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG;IAChB,KAAK,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IACzE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAsCV,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts b/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts deleted file mode 100644 index 62aeedb..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -type Resolve = (source: string | null) => string; -export = function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve; -export {}; -//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map deleted file mode 100644 index 9f155ac..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AACjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAQT"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts b/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts deleted file mode 100644 index e2798a1..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts +++ /dev/null @@ -1,4 +0,0 @@ -type Resolve = (source: string | null) => string; -export default function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve; -export {}; -//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map deleted file mode 100644 index 9f155ac..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AACjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAQT"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.cts b/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.cts deleted file mode 100644 index aa14c12..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.cts'; -export = function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; -export declare function sortComparator(a: T, b: T): number; -//# sourceMappingURL=sort.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map deleted file mode 100644 index 48b8e67..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAC9B,KAAK,EAAE,OAAO,GACb,gBAAgB,EAAE,EAAE,CAYtB;AAuBD,wBAAgB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAE9F"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.mts b/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.mts deleted file mode 100644 index c5b94e6..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.mts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts'; -export default function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; -export declare function sortComparator(a: T, b: T): number; -//# sourceMappingURL=sort.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map deleted file mode 100644 index 48b8e67..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAC9B,KAAK,EAAE,OAAO,GACb,gBAAgB,EAAE,EAAE,CAYtB;AAuBD,wBAAgB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAE9F"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts b/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts deleted file mode 100644 index 8d3cabc..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts +++ /dev/null @@ -1,17 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; -type GeneratedLine = number; -export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; -export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; -export declare const COLUMN = 0; -export declare const SOURCES_INDEX = 1; -export declare const SOURCE_LINE = 2; -export declare const SOURCE_COLUMN = 3; -export declare const NAMES_INDEX = 4; -export declare const REV_GENERATED_LINE = 1; -export declare const REV_GENERATED_COLUMN = 2; -export {}; -//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map deleted file mode 100644 index 0c94a46..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,KAAK,aAAa,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts b/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts deleted file mode 100644 index 8d3cabc..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts +++ /dev/null @@ -1,17 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; -type GeneratedLine = number; -export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; -export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; -export declare const COLUMN = 0; -export declare const SOURCES_INDEX = 1; -export declare const SOURCE_LINE = 2; -export declare const SOURCE_COLUMN = 3; -export declare const NAMES_INDEX = 4; -export declare const REV_GENERATED_LINE = 1; -export declare const REV_GENERATED_COLUMN = 2; -export {}; -//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map deleted file mode 100644 index 0c94a46..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,KAAK,aAAa,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts b/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts deleted file mode 100644 index 8b3c0e9..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Removes everything after the last "/", but leaves the slash. - */ -export = function stripFilename(path: string | undefined | null): string; -//# sourceMappingURL=strip-filename.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map deleted file mode 100644 index 17a25da..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strip-filename.d.ts","sourceRoot":"","sources":["../src/strip-filename.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI7E"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts b/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts deleted file mode 100644 index cbbaee0..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Removes everything after the last "/", but leaves the slash. - */ -export default function stripFilename(path: string | undefined | null): string; -//# sourceMappingURL=strip-filename.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map deleted file mode 100644 index 17a25da..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strip-filename.d.ts","sourceRoot":"","sources":["../src/strip-filename.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI7E"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts b/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts deleted file mode 100644 index a40f305..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts +++ /dev/null @@ -1,80 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.cts'; -import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping, Ro } from './types.cts'; -export type { SourceMapSegment } from './sourcemap-segment.cts'; -export type { SourceMap, DecodedSourceMap, EncodedSourceMap, Section, SectionedSourceMap, SourceMapV3, Bias, EachMapping, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, Needle, OriginalMapping, OriginalMapping as Mapping, SectionedSourceMapInput, SourceMapInput, SourceNeedle, XInput, EncodedSourceMapXInput, DecodedSourceMapXInput, SectionedSourceMapXInput, SectionXInput, } from './types.cts'; -export declare const LEAST_UPPER_BOUND = -1; -export declare const GREATEST_LOWER_BOUND = 1; -export { FlattenMap, FlattenMap as AnyMap } from './flatten-map.cts'; -export declare class TraceMap implements SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - ignoreList: SourceMapV3['ignoreList']; - resolvedSources: string[]; - private _encoded; - private _decoded; - private _decodedMemo; - private _bySources; - private _bySourceMemos; - constructor(map: Ro, mapUrl?: string | null); -} -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -export declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings']; -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -export declare function decodedMappings(map: TraceMap): Readonly; -/** - * A low-level API to find the segment associated with a generated line/column (think, from a - * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. - */ -export declare function traceSegment(map: TraceMap, line: number, column: number): Readonly | null; -/** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ -export declare function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping; -/** - * Finds the generated line/column position of the provided source/line/column source position. - */ -export declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping; -/** - * Finds all generated line/column positions of the provided source/line/column source position. - */ -export declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[]; -/** - * Iterates each mapping in generated position order. - */ -export declare function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void; -/** - * Retrieves the source content for a particular source, if its found. Returns null if not. - */ -export declare function sourceContentFor(map: TraceMap, source: string): string | null; -/** - * Determines if the source is marked to ignore by the source map. - */ -export declare function isIgnored(map: TraceMap, source: string): boolean; -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -export declare function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function decodedMap(map: TraceMap): Omit & { - mappings: readonly SourceMapSegment[][]; -}; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function encodedMap(map: TraceMap): EncodedSourceMap; -//# sourceMappingURL=trace-mapping.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map deleted file mode 100644 index b5a874c..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trace-mapping.d.ts","sourceRoot":"","sources":["../src/trace-mapping.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EAIX,EAAE,EACH,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,EACN,eAAe,EACf,eAAe,IAAI,OAAO,EAC1B,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,GACd,MAAM,SAAS,CAAC;AAajB,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjE,qBAAa,QAAS,YAAW,SAAS;IAChC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAEtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAClC,QAAgB,QAAQ,CAAqB;IAE7C,QAAgB,QAAQ,CAAmC;IAC3D,QAAgB,YAAY,CAAY;IAExC,QAAgB,UAAU,CAAuB;IACjD,QAAgB,cAAc,CAA0B;gBAE5C,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;CAmC5D;AAUD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAErF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAiBnC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,sBAAsB,CAiC1C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,YAAY,GACnB,gBAAgB,GAAG,uBAAuB,CAG5C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAIhG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAgCnF;AASD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAIpF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,QAAQ,GACZ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAA;CAAE,CAElF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAE1D"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts b/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts deleted file mode 100644 index bc2ff0f..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts +++ /dev/null @@ -1,80 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.mts'; -import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping, Ro } from './types.mts'; -export type { SourceMapSegment } from './sourcemap-segment.mts'; -export type { SourceMap, DecodedSourceMap, EncodedSourceMap, Section, SectionedSourceMap, SourceMapV3, Bias, EachMapping, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, Needle, OriginalMapping, OriginalMapping as Mapping, SectionedSourceMapInput, SourceMapInput, SourceNeedle, XInput, EncodedSourceMapXInput, DecodedSourceMapXInput, SectionedSourceMapXInput, SectionXInput, } from './types.mts'; -export declare const LEAST_UPPER_BOUND = -1; -export declare const GREATEST_LOWER_BOUND = 1; -export { FlattenMap, FlattenMap as AnyMap } from './flatten-map.mts'; -export declare class TraceMap implements SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - ignoreList: SourceMapV3['ignoreList']; - resolvedSources: string[]; - private _encoded; - private _decoded; - private _decodedMemo; - private _bySources; - private _bySourceMemos; - constructor(map: Ro, mapUrl?: string | null); -} -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -export declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings']; -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -export declare function decodedMappings(map: TraceMap): Readonly; -/** - * A low-level API to find the segment associated with a generated line/column (think, from a - * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. - */ -export declare function traceSegment(map: TraceMap, line: number, column: number): Readonly | null; -/** - * A higher-level API to find the source/line/column associated with a generated line/column - * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in - * `source-map` library. - */ -export declare function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping; -/** - * Finds the generated line/column position of the provided source/line/column source position. - */ -export declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping; -/** - * Finds all generated line/column positions of the provided source/line/column source position. - */ -export declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[]; -/** - * Iterates each mapping in generated position order. - */ -export declare function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void; -/** - * Retrieves the source content for a particular source, if its found. Returns null if not. - */ -export declare function sourceContentFor(map: TraceMap, source: string): string | null; -/** - * Determines if the source is marked to ignore by the source map. - */ -export declare function isIgnored(map: TraceMap, source: string): boolean; -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -export declare function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function decodedMap(map: TraceMap): Omit & { - mappings: readonly SourceMapSegment[][]; -}; -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function encodedMap(map: TraceMap): EncodedSourceMap; -//# sourceMappingURL=trace-mapping.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map deleted file mode 100644 index b5a874c..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trace-mapping.d.ts","sourceRoot":"","sources":["../src/trace-mapping.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EAIX,EAAE,EACH,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,EACN,eAAe,EACf,eAAe,IAAI,OAAO,EAC1B,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,GACd,MAAM,SAAS,CAAC;AAajB,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjE,qBAAa,QAAS,YAAW,SAAS;IAChC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAEtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAClC,QAAgB,QAAQ,CAAqB;IAE7C,QAAgB,QAAQ,CAAmC;IAC3D,QAAgB,YAAY,CAAY;IAExC,QAAgB,UAAU,CAAuB;IACjD,QAAgB,cAAc,CAA0B;gBAE5C,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;CAmC5D;AAUD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAErF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAiBnC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,sBAAsB,CAiC1C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,YAAY,GACnB,gBAAgB,GAAG,uBAAuB,CAG5C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAIhG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAgCnF;AASD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAIpF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,QAAQ,GACZ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAA;CAAE,CAElF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAE1D"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.cts b/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.cts deleted file mode 100644 index 729c2c3..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.cts +++ /dev/null @@ -1,107 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.cts'; -import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping.cts'; -export interface SourceMapV3 { - file?: string | null; - names: string[]; - sourceRoot?: string; - sources: (string | null)[]; - sourcesContent?: (string | null)[]; - version: 3; - ignoreList?: number[]; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: SourceMapSegment[][]; -} -export interface Section { - offset: { - line: number; - column: number; - }; - map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; -} -export interface SectionedSourceMap { - file?: string | null; - sections: Section[]; - version: 3; -} -export type OriginalMapping = { - source: string | null; - line: number; - column: number; - name: string | null; -}; -export type InvalidOriginalMapping = { - source: null; - line: null; - column: null; - name: null; -}; -export type GeneratedMapping = { - line: number; - column: number; -}; -export type InvalidGeneratedMapping = { - line: null; - column: null; -}; -export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; -export type XInput = { - x_google_ignoreList?: SourceMapV3['ignoreList']; -}; -export type EncodedSourceMapXInput = EncodedSourceMap & XInput; -export type DecodedSourceMapXInput = DecodedSourceMap & XInput; -export type SectionedSourceMapXInput = Omit & { - sections: SectionXInput[]; -}; -export type SectionXInput = Omit & { - map: SectionedSourceMapInput; -}; -export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; -export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; -export type Needle = { - line: number; - column: number; - bias?: Bias; -}; -export type SourceNeedle = { - source: string; - line: number; - column: number; - bias?: Bias; -}; -export type EachMapping = { - generatedLine: number; - generatedColumn: number; - source: null; - originalLine: null; - originalColumn: null; - name: null; -} | { - generatedLine: number; - generatedColumn: number; - source: string | null; - originalLine: number; - originalColumn: number; - name: string | null; -}; -export declare abstract class SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - resolvedSources: SourceMapV3['sources']; - ignoreList: SourceMapV3['ignoreList']; -} -export type Ro = T extends Array ? V[] | Readonly | RoArray | Readonly> : T extends object ? T | Readonly | RoObject | Readonly> : T; -type RoArray = Ro[]; -type RoObject = { - [K in keyof T]: T[K] | Ro; -}; -export declare function parse(map: T): Exclude; -export {}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map deleted file mode 100644 index 9224783..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;CAC/D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,OAAO,oBAAoB,GAAG,OAAO,iBAAiB,CAAC;AAE1E,MAAM,MAAM,MAAM,GAAG;IAAE,mBAAmB,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG;IAC5E,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG;IACjD,GAAG,EAAE,uBAAuB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,QAAQ,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,wBAAwB,CAAC;AAEhF,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,WAAW,GACnB;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,IAAI,CAAC;IACb,YAAY,EAAE,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEN,8BAAsB,SAAS;IACrB,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,EAAE,CAAC,CAAC,IACd,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACpB,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvD,CAAC,SAAS,MAAM,GACd,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC;AACV,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEvD,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAEnD"} \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.mts b/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.mts deleted file mode 100644 index a26d186..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.mts +++ /dev/null @@ -1,107 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.mts'; -import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping.mts'; -export interface SourceMapV3 { - file?: string | null; - names: string[]; - sourceRoot?: string; - sources: (string | null)[]; - sourcesContent?: (string | null)[]; - version: 3; - ignoreList?: number[]; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: SourceMapSegment[][]; -} -export interface Section { - offset: { - line: number; - column: number; - }; - map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; -} -export interface SectionedSourceMap { - file?: string | null; - sections: Section[]; - version: 3; -} -export type OriginalMapping = { - source: string | null; - line: number; - column: number; - name: string | null; -}; -export type InvalidOriginalMapping = { - source: null; - line: null; - column: null; - name: null; -}; -export type GeneratedMapping = { - line: number; - column: number; -}; -export type InvalidGeneratedMapping = { - line: null; - column: null; -}; -export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; -export type XInput = { - x_google_ignoreList?: SourceMapV3['ignoreList']; -}; -export type EncodedSourceMapXInput = EncodedSourceMap & XInput; -export type DecodedSourceMapXInput = DecodedSourceMap & XInput; -export type SectionedSourceMapXInput = Omit & { - sections: SectionXInput[]; -}; -export type SectionXInput = Omit & { - map: SectionedSourceMapInput; -}; -export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; -export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; -export type Needle = { - line: number; - column: number; - bias?: Bias; -}; -export type SourceNeedle = { - source: string; - line: number; - column: number; - bias?: Bias; -}; -export type EachMapping = { - generatedLine: number; - generatedColumn: number; - source: null; - originalLine: null; - originalColumn: null; - name: null; -} | { - generatedLine: number; - generatedColumn: number; - source: string | null; - originalLine: number; - originalColumn: number; - name: string | null; -}; -export declare abstract class SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - resolvedSources: SourceMapV3['sources']; - ignoreList: SourceMapV3['ignoreList']; -} -export type Ro = T extends Array ? V[] | Readonly | RoArray | Readonly> : T extends object ? T | Readonly | RoObject | Readonly> : T; -type RoArray = Ro[]; -type RoObject = { - [K in keyof T]: T[K] | Ro; -}; -export declare function parse(map: T): Exclude; -export {}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map b/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map deleted file mode 100644 index 9224783..0000000 --- a/frontend/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;CAC/D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,OAAO,oBAAoB,GAAG,OAAO,iBAAiB,CAAC;AAE1E,MAAM,MAAM,MAAM,GAAG;IAAE,mBAAmB,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG;IAC5E,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG;IACjD,GAAG,EAAE,uBAAuB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,QAAQ,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,wBAAwB,CAAC;AAEhF,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,WAAW,GACnB;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,IAAI,CAAC;IACb,YAAY,EAAE,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEN,8BAAsB,SAAS;IACrB,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,EAAE,CAAC,CAAC,IACd,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACpB,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvD,CAAC,SAAS,MAAM,GACd,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC;AACV,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEvD,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAEnD"} \ No newline at end of file diff --git a/frontend/node_modules/@oxc-project/types/LICENSE b/frontend/node_modules/@oxc-project/types/LICENSE deleted file mode 100644 index 444bffc..0000000 --- a/frontend/node_modules/@oxc-project/types/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2024-present VoidZero Inc. & Contributors -Copyright (c) 2023 Boshen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/frontend/node_modules/@oxc-project/types/README.md b/frontend/node_modules/@oxc-project/types/README.md deleted file mode 100644 index d5b248a..0000000 --- a/frontend/node_modules/@oxc-project/types/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Oxc Types - -Typescript definitions for Oxc AST nodes. diff --git a/frontend/node_modules/@oxc-project/types/package.json b/frontend/node_modules/@oxc-project/types/package.json deleted file mode 100644 index f181226..0000000 --- a/frontend/node_modules/@oxc-project/types/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@oxc-project/types", - "version": "0.127.0", - "description": "Types for Oxc AST nodes", - "keywords": [ - "AST", - "Parser" - ], - "homepage": "https://oxc.rs", - "bugs": "https://github.com/oxc-project/oxc/issues", - "license": "MIT", - "author": "Boshen and oxc contributors", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc.git", - "directory": "npm/oxc-types" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - }, - "files": [ - "types.d.ts" - ], - "type": "module", - "types": "types.d.ts" -} \ No newline at end of file diff --git a/frontend/node_modules/@oxc-project/types/types.d.ts b/frontend/node_modules/@oxc-project/types/types.d.ts deleted file mode 100644 index c94c115..0000000 --- a/frontend/node_modules/@oxc-project/types/types.d.ts +++ /dev/null @@ -1,1912 +0,0 @@ -// Auto-generated code, DO NOT EDIT DIRECTLY! -// To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`. - -export interface Program extends Span { - type: "Program"; - body: Array; - sourceType: ModuleKind; - hashbang: Hashbang | null; - parent?: null; -} - -export type Expression = - | BooleanLiteral - | NullLiteral - | NumericLiteral - | BigIntLiteral - | RegExpLiteral - | StringLiteral - | TemplateLiteral - | IdentifierReference - | MetaProperty - | Super - | ArrayExpression - | ArrowFunctionExpression - | AssignmentExpression - | AwaitExpression - | BinaryExpression - | CallExpression - | ChainExpression - | Class - | ConditionalExpression - | Function - | ImportExpression - | LogicalExpression - | NewExpression - | ObjectExpression - | ParenthesizedExpression - | SequenceExpression - | TaggedTemplateExpression - | ThisExpression - | UnaryExpression - | UpdateExpression - | YieldExpression - | PrivateInExpression - | JSXElement - | JSXFragment - | TSAsExpression - | TSSatisfiesExpression - | TSTypeAssertion - | TSNonNullExpression - | TSInstantiationExpression - | V8IntrinsicExpression - | MemberExpression; - -export interface IdentifierName extends Span { - type: "Identifier"; - decorators?: []; - name: string; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export interface IdentifierReference extends Span { - type: "Identifier"; - decorators?: []; - name: string; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export interface BindingIdentifier extends Span { - type: "Identifier"; - decorators?: []; - name: string; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export interface LabelIdentifier extends Span { - type: "Identifier"; - decorators?: []; - name: string; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export interface ThisExpression extends Span { - type: "ThisExpression"; - parent?: Node; -} - -export interface ArrayExpression extends Span { - type: "ArrayExpression"; - elements: Array; - parent?: Node; -} - -export type ArrayExpressionElement = SpreadElement | null | Expression; - -export interface ObjectExpression extends Span { - type: "ObjectExpression"; - properties: Array; - parent?: Node; -} - -export type ObjectPropertyKind = ObjectProperty | SpreadElement; - -export interface ObjectProperty extends Span { - type: "Property"; - kind: PropertyKind; - key: PropertyKey; - value: Expression; - method: boolean; - shorthand: boolean; - computed: boolean; - optional?: false; - parent?: Node; -} - -export type PropertyKey = IdentifierName | PrivateIdentifier | Expression; - -export type PropertyKind = "init" | "get" | "set"; - -export interface TemplateLiteral extends Span { - type: "TemplateLiteral"; - quasis: Array; - expressions: Array; - parent?: Node; -} - -export interface TaggedTemplateExpression extends Span { - type: "TaggedTemplateExpression"; - tag: Expression; - typeArguments?: TSTypeParameterInstantiation | null; - quasi: TemplateLiteral; - parent?: Node; -} - -export interface TemplateElement extends Span { - type: "TemplateElement"; - value: TemplateElementValue; - tail: boolean; - parent?: Node; -} - -export interface TemplateElementValue { - raw: string; - cooked: string | null; -} - -export type MemberExpression = - | ComputedMemberExpression - | StaticMemberExpression - | PrivateFieldExpression; - -export interface ComputedMemberExpression extends Span { - type: "MemberExpression"; - object: Expression; - property: Expression; - optional: boolean; - computed: true; - parent?: Node; -} - -export interface StaticMemberExpression extends Span { - type: "MemberExpression"; - object: Expression; - property: IdentifierName; - optional: boolean; - computed: false; - parent?: Node; -} - -export interface PrivateFieldExpression extends Span { - type: "MemberExpression"; - object: Expression; - property: PrivateIdentifier; - optional: boolean; - computed: false; - parent?: Node; -} - -export interface CallExpression extends Span { - type: "CallExpression"; - callee: Expression; - typeArguments?: TSTypeParameterInstantiation | null; - arguments: Array; - optional: boolean; - parent?: Node; -} - -export interface NewExpression extends Span { - type: "NewExpression"; - callee: Expression; - typeArguments?: TSTypeParameterInstantiation | null; - arguments: Array; - parent?: Node; -} - -export interface MetaProperty extends Span { - type: "MetaProperty"; - meta: IdentifierName; - property: IdentifierName; - parent?: Node; -} - -export interface SpreadElement extends Span { - type: "SpreadElement"; - argument: Expression; - parent?: Node; -} - -export type Argument = SpreadElement | Expression; - -export interface UpdateExpression extends Span { - type: "UpdateExpression"; - operator: UpdateOperator; - prefix: boolean; - argument: SimpleAssignmentTarget; - parent?: Node; -} - -export interface UnaryExpression extends Span { - type: "UnaryExpression"; - operator: UnaryOperator; - argument: Expression; - prefix: true; - parent?: Node; -} - -export interface BinaryExpression extends Span { - type: "BinaryExpression"; - left: Expression; - operator: BinaryOperator; - right: Expression; - parent?: Node; -} - -export interface PrivateInExpression extends Span { - type: "BinaryExpression"; - left: PrivateIdentifier; - operator: "in"; - right: Expression; - parent?: Node; -} - -export interface LogicalExpression extends Span { - type: "LogicalExpression"; - left: Expression; - operator: LogicalOperator; - right: Expression; - parent?: Node; -} - -export interface ConditionalExpression extends Span { - type: "ConditionalExpression"; - test: Expression; - consequent: Expression; - alternate: Expression; - parent?: Node; -} - -export interface AssignmentExpression extends Span { - type: "AssignmentExpression"; - operator: AssignmentOperator; - left: AssignmentTarget; - right: Expression; - parent?: Node; -} - -export type AssignmentTarget = SimpleAssignmentTarget | AssignmentTargetPattern; - -export type SimpleAssignmentTarget = - | IdentifierReference - | TSAsExpression - | TSSatisfiesExpression - | TSNonNullExpression - | TSTypeAssertion - | MemberExpression; - -export type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget; - -export interface ArrayAssignmentTarget extends Span { - type: "ArrayPattern"; - decorators?: []; - elements: Array; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export interface ObjectAssignmentTarget extends Span { - type: "ObjectPattern"; - decorators?: []; - properties: Array; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export interface AssignmentTargetRest extends Span { - type: "RestElement"; - decorators?: []; - argument: AssignmentTarget; - optional?: false; - typeAnnotation?: null; - value?: null; - parent?: Node; -} - -export type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget; - -export interface AssignmentTargetWithDefault extends Span { - type: "AssignmentPattern"; - decorators?: []; - left: AssignmentTarget; - right: Expression; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export type AssignmentTargetProperty = - | AssignmentTargetPropertyIdentifier - | AssignmentTargetPropertyProperty; - -export interface AssignmentTargetPropertyIdentifier extends Span { - type: "Property"; - kind: "init"; - key: IdentifierReference; - value: IdentifierReference | AssignmentTargetWithDefault; - method: false; - shorthand: true; - computed: false; - optional?: false; - parent?: Node; -} - -export interface AssignmentTargetPropertyProperty extends Span { - type: "Property"; - kind: "init"; - key: PropertyKey; - value: AssignmentTargetMaybeDefault; - method: false; - shorthand: false; - computed: boolean; - optional?: false; - parent?: Node; -} - -export interface SequenceExpression extends Span { - type: "SequenceExpression"; - expressions: Array; - parent?: Node; -} - -export interface Super extends Span { - type: "Super"; - parent?: Node; -} - -export interface AwaitExpression extends Span { - type: "AwaitExpression"; - argument: Expression; - parent?: Node; -} - -export interface ChainExpression extends Span { - type: "ChainExpression"; - expression: ChainElement; - parent?: Node; -} - -export type ChainElement = CallExpression | TSNonNullExpression | MemberExpression; - -export interface ParenthesizedExpression extends Span { - type: "ParenthesizedExpression"; - expression: Expression; - parent?: Node; -} - -export type Statement = - | BlockStatement - | BreakStatement - | ContinueStatement - | DebuggerStatement - | DoWhileStatement - | EmptyStatement - | ExpressionStatement - | ForInStatement - | ForOfStatement - | ForStatement - | IfStatement - | LabeledStatement - | ReturnStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | WithStatement - | Declaration - | ModuleDeclaration; - -export interface Directive extends Span { - type: "ExpressionStatement"; - expression: StringLiteral; - directive: string; - parent?: Node; -} - -export interface Hashbang extends Span { - type: "Hashbang"; - value: string; - parent?: Node; -} - -export interface BlockStatement extends Span { - type: "BlockStatement"; - body: Array; - parent?: Node; -} - -export type Declaration = - | VariableDeclaration - | Function - | Class - | TSTypeAliasDeclaration - | TSInterfaceDeclaration - | TSEnumDeclaration - | TSModuleDeclaration - | TSGlobalDeclaration - | TSImportEqualsDeclaration; - -export interface VariableDeclaration extends Span { - type: "VariableDeclaration"; - kind: VariableDeclarationKind; - declarations: Array; - declare?: boolean; - parent?: Node; -} - -export type VariableDeclarationKind = "var" | "let" | "const" | "using" | "await using"; - -export interface VariableDeclarator extends Span { - type: "VariableDeclarator"; - id: BindingPattern; - init: Expression | null; - definite?: boolean; - parent?: Node; -} - -export interface EmptyStatement extends Span { - type: "EmptyStatement"; - parent?: Node; -} - -export interface ExpressionStatement extends Span { - type: "ExpressionStatement"; - expression: Expression; - directive?: string | null; - parent?: Node; -} - -export interface IfStatement extends Span { - type: "IfStatement"; - test: Expression; - consequent: Statement; - alternate: Statement | null; - parent?: Node; -} - -export interface DoWhileStatement extends Span { - type: "DoWhileStatement"; - body: Statement; - test: Expression; - parent?: Node; -} - -export interface WhileStatement extends Span { - type: "WhileStatement"; - test: Expression; - body: Statement; - parent?: Node; -} - -export interface ForStatement extends Span { - type: "ForStatement"; - init: ForStatementInit | null; - test: Expression | null; - update: Expression | null; - body: Statement; - parent?: Node; -} - -export type ForStatementInit = VariableDeclaration | Expression; - -export interface ForInStatement extends Span { - type: "ForInStatement"; - left: ForStatementLeft; - right: Expression; - body: Statement; - parent?: Node; -} - -export type ForStatementLeft = VariableDeclaration | AssignmentTarget; - -export interface ForOfStatement extends Span { - type: "ForOfStatement"; - await: boolean; - left: ForStatementLeft; - right: Expression; - body: Statement; - parent?: Node; -} - -export interface ContinueStatement extends Span { - type: "ContinueStatement"; - label: LabelIdentifier | null; - parent?: Node; -} - -export interface BreakStatement extends Span { - type: "BreakStatement"; - label: LabelIdentifier | null; - parent?: Node; -} - -export interface ReturnStatement extends Span { - type: "ReturnStatement"; - argument: Expression | null; - parent?: Node; -} - -export interface WithStatement extends Span { - type: "WithStatement"; - object: Expression; - body: Statement; - parent?: Node; -} - -export interface SwitchStatement extends Span { - type: "SwitchStatement"; - discriminant: Expression; - cases: Array; - parent?: Node; -} - -export interface SwitchCase extends Span { - type: "SwitchCase"; - test: Expression | null; - consequent: Array; - parent?: Node; -} - -export interface LabeledStatement extends Span { - type: "LabeledStatement"; - label: LabelIdentifier; - body: Statement; - parent?: Node; -} - -export interface ThrowStatement extends Span { - type: "ThrowStatement"; - argument: Expression; - parent?: Node; -} - -export interface TryStatement extends Span { - type: "TryStatement"; - block: BlockStatement; - handler: CatchClause | null; - finalizer: BlockStatement | null; - parent?: Node; -} - -export interface CatchClause extends Span { - type: "CatchClause"; - param: BindingPattern | null; - body: BlockStatement; - parent?: Node; -} - -export interface DebuggerStatement extends Span { - type: "DebuggerStatement"; - parent?: Node; -} - -export type BindingPattern = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern; - -export interface AssignmentPattern extends Span { - type: "AssignmentPattern"; - decorators?: []; - left: BindingPattern; - right: Expression; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export interface ObjectPattern extends Span { - type: "ObjectPattern"; - decorators?: []; - properties: Array; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export interface BindingProperty extends Span { - type: "Property"; - kind: "init"; - key: PropertyKey; - value: BindingPattern; - method: false; - shorthand: boolean; - computed: boolean; - optional?: false; - parent?: Node; -} - -export interface ArrayPattern extends Span { - type: "ArrayPattern"; - decorators?: []; - elements: Array; - optional?: false; - typeAnnotation?: null; - parent?: Node; -} - -export interface BindingRestElement extends Span { - type: "RestElement"; - decorators?: []; - argument: BindingPattern; - optional?: false; - typeAnnotation?: null; - value?: null; - parent?: Node; -} - -export interface Function extends Span { - type: FunctionType; - id: BindingIdentifier | null; - generator: boolean; - async: boolean; - declare?: boolean; - typeParameters?: TSTypeParameterDeclaration | null; - params: ParamPattern[]; - returnType?: TSTypeAnnotation | null; - body: FunctionBody | null; - expression: false; - parent?: Node; -} - -export type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest; - -export type FunctionType = - | "FunctionDeclaration" - | "FunctionExpression" - | "TSDeclareFunction" - | "TSEmptyBodyFunctionExpression"; - -export interface FormalParameterRest extends Span { - type: "RestElement"; - argument: BindingPattern; - decorators?: []; - optional?: boolean; - typeAnnotation?: TSTypeAnnotation | null; - value?: null; - parent?: Node; -} - -export type FormalParameter = { - decorators?: Array; -} & BindingPattern; - -export interface TSParameterProperty extends Span { - type: "TSParameterProperty"; - accessibility: TSAccessibility | null; - decorators: Array; - override: boolean; - parameter: FormalParameter; - readonly: boolean; - static: boolean; - parent?: Node; -} - -export interface FunctionBody extends Span { - type: "BlockStatement"; - body: Array; - parent?: Node; -} - -export interface ArrowFunctionExpression extends Span { - type: "ArrowFunctionExpression"; - expression: boolean; - async: boolean; - typeParameters?: TSTypeParameterDeclaration | null; - params: ParamPattern[]; - returnType?: TSTypeAnnotation | null; - body: FunctionBody | Expression; - id: null; - generator: false; - parent?: Node; -} - -export interface YieldExpression extends Span { - type: "YieldExpression"; - delegate: boolean; - argument: Expression | null; - parent?: Node; -} - -export interface Class extends Span { - type: ClassType; - decorators: Array; - id: BindingIdentifier | null; - typeParameters?: TSTypeParameterDeclaration | null; - superClass: Expression | null; - superTypeArguments?: TSTypeParameterInstantiation | null; - implements?: Array; - body: ClassBody; - abstract?: boolean; - declare?: boolean; - parent?: Node; -} - -export type ClassType = "ClassDeclaration" | "ClassExpression"; - -export interface ClassBody extends Span { - type: "ClassBody"; - body: Array; - parent?: Node; -} - -export type ClassElement = - | StaticBlock - | MethodDefinition - | PropertyDefinition - | AccessorProperty - | TSIndexSignature; - -export interface MethodDefinition extends Span { - type: MethodDefinitionType; - decorators: Array; - key: PropertyKey; - value: Function; - kind: MethodDefinitionKind; - computed: boolean; - static: boolean; - override?: boolean; - optional?: boolean; - accessibility?: TSAccessibility | null; - parent?: Node; -} - -export type MethodDefinitionType = "MethodDefinition" | "TSAbstractMethodDefinition"; - -export interface PropertyDefinition extends Span { - type: PropertyDefinitionType; - decorators: Array; - key: PropertyKey; - typeAnnotation?: TSTypeAnnotation | null; - value: Expression | null; - computed: boolean; - static: boolean; - declare?: boolean; - override?: boolean; - optional?: boolean; - definite?: boolean; - readonly?: boolean; - accessibility?: TSAccessibility | null; - parent?: Node; -} - -export type PropertyDefinitionType = "PropertyDefinition" | "TSAbstractPropertyDefinition"; - -export type MethodDefinitionKind = "constructor" | "method" | "get" | "set"; - -export interface PrivateIdentifier extends Span { - type: "PrivateIdentifier"; - name: string; - parent?: Node; -} - -export interface StaticBlock extends Span { - type: "StaticBlock"; - body: Array; - parent?: Node; -} - -export type ModuleDeclaration = - | ImportDeclaration - | ExportAllDeclaration - | ExportDefaultDeclaration - | ExportNamedDeclaration - | TSExportAssignment - | TSNamespaceExportDeclaration; - -export type AccessorPropertyType = "AccessorProperty" | "TSAbstractAccessorProperty"; - -export interface AccessorProperty extends Span { - type: AccessorPropertyType; - decorators: Array; - key: PropertyKey; - typeAnnotation?: TSTypeAnnotation | null; - value: Expression | null; - computed: boolean; - static: boolean; - override?: boolean; - definite?: boolean; - accessibility?: TSAccessibility | null; - declare?: false; - optional?: false; - readonly?: false; - parent?: Node; -} - -export interface ImportExpression extends Span { - type: "ImportExpression"; - source: Expression; - options: Expression | null; - phase: ImportPhase | null; - parent?: Node; -} - -export interface ImportDeclaration extends Span { - type: "ImportDeclaration"; - specifiers: Array; - source: StringLiteral; - phase: ImportPhase | null; - attributes: Array; - importKind?: ImportOrExportKind; - parent?: Node; -} - -export type ImportPhase = "source" | "defer"; - -export type ImportDeclarationSpecifier = - | ImportSpecifier - | ImportDefaultSpecifier - | ImportNamespaceSpecifier; - -export interface ImportSpecifier extends Span { - type: "ImportSpecifier"; - imported: ModuleExportName; - local: BindingIdentifier; - importKind?: ImportOrExportKind; - parent?: Node; -} - -export interface ImportDefaultSpecifier extends Span { - type: "ImportDefaultSpecifier"; - local: BindingIdentifier; - parent?: Node; -} - -export interface ImportNamespaceSpecifier extends Span { - type: "ImportNamespaceSpecifier"; - local: BindingIdentifier; - parent?: Node; -} - -export interface ImportAttribute extends Span { - type: "ImportAttribute"; - key: ImportAttributeKey; - value: StringLiteral; - parent?: Node; -} - -export type ImportAttributeKey = IdentifierName | StringLiteral; - -export interface ExportNamedDeclaration extends Span { - type: "ExportNamedDeclaration"; - declaration: Declaration | null; - specifiers: Array; - source: StringLiteral | null; - exportKind?: ImportOrExportKind; - attributes: Array; - parent?: Node; -} - -export interface ExportDefaultDeclaration extends Span { - type: "ExportDefaultDeclaration"; - declaration: ExportDefaultDeclarationKind; - exportKind?: "value"; - parent?: Node; -} - -export interface ExportAllDeclaration extends Span { - type: "ExportAllDeclaration"; - exported: ModuleExportName | null; - source: StringLiteral; - attributes: Array; - exportKind?: ImportOrExportKind; - parent?: Node; -} - -export interface ExportSpecifier extends Span { - type: "ExportSpecifier"; - local: ModuleExportName; - exported: ModuleExportName; - exportKind?: ImportOrExportKind; - parent?: Node; -} - -export type ExportDefaultDeclarationKind = Function | Class | TSInterfaceDeclaration | Expression; - -export type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral; - -export interface V8IntrinsicExpression extends Span { - type: "V8IntrinsicExpression"; - name: IdentifierName; - arguments: Array; - parent?: Node; -} - -export interface BooleanLiteral extends Span { - type: "Literal"; - value: boolean; - raw: string | null; - parent?: Node; -} - -export interface NullLiteral extends Span { - type: "Literal"; - value: null; - raw: "null" | null; - parent?: Node; -} - -export interface NumericLiteral extends Span { - type: "Literal"; - value: number; - raw: string | null; - parent?: Node; -} - -export interface StringLiteral extends Span { - type: "Literal"; - value: string; - raw: string | null; - parent?: Node; -} - -export interface BigIntLiteral extends Span { - type: "Literal"; - value: bigint; - raw: string | null; - bigint: string; - parent?: Node; -} - -export interface RegExpLiteral extends Span { - type: "Literal"; - value: RegExp | null; - raw: string | null; - regex: { pattern: string; flags: string }; - parent?: Node; -} - -export interface JSXElement extends Span { - type: "JSXElement"; - openingElement: JSXOpeningElement; - children: Array; - closingElement: JSXClosingElement | null; - parent?: Node; -} - -export interface JSXOpeningElement extends Span { - type: "JSXOpeningElement"; - name: JSXElementName; - typeArguments?: TSTypeParameterInstantiation | null; - attributes: Array; - selfClosing: boolean; - parent?: Node; -} - -export interface JSXClosingElement extends Span { - type: "JSXClosingElement"; - name: JSXElementName; - parent?: Node; -} - -export interface JSXFragment extends Span { - type: "JSXFragment"; - openingFragment: JSXOpeningFragment; - children: Array; - closingFragment: JSXClosingFragment; - parent?: Node; -} - -export interface JSXOpeningFragment extends Span { - type: "JSXOpeningFragment"; - attributes?: []; - selfClosing?: false; - parent?: Node; -} - -export interface JSXClosingFragment extends Span { - type: "JSXClosingFragment"; - parent?: Node; -} - -export type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression; - -export interface JSXNamespacedName extends Span { - type: "JSXNamespacedName"; - namespace: JSXIdentifier; - name: JSXIdentifier; - parent?: Node; -} - -export interface JSXMemberExpression extends Span { - type: "JSXMemberExpression"; - object: JSXMemberExpressionObject; - property: JSXIdentifier; - parent?: Node; -} - -export type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression; - -export interface JSXExpressionContainer extends Span { - type: "JSXExpressionContainer"; - expression: JSXExpression; - parent?: Node; -} - -export type JSXExpression = JSXEmptyExpression | Expression; - -export interface JSXEmptyExpression extends Span { - type: "JSXEmptyExpression"; - parent?: Node; -} - -export type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute; - -export interface JSXAttribute extends Span { - type: "JSXAttribute"; - name: JSXAttributeName; - value: JSXAttributeValue | null; - parent?: Node; -} - -export interface JSXSpreadAttribute extends Span { - type: "JSXSpreadAttribute"; - argument: Expression; - parent?: Node; -} - -export type JSXAttributeName = JSXIdentifier | JSXNamespacedName; - -export type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment; - -export interface JSXIdentifier extends Span { - type: "JSXIdentifier"; - name: string; - parent?: Node; -} - -export type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild; - -export interface JSXSpreadChild extends Span { - type: "JSXSpreadChild"; - expression: Expression; - parent?: Node; -} - -export interface JSXText extends Span { - type: "JSXText"; - value: string; - raw: string | null; - parent?: Node; -} - -export interface TSThisParameter extends Span { - type: "Identifier"; - decorators: []; - name: "this"; - optional: false; - typeAnnotation: TSTypeAnnotation | null; - parent?: Node; -} - -export interface TSEnumDeclaration extends Span { - type: "TSEnumDeclaration"; - id: BindingIdentifier; - body: TSEnumBody; - const: boolean; - declare: boolean; - parent?: Node; -} - -export interface TSEnumBody extends Span { - type: "TSEnumBody"; - members: Array; - parent?: Node; -} - -export interface TSEnumMember extends Span { - type: "TSEnumMember"; - id: TSEnumMemberName; - initializer: Expression | null; - computed: boolean; - parent?: Node; -} - -export type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral; - -export interface TSTypeAnnotation extends Span { - type: "TSTypeAnnotation"; - typeAnnotation: TSType; - parent?: Node; -} - -export interface TSLiteralType extends Span { - type: "TSLiteralType"; - literal: TSLiteral; - parent?: Node; -} - -export type TSLiteral = - | BooleanLiteral - | NumericLiteral - | BigIntLiteral - | StringLiteral - | TemplateLiteral - | UnaryExpression; - -export type TSType = - | TSAnyKeyword - | TSBigIntKeyword - | TSBooleanKeyword - | TSIntrinsicKeyword - | TSNeverKeyword - | TSNullKeyword - | TSNumberKeyword - | TSObjectKeyword - | TSStringKeyword - | TSSymbolKeyword - | TSUndefinedKeyword - | TSUnknownKeyword - | TSVoidKeyword - | TSArrayType - | TSConditionalType - | TSConstructorType - | TSFunctionType - | TSImportType - | TSIndexedAccessType - | TSInferType - | TSIntersectionType - | TSLiteralType - | TSMappedType - | TSNamedTupleMember - | TSTemplateLiteralType - | TSThisType - | TSTupleType - | TSTypeLiteral - | TSTypeOperator - | TSTypePredicate - | TSTypeQuery - | TSTypeReference - | TSUnionType - | TSParenthesizedType - | JSDocNullableType - | JSDocNonNullableType - | JSDocUnknownType; - -export interface TSConditionalType extends Span { - type: "TSConditionalType"; - checkType: TSType; - extendsType: TSType; - trueType: TSType; - falseType: TSType; - parent?: Node; -} - -export interface TSUnionType extends Span { - type: "TSUnionType"; - types: Array; - parent?: Node; -} - -export interface TSIntersectionType extends Span { - type: "TSIntersectionType"; - types: Array; - parent?: Node; -} - -export interface TSParenthesizedType extends Span { - type: "TSParenthesizedType"; - typeAnnotation: TSType; - parent?: Node; -} - -export interface TSTypeOperator extends Span { - type: "TSTypeOperator"; - operator: TSTypeOperatorOperator; - typeAnnotation: TSType; - parent?: Node; -} - -export type TSTypeOperatorOperator = "keyof" | "unique" | "readonly"; - -export interface TSArrayType extends Span { - type: "TSArrayType"; - elementType: TSType; - parent?: Node; -} - -export interface TSIndexedAccessType extends Span { - type: "TSIndexedAccessType"; - objectType: TSType; - indexType: TSType; - parent?: Node; -} - -export interface TSTupleType extends Span { - type: "TSTupleType"; - elementTypes: Array; - parent?: Node; -} - -export interface TSNamedTupleMember extends Span { - type: "TSNamedTupleMember"; - label: IdentifierName; - elementType: TSTupleElement; - optional: boolean; - parent?: Node; -} - -export interface TSOptionalType extends Span { - type: "TSOptionalType"; - typeAnnotation: TSType; - parent?: Node; -} - -export interface TSRestType extends Span { - type: "TSRestType"; - typeAnnotation: TSType; - parent?: Node; -} - -export type TSTupleElement = TSOptionalType | TSRestType | TSType; - -export interface TSAnyKeyword extends Span { - type: "TSAnyKeyword"; - parent?: Node; -} - -export interface TSStringKeyword extends Span { - type: "TSStringKeyword"; - parent?: Node; -} - -export interface TSBooleanKeyword extends Span { - type: "TSBooleanKeyword"; - parent?: Node; -} - -export interface TSNumberKeyword extends Span { - type: "TSNumberKeyword"; - parent?: Node; -} - -export interface TSNeverKeyword extends Span { - type: "TSNeverKeyword"; - parent?: Node; -} - -export interface TSIntrinsicKeyword extends Span { - type: "TSIntrinsicKeyword"; - parent?: Node; -} - -export interface TSUnknownKeyword extends Span { - type: "TSUnknownKeyword"; - parent?: Node; -} - -export interface TSNullKeyword extends Span { - type: "TSNullKeyword"; - parent?: Node; -} - -export interface TSUndefinedKeyword extends Span { - type: "TSUndefinedKeyword"; - parent?: Node; -} - -export interface TSVoidKeyword extends Span { - type: "TSVoidKeyword"; - parent?: Node; -} - -export interface TSSymbolKeyword extends Span { - type: "TSSymbolKeyword"; - parent?: Node; -} - -export interface TSThisType extends Span { - type: "TSThisType"; - parent?: Node; -} - -export interface TSObjectKeyword extends Span { - type: "TSObjectKeyword"; - parent?: Node; -} - -export interface TSBigIntKeyword extends Span { - type: "TSBigIntKeyword"; - parent?: Node; -} - -export interface TSTypeReference extends Span { - type: "TSTypeReference"; - typeName: TSTypeName; - typeArguments: TSTypeParameterInstantiation | null; - parent?: Node; -} - -export type TSTypeName = IdentifierReference | TSQualifiedName | ThisExpression; - -export interface TSQualifiedName extends Span { - type: "TSQualifiedName"; - left: TSTypeName; - right: IdentifierName; - parent?: Node; -} - -export interface TSTypeParameterInstantiation extends Span { - type: "TSTypeParameterInstantiation"; - params: Array; - parent?: Node; -} - -export interface TSTypeParameter extends Span { - type: "TSTypeParameter"; - name: BindingIdentifier; - constraint: TSType | null; - default: TSType | null; - in: boolean; - out: boolean; - const: boolean; - parent?: Node; -} - -export interface TSTypeParameterDeclaration extends Span { - type: "TSTypeParameterDeclaration"; - params: Array; - parent?: Node; -} - -export interface TSTypeAliasDeclaration extends Span { - type: "TSTypeAliasDeclaration"; - id: BindingIdentifier; - typeParameters: TSTypeParameterDeclaration | null; - typeAnnotation: TSType; - declare: boolean; - parent?: Node; -} - -export type TSAccessibility = "private" | "protected" | "public"; - -export interface TSClassImplements extends Span { - type: "TSClassImplements"; - expression: IdentifierReference | ThisExpression | MemberExpression; - typeArguments: TSTypeParameterInstantiation | null; - parent?: Node; -} - -export interface TSInterfaceDeclaration extends Span { - type: "TSInterfaceDeclaration"; - id: BindingIdentifier; - typeParameters: TSTypeParameterDeclaration | null; - extends: Array; - body: TSInterfaceBody; - declare: boolean; - parent?: Node; -} - -export interface TSInterfaceBody extends Span { - type: "TSInterfaceBody"; - body: Array; - parent?: Node; -} - -export interface TSPropertySignature extends Span { - type: "TSPropertySignature"; - computed: boolean; - optional: boolean; - readonly: boolean; - key: PropertyKey; - typeAnnotation: TSTypeAnnotation | null; - accessibility: null; - static: false; - parent?: Node; -} - -export type TSSignature = - | TSIndexSignature - | TSPropertySignature - | TSCallSignatureDeclaration - | TSConstructSignatureDeclaration - | TSMethodSignature; - -export interface TSIndexSignature extends Span { - type: "TSIndexSignature"; - parameters: Array; - typeAnnotation: TSTypeAnnotation; - readonly: boolean; - static: boolean; - accessibility: null; - parent?: Node; -} - -export interface TSCallSignatureDeclaration extends Span { - type: "TSCallSignatureDeclaration"; - typeParameters: TSTypeParameterDeclaration | null; - params: ParamPattern[]; - returnType: TSTypeAnnotation | null; - parent?: Node; -} - -export type TSMethodSignatureKind = "method" | "get" | "set"; - -export interface TSMethodSignature extends Span { - type: "TSMethodSignature"; - key: PropertyKey; - computed: boolean; - optional: boolean; - kind: TSMethodSignatureKind; - typeParameters: TSTypeParameterDeclaration | null; - params: ParamPattern[]; - returnType: TSTypeAnnotation | null; - accessibility: null; - readonly: false; - static: false; - parent?: Node; -} - -export interface TSConstructSignatureDeclaration extends Span { - type: "TSConstructSignatureDeclaration"; - typeParameters: TSTypeParameterDeclaration | null; - params: ParamPattern[]; - returnType: TSTypeAnnotation | null; - parent?: Node; -} - -export interface TSIndexSignatureName extends Span { - type: "Identifier"; - decorators: []; - name: string; - optional: false; - typeAnnotation: TSTypeAnnotation; - parent?: Node; -} - -export interface TSInterfaceHeritage extends Span { - type: "TSInterfaceHeritage"; - expression: Expression; - typeArguments: TSTypeParameterInstantiation | null; - parent?: Node; -} - -export interface TSTypePredicate extends Span { - type: "TSTypePredicate"; - parameterName: TSTypePredicateName; - asserts: boolean; - typeAnnotation: TSTypeAnnotation | null; - parent?: Node; -} - -export type TSTypePredicateName = IdentifierName | TSThisType; - -export interface TSModuleDeclaration extends Span { - type: "TSModuleDeclaration"; - id: BindingIdentifier | StringLiteral | TSQualifiedName; - body: TSModuleBlock | null; - kind: TSModuleDeclarationKind; - declare: boolean; - global: false; - parent?: Node; -} - -export type TSModuleDeclarationKind = "module" | "namespace"; - -export interface TSGlobalDeclaration extends Span { - type: "TSModuleDeclaration"; - id: IdentifierName; - body: TSModuleBlock; - kind: "global"; - declare: boolean; - global: true; - parent?: Node; -} - -export interface TSModuleBlock extends Span { - type: "TSModuleBlock"; - body: Array; - parent?: Node; -} - -export interface TSTypeLiteral extends Span { - type: "TSTypeLiteral"; - members: Array; - parent?: Node; -} - -export interface TSInferType extends Span { - type: "TSInferType"; - typeParameter: TSTypeParameter; - parent?: Node; -} - -export interface TSTypeQuery extends Span { - type: "TSTypeQuery"; - exprName: TSTypeQueryExprName; - typeArguments: TSTypeParameterInstantiation | null; - parent?: Node; -} - -export type TSTypeQueryExprName = TSImportType | TSTypeName; - -export interface TSImportType extends Span { - type: "TSImportType"; - source: StringLiteral; - options: ObjectExpression | null; - qualifier: TSImportTypeQualifier | null; - typeArguments: TSTypeParameterInstantiation | null; - parent?: Node; -} - -export type TSImportTypeQualifier = IdentifierName | TSImportTypeQualifiedName; - -export interface TSImportTypeQualifiedName extends Span { - type: "TSQualifiedName"; - left: TSImportTypeQualifier; - right: IdentifierName; - parent?: Node; -} - -export interface TSFunctionType extends Span { - type: "TSFunctionType"; - typeParameters: TSTypeParameterDeclaration | null; - params: ParamPattern[]; - returnType: TSTypeAnnotation; - parent?: Node; -} - -export interface TSConstructorType extends Span { - type: "TSConstructorType"; - abstract: boolean; - typeParameters: TSTypeParameterDeclaration | null; - params: ParamPattern[]; - returnType: TSTypeAnnotation; - parent?: Node; -} - -export interface TSMappedType extends Span { - type: "TSMappedType"; - key: BindingIdentifier; - constraint: TSType; - nameType: TSType | null; - typeAnnotation: TSType | null; - optional: TSMappedTypeModifierOperator | false; - readonly: TSMappedTypeModifierOperator | null; - parent?: Node; -} - -export type TSMappedTypeModifierOperator = true | "+" | "-"; - -export interface TSTemplateLiteralType extends Span { - type: "TSTemplateLiteralType"; - quasis: Array; - types: Array; - parent?: Node; -} - -export interface TSAsExpression extends Span { - type: "TSAsExpression"; - expression: Expression; - typeAnnotation: TSType; - parent?: Node; -} - -export interface TSSatisfiesExpression extends Span { - type: "TSSatisfiesExpression"; - expression: Expression; - typeAnnotation: TSType; - parent?: Node; -} - -export interface TSTypeAssertion extends Span { - type: "TSTypeAssertion"; - typeAnnotation: TSType; - expression: Expression; - parent?: Node; -} - -export interface TSImportEqualsDeclaration extends Span { - type: "TSImportEqualsDeclaration"; - id: BindingIdentifier; - moduleReference: TSModuleReference; - importKind: ImportOrExportKind; - parent?: Node; -} - -export type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName; - -export interface TSExternalModuleReference extends Span { - type: "TSExternalModuleReference"; - expression: StringLiteral; - parent?: Node; -} - -export interface TSNonNullExpression extends Span { - type: "TSNonNullExpression"; - expression: Expression; - parent?: Node; -} - -export interface Decorator extends Span { - type: "Decorator"; - expression: Expression; - parent?: Node; -} - -export interface TSExportAssignment extends Span { - type: "TSExportAssignment"; - expression: Expression; - parent?: Node; -} - -export interface TSNamespaceExportDeclaration extends Span { - type: "TSNamespaceExportDeclaration"; - id: IdentifierName; - parent?: Node; -} - -export interface TSInstantiationExpression extends Span { - type: "TSInstantiationExpression"; - expression: Expression; - typeArguments: TSTypeParameterInstantiation; - parent?: Node; -} - -export type ImportOrExportKind = "value" | "type"; - -export interface JSDocNullableType extends Span { - type: "TSJSDocNullableType"; - typeAnnotation: TSType; - postfix: boolean; - parent?: Node; -} - -export interface JSDocNonNullableType extends Span { - type: "TSJSDocNonNullableType"; - typeAnnotation: TSType; - postfix: boolean; - parent?: Node; -} - -export interface JSDocUnknownType extends Span { - type: "TSJSDocUnknownType"; - parent?: Node; -} - -export type ModuleKind = "script" | "module" | "commonjs"; - -export interface Span { - start: number; - end: number; - range?: [number, number]; -} - -export type AssignmentOperator = - | "=" - | "+=" - | "-=" - | "*=" - | "/=" - | "%=" - | "**=" - | "<<=" - | ">>=" - | ">>>=" - | "|=" - | "^=" - | "&=" - | "||=" - | "&&=" - | "??="; - -export type BinaryOperator = - | "==" - | "!=" - | "===" - | "!==" - | "<" - | "<=" - | ">" - | ">=" - | "+" - | "-" - | "*" - | "/" - | "%" - | "**" - | "<<" - | ">>" - | ">>>" - | "|" - | "^" - | "&" - | "in" - | "instanceof"; - -export type LogicalOperator = "||" | "&&" | "??"; - -export type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete"; - -export type UpdateOperator = "++" | "--"; - -export type Node = - | Program - | IdentifierName - | IdentifierReference - | BindingIdentifier - | LabelIdentifier - | ThisExpression - | ArrayExpression - | ObjectExpression - | ObjectProperty - | TemplateLiteral - | TaggedTemplateExpression - | TemplateElement - | ComputedMemberExpression - | StaticMemberExpression - | PrivateFieldExpression - | CallExpression - | NewExpression - | MetaProperty - | SpreadElement - | UpdateExpression - | UnaryExpression - | BinaryExpression - | PrivateInExpression - | LogicalExpression - | ConditionalExpression - | AssignmentExpression - | ArrayAssignmentTarget - | ObjectAssignmentTarget - | AssignmentTargetRest - | AssignmentTargetWithDefault - | AssignmentTargetPropertyIdentifier - | AssignmentTargetPropertyProperty - | SequenceExpression - | Super - | AwaitExpression - | ChainExpression - | ParenthesizedExpression - | Directive - | Hashbang - | BlockStatement - | VariableDeclaration - | VariableDeclarator - | EmptyStatement - | ExpressionStatement - | IfStatement - | DoWhileStatement - | WhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | ContinueStatement - | BreakStatement - | ReturnStatement - | WithStatement - | SwitchStatement - | SwitchCase - | LabeledStatement - | ThrowStatement - | TryStatement - | CatchClause - | DebuggerStatement - | AssignmentPattern - | ObjectPattern - | BindingProperty - | ArrayPattern - | BindingRestElement - | Function - | FunctionBody - | ArrowFunctionExpression - | YieldExpression - | Class - | ClassBody - | MethodDefinition - | PropertyDefinition - | PrivateIdentifier - | StaticBlock - | AccessorProperty - | ImportExpression - | ImportDeclaration - | ImportSpecifier - | ImportDefaultSpecifier - | ImportNamespaceSpecifier - | ImportAttribute - | ExportNamedDeclaration - | ExportDefaultDeclaration - | ExportAllDeclaration - | ExportSpecifier - | V8IntrinsicExpression - | BooleanLiteral - | NullLiteral - | NumericLiteral - | StringLiteral - | BigIntLiteral - | RegExpLiteral - | JSXElement - | JSXOpeningElement - | JSXClosingElement - | JSXFragment - | JSXOpeningFragment - | JSXClosingFragment - | JSXNamespacedName - | JSXMemberExpression - | JSXExpressionContainer - | JSXEmptyExpression - | JSXAttribute - | JSXSpreadAttribute - | JSXIdentifier - | JSXSpreadChild - | JSXText - | TSThisParameter - | TSEnumDeclaration - | TSEnumBody - | TSEnumMember - | TSTypeAnnotation - | TSLiteralType - | TSConditionalType - | TSUnionType - | TSIntersectionType - | TSParenthesizedType - | TSTypeOperator - | TSArrayType - | TSIndexedAccessType - | TSTupleType - | TSNamedTupleMember - | TSOptionalType - | TSRestType - | TSAnyKeyword - | TSStringKeyword - | TSBooleanKeyword - | TSNumberKeyword - | TSNeverKeyword - | TSIntrinsicKeyword - | TSUnknownKeyword - | TSNullKeyword - | TSUndefinedKeyword - | TSVoidKeyword - | TSSymbolKeyword - | TSThisType - | TSObjectKeyword - | TSBigIntKeyword - | TSTypeReference - | TSQualifiedName - | TSTypeParameterInstantiation - | TSTypeParameter - | TSTypeParameterDeclaration - | TSTypeAliasDeclaration - | TSClassImplements - | TSInterfaceDeclaration - | TSInterfaceBody - | TSPropertySignature - | TSIndexSignature - | TSCallSignatureDeclaration - | TSMethodSignature - | TSConstructSignatureDeclaration - | TSIndexSignatureName - | TSInterfaceHeritage - | TSTypePredicate - | TSModuleDeclaration - | TSGlobalDeclaration - | TSModuleBlock - | TSTypeLiteral - | TSInferType - | TSTypeQuery - | TSImportType - | TSImportTypeQualifiedName - | TSFunctionType - | TSConstructorType - | TSMappedType - | TSTemplateLiteralType - | TSAsExpression - | TSSatisfiesExpression - | TSTypeAssertion - | TSImportEqualsDeclaration - | TSExternalModuleReference - | TSNonNullExpression - | Decorator - | TSExportAssignment - | TSNamespaceExportDeclaration - | TSInstantiationExpression - | JSDocNullableType - | JSDocNonNullableType - | JSDocUnknownType - | ParamPattern; diff --git a/frontend/node_modules/@polka/url/build.js b/frontend/node_modules/@polka/url/build.js deleted file mode 100644 index a945343..0000000 --- a/frontend/node_modules/@polka/url/build.js +++ /dev/null @@ -1,49 +0,0 @@ -const qs = require('querystring'); - -/** - * @typedef ParsedURL - * @type {import('.').ParsedURL} - */ - -/** - * @typedef Request - * @property {string} url - * @property {ParsedURL} _parsedUrl - */ - -/** - * @param {Request} req - * @returns {ParsedURL|void} - */ -function parse(req) { - let raw = req.url; - if (raw == null) return; - - let prev = req._parsedUrl; - if (prev && prev.raw === raw) return prev; - - let pathname=raw, search='', query, hash; - - if (raw.length > 1) { - let idx = raw.indexOf('#', 1); - - if (idx !== -1) { - hash = raw.substring(idx); - pathname = raw.substring(0, idx); - } - - idx = pathname.indexOf('?', 1); - - if (idx !== -1) { - search = pathname.substring(idx); - pathname = pathname.substring(0, idx); - if (search.length > 1) { - query = qs.parse(search.substring(1)); - } - } - } - - return req._parsedUrl = { pathname, search, query, hash, raw }; -} - -exports.parse = parse; \ No newline at end of file diff --git a/frontend/node_modules/@polka/url/build.mjs b/frontend/node_modules/@polka/url/build.mjs deleted file mode 100644 index 48ccfaa..0000000 --- a/frontend/node_modules/@polka/url/build.mjs +++ /dev/null @@ -1,47 +0,0 @@ -import * as qs from 'node:querystring'; - -/** - * @typedef ParsedURL - * @type {import('.').ParsedURL} - */ - -/** - * @typedef Request - * @property {string} url - * @property {ParsedURL} _parsedUrl - */ - -/** - * @param {Request} req - * @returns {ParsedURL|void} - */ -export function parse(req) { - let raw = req.url; - if (raw == null) return; - - let prev = req._parsedUrl; - if (prev && prev.raw === raw) return prev; - - let pathname=raw, search='', query, hash; - - if (raw.length > 1) { - let idx = raw.indexOf('#', 1); - - if (idx !== -1) { - hash = raw.substring(idx); - pathname = raw.substring(0, idx); - } - - idx = pathname.indexOf('?', 1); - - if (idx !== -1) { - search = pathname.substring(idx); - pathname = pathname.substring(0, idx); - if (search.length > 1) { - query = qs.parse(search.substring(1)); - } - } - } - - return req._parsedUrl = { pathname, search, query, hash, raw }; -} diff --git a/frontend/node_modules/@polka/url/index.d.ts b/frontend/node_modules/@polka/url/index.d.ts deleted file mode 100644 index 46ecac2..0000000 --- a/frontend/node_modules/@polka/url/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { IncomingMessage } from 'http'; - -export interface ParsedURL { - pathname: string; - search: string; - query: Record | undefined; - hash: string | undefined; - raw: string; -} - -export function parse(req: IncomingMessage): ParsedURL; diff --git a/frontend/node_modules/@polka/url/package.json b/frontend/node_modules/@polka/url/package.json deleted file mode 100644 index d594ee7..0000000 --- a/frontend/node_modules/@polka/url/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "1.0.0-next.29", - "name": "@polka/url", - "repository": "lukeed/polka", - "description": "Super fast, memoized `req.url` parser", - "module": "build.mjs", - "types": "index.d.ts", - "main": "build.js", - "license": "MIT", - "exports": { - ".": { - "types": "./index.d.ts", - "import": "./build.mjs", - "require": "./build.js" - }, - "./package.json": "./package.json" - }, - "files": [ - "build.*", - "index.d.*" - ], - "author": { - "name": "Luke Edwards", - "email": "luke@lukeed.com", - "url": "https://lukeed.com" - }, - "publishConfig": { - "access": "public" - } -} \ No newline at end of file diff --git a/frontend/node_modules/@polka/url/readme.md b/frontend/node_modules/@polka/url/readme.md deleted file mode 100644 index e47645c..0000000 --- a/frontend/node_modules/@polka/url/readme.md +++ /dev/null @@ -1,68 +0,0 @@ -# @polka/url [![npm](https://badgen.now.sh/npm/v/@polka/url)](https://npmjs.org/package/@polka/url) [![licenses](https://licenses.dev/b/npm/%40polka%2Furl)](https://licenses.dev/npm/%40polka%2Furl) - -> Super fast, memoized `req.url` parser; _not_ limited to [Polka][polka]! - -Parses the `url` from a [`IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) request. The returned object will always only contain the following keys: `search`, `query`, `pathname`, and `raw`. - -> **Note:** This library does not process `protocol`, `hostname`, `port`, etc.
This is because the incoming `req.url` value only begins with the path information. - -Parsed requests will be mutated with a `_parsedUrl` key, containing the returned output. This is used for future memoization, avoiding the need to fully parse the same `url` value multiple times. - -## Install - -``` -$ npm install --save @polka/url -``` - -## Usage - -```js -const parse = require('@polka/url'); - -let req = { - url: '/foo/bar?fizz=buzz' -}; -let output = parse(req); -//=> { -//=> pathname: '/foo/bar', -//=> raw: '/foo/bar?fizz=buzz', -//=> search: '?fizz=buzz', -//=> query: { -//=> fizz: 'buzz' -//=> }, -//=> } - -// Attaches result for future memoization -assert.deepEqual(output, req._parsedUrl); //=> true -``` - -## API - -### url(req) -Returns: `Object` or `undefined` - -> **Important:** The `req` must have a `url` key, otherwise `undefined` will be returned.
If no input is provided at all, a `TypeError` will be thrown. - -#### req -Type: `IncomingMessage` or `{ url: string }` - -The incoming HTTP request (`req`) or a plain `Object` with a `url` key. - -> **Note:** In Node.js servers, the [`req.url`](https://nodejs.org/api/http.html#http_message_url) begins with a pathname & does not include a `hash`. - - -## Benchmarks - -Check out the [`bench`](/bench) directory for in-depth benchmark results and comparisons. - - -## Support - -Any issues or questions can be sent to the [Polka][polka] repository.
However, please specify that your inquiry is about `@polka/url` specifically. - - -## License - -MIT © [Luke Edwards](https://lukeed.com) - -[polka]: https://github.com/lukeed/polka diff --git a/frontend/node_modules/@rolldown/binding-linux-x64-gnu/README.md b/frontend/node_modules/@rolldown/binding-linux-x64-gnu/README.md deleted file mode 100644 index deea424..0000000 --- a/frontend/node_modules/@rolldown/binding-linux-x64-gnu/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `@rolldown/binding-linux-x64-gnu` - -This is the **x86_64-unknown-linux-gnu** binary for `@rolldown/binding` diff --git a/frontend/node_modules/@rolldown/binding-linux-x64-gnu/package.json b/frontend/node_modules/@rolldown/binding-linux-x64-gnu/package.json deleted file mode 100644 index 2fc03dc..0000000 --- a/frontend/node_modules/@rolldown/binding-linux-x64-gnu/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@rolldown/binding-linux-x64-gnu", - "version": "1.0.0-rc.17", - "cpu": [ - "x64" - ], - "main": "rolldown-binding.linux-x64-gnu.node", - "files": [ - "rolldown-binding.linux-x64-gnu.node" - ], - "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.", - "keywords": [ - "bundler", - "esbuild", - "parcel", - "rolldown", - "rollup", - "webpack" - ], - "homepage": "https://rolldown.rs/", - "license": "MIT", - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/rolldown/rolldown.git", - "directory": "packages/rolldown" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "os": [ - "linux" - ], - "libc": [ - "glibc" - ] -} \ No newline at end of file diff --git a/frontend/node_modules/@rolldown/binding-linux-x64-gnu/rolldown-binding.linux-x64-gnu.node b/frontend/node_modules/@rolldown/binding-linux-x64-gnu/rolldown-binding.linux-x64-gnu.node deleted file mode 100644 index ca23bc1..0000000 Binary files a/frontend/node_modules/@rolldown/binding-linux-x64-gnu/rolldown-binding.linux-x64-gnu.node and /dev/null differ diff --git a/frontend/node_modules/@rolldown/pluginutils/LICENSE b/frontend/node_modules/@rolldown/pluginutils/LICENSE deleted file mode 100644 index afc0cdb..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -MIT License - -Copyright (c) 2024-present VoidZero Inc. & Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -end of terms and conditions - -The licenses of externally maintained libraries from which parts of the Software is derived are listed [here](https://github.com/rolldown/rolldown/blob/main/THIRD-PARTY-LICENSE). diff --git a/frontend/node_modules/@rolldown/pluginutils/README.md b/frontend/node_modules/@rolldown/pluginutils/README.md deleted file mode 100644 index 6d29a90..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# @rolldown/pluginutils - -A utility library for building flexible, composable filter expressions that can be used in plugin hook filters of Rolldown/Vite/Rollup/Unplugin plugins. - -## Installation - -```sh -pnpm add @rolldown/pluginutils -``` - -## Usage - -### Simple Filters - -```ts -import { exactRegex, makeIdFiltersToMatchWithQuery, prefixRegex } from '@rolldown/pluginutils'; - -// Match exactly 'foo.js' -const filter = exactRegex('foo.js'); - -// Match any id starting with 'lib/' -const prefix = prefixRegex('lib/'); - -// Match ids with query params (e.g. 'foo.js?bar') -const idFilters = makeIdFiltersToMatchWithQuery(['**/*.js', /\.ts$/]); - -// Usage in a plugin to define a hook filter -const myPlugin = { - resolveId: { - filter: { - id: [exactRegex('MY_ID_TO_CHECK'), /some-other-regex/], - }, - handler(id) { - // Your code here - }, - }, -}; -``` - -### Composable Filters - -> [!WARNING] -> Composable filters are not yet supported in Vite or unplugin. They can be used in Rolldown plugins only. - -```ts -import { and, id, include, moduleType, query } from '@rolldown/pluginutils'; - -// Build a filter expression -const filterExpr = and(id(/\.ts$/), moduleType('ts'), query('foo', true)); - -// Usage in a plugin to define a hook filter -const myPlugin = { - transform: { - filter: [include(filterExpr)], - handler(code, id, options) { - // Your code here - }, - }, -}; -``` - -## API Reference - -### Simple Filters - -- `exactRegex(str: string, flags?: string): RegExp` — Matches the exact string. -- `prefixRegex(str: string, flags?: string): RegExp` — Matches values with the given prefix. -- `makeIdFiltersToMatchWithQuery(input: string | RegExp | (string | RegExp)[]): string | RegExp | (string | RegExp)[]` — Adapts filters to match ids with query params. - -### Composable Filters - -- `and(...exprs)` / `or(...exprs)` / `not(expr)` — Logical composition of filter expressions. -- `id(pattern, params?)` — Filter by id. A `string` pattern is matched by exact equality (not glob); a `RegExp` is tested against the id. -- `importerId(pattern, params?)` — Filter by importer id. A `string` pattern is matched by exact equality; a `RegExp` is tested against the importer id. Only usable with the `resolveId` hook. -- `moduleType(type)` — Filter by module type (e.g. 'js', 'tsx', or 'json'). -- `code(pattern)` — Filter by code content. -- `query(key, pattern)` — Filter by query parameter. -- `include(expr)` / `exclude(expr)` — Top-level include/exclude wrappers. -- `queries(obj)` — Compose multiple query filters. - -### Utilities - -- `filterVitePlugins(plugins)` — Filters out Vite plugins with `apply: 'serve'`. diff --git a/frontend/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts b/frontend/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts deleted file mode 100644 index 9e622a1..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -type StringOrRegExp = string | RegExp; -type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {}); -export type FilterExpressionKind = FilterExpression['kind']; -export type FilterExpression = And | Or | Not | Id | ImporterId | ModuleType | Code | Query; -export type TopLevelFilterExpression = Include | Exclude; -declare class And { - kind: 'and'; - args: FilterExpression[]; - constructor(...args: FilterExpression[]); -} -declare class Or { - kind: 'or'; - args: FilterExpression[]; - constructor(...args: FilterExpression[]); -} -declare class Not { - kind: 'not'; - expr: FilterExpression; - constructor(expr: FilterExpression); -} -export interface QueryFilterObject { - [key: string]: StringOrRegExp | boolean; -} -interface IdParams { - cleanUrl?: boolean; -} -declare class Id { - kind: 'id'; - pattern: StringOrRegExp; - params: IdParams; - constructor(pattern: StringOrRegExp, params?: IdParams); -} -declare class ImporterId { - kind: 'importerId'; - pattern: StringOrRegExp; - params: IdParams; - constructor(pattern: StringOrRegExp, params?: IdParams); -} -declare class ModuleType { - kind: 'moduleType'; - pattern: PluginModuleType; - constructor(pattern: PluginModuleType); -} -declare class Code { - kind: 'code'; - pattern: StringOrRegExp; - constructor(expr: StringOrRegExp); -} -declare class Query { - kind: 'query'; - key: string; - pattern: StringOrRegExp | boolean; - constructor(key: string, pattern: StringOrRegExp | boolean); -} -declare class Include { - kind: 'include'; - expr: FilterExpression; - constructor(expr: FilterExpression); -} -declare class Exclude { - kind: 'exclude'; - expr: FilterExpression; - constructor(expr: FilterExpression); -} -export declare function and(...args: FilterExpression[]): And; -export declare function or(...args: FilterExpression[]): Or; -export declare function not(expr: FilterExpression): Not; -export declare function id(pattern: StringOrRegExp, params?: IdParams): Id; -export declare function importerId(pattern: StringOrRegExp, params?: IdParams): ImporterId; -export declare function moduleType(pattern: PluginModuleType): ModuleType; -export declare function code(pattern: StringOrRegExp): Code; -export declare function query(key: string, pattern: StringOrRegExp | boolean): Query; -export declare function include(expr: FilterExpression): Include; -export declare function exclude(expr: FilterExpression): Exclude; -/** - * convert a queryObject to FilterExpression like - * ```js - * and(query(k1, v1), query(k2, v2)) - * ``` - * @param queryFilterObject The query filter object needs to be matched. - * @returns a `And` FilterExpression - */ -export declare function queries(queryFilter: QueryFilterObject): And; -export declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string): boolean; -interface InterpreterCtx { - urlSearchParamsCache?: URLSearchParams; -} -export declare function interpreterImpl(expr: TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean; -export declare function exprInterpreter(expr: FilterExpression, code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean; -export {}; diff --git a/frontend/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js b/frontend/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js deleted file mode 100644 index 1863562..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js +++ /dev/null @@ -1,256 +0,0 @@ -import { cleanUrl, extractQueryWithoutFragment } from "../utils.js"; -class And { - kind; - args; - constructor(...args) { - if (args.length === 0) { - throw new Error('`And` expects at least one operand'); - } - this.args = args; - this.kind = 'and'; - } -} -class Or { - kind; - args; - constructor(...args) { - if (args.length === 0) { - throw new Error('`Or` expects at least one operand'); - } - this.args = args; - this.kind = 'or'; - } -} -class Not { - kind; - expr; - constructor(expr) { - this.expr = expr; - this.kind = 'not'; - } -} -class Id { - kind; - pattern; - params; - constructor(pattern, params) { - this.pattern = pattern; - this.kind = 'id'; - this.params = params ?? { - cleanUrl: false, - }; - } -} -class ImporterId { - kind; - pattern; - params; - constructor(pattern, params) { - this.pattern = pattern; - this.kind = 'importerId'; - this.params = params ?? { - cleanUrl: false, - }; - } -} -class ModuleType { - kind; - pattern; - constructor(pattern) { - this.pattern = pattern; - this.kind = 'moduleType'; - } -} -class Code { - kind; - pattern; - constructor(expr) { - this.pattern = expr; - this.kind = 'code'; - } -} -class Query { - kind; - key; - pattern; - constructor(key, pattern) { - this.pattern = pattern; - this.key = key; - this.kind = 'query'; - } -} -class Include { - kind; - expr; - constructor(expr) { - this.expr = expr; - this.kind = 'include'; - } -} -class Exclude { - kind; - expr; - constructor(expr) { - this.expr = expr; - this.kind = 'exclude'; - } -} -export function and(...args) { - return new And(...args); -} -export function or(...args) { - return new Or(...args); -} -export function not(expr) { - return new Not(expr); -} -export function id(pattern, params) { - return new Id(pattern, params); -} -export function importerId(pattern, params) { - return new ImporterId(pattern, params); -} -export function moduleType(pattern) { - return new ModuleType(pattern); -} -export function code(pattern) { - return new Code(pattern); -} -/* - * There are three kinds of conditions are supported: - * 1. `boolean`: if the value is `true`, the key must exist and be truthy. if the value is `false`, the key must not exist or be falsy. - * 2. `string`: the key must exist and be equal to the value. - * 3. `RegExp`: the key must exist and match the value. - */ -export function query(key, pattern) { - return new Query(key, pattern); -} -export function include(expr) { - return new Include(expr); -} -export function exclude(expr) { - return new Exclude(expr); -} -/** - * convert a queryObject to FilterExpression like - * ```js - * and(query(k1, v1), query(k2, v2)) - * ``` - * @param queryFilterObject The query filter object needs to be matched. - * @returns a `And` FilterExpression - */ -export function queries(queryFilter) { - let arr = Object.entries(queryFilter).map(([key, value]) => { - return new Query(key, value); - }); - return and(...arr); -} -export function interpreter(exprs, code, id, moduleType, importerId) { - let arr = []; - if (Array.isArray(exprs)) { - arr = exprs; - } - else { - arr = [exprs]; - } - return interpreterImpl(arr, code, id, moduleType, importerId); -} -export function interpreterImpl(expr, code, id, moduleType, importerId, ctx = {}) { - let hasInclude = false; - for (const e of expr) { - switch (e.kind) { - case 'include': { - hasInclude = true; - if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) { - return true; - } - break; - } - case 'exclude': { - if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) { - return false; - } - break; - } - } - } - return !hasInclude; -} -export function exprInterpreter(expr, code, id, moduleType, importerId, ctx = {}) { - switch (expr.kind) { - case 'and': { - return expr.args.every((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx)); - } - case 'or': { - return expr.args.some((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx)); - } - case 'not': { - return !exprInterpreter(expr.expr, code, id, moduleType, importerId, ctx); - } - case 'id': { - if (id === undefined) { - throw new Error('`id` is required for `id` expression'); - } - let idToMatch = id; - if (expr.params.cleanUrl) { - idToMatch = cleanUrl(idToMatch); - } - return typeof expr.pattern === 'string' - ? idToMatch === expr.pattern - : expr.pattern.test(idToMatch); - } - case 'importerId': { - if (importerId === undefined) { - return false; // Entry files have no importer, so no match - } - let importerIdToMatch = importerId; - if (expr.params.cleanUrl) { - importerIdToMatch = cleanUrl(importerIdToMatch); - } - return typeof expr.pattern === 'string' - ? importerIdToMatch === expr.pattern - : expr.pattern.test(importerIdToMatch); - } - case 'moduleType': { - if (moduleType === undefined) { - throw new Error('`moduleType` is required for `moduleType` expression'); - } - return moduleType === expr.pattern; - } - case 'code': { - if (code === undefined) { - throw new Error('`code` is required for `code` expression'); - } - return typeof expr.pattern === 'string' - ? code.includes(expr.pattern) - : expr.pattern.test(code); - } - case 'query': { - if (id === undefined) { - throw new Error('`id` is required for `Query` expression'); - } - if (!ctx.urlSearchParamsCache) { - let queryString = extractQueryWithoutFragment(id); - ctx.urlSearchParamsCache = new URLSearchParams(queryString); - } - let urlParams = ctx.urlSearchParamsCache; - if (typeof expr.pattern === 'boolean') { - if (expr.pattern) { - return urlParams.has(expr.key); - } - else { - return !urlParams.has(expr.key); - } - } - else if (typeof expr.pattern === 'string') { - return urlParams.get(expr.key) === expr.pattern; - } - else { - return expr.pattern.test(urlParams.get(expr.key) ?? ''); - } - } - default: { - throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`); - } - } -} diff --git a/frontend/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.d.ts b/frontend/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.d.ts deleted file mode 100644 index 256d8fc..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Filters out Vite plugins that have `apply: 'serve'` set. - * - * Since Rolldown operates in build mode, plugins marked with `apply: 'serve'` - * are intended only for Vite's dev server and should be excluded from the build process. - * - * @param plugins - Array of plugins (can include nested arrays) - * @returns Filtered array with serve-only plugins removed - * - * @example - * ```ts - * import { defineConfig } from 'rolldown'; - * import { filterVitePlugins } from '@rolldown/pluginutils'; - * import viteReact from '@vitejs/plugin-react'; - * - * export default defineConfig({ - * plugins: filterVitePlugins([ - * viteReact(), - * { - * name: 'dev-only', - * apply: 'serve', // This will be filtered out - * // ... - * } - * ]) - * }); - * ``` - */ -export declare function filterVitePlugins(plugins: T | T[] | null | undefined | false): T[]; diff --git a/frontend/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js b/frontend/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js deleted file mode 100644 index dea79ca..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Filters out Vite plugins that have `apply: 'serve'` set. - * - * Since Rolldown operates in build mode, plugins marked with `apply: 'serve'` - * are intended only for Vite's dev server and should be excluded from the build process. - * - * @param plugins - Array of plugins (can include nested arrays) - * @returns Filtered array with serve-only plugins removed - * - * @example - * ```ts - * import { defineConfig } from 'rolldown'; - * import { filterVitePlugins } from '@rolldown/pluginutils'; - * import viteReact from '@vitejs/plugin-react'; - * - * export default defineConfig({ - * plugins: filterVitePlugins([ - * viteReact(), - * { - * name: 'dev-only', - * apply: 'serve', // This will be filtered out - * // ... - * } - * ]) - * }); - * ``` - */ -export function filterVitePlugins(plugins) { - if (!plugins) { - return []; - } - const pluginArray = Array.isArray(plugins) ? plugins : [plugins]; - const result = []; - for (const plugin of pluginArray) { - // Skip falsy values - if (!plugin) { - continue; - } - // Handle nested arrays recursively - if (Array.isArray(plugin)) { - result.push(...filterVitePlugins(plugin)); - continue; - } - // Check if plugin has apply property - const pluginWithApply = plugin; - if ('apply' in pluginWithApply) { - const applyValue = pluginWithApply.apply; - // If apply is a function, call it with build mode - if (typeof applyValue === 'function') { - try { - const shouldApply = applyValue({}, // config object - { command: 'build', mode: 'production' }); - if (shouldApply) { - result.push(plugin); - } - } - catch { - // If function throws, include the plugin to be safe - result.push(plugin); - } - } // If apply is 'serve', skip this plugin - else if (applyValue === 'serve') { - continue; - } // If apply is 'build' or anything else, include it - else { - result.push(plugin); - } - } - else { - // No apply property, include the plugin - result.push(plugin); - } - } - return result; -} diff --git a/frontend/node_modules/@rolldown/pluginutils/dist/filter/index.d.ts b/frontend/node_modules/@rolldown/pluginutils/dist/filter/index.d.ts deleted file mode 100644 index a7a1ea2..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/dist/filter/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './composable-filters.ts'; -export * from './filter-vite-plugins.ts'; -export * from './simple-filters.ts'; diff --git a/frontend/node_modules/@rolldown/pluginutils/dist/filter/index.js b/frontend/node_modules/@rolldown/pluginutils/dist/filter/index.js deleted file mode 100644 index 6f5bb4f..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/dist/filter/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./composable-filters.js"; -export * from "./filter-vite-plugins.js"; -export * from "./simple-filters.js"; diff --git a/frontend/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.d.ts b/frontend/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.d.ts deleted file mode 100644 index 1f03361..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Constructs a RegExp that matches the exact string specified. - * - * This is useful for plugin hook filters. - * - * @param str the string to match. - * @param flags flags for the RegExp. - * - * @example - * ```ts - * import { exactRegex } from '@rolldown/pluginutils'; - * const plugin = { - * name: 'plugin', - * resolveId: { - * filter: { id: exactRegex('foo') }, - * handler(id) {} // will only be called for `foo` - * } - * } - * ``` - */ -export declare function exactRegex(str: string, flags?: string): RegExp; -/** - * Constructs a RegExp that matches a value that has the specified prefix. - * - * This is useful for plugin hook filters. - * - * @param str the string to match. - * @param flags flags for the RegExp. - * - * @example - * ```ts - * import { prefixRegex } from '@rolldown/pluginutils'; - * const plugin = { - * name: 'plugin', - * resolveId: { - * filter: { id: prefixRegex('foo') }, - * handler(id) {} // will only be called for IDs starting with `foo` - * } - * } - * ``` - */ -export declare function prefixRegex(str: string, flags?: string): RegExp; -type WidenString = T extends string ? string : T; -/** - * Converts a id filter to match with an id with a query. - * - * @param input the id filters to convert. - * - * @example - * ```ts - * import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils'; - * const plugin = { - * name: 'plugin', - * transform: { - * filter: { id: makeIdFiltersToMatchWithQuery(['**' + '/*.js', /\.ts$/]) }, - * // The handler will be called for IDs like: - * // - foo.js - * // - foo.js?foo - * // - foo.txt?foo.js - * // - foo.ts - * // - foo.ts?foo - * // - foo.txt?foo.ts - * handler(code, id) {} - * } - * } - * ``` - */ -export declare function makeIdFiltersToMatchWithQuery(input: T): WidenString; -export declare function makeIdFiltersToMatchWithQuery(input: readonly T[]): WidenString[]; -export declare function makeIdFiltersToMatchWithQuery(input: string | RegExp | readonly (string | RegExp)[]): string | RegExp | (string | RegExp)[]; -export {}; diff --git a/frontend/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js b/frontend/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js deleted file mode 100644 index 241380c..0000000 --- a/frontend/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Constructs a RegExp that matches the exact string specified. - * - * This is useful for plugin hook filters. - * - * @param str the string to match. - * @param flags flags for the RegExp. - * - * @example - * ```ts - * import { exactRegex } from '@rolldown/pluginutils'; - * const plugin = { - * name: 'plugin', - * resolveId: { - * filter: { id: exactRegex('foo') }, - * handler(id) {} // will only be called for `foo` - * } - * } - * ``` - */ -export function exactRegex(str, flags) { - return new RegExp(`^${escapeRegex(str)}$`, flags); -} -/** - * Constructs a RegExp that matches a value that has the specified prefix. - * - * This is useful for plugin hook filters. - * - * @param str the string to match. - * @param flags flags for the RegExp. - * - * @example - * ```ts - * import { prefixRegex } from '@rolldown/pluginutils'; - * const plugin = { - * name: 'plugin', - * resolveId: { - * filter: { id: prefixRegex('foo') }, - * handler(id) {} // will only be called for IDs starting with `foo` - * } - * } - * ``` - */ -export function prefixRegex(str, flags) { - return new RegExp(`^${escapeRegex(str)}`, flags); -} -const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g; -function escapeRegex(str) { - return str.replace(escapeRegexRE, '\\$&'); -} -export function makeIdFiltersToMatchWithQuery(input) { - if (!Array.isArray(input)) { - return makeIdFilterToMatchWithQuery( - // Array.isArray cannot narrow the type - // https://github.com/microsoft/TypeScript/issues/17002 - input); - } - return input.map((i) => makeIdFilterToMatchWithQuery(i)); -} -function makeIdFilterToMatchWithQuery(input) { - if (typeof input === 'string') { - return `${input}{?*,}`; - } - return makeRegexIdFilterToMatchWithQuery(input); -} -function makeRegexIdFilterToMatchWithQuery(input) { - return new RegExp( - // replace `$` with `(?:\?.*)?$` (ignore `\$`) - input.source.replace(/(? - Standard Schema fire logo -
- Standard Schema -

- A family of specs for interoperable TypeScript -
- standardschema.dev -

-
- - - -The Standard Schema project is a set of interfaces that standardize the provision and consumption of shared functionality in the TypeScript ecosystem. - -Its goal is to allow tools to accept a single input that includes all the types and capabilities they need— no library-specific adapters, no extra dependencies. The result is an ecosystem that's fair for implementers, friendly for consumers, and open for end users. - -## The specifications - -The specifications can be found below in their entirety. Libraries wishing to implement a spec can copy/paste the code block below into their codebase. They're also available at `@standard-schema/spec` on [npm](https://www.npmjs.com/package/@standard-schema/spec) and [JSR](https://jsr.io/@standard-schema/spec). - -```ts -// ######################### -// ### Standard Typed ### -// ######################### - -/** The Standard Typed interface. This is a base type extended by other specs. */ -export interface StandardTypedV1 { - /** The Standard properties. */ - readonly "~standard": StandardTypedV1.Props; -} - -export declare namespace StandardTypedV1 { - /** The Standard Typed properties interface. */ - export interface Props { - /** The version number of the standard. */ - readonly version: 1; - /** The vendor name of the schema library. */ - readonly vendor: string; - /** Inferred types associated with the schema. */ - readonly types?: Types | undefined; - } - - /** The Standard Typed types interface. */ - export interface Types { - /** The input type of the schema. */ - readonly input: Input; - /** The output type of the schema. */ - readonly output: Output; - } - - /** Infers the input type of a Standard Typed. */ - export type InferInput = NonNullable< - Schema["~standard"]["types"] - >["input"]; - - /** Infers the output type of a Standard Typed. */ - export type InferOutput = NonNullable< - Schema["~standard"]["types"] - >["output"]; -} - -// ########################## -// ### Standard Schema ### -// ########################## - -/** The Standard Schema interface. */ -export interface StandardSchemaV1 { - /** The Standard Schema properties. */ - readonly "~standard": StandardSchemaV1.Props; -} - -export declare namespace StandardSchemaV1 { - /** The Standard Schema properties interface. */ - export interface Props - extends StandardTypedV1.Props { - /** Validates unknown input values. */ - readonly validate: ( - value: unknown, - options?: StandardSchemaV1.Options | undefined - ) => Result | Promise>; - } - - /** The result interface of the validate function. */ - export type Result = SuccessResult | FailureResult; - - /** The result interface if validation succeeds. */ - export interface SuccessResult { - /** The typed output value. */ - readonly value: Output; - /** A falsy value for `issues` indicates success. */ - readonly issues?: undefined; - } - - export interface Options { - /** Explicit support for additional vendor-specific parameters, if needed. */ - readonly libraryOptions?: Record | undefined; - } - - /** The result interface if validation fails. */ - export interface FailureResult { - /** The issues of failed validation. */ - readonly issues: ReadonlyArray; - } - - /** The issue interface of the failure output. */ - export interface Issue { - /** The error message of the issue. */ - readonly message: string; - /** The path of the issue, if any. */ - readonly path?: ReadonlyArray | undefined; - } - - /** The path segment interface of the issue. */ - export interface PathSegment { - /** The key representing a path segment. */ - readonly key: PropertyKey; - } - - /** The Standard types interface. */ - export interface Types - extends StandardTypedV1.Types {} - - /** Infers the input type of a Standard. */ - export type InferInput = - StandardTypedV1.InferInput; - - /** Infers the output type of a Standard. */ - export type InferOutput = - StandardTypedV1.InferOutput; -} - -// ############################### -// ### Standard JSON Schema ### -// ############################### - -/** The Standard JSON Schema interface. */ -export interface StandardJSONSchemaV1 { - /** The Standard JSON Schema properties. */ - readonly "~standard": StandardJSONSchemaV1.Props; -} - -export declare namespace StandardJSONSchemaV1 { - /** The Standard JSON Schema properties interface. */ - export interface Props - extends StandardTypedV1.Props { - /** Methods for generating the input/output JSON Schema. */ - readonly jsonSchema: StandardJSONSchemaV1.Converter; - } - - /** The Standard JSON Schema converter interface. */ - export interface Converter { - /** Converts the input type to JSON Schema. May throw if conversion is not supported. */ - readonly input: ( - options: StandardJSONSchemaV1.Options - ) => Record; - /** Converts the output type to JSON Schema. May throw if conversion is not supported. */ - readonly output: ( - options: StandardJSONSchemaV1.Options - ) => Record; - } - - /** - * The target version of the generated JSON Schema. - * - * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target. - * - * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`. - */ - export type Target = - | "draft-2020-12" - | "draft-07" - | "openapi-3.0" - // Accepts any string for future targets while preserving autocomplete - | ({} & string); - - /** The options for the input/output methods. */ - export interface Options { - /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */ - readonly target: Target; - - /** Explicit support for additional vendor-specific parameters, if needed. */ - readonly libraryOptions?: Record | undefined; - } - - /** The Standard types interface. */ - export interface Types - extends StandardTypedV1.Types {} - - /** Infers the input type of a Standard. */ - export type InferInput = - StandardTypedV1.InferInput; - - /** Infers the output type of a Standard. */ - export type InferOutput = - StandardTypedV1.InferOutput; -} -``` diff --git a/frontend/node_modules/@standard-schema/spec/dist/index.cjs b/frontend/node_modules/@standard-schema/spec/dist/index.cjs deleted file mode 100644 index 321666e..0000000 --- a/frontend/node_modules/@standard-schema/spec/dist/index.cjs +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var src_exports = {}; -module.exports = __toCommonJS(src_exports); diff --git a/frontend/node_modules/@standard-schema/spec/dist/index.d.cts b/frontend/node_modules/@standard-schema/spec/dist/index.d.cts deleted file mode 100644 index 5e4acaa..0000000 --- a/frontend/node_modules/@standard-schema/spec/dist/index.d.cts +++ /dev/null @@ -1,119 +0,0 @@ -/** The Standard Typed interface. This is a base type extended by other specs. */ -interface StandardTypedV1 { - /** The Standard properties. */ - readonly "~standard": StandardTypedV1.Props; -} -declare namespace StandardTypedV1 { - /** The Standard Typed properties interface. */ - interface Props { - /** The version number of the standard. */ - readonly version: 1; - /** The vendor name of the schema library. */ - readonly vendor: string; - /** Inferred types associated with the schema. */ - readonly types?: Types | undefined; - } - /** The Standard Typed types interface. */ - interface Types { - /** The input type of the schema. */ - readonly input: Input; - /** The output type of the schema. */ - readonly output: Output; - } - /** Infers the input type of a Standard Typed. */ - type InferInput = NonNullable["input"]; - /** Infers the output type of a Standard Typed. */ - type InferOutput = NonNullable["output"]; -} -/** The Standard Schema interface. */ -interface StandardSchemaV1 { - /** The Standard Schema properties. */ - readonly "~standard": StandardSchemaV1.Props; -} -declare namespace StandardSchemaV1 { - /** The Standard Schema properties interface. */ - interface Props extends StandardTypedV1.Props { - /** Validates unknown input values. */ - readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result | Promise>; - } - /** The result interface of the validate function. */ - type Result = SuccessResult | FailureResult; - /** The result interface if validation succeeds. */ - interface SuccessResult { - /** The typed output value. */ - readonly value: Output; - /** A falsy value for `issues` indicates success. */ - readonly issues?: undefined; - } - interface Options { - /** Explicit support for additional vendor-specific parameters, if needed. */ - readonly libraryOptions?: Record | undefined; - } - /** The result interface if validation fails. */ - interface FailureResult { - /** The issues of failed validation. */ - readonly issues: ReadonlyArray; - } - /** The issue interface of the failure output. */ - interface Issue { - /** The error message of the issue. */ - readonly message: string; - /** The path of the issue, if any. */ - readonly path?: ReadonlyArray | undefined; - } - /** The path segment interface of the issue. */ - interface PathSegment { - /** The key representing a path segment. */ - readonly key: PropertyKey; - } - /** The Standard types interface. */ - interface Types extends StandardTypedV1.Types { - } - /** Infers the input type of a Standard. */ - type InferInput = StandardTypedV1.InferInput; - /** Infers the output type of a Standard. */ - type InferOutput = StandardTypedV1.InferOutput; -} -/** The Standard JSON Schema interface. */ -interface StandardJSONSchemaV1 { - /** The Standard JSON Schema properties. */ - readonly "~standard": StandardJSONSchemaV1.Props; -} -declare namespace StandardJSONSchemaV1 { - /** The Standard JSON Schema properties interface. */ - interface Props extends StandardTypedV1.Props { - /** Methods for generating the input/output JSON Schema. */ - readonly jsonSchema: StandardJSONSchemaV1.Converter; - } - /** The Standard JSON Schema converter interface. */ - interface Converter { - /** Converts the input type to JSON Schema. May throw if conversion is not supported. */ - readonly input: (options: StandardJSONSchemaV1.Options) => Record; - /** Converts the output type to JSON Schema. May throw if conversion is not supported. */ - readonly output: (options: StandardJSONSchemaV1.Options) => Record; - } - /** - * The target version of the generated JSON Schema. - * - * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target. - * - * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`. - */ - type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string); - /** The options for the input/output methods. */ - interface Options { - /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */ - readonly target: Target; - /** Explicit support for additional vendor-specific parameters, if needed. */ - readonly libraryOptions?: Record | undefined; - } - /** The Standard types interface. */ - interface Types extends StandardTypedV1.Types { - } - /** Infers the input type of a Standard. */ - type InferInput = StandardTypedV1.InferInput; - /** Infers the output type of a Standard. */ - type InferOutput = StandardTypedV1.InferOutput; -} - -export { StandardJSONSchemaV1, StandardSchemaV1, StandardTypedV1 }; diff --git a/frontend/node_modules/@standard-schema/spec/dist/index.d.ts b/frontend/node_modules/@standard-schema/spec/dist/index.d.ts deleted file mode 100644 index 5e4acaa..0000000 --- a/frontend/node_modules/@standard-schema/spec/dist/index.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -/** The Standard Typed interface. This is a base type extended by other specs. */ -interface StandardTypedV1 { - /** The Standard properties. */ - readonly "~standard": StandardTypedV1.Props; -} -declare namespace StandardTypedV1 { - /** The Standard Typed properties interface. */ - interface Props { - /** The version number of the standard. */ - readonly version: 1; - /** The vendor name of the schema library. */ - readonly vendor: string; - /** Inferred types associated with the schema. */ - readonly types?: Types | undefined; - } - /** The Standard Typed types interface. */ - interface Types { - /** The input type of the schema. */ - readonly input: Input; - /** The output type of the schema. */ - readonly output: Output; - } - /** Infers the input type of a Standard Typed. */ - type InferInput = NonNullable["input"]; - /** Infers the output type of a Standard Typed. */ - type InferOutput = NonNullable["output"]; -} -/** The Standard Schema interface. */ -interface StandardSchemaV1 { - /** The Standard Schema properties. */ - readonly "~standard": StandardSchemaV1.Props; -} -declare namespace StandardSchemaV1 { - /** The Standard Schema properties interface. */ - interface Props extends StandardTypedV1.Props { - /** Validates unknown input values. */ - readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result | Promise>; - } - /** The result interface of the validate function. */ - type Result = SuccessResult | FailureResult; - /** The result interface if validation succeeds. */ - interface SuccessResult { - /** The typed output value. */ - readonly value: Output; - /** A falsy value for `issues` indicates success. */ - readonly issues?: undefined; - } - interface Options { - /** Explicit support for additional vendor-specific parameters, if needed. */ - readonly libraryOptions?: Record | undefined; - } - /** The result interface if validation fails. */ - interface FailureResult { - /** The issues of failed validation. */ - readonly issues: ReadonlyArray; - } - /** The issue interface of the failure output. */ - interface Issue { - /** The error message of the issue. */ - readonly message: string; - /** The path of the issue, if any. */ - readonly path?: ReadonlyArray | undefined; - } - /** The path segment interface of the issue. */ - interface PathSegment { - /** The key representing a path segment. */ - readonly key: PropertyKey; - } - /** The Standard types interface. */ - interface Types extends StandardTypedV1.Types { - } - /** Infers the input type of a Standard. */ - type InferInput = StandardTypedV1.InferInput; - /** Infers the output type of a Standard. */ - type InferOutput = StandardTypedV1.InferOutput; -} -/** The Standard JSON Schema interface. */ -interface StandardJSONSchemaV1 { - /** The Standard JSON Schema properties. */ - readonly "~standard": StandardJSONSchemaV1.Props; -} -declare namespace StandardJSONSchemaV1 { - /** The Standard JSON Schema properties interface. */ - interface Props extends StandardTypedV1.Props { - /** Methods for generating the input/output JSON Schema. */ - readonly jsonSchema: StandardJSONSchemaV1.Converter; - } - /** The Standard JSON Schema converter interface. */ - interface Converter { - /** Converts the input type to JSON Schema. May throw if conversion is not supported. */ - readonly input: (options: StandardJSONSchemaV1.Options) => Record; - /** Converts the output type to JSON Schema. May throw if conversion is not supported. */ - readonly output: (options: StandardJSONSchemaV1.Options) => Record; - } - /** - * The target version of the generated JSON Schema. - * - * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target. - * - * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`. - */ - type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string); - /** The options for the input/output methods. */ - interface Options { - /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */ - readonly target: Target; - /** Explicit support for additional vendor-specific parameters, if needed. */ - readonly libraryOptions?: Record | undefined; - } - /** The Standard types interface. */ - interface Types extends StandardTypedV1.Types { - } - /** Infers the input type of a Standard. */ - type InferInput = StandardTypedV1.InferInput; - /** Infers the output type of a Standard. */ - type InferOutput = StandardTypedV1.InferOutput; -} - -export { StandardJSONSchemaV1, StandardSchemaV1, StandardTypedV1 }; diff --git a/frontend/node_modules/@standard-schema/spec/dist/index.js b/frontend/node_modules/@standard-schema/spec/dist/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/node_modules/@standard-schema/spec/package.json b/frontend/node_modules/@standard-schema/spec/package.json deleted file mode 100644 index 62bb551..0000000 --- a/frontend/node_modules/@standard-schema/spec/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "@standard-schema/spec", - "description": "A family of specs for interoperable TypeScript", - "version": "1.1.0", - "license": "MIT", - "author": "Colin McDonnell", - "homepage": "https://standardschema.dev", - "repository": { - "type": "git", - "url": "https://github.com/standard-schema/standard-schema" - }, - "keywords": [ - "typescript", - "schema", - "validation", - "standard", - "interface" - ], - "type": "module", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "standard-schema-spec": "./src/index.ts", - "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - }, - "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" - } - } - }, - "sideEffects": false, - "files": [ - "dist" - ], - "publishConfig": { - "access": "public" - }, - "devDependencies": { - "tsup": "^8.3.0", - "typescript": "^5.6.2" - }, - "scripts": { - "lint": "pnpm biome lint ./src", - "format": "pnpm biome format --write ./src", - "check": "pnpm biome check ./src", - "build": "tsup" - } -} \ No newline at end of file diff --git a/frontend/node_modules/@sveltejs/acorn-typescript/LICENSE.md b/frontend/node_modules/@sveltejs/acorn-typescript/LICENSE.md deleted file mode 100644 index 36d00ff..0000000 --- a/frontend/node_modules/@sveltejs/acorn-typescript/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2022 Tyreal Hu -Copyright (c) 2025 The Svelte Team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/frontend/node_modules/@sveltejs/acorn-typescript/README.md b/frontend/node_modules/@sveltejs/acorn-typescript/README.md deleted file mode 100644 index c6305de..0000000 --- a/frontend/node_modules/@sveltejs/acorn-typescript/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# @sveltejs/acorn-typescript - -[![License](https://img.shields.io/npm/l/svelte.svg)](LICENSE.md) [![Chat](https://img.shields.io/discord/457912077277855764?label=chat&logo=discord)](https://svelte.dev/chat) - -This is a plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript. - -It was created as an experimental alternative, faster [TypeScript](https://www.typescriptlang.org/) parser. It will help you to parse -TypeScript using Acorn. - -## Usage - -To get started, import the plugin and use Acorn's extension mechanism to register it. You have to enable `options.locations` while using `@sveltejs/acorn-typescript`. - -```typescript -import { Parser } from 'acorn'; -import { tsPlugin } from '@sveltejs/acorn-typescript'; - -const node = Parser.extend(tsPlugin()).parse( - ` -const a = 1 -type A = number -export { - a, - type A as B -} -`, - { - sourceType: 'module', - ecmaVersion: 'latest', - locations: true - } -); -``` - -If you want to enable parsing within a TypeScript ambient context, where certain syntax have different rules (like `.d.ts` files and inside [declare module blocks](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)): - -```typescript -import { Parser } from 'acorn'; -import { tsPlugin } from '@sveltejs/acorn-typescript'; - -const node = Parser.extend(tsPlugin({ dts: true })).parse( - ` -const a = 1 -type A = number -export { - a, - type A as B -} -`, - { - sourceType: 'module', - ecmaVersion: 'latest', - locations: true - } -); -``` - -## SUPPORTED - -- Typescript normal syntax -- Support to parse TypeScript [Decorators](https://www.typescriptlang.org/docs/handbook/decorators.html) -- Support to parse JSX & TSX - -## CHANGELOG - -[click](./CHANGELOG.md) - -## Acknowledgments - -We want to thank [TyrealHu](https://github.com/TyrealHu) for his original work on this project. He maintained [`acorn-typescript`](https://github.com/TyrealHu/acorn-typescript) until early 2024. diff --git a/frontend/node_modules/@sveltejs/acorn-typescript/index.d.ts b/frontend/node_modules/@sveltejs/acorn-typescript/index.d.ts deleted file mode 100644 index 1f357ec..0000000 --- a/frontend/node_modules/@sveltejs/acorn-typescript/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Parser } from 'acorn'; - -export function tsPlugin(options?: { - dts?: boolean; - /** Whether to use JSX. Defaults to false */ - jsx?: - | boolean - | { - allowNamespaces?: boolean; - allowNamespacedObjects?: boolean; - }; -}): (BaseParser: typeof Parser) => typeof Parser; diff --git a/frontend/node_modules/@sveltejs/acorn-typescript/index.js b/frontend/node_modules/@sveltejs/acorn-typescript/index.js deleted file mode 100644 index 44771ea..0000000 --- a/frontend/node_modules/@sveltejs/acorn-typescript/index.js +++ /dev/null @@ -1,5016 +0,0 @@ -// src/index.ts -import * as acornNamespace from "acorn"; - -// src/tokenType.ts -import { TokenType, keywordTypes, tokTypes, TokContext } from "acorn"; -var startsExpr = true; -function kwLike(_name, options = {}) { - return new TokenType("name", options); -} -var acornTypeScriptMap = /* @__PURE__ */ new WeakMap(); -var keywordTypeValues = Object.values(keywordTypes); -function generateAcornTypeScript(_acorn) { - const acorn = _acorn.Parser.acorn || _acorn; - let acornTypeScript = acornTypeScriptMap.get(acorn); - if (!acornTypeScript) { - let tokenIsLiteralPropertyName = function(token) { - return token === tokTypes.name || token === tokTypes.string || token === tokTypes.num || keywordTypeValues.includes(token) || tsKwTokenTypeValues.includes(token); - }, tokenIsKeywordOrIdentifier = function(token) { - return token === tokTypes.name || keywordTypeValues.includes(token) || tsKwTokenTypeValues.includes(token); - }, tokenIsIdentifier = function(token) { - return token === tokTypes.name || tsKwTokenTypeValues.includes(token); - }, tokenIsTSDeclarationStart = function(token) { - return token === tsKwTokenType.abstract || token === tsKwTokenType.declare || token === tsKwTokenType.enum || token === tsKwTokenType.module || token === tsKwTokenType.namespace || token === tsKwTokenType.interface || token === tsKwTokenType.type; - }, tokenIsTSTypeOperator = function(token) { - return token === tsKwTokenType.keyof || token === tsKwTokenType.readonly || token === tsKwTokenType.unique; - }, tokenIsTemplate = function(token) { - return token === tokTypes.invalidTemplate; - }; - const tsKwTokenType = generateTsKwTokenType(); - const tsKwTokenTypeValues = Object.values(tsKwTokenType); - const tsTokenType = generateTsTokenType(); - const tsTokenContext = generateTsTokenContext(); - const tsKeywordsRegExp = new RegExp(`^(?:${Object.keys(tsKwTokenType).join("|")})$`); - tsTokenType.jsxTagStart.updateContext = function() { - this.context.push(tsTokenContext.tc_expr); - this.context.push(tsTokenContext.tc_oTag); - this.exprAllowed = false; - }; - tsTokenType.jsxTagEnd.updateContext = function(prevType) { - let out = this.context.pop(); - if (out === tsTokenContext.tc_oTag && prevType === tokTypes.slash || out === tsTokenContext.tc_cTag) { - this.context.pop(); - this.exprAllowed = this.curContext() === tsTokenContext.tc_expr; - } else { - this.exprAllowed = true; - } - }; - acornTypeScript = { - tokTypes: { - ...tsKwTokenType, - ...tsTokenType - }, - tokContexts: { - ...tsTokenContext - }, - keywordsRegExp: tsKeywordsRegExp, - tokenIsLiteralPropertyName, - tokenIsKeywordOrIdentifier, - tokenIsIdentifier, - tokenIsTSDeclarationStart, - tokenIsTSTypeOperator, - tokenIsTemplate - }; - } - return acornTypeScript; -} -function generateTsTokenContext() { - return { - tc_oTag: new TokContext("...", true, true) - }; -} -function generateTsTokenType() { - return { - // @ts-expect-error - at: new TokenType("@"), - // @ts-expect-error - jsxName: new TokenType("jsxName"), - // @ts-expect-error - jsxText: new TokenType("jsxText", { beforeExpr: true }), - // @ts-expect-error - jsxTagStart: new TokenType("jsxTagStart", { startsExpr: true }), - // @ts-expect-error - jsxTagEnd: new TokenType("jsxTagEnd") - }; -} -function generateTsKwTokenType() { - return { - assert: kwLike("assert", { startsExpr }), - asserts: kwLike("asserts", { startsExpr }), - global: kwLike("global", { startsExpr }), - keyof: kwLike("keyof", { startsExpr }), - readonly: kwLike("readonly", { startsExpr }), - unique: kwLike("unique", { startsExpr }), - abstract: kwLike("abstract", { startsExpr }), - declare: kwLike("declare", { startsExpr }), - enum: kwLike("enum", { startsExpr }), - module: kwLike("module", { startsExpr }), - namespace: kwLike("namespace", { startsExpr }), - interface: kwLike("interface", { startsExpr }), - type: kwLike("type", { startsExpr }) - }; -} - -// src/scopeflags.ts -var TS_SCOPE_OTHER = 512; -var TS_SCOPE_TS_MODULE = 1024; -var BIND_KIND_VALUE = 1; -var BIND_KIND_TYPE = 2; -var BIND_SCOPE_VAR = 4; -var BIND_SCOPE_LEXICAL = 8; -var BIND_SCOPE_FUNCTION = 16; -var BIND_FLAGS_NONE = 64; -var BIND_FLAGS_CLASS = 128; -var BIND_FLAGS_TS_ENUM = 256; -var BIND_FLAGS_TS_CONST_ENUM = 512; -var BIND_FLAGS_TS_EXPORT_ONLY = 1024; -var BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS; -var BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0; -var BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0; -var BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0; -var BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS; -var BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0; -var BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM; -var BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY; -var BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE; -var BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE; -var BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM; -var BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY; -var CLASS_ELEMENT_FLAG_STATIC = 4; -var CLASS_ELEMENT_KIND_GETTER = 2; -var CLASS_ELEMENT_KIND_SETTER = 1; -var CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; -var CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC; -var CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC; - -// src/whitespace.ts -var skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y; -var skipWhiteSpaceToLineBreak = new RegExp( - // Unfortunately JS doesn't support Perl's atomic /(?>pattern)/ or - // possessive quantifiers, so we use a trick to prevent backtracking - // when the look-ahead for line terminator fails. - "(?=(" + // Capture the whitespace and comments that should be skipped inside - // a look-ahead assertion, and then re-match the group as a unit. - skipWhiteSpaceInLine.source + "))\\1" + // Look-ahead for either line terminator, start of multi-line comment, - // or end of string. - /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, - "y" - // sticky -); - -// src/parseutil.ts -var DestructuringErrors = class { - constructor() { - this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; - } -}; -function isPrivateNameConflicted(privateNameMap, element) { - const name = element.key.name; - const curr = privateNameMap[name]; - let next = "true"; - if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { - next = (element.static ? "s" : "i") + element.kind; - } - if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { - privateNameMap[name] = "true"; - return false; - } else if (!curr) { - privateNameMap[name] = next; - return false; - } else { - return true; - } -} -function checkKeyName(node, name) { - const { computed, key } = node; - return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name); -} - -// src/error.ts -var TypeScriptError = { - AbstractMethodHasImplementation: ({ methodName }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, - AbstractPropertyHasInitializer: ({ propertyName }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, - AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", - AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.", - CannotFindName: ({ name }) => `Cannot find name '${name}'.`, - ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", - ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", - ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", - ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", - DeclareAccessor: ({ kind }) => `'declare' is not allowed in ${kind}ters.`, - DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", - DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", - DuplicateAccessibilityModifier: ( - // `Accessibility modifier already seen: ${modifier}` would be more helpful. - // eslint-disable-next-line @typescript-eslint/no-unused-vars - () => `Accessibility modifier already seen.` - ), - DuplicateModifier: ({ modifier }) => `Duplicate modifier: '${modifier}'.`, - // `token` matches the terminology used by typescript: - // https://github.com/microsoft/TypeScript/blob/main/src/compiler/types.ts#L2915 - EmptyHeritageClauseType: ({ token }) => `'${token}' list cannot be empty.`, - EmptyTypeArguments: "Type argument list cannot be empty.", - EmptyTypeParameters: "Type parameter list cannot be empty.", - ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", - ImportAliasHasImportType: "An import alias can not use 'import type'.", - IncompatibleModifiers: ({ modifiers }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, - IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", - IndexSignatureHasAccessibility: ({ modifier }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, - IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", - IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", - IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", - InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", - InvalidModifierOnTypeMember: ({ modifier }) => `'${modifier}' modifier cannot appear on a type member.`, - InvalidModifierOnTypeParameter: ({ modifier }) => `'${modifier}' modifier cannot appear on a type parameter.`, - InvalidModifierOnTypeParameterPositions: ({ modifier }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, - InvalidModifiersOrder: ({ orderedModifiers }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, - InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.", - InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", - MissingInterfaceName: "'interface' declarations must be followed by an identifier.", - NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", - NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", - OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", - OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", - PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", - PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", - PrivateElementHasAccessibility: ({ modifier }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, - PrivateMethodsHasAccessibility: ({ modifier }) => `Private methods cannot have an accessibility modifier ('${modifier}').`, - ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", - ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.", - ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", - SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", - SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", - SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", - SingleTypeParameterWithoutTrailingComma: ({ typeParameterName }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, - StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", - TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", - TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", - TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", - TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", - UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", - UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", - GenericsEndWithComma: `Trailing comma is not allowed at the end of generics.`, - UnexpectedTypeAnnotation: "Did not expect a type annotation here.", - UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", - UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", - UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", - UnsupportedSignatureParameterKind: ({ type }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`, - LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." -}; -var DecoratorsError = { - UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", - DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", - TrailingDecorator: "Decorators must be attached to a class element.", - SpreadElementDecorator: `Decorators can't be used with SpreadElement` -}; - -// src/extentions/decorators.ts -function generateParseDecorators(Parse, acornTypeScript, acorn) { - const { tokTypes: tt } = acorn; - const { tokTypes: tokTypes2 } = acornTypeScript; - return class ParseDecorators extends Parse { - takeDecorators(node) { - const decorators = this.decoratorStack[this.decoratorStack.length - 1]; - if (decorators.length) { - node.decorators = decorators; - this.resetStartLocationFromNode(node, decorators[0]); - this.decoratorStack[this.decoratorStack.length - 1] = []; - } - } - parseDecorators(allowExport) { - const currentContextDecorators = this.decoratorStack[this.decoratorStack.length - 1]; - while (this.match(tokTypes2.at)) { - const decorator = this.parseDecorator(); - currentContextDecorators.push(decorator); - } - if (this.match(tt._export)) { - if (!allowExport) { - this.unexpected(); - } - } else if (!this.canHaveLeadingDecorator()) { - this.raise(this.start, DecoratorsError.UnexpectedLeadingDecorator); - } - } - parseDecorator() { - const node = this.startNode(); - this.next(); - this.decoratorStack.push([]); - const startPos = this.start; - const startLoc = this.startLoc; - let expr; - if (this.match(tt.parenL)) { - const startPos2 = this.start; - const startLoc2 = this.startLoc; - this.next(); - expr = this.parseExpression(); - this.expect(tt.parenR); - if (this.options.preserveParens) { - let par = this.startNodeAt(startPos2, startLoc2); - par.expression = expr; - expr = this.finishNode(par, "ParenthesizedExpression"); - } - } else { - expr = this.parseIdent(false); - while (this.eat(tt.dot)) { - const node2 = this.startNodeAt(startPos, startLoc); - node2.object = expr; - node2.property = this.parseIdent(true); - node2.computed = false; - expr = this.finishNode(node2, "MemberExpression"); - } - } - node.expression = this.parseMaybeDecoratorArguments(expr); - this.decoratorStack.pop(); - return this.finishNode(node, "Decorator"); - } - parseMaybeDecoratorArguments(expr) { - if (this.eat(tt.parenL)) { - const node = this.startNodeAtNode(expr); - node.callee = expr; - node.arguments = this.parseExprList(tt.parenR, false); - return this.finishNode(node, "CallExpression"); - } - return expr; - } - }; -} - -// src/extentions/jsx/xhtml.ts -var xhtml_default = { - quot: '"', - amp: "&", - apos: "'", - lt: "<", - gt: ">", - nbsp: "\xA0", - iexcl: "\xA1", - cent: "\xA2", - pound: "\xA3", - curren: "\xA4", - yen: "\xA5", - brvbar: "\xA6", - sect: "\xA7", - uml: "\xA8", - copy: "\xA9", - ordf: "\xAA", - laquo: "\xAB", - not: "\xAC", - shy: "\xAD", - reg: "\xAE", - macr: "\xAF", - deg: "\xB0", - plusmn: "\xB1", - sup2: "\xB2", - sup3: "\xB3", - acute: "\xB4", - micro: "\xB5", - para: "\xB6", - middot: "\xB7", - cedil: "\xB8", - sup1: "\xB9", - ordm: "\xBA", - raquo: "\xBB", - frac14: "\xBC", - frac12: "\xBD", - frac34: "\xBE", - iquest: "\xBF", - Agrave: "\xC0", - Aacute: "\xC1", - Acirc: "\xC2", - Atilde: "\xC3", - Auml: "\xC4", - Aring: "\xC5", - AElig: "\xC6", - Ccedil: "\xC7", - Egrave: "\xC8", - Eacute: "\xC9", - Ecirc: "\xCA", - Euml: "\xCB", - Igrave: "\xCC", - Iacute: "\xCD", - Icirc: "\xCE", - Iuml: "\xCF", - ETH: "\xD0", - Ntilde: "\xD1", - Ograve: "\xD2", - Oacute: "\xD3", - Ocirc: "\xD4", - Otilde: "\xD5", - Ouml: "\xD6", - times: "\xD7", - Oslash: "\xD8", - Ugrave: "\xD9", - Uacute: "\xDA", - Ucirc: "\xDB", - Uuml: "\xDC", - Yacute: "\xDD", - THORN: "\xDE", - szlig: "\xDF", - agrave: "\xE0", - aacute: "\xE1", - acirc: "\xE2", - atilde: "\xE3", - auml: "\xE4", - aring: "\xE5", - aelig: "\xE6", - ccedil: "\xE7", - egrave: "\xE8", - eacute: "\xE9", - ecirc: "\xEA", - euml: "\xEB", - igrave: "\xEC", - iacute: "\xED", - icirc: "\xEE", - iuml: "\xEF", - eth: "\xF0", - ntilde: "\xF1", - ograve: "\xF2", - oacute: "\xF3", - ocirc: "\xF4", - otilde: "\xF5", - ouml: "\xF6", - divide: "\xF7", - oslash: "\xF8", - ugrave: "\xF9", - uacute: "\xFA", - ucirc: "\xFB", - uuml: "\xFC", - yacute: "\xFD", - thorn: "\xFE", - yuml: "\xFF", - OElig: "\u0152", - oelig: "\u0153", - Scaron: "\u0160", - scaron: "\u0161", - Yuml: "\u0178", - fnof: "\u0192", - circ: "\u02C6", - tilde: "\u02DC", - Alpha: "\u0391", - Beta: "\u0392", - Gamma: "\u0393", - Delta: "\u0394", - Epsilon: "\u0395", - Zeta: "\u0396", - Eta: "\u0397", - Theta: "\u0398", - Iota: "\u0399", - Kappa: "\u039A", - Lambda: "\u039B", - Mu: "\u039C", - Nu: "\u039D", - Xi: "\u039E", - Omicron: "\u039F", - Pi: "\u03A0", - Rho: "\u03A1", - Sigma: "\u03A3", - Tau: "\u03A4", - Upsilon: "\u03A5", - Phi: "\u03A6", - Chi: "\u03A7", - Psi: "\u03A8", - Omega: "\u03A9", - alpha: "\u03B1", - beta: "\u03B2", - gamma: "\u03B3", - delta: "\u03B4", - epsilon: "\u03B5", - zeta: "\u03B6", - eta: "\u03B7", - theta: "\u03B8", - iota: "\u03B9", - kappa: "\u03BA", - lambda: "\u03BB", - mu: "\u03BC", - nu: "\u03BD", - xi: "\u03BE", - omicron: "\u03BF", - pi: "\u03C0", - rho: "\u03C1", - sigmaf: "\u03C2", - sigma: "\u03C3", - tau: "\u03C4", - upsilon: "\u03C5", - phi: "\u03C6", - chi: "\u03C7", - psi: "\u03C8", - omega: "\u03C9", - thetasym: "\u03D1", - upsih: "\u03D2", - piv: "\u03D6", - ensp: "\u2002", - emsp: "\u2003", - thinsp: "\u2009", - zwnj: "\u200C", - zwj: "\u200D", - lrm: "\u200E", - rlm: "\u200F", - ndash: "\u2013", - mdash: "\u2014", - lsquo: "\u2018", - rsquo: "\u2019", - sbquo: "\u201A", - ldquo: "\u201C", - rdquo: "\u201D", - bdquo: "\u201E", - dagger: "\u2020", - Dagger: "\u2021", - bull: "\u2022", - hellip: "\u2026", - permil: "\u2030", - prime: "\u2032", - Prime: "\u2033", - lsaquo: "\u2039", - rsaquo: "\u203A", - oline: "\u203E", - frasl: "\u2044", - euro: "\u20AC", - image: "\u2111", - weierp: "\u2118", - real: "\u211C", - trade: "\u2122", - alefsym: "\u2135", - larr: "\u2190", - uarr: "\u2191", - rarr: "\u2192", - darr: "\u2193", - harr: "\u2194", - crarr: "\u21B5", - lArr: "\u21D0", - uArr: "\u21D1", - rArr: "\u21D2", - dArr: "\u21D3", - hArr: "\u21D4", - forall: "\u2200", - part: "\u2202", - exist: "\u2203", - empty: "\u2205", - nabla: "\u2207", - isin: "\u2208", - notin: "\u2209", - ni: "\u220B", - prod: "\u220F", - sum: "\u2211", - minus: "\u2212", - lowast: "\u2217", - radic: "\u221A", - prop: "\u221D", - infin: "\u221E", - ang: "\u2220", - and: "\u2227", - or: "\u2228", - cap: "\u2229", - cup: "\u222A", - int: "\u222B", - there4: "\u2234", - sim: "\u223C", - cong: "\u2245", - asymp: "\u2248", - ne: "\u2260", - equiv: "\u2261", - le: "\u2264", - ge: "\u2265", - sub: "\u2282", - sup: "\u2283", - nsub: "\u2284", - sube: "\u2286", - supe: "\u2287", - oplus: "\u2295", - otimes: "\u2297", - perp: "\u22A5", - sdot: "\u22C5", - lceil: "\u2308", - rceil: "\u2309", - lfloor: "\u230A", - rfloor: "\u230B", - lang: "\u2329", - rang: "\u232A", - loz: "\u25CA", - spades: "\u2660", - clubs: "\u2663", - hearts: "\u2665", - diams: "\u2666" -}; - -// src/extentions/jsx/index.ts -var hexNumber = /^[\da-fA-F]+$/; -var decimalNumber = /^\d+$/; -function getQualifiedJSXName(object) { - if (!object) return object; - if (object.type === "JSXIdentifier") return object.name; - if (object.type === "JSXNamespacedName") return object.namespace.name + ":" + object.name.name; - if (object.type === "JSXMemberExpression") - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); -} -function generateJsxParser(acorn, acornTypeScript, Parser, jsxOptions) { - const tt = acorn.tokTypes; - const tok = acornTypeScript.tokTypes; - const isNewLine = acorn.isNewLine; - const isIdentifierChar = acorn.isIdentifierChar; - const options = Object.assign( - { - allowNamespaces: true, - allowNamespacedObjects: true - }, - jsxOptions || {} - ); - return class JsxParser extends Parser { - // Reads inline JSX contents token. - jsx_readToken() { - let out = "", chunkStart = this.pos; - for (; ; ) { - if (this.pos >= this.input.length) this.raise(this.start, "Unterminated JSX contents"); - let ch = this.input.charCodeAt(this.pos); - switch (ch) { - case 60: - // '<' - case 123: - if (this.pos === this.start) { - if (ch === 60 && this.exprAllowed) { - ++this.pos; - return this.finishToken(tok.jsxTagStart); - } - return this.getTokenFromCode(ch); - } - out += this.input.slice(chunkStart, this.pos); - return this.finishToken(tok.jsxText, out); - case 38: - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readEntity(); - chunkStart = this.pos; - break; - case 62: - // '>' - case 125: - this.raise( - this.pos, - "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" + (ch === 62 ? ">" : "}") + '` or `{"' + this.input[this.pos] + '"}`?' - ); - default: - if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readNewLine(true); - chunkStart = this.pos; - } else { - ++this.pos; - } - } - } - } - jsx_readNewLine(normalizeCRLF) { - let ch = this.input.charCodeAt(this.pos); - let out; - ++this.pos; - if (ch === 13 && this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); - } - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - return out; - } - jsx_readString(quote) { - let out = "", chunkStart = ++this.pos; - for (; ; ) { - if (this.pos >= this.input.length) this.raise(this.start, "Unterminated string constant"); - let ch = this.input.charCodeAt(this.pos); - if (ch === quote) break; - if (ch === 38) { - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readEntity(); - chunkStart = this.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readNewLine(false); - chunkStart = this.pos; - } else { - ++this.pos; - } - } - out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(tt.string, out); - } - jsx_readEntity() { - let str = "", count = 0, entity; - let ch = this.input[this.pos]; - if (ch !== "&") this.raise(this.pos, "Entity must start with an ampersand"); - let startPos = ++this.pos; - while (this.pos < this.input.length && count++ < 10) { - ch = this.input[this.pos++]; - if (ch === ";") { - if (str[0] === "#") { - if (str[1] === "x") { - str = str.substr(2); - if (hexNumber.test(str)) entity = String.fromCharCode(parseInt(str, 16)); - } else { - str = str.substr(1); - if (decimalNumber.test(str)) entity = String.fromCharCode(parseInt(str, 10)); - } - } else { - entity = xhtml_default[str]; - } - break; - } - str += ch; - } - if (!entity) { - this.pos = startPos; - return "&"; - } - return entity; - } - // Read a JSX identifier (valid tag or attribute name). - // - // Optimized version since JSX identifiers can't contain - // escape characters and so can be read as single slice. - // Also assumes that first character was already checked - // by isIdentifierStart in readToken. - jsx_readWord() { - let ch, start = this.pos; - do { - ch = this.input.charCodeAt(++this.pos); - } while (isIdentifierChar(ch) || ch === 45); - return this.finishToken(tok.jsxName, this.input.slice(start, this.pos)); - } - // Parse next token as JSX identifier - jsx_parseIdentifier() { - let node = this.startNode(); - if (this.type === tok.jsxName) node.name = this.value; - else if (this.type.keyword) node.name = this.type.keyword; - else this.unexpected(); - this.next(); - return this.finishNode(node, "JSXIdentifier"); - } - // Parse namespaced identifier. - jsx_parseNamespacedName() { - let startPos = this.start, startLoc = this.startLoc; - let name = this.jsx_parseIdentifier(); - if (!options.allowNamespaces || !this.eat(tt.colon)) return name; - var node = this.startNodeAt(startPos, startLoc); - node.namespace = name; - node.name = this.jsx_parseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); - } - // Parses element name in any form - namespaced, member - // or single identifier. - jsx_parseElementName() { - if (this.type === tok.jsxTagEnd) return ""; - let startPos = this.start, startLoc = this.startLoc; - let node = this.jsx_parseNamespacedName(); - if (this.type === tt.dot && node.type === "JSXNamespacedName" && !options.allowNamespacedObjects) { - this.unexpected(); - } - while (this.eat(tt.dot)) { - let newNode = this.startNodeAt(startPos, startLoc); - newNode.object = node; - newNode.property = this.jsx_parseIdentifier(); - node = this.finishNode(newNode, "JSXMemberExpression"); - } - return node; - } - // Parses any type of JSX attribute value. - jsx_parseAttributeValue() { - switch (this.type) { - case tt.braceL: - let node = this.jsx_parseExpressionContainer(); - if (node.expression.type === "JSXEmptyExpression") - this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); - return node; - case tok.jsxTagStart: - case tt.string: - return this.parseExprAtom(); - default: - this.raise(this.start, "JSX value should be either an expression or a quoted JSX text"); - } - } - // JSXEmptyExpression is unique type since it doesn't actually parse anything, - // and so it should start at the end of last read token (left brace) and finish - // at the beginning of the next one (right brace). - jsx_parseEmptyExpression() { - let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); - return this.finishNodeAt(node, "JSXEmptyExpression", this.start, this.startLoc); - } - // Parses JSX expression enclosed into curly brackets. - jsx_parseExpressionContainer() { - let node = this.startNode(); - this.next(); - node.expression = this.type === tt.braceR ? this.jsx_parseEmptyExpression() : this.parseExpression(); - this.expect(tt.braceR); - return this.finishNode(node, "JSXExpressionContainer"); - } - // Parses following JSX attribute name-value pair. - jsx_parseAttribute() { - let node = this.startNode(); - if (this.eat(tt.braceL)) { - this.expect(tt.ellipsis); - node.argument = this.parseMaybeAssign(); - this.expect(tt.braceR); - return this.finishNode(node, "JSXSpreadAttribute"); - } - node.name = this.jsx_parseNamespacedName(); - node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null; - return this.finishNode(node, "JSXAttribute"); - } - // Parses JSX opening tag starting after '<'. - jsx_parseOpeningElementAt(startPos, startLoc) { - let node = this.startNodeAt(startPos, startLoc); - node.attributes = []; - let nodeName = this.jsx_parseElementName(); - if (nodeName) node.name = nodeName; - while (this.type !== tt.slash && this.type !== tok.jsxTagEnd) - node.attributes.push(this.jsx_parseAttribute()); - node.selfClosing = this.eat(tt.slash); - this.expect(tok.jsxTagEnd); - return this.finishNode(node, nodeName ? "JSXOpeningElement" : "JSXOpeningFragment"); - } - // Parses JSX closing tag starting after '" - ); - } - } - let fragmentOrElement = openingElement.name ? "Element" : "Fragment"; - node["opening" + fragmentOrElement] = openingElement; - node["closing" + fragmentOrElement] = closingElement; - node.children = children; - if (this.type === tt.relational && this.value === "<") { - this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); - } - return this.finishNode(node, "JSX" + fragmentOrElement); - } - // Parse JSX text - jsx_parseText() { - let node = this.parseLiteral(this.value); - node.type = "JSXText"; - return node; - } - // Parses entire JSX element from current position. - jsx_parseElement() { - let startPos = this.start, startLoc = this.startLoc; - this.next(); - return this.jsx_parseElementAt(startPos, startLoc); - } - }; -} - -// src/extentions/import-assertions.ts -function generateParseImportAssertions(Parse, acornTypeScript, acorn) { - const { tokTypes: tokTypes2 } = acornTypeScript; - const { tokTypes: tt } = acorn; - return class ImportAttributes extends Parse { - parseMaybeImportAttributes(node) { - if (this.type === tt._with || this.type === tokTypes2.assert) { - this.next(); - const attributes = this.parseImportAttributes(); - if (attributes) { - node.attributes = attributes; - } - } - } - parseImportAttributes() { - this.expect(tt.braceL); - const attrs = this.parseWithEntries(); - this.expect(tt.braceR); - return attrs; - } - parseWithEntries() { - const attrs = []; - const attrNames = /* @__PURE__ */ new Set(); - do { - if (this.type === tt.braceR) { - break; - } - const node = this.startNode(); - let withionKeyNode; - if (this.type === tt.string) { - withionKeyNode = this.parseLiteral(this.value); - } else { - withionKeyNode = this.parseIdent(true); - } - this.next(); - node.key = withionKeyNode; - if (attrNames.has(node.key.name)) { - this.raise(this.pos, "Duplicated key in attributes"); - } - attrNames.add(node.key.name); - if (this.type !== tt.string) { - this.raise(this.pos, "Only string is supported as an attribute value"); - } - node.value = this.parseLiteral(this.value); - attrs.push(this.finishNode(node, "ImportAttribute")); - } while (this.eat(tt.comma)); - return attrs; - } - }; -} - -// src/index.ts -var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -function assert(x) { - if (!x) { - throw new Error("Assert fail"); - } -} -function tsIsClassAccessor(modifier) { - return modifier === "accessor"; -} -function tsIsVarianceAnnotations(modifier) { - return modifier === "in" || modifier === "out"; -} -var FUNC_STATEMENT = 1; -var FUNC_HANGING_STATEMENT = 2; -var FUNC_NULLABLE_ID = 4; -var acornScope = { - SCOPE_TOP: 1, - SCOPE_FUNCTION: 2, - SCOPE_ASYNC: 4, - SCOPE_GENERATOR: 8, - SCOPE_ARROW: 16, - SCOPE_SIMPLE_CATCH: 32, - SCOPE_SUPER: 64, - SCOPE_DIRECT_SUPER: 128, - SCOPE_CLASS_STATIC_BLOCK: 256, - SCOPE_VAR: 256, - BIND_NONE: 0, - // Not a binding - BIND_VAR: 1, - // Var-style binding - BIND_LEXICAL: 2, - // Let- or const-style binding - BIND_FUNCTION: 3, - // Function declaration - BIND_SIMPLE_CATCH: 4, - // Simple (identifier pattern) catch binding - BIND_OUTSIDE: 5, - // Special case for function names as bound inside the - BIND_TS_TYPE: 6, - BIND_TS_INTERFACE: 7, - BIND_TS_NAMESPACE: 8, - BIND_FLAGS_TS_EXPORT_ONLY: 1024, - BIND_FLAGS_TS_IMPORT: 4096, - BIND_FLAGS_TS_ENUM: 256, - BIND_FLAGS_TS_CONST_ENUM: 512, - BIND_FLAGS_CLASS: 128 - // function -}; -function functionFlags(async, generator) { - return acornScope.SCOPE_FUNCTION | (async ? acornScope.SCOPE_ASYNC : 0) | (generator ? acornScope.SCOPE_GENERATOR : 0); -} -function isPossiblyLiteralEnum(expression) { - if (expression.type !== "MemberExpression") return false; - const { computed, property } = expression; - if (computed && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { - return false; - } - return isUncomputedMemberExpressionChain(expression.object); -} -function isUncomputedMemberExpressionChain(expression) { - if (expression.type === "Identifier") return true; - if (expression.type !== "MemberExpression") return false; - if (expression.computed) return false; - return isUncomputedMemberExpressionChain(expression.object); -} -function tsIsAccessModifier(modifier) { - return modifier === "private" || modifier === "public" || modifier === "protected"; -} -function tokenCanStartExpression(token) { - return Boolean(token.startsExpr); -} -function nonNull(x) { - if (x == null) { - throw new Error(`Unexpected ${x} value.`); - } - return x; -} -function keywordTypeFromName(value) { - switch (value) { - case "any": - return "TSAnyKeyword"; - case "boolean": - return "TSBooleanKeyword"; - case "bigint": - return "TSBigIntKeyword"; - case "never": - return "TSNeverKeyword"; - case "number": - return "TSNumberKeyword"; - case "object": - return "TSObjectKeyword"; - case "string": - return "TSStringKeyword"; - case "symbol": - return "TSSymbolKeyword"; - case "undefined": - return "TSUndefinedKeyword"; - case "unknown": - return "TSUnknownKeyword"; - default: - return void 0; - } -} -function tsPlugin(options) { - const { dts = false } = options || {}; - const disallowAmbiguousJSXLike = !!options?.jsx; - return function(Parser) { - const _acorn = Parser.acorn || acornNamespace; - const acornTypeScript = generateAcornTypeScript(_acorn); - const tt = _acorn.tokTypes; - const keywordTypes2 = _acorn.keywordTypes; - const isIdentifierStart = _acorn.isIdentifierStart; - const lineBreak = _acorn.lineBreak; - const isNewLine = _acorn.isNewLine; - const tokContexts = _acorn.tokContexts; - const isIdentifierChar = _acorn.isIdentifierChar; - const { - tokTypes: tokTypes2, - tokContexts: tsTokContexts, - keywordsRegExp, - tokenIsLiteralPropertyName, - tokenIsTemplate, - tokenIsTSDeclarationStart, - tokenIsIdentifier, - tokenIsKeywordOrIdentifier, - tokenIsTSTypeOperator - } = acornTypeScript; - function nextLineBreak(code, from, end = code.length) { - for (let i = from; i < end; i++) { - let next = code.charCodeAt(i); - if (isNewLine(next)) - return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1; - } - return -1; - } - Parser = generateParseDecorators(Parser, acornTypeScript, _acorn); - if (options?.jsx) { - Parser = generateJsxParser( - _acorn, - acornTypeScript, - Parser, - typeof options.jsx === "boolean" ? {} : options.jsx - ); - } - Parser = generateParseImportAssertions(Parser, acornTypeScript, _acorn); - class TypeScriptParser extends Parser { - constructor(options2, input, startPos) { - super(options2, input, startPos); - this.preValue = null; - this.preToken = null; - this.isLookahead = false; - this.isAmbientContext = false; - this.inAbstractClass = false; - this.inType = false; - this.inDisallowConditionalTypesContext = false; - this.maybeInArrowParameters = false; - this.shouldParseArrowReturnType = void 0; - this.shouldParseAsyncArrowReturnType = void 0; - this.decoratorStack = [[]]; - this.importsStack = [[]]; - /** - * we will only parse one import node or export node at same time. - * default kind is undefined - * */ - this.importOrExportOuterKind = void 0; - this.tsParseConstModifier = (node) => { - this.tsParseModifiers({ - modified: node, - allowedModifiers: ["const"], - // for better error recovery - disallowedModifiers: ["in", "out"], - errorTemplate: TypeScriptError.InvalidModifierOnTypeParameterPositions - }); - }; - this.ecmaVersion = this.options.ecmaVersion; - } - // support in Class static - static get acornTypeScript() { - return acornTypeScript; - } - // support in runtime, get acornTypeScript be this - get acornTypeScript() { - return acornTypeScript; - } - getTokenFromCodeInType(code) { - if (code === 62) { - return this.finishOp(tt.relational, 1); - } - if (code === 60) { - return this.finishOp(tt.relational, 1); - } - return super.getTokenFromCode(code); - } - readToken(code) { - if (!this.inType) { - let context = this.curContext(); - if (context === tsTokContexts.tc_expr) return this.jsx_readToken(); - if (context === tsTokContexts.tc_oTag || context === tsTokContexts.tc_cTag) { - if (isIdentifierStart(code)) return this.jsx_readWord(); - if (code == 62) { - ++this.pos; - return this.finishToken(tokTypes2.jsxTagEnd); - } - if ((code === 34 || code === 39) && context == tsTokContexts.tc_oTag) - return this.jsx_readString(code); - } - if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) { - ++this.pos; - if (options?.jsx) { - return this.finishToken(tokTypes2.jsxTagStart); - } else { - return this.finishToken(tt.relational, "<"); - } - } - } - return super.readToken(code); - } - getTokenFromCode(code) { - if (this.inType) { - return this.getTokenFromCodeInType(code); - } - if (code === 64) { - ++this.pos; - return this.finishToken(tokTypes2.at); - } - return super.getTokenFromCode(code); - } - isAbstractClass() { - return this.ts_isContextual(tokTypes2.abstract) && this.lookahead().type === tt._class; - } - finishNode(node, type) { - if (node.type !== "" && node.end !== 0) { - return node; - } - return super.finishNode(node, type); - } - // tryParse will clone parser state. - // It is expensive and should be used with cautions - tryParse(fn, oldState = this.cloneCurLookaheadState()) { - const abortSignal = { node: null }; - try { - const node = fn((node2 = null) => { - abortSignal.node = node2; - throw abortSignal; - }); - return { - node, - error: null, - thrown: false, - aborted: false, - failState: null - }; - } catch (error) { - const failState = this.getCurLookaheadState(); - this.setLookaheadState(oldState); - if (error instanceof SyntaxError) { - return { - node: null, - error, - thrown: true, - aborted: false, - failState - }; - } - if (error === abortSignal) { - return { - node: abortSignal.node, - error: null, - thrown: false, - aborted: true, - failState - }; - } - throw error; - } - } - setOptionalParametersError(refExpressionErrors, resultError) { - refExpressionErrors.optionalParametersLoc = resultError?.loc ?? this.startLoc; - } - // used after we have finished parsing types - reScan_lt_gt() { - if (this.type === tt.relational) { - this.pos -= 1; - this.readToken_lt_gt(this.fullCharCodeAtPos()); - } - } - reScan_lt() { - const { type } = this; - if (type === tt.bitShift) { - this.pos -= 2; - this.finishOp(tt.relational, 1); - return tt.relational; - } - return type; - } - resetEndLocation(node, endPos = this.lastTokEnd, endLoc = this.lastTokEndLoc) { - node.end = endPos; - node.loc.end = endLoc; - if (this.options.ranges) node.range[1] = endPos; - } - startNodeAtNode(type) { - return super.startNodeAt(type.start, type.loc.start); - } - nextTokenStart() { - return this.nextTokenStartSince(this.pos); - } - tsHasSomeModifiers(member, modifiers) { - return modifiers.some((modifier) => { - if (tsIsAccessModifier(modifier)) { - return member.accessibility === modifier; - } - return !!member[modifier]; - }); - } - tsIsStartOfStaticBlocks() { - return this.isContextual("static") && this.lookaheadCharCode() === 123; - } - tsCheckForInvalidTypeCasts(items) { - items.forEach((node) => { - if (node?.type === "TSTypeCastExpression") { - this.raise(node.typeAnnotation.start, TypeScriptError.UnexpectedTypeAnnotation); - } - }); - } - atPossibleAsyncArrow(base) { - return base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.potentialArrowAt; - } - tsIsIdentifier() { - return tokenIsIdentifier(this.type); - } - tsTryParseTypeOrTypePredicateAnnotation() { - return this.match(tt.colon) ? this.tsParseTypeOrTypePredicateAnnotation(tt.colon) : void 0; - } - tsTryParseGenericAsyncArrowFunction(startPos, startLoc, forInit) { - if (!this.tsMatchLeftRelational()) { - return void 0; - } - const oldMaybeInArrowParameters = this.maybeInArrowParameters; - this.maybeInArrowParameters = true; - const res = this.tsTryParseAndCatch(() => { - const node = this.startNodeAt(startPos, startLoc); - node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); - super.parseFunctionParams(node); - node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); - this.expect(tt.arrow); - return node; - }); - this.maybeInArrowParameters = oldMaybeInArrowParameters; - if (!res) { - return void 0; - } - return super.parseArrowExpression( - res, - /* params are already set */ - null, - /* async */ - true, - /* forInit */ - forInit - ); - } - // Used when parsing type arguments from ES productions, where the first token - // has been created without state.inType. Thus we need to rescan the lt token. - tsParseTypeArgumentsInExpression() { - if (this.reScan_lt() !== tt.relational) { - return void 0; - } - return this.tsParseTypeArguments(); - } - tsInNoContext(cb) { - const oldContext = this.context; - this.context = [oldContext[0]]; - try { - return cb(); - } finally { - this.context = oldContext; - } - } - tsTryParseTypeAnnotation() { - return this.match(tt.colon) ? this.tsParseTypeAnnotation() : void 0; - } - isUnparsedContextual(nameStart, name) { - const nameEnd = nameStart + name.length; - if (this.input.slice(nameStart, nameEnd) === name) { - const nextCh = this.input.charCodeAt(nameEnd); - return !(isIdentifierChar(nextCh) || // check if `nextCh is between 0xd800 - 0xdbff, - // if `nextCh` is NaN, `NaN & 0xfc00` is 0, the function - // returns true - (nextCh & 64512) === 55296); - } - return false; - } - isAbstractConstructorSignature() { - return this.ts_isContextual(tokTypes2.abstract) && this.lookahead().type === tt._new; - } - nextTokenStartSince(pos) { - skipWhiteSpace.lastIndex = pos; - return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; - } - lookaheadCharCode() { - return this.input.charCodeAt(this.nextTokenStart()); - } - compareLookaheadState(state, state2) { - for (const key of Object.keys(state)) { - if (state[key] !== state2[key]) return false; - } - return true; - } - createLookaheadState() { - this.value = null; - this.context = [this.curContext()]; - } - getCurLookaheadState() { - return { - endLoc: this.endLoc, - lastTokEnd: this.lastTokEnd, - lastTokStart: this.lastTokStart, - lastTokStartLoc: this.lastTokStartLoc, - pos: this.pos, - value: this.value, - type: this.type, - start: this.start, - end: this.end, - context: this.context, - startLoc: this.startLoc, - lastTokEndLoc: this.lastTokEndLoc, - curLine: this.curLine, - lineStart: this.lineStart, - curPosition: this.curPosition, - containsEsc: this.containsEsc - }; - } - cloneCurLookaheadState() { - return { - pos: this.pos, - value: this.value, - type: this.type, - start: this.start, - end: this.end, - context: this.context && this.context.slice(), - startLoc: this.startLoc, - lastTokEndLoc: this.lastTokEndLoc, - endLoc: this.endLoc, - lastTokEnd: this.lastTokEnd, - lastTokStart: this.lastTokStart, - lastTokStartLoc: this.lastTokStartLoc, - curLine: this.curLine, - lineStart: this.lineStart, - curPosition: this.curPosition, - containsEsc: this.containsEsc - }; - } - setLookaheadState(state) { - this.pos = state.pos; - this.value = state.value; - this.endLoc = state.endLoc; - this.lastTokEnd = state.lastTokEnd; - this.lastTokStart = state.lastTokStart; - this.lastTokStartLoc = state.lastTokStartLoc; - this.type = state.type; - this.start = state.start; - this.end = state.end; - this.context = state.context; - this.startLoc = state.startLoc; - this.lastTokEndLoc = state.lastTokEndLoc; - this.curLine = state.curLine; - this.lineStart = state.lineStart; - this.curPosition = state.curPosition; - this.containsEsc = state.containsEsc; - } - // Utilities - tsLookAhead(f) { - const state = this.getCurLookaheadState(); - const res = f(); - this.setLookaheadState(state); - return res; - } - lookahead(number) { - const oldState = this.getCurLookaheadState(); - this.createLookaheadState(); - this.isLookahead = true; - if (number !== void 0) { - for (let i = 0; i < number; i++) { - this.nextToken(); - } - } else { - this.nextToken(); - } - this.isLookahead = false; - const curState = this.getCurLookaheadState(); - this.setLookaheadState(oldState); - return curState; - } - readWord() { - let word = this.readWord1(); - let type = tt.name; - if (this.keywords.test(word)) { - type = keywordTypes2[word]; - } else if (new RegExp(keywordsRegExp).test(word)) { - type = tokTypes2[word]; - } - return this.finishToken(type, word); - } - skipBlockComment() { - let startLoc; - if (!this.isLookahead) startLoc = this.options.onComment && this.curPosition(); - let start = this.pos, end = this.input.indexOf("*/", this.pos += 2); - if (end === -1) this.raise(this.pos - 2, "Unterminated comment"); - this.pos = end + 2; - if (this.options.locations) { - for (let nextBreak, pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; ) { - ++this.curLine; - pos = this.lineStart = nextBreak; - } - } - if (this.isLookahead) return; - if (this.options.onComment) { - this.options.onComment( - true, - this.input.slice(start + 2, end), - start, - this.pos, - startLoc, - this.curPosition() - ); - } - } - skipLineComment(startSkip) { - let start = this.pos; - let startLoc; - if (!this.isLookahead) startLoc = this.options.onComment && this.curPosition(); - let ch = this.input.charCodeAt(this.pos += startSkip); - while (this.pos < this.input.length && !isNewLine(ch)) { - ch = this.input.charCodeAt(++this.pos); - } - if (this.isLookahead) return; - if (this.options.onComment) - this.options.onComment( - false, - this.input.slice(start + startSkip, this.pos), - start, - this.pos, - startLoc, - this.curPosition() - ); - } - finishToken(type, val) { - this.preValue = this.value; - this.preToken = this.type; - this.end = this.pos; - if (this.options.locations) this.endLoc = this.curPosition(); - let prevType = this.type; - this.type = type; - this.value = val; - if (!this.isLookahead) { - this.updateContext(prevType); - } - } - resetStartLocation(node, start, startLoc) { - node.start = start; - node.loc.start = startLoc; - if (this.options.ranges) node.range[0] = start; - } - isLineTerminator() { - return this.eat(tt.semi) || super.canInsertSemicolon(); - } - hasFollowingLineBreak() { - skipWhiteSpaceToLineBreak.lastIndex = this.end; - return skipWhiteSpaceToLineBreak.test(this.input); - } - addExtra(node, key, value, enumerable = true) { - if (!node) return; - const extra = node.extra = node.extra || {}; - if (enumerable) { - extra[key] = value; - } else { - Object.defineProperty(extra, key, { enumerable, value }); - } - } - /** - * Test if current token is a literal property name - * https://tc39.es/ecma262/#prod-LiteralPropertyName - * LiteralPropertyName: - * IdentifierName - * StringLiteral - * NumericLiteral - * BigIntLiteral - */ - isLiteralPropertyName() { - return tokenIsLiteralPropertyName(this.type); - } - hasPrecedingLineBreak() { - return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); - } - createIdentifier(node, name) { - node.name = name; - return this.finishNode(node, "Identifier"); - } - /** - * Reset the start location of node to the start location of locationNode - */ - resetStartLocationFromNode(node, locationNode) { - this.resetStartLocation(node, locationNode.start, locationNode.loc.start); - } - // This is used in flow and typescript plugin - // Determine whether a parameter is a this param - isThisParam(param) { - return param.type === "Identifier" && param.name === "this"; - } - isLookaheadContextual(name) { - const next = this.nextTokenStart(); - return this.isUnparsedContextual(next, name); - } - /** - * ts type isContextual - * @param {TokenType} type - * @param {TokenType} token - * @returns {boolean} - * */ - ts_type_isContextual(type, token) { - return type === token && !this.containsEsc; - } - /** - * ts isContextual - * @param {TokenType} token - * @returns {boolean} - * */ - ts_isContextual(token) { - return this.type === token && !this.containsEsc; - } - ts_isContextualWithState(state, token) { - return state.type === token && !state.containsEsc; - } - isContextualWithState(keyword, state) { - return state.type === tt.name && state.value === keyword && !state.containsEsc; - } - tsIsStartOfMappedType() { - this.next(); - if (this.eat(tt.plusMin)) { - return this.ts_isContextual(tokTypes2.readonly); - } - if (this.ts_isContextual(tokTypes2.readonly)) { - this.next(); - } - if (!this.match(tt.bracketL)) { - return false; - } - this.next(); - if (!this.tsIsIdentifier()) { - return false; - } - this.next(); - return this.match(tt._in); - } - tsInDisallowConditionalTypesContext(cb) { - const oldInDisallowConditionalTypesContext = this.inDisallowConditionalTypesContext; - this.inDisallowConditionalTypesContext = true; - try { - return cb(); - } finally { - this.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - } - } - tsTryParseType() { - return this.tsEatThenParseType(tt.colon); - } - /** - * Whether current token matches given type - * - * @param {TokenType} type - * @returns {boolean} - * @memberof Tokenizer - */ - match(type) { - return this.type === type; - } - matchJsx(type) { - return this.type === acornTypeScript.tokTypes[type]; - } - ts_eatWithState(type, nextCount, state) { - const targetType = state.type; - if (type === targetType) { - for (let i = 0; i < nextCount; i++) { - this.next(); - } - return true; - } else { - return false; - } - } - ts_eatContextualWithState(name, nextCount, state) { - if (keywordsRegExp.test(name)) { - if (this.ts_isContextualWithState(state, tokTypes2[name])) { - for (let i = 0; i < nextCount; i++) { - this.next(); - } - return true; - } - return false; - } else { - if (!this.isContextualWithState(name, state)) return false; - for (let i = 0; i < nextCount; i++) { - this.next(); - } - return true; - } - } - canHaveLeadingDecorator() { - return this.match(tt._class) || this.isAbstractClass(); - } - eatContextual(name) { - if (keywordsRegExp.test(name)) { - if (this.ts_isContextual(tokTypes2[name])) { - this.next(); - return true; - } - return false; - } else { - return super.eatContextual(name); - } - } - tsIsExternalModuleReference() { - return this.isContextual("require") && this.lookaheadCharCode() === 40; - } - tsParseExternalModuleReference() { - const node = this.startNode(); - this.expectContextual("require"); - this.expect(tt.parenL); - if (!this.match(tt.string)) { - this.unexpected(); - } - node.expression = this.parseExprAtom(); - this.expect(tt.parenR); - return this.finishNode(node, "TSExternalModuleReference"); - } - tsParseEntityName(allowReservedWords = true) { - let entity = this.parseIdent(allowReservedWords); - while (this.eat(tt.dot)) { - const node = this.startNodeAtNode(entity); - node.left = entity; - node.right = this.parseIdent(allowReservedWords); - entity = this.finishNode(node, "TSQualifiedName"); - } - return entity; - } - tsParseEnumMember() { - const node = this.startNode(); - node.id = this.match(tt.string) ? this.parseLiteral(this.value) : this.parseIdent( - /* liberal */ - true - ); - if (this.eat(tt.eq)) { - node.initializer = this.parseMaybeAssign(); - } - return this.finishNode(node, "TSEnumMember"); - } - tsParseEnumDeclaration(node, properties = {}) { - if (properties.const) node.const = true; - if (properties.declare) node.declare = true; - this.expectContextual("enum"); - node.id = this.parseIdent(); - this.checkLValSimple(node.id); - this.expect(tt.braceL); - node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); - this.expect(tt.braceR); - return this.finishNode(node, "TSEnumDeclaration"); - } - tsParseModuleBlock() { - const node = this.startNode(); - this.enterScope(TS_SCOPE_OTHER); - this.expect(tt.braceL); - node.body = []; - while (this.type !== tt.braceR) { - let stmt = this.parseStatement(null, true); - node.body.push(stmt); - } - this.next(); - super.exitScope(); - return this.finishNode(node, "TSModuleBlock"); - } - tsParseAmbientExternalModuleDeclaration(node) { - if (this.ts_isContextual(tokTypes2.global)) { - node.global = true; - node.id = this.parseIdent(); - } else if (this.match(tt.string)) { - node.id = this.parseLiteral(this.value); - } else { - this.unexpected(); - } - if (this.match(tt.braceL)) { - this.enterScope(TS_SCOPE_TS_MODULE); - node.body = this.tsParseModuleBlock(); - super.exitScope(); - } else { - super.semicolon(); - } - return this.finishNode(node, "TSModuleDeclaration"); - } - tsTryParseDeclare(nany) { - if (this.isLineTerminator()) { - return; - } - let starttype = this.type; - let kind; - if (this.isContextual("let")) { - starttype = tt._var; - kind = "let"; - } - return this.tsInAmbientContext(() => { - if (starttype === tt._function) { - nany.declare = true; - return this.parseFunctionStatement( - nany, - /* async */ - false, - /* declarationPosition */ - true - ); - } - if (starttype === tt._class) { - nany.declare = true; - return this.parseClass(nany, true); - } - if (starttype === tokTypes2.enum) { - return this.tsParseEnumDeclaration(nany, { declare: true }); - } - if (starttype === tokTypes2.global) { - return this.tsParseAmbientExternalModuleDeclaration(nany); - } - if (starttype === tt._const || starttype === tt._var) { - if (!this.match(tt._const) || !this.isLookaheadContextual("enum")) { - nany.declare = true; - return this.parseVarStatement(nany, kind || this.value, true); - } - this.expect(tt._const); - return this.tsParseEnumDeclaration(nany, { - const: true, - declare: true - }); - } - if (starttype === tokTypes2.interface) { - const result = this.tsParseInterfaceDeclaration(nany, { - declare: true - }); - if (result) return result; - } - if (tokenIsIdentifier(starttype)) { - return this.tsParseDeclaration( - nany, - this.value, - /* next */ - true - ); - } - }); - } - tsIsListTerminator(kind) { - switch (kind) { - case "EnumMembers": - case "TypeMembers": - return this.match(tt.braceR); - case "HeritageClauseElement": - return this.match(tt.braceL); - case "TupleElementTypes": - return this.match(tt.bracketR); - case "TypeParametersOrArguments": - return this.tsMatchRightRelational(); - } - } - /** - * If !expectSuccess, returns undefined instead of failing to parse. - * If expectSuccess, parseElement should always return a defined value. - */ - tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { - const result = []; - let trailingCommaPos = -1; - for (; ; ) { - if (this.tsIsListTerminator(kind)) { - break; - } - trailingCommaPos = -1; - const element = parseElement(); - if (element == null) { - return void 0; - } - result.push(element); - if (this.eat(tt.comma)) { - trailingCommaPos = this.lastTokStart; - continue; - } - if (this.tsIsListTerminator(kind)) { - break; - } - if (expectSuccess) { - this.expect(tt.comma); - } - return void 0; - } - if (refTrailingCommaPos) { - refTrailingCommaPos.value = trailingCommaPos; - } - return result; - } - tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { - return nonNull( - this.tsParseDelimitedListWorker( - kind, - parseElement, - /* expectSuccess */ - true, - refTrailingCommaPos - ) - ); - } - tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { - if (!skipFirstToken) { - if (bracket) { - this.expect(tt.bracketL); - } else { - this.expect(tt.relational); - } - } - const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); - if (bracket) { - this.expect(tt.bracketR); - } else { - this.expect(tt.relational); - } - return result; - } - tsParseTypeParameterName() { - const typeName = this.parseIdent(); - return typeName.name; - } - tsEatThenParseType(token) { - return !this.match(token) ? void 0 : this.tsNextThenParseType(); - } - tsExpectThenParseType(token) { - return this.tsDoThenParseType(() => this.expect(token)); - } - tsNextThenParseType() { - return this.tsDoThenParseType(() => this.next()); - } - tsDoThenParseType(cb) { - return this.tsInType(() => { - cb(); - return this.tsParseType(); - }); - } - tsSkipParameterStart() { - if (tokenIsIdentifier(this.type) || this.match(tt._this)) { - this.next(); - return true; - } - if (this.match(tt.braceL)) { - try { - this.parseObj(true); - return true; - } catch { - return false; - } - } - if (this.match(tt.bracketL)) { - this.next(); - try { - this.parseBindingList(tt.bracketR, true, true); - return true; - } catch { - return false; - } - } - return false; - } - tsIsUnambiguouslyStartOfFunctionType() { - this.next(); - if (this.match(tt.parenR) || this.match(tt.ellipsis)) { - return true; - } - if (this.tsSkipParameterStart()) { - if (this.match(tt.colon) || this.match(tt.comma) || this.match(tt.question) || this.match(tt.eq)) { - return true; - } - if (this.match(tt.parenR)) { - this.next(); - if (this.match(tt.arrow)) { - return true; - } - } - } - return false; - } - tsIsStartOfFunctionType() { - if (this.tsMatchLeftRelational()) { - return true; - } - return this.match(tt.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); - } - tsInAllowConditionalTypesContext(cb) { - const oldInDisallowConditionalTypesContext = this.inDisallowConditionalTypesContext; - this.inDisallowConditionalTypesContext = false; - try { - return cb(); - } finally { - this.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - } - } - tsParseBindingListForSignature() { - return super.parseBindingList(tt.parenR, true, true).map((pattern) => { - if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") { - this.raise( - pattern.start, - TypeScriptError.UnsupportedSignatureParameterKind({ type: pattern.type }) - ); - } - return pattern; - }); - } - tsParseTypePredicateAsserts() { - if (this.type !== tokTypes2.asserts) { - return false; - } - const containsEsc = this.containsEsc; - this.next(); - if (!tokenIsIdentifier(this.type) && !this.match(tt._this)) { - return false; - } - if (containsEsc) { - this.raise(this.lastTokStart, "Escape sequence in keyword asserts"); - } - return true; - } - tsParseThisTypeNode() { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "TSThisType"); - } - tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { - this.tsInType(() => { - if (eatColon) this.expect(tt.colon); - t.typeAnnotation = this.tsParseType(); - }); - return this.finishNode(t, "TSTypeAnnotation"); - } - tsParseThisTypePredicate(lhs) { - this.next(); - const node = this.startNodeAtNode(lhs); - node.parameterName = lhs; - node.typeAnnotation = this.tsParseTypeAnnotation( - /* eatColon */ - false - ); - node.asserts = false; - return this.finishNode(node, "TSTypePredicate"); - } - tsParseThisTypeOrThisTypePredicate() { - const thisKeyword = this.tsParseThisTypeNode(); - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - return this.tsParseThisTypePredicate(thisKeyword); - } else { - return thisKeyword; - } - } - tsParseTypePredicatePrefix() { - const id = this.parseIdent(); - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - this.next(); - return id; - } - } - tsParseTypeOrTypePredicateAnnotation(returnToken) { - return this.tsInType(() => { - const t = this.startNode(); - this.expect(returnToken); - const node = this.startNode(); - const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); - if (asserts && this.match(tt._this)) { - let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); - if (thisTypePredicate.type === "TSThisType") { - node.parameterName = thisTypePredicate; - node.asserts = true; - node.typeAnnotation = null; - thisTypePredicate = this.finishNode(node, "TSTypePredicate"); - } else { - this.resetStartLocationFromNode(thisTypePredicate, node); - thisTypePredicate.asserts = true; - } - t.typeAnnotation = thisTypePredicate; - return this.finishNode(t, "TSTypeAnnotation"); - } - const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); - if (!typePredicateVariable) { - if (!asserts) { - return this.tsParseTypeAnnotation( - /* eatColon */ - false, - t - ); - } - node.parameterName = this.parseIdent(); - node.asserts = asserts; - node.typeAnnotation = null; - t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TSTypeAnnotation"); - } - const type = this.tsParseTypeAnnotation( - /* eatColon */ - false - ); - node.parameterName = typePredicateVariable; - node.typeAnnotation = type; - node.asserts = asserts; - t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TSTypeAnnotation"); - }); - } - // Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`, - // but here it's always false, because this is only used for types. - tsFillSignature(returnToken, signature) { - const returnTokenRequired = returnToken === tt.arrow; - const paramsKey = "parameters"; - const returnTypeKey = "typeAnnotation"; - signature.typeParameters = this.tsTryParseTypeParameters(); - this.expect(tt.parenL); - signature[paramsKey] = this.tsParseBindingListForSignature(); - if (returnTokenRequired) { - signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } else if (this.match(returnToken)) { - signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } - } - tsTryNextParseConstantContext() { - if (this.lookahead().type !== tt._const) return null; - this.next(); - const typeReference = this.tsParseTypeReference(); - if (typeReference.typeParameters || typeReference.typeArguments) { - this.raise( - typeReference.typeName.start, - TypeScriptError.CannotFindName({ - name: "const" - }) - ); - } - return typeReference; - } - tsParseFunctionOrConstructorType(type, abstract) { - const node = this.startNode(); - if (type === "TSConstructorType") { - node.abstract = !!abstract; - if (abstract) this.next(); - this.next(); - } - this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(tt.arrow, node)); - return this.finishNode(node, type); - } - tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { - const node = this.startNode(); - const hasLeadingOperator = this.eat(operator); - const types = []; - do { - types.push(parseConstituentType()); - } while (this.eat(operator)); - if (types.length === 1 && !hasLeadingOperator) { - return types[0]; - } - node.types = types; - return this.finishNode(node, kind); - } - tsCheckTypeAnnotationForReadOnly(node) { - switch (node.typeAnnotation.type) { - case "TSTupleType": - case "TSArrayType": - return; - default: - this.raise(node.start, TypeScriptError.UnexpectedReadonly); - } - } - tsParseTypeOperator() { - const node = this.startNode(); - const operator = this.value; - this.next(); - node.operator = operator; - node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); - if (operator === "readonly") { - this.tsCheckTypeAnnotationForReadOnly(node); - } - return this.finishNode(node, "TSTypeOperator"); - } - tsParseConstraintForInferType() { - if (this.eat(tt._extends)) { - const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); - if (this.inDisallowConditionalTypesContext || !this.match(tt.question)) { - return constraint; - } - } - } - tsParseInferType() { - const node = this.startNode(); - this.expectContextual("infer"); - const typeParameter = this.startNode(); - typeParameter.name = this.tsParseTypeParameterName(); - typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); - node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); - return this.finishNode(node, "TSInferType"); - } - tsParseLiteralTypeNode() { - const node = this.startNode(); - node.literal = (() => { - switch (this.type) { - case tt.num: - // we don't need bigint type here - // case tt.bigint: - case tt.string: - case tt._true: - case tt._false: - return this.parseExprAtom(); - default: - this.unexpected(); - } - })(); - return this.finishNode(node, "TSLiteralType"); - } - tsParseImportType() { - const node = this.startNode(); - this.expect(tt._import); - this.expect(tt.parenL); - if (!this.match(tt.string)) { - this.raise(this.start, TypeScriptError.UnsupportedImportTypeArgument); - } - node.argument = this.parseExprAtom(); - this.expect(tt.parenR); - if (this.eat(tt.dot)) { - node.qualifier = this.tsParseEntityName(); - } - if (this.tsMatchLeftRelational()) { - node.typeArguments = this.tsParseTypeArguments(); - } - return this.finishNode(node, "TSImportType"); - } - tsParseTypeQuery() { - const node = this.startNode(); - this.expect(tt._typeof); - if (this.match(tt._import)) { - node.exprName = this.tsParseImportType(); - } else { - node.exprName = this.tsParseEntityName(); - } - if (!this.hasPrecedingLineBreak() && this.tsMatchLeftRelational()) { - node.typeArguments = this.tsParseTypeArguments(); - } - return this.finishNode(node, "TSTypeQuery"); - } - tsParseMappedTypeParameter() { - const node = this.startNode(); - node.name = this.tsParseTypeParameterName(); - node.constraint = this.tsExpectThenParseType(tt._in); - return this.finishNode(node, "TSTypeParameter"); - } - tsParseMappedType() { - const node = this.startNode(); - this.expect(tt.braceL); - if (this.match(tt.plusMin)) { - node.readonly = this.value; - this.next(); - this.expectContextual("readonly"); - } else if (this.eatContextual("readonly")) { - node.readonly = true; - } - this.expect(tt.bracketL); - node.typeParameter = this.tsParseMappedTypeParameter(); - node.nameType = this.eatContextual("as") ? this.tsParseType() : null; - this.expect(tt.bracketR); - if (this.match(tt.plusMin)) { - node.optional = this.value; - this.next(); - this.expect(tt.question); - } else if (this.eat(tt.question)) { - node.optional = true; - } - node.typeAnnotation = this.tsTryParseType(); - this.semicolon(); - this.expect(tt.braceR); - return this.finishNode(node, "TSMappedType"); - } - tsParseTypeLiteral() { - const node = this.startNode(); - node.members = this.tsParseObjectTypeMembers(); - return this.finishNode(node, "TSTypeLiteral"); - } - tsParseTupleElementType() { - const startLoc = this.startLoc; - const startPos = this["start"]; - const rest = this.eat(tt.ellipsis); - let type = this.tsParseType(); - const optional = this.eat(tt.question); - const labeled = this.eat(tt.colon); - if (labeled) { - const labeledNode = this.startNodeAtNode(type); - labeledNode.optional = optional; - if (type.type === "TSTypeReference" && !type.typeArguments && type.typeName.type === "Identifier") { - labeledNode.label = type.typeName; - } else { - this.raise(type.start, TypeScriptError.InvalidTupleMemberLabel); - labeledNode.label = type; - } - labeledNode.elementType = this.tsParseType(); - type = this.finishNode(labeledNode, "TSNamedTupleMember"); - } else if (optional) { - const optionalTypeNode = this.startNodeAtNode(type); - optionalTypeNode.typeAnnotation = type; - type = this.finishNode(optionalTypeNode, "TSOptionalType"); - } - if (rest) { - const restNode = this.startNodeAt(startPos, startLoc); - restNode.typeAnnotation = type; - type = this.finishNode(restNode, "TSRestType"); - } - return type; - } - tsParseTupleType() { - const node = this.startNode(); - node.elementTypes = this.tsParseBracketedList( - "TupleElementTypes", - this.tsParseTupleElementType.bind(this), - /* bracket */ - true, - /* skipFirstToken */ - false - ); - let seenOptionalElement = false; - node.elementTypes.forEach((elementNode) => { - const { type } = elementNode; - if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { - this.raise(elementNode.start, TypeScriptError.OptionalTypeBeforeRequired); - } - seenOptionalElement ||= type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"; - if (type === "TSRestType") { - elementNode = elementNode.typeAnnotation; - } - }); - return this.finishNode(node, "TSTupleType"); - } - tsParseTemplateLiteralType() { - const node = this.startNode(); - node.literal = this.parseTemplate({ isTagged: false }); - return this.finishNode(node, "TSLiteralType"); - } - tsParseTypeReference() { - const node = this.startNode(); - node.typeName = this.tsParseEntityName(); - if (!this.hasPrecedingLineBreak() && this.tsMatchLeftRelational()) { - node.typeArguments = this.tsParseTypeArguments(); - } - return this.finishNode(node, "TSTypeReference"); - } - tsMatchLeftRelational() { - return this.match(tt.relational) && this.value === "<"; - } - tsMatchRightRelational() { - return this.match(tt.relational) && this.value === ">"; - } - tsParseParenthesizedType() { - const node = this.startNode(); - this.expect(tt.parenL); - node.typeAnnotation = this.tsParseType(); - this.expect(tt.parenR); - return this.finishNode(node, "TSParenthesizedType"); - } - tsParseNonArrayType() { - switch (this.type) { - case tt.string: - case tt.num: - // we don't need bigint type here - // case tt.bigint: - case tt._true: - case tt._false: - return this.tsParseLiteralTypeNode(); - case tt.plusMin: - if (this.value === "-") { - const node = this.startNode(); - const nextToken = this.lookahead(); - if (nextToken.type !== tt.num) { - this.unexpected(); - } - node.literal = this.parseMaybeUnary(); - return this.finishNode(node, "TSLiteralType"); - } - break; - case tt._this: - return this.tsParseThisTypeOrThisTypePredicate(); - case tt._typeof: - return this.tsParseTypeQuery(); - case tt._import: - return this.tsParseImportType(); - case tt.braceL: - return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); - case tt.bracketL: - return this.tsParseTupleType(); - case tt.parenL: - return this.tsParseParenthesizedType(); - // parse template string here - case tt.backQuote: - case tt.dollarBraceL: - return this.tsParseTemplateLiteralType(); - default: { - const { type } = this; - if (tokenIsIdentifier(type) || type === tt._void || type === tt._null) { - const nodeType = type === tt._void ? "TSVoidKeyword" : type === tt._null ? "TSNullKeyword" : keywordTypeFromName(this.value); - if (nodeType !== void 0 && this.lookaheadCharCode() !== 46) { - const node = this.startNode(); - this.next(); - return this.finishNode(node, nodeType); - } - return this.tsParseTypeReference(); - } - } - } - this.unexpected(); - } - tsParseArrayTypeOrHigher() { - let type = this.tsParseNonArrayType(); - while (!this.hasPrecedingLineBreak() && this.eat(tt.bracketL)) { - if (this.match(tt.bracketR)) { - const node = this.startNodeAtNode(type); - node.elementType = type; - this.expect(tt.bracketR); - type = this.finishNode(node, "TSArrayType"); - } else { - const node = this.startNodeAtNode(type); - node.objectType = type; - node.indexType = this.tsParseType(); - this.expect(tt.bracketR); - type = this.finishNode(node, "TSIndexedAccessType"); - } - } - return type; - } - tsParseTypeOperatorOrHigher() { - const isTypeOperator = tokenIsTSTypeOperator(this.type) && !this.containsEsc; - return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual("infer") ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); - } - tsParseIntersectionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType( - "TSIntersectionType", - this.tsParseTypeOperatorOrHigher.bind(this), - tt.bitwiseAND - ); - } - tsParseUnionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType( - "TSUnionType", - this.tsParseIntersectionTypeOrHigher.bind(this), - tt.bitwiseOR - ); - } - tsParseNonConditionalType() { - if (this.tsIsStartOfFunctionType()) { - return this.tsParseFunctionOrConstructorType("TSFunctionType"); - } - if (this.match(tt._new)) { - return this.tsParseFunctionOrConstructorType("TSConstructorType"); - } else if (this.isAbstractConstructorSignature()) { - return this.tsParseFunctionOrConstructorType( - "TSConstructorType", - /* abstract */ - true - ); - } - return this.tsParseUnionTypeOrHigher(); - } - /** Be sure to be in a type context before calling this, using `tsInType`. */ - tsParseType() { - assert(this.inType); - const type = this.tsParseNonConditionalType(); - if (this.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(tt._extends)) { - return type; - } - const node = this.startNodeAtNode(type); - node.checkType = type; - node.extendsType = this.tsInDisallowConditionalTypesContext( - () => this.tsParseNonConditionalType() - ); - this.expect(tt.question); - node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); - this.expect(tt.colon); - node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); - return this.finishNode(node, "TSConditionalType"); - } - tsIsUnambiguouslyIndexSignature() { - this.next(); - if (tokenIsIdentifier(this.type)) { - this.next(); - return this.match(tt.colon); - } - return false; - } - /** - * Runs `cb` in a type context. - * This should be called one token *before* the first type token, - * so that the call to `next()` is run in type context. - */ - tsInType(cb) { - const oldInType = this.inType; - this.inType = true; - try { - return cb(); - } finally { - this.inType = oldInType; - } - } - tsTryParseIndexSignature(node) { - if (!(this.match(tt.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { - return void 0; - } - this.expect(tt.bracketL); - const id = this.parseIdent(); - id.typeAnnotation = this.tsParseTypeAnnotation(); - this.resetEndLocation(id); - this.expect(tt.bracketR); - node.parameters = [id]; - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, "TSIndexSignature"); - } - // for better error recover - tsParseNoneModifiers(node) { - this.tsParseModifiers({ - modified: node, - allowedModifiers: [], - disallowedModifiers: ["in", "out"], - errorTemplate: TypeScriptError.InvalidModifierOnTypeParameterPositions - }); - } - tsParseTypeParameter(parseModifiers = this.tsParseNoneModifiers.bind(this)) { - const node = this.startNode(); - parseModifiers(node); - node.name = this.tsParseTypeParameterName(); - node.constraint = this.tsEatThenParseType(tt._extends); - node.default = this.tsEatThenParseType(tt.eq); - return this.finishNode(node, "TSTypeParameter"); - } - tsParseTypeParameters(parseModifiers) { - const node = this.startNode(); - if (this.tsMatchLeftRelational() || this.matchJsx("jsxTagStart")) { - this.next(); - } else { - this.unexpected(); - } - const refTrailingCommaPos = { value: -1 }; - node.params = this.tsParseBracketedList( - "TypeParametersOrArguments", - this.tsParseTypeParameter.bind(this, parseModifiers), - /* bracket */ - false, - /* skipFirstToken */ - true, - refTrailingCommaPos - ); - if (node.params.length === 0) { - this.raise(this.start, TypeScriptError.EmptyTypeParameters); - } - if (refTrailingCommaPos.value !== -1) { - this.addExtra(node, "trailingComma", refTrailingCommaPos.value); - } - return this.finishNode(node, "TSTypeParameterDeclaration"); - } - tsTryParseTypeParameters(parseModifiers) { - if (this.tsMatchLeftRelational()) { - return this.tsParseTypeParameters(parseModifiers); - } - } - tsTryParse(f) { - const state = this.getCurLookaheadState(); - const result = f(); - if (result !== void 0 && result !== false) { - return result; - } else { - this.setLookaheadState(state); - return void 0; - } - } - tsTokenCanFollowModifier() { - return (this.match(tt.bracketL) || this.match(tt.braceL) || this.match(tt.star) || this.match(tt.ellipsis) || this.match(tt.privateId) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); - } - tsNextTokenCanFollowModifier() { - this.next(true); - return this.tsTokenCanFollowModifier(); - } - /** Parses a modifier matching one the given modifier names. */ - tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { - const modifier = this.value; - if (allowedModifiers.indexOf(modifier) !== -1 && !this.containsEsc) { - if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { - return void 0; - } - if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { - return modifier; - } - } - return void 0; - } - tsParseModifiersByMap({ - modified, - map - }) { - for (const key of Object.keys(map)) { - modified[key] = map[key]; - } - } - /** Parses a list of modifiers, in any order. - * If you need a specific order, you must call this function multiple times: - * this.tsParseModifiers({ modified: node, allowedModifiers: ['public'] }); - * this.tsParseModifiers({ modified: node, allowedModifiers: ["abstract", "readonly"] }); - */ - tsParseModifiers({ - modified, - allowedModifiers, - disallowedModifiers, - stopOnStartOfClassStaticBlock, - errorTemplate = TypeScriptError.InvalidModifierOnTypeMember - }) { - const modifiedMap = {}; - const enforceOrder = (loc, modifier, before, after) => { - if (modifier === before && modified[after]) { - this.raise( - loc.column, - TypeScriptError.InvalidModifiersOrder({ orderedModifiers: [before, after] }) - ); - } - }; - const incompatible = (loc, modifier, mod1, mod2) => { - if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { - this.raise( - loc.column, - TypeScriptError.IncompatibleModifiers({ modifiers: [mod1, mod2] }) - ); - } - }; - for (; ; ) { - const startLoc = this.startLoc; - const modifier = this.tsParseModifier( - allowedModifiers.concat(disallowedModifiers ?? []), - stopOnStartOfClassStaticBlock - ); - if (!modifier) break; - if (tsIsAccessModifier(modifier)) { - if (modified.accessibility) { - this.raise(this.start, TypeScriptError.DuplicateAccessibilityModifier()); - } else { - enforceOrder(startLoc, modifier, modifier, "override"); - enforceOrder(startLoc, modifier, modifier, "static"); - enforceOrder(startLoc, modifier, modifier, "readonly"); - enforceOrder(startLoc, modifier, modifier, "accessor"); - modifiedMap.accessibility = modifier; - modified["accessibility"] = modifier; - } - } else if (tsIsVarianceAnnotations(modifier)) { - if (modified[modifier]) { - this.raise(this.start, TypeScriptError.DuplicateModifier({ modifier })); - } else { - enforceOrder(startLoc, modifier, "in", "out"); - modifiedMap[modifier] = modifier; - modified[modifier] = true; - } - } else if (tsIsClassAccessor(modifier)) { - if (modified[modifier]) { - this.raise(this.start, TypeScriptError.DuplicateModifier({ modifier })); - } else { - incompatible(startLoc, modifier, "accessor", "readonly"); - incompatible(startLoc, modifier, "accessor", "static"); - incompatible(startLoc, modifier, "accessor", "override"); - modifiedMap[modifier] = modifier; - modified[modifier] = true; - } - } else if (modifier === "const") { - if (modified[modifier]) { - this.raise(this.start, TypeScriptError.DuplicateModifier({ modifier })); - } else { - modifiedMap[modifier] = modifier; - modified[modifier] = true; - } - } else { - if (Object.hasOwnProperty.call(modified, modifier)) { - this.raise(this.start, TypeScriptError.DuplicateModifier({ modifier })); - } else { - enforceOrder(startLoc, modifier, "static", "readonly"); - enforceOrder(startLoc, modifier, "static", "override"); - enforceOrder(startLoc, modifier, "override", "readonly"); - enforceOrder(startLoc, modifier, "abstract", "override"); - incompatible(startLoc, modifier, "declare", "override"); - incompatible(startLoc, modifier, "static", "abstract"); - modifiedMap[modifier] = modifier; - modified[modifier] = true; - } - } - if (disallowedModifiers?.includes(modifier)) { - this.raise(this.start, errorTemplate); - } - } - return modifiedMap; - } - tsParseInOutModifiers(node) { - this.tsParseModifiers({ - modified: node, - allowedModifiers: ["in", "out"], - disallowedModifiers: [ - "public", - "private", - "protected", - "readonly", - "declare", - "abstract", - "override" - ], - errorTemplate: TypeScriptError.InvalidModifierOnTypeParameter - }); - } - // Handle type assertions - parseMaybeUnary(refExpressionErrors, sawUnary, incDec, forInit) { - if (!options?.jsx && this.tsMatchLeftRelational()) { - return this.tsParseTypeAssertion(); - } else { - return super.parseMaybeUnary(refExpressionErrors, sawUnary, incDec, forInit); - } - } - tsParseTypeAssertion() { - if (disallowAmbiguousJSXLike) { - this.raise(this.start, TypeScriptError.ReservedTypeAssertion); - } - const result = this.tryParse(() => { - const node = this.startNode(); - const _const = this.tsTryNextParseConstantContext(); - node.typeAnnotation = _const || this.tsNextThenParseType(); - this.expect(tt.relational); - node.expression = this.parseMaybeUnary(); - return this.finishNode(node, "TSTypeAssertion"); - }); - if (result.error) { - return this.tsParseTypeParameters(this.tsParseConstModifier); - } else { - return result.node; - } - } - tsParseTypeArguments() { - const node = this.startNode(); - node.params = this.tsInType( - () => ( - // Temporarily remove a JSX parsing context, which makes us scan different tokens. - this.tsInNoContext(() => { - this.expect(tt.relational); - return this.tsParseDelimitedList( - "TypeParametersOrArguments", - this.tsParseType.bind(this) - ); - }) - ) - ); - if (node.params.length === 0) { - this.raise(this.start, TypeScriptError.EmptyTypeArguments); - } - this.exprAllowed = false; - this.expect(tt.relational); - return this.finishNode(node, "TSTypeParameterInstantiation"); - } - tsParseHeritageClause(token) { - const originalStart = this.start; - const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { - const node = this.startNode(); - node.expression = this.tsParseEntityName(); - if (this.tsMatchLeftRelational()) { - node.typeParameters = this.tsParseTypeArguments(); - } - return this.finishNode(node, "TSExpressionWithTypeArguments"); - }); - if (!delimitedList.length) { - this.raise(originalStart, TypeScriptError.EmptyHeritageClauseType({ token })); - } - return delimitedList; - } - tsParseTypeMemberSemicolon() { - if (!this.eat(tt.comma) && !this.isLineTerminator()) { - this.expect(tt.semi); - } - } - tsTryParseAndCatch(f) { - const result = this.tryParse( - (abort) => ( - // @ts-expect-error todo(flow->ts) - f() || abort() - ) - ); - if (result.aborted || !result.node) return void 0; - if (result.error) this.setLookaheadState(result.failState); - return result.node; - } - tsParseSignatureMember(kind, node) { - this.tsFillSignature(tt.colon, node); - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, kind); - } - tsParsePropertyOrMethodSignature(node, readonly) { - if (this.eat(tt.question)) node.optional = true; - const nodeAny = node; - if (this.match(tt.parenL) || this.tsMatchLeftRelational()) { - if (readonly) { - this.raise(node.start, TypeScriptError.ReadonlyForMethodSignature); - } - const method = nodeAny; - if (method.kind && this.tsMatchLeftRelational()) { - this.raise(this.start, TypeScriptError.AccesorCannotHaveTypeParameters); - } - this.tsFillSignature(tt.colon, method); - this.tsParseTypeMemberSemicolon(); - const paramsKey = "parameters"; - const returnTypeKey = "typeAnnotation"; - if (method.kind === "get") { - if (method[paramsKey].length > 0) { - this.raise(this.start, "A 'get' accesor must not have any formal parameters."); - if (this.isThisParam(method[paramsKey][0])) { - this.raise(this.start, TypeScriptError.AccesorCannotDeclareThisParameter); - } - } - } else if (method.kind === "set") { - if (method[paramsKey].length !== 1) { - this.raise(this.start, "A 'get' accesor must not have any formal parameters."); - } else { - const firstParameter = method[paramsKey][0]; - if (this.isThisParam(firstParameter)) { - this.raise(this.start, TypeScriptError.AccesorCannotDeclareThisParameter); - } - if (firstParameter.type === "Identifier" && firstParameter.optional) { - this.raise(this.start, TypeScriptError.SetAccesorCannotHaveOptionalParameter); - } - if (firstParameter.type === "RestElement") { - this.raise(this.start, TypeScriptError.SetAccesorCannotHaveRestParameter); - } - } - if (method[returnTypeKey]) { - this.raise( - method[returnTypeKey].start, - TypeScriptError.SetAccesorCannotHaveReturnType - ); - } - } else { - method.kind = "method"; - } - return this.finishNode(method, "TSMethodSignature"); - } else { - const property = nodeAny; - if (readonly) property.readonly = true; - const type = this.tsTryParseTypeAnnotation(); - if (type) property.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(property, "TSPropertySignature"); - } - } - tsParseTypeMember() { - const node = this.startNode(); - if (this.match(tt.parenL) || this.tsMatchLeftRelational()) { - return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); - } - if (this.match(tt._new)) { - const id = this.startNode(); - this.next(); - if (this.match(tt.parenL) || this.tsMatchLeftRelational()) { - return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); - } else { - node.key = this.createIdentifier(id, "new"); - return this.tsParsePropertyOrMethodSignature(node, false); - } - } - this.tsParseModifiers({ - modified: node, - allowedModifiers: ["readonly"], - disallowedModifiers: [ - "declare", - "abstract", - "private", - "protected", - "public", - "static", - "override" - ] - }); - const idx = this.tsTryParseIndexSignature(node); - if (idx) { - return idx; - } - this.parsePropertyName(node); - if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { - node.kind = node.key.name; - this.parsePropertyName(node); - } - return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); - } - tsParseList(kind, parseElement) { - const result = []; - while (!this.tsIsListTerminator(kind)) { - result.push(parseElement()); - } - return result; - } - tsParseObjectTypeMembers() { - this.expect(tt.braceL); - const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); - this.expect(tt.braceR); - return members; - } - tsParseInterfaceDeclaration(node, properties = {}) { - if (this.hasFollowingLineBreak()) return null; - this.expectContextual("interface"); - if (properties.declare) node.declare = true; - if (tokenIsIdentifier(this.type)) { - node.id = this.parseIdent(); - this.checkLValSimple(node.id, acornScope.BIND_TS_INTERFACE); - } else { - node.id = null; - this.raise(this.start, TypeScriptError.MissingInterfaceName); - } - node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)); - if (this.eat(tt._extends)) { - node.extends = this.tsParseHeritageClause("extends"); - } - const body = this.startNode(); - body.body = this.tsParseInterfaceBody(); - node.body = this.finishNode(body, "TSInterfaceBody"); - return this.finishNode(node, "TSInterfaceDeclaration"); - } - /** - * Parse interface body, ensuring the closing brace is read outside of type context - * so that decorators following the interface are properly tokenized. - */ - tsParseInterfaceBody() { - this.expect(tt.braceL); - const oldInType = this.inType; - this.inType = true; - let members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); - this.inType = oldInType; - this.expect(tt.braceR); - return members; - } - tsParseAbstractDeclaration(node) { - if (this.match(tt._class)) { - node.abstract = true; - return this.parseClass(node, true); - } else if (this.ts_isContextual(tokTypes2.interface)) { - if (!this.hasFollowingLineBreak()) { - node.abstract = true; - return this.tsParseInterfaceDeclaration(node); - } - } else { - this.unexpected(node.start); - } - } - tsIsDeclarationStart() { - return tokenIsTSDeclarationStart(this.type); - } - tsParseExpressionStatement(node, expr) { - switch (expr.name) { - case "declare": { - const declaration = this.tsTryParseDeclare(node); - if (declaration) { - declaration.declare = true; - return declaration; - } - break; - } - case "global": - if (this.match(tt.braceL)) { - this.enterScope(TS_SCOPE_TS_MODULE); - const mod = node; - mod.global = true; - mod.id = expr; - mod.body = this.tsParseModuleBlock(); - super.exitScope(); - return this.finishNode(mod, "TSModuleDeclaration"); - } - break; - default: - return this.tsParseDeclaration( - node, - expr.name, - /* next */ - false - ); - } - } - tsParseModuleReference() { - return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName( - /* allowReservedWords */ - false - ); - } - tsIsExportDefaultSpecifier() { - const { type } = this; - const isAsync = this.isAsyncFunction(); - const isLet = this.isLet(); - if (tokenIsIdentifier(type)) { - if (isAsync && !this.containsEsc || isLet) { - return false; - } - if ((type === tokTypes2.type || type === tokTypes2.interface) && !this.containsEsc) { - const ahead = this.lookahead(); - if (tokenIsIdentifier(ahead.type) && !this.isContextualWithState("from", ahead) || ahead.type === tt.braceL) { - return false; - } - } - } else if (!this.match(tt._default)) { - return false; - } - const next = this.nextTokenStart(); - const hasFrom = this.isUnparsedContextual(next, "from"); - if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.type) && hasFrom) { - return true; - } - if (this.match(tt._default) && hasFrom) { - const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); - return nextAfterFrom === 34 || nextAfterFrom === 39; - } - return false; - } - tsInAmbientContext(cb) { - const oldIsAmbientContext = this.isAmbientContext; - this.isAmbientContext = true; - try { - return cb(); - } finally { - this.isAmbientContext = oldIsAmbientContext; - } - } - tsCheckLineTerminator(next) { - if (next) { - if (this.hasFollowingLineBreak()) return false; - this.next(); - return true; - } - return !this.isLineTerminator(); - } - tsParseModuleOrNamespaceDeclaration(node, nested = false) { - node.id = this.parseIdent(); - if (!nested) { - this.checkLValSimple(node.id, acornScope.BIND_TS_NAMESPACE); - } - if (this.eat(tt.dot)) { - const inner = this.startNode(); - this.tsParseModuleOrNamespaceDeclaration(inner, true); - node.body = inner; - } else { - this.enterScope(TS_SCOPE_TS_MODULE); - node.body = this.tsParseModuleBlock(); - super.exitScope(); - } - return this.finishNode(node, "TSModuleDeclaration"); - } - checkLValSimple(expr, bindingType = acornScope.BIND_NONE, checkClashes) { - if (expr.type === "TSNonNullExpression" || expr.type === "TSAsExpression") { - expr = expr.expression; - } - return super.checkLValSimple(expr, bindingType, checkClashes); - } - tsParseTypeAliasDeclaration(node) { - node.id = this.parseIdent(); - this.checkLValSimple(node.id, acornScope.BIND_TS_TYPE); - node.typeAnnotation = this.tsInType(() => { - node.typeParameters = this.tsTryParseTypeParameters( - this.tsParseInOutModifiers.bind(this) - ); - this.expect(tt.eq); - if (this.ts_isContextual(tokTypes2.interface) && this.lookahead().type !== tt.dot) { - const node2 = this.startNode(); - this.next(); - return this.finishNode(node2, "TSIntrinsicKeyword"); - } - return this.tsParseType(); - }); - this.semicolon(); - return this.finishNode(node, "TSTypeAliasDeclaration"); - } - // Common to tsTryParseDeclare, tsTryParseExportDeclaration, and tsParseExpressionStatement. - tsParseDeclaration(node, value, next) { - switch (value) { - case "abstract": - if (this.tsCheckLineTerminator(next) && (this.match(tt._class) || tokenIsIdentifier(this.type))) { - return this.tsParseAbstractDeclaration(node); - } - break; - case "module": - if (this.tsCheckLineTerminator(next)) { - if (this.match(tt.string)) { - return this.tsParseAmbientExternalModuleDeclaration(node); - } else if (tokenIsIdentifier(this.type)) { - return this.tsParseModuleOrNamespaceDeclaration(node); - } - } - break; - case "namespace": - if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.type)) { - return this.tsParseModuleOrNamespaceDeclaration(node); - } - break; - case "type": - if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.type)) { - return this.tsParseTypeAliasDeclaration(node); - } - break; - } - } - // Note: this won't b·e called unless the keyword is allowed in - // `shouldParseExportDeclaration`. - tsTryParseExportDeclaration() { - return this.tsParseDeclaration( - this.startNode(), - this.value, - /* next */ - true - ); - } - tsParseImportEqualsDeclaration(node, isExport) { - node.isExport = isExport || false; - node.id = this.parseIdent(); - this.checkLValSimple(node.id, acornScope.BIND_LEXICAL); - super.expect(tt.eq); - const moduleReference = this.tsParseModuleReference(); - if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { - this.raise(moduleReference.start, TypeScriptError.ImportAliasHasImportType); - } - node.moduleReference = moduleReference; - super.semicolon(); - return this.finishNode(node, "TSImportEqualsDeclaration"); - } - isExportDefaultSpecifier() { - if (this.tsIsDeclarationStart()) return false; - const { type } = this; - if (tokenIsIdentifier(type)) { - if (this.isContextual("async") || this.isContextual("let")) { - return false; - } - if ((type === tokTypes2.type || type === tokTypes2.interface) && !this.containsEsc) { - const ahead = this.lookahead(); - if (tokenIsIdentifier(ahead.type) && !this.isContextualWithState("from", ahead) || ahead.type === tt.braceL) { - return false; - } - } - } else if (!this.match(tt._default)) { - return false; - } - const next = this.nextTokenStart(); - const hasFrom = this.isUnparsedContextual(next, "from"); - if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.type) && hasFrom) { - return true; - } - if (this.match(tt._default) && hasFrom) { - const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); - return nextAfterFrom === 34 || nextAfterFrom === 39; - } - return false; - } - parseTemplate({ isTagged = false } = {}) { - let node = this.startNode(); - this.next(); - node.expressions = []; - let curElt = this.parseTemplateElement({ isTagged }); - node.quasis = [curElt]; - while (!curElt.tail) { - if (this.type === tt.eof) this.raise(this.pos, "Unterminated template literal"); - this.expect(tt.dollarBraceL); - node.expressions.push(this.inType ? this.tsParseType() : this.parseExpression()); - this.expect(tt.braceR); - node.quasis.push(curElt = this.parseTemplateElement({ isTagged })); - } - this.next(); - return this.finishNode(node, "TemplateLiteral"); - } - parseFunction(node, statement, allowExpressionBody, isAsync, forInit) { - this.initFunction(node); - if (this.ecmaVersion >= 9 || this.ecmaVersion >= 6 && !isAsync) { - if (this.type === tt.star && statement & FUNC_HANGING_STATEMENT) { - this.unexpected(); - } - node.generator = this.eat(tt.star); - } - if (this.ecmaVersion >= 8) { - node.async = !!isAsync; - } - if (statement & FUNC_STATEMENT) { - node.id = statement & FUNC_NULLABLE_ID && this.type !== tt.name ? null : this.parseIdent(); - } - let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - const oldMaybeInArrowParameters = this.maybeInArrowParameters; - this.maybeInArrowParameters = false; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(node.async, node.generator)); - if (!(statement & FUNC_STATEMENT)) { - node.id = this.type === tt.name ? this.parseIdent() : null; - } - this.parseFunctionParams(node); - const isDeclaration = statement & FUNC_STATEMENT; - this.parseFunctionBody(node, allowExpressionBody, false, forInit, { - isFunctionDeclaration: isDeclaration - }); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - if (statement & FUNC_STATEMENT && node.id && !(statement & FUNC_HANGING_STATEMENT)) { - if (node.body) { - this.checkLValSimple( - node.id, - this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? acornScope.BIND_VAR : acornScope.BIND_LEXICAL : acornScope.BIND_FUNCTION - ); - } else { - this.checkLValSimple(node.id, acornScope.BIND_NONE); - } - } - this.maybeInArrowParameters = oldMaybeInArrowParameters; - return this.finishNode(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression"); - } - parseFunctionBody(node, isArrowFunction = false, isMethod = false, forInit = false, tsConfig) { - if (this.match(tt.colon)) { - node.returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon); - } - const bodilessType = tsConfig?.isFunctionDeclaration ? "TSDeclareFunction" : tsConfig?.isClassMethod ? "TSDeclareMethod" : void 0; - if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) { - this.exitScope(); - return this.finishNode(node, bodilessType); - } - if (bodilessType === "TSDeclareFunction" && this.isAmbientContext) { - this.raise(node.start, TypeScriptError.DeclareFunctionHasImplementation); - if (node.declare) { - super.parseFunctionBody(node, isArrowFunction, isMethod, false); - return this.finishNode(node, bodilessType); - } - } - super.parseFunctionBody(node, isArrowFunction, isMethod, forInit); - return node; - } - parseNew() { - if (this.containsEsc) this.raiseRecoverable(this.start, "Escape sequence in keyword new"); - let node = this.startNode(); - let meta = this.parseIdent(true); - if (this.ecmaVersion >= 6 && this.eat(tt.dot)) { - node.meta = meta; - let containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== "target") - this.raiseRecoverable( - node.property.start, - "The only valid meta property for new is 'new.target'" - ); - if (containsEsc) - this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); - if (!this["allowNewDotTarget"]) - this.raiseRecoverable( - node.start, - "'new.target' can only be used in functions and class static block" - ); - return this.finishNode(node, "MetaProperty"); - } - let startPos = this.start, startLoc = this.startLoc, isImport = this.type === tt._import; - node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); - if (isImport && node.callee.type === "ImportExpression") { - this.raise(startPos, "Cannot use new with import()"); - } - const { callee } = node; - if (callee.type === "TSInstantiationExpression" && !callee.extra?.parenthesized) { - node.typeArguments = callee.typeArguments; - node.callee = callee.expression; - } - if (this.eat(tt.parenL)) - node.arguments = this.parseExprList(tt.parenR, this.ecmaVersion >= 8, false); - else node.arguments = []; - return this.finishNode(node, "NewExpression"); - } - parseExprOp(left, leftStartPos, leftStartLoc, minPrec, forInit) { - if (tt._in.binop > minPrec && !this.hasPrecedingLineBreak()) { - let nodeType; - if (this.isContextual("as")) { - nodeType = "TSAsExpression"; - } - if (this.isContextual("satisfies")) { - nodeType = "TSSatisfiesExpression"; - } - if (nodeType) { - const node = this.startNodeAt(leftStartPos, leftStartLoc); - node.expression = left; - const _const = this.tsTryNextParseConstantContext(); - if (_const) { - node.typeAnnotation = _const; - } else { - node.typeAnnotation = this.tsNextThenParseType(); - } - this.finishNode(node, nodeType); - this.reScan_lt_gt(); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); - } - } - return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec, forInit); - } - parseImportSpecifiers() { - let nodes = [], first = true; - if (acornTypeScript.tokenIsIdentifier(this.type)) { - nodes.push(this.parseImportDefaultSpecifier()); - if (!this.eat(tt.comma)) return nodes; - } - if (this.type === tt.star) { - nodes.push(this.parseImportNamespaceSpecifier()); - return nodes; - } - this.expect(tt.braceL); - while (!this.eat(tt.braceR)) { - if (!first) { - this.expect(tt.comma); - if (this.afterTrailingComma(tt.braceR)) break; - } else first = false; - nodes.push(this.parseImportSpecifier()); - } - return nodes; - } - /** - * @param {Node} node this may be ImportDeclaration | - * TsImportEqualsDeclaration - * @returns AnyImport - * */ - parseImport(node) { - let enterHead = this.lookahead(); - node.importKind = "value"; - this.importOrExportOuterKind = "value"; - if (tokenIsIdentifier(enterHead.type) || this.match(tt.star) || this.match(tt.braceL)) { - let ahead = this.lookahead(2); - if ( - // import type, { a } from "b"; - ahead.type !== tt.comma && // import type from "a"; - !this.isContextualWithState("from", ahead) && // import type = require("a"); - ahead.type !== tt.eq && this.ts_eatContextualWithState("type", 1, enterHead) - ) { - this.importOrExportOuterKind = "type"; - node.importKind = "type"; - enterHead = this.lookahead(); - ahead = this.lookahead(2); - } - if (tokenIsIdentifier(enterHead.type) && ahead.type === tt.eq) { - this.next(); - const importNode = this.tsParseImportEqualsDeclaration(node); - this.importOrExportOuterKind = "value"; - return importNode; - } - } - this.next(); - if (this.type === tt.string) { - node.specifiers = []; - node.source = this.parseExprAtom(); - } else { - node.specifiers = this.parseImportSpecifiers(); - this.expectContextual("from"); - node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected(); - } - this.parseMaybeImportAttributes(node); - this.semicolon(); - this.finishNode(node, "ImportDeclaration"); - this.importOrExportOuterKind = "value"; - if (node.importKind === "type" && node.specifiers.length > 1 && node.specifiers[0].type === "ImportDefaultSpecifier") { - this.raise(node.start, TypeScriptError.TypeImportCannotSpecifyDefaultAndNamed); - } - return node; - } - parseExportDefaultDeclaration() { - if (this.isAbstractClass()) { - const cls = this.startNode(); - this.next(); - cls.abstract = true; - return this.parseClass(cls, true); - } - if (this.match(tokTypes2.interface)) { - const result = this.tsParseInterfaceDeclaration(this.startNode()); - if (result) return result; - } - return super.parseExportDefaultDeclaration(); - } - parseExportAllDeclaration(node, exports) { - if (this.ecmaVersion >= 11) { - if (this.eatContextual("as")) { - node.exported = this.parseModuleExportName(); - this.checkExport(exports, node.exported, this.lastTokStart); - } else { - node.exported = null; - } - } - this.expectContextual("from"); - if (this.type !== tt.string) this.unexpected(); - node.source = this.parseExprAtom(); - this.parseMaybeImportAttributes(node); - this.semicolon(); - return this.finishNode(node, "ExportAllDeclaration"); - } - parseDynamicImport(node) { - this.next(); - node.source = this.parseMaybeAssign(); - if (this.eat(tt.comma)) { - const expr = this.parseExpression(); - node.arguments = [expr]; - } - if (!this.eat(tt.parenR)) { - const errorPos = this.start; - if (this.eat(tt.comma) && this.eat(tt.parenR)) { - this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); - } else { - this.unexpected(errorPos); - } - } - return this.finishNode(node, "ImportExpression"); - } - parseExport(node, exports) { - let enterHead = this.lookahead(); - if (this.ts_eatWithState(tt._import, 2, enterHead)) { - if (this.ts_isContextual(tokTypes2.type) && this.lookaheadCharCode() !== 61) { - node.importKind = "type"; - this.importOrExportOuterKind = "type"; - this.next(); - } else { - node.importKind = "value"; - this.importOrExportOuterKind = "value"; - } - const exportEqualsNode = this.tsParseImportEqualsDeclaration( - node, - /* isExport */ - true - ); - this.importOrExportOuterKind = void 0; - return exportEqualsNode; - } else if (this.ts_eatWithState(tt.eq, 2, enterHead)) { - const assign = node; - assign.expression = this.parseExpression(); - this.semicolon(); - this.importOrExportOuterKind = void 0; - return this.finishNode(assign, "TSExportAssignment"); - } else if (this.ts_eatContextualWithState("as", 2, enterHead)) { - const decl = node; - this.expectContextual("namespace"); - decl.id = this.parseIdent(); - this.semicolon(); - this.importOrExportOuterKind = void 0; - return this.finishNode(decl, "TSNamespaceExportDeclaration"); - } else { - const lookahead2 = this.lookahead(2).type; - if (this.ts_isContextualWithState(enterHead, tokTypes2.type) && (lookahead2 === tt.braceL || // export type { ... } - lookahead2 === tt.star)) { - this.next(); - this.importOrExportOuterKind = "type"; - node.exportKind = "type"; - } else { - this.importOrExportOuterKind = "value"; - node.exportKind = "value"; - } - this.next(); - if (this.eat(tt.star)) { - return this.parseExportAllDeclaration(node, exports); - } - if (this.eat(tt._default)) { - this.checkExport(exports, "default", this.lastTokStart); - node.declaration = this.parseExportDefaultDeclaration(); - return this.finishNode(node, "ExportDefaultDeclaration"); - } - if (this.shouldParseExportStatement()) { - node.declaration = this.parseExportDeclaration(node); - if (node.declaration.type === "VariableDeclaration") - this.checkVariableExport(exports, node.declaration.declarations); - else this.checkExport(exports, node.declaration.id, node.declaration.id.start); - node.specifiers = []; - node.source = null; - } else { - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(exports); - if (this.eatContextual("from")) { - if (this.type !== tt.string) this.unexpected(); - node.source = this.parseExprAtom(); - this.parseMaybeImportAttributes(node); - } else { - for (let spec of node.specifiers) { - this.checkUnreserved(spec.local); - this.checkLocalExport(spec.local); - if (spec.local.type === "Literal") { - this.raise( - spec.local.start, - "A string literal cannot be used as an exported binding without `from`." - ); - } - } - node.source = null; - } - this.semicolon(); - } - return this.finishNode(node, "ExportNamedDeclaration"); - } - } - checkExport(exports, name, _) { - if (!exports) { - return; - } - if (typeof name !== "string") { - name = name.type === "Identifier" ? name.name : name.value; - } - exports[name] = true; - } - parseMaybeDefault(startPos, startLoc, left) { - const node = super.parseMaybeDefault(startPos, startLoc, left); - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, TypeScriptError.TypeAnnotationAfterAssign); - } - return node; - } - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation( - node.expression, - node.typeAnnotation.end, - node.typeAnnotation.loc?.end - ); - return node.expression; - } - toAssignableList(exprList, isBinding) { - if (!exprList) exprList = []; - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - if (expr?.type === "TSTypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } - } - return super.toAssignableList(exprList, isBinding); - } - reportReservedArrowTypeParam(node) { - if (node.params.length === 1 && !node.extra?.trailingComma && disallowAmbiguousJSXLike) { - this.raise(node.start, TypeScriptError.ReservedArrowTypeParam); - } - } - parseExprAtom(refDestructuringErrors, forInit, forNew) { - if (this.type === tokTypes2.jsxText) { - return this.jsx_parseText(); - } else if (this.type === tokTypes2.jsxTagStart) { - return this.jsx_parseElement(); - } else if (this.type === tokTypes2.at) { - this.parseDecorators(); - return this.parseExprAtom(); - } else if (tokenIsIdentifier(this.type)) { - let canBeArrow = this.potentialArrowAt === this.start; - let startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; - let id = this.parseIdent(false); - if (this.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(tt._function)) { - this.overrideContext(tokContexts.f_expr); - return this.parseFunction( - this.startNodeAt(startPos, startLoc), - 0, - false, - true, - forInit - ); - } - if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(tt.arrow)) - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - [id], - false, - forInit - ); - if (this.ecmaVersion >= 8 && id.name === "async" && this.type === tt.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { - id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(tt.arrow)) this.unexpected(); - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - [id], - true, - forInit - ); - } - } - return id; - } else { - return super.parseExprAtom(refDestructuringErrors, forInit, forNew); - } - } - parseExprAtomDefault() { - if (tokenIsIdentifier(this.type)) { - const canBeArrow = this["potentialArrowAt"] === this.start; - const containsEsc = this.containsEsc; - const id = this.parseIdent(); - if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { - const { type } = this; - if (type === tt._function) { - this.next(); - return this.parseFunction(this.startNodeAtNode(id), void 0, true, true); - } else if (tokenIsIdentifier(type)) { - if (this.lookaheadCharCode() === 61) { - const paramId = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(tt.arrow)) this.unexpected(); - return this.parseArrowExpression(this.startNodeAtNode(id), [paramId], true); - } else { - return id; - } - } - } - if (canBeArrow && this.match(tt.arrow) && !this.canInsertSemicolon()) { - this.next(); - return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); - } - return id; - } else { - this.unexpected(); - } - } - parseIdentNode() { - let node = this.startNode(); - if (tokenIsKeywordOrIdentifier(this.type) && // Taken from super-class method - !((this.type.keyword === "class" || this.type.keyword === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46))) { - node.name = this.value; - } else { - return super.parseIdentNode(); - } - return node; - } - parseVarStatement(node, kind, allowMissingInitializer = false) { - const { isAmbientContext } = this; - this.next(); - super.parseVar(node, false, kind, allowMissingInitializer || isAmbientContext); - this.semicolon(); - const declaration = this.finishNode(node, "VariableDeclaration"); - if (!isAmbientContext) return declaration; - for (const { id, init } of declaration.declarations) { - if (!init) continue; - if (kind !== "const" || !!id.typeAnnotation) { - this.raise(init.start, TypeScriptError.InitializerNotAllowedInAmbientContext); - } else if (init.type !== "StringLiteral" && init.type !== "BooleanLiteral" && init.type !== "NumericLiteral" && init.type !== "BigIntLiteral" && (init.type !== "TemplateLiteral" || init.expressions.length > 0) && !isPossiblyLiteralEnum(init)) { - this.raise( - init.start, - TypeScriptError.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference - ); - } - } - return declaration; - } - parseStatement(context, topLevel, exports) { - if (this.match(tokTypes2.at)) { - this.parseDecorators(true); - } - if (this.match(tt._const) && this.isLookaheadContextual("enum")) { - const node = this.startNode(); - this.expect(tt._const); - return this.tsParseEnumDeclaration(node, { const: true }); - } - if (this.ts_isContextual(tokTypes2.enum)) { - return this.tsParseEnumDeclaration(this.startNode()); - } - if (this.ts_isContextual(tokTypes2.interface)) { - const result = this.tsParseInterfaceDeclaration(this.startNode()); - if (result) return result; - } - return super.parseStatement(context, topLevel, exports); - } - // NOTE: unused function - parseAccessModifier() { - return this.tsParseModifier(["public", "protected", "private"]); - } - parsePostMemberNameModifiers(methodOrProp) { - const optional = this.eat(tt.question); - if (optional) methodOrProp.optional = true; - if (methodOrProp.readonly && this.match(tt.parenL)) { - this.raise(methodOrProp.start, TypeScriptError.ClassMethodHasReadonly); - } - if (methodOrProp.declare && this.match(tt.parenL)) { - this.raise(methodOrProp.start, TypeScriptError.ClassMethodHasDeclare); - } - } - // Note: The reason we do this in `parseExpressionStatement` and not `parseStatement` - // is that e.g. `type()` is valid JS, so we must try parsing that first. - // If it's really a type, we will parse `type` as the statement, and can correct it here - // by parsing the rest. - parseExpressionStatement(node, expr) { - const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : void 0; - return decl || super.parseExpressionStatement(node, expr); - } - shouldParseExportStatement() { - if (this.tsIsDeclarationStart()) return true; - if (this.match(tokTypes2.at)) { - return true; - } - return super.shouldParseExportStatement(); - } - parseConditional(expr, startPos, startLoc, forInit, refDestructuringErrors) { - if (this.eat(tt.question)) { - let node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(tt.colon); - node.alternate = this.parseMaybeAssign(forInit); - return this.finishNode(node, "ConditionalExpression"); - } - return expr; - } - parseMaybeConditional(forInit, refDestructuringErrors) { - let startPos = this.start, startLoc = this.startLoc; - let expr = this.parseExprOps(forInit, refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) return expr; - if (!this.maybeInArrowParameters || !this.match(tt.question)) { - return this.parseConditional(expr, startPos, startLoc, forInit, refDestructuringErrors); - } - const result = this.tryParse( - () => this.parseConditional(expr, startPos, startLoc, forInit, refDestructuringErrors) - ); - if (!result.node) { - if (result.error) { - this.setOptionalParametersError(refDestructuringErrors, result.error); - } - return expr; - } - if (result.error) this.setLookaheadState(result.failState); - return result.node; - } - parseParenItem(node) { - const startPos = this.start; - const startLoc = this.startLoc; - node = super.parseParenItem(node); - if (this.eat(tt.question)) { - node.optional = true; - this.resetEndLocation(node); - } - if (this.match(tt.colon)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TSTypeCastExpression"); - } - return node; - } - parseExportDeclaration(node) { - if (!this.isAmbientContext && this.ts_isContextual(tokTypes2.declare)) { - return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); - } - const startPos = this.start; - const startLoc = this.startLoc; - const isDeclare = this.eatContextual("declare"); - if (isDeclare && (this.ts_isContextual(tokTypes2.declare) || !this.shouldParseExportStatement())) { - this.raise(this.start, TypeScriptError.ExpectedAmbientAfterExportDeclare); - } - const isIdentifier = tokenIsIdentifier(this.type); - const declaration = isIdentifier && this.tsTryParseExportDeclaration() || this.parseStatement(null); - if (!declaration) return null; - if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { - node.exportKind = "type"; - } - if (isDeclare) { - this.resetStartLocation(declaration, startPos, startLoc); - declaration.declare = true; - } - return declaration; - } - parseClassId(node, isStatement) { - if (!isStatement && this.isContextual("implements")) { - return; - } - super.parseClassId(node, isStatement); - const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)); - if (typeParameters) node.typeParameters = typeParameters; - } - parseClassPropertyAnnotation(node) { - if (!node.optional) { - if (this.value === "!" && this.eat(tt.prefix)) { - node.definite = true; - } else if (this.eat(tt.question)) { - node.optional = true; - } - } - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - } - parseClassField(field) { - const isPrivate = field.key.type === "PrivateIdentifier"; - if (isPrivate) { - if (field.abstract) { - this.raise(field.start, TypeScriptError.PrivateElementHasAbstract); - } - if (field.accessibility) { - this.raise( - field.start, - TypeScriptError.PrivateElementHasAccessibility({ - modifier: field.accessibility - }) - ); - } - this.parseClassPropertyAnnotation(field); - } else { - this.parseClassPropertyAnnotation(field); - if (this.isAmbientContext && !(field.readonly && !field.typeAnnotation) && this.match(tt.eq)) { - this.raise(this.start, TypeScriptError.DeclareClassFieldHasInitializer); - } - if (field.abstract && this.match(tt.eq)) { - const { key } = field; - this.raise( - this.start, - TypeScriptError.AbstractPropertyHasInitializer({ - propertyName: key.type === "Identifier" && !field.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` - }) - ); - } - } - return super.parseClassField(field); - } - parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper) { - const isConstructor = method.kind === "constructor"; - const isPrivate = method.key.type === "PrivateIdentifier"; - const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); - if (isPrivate) { - if (typeParameters) method.typeParameters = typeParameters; - if (method.accessibility) { - this.raise( - method.start, - TypeScriptError.PrivateMethodsHasAccessibility({ - modifier: method.accessibility - }) - ); - } - } else { - if (typeParameters && isConstructor) { - this.raise(typeParameters.start, TypeScriptError.ConstructorHasTypeParameters); - } - } - const { declare = false, kind } = method; - if (declare && (kind === "get" || kind === "set")) { - this.raise(method.start, TypeScriptError.DeclareAccessor({ kind })); - } - if (typeParameters) method.typeParameters = typeParameters; - const key = method.key; - if (method.kind === "constructor") { - if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); - if (isAsync) this.raise(key.start, "Constructor can't be an async method"); - } else if (method.static && checkKeyName(method, "prototype")) { - this.raise(key.start, "Classes may not have a static property named prototype"); - } - const value = method.value = this.parseMethod( - isGenerator, - isAsync, - allowsDirectSuper, - true, - method - ); - if (method.kind === "get" && value["params"].length !== 0) - this.raiseRecoverable(value.start, "getter should have no params"); - if (method.kind === "set" && value["params"].length !== 1) - this.raiseRecoverable(value.start, "setter should have exactly one param"); - if (method.kind === "set" && value["params"][0].type === "RestElement") - this.raiseRecoverable(value["params"][0].start, "Setter cannot use rest params"); - return this.finishNode(method, "MethodDefinition"); - } - isClassMethod() { - return this.match(tt.relational); - } - parseClassElement(constructorAllowsSuper) { - if (this.eat(tt.semi)) return null; - let node = this.startNode(); - let keyName = ""; - let isGenerator = false; - let isAsync = false; - let kind = "method"; - let isStatic = false; - const modifiers = [ - "declare", - "private", - "public", - "protected", - "accessor", - "override", - "abstract", - "readonly", - "static" - ]; - const modifierMap = this.tsParseModifiers({ - modified: node, - allowedModifiers: modifiers, - disallowedModifiers: ["in", "out"], - stopOnStartOfClassStaticBlock: true, - errorTemplate: TypeScriptError.InvalidModifierOnTypeParameterPositions - }); - isStatic = Boolean(modifierMap.static); - const callParseClassMemberWithIsStatic = () => { - if (this.tsIsStartOfStaticBlocks()) { - this.next(); - this.next(); - if (this.tsHasSomeModifiers(node, modifiers)) { - this.raise(this.start, TypeScriptError.StaticBlockCannotHaveModifier); - } - if (this.ecmaVersion >= 13) { - super.parseClassStaticBlock(node); - return node; - } - } else { - const idx = this.tsTryParseIndexSignature(node); - if (idx) { - if (node.abstract) { - this.raise(node.start, TypeScriptError.IndexSignatureHasAbstract); - } - if (node.accessibility) { - this.raise( - node.start, - TypeScriptError.IndexSignatureHasAccessibility({ - modifier: node.accessibility - }) - ); - } - if (node.declare) { - this.raise(node.start, TypeScriptError.IndexSignatureHasDeclare); - } - if (node.override) { - this.raise(node.start, TypeScriptError.IndexSignatureHasOverride); - } - return idx; - } - if (!this.inAbstractClass && node.abstract) { - this.raise(node.start, TypeScriptError.NonAbstractClassHasAbstractMethod); - } - if (node.override) { - if (!constructorAllowsSuper) { - this.raise(node.start, TypeScriptError.OverrideNotInSubClass); - } - } - node.static = isStatic; - if (isStatic) { - if (!(this.isClassElementNameStart() || this.type === tt.star)) { - keyName = "static"; - } - } - if (!keyName && this.ecmaVersion >= 8 && this.eatContextual("async")) { - if ((this.isClassElementNameStart() || this.type === tt.star) && !this.canInsertSemicolon()) { - isAsync = true; - } else { - keyName = "async"; - } - } - if (!keyName && (this.ecmaVersion >= 9 || !isAsync) && this.eat(tt.star)) { - isGenerator = true; - } - if (!keyName && !isAsync && !isGenerator) { - const lastValue = this.value; - if (this.eatContextual("get") || this.eatContextual("set")) { - if (this.isClassElementNameStart()) { - kind = lastValue; - } else { - keyName = lastValue; - } - } - } - if (keyName) { - node.computed = false; - node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); - node.key.name = keyName; - this.finishNode(node.key, "Identifier"); - } else { - this.parseClassElementName(node); - } - this.parsePostMemberNameModifiers(node); - if (this.isClassMethod() || this.ecmaVersion < 13 || this.type === tt.parenL || kind !== "method" || isGenerator || isAsync) { - const isConstructor = !node.static && checkKeyName(node, "constructor"); - const allowsDirectSuper = isConstructor && constructorAllowsSuper; - if (isConstructor && kind !== "method") - this.raise(node.key.start, "Constructor can't have get/set modifier"); - node.kind = isConstructor ? "constructor" : kind; - this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); - } else { - this.parseClassField(node); - } - return node; - } - }; - if (node.declare) { - this.tsInAmbientContext(callParseClassMemberWithIsStatic); - } else { - callParseClassMemberWithIsStatic(); - } - return node; - } - isClassElementNameStart() { - if (this.tsIsIdentifier()) { - return true; - } - return super.isClassElementNameStart(); - } - parseClassSuper(node) { - super.parseClassSuper(node); - if (node.superClass && (this.tsMatchLeftRelational() || this.match(tt.bitShift))) { - node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); - } - if (this.eatContextual("implements")) { - node.implements = this.tsParseHeritageClause("implements"); - } - } - parseFunctionParams(node) { - const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); - if (typeParameters) node.typeParameters = typeParameters; - super.parseFunctionParams(node); - } - // `let x: number;` - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.value === "!" && this.eat(tt.prefix)) { - decl.definite = true; - } - const type = this.tsTryParseTypeAnnotation(); - if (type) { - decl.id.typeAnnotation = type; - this.resetEndLocation(decl.id); - } - } - // parse the return type of an async arrow function - let foo = (async (): number => {}); - parseArrowExpression(node, params, isAsync, forInit) { - if (this.match(tt.colon)) { - node.returnType = this.tsParseTypeAnnotation(); - } - let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.enterScope(functionFlags(isAsync, false) | acornScope.SCOPE_ARROW); - this.initFunction(node); - const oldMaybeInArrowParameters = this.maybeInArrowParameters; - if (this.ecmaVersion >= 8) node.async = !!isAsync; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.maybeInArrowParameters = true; - node.params = this.toAssignableList(params, true); - this.maybeInArrowParameters = false; - this.parseFunctionBody(node, true, false, forInit); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - this.maybeInArrowParameters = oldMaybeInArrowParameters; - return this.finishNode(node, "ArrowFunctionExpression"); - } - parseMaybeAssignOrigin(forInit, refDestructuringErrors, afterLeftParse) { - if (this.isContextual("yield")) { - if (this.inGenerator) return this.parseYield(forInit); - else this.exprAllowed = false; - } - let ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; - if (refDestructuringErrors) { - oldParenAssign = refDestructuringErrors.parenthesizedAssign; - oldTrailingComma = refDestructuringErrors.trailingComma; - oldDoubleProto = refDestructuringErrors.doubleProto; - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; - } else { - refDestructuringErrors = new DestructuringErrors(); - ownDestructuringErrors = true; - } - let startPos = this.start, startLoc = this.startLoc; - if (this.type === tt.parenL || tokenIsIdentifier(this.type)) { - this.potentialArrowAt = this.start; - this.potentialArrowInForAwait = forInit === "await"; - } - let left = this.parseMaybeConditional(forInit, refDestructuringErrors); - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - if (this.type.isAssign) { - let node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - if (this.type === tt.eq) left = this.toAssignable(left, true, refDestructuringErrors); - if (!ownDestructuringErrors) { - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; - } - if (refDestructuringErrors.shorthandAssign >= left.start) - refDestructuringErrors.shorthandAssign = -1; - if (!this.maybeInArrowParameters) { - if (this.type === tt.eq) this.checkLValPattern(left); - else this.checkLValSimple(left); - } - node.left = left; - this.next(); - node.right = this.parseMaybeAssign(forInit); - if (oldDoubleProto > -1) refDestructuringErrors.doubleProto = oldDoubleProto; - return this.finishNode(node, "AssignmentExpression"); - } else { - if (ownDestructuringErrors) this.checkExpressionErrors(refDestructuringErrors, true); - } - if (oldParenAssign > -1) refDestructuringErrors.parenthesizedAssign = oldParenAssign; - if (oldTrailingComma > -1) refDestructuringErrors.trailingComma = oldTrailingComma; - return left; - } - parseMaybeAssign(forInit, refExpressionErrors, afterLeftParse) { - let state; - let jsx; - let typeCast; - if (options?.jsx && (this.matchJsx("jsxTagStart") || this.tsMatchLeftRelational())) { - state = this.cloneCurLookaheadState(); - jsx = this.tryParse( - () => this.parseMaybeAssignOrigin(forInit, refExpressionErrors, afterLeftParse), - state - ); - if (!jsx.error) return jsx.node; - const context = this.context; - const currentContext = context[context.length - 1]; - const lastCurrentContext = context[context.length - 2]; - if (currentContext === acornTypeScript.tokContexts.tc_oTag && lastCurrentContext === acornTypeScript.tokContexts.tc_expr) { - context.pop(); - context.pop(); - } else if (currentContext === acornTypeScript.tokContexts.tc_oTag || currentContext === acornTypeScript.tokContexts.tc_expr) { - context.pop(); - } - } - if (!jsx?.error && !this.tsMatchLeftRelational()) { - return this.parseMaybeAssignOrigin(forInit, refExpressionErrors, afterLeftParse); - } - if (!state || this.compareLookaheadState(state, this.getCurLookaheadState())) { - state = this.cloneCurLookaheadState(); - } - let typeParameters; - const arrow = this.tryParse((abort) => { - typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); - const expr = this.parseMaybeAssignOrigin(forInit, refExpressionErrors, afterLeftParse); - if (expr.type !== "ArrowFunctionExpression" || expr.extra?.parenthesized) { - abort(); - } - if (typeParameters?.params.length !== 0) { - this.resetStartLocationFromNode(expr, typeParameters); - } - expr.typeParameters = typeParameters; - return expr; - }, state); - if (!arrow.error && !arrow.aborted) { - if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); - return arrow.node; - } - if (!jsx) { - assert(true); - typeCast = this.tryParse( - () => this.parseMaybeAssignOrigin(forInit, refExpressionErrors, afterLeftParse), - state - ); - if (!typeCast.error) return typeCast.node; - } - if (jsx?.node) { - this.setLookaheadState(jsx.failState); - return jsx.node; - } - if (arrow.node) { - this.setLookaheadState(arrow.failState); - if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); - return arrow.node; - } - if (typeCast?.node) { - this.setLookaheadState(typeCast.failState); - return typeCast.node; - } - if (jsx?.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - if (typeCast?.thrown) throw typeCast.error; - throw jsx?.error || arrow.error || typeCast?.error; - } - parseAssignableListItem(allowModifiers) { - const decorators = []; - while (this.match(tokTypes2.at)) { - decorators.push(this.parseDecorator()); - } - const startPos = this.start; - const startLoc = this.startLoc; - let accessibility; - let readonly = false; - let override = false; - if (allowModifiers !== void 0) { - const modified = {}; - this.tsParseModifiers({ - modified, - allowedModifiers: ["public", "private", "protected", "override", "readonly"] - }); - accessibility = modified.accessibility; - override = modified.override; - readonly = modified.readonly; - if (allowModifiers === false && (accessibility || readonly || override)) { - this.raise(startLoc.column, TypeScriptError.UnexpectedParameterModifier); - } - } - const left = this.parseMaybeDefault(startPos, startLoc); - this.parseBindingListItem(left); - const elt = this.parseMaybeDefault(left["start"], left["loc"].start, left); - if (decorators.length) { - elt.decorators = decorators; - } - if (accessibility || readonly || override) { - const pp = this.startNodeAt(startPos, startLoc); - if (accessibility) pp.accessibility = accessibility; - if (readonly) pp.readonly = readonly; - if (override) pp.override = override; - if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { - this.raise(pp.start, TypeScriptError.UnsupportedParameterPropertyKind); - } - pp.parameter = elt; - return this.finishNode(pp, "TSParameterProperty"); - } - return elt; - } - // AssignmentPattern - checkLValInnerPattern(expr, bindingType = acornScope.BIND_NONE, checkClashes) { - switch (expr.type) { - case "TSParameterProperty": - this.checkLValInnerPattern(expr.parameter, bindingType, checkClashes); - break; - default: { - super.checkLValInnerPattern(expr, bindingType, checkClashes); - break; - } - } - } - // Allow type annotations inside of a parameter list. - parseBindingListItem(param) { - if (this.eat(tt.question)) { - if (param.type !== "Identifier" && !this.isAmbientContext && !this.inType) { - this.raise(param.start, TypeScriptError.PatternIsOptional); - } - param.optional = true; - } - const type = this.tsTryParseTypeAnnotation(); - if (type) param.typeAnnotation = type; - this.resetEndLocation(param); - return param; - } - isAssignable(node, isBinding) { - switch (node.type) { - case "TSTypeCastExpression": - return this.isAssignable(node.expression, isBinding); - case "TSParameterProperty": - return true; - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - case "RestElement": - return true; - case "ObjectExpression": { - const last = node.properties.length - 1; - return node.properties.every((prop, i) => { - return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); - }); - } - case "Property": - case "ObjectProperty": - return this.isAssignable(node.value); - case "SpreadElement": - return this.isAssignable(node.argument); - case "ArrayExpression": - return node.elements.every( - (element) => element === null || this.isAssignable(element) - ); - case "AssignmentExpression": - return node.operator === "="; - case "ParenthesizedExpression": - return this.isAssignable(node.expression); - case "MemberExpression": - case "OptionalMemberExpression": - return !isBinding; - default: - return false; - } - } - toAssignable(node, isBinding = false, refDestructuringErrors = new DestructuringErrors()) { - switch (node.type) { - case "ParenthesizedExpression": - return this.toAssignableParenthesizedExpression( - node, - isBinding, - refDestructuringErrors - ); - case "TSAsExpression": - case "TSSatisfiesExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - if (isBinding) { - } else { - this.raise(node.start, TypeScriptError.UnexpectedTypeCastInParameter); - } - return this.toAssignable(node.expression, isBinding, refDestructuringErrors); - case "MemberExpression": - break; - case "AssignmentExpression": - if (!isBinding && node.left.type === "TSTypeCastExpression") { - node.left = this.typeCastToParameter(node.left); - } - return super.toAssignable(node, isBinding, refDestructuringErrors); - case "TSTypeCastExpression": { - return this.typeCastToParameter(node); - } - default: - return super.toAssignable(node, isBinding, refDestructuringErrors); - } - return node; - } - toAssignableParenthesizedExpression(node, isBinding, refDestructuringErrors) { - switch (node.expression.type) { - case "TSAsExpression": - case "TSSatisfiesExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - case "ParenthesizedExpression": - return this.toAssignable(node.expression, isBinding, refDestructuringErrors); - default: - return super.toAssignable(node, isBinding, refDestructuringErrors); - } - } - parseBindingAtom() { - switch (this.type) { - case tt._this: - return this.parseIdent( - /* liberal */ - true - ); - default: - return super.parseBindingAtom(); - } - } - shouldParseArrow(exprList) { - let shouldParseArrowRes; - if (this.match(tt.colon)) { - shouldParseArrowRes = exprList.every((expr) => this.isAssignable(expr, true)); - } else { - shouldParseArrowRes = !this.canInsertSemicolon(); - } - if (shouldParseArrowRes) { - if (this.match(tt.colon)) { - const result = this.tryParse((abort) => { - const returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon); - if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort(); - return returnType; - }); - if (result.aborted) { - this.shouldParseArrowReturnType = void 0; - return false; - } - if (!result.thrown) { - if (result.error) this.setLookaheadState(result.failState); - this.shouldParseArrowReturnType = result.node; - } - } - if (!this.match(tt.arrow)) { - this.shouldParseArrowReturnType = void 0; - return false; - } - return true; - } - this.shouldParseArrowReturnType = void 0; - return shouldParseArrowRes; - } - parseParenArrowList(startPos, startLoc, exprList, forInit) { - const node = this.startNodeAt(startPos, startLoc); - node.returnType = this.shouldParseArrowReturnType; - this.shouldParseArrowReturnType = void 0; - return this.parseArrowExpression(node, exprList, false, forInit); - } - parseParenAndDistinguishExpression(canBeArrow, forInit) { - let startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.ecmaVersion >= 8; - if (this.ecmaVersion >= 6) { - const oldMaybeInArrowParameters = this.maybeInArrowParameters; - this.maybeInArrowParameters = true; - this.next(); - let innerStartPos = this.start, innerStartLoc = this.startLoc; - let exprList = [], first = true, lastIsComma = false; - let refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; - this.yieldPos = 0; - this.awaitPos = 0; - while (this.type !== tt.parenR) { - first ? first = false : this.expect(tt.comma); - if (allowTrailingComma && this.afterTrailingComma(tt.parenR, true)) { - lastIsComma = true; - break; - } else if (this.type === tt.ellipsis) { - spreadStart = this.start; - exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === tt.comma) { - this.raise(this.start, "Comma is not permitted after the rest element"); - } - break; - } else { - exprList.push( - this.parseMaybeAssign(forInit, refDestructuringErrors, this.parseParenItem) - ); - } - } - let innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; - this.expect(tt.parenR); - this.maybeInArrowParameters = oldMaybeInArrowParameters; - if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(tt.arrow)) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - return this.parseParenArrowList(startPos, startLoc, exprList, forInit); - } - if (!exprList.length || lastIsComma) this.unexpected(this.lastTokStart); - if (spreadStart) this.unexpected(spreadStart); - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - } else { - val = this.parseParenExpression(); - } - if (this.options.preserveParens) { - let par = this.startNodeAt(startPos, startLoc); - par.expression = val; - return this.finishNode(par, "ParenthesizedExpression"); - } else { - return val; - } - } - parseTaggedTemplateExpression(base, startPos, startLoc, optionalChainMember) { - const node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate({ isTagged: true }); - if (optionalChainMember) { - this.raise( - startPos, - "Tagged Template Literals are not allowed in optionalChain." - ); - } - return this.finishNode(node, "TaggedTemplateExpression"); - } - shouldParseAsyncArrow() { - if (this.match(tt.colon)) { - const result = this.tryParse((abort) => { - const returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon); - if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort(); - return returnType; - }); - if (result.aborted) { - this.shouldParseAsyncArrowReturnType = void 0; - return false; - } - if (!result.thrown) { - if (result.error) this.setLookaheadState(result.failState); - this.shouldParseAsyncArrowReturnType = result.node; - return !this.canInsertSemicolon() && this.eat(tt.arrow); - } - } else { - return !this.canInsertSemicolon() && this.eat(tt.arrow); - } - } - parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit) { - const arrN = this.startNodeAt(startPos, startLoc); - arrN.returnType = this.shouldParseAsyncArrowReturnType; - this.shouldParseAsyncArrowReturnType = void 0; - return this.parseArrowExpression(arrN, exprList, true, forInit); - } - parseExprList(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { - let elts = [], first = true; - while (!this.eat(close)) { - if (!first) { - this.expect(tt.comma); - if (allowTrailingComma && this.afterTrailingComma(close)) break; - } else first = false; - let elt; - if (allowEmpty && this.type === tt.comma) elt = null; - else if (this.type === tt.ellipsis) { - elt = this.parseSpread(refDestructuringErrors); - if (this.maybeInArrowParameters && this.match(tt.colon)) { - elt.typeAnnotation = this.tsParseTypeAnnotation(); - } - if (refDestructuringErrors && this.type === tt.comma && refDestructuringErrors.trailingComma < 0) - refDestructuringErrors.trailingComma = this.start; - } else { - elt = this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem); - } - elts.push(elt); - } - return elts; - } - parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { - let _optionalChained = optionalChained; - if (!this.hasPrecedingLineBreak() && // NODE: replace bang - this.value === "!" && this.match(tt.prefix)) { - this.exprAllowed = false; - this.next(); - const nonNullExpression = this.startNodeAt(startPos, startLoc); - nonNullExpression.expression = base; - base = this.finishNode(nonNullExpression, "TSNonNullExpression"); - return base; - } - let isOptionalCall = false; - if (this.match(tt.questionDot) && this.lookaheadCharCode() === 60) { - if (noCalls) { - return base; - } - base.optional = true; - _optionalChained = isOptionalCall = true; - this.next(); - } - if (this.tsMatchLeftRelational() || this.match(tt.bitShift)) { - let missingParenErrorLoc; - const result = this.tsTryParseAndCatch(() => { - if (!noCalls && this.atPossibleAsyncArrow(base)) { - const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction( - startPos, - startLoc, - forInit - ); - if (asyncArrowFn) { - base = asyncArrowFn; - return base; - } - } - const typeArguments = this.tsParseTypeArgumentsInExpression(); - if (!typeArguments) return base; - if (isOptionalCall && !this.match(tt.parenL)) { - missingParenErrorLoc = this.curPosition(); - return base; - } - if (tokenIsTemplate(this.type) || this.type === tt.backQuote) { - const result2 = this.parseTaggedTemplateExpression( - base, - startPos, - startLoc, - _optionalChained - ); - result2.typeArguments = typeArguments; - return result2; - } - if (!noCalls && this.eat(tt.parenL)) { - let refDestructuringErrors = new DestructuringErrors(); - const node2 = this.startNodeAt(startPos, startLoc); - node2.callee = base; - node2.arguments = this.parseExprList( - tt.parenR, - this.ecmaVersion >= 8, - false, - refDestructuringErrors - ); - this.tsCheckForInvalidTypeCasts(node2.arguments); - node2.typeArguments = typeArguments; - if (_optionalChained) { - node2.optional = isOptionalCall; - } - this.checkExpressionErrors(refDestructuringErrors, true); - base = this.finishNode(node2, "CallExpression"); - return base; - } - const tokenType = this.type; - if ( - // a>c is not (a)>c, but a<(b>>c) - this.tsMatchRightRelational() || // a>>c is not (a)>>c, but a<(b>>>c) - tokenType === tt.bitShift || // ac is (ac - tokenType !== tt.parenL && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak() - ) { - return; - } - const node = this.startNodeAt(startPos, startLoc); - node.expression = base; - node.typeArguments = typeArguments; - return this.finishNode(node, "TSInstantiationExpression"); - }); - if (missingParenErrorLoc) { - this.unexpected(missingParenErrorLoc); - } - if (result) { - if (result.type === "TSInstantiationExpression" && (this.match(tt.dot) || this.match(tt.questionDot) && this.lookaheadCharCode() !== 40)) { - this.raise( - this.start, - TypeScriptError.InvalidPropertyAccessAfterInstantiationExpression - ); - } - base = result; - return base; - } - } - let optionalSupported = this.ecmaVersion >= 11; - let optional = optionalSupported && this.eat(tt.questionDot); - if (noCalls && optional) - this.raise( - this.lastTokStart, - "Optional chaining cannot appear in the callee of new expressions" - ); - let computed = this.eat(tt.bracketL); - if (computed || optional && this.type !== tt.parenL && this.type !== tt.backQuote || this.eat(tt.dot)) { - let node = this.startNodeAt(startPos, startLoc); - node.object = base; - if (computed) { - node.property = this.parseExpression(); - this.expect(tt.bracketR); - } else if (this.type === tt.privateId && base.type !== "Super") { - node.property = this.parsePrivateIdent(); - } else { - node.property = this.parseIdent(this.options.allowReserved !== "never"); - } - node.computed = !!computed; - if (optionalSupported) { - node.optional = optional; - } - base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(tt.parenL)) { - const oldMaybeInArrowParameters = this.maybeInArrowParameters; - this.maybeInArrowParameters = true; - let refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - let exprList = this.parseExprList( - tt.parenR, - this.ecmaVersion >= 8, - false, - refDestructuringErrors - ); - if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - if (this.awaitIdentPos > 0) - this.raise( - this.awaitIdentPos, - "Cannot use 'await' as identifier inside an async function" - ); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - base = this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit); - } else { - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; - let node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = exprList; - if (optionalSupported) { - node.optional = optional; - } - base = this.finishNode(node, "CallExpression"); - } - this.maybeInArrowParameters = oldMaybeInArrowParameters; - } else if (this.type === tt.backQuote) { - if (optional || _optionalChained) { - this.raise( - this.start, - "Optional chaining cannot appear in the tag of tagged template expressions" - ); - } - let node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate({ isTagged: true }); - base = this.finishNode(node, "TaggedTemplateExpression"); - } - return base; - } - parseGetterSetter(prop) { - prop.kind = prop.key.name; - this.parsePropertyName(prop); - const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); - prop.value = this.parseMethod(false); - if (typeParameters) prop.value.typeParameters = typeParameters; - let paramCount = prop.kind === "get" ? 0 : 1; - const firstParam = prop.value.params[0]; - const hasContextParam = firstParam && this.isThisParam(firstParam); - paramCount = hasContextParam ? paramCount + 1 : paramCount; - if (prop.value.params.length !== paramCount) { - let start = prop.value.start; - if (prop.kind === "get") this.raiseRecoverable(start, "getter should have no params"); - else this.raiseRecoverable(start, "setter should have exactly one param"); - } else { - if (prop.kind === "set" && prop.value.params[0].type === "RestElement") - this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); - } - } - parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { - if (this.tsMatchLeftRelational()) { - if (isPattern) this.unexpected(); - prop.kind = "init"; - prop.method = true; - const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); - prop.value = this.parseMethod(isGenerator, isAsync); - if (typeParameters) prop.value.typeParameters = typeParameters; - return; - } - return super.parsePropertyValue( - prop, - isPattern, - isGenerator, - isAsync, - startPos, - startLoc, - refDestructuringErrors, - containsEsc - ); - } - parseProperty(isPattern, refDestructuringErrors) { - if (!isPattern) { - let decorators = []; - if (this.match(tokTypes2.at)) { - while (this.match(tokTypes2.at)) { - decorators.push(this.parseDecorator()); - } - } - const property = super.parseProperty(isPattern, refDestructuringErrors); - if (property.type === "SpreadElement") { - if (decorators.length) - this.raise(property.start, DecoratorsError.SpreadElementDecorator); - } - if (decorators.length) { - property.decorators = decorators; - decorators = []; - } - return property; - } - return super.parseProperty(isPattern, refDestructuringErrors); - } - parseCatchClauseParam() { - const param = this.parseBindingAtom(); - let simple = param.type === "Identifier"; - this.enterScope(simple ? acornScope.SCOPE_SIMPLE_CATCH : 0); - this.checkLValPattern( - param, - simple ? acornScope.BIND_SIMPLE_CATCH : acornScope.BIND_LEXICAL - ); - const type = this.tsTryParseTypeAnnotation(); - if (type) { - param.typeAnnotation = type; - this.resetEndLocation(param); - } - this.expect(tt.parenR); - return param; - } - parseClass(node, isStatement) { - const oldInAbstractClass = this.inAbstractClass; - this.inAbstractClass = !!node.abstract; - try { - this.next(); - this.takeDecorators(node); - const oldStrict = this.strict; - this.strict = true; - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - const privateNameMap = this.enterClassBody(); - const classBody = this.startNode(); - let hadConstructor = false; - classBody.body = []; - let decorators = []; - this.expect(tt.braceL); - while (this.type !== tt.braceR) { - if (this.match(tokTypes2.at)) { - decorators.push(this.parseDecorator()); - continue; - } - const element = this.parseClassElement(node.superClass !== null); - if (decorators.length) { - element.decorators = decorators; - this.resetStartLocationFromNode(element, decorators[0]); - decorators = []; - } - if (element) { - classBody.body.push(element); - if (element.type === "MethodDefinition" && element.kind === "constructor" && element.value.type === "FunctionExpression") { - if (hadConstructor) { - this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); - } - hadConstructor = true; - if (element.decorators && element.decorators.length > 0) { - this.raise(element.start, DecoratorsError.DecoratorConstructor); - } - } else if (element.key && element.key.type === "PrivateIdentifier" && element.value?.type !== "TSDeclareMethod" && isPrivateNameConflicted(privateNameMap, element)) { - this.raiseRecoverable( - element.key.start, - `Identifier '#${element.key.name}' has already been declared` - ); - } - } - } - this.strict = oldStrict; - this.next(); - if (decorators.length) { - this.raise(this.start, DecoratorsError.TrailingDecorator); - } - node.body = this.finishNode(classBody, "ClassBody"); - this.exitClassBody(); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); - } finally { - this.inAbstractClass = oldInAbstractClass; - } - } - parseClassFunctionParams() { - const typeParameters = this.tsTryParseTypeParameters(); - let params = this.parseBindingList(tt.parenR, false, this.ecmaVersion >= 8, true); - if (typeParameters) params.typeParameters = typeParameters; - return params; - } - parseMethod(isGenerator, isAsync, allowDirectSuper, inClassScope, method) { - let node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.initFunction(node); - if (this.ecmaVersion >= 6) node.generator = isGenerator; - if (this.ecmaVersion >= 8) node.async = !!isAsync; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope( - functionFlags(isAsync, node.generator) | acornScope.SCOPE_SUPER | (allowDirectSuper ? acornScope.SCOPE_DIRECT_SUPER : 0) - ); - this.expect(tt.parenL); - node.params = this.parseClassFunctionParams(); - this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false, true, false, { - isClassMethod: inClassScope - }); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - if (method && method.abstract) { - const hasBody = !!node.body; - if (hasBody) { - const { key } = method; - this.raise( - method.start, - TypeScriptError.AbstractMethodHasImplementation({ - methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` - }) - ); - } - } - return this.finishNode(node, "FunctionExpression"); - } - static parse(input, options2) { - if (options2.locations === false) { - throw new Error(`You have to enable options.locations while using acorn-typescript`); - } else { - options2.locations = true; - } - const parser = new this(options2, input); - if (dts) { - parser.isAmbientContext = true; - } - return parser.parse(); - } - static parseExpressionAt(input, pos, options2) { - if (options2.locations === false) { - throw new Error(`You have to enable options.locations while using acorn-typescript`); - } else { - options2.locations = true; - } - const parser = new this(options2, input, pos); - if (dts) { - parser.isAmbientContext = true; - } - parser.nextToken(); - return parser.parseExpression(); - } - parseImportSpecifier() { - const isMaybeTypeOnly = this.ts_isContextual(tokTypes2.type); - if (isMaybeTypeOnly) { - let node = this.startNode(); - node.imported = this.parseModuleExportName(); - this.parseTypeOnlyImportExportSpecifier( - node, - /* isImport */ - true, - this.importOrExportOuterKind === "type" - ); - return this.finishNode(node, "ImportSpecifier"); - } else { - const node = super.parseImportSpecifier(); - node.importKind = "value"; - return node; - } - } - parseExportSpecifier(exports) { - const isMaybeTypeOnly = this.ts_isContextual(tokTypes2.type); - const isString = this.match(tt.string); - if (!isString && isMaybeTypeOnly) { - let node = this.startNode(); - node.local = this.parseModuleExportName(); - this.parseTypeOnlyImportExportSpecifier( - node, - /* isImport */ - false, - this.importOrExportOuterKind === "type" - ); - this.finishNode(node, "ExportSpecifier"); - this.checkExport(exports, node.exported, node.exported.start); - return node; - } else { - const node = super.parseExportSpecifier(exports); - node.exportKind = "value"; - return node; - } - } - parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { - const leftOfAsKey = isImport ? "imported" : "local"; - const rightOfAsKey = isImport ? "local" : "exported"; - let leftOfAs = node[leftOfAsKey]; - let rightOfAs; - let hasTypeSpecifier = false; - let canParseAsKeyword = true; - const loc = leftOfAs.start; - if (this.isContextual("as")) { - const firstAs = this.parseIdent(); - if (this.isContextual("as")) { - const secondAs = this.parseIdent(); - if (tokenIsKeywordOrIdentifier(this.type)) { - hasTypeSpecifier = true; - leftOfAs = firstAs; - rightOfAs = isImport ? this.parseIdent() : this.parseModuleExportName(); - canParseAsKeyword = false; - } else { - rightOfAs = secondAs; - canParseAsKeyword = false; - } - } else if (tokenIsKeywordOrIdentifier(this.type)) { - canParseAsKeyword = false; - rightOfAs = isImport ? this.parseIdent() : this.parseModuleExportName(); - } else { - hasTypeSpecifier = true; - leftOfAs = firstAs; - } - } else if (tokenIsKeywordOrIdentifier(this.type)) { - hasTypeSpecifier = true; - if (isImport) { - leftOfAs = super.parseIdent(true); - if (!this.isContextual("as")) { - this.checkUnreserved(leftOfAs); - } - } else { - leftOfAs = this.parseModuleExportName(); - } - } - if (hasTypeSpecifier && isInTypeOnlyImportExport) { - this.raise( - loc, - isImport ? TypeScriptError.TypeModifierIsUsedInTypeImports : TypeScriptError.TypeModifierIsUsedInTypeExports - ); - } - node[leftOfAsKey] = leftOfAs; - node[rightOfAsKey] = rightOfAs; - const kindKey = isImport ? "importKind" : "exportKind"; - node[kindKey] = hasTypeSpecifier ? "type" : "value"; - if (canParseAsKeyword && this.eatContextual("as")) { - node[rightOfAsKey] = isImport ? this.parseIdent() : this.parseModuleExportName(); - } - if (!node[rightOfAsKey]) { - node[rightOfAsKey] = this.copyNode(node[leftOfAsKey]); - } - if (isImport) { - this.checkLValSimple(node[rightOfAsKey], acornScope.BIND_LEXICAL); - } - } - raiseCommonCheck(pos, message, recoverable) { - switch (message) { - case "Comma is not permitted after the rest element": { - if (this.isAmbientContext && this.match(tt.comma) && this.lookaheadCharCode() === 41) { - this.next(); - return; - } else { - return super.raise(pos, message); - } - } - } - return recoverable ? super.raiseRecoverable(pos, message) : super.raise(pos, message); - } - raiseRecoverable(pos, message) { - return this.raiseCommonCheck(pos, message, true); - } - raise(pos, message) { - return this.raiseCommonCheck(pos, message, true); - } - updateContext(prevType) { - const { type } = this; - if (type == tt.braceL) { - var curContext = this.curContext(); - if (curContext == tsTokContexts.tc_oTag) this.context.push(tokContexts.b_expr); - else if (curContext == tsTokContexts.tc_expr) this.context.push(tokContexts.b_tmpl); - else super.updateContext(prevType); - this.exprAllowed = true; - } else if (type === tt.slash && prevType === tokTypes2.jsxTagStart) { - this.context.length -= 2; - this.context.push(tsTokContexts.tc_cTag); - this.exprAllowed = false; - } else { - return super.updateContext(prevType); - } - } - // Parses JSX opening tag starting after '<'. - jsx_parseOpeningElementAt(startPos, startLoc) { - let node = this.startNodeAt(startPos, startLoc); - let nodeName = this.jsx_parseElementName(); - if (nodeName) node.name = nodeName; - if (this.match(tt.relational) || this.match(tt.bitShift)) { - const typeArguments = this.tsTryParseAndCatch( - () => this.tsParseTypeArgumentsInExpression() - ); - if (typeArguments) node.typeArguments = typeArguments; - } - node.attributes = []; - while (this.type !== tt.slash && this.type !== tokTypes2.jsxTagEnd) - node.attributes.push(this.jsx_parseAttribute()); - node.selfClosing = this.eat(tt.slash); - this.expect(tokTypes2.jsxTagEnd); - return this.finishNode(node, nodeName ? "JSXOpeningElement" : "JSXOpeningFragment"); - } - enterScope(flags) { - if (flags === TS_SCOPE_TS_MODULE) { - this.importsStack.push([]); - } - super.enterScope(flags); - const scope = super.currentScope(); - scope.types = []; - scope.enums = []; - scope.constEnums = []; - scope.classes = []; - scope.exportOnlyBindings = []; - } - exitScope() { - const scope = super.currentScope(); - if (scope.flags === TS_SCOPE_TS_MODULE) { - this.importsStack.pop(); - } - super.exitScope(); - } - hasImport(name, allowShadow) { - const len = this.importsStack.length; - if (this.importsStack[len - 1].indexOf(name) > -1) { - return true; - } - if (!allowShadow && len > 1) { - for (let i = 0; i < len - 1; i++) { - if (this.importsStack[i].indexOf(name) > -1) return true; - } - } - return false; - } - maybeExportDefined(scope, name) { - if (this.inModule && scope.flags & acornScope.SCOPE_TOP) { - this.undefinedExports.delete(name); - } - } - declareName(name, bindingType, pos) { - if (bindingType & acornScope.BIND_FLAGS_TS_IMPORT) { - if (this.hasImport(name, true)) { - this.raise(pos, `Identifier '${name}' has already been declared.`); - } - this.importsStack[this.importsStack.length - 1].push(name); - return; - } - const scope = this.currentScope(); - if (bindingType & acornScope.BIND_FLAGS_TS_EXPORT_ONLY) { - this.maybeExportDefined(scope, name); - scope.exportOnlyBindings.push(name); - return; - } - if (bindingType === acornScope.BIND_TS_TYPE || bindingType === acornScope.BIND_TS_INTERFACE) { - if (bindingType === acornScope.BIND_TS_TYPE && scope.types.includes(name)) { - this.raise(pos, `type '${name}' has already been declared.`); - } - scope.types.push(name); - } else { - super.declareName(name, bindingType, pos); - } - if (bindingType & acornScope.BIND_FLAGS_TS_ENUM) scope.enums.push(name); - if (bindingType & acornScope.BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name); - if (bindingType & acornScope.BIND_FLAGS_CLASS) scope.classes.push(name); - } - checkLocalExport(id) { - const { name } = id; - if (this.hasImport(name)) return; - const len = this.scopeStack.length; - for (let i = len - 1; i >= 0; i--) { - const scope = this.scopeStack[i]; - if (scope.types.indexOf(name) > -1 || scope.exportOnlyBindings.indexOf(name) > -1) return; - } - super.checkLocalExport(id); - } - } - return TypeScriptParser; - }; -} -export { - tsPlugin -}; diff --git a/frontend/node_modules/@sveltejs/acorn-typescript/package.json b/frontend/node_modules/@sveltejs/acorn-typescript/package.json deleted file mode 100644 index 67536b9..0000000 --- a/frontend/node_modules/@sveltejs/acorn-typescript/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "@sveltejs/acorn-typescript", - "version": "1.0.9", - "description": "Acorn plugin that parses TypeScript", - "type": "module", - "types": "index.d.ts", - "files": [ - "index.js", - "index.d.ts" - ], - "exports": { - ".": { - "types": "./index.d.ts", - "default": "./index.js" - } - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sveltejs/acorn-typescript.git" - }, - "author": "tyrealhu and the Svelte team", - "license": "MIT", - "bugs": { - "url": "https://github.com/sveltejs/acorn-typescript/issues" - }, - "homepage": "https://github.com/sveltejs/acorn-typescript#readme", - "devDependencies": { - "@changesets/cli": "^2.27.11", - "@svitejs/changesets-changelog-github-compact": "^1.1.0", - "acorn": "^8.14.0", - "acorn-jsx": "~5.3.2", - "cross-env": "^7.0.3", - "esbuild": "^0.25.0", - "prettier": "~3.5.2", - "test262": "git+https://github.com/tc39/test262.git#88ebb1e3755198cd08757bca1698effbbf360345", - "test262-parser-runner": "^0.5.0", - "typescript": "^5.7.3", - "vitest": "^3.0.7" - }, - "peerDependencies": { - "acorn": "^8.9.0" - }, - "scripts": { - "build": "esbuild src/index.ts --bundle --format=esm --outfile=index.js --platform=node --external:acorn", - "format": "prettier --write .", - "check": "tsc --noEmit", - "lint": "prettier --check .", - "test": "vitest run", - "test:update": "cross-env UPDATE_SNAPSHOT=true vitest run && pnpm run format", - "test:test262": "pnpm run build && node ./test/run_test262.js", - "changeset:version": "changeset version && git add --all", - "changeset:release": "changeset publish", - "playground": "pnpm build && node ./playground/index.js" - } -} \ No newline at end of file diff --git a/frontend/node_modules/@sveltejs/adapter-static/LICENSE b/frontend/node_modules/@sveltejs/adapter-static/LICENSE deleted file mode 100644 index 22efd0c..0000000 --- a/frontend/node_modules/@sveltejs/adapter-static/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/contributors) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/frontend/node_modules/@sveltejs/adapter-static/README.md b/frontend/node_modules/@sveltejs/adapter-static/README.md deleted file mode 100644 index b612f2a..0000000 --- a/frontend/node_modules/@sveltejs/adapter-static/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# @sveltejs/adapter-static - -[Adapter](https://svelte.dev/docs/kit/adapters) for SvelteKit apps that prerenders your entire site as a collection of static files. It's also possible to create an SPA with it by specifying a fallback page which renders an empty shell. If you'd like to prerender only some pages and not create an SPA for those left out, you will need to use a different adapter together with [the `prerender` option](https://svelte.dev/docs/kit/page-options#prerender). - -## Docs - -[Docs](https://svelte.dev/docs/kit/adapter-static) - -## Changelog - -[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/main/packages/adapter-static/CHANGELOG.md). - -## License - -[MIT](LICENSE) diff --git a/frontend/node_modules/@sveltejs/adapter-static/index.d.ts b/frontend/node_modules/@sveltejs/adapter-static/index.d.ts deleted file mode 100644 index 101e02f..0000000 --- a/frontend/node_modules/@sveltejs/adapter-static/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Adapter } from '@sveltejs/kit'; - -export interface AdapterOptions { - pages?: string; - assets?: string; - fallback?: string; - precompress?: boolean; - strict?: boolean; -} - -export default function plugin(options?: AdapterOptions): Adapter; diff --git a/frontend/node_modules/@sveltejs/adapter-static/index.js b/frontend/node_modules/@sveltejs/adapter-static/index.js deleted file mode 100644 index c2b8730..0000000 --- a/frontend/node_modules/@sveltejs/adapter-static/index.js +++ /dev/null @@ -1,91 +0,0 @@ -import path from 'node:path'; -import { platforms } from './platforms.js'; - -/** @type {import('./index.js').default} */ -export default function (options) { - return { - name: '@sveltejs/adapter-static', - /** @param {import('./internal.js').Builder2_0_0} builder */ - async adapt(builder) { - if (!options?.fallback && builder.config.kit.router?.type !== 'hash') { - const dynamic_routes = builder.routes.filter((route) => route.prerender !== true); - if (dynamic_routes.length > 0 && options?.strict !== false) { - const prefix = path.relative('.', builder.config.kit.files.routes); - const has_param_routes = builder.routes.some((route) => route.id.includes('[')); - const config_option = - has_param_routes || JSON.stringify(builder.config.kit.prerender.entries) !== '["*"]' - ? ` - adjust the \`prerender.entries\` config option ${ - has_param_routes - ? '(routes with parameters are not part of entry points by default)' - : '' - } — see https://svelte.dev/docs/kit/configuration#prerender for more info.` - : ''; - - builder.log.error( - `@sveltejs/adapter-static: all routes must be fully prerenderable, but found the following routes that are dynamic: -${dynamic_routes.map((route) => ` - ${path.posix.join(prefix, route.id)}`).join('\n')} - -You have the following options: - - set the \`fallback\` option — see https://svelte.dev/docs/kit/single-page-apps#usage for more info. - - add \`export const prerender = true\` to your root \`+layout.js/.ts\` or \`+layout.server.js/.ts\` file. This will try to prerender all pages. - - add \`export const prerender = true\` to any \`+server.js/ts\` files that are not fetched by page \`load\` functions. -${config_option} - - pass \`strict: false\` to \`adapter-static\` to ignore this error. Only do this if you are sure you don't need the routes in question in your final app, as they will be unavailable. See https://github.com/sveltejs/kit/tree/main/packages/adapter-static#strict for more info. - -If this doesn't help, you may need to use a different adapter. @sveltejs/adapter-static can only be used for sites that don't need a server for dynamic rendering, and can run on just a static file server. -See https://svelte.dev/docs/kit/page-options#prerender for more details` - ); - throw new Error('Encountered dynamic routes'); - } - } - - const platform = platforms.find((platform) => platform.test()); - - if (platform) { - if (options) { - builder.log.warn( - `Detected ${platform.name}. Please remove adapter-static options to enable zero-config mode` - ); - } else { - builder.log.info(`Detected ${platform.name}, using zero-config mode`); - } - } - - const { - // @ts-ignore - pages = 'build', - assets = pages, - fallback, - precompress - } = options ?? platform?.defaults ?? /** @type {import('./index.js').AdapterOptions} */ ({}); - - builder.rimraf(assets); - builder.rimraf(pages); - - builder.generateEnvModule(); - builder.writeClient(assets); - builder.writePrerendered(pages); - - if (fallback) { - await builder.generateFallback(path.join(pages, fallback)); - } - - if (precompress) { - builder.log.minor('Compressing assets and pages'); - if (pages === assets) { - await builder.compress(assets); - } else { - await Promise.all([builder.compress(assets), builder.compress(pages)]); - } - } - - if (pages === assets) { - builder.log(`Wrote site to "${pages}"`); - } else { - builder.log(`Wrote pages to "${pages}" and assets to "${assets}"`); - } - - if (!options) platform?.done(builder); - } - }; -} diff --git a/frontend/node_modules/@sveltejs/adapter-static/package.json b/frontend/node_modules/@sveltejs/adapter-static/package.json deleted file mode 100644 index 42cc5e5..0000000 --- a/frontend/node_modules/@sveltejs/adapter-static/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "@sveltejs/adapter-static", - "version": "3.0.10", - "description": "Adapter for SvelteKit apps that prerenders your entire site as a collection of static files", - "keywords": [ - "adapter", - "deploy", - "hosting", - "ssg", - "static site generation", - "svelte", - "sveltekit" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/sveltejs/kit.git", - "directory": "packages/adapter-static" - }, - "license": "MIT", - "homepage": "https://svelte.dev/docs/kit/adapter-static", - "type": "module", - "exports": { - ".": { - "types": "./index.d.ts", - "import": "./index.js" - }, - "./package.json": "./package.json" - }, - "types": "index.d.ts", - "files": [ - "index.js", - "index.d.ts", - "platforms.js" - ], - "devDependencies": { - "@playwright/test": "^1.51.1", - "@sveltejs/vite-plugin-svelte": "^6.0.0-next.3", - "@types/node": "^18.19.119", - "sirv": "^3.0.0", - "svelte": "^5.39.3", - "typescript": "^5.3.3", - "vite": "^6.3.5", - "@sveltejs/kit": "^2.43.7" - }, - "peerDependencies": { - "@sveltejs/kit": "^2.0.0" - }, - "scripts": { - "lint": "prettier --check .", - "check": "tsc", - "format": "pnpm lint --write", - "test": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test" - } -} \ No newline at end of file diff --git a/frontend/node_modules/@sveltejs/adapter-static/platforms.js b/frontend/node_modules/@sveltejs/adapter-static/platforms.js deleted file mode 100644 index 6ed4216..0000000 --- a/frontend/node_modules/@sveltejs/adapter-static/platforms.js +++ /dev/null @@ -1,76 +0,0 @@ -import fs from 'node:fs'; -import process from 'node:process'; - -/** - * @typedef {{ - * name: string; - * test: () => boolean; - * defaults: import('./index.js').AdapterOptions; - * done: (builder: import('./internal.js').Builder2_0_0) => void; - * }} - * Platform */ - -// This function is duplicated in adapter-vercel -/** @param {import('./internal.js').Builder2_0_0} builder */ -function static_vercel_config(builder) { - /** @type {any[]} */ - const prerendered_redirects = []; - - /** @type {Record} */ - const overrides = {}; - - for (const [src, redirect] of builder.prerendered.redirects) { - prerendered_redirects.push({ - src, - headers: { - Location: redirect.location - }, - status: redirect.status - }); - } - - for (const [path, page] of builder.prerendered.pages) { - if (path.endsWith('/') && path !== '/') { - prerendered_redirects.push( - { src: path, dest: path.slice(0, -1) }, - { src: path.slice(0, -1), status: 308, headers: { Location: path } } - ); - - overrides[page.file] = { path: path.slice(1, -1) }; - } else { - overrides[page.file] = { path: path.slice(1) }; - } - } - - return { - version: 3, - routes: [ - ...prerendered_redirects, - { - src: `/${builder.getAppPath()}/immutable/.+`, - headers: { - 'cache-control': 'public, immutable, max-age=31536000' - } - }, - { - handle: 'filesystem' - } - ], - overrides - }; -} - -/** @type {Platform[]} */ -export const platforms = [ - { - name: 'Vercel', - test: () => !!process.env.VERCEL, - defaults: { - pages: '.vercel/output/static' - }, - done: (builder) => { - const config = static_vercel_config(builder); - fs.writeFileSync('.vercel/output/config.json', JSON.stringify(config, null, ' ')); - } - } -]; diff --git a/frontend/node_modules/@sveltejs/kit/LICENSE b/frontend/node_modules/@sveltejs/kit/LICENSE deleted file mode 100644 index 22efd0c..0000000 --- a/frontend/node_modules/@sveltejs/kit/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/contributors) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/frontend/node_modules/@sveltejs/kit/README.md b/frontend/node_modules/@sveltejs/kit/README.md deleted file mode 100644 index 372a92e..0000000 --- a/frontend/node_modules/@sveltejs/kit/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# The fastest way to build Svelte apps - -This is the [SvelteKit](https://svelte.dev/docs/kit) framework and CLI. - -The quickest way to get started is via the [sv](https://npmjs.com/package/sv) package: - -```sh -npx sv create my-app -cd my-app -npm install -npm run dev -``` - -See the [documentation](https://svelte.dev/docs/kit) to learn more. - -## Changelog - -[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/main/packages/kit/CHANGELOG.md). diff --git a/frontend/node_modules/@sveltejs/kit/package.json b/frontend/node_modules/@sveltejs/kit/package.json deleted file mode 100644 index f14c3e2..0000000 --- a/frontend/node_modules/@sveltejs/kit/package.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "name": "@sveltejs/kit", - "version": "2.58.0", - "description": "SvelteKit is the fastest way to build Svelte apps", - "keywords": [ - "framework", - "official", - "svelte", - "sveltekit", - "vite" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/sveltejs/kit.git", - "directory": "packages/kit" - }, - "license": "MIT", - "homepage": "https://svelte.dev", - "type": "module", - "dependencies": { - "@standard-schema/spec": "^1.0.0", - "@sveltejs/acorn-typescript": "^1.0.5", - "@types/cookie": "^0.6.0", - "acorn": "^8.14.1", - "cookie": "^0.6.0", - "devalue": "^5.6.4", - "esm-env": "^1.2.2", - "kleur": "^4.1.5", - "magic-string": "^0.30.5", - "mrmime": "^2.0.0", - "set-cookie-parser": "^3.0.0", - "sirv": "^3.0.0" - }, - "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@playwright/test": "^1.59.1", - "@sveltejs/vite-plugin-svelte": "^6.0.0-next.3", - "@types/connect": "^3.4.38", - "@types/node": "^18.19.119", - "@types/set-cookie-parser": "^2.4.7", - "dts-buddy": "^0.7.0", - "rollup": "^4.59.0", - "svelte": "^5.53.12", - "typescript": "^5.3.3", - "vite": "^6.4.2", - "vitest": "^4.0.0" - }, - "peerDependencies": { - "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0", - "@opentelemetry/api": "^1.0.0", - "svelte": "^4.0.0 || ^5.0.0-next.0", - "typescript": "^5.3.3 || ^6.0.0", - "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "@opentelemetry/api": { - "optional": true - }, - "typescript": { - "optional": true - } - }, - "bin": { - "svelte-kit": "svelte-kit.js" - }, - "files": [ - "src", - "!src/**/*.spec.js", - "!src/core/**/fixtures", - "!src/core/**/test", - "types", - "svelte-kit.js" - ], - "imports": { - "#app/paths": { - "browser": "./src/runtime/app/paths/client.js", - "default": "./src/runtime/app/paths/server.js" - } - }, - "exports": { - "./package.json": "./package.json", - ".": { - "types": "./types/index.d.ts", - "import": "./src/exports/index.js" - }, - "./internal": { - "types": "./types/index.d.ts", - "import": "./src/exports/internal/index.js" - }, - "./internal/server": { - "types": "./types/index.d.ts", - "import": "./src/exports/internal/server.js" - }, - "./node": { - "types": "./types/index.d.ts", - "import": "./src/exports/node/index.js" - }, - "./node/polyfills": { - "types": "./types/index.d.ts", - "import": "./src/exports/node/polyfills.js" - }, - "./hooks": { - "types": "./types/index.d.ts", - "import": "./src/exports/hooks/index.js" - }, - "./vite": { - "types": "./types/index.d.ts", - "import": "./src/exports/vite/index.js" - } - }, - "types": "types/index.d.ts", - "engines": { - "node": ">=18.13" - }, - "scripts": { - "lint": "prettier --config ../../.prettierrc --check .", - "check": "tsc && cd ./test/types && tsc", - "check:all": "tsc && pnpm -r --filter=\"./**\" check", - "format": "prettier --config ../../.prettierrc --write .", - "test": "pnpm test:unit && pnpm test:integration", - "test:integration": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test", - "test:cross-platform:dev": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-platform:dev", - "test:cross-platform:build": "pnpm test:unit && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-platform:build", - "test:server-side-route-resolution:dev": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:server-side-route-resolution:dev", - "test:server-side-route-resolution:build": "pnpm test:unit && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:server-side-route-resolution:build", - "test:svelte-async:dev": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:svelte-async:dev", - "test:svelte-async:build": "pnpm test:unit && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:svelte-async:build", - "test:unit:dev": "vitest --config kit.vitest.config.js run", - "test:unit:prod": "NODE_ENV=production vitest --config kit.vitest.config.js run csp.spec.js cookie.spec.js", - "test:unit": "pnpm test:unit:dev && pnpm test:unit:prod", - "generate:version": "node scripts/generate-version.js", - "generate:types": "node scripts/generate-dts.js" - } -} \ No newline at end of file diff --git a/frontend/node_modules/@sveltejs/kit/src/cli.js b/frontend/node_modules/@sveltejs/kit/src/cli.js deleted file mode 100644 index 99024d1..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/cli.js +++ /dev/null @@ -1,95 +0,0 @@ -import fs from 'node:fs'; -import process from 'node:process'; -import { parseArgs } from 'node:util'; -import colors from 'kleur'; -import { load_config } from './core/config/index.js'; -import { coalesce_to_error } from './utils/error.js'; - -/** @param {unknown} e */ -function handle_error(e) { - const error = coalesce_to_error(e); - - if (error.name === 'SyntaxError') throw error; - - console.error(colors.bold().red(`> ${error.message}`)); - if (error.stack) { - console.error(colors.gray(error.stack.split('\n').slice(1).join('\n'))); - } - - process.exit(1); -} - -const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8')); - -const help = ` - Usage: svelte-kit [options] - - Commands: - sync Synchronise generated type definitions - - Options: - --version, -v Show version number - --help, -h Show this help message - - Sync Options: - --mode Specify a mode for loading environment variables (default: development) -`; - -let parsed; -try { - parsed = parseArgs({ - options: { - version: { type: 'boolean', short: 'v' }, - help: { type: 'boolean', short: 'h' }, - mode: { type: 'string', default: 'development' } - }, - allowPositionals: true, - strict: true - }); -} catch (err) { - const error = /** @type {Error} */ (err); - console.error(colors.bold().red(`> ${error.message}`)); - console.log(help); - process.exit(1); -} - -const { values, positionals } = parsed; - -if (values.version) { - console.log(pkg.version); - process.exit(0); -} - -if (values.help) { - console.log(help); - process.exit(0); -} - -const command = positionals[0]; - -if (!command) { - console.log(help); - process.exit(0); -} - -if (command === 'sync') { - const config_files = ['js', 'ts'] - .map((ext) => `svelte.config.${ext}`) - .filter((f) => fs.existsSync(f)); - if (config_files.length === 0) { - console.warn(`Missing Svelte config file in ${process.cwd()} — skipping`); - process.exit(0); - } - - try { - const config = await load_config(); - const sync = await import('./core/sync/sync.js'); - sync.all_types(config, values.mode); - } catch (error) { - handle_error(error); - } -} else { - console.error(colors.bold().red(`> Unknown command: ${command}`)); - console.log(help); - process.exit(1); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/constants.js b/frontend/node_modules/@sveltejs/kit/src/constants.js deleted file mode 100644 index 5a6795f..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/constants.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A fake asset path used in `vite dev` and `vite preview`, so that we can - * serve local assets while verifying that requests are correctly prefixed - */ -export const SVELTE_KIT_ASSETS = '/_svelte_kit_assets'; - -export const GENERATED_COMMENT = '// this file is generated — do not edit it\n'; - -export const ENDPOINT_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS', 'HEAD']; - -export const MUTATIVE_METHODS = ['POST', 'PUT', 'PATCH', 'DELETE']; - -export const PAGE_METHODS = ['GET', 'POST', 'HEAD']; diff --git a/frontend/node_modules/@sveltejs/kit/src/core/adapt/builder.js b/frontend/node_modules/@sveltejs/kit/src/core/adapt/builder.js deleted file mode 100644 index 42ff214..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/adapt/builder.js +++ /dev/null @@ -1,369 +0,0 @@ -/** @import { Builder } from '@sveltejs/kit' */ -/** @import { ResolvedConfig } from 'vite' */ -/** @import { RouteDefinition } from '@sveltejs/kit' */ -/** @import { RouteData, ValidatedConfig, BuildData, ServerMetadata, ServerMetadataRoute, Prerendered, PrerenderMap, Logger, RemoteChunk } from 'types' */ -import colors from 'kleur'; -import { createReadStream, createWriteStream, existsSync, statSync } from 'node:fs'; -import { extname, resolve, join, dirname, relative } from 'node:path'; -import { pipeline } from 'node:stream'; -import { promisify } from 'node:util'; -import zlib from 'node:zlib'; -import { copy, rimraf, mkdirp, posixify } from '../../utils/filesystem.js'; -import { generate_manifest } from '../generate_manifest/index.js'; -import { get_route_segments } from '../../utils/routing.js'; -import { get_env } from '../../exports/vite/utils.js'; -import generate_fallback from '../postbuild/fallback.js'; -import { write } from '../sync/utils.js'; -import { list_files } from '../utils.js'; -import { find_server_assets } from '../generate_manifest/find_server_assets.js'; -import { reserved } from '../env.js'; - -const pipe = promisify(pipeline); -const extensions = ['.html', '.js', '.mjs', '.json', '.css', '.svg', '.xml', '.wasm', '.txt']; - -/** - * Creates the Builder which is passed to adapters for building the application. - * @param {{ - * config: ValidatedConfig; - * build_data: BuildData; - * server_metadata: ServerMetadata; - * route_data: RouteData[]; - * prerendered: Prerendered; - * prerender_map: PrerenderMap; - * log: Logger; - * vite_config: ResolvedConfig; - * remotes: RemoteChunk[] - * }} opts - * @returns {Builder} - */ -export function create_builder({ - config, - build_data, - server_metadata, - route_data, - prerendered, - prerender_map, - log, - vite_config, - remotes -}) { - /** @type {Map} */ - const lookup = new Map(); - - /** - * Rather than exposing the internal `RouteData` type, which is subject to change, - * we expose a stable type that adapters can use to group/filter routes - */ - const routes = route_data.map((route) => { - const { config, methods, page, api } = /** @type {ServerMetadataRoute} */ ( - server_metadata.routes.get(route.id) - ); - - /** @type {RouteDefinition} */ - const facade = { - id: route.id, - api, - page, - segments: get_route_segments(route.id).map((segment) => ({ - dynamic: segment.includes('['), - rest: segment.includes('[...'), - content: segment - })), - pattern: route.pattern, - prerender: prerender_map.get(route.id) ?? false, - methods, - config - }; - - lookup.set(facade, route); - - return facade; - }); - - return { - log, - rimraf, - mkdirp, - copy, - - config, - prerendered, - routes, - - async compress(directory) { - if (!existsSync(directory)) { - return; - } - - const files = list_files(directory, (file) => extensions.includes(extname(file))).map( - (file) => resolve(directory, file) - ); - - await Promise.all( - files.flatMap((file) => [compress_file(file, 'gz'), compress_file(file, 'br')]) - ); - }, - - async createEntries(fn) { - const seen = new Set(); - - for (let i = 0; i < route_data.length; i += 1) { - const route = route_data[i]; - if (prerender_map.get(route.id) === true) continue; - const { id, filter, complete } = fn(routes[i]); - - if (seen.has(id)) continue; - seen.add(id); - - const group = [route]; - - // figure out which lower priority routes should be considered fallbacks - for (let j = i + 1; j < route_data.length; j += 1) { - if (prerender_map.get(routes[j].id) === true) continue; - if (filter(routes[j])) { - group.push(route_data[j]); - } - } - - const filtered = new Set(group); - - // heuristic: if /foo/[bar] is included, /foo/[bar].json should - // also be included, since the page likely needs the endpoint - // TODO is this still necessary, given the new way of doing things? - filtered.forEach((route) => { - if (route.page) { - const endpoint = route_data.find((candidate) => candidate.id === route.id + '.json'); - - if (endpoint) { - filtered.add(endpoint); - } - } - }); - - if (filtered.size > 0) { - await complete({ - generateManifest: ({ relativePath }) => - generate_manifest({ - build_data, - prerendered: [], - relative_path: relativePath, - routes: Array.from(filtered), - remotes - }) - }); - } - } - }, - - findServerAssets(route_data) { - return find_server_assets( - build_data, - route_data.map((route) => /** @type {import('types').RouteData} */ (lookup.get(route))) - ); - }, - - async generateFallback(dest) { - const manifest_path = `${config.kit.outDir}/output/server/manifest-full.js`; - const env = get_env(config.kit.env, vite_config.mode); - - const fallback = await generate_fallback({ - manifest_path, - env: { ...env.private, ...env.public } - }); - - if (existsSync(dest)) { - console.log( - colors - .bold() - .yellow( - `Overwriting ${dest} with fallback page. Consider using a different name for the fallback.` - ) - ); - } - - write(dest, fallback); - }, - - generateEnvModule() { - const dest = `${config.kit.outDir}/output/prerendered/dependencies/${config.kit.appDir}/env.js`; - const env = get_env(config.kit.env, vite_config.mode); - - write(dest, `export const env=${JSON.stringify(env.public)}`); - }, - - generateManifest({ relativePath, routes: subset }) { - return generate_manifest({ - build_data, - prerendered: prerendered.paths, - relative_path: relativePath, - routes: subset - ? subset.map((route) => /** @type {import('types').RouteData} */ (lookup.get(route))) - : route_data.filter((route) => prerender_map.get(route.id) !== true), - remotes - }); - }, - - getBuildDirectory(name) { - return `${config.kit.outDir}/${name}`; - }, - - getClientDirectory() { - return `${config.kit.outDir}/output/client`; - }, - - getServerDirectory() { - return `${config.kit.outDir}/output/server`; - }, - - getAppPath() { - return build_data.app_path; - }, - - writeClient(dest) { - return copy(`${config.kit.outDir}/output/client`, dest, { - // avoid making vite build artefacts public - filter: (basename) => basename !== '.vite' - }); - }, - - writePrerendered(dest) { - const source = `${config.kit.outDir}/output/prerendered`; - - return [ - ...copy(`${source}/pages`, dest), - ...copy(`${source}/dependencies`, dest), - ...copy(`${source}/data`, dest) - ]; - }, - - writeServer(dest) { - return copy(`${config.kit.outDir}/output/server`, dest); - }, - - hasServerInstrumentationFile() { - return existsSync(`${config.kit.outDir}/output/server/instrumentation.server.js`); - }, - - instrument({ - entrypoint, - instrumentation, - start = join(dirname(entrypoint), 'start.js'), - module = { - exports: ['default'] - } - }) { - if (!existsSync(instrumentation)) { - throw new Error( - `Instrumentation file ${instrumentation} not found. This is probably a bug in your adapter.` - ); - } - if (!existsSync(entrypoint)) { - throw new Error( - `Entrypoint file ${entrypoint} not found. This is probably a bug in your adapter.` - ); - } - - copy(entrypoint, start); - if (existsSync(`${entrypoint}.map`)) { - copy(`${entrypoint}.map`, `${start}.map`); - } - - const relative_instrumentation = posixify(relative(dirname(entrypoint), instrumentation)); - const relative_start = posixify(relative(dirname(entrypoint), start)); - - const facade = - 'generateText' in module - ? module.generateText({ - instrumentation: relative_instrumentation, - start: relative_start - }) - : create_instrumentation_facade({ - instrumentation: relative_instrumentation, - start: relative_start, - exports: module.exports - }); - - rimraf(entrypoint); - write(entrypoint, facade); - } - }; -} - -/** - * @param {string} file - * @param {'gz' | 'br'} format - */ -async function compress_file(file, format = 'gz') { - const compress = - format == 'br' - ? zlib.createBrotliCompress({ - params: { - [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT, - [zlib.constants.BROTLI_PARAM_QUALITY]: zlib.constants.BROTLI_MAX_QUALITY, - [zlib.constants.BROTLI_PARAM_SIZE_HINT]: statSync(file).size - } - }) - : zlib.createGzip({ level: zlib.constants.Z_BEST_COMPRESSION }); - - const source = createReadStream(file); - const destination = createWriteStream(`${file}.${format}`); - - await pipe(source, compress, destination); -} - -/** - * Given a list of exports, generate a facade that: - * - Imports the instrumentation file - * - Imports `exports` from the entrypoint (dynamically, if `tla` is true) - * - Re-exports `exports` from the entrypoint - * - * `default` receives special treatment: It will be imported as `default` and exported with `export default`. - * - * @param {{ instrumentation: string; start: string; exports: string[] }} opts - * @returns {string} - */ -function create_instrumentation_facade({ instrumentation, start, exports }) { - const import_instrumentation = `import './${instrumentation}';`; - - let alias_index = 0; - const aliases = new Map(); - - for (const name of exports.filter((name) => reserved.has(name))) { - /* - * you can do evil things like `export { c as class }`. - * in order to import these, you need to alias them, and then un-alias them when re-exporting - * this map will allow us to generate the following: - * import { class as _1 } from 'entrypoint'; - * export { _1 as class }; - */ - let alias = `_${alias_index++}`; - while (exports.includes(alias)) { - alias = `_${alias_index++}`; - } - - aliases.set(name, alias); - } - - const import_statements = []; - const export_statements = []; - - for (const name of exports) { - const alias = aliases.get(name); - if (alias) { - import_statements.push(`${name}: ${alias}`); - export_statements.push(`${alias} as ${name}`); - } else { - import_statements.push(`${name}`); - export_statements.push(`${name}`); - } - } - - const entrypoint_facade = [ - `const { ${import_statements.join(', ')} } = await import('./${start}');`, - export_statements.length > 0 ? `export { ${export_statements.join(', ')} };` : '' - ] - .filter(Boolean) - .join('\n'); - - return `${import_instrumentation}\n${entrypoint_facade}`; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/adapt/index.js b/frontend/node_modules/@sveltejs/kit/src/core/adapt/index.js deleted file mode 100644 index 48d1411..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/adapt/index.js +++ /dev/null @@ -1,44 +0,0 @@ -import colors from 'kleur'; -import { create_builder } from './builder.js'; - -/** - * @param {import('types').ValidatedConfig} config - * @param {import('types').BuildData} build_data - * @param {import('types').ServerMetadata} server_metadata - * @param {import('types').Prerendered} prerendered - * @param {import('types').PrerenderMap} prerender_map - * @param {import('types').Logger} log - * @param {import('types').RemoteChunk[]} remotes - * @param {import('vite').ResolvedConfig} vite_config - */ -export async function adapt( - config, - build_data, - server_metadata, - prerendered, - prerender_map, - log, - remotes, - vite_config -) { - // This is only called when adapter is truthy, so the cast is safe - const { name, adapt } = /** @type {import('@sveltejs/kit').Adapter} */ (config.kit.adapter); - - console.log(colors.bold().cyan(`\n> Using ${name}`)); - - const builder = create_builder({ - config, - build_data, - server_metadata, - route_data: build_data.manifest_data.routes.filter((route) => route.page || route.endpoint), - prerendered, - prerender_map, - log, - remotes, - vite_config - }); - - await adapt(builder); - - log.success('done'); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/config/default-error.html b/frontend/node_modules/@sveltejs/kit/src/core/config/default-error.html deleted file mode 100644 index c322e16..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/config/default-error.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - %sveltekit.error.message% - - - - -
- %sveltekit.status% -
-

%sveltekit.error.message%

-
-
- - diff --git a/frontend/node_modules/@sveltejs/kit/src/core/config/index.js b/frontend/node_modules/@sveltejs/kit/src/core/config/index.js deleted file mode 100644 index 42146a8..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/config/index.js +++ /dev/null @@ -1,175 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import process from 'node:process'; -import * as url from 'node:url'; -import options from './options.js'; -import { resolve_entry } from '../../utils/filesystem.js'; - -/** - * Loads the template (src/app.html by default) and validates that it has the - * required content. - * @param {string} cwd - * @param {import('types').ValidatedConfig} config - */ -export function load_template(cwd, { kit }) { - const { env, files } = kit; - - const relative = path.relative(cwd, files.appTemplate); - - if (!fs.existsSync(files.appTemplate)) { - throw new Error(`${relative} does not exist`); - } - - const contents = fs.readFileSync(files.appTemplate, 'utf8'); - - const expected_tags = ['%sveltekit.head%', '%sveltekit.body%']; - expected_tags.forEach((tag) => { - if (contents.indexOf(tag) === -1) { - throw new Error(`${relative} is missing ${tag}`); - } - }); - - for (const match of contents.matchAll(/%sveltekit\.env\.([^%]+)%/g)) { - if (!match[1].startsWith(env.publicPrefix)) { - throw new Error( - `Environment variables in ${relative} must start with ${env.publicPrefix} (saw %sveltekit.env.${match[1]}%)` - ); - } - } - - return contents; -} - -/** - * Loads the error page (src/error.html by default) if it exists. - * Falls back to a generic error page content. - * @param {import('types').ValidatedConfig} config - */ -export function load_error_page(config) { - let { errorTemplate } = config.kit.files; - - // Don't do this inside resolving the config, because that would mean - // adding/removing error.html isn't detected and would require a restart. - if (!fs.existsSync(config.kit.files.errorTemplate)) { - errorTemplate = url.fileURLToPath(new URL('./default-error.html', import.meta.url)); - } - - return fs.readFileSync(errorTemplate, 'utf-8'); -} - -/** - * Loads and validates Svelte config file - * @param {{ cwd?: string }} options - * @returns {Promise} - */ -export async function load_config({ cwd = process.cwd() } = {}) { - const config_files = ['js', 'ts'] - .map((ext) => path.join(cwd, `svelte.config.${ext}`)) - .filter((f) => fs.existsSync(f)); - - if (config_files.length === 0) { - console.log( - `No Svelte config file found in ${cwd} - using SvelteKit's default configuration without an adapter.` - ); - return process_config({}, { cwd }); - } - const config_file = config_files[0]; - if (config_files.length > 1) { - console.log( - `Found multiple Svelte config files in ${cwd}: ${config_files.map((f) => path.basename(f)).join(', ')}. Using ${path.basename(config_file)}` - ); - } - const config = await import(`${url.pathToFileURL(config_file).href}?ts=${Date.now()}`); - - try { - return process_config(config.default, { cwd }); - } catch (e) { - const error = /** @type {Error} */ (e); - - // redact the stack trace — it's not helpful to users - error.stack = `Could not load ${config_file}: ${error.message}\n`; - throw error; - } -} - -/** - * @param {import('@sveltejs/kit').Config} config - * @returns {import('types').ValidatedConfig} - */ -function process_config(config, { cwd = process.cwd() } = {}) { - const validated = validate_config(config, cwd); - - validated.kit.outDir = path.resolve(cwd, validated.kit.outDir); - - for (const key in validated.kit.files) { - if (key === 'hooks') { - validated.kit.files.hooks.client = path.resolve(cwd, validated.kit.files.hooks.client); - validated.kit.files.hooks.server = path.resolve(cwd, validated.kit.files.hooks.server); - validated.kit.files.hooks.universal = path.resolve(cwd, validated.kit.files.hooks.universal); - } else { - // @ts-expect-error - validated.kit.files[key] = path.resolve(cwd, validated.kit.files[key]); - } - } - - return validated; -} - -/** - * @param {import('@sveltejs/kit').Config} config - * @param {string} [cwd] - * @returns {import('types').ValidatedConfig} - */ -export function validate_config(config, cwd = process.cwd()) { - if (typeof config !== 'object') { - throw new Error( - 'The Svelte config file must have a configuration object as its default export. See https://svelte.dev/docs/kit/configuration' - ); - } - - /** @type {import('types').ValidatedConfig} */ - const validated = options(config, 'config'); - const files = validated.kit.files; - - files.hooks.client ??= path.join(files.src, 'hooks.client'); - files.hooks.server ??= path.join(files.src, 'hooks.server'); - files.hooks.universal ??= path.join(files.src, 'hooks'); - files.lib ??= path.join(files.src, 'lib'); - files.params ??= path.join(files.src, 'params'); - files.routes ??= path.join(files.src, 'routes'); - files.serviceWorker ??= path.join(files.src, 'service-worker'); - files.appTemplate ??= path.join(files.src, 'app.html'); - files.errorTemplate ??= path.join(files.src, 'error.html'); - - if (validated.kit.router.resolution === 'server') { - if (validated.kit.router.type === 'hash') { - throw new Error( - "The `router.resolution` option cannot be 'server' if `router.type` is 'hash'" - ); - } - if (validated.kit.output.bundleStrategy !== 'split') { - throw new Error( - "The `router.resolution` option cannot be 'server' if `output.bundleStrategy` is 'inline' or 'single'" - ); - } - } - - if (validated.kit.csp?.directives?.['require-trusted-types-for']?.includes('script')) { - if (!validated.kit.csp?.directives?.['trusted-types']?.includes('svelte-trusted-html')) { - throw new Error( - "The `csp.directives['trusted-types']` option must include 'svelte-trusted-html'" - ); - } - if ( - validated.kit.serviceWorker?.register && - resolve_entry(path.resolve(cwd, validated.kit.files.serviceWorker)) && - !validated.kit.csp?.directives?.['trusted-types']?.includes('sveltekit-trusted-url') - ) { - throw new Error( - "The `csp.directives['trusted-types']` option must include 'sveltekit-trusted-url' when `serviceWorker.register` is true" - ); - } - } - - return validated; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/config/options.js b/frontend/node_modules/@sveltejs/kit/src/core/config/options.js deleted file mode 100644 index ac30ce4..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/config/options.js +++ /dev/null @@ -1,505 +0,0 @@ -/** @import { Validator } from './types.js' */ - -import process from 'node:process'; -import colors from 'kleur'; -import { supportsTrustedTypes } from '../sync/utils.js'; - -const directives = object({ - 'child-src': string_array(), - 'default-src': string_array(), - 'frame-src': string_array(), - 'worker-src': string_array(), - 'connect-src': string_array(), - 'font-src': string_array(), - 'img-src': string_array(), - 'manifest-src': string_array(), - 'media-src': string_array(), - 'object-src': string_array(), - 'prefetch-src': string_array(), - 'script-src': string_array(), - 'script-src-elem': string_array(), - 'script-src-attr': string_array(), - 'style-src': string_array(), - 'style-src-elem': string_array(), - 'style-src-attr': string_array(), - 'base-uri': string_array(), - sandbox: string_array(), - 'form-action': string_array(), - 'frame-ancestors': string_array(), - 'navigate-to': string_array(), - 'report-uri': string_array(), - 'report-to': string_array(), - 'require-trusted-types-for': validate(undefined, (input, keypath) => { - assert_trusted_types_supported(keypath); - return string_array()(input, keypath); - }), - 'trusted-types': validate(undefined, (input, keypath) => { - assert_trusted_types_supported(keypath); - return string_array()(input, keypath); - }), - 'upgrade-insecure-requests': boolean(false), - 'require-sri-for': string_array(), - 'block-all-mixed-content': boolean(false), - 'plugin-types': string_array(), - referrer: string_array() -}); - -/** @type {Validator} */ -const options = object( - { - extensions: validate(['.svelte'], (input, keypath) => { - if (!Array.isArray(input) || !input.every((page) => typeof page === 'string')) { - throw new Error(`${keypath} must be an array of strings`); - } - - input.forEach((extension) => { - if (extension[0] !== '.') { - throw new Error(`Each member of ${keypath} must start with '.' — saw '${extension}'`); - } - - if (!/^(\.[a-z0-9]+)+$/i.test(extension)) { - throw new Error(`File extensions must be alphanumeric — saw '${extension}'`); - } - }); - - return input; - }), - - kit: object({ - adapter: validate(null, (input, keypath) => { - if (typeof input !== 'object' || !input.adapt) { - let message = `${keypath} should be an object with an "adapt" method`; - - if (Array.isArray(input) || typeof input === 'string') { - // for the early adapter adopters - message += ', rather than the name of an adapter'; - } - - throw new Error(`${message}. See https://svelte.dev/docs/kit/adapters`); - } - - return input; - }), - - alias: validate({}, (input, keypath) => { - if (typeof input !== 'object') { - throw new Error(`${keypath} should be an object`); - } - - for (const key in input) { - assert_string(input[key], `${keypath}.${key}`); - } - - return input; - }), - - appDir: validate('_app', (input, keypath) => { - assert_string(input, keypath); - - if (input) { - if (input.startsWith('/') || input.endsWith('/')) { - throw new Error( - "config.kit.appDir cannot start or end with '/'. See https://svelte.dev/docs/kit/configuration" - ); - } - } else { - throw new Error(`${keypath} cannot be empty`); - } - - return input; - }), - - csp: object({ - mode: list(['auto', 'hash', 'nonce']), - directives, - reportOnly: directives - }), - - csrf: object({ - checkOrigin: deprecate( - boolean(true), - (keypath) => - `\`${keypath}\` has been deprecated in favour of \`csrf.trustedOrigins\`. It will be removed in a future version` - ), - trustedOrigins: string_array([]) - }), - - embedded: boolean(false), - - env: object({ - dir: string(process.cwd()), - publicPrefix: string('PUBLIC_'), - privatePrefix: string('') - }), - - experimental: object({ - tracing: object({ - server: boolean(false) - }), - instrumentation: object({ - server: boolean(false) - }), - remoteFunctions: boolean(false), - forkPreloads: boolean(false), - handleRenderingErrors: boolean(false) - }), - - files: object({ - src: string('src'), - assets: string('static'), - hooks: object({ - client: string(null), - server: string(null), - universal: string(null) - }), - lib: string(null), - params: string(null), - routes: string(null), - serviceWorker: string(null), - appTemplate: string(null), - errorTemplate: string(null) - }), - - inlineStyleThreshold: number(0), - - moduleExtensions: string_array(['.js', '.ts']), - - outDir: string('.svelte-kit'), - - output: object({ - preloadStrategy: list(['modulepreload', 'preload-js', 'preload-mjs']), - bundleStrategy: list(['split', 'single', 'inline']) - }), - - paths: object({ - base: validate('', (input, keypath) => { - assert_string(input, keypath); - - if (input !== '' && (input.endsWith('/') || !input.startsWith('/'))) { - throw new Error( - `${keypath} option must either be the empty string or a root-relative path that starts but doesn't end with '/'. See https://svelte.dev/docs/kit/configuration#paths` - ); - } - - return input; - }), - assets: validate('', (input, keypath) => { - assert_string(input, keypath); - - if (input) { - if (!/^[a-z]+:\/\//.test(input)) { - throw new Error( - `${keypath} option must be an absolute path, if specified. See https://svelte.dev/docs/kit/configuration#paths` - ); - } - - if (input.endsWith('/')) { - throw new Error( - `${keypath} option must not end with '/'. See https://svelte.dev/docs/kit/configuration#paths` - ); - } - } - - return input; - }), - relative: boolean(true) - }), - - prerender: object({ - concurrency: number(1), - crawl: boolean(true), - entries: validate(['*'], (input, keypath) => { - if (!Array.isArray(input) || !input.every((page) => typeof page === 'string')) { - throw new Error(`${keypath} must be an array of strings`); - } - - input.forEach((page) => { - if (page !== '*' && page[0] !== '/') { - throw new Error( - `Each member of ${keypath} must be either '*' or an absolute path beginning with '/' — saw '${page}'` - ); - } - }); - - return input; - }), - - handleHttpError: validate( - (/** @type {any} */ { message }) => { - throw new Error( - message + - '\nTo suppress or handle this error, implement `handleHttpError` in https://svelte.dev/docs/kit/configuration#prerender' - ); - }, - (input, keypath) => { - if (typeof input === 'function') return input; - if (['fail', 'warn', 'ignore'].includes(input)) return input; - throw new Error(`${keypath} should be "fail", "warn", "ignore" or a custom function`); - } - ), - - handleMissingId: validate( - (/** @type {any} */ { message }) => { - throw new Error( - message + - '\nTo suppress or handle this error, implement `handleMissingId` in https://svelte.dev/docs/kit/configuration#prerender' - ); - }, - (input, keypath) => { - if (typeof input === 'function') return input; - if (['fail', 'warn', 'ignore'].includes(input)) return input; - throw new Error(`${keypath} should be "fail", "warn", "ignore" or a custom function`); - } - ), - - handleEntryGeneratorMismatch: validate( - (/** @type {any} */ { message }) => { - throw new Error( - message + - '\nTo suppress or handle this error, implement `handleEntryGeneratorMismatch` in https://svelte.dev/docs/kit/configuration#prerender' - ); - }, - (input, keypath) => { - if (typeof input === 'function') return input; - if (['fail', 'warn', 'ignore'].includes(input)) return input; - throw new Error(`${keypath} should be "fail", "warn", "ignore" or a custom function`); - } - ), - - handleUnseenRoutes: validate( - (/** @type {any} */ { message }) => { - throw new Error( - message + - '\nTo suppress or handle this error, implement `handleUnseenRoutes` in https://svelte.dev/docs/kit/configuration#prerender' - ); - }, - (input, keypath) => { - if (typeof input === 'function') return input; - if (['fail', 'warn', 'ignore'].includes(input)) return input; - throw new Error(`${keypath} should be "fail", "warn", "ignore" or a custom function`); - } - ), - - origin: validate('http://sveltekit-prerender', (input, keypath) => { - assert_string(input, keypath); - - let origin; - - try { - origin = new URL(input).origin; - } catch { - throw new Error(`${keypath} must be a valid origin`); - } - - if (input !== origin) { - throw new Error(`${keypath} must be a valid origin (${origin} rather than ${input})`); - } - - return origin; - }) - }), - - router: object({ - type: list(['pathname', 'hash']), - resolution: list(['client', 'server']) - }), - - serviceWorker: object({ - register: boolean(true), - // options could be undefined but if it is defined we only validate that - // it's an object since the type comes from the browser itself - options: validate(undefined, object({}, true)), - files: fun((filename) => !/\.DS_Store/.test(filename)) - }), - - typescript: object({ - config: fun((config) => config) - }), - - version: object({ - name: string(Date.now().toString()), - pollInterval: number(0) - }) - }) - }, - true -); - -/** - * @param {Validator} fn - * @param {(keypath: string) => string} get_message - * @returns {Validator} - */ -function deprecate( - fn, - get_message = (keypath) => - `The \`${keypath}\` option is deprecated, and will be removed in a future version` -) { - return (input, keypath) => { - if (input !== undefined) { - console.warn(colors.bold().yellow(get_message(keypath))); - } - - return fn(input, keypath); - }; -} - -/** - * @param {Record} children - * @param {boolean} [allow_unknown] - * @returns {Validator} - */ -function object(children, allow_unknown = false) { - return (input, keypath) => { - /** @type {Record} */ - const output = {}; - - if ((input && typeof input !== 'object') || Array.isArray(input)) { - throw new Error(`${keypath} should be an object`); - } - - for (const key in input) { - if (!(key in children)) { - if (allow_unknown) { - output[key] = input[key]; - } else { - let message = `Unexpected option ${keypath}.${key}`; - - // special case - if (keypath === 'config.kit' && key in options) { - message += ` (did you mean config.${key}?)`; - } - - throw new Error(message); - } - } - } - - for (const key in children) { - const validator = children[key]; - output[key] = validator(input && input[key], `${keypath}.${key}`); - } - - return output; - }; -} - -/** - * @param {any} fallback - * @param {(value: any, keypath: string) => any} fn - * @returns {Validator} - */ -function validate(fallback, fn) { - return (input, keypath) => { - return input === undefined ? fallback : fn(input, keypath); - }; -} - -/** - * @param {string | null} fallback - * @param {boolean} allow_empty - * @returns {Validator} - */ -function string(fallback, allow_empty = true) { - return validate(fallback, (input, keypath) => { - assert_string(input, keypath); - - if (!allow_empty && input === '') { - throw new Error(`${keypath} cannot be empty`); - } - - return input; - }); -} - -/** - * @param {string[] | undefined} [fallback] - * @returns {Validator} - */ -function string_array(fallback) { - return validate(fallback, (input, keypath) => { - if (!Array.isArray(input) || input.some((value) => typeof value !== 'string')) { - throw new Error(`${keypath} must be an array of strings, if specified`); - } - - return input; - }); -} - -/** - * @param {number} fallback - * @returns {Validator} - */ -function number(fallback) { - return validate(fallback, (input, keypath) => { - if (typeof input !== 'number') { - throw new Error(`${keypath} should be a number, if specified`); - } - return input; - }); -} - -/** - * @param {boolean} fallback - * @returns {Validator} - */ -function boolean(fallback) { - return validate(fallback, (input, keypath) => { - if (typeof input !== 'boolean') { - throw new Error(`${keypath} should be true or false, if specified`); - } - return input; - }); -} - -/** - * @param {string[]} options - * @returns {Validator} - */ -function list(options, fallback = options[0]) { - return validate(fallback, (input, keypath) => { - if (!options.includes(input)) { - // prettier-ignore - const msg = options.length > 2 - ? `${keypath} should be one of ${options.slice(0, -1).map(input => `"${input}"`).join(', ')} or "${options[options.length - 1]}"` - : `${keypath} should be either "${options[0]}" or "${options[1]}"`; - - throw new Error(msg); - } - return input; - }); -} - -/** - * @param {(...args: any) => any} fallback - * @returns {Validator} - */ -function fun(fallback) { - return validate(fallback, (input, keypath) => { - if (typeof input !== 'function') { - throw new Error(`${keypath} should be a function, if specified`); - } - return input; - }); -} - -/** - * @param {string} input - * @param {string} keypath - */ -function assert_string(input, keypath) { - if (typeof input !== 'string') { - throw new Error(`${keypath} should be a string, if specified`); - } -} - -/** @param {string} keypath */ -function assert_trusted_types_supported(keypath) { - if (!supportsTrustedTypes()) { - throw new Error( - `${keypath} is not supported by your version of Svelte. Please upgrade to Svelte 5.51.0 or later to use this directive.` - ); - } -} - -export default options; diff --git a/frontend/node_modules/@sveltejs/kit/src/core/config/types.d.ts b/frontend/node_modules/@sveltejs/kit/src/core/config/types.d.ts deleted file mode 100644 index 00d005c..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/config/types.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type Validator = (input: T, keypath: string) => T; diff --git a/frontend/node_modules/@sveltejs/kit/src/core/env.js b/frontend/node_modules/@sveltejs/kit/src/core/env.js deleted file mode 100644 index 455eb0f..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/env.js +++ /dev/null @@ -1,152 +0,0 @@ -import { GENERATED_COMMENT } from '../constants.js'; -import { dedent } from './sync/utils.js'; -import { runtime_base } from './utils.js'; - -/** - * @typedef {'public' | 'private'} EnvType - */ - -/** - * @param {string} id - * @param {Record} env - * @returns {string} - */ -export function create_static_module(id, env) { - /** @type {string[]} */ - const declarations = []; - - for (const key in env) { - if (!valid_identifier.test(key) || reserved.has(key)) { - continue; - } - - const comment = `/** @type {import('${id}').${key}} */`; - const declaration = `export const ${key} = ${JSON.stringify(env[key])};`; - - declarations.push(`${comment}\n${declaration}`); - } - - return GENERATED_COMMENT + declarations.join('\n\n'); -} - -/** - * @param {EnvType} type - * @param {Record | undefined} dev_values If in a development mode, values to pre-populate the module with. - */ -export function create_dynamic_module(type, dev_values) { - if (dev_values) { - const keys = Object.entries(dev_values).map( - ([k, v]) => `${JSON.stringify(k)}: ${JSON.stringify(v)}` - ); - return `export const env = {\n${keys.join(',\n')}\n}`; - } - return `export { ${type}_env as env } from '${runtime_base}/shared-server.js';`; -} - -/** - * @param {EnvType} id - * @param {import('types').Env} env - * @returns {string} - */ -export function create_static_types(id, env) { - const declarations = Object.keys(env[id]) - .filter((k) => valid_identifier.test(k)) - .map((k) => `export const ${k}: string;`); - - return dedent` - declare module '$env/static/${id}' { - ${declarations.join('\n')} - } - `; -} - -/** - * @param {EnvType} id - * @param {import('types').Env} env - * @param {{ - * public_prefix: string; - * private_prefix: string; - * }} prefixes - * @returns {string} - */ -export function create_dynamic_types(id, env, { public_prefix, private_prefix }) { - const properties = Object.keys(env[id]) - .filter((k) => valid_identifier.test(k)) - .map((k) => `${k}: string;`); - - const public_prefixed = `[key: \`${public_prefix}\${string}\`]`; - const private_prefixed = `[key: \`${private_prefix}\${string}\`]`; - - if (id === 'private') { - if (public_prefix) { - properties.push(`${public_prefixed}: undefined;`); - } - properties.push(`${private_prefixed}: string | undefined;`); - } else { - if (private_prefix) { - properties.push(`${private_prefixed}: undefined;`); - } - properties.push(`${public_prefixed}: string | undefined;`); - } - - return dedent` - declare module '$env/dynamic/${id}' { - export const env: { - ${properties.join('\n')} - } - } - `; -} - -export const reserved = new Set([ - 'do', - 'if', - 'in', - 'for', - 'let', - 'new', - 'try', - 'var', - 'case', - 'else', - 'enum', - 'eval', - 'null', - 'this', - 'true', - 'void', - 'with', - 'await', - 'break', - 'catch', - 'class', - 'const', - 'false', - 'super', - 'throw', - 'while', - 'yield', - 'delete', - 'export', - 'import', - 'public', - 'return', - 'static', - 'switch', - 'typeof', - 'default', - 'extends', - 'finally', - 'package', - 'private', - 'continue', - 'debugger', - 'function', - 'arguments', - 'interface', - 'protected', - 'implements', - 'instanceof' -]); - -export const valid_identifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/; diff --git a/frontend/node_modules/@sveltejs/kit/src/core/generate_manifest/find_server_assets.js b/frontend/node_modules/@sveltejs/kit/src/core/generate_manifest/find_server_assets.js deleted file mode 100644 index 044db84..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/generate_manifest/find_server_assets.js +++ /dev/null @@ -1,56 +0,0 @@ -import { find_deps } from '../../exports/vite/build/utils.js'; - -/** - * Finds all the assets that are imported by server files associated with `routes` - * @param {import('types').BuildData} build_data - * @param {import('types').RouteData[]} routes - */ -export function find_server_assets(build_data, routes) { - /** - * All nodes actually used in the routes definition (prerendered routes are omitted). - * Root layout/error is always included as they are needed for 404 and root errors. - * @type {Set} - */ - const used_nodes = new Set([0, 1]); - - /** @type {Set} */ - const server_assets = new Set(); - - /** @param {string} id */ - function add_assets(id) { - if (id in build_data.server_manifest) { - const deps = find_deps(build_data.server_manifest, id, false); - for (const asset of deps.assets) { - server_assets.add(asset); - } - } - } - - for (const route of routes) { - if (route.page) { - for (const i of route.page.layouts) used_nodes.add(i); - for (const i of route.page.errors) used_nodes.add(i); - used_nodes.add(route.page.leaf); - } - - if (route.endpoint) { - add_assets(route.endpoint.file); - } - } - - for (const n of used_nodes) { - const node = build_data.manifest_data.nodes[n]; - if (node?.universal) add_assets(node.universal); - if (node?.server) add_assets(node.server); - } - - if (build_data.manifest_data.hooks.server) { - add_assets(build_data.manifest_data.hooks.server); - } - - if (build_data.manifest_data.hooks.universal) { - add_assets(build_data.manifest_data.hooks.universal); - } - - return Array.from(server_assets); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/generate_manifest/index.js b/frontend/node_modules/@sveltejs/kit/src/core/generate_manifest/index.js deleted file mode 100644 index 6b2445a..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/generate_manifest/index.js +++ /dev/null @@ -1,152 +0,0 @@ -/** @import { RemoteChunk } from 'types' */ -import fs from 'node:fs'; -import path from 'node:path'; -import * as mime from 'mrmime'; -import { s } from '../../utils/misc.js'; -import { get_mime_lookup } from '../utils.js'; -import { resolve_symlinks } from '../../exports/vite/build/utils.js'; -import { compact } from '../../utils/array.js'; -import { join_relative } from '../../utils/filesystem.js'; -import { dedent } from '../sync/utils.js'; -import { find_server_assets } from './find_server_assets.js'; -import { uneval } from 'devalue'; - -/** - * Generates the data used to write the server-side manifest.js file. This data is used in the Vite - * build process, to power routing, etc. - * @param {{ - * build_data: import('types').BuildData; - * prerendered: string[]; - * relative_path: string; - * routes: import('types').RouteData[]; - * remotes: RemoteChunk[]; - * }} opts - */ -export function generate_manifest({ build_data, prerendered, relative_path, routes, remotes }) { - /** - * @type {Map} The new index of each node in the filtered nodes array - */ - const reindexed = new Map(); - /** - * All nodes actually used in the routes definition (prerendered routes are omitted). - * Root layout/error is always included as they are needed for 404 and root errors. - * @type {Set} - */ - const used_nodes = new Set([0, 1]); - - const server_assets = find_server_assets(build_data, routes); - - for (const route of routes) { - if (route.page) { - for (const i of route.page.layouts) used_nodes.add(i); - for (const i of route.page.errors) used_nodes.add(i); - used_nodes.add(route.page.leaf); - } - } - - const node_paths = compact( - build_data.manifest_data.nodes.map((_, i) => { - if (used_nodes.has(i)) { - reindexed.set(i, reindexed.size); - return join_relative(relative_path, `/nodes/${i}.js`); - } - }) - ); - - /** @type {(path: string) => string} */ - const loader = (path) => `__memo(() => import('${path}'))`; - - const assets = build_data.manifest_data.assets.map((asset) => asset.file); - if (build_data.service_worker) { - assets.push(build_data.service_worker); - } - - // In case of server-side route resolution, we need to include all matchers. Prerendered routes are not part - // of the server manifest, and they could reference matchers that then would not be included. - const matchers = new Set( - build_data.client?.nodes ? Object.keys(build_data.manifest_data.matchers) : undefined - ); - - /** @param {Array} indexes */ - function get_nodes(indexes) { - const string = indexes.map((n) => reindexed.get(n) ?? '').join(','); - - // since JavaScript ignores trailing commas, we need to insert a dummy - // comma so that the array has the correct length if the last item - // is undefined - return `[${string},]`; - } - - const mime_types = get_mime_lookup(build_data.manifest_data); - - /** @type {Record} */ - const files = {}; - for (const file of server_assets) { - files[file] = fs.statSync(path.resolve(build_data.out_dir, 'server', file)).size; - - const ext = path.extname(file); - mime_types[ext] ??= mime.lookup(ext) || ''; - } - - // prettier-ignore - // String representation of - /** @template {import('@sveltejs/kit').SSRManifest} T */ - const manifest_expr = dedent` - { - appDir: ${s(build_data.app_dir)}, - appPath: ${s(build_data.app_path)}, - assets: new Set(${s(assets)}), - mimeTypes: ${s(mime_types)}, - _: { - client: ${uneval(build_data.client)}, - nodes: [ - ${(node_paths).map(loader).join(',\n')} - ], - remotes: { - ${remotes.map((remote) => `'${remote.hash}': ${loader(join_relative(relative_path, `chunks/remote-${remote.hash}.js`))}`).join(',\n')} - }, - routes: [ - ${routes.map(route => { - if (!route.page && !route.endpoint) return; - - route.params.forEach(param => { - if (param.matcher) matchers.add(param.matcher); - }); - - return dedent` - { - id: ${s(route.id)}, - pattern: ${route.pattern}, - params: ${s(route.params)}, - page: ${route.page ? `{ layouts: ${get_nodes(route.page.layouts)}, errors: ${get_nodes(route.page.errors)}, leaf: ${reindexed.get(route.page.leaf)} }` : 'null'}, - endpoint: ${route.endpoint ? loader(join_relative(relative_path, resolve_symlinks(build_data.server_manifest, route.endpoint.file).chunk.file)) : 'null'} - } - `; - }).filter(Boolean).join(',\n')} - ], - prerendered_routes: new Set(${s(prerendered)}), - matchers: async () => { - ${Array.from( - matchers, - type => `const { match: ${type} } = await import ('${(join_relative(relative_path, `/entries/matchers/${type}.js`))}')` - ).join('\n')} - return { ${Array.from(matchers).join(', ')} }; - }, - server_assets: ${s(files)} - } - } - `; - - // Memoize the loaders to prevent Node from doing unnecessary work - // on every dynamic import call - return dedent` - (() => { - function __memo(fn) { - let value; - return () => value ??= (value = fn()); - } - - return ${manifest_expr} - })() - `; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js b/frontend/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js deleted file mode 100644 index 2b967e5..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js +++ /dev/null @@ -1,285 +0,0 @@ -/** @import { RemoteChunk } from 'types' */ -import { join } from 'node:path'; -import { pathToFileURL } from 'node:url'; -import { validate_server_exports } from '../../utils/exports.js'; -import { load_config } from '../config/index.js'; -import { forked } from '../../utils/fork.js'; -import { installPolyfills } from '../../exports/node/polyfills.js'; -import { ENDPOINT_METHODS } from '../../constants.js'; -import { filter_env } from '../../utils/env.js'; -import { has_server_load, resolve_route } from '../../utils/routing.js'; -import { check_feature } from '../../utils/features.js'; -import { createReadableStream } from '@sveltejs/kit/node'; -import { PageNodes } from '../../utils/page_nodes.js'; -import { build_server_nodes } from '../../exports/vite/build/build_server.js'; - -export default forked(import.meta.url, analyse); - -/** - * @param {{ - * hash: boolean; - * manifest_path: string; - * manifest_data: import('types').ManifestData; - * server_manifest: import('vite').Manifest; - * tracked_features: Record; - * env: Record; - * out: string; - * output_config: import('types').RecursiveRequired; - * remotes: RemoteChunk[]; - * }} opts - */ -async function analyse({ - hash, - manifest_path, - manifest_data, - server_manifest, - tracked_features, - env, - out, - output_config, - remotes -}) { - /** @type {import('@sveltejs/kit').SSRManifest} */ - const manifest = (await import(pathToFileURL(manifest_path).href)).manifest; - - /** @type {import('types').ValidatedKitConfig} */ - const config = (await load_config()).kit; - - const server_root = join(config.outDir, 'output'); - - /** @type {import('types').ServerInternalModule} */ - const internal = await import(pathToFileURL(`${server_root}/server/internal.js`).href); - - installPolyfills(); - - // configure `import { building } from '$app/environment'` — - // essential we do this before analysing the code - internal.set_building(); - - // set env, `read`, and `manifest`, in case they're used in initialisation - const { publicPrefix: public_prefix, privatePrefix: private_prefix } = config.env; - const private_env = filter_env(env, private_prefix, public_prefix); - const public_env = filter_env(env, public_prefix, private_prefix); - internal.set_private_env(private_env); - internal.set_public_env(public_env); - internal.set_manifest(manifest); - internal.set_read_implementation((file) => createReadableStream(`${server_root}/server/${file}`)); - - // first, build server nodes without the client manifest so we can analyse it - build_server_nodes(out, config, manifest_data, server_manifest, null, null, null, output_config); - - /** @type {import('types').ServerMetadata} */ - const metadata = { - nodes: [], - routes: new Map(), - remotes: new Map() - }; - - const nodes = await Promise.all(manifest._.nodes.map((loader) => loader())); - - // analyse nodes - for (const node of nodes) { - if (hash && node.universal) { - const options = Object.keys(node.universal).filter((o) => o !== 'load'); - if (options.length > 0) { - throw new Error( - `Page options are ignored when \`router.type === 'hash'\` (${node.universal_id} has ${options - .filter((o) => o !== 'load') - .map((o) => `'${o}'`) - .join(', ')})` - ); - } - } - - metadata.nodes[node.index] = { - has_server_load: has_server_load(node), - has_universal_load: node.universal?.load !== undefined - }; - } - - // analyse routes - for (const route of manifest._.routes) { - const page = - route.page && - analyse_page( - route.page.layouts.map((n) => (n === undefined ? n : nodes[n])), - nodes[route.page.leaf] - ); - - const endpoint = route.endpoint && analyse_endpoint(route, await route.endpoint()); - - if (page?.prerender && endpoint?.prerender) { - throw new Error(`Cannot prerender a route with both +page and +server files (${route.id})`); - } - - if (page?.config && endpoint?.config) { - for (const key in { ...page.config, ...endpoint.config }) { - if (JSON.stringify(page.config[key]) !== JSON.stringify(endpoint.config[key])) { - throw new Error( - `Mismatched route config for ${route.id} — the +page and +server files must export the same config, if any` - ); - } - } - } - - const route_config = page?.config ?? endpoint?.config ?? {}; - const prerender = page?.prerender ?? endpoint?.prerender; - - if (prerender !== true) { - for (const feature of list_features( - route, - manifest_data, - server_manifest, - tracked_features - )) { - check_feature(route.id, route_config, feature, config.adapter); - } - } - - const page_methods = page?.methods ?? []; - const api_methods = endpoint?.methods ?? []; - const entries = page?.entries ?? endpoint?.entries; - - metadata.routes.set(route.id, { - config: route_config, - methods: Array.from(new Set([...page_methods, ...api_methods])), - page: { - methods: page_methods - }, - api: { - methods: api_methods - }, - prerender, - entries: - entries && (await entries()).map((entry_object) => resolve_route(route.id, entry_object)) - }); - } - - // analyse remotes - for (const remote of remotes) { - const loader = manifest._.remotes[remote.hash]; - const { default: functions } = await loader(); - - const exports = new Map(); - - for (const name in functions) { - const internals = /** @type {import('types').RemoteInternals} */ (functions[name].__); - const type = internals.type; - - exports.set(name, { - type, - dynamic: type !== 'prerender' || internals.dynamic - }); - } - - metadata.remotes.set(remote.hash, exports); - } - - return { metadata }; -} - -/** - * @param {import('types').SSRRoute} route - * @param {import('types').SSREndpoint} mod - */ -function analyse_endpoint(route, mod) { - validate_server_exports(mod, route.id); - - if (mod.prerender && (mod.POST || mod.PATCH || mod.PUT || mod.DELETE)) { - throw new Error( - `Cannot prerender a +server file with POST, PATCH, PUT, or DELETE (${route.id})` - ); - } - - /** @type {Array} */ - const methods = []; - - for (const method of /** @type {import('types').HttpMethod[]} */ (ENDPOINT_METHODS)) { - if (mod[method]) methods.push(method); - } - - if (mod.fallback) { - methods.push('*'); - } - - return { - config: mod.config, - entries: mod.entries, - methods, - prerender: mod.prerender ?? false - }; -} - -/** - * @param {Array} layouts - * @param {import('types').SSRNode} leaf - */ -function analyse_page(layouts, leaf) { - /** @type {Array<'GET' | 'POST'>} */ - const methods = ['GET']; - if (leaf.server?.actions) methods.push('POST'); - - const nodes = new PageNodes([...layouts, leaf]); - nodes.validate(); - - return { - config: nodes.get_config(), - entries: leaf.universal?.entries ?? leaf.server?.entries, - methods, - prerender: nodes.prerender() - }; -} - -/** - * @param {import('types').SSRRoute} route - * @param {import('types').ManifestData} manifest_data - * @param {import('vite').Manifest} server_manifest - * @param {Record} tracked_features - */ -function list_features(route, manifest_data, server_manifest, tracked_features) { - const features = new Set(); - - const route_data = /** @type {import('types').RouteData} */ ( - manifest_data.routes.find((r) => r.id === route.id) - ); - - const visited = new Set(); - /** @param {string} id */ - function visit(id) { - if (visited.has(id)) return; - visited.add(id); - - const chunk = server_manifest[id]; - if (!chunk) return; - - if (chunk.file in tracked_features) { - for (const feature of tracked_features[chunk.file]) { - features.add(feature); - } - } - - if (chunk.imports) { - for (const id of chunk.imports) { - visit(id); - } - } - } - - let page_node = route_data?.leaf; - while (page_node) { - if (page_node.server) visit(page_node.server); - page_node = page_node.parent ?? null; - } - - if (route_data.endpoint) { - visit(route_data.endpoint.file); - } - - if (manifest_data.hooks.server) { - // TODO if hooks.server.js imports `read`, it will be in the entry chunk - // we don't currently account for that case - visit(manifest_data.hooks.server); - } - - return Array.from(features); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/crawl.js b/frontend/node_modules/@sveltejs/kit/src/core/postbuild/crawl.js deleted file mode 100644 index 25134d1..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/crawl.js +++ /dev/null @@ -1,243 +0,0 @@ -import { resolve, decode_uri } from '../../utils/url.js'; -import { decode } from './entities.js'; - -const DOCTYPE = 'DOCTYPE'; -const CDATA_OPEN = '[CDATA['; -const CDATA_CLOSE = ']]>'; -const COMMENT_OPEN = '--'; -const COMMENT_CLOSE = '-->'; - -const TAG_OPEN = /[a-zA-Z]/; -const TAG_CHAR = /[a-zA-Z0-9]/; -const ATTRIBUTE_NAME = /[^\t\n\f />"'=]/; - -const WHITESPACE = /[\s\n\r]/; - -const CRAWLABLE_META_NAME_ATTRS = new Set([ - 'og:url', - 'og:image', - 'og:image:url', - 'og:image:secure_url', - 'og:video', - 'og:video:url', - 'og:video:secure_url', - 'og:audio', - 'og:audio:url', - 'og:audio:secure_url', - 'twitter:image' -]); - -/** - * @param {string} html - * @param {string} base - */ -export function crawl(html, base) { - /** @type {string[]} */ - const ids = []; - - /** @type {string[]} */ - const hrefs = []; - - let i = 0; - main: while (i < html.length) { - const char = html[i]; - - if (char === '<') { - if (html[i + 1] === '!') { - i += 2; - - if (html.slice(i, i + DOCTYPE.length).toUpperCase() === DOCTYPE) { - i += DOCTYPE.length; - while (i < html.length) { - if (html[i++] === '>') { - continue main; - } - } - } - - // skip cdata - if (html.slice(i, i + CDATA_OPEN.length) === CDATA_OPEN) { - i += CDATA_OPEN.length; - while (i < html.length) { - if (html.slice(i, i + CDATA_CLOSE.length) === CDATA_CLOSE) { - i += CDATA_CLOSE.length; - continue main; - } - - i += 1; - } - } - - // skip comments - if (html.slice(i, i + COMMENT_OPEN.length) === COMMENT_OPEN) { - i += COMMENT_OPEN.length; - while (i < html.length) { - if (html.slice(i, i + COMMENT_CLOSE.length) === COMMENT_CLOSE) { - i += COMMENT_CLOSE.length; - continue main; - } - - i += 1; - } - } - } - - // parse opening tags - const start = ++i; - if (TAG_OPEN.test(html[start])) { - while (i < html.length) { - if (!TAG_CHAR.test(html[i])) { - break; - } - - i += 1; - } - - const tag = html.slice(start, i).toUpperCase(); - - /** @type {Record} */ - const attributes = {}; - - if (tag === 'SCRIPT' || tag === 'STYLE') { - while (i < html.length) { - if ( - html[i] === '<' && - html[i + 1] === '/' && - html.slice(i + 2, i + 2 + tag.length).toUpperCase() === tag - ) { - continue main; - } - - i += 1; - } - } - - while (i < html.length) { - const start = i; - - const char = html[start]; - if (char === '>') break; - - if (ATTRIBUTE_NAME.test(char)) { - i += 1; - - while (i < html.length) { - if (!ATTRIBUTE_NAME.test(html[i])) { - break; - } - - i += 1; - } - - const name = html.slice(start, i).toLowerCase(); - - while (WHITESPACE.test(html[i])) i += 1; - - if (html[i] === '=') { - i += 1; - while (WHITESPACE.test(html[i])) i += 1; - - let value; - - if (html[i] === "'" || html[i] === '"') { - const quote = html[i++]; - - const start = i; - let escaped = false; - - while (i < html.length) { - if (escaped) { - escaped = false; - } else { - const char = html[i]; - - if (html[i] === quote) { - break; - } - - if (char === '\\') { - escaped = true; - } - } - - i += 1; - } - - value = html.slice(start, i); - } else { - const start = i; - while (html[i] !== '>' && !WHITESPACE.test(html[i])) i += 1; - value = html.slice(start, i); - - i -= 1; - } - - value = decode(value); - attributes[name] = value; - } else { - i -= 1; - } - } - - i += 1; - } - - const { href, id, name, property, rel, src, srcset, content } = attributes; - - if (href) { - if (tag === 'BASE') { - base = resolve(base, href); - } else if (!rel || !/\bexternal\b/i.test(rel)) { - hrefs.push(resolve(base, href)); - } - } - - if (id) { - ids.push(decode_uri(id)); - } - - if (name && tag === 'A') { - ids.push(decode_uri(name)); - } - - if (src) { - hrefs.push(resolve(base, src)); - } - - if (srcset) { - let value = srcset; - const candidates = []; - let insideURL = true; - value = value.trim(); - for (let i = 0; i < value.length; i++) { - if (value[i] === ',' && (!insideURL || (insideURL && WHITESPACE.test(value[i + 1])))) { - candidates.push(value.slice(0, i)); - value = value.substring(i + 1).trim(); - i = 0; - insideURL = true; - } else if (WHITESPACE.test(value[i])) { - insideURL = false; - } - } - candidates.push(value); - for (const candidate of candidates) { - const src = candidate.split(WHITESPACE)[0]; - if (src) hrefs.push(resolve(base, src)); - } - } - - if (tag === 'META' && content) { - const attr = name ?? property; - - if (attr && CRAWLABLE_META_NAME_ATTRS.has(attr)) { - hrefs.push(resolve(base, content)); - } - } - } - } - - i += 1; - } - - return { ids, hrefs }; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/entities.js b/frontend/node_modules/@sveltejs/kit/src/core/postbuild/entities.js deleted file mode 100644 index 91888a9..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/entities.js +++ /dev/null @@ -1,2252 +0,0 @@ -/** - * A list of all named HTML entities, from https://html.spec.whatwg.org/multipage/named-characters.html - * @type {Record} - */ -const entities = { - AElig: 'Æ', - 'AElig;': 'Æ', - AMP: '&', - 'AMP;': '&', - Aacute: 'Á', - 'Aacute;': 'Á', - 'Abreve;': 'Ă', - Acirc: 'Â', - 'Acirc;': 'Â', - 'Acy;': 'А', - 'Afr;': '𝔄', - Agrave: 'À', - 'Agrave;': 'À', - 'Alpha;': 'Α', - 'Amacr;': 'Ā', - 'And;': '⩓', - 'Aogon;': 'Ą', - 'Aopf;': '𝔸', - 'ApplyFunction;': '⁡', - Aring: 'Å', - 'Aring;': 'Å', - 'Ascr;': '𝒜', - 'Assign;': '≔', - Atilde: 'Ã', - 'Atilde;': 'Ã', - Auml: 'Ä', - 'Auml;': 'Ä', - 'Backslash;': '∖', - 'Barv;': '⫧', - 'Barwed;': '⌆', - 'Bcy;': 'Б', - 'Because;': '∵', - 'Bernoullis;': 'ℬ', - 'Beta;': 'Β', - 'Bfr;': '𝔅', - 'Bopf;': '𝔹', - 'Breve;': '˘', - 'Bscr;': 'ℬ', - 'Bumpeq;': '≎', - 'CHcy;': 'Ч', - COPY: '©', - 'COPY;': '©', - 'Cacute;': 'Ć', - 'Cap;': '⋒', - 'CapitalDifferentialD;': 'ⅅ', - 'Cayleys;': 'ℭ', - 'Ccaron;': 'Č', - Ccedil: 'Ç', - 'Ccedil;': 'Ç', - 'Ccirc;': 'Ĉ', - 'Cconint;': '∰', - 'Cdot;': 'Ċ', - 'Cedilla;': '¸', - 'CenterDot;': '·', - 'Cfr;': 'ℭ', - 'Chi;': 'Χ', - 'CircleDot;': '⊙', - 'CircleMinus;': '⊖', - 'CirclePlus;': '⊕', - 'CircleTimes;': '⊗', - 'ClockwiseContourIntegral;': '∲', - 'CloseCurlyDoubleQuote;': '”', - 'CloseCurlyQuote;': '’', - 'Colon;': '∷', - 'Colone;': '⩴', - 'Congruent;': '≡', - 'Conint;': '∯', - 'ContourIntegral;': '∮', - 'Copf;': 'ℂ', - 'Coproduct;': '∐', - 'CounterClockwiseContourIntegral;': '∳', - 'Cross;': '⨯', - 'Cscr;': '𝒞', - 'Cup;': '⋓', - 'CupCap;': '≍', - 'DD;': 'ⅅ', - 'DDotrahd;': '⤑', - 'DJcy;': 'Ђ', - 'DScy;': 'Ѕ', - 'DZcy;': 'Џ', - 'Dagger;': '‡', - 'Darr;': '↡', - 'Dashv;': '⫤', - 'Dcaron;': 'Ď', - 'Dcy;': 'Д', - 'Del;': '∇', - 'Delta;': 'Δ', - 'Dfr;': '𝔇', - 'DiacriticalAcute;': '´', - 'DiacriticalDot;': '˙', - 'DiacriticalDoubleAcute;': '˝', - 'DiacriticalGrave;': '`', - 'DiacriticalTilde;': '˜', - 'Diamond;': '⋄', - 'DifferentialD;': 'ⅆ', - 'Dopf;': '𝔻', - 'Dot;': '¨', - 'DotDot;': '⃜', - 'DotEqual;': '≐', - 'DoubleContourIntegral;': '∯', - 'DoubleDot;': '¨', - 'DoubleDownArrow;': '⇓', - 'DoubleLeftArrow;': '⇐', - 'DoubleLeftRightArrow;': '⇔', - 'DoubleLeftTee;': '⫤', - 'DoubleLongLeftArrow;': '⟸', - 'DoubleLongLeftRightArrow;': '⟺', - 'DoubleLongRightArrow;': '⟹', - 'DoubleRightArrow;': '⇒', - 'DoubleRightTee;': '⊨', - 'DoubleUpArrow;': '⇑', - 'DoubleUpDownArrow;': '⇕', - 'DoubleVerticalBar;': '∥', - 'DownArrow;': '↓', - 'DownArrowBar;': '⤓', - 'DownArrowUpArrow;': '⇵', - 'DownBreve;': '̑', - 'DownLeftRightVector;': '⥐', - 'DownLeftTeeVector;': '⥞', - 'DownLeftVector;': '↽', - 'DownLeftVectorBar;': '⥖', - 'DownRightTeeVector;': '⥟', - 'DownRightVector;': '⇁', - 'DownRightVectorBar;': '⥗', - 'DownTee;': '⊤', - 'DownTeeArrow;': '↧', - 'Downarrow;': '⇓', - 'Dscr;': '𝒟', - 'Dstrok;': 'Đ', - 'ENG;': 'Ŋ', - ETH: 'Ð', - 'ETH;': 'Ð', - Eacute: 'É', - 'Eacute;': 'É', - 'Ecaron;': 'Ě', - Ecirc: 'Ê', - 'Ecirc;': 'Ê', - 'Ecy;': 'Э', - 'Edot;': 'Ė', - 'Efr;': '𝔈', - Egrave: 'È', - 'Egrave;': 'È', - 'Element;': '∈', - 'Emacr;': 'Ē', - 'EmptySmallSquare;': '◻', - 'EmptyVerySmallSquare;': '▫', - 'Eogon;': 'Ę', - 'Eopf;': '𝔼', - 'Epsilon;': 'Ε', - 'Equal;': '⩵', - 'EqualTilde;': '≂', - 'Equilibrium;': '⇌', - 'Escr;': 'ℰ', - 'Esim;': '⩳', - 'Eta;': 'Η', - Euml: 'Ë', - 'Euml;': 'Ë', - 'Exists;': '∃', - 'ExponentialE;': 'ⅇ', - 'Fcy;': 'Ф', - 'Ffr;': '𝔉', - 'FilledSmallSquare;': '◼', - 'FilledVerySmallSquare;': '▪', - 'Fopf;': '𝔽', - 'ForAll;': '∀', - 'Fouriertrf;': 'ℱ', - 'Fscr;': 'ℱ', - 'GJcy;': 'Ѓ', - GT: '>', - 'GT;': '>', - 'Gamma;': 'Γ', - 'Gammad;': 'Ϝ', - 'Gbreve;': 'Ğ', - 'Gcedil;': 'Ģ', - 'Gcirc;': 'Ĝ', - 'Gcy;': 'Г', - 'Gdot;': 'Ġ', - 'Gfr;': '𝔊', - 'Gg;': '⋙', - 'Gopf;': '𝔾', - 'GreaterEqual;': '≥', - 'GreaterEqualLess;': '⋛', - 'GreaterFullEqual;': '≧', - 'GreaterGreater;': '⪢', - 'GreaterLess;': '≷', - 'GreaterSlantEqual;': '⩾', - 'GreaterTilde;': '≳', - 'Gscr;': '𝒢', - 'Gt;': '≫', - 'HARDcy;': 'Ъ', - 'Hacek;': 'ˇ', - 'Hat;': '^', - 'Hcirc;': 'Ĥ', - 'Hfr;': 'ℌ', - 'HilbertSpace;': 'ℋ', - 'Hopf;': 'ℍ', - 'HorizontalLine;': '─', - 'Hscr;': 'ℋ', - 'Hstrok;': 'Ħ', - 'HumpDownHump;': '≎', - 'HumpEqual;': '≏', - 'IEcy;': 'Е', - 'IJlig;': 'IJ', - 'IOcy;': 'Ё', - Iacute: 'Í', - 'Iacute;': 'Í', - Icirc: 'Î', - 'Icirc;': 'Î', - 'Icy;': 'И', - 'Idot;': 'İ', - 'Ifr;': 'ℑ', - Igrave: 'Ì', - 'Igrave;': 'Ì', - 'Im;': 'ℑ', - 'Imacr;': 'Ī', - 'ImaginaryI;': 'ⅈ', - 'Implies;': '⇒', - 'Int;': '∬', - 'Integral;': '∫', - 'Intersection;': '⋂', - 'InvisibleComma;': '⁣', - 'InvisibleTimes;': '⁢', - 'Iogon;': 'Į', - 'Iopf;': '𝕀', - 'Iota;': 'Ι', - 'Iscr;': 'ℐ', - 'Itilde;': 'Ĩ', - 'Iukcy;': 'І', - Iuml: 'Ï', - 'Iuml;': 'Ï', - 'Jcirc;': 'Ĵ', - 'Jcy;': 'Й', - 'Jfr;': '𝔍', - 'Jopf;': '𝕁', - 'Jscr;': '𝒥', - 'Jsercy;': 'Ј', - 'Jukcy;': 'Є', - 'KHcy;': 'Х', - 'KJcy;': 'Ќ', - 'Kappa;': 'Κ', - 'Kcedil;': 'Ķ', - 'Kcy;': 'К', - 'Kfr;': '𝔎', - 'Kopf;': '𝕂', - 'Kscr;': '𝒦', - 'LJcy;': 'Љ', - LT: '<', - 'LT;': '<', - 'Lacute;': 'Ĺ', - 'Lambda;': 'Λ', - 'Lang;': '⟪', - 'Laplacetrf;': 'ℒ', - 'Larr;': '↞', - 'Lcaron;': 'Ľ', - 'Lcedil;': 'Ļ', - 'Lcy;': 'Л', - 'LeftAngleBracket;': '⟨', - 'LeftArrow;': '←', - 'LeftArrowBar;': '⇤', - 'LeftArrowRightArrow;': '⇆', - 'LeftCeiling;': '⌈', - 'LeftDoubleBracket;': '⟦', - 'LeftDownTeeVector;': '⥡', - 'LeftDownVector;': '⇃', - 'LeftDownVectorBar;': '⥙', - 'LeftFloor;': '⌊', - 'LeftRightArrow;': '↔', - 'LeftRightVector;': '⥎', - 'LeftTee;': '⊣', - 'LeftTeeArrow;': '↤', - 'LeftTeeVector;': '⥚', - 'LeftTriangle;': '⊲', - 'LeftTriangleBar;': '⧏', - 'LeftTriangleEqual;': '⊴', - 'LeftUpDownVector;': '⥑', - 'LeftUpTeeVector;': '⥠', - 'LeftUpVector;': '↿', - 'LeftUpVectorBar;': '⥘', - 'LeftVector;': '↼', - 'LeftVectorBar;': '⥒', - 'Leftarrow;': '⇐', - 'Leftrightarrow;': '⇔', - 'LessEqualGreater;': '⋚', - 'LessFullEqual;': '≦', - 'LessGreater;': '≶', - 'LessLess;': '⪡', - 'LessSlantEqual;': '⩽', - 'LessTilde;': '≲', - 'Lfr;': '𝔏', - 'Ll;': '⋘', - 'Lleftarrow;': '⇚', - 'Lmidot;': 'Ŀ', - 'LongLeftArrow;': '⟵', - 'LongLeftRightArrow;': '⟷', - 'LongRightArrow;': '⟶', - 'Longleftarrow;': '⟸', - 'Longleftrightarrow;': '⟺', - 'Longrightarrow;': '⟹', - 'Lopf;': '𝕃', - 'LowerLeftArrow;': '↙', - 'LowerRightArrow;': '↘', - 'Lscr;': 'ℒ', - 'Lsh;': '↰', - 'Lstrok;': 'Ł', - 'Lt;': '≪', - 'Map;': '⤅', - 'Mcy;': 'М', - 'MediumSpace;': ' ', - 'Mellintrf;': 'ℳ', - 'Mfr;': '𝔐', - 'MinusPlus;': '∓', - 'Mopf;': '𝕄', - 'Mscr;': 'ℳ', - 'Mu;': 'Μ', - 'NJcy;': 'Њ', - 'Nacute;': 'Ń', - 'Ncaron;': 'Ň', - 'Ncedil;': 'Ņ', - 'Ncy;': 'Н', - 'NegativeMediumSpace;': '​', - 'NegativeThickSpace;': '​', - 'NegativeThinSpace;': '​', - 'NegativeVeryThinSpace;': '​', - 'NestedGreaterGreater;': '≫', - 'NestedLessLess;': '≪', - 'NewLine;': '\n', - 'Nfr;': '𝔑', - 'NoBreak;': '⁠', - 'NonBreakingSpace;': ' ', - 'Nopf;': 'ℕ', - 'Not;': '⫬', - 'NotCongruent;': '≢', - 'NotCupCap;': '≭', - 'NotDoubleVerticalBar;': '∦', - 'NotElement;': '∉', - 'NotEqual;': '≠', - 'NotEqualTilde;': '≂̸', - 'NotExists;': '∄', - 'NotGreater;': '≯', - 'NotGreaterEqual;': '≱', - 'NotGreaterFullEqual;': '≧̸', - 'NotGreaterGreater;': '≫̸', - 'NotGreaterLess;': '≹', - 'NotGreaterSlantEqual;': '⩾̸', - 'NotGreaterTilde;': '≵', - 'NotHumpDownHump;': '≎̸', - 'NotHumpEqual;': '≏̸', - 'NotLeftTriangle;': '⋪', - 'NotLeftTriangleBar;': '⧏̸', - 'NotLeftTriangleEqual;': '⋬', - 'NotLess;': '≮', - 'NotLessEqual;': '≰', - 'NotLessGreater;': '≸', - 'NotLessLess;': '≪̸', - 'NotLessSlantEqual;': '⩽̸', - 'NotLessTilde;': '≴', - 'NotNestedGreaterGreater;': '⪢̸', - 'NotNestedLessLess;': '⪡̸', - 'NotPrecedes;': '⊀', - 'NotPrecedesEqual;': '⪯̸', - 'NotPrecedesSlantEqual;': '⋠', - 'NotReverseElement;': '∌', - 'NotRightTriangle;': '⋫', - 'NotRightTriangleBar;': '⧐̸', - 'NotRightTriangleEqual;': '⋭', - 'NotSquareSubset;': '⊏̸', - 'NotSquareSubsetEqual;': '⋢', - 'NotSquareSuperset;': '⊐̸', - 'NotSquareSupersetEqual;': '⋣', - 'NotSubset;': '⊂⃒', - 'NotSubsetEqual;': '⊈', - 'NotSucceeds;': '⊁', - 'NotSucceedsEqual;': '⪰̸', - 'NotSucceedsSlantEqual;': '⋡', - 'NotSucceedsTilde;': '≿̸', - 'NotSuperset;': '⊃⃒', - 'NotSupersetEqual;': '⊉', - 'NotTilde;': '≁', - 'NotTildeEqual;': '≄', - 'NotTildeFullEqual;': '≇', - 'NotTildeTilde;': '≉', - 'NotVerticalBar;': '∤', - 'Nscr;': '𝒩', - Ntilde: 'Ñ', - 'Ntilde;': 'Ñ', - 'Nu;': 'Ν', - 'OElig;': 'Œ', - Oacute: 'Ó', - 'Oacute;': 'Ó', - Ocirc: 'Ô', - 'Ocirc;': 'Ô', - 'Ocy;': 'О', - 'Odblac;': 'Ő', - 'Ofr;': '𝔒', - Ograve: 'Ò', - 'Ograve;': 'Ò', - 'Omacr;': 'Ō', - 'Omega;': 'Ω', - 'Omicron;': 'Ο', - 'Oopf;': '𝕆', - 'OpenCurlyDoubleQuote;': '“', - 'OpenCurlyQuote;': '‘', - 'Or;': '⩔', - 'Oscr;': '𝒪', - Oslash: 'Ø', - 'Oslash;': 'Ø', - Otilde: 'Õ', - 'Otilde;': 'Õ', - 'Otimes;': '⨷', - Ouml: 'Ö', - 'Ouml;': 'Ö', - 'OverBar;': '‾', - 'OverBrace;': '⏞', - 'OverBracket;': '⎴', - 'OverParenthesis;': '⏜', - 'PartialD;': '∂', - 'Pcy;': 'П', - 'Pfr;': '𝔓', - 'Phi;': 'Φ', - 'Pi;': 'Π', - 'PlusMinus;': '±', - 'Poincareplane;': 'ℌ', - 'Popf;': 'ℙ', - 'Pr;': '⪻', - 'Precedes;': '≺', - 'PrecedesEqual;': '⪯', - 'PrecedesSlantEqual;': '≼', - 'PrecedesTilde;': '≾', - 'Prime;': '″', - 'Product;': '∏', - 'Proportion;': '∷', - 'Proportional;': '∝', - 'Pscr;': '𝒫', - 'Psi;': 'Ψ', - QUOT: '"', - 'QUOT;': '"', - 'Qfr;': '𝔔', - 'Qopf;': 'ℚ', - 'Qscr;': '𝒬', - 'RBarr;': '⤐', - REG: '®', - 'REG;': '®', - 'Racute;': 'Ŕ', - 'Rang;': '⟫', - 'Rarr;': '↠', - 'Rarrtl;': '⤖', - 'Rcaron;': 'Ř', - 'Rcedil;': 'Ŗ', - 'Rcy;': 'Р', - 'Re;': 'ℜ', - 'ReverseElement;': '∋', - 'ReverseEquilibrium;': '⇋', - 'ReverseUpEquilibrium;': '⥯', - 'Rfr;': 'ℜ', - 'Rho;': 'Ρ', - 'RightAngleBracket;': '⟩', - 'RightArrow;': '→', - 'RightArrowBar;': '⇥', - 'RightArrowLeftArrow;': '⇄', - 'RightCeiling;': '⌉', - 'RightDoubleBracket;': '⟧', - 'RightDownTeeVector;': '⥝', - 'RightDownVector;': '⇂', - 'RightDownVectorBar;': '⥕', - 'RightFloor;': '⌋', - 'RightTee;': '⊢', - 'RightTeeArrow;': '↦', - 'RightTeeVector;': '⥛', - 'RightTriangle;': '⊳', - 'RightTriangleBar;': '⧐', - 'RightTriangleEqual;': '⊵', - 'RightUpDownVector;': '⥏', - 'RightUpTeeVector;': '⥜', - 'RightUpVector;': '↾', - 'RightUpVectorBar;': '⥔', - 'RightVector;': '⇀', - 'RightVectorBar;': '⥓', - 'Rightarrow;': '⇒', - 'Ropf;': 'ℝ', - 'RoundImplies;': '⥰', - 'Rrightarrow;': '⇛', - 'Rscr;': 'ℛ', - 'Rsh;': '↱', - 'RuleDelayed;': '⧴', - 'SHCHcy;': 'Щ', - 'SHcy;': 'Ш', - 'SOFTcy;': 'Ь', - 'Sacute;': 'Ś', - 'Sc;': '⪼', - 'Scaron;': 'Š', - 'Scedil;': 'Ş', - 'Scirc;': 'Ŝ', - 'Scy;': 'С', - 'Sfr;': '𝔖', - 'ShortDownArrow;': '↓', - 'ShortLeftArrow;': '←', - 'ShortRightArrow;': '→', - 'ShortUpArrow;': '↑', - 'Sigma;': 'Σ', - 'SmallCircle;': '∘', - 'Sopf;': '𝕊', - 'Sqrt;': '√', - 'Square;': '□', - 'SquareIntersection;': '⊓', - 'SquareSubset;': '⊏', - 'SquareSubsetEqual;': '⊑', - 'SquareSuperset;': '⊐', - 'SquareSupersetEqual;': '⊒', - 'SquareUnion;': '⊔', - 'Sscr;': '𝒮', - 'Star;': '⋆', - 'Sub;': '⋐', - 'Subset;': '⋐', - 'SubsetEqual;': '⊆', - 'Succeeds;': '≻', - 'SucceedsEqual;': '⪰', - 'SucceedsSlantEqual;': '≽', - 'SucceedsTilde;': '≿', - 'SuchThat;': '∋', - 'Sum;': '∑', - 'Sup;': '⋑', - 'Superset;': '⊃', - 'SupersetEqual;': '⊇', - 'Supset;': '⋑', - THORN: 'Þ', - 'THORN;': 'Þ', - 'TRADE;': '™', - 'TSHcy;': 'Ћ', - 'TScy;': 'Ц', - 'Tab;': '\t', - 'Tau;': 'Τ', - 'Tcaron;': 'Ť', - 'Tcedil;': 'Ţ', - 'Tcy;': 'Т', - 'Tfr;': '𝔗', - 'Therefore;': '∴', - 'Theta;': 'Θ', - 'ThickSpace;': '  ', - 'ThinSpace;': ' ', - 'Tilde;': '∼', - 'TildeEqual;': '≃', - 'TildeFullEqual;': '≅', - 'TildeTilde;': '≈', - 'Topf;': '𝕋', - 'TripleDot;': '⃛', - 'Tscr;': '𝒯', - 'Tstrok;': 'Ŧ', - Uacute: 'Ú', - 'Uacute;': 'Ú', - 'Uarr;': '↟', - 'Uarrocir;': '⥉', - 'Ubrcy;': 'Ў', - 'Ubreve;': 'Ŭ', - Ucirc: 'Û', - 'Ucirc;': 'Û', - 'Ucy;': 'У', - 'Udblac;': 'Ű', - 'Ufr;': '𝔘', - Ugrave: 'Ù', - 'Ugrave;': 'Ù', - 'Umacr;': 'Ū', - 'UnderBar;': '_', - 'UnderBrace;': '⏟', - 'UnderBracket;': '⎵', - 'UnderParenthesis;': '⏝', - 'Union;': '⋃', - 'UnionPlus;': '⊎', - 'Uogon;': 'Ų', - 'Uopf;': '𝕌', - 'UpArrow;': '↑', - 'UpArrowBar;': '⤒', - 'UpArrowDownArrow;': '⇅', - 'UpDownArrow;': '↕', - 'UpEquilibrium;': '⥮', - 'UpTee;': '⊥', - 'UpTeeArrow;': '↥', - 'Uparrow;': '⇑', - 'Updownarrow;': '⇕', - 'UpperLeftArrow;': '↖', - 'UpperRightArrow;': '↗', - 'Upsi;': 'ϒ', - 'Upsilon;': 'Υ', - 'Uring;': 'Ů', - 'Uscr;': '𝒰', - 'Utilde;': 'Ũ', - Uuml: 'Ü', - 'Uuml;': 'Ü', - 'VDash;': '⊫', - 'Vbar;': '⫫', - 'Vcy;': 'В', - 'Vdash;': '⊩', - 'Vdashl;': '⫦', - 'Vee;': '⋁', - 'Verbar;': '‖', - 'Vert;': '‖', - 'VerticalBar;': '∣', - 'VerticalLine;': '|', - 'VerticalSeparator;': '❘', - 'VerticalTilde;': '≀', - 'VeryThinSpace;': ' ', - 'Vfr;': '𝔙', - 'Vopf;': '𝕍', - 'Vscr;': '𝒱', - 'Vvdash;': '⊪', - 'Wcirc;': 'Ŵ', - 'Wedge;': '⋀', - 'Wfr;': '𝔚', - 'Wopf;': '𝕎', - 'Wscr;': '𝒲', - 'Xfr;': '𝔛', - 'Xi;': 'Ξ', - 'Xopf;': '𝕏', - 'Xscr;': '𝒳', - 'YAcy;': 'Я', - 'YIcy;': 'Ї', - 'YUcy;': 'Ю', - Yacute: 'Ý', - 'Yacute;': 'Ý', - 'Ycirc;': 'Ŷ', - 'Ycy;': 'Ы', - 'Yfr;': '𝔜', - 'Yopf;': '𝕐', - 'Yscr;': '𝒴', - 'Yuml;': 'Ÿ', - 'ZHcy;': 'Ж', - 'Zacute;': 'Ź', - 'Zcaron;': 'Ž', - 'Zcy;': 'З', - 'Zdot;': 'Ż', - 'ZeroWidthSpace;': '​', - 'Zeta;': 'Ζ', - 'Zfr;': 'ℨ', - 'Zopf;': 'ℤ', - 'Zscr;': '𝒵', - aacute: 'á', - 'aacute;': 'á', - 'abreve;': 'ă', - 'ac;': '∾', - 'acE;': '∾̳', - 'acd;': '∿', - acirc: 'â', - 'acirc;': 'â', - acute: '´', - 'acute;': '´', - 'acy;': 'а', - aelig: 'æ', - 'aelig;': 'æ', - 'af;': '⁡', - 'afr;': '𝔞', - agrave: 'à', - 'agrave;': 'à', - 'alefsym;': 'ℵ', - 'aleph;': 'ℵ', - 'alpha;': 'α', - 'amacr;': 'ā', - 'amalg;': '⨿', - amp: '&', - 'amp;': '&', - 'and;': '∧', - 'andand;': '⩕', - 'andd;': '⩜', - 'andslope;': '⩘', - 'andv;': '⩚', - 'ang;': '∠', - 'ange;': '⦤', - 'angle;': '∠', - 'angmsd;': '∡', - 'angmsdaa;': '⦨', - 'angmsdab;': '⦩', - 'angmsdac;': '⦪', - 'angmsdad;': '⦫', - 'angmsdae;': '⦬', - 'angmsdaf;': '⦭', - 'angmsdag;': '⦮', - 'angmsdah;': '⦯', - 'angrt;': '∟', - 'angrtvb;': '⊾', - 'angrtvbd;': '⦝', - 'angsph;': '∢', - 'angst;': 'Å', - 'angzarr;': '⍼', - 'aogon;': 'ą', - 'aopf;': '𝕒', - 'ap;': '≈', - 'apE;': '⩰', - 'apacir;': '⩯', - 'ape;': '≊', - 'apid;': '≋', - 'apos;': "'", - 'approx;': '≈', - 'approxeq;': '≊', - aring: 'å', - 'aring;': 'å', - 'ascr;': '𝒶', - 'ast;': '*', - 'asymp;': '≈', - 'asympeq;': '≍', - atilde: 'ã', - 'atilde;': 'ã', - auml: 'ä', - 'auml;': 'ä', - 'awconint;': '∳', - 'awint;': '⨑', - 'bNot;': '⫭', - 'backcong;': '≌', - 'backepsilon;': '϶', - 'backprime;': '‵', - 'backsim;': '∽', - 'backsimeq;': '⋍', - 'barvee;': '⊽', - 'barwed;': '⌅', - 'barwedge;': '⌅', - 'bbrk;': '⎵', - 'bbrktbrk;': '⎶', - 'bcong;': '≌', - 'bcy;': 'б', - 'bdquo;': '„', - 'becaus;': '∵', - 'because;': '∵', - 'bemptyv;': '⦰', - 'bepsi;': '϶', - 'bernou;': 'ℬ', - 'beta;': 'β', - 'beth;': 'ℶ', - 'between;': '≬', - 'bfr;': '𝔟', - 'bigcap;': '⋂', - 'bigcirc;': '◯', - 'bigcup;': '⋃', - 'bigodot;': '⨀', - 'bigoplus;': '⨁', - 'bigotimes;': '⨂', - 'bigsqcup;': '⨆', - 'bigstar;': '★', - 'bigtriangledown;': '▽', - 'bigtriangleup;': '△', - 'biguplus;': '⨄', - 'bigvee;': '⋁', - 'bigwedge;': '⋀', - 'bkarow;': '⤍', - 'blacklozenge;': '⧫', - 'blacksquare;': '▪', - 'blacktriangle;': '▴', - 'blacktriangledown;': '▾', - 'blacktriangleleft;': '◂', - 'blacktriangleright;': '▸', - 'blank;': '␣', - 'blk12;': '▒', - 'blk14;': '░', - 'blk34;': '▓', - 'block;': '█', - 'bne;': '=⃥', - 'bnequiv;': '≡⃥', - 'bnot;': '⌐', - 'bopf;': '𝕓', - 'bot;': '⊥', - 'bottom;': '⊥', - 'bowtie;': '⋈', - 'boxDL;': '╗', - 'boxDR;': '╔', - 'boxDl;': '╖', - 'boxDr;': '╓', - 'boxH;': '═', - 'boxHD;': '╦', - 'boxHU;': '╩', - 'boxHd;': '╤', - 'boxHu;': '╧', - 'boxUL;': '╝', - 'boxUR;': '╚', - 'boxUl;': '╜', - 'boxUr;': '╙', - 'boxV;': '║', - 'boxVH;': '╬', - 'boxVL;': '╣', - 'boxVR;': '╠', - 'boxVh;': '╫', - 'boxVl;': '╢', - 'boxVr;': '╟', - 'boxbox;': '⧉', - 'boxdL;': '╕', - 'boxdR;': '╒', - 'boxdl;': '┐', - 'boxdr;': '┌', - 'boxh;': '─', - 'boxhD;': '╥', - 'boxhU;': '╨', - 'boxhd;': '┬', - 'boxhu;': '┴', - 'boxminus;': '⊟', - 'boxplus;': '⊞', - 'boxtimes;': '⊠', - 'boxuL;': '╛', - 'boxuR;': '╘', - 'boxul;': '┘', - 'boxur;': '└', - 'boxv;': '│', - 'boxvH;': '╪', - 'boxvL;': '╡', - 'boxvR;': '╞', - 'boxvh;': '┼', - 'boxvl;': '┤', - 'boxvr;': '├', - 'bprime;': '‵', - 'breve;': '˘', - brvbar: '¦', - 'brvbar;': '¦', - 'bscr;': '𝒷', - 'bsemi;': '⁏', - 'bsim;': '∽', - 'bsime;': '⋍', - 'bsol;': '\\', - 'bsolb;': '⧅', - 'bsolhsub;': '⟈', - 'bull;': '•', - 'bullet;': '•', - 'bump;': '≎', - 'bumpE;': '⪮', - 'bumpe;': '≏', - 'bumpeq;': '≏', - 'cacute;': 'ć', - 'cap;': '∩', - 'capand;': '⩄', - 'capbrcup;': '⩉', - 'capcap;': '⩋', - 'capcup;': '⩇', - 'capdot;': '⩀', - 'caps;': '∩︀', - 'caret;': '⁁', - 'caron;': 'ˇ', - 'ccaps;': '⩍', - 'ccaron;': 'č', - ccedil: 'ç', - 'ccedil;': 'ç', - 'ccirc;': 'ĉ', - 'ccups;': '⩌', - 'ccupssm;': '⩐', - 'cdot;': 'ċ', - cedil: '¸', - 'cedil;': '¸', - 'cemptyv;': '⦲', - cent: '¢', - 'cent;': '¢', - 'centerdot;': '·', - 'cfr;': '𝔠', - 'chcy;': 'ч', - 'check;': '✓', - 'checkmark;': '✓', - 'chi;': 'χ', - 'cir;': '○', - 'cirE;': '⧃', - 'circ;': 'ˆ', - 'circeq;': '≗', - 'circlearrowleft;': '↺', - 'circlearrowright;': '↻', - 'circledR;': '®', - 'circledS;': 'Ⓢ', - 'circledast;': '⊛', - 'circledcirc;': '⊚', - 'circleddash;': '⊝', - 'cire;': '≗', - 'cirfnint;': '⨐', - 'cirmid;': '⫯', - 'cirscir;': '⧂', - 'clubs;': '♣', - 'clubsuit;': '♣', - 'colon;': ':', - 'colone;': '≔', - 'coloneq;': '≔', - 'comma;': ',', - 'commat;': '@', - 'comp;': '∁', - 'compfn;': '∘', - 'complement;': '∁', - 'complexes;': 'ℂ', - 'cong;': '≅', - 'congdot;': '⩭', - 'conint;': '∮', - 'copf;': '𝕔', - 'coprod;': '∐', - copy: '©', - 'copy;': '©', - 'copysr;': '℗', - 'crarr;': '↵', - 'cross;': '✗', - 'cscr;': '𝒸', - 'csub;': '⫏', - 'csube;': '⫑', - 'csup;': '⫐', - 'csupe;': '⫒', - 'ctdot;': '⋯', - 'cudarrl;': '⤸', - 'cudarrr;': '⤵', - 'cuepr;': '⋞', - 'cuesc;': '⋟', - 'cularr;': '↶', - 'cularrp;': '⤽', - 'cup;': '∪', - 'cupbrcap;': '⩈', - 'cupcap;': '⩆', - 'cupcup;': '⩊', - 'cupdot;': '⊍', - 'cupor;': '⩅', - 'cups;': '∪︀', - 'curarr;': '↷', - 'curarrm;': '⤼', - 'curlyeqprec;': '⋞', - 'curlyeqsucc;': '⋟', - 'curlyvee;': '⋎', - 'curlywedge;': '⋏', - curren: '¤', - 'curren;': '¤', - 'curvearrowleft;': '↶', - 'curvearrowright;': '↷', - 'cuvee;': '⋎', - 'cuwed;': '⋏', - 'cwconint;': '∲', - 'cwint;': '∱', - 'cylcty;': '⌭', - 'dArr;': '⇓', - 'dHar;': '⥥', - 'dagger;': '†', - 'daleth;': 'ℸ', - 'darr;': '↓', - 'dash;': '‐', - 'dashv;': '⊣', - 'dbkarow;': '⤏', - 'dblac;': '˝', - 'dcaron;': 'ď', - 'dcy;': 'д', - 'dd;': 'ⅆ', - 'ddagger;': '‡', - 'ddarr;': '⇊', - 'ddotseq;': '⩷', - deg: '°', - 'deg;': '°', - 'delta;': 'δ', - 'demptyv;': '⦱', - 'dfisht;': '⥿', - 'dfr;': '𝔡', - 'dharl;': '⇃', - 'dharr;': '⇂', - 'diam;': '⋄', - 'diamond;': '⋄', - 'diamondsuit;': '♦', - 'diams;': '♦', - 'die;': '¨', - 'digamma;': 'ϝ', - 'disin;': '⋲', - 'div;': '÷', - divide: '÷', - 'divide;': '÷', - 'divideontimes;': '⋇', - 'divonx;': '⋇', - 'djcy;': 'ђ', - 'dlcorn;': '⌞', - 'dlcrop;': '⌍', - 'dollar;': '$', - 'dopf;': '𝕕', - 'dot;': '˙', - 'doteq;': '≐', - 'doteqdot;': '≑', - 'dotminus;': '∸', - 'dotplus;': '∔', - 'dotsquare;': '⊡', - 'doublebarwedge;': '⌆', - 'downarrow;': '↓', - 'downdownarrows;': '⇊', - 'downharpoonleft;': '⇃', - 'downharpoonright;': '⇂', - 'drbkarow;': '⤐', - 'drcorn;': '⌟', - 'drcrop;': '⌌', - 'dscr;': '𝒹', - 'dscy;': 'ѕ', - 'dsol;': '⧶', - 'dstrok;': 'đ', - 'dtdot;': '⋱', - 'dtri;': '▿', - 'dtrif;': '▾', - 'duarr;': '⇵', - 'duhar;': '⥯', - 'dwangle;': '⦦', - 'dzcy;': 'џ', - 'dzigrarr;': '⟿', - 'eDDot;': '⩷', - 'eDot;': '≑', - eacute: 'é', - 'eacute;': 'é', - 'easter;': '⩮', - 'ecaron;': 'ě', - 'ecir;': '≖', - ecirc: 'ê', - 'ecirc;': 'ê', - 'ecolon;': '≕', - 'ecy;': 'э', - 'edot;': 'ė', - 'ee;': 'ⅇ', - 'efDot;': '≒', - 'efr;': '𝔢', - 'eg;': '⪚', - egrave: 'è', - 'egrave;': 'è', - 'egs;': '⪖', - 'egsdot;': '⪘', - 'el;': '⪙', - 'elinters;': '⏧', - 'ell;': 'ℓ', - 'els;': '⪕', - 'elsdot;': '⪗', - 'emacr;': 'ē', - 'empty;': '∅', - 'emptyset;': '∅', - 'emptyv;': '∅', - 'emsp13;': ' ', - 'emsp14;': ' ', - 'emsp;': ' ', - 'eng;': 'ŋ', - 'ensp;': ' ', - 'eogon;': 'ę', - 'eopf;': '𝕖', - 'epar;': '⋕', - 'eparsl;': '⧣', - 'eplus;': '⩱', - 'epsi;': 'ε', - 'epsilon;': 'ε', - 'epsiv;': 'ϵ', - 'eqcirc;': '≖', - 'eqcolon;': '≕', - 'eqsim;': '≂', - 'eqslantgtr;': '⪖', - 'eqslantless;': '⪕', - 'equals;': '=', - 'equest;': '≟', - 'equiv;': '≡', - 'equivDD;': '⩸', - 'eqvparsl;': '⧥', - 'erDot;': '≓', - 'erarr;': '⥱', - 'escr;': 'ℯ', - 'esdot;': '≐', - 'esim;': '≂', - 'eta;': 'η', - eth: 'ð', - 'eth;': 'ð', - euml: 'ë', - 'euml;': 'ë', - 'euro;': '€', - 'excl;': '!', - 'exist;': '∃', - 'expectation;': 'ℰ', - 'exponentiale;': 'ⅇ', - 'fallingdotseq;': '≒', - 'fcy;': 'ф', - 'female;': '♀', - 'ffilig;': 'ffi', - 'fflig;': 'ff', - 'ffllig;': 'ffl', - 'ffr;': '𝔣', - 'filig;': 'fi', - 'fjlig;': 'fj', - 'flat;': '♭', - 'fllig;': 'fl', - 'fltns;': '▱', - 'fnof;': 'ƒ', - 'fopf;': '𝕗', - 'forall;': '∀', - 'fork;': '⋔', - 'forkv;': '⫙', - 'fpartint;': '⨍', - frac12: '½', - 'frac12;': '½', - 'frac13;': '⅓', - frac14: '¼', - 'frac14;': '¼', - 'frac15;': '⅕', - 'frac16;': '⅙', - 'frac18;': '⅛', - 'frac23;': '⅔', - 'frac25;': '⅖', - frac34: '¾', - 'frac34;': '¾', - 'frac35;': '⅗', - 'frac38;': '⅜', - 'frac45;': '⅘', - 'frac56;': '⅚', - 'frac58;': '⅝', - 'frac78;': '⅞', - 'frasl;': '⁄', - 'frown;': '⌢', - 'fscr;': '𝒻', - 'gE;': '≧', - 'gEl;': '⪌', - 'gacute;': 'ǵ', - 'gamma;': 'γ', - 'gammad;': 'ϝ', - 'gap;': '⪆', - 'gbreve;': 'ğ', - 'gcirc;': 'ĝ', - 'gcy;': 'г', - 'gdot;': 'ġ', - 'ge;': '≥', - 'gel;': '⋛', - 'geq;': '≥', - 'geqq;': '≧', - 'geqslant;': '⩾', - 'ges;': '⩾', - 'gescc;': '⪩', - 'gesdot;': '⪀', - 'gesdoto;': '⪂', - 'gesdotol;': '⪄', - 'gesl;': '⋛︀', - 'gesles;': '⪔', - 'gfr;': '𝔤', - 'gg;': '≫', - 'ggg;': '⋙', - 'gimel;': 'ℷ', - 'gjcy;': 'ѓ', - 'gl;': '≷', - 'glE;': '⪒', - 'gla;': '⪥', - 'glj;': '⪤', - 'gnE;': '≩', - 'gnap;': '⪊', - 'gnapprox;': '⪊', - 'gne;': '⪈', - 'gneq;': '⪈', - 'gneqq;': '≩', - 'gnsim;': '⋧', - 'gopf;': '𝕘', - 'grave;': '`', - 'gscr;': 'ℊ', - 'gsim;': '≳', - 'gsime;': '⪎', - 'gsiml;': '⪐', - gt: '>', - 'gt;': '>', - 'gtcc;': '⪧', - 'gtcir;': '⩺', - 'gtdot;': '⋗', - 'gtlPar;': '⦕', - 'gtquest;': '⩼', - 'gtrapprox;': '⪆', - 'gtrarr;': '⥸', - 'gtrdot;': '⋗', - 'gtreqless;': '⋛', - 'gtreqqless;': '⪌', - 'gtrless;': '≷', - 'gtrsim;': '≳', - 'gvertneqq;': '≩︀', - 'gvnE;': '≩︀', - 'hArr;': '⇔', - 'hairsp;': ' ', - 'half;': '½', - 'hamilt;': 'ℋ', - 'hardcy;': 'ъ', - 'harr;': '↔', - 'harrcir;': '⥈', - 'harrw;': '↭', - 'hbar;': 'ℏ', - 'hcirc;': 'ĥ', - 'hearts;': '♥', - 'heartsuit;': '♥', - 'hellip;': '…', - 'hercon;': '⊹', - 'hfr;': '𝔥', - 'hksearow;': '⤥', - 'hkswarow;': '⤦', - 'hoarr;': '⇿', - 'homtht;': '∻', - 'hookleftarrow;': '↩', - 'hookrightarrow;': '↪', - 'hopf;': '𝕙', - 'horbar;': '―', - 'hscr;': '𝒽', - 'hslash;': 'ℏ', - 'hstrok;': 'ħ', - 'hybull;': '⁃', - 'hyphen;': '‐', - iacute: 'í', - 'iacute;': 'í', - 'ic;': '⁣', - icirc: 'î', - 'icirc;': 'î', - 'icy;': 'и', - 'iecy;': 'е', - iexcl: '¡', - 'iexcl;': '¡', - 'iff;': '⇔', - 'ifr;': '𝔦', - igrave: 'ì', - 'igrave;': 'ì', - 'ii;': 'ⅈ', - 'iiiint;': '⨌', - 'iiint;': '∭', - 'iinfin;': '⧜', - 'iiota;': '℩', - 'ijlig;': 'ij', - 'imacr;': 'ī', - 'image;': 'ℑ', - 'imagline;': 'ℐ', - 'imagpart;': 'ℑ', - 'imath;': 'ı', - 'imof;': '⊷', - 'imped;': 'Ƶ', - 'in;': '∈', - 'incare;': '℅', - 'infin;': '∞', - 'infintie;': '⧝', - 'inodot;': 'ı', - 'int;': '∫', - 'intcal;': '⊺', - 'integers;': 'ℤ', - 'intercal;': '⊺', - 'intlarhk;': '⨗', - 'intprod;': '⨼', - 'iocy;': 'ё', - 'iogon;': 'į', - 'iopf;': '𝕚', - 'iota;': 'ι', - 'iprod;': '⨼', - iquest: '¿', - 'iquest;': '¿', - 'iscr;': '𝒾', - 'isin;': '∈', - 'isinE;': '⋹', - 'isindot;': '⋵', - 'isins;': '⋴', - 'isinsv;': '⋳', - 'isinv;': '∈', - 'it;': '⁢', - 'itilde;': 'ĩ', - 'iukcy;': 'і', - iuml: 'ï', - 'iuml;': 'ï', - 'jcirc;': 'ĵ', - 'jcy;': 'й', - 'jfr;': '𝔧', - 'jmath;': 'ȷ', - 'jopf;': '𝕛', - 'jscr;': '𝒿', - 'jsercy;': 'ј', - 'jukcy;': 'є', - 'kappa;': 'κ', - 'kappav;': 'ϰ', - 'kcedil;': 'ķ', - 'kcy;': 'к', - 'kfr;': '𝔨', - 'kgreen;': 'ĸ', - 'khcy;': 'х', - 'kjcy;': 'ќ', - 'kopf;': '𝕜', - 'kscr;': '𝓀', - 'lAarr;': '⇚', - 'lArr;': '⇐', - 'lAtail;': '⤛', - 'lBarr;': '⤎', - 'lE;': '≦', - 'lEg;': '⪋', - 'lHar;': '⥢', - 'lacute;': 'ĺ', - 'laemptyv;': '⦴', - 'lagran;': 'ℒ', - 'lambda;': 'λ', - 'lang;': '⟨', - 'langd;': '⦑', - 'langle;': '⟨', - 'lap;': '⪅', - laquo: '«', - 'laquo;': '«', - 'larr;': '←', - 'larrb;': '⇤', - 'larrbfs;': '⤟', - 'larrfs;': '⤝', - 'larrhk;': '↩', - 'larrlp;': '↫', - 'larrpl;': '⤹', - 'larrsim;': '⥳', - 'larrtl;': '↢', - 'lat;': '⪫', - 'latail;': '⤙', - 'late;': '⪭', - 'lates;': '⪭︀', - 'lbarr;': '⤌', - 'lbbrk;': '❲', - 'lbrace;': '{', - 'lbrack;': '[', - 'lbrke;': '⦋', - 'lbrksld;': '⦏', - 'lbrkslu;': '⦍', - 'lcaron;': 'ľ', - 'lcedil;': 'ļ', - 'lceil;': '⌈', - 'lcub;': '{', - 'lcy;': 'л', - 'ldca;': '⤶', - 'ldquo;': '“', - 'ldquor;': '„', - 'ldrdhar;': '⥧', - 'ldrushar;': '⥋', - 'ldsh;': '↲', - 'le;': '≤', - 'leftarrow;': '←', - 'leftarrowtail;': '↢', - 'leftharpoondown;': '↽', - 'leftharpoonup;': '↼', - 'leftleftarrows;': '⇇', - 'leftrightarrow;': '↔', - 'leftrightarrows;': '⇆', - 'leftrightharpoons;': '⇋', - 'leftrightsquigarrow;': '↭', - 'leftthreetimes;': '⋋', - 'leg;': '⋚', - 'leq;': '≤', - 'leqq;': '≦', - 'leqslant;': '⩽', - 'les;': '⩽', - 'lescc;': '⪨', - 'lesdot;': '⩿', - 'lesdoto;': '⪁', - 'lesdotor;': '⪃', - 'lesg;': '⋚︀', - 'lesges;': '⪓', - 'lessapprox;': '⪅', - 'lessdot;': '⋖', - 'lesseqgtr;': '⋚', - 'lesseqqgtr;': '⪋', - 'lessgtr;': '≶', - 'lesssim;': '≲', - 'lfisht;': '⥼', - 'lfloor;': '⌊', - 'lfr;': '𝔩', - 'lg;': '≶', - 'lgE;': '⪑', - 'lhard;': '↽', - 'lharu;': '↼', - 'lharul;': '⥪', - 'lhblk;': '▄', - 'ljcy;': 'љ', - 'll;': '≪', - 'llarr;': '⇇', - 'llcorner;': '⌞', - 'llhard;': '⥫', - 'lltri;': '◺', - 'lmidot;': 'ŀ', - 'lmoust;': '⎰', - 'lmoustache;': '⎰', - 'lnE;': '≨', - 'lnap;': '⪉', - 'lnapprox;': '⪉', - 'lne;': '⪇', - 'lneq;': '⪇', - 'lneqq;': '≨', - 'lnsim;': '⋦', - 'loang;': '⟬', - 'loarr;': '⇽', - 'lobrk;': '⟦', - 'longleftarrow;': '⟵', - 'longleftrightarrow;': '⟷', - 'longmapsto;': '⟼', - 'longrightarrow;': '⟶', - 'looparrowleft;': '↫', - 'looparrowright;': '↬', - 'lopar;': '⦅', - 'lopf;': '𝕝', - 'loplus;': '⨭', - 'lotimes;': '⨴', - 'lowast;': '∗', - 'lowbar;': '_', - 'loz;': '◊', - 'lozenge;': '◊', - 'lozf;': '⧫', - 'lpar;': '(', - 'lparlt;': '⦓', - 'lrarr;': '⇆', - 'lrcorner;': '⌟', - 'lrhar;': '⇋', - 'lrhard;': '⥭', - 'lrm;': '‎', - 'lrtri;': '⊿', - 'lsaquo;': '‹', - 'lscr;': '𝓁', - 'lsh;': '↰', - 'lsim;': '≲', - 'lsime;': '⪍', - 'lsimg;': '⪏', - 'lsqb;': '[', - 'lsquo;': '‘', - 'lsquor;': '‚', - 'lstrok;': 'ł', - lt: '<', - 'lt;': '<', - 'ltcc;': '⪦', - 'ltcir;': '⩹', - 'ltdot;': '⋖', - 'lthree;': '⋋', - 'ltimes;': '⋉', - 'ltlarr;': '⥶', - 'ltquest;': '⩻', - 'ltrPar;': '⦖', - 'ltri;': '◃', - 'ltrie;': '⊴', - 'ltrif;': '◂', - 'lurdshar;': '⥊', - 'luruhar;': '⥦', - 'lvertneqq;': '≨︀', - 'lvnE;': '≨︀', - 'mDDot;': '∺', - macr: '¯', - 'macr;': '¯', - 'male;': '♂', - 'malt;': '✠', - 'maltese;': '✠', - 'map;': '↦', - 'mapsto;': '↦', - 'mapstodown;': '↧', - 'mapstoleft;': '↤', - 'mapstoup;': '↥', - 'marker;': '▮', - 'mcomma;': '⨩', - 'mcy;': 'м', - 'mdash;': '—', - 'measuredangle;': '∡', - 'mfr;': '𝔪', - 'mho;': '℧', - micro: 'µ', - 'micro;': 'µ', - 'mid;': '∣', - 'midast;': '*', - 'midcir;': '⫰', - middot: '·', - 'middot;': '·', - 'minus;': '−', - 'minusb;': '⊟', - 'minusd;': '∸', - 'minusdu;': '⨪', - 'mlcp;': '⫛', - 'mldr;': '…', - 'mnplus;': '∓', - 'models;': '⊧', - 'mopf;': '𝕞', - 'mp;': '∓', - 'mscr;': '𝓂', - 'mstpos;': '∾', - 'mu;': 'μ', - 'multimap;': '⊸', - 'mumap;': '⊸', - 'nGg;': '⋙̸', - 'nGt;': '≫⃒', - 'nGtv;': '≫̸', - 'nLeftarrow;': '⇍', - 'nLeftrightarrow;': '⇎', - 'nLl;': '⋘̸', - 'nLt;': '≪⃒', - 'nLtv;': '≪̸', - 'nRightarrow;': '⇏', - 'nVDash;': '⊯', - 'nVdash;': '⊮', - 'nabla;': '∇', - 'nacute;': 'ń', - 'nang;': '∠⃒', - 'nap;': '≉', - 'napE;': '⩰̸', - 'napid;': '≋̸', - 'napos;': 'ʼn', - 'napprox;': '≉', - 'natur;': '♮', - 'natural;': '♮', - 'naturals;': 'ℕ', - nbsp: ' ', - 'nbsp;': ' ', - 'nbump;': '≎̸', - 'nbumpe;': '≏̸', - 'ncap;': '⩃', - 'ncaron;': 'ň', - 'ncedil;': 'ņ', - 'ncong;': '≇', - 'ncongdot;': '⩭̸', - 'ncup;': '⩂', - 'ncy;': 'н', - 'ndash;': '–', - 'ne;': '≠', - 'neArr;': '⇗', - 'nearhk;': '⤤', - 'nearr;': '↗', - 'nearrow;': '↗', - 'nedot;': '≐̸', - 'nequiv;': '≢', - 'nesear;': '⤨', - 'nesim;': '≂̸', - 'nexist;': '∄', - 'nexists;': '∄', - 'nfr;': '𝔫', - 'ngE;': '≧̸', - 'nge;': '≱', - 'ngeq;': '≱', - 'ngeqq;': '≧̸', - 'ngeqslant;': '⩾̸', - 'nges;': '⩾̸', - 'ngsim;': '≵', - 'ngt;': '≯', - 'ngtr;': '≯', - 'nhArr;': '⇎', - 'nharr;': '↮', - 'nhpar;': '⫲', - 'ni;': '∋', - 'nis;': '⋼', - 'nisd;': '⋺', - 'niv;': '∋', - 'njcy;': 'њ', - 'nlArr;': '⇍', - 'nlE;': '≦̸', - 'nlarr;': '↚', - 'nldr;': '‥', - 'nle;': '≰', - 'nleftarrow;': '↚', - 'nleftrightarrow;': '↮', - 'nleq;': '≰', - 'nleqq;': '≦̸', - 'nleqslant;': '⩽̸', - 'nles;': '⩽̸', - 'nless;': '≮', - 'nlsim;': '≴', - 'nlt;': '≮', - 'nltri;': '⋪', - 'nltrie;': '⋬', - 'nmid;': '∤', - 'nopf;': '𝕟', - not: '¬', - 'not;': '¬', - 'notin;': '∉', - 'notinE;': '⋹̸', - 'notindot;': '⋵̸', - 'notinva;': '∉', - 'notinvb;': '⋷', - 'notinvc;': '⋶', - 'notni;': '∌', - 'notniva;': '∌', - 'notnivb;': '⋾', - 'notnivc;': '⋽', - 'npar;': '∦', - 'nparallel;': '∦', - 'nparsl;': '⫽⃥', - 'npart;': '∂̸', - 'npolint;': '⨔', - 'npr;': '⊀', - 'nprcue;': '⋠', - 'npre;': '⪯̸', - 'nprec;': '⊀', - 'npreceq;': '⪯̸', - 'nrArr;': '⇏', - 'nrarr;': '↛', - 'nrarrc;': '⤳̸', - 'nrarrw;': '↝̸', - 'nrightarrow;': '↛', - 'nrtri;': '⋫', - 'nrtrie;': '⋭', - 'nsc;': '⊁', - 'nsccue;': '⋡', - 'nsce;': '⪰̸', - 'nscr;': '𝓃', - 'nshortmid;': '∤', - 'nshortparallel;': '∦', - 'nsim;': '≁', - 'nsime;': '≄', - 'nsimeq;': '≄', - 'nsmid;': '∤', - 'nspar;': '∦', - 'nsqsube;': '⋢', - 'nsqsupe;': '⋣', - 'nsub;': '⊄', - 'nsubE;': '⫅̸', - 'nsube;': '⊈', - 'nsubset;': '⊂⃒', - 'nsubseteq;': '⊈', - 'nsubseteqq;': '⫅̸', - 'nsucc;': '⊁', - 'nsucceq;': '⪰̸', - 'nsup;': '⊅', - 'nsupE;': '⫆̸', - 'nsupe;': '⊉', - 'nsupset;': '⊃⃒', - 'nsupseteq;': '⊉', - 'nsupseteqq;': '⫆̸', - 'ntgl;': '≹', - ntilde: 'ñ', - 'ntilde;': 'ñ', - 'ntlg;': '≸', - 'ntriangleleft;': '⋪', - 'ntrianglelefteq;': '⋬', - 'ntriangleright;': '⋫', - 'ntrianglerighteq;': '⋭', - 'nu;': 'ν', - 'num;': '#', - 'numero;': '№', - 'numsp;': ' ', - 'nvDash;': '⊭', - 'nvHarr;': '⤄', - 'nvap;': '≍⃒', - 'nvdash;': '⊬', - 'nvge;': '≥⃒', - 'nvgt;': '>⃒', - 'nvinfin;': '⧞', - 'nvlArr;': '⤂', - 'nvle;': '≤⃒', - 'nvlt;': '<⃒', - 'nvltrie;': '⊴⃒', - 'nvrArr;': '⤃', - 'nvrtrie;': '⊵⃒', - 'nvsim;': '∼⃒', - 'nwArr;': '⇖', - 'nwarhk;': '⤣', - 'nwarr;': '↖', - 'nwarrow;': '↖', - 'nwnear;': '⤧', - 'oS;': 'Ⓢ', - oacute: 'ó', - 'oacute;': 'ó', - 'oast;': '⊛', - 'ocir;': '⊚', - ocirc: 'ô', - 'ocirc;': 'ô', - 'ocy;': 'о', - 'odash;': '⊝', - 'odblac;': 'ő', - 'odiv;': '⨸', - 'odot;': '⊙', - 'odsold;': '⦼', - 'oelig;': 'œ', - 'ofcir;': '⦿', - 'ofr;': '𝔬', - 'ogon;': '˛', - ograve: 'ò', - 'ograve;': 'ò', - 'ogt;': '⧁', - 'ohbar;': '⦵', - 'ohm;': 'Ω', - 'oint;': '∮', - 'olarr;': '↺', - 'olcir;': '⦾', - 'olcross;': '⦻', - 'oline;': '‾', - 'olt;': '⧀', - 'omacr;': 'ō', - 'omega;': 'ω', - 'omicron;': 'ο', - 'omid;': '⦶', - 'ominus;': '⊖', - 'oopf;': '𝕠', - 'opar;': '⦷', - 'operp;': '⦹', - 'oplus;': '⊕', - 'or;': '∨', - 'orarr;': '↻', - 'ord;': '⩝', - 'order;': 'ℴ', - 'orderof;': 'ℴ', - ordf: 'ª', - 'ordf;': 'ª', - ordm: 'º', - 'ordm;': 'º', - 'origof;': '⊶', - 'oror;': '⩖', - 'orslope;': '⩗', - 'orv;': '⩛', - 'oscr;': 'ℴ', - oslash: 'ø', - 'oslash;': 'ø', - 'osol;': '⊘', - otilde: 'õ', - 'otilde;': 'õ', - 'otimes;': '⊗', - 'otimesas;': '⨶', - ouml: 'ö', - 'ouml;': 'ö', - 'ovbar;': '⌽', - 'par;': '∥', - para: '¶', - 'para;': '¶', - 'parallel;': '∥', - 'parsim;': '⫳', - 'parsl;': '⫽', - 'part;': '∂', - 'pcy;': 'п', - 'percnt;': '%', - 'period;': '.', - 'permil;': '‰', - 'perp;': '⊥', - 'pertenk;': '‱', - 'pfr;': '𝔭', - 'phi;': 'φ', - 'phiv;': 'ϕ', - 'phmmat;': 'ℳ', - 'phone;': '☎', - 'pi;': 'π', - 'pitchfork;': '⋔', - 'piv;': 'ϖ', - 'planck;': 'ℏ', - 'planckh;': 'ℎ', - 'plankv;': 'ℏ', - 'plus;': '+', - 'plusacir;': '⨣', - 'plusb;': '⊞', - 'pluscir;': '⨢', - 'plusdo;': '∔', - 'plusdu;': '⨥', - 'pluse;': '⩲', - plusmn: '±', - 'plusmn;': '±', - 'plussim;': '⨦', - 'plustwo;': '⨧', - 'pm;': '±', - 'pointint;': '⨕', - 'popf;': '𝕡', - pound: '£', - 'pound;': '£', - 'pr;': '≺', - 'prE;': '⪳', - 'prap;': '⪷', - 'prcue;': '≼', - 'pre;': '⪯', - 'prec;': '≺', - 'precapprox;': '⪷', - 'preccurlyeq;': '≼', - 'preceq;': '⪯', - 'precnapprox;': '⪹', - 'precneqq;': '⪵', - 'precnsim;': '⋨', - 'precsim;': '≾', - 'prime;': '′', - 'primes;': 'ℙ', - 'prnE;': '⪵', - 'prnap;': '⪹', - 'prnsim;': '⋨', - 'prod;': '∏', - 'profalar;': '⌮', - 'profline;': '⌒', - 'profsurf;': '⌓', - 'prop;': '∝', - 'propto;': '∝', - 'prsim;': '≾', - 'prurel;': '⊰', - 'pscr;': '𝓅', - 'psi;': 'ψ', - 'puncsp;': ' ', - 'qfr;': '𝔮', - 'qint;': '⨌', - 'qopf;': '𝕢', - 'qprime;': '⁗', - 'qscr;': '𝓆', - 'quaternions;': 'ℍ', - 'quatint;': '⨖', - 'quest;': '?', - 'questeq;': '≟', - quot: '"', - 'quot;': '"', - 'rAarr;': '⇛', - 'rArr;': '⇒', - 'rAtail;': '⤜', - 'rBarr;': '⤏', - 'rHar;': '⥤', - 'race;': '∽̱', - 'racute;': 'ŕ', - 'radic;': '√', - 'raemptyv;': '⦳', - 'rang;': '⟩', - 'rangd;': '⦒', - 'range;': '⦥', - 'rangle;': '⟩', - raquo: '»', - 'raquo;': '»', - 'rarr;': '→', - 'rarrap;': '⥵', - 'rarrb;': '⇥', - 'rarrbfs;': '⤠', - 'rarrc;': '⤳', - 'rarrfs;': '⤞', - 'rarrhk;': '↪', - 'rarrlp;': '↬', - 'rarrpl;': '⥅', - 'rarrsim;': '⥴', - 'rarrtl;': '↣', - 'rarrw;': '↝', - 'ratail;': '⤚', - 'ratio;': '∶', - 'rationals;': 'ℚ', - 'rbarr;': '⤍', - 'rbbrk;': '❳', - 'rbrace;': '}', - 'rbrack;': ']', - 'rbrke;': '⦌', - 'rbrksld;': '⦎', - 'rbrkslu;': '⦐', - 'rcaron;': 'ř', - 'rcedil;': 'ŗ', - 'rceil;': '⌉', - 'rcub;': '}', - 'rcy;': 'р', - 'rdca;': '⤷', - 'rdldhar;': '⥩', - 'rdquo;': '”', - 'rdquor;': '”', - 'rdsh;': '↳', - 'real;': 'ℜ', - 'realine;': 'ℛ', - 'realpart;': 'ℜ', - 'reals;': 'ℝ', - 'rect;': '▭', - reg: '®', - 'reg;': '®', - 'rfisht;': '⥽', - 'rfloor;': '⌋', - 'rfr;': '𝔯', - 'rhard;': '⇁', - 'rharu;': '⇀', - 'rharul;': '⥬', - 'rho;': 'ρ', - 'rhov;': 'ϱ', - 'rightarrow;': '→', - 'rightarrowtail;': '↣', - 'rightharpoondown;': '⇁', - 'rightharpoonup;': '⇀', - 'rightleftarrows;': '⇄', - 'rightleftharpoons;': '⇌', - 'rightrightarrows;': '⇉', - 'rightsquigarrow;': '↝', - 'rightthreetimes;': '⋌', - 'ring;': '˚', - 'risingdotseq;': '≓', - 'rlarr;': '⇄', - 'rlhar;': '⇌', - 'rlm;': '‏', - 'rmoust;': '⎱', - 'rmoustache;': '⎱', - 'rnmid;': '⫮', - 'roang;': '⟭', - 'roarr;': '⇾', - 'robrk;': '⟧', - 'ropar;': '⦆', - 'ropf;': '𝕣', - 'roplus;': '⨮', - 'rotimes;': '⨵', - 'rpar;': ')', - 'rpargt;': '⦔', - 'rppolint;': '⨒', - 'rrarr;': '⇉', - 'rsaquo;': '›', - 'rscr;': '𝓇', - 'rsh;': '↱', - 'rsqb;': ']', - 'rsquo;': '’', - 'rsquor;': '’', - 'rthree;': '⋌', - 'rtimes;': '⋊', - 'rtri;': '▹', - 'rtrie;': '⊵', - 'rtrif;': '▸', - 'rtriltri;': '⧎', - 'ruluhar;': '⥨', - 'rx;': '℞', - 'sacute;': 'ś', - 'sbquo;': '‚', - 'sc;': '≻', - 'scE;': '⪴', - 'scap;': '⪸', - 'scaron;': 'š', - 'sccue;': '≽', - 'sce;': '⪰', - 'scedil;': 'ş', - 'scirc;': 'ŝ', - 'scnE;': '⪶', - 'scnap;': '⪺', - 'scnsim;': '⋩', - 'scpolint;': '⨓', - 'scsim;': '≿', - 'scy;': 'с', - 'sdot;': '⋅', - 'sdotb;': '⊡', - 'sdote;': '⩦', - 'seArr;': '⇘', - 'searhk;': '⤥', - 'searr;': '↘', - 'searrow;': '↘', - sect: '§', - 'sect;': '§', - 'semi;': ';', - 'seswar;': '⤩', - 'setminus;': '∖', - 'setmn;': '∖', - 'sext;': '✶', - 'sfr;': '𝔰', - 'sfrown;': '⌢', - 'sharp;': '♯', - 'shchcy;': 'щ', - 'shcy;': 'ш', - 'shortmid;': '∣', - 'shortparallel;': '∥', - shy: '­', - 'shy;': '­', - 'sigma;': 'σ', - 'sigmaf;': 'ς', - 'sigmav;': 'ς', - 'sim;': '∼', - 'simdot;': '⩪', - 'sime;': '≃', - 'simeq;': '≃', - 'simg;': '⪞', - 'simgE;': '⪠', - 'siml;': '⪝', - 'simlE;': '⪟', - 'simne;': '≆', - 'simplus;': '⨤', - 'simrarr;': '⥲', - 'slarr;': '←', - 'smallsetminus;': '∖', - 'smashp;': '⨳', - 'smeparsl;': '⧤', - 'smid;': '∣', - 'smile;': '⌣', - 'smt;': '⪪', - 'smte;': '⪬', - 'smtes;': '⪬︀', - 'softcy;': 'ь', - 'sol;': '/', - 'solb;': '⧄', - 'solbar;': '⌿', - 'sopf;': '𝕤', - 'spades;': '♠', - 'spadesuit;': '♠', - 'spar;': '∥', - 'sqcap;': '⊓', - 'sqcaps;': '⊓︀', - 'sqcup;': '⊔', - 'sqcups;': '⊔︀', - 'sqsub;': '⊏', - 'sqsube;': '⊑', - 'sqsubset;': '⊏', - 'sqsubseteq;': '⊑', - 'sqsup;': '⊐', - 'sqsupe;': '⊒', - 'sqsupset;': '⊐', - 'sqsupseteq;': '⊒', - 'squ;': '□', - 'square;': '□', - 'squarf;': '▪', - 'squf;': '▪', - 'srarr;': '→', - 'sscr;': '𝓈', - 'ssetmn;': '∖', - 'ssmile;': '⌣', - 'sstarf;': '⋆', - 'star;': '☆', - 'starf;': '★', - 'straightepsilon;': 'ϵ', - 'straightphi;': 'ϕ', - 'strns;': '¯', - 'sub;': '⊂', - 'subE;': '⫅', - 'subdot;': '⪽', - 'sube;': '⊆', - 'subedot;': '⫃', - 'submult;': '⫁', - 'subnE;': '⫋', - 'subne;': '⊊', - 'subplus;': '⪿', - 'subrarr;': '⥹', - 'subset;': '⊂', - 'subseteq;': '⊆', - 'subseteqq;': '⫅', - 'subsetneq;': '⊊', - 'subsetneqq;': '⫋', - 'subsim;': '⫇', - 'subsub;': '⫕', - 'subsup;': '⫓', - 'succ;': '≻', - 'succapprox;': '⪸', - 'succcurlyeq;': '≽', - 'succeq;': '⪰', - 'succnapprox;': '⪺', - 'succneqq;': '⪶', - 'succnsim;': '⋩', - 'succsim;': '≿', - 'sum;': '∑', - 'sung;': '♪', - sup1: '¹', - 'sup1;': '¹', - sup2: '²', - 'sup2;': '²', - sup3: '³', - 'sup3;': '³', - 'sup;': '⊃', - 'supE;': '⫆', - 'supdot;': '⪾', - 'supdsub;': '⫘', - 'supe;': '⊇', - 'supedot;': '⫄', - 'suphsol;': '⟉', - 'suphsub;': '⫗', - 'suplarr;': '⥻', - 'supmult;': '⫂', - 'supnE;': '⫌', - 'supne;': '⊋', - 'supplus;': '⫀', - 'supset;': '⊃', - 'supseteq;': '⊇', - 'supseteqq;': '⫆', - 'supsetneq;': '⊋', - 'supsetneqq;': '⫌', - 'supsim;': '⫈', - 'supsub;': '⫔', - 'supsup;': '⫖', - 'swArr;': '⇙', - 'swarhk;': '⤦', - 'swarr;': '↙', - 'swarrow;': '↙', - 'swnwar;': '⤪', - szlig: 'ß', - 'szlig;': 'ß', - 'target;': '⌖', - 'tau;': 'τ', - 'tbrk;': '⎴', - 'tcaron;': 'ť', - 'tcedil;': 'ţ', - 'tcy;': 'т', - 'tdot;': '⃛', - 'telrec;': '⌕', - 'tfr;': '𝔱', - 'there4;': '∴', - 'therefore;': '∴', - 'theta;': 'θ', - 'thetasym;': 'ϑ', - 'thetav;': 'ϑ', - 'thickapprox;': '≈', - 'thicksim;': '∼', - 'thinsp;': ' ', - 'thkap;': '≈', - 'thksim;': '∼', - thorn: 'þ', - 'thorn;': 'þ', - 'tilde;': '˜', - times: '×', - 'times;': '×', - 'timesb;': '⊠', - 'timesbar;': '⨱', - 'timesd;': '⨰', - 'tint;': '∭', - 'toea;': '⤨', - 'top;': '⊤', - 'topbot;': '⌶', - 'topcir;': '⫱', - 'topf;': '𝕥', - 'topfork;': '⫚', - 'tosa;': '⤩', - 'tprime;': '‴', - 'trade;': '™', - 'triangle;': '▵', - 'triangledown;': '▿', - 'triangleleft;': '◃', - 'trianglelefteq;': '⊴', - 'triangleq;': '≜', - 'triangleright;': '▹', - 'trianglerighteq;': '⊵', - 'tridot;': '◬', - 'trie;': '≜', - 'triminus;': '⨺', - 'triplus;': '⨹', - 'trisb;': '⧍', - 'tritime;': '⨻', - 'trpezium;': '⏢', - 'tscr;': '𝓉', - 'tscy;': 'ц', - 'tshcy;': 'ћ', - 'tstrok;': 'ŧ', - 'twixt;': '≬', - 'twoheadleftarrow;': '↞', - 'twoheadrightarrow;': '↠', - 'uArr;': '⇑', - 'uHar;': '⥣', - uacute: 'ú', - 'uacute;': 'ú', - 'uarr;': '↑', - 'ubrcy;': 'ў', - 'ubreve;': 'ŭ', - ucirc: 'û', - 'ucirc;': 'û', - 'ucy;': 'у', - 'udarr;': '⇅', - 'udblac;': 'ű', - 'udhar;': '⥮', - 'ufisht;': '⥾', - 'ufr;': '𝔲', - ugrave: 'ù', - 'ugrave;': 'ù', - 'uharl;': '↿', - 'uharr;': '↾', - 'uhblk;': '▀', - 'ulcorn;': '⌜', - 'ulcorner;': '⌜', - 'ulcrop;': '⌏', - 'ultri;': '◸', - 'umacr;': 'ū', - uml: '¨', - 'uml;': '¨', - 'uogon;': 'ų', - 'uopf;': '𝕦', - 'uparrow;': '↑', - 'updownarrow;': '↕', - 'upharpoonleft;': '↿', - 'upharpoonright;': '↾', - 'uplus;': '⊎', - 'upsi;': 'υ', - 'upsih;': 'ϒ', - 'upsilon;': 'υ', - 'upuparrows;': '⇈', - 'urcorn;': '⌝', - 'urcorner;': '⌝', - 'urcrop;': '⌎', - 'uring;': 'ů', - 'urtri;': '◹', - 'uscr;': '𝓊', - 'utdot;': '⋰', - 'utilde;': 'ũ', - 'utri;': '▵', - 'utrif;': '▴', - 'uuarr;': '⇈', - uuml: 'ü', - 'uuml;': 'ü', - 'uwangle;': '⦧', - 'vArr;': '⇕', - 'vBar;': '⫨', - 'vBarv;': '⫩', - 'vDash;': '⊨', - 'vangrt;': '⦜', - 'varepsilon;': 'ϵ', - 'varkappa;': 'ϰ', - 'varnothing;': '∅', - 'varphi;': 'ϕ', - 'varpi;': 'ϖ', - 'varpropto;': '∝', - 'varr;': '↕', - 'varrho;': 'ϱ', - 'varsigma;': 'ς', - 'varsubsetneq;': '⊊︀', - 'varsubsetneqq;': '⫋︀', - 'varsupsetneq;': '⊋︀', - 'varsupsetneqq;': '⫌︀', - 'vartheta;': 'ϑ', - 'vartriangleleft;': '⊲', - 'vartriangleright;': '⊳', - 'vcy;': 'в', - 'vdash;': '⊢', - 'vee;': '∨', - 'veebar;': '⊻', - 'veeeq;': '≚', - 'vellip;': '⋮', - 'verbar;': '|', - 'vert;': '|', - 'vfr;': '𝔳', - 'vltri;': '⊲', - 'vnsub;': '⊂⃒', - 'vnsup;': '⊃⃒', - 'vopf;': '𝕧', - 'vprop;': '∝', - 'vrtri;': '⊳', - 'vscr;': '𝓋', - 'vsubnE;': '⫋︀', - 'vsubne;': '⊊︀', - 'vsupnE;': '⫌︀', - 'vsupne;': '⊋︀', - 'vzigzag;': '⦚', - 'wcirc;': 'ŵ', - 'wedbar;': '⩟', - 'wedge;': '∧', - 'wedgeq;': '≙', - 'weierp;': '℘', - 'wfr;': '𝔴', - 'wopf;': '𝕨', - 'wp;': '℘', - 'wr;': '≀', - 'wreath;': '≀', - 'wscr;': '𝓌', - 'xcap;': '⋂', - 'xcirc;': '◯', - 'xcup;': '⋃', - 'xdtri;': '▽', - 'xfr;': '𝔵', - 'xhArr;': '⟺', - 'xharr;': '⟷', - 'xi;': 'ξ', - 'xlArr;': '⟸', - 'xlarr;': '⟵', - 'xmap;': '⟼', - 'xnis;': '⋻', - 'xodot;': '⨀', - 'xopf;': '𝕩', - 'xoplus;': '⨁', - 'xotime;': '⨂', - 'xrArr;': '⟹', - 'xrarr;': '⟶', - 'xscr;': '𝓍', - 'xsqcup;': '⨆', - 'xuplus;': '⨄', - 'xutri;': '△', - 'xvee;': '⋁', - 'xwedge;': '⋀', - yacute: 'ý', - 'yacute;': 'ý', - 'yacy;': 'я', - 'ycirc;': 'ŷ', - 'ycy;': 'ы', - yen: '¥', - 'yen;': '¥', - 'yfr;': '𝔶', - 'yicy;': 'ї', - 'yopf;': '𝕪', - 'yscr;': '𝓎', - 'yucy;': 'ю', - yuml: 'ÿ', - 'yuml;': 'ÿ', - 'zacute;': 'ź', - 'zcaron;': 'ž', - 'zcy;': 'з', - 'zdot;': 'ż', - 'zeetrf;': 'ℨ', - 'zeta;': 'ζ', - 'zfr;': '𝔷', - 'zhcy;': 'ж', - 'zigrarr;': '⇝', - 'zopf;': '𝕫', - 'zscr;': '𝓏', - 'zwj;': '‍', - 'zwnj;': '‌' -}; - -const numeric = /&#(x)?([0-9a-f]+);/i; -const named = new RegExp( - `&(${Object.keys(entities) - .sort((a, b) => b.length - a.length) - .join('|')})`, - 'g' -); - -/** @param {string} str */ -export function decode(str) { - return str - .replace(numeric, (_match, hex, code) => String.fromCharCode(hex ? parseInt(code, 16) : +code)) - .replace(named, (_match, entity) => entities[entity]); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/fallback.js b/frontend/node_modules/@sveltejs/kit/src/core/postbuild/fallback.js deleted file mode 100644 index 3935688..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/fallback.js +++ /dev/null @@ -1,55 +0,0 @@ -import { readFileSync } from 'node:fs'; -import { join } from 'node:path'; -import { pathToFileURL } from 'node:url'; -import { installPolyfills } from '../../exports/node/polyfills.js'; -import { load_config } from '../config/index.js'; -import { forked } from '../../utils/fork.js'; - -export default forked(import.meta.url, generate_fallback); - -/** - * @param {{ - * manifest_path: string; - * env: Record - * }} opts - */ -async function generate_fallback({ manifest_path, env }) { - /** @type {import('types').ValidatedKitConfig} */ - const config = (await load_config()).kit; - - installPolyfills(); - - const server_root = join(config.outDir, 'output'); - - /** @type {import('types').ServerInternalModule} */ - const { set_building } = await import(pathToFileURL(`${server_root}/server/internal.js`).href); - - /** @type {import('types').ServerModule} */ - const { Server } = await import(pathToFileURL(`${server_root}/server/index.js`).href); - - /** @type {import('@sveltejs/kit').SSRManifest} */ - const manifest = (await import(pathToFileURL(manifest_path).href)).manifest; - - set_building(); - - const server = new Server(manifest); - await server.init({ env }); - - const response = await server.respond(new Request(config.prerender.origin + '/[fallback]'), { - getClientAddress: () => { - throw new Error('Cannot read clientAddress during prerendering'); - }, - prerendering: { - fallback: true, - dependencies: new Map(), - remote_responses: new Map() - }, - read: (file) => readFileSync(join(config.files.assets, file)) - }); - - if (response.ok) { - return await response.text(); - } - - throw new Error(`Could not create a fallback page — failed with status ${response.status}`); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js b/frontend/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js deleted file mode 100644 index 12223d2..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js +++ /dev/null @@ -1,597 +0,0 @@ -import { existsSync, readFileSync, statSync, writeFileSync } from 'node:fs'; -import { dirname, join } from 'node:path'; -import { pathToFileURL } from 'node:url'; -import { installPolyfills } from '../../exports/node/polyfills.js'; -import { mkdirp, posixify, walk } from '../../utils/filesystem.js'; -import { noop } from '../../utils/functions.js'; -import { decode_uri, is_root_relative, resolve } from '../../utils/url.js'; -import { escape_html } from '../../utils/escape.js'; -import { logger } from '../utils.js'; -import { load_config } from '../config/index.js'; -import { get_route_segments } from '../../utils/routing.js'; -import { queue } from './queue.js'; -import { crawl } from './crawl.js'; -import { forked } from '../../utils/fork.js'; -import * as devalue from 'devalue'; -import { createReadableStream } from '@sveltejs/kit/node'; -import generate_fallback from './fallback.js'; -import { stringify_remote_arg } from '../../runtime/shared.js'; -import { filter_env } from '../../utils/env.js'; - -export default forked(import.meta.url, prerender); - -// https://html.spec.whatwg.org/multipage/browsing-the-web.html#scrolling-to-a-fragment -// "If fragment is the empty string, then return the special value top of the document." -// ...and -// "If decodedFragment is an ASCII case-insensitive match for the string 'top', then return the top of the document." -const SPECIAL_HASHLINKS = new Set(['', 'top']); - -/** - * @param {{ - * hash: boolean; - * out: string; - * manifest_path: string; - * metadata: import('types').ServerMetadata; - * verbose: boolean; - * env: Record - * }} opts - */ -async function prerender({ hash, out, manifest_path, metadata, verbose, env }) { - /** @type {import('@sveltejs/kit').SSRManifest} */ - const manifest = (await import(pathToFileURL(manifest_path).href)).manifest; - - /** @type {import('types').ServerInternalModule} */ - const internal = await import(pathToFileURL(`${out}/server/internal.js`).href); - - /** @type {import('types').ServerModule} */ - const { Server } = await import(pathToFileURL(`${out}/server/index.js`).href); - - // configure `import { building } from '$app/environment'` — - // essential we do this before analysing the code - internal.set_building(); - internal.set_prerendering(); - - /** - * @template {{message: string}} T - * @template {Omit} K - * @param {import('types').Logger} log - * @param {'fail' | 'warn' | 'ignore' | ((details: T) => void)} input - * @param {(details: K) => string} format - * @returns {(details: K) => void} - */ - function normalise_error_handler(log, input, format) { - switch (input) { - case 'fail': - return (details) => { - throw new Error(format(details)); - }; - case 'warn': - return (details) => { - log.error(format(details)); - }; - case 'ignore': - return noop; - default: - // @ts-expect-error TS thinks T might be of a different kind, but it's not - return (details) => input({ ...details, message: format(details) }); - } - } - - const OK = 2; - const REDIRECT = 3; - - /** @type {import('types').Prerendered} */ - const prerendered = { - pages: new Map(), - assets: new Map(), - redirects: new Map(), - paths: [] - }; - - /** @type {import('types').PrerenderMap} */ - const prerender_map = new Map(); - - for (const [id, { prerender }] of metadata.routes) { - if (prerender !== undefined) { - prerender_map.set(id, prerender); - } - } - - /** @type {Set} */ - const prerendered_routes = new Set(); - - /** @type {import('types').ValidatedKitConfig} */ - const config = (await load_config()).kit; - - if (hash) { - const fallback = await generate_fallback({ - manifest_path, - env - }); - - const file = output_filename('/', true); - const dest = `${config.outDir}/output/prerendered/pages/${file}`; - - mkdirp(dirname(dest)); - writeFileSync(dest, fallback); - - prerendered.pages.set('/', { file }); - - return { prerendered, prerender_map }; - } - - const emulator = await config.adapter?.emulate?.(); - - /** @type {import('types').Logger} */ - const log = logger({ verbose }); - - installPolyfills(); - - /** @type {Map} */ - const saved = new Map(); - - const handle_http_error = normalise_error_handler( - log, - config.prerender.handleHttpError, - ({ status, path, referrer, referenceType }) => { - const message = - status === 404 && !path.startsWith(config.paths.base) - ? `${path} does not begin with \`base\`, which is configured in \`paths.base\` and can be imported from \`$app/paths\` - see https://svelte.dev/docs/kit/configuration#paths for more info` - : path; - - return `${status} ${message}${referrer ? ` (${referenceType} from ${referrer})` : ''}`; - } - ); - - const handle_missing_id = normalise_error_handler( - log, - config.prerender.handleMissingId, - ({ path, id, referrers }) => { - return ( - `The following pages contain links to ${path}#${id}, but no element with id="${id}" exists on ${path} - see the \`handleMissingId\` option in https://svelte.dev/docs/kit/configuration#prerender for more info:` + - referrers.map((l) => `\n - ${l}`).join('') - ); - } - ); - - const handle_entry_generator_mismatch = normalise_error_handler( - log, - config.prerender.handleEntryGeneratorMismatch, - ({ generatedFromId, entry, matchedId }) => { - return `The entries export from ${generatedFromId} generated entry ${entry}, which was matched by ${matchedId} - see the \`handleEntryGeneratorMismatch\` option in https://svelte.dev/docs/kit/configuration#prerender for more info.`; - } - ); - - const handle_not_prerendered_route = normalise_error_handler( - log, - config.prerender.handleUnseenRoutes, - ({ routes }) => { - const list = routes.map((id) => ` - ${id}`).join('\n'); - return `The following routes were marked as prerenderable, but were not prerendered because they were not found while crawling your app:\n${list}\n\nSee the \`handleUnseenRoutes\` option in https://svelte.dev/docs/kit/configuration#prerender for more info.`; - } - ); - - const q = queue(config.prerender.concurrency); - - /** - * @param {string} path - * @param {boolean} is_html - */ - function output_filename(path, is_html) { - const file = path.slice(config.paths.base.length + 1) || 'index.html'; - - if (is_html && !file.endsWith('.html')) { - return file + (file.endsWith('/') ? 'index.html' : '.html'); - } - - return file; - } - - const files = new Set(walk(`${out}/client`).map(posixify)); - files.add(`${config.appDir}/env.js`); - - const immutable = `${config.appDir}/immutable`; - if (existsSync(`${out}/server/${immutable}`)) { - for (const file of walk(`${out}/server/${immutable}`)) { - files.add(posixify(`${config.appDir}/immutable/${file}`)); - } - } - - const remote_prefix = `${config.paths.base}/${config.appDir}/remote/`; - - const seen = new Set(); - const written = new Set(); - const remote_responses = new Map(); - - /** @type {Map>} */ - const expected_hashlinks = new Map(); - - /** @type {Map} */ - const actual_hashlinks = new Map(); - - /** - * @param {string | null} referrer - * @param {string} decoded - * @param {string} [encoded] - * @param {string} [generated_from_id] - */ - function enqueue(referrer, decoded, encoded, generated_from_id) { - if (seen.has(decoded)) return; - seen.add(decoded); - - const file = decoded.slice(config.paths.base.length + 1); - if (files.has(file)) return; - - return q.add(() => visit(decoded, encoded || encodeURI(decoded), referrer, generated_from_id)); - } - - /** - * @param {string} decoded - * @param {string} encoded - * @param {string?} referrer - * @param {string} [generated_from_id] - */ - async function visit(decoded, encoded, referrer, generated_from_id) { - if (!decoded.startsWith(config.paths.base)) { - handle_http_error({ status: 404, path: decoded, referrer, referenceType: 'linked' }); - return; - } - - /** @type {Map} */ - const dependencies = new Map(); - - const response = await server.respond(new Request(config.prerender.origin + encoded), { - getClientAddress() { - throw new Error('Cannot read clientAddress during prerendering'); - }, - prerendering: { - dependencies, - remote_responses - }, - read: (file) => { - // stuff we just wrote - const filepath = saved.get(file); - if (filepath) return readFileSync(filepath); - - // Static assets emitted during build - if (file.startsWith(config.appDir)) { - return readFileSync(`${out}/server/${file}`); - } - - // stuff in `static` - return readFileSync(join(config.files.assets, file)); - }, - emulator - }); - - const encoded_id = response.headers.get('x-sveltekit-routeid'); - const decoded_id = encoded_id && decode_uri(encoded_id); - if ( - decoded_id !== null && - generated_from_id !== undefined && - decoded_id !== generated_from_id - ) { - handle_entry_generator_mismatch({ - generatedFromId: generated_from_id, - entry: decoded, - matchedId: decoded_id - }); - } - - const body = Buffer.from(await response.arrayBuffer()); - - const category = decoded.startsWith(remote_prefix) ? 'data' : 'pages'; - save(category, response, body, decoded, encoded, referrer, 'linked'); - - for (const [dependency_path, result] of dependencies) { - // this seems circuitous, but using new URL allows us to not care - // whether dependency_path is encoded or not - const encoded_dependency_path = new URL(dependency_path, 'http://localhost').pathname; - const decoded_dependency_path = decode_uri(encoded_dependency_path); - - const headers = Object.fromEntries(result.response.headers); - - const prerender = headers['x-sveltekit-prerender']; - if (prerender) { - const encoded_route_id = headers['x-sveltekit-routeid']; - if (encoded_route_id != null) { - const route_id = decode_uri(encoded_route_id); - const existing_value = prerender_map.get(route_id); - if (existing_value !== 'auto') { - prerender_map.set(route_id, prerender === 'true' ? true : 'auto'); - } - } - } - - const body = result.body ?? new Uint8Array(await result.response.arrayBuffer()); - - const category = decoded_dependency_path.startsWith(remote_prefix) ? 'data' : 'dependencies'; - - save( - category, - result.response, - body, - decoded_dependency_path, - encoded_dependency_path, - decoded, - 'fetched' - ); - } - - // avoid triggering `filterSerializeResponseHeaders` guard - const headers = Object.fromEntries(response.headers); - - // if it's a 200 HTML response, crawl it. Skip error responses, as we don't save those - if (response.ok && config.prerender.crawl && headers['content-type'] === 'text/html') { - const { ids, hrefs } = crawl(body.toString(), decoded); - - actual_hashlinks.set(decoded, ids); - - /** @param {string} href */ - const removePrerenderOrigin = (href) => { - if (href.startsWith(config.prerender.origin)) { - if (href === config.prerender.origin) return '/'; - if (href.at(config.prerender.origin.length) !== '/') return href; - return href.slice(config.prerender.origin.length); - } - return href; - }; - - for (const href of hrefs.map(removePrerenderOrigin)) { - if (!is_root_relative(href)) continue; - - const { pathname, search, hash } = new URL(href, 'http://localhost'); - - if (search) { - // TODO warn that query strings have no effect on statically-exported pages - } - - if (hash) { - const key = decode_uri(pathname + hash); - - if (!expected_hashlinks.has(key)) { - expected_hashlinks.set(key, new Set()); - } - - /** @type {Set} */ (expected_hashlinks.get(key)).add(decoded); - } - - void enqueue(decoded, decode_uri(pathname), pathname); - } - } - } - - /** - * @param {'pages' | 'dependencies' | 'data'} category - * @param {Response} response - * @param {string | Uint8Array} body - * @param {string} decoded - * @param {string} encoded - * @param {string | null} referrer - * @param {'linked' | 'fetched'} referenceType - */ - function save(category, response, body, decoded, encoded, referrer, referenceType) { - const response_type = Math.floor(response.status / 100); - const headers = Object.fromEntries(response.headers); - - const type = headers['content-type']; - const is_html = response_type === REDIRECT || type === 'text/html'; - - const file = output_filename(decoded, is_html); - const dest = `${config.outDir}/output/prerendered/${category}/${file}`; - - if (written.has(file)) return; - - const encoded_route_id = response.headers.get('x-sveltekit-routeid'); - const route_id = encoded_route_id != null ? decode_uri(encoded_route_id) : null; - if (route_id !== null) prerendered_routes.add(route_id); - - if (response_type === REDIRECT) { - const location = headers['location']; - - if (location) { - const resolved = resolve(encoded, location); - if (is_root_relative(resolved)) { - void enqueue(decoded, decode_uri(resolved), resolved); - } - - if (!headers['x-sveltekit-normalize']) { - mkdirp(dirname(dest)); - - log.warn(`${response.status} ${decoded} -> ${location}`); - - writeFileSync( - dest, - `` - ); - - written.add(file); - - if (!prerendered.redirects.has(decoded)) { - prerendered.redirects.set(decoded, { - status: response.status, - location: resolved - }); - - prerendered.paths.push(decoded); - } - } - } else { - log.warn(`location header missing on redirect received from ${decoded}`); - } - - return; - } - - if (response.status === 200) { - if (existsSync(dest) && statSync(dest).isDirectory()) { - throw new Error( - `Cannot save ${decoded} as it is already a directory. See https://svelte.dev/docs/kit/page-options#prerender-route-conflicts for more information` - ); - } - - const dir = dirname(dest); - - if (existsSync(dir) && !statSync(dir).isDirectory()) { - const parent = decoded.split('/').slice(0, -1).join('/'); - throw new Error( - `Cannot save ${decoded} as ${parent} is already a file. See https://svelte.dev/docs/kit/page-options#prerender-route-conflicts for more information` - ); - } - - mkdirp(dir); - - log.info(`${response.status} ${decoded}`); - writeFileSync(dest, body); - written.add(file); - - if (is_html) { - prerendered.pages.set(decoded, { - file - }); - } else { - prerendered.assets.set(decoded, { - type - }); - } - - prerendered.paths.push(decoded); - } else if (response_type !== OK) { - handle_http_error({ status: response.status, path: decoded, referrer, referenceType }); - } - - manifest.assets.add(file); - saved.set(file, dest); - } - - /** @type {Array<{ id: string, entries: Array}>} */ - const route_level_entries = []; - for (const [id, { entries }] of metadata.routes.entries()) { - if (entries) { - route_level_entries.push({ id, entries }); - } - } - - let should_prerender = false; - - for (const value of prerender_map.values()) { - if (value) { - should_prerender = true; - break; - } - } - - // the user's remote function modules may reference environment variables, - // `read` or the `manifest` at the top-level so we need to set them before - // evaluating those modules to avoid potential runtime errors - const { publicPrefix: public_prefix, privatePrefix: private_prefix } = config.env; - const private_env = filter_env(env, private_prefix, public_prefix); - const public_env = filter_env(env, public_prefix, private_prefix); - internal.set_private_env(private_env); - internal.set_public_env(public_env); - internal.set_manifest(manifest); - internal.set_read_implementation((file) => createReadableStream(`${out}/server/${file}`)); - - /** @type {Array} */ - const prerender_functions = []; - - for (const loader of Object.values(manifest._.remotes)) { - const module = await loader(); - - for (const fn of Object.values(module.default)) { - if (fn?.__?.type === 'prerender') { - prerender_functions.push(fn.__); - should_prerender = true; - } - } - } - - if (!should_prerender) { - return { prerendered, prerender_map }; - } - - // only run the server after the `should_prerender` check so that we - // don't run the user's init hook unnecessarily - const server = new Server(manifest); - await server.init({ - env, - read: (file) => createReadableStream(`${config.outDir}/output/server/${file}`) - }); - - log.info('Prerendering'); - - for (const entry of config.prerender.entries) { - if (entry === '*') { - for (const [id, prerender] of prerender_map) { - if (prerender) { - // remove optional parameters from the route - const segments = get_route_segments(id).filter((segment) => !segment.startsWith('[[')); - const processed_id = '/' + segments.join('/'); - - if (processed_id.includes('[')) continue; - const path = `/${get_route_segments(processed_id).join('/')}`; - void enqueue(null, config.paths.base + path); - } - } - } else { - void enqueue(null, config.paths.base + entry); - } - } - - for (const { id, entries } of route_level_entries) { - for (const entry of entries) { - void enqueue(null, config.paths.base + entry, undefined, id); - } - } - - const transport = (await internal.get_hooks()).transport ?? {}; - for (const internals of prerender_functions) { - if (internals.has_arg) { - for (const arg of (await internals.inputs?.()) ?? []) { - void enqueue( - null, - remote_prefix + internals.id + '/' + stringify_remote_arg(arg, transport) - ); - } - } else { - void enqueue(null, remote_prefix + internals.id); - } - } - - await q.done(); - - // handle invalid fragment links - for (const [key, referrers] of expected_hashlinks) { - const index = key.indexOf('#'); - const path = key.slice(0, index); - const id = key.slice(index + 1); - - const hashlinks = actual_hashlinks.get(path); - // ignore fragment links to pages that were not prerendered - if (!hashlinks) continue; - - if (!hashlinks.includes(id) && !SPECIAL_HASHLINKS.has(id)) { - handle_missing_id({ id, path, referrers: Array.from(referrers) }); - } - } - - /** @type {string[]} */ - const not_prerendered = []; - - for (const [route_id, prerender] of prerender_map) { - if (prerender === true && !prerendered_routes.has(route_id)) { - not_prerendered.push(route_id); - } - } - - if (not_prerendered.length > 0) { - handle_not_prerendered_route({ routes: not_prerendered }); - } - - return { prerendered, prerender_map }; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/queue.js b/frontend/node_modules/@sveltejs/kit/src/core/postbuild/queue.js deleted file mode 100644 index a816e6e..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/postbuild/queue.js +++ /dev/null @@ -1,72 +0,0 @@ -/** @import { PromiseWithResolvers } from '../../utils/promise.js' */ -import { with_resolvers } from '../../utils/promise.js'; - -/** - * @typedef {{ - * fn: () => Promise, - * fulfil: (value: any) => void, - * reject: (error: Error) => void - * }} Task - */ - -/** @param {number} concurrency */ -export function queue(concurrency) { - /** @type {Task[]} */ - const tasks = []; - const { promise, resolve, reject } = /** @type {PromiseWithResolvers} */ (with_resolvers()); - - let current = 0; - let closed = false; - - promise.catch(() => { - // this is necessary in case a catch handler is never added - // to the done promise by the user - }); - - function dequeue() { - if (current < concurrency) { - const task = tasks.shift(); - - if (task) { - current += 1; - const promise = Promise.resolve(task.fn()); - - void promise - .then(task.fulfil, (err) => { - task.reject(err); - reject(err); - }) - .then(() => { - current -= 1; - dequeue(); - }); - } else if (current === 0) { - closed = true; - resolve(); - } - } - } - - return { - /** @param {() => any} fn */ - add: (fn) => { - if (closed) throw new Error('Cannot add tasks to a queue that has ended'); - - const promise = new Promise((fulfil, reject) => { - tasks.push({ fn, fulfil, reject }); - }); - - dequeue(); - return promise; - }, - - done: () => { - if (current === 0) { - closed = true; - resolve(); - } - - return promise; - } - }; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/conflict.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/conflict.js deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/index.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/index.js deleted file mode 100644 index 5facdc7..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/index.js +++ /dev/null @@ -1,613 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import process from 'node:process'; -import colors from 'kleur'; -import { lookup } from 'mrmime'; -import { list_files, runtime_directory } from '../../utils.js'; -import { posixify, resolve_entry } from '../../../utils/filesystem.js'; -import { parse_route_id } from '../../../utils/routing.js'; -import { sort_routes } from './sort.js'; -import { isSvelte5Plus } from '../utils.js'; -import { - create_node_analyser, - get_page_options -} from '../../../exports/vite/static_analysis/index.js'; - -/** - * Generates the manifest data used for the client-side manifest and types generation. - * @param {{ - * config: import('types').ValidatedConfig; - * fallback?: string; - * cwd?: string; - * }} opts - * @returns {import('types').ManifestData} - */ -export default function create_manifest_data({ - config, - fallback = `${runtime_directory}/components/${isSvelte5Plus() ? 'svelte-5' : 'svelte-4'}`, - cwd = process.cwd() -}) { - const assets = create_assets(config); - const hooks = create_hooks(config, cwd); - const matchers = create_matchers(config, cwd); - const { nodes, routes } = create_routes_and_nodes(cwd, config, fallback); - - for (const route of routes) { - for (const param of route.params) { - if (param.matcher && !matchers[param.matcher]) { - throw new Error(`No matcher found for parameter '${param.matcher}' in route ${route.id}`); - } - } - } - - return { - assets, - hooks, - matchers, - nodes, - routes - }; -} - -/** - * @param {import('types').ValidatedConfig} config - */ -export function create_assets(config) { - return list_files(config.kit.files.assets).map((file) => ({ - file, - size: fs.statSync(path.resolve(config.kit.files.assets, file)).size, - type: lookup(file) || null - })); -} - -/** - * @param {import('types').ValidatedConfig} config - * @param {string} cwd - */ -function create_hooks(config, cwd) { - const client = resolve_entry(config.kit.files.hooks.client); - const server = resolve_entry(config.kit.files.hooks.server); - const universal = resolve_entry(config.kit.files.hooks.universal); - - return { - client: client && posixify(path.relative(cwd, client)), - server: server && posixify(path.relative(cwd, server)), - universal: universal && posixify(path.relative(cwd, universal)) - }; -} - -/** - * @param {import('types').ValidatedConfig} config - * @param {string} cwd - */ -function create_matchers(config, cwd) { - const params_base = path.relative(cwd, config.kit.files.params); - - /** @type {Record} */ - const matchers = {}; - if (fs.existsSync(config.kit.files.params)) { - for (const file of fs.readdirSync(config.kit.files.params)) { - const ext = path.extname(file); - if (!config.kit.moduleExtensions.includes(ext)) continue; - const type = file.slice(0, -ext.length); - - if (/^\w+$/.test(type)) { - const matcher_file = path.join(params_base, file); - - // Disallow same matcher with different extensions - if (matchers[type]) { - throw new Error(`Duplicate matchers: ${matcher_file} and ${matchers[type]}`); - } else { - matchers[type] = matcher_file; - } - } else { - // Allow for matcher test collocation - if (type.endsWith('.test') || type.endsWith('.spec')) continue; - - throw new Error( - `Matcher names can only have underscores and alphanumeric characters — "${file}" is invalid` - ); - } - } - } - - return matchers; -} - -/** - * @param {import('types').ValidatedConfig} config - * @param {string} cwd - * @param {string} fallback - */ -function create_routes_and_nodes(cwd, config, fallback) { - /** @type {import('types').RouteData[]} */ - const routes = []; - - const routes_base = posixify(path.relative(cwd, config.kit.files.routes)); - - const valid_extensions = [...config.extensions, ...config.kit.moduleExtensions]; - - /** @type {import('types').PageNode[]} */ - const nodes = []; - - if (fs.existsSync(config.kit.files.routes)) { - /** - * @param {number} depth - * @param {string} id - * @param {string} segment - * @param {import('types').RouteData | null} parent - */ - const walk = (depth, id, segment, parent) => { - const unescaped = id.replace(/\[([ux])\+([^\]]+)\]/gi, (match, type, code) => { - if (match !== match.toLowerCase()) { - throw new Error(`Character escape sequence in ${id} must be lowercase`); - } - - if (!/[0-9a-f]+/.test(code)) { - throw new Error(`Invalid character escape sequence in ${id}`); - } - - if (type === 'x') { - if (code.length !== 2) { - throw new Error(`Hexadecimal escape sequence in ${id} must be two characters`); - } - - return String.fromCharCode(parseInt(code, 16)); - } else { - if (code.length < 4 || code.length > 6) { - throw new Error( - `Unicode escape sequence in ${id} must be between four and six characters` - ); - } - - return String.fromCharCode(parseInt(code, 16)); - } - }); - - if (/\]\[/.test(unescaped)) { - throw new Error(`Invalid route ${id} — parameters must be separated`); - } - - if (count_occurrences('[', id) !== count_occurrences(']', id)) { - throw new Error(`Invalid route ${id} — brackets are unbalanced`); - } - - if (/#/.test(segment)) { - // Vite will barf on files with # in them - throw new Error(`Route ${id} should be renamed to ${id.replace(/#/g, '[x+23]')}`); - } - - if (/\[\.\.\.\w+\]\/\[\[/.test(id)) { - throw new Error( - `Invalid route ${id} — an [[optional]] route segment cannot follow a [...rest] route segment` - ); - } - - if (/\[\[\.\.\./.test(id)) { - throw new Error( - `Invalid route ${id} — a rest route segment is always optional, remove the outer square brackets` - ); - } - - const { pattern, params } = parse_route_id(id); - - /** @type {import('types').RouteData} */ - const route = { - id, - parent, - - segment, - pattern, - params, - - layout: null, - error: null, - leaf: null, - page: null, - endpoint: null - }; - - // important to do this before walking children, so that child - // routes appear later - routes.push(route); - - // if we don't do this, the route map becomes unwieldy to console.log - Object.defineProperty(route, 'parent', { enumerable: false }); - - const dir = path.join(cwd, routes_base, id); - - // We can't use withFileTypes because of a NodeJs bug which returns wrong results - // with isDirectory() in case of symlinks: https://github.com/nodejs/node/issues/30646 - const files = fs.readdirSync(dir).map((name) => ({ - is_dir: fs.statSync(path.join(dir, name)).isDirectory(), - name - })); - - // process files first - for (const file of files) { - if (file.is_dir) continue; - - const ext = valid_extensions.find((ext) => file.name.endsWith(ext)); - if (!ext) continue; - - if (!file.name.startsWith('+')) { - const name = file.name.slice(0, -ext.length); - // check if it is a valid route filename but missing the + prefix - const typo = - /^(?:(page(?:@(.*))?)|(layout(?:@(.*))?)|(error))$/.test(name) || - /^(?:(server)|(page(?:(@[a-zA-Z0-9_-]*))?(\.server)?)|(layout(?:(@[a-zA-Z0-9_-]*))?(\.server)?))$/.test( - name - ); - if (typo) { - console.log( - colors - .bold() - .yellow( - `Missing route file prefix. Did you mean +${file.name}?` + - ` at ${path.join(dir, file.name)}` - ) - ); - } - - continue; - } - - if (file.name.endsWith('.d.ts')) { - let name = file.name.slice(0, -5); - const ext = valid_extensions.find((ext) => name.endsWith(ext)); - if (ext) name = name.slice(0, -ext.length); - - const valid = - /^\+(?:(page(?:@(.*))?)|(layout(?:@(.*))?)|(error))$/.test(name) || - /^\+(?:(server)|(page(?:(@[a-zA-Z0-9_-]*))?(\.server)?)|(layout(?:(@[a-zA-Z0-9_-]*))?(\.server)?))$/.test( - name - ); - - if (valid) continue; - } - - const project_relative = posixify(path.relative(cwd, path.join(dir, file.name))); - - const item = analyze( - project_relative, - file.name, - config.extensions, - config.kit.moduleExtensions - ); - - if (config.kit.router.type === 'hash' && item.kind === 'server') { - throw new Error( - `Cannot use server-only files in an app with \`router.type === 'hash': ${project_relative}` - ); - } - - /** - * @param {string} type - * @param {string} existing_file - */ - function duplicate_files_error(type, existing_file) { - return new Error( - `Multiple ${type} files found in ${routes_base}${route.id} : ${path.basename( - existing_file - )} and ${file.name}` - ); - } - - if (item.kind === 'component') { - if (item.is_error) { - route.error = { - depth, - component: project_relative - }; - } else if (item.is_layout) { - if (!route.layout) { - route.layout = { depth, child_pages: [] }; - } else if (route.layout.component) { - throw duplicate_files_error('layout component', route.layout.component); - } - - route.layout.component = project_relative; - if (item.uses_layout !== undefined) route.layout.parent_id = item.uses_layout; - } else { - if (!route.leaf) { - route.leaf = { depth }; - } else if (route.leaf.component) { - throw duplicate_files_error('page component', route.leaf.component); - } - - route.leaf.component = project_relative; - if (item.uses_layout !== undefined) route.leaf.parent_id = item.uses_layout; - } - } else if (item.is_layout) { - if (!route.layout) { - route.layout = { depth, child_pages: [] }; - } else if (route.layout[item.kind]) { - throw duplicate_files_error( - item.kind + ' layout module', - /** @type {string} */ (route.layout[item.kind]) - ); - } - - route.layout[item.kind] = project_relative; - } else if (item.is_page) { - if (!route.leaf) { - route.leaf = { depth }; - } else if (route.leaf[item.kind]) { - throw duplicate_files_error( - item.kind + ' page module', - /** @type {string} */ (route.leaf[item.kind]) - ); - } - - route.leaf[item.kind] = project_relative; - } else { - if (route.endpoint) { - throw duplicate_files_error('endpoint', route.endpoint.file); - } - - route.endpoint = { - file: project_relative, - page_options: null // will be filled later - }; - } - } - - // then handle children - for (const file of files) { - if (file.is_dir) { - walk(depth + 1, path.posix.join(id, file.name), file.name, route); - } - } - }; - - walk(0, '/', '', null); - - if (routes.length === 1) { - const root = routes[0]; - if (!root.leaf && !root.error && !root.layout && !root.endpoint) { - throw new Error( - 'No routes found. If you are using a custom src/routes directory, make sure it is specified in your Svelte config file' - ); - } - } - } else { - // If there's no routes directory, we'll just create a single empty route. This ensures the root layout and - // error components are included in the manifest, which is needed for subsequent build/dev commands to work - routes.push({ - id: '/', - segment: '', - pattern: /^$/, - params: [], - parent: null, - layout: null, - error: null, - leaf: null, - page: null, - endpoint: null - }); - } - - prevent_conflicts(routes); - - const root = routes[0]; - - if (!root.layout?.component) { - if (!root.layout) root.layout = { depth: 0, child_pages: [] }; - root.layout.component = posixify(path.relative(cwd, `${fallback}/layout.svelte`)); - } - - if (!root.error?.component) { - if (!root.error) root.error = { depth: 0 }; - root.error.component = posixify(path.relative(cwd, `${fallback}/error.svelte`)); - } - - // we do layouts/errors first as they are more likely to be reused, - // and smaller indexes take fewer bytes. also, this guarantees that - // the default error/layout are 0/1 - for (const route of routes) { - if (route.layout) { - if (!route.layout?.component) { - route.layout.component = posixify(path.relative(cwd, `${fallback}/layout.svelte`)); - } - nodes.push(route.layout); - } - if (route.error) nodes.push(route.error); - } - - for (const route of routes) { - if (route.leaf) nodes.push(route.leaf); - } - - const indexes = new Map(nodes.map((node, i) => [node, i])); - - const node_analyser = create_node_analyser(); - - for (const route of routes) { - if (!route.leaf) continue; - - route.page = { - layouts: [], - errors: [], - leaf: /** @type {number} */ (indexes.get(route.leaf)) - }; - - /** @type {import('types').RouteData | null} */ - let current_route = route; - let current_node = route.leaf; - let parent_id = route.leaf.parent_id; - - while (current_route) { - if (parent_id === undefined || current_route.segment === parent_id) { - if (current_route.layout || current_route.error) { - route.page.layouts.unshift( - current_route.layout ? indexes.get(current_route.layout) : undefined - ); - route.page.errors.unshift( - current_route.error ? indexes.get(current_route.error) : undefined - ); - } - - if (current_route.layout) { - /** @type {import('types').PageNode[]} */ (current_route.layout.child_pages).push( - route.leaf - ); - current_node.parent = current_node = current_route.layout; - parent_id = current_node.parent_id; - } else { - parent_id = undefined; - } - } - - current_route = current_route.parent; - } - - if (parent_id !== undefined) { - throw new Error(`${current_node.component} references missing segment "${parent_id}"`); - } - } - - for (const node of nodes) { - node.page_options = node_analyser.get_page_options(node); - } - - for (const route of routes) { - if (route.endpoint) { - route.endpoint.page_options = get_page_options(route.endpoint.file); - } - } - - return { - nodes, - routes: sort_routes(routes) - }; -} - -/** - * @param {string} project_relative - * @param {string} file - * @param {string[]} component_extensions - * @param {string[]} module_extensions - * @returns {import('./types.js').RouteFile} - */ -function analyze(project_relative, file, component_extensions, module_extensions) { - const component_extension = component_extensions.find((ext) => file.endsWith(ext)); - if (component_extension) { - const name = file.slice(0, -component_extension.length); - const pattern = /^\+(?:(page(?:@(.*))?)|(layout(?:@(.*))?)|(error))$/; - const match = pattern.exec(name); - if (!match) { - throw new Error(`Files prefixed with + are reserved (saw ${project_relative})`); - } - - return { - kind: 'component', - is_page: !!match[1], - is_layout: !!match[3], - is_error: !!match[5], - uses_layout: match[2] ?? match[4] - }; - } - - const module_extension = module_extensions.find((ext) => file.endsWith(ext)); - if (module_extension) { - const name = file.slice(0, -module_extension.length); - const pattern = - /^\+(?:(server)|(page(?:(@[a-zA-Z0-9_-]*))?(\.server)?)|(layout(?:(@[a-zA-Z0-9_-]*))?(\.server)?))$/; - const match = pattern.exec(name); - if (!match) { - throw new Error(`Files prefixed with + are reserved (saw ${project_relative})`); - } else if (match[3] || match[6]) { - throw new Error( - // prettier-ignore - `Only Svelte files can reference named layouts. Remove '${match[3] || match[6]}' from ${file} (at ${project_relative})` - ); - } - - const kind = match[1] || match[4] || match[7] ? 'server' : 'universal'; - - return { - kind, - is_page: !!match[2], - is_layout: !!match[5] - }; - } - - throw new Error(`Files and directories prefixed with + are reserved (saw ${project_relative})`); -} - -/** - * @param {string} needle - * @param {string} haystack - */ -function count_occurrences(needle, haystack) { - let count = 0; - for (let i = 0; i < haystack.length; i += 1) { - if (haystack[i] === needle) count += 1; - } - return count; -} - -/** @param {import('types').RouteData[]} routes */ -function prevent_conflicts(routes) { - /** @type {Map} */ - const lookup = new Map(); - - for (const route of routes) { - if (!route.leaf && !route.endpoint) continue; - - const normalized = normalize_route_id(route.id); - - // find all permutations created by optional parameters - const split = normalized.split(/<\?(.+?)>/g); - - let permutations = [/** @type {string} */ (split[0])]; - - // turn `x/[[optional]]/y` into `x/y` and `x/[required]/y` - for (let i = 1; i < split.length; i += 2) { - const matcher = split[i]; - const next = split[i + 1]; - - permutations = permutations.reduce((a, b) => { - a.push(b + next); - if (!(matcher === '*' && b.endsWith('//'))) a.push(b + `<${matcher}>${next}`); - return a; - }, /** @type {string[]} */ ([])); - } - - for (const permutation of permutations) { - // remove leading/trailing/duplicated slashes caused by prior - // manipulation of optional parameters and (groups) - const key = permutation - .replace(/\/{2,}/, '/') - .replace(/^\//, '') - .replace(/\/$/, ''); - - if (lookup.has(key)) { - throw new Error( - `The "${lookup.get(key)}" and "${route.id}" routes conflict with each other` - ); - } - - lookup.set(key, route.id); - } - } -} - -/** @param {string} id */ -function normalize_route_id(id) { - return ( - id - // remove groups - .replace(/(?<=^|\/)\(.+?\)(?=$|\/)/g, '') - - .replace(/\[[ux]\+([0-9a-f]+)\]/g, (_, x) => - String.fromCharCode(parseInt(x, 16)).replace(/\//g, '%2f') - ) - - // replace `[param]` with `<*>`, `[param=x]` with ``, and `[[param]]` with `` - .replace( - /\[(?:(\[)|(\.\.\.))?.+?(=.+?)?\]\]?/g, - (_, optional, rest, matcher) => `<${optional ? '?' : ''}${rest ?? ''}${matcher ?? '*'}>` - ) - ); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/sort.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/sort.js deleted file mode 100644 index 1629d14..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/sort.js +++ /dev/null @@ -1,162 +0,0 @@ -import { get_route_segments } from '../../../utils/routing.js'; - -/** - * @typedef {{ - * type: 'static' | 'required' | 'optional' | 'rest'; - * content: string; - * matched: boolean; - * }} Part - */ - -/** - * @typedef {Part[]} Segment - */ - -const EMPTY = { type: 'static', content: '', matched: false }; - -/** @param {import('types').RouteData[]} routes */ -export function sort_routes(routes) { - /** @type {Map} */ - const segment_cache = new Map(); - - /** @param {string} segment */ - function get_parts(segment) { - if (!segment_cache.has(segment)) { - segment_cache.set(segment, split(segment)); - } - - return segment_cache.get(segment); - } - - /** @param {string} id */ - function split(id) { - /** @type {Part[]} */ - const parts = []; - - let i = 0; - while (i <= id.length) { - const start = id.indexOf('[', i); - if (start === -1) { - parts.push({ type: 'static', content: id.slice(i), matched: false }); - break; - } - - parts.push({ type: 'static', content: id.slice(i, start), matched: false }); - - const type = id[start + 1] === '[' ? 'optional' : id[start + 1] === '.' ? 'rest' : 'required'; - const delimiter = type === 'optional' ? ']]' : ']'; - const end = id.indexOf(delimiter, start); - - if (end === -1) { - throw new Error(`Invalid route ID ${id}`); - } - - const content = id.slice(start, (i = end + delimiter.length)); - - parts.push({ - type, - content, - matched: content.includes('=') - }); - } - - return parts; - } - - return routes.sort((route_a, route_b) => { - const segments_a = split_route_id(route_a.id).map(get_parts); - const segments_b = split_route_id(route_b.id).map(get_parts); - - for (let i = 0; i < Math.max(segments_a.length, segments_b.length); i += 1) { - const segment_a = segments_a[i] ?? [EMPTY]; - const segment_b = segments_b[i] ?? [EMPTY]; - - for (let j = 0; j < Math.max(segment_a.length, segment_b.length); j += 1) { - const a = segment_a[j]; - const b = segment_b[j]; - - // first part of each segment is always static - // (though it may be the empty string), then - // it alternates between dynamic and static - // (i.e. [foo][bar] is disallowed) - const dynamic = j % 2 === 1; - - if (dynamic) { - if (!a) return -1; - if (!b) return +1; - - // get the next static chunk, so we can handle [...rest] edge cases - const next_a = segment_a[j + 1].content || segments_a[i + 1]?.[0].content; - const next_b = segment_b[j + 1].content || segments_b[i + 1]?.[0].content; - - // `[...rest]/x` outranks `[...rest]` - if (a.type === 'rest' && b.type === 'rest') { - if (next_a && next_b) continue; - if (next_a) return -1; - if (next_b) return +1; - } - - // `[...rest]/x` outranks `[required]` or `[required]/[required]` - // but not `[required]/x` - if (a.type === 'rest') { - return next_a && !next_b ? -1 : +1; - } - - if (b.type === 'rest') { - return next_b && !next_a ? +1 : -1; - } - - // part with matcher outranks one without - if (a.matched !== b.matched) { - return a.matched ? -1 : +1; - } - - if (a.type !== b.type) { - // `[...rest]` has already been accounted for, so here - // we're comparing between `[required]` and `[[optional]]` - if (a.type === 'required') return -1; - if (b.type === 'required') return +1; - } - } else if (a.content !== b.content) { - // shallower path outranks deeper path - if (a === EMPTY) return -1; - if (b === EMPTY) return +1; - - return sort_static(a.content, b.content); - } - } - } - - return route_a.id < route_b.id ? +1 : -1; - }); -} - -/** @param {string} id */ -function split_route_id(id) { - return get_route_segments( - id - // remove all [[optional]] parts unless they're at the very end - // or it ends with a route group - .replace(/\[\[[^\]]+\]\](?!(?:\/\([^/]+\))*$)/g, '') - ).filter(Boolean); -} - -/** - * Sort two strings lexicographically, except `foobar` outranks `foo` - * @param {string} a - * @param {string} b - */ -function sort_static(a, b) { - if (a === b) return 0; - - for (let i = 0; true; i += 1) { - const char_a = a[i]; - const char_b = b[i]; - - if (char_a !== char_b) { - if (char_a === undefined) return +1; - if (char_b === undefined) return -1; - return char_a < char_b ? -1 : +1; - } - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/types.d.ts b/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/types.d.ts deleted file mode 100644 index ec5c01b..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/types.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { PageNode } from 'types'; - -interface Part { - dynamic: boolean; - optional: boolean; - rest: boolean; - type: string | null; -} - -interface RouteTreeNode { - error: PageNode | undefined; - layout: PageNode | undefined; -} - -export type RouteTree = Map; - -interface RouteComponent { - kind: 'component'; - is_page: boolean; - is_layout: boolean; - is_error: boolean; - uses_layout: string | undefined; -} - -interface RouteSharedModule { - kind: 'universal'; - is_page: boolean; - is_layout: boolean; -} - -interface RouteServerModule { - kind: 'server'; - is_page: boolean; - is_layout: boolean; -} - -export type RouteFile = RouteComponent | RouteSharedModule | RouteServerModule; diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/sync.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/sync.js deleted file mode 100644 index d9680e8..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/sync.js +++ /dev/null @@ -1,96 +0,0 @@ -import path from 'node:path'; -import create_manifest_data from './create_manifest_data/index.js'; -import { write_client_manifest } from './write_client_manifest.js'; -import { write_root } from './write_root.js'; -import { write_tsconfig } from './write_tsconfig.js'; -import { write_types, write_all_types } from './write_types/index.js'; -import { write_ambient } from './write_ambient.js'; -import { write_non_ambient } from './write_non_ambient.js'; -import { write_server } from './write_server.js'; -import { - create_node_analyser, - get_page_options -} from '../../exports/vite/static_analysis/index.js'; - -/** - * Initialize SvelteKit's generated files that only depend on the config and mode. - * @param {import('types').ValidatedConfig} config - * @param {string} mode - */ -export function init(config, mode) { - write_tsconfig(config.kit); - write_ambient(config.kit, mode); -} - -/** - * Update SvelteKit's generated files - * @param {import('types').ValidatedConfig} config - */ -export function create(config) { - const manifest_data = create_manifest_data({ config }); - - const output = path.join(config.kit.outDir, 'generated'); - - write_client_manifest(config.kit, manifest_data, `${output}/client`); - write_server(config, output); - write_root(manifest_data, config, output); - write_all_types(config, manifest_data); - write_non_ambient(config.kit, manifest_data); - - return { manifest_data }; -} - -/** - * Update SvelteKit's generated files in response to a single file content update. - * Do not call this when the file in question was created/deleted. - * - * @param {import('types').ValidatedConfig} config - * @param {import('types').ManifestData} manifest_data - * @param {string} file - */ -export function update(config, manifest_data, file) { - const node_analyser = create_node_analyser(); - - for (const node of manifest_data.nodes) { - node.page_options = node_analyser.get_page_options(node); - } - - for (const route of manifest_data.routes) { - if (route.endpoint) { - route.endpoint.page_options = get_page_options(route.endpoint.file); - } - } - - write_types(config, manifest_data, file); - write_non_ambient(config.kit, manifest_data); -} - -/** - * Run sync.init and sync.create in series, returning the result from sync.create. - * @param {import('types').ValidatedConfig} config - * @param {string} mode The Vite mode - */ -export function all(config, mode) { - init(config, mode); - return create(config); -} - -/** - * Run sync.init and then generate all type files. - * @param {import('types').ValidatedConfig} config - * @param {string} mode The Vite mode - */ -export function all_types(config, mode) { - init(config, mode); - const manifest_data = create_manifest_data({ config }); - write_all_types(config, manifest_data); - write_non_ambient(config.kit, manifest_data); -} - -/** - * Regenerate __SERVER__/internal.js in response to src/{app.html,error.html,service-worker.js} changing - * @param {import('types').ValidatedConfig} config - */ -export function server(config) { - write_server(config, path.join(config.kit.outDir, 'generated')); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/ts.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/ts.js deleted file mode 100644 index 61c79e3..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/ts.js +++ /dev/null @@ -1,6 +0,0 @@ -/** @type {import('typescript')} */ -// @ts-ignore -export let ts = undefined; -try { - ts = (await import('typescript')).default; -} catch {} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/utils.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/utils.js deleted file mode 100644 index 1063606..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/utils.js +++ /dev/null @@ -1,85 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import { mkdirp } from '../../utils/filesystem.js'; -import { import_peer } from '../../utils/import.js'; - -/** @type {{ VERSION: string }} */ -const { VERSION } = await import_peer('svelte/compiler'); - -const [MAJOR, MINOR] = VERSION.split('.').map(Number); - -/** @type {Map} */ -const previous_contents = new Map(); - -/** - * @param {string} file - * @param {string} code - */ -export function write_if_changed(file, code) { - if (code !== previous_contents.get(file)) { - write(file, code); - } -} - -/** - * @param {string} file - * @param {string} code - */ -export function write(file, code) { - previous_contents.set(file, code); - mkdirp(path.dirname(file)); - fs.writeFileSync(file, code); -} - -/** @type {WeakMap} */ -const dedent_map = new WeakMap(); - -/** - * Allows indenting template strings without the extra indentation ending up in the result. - * Still allows indentation of lines relative to one another in the template string. - * @param {TemplateStringsArray} strings - * @param {any[]} values - */ -export function dedent(strings, ...values) { - let dedented = dedent_map.get(strings); - - if (!dedented) { - const indentation = /** @type {RegExpExecArray} */ (/\n?([ \t]*)/.exec(strings[0]))[1]; - const pattern = new RegExp(`^${indentation}`, 'gm'); - - dedented = { - strings: strings.map((str) => str.replace(pattern, '')), - indents: [] - }; - - let current = '\n'; - - for (let i = 0; i < values.length; i += 1) { - const string = dedented.strings[i]; - const match = /\n([ \t]*)$/.exec(string); - - if (match) current = match[0]; - dedented.indents[i] = current; - } - - dedent_map.set(strings, dedented); - } - - let str = dedented.strings[0]; - for (let i = 0; i < values.length; i += 1) { - str += String(values[i]).replace(/\n/g, dedented.indents[i]) + dedented.strings[i + 1]; - } - - str = str.trim(); - - return str; -} - -export function isSvelte5Plus() { - return MAJOR >= 5; -} - -// TODO 3.0 remove this once we can bump the peerDep range -export function supportsTrustedTypes() { - return (MAJOR === 5 && MINOR >= 51) || MAJOR > 5; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_ambient.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/write_ambient.js deleted file mode 100644 index 1f21880..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_ambient.js +++ /dev/null @@ -1,63 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { get_env } from '../../exports/vite/utils.js'; -import { GENERATED_COMMENT } from '../../constants.js'; -import { create_dynamic_types, create_static_types } from '../env.js'; -import { write_if_changed } from './utils.js'; - -// TODO these types should be described in a neutral place, rather than -// inside either `packages/kit` or `svelte.dev/docs/kit` -const descriptions_dir = fileURLToPath(new URL('../../../src/types/synthetic', import.meta.url)); - -/** @param {string} filename */ -function read_description(filename) { - const content = fs.readFileSync(`${descriptions_dir}/${filename}`, 'utf8'); - return `/**\n${content - .trim() - .split('\n') - .map((line) => ` * ${line}`) - .join('\n')}\n */`; -} - -/** - * @param {import('types').Env} env - * @param {{ - * public_prefix: string; - * private_prefix: string; - * }} prefixes - */ -const template = (env, prefixes) => ` -${GENERATED_COMMENT} - -/// - -${read_description('$env+static+private.md')} -${create_static_types('private', env)} - -${read_description('$env+static+public.md')} -${create_static_types('public', env)} - -${read_description('$env+dynamic+private.md')} -${create_dynamic_types('private', env, prefixes)} - -${read_description('$env+dynamic+public.md')} -${create_dynamic_types('public', env, prefixes)} -`; - -/** - * Writes ambient declarations including types reference to @sveltejs/kit, - * and the existing environment variables in process.env to - * $env/static/private and $env/static/public - * @param {import('types').ValidatedKitConfig} config - * @param {string} mode The Vite mode - */ -export function write_ambient(config, mode) { - const env = get_env(config.env, mode); - const { publicPrefix: public_prefix, privatePrefix: private_prefix } = config.env; - - write_if_changed( - path.join(config.outDir, 'ambient.d.ts'), - template(env, { public_prefix, private_prefix }) - ); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_client_manifest.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/write_client_manifest.js deleted file mode 100644 index 7495e31..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_client_manifest.js +++ /dev/null @@ -1,203 +0,0 @@ -import path from 'node:path'; -import { relative_path, resolve_entry } from '../../utils/filesystem.js'; -import { s } from '../../utils/misc.js'; -import { dedent, isSvelte5Plus, write_if_changed } from './utils.js'; -import colors from 'kleur'; - -/** - * Writes the client manifest to disk. The manifest is used to power the router. It contains the - * list of routes and corresponding Svelte components (i.e. pages and layouts). - * @param {import('types').ValidatedKitConfig} kit - * @param {import('types').ManifestData} manifest_data - * @param {string} output - * @param {import('types').ServerMetadata['nodes']} [metadata] If this is omitted, we have to assume that all routes with a `+layout/page.server.js` file have a server load function - */ -export function write_client_manifest(kit, manifest_data, output, metadata) { - const client_routing = kit.router.resolution === 'client'; - - /** - * Creates a module that exports a `CSRPageNode` - * @param {import('types').PageNode} node - */ - function generate_node(node) { - const declarations = []; - - if (node.universal) { - declarations.push( - `import * as universal from ${s(relative_path(`${output}/nodes`, node.universal))};`, - 'export { universal };' - ); - } - - if (node.component) { - declarations.push( - `export { default as component } from ${s( - relative_path(`${output}/nodes`, node.component) - )};` - ); - } - - return declarations.join('\n'); - } - - /** @type {Map} */ - const indices = new Map(); - const nodes = manifest_data.nodes - .map((node, i) => { - indices.set(node, i); - - write_if_changed(`${output}/nodes/${i}.js`, generate_node(node)); - return `() => import('./nodes/${i}')`; - }) - // If route resolution happens on the server, we only need the root layout and root error page - // upfront, the rest is loaded on demand as the user navigates the app - .slice(0, client_routing ? manifest_data.nodes.length : 2) - .join(',\n'); - - const layouts_with_server_load = new Set(); - - let dictionary = dedent` - { - ${manifest_data.routes - .map((route) => { - if (route.page) { - const errors = route.page.errors.slice(1).map((n) => n ?? ''); - const layouts = route.page.layouts.slice(1).map((n) => n ?? ''); - - while (layouts.at(-1) === '') layouts.pop(); - while (errors.at(-1) === '') errors.pop(); - - let leaf_has_server_load = false; - if (route.leaf) { - if (metadata) { - const i = /** @type {number} */ (indices.get(route.leaf)); - - leaf_has_server_load = metadata[i].has_server_load; - } else if (route.leaf.server) { - leaf_has_server_load = true; - } - } - - // Encode whether or not the route uses server data - // using the ones' complement, to save space - const array = [`${leaf_has_server_load ? '~' : ''}${route.page.leaf}`]; - - // Encode whether or not the layout uses server data. - // It's a different method compared to pages because layouts - // are reused across pages, so we save space by doing it this way. - route.page.layouts.forEach((layout) => { - if (layout == undefined) return; - - let layout_has_server_load = false; - - if (metadata) { - layout_has_server_load = metadata[layout].has_server_load; - } else if (manifest_data.nodes[layout].server) { - layout_has_server_load = true; - } - - if (layout_has_server_load) { - layouts_with_server_load.add(layout); - } - }); - - // only include non-root layout/error nodes if they exist - if (layouts.length > 0 || errors.length > 0) array.push(`[${layouts.join(',')}]`); - if (errors.length > 0) array.push(`[${errors.join(',')}]`); - - return `${s(route.id)}: [${array.join(',')}]`; - } - }) - .filter(Boolean) - .join(',\n')} - } - `; - - if (!client_routing) { - dictionary = '{}'; - const root_layout = layouts_with_server_load.has(0); - layouts_with_server_load.clear(); - if (root_layout) layouts_with_server_load.add(0); - } - - const client_hooks_file = resolve_entry(kit.files.hooks.client); - const universal_hooks_file = resolve_entry(kit.files.hooks.universal); - - const typo = resolve_entry('src/+hooks.client'); - if (typo) { - console.log( - colors - .bold() - .yellow( - `Unexpected + prefix. Did you mean ${typo.split('/').at(-1)?.slice(1)}?` + - ` at ${path.resolve(typo)}` - ) - ); - } - - // Stringified version of - /** @type {import('../../runtime/client/types.js').SvelteKitApp} */ - write_if_changed( - `${output}/app.js`, - dedent` - ${ - client_hooks_file - ? `import * as client_hooks from '${relative_path(output, client_hooks_file)}';` - : '' - } - ${ - universal_hooks_file - ? `import * as universal_hooks from '${relative_path(output, universal_hooks_file)}';` - : '' - } - - ${client_routing ? "export { matchers } from './matchers.js';" : 'export const matchers = {};'} - - export const nodes = [ - ${nodes} - ]; - - export const server_loads = [${[...layouts_with_server_load].join(',')}]; - - export const dictionary = ${dictionary}; - - export const hooks = { - handleError: ${ - client_hooks_file ? 'client_hooks.handleError || ' : '' - }(({ error }) => { console.error(error) }), - ${client_hooks_file ? 'init: client_hooks.init,' : ''} - reroute: ${universal_hooks_file ? 'universal_hooks.reroute || ' : ''}(() => {}), - transport: ${universal_hooks_file ? 'universal_hooks.transport || ' : ''}{} - }; - - export const decoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.decode])); - export const encoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.encode])); - - export const hash = ${s(kit.router.type === 'hash')}; - - export const decode = (type, value) => decoders[type](value); - - export { default as root } from '../root.${isSvelte5Plus() ? 'js' : 'svelte'}'; - ` - ); - - if (client_routing) { - // write matchers to a separate module so that we don't - // need to worry about name conflicts - const imports = []; - const matchers = []; - - for (const key in manifest_data.matchers) { - const src = manifest_data.matchers[key]; - - imports.push(`import { match as ${key} } from ${s(relative_path(output, src))};`); - matchers.push(key); - } - - const module = imports.length - ? `${imports.join('\n')}\n\nexport const matchers = { ${matchers.join(', ')} };` - : 'export const matchers = {};'; - - write_if_changed(`${output}/matchers.js`, module); - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_non_ambient.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/write_non_ambient.js deleted file mode 100644 index 3b92b73..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_non_ambient.js +++ /dev/null @@ -1,266 +0,0 @@ -import path from 'node:path'; -import { GENERATED_COMMENT } from '../../constants.js'; -import { posixify } from '../../utils/filesystem.js'; -import { write_if_changed } from './utils.js'; -import { s } from '../../utils/misc.js'; -import { get_route_segments } from '../../utils/routing.js'; - -const replace_optional_params = (/** @type {string} */ id) => - id.replace(/\/\[\[[^\]]+\]\]/g, '${string}'); -const replace_required_params = (/** @type {string} */ id) => - id.replace(/\/\[[^\]]+\]/g, '/${string}'); -/** Convert route ID to pathname by removing layout groups */ -const remove_group_segments = (/** @type {string} */ id) => { - return '/' + get_route_segments(id).join('/'); -}; - -/** - * Get pathnames to add based on trailingSlash settings - * @param {string} pathname - * @param {import('types').RouteData} route - * @returns {string[]} - */ -function get_pathnames_for_trailing_slash(pathname, route) { - if (pathname === '/') { - return [pathname]; - } - - /** @type {Set} */ - const pathnames = new Set(); - - /** - * @param {{ trailingSlash?: import('types').TrailingSlash } | null | undefined} page_options - */ - const add_pathnames = (page_options) => { - if (page_options === null || page_options?.trailingSlash === 'ignore') { - pathnames.add(pathname); - pathnames.add(pathname + '/'); - } else if (page_options?.trailingSlash === 'always') { - pathnames.add(pathname + '/'); - } else { - pathnames.add(pathname); - } - }; - - if (route.leaf) add_pathnames(route.leaf.page_options ?? null); - if (route.endpoint) add_pathnames(route.endpoint.page_options); - - return Array.from(pathnames); -} - -// `declare module "svelte/elements"` needs to happen in a non-ambient module, and dts-buddy generates one big ambient module, -// so we can't add it there - therefore generate the typings ourselves here. -// We're not using the `declare namespace svelteHTML` variant because that one doesn't augment the HTMLAttributes interface -// people could use to type their own components. -// The T generic is needed or else there's a "all declarations must have identical type parameters" error. -const template = ` -${GENERATED_COMMENT} - -declare module "svelte/elements" { - export interface HTMLAttributes { - 'data-sveltekit-keepfocus'?: true | '' | 'off' | undefined | null; - 'data-sveltekit-noscroll'?: true | '' | 'off' | undefined | null; - 'data-sveltekit-preload-code'?: - | true - | '' - | 'eager' - | 'viewport' - | 'hover' - | 'tap' - | 'off' - | undefined - | null; - 'data-sveltekit-preload-data'?: true | '' | 'hover' | 'tap' | 'off' | undefined | null; - 'data-sveltekit-reload'?: true | '' | 'off' | undefined | null; - 'data-sveltekit-replacestate'?: true | '' | 'off' | undefined | null; - } -} - -export {}; -`; - -/** - * Generate app types interface extension - * @param {import('types').ManifestData} manifest_data - * @param {import('types').ValidatedKitConfig} config - */ -function generate_app_types(manifest_data, config) { - /** @param {string} matcher */ - const path_to_matcher = (matcher) => - posixify(path.relative(config.outDir, path.join(config.files.params, matcher + '.js'))); - - /** @type {Map} */ - const matcher_types = new Map(); - - /** @param {string | undefined} matcher */ - const get_matcher_type = (matcher) => { - if (!matcher) return 'string'; - - let type = matcher_types.get(matcher); - if (!type) { - type = `MatcherParam`; - matcher_types.set(matcher, type); - } - - return type; - }; - - /** @param {Set | null} matchers */ - const get_matchers_type = (matchers) => { - if (matchers === null) return 'string'; - - return Array.from(matchers) - .map((matcher) => get_matcher_type(matcher)) - .join(' | '); - }; - - /** @type {Set} */ - const route_ids = new Set(manifest_data.routes.map((route) => route.id)); - - /** - * @param {string} id - * @returns {string[]} - */ - const get_ancestor_route_ids = (id) => { - /** @type {string[]} */ - const ancestors = []; - - if (route_ids.has('/')) { - ancestors.push('/'); - } - - let current = ''; - for (const segment of id.slice(1).split('/')) { - if (!segment) continue; - - current += '/' + segment; - if (route_ids.has(current)) { - ancestors.push(current); - } - } - - return ancestors; - }; - - /** @type {Set} */ - const pathnames = new Set(); - - /** @type {string[]} */ - const dynamic_routes = []; - - /** @type {string[]} */ - const layouts = []; - - /** @type {Map | null }>>} */ - const layout_params_by_route = new Map( - manifest_data.routes.map((route) => [ - route.id, - new Map( - route.params.map((p) => [ - p.name, - { optional: p.optional, matchers: p.matcher ? new Set([p.matcher]) : null } - ]) - ) - ]) - ); - - for (const route of manifest_data.routes) { - const ancestors = get_ancestor_route_ids(route.id); - - for (const ancestor_id of ancestors) { - const ancestor_params = layout_params_by_route.get(ancestor_id); - if (!ancestor_params) continue; - - for (const p of route.params) { - const matcher = p.matcher ?? null; - const entry = ancestor_params.get(p.name); - if (!entry) { - ancestor_params.set(p.name, { - optional: true, - matchers: matcher === null ? null : new Set([matcher]) - }); - continue; - } - - if (entry.matchers === null) continue; - - if (matcher === null) { - entry.matchers = null; - continue; - } - - entry.matchers.add(matcher); - } - } - } - - for (const route of manifest_data.routes) { - const pathname = remove_group_segments(route.id); - let normalized_pathname = pathname; - - /** @type {(path: string) => string} */ - let serialise = s; - - if (route.params.length > 0) { - const params = route.params.map((p) => { - const type = get_matcher_type(p.matcher); - return `${p.name}${p.optional ? '?:' : ':'} ${type}`; - }); - const route_type = `${s(route.id)}: { ${params.join('; ')} }`; - - dynamic_routes.push(route_type); - - normalized_pathname = replace_required_params(replace_optional_params(pathname)); - serialise = (p) => `\`${p}\` & {}`; - } - - for (const p of get_pathnames_for_trailing_slash(normalized_pathname, route)) { - pathnames.add(serialise(p)); - } - - let layout_type = 'Record'; - - const layout_params = layout_params_by_route.get(route.id); - if (layout_params) { - const params = Array.from(layout_params) - .map(([name, { optional, matchers }]) => { - const type = get_matchers_type(matchers); - return `${name}${optional ? '?:' : ':'} ${type}`; - }) - .join('; '); - - if (params.length > 0) layout_type = `{ ${params} }`; - } - - layouts.push(`${s(route.id)}: ${layout_type}`); - } - - const assets = manifest_data.assets.map((asset) => s('/' + asset.file)); - - return [ - 'declare module "$app/types" {', - '\ttype MatcherParam = M extends (param : string) => param is (infer U extends string) ? U : string;', - '', - '\texport interface AppTypes {', - `\t\tRouteId(): ${manifest_data.routes.map((r) => s(r.id)).join(' | ')};`, - `\t\tRouteParams(): {\n\t\t\t${dynamic_routes.join(';\n\t\t\t')}\n\t\t};`, - `\t\tLayoutParams(): {\n\t\t\t${layouts.join(';\n\t\t\t')}\n\t\t};`, - `\t\tPathname(): ${Array.from(pathnames).join(' | ')};`, - '\t\tResolvedPathname(): `${"" | `/${string}`}${ReturnType}`;', - `\t\tAsset(): ${assets.concat('string & {}').join(' | ')};`, - '\t}', - '}' - ].join('\n'); -} - -/** - * Writes non-ambient declarations to the output directory - * @param {import('types').ValidatedKitConfig} config - * @param {import('types').ManifestData} manifest_data - */ -export function write_non_ambient(config, manifest_data) { - const app_types = generate_app_types(manifest_data, config); - const content = [template, app_types].join('\n\n'); - - write_if_changed(path.join(config.outDir, 'non-ambient.d.ts'), content); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_root.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/write_root.js deleted file mode 100644 index 445c17e..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_root.js +++ /dev/null @@ -1,196 +0,0 @@ -import { dedent, isSvelte5Plus, write_if_changed } from './utils.js'; - -/** - * @param {import('types').ManifestData} manifest_data - * @param {import('types').ValidatedConfig} config - * @param {string} output - */ -export function write_root(manifest_data, config, output) { - // TODO remove default layout altogether - - const use_boundaries = config.kit.experimental.handleRenderingErrors && isSvelte5Plus(); - - const max_depth = Math.max( - ...manifest_data.routes.map((route) => - route.page ? route.page.layouts.filter(Boolean).length + 1 : 0 - ), - 1 - ); - - const levels = []; - for (let i = 0; i <= max_depth; i += 1) { - levels.push(i); - } - - let l = max_depth; - /** @type {string} */ - let pyramid; - - if (isSvelte5Plus() && use_boundaries) { - // with the @const we force the data[depth] access to be derived, which is important to not fire updates needlessly - // TODO in Svelte 5 we should rethink the client.js side, we can likely make data a $state and only update indexes that changed there, simplifying this a lot - pyramid = dedent` - {#snippet pyramid(depth)} - {@const Pyramid = constructors[depth]} - {#snippet failed(error)} - {@const ErrorPage = errors[depth]} - - {/snippet} - - {#if constructors[depth + 1]} - {@const d = data[depth]} - - - {@render pyramid(depth + 1)} - - {:else} - {@const d = data[depth]} - - - {/if} - - {/snippet} - - {@render pyramid(0)} - `; - } else { - pyramid = dedent` - ${ - isSvelte5Plus() - ? ` - ` - : `` - }`; - - while (l--) { - pyramid = dedent` - {#if constructors[${l + 1}]} - ${ - isSvelte5Plus() - ? dedent`{@const Pyramid_${l} = constructors[${l}]} - - - ${pyramid} - ` - : dedent` - ${pyramid} - ` - } - - {:else} - ${ - isSvelte5Plus() - ? dedent` - {@const Pyramid_${l} = constructors[${l}]} - - - ` - : dedent`` - } - - {/if} - `; - } - } - - write_if_changed( - `${output}/root.svelte`, - dedent` - - ${isSvelte5Plus() ? '' : ''} - - - ${pyramid} - - {#if mounted} -
- {#if navigated} - {title} - {/if} -
- {/if} - ` - ); - - if (isSvelte5Plus()) { - write_if_changed( - `${output}/root.js`, - dedent` - import { asClassComponent } from 'svelte/legacy'; - import Root from './root.svelte'; - export default asClassComponent(Root); - ` - ); - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_server.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/write_server.js deleted file mode 100644 index 711a007..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_server.js +++ /dev/null @@ -1,143 +0,0 @@ -import path from 'node:path'; -import process from 'node:process'; -import { hash } from '../../utils/hash.js'; -import { posixify, resolve_entry } from '../../utils/filesystem.js'; -import { s } from '../../utils/misc.js'; -import { load_error_page, load_template } from '../config/index.js'; -import { runtime_directory } from '../utils.js'; -import { isSvelte5Plus, write_if_changed } from './utils.js'; -import colors from 'kleur'; -import { escape_html } from '../../utils/escape.js'; - -/** - * @param {{ - * server_hooks: string | null; - * universal_hooks: string | null; - * config: import('types').ValidatedConfig; - * has_service_worker: boolean; - * runtime_directory: string; - * template: string; - * error_page: string; - * }} opts - */ -const server_template = ({ - config, - server_hooks, - universal_hooks, - has_service_worker, - runtime_directory, - template, - error_page -}) => ` -import root from '../root.${isSvelte5Plus() ? 'js' : 'svelte'}'; -import { set_building, set_prerendering } from '__sveltekit/environment'; -import { set_assets } from '$app/paths/internal/server'; -import { set_manifest, set_read_implementation } from '__sveltekit/server'; -import { set_private_env, set_public_env } from '${runtime_directory}/shared-server.js'; - -export const options = { - app_template_contains_nonce: ${template.includes('%sveltekit.nonce%')}, - async: ${s(!!config.compilerOptions?.experimental?.async)}, - csp: ${s(config.kit.csp)}, - csrf_check_origin: ${s(config.kit.csrf.checkOrigin && !config.kit.csrf.trustedOrigins.includes('*'))}, - csrf_trusted_origins: ${s(config.kit.csrf.trustedOrigins)}, - embedded: ${config.kit.embedded}, - env_public_prefix: '${config.kit.env.publicPrefix}', - env_private_prefix: '${config.kit.env.privatePrefix}', - hash_routing: ${s(config.kit.router.type === 'hash')}, - hooks: null, // added lazily, via \`get_hooks\` - preload_strategy: ${s(config.kit.output.preloadStrategy)}, - root, - service_worker: ${has_service_worker}, - service_worker_options: ${config.kit.serviceWorker.register ? s(config.kit.serviceWorker.options) : 'null'}, - server_error_boundaries: ${s(!!config.kit.experimental.handleRenderingErrors)}, - templates: { - app: ({ head, body, assets, nonce, env }) => ${s(template) - .replace('%sveltekit.head%', '" + head + "') - .replace('%sveltekit.body%', '" + body + "') - .replace(/%sveltekit\.assets%/g, '" + assets + "') - .replace(/%sveltekit\.nonce%/g, '" + nonce + "') - .replace(/%sveltekit\.version%/g, escape_html(config.kit.version.name)) - .replace( - /%sveltekit\.env\.([^%]+)%/g, - (_match, capture) => `" + (env[${s(capture)}] ?? "") + "` - )}, - error: ({ status, message }) => ${s(error_page) - .replace(/%sveltekit\.status%/g, '" + status + "') - .replace(/%sveltekit\.error\.message%/g, '" + message + "')} - }, - version_hash: ${s(hash(config.kit.version.name))} -}; - -export async function get_hooks() { - let handle; - let handleFetch; - let handleError; - let handleValidationError; - let init; - ${server_hooks ? `({ handle, handleFetch, handleError, handleValidationError, init } = await import(${s(server_hooks)}));` : ''} - - let reroute; - let transport; - ${universal_hooks ? `({ reroute, transport } = await import(${s(universal_hooks)}));` : ''} - - return { - handle, - handleFetch, - handleError, - handleValidationError, - init, - reroute, - transport - }; -} - -export { set_assets, set_building, set_manifest, set_prerendering, set_private_env, set_public_env, set_read_implementation }; -`; - -// TODO need to re-run this whenever src/app.html or src/error.html are -// created or changed, or src/service-worker.js is created or deleted. -// Also, need to check that updating hooks.server.js works - -/** - * Write server configuration to disk - * @param {import('types').ValidatedConfig} config - * @param {string} output - */ -export function write_server(config, output) { - const server_hooks_file = resolve_entry(config.kit.files.hooks.server); - const universal_hooks_file = resolve_entry(config.kit.files.hooks.universal); - - const typo = resolve_entry('src/+hooks.server'); - if (typo) { - console.log( - colors - .bold() - .yellow( - `Unexpected + prefix. Did you mean ${typo.split('/').at(-1)?.slice(1)}?` + - ` at ${path.resolve(typo)}` - ) - ); - } - - /** @param {string} file */ - function relative(file) { - return posixify(path.relative(`${output}/server`, file)); - } - - // Contains the stringified version of - /** @type {import('types').SSROptions} */ - write_if_changed( - `${output}/server/internal.js`, - server_template({ - config, - server_hooks: server_hooks_file ? relative(server_hooks_file) : null, - universal_hooks: universal_hooks_file ? relative(universal_hooks_file) : null, - has_service_worker: - config.kit.serviceWorker.register && !!resolve_entry(config.kit.files.serviceWorker), - runtime_directory: relative(runtime_directory), - template: load_template(process.cwd(), config), - error_page: load_error_page(config) - }) - ); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_tsconfig.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/write_tsconfig.js deleted file mode 100644 index d0f6330..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_tsconfig.js +++ /dev/null @@ -1,245 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import process from 'node:process'; -import colors from 'kleur'; -import { posixify } from '../../utils/filesystem.js'; -import { write_if_changed } from './utils.js'; - -/** - * @param {string} cwd - * @param {string} file - */ -function maybe_file(cwd, file) { - const resolved = path.resolve(cwd, file); - if (fs.existsSync(resolved)) { - return resolved; - } -} - -/** - * @param {string} file - */ -function project_relative(file) { - return posixify(path.relative('.', file)); -} - -/** - * @param {string} file - */ -function remove_trailing_slashstar(file) { - if (file.endsWith('/*')) { - return file.slice(0, -2); - } else { - return file; - } -} - -/** - * Generates the tsconfig that the user's tsconfig inherits from. - * @param {import('types').ValidatedKitConfig} kit - */ -export function write_tsconfig(kit, cwd = process.cwd()) { - const out = path.join(kit.outDir, 'tsconfig.json'); - - const user_config = load_user_tsconfig(cwd); - if (user_config) validate_user_config(cwd, out, user_config); - - write_if_changed(out, JSON.stringify(get_tsconfig(kit), null, '\t')); -} - -/** - * Generates the tsconfig that the user's tsconfig inherits from. - * @param {import('types').ValidatedKitConfig} kit - */ -export function get_tsconfig(kit) { - /** @param {string} file */ - const config_relative = (file) => posixify(path.relative(kit.outDir, file)); - - const include = new Set([ - 'ambient.d.ts', // careful: changing this name would be a breaking change, because it's referenced in the service-workers documentation - 'non-ambient.d.ts', - './types/**/$types.d.ts', - config_relative('vite.config.js'), - config_relative('vite.config.ts') - ]); - const src_includes = [kit.files.routes, kit.files.lib, kit.files.src].filter((dir) => { - const relative = path.relative(kit.files.src, dir); - return !relative || relative.startsWith('..'); - }); - for (const dir of src_includes) { - include.add(config_relative(`${dir}/**/*.js`)); - include.add(config_relative(`${dir}/**/*.ts`)); - include.add(config_relative(`${dir}/**/*.svelte`)); - } - - // Test folder is a special case - we advocate putting tests in a top-level test folder - // and it's not configurable (should we make it?) - const test_folder = project_relative('test'); - include.add(config_relative(`${test_folder}/**/*.js`)); - include.add(config_relative(`${test_folder}/**/*.ts`)); - include.add(config_relative(`${test_folder}/**/*.svelte`)); - const tests_folder = project_relative('tests'); - include.add(config_relative(`${tests_folder}/**/*.js`)); - include.add(config_relative(`${tests_folder}/**/*.ts`)); - include.add(config_relative(`${tests_folder}/**/*.svelte`)); - - const exclude = [config_relative('node_modules/**')]; - // Add service worker to exclude list so that worker types references in it don't spill over into the rest of the app - // (i.e. suddenly ServiceWorkerGlobalScope would be available throughout the app, and some types might even clash) - if (path.extname(kit.files.serviceWorker)) { - exclude.push(config_relative(kit.files.serviceWorker)); - } else { - exclude.push(config_relative(`${kit.files.serviceWorker}.js`)); - exclude.push(config_relative(`${kit.files.serviceWorker}/**/*.js`)); - exclude.push(config_relative(`${kit.files.serviceWorker}.ts`)); - exclude.push(config_relative(`${kit.files.serviceWorker}/**/*.ts`)); - exclude.push(config_relative(`${kit.files.serviceWorker}.d.ts`)); - exclude.push(config_relative(`${kit.files.serviceWorker}/**/*.d.ts`)); - } - - const config = { - compilerOptions: { - // generated options - paths: { - ...get_tsconfig_paths(kit), - '$app/types': ['./types/index.d.ts'] - }, - rootDirs: [config_relative('.'), './types'], - - // essential options - // svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript - // to enforce using \`import type\` instead of \`import\` for Types. - // Also, TypeScript doesn't know about import usages in the template because it only sees the - // script of a Svelte file. Therefore preserve all value imports. - verbatimModuleSyntax: true, - // Vite compiles modules one at a time - isolatedModules: true, - - // This is required for svelte-package to work as expected - // Can be overwritten - lib: ['esnext', 'DOM', 'DOM.Iterable'], - moduleResolution: 'bundler', - module: 'esnext', - noEmit: true, // prevent tsconfig error "overwriting input files" - Vite handles the build and ignores this - target: 'esnext', - types: ['node'] - }, - include: [...include], - exclude - }; - - return kit.typescript.config(config) ?? config; -} - -/** @param {string} cwd */ -function load_user_tsconfig(cwd) { - const file = maybe_file(cwd, 'tsconfig.json') || maybe_file(cwd, 'jsconfig.json'); - - if (!file) return; - - // we have to eval the file, since it's not parseable as JSON (contains comments) - const json = fs.readFileSync(file, 'utf-8'); - - return { - kind: path.basename(file), - options: (0, eval)(`(${json})`) - }; -} - -/** - * @param {string} cwd - * @param {string} out - * @param {{ kind: string, options: any }} config - */ -function validate_user_config(cwd, out, config) { - // we need to check that the user's tsconfig extends the framework config - const extend = config.options.extends; - const extends_framework_config = - typeof extend === 'string' - ? path.resolve(cwd, extend) === out - : Array.isArray(extend) - ? extend.some((e) => path.resolve(cwd, e) === out) - : false; - - const options = config.options.compilerOptions || {}; - - if (extends_framework_config) { - const { paths, baseUrl } = options; - - // TODO: baseUrl will be removed in TypeScript 7.0 - if (baseUrl || paths) { - console.warn( - colors - .bold() - .yellow( - `You have specified a baseUrl and/or paths in your ${config.kind} which interferes with SvelteKit's auto-generated tsconfig.json. ` + - 'Remove it to avoid problems with intellisense. For path aliases, use `kit.alias` instead: https://svelte.dev/docs/kit/configuration#alias' - ) - ); - } - } else { - let relative = posixify(path.relative('.', out)); - if (!relative.startsWith('./')) relative = './' + relative; - - console.warn( - colors - .bold() - .yellow(`Your ${config.kind} should extend the configuration generated by SvelteKit:`) - ); - console.warn(`{\n "extends": "${relative}"\n}`); - } -} - -// -const alias_regex = /^(.+?)(\/\*)?$/; -// -const value_regex = /^(.*?)((\/\*)|(\.\w+))?$/; - -/** - * Generates tsconfig path aliases from kit's aliases. - * Related to vite alias creation. - * - * @param {import('types').ValidatedKitConfig} config - */ -function get_tsconfig_paths(config) { - /** @param {string} file */ - const config_relative = (file) => { - let relative_path = path.relative(config.outDir, file); - if (!relative_path.startsWith('..')) { - relative_path = './' + relative_path; - } - return posixify(relative_path); - }; - - const alias = { ...config.alias }; - if (fs.existsSync(project_relative(config.files.lib))) { - alias['$lib'] = project_relative(config.files.lib); - } - - /** @type {Record} */ - const paths = {}; - - for (const [key, value] of Object.entries(alias)) { - const key_match = alias_regex.exec(key); - if (!key_match) throw new Error(`Invalid alias key: ${key}`); - - const value_match = value_regex.exec(value); - if (!value_match) throw new Error(`Invalid alias value: ${value}`); - - const rel_path = config_relative(remove_trailing_slashstar(value)); - const slashstar = key_match[2]; - - if (slashstar) { - paths[key] = [rel_path + '/*']; - } else { - paths[key] = [rel_path]; - const fileending = value_match[4]; - - if (!fileending && !(key + '/*' in alias)) { - paths[key + '/*'] = [rel_path + '/*']; - } - } - } - - return paths; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js b/frontend/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js deleted file mode 100644 index bbf63ec..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js +++ /dev/null @@ -1,869 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import process from 'node:process'; -import MagicString from 'magic-string'; -import { posixify, rimraf, walk } from '../../../utils/filesystem.js'; -import { compact } from '../../../utils/array.js'; -import { ts } from '../ts.js'; -const remove_relative_parent_traversals = (/** @type {string} */ path) => - path.replace(/\.\.\//g, ''); -const is_whitespace = (/** @type {string} */ char) => /\s/.test(char); - -/** - * @typedef {{ - * file_name: string; - * modified: boolean; - * code: string; - * exports: any[]; - * } | null} Proxy - * - * @typedef {{ - * server: Proxy, - * universal: Proxy - * }} Proxies - * - * @typedef {Map} RoutesMap - */ - -const cwd = process.cwd(); - -/** - * Creates types for the whole manifest - * @param {import('types').ValidatedConfig} config - * @param {import('types').ManifestData} manifest_data - */ -export function write_all_types(config, manifest_data) { - if (!ts) return; - - const types_dir = `${config.kit.outDir}/types`; - - // empty out files that no longer need to exist - const routes_dir = remove_relative_parent_traversals( - posixify(path.relative('.', config.kit.files.routes)) - ); - const expected_directories = new Set( - manifest_data.routes.map((route) => path.join(routes_dir, route.id)) - ); - - if (fs.existsSync(types_dir)) { - for (const file of walk(types_dir)) { - const dir = path.dirname(file); - if (!expected_directories.has(dir)) { - rimraf(path.join(types_dir, file)); - } - } - } - - // Read/write meta data on each invocation, not once per node process, - // it could be invoked by another process in the meantime. - const meta_data_file = `${types_dir}/route_meta_data.json`; - const has_meta_data = fs.existsSync(meta_data_file); - const meta_data = has_meta_data - ? /** @type {Record} */ (JSON.parse(fs.readFileSync(meta_data_file, 'utf-8'))) - : {}; - const routes_map = create_routes_map(manifest_data); - // For each directory, write $types.d.ts - for (const route of manifest_data.routes) { - if (!route.leaf && !route.layout && !route.endpoint) continue; // nothing to do - - const outdir = path.join(config.kit.outDir, 'types', routes_dir, route.id); - - // check if the types are out of date - /** @type {string[]} */ - const input_files = []; - - /** @type {import('types').PageNode | null} */ - let node = route.leaf; - while (node) { - if (node.universal) input_files.push(node.universal); - if (node.server) input_files.push(node.server); - node = node.parent ?? null; - } - - /** @type {import('types').PageNode | null} */ - node = route.layout; - while (node) { - if (node.universal) input_files.push(node.universal); - if (node.server) input_files.push(node.server); - node = node.parent ?? null; - } - - if (route.endpoint) { - input_files.push(route.endpoint.file); - } - - try { - fs.mkdirSync(outdir, { recursive: true }); - } catch {} - - const output_files = compact( - fs.readdirSync(outdir).map((name) => { - const stats = fs.statSync(path.join(outdir, name)); - if (stats.isDirectory()) return; - return { - name, - updated: stats.mtimeMs - }; - }) - ); - - const source_last_updated = Math.max( - // ctimeMs includes move operations whereas mtimeMs does not - ...input_files.map((file) => fs.statSync(file).ctimeMs) - ); - const types_last_updated = Math.max(...output_files.map((file) => file.updated)); - - const should_generate = - // source files were generated more recently than the types - source_last_updated > types_last_updated || - // no meta data file exists yet - !has_meta_data || - // some file was deleted - !meta_data[route.id]?.every((file) => input_files.includes(file)); - - if (should_generate) { - // track which old files end up being surplus to requirements - const to_delete = new Set(output_files.map((file) => file.name)); - update_types(config, routes_map, route, to_delete); - meta_data[route.id] = input_files; - } - } - - fs.writeFileSync(meta_data_file, JSON.stringify(meta_data, null, '\t')); -} - -/** - * Creates types related to the given file. This should only be called - * if the file in question was edited, not if it was created/deleted/moved. - * @param {import('types').ValidatedConfig} config - * @param {import('types').ManifestData} manifest_data - * @param {string} file - */ -export function write_types(config, manifest_data, file) { - if (!ts) return; - - if (!path.basename(file).startsWith('+')) { - // Not a route file - return; - } - - const id = '/' + posixify(path.relative(config.kit.files.routes, path.dirname(file))); - - const route = manifest_data.routes.find((route) => route.id === id); - if (!route) return; - if (!route.leaf && !route.layout && !route.endpoint) return; // nothing to do - - update_types(config, create_routes_map(manifest_data), route); -} - -/** - * Collect all leafs into a leaf -> route map - * @param {import('types').ManifestData} manifest_data - */ -function create_routes_map(manifest_data) { - /** @type {RoutesMap} */ - const map = new Map(); - for (const route of manifest_data.routes) { - if (route.leaf) { - map.set(route.leaf, { route, proxies: { server: null, universal: null } }); - } - } - return map; -} - -/** - * Update types for a specific route - * @param {import('types').ValidatedConfig} config - * @param {RoutesMap} routes - * @param {import('types').RouteData} route - * @param {Set} [to_delete] - */ -function update_types(config, routes, route, to_delete = new Set()) { - const routes_dir = remove_relative_parent_traversals( - posixify(path.relative('.', config.kit.files.routes)) - ); - const outdir = path.join(config.kit.outDir, 'types', routes_dir, route.id); - - // now generate new types - const imports = ["import type * as Kit from '@sveltejs/kit';"]; - - /** @type {string[]} */ - const declarations = []; - - /** @type {string[]} */ - const exports = []; - - // add 'Expand' helper - // Makes sure a type is "repackaged" and therefore more readable - declarations.push('type Expand = T extends infer O ? { [K in keyof O]: O[K] } : never;'); - - // returns the predicate of a matcher's type guard - or string if there is no type guard - declarations.push( - 'type MatcherParam = M extends (param : string) => param is (infer U extends string) ? U : string;' - ); - - declarations.push( - 'type RouteParams = ' + generate_params_type(route.params, outdir, config) + ';' - ); - - if (route.params.length > 0) { - exports.push( - 'export type EntryGenerator = () => Promise> | Array;' - ); - } - - declarations.push(`type RouteId = '${route.id}';`); - - // These could also be placed in our public types, but it would bloat them unnecessarily and we may want to change these in the future - if (route.layout || route.leaf) { - declarations.push( - // If T extends the empty object, void is also allowed as a return type - 'type MaybeWithVoid = {} extends T ? T | void : T;', - - // Returns the key of the object whose values are required. - 'export type RequiredKeys = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T];', - - // Helper type to get the correct output type for load functions. It should be passed the parent type to check what types from App.PageData are still required. - // If none, void is also allowed as a return type. - 'type OutputDataShape = MaybeWithVoid> & Partial> & Record>', - - // null & {} == null, we need to prevent that in some situations - 'type EnsureDefined = T extends null | undefined ? {} : T;', - - // Takes a union type and returns a union type where each type also has all properties - // of all possible types (typed as undefined), making accessing them more ergonomic - 'type OptionalUnion, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude]?: never } & U : never;', - - // Re-export `Snapshot` from @sveltejs/kit — in future we could use this to infer from the return type of `snapshot.capture` - 'export type Snapshot = Kit.Snapshot;' - ); - } - - if (route.leaf) { - let route_info = routes.get(route.leaf); - if (!route_info) { - // This should be defined, but belts and braces - route_info = { route, proxies: { server: null, universal: null } }; - routes.set(route.leaf, route_info); - } - - const { - declarations: d, - exports: e, - proxies - } = process_node(route.leaf, outdir, true, route_info.proxies); - - exports.push(...e); - declarations.push(...d); - - if (proxies.server) { - route_info.proxies.server = proxies.server; - if (proxies.server?.modified) to_delete.delete(proxies.server.file_name); - } - if (proxies.universal) { - route_info.proxies.universal = proxies.universal; - if (proxies.universal?.modified) to_delete.delete(proxies.universal.file_name); - } - - if (route.leaf.server) { - exports.push( - 'export type Action | void = Record | void> = Kit.Action' - ); - exports.push( - 'export type Actions | void = Record | void> = Kit.Actions' - ); - } - - if (route.leaf.server) { - exports.push( - 'export type PageProps = { params: RouteParams; data: PageData; form: ActionData }' - ); - } else { - exports.push('export type PageProps = { params: RouteParams; data: PageData }'); - } - } - - if (route.layout) { - let all_pages_have_load = true; - /** @type {import('types').RouteParam[]} */ - const layout_params = []; - const ids = ['RouteId']; - - route.layout.child_pages?.forEach((page) => { - const leaf = routes.get(page); - if (leaf) { - if (leaf.route.page) ids.push(`"${leaf.route.id}"`); - - for (const param of leaf.route.params) { - // skip if already added - if (layout_params.some((p) => p.name === param.name)) continue; - layout_params.push({ ...param, optional: true }); - } - - ensureProxies(page, leaf.proxies); - - if ( - // Be defensive - if a proxy doesn't exist (because it couldn't be created), assume a load function exists. - // If we didn't and it's a false negative, the user could wrongfully get a type error on layouts. - (leaf.proxies.server && !leaf.proxies.server.exports.includes('load')) || - (leaf.proxies.universal && !leaf.proxies.universal.exports.includes('load')) - ) { - all_pages_have_load = false; - } - } - if (!page.server && !page.universal) { - all_pages_have_load = false; - } - }); - - if (route.id === '/') { - // root layout is used for fallback error page, where ID can be null - ids.push('null'); - } - - declarations.push(`type LayoutRouteId = ${ids.join(' | ')}`); - - declarations.push( - 'type LayoutParams = RouteParams & ' + generate_params_type(layout_params, outdir, config) - ); - - const { - exports: e, - declarations: d, - proxies - } = process_node( - route.layout, - outdir, - false, - { server: null, universal: null }, - all_pages_have_load - ); - - exports.push(...e); - declarations.push(...d); - - if (proxies.server?.modified) to_delete.delete(proxies.server.file_name); - if (proxies.universal?.modified) to_delete.delete(proxies.universal.file_name); - - exports.push( - 'export type LayoutProps = { params: LayoutParams; data: LayoutData; children: import("svelte").Snippet }' - ); - } - - if (route.endpoint) { - exports.push('export type RequestHandler = Kit.RequestHandler;'); - } - - if (route.leaf?.server || route.layout?.server || route.endpoint) { - exports.push('export type RequestEvent = Kit.RequestEvent;'); - } - - const output = [imports.join('\n'), declarations.join('\n'), exports.join('\n')] - .filter(Boolean) - .join('\n\n'); - - fs.writeFileSync(`${outdir}/$types.d.ts`, output); - to_delete.delete('$types.d.ts'); - - for (const file of to_delete) { - fs.unlinkSync(path.join(outdir, file)); - } -} - -/** - * @param {import('types').PageNode} node - * @param {string} outdir - * @param {boolean} is_page - * @param {Proxies} proxies - * @param {boolean} [all_pages_have_load] - */ -function process_node(node, outdir, is_page, proxies, all_pages_have_load = true) { - const params = `${is_page ? 'Route' : 'Layout'}Params`; - const prefix = is_page ? 'Page' : 'Layout'; - - const route_id = is_page ? 'RouteId' : 'LayoutRouteId'; - - /** @type {string[]} */ - const declarations = []; - /** @type {string[]} */ - const exports = []; - - /** @type {string} */ - let server_data; - /** @type {string} */ - let data; - - ensureProxies(node, proxies); - - if (node.server) { - const basename = path.basename(node.server); - const proxy = proxies.server; - if (proxy?.modified) { - fs.writeFileSync(`${outdir}/proxy${basename}`, proxy.code); - } - - server_data = get_data_type(node.server, 'null', proxy, true); - - const parent_type = `${prefix}ServerParentData`; - - declarations.push(`type ${parent_type} = ${get_parent_type(node, 'LayoutServerData')};`); - - // +page.js load present -> server can return all-optional data - const output_data_shape = - node.universal || (!is_page && all_pages_have_load) - ? 'Partial & Record | void' - : `OutputDataShape<${parent_type}>`; - exports.push( - `export type ${prefix}ServerLoad = Kit.ServerLoad<${params}, ${parent_type}, OutputData, ${route_id}>;` - ); - - exports.push(`export type ${prefix}ServerLoadEvent = Parameters<${prefix}ServerLoad>[0];`); - - if (is_page) { - let type = 'unknown'; - if (proxy && proxy.exports.includes('actions')) { - // If the file wasn't tweaked, we can use the return type of the original file. - // The advantage is that type updates are reflected without saving. - const from = proxy.modified - ? `./proxy${replace_ext_with_js(basename)}` - : path_to_original(outdir, node.server); - - exports.push( - 'type ExcludeActionFailure = T extends Kit.ActionFailure ? never : T extends void ? never : T;', - 'type ActionsSuccess any>> = { [Key in keyof T]: ExcludeActionFailure>>; }[keyof T];', - 'type ExtractActionFailure = T extends Kit.ActionFailure ? X extends void ? never : X : never;', - 'type ActionsFailure any>> = { [Key in keyof T]: Exclude>>, void>; }[keyof T];', - `type ActionsExport = typeof import('${from}').actions`, - 'export type SubmitFunction = Kit.SubmitFunction>, Expand>>' - ); - - type = 'Expand> | null'; - } - exports.push(`export type ActionData = ${type};`); - } - } else { - server_data = 'null'; - } - exports.push(`export type ${prefix}ServerData = ${server_data};`); - - const parent_type = `${prefix}ParentData`; - declarations.push(`type ${parent_type} = ${get_parent_type(node, 'LayoutData')};`); - - if (node.universal) { - const proxy = proxies.universal; - if (proxy?.modified) { - fs.writeFileSync(`${outdir}/proxy${path.basename(node.universal)}`, proxy.code); - } - - const type = get_data_type( - node.universal, - `${parent_type} & EnsureDefined<${prefix}ServerData>`, - proxy - ); - - data = `Expand & OptionalUnion>>`; - - const output_data_shape = - !is_page && all_pages_have_load - ? 'Partial & Record | void' - : `OutputDataShape<${parent_type}>`; - exports.push( - `export type ${prefix}Load = Kit.Load<${params}, ${prefix}ServerData, ${parent_type}, OutputData, ${route_id}>;` - ); - - exports.push(`export type ${prefix}LoadEvent = Parameters<${prefix}Load>[0];`); - } else if (server_data === 'null') { - data = `Expand<${parent_type}>`; - } else { - data = `Expand & EnsureDefined<${prefix}ServerData>>`; - } - - exports.push(`export type ${prefix}Data = ${data};`); - - return { declarations, exports, proxies }; - - /** - * @param {string} file_path - * @param {string} fallback - * @param {Proxy} proxy - * @param {boolean} expand - */ - function get_data_type(file_path, fallback, proxy, expand = false) { - if (proxy) { - if (proxy.exports.includes('load')) { - // If the file wasn't tweaked, we can use the return type of the original file. - // The advantage is that type updates are reflected without saving. - const from = proxy.modified - ? `./proxy${replace_ext_with_js(path.basename(file_path))}` - : path_to_original(outdir, file_path); - const type = `Kit.LoadProperties>>`; - return expand ? `Expand>>` : type; - } else { - return fallback; - } - } else { - return 'unknown'; - } - } -} - -/** - * This function populates the proxies object, if necessary and not already done. - * Proxies are used to tweak the code of a file before it's typechecked. - * They are needed in two places - when generating the types for a page or layout. - * To not do the same work twice, we generate the proxies once and pass them around. - * - * @param {import('types').PageNode} node - * @param {Proxies} proxies - */ -function ensureProxies(node, proxies) { - if (node.server && !proxies.server) { - proxies.server = createProxy(node.server, true); - } - - if (node.universal && !proxies.universal) { - proxies.universal = createProxy(node.universal, false); - } -} - -/** - * @param {string} file_path - * @param {boolean} is_server - * @returns {Proxy} - */ -function createProxy(file_path, is_server) { - const proxy = tweak_types(fs.readFileSync(file_path, 'utf8'), is_server); - if (proxy) { - return { - ...proxy, - file_name: `proxy${path.basename(file_path)}` - }; - } else { - return null; - } -} - -/** - * Get the parent type string by recursively looking up the parent layout and accumulate them to one type. - * @param {import('types').PageNode} node - * @param {string} type - */ -function get_parent_type(node, type) { - const parent_imports = []; - - let parent = node.parent; - - while (parent) { - const d = node.depth - parent.depth; - // unshift because we need it the other way round for the import string - parent_imports.unshift( - `${d === 0 ? '' : `import('${'../'.repeat(d)}${'$types.js'}').`}${type}` - ); - parent = parent.parent; - } - - let parent_str = `EnsureDefined<${parent_imports[0] || '{}'}>`; - for (let i = 1; i < parent_imports.length; i++) { - // Omit is necessary because a parent could have a property with the same key which would - // cause a type conflict. At runtime the child overwrites the parent property in this case, - // so reflect that in the type definition. - // EnsureDefined is necessary because {something: string} & null becomes null. - // Output types of server loads can be null but when passed in through the `parent` parameter they are the empty object instead. - parent_str = `Omit<${parent_str}, keyof ${parent_imports[i]}> & EnsureDefined<${parent_imports[i]}>`; - } - return parent_str; -} - -/** - * @param {string} outdir - * @param {string} file_path - */ -function path_to_original(outdir, file_path) { - return posixify(path.relative(outdir, path.join(cwd, replace_ext_with_js(file_path)))); -} - -/** - * @param {string} file_path - */ -function replace_ext_with_js(file_path) { - // Another extension than `.js` (or nothing, but that fails with node16 moduleResolution) - // will result in TS failing to lookup the file - const ext = path.extname(file_path); - return file_path.slice(0, -ext.length) + '.js'; -} - -/** - * @param {import('types').RouteParam[]} params - * @param {string} outdir - * @param {import('types').ValidatedConfig} config - */ -function generate_params_type(params, outdir, config) { - /** @param {string} matcher */ - const path_to_matcher = (matcher) => - posixify(path.relative(outdir, path.join(config.kit.files.params, matcher + '.js'))); - - return `{ ${params - .map( - (param) => - `${param.name}${param.optional ? '?' : ''}: ${ - param.matcher - ? `MatcherParam` - : 'string' - }` - ) - .join('; ')} }`; -} - -/** - * @param {string} content - * @param {boolean} is_server - * @returns {Omit, 'file_name'> | null} - */ -export function tweak_types(content, is_server) { - const names = new Set(is_server ? ['load', 'actions'] : ['load']); - - try { - let modified = false; - - const ast = ts.createSourceFile( - 'filename.ts', - content, - ts.ScriptTarget.Latest, - false, - ts.ScriptKind.TS - ); - - const code = new MagicString(content); - - const exports = new Map(); - - ast.forEachChild((node) => { - if ( - ts.isExportDeclaration(node) && - node.exportClause && - ts.isNamedExports(node.exportClause) - ) { - node.exportClause.elements.forEach((element) => { - const exported = element.name; - if (names.has(element.name.text)) { - const local = element.propertyName || element.name; - exports.set(exported.text, local.text); - } - }); - } - - if ( - ts.canHaveModifiers(node) && - ts.getModifiers(node)?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) - ) { - if (ts.isFunctionDeclaration(node) && node.name?.text && names.has(node.name?.text)) { - exports.set(node.name.text, node.name.text); - } - - if (ts.isVariableStatement(node)) { - node.declarationList.declarations.forEach((declaration) => { - if (ts.isIdentifier(declaration.name) && names.has(declaration.name.text)) { - exports.set(declaration.name.text, declaration.name.text); - } - }); - } - } - }); - - /** - * @param {import('typescript').Node} node - * @param {import('typescript').Node} value - */ - function replace_jsdoc_type_tags(node, value) { - let _modified = false; - // @ts-ignore - if (node.jsDoc) { - // @ts-ignore - for (const comment of node.jsDoc) { - for (const tag of comment.tags ?? []) { - if (ts.isJSDocTypeTag(tag)) { - const is_fn = - ts.isFunctionDeclaration(value) || - ts.isFunctionExpression(value) || - ts.isArrowFunction(value); - - if (is_fn && value.parameters?.length > 0) { - const name = ts.isIdentifier(value.parameters[0].name) - ? value.parameters[0].name.text - : 'event'; - code.overwrite(tag.tagName.pos, tag.tagName.end, 'param'); - code.prependRight(tag.typeExpression.pos + 1, 'Parameters<'); - code.appendLeft(tag.typeExpression.end - 1, '>[0]'); - code.appendLeft(tag.typeExpression.end, ` ${name}`); - } else { - code.overwrite(tag.pos, tag.end, ''); - } - _modified = true; - } - } - } - } - modified = modified || _modified; - return _modified; - } - - ast.forEachChild((node) => { - if (ts.isFunctionDeclaration(node) && node.name?.text && node.name?.text === 'load') { - // remove JSDoc comment above `export function load ...` - replace_jsdoc_type_tags(node, node); - } - - if (ts.isVariableStatement(node)) { - // remove JSDoc comment above `export const load = ...` - if ( - ts.isIdentifier(node.declarationList.declarations[0].name) && - names.has(node.declarationList.declarations[0].name.text) && - node.declarationList.declarations[0].initializer - ) { - replace_jsdoc_type_tags(node, node.declarationList.declarations[0].initializer); - } - - for (const declaration of node.declarationList.declarations) { - if ( - ts.isIdentifier(declaration.name) && - declaration.name.text === 'load' && - declaration.initializer - ) { - // edge case — remove JSDoc comment above individual export - replace_jsdoc_type_tags(declaration, declaration.initializer); - - // remove type from `export const load: Load ...` - if (declaration.type) { - let a = declaration.type.pos; - const b = declaration.type.end; - while (is_whitespace(content[a])) a += 1; - - const type = content.slice(a, b); - code.remove(declaration.name.end, declaration.type.end); - - const rhs = declaration.initializer; - - if ( - rhs && - (ts.isArrowFunction(rhs) || ts.isFunctionExpression(rhs)) && - rhs.parameters.length - ) { - const arg = rhs.parameters[0]; - const add_parens = content[arg.pos - 1] !== '('; - - if (add_parens) code.prependRight(arg.pos, '('); - - if (arg && !arg.type) { - code.appendLeft( - arg.name.end, - `: Parameters<${type}>[0]` + (add_parens ? ')' : '') - ); - } else { - // prevent "type X is imported but not used" (isn't silenced by @ts-nocheck) when svelte-check runs - code.append(`;null as any as ${type};`); - } - } else { - // prevent "type X is imported but not used" (isn't silenced by @ts-nocheck) when svelte-check runs - code.append(`;null as any as ${type};`); - } - - modified = true; - } - } else if ( - is_server && - ts.isIdentifier(declaration.name) && - declaration.name?.text === 'actions' && - declaration.initializer - ) { - // remove JSDoc comment from `export const actions = ..` - const removed = replace_jsdoc_type_tags(node, declaration.initializer); - // ... and move type to each individual action - if (removed) { - const rhs = declaration.initializer; - if (ts.isObjectLiteralExpression(rhs)) { - for (const prop of rhs.properties) { - if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) { - const rhs = prop.initializer; - const replaced = replace_jsdoc_type_tags(prop, rhs); - if ( - !replaced && - rhs && - (ts.isArrowFunction(rhs) || ts.isFunctionExpression(rhs)) && - rhs.parameters?.[0] - ) { - const name = ts.isIdentifier(rhs.parameters[0].name) - ? rhs.parameters[0].name.text - : 'event'; - code.prependRight( - rhs.pos, - `/** @param {import('./$types').RequestEvent} ${name} */ ` - ); - } - } - } - } - } - - // remove type from `export const actions: Actions ...` - if (declaration.type) { - let a = declaration.type.pos; - const b = declaration.type.end; - while (is_whitespace(content[a])) a += 1; - - const type = content.slice(a, b); - code.remove(declaration.name.end, declaration.type.end); - code.append(`;null as any as ${type};`); - modified = true; - - // ... and move type to each individual action - const rhs = declaration.initializer; - if (ts.isObjectLiteralExpression(rhs)) { - for (const prop of rhs.properties) { - if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) { - const rhs = prop.initializer; - - if ( - rhs && - (ts.isArrowFunction(rhs) || ts.isFunctionExpression(rhs)) && - rhs.parameters.length - ) { - const arg = rhs.parameters[0]; - const add_parens = content[arg.pos - 1] !== '('; - - if (add_parens) code.prependRight(arg.pos, '('); - - if (arg && !arg.type) { - code.appendLeft( - arg.name.end, - ": import('./$types').RequestEvent" + (add_parens ? ')' : '') - ); - } - } - } - } - } - } - } - } - } - }); - - if (modified) { - // Ignore all type errors so they don't show up twice when svelte-check runs - // Account for possible @ts-check which would overwrite @ts-nocheck - if (code.original.startsWith('// @ts-check')) { - code.prependLeft('// @ts-check'.length, '\n// @ts-nocheck\n'); - } else { - code.prepend('// @ts-nocheck\n'); - } - } - - return { - modified, - code: code.toString(), - exports: Array.from(exports.keys()) - }; - } catch { - return null; - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/core/utils.js b/frontend/node_modules/@sveltejs/kit/src/core/utils.js deleted file mode 100644 index 3bbcdea..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/core/utils.js +++ /dev/null @@ -1,86 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import process from 'node:process'; -import { fileURLToPath } from 'node:url'; -import colors from 'kleur'; -import { posixify, to_fs } from '../utils/filesystem.js'; -import { noop } from '../utils/functions.js'; - -/** - * Resolved path of the `runtime` directory - * - * TODO Windows issue: - * Vite or sth else somehow sets the driver letter inconsistently to lower or upper case depending on the run environment. - * In playwright debug mode run through VS Code this a root-to-lowercase conversion is needed in order for the tests to run. - * If we do this conversion in other cases it has the opposite effect though and fails. - */ -export const runtime_directory = posixify(fileURLToPath(new URL('../runtime', import.meta.url))); - -/** - * This allows us to import SvelteKit internals that aren't exposed via `pkg.exports` in a - * way that works whether `@sveltejs/kit` is installed inside the project's `node_modules` - * or in a workspace root - */ -export const runtime_base = runtime_directory.startsWith(process.cwd()) - ? `/${path.relative('.', runtime_directory)}` - : to_fs(runtime_directory); - -/** @param {{ verbose: boolean }} opts */ -export function logger({ verbose }) { - /** @type {import('types').Logger} */ - const log = (msg) => console.log(msg.replace(/^/gm, ' ')); - - /** @param {string} msg */ - const err = (msg) => console.error(msg.replace(/^/gm, ' ')); - - log.success = (msg) => log(colors.green(`✔ ${msg}`)); - log.error = (msg) => err(colors.bold().red(msg)); - log.warn = (msg) => log(colors.bold().yellow(msg)); - - log.minor = verbose ? (msg) => log(colors.grey(msg)) : noop; - log.info = verbose ? log : noop; - - return log; -} - -/** @param {import('types').ManifestData} manifest_data */ -export function get_mime_lookup(manifest_data) { - /** @type {Record} */ - const mime = {}; - - manifest_data.assets.forEach((asset) => { - if (asset.type) { - const ext = path.extname(asset.file); - mime[ext] = asset.type; - } - }); - - return mime; -} - -/** - * @param {string} dir - * @param {(file: string) => boolean} [filter] - */ -export function list_files(dir, filter) { - /** @type {string[]} */ - const files = []; - - /** @param {string} current */ - function walk(current) { - for (const file of fs.readdirSync(path.resolve(dir, current))) { - const child = path.posix.join(current, file); - if (fs.statSync(path.resolve(dir, child)).isDirectory()) { - walk(child); - } else { - if (!filter || filter(child)) { - files.push(child); - } - } - } - } - - if (fs.existsSync(dir)) walk(''); - - return files; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/hooks/index.js b/frontend/node_modules/@sveltejs/kit/src/exports/hooks/index.js deleted file mode 100644 index 98e1e53..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/hooks/index.js +++ /dev/null @@ -1 +0,0 @@ -export { sequence } from './sequence.js'; diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/hooks/sequence.js b/frontend/node_modules/@sveltejs/kit/src/exports/hooks/sequence.js deleted file mode 100644 index 3668c50..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/hooks/sequence.js +++ /dev/null @@ -1,145 +0,0 @@ -/** @import { Handle, RequestEvent, ResolveOptions } from '@sveltejs/kit' */ -/** @import { MaybePromise } from 'types' */ -import { - merge_tracing, - get_request_store, - with_request_store -} from '@sveltejs/kit/internal/server'; - -/** - * A helper function for sequencing multiple `handle` calls in a middleware-like manner. - * The behavior for the `handle` options is as follows: - * - `transformPageChunk` is applied in reverse order and merged - * - `preload` is applied in forward order, the first option "wins" and no `preload` options after it are called - * - `filterSerializedResponseHeaders` behaves the same as `preload` - * - * ```js - * /// file: src/hooks.server.js - * import { sequence } from '@sveltejs/kit/hooks'; - * - * /// type: import('@sveltejs/kit').Handle - * async function first({ event, resolve }) { - * console.log('first pre-processing'); - * const result = await resolve(event, { - * transformPageChunk: ({ html }) => { - * // transforms are applied in reverse order - * console.log('first transform'); - * return html; - * }, - * preload: () => { - * // this one wins as it's the first defined in the chain - * console.log('first preload'); - * return true; - * } - * }); - * console.log('first post-processing'); - * return result; - * } - * - * /// type: import('@sveltejs/kit').Handle - * async function second({ event, resolve }) { - * console.log('second pre-processing'); - * const result = await resolve(event, { - * transformPageChunk: ({ html }) => { - * console.log('second transform'); - * return html; - * }, - * preload: () => { - * console.log('second preload'); - * return true; - * }, - * filterSerializedResponseHeaders: () => { - * // this one wins as it's the first defined in the chain - * console.log('second filterSerializedResponseHeaders'); - * return true; - * } - * }); - * console.log('second post-processing'); - * return result; - * } - * - * export const handle = sequence(first, second); - * ``` - * - * The example above would print: - * - * ``` - * first pre-processing - * first preload - * second pre-processing - * second filterSerializedResponseHeaders - * second transform - * first transform - * second post-processing - * first post-processing - * ``` - * - * @param {...Handle} handlers The chain of `handle` functions - * @returns {Handle} - */ -export function sequence(...handlers) { - const length = handlers.length; - if (!length) return ({ event, resolve }) => resolve(event); - - return ({ event, resolve }) => { - const { state } = get_request_store(); - return apply_handle(0, event, {}); - - /** - * @param {number} i - * @param {RequestEvent} event - * @param {ResolveOptions | undefined} parent_options - * @returns {MaybePromise} - */ - function apply_handle(i, event, parent_options) { - const handle = handlers[i]; - - return state.tracing.record_span({ - name: `sveltekit.handle.sequenced.${handle.name ? handle.name : i}`, - attributes: {}, - fn: async (current) => { - const traced_event = merge_tracing(event, current); - return await with_request_store({ event: traced_event, state }, () => - handle({ - event: traced_event, - resolve: (event, options) => { - /** @type {ResolveOptions['transformPageChunk']} */ - const transformPageChunk = async ({ html, done }) => { - if (options?.transformPageChunk) { - html = (await options.transformPageChunk({ html, done })) ?? ''; - } - - if (parent_options?.transformPageChunk) { - html = (await parent_options.transformPageChunk({ html, done })) ?? ''; - } - - return html; - }; - - /** @type {ResolveOptions['filterSerializedResponseHeaders']} */ - const filterSerializedResponseHeaders = - parent_options?.filterSerializedResponseHeaders ?? - options?.filterSerializedResponseHeaders; - - /** @type {ResolveOptions['preload']} */ - const preload = parent_options?.preload ?? options?.preload; - - return i < length - 1 - ? apply_handle(i + 1, event, { - transformPageChunk, - filterSerializedResponseHeaders, - preload - }) - : resolve(event, { - transformPageChunk, - filterSerializedResponseHeaders, - preload - }); - } - }) - ); - } - }); - } - }; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/index.js b/frontend/node_modules/@sveltejs/kit/src/exports/index.js deleted file mode 100644 index c6e2b7c..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/index.js +++ /dev/null @@ -1,308 +0,0 @@ -/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ - -import { HttpError, Redirect, ActionFailure, ValidationError } from './internal/index.js'; -import { BROWSER, DEV } from 'esm-env'; -import { - add_data_suffix, - add_resolution_suffix, - has_data_suffix, - has_resolution_suffix, - strip_data_suffix, - strip_resolution_suffix -} from '../runtime/pathname.js'; -import { text_encoder } from '../runtime/utils.js'; - -export { VERSION } from '../version.js'; - -// TODO 3.0: remove these types as they are not used anymore (we can't remove them yet because that would be a breaking change) -/** - * @template {number} TNumber - * @template {any[]} [TArray=[]] - * @typedef {TNumber extends TArray['length'] ? TArray[number] : LessThan} LessThan - */ - -/** - * @template {number} TStart - * @template {number} TEnd - * @typedef {Exclude, LessThan>} NumericRange - */ - -// Keep the status codes as `number` because restricting to certain numbers makes it unnecessarily hard to use compared to the benefits -// (we have runtime errors already to check for invalid codes). Also see https://github.com/sveltejs/kit/issues/11780 - -// we have to repeat the JSDoc because the display for function overloads is broken -// see https://github.com/microsoft/TypeScript/issues/55056 - -/** - * Throws an error with a HTTP status code and an optional message. - * When called during request handling, this will cause SvelteKit to - * return an error response without invoking `handleError`. - * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. - * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. - * @param {App.Error} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. - * @overload - * @param {number} status - * @param {App.Error} body - * @return {never} - * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. - * @throws {Error} If the provided status is invalid (not between 400 and 599). - */ -/** - * Throws an error with a HTTP status code and an optional message. - * When called during request handling, this will cause SvelteKit to - * return an error response without invoking `handleError`. - * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. - * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. - * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. - * @overload - * @param {number} status - * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] - * @return {never} - * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. - * @throws {Error} If the provided status is invalid (not between 400 and 599). - */ -/** - * Throws an error with a HTTP status code and an optional message. - * When called during request handling, this will cause SvelteKit to - * return an error response without invoking `handleError`. - * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. - * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. - * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. - * @return {never} - * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. - * @throws {Error} If the provided status is invalid (not between 400 and 599). - */ -export function error(status, body) { - if ((!BROWSER || DEV) && (isNaN(status) || status < 400 || status > 599)) { - throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`); - } - - throw new HttpError(status, body); -} - -/** - * Checks whether this is an error thrown by {@link error}. - * @template {number} T - * @param {unknown} e - * @param {T} [status] The status to filter for. - * @return {e is (HttpError & { status: T extends undefined ? never : T })} - */ -export function isHttpError(e, status) { - if (!(e instanceof HttpError)) return false; - return !status || e.status === status; -} - -/** - * Redirect a request. When called during request handling, SvelteKit will return a redirect response. - * Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it. - * - * Most common status codes: - * * `303 See Other`: redirect as a GET request (often used after a form POST request) - * * `307 Temporary Redirect`: redirect will keep the request method - * * `308 Permanent Redirect`: redirect will keep the request method, SEO will be transferred to the new page - * - * [See all redirect status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages) - * - * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | ({} & number)} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308. - * @param {string | URL} location The location to redirect to. - * @throws {Redirect} This error instructs SvelteKit to redirect to the specified location. - * @throws {Error} If the provided status is invalid or the location cannot be used as a header value. - * @return {never} - */ -export function redirect(status, location) { - if ((!BROWSER || DEV) && (isNaN(status) || status < 300 || status > 308)) { - throw new Error('Invalid status code'); - } - - throw new Redirect( - // @ts-ignore - status, - location.toString() - ); -} - -/** - * Checks whether this is a redirect thrown by {@link redirect}. - * @param {unknown} e The object to check. - * @return {e is Redirect} - */ -export function isRedirect(e) { - return e instanceof Redirect; -} - -/** - * Create a JSON `Response` object from the supplied data. - * @param {any} data The value that will be serialized as JSON. - * @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. `Content-Type: application/json` and `Content-Length` headers will be added automatically. - */ -export function json(data, init) { - // TODO deprecate this in favour of `Response.json` when it's - // more widely supported - const body = JSON.stringify(data); - - // we can't just do `text(JSON.stringify(data), init)` because - // it will set a default `content-type` header. duplicated code - // means less duplicated work - const headers = new Headers(init?.headers); - if (!headers.has('content-length')) { - headers.set('content-length', text_encoder.encode(body).byteLength.toString()); - } - - if (!headers.has('content-type')) { - headers.set('content-type', 'application/json'); - } - - return new Response(body, { - ...init, - headers - }); -} - -/** - * Create a `Response` object from the supplied body. - * @param {string} body The value that will be used as-is. - * @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically. - */ -export function text(body, init) { - const headers = new Headers(init?.headers); - if (!headers.has('content-length')) { - const encoded = text_encoder.encode(body); - headers.set('content-length', encoded.byteLength.toString()); - return new Response(encoded, { - ...init, - headers - }); - } - - return new Response(body, { - ...init, - headers - }); -} - -/** - * Create an `ActionFailure` object. Call when form submission fails. - * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. - * @overload - * @param {number} status - * @returns {import('./public.js').ActionFailure} - */ -/** - * Create an `ActionFailure` object. Call when form submission fails. - * @template [T=undefined] - * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. - * @param {T} data Data associated with the failure (e.g. validation errors) - * @overload - * @param {number} status - * @param {T} data - * @returns {import('./public.js').ActionFailure} - */ -/** - * Create an `ActionFailure` object. Call when form submission fails. - * @param {number} status - * @param {any} [data] - * @returns {import('./public.js').ActionFailure} - */ -export function fail(status, data) { - // @ts-expect-error unique symbol missing - return new ActionFailure(status, data); -} - -/** - * Checks whether this is an action failure thrown by {@link fail}. - * @param {unknown} e The object to check. - * @return {e is import('./public.js').ActionFailure} - */ -export function isActionFailure(e) { - return e instanceof ActionFailure; -} - -/** - * Use this to throw a validation error to imperatively fail form validation. - * Can be used in combination with `issue` passed to form actions to create field-specific issues. - * - * @example - * ```ts - * import { invalid } from '@sveltejs/kit'; - * import { form } from '$app/server'; - * import { tryLogin } from '$lib/server/auth'; - * import * as v from 'valibot'; - * - * export const login = form( - * v.object({ name: v.string(), _password: v.string() }), - * async ({ name, _password }) => { - * const success = tryLogin(name, _password); - * if (!success) { - * invalid('Incorrect username or password'); - * } - * - * // ... - * } - * ); - * ``` - * @param {...(StandardSchemaV1.Issue | string)} issues - * @returns {never} - * @since 2.47.3 - */ -export function invalid(...issues) { - throw new ValidationError( - issues.map((issue) => (typeof issue === 'string' ? { message: issue } : issue)) - ); -} - -/** - * Checks whether this is an validation error thrown by {@link invalid}. - * @param {unknown} e The object to check. - * @return {e is import('./public.js').ActionFailure} - * @since 2.47.3 - */ -export function isValidationError(e) { - return e instanceof ValidationError; -} - -/** - * Strips possible SvelteKit-internal suffixes and trailing slashes from the URL pathname. - * Returns the normalized URL as well as a method for adding the potential suffix back - * based on a new pathname (possibly including search) or URL. - * ```js - * import { normalizeUrl } from '@sveltejs/kit'; - * - * const { url, denormalize } = normalizeUrl('/blog/post/__data.json'); - * console.log(url.pathname); // /blog/post - * console.log(denormalize('/blog/post/a')); // /blog/post/a/__data.json - * ``` - * @param {URL | string} url - * @returns {{ url: URL, wasNormalized: boolean, denormalize: (url?: string | URL) => URL }} - * @since 2.18.0 - */ -export function normalizeUrl(url) { - url = new URL(url, 'a://a'); - - const is_route_resolution = has_resolution_suffix(url.pathname); - const is_data_request = has_data_suffix(url.pathname); - const has_trailing_slash = url.pathname !== '/' && url.pathname.endsWith('/'); - - if (is_route_resolution) { - url.pathname = strip_resolution_suffix(url.pathname); - } else if (is_data_request) { - url.pathname = strip_data_suffix(url.pathname); - } else if (has_trailing_slash) { - url.pathname = url.pathname.slice(0, -1); - } - - return { - url, - wasNormalized: is_data_request || is_route_resolution || has_trailing_slash, - denormalize: (new_url = url) => { - new_url = new URL(new_url, url); - if (is_route_resolution) { - new_url.pathname = add_resolution_suffix(new_url.pathname); - } else if (is_data_request) { - new_url.pathname = add_data_suffix(new_url.pathname); - } else if (has_trailing_slash && !new_url.pathname.endsWith('/')) { - new_url.pathname += '/'; - } - return new_url; - } - }; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/internal/event.js b/frontend/node_modules/@sveltejs/kit/src/exports/internal/event.js deleted file mode 100644 index 9d65849..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/internal/event.js +++ /dev/null @@ -1,85 +0,0 @@ -/** @import { RequestEvent } from '@sveltejs/kit' */ -/** @import { RequestStore } from 'types' */ -/** @import { AsyncLocalStorage } from 'node:async_hooks' */ - -import { IN_WEBCONTAINER } from '../../runtime/server/constants.js'; - -/** @type {RequestStore | null} */ -let sync_store = null; - -/** @type {AsyncLocalStorage | null} */ -let als; - -import('node:async_hooks') - .then((hooks) => (als = new hooks.AsyncLocalStorage())) - .catch(() => { - // can't use AsyncLocalStorage, but can still call getRequestEvent synchronously. - // this isn't behind `supports` because it's basically just StackBlitz (i.e. - // in-browser usage) that doesn't support it AFAICT - }); - -/** - * Returns the current `RequestEvent`. Can be used inside server hooks, server `load` functions, actions, and endpoints (and functions called by them). - * - * In environments without [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage), this must be called synchronously (i.e. not after an `await`). - * @since 2.20.0 - * - * @returns {RequestEvent} - */ -export function getRequestEvent() { - const event = try_get_request_store()?.event; - - if (!event) { - let message = - 'Can only read the current request event inside functions invoked during `handle`, such as server `load` functions, actions, endpoints, and other server hooks.'; - - if (!als) { - message += - ' In environments without `AsyncLocalStorage`, the event must be read synchronously, not after an `await`.'; - } - - throw new Error(message); - } - - return event; -} - -export function get_request_store() { - const result = try_get_request_store(); - if (!result) { - let message = 'Could not get the request store.'; - - if (als) { - message += ' This is an internal error.'; - } else { - message += - ' In environments without `AsyncLocalStorage`, the request store (used by e.g. remote functions) must be accessed synchronously, not after an `await`.' + - ' If it was accessed synchronously then this is an internal error.'; - } - - throw new Error(message); - } - return result; -} - -export function try_get_request_store() { - return sync_store ?? als?.getStore() ?? null; -} - -/** - * @template T - * @param {RequestStore | null} store - * @param {() => T} fn - */ -export function with_request_store(store, fn) { - try { - sync_store = store; - return als ? als.run(store, fn) : fn(); - } finally { - // Since AsyncLocalStorage is not working in webcontainers, we don't reset `sync_store` - // and handle only one request at a time in `src/runtime/server/index.js`. - if (!IN_WEBCONTAINER) { - sync_store = null; - } - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/internal/index.js b/frontend/node_modules/@sveltejs/kit/src/exports/internal/index.js deleted file mode 100644 index eb9589c..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/internal/index.js +++ /dev/null @@ -1,90 +0,0 @@ -/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ - -export class HttpError { - /** - * @param {number} status - * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body - */ - constructor(status, body) { - this.status = status; - if (typeof body === 'string') { - this.body = { message: body }; - } else if (body) { - this.body = body; - } else { - this.body = { message: `Error: ${status}` }; - } - } - - toString() { - return JSON.stringify(this.body); - } -} - -export class Redirect { - /** - * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status - * @param {string} location - */ - constructor(status, location) { - try { - new Headers({ location }); - } catch { - throw new Error( - `Invalid redirect location ${JSON.stringify(location)}: ` + - 'this string contains characters that cannot be used in HTTP headers' - ); - } - - this.status = status; - this.location = location; - } -} - -/** - * An error that was thrown from within the SvelteKit runtime that is not fatal and doesn't result in a 500, such as a 404. - * `SvelteKitError` goes through `handleError`. - * @extends Error - */ -export class SvelteKitError extends Error { - /** - * @param {number} status - * @param {string} text - * @param {string} message - */ - constructor(status, text, message) { - super(message); - this.status = status; - this.text = text; - } -} - -/** - * @template [T=undefined] - */ -export class ActionFailure { - /** - * @param {number} status - * @param {T} data - */ - constructor(status, data) { - this.status = status; - this.data = data; - } -} - -/** - * Error thrown when form validation fails imperatively - */ -export class ValidationError extends Error { - /** - * @param {StandardSchemaV1.Issue[]} issues - */ - constructor(issues) { - super('Validation failed'); - this.name = 'ValidationError'; - this.issues = issues; - } -} - -export { init_remote_functions } from './remote-functions.js'; diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/internal/remote-functions.js b/frontend/node_modules/@sveltejs/kit/src/exports/internal/remote-functions.js deleted file mode 100644 index 100488a..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/internal/remote-functions.js +++ /dev/null @@ -1,28 +0,0 @@ -/** @import { RemoteInternals } from 'types' */ - -/** @type {RemoteInternals['type'][]} */ -const types = ['command', 'form', 'prerender', 'query', 'query_batch']; - -/** - * @param {Record} module - * @param {string} file - * @param {string} hash - */ -export function init_remote_functions(module, file, hash) { - if (module.default) { - throw new Error( - `Cannot export \`default\` from a remote module (${file}) — please use named exports instead` - ); - } - - for (const [name, fn] of Object.entries(module)) { - if (!types.includes(fn?.__?.type)) { - throw new Error( - `\`${name}\` exported from ${file} is invalid — all exports from this file must be remote functions` - ); - } - - fn.__.id = `${hash}/${name}`; - fn.__.name = name; - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/internal/server.js b/frontend/node_modules/@sveltejs/kit/src/exports/internal/server.js deleted file mode 100644 index ed42506..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/internal/server.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @template {{ tracing: { enabled: boolean, root: import('@opentelemetry/api').Span, current: import('@opentelemetry/api').Span } }} T - * @param {T} event_like - * @param {import('@opentelemetry/api').Span} current - * @returns {T} - */ -export function merge_tracing(event_like, current) { - return { - ...event_like, - tracing: { - ...event_like.tracing, - current - } - }; -} - -export { - with_request_store, - getRequestEvent, - get_request_store, - try_get_request_store -} from './event.js'; diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/node/index.js b/frontend/node_modules/@sveltejs/kit/src/exports/node/index.js deleted file mode 100644 index 81bd5cf..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/node/index.js +++ /dev/null @@ -1,251 +0,0 @@ -import { createReadStream } from 'node:fs'; -import { Readable } from 'node:stream'; -import * as set_cookie_parser from 'set-cookie-parser'; -import { SvelteKitError } from '../internal/index.js'; -import { noop } from '../../utils/functions.js'; - -/** - * @param {import('http').IncomingMessage} req - * @param {number} [body_size_limit] - */ -function get_raw_body(req, body_size_limit) { - const h = req.headers; - - if (!h['content-type']) { - return null; - } - - const content_length = Number(h['content-length']); - const has_content_length = Number.isFinite(content_length); - - // check if no request body - if ( - (req.httpVersionMajor === 1 && !has_content_length && h['transfer-encoding'] == null) || - content_length === 0 - ) { - return null; - } - - if (req.destroyed) { - const readable = new ReadableStream(); - void readable.cancel(); - return readable; - } - - let size = 0; - let cancelled = false; - - return new ReadableStream({ - start(controller) { - if (body_size_limit !== undefined && has_content_length && content_length > body_size_limit) { - let message = `Content-length of ${content_length} exceeds limit of ${body_size_limit} bytes.`; - - if (body_size_limit === 0) { - // https://github.com/sveltejs/kit/pull/11589 - // TODO this exists to aid migration — remove in a future version - message += ' To disable body size limits, specify Infinity rather than 0.'; - } - - const error = new SvelteKitError(413, 'Payload Too Large', message); - - controller.error(error); - return; - } - - req.on('error', (error) => { - cancelled = true; - controller.error(error); - }); - - req.on('end', () => { - if (cancelled) return; - controller.close(); - }); - - req.on('data', (chunk) => { - if (cancelled) return; - - size += chunk.length; - - if (body_size_limit !== undefined && size > body_size_limit) { - cancelled = true; - - const message = `request body size exceeded BODY_SIZE_LIMIT of ${body_size_limit}`; - - const error = new SvelteKitError(413, 'Payload Too Large', message); - controller.error(error); - - return; - } - - if (has_content_length && size > content_length) { - cancelled = true; - - const message = `request body size exceeded content-length of ${content_length}`; - - const error = new SvelteKitError(413, 'Payload Too Large', message); - controller.error(error); - - return; - } - - controller.enqueue(chunk); - - if (controller.desiredSize === null || controller.desiredSize <= 0) { - req.pause(); - } - }); - }, - - pull() { - req.resume(); - }, - - cancel(reason) { - cancelled = true; - req.destroy(reason); - } - }); -} - -/** - * @param {{ - * request: import('http').IncomingMessage; - * base: string; - * bodySizeLimit?: number; - * }} options - * @returns {Promise} - */ -// TODO 3.0 make the signature synchronous? -// eslint-disable-next-line @typescript-eslint/require-await -export async function getRequest({ request, base, bodySizeLimit }) { - let headers = /** @type {Record} */ (request.headers); - if (request.httpVersionMajor >= 2) { - // the Request constructor rejects headers with ':' in the name - headers = Object.assign({}, headers); - // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.5 - if (headers[':authority']) { - headers.host = headers[':authority']; - } - delete headers[':authority']; - delete headers[':method']; - delete headers[':path']; - delete headers[':scheme']; - } - - // TODO: Whenever Node >=22 is minimum supported version, we can use `request.readableAborted` - // @see https://github.com/nodejs/node/blob/5cf3c3e24c7257a0c6192ed8ef71efec8ddac22b/lib/internal/streams/readable.js#L1443-L1453 - const controller = new AbortController(); - let errored = false; - let end_emitted = false; - request.once('error', () => (errored = true)); - request.once('end', () => (end_emitted = true)); - request.once('close', () => { - if ((errored || request.destroyed) && !end_emitted) { - controller.abort(); - } - }); - - return new Request(base + request.url, { - // @ts-expect-error - duplex: 'half', - method: request.method, - headers: Object.entries(headers), - signal: controller.signal, - body: - request.method === 'GET' || request.method === 'HEAD' - ? undefined - : get_raw_body(request, bodySizeLimit) - }); -} - -/** - * @param {import('http').ServerResponse} res - * @param {Response} response - * @returns {Promise} - */ -// TODO 3.0 make the signature synchronous? -// eslint-disable-next-line @typescript-eslint/require-await -export async function setResponse(res, response) { - for (const [key, value] of response.headers) { - try { - res.setHeader( - key, - key === 'set-cookie' - ? set_cookie_parser.splitCookiesString( - // This is absurd but necessary, TODO: investigate why - /** @type {string}*/ (response.headers.get(key)) - ) - : value - ); - } catch (error) { - res.getHeaderNames().forEach((name) => res.removeHeader(name)); - res.writeHead(500).end(String(error)); - return; - } - } - - res.writeHead(response.status); - - if (!response.body) { - res.end(); - return; - } - - if (response.body.locked) { - res.end( - 'Fatal error: Response body is locked. ' + - "This can happen when the response was already read (for example through 'response.json()' or 'response.text()')." - ); - return; - } - - const reader = response.body.getReader(); - - if (res.destroyed) { - void reader.cancel(); - return; - } - - const cancel = (/** @type {Error|undefined} */ error) => { - res.off('close', cancel); - res.off('error', cancel); - - // If the reader has already been interrupted with an error earlier, - // then it will appear here, it is useless, but it needs to be catch. - reader.cancel(error).catch(noop); - if (error) res.destroy(error); - }; - - res.on('close', cancel); - res.on('error', cancel); - - void next(); - async function next() { - try { - for (;;) { - const { done, value } = await reader.read(); - - if (done) break; - - if (!res.write(value)) { - res.once('drain', next); - return; - } - } - res.end(); - } catch (error) { - cancel(error instanceof Error ? error : new Error(String(error))); - } - } -} - -/** - * Converts a file on disk to a readable stream - * @param {string} file - * @returns {ReadableStream} - * @since 2.4.0 - */ -export function createReadableStream(file) { - return /** @type {ReadableStream} */ (Readable.toWeb(createReadStream(file))); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/node/polyfills.js b/frontend/node_modules/@sveltejs/kit/src/exports/node/polyfills.js deleted file mode 100644 index 347c68c..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/node/polyfills.js +++ /dev/null @@ -1,30 +0,0 @@ -import buffer from 'node:buffer'; -import { webcrypto as crypto } from 'node:crypto'; - -// `buffer.File` was added in Node 18.13.0 while the `File` global was added in Node 20.0.0 -const File = /** @type {import('node:buffer') & { File?: File}} */ (buffer).File; - -/** @type {Record} */ -const globals = { - crypto, - File -}; - -// exported for dev/preview and node environments -/** - * Make various web APIs available as globals: - * - `crypto` - * - `File` - */ -export function installPolyfills() { - for (const name in globals) { - if (name in globalThis) continue; - - Object.defineProperty(globalThis, name, { - enumerable: true, - configurable: true, - writable: true, - value: globals[name] - }); - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/public.d.ts b/frontend/node_modules/@sveltejs/kit/src/exports/public.d.ts deleted file mode 100644 index 38d5990..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/public.d.ts +++ /dev/null @@ -1,2253 +0,0 @@ -import 'svelte'; // pick up `declare module "*.svelte"` -import 'vite/client'; // pick up `declare module "*.jpg"`, etc. -import '../types/ambient.js'; - -import { - AdapterEntry, - CspDirectives, - HttpMethod, - Logger, - MaybePromise, - Prerendered, - PrerenderEntryGeneratorMismatchHandlerValue, - PrerenderHttpErrorHandlerValue, - PrerenderMissingIdHandlerValue, - PrerenderUnseenRoutesHandlerValue, - PrerenderOption, - RequestOptions, - RouteSegment, - DeepPartial, - IsAny -} from '../types/private.js'; -import { BuildData, SSRNodeLoader, SSRRoute, ValidatedConfig } from 'types'; -import { SvelteConfig } from '@sveltejs/vite-plugin-svelte'; -import { StandardSchemaV1 } from '@standard-schema/spec'; -import { - RouteId as AppRouteId, - LayoutParams as AppLayoutParams, - ResolvedPathname -} from '$app/types'; - -export { PrerenderOption } from '../types/private.js'; - -// @ts-ignore this is an optional peer dependency so could be missing. Written like this so dts-buddy preserves the ts-ignore -type Span = import('@opentelemetry/api').Span; - -/** - * [Adapters](https://svelte.dev/docs/kit/adapters) are responsible for taking the production build and turning it into something that can be deployed to a platform of your choosing. - */ -export interface Adapter { - /** - * The name of the adapter, using for logging. Will typically correspond to the package name. - */ - name: string; - /** - * This function is called after SvelteKit has built your app. - * @param builder An object provided by SvelteKit that contains methods for adapting the app - */ - adapt: (builder: Builder) => MaybePromise; - /** - * Checks called during dev and build to determine whether specific features will work in production with this adapter. - */ - supports?: { - /** - * Test support for `read` from `$app/server`. - * @param details.config The merged route config - */ - read?: (details: { config: any; route: { id: string } }) => boolean; - - /** - * Test support for `instrumentation.server.js`. To pass, the adapter must support running `instrumentation.server.js` prior to the application code. - * @since 2.31.0 - */ - instrumentation?: () => boolean; - }; - /** - * Creates an `Emulator`, which allows the adapter to influence the environment - * during dev, build and prerendering. - */ - emulate?: () => MaybePromise; -} - -export type LoadProperties | void> = input extends void - ? undefined // needs to be undefined, because void will break intellisense - : input extends Record - ? input - : unknown; - -export type AwaitedActions any>> = OptionalUnion< - { - [Key in keyof T]: UnpackValidationError>>; - }[keyof T] ->; - -// Takes a union type and returns a union type where each type also has all properties -// of all possible types (typed as undefined), making accessing them more ergonomic -type OptionalUnion< - U extends Record, // not unknown, else interfaces don't satisfy this constraint - A extends keyof U = U extends U ? keyof U : never -> = U extends unknown ? { [P in Exclude]?: never } & U : never; - -declare const uniqueSymbol: unique symbol; - -export interface ActionFailure { - status: number; - data: T; - [uniqueSymbol]: true; // necessary or else UnpackValidationError could wrongly unpack objects with the same shape as ActionFailure -} - -type UnpackValidationError = - T extends ActionFailure - ? X - : T extends void - ? undefined // needs to be undefined, because void will corrupt union type - : T; - -/** - * This object is passed to the `adapt` function of adapters. - * It contains various methods and properties that are useful for adapting the app. - */ -export interface Builder { - /** Print messages to the console. `log.info` and `log.minor` are silent unless Vite's `logLevel` is `info`. */ - log: Logger; - /** Remove `dir` and all its contents. */ - rimraf: (dir: string) => void; - /** Create `dir` and any required parent directories. */ - mkdirp: (dir: string) => void; - - /** The fully resolved Svelte config. */ - config: ValidatedConfig; - /** Information about prerendered pages and assets, if any. */ - prerendered: Prerendered; - /** An array of all routes (including prerendered) */ - routes: RouteDefinition[]; - - // TODO 3.0 remove this method - /** - * Create separate functions that map to one or more routes of your app. - * @param fn A function that groups a set of routes into an entry point - * @deprecated Use `builder.routes` instead - */ - createEntries: (fn: (route: RouteDefinition) => AdapterEntry) => Promise; - - /** - * Find all the assets imported by server files belonging to `routes` - */ - findServerAssets: (routes: RouteDefinition[]) => string[]; - - /** - * Generate a fallback page for a static webserver to use when no route is matched. Useful for single-page apps. - */ - generateFallback: (dest: string) => Promise; - - /** - * Generate a module exposing build-time environment variables as `$env/dynamic/public`. - */ - generateEnvModule: () => void; - - /** - * Generate a server-side manifest to initialise the SvelteKit [server](https://svelte.dev/docs/kit/@sveltejs-kit#Server) with. - * @param opts a relative path to the base directory of the app and optionally in which format (esm or cjs) the manifest should be generated - */ - generateManifest: (opts: { relativePath: string; routes?: RouteDefinition[] }) => string; - - /** - * Resolve a path to the `name` directory inside `outDir`, e.g. `/path/to/.svelte-kit/my-adapter`. - * @param name path to the file, relative to the build directory - */ - getBuildDirectory: (name: string) => string; - /** Get the fully resolved path to the directory containing client-side assets, including the contents of your `static` directory. */ - getClientDirectory: () => string; - /** Get the fully resolved path to the directory containing server-side code. */ - getServerDirectory: () => string; - /** Get the application path including any configured `base` path, e.g. `my-base-path/_app`. */ - getAppPath: () => string; - - /** - * Write client assets to `dest`. - * @param dest the destination folder - * @returns an array of files written to `dest` - */ - writeClient: (dest: string) => string[]; - /** - * Write prerendered files to `dest`. - * @param dest the destination folder - * @returns an array of files written to `dest` - */ - writePrerendered: (dest: string) => string[]; - /** - * Write server-side code to `dest`. - * @param dest the destination folder - * @returns an array of files written to `dest` - */ - writeServer: (dest: string) => string[]; - /** - * Copy a file or directory. - * @param from the source file or directory - * @param to the destination file or directory - * @param opts.filter a function to determine whether a file or directory should be copied - * @param opts.replace a map of strings to replace - * @returns an array of files that were copied - */ - copy: ( - from: string, - to: string, - opts?: { - filter?(basename: string): boolean; - replace?: Record; - } - ) => string[]; - - /** - * Check if the server instrumentation file exists. - * @returns true if the server instrumentation file exists, false otherwise - * @since 2.31.0 - */ - hasServerInstrumentationFile: () => boolean; - - /** - * Instrument `entrypoint` with `instrumentation`. - * - * Renames `entrypoint` to `start` and creates a new module at - * `entrypoint` which imports `instrumentation` and then dynamically imports `start`. This allows - * the module hooks necessary for instrumentation libraries to be loaded prior to any application code. - * - * Caveats: - * - "Live exports" will not work. If your adapter uses live exports, your users will need to manually import the server instrumentation on startup. - * - If `tla` is `false`, OTEL auto-instrumentation may not work properly. Use it if your environment supports it. - * - Use `hasServerInstrumentationFile` to check if the user has a server instrumentation file; if they don't, you shouldn't do this. - * - * @param options an object containing the following properties: - * @param options.entrypoint the path to the entrypoint to trace. - * @param options.instrumentation the path to the instrumentation file. - * @param options.start the name of the start file. This is what `entrypoint` will be renamed to. - * @param options.module configuration for the resulting entrypoint module. - * @param options.module.exports - * @param options.module.generateText a function that receives the relative paths to the instrumentation and start files, and generates the text of the module to be traced. If not provided, the default implementation will be used, which uses top-level await. - * @since 2.31.0 - */ - instrument: (args: { - entrypoint: string; - instrumentation: string; - start?: string; - module?: - | { - exports: string[]; - } - | { - generateText: (args: { instrumentation: string; start: string }) => string; - }; - }) => void; - - /** - * Compress files in `directory` with gzip and brotli, where appropriate. Generates `.gz` and `.br` files alongside the originals. - * @param {string} directory The directory containing the files to be compressed - */ - compress: (directory: string) => Promise; -} - -/** - * An extension of [`vite-plugin-svelte`'s options](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#svelte-options). - */ -export interface Config extends SvelteConfig { - /** - * SvelteKit options. - * - * @see https://svelte.dev/docs/kit/configuration - */ - kit?: KitConfig; - /** Any additional options required by tooling that integrates with Svelte. */ - [key: string]: any; -} - -export interface Cookies { - /** - * Gets a cookie that was previously set with `cookies.set`, or from the request headers. - * @param name the name of the cookie - * @param opts the options, passed directly to `cookie.parse`. See documentation [here](https://github.com/jshttp/cookie#cookieparsestr-options) - */ - get: (name: string, opts?: import('cookie').CookieParseOptions) => string | undefined; - - /** - * Gets all cookies that were previously set with `cookies.set`, or from the request headers. - * @param opts the options, passed directly to `cookie.parse`. See documentation [here](https://github.com/jshttp/cookie#cookieparsestr-options) - */ - getAll: (opts?: import('cookie').CookieParseOptions) => Array<{ name: string; value: string }>; - - /** - * Sets a cookie. This will add a `set-cookie` header to the response, but also make the cookie available via `cookies.get` or `cookies.getAll` during the current request. - * - * The `httpOnly` and `secure` options are `true` by default (except on http://localhost, where `secure` is `false`), and must be explicitly disabled if you want cookies to be readable by client-side JavaScript and/or transmitted over HTTP. The `sameSite` option defaults to `lax`. - * - * You must specify a `path` for the cookie. In most cases you should explicitly set `path: '/'` to make the cookie available throughout your app. You can use relative paths, or set `path: ''` to make the cookie only available on the current path and its children - * @param name the name of the cookie - * @param value the cookie value - * @param opts the options, passed directly to `cookie.serialize`. See documentation [here](https://github.com/jshttp/cookie#cookieserializename-value-options) - */ - set: ( - name: string, - value: string, - opts: import('cookie').CookieSerializeOptions & { path: string } - ) => void; - - /** - * Deletes a cookie by setting its value to an empty string and setting the expiry date in the past. - * - * You must specify a `path` for the cookie. In most cases you should explicitly set `path: '/'` to make the cookie available throughout your app. You can use relative paths, or set `path: ''` to make the cookie only available on the current path and its children - * @param name the name of the cookie - * @param opts the options, passed directly to `cookie.serialize`. The `path` must match the path of the cookie you want to delete. See documentation [here](https://github.com/jshttp/cookie#cookieserializename-value-options) - */ - delete: (name: string, opts: import('cookie').CookieSerializeOptions & { path: string }) => void; - - /** - * Serialize a cookie name-value pair into a `Set-Cookie` header string, but don't apply it to the response. - * - * The `httpOnly` and `secure` options are `true` by default (except on http://localhost, where `secure` is `false`), and must be explicitly disabled if you want cookies to be readable by client-side JavaScript and/or transmitted over HTTP. The `sameSite` option defaults to `lax`. - * - * You must specify a `path` for the cookie. In most cases you should explicitly set `path: '/'` to make the cookie available throughout your app. You can use relative paths, or set `path: ''` to make the cookie only available on the current path and its children - * - * @param name the name of the cookie - * @param value the cookie value - * @param opts the options, passed directly to `cookie.serialize`. See documentation [here](https://github.com/jshttp/cookie#cookieserializename-value-options) - */ - serialize: ( - name: string, - value: string, - opts: import('cookie').CookieSerializeOptions & { path: string } - ) => string; -} - -/** - * A collection of functions that influence the environment during dev, build and prerendering - */ -export interface Emulator { - /** - * A function that is called with the current route `config` and `prerender` option - * and returns an `App.Platform` object - */ - platform?(details: { config: any; prerender: PrerenderOption }): MaybePromise; -} - -export interface KitConfig { - /** - * Your [adapter](https://svelte.dev/docs/kit/adapters) is run when executing `vite build`. It determines how the output is converted for different platforms. - * @default undefined - */ - adapter?: Adapter; - /** - * An object containing zero or more aliases used to replace values in `import` statements. These aliases are automatically passed to Vite and TypeScript. - * - * ```js - * /// file: svelte.config.js - * /// type: import('@sveltejs/kit').Config - * const config = { - * kit: { - * alias: { - * // this will match a file - * 'my-file': 'path/to/my-file.js', - * - * // this will match a directory and its contents - * // (`my-directory/x` resolves to `path/to/my-directory/x`) - * 'my-directory': 'path/to/my-directory', - * - * // an alias ending /* will only match - * // the contents of a directory, not the directory itself - * 'my-directory/*': 'path/to/my-directory/*' - * } - * } - * }; - * ``` - * - * > [!NOTE] You will need to run `npm run dev` to have SvelteKit automatically generate the required alias configuration in `jsconfig.json` or `tsconfig.json`. - * @default {} - */ - alias?: Record; - /** - * The directory where SvelteKit keeps its stuff, including static assets (such as JS and CSS) and internally-used routes. - * - * If `paths.assets` is specified, there will be two app directories — `${paths.assets}/${appDir}` and `${paths.base}/${appDir}`. - * @default "_app" - */ - appDir?: string; - /** - * [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) configuration. CSP helps to protect your users against cross-site scripting (XSS) attacks, by limiting the places resources can be loaded from. For example, a configuration like this... - * - * ```js - * /// file: svelte.config.js - * /// type: import('@sveltejs/kit').Config - * const config = { - * kit: { - * csp: { - * directives: { - * 'script-src': ['self'] - * }, - * // must be specified with either the `report-uri` or `report-to` directives, or both - * reportOnly: { - * 'script-src': ['self'], - * 'report-uri': ['/'] - * } - * } - * } - * }; - * - * export default config; - * ``` - * - * ...would prevent scripts loading from external sites. SvelteKit will augment the specified directives with nonces or hashes (depending on `mode`) for any inline styles and scripts it generates. - * - * To add a nonce for scripts and links manually included in `src/app.html`, you may use the placeholder `%sveltekit.nonce%` (for example ` - * - * - * - * - * - * ``` - * @default 'split' - * @since 2.13.0 - */ - bundleStrategy?: 'split' | 'single' | 'inline'; - }; - paths?: { - /** - * An absolute path that your app's files are served from. This is useful if your files are served from a storage bucket of some kind. - * @default "" - */ - assets?: '' | `http://${string}` | `https://${string}`; - /** - * A root-relative path that must start, but not end with `/` (e.g. `/base-path`), unless it is the empty string. This specifies where your app is served from and allows the app to live on a non-root path. Note that you need to prepend all your root-relative links with the base value or they will point to the root of your domain, not your `base` (this is how the browser works). You can use [`base` from `$app/paths`](https://svelte.dev/docs/kit/$app-paths#base) for that: `Link`. If you find yourself writing this often, it may make sense to extract this into a reusable component. - * @default "" - */ - base?: '' | `/${string}`; - /** - * Whether to use relative asset paths. - * - * If `true`, `base` and `assets` imported from `$app/paths` will be replaced with relative asset paths during server-side rendering, resulting in more portable HTML. - * If `false`, `%sveltekit.assets%` and references to build artifacts will always be root-relative paths, unless `paths.assets` is an external URL - * - * [Single-page app](https://svelte.dev/docs/kit/single-page-apps) fallback pages will always use absolute paths, regardless of this setting. - * - * If your app uses a `` element, you should set this to `false`, otherwise asset URLs will incorrectly be resolved against the `` URL rather than the current page. - * - * In 1.0, `undefined` was a valid value, which was set by default. In that case, if `paths.assets` was not external, SvelteKit would replace `%sveltekit.assets%` with a relative path and use relative paths to reference build artifacts, but `base` and `assets` imported from `$app/paths` would be as specified in your config. - * - * @default true - * @since 1.9.0 - */ - relative?: boolean; - }; - /** - * See [Prerendering](https://svelte.dev/docs/kit/page-options#prerender). - */ - prerender?: { - /** - * How many pages can be prerendered simultaneously. JS is single-threaded, but in cases where prerendering performance is network-bound (for example loading content from a remote CMS) this can speed things up by processing other tasks while waiting on the network response. - * @default 1 - */ - concurrency?: number; - /** - * Whether SvelteKit should find pages to prerender by following links from `entries`. - * @default true - */ - crawl?: boolean; - /** - * An array of pages to prerender, or start crawling from (if `crawl: true`). The `*` string includes all routes containing no required `[parameters]` with optional parameters included as being empty (since SvelteKit doesn't know what value any parameters should have). - * @default ["*"] - */ - entries?: Array<'*' | `/${string}`>; - /** - * How to respond to HTTP errors encountered while prerendering the app. - * - * - `'fail'` — fail the build - * - `'ignore'` - silently ignore the failure and continue - * - `'warn'` — continue, but print a warning - * - `(details) => void` — a custom error handler that takes a `details` object with `status`, `path`, `referrer`, `referenceType` and `message` properties. If you `throw` from this function, the build will fail - * - * ```js - * /// file: svelte.config.js - * /// type: import('@sveltejs/kit').Config - * const config = { - * kit: { - * prerender: { - * handleHttpError: ({ path, referrer, message }) => { - * // ignore deliberate link to shiny 404 page - * if (path === '/not-found' && referrer === '/blog/how-we-built-our-404-page') { - * return; - * } - * - * // otherwise fail the build - * throw new Error(message); - * } - * } - * } - * }; - * ``` - * - * @default "fail" - * @since 1.15.7 - */ - handleHttpError?: PrerenderHttpErrorHandlerValue; - /** - * How to respond when hash links from one prerendered page to another don't correspond to an `id` on the destination page. - * - * - `'fail'` — fail the build - * - `'ignore'` - silently ignore the failure and continue - * - `'warn'` — continue, but print a warning - * - `(details) => void` — a custom error handler that takes a `details` object with `path`, `id`, `referrers` and `message` properties. If you `throw` from this function, the build will fail - * - * @default "fail" - * @since 1.15.7 - */ - handleMissingId?: PrerenderMissingIdHandlerValue; - /** - * How to respond when an entry generated by the `entries` export doesn't match the route it was generated from. - * - * - `'fail'` — fail the build - * - `'ignore'` - silently ignore the failure and continue - * - `'warn'` — continue, but print a warning - * - `(details) => void` — a custom error handler that takes a `details` object with `generatedFromId`, `entry`, `matchedId` and `message` properties. If you `throw` from this function, the build will fail - * - * @default "fail" - * @since 1.16.0 - */ - handleEntryGeneratorMismatch?: PrerenderEntryGeneratorMismatchHandlerValue; - /** - * How to respond when a route is marked as prerenderable but has not been prerendered. - * - * - `'fail'` — fail the build - * - `'ignore'` - silently ignore the failure and continue - * - `'warn'` — continue, but print a warning - * - `(details) => void` — a custom error handler that takes a `details` object with a `routes` property which contains all routes that haven't been prerendered. If you `throw` from this function, the build will fail - * - * The default behavior is to fail the build. This may be undesirable when you know that some of your routes may never be reached under certain - * circumstances such as a CMS not returning data for a specific area, resulting in certain routes never being reached. - * - * @default "fail" - * @since 2.16.0 - */ - handleUnseenRoutes?: PrerenderUnseenRoutesHandlerValue; - /** - * The value of `url.origin` during prerendering; useful if it is included in rendered content. - * @default "http://sveltekit-prerender" - */ - origin?: string; - }; - router?: { - /** - * What type of client-side router to use. - * - `'pathname'` is the default and means the current URL pathname determines the route - * - `'hash'` means the route is determined by `location.hash`. In this case, SSR and prerendering are disabled. This is only recommended if `pathname` is not an option, for example because you don't control the webserver where your app is deployed. - * It comes with some caveats: you can't use server-side rendering (or indeed any server logic), and you have to make sure that the links in your app all start with #/, or they won't work. Beyond that, everything works exactly like a normal SvelteKit app. - * - * @default "pathname" - * @since 2.14.0 - */ - type?: 'pathname' | 'hash'; - /** - * How to determine which route to load when navigating to a new page. - * - * By default, SvelteKit will serve a route manifest to the browser. - * When navigating, this manifest is used (along with the `reroute` hook, if it exists) to determine which components to load and which `load` functions to run. - * Because everything happens on the client, this decision can be made immediately. The drawback is that the manifest needs to be - * loaded and parsed before the first navigation can happen, which may have an impact if your app contains many routes. - * - * Alternatively, SvelteKit can determine the route on the server. This means that for every navigation to a path that has not yet been visited, the server will be asked to determine the route. - * This has several advantages: - * - The client does not need to load the routing manifest upfront, which can lead to faster initial page loads - * - The list of routes is hidden from public view - * - The server has an opportunity to intercept each navigation (for example through a middleware), enabling (for example) A/B testing opaque to SvelteKit - - * The drawback is that for unvisited paths, resolution will take slightly longer (though this is mitigated by [preloading](https://svelte.dev/docs/kit/link-options#data-sveltekit-preload-data)). - * - * > [!NOTE] When using server-side route resolution and prerendering, the resolution is prerendered along with the route itself. - * - * @default "client" - * @since 2.17.0 - */ - resolution?: 'client' | 'server'; - }; - serviceWorker?: { - /** - * Determine which files in your `static` directory will be available in `$service-worker.files`. - * @default (filename) => !/\.DS_Store/.test(filename) - */ - files?: (file: string) => boolean; - } & ( - | { - /** - * Whether to automatically register the service worker, if it exists. - * @default true - */ - register: true; - /** - * Options for serviceWorker.register("...", options); - */ - options?: RegistrationOptions; - } - | { - /** - * Whether to automatically register the service worker, if it exists. - * @default true - */ - register?: false; - } - ); - typescript?: { - /** - * A function that allows you to edit the generated `tsconfig.json`. You can mutate the config (recommended) or return a new one. - * This is useful for extending a shared `tsconfig.json` in a monorepo root, for example. - * - * Note that any paths configured here should be relative to the generated config file, which is written to `.svelte-kit/tsconfig.json`. - * - * @default (config) => config - * @since 1.3.0 - */ - config?: (config: Record) => Record | void; - }; - /** - * Client-side navigation can be buggy if you deploy a new version of your app while people are using it. If the code for the new page is already loaded, it may have stale content; if it isn't, the app's route manifest may point to a JavaScript file that no longer exists. - * SvelteKit helps you solve this problem through version management. - * If SvelteKit encounters an error while loading the page and detects that a new version has been deployed (using the `name` specified here, which defaults to a timestamp of the build) it will fall back to traditional full-page navigation. - * Not all navigations will result in an error though, for example if the JavaScript for the next page is already loaded. If you still want to force a full-page navigation in these cases, use techniques such as setting the `pollInterval` and then using `beforeNavigate`: - * ```html - * /// file: +layout.svelte - * - * ``` - * - * If you set `pollInterval` to a non-zero value, SvelteKit will poll for new versions in the background and set the value of [`updated.current`](https://svelte.dev/docs/kit/$app-state#updated) `true` when it detects one. - */ - version?: { - /** - * The current app version string. If specified, this must be deterministic (e.g. a commit ref rather than `Math.random()` or `Date.now().toString()`), otherwise defaults to a timestamp of the build. - * - * For example, to use the current commit hash, you could do use `git rev-parse HEAD`: - * - * ```js - * /// file: svelte.config.js - * import * as child_process from 'node:child_process'; - * - * export default { - * kit: { - * version: { - * name: child_process.execSync('git rev-parse HEAD').toString().trim() - * } - * } - * }; - * ``` - */ - name?: string; - /** - * The interval in milliseconds to poll for version changes. If this is `0`, no polling occurs. - * @default 0 - */ - pollInterval?: number; - }; -} - -/** - * The [`handle`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle) hook runs every time the SvelteKit server receives a [request](https://svelte.dev/docs/kit/web-standards#Fetch-APIs-Request) and - * determines the [response](https://svelte.dev/docs/kit/web-standards#Fetch-APIs-Response). - * It receives an `event` object representing the request and a function called `resolve`, which renders the route and generates a `Response`. - * This allows you to modify response headers or bodies, or bypass SvelteKit entirely (for implementing routes programmatically, for example). - */ -export type Handle = (input: { - event: RequestEvent; - resolve: (event: RequestEvent, opts?: ResolveOptions) => MaybePromise; -}) => MaybePromise; - -/** - * The server-side [`handleError`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError) hook runs when an unexpected error is thrown while responding to a request. - * - * If an unexpected error is thrown during loading or rendering, this function will be called with the error and the event. - * Make sure that this function _never_ throws an error. - */ -export type HandleServerError = (input: { - error: unknown; - event: RequestEvent; - status: number; - message: string; -}) => MaybePromise; - -/** - * The [`handleValidationError`](https://svelte.dev/docs/kit/hooks#Server-hooks-handleValidationError) hook runs when the argument to a remote function fails validation. - * - * It will be called with the validation issues and the event, and must return an object shape that matches `App.Error`. - */ -export type HandleValidationError = - (input: { issues: Issue[]; event: RequestEvent }) => MaybePromise; - -/** - * The client-side [`handleError`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError) hook runs when an unexpected error is thrown while navigating. - * - * If an unexpected error is thrown during loading or the following render, this function will be called with the error and the event. - * Make sure that this function _never_ throws an error. - */ -export type HandleClientError = (input: { - error: unknown; - event: NavigationEvent; - status: number; - message: string; -}) => MaybePromise; - -/** - * The [`handleFetch`](https://svelte.dev/docs/kit/hooks#Server-hooks-handleFetch) hook allows you to modify (or replace) the result of an [`event.fetch`](https://svelte.dev/docs/kit/load#Making-fetch-requests) call that runs on the server (or during prerendering) inside an endpoint, `load`, `action`, `handle`, `handleError` or `reroute`. - */ -export type HandleFetch = (input: { - event: RequestEvent; - request: Request; - fetch: typeof fetch; -}) => MaybePromise; - -/** - * The [`init`](https://svelte.dev/docs/kit/hooks#Shared-hooks-init) will be invoked before the server responds to its first request - * @since 2.10.0 - */ -export type ServerInit = () => MaybePromise; - -/** - * The [`init`](https://svelte.dev/docs/kit/hooks#Shared-hooks-init) will be invoked once the app starts in the browser - * @since 2.10.0 - */ -export type ClientInit = () => MaybePromise; - -/** - * The [`reroute`](https://svelte.dev/docs/kit/hooks#Universal-hooks-reroute) hook allows you to modify the URL before it is used to determine which route to render. - * @since 2.3.0 - */ -export type Reroute = (event: { url: URL; fetch: typeof fetch }) => MaybePromise; - -/** - * The [`transport`](https://svelte.dev/docs/kit/hooks#Universal-hooks-transport) hook allows you to transport custom types across the server/client boundary. - * - * Each transporter has a pair of `encode` and `decode` functions. On the server, `encode` determines whether a value is an instance of the custom type and, if so, returns a non-falsy encoding of the value which can be an object or an array (or `false` otherwise). - * - * In the browser, `decode` turns the encoding back into an instance of the custom type. - * - * ```ts - * import type { Transport } from '@sveltejs/kit'; - * - * declare class MyCustomType { - * data: any - * } - * - * // hooks.js - * export const transport: Transport = { - * MyCustomType: { - * encode: (value) => value instanceof MyCustomType && [value.data], - * decode: ([data]) => new MyCustomType(data) - * } - * }; - * ``` - * @since 2.11.0 - */ -export type Transport = Record; - -/** - * A member of the [`transport`](https://svelte.dev/docs/kit/hooks#Universal-hooks-transport) hook. - */ -export interface Transporter< - T = any, - U = Exclude -> { - encode: (value: T) => false | U; - decode: (data: U) => T; -} - -/** - * The generic form of `PageLoad` and `LayoutLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types)) - * rather than using `Load` directly. - */ -export type Load< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - InputData extends Record | null = Record | null, - ParentData extends Record = Record, - OutputData extends Record | void = Record | void, - RouteId extends AppRouteId | null = AppRouteId | null -> = (event: LoadEvent) => MaybePromise; - -/** - * The generic form of `PageLoadEvent` and `LayoutLoadEvent`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types)) - * rather than using `LoadEvent` directly. - */ -export interface LoadEvent< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - Data extends Record | null = Record | null, - ParentData extends Record = Record, - RouteId extends AppRouteId | null = AppRouteId | null -> extends NavigationEvent { - /** - * `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features: - * - * - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request. - * - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context). - * - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call. - * - During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle) - * - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request. - * - * You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies) - */ - fetch: typeof fetch; - /** - * Contains the data returned by the route's server `load` function (in `+layout.server.js` or `+page.server.js`), if any. - */ - data: Data; - /** - * If you need to set headers for the response, you can do so using the this method. This is useful if you want the page to be cached, for example: - * - * ```js - * /// file: src/routes/blog/+page.js - * export async function load({ fetch, setHeaders }) { - * const url = `https://cms.example.com/articles.json`; - * const response = await fetch(url); - * - * setHeaders({ - * age: response.headers.get('age'), - * 'cache-control': response.headers.get('cache-control') - * }); - * - * return response.json(); - * } - * ``` - * - * Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once. - * - * You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API in a server-only `load` function instead. - * - * `setHeaders` has no effect when a `load` function runs in the browser. - */ - setHeaders: (headers: Record) => void; - /** - * `await parent()` returns data from parent `+layout.js` `load` functions. - * Implicitly, a missing `+layout.js` is treated as a `({ data }) => data` function, meaning that it will return and forward data from parent `+layout.server.js` files. - * - * Be careful not to introduce accidental waterfalls when using `await parent()`. If for example you only want to merge parent data into the returned output, call it _after_ fetching your other data. - */ - parent: () => Promise; - /** - * This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun. - * - * Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`. - * - * URLs can be absolute or relative to the page being loaded, and must be [encoded](https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding). - * - * Custom identifiers have to be prefixed with one or more lowercase letters followed by a colon to conform to the [URI specification](https://www.rfc-editor.org/rfc/rfc3986.html). - * - * The following example shows how to use `depends` to register a dependency on a custom identifier, which is `invalidate`d after a button click, making the `load` function rerun. - * - * ```js - * /// file: src/routes/+page.js - * let count = 0; - * export async function load({ depends }) { - * depends('increase:count'); - * - * return { count: count++ }; - * } - * ``` - * - * ```html - * /// file: src/routes/+page.svelte - * - * - *

{data.count}

- * - * ``` - */ - depends: (...deps: Array<`${string}:${string}`>) => void; - /** - * Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example: - * - * ```js - * /// file: src/routes/+page.server.js - * export async function load({ untrack, url }) { - * // Untrack url.pathname so that path changes don't trigger a rerun - * if (untrack(() => url.pathname === '/')) { - * return { message: 'Welcome!' }; - * } - * } - * ``` - */ - untrack: (fn: () => T) => T; - - /** - * Access to spans for tracing. If tracing is not enabled or the function is being run in the browser, these spans will do nothing. - * @since 2.31.0 - */ - tracing: { - /** Whether tracing is enabled. */ - enabled: boolean; - /** The root span for the request. This span is named `sveltekit.handle.root`. */ - root: Span; - /** The span associated with the current `load` function. */ - current: Span; - }; -} - -export interface NavigationEvent< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null -> { - /** - * The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object - */ - params: Params; - /** - * Info about the current route - */ - route: { - /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. - */ - id: RouteId; - }; - /** - * The URL of the current page - */ - url: URL; -} - -/** - * Information about the target of a specific navigation. - */ -export interface NavigationTarget< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null -> { - /** - * Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. - * Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route). - */ - params: Params | null; - /** - * Info about the target route - */ - route: { - /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. - */ - id: RouteId | null; - }; - /** - * The URL that is navigated to - */ - url: URL; - /** - * The scroll position associated with this navigation. - * - * For the `from` target, this is the scroll position at the moment of navigation. - * - * For the `to` target, this represents the scroll position that will be or was restored: - * - In `beforeNavigate` and `onNavigate`, this is only available for `popstate` navigations (back/forward button) - * and will be `null` for other navigation types, since the final scroll position isn't known - * ahead of time. - * - In `afterNavigate`, this is always the scroll position that was applied after the navigation - * completed. - */ - scroll: { x: number; y: number } | null; -} - -/** - * - `enter`: The app has hydrated/started - * - `form`: The user submitted a `

` - * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring - * - `link`: Navigation was triggered by a link click - * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect - * - `popstate`: Navigation was triggered by back/forward navigation - */ -export type NavigationType = 'enter' | 'form' | 'leave' | 'link' | 'goto' | 'popstate'; - -export interface NavigationBase { - /** - * Where navigation was triggered from - */ - from: NavigationTarget | null; - /** - * Where navigation is going to/has gone to - */ - to: NavigationTarget | null; - /** - * Whether or not the navigation will result in the page being unloaded (i.e. not a client-side navigation). - */ - willUnload: boolean; - /** - * A promise that resolves once the navigation is complete, and rejects if the navigation - * fails or is aborted. In the case of a `willUnload` navigation, the promise will never resolve - */ - complete: Promise; -} - -export interface NavigationEnter extends NavigationBase { - /** - * The type of navigation: - * - `enter`: The app has hydrated/started - */ - type: 'enter'; - - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; - - /** - * Dispatched `Event` object when navigation occurred by `popstate` or `link`. - */ - event?: undefined; -} - -export type NavigationExternal = NavigationGoto | NavigationLeave; - -export interface NavigationGoto extends NavigationBase { - /** - * The type of navigation: - * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect - */ - type: 'goto'; - - // TODO 3.0 remove this property, so that it only exists when type is 'popstate' - // (would possibly be a breaking change to do it prior to that) - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; -} - -export interface NavigationLeave extends NavigationBase { - /** - * The type of navigation: - * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring - */ - type: 'leave'; - - // TODO 3.0 remove this property, so that it only exists when type is 'popstate' - // (would possibly be a breaking change to do it prior to that) - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; -} - -export interface NavigationFormSubmit extends NavigationBase { - /** - * The type of navigation: - * - `form`: The user submitted a `` - */ - type: 'form'; - - /** - * The `SubmitEvent` that caused the navigation - */ - event: SubmitEvent; - - // TODO 3.0 remove this property, so that it only exists when type is 'popstate' - // (would possibly be a breaking change to do it prior to that) - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; -} - -export interface NavigationPopState extends NavigationBase { - /** - * The type of navigation: - * - `popstate`: Navigation was triggered by back/forward navigation - */ - type: 'popstate'; - - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta: number; - - /** - * The `PopStateEvent` that caused the navigation - */ - event: PopStateEvent; -} - -export interface NavigationLink extends NavigationBase { - /** - * The type of navigation: - * - `link`: Navigation was triggered by a link click - */ - type: 'link'; - - /** - * The `PointerEvent` that caused the navigation - */ - event: PointerEvent; - - // TODO 3.0 remove this property, so that it only exists when type is 'popstate' - // (would possibly be a breaking change to do it prior to that) - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; -} - -export type Navigation = - | NavigationExternal - | NavigationFormSubmit - | NavigationPopState - | NavigationLink; - -/** - * The argument passed to [`beforeNavigate`](https://svelte.dev/docs/kit/$app-navigation#beforeNavigate) callbacks. - */ -export type BeforeNavigate = Navigation & { - /** - * Call this to prevent the navigation from starting. - */ - cancel: () => void; -}; - -/** - * The argument passed to [`onNavigate`](https://svelte.dev/docs/kit/$app-navigation#onNavigate) callbacks. - */ -export type OnNavigate = Navigation & { - type: Exclude; - /** - * Since `onNavigate` callbacks are called immediately before a client-side navigation, they will never be called with a navigation that unloads the page. - */ - willUnload: false; -}; - -/** - * The argument passed to [`afterNavigate`](https://svelte.dev/docs/kit/$app-navigation#afterNavigate) callbacks. - */ -export type AfterNavigate = (Navigation | NavigationEnter) & { - type: Exclude; - /** - * Since `afterNavigate` callbacks are called after a navigation completes, they will never be called with a navigation that unloads the page. - */ - willUnload: false; -}; - -/** - * The shape of the [`page`](https://svelte.dev/docs/kit/$app-state#page) reactive object and the [`$page`](https://svelte.dev/docs/kit/$app-stores) store. - */ -export interface Page< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null -> { - /** - * The URL of the current page. - */ - url: URL & { pathname: ResolvedPathname }; - /** - * The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. - */ - params: Params; - /** - * Info about the current route. - */ - route: { - /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. - */ - id: RouteId; - }; - /** - * HTTP status code of the current page. - */ - status: number; - /** - * The error object of the current page, if any. Filled from the `handleError` hooks. - */ - error: App.Error | null; - /** - * The merged result of all data from all `load` functions on the current page. You can type a common denominator through `App.PageData`. - */ - data: App.PageData & Record; - /** - * The page state, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`. - */ - state: App.PageState; - /** - * Filled only after a form submission. See [form actions](https://svelte.dev/docs/kit/form-actions) for more info. - */ - form: any; -} - -/** - * The shape of a param matcher. See [matching](https://svelte.dev/docs/kit/advanced-routing#Matching) for more info. - */ -export type ParamMatcher = (param: string) => boolean; - -/** - * A single entry yielded by [`requested`](https://svelte.dev/docs/kit/$app-server#requested). - * `arg` is the validated argument (the input *after* the query's schema validated and - * transformed it, if applicable); `query` is a `RemoteQuery` bound to the client's - * original cache key, so `refresh()` / `set()` will update the correct client entry. - */ -export type RequestedEntry = { - arg: Validated; - query: RemoteQuery; -}; - -export type RequestedResult = Iterable> & - AsyncIterable> & { - /** - * Call `refresh` on all queries selected by this `requested` invocation. - * This is identical to: - * ```ts - * import { requested } from '$app/server'; - * - * for await (const { query } of requested(getPost, ...)) { - * void query.refresh(); - * } - * ``` - */ - refreshAll: () => Promise; - }; - -export interface RequestEvent< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null -> { - /** - * Get or set cookies related to the current request - */ - cookies: Cookies; - /** - * `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features: - * - * - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request. - * - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context). - * - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call. - * - During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle) - * - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request. - * - * You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies). - */ - fetch: typeof fetch; - /** - * The client's IP address, set by the adapter. - */ - getClientAddress: () => string; - /** - * Contains custom data that was added to the request within the [`server handle hook`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle). - */ - locals: App.Locals; - /** - * The parameters of the current route - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. - */ - params: Params; - /** - * Additional data made available through the adapter. - */ - platform: Readonly | undefined; - /** - * The original request object. - */ - request: Request; - /** - * Info about the current route. - */ - route: { - /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. - */ - id: RouteId; - }; - /** - * If you need to set headers for the response, you can do so using the this method. This is useful if you want the page to be cached, for example: - * - * ```js - * /// file: src/routes/blog/+page.js - * export async function load({ fetch, setHeaders }) { - * const url = `https://cms.example.com/articles.json`; - * const response = await fetch(url); - * - * setHeaders({ - * age: response.headers.get('age'), - * 'cache-control': response.headers.get('cache-control') - * }); - * - * return response.json(); - * } - * ``` - * - * Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once. - * - * You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API instead. - */ - setHeaders: (headers: Record) => void; - /** - * The requested URL. - */ - url: URL; - /** - * `true` if the request comes from the client asking for `+page/layout.server.js` data. The `url` property will be stripped of the internal information - * related to the data request in this case. Use this property instead if the distinction is important to you. - */ - isDataRequest: boolean; - /** - * `true` for `+server.js` calls coming from SvelteKit without the overhead of actually making an HTTP request. This happens when you make same-origin `fetch` requests on the server. - */ - isSubRequest: boolean; - - /** - * Access to spans for tracing. If tracing is not enabled, these spans will do nothing. - * @since 2.31.0 - */ - tracing: { - /** Whether tracing is enabled. */ - enabled: boolean; - /** The root span for the request. This span is named `sveltekit.handle.root`. */ - root: Span; - /** The span associated with the current `handle` hook, `load` function, or form action. */ - current: Span; - }; - - /** - * `true` if the request comes from the client via a remote function. The `url` property will be stripped of the internal information - * related to the data request in this case. Use this property instead if the distinction is important to you. - */ - isRemoteRequest: boolean; -} - -/** - * A `(event: RequestEvent) => Response` function exported from a `+server.js` file that corresponds to an HTTP verb (`GET`, `PUT`, `PATCH`, etc) and handles requests with that method. - * - * It receives `Params` as the first generic argument, which you can skip by using [generated types](https://svelte.dev/docs/kit/types#Generated-types) instead. - */ -export type RequestHandler< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null -> = (event: RequestEvent) => MaybePromise; - -export interface ResolveOptions { - /** - * Applies custom transforms to HTML. If `done` is true, it's the final chunk. Chunks are not guaranteed to be well-formed HTML - * (they could include an element's opening tag but not its closing tag, for example) - * but they will always be split at sensible boundaries such as `%sveltekit.head%` or layout/page components. - * @param input the html chunk and the info if this is the last chunk - */ - transformPageChunk?: (input: { html: string; done: boolean }) => MaybePromise; - /** - * Determines which headers should be included in serialized responses when a `load` function loads a resource with `fetch`. - * By default, none will be included. - * @param name header name - * @param value header value - */ - filterSerializedResponseHeaders?: (name: string, value: string) => boolean; - /** - * Determines what should be added to the `` tag to preload it. - * By default, `js` and `css` files will be preloaded. - * @param input the type of the file and its path - */ - preload?: (input: { type: 'font' | 'css' | 'js' | 'asset'; path: string }) => boolean; -} - -export interface RouteDefinition { - id: string; - api: { - methods: Array; - }; - page: { - methods: Array>; - }; - pattern: RegExp; - prerender: PrerenderOption; - segments: RouteSegment[]; - methods: Array; - config: Config; -} - -export class Server { - constructor(manifest: SSRManifest); - init(options: ServerInitOptions): Promise; - respond(request: Request, options: RequestOptions): Promise; -} - -export interface ServerInitOptions { - /** A map of environment variables. */ - env: Record; - /** A function that turns an asset filename into a `ReadableStream`. Required for the `read` export from `$app/server` to work. */ - read?: (file: string) => MaybePromise; -} - -export interface SSRManifest { - appDir: string; - appPath: string; - /** Static files from `kit.config.files.assets` and the service worker (if any). */ - assets: Set; - mimeTypes: Record; - - /** private fields */ - _: { - client: NonNullable; - nodes: SSRNodeLoader[]; - /** hashed filename -> import to that file */ - remotes: Record Promise>; - routes: SSRRoute[]; - prerendered_routes: Set; - matchers: () => Promise>; - /** A `[file]: size` map of all assets imported by server code. */ - server_assets: Record; - }; -} - -/** - * The generic form of `PageServerLoad` and `LayoutServerLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types)) - * rather than using `ServerLoad` directly. - */ -export type ServerLoad< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - ParentData extends Record = Record, - OutputData extends Record | void = Record | void, - RouteId extends AppRouteId | null = AppRouteId | null -> = (event: ServerLoadEvent) => MaybePromise; - -export interface ServerLoadEvent< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - ParentData extends Record = Record, - RouteId extends AppRouteId | null = AppRouteId | null -> extends RequestEvent { - /** - * `await parent()` returns data from parent `+layout.server.js` `load` functions. - * - * Be careful not to introduce accidental waterfalls when using `await parent()`. If for example you only want to merge parent data into the returned output, call it _after_ fetching your other data. - */ - parent: () => Promise; - /** - * This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun. - * - * Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`. - * - * URLs can be absolute or relative to the page being loaded, and must be [encoded](https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding). - * - * Custom identifiers have to be prefixed with one or more lowercase letters followed by a colon to conform to the [URI specification](https://www.rfc-editor.org/rfc/rfc3986.html). - * - * The following example shows how to use `depends` to register a dependency on a custom identifier, which is `invalidate`d after a button click, making the `load` function rerun. - * - * ```js - * /// file: src/routes/+page.js - * let count = 0; - * export async function load({ depends }) { - * depends('increase:count'); - * - * return { count: count++ }; - * } - * ``` - * - * ```html - * /// file: src/routes/+page.svelte - * - * - *

{data.count}

- * - * ``` - */ - depends: (...deps: string[]) => void; - /** - * Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example: - * - * ```js - * /// file: src/routes/+page.js - * export async function load({ untrack, url }) { - * // Untrack url.pathname so that path changes don't trigger a rerun - * if (untrack(() => url.pathname === '/')) { - * return { message: 'Welcome!' }; - * } - * } - * ``` - */ - untrack: (fn: () => T) => T; - - /** - * Access to spans for tracing. If tracing is not enabled, these spans will do nothing. - * @since 2.31.0 - */ - tracing: { - /** Whether tracing is enabled. */ - enabled: boolean; - /** The root span for the request. This span is named `sveltekit.handle.root`. */ - root: Span; - /** The span associated with the current server `load` function. */ - current: Span; - }; -} - -/** - * Shape of a form action method that is part of `export const actions = {...}` in `+page.server.js`. - * See [form actions](https://svelte.dev/docs/kit/form-actions) for more information. - */ -export type Action< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - OutputData extends Record | void = Record | void, - RouteId extends AppRouteId | null = AppRouteId | null -> = (event: RequestEvent) => MaybePromise; - -/** - * Shape of the `export const actions = {...}` object in `+page.server.js`. - * See [form actions](https://svelte.dev/docs/kit/form-actions) for more information. - */ -export type Actions< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - OutputData extends Record | void = Record | void, - RouteId extends AppRouteId | null = AppRouteId | null -> = Record>; - -/** - * When calling a form action via fetch, the response will be one of these shapes. - * ```svelte - * { - * return ({ result }) => { - * // result is of type ActionResult - * }; - * }} - * ``` - */ -export type ActionResult< - Success extends Record | undefined = Record, - Failure extends Record | undefined = Record -> = - | { type: 'success'; status: number; data?: Success } - | { type: 'failure'; status: number; data?: Failure } - | { type: 'redirect'; status: number; location: string } - | { type: 'error'; status?: number; error: any }; - -/** - * The object returned by the [`error`](https://svelte.dev/docs/kit/@sveltejs-kit#error) function. - */ -export interface HttpError { - /** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses), in the range 400-599. */ - status: number; - /** The content of the error. */ - body: App.Error; -} - -/** - * The object returned by the [`redirect`](https://svelte.dev/docs/kit/@sveltejs-kit#redirect) function. - */ -export interface Redirect { - /** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages), in the range 300-308. */ - status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308; - /** The location to redirect to. */ - location: string; -} - -export type SubmitFunction< - Success extends Record | undefined = Record, - Failure extends Record | undefined = Record -> = (input: { - action: URL; - formData: FormData; - formElement: HTMLFormElement; - controller: AbortController; - submitter: HTMLElement | null; - cancel: () => void; -}) => MaybePromise< - | void - | ((opts: { - formData: FormData; - formElement: HTMLFormElement; - action: URL; - result: ActionResult; - /** - * Call this to get the default behavior of a form submission response. - * @param options Set `reset: false` if you don't want the `` values to be reset after a successful submission. - * @param invalidateAll Set `invalidateAll: false` if you don't want the action to call `invalidateAll` after submission. - */ - update: (options?: { reset?: boolean; invalidateAll?: boolean }) => Promise; - }) => MaybePromise) ->; - -/** - * The type of `export const snapshot` exported from a page or layout component. - */ -export interface Snapshot { - capture: () => T; - restore: (snapshot: T) => void; -} - -// If T is unknown or has an index signature, the types below will recurse indefinitely and create giant unions that TS can't handle -type WillRecurseIndefinitely = unknown extends T ? true : string extends keyof T ? true : false; - -// Input type mappings for form fields -type InputTypeMap = { - text: string; - email: string; - password: string; - url: string; - tel: string; - search: string; - number: number; - range: number; - date: string; - 'datetime-local': string; - time: string; - month: string; - week: string; - color: string; - checkbox: boolean | string[]; - radio: string; - file: File; - hidden: string; - submit: string; - button: string; - reset: string; - image: string; - select: string; - 'select multiple': string[]; - 'file multiple': File[]; -}; - -// Valid input types for a given value type -export type RemoteFormFieldType = { - [K in keyof InputTypeMap]: T extends InputTypeMap[K] ? K : never; -}[keyof InputTypeMap]; - -// Input element properties based on type -type InputElementProps = T extends 'checkbox' | 'radio' - ? { - name: string; - type: T; - value?: string; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get checked(): boolean; - set checked(value: boolean); - } - : T extends 'file' - ? { - name: string; - type: 'file'; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get files(): FileList | null; - set files(v: FileList | null); - } - : T extends 'select' - ? { - name: string; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get value(): string; - set value(v: string); - } - : T extends 'select multiple' - ? { - name: string; - multiple: true; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get value(): string[]; - set value(v: string[]); - } - : T extends 'text' - ? { - name: string; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get value(): string | number; - set value(v: string | number); - } - : { - name: string; - type: T; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get value(): string | number; - set value(v: string | number); - }; - -type RemoteFormFieldMethods = { - /** The values that will be submitted */ - value(): DeepPartial; - /** Set the values that will be submitted */ - set(input: DeepPartial): DeepPartial; - /** Validation issues, if any */ - issues(): RemoteFormIssue[] | undefined; -}; - -// These two types use "T extends unknown ? .. : .." to distribute over unions. -// Example: if "type T = A | b" then "keyof T" only contains keys that both A and B have, with "KeysOfUnion" we get the keys of both A and B -type KeysOfUnion = T extends unknown ? keyof T : never; -type ValueOfUnionKey = T extends unknown - ? K extends keyof T - ? T[K] - : never - : never; - -export type RemoteFormFieldValue = string | string[] | number | boolean | File | File[]; - -type AsArgs = Type extends 'checkbox' - ? Value extends string[] - ? [type: Type, value: Value[number] | (string & {})] - : [type: Type] | [type: Type, value: Value | (string & {})] - : Type extends 'radio' | 'submit' | 'hidden' - ? [type: Type, value: Value | (string & {})] - : Type extends 'file' | 'file multiple' - ? [type: Type] - : [type: Type] | [type: Type, value: Value | (string & {})]; - -/** - * Form field accessor type that provides name(), value(), and issues() methods - */ -export type RemoteFormField = RemoteFormFieldMethods & { - /** - * Returns an object that can be spread onto an input element with the correct type attribute, - * aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters. - * @example - * ```svelte - * - * - * - * ``` - */ - as>(...args: AsArgs): InputElementProps; -}; - -type RemoteFormFieldContainer = RemoteFormFieldMethods & { - /** Validation issues belonging to this or any of the fields that belong to it, if any */ - allIssues(): RemoteFormIssue[] | undefined; -}; - -type UnknownField = RemoteFormFieldMethods & { - /** Validation issues belonging to this or any of the fields that belong to it, if any */ - allIssues(): RemoteFormIssue[] | undefined; - /** - * Returns an object that can be spread onto an input element with the correct type attribute, - * aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters. - * @example - * ```svelte - * - * - * - * ``` - */ - as>(...args: AsArgs): InputElementProps; -} & { - [key: string | number]: UnknownField; -}; - -type RemoteFormFieldsRoot = - IsAny extends true - ? RecursiveFormFields - : Input extends void - ? { - /** Validation issues, if any */ - issues(): RemoteFormIssue[] | undefined; - /** Validation issues belonging to this or any of the fields that belong to it, if any */ - allIssues(): RemoteFormIssue[] | undefined; - } - : RemoteFormFields; - -/** - * Recursive type to build form fields structure with proxy access - */ -export type RemoteFormFields = - WillRecurseIndefinitely extends true - ? RecursiveFormFields - : NonNullable extends string | number | boolean | File - ? RemoteFormField> - : // [NonNullable] is used to prevent distributing over union while still allowing - // nullable wrappers (e.g. `string[] | undefined` from a schema with `.default([])`) - // to be treated as arrays; only the last condition should distribute over unions - [NonNullable] extends [string[] | File[]] - ? RemoteFormField> & { - [K in number]: RemoteFormField[number]>; - } - : [NonNullable] extends [Array] - ? RemoteFormFieldContainer> & { - [K in number]: RemoteFormFields; - } - : RemoteFormFieldContainer & { - [K in KeysOfUnion]-?: RemoteFormFields>; - }; - -// By breaking this out into its own type, we avoid the TS recursion depth limit -type RecursiveFormFields = RemoteFormFieldContainer & { - [key: string | number]: UnknownField; -}; - -type MaybeArray = T | T[]; - -export interface RemoteFormInput { - [key: string]: MaybeArray; -} - -export interface RemoteFormIssue { - message: string; - path: Array; -} - -// If the schema specifies `id` as a string or number, ensure that `for(...)` -// only accepts that type. Otherwise, accept `string | number` -type ExtractId = Input extends { id: infer Id } - ? Id extends string | number - ? Id - : string | number - : string | number; - -/** - * A function and proxy object used to imperatively create validation errors in form handlers. - * - * Access properties to create field-specific issues: `issue.fieldName('message')`. - * The type structure mirrors the input data structure for type-safe field access. - * Call `invalid(issue.foo(...), issue.nested.bar(...))` to throw a validation error. - */ -export type InvalidField = - WillRecurseIndefinitely extends true - ? Record - : NonNullable extends string | number | boolean | File - ? (message: string) => StandardSchemaV1.Issue - : NonNullable extends Array - ? { - [K in number]: InvalidField; - } & ((message: string) => StandardSchemaV1.Issue) - : NonNullable extends RemoteFormInput - ? { - [K in keyof T]-?: InvalidField; - } & ((message: string) => StandardSchemaV1.Issue) - : Record; - -/** - * A validation error thrown by `invalid`. - */ -export interface ValidationError { - /** The validation issues */ - issues: StandardSchemaV1.Issue[]; -} - -/** - * The return value of a remote `form` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. - */ -export type RemoteForm = { - /** Attachment that sets up an event handler that intercepts the form submission on the client to prevent a full page reload */ - [attachment: symbol]: (node: HTMLFormElement) => void; - method: 'POST'; - /** The URL to send the form to. */ - action: string; - /** Use the `enhance` method to influence what happens when the form is submitted. */ - enhance( - callback: (opts: { - form: HTMLFormElement; - data: Input; - submit: () => Promise & { - updates: (...updates: RemoteQueryUpdate[]) => Promise; - }; - }) => MaybePromise - ): { - method: 'POST'; - action: string; - [attachment: symbol]: (node: HTMLFormElement) => void; - }; - /** - * Create an instance of the form for the given `id`. - * The `id` is stringified and used for deduplication to potentially reuse existing instances. - * Useful when you have multiple forms that use the same remote form action, for example in a loop. - * ```svelte - * {#each todos as todo} - * {@const todoForm = updateTodo.for(todo.id)} - * - * {#if todoForm.result?.invalid}

Invalid data

{/if} - * ... - * - * {/each} - * ``` - */ - for(id: ExtractId): Omit, 'for'>; - /** Preflight checks */ - preflight(schema: StandardSchemaV1): RemoteForm; - /** Validate the form contents programmatically */ - validate(options?: { - /** Set this to `true` to also show validation issues of fields that haven't been touched yet. */ - includeUntouched?: boolean; - /** Set this to `true` to only run the `preflight` validation. */ - preflightOnly?: boolean; - }): Promise; - /** The result of the form submission */ - get result(): Output | undefined; - /** The number of pending submissions */ - get pending(): number; - /** Access form fields using object notation */ - fields: RemoteFormFieldsRoot; -}; - -/** - * The return value of a remote `command` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. - */ -export type RemoteCommand = { - (arg: undefined extends Input ? Input | void : Input): Promise & { - updates(...updates: RemoteQueryUpdate[]): Promise; - }; - /** The number of pending command executions */ - get pending(): number; -}; - -export type RemoteQueryUpdate = - | RemoteQuery - | RemoteQueryFunction - | RemoteQueryOverride; - -export type RemoteResource = Promise & { - /** The error in case the query fails. Most often this is a [`HttpError`](https://svelte.dev/docs/kit/@sveltejs-kit#HttpError) but it isn't guaranteed to be. */ - get error(): any; - /** `true` before the first result is available and during refreshes */ - get loading(): boolean; -} & ( - | { - /** The current value of the query. Undefined until `ready` is `true` */ - get current(): undefined; - ready: false; - } - | { - /** The current value of the query. Undefined until `ready` is `true` */ - get current(): T; - ready: true; - } - ); - -export type RemoteQuery = RemoteResource & { - /** - * Returns a plain promise with the result. - * Unlike awaiting the resource directly, this can only be used _outside_ render - * (i.e. in load functions, event handlers and so on) - */ - run(): Promise; - /** - * On the client, this function will update the value of the query without re-fetching it. - * - * On the server, this can be called in the context of a `command` or `form` and the specified data will accompany the action response back to the client. - * This prevents SvelteKit needing to refresh all queries on the page in a second server round-trip. - */ - set(value: T): void; - /** - * On the client, this function will re-fetch the query from the server. - * - * On the server, this can be called in the context of a `command` or `form` and the refreshed data will accompany the action response back to the client. - * This prevents SvelteKit needing to refresh all queries on the page in a second server round-trip. - */ - refresh(): Promise; - /** - * Temporarily override a query's value during a [single-flight mutation](https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations) to provide optimistic updates. - * - * ```svelte - * - * - *
{ - * await submit().updates( - * todos.withOverride((todos) => [...todos, { text: data.get('text') }]) - * ); - * })}> - * - * - *
- * ``` - */ - withOverride(update: (current: T) => T): RemoteQueryOverride; -}; - -export type RemoteQueryOverride = () => void; - -/** - * The return value of a remote `prerender` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. - */ -export type RemotePrerenderFunction = ( - arg: undefined extends Input ? Input | void : Input -) => RemoteResource; - -/** - * The return value of a remote `query` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. - * - * The optional `Validated` generic parameter represents the argument type *after* the - * query's schema has validated and (optionally) transformed it — this is the type the - * query's implementation function receives on the server, and the type yielded by - * [`requested`](https://svelte.dev/docs/kit/$app-server#requested). For queries declared - * with [Standard Schema](https://standardschema.dev/) it differs from `Input` when the - * schema contains a transform (e.g. `v.pipe(v.number(), v.transform(String))` has - * `Input = number` but `Validated = string`). For `'unchecked'` validators and queries - * without arguments it defaults to `Input`. - */ -export type RemoteQueryFunction = ( - arg: undefined extends Input ? Input | void : Input -) => RemoteQuery; - -export * from './index.js'; diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js deleted file mode 100644 index a960a20..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js +++ /dev/null @@ -1,260 +0,0 @@ -import fs from 'node:fs'; -import { mkdirp } from '../../../utils/filesystem.js'; -import { - create_function_as_string, - filter_fonts, - find_deps, - generate_placeholder, - resolve_symlinks -} from './utils.js'; -import { s } from '../../../utils/misc.js'; -import { normalizePath } from 'vite'; -import { basename } from 'node:path'; -import { fix_css_urls } from '../../../utils/css.js'; -import { escape_for_interpolation } from '../../../utils/escape.js'; - -/** - * @param {string} out - * @param {import('types').ValidatedKitConfig} kit - * @param {import('types').ManifestData} manifest_data - * @param {import('vite').Manifest} server_manifest - * @param {import('vite').Manifest | null} client_manifest - * @param {string | null} assets_path - * @param {import('vite').Rollup.RollupOutput['output'] | null} client_chunks - * @param {import('types').RecursiveRequired} output_config - */ -export function build_server_nodes( - out, - kit, - manifest_data, - server_manifest, - client_manifest, - assets_path, - client_chunks, - output_config -) { - mkdirp(`${out}/server/nodes`); - mkdirp(`${out}/server/stylesheets`); - - /** - * Stylesheet names and their contents which are below the inline threshold - * @type {Map} - */ - const stylesheets_to_inline = new Map(); - - /** - * For CSS inlining, we either store a string or a function that returns the - * styles with the correct relative URLs - * @type {(css: string, eager_assets: Set) => string} - */ - let prepare_css_for_inlining = (css) => s(css); - - if (client_chunks && kit.inlineStyleThreshold > 0 && output_config.bundleStrategy === 'split') { - for (const chunk of client_chunks) { - if (chunk.type !== 'asset' || !chunk.fileName.endsWith('.css')) { - continue; - } - - const source = chunk.source.toString(); - if (source.length < kit.inlineStyleThreshold) { - stylesheets_to_inline.set(chunk.fileName, source); - } - } - - // If the client CSS has URL references to assets, we need to adjust the - // relative path so that they are correct when inlined into the document. - // Although `paths.assets` is static, we need to pass in a fake path - // `/_svelte_kit_assets` at runtime when running `vite preview` - if (kit.paths.assets || kit.paths.relative) { - const static_assets = new Set( - manifest_data.assets.map((asset) => decodeURIComponent(asset.file)) - ); - - const segments = /** @type {string} */ (assets_path).split('/'); - const static_asset_prefix = segments.map(() => '..').join('/') + '/'; - - prepare_css_for_inlining = (css, eager_assets) => { - const assets_placeholder = generate_placeholder(css, 'ASSETS'); - const base_placeholder = generate_placeholder(css, 'BASE'); - - const transformed_css = fix_css_urls({ - css, - vite_assets: eager_assets, - static_assets, - paths_assets: assets_placeholder, - base: base_placeholder, - static_asset_prefix - }); - - // only convert to a function if we have adjusted any URLs - if (css !== transformed_css) { - const escaped = escape_for_interpolation(transformed_css, [ - { - placeholder: assets_placeholder, - replacement: '${assets}' - }, - { - placeholder: base_placeholder, - replacement: '${base}' - } - ]); - return create_function_as_string('css', ['assets', 'base'], escaped); - } - - return s(css); - }; - } - } - - for (let i = 0; i < manifest_data.nodes.length; i++) { - const node = manifest_data.nodes[i]; - - /** @type {string[]} */ - const imports = []; - - // String representation of - /** @type {import('types').SSRNode} */ - /** @type {string[]} */ - const exports = [`export const index = ${i};`]; - - /** @type {string[]} */ - let imported = []; - - /** @type {string[]} */ - let stylesheets = []; - - /** @type {string[]} */ - let fonts = []; - - /** @type {Set} */ - const eager_assets = new Set(); - - if (node.component && client_manifest) { - exports.push( - 'let component_cache;', - `export const component = async () => component_cache ??= (await import('../${ - resolve_symlinks(server_manifest, node.component).chunk.file - }')).default;` - ); - } - - if (node.universal) { - if (!!node.page_options && node.page_options.ssr === false) { - exports.push(`export const universal = ${s(node.page_options, null, 2)};`); - } else { - imports.push( - `import * as universal from '../${resolve_symlinks(server_manifest, node.universal).chunk.file}';` - ); - // TODO: when building for analysis, explain why the file was loaded on the server if we fail to load it - exports.push('export { universal };'); - } - exports.push(`export const universal_id = ${s(node.universal)};`); - } - - if (node.server) { - imports.push( - `import * as server from '../${resolve_symlinks(server_manifest, node.server).chunk.file}';` - ); - exports.push('export { server };'); - exports.push(`export const server_id = ${s(node.server)};`); - } - - if ( - client_manifest && - (node.universal || node.component) && - output_config.bundleStrategy === 'split' - ) { - const entry_path = `${normalizePath(kit.outDir)}/generated/client-optimized/nodes/${i}.js`; - const entry = find_deps(client_manifest, entry_path, true); - - // Eagerly load client stylesheets and fonts imported by the SSR-ed page to avoid FOUC. - // However, if it is not used during SSR (not present in the server manifest), - // then it can be lazily loaded in the browser. - - /** @type {import('types').AssetDependencies | undefined} */ - let component; - if (node.component) { - component = find_deps(server_manifest, node.component, true); - } - - /** @type {import('types').AssetDependencies | undefined} */ - let universal; - if (node.universal) { - universal = find_deps(server_manifest, node.universal, true); - } - - /** @type {Set} */ - const eager_css = new Set(); - - entry.stylesheet_map.forEach((value, filepath) => { - // pages and layouts are renamed to node indexes when optimised for the client - // so we use the original filename instead to check against the server manifest - if (filepath === entry_path) { - filepath = node.component ?? filepath; - } - - if (component?.stylesheet_map.has(filepath) || universal?.stylesheet_map.has(filepath)) { - value.css.forEach((file) => eager_css.add(file)); - value.assets.forEach((file) => eager_assets.add(file)); - } - }); - - imported = entry.imports; - stylesheets = Array.from(eager_css); - fonts = filter_fonts(Array.from(eager_assets)); - } - - exports.push( - `export const imports = ${s(imported)};`, - `export const stylesheets = ${s(stylesheets)};`, - `export const fonts = ${s(fonts)};` - ); - - /** - * Assets that have been processed by Vite (decoded and with the asset path stripped) - * @type {Set} - */ - let vite_assets = new Set(); - - // Keep track of Vite asset filenames so that we avoid touching unrelated ones - // when adjusting the inlined CSS - if (stylesheets_to_inline.size && assets_path && eager_assets.size) { - vite_assets = new Set( - Array.from(eager_assets).map((asset) => { - return decodeURIComponent(asset.replace(`${assets_path}/`, '')); - }) - ); - } - - if (stylesheets_to_inline.size) { - /** @type {string[]} */ - const inline_styles = []; - - stylesheets.forEach((file, i) => { - if (stylesheets_to_inline.has(file)) { - const filename = basename(file); - const dest = `${out}/server/stylesheets/${filename}.js`; - - const css = /** @type {string} */ (stylesheets_to_inline.get(file)); - - fs.writeFileSync( - dest, - `// ${filename}\nexport default ${prepare_css_for_inlining(css, vite_assets)};` - ); - const name = `stylesheet_${i}`; - imports.push(`import ${name} from '../stylesheets/${filename}.js';`); - inline_styles.push(`\t${s(file)}: ${name}`); - } - }); - - if (inline_styles.length > 0) { - exports.push(`export const inline_styles = () => ({\n${inline_styles.join(',\n')}\n});`); - } - } - - fs.writeFileSync( - `${out}/server/nodes/${i}.js`, - `${imports.join('\n')}\n\n${exports.join('\n')}\n` - ); - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/build_service_worker.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/build_service_worker.js deleted file mode 100644 index 4141211..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/build_service_worker.js +++ /dev/null @@ -1,149 +0,0 @@ -import fs from 'node:fs'; -import process from 'node:process'; -import * as vite from 'vite'; -import { dedent } from '../../../core/sync/utils.js'; -import { s } from '../../../utils/misc.js'; -import { get_config_aliases, strip_virtual_prefix, get_env, normalize_id } from '../utils.js'; -import { create_static_module } from '../../../core/env.js'; -import { env_static_public, service_worker } from '../module_ids.js'; - -// @ts-ignore `vite.rolldownVersion` only exists in `rolldown-vite` -const is_rolldown = !!vite.rolldownVersion; - -/** - * @param {string} out - * @param {import('types').ValidatedKitConfig} kit - * @param {import('vite').ResolvedConfig} vite_config - * @param {import('types').ManifestData} manifest_data - * @param {string} service_worker_entry_file - * @param {import('types').Prerendered} prerendered - * @param {import('vite').Manifest} client_manifest - */ -export async function build_service_worker( - out, - kit, - vite_config, - manifest_data, - service_worker_entry_file, - prerendered, - client_manifest -) { - const build = new Set(); - for (const key in client_manifest) { - const { file, css = [], assets = [] } = client_manifest[key]; - build.add(file); - css.forEach((file) => build.add(file)); - assets.forEach((file) => build.add(file)); - } - - // in a service worker, `location` is the location of the service worker itself, - // which is guaranteed to be `/service-worker.js` - const base = "location.pathname.split('/').slice(0, -1).join('/')"; - - const service_worker_code = dedent` - export const base = /*@__PURE__*/ ${base}; - - export const build = [ - ${Array.from(build) - .map((file) => `base + ${s(`/${file}`)}`) - .join(',\n')} - ]; - - export const files = [ - ${manifest_data.assets - .filter((asset) => kit.serviceWorker.files(asset.file)) - .map((asset) => `base + ${s(`/${asset.file}`)}`) - .join(',\n')} - ]; - - export const prerendered = [ - ${prerendered.paths.map((path) => `base + ${s(path.replace(kit.paths.base, ''))}`).join(',\n')} - ]; - - export const version = ${s(kit.version.name)}; - `; - - const env = get_env(kit.env, vite_config.mode); - - /** - * @type {import('vite').Plugin} - */ - const sw_virtual_modules = { - name: 'service-worker-build-virtual-modules', - resolveId(id) { - if (id.startsWith('$env/') || id.startsWith('$app/') || id === '$service-worker') { - // ids with :$ don't work with reverse proxies like nginx - return `\0virtual:${id.substring(1)}`; - } - }, - - load(id) { - if (!id.startsWith('\0virtual:')) return; - - if (id === service_worker) { - return service_worker_code; - } - - if (id === env_static_public) { - return create_static_module('$env/static/public', env.public); - } - - const normalized_cwd = vite.normalizePath(process.cwd()); - const normalized_lib = vite.normalizePath(kit.files.lib); - const relative = normalize_id(id, normalized_lib, normalized_cwd); - const stripped = strip_virtual_prefix(relative); - throw new Error( - `Cannot import ${stripped} into service-worker code. Only the modules $service-worker and $env/static/public are available in service workers.` - ); - } - }; - - /** @type {import('vite').InlineConfig} */ - const config = { - build: { - modulePreload: false, - rollupOptions: { - input: { - 'service-worker': service_worker_entry_file - }, - output: { - // .mjs so that esbuild doesn't incorrectly inject `export` https://github.com/vitejs/vite/issues/15379 - entryFileNames: `service-worker.${is_rolldown ? 'js' : 'mjs'}`, - assetFileNames: `${kit.appDir}/immutable/assets/[name].[hash][extname]`, - inlineDynamicImports: !is_rolldown ? true : undefined - } - }, - outDir: `${out}/client`, - emptyOutDir: false, - minify: vite_config.build.minify - }, - configFile: false, - define: vite_config.define, - publicDir: false, - plugins: [sw_virtual_modules], - resolve: { - alias: [...get_config_aliases(kit)] - }, - experimental: { - renderBuiltUrl(filename) { - return { - runtime: `new URL(${JSON.stringify(filename)}, location.href).pathname` - }; - } - } - }; - - // we must reference Vite 8 options conditionally. Otherwise, older Vite - // versions throw an error about unknown config options - if (is_rolldown && config?.build?.rollupOptions?.output) { - // @ts-ignore only available in Vite 8 - config.build.rollupOptions.output.codeSplitting = true; - } - - await vite.build(config); - - // rename .mjs to .js to avoid incorrect MIME types with ancient webservers - if (!is_rolldown) { - fs.renameSync(`${out}/client/service-worker.mjs`, `${out}/client/service-worker.js`); - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/remote.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/remote.js deleted file mode 100644 index 4e9d60a..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/remote.js +++ /dev/null @@ -1,126 +0,0 @@ -/** @import { ServerMetadata } from 'types' */ -/** @import { Rollup } from 'vite' */ - -import fs from 'node:fs'; -import path from 'node:path'; -import { Parser } from 'acorn'; -import MagicString from 'magic-string'; -import { posixify } from '../../../utils/filesystem.js'; -import { import_peer } from '../../../utils/import.js'; - -/** - * @param {string} out - * @param {Array<{ hash: string, file: string }>} remotes - * @param {ServerMetadata} metadata - * @param {string} cwd - * @param {Rollup.OutputBundle} server_bundle - * @param {NonNullable['sourcemap']} sourcemap - */ -export async function treeshake_prerendered_remotes( - out, - remotes, - metadata, - cwd, - server_bundle, - sourcemap -) { - if (remotes.length === 0) return; - - const vite = /** @type {typeof import('vite')} */ (await import_peer('vite')); - - for (const remote of remotes) { - const exports_map = metadata.remotes.get(remote.hash); - if (!exports_map) continue; - - /** @type {string[]} */ - const dynamic = []; - /** @type {string[]} */ - const prerendered = []; - - for (const [name, value] of exports_map) { - (value.dynamic ? dynamic : prerendered).push(name); - } - - if (prerendered.length === 0) continue; // nothing to treeshake - - // remove file extension - const remote_filename = path.basename(remote.file).split('.').slice(0, -1).join('.'); - - const remote_chunk = Object.values(server_bundle).find((chunk) => { - return chunk.name === remote_filename; - }); - - if (!remote_chunk) continue; - - const chunk_path = posixify(path.relative(cwd, `${out}/server/${remote_chunk.fileName}`)); - - const code = fs.readFileSync(chunk_path, 'utf-8'); - const parsed = Parser.parse(code, { sourceType: 'module', ecmaVersion: 'latest' }); - const modified_code = new MagicString(code); - - for (const fn of prerendered) { - for (const node of parsed.body) { - const declaration = - node.type === 'ExportNamedDeclaration' - ? node.declaration - : node.type === 'VariableDeclaration' - ? node - : null; - - if (!declaration || declaration.type !== 'VariableDeclaration') continue; - - for (const declarator of declaration.declarations) { - if (declarator.id.type === 'Identifier' && declarator.id.name === fn) { - modified_code.overwrite( - node.start, - node.end, - `const ${fn} = prerender('unchecked', () => { throw new Error('Unexpectedly called prerender function. Did you forget to set { dynamic: true } ?') });` - ); - } - } - } - } - - for (const node of parsed.body) { - if (node.type === 'ExportDefaultDeclaration') { - modified_code.remove(node.start, node.end); - } - } - - const stubbed = modified_code.toString(); - fs.writeFileSync(chunk_path, stubbed); - - const bundle = /** @type {import('vite').Rollup.RollupOutput} */ ( - await vite.build({ - configFile: false, - build: { - write: false, - ssr: true, - target: 'esnext', - sourcemap, - rollupOptions: { - // avoid resolving imports - external: (id) => !id.endsWith(chunk_path), - input: { - treeshaken: chunk_path - } - } - } - }) - ); - - const chunk = bundle.output.find( - (output) => output.type === 'chunk' && output.name === 'treeshaken' - ); - if (chunk && chunk.type === 'chunk') { - fs.writeFileSync(chunk_path, chunk.code); - - const chunk_sourcemap = bundle.output.find( - (output) => output.type === 'asset' && output.fileName === chunk.fileName + '.map' - ); - if (chunk_sourcemap && chunk_sourcemap.type === 'asset') { - fs.writeFileSync(chunk_path + '.map', chunk_sourcemap.source); - } - } - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js deleted file mode 100644 index 3038412..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js +++ /dev/null @@ -1,162 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import { normalizePath } from 'vite'; - -/** - * Adds transitive JS and CSS dependencies to the js and css inputs. - * @param {import('vite').Manifest} manifest - * @param {string} entry - * @param {boolean} add_dynamic_css - * @returns {import('types').AssetDependencies} - */ -export function find_deps(manifest, entry, add_dynamic_css) { - /** @type {Set} */ - const seen = new Set(); - - /** @type {Set} */ - const imports = new Set(); - - /** @type {Set} */ - const stylesheets = new Set(); - - /** @type {Set} */ - const imported_assets = new Set(); - - /** @type {Map; assets: Set }>} */ - const stylesheet_map = new Map(); - - /** - * @param {string} current - * @param {boolean} add_js - * @param {string} initial_importer - * @param {number} dynamic_import_depth - */ - function traverse(current, add_js, initial_importer, dynamic_import_depth) { - if (seen.has(current)) return; - seen.add(current); - - const { chunk } = resolve_symlinks(manifest, current); - - if (add_js) imports.add(chunk.file); - - if (chunk.assets) { - chunk.assets.forEach((asset) => imported_assets.add(asset)); - } - - if (chunk.css) { - chunk.css.forEach((file) => stylesheets.add(file)); - } - - if (chunk.imports) { - chunk.imports.forEach((file) => - traverse(file, add_js, initial_importer, dynamic_import_depth) - ); - } - - if (!add_dynamic_css) return; - - if ((chunk.css || chunk.assets) && dynamic_import_depth <= 1) { - // group files based on the initial importer because if a file is only ever - // a transitive dependency, it doesn't have a suitable name we can map back to - // the server manifest - if (stylesheet_map.has(initial_importer)) { - const { css, assets } = /** @type {{ css: Set; assets: Set }} */ ( - stylesheet_map.get(initial_importer) - ); - if (chunk.css) chunk.css.forEach((file) => css.add(file)); - if (chunk.assets) chunk.assets.forEach((file) => assets.add(file)); - } else { - stylesheet_map.set(initial_importer, { - css: new Set(chunk.css), - assets: new Set(chunk.assets) - }); - } - } - - if (chunk.dynamicImports) { - dynamic_import_depth++; - chunk.dynamicImports.forEach((file) => { - traverse(file, false, file, dynamic_import_depth); - }); - } - } - - const { chunk, file } = resolve_symlinks(manifest, entry); - - traverse(file, true, entry, 0); - - const assets = Array.from(imported_assets); - - return { - assets, - file: chunk.file, - imports: Array.from(imports), - stylesheets: Array.from(stylesheets), - // TODO do we need this separately? - fonts: filter_fonts(assets), - stylesheet_map - }; -} - -/** - * @param {import('vite').Manifest} manifest - * @param {string} file - */ -export function resolve_symlinks(manifest, file) { - while (!manifest[file]) { - const next = normalizePath(path.relative('.', fs.realpathSync(file))); - if (next === file) throw new Error(`Could not find file "${file}" in Vite manifest`); - file = next; - } - - const chunk = manifest[file]; - - return { chunk, file }; -} - -/** - * @param {string[]} assets - * @returns {string[]} - */ -export function filter_fonts(assets) { - return assets.filter((asset) => /\.(woff2?|ttf|otf)$/.test(asset)); -} - -/** - * @param {import('types').ValidatedKitConfig} config - * @returns {string} - */ -export function assets_base(config) { - return (config.paths.assets || config.paths.base || '.') + '/'; -} - -/** - * Writes a function with arguments used by a template literal. - * This helps us store strings in a module and inject values at runtime. - * @param {string} name The name of the function - * @param {string[]} placeholder_names The names of the placeholders in the string - * @param {string} str A string with placeholders such as "Hello ${arg0}". - * It must have backslashes, backticks and dollar signs already escaped. - * @returns {string} The function written as a string - */ -export function create_function_as_string(name, placeholder_names, str) { - const args = placeholder_names ? placeholder_names.join(', ') : ''; - return `function ${name}(${args}) { return \`${str}\`; }`; -} - -/** - * Guarantees that the generated placeholder is not already present in the content. - * @param {string} content - * @param {string} key - * @returns {string} - */ -export function generate_placeholder(content, key) { - let id = 1; - let placeholder = `__SVELTEKIT_${key}_${id}__`; - - while (content.includes(placeholder)) { - placeholder = `__SVELTEKIT_${key}_${++id}__`; - } - - return placeholder; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js deleted file mode 100644 index ecada10..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js +++ /dev/null @@ -1,682 +0,0 @@ -/** @import { RequestEvent } from '@sveltejs/kit' */ -/** @import { PrerenderOption, UniversalNode } from 'types' */ -import fs from 'node:fs'; -import path from 'node:path'; -import process from 'node:process'; -import { URL } from 'node:url'; -import { AsyncLocalStorage } from 'node:async_hooks'; -import colors from 'kleur'; -import sirv from 'sirv'; -import { isCSSRequest, loadEnv, buildErrorMessage } from 'vite'; -import { createReadableStream, getRequest, setResponse } from '../../../exports/node/index.js'; -import { installPolyfills } from '../../../exports/node/polyfills.js'; -import { coalesce_to_error } from '../../../utils/error.js'; -import { from_fs, posixify, resolve_entry, to_fs } from '../../../utils/filesystem.js'; -import { load_error_page } from '../../../core/config/index.js'; -import { SVELTE_KIT_ASSETS } from '../../../constants.js'; -import * as sync from '../../../core/sync/sync.js'; -import { get_mime_lookup, runtime_base } from '../../../core/utils.js'; -import { compact } from '../../../utils/array.js'; -import { is_chrome_devtools_request, not_found } from '../utils.js'; -import { SCHEME } from '../../../utils/url.js'; -import { check_feature } from '../../../utils/features.js'; -import { escape_html } from '../../../utils/escape.js'; - -const cwd = process.cwd(); -// vite-specifc queries that we should skip handling for css urls -const vite_css_query_regex = /(?:\?|&)(?:raw|url|inline)(?:&|$)/; - -/** - * @param {import('vite').ViteDevServer} vite - * @param {import('vite').ResolvedConfig} vite_config - * @param {import('types').ValidatedConfig} svelte_config - * @param {() => Array<{ hash: string, file: string }>} get_remotes - * @return {Promise void>>} - */ -export async function dev(vite, vite_config, svelte_config, get_remotes) { - installPolyfills(); - - /** @type {AsyncLocalStorage<{ event: RequestEvent, config: any, prerender: PrerenderOption }>} */ - const async_local_storage = new AsyncLocalStorage(); - - globalThis.__SVELTEKIT_TRACK__ = (label) => { - const context = async_local_storage.getStore(); - if (!context || context.prerender === true) return; - - check_feature( - /** @type {string} */ (context.event.route.id), - context.config, - label, - svelte_config.kit.adapter - ); - }; - - const fetch = globalThis.fetch; - globalThis.fetch = (info, init) => { - if (typeof info === 'string' && !SCHEME.test(info)) { - throw new Error( - `Cannot use relative URL (${info}) with global fetch — use \`event.fetch\` instead: https://svelte.dev/docs/kit/web-standards#fetch-apis` - ); - } - - return fetch(info, init); - }; - - sync.init(svelte_config, vite_config.mode); - - /** @type {import('types').ManifestData} */ - let manifest_data; - /** @type {import('@sveltejs/kit').SSRManifest} */ - let manifest; - - /** @type {Error | null} */ - let manifest_error = null; - - /** @param {string} url */ - async function loud_ssr_load_module(url) { - try { - return await vite.ssrLoadModule(url, { fixStacktrace: true }); - } catch (/** @type {unknown} */ e) { - const err = /** @type {import('rollup').RollupError} */ (e); - const msg = buildErrorMessage(err, [colors.red(`Internal server error: ${err.message}`)]); - - if (!vite.config.logger.hasErrorLogged(err)) { - vite.config.logger.error(msg, { error: err }); - } - - vite.ws.send({ - type: 'error', - err: /** @type {import('vite').ErrorPayload['err']} */ ({ - ...err, - // these properties are non-enumerable and will - // not be serialized unless we explicitly include them - message: err.message, - stack: err.stack ?? '' - }) - }); - - throw err; - } - } - - /** @param {string} id */ - async function resolve(id) { - const url = id.startsWith('..') ? to_fs(path.posix.resolve(id)) : `/${id}`; - - const module = await loud_ssr_load_module(url); - - const module_node = await vite.moduleGraph.getModuleByUrl(url); - if (!module_node) throw new Error(`Could not find node for ${url}`); - - return { module, module_node, url }; - } - - function update_manifest() { - try { - ({ manifest_data } = sync.create(svelte_config)); - - if (manifest_error) { - manifest_error = null; - vite.ws.send({ type: 'full-reload' }); - } - } catch (error) { - manifest_error = /** @type {Error} */ (error); - - console.error(colors.bold().red(manifest_error.message)); - vite.ws.send({ - type: 'error', - err: { - message: manifest_error.message ?? 'Invalid routes', - stack: '' - } - }); - - return; - } - - manifest = { - appDir: svelte_config.kit.appDir, - appPath: svelte_config.kit.appDir, - assets: new Set(manifest_data.assets.map((asset) => asset.file)), - mimeTypes: get_mime_lookup(manifest_data), - _: { - client: { - start: `${runtime_base}/client/entry.js`, - app: `${to_fs(svelte_config.kit.outDir)}/generated/client/app.js`, - imports: [], - stylesheets: [], - fonts: [], - uses_env_dynamic_public: true, - nodes: - svelte_config.kit.router.resolution === 'client' - ? undefined - : manifest_data.nodes.map((node, i) => { - if (node.component || node.universal) { - return `${svelte_config.kit.paths.base}${to_fs(svelte_config.kit.outDir)}/generated/client/nodes/${i}.js`; - } - }), - // `css` is not necessary in dev, as the JS file from `nodes` will reference the CSS file - routes: - svelte_config.kit.router.resolution === 'client' - ? undefined - : compact( - manifest_data.routes.map((route) => { - if (!route.page) return; - - return { - id: route.id, - pattern: route.pattern, - params: route.params, - layouts: route.page.layouts.map((l) => - l !== undefined ? [!!manifest_data.nodes[l].server, l] : undefined - ), - errors: route.page.errors, - leaf: [!!manifest_data.nodes[route.page.leaf].server, route.page.leaf] - }; - }) - ) - }, - server_assets: new Proxy( - {}, - { - has: (_, /** @type {string} */ file) => fs.existsSync(from_fs(file)), - get: (_, /** @type {string} */ file) => fs.statSync(from_fs(file)).size - } - ), - nodes: manifest_data.nodes.map((node, index) => { - return async () => { - /** @type {import('types').SSRNode} */ - const result = {}; - result.index = index; - result.universal_id = node.universal; - result.server_id = node.server; - - // these are unused in dev, but it's easier to include them - result.imports = []; - result.stylesheets = []; - result.fonts = []; - - /** @type {import('vite').ModuleNode[]} */ - const module_nodes = []; - - if (node.component) { - result.component = async () => { - const { module_node, module } = await resolve( - /** @type {string} */ (node.component) - ); - - module_nodes.push(module_node); - - return module.default; - }; - } - - if (node.universal) { - if (node.page_options?.ssr === false) { - result.universal = /** @type {UniversalNode} */ (node.page_options); - } else { - // TODO: explain why the file was loaded on the server if we fail to load it - const { module, module_node } = await resolve(node.universal); - module_nodes.push(module_node); - result.universal = module; - } - } - - if (node.server) { - const { module } = await resolve(node.server); - result.server = module; - } - - // in dev we inline all styles to avoid FOUC. this gets populated lazily so that - // components/stylesheets loaded via import() during `load` are included - result.inline_styles = async () => { - /** @type {Set} */ - const deps = new Set(); - - for (const module_node of module_nodes) { - await find_deps(vite, module_node, deps); - } - - /** @type {Record} */ - const styles = {}; - - for (const dep of deps) { - if (isCSSRequest(dep.url) && !vite_css_query_regex.test(dep.url)) { - const inlineCssUrl = dep.url.includes('?') - ? dep.url.replace('?', '?inline&') - : dep.url + '?inline'; - try { - const mod = await vite.ssrLoadModule(inlineCssUrl); - styles[dep.url] = mod.default; - } catch { - // this can happen with dynamically imported modules, I think - // because the Vite module graph doesn't distinguish between - // static and dynamic imports? TODO investigate, submit fix - } - } - } - - return styles; - }; - - return result; - }; - }), - prerendered_routes: new Set(), - get remotes() { - return Object.fromEntries( - get_remotes().map((remote) => [ - remote.hash, - () => vite.ssrLoadModule(remote.file).then((module) => ({ default: module })) - ]) - ); - }, - routes: compact( - manifest_data.routes.map((route) => { - if (!route.page && !route.endpoint) return null; - - const endpoint = route.endpoint; - - return { - id: route.id, - pattern: route.pattern, - params: route.params, - page: route.page, - endpoint: endpoint - ? async () => { - const url = path.resolve(cwd, endpoint.file); - return await loud_ssr_load_module(url); - } - : null, - endpoint_id: endpoint?.file - }; - }) - ), - matchers: async () => { - /** @type {Record} */ - const matchers = {}; - - for (const key in manifest_data.matchers) { - const file = manifest_data.matchers[key]; - const url = path.resolve(cwd, file); - const module = await vite.ssrLoadModule(url, { fixStacktrace: true }); - - if (module.match) { - matchers[key] = module.match; - } else { - throw new Error(`${file} does not export a \`match\` function`); - } - } - - return matchers; - } - } - }; - } - - /** @param {Error} error */ - function fix_stack_trace(error) { - try { - vite.ssrFixStacktrace(error); - } catch { - // ssrFixStacktrace can fail on StackBlitz web containers and we don't know why - // by ignoring it the line numbers are wrong, but at least we can show the error - } - return error.stack; - } - - update_manifest(); - - /** - * @param {string} event - * @param {(file: string) => void} cb - */ - const watch = (event, cb) => { - vite.watcher.on(event, (file) => { - if ( - file.startsWith(svelte_config.kit.files.routes + path.sep) || - file.startsWith(svelte_config.kit.files.params + path.sep) || - svelte_config.kit.moduleExtensions.some((ext) => file.endsWith(`.remote${ext}`)) || - // in contrast to server hooks, client hooks are written to the client manifest - // and therefore need rebuilding when they are added/removed - file.startsWith(svelte_config.kit.files.hooks.client) - ) { - cb(file); - } - }); - }; - /** @type {NodeJS.Timeout | null } */ - let timeout = null; - /** @param {() => void} to_run */ - const debounce = (to_run) => { - timeout && clearTimeout(timeout); - timeout = setTimeout(() => { - timeout = null; - to_run(); - }, 100); - }; - - // flag to skip watchers if server is already restarting - let restarting = false; - - // Debounce add/unlink events because in case of folder deletion or moves - // they fire in rapid succession, causing needless invocations. - // These watchers only run for routes, param matchers, and client hooks. - watch('add', () => debounce(update_manifest)); - watch('unlink', () => debounce(update_manifest)); - watch('change', (file) => { - // Don't run for a single file if the whole manifest is about to get updated - // Unless it's a file where the trailing slash page option might have changed - if (timeout || restarting || !/\+(page|layout|server).*$/.test(file)) return; - sync.update(svelte_config, manifest_data, file); - }); - - const { appTemplate, errorTemplate, serviceWorker, hooks } = svelte_config.kit.files; - - // vite client only executes a full reload if the triggering html file path is index.html - // kit defaults to src/app.html, so unless user changed that to index.html - // send the vite client a full-reload event without path being set - if (appTemplate !== 'index.html') { - vite.watcher.on('change', (file) => { - if (file === appTemplate && !restarting) { - vite.ws.send({ type: 'full-reload' }); - } - }); - } - - vite.watcher.on('all', (_, file) => { - if ( - file === appTemplate || - file === errorTemplate || - file.startsWith(serviceWorker) || - file.startsWith(hooks.server) - ) { - sync.server(svelte_config); - } - }); - - vite.watcher.on('change', async (file) => { - // changing the svelte config requires restarting the dev server - // the config is only read on start and passed on to vite-plugin-svelte - // which needs up-to-date values to operate correctly - if (file.match(/[/\\]svelte\.config\.[jt]s$/)) { - console.log(`svelte config changed, restarting vite dev-server. changed file: ${file}`); - restarting = true; - await vite.restart(); - } - }); - - const assets = svelte_config.kit.paths.assets ? SVELTE_KIT_ASSETS : svelte_config.kit.paths.base; - const asset_server = sirv(svelte_config.kit.files.assets, { - dev: true, - etag: true, - maxAge: 0, - extensions: [], - setHeaders: (res) => { - res.setHeader('access-control-allow-origin', '*'); - } - }); - - vite.middlewares.use((req, res, next) => { - const base = `${vite.config.server.https ? 'https' : 'http'}://${ - req.headers[':authority'] || req.headers.host - }`; - - const decoded = decodeURI(new URL(base + req.url).pathname); - - if (decoded.startsWith(assets)) { - const pathname = decoded.slice(assets.length); - const file = svelte_config.kit.files.assets + pathname; - - if (fs.existsSync(file) && !fs.statSync(file).isDirectory()) { - if (has_correct_case(file, svelte_config.kit.files.assets)) { - req.url = encodeURI(pathname); // don't need query/hash - asset_server(req, res); - return; - } - } - } - - next(); - }); - - const env = loadEnv(vite_config.mode, svelte_config.kit.env.dir, ''); - const emulator = await svelte_config.kit.adapter?.emulate?.(); - - return () => { - const serve_static_middleware = vite.middlewares.stack.find( - (middleware) => - /** @type {Function} */ (middleware.handle).name === 'viteServeStaticMiddleware' - ); - - // Vite will give a 403 on URLs like /test, /static, and /package.json preventing us from - // serving routes with those names. See https://github.com/vitejs/vite/issues/7363 - remove_static_middlewares(vite.middlewares); - - vite.middlewares.use(async (req, res) => { - // Vite's base middleware strips out the base path. Restore it - const original_url = req.url; - req.url = req.originalUrl; - try { - const base = `${vite.config.server.https ? 'https' : 'http'}://${ - req.headers[':authority'] || req.headers.host - }`; - - const decoded = decodeURI(new URL(base + req.url).pathname); - const file = posixify(path.resolve(decoded.slice(svelte_config.kit.paths.base.length + 1))); - const is_file = fs.existsSync(file) && !fs.statSync(file).isDirectory(); - const allowed = - !vite_config.server.fs.strict || - vite_config.server.fs.allow.some((dir) => file.startsWith(dir)); - - if (is_file && allowed) { - req.url = original_url; - // @ts-expect-error - serve_static_middleware.handle(req, res); - return; - } - - if (is_chrome_devtools_request(decoded, res)) { - return; - } - - if (!decoded.startsWith(svelte_config.kit.paths.base)) { - return not_found(req, res, svelte_config.kit.paths.base); - } - - if (decoded === svelte_config.kit.paths.base + '/service-worker.js') { - const resolved = resolve_entry(svelte_config.kit.files.serviceWorker); - - if (resolved) { - res.writeHead(200, { - 'content-type': 'application/javascript' - }); - res.end(`import '${svelte_config.kit.paths.base}${to_fs(resolved)}';`); - } else { - res.writeHead(404); - res.end('not found'); - } - - return; - } - - const resolved_instrumentation = resolve_entry( - path.join(svelte_config.kit.files.src, 'instrumentation.server') - ); - - if (resolved_instrumentation) { - await vite.ssrLoadModule(resolved_instrumentation); - } - - // we have to import `Server` before calling `set_assets` - const { Server } = /** @type {import('types').ServerModule} */ ( - await vite.ssrLoadModule(`${runtime_base}/server/index.js`, { fixStacktrace: true }) - ); - - const { set_fix_stack_trace } = await vite.ssrLoadModule( - `${runtime_base}/shared-server.js` - ); - set_fix_stack_trace(fix_stack_trace); - - const { set_assets } = await vite.ssrLoadModule('$app/paths/internal/server'); - set_assets(assets); - - const server = new Server(manifest); - - await server.init({ - env, - read: (file) => createReadableStream(from_fs(file)) - }); - - const request = await getRequest({ - base, - request: req - }); - - if (manifest_error) { - console.error(colors.bold().red(manifest_error.message)); - - const error_page = load_error_page(svelte_config); - - /** @param {{ status: number; message: string }} opts */ - const error_template = ({ status, message }) => { - return error_page - .replace(/%sveltekit\.status%/g, String(status)) - .replace(/%sveltekit\.error\.message%/g, escape_html(message)); - }; - - res.writeHead(500, { - 'Content-Type': 'text/html; charset=utf-8' - }); - res.end( - error_template({ status: 500, message: manifest_error.message ?? 'Invalid routes' }) - ); - - return; - } - - const rendered = await server.respond(request, { - getClientAddress: () => { - const { remoteAddress } = req.socket; - if (remoteAddress) return remoteAddress; - throw new Error('Could not determine clientAddress'); - }, - read: (file) => { - if (file in manifest._.server_assets) { - return fs.readFileSync(from_fs(file)); - } - - return fs.readFileSync(path.join(svelte_config.kit.files.assets, file)); - }, - before_handle: (event, config, prerender) => { - async_local_storage.enterWith({ event, config, prerender }); - }, - emulator - }); - - if (rendered.status === 404) { - // @ts-expect-error - serve_static_middleware.handle(req, res, () => { - void setResponse(res, rendered); - }); - } else { - void setResponse(res, rendered); - } - } catch (e) { - const error = coalesce_to_error(e); - res.statusCode = 500; - res.end(fix_stack_trace(error)); - } - }); - }; -} - -/** - * @param {import('connect').Server} server - */ -function remove_static_middlewares(server) { - const static_middlewares = ['viteServeStaticMiddleware', 'viteServePublicMiddleware']; - for (let i = server.stack.length - 1; i > 0; i--) { - // @ts-expect-error using internals - if (static_middlewares.includes(server.stack[i].handle.name)) { - server.stack.splice(i, 1); - } - } -} - -/** - * @param {import('vite').ViteDevServer} vite - * @param {import('vite').ModuleNode | import('vite').EnvironmentModuleNode} node - * @param {Set} deps - */ -async function find_deps(vite, node, deps) { - // since `ssrTransformResult.deps` contains URLs instead of `ModuleNode`s, this process is asynchronous. - // instead of using `await`, we resolve all branches in parallel. - /** @type {Promise[]} */ - const branches = []; - - /** @param {import('vite').ModuleNode | import('vite').EnvironmentModuleNode} node */ - async function add(node) { - if (!deps.has(node)) { - deps.add(node); - await find_deps(vite, node, deps); - } - } - - /** @param {string} url */ - async function add_by_url(url) { - const node = await get_server_module_by_url(vite, url); - - if (node) { - await add(node); - } - } - - const transform_result = - /** @type {import('vite').ModuleNode} */ (node).ssrTransformResult || node.transformResult; - - if (transform_result) { - if (transform_result.deps) { - transform_result.deps.forEach((url) => branches.push(add_by_url(url))); - } - - if (transform_result.dynamicDeps) { - transform_result.dynamicDeps.forEach((url) => branches.push(add_by_url(url))); - } - } else { - node.importedModules.forEach((node) => branches.push(add(node))); - } - - await Promise.all(branches); -} - -/** - * @param {import('vite').ViteDevServer} vite - * @param {string} url - */ -function get_server_module_by_url(vite, url) { - return vite.environments - ? vite.environments.ssr.moduleGraph.getModuleByUrl(url) - : vite.moduleGraph.getModuleByUrl(url, true); -} - -/** - * Determine if a file is being requested with the correct case, - * to ensure consistent behaviour between dev and prod and across - * operating systems. Note that we can't use realpath here, - * because we don't want to follow symlinks - * @param {string} file - * @param {string} assets - * @returns {boolean} - */ -function has_correct_case(file, assets) { - if (file === assets) return true; - - const parent = path.dirname(file); - - if (fs.readdirSync(parent).includes(path.basename(file))) { - return has_correct_case(parent, assets); - } - - return false; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/index.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/index.js deleted file mode 100644 index fe829e7..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/index.js +++ /dev/null @@ -1,1486 +0,0 @@ -/** @import { Options } from '@sveltejs/vite-plugin-svelte' */ -/** @import { PreprocessorGroup } from 'svelte/compiler' */ -/** @import { ConfigEnv, Manifest, Plugin, ResolvedConfig, UserConfig, ViteDevServer } from 'vite' */ -import fs from 'node:fs'; -import path from 'node:path'; -import process from 'node:process'; - -import colors from 'kleur'; - -import { copy, mkdirp, posixify, read, resolve_entry, rimraf } from '../../utils/filesystem.js'; -import { create_static_module, create_dynamic_module } from '../../core/env.js'; -import * as sync from '../../core/sync/sync.js'; -import { create_assets } from '../../core/sync/create_manifest_data/index.js'; -import { runtime_directory, logger } from '../../core/utils.js'; -import { load_config } from '../../core/config/index.js'; -import { generate_manifest } from '../../core/generate_manifest/index.js'; -import { build_server_nodes } from './build/build_server.js'; -import { build_service_worker } from './build/build_service_worker.js'; -import { assets_base, find_deps, resolve_symlinks } from './build/utils.js'; -import { dev } from './dev/index.js'; -import { preview } from './preview/index.js'; -import { - error_for_missing_config, - get_config_aliases, - get_env, - normalize_id, - stackless -} from './utils.js'; -import { write_client_manifest } from '../../core/sync/write_client_manifest.js'; -import prerender from '../../core/postbuild/prerender.js'; -import analyse from '../../core/postbuild/analyse.js'; -import { s } from '../../utils/misc.js'; -import { hash } from '../../utils/hash.js'; -import { dedent, isSvelte5Plus } from '../../core/sync/utils.js'; -import { - env_dynamic_private, - env_dynamic_public, - env_static_private, - env_static_public, - service_worker, - sveltekit_environment, - sveltekit_server -} from './module_ids.js'; -import { import_peer } from '../../utils/import.js'; -import { compact } from '../../utils/array.js'; -import { should_ignore, has_children } from './static_analysis/utils.js'; -import { treeshake_prerendered_remotes } from './build/remote.js'; - -const cwd = posixify(process.cwd()); - -/** @type {import('./types.js').EnforcedConfig} */ -const enforced_config = { - appType: true, - base: true, - build: { - cssCodeSplit: true, - emptyOutDir: true, - lib: { - entry: true, - name: true, - formats: true - }, - manifest: true, - outDir: true, - rollupOptions: { - input: true, - output: { - format: true, - entryFileNames: true, - chunkFileNames: true, - assetFileNames: true - }, - preserveEntrySignatures: true - }, - ssr: true - }, - publicDir: true, - resolve: { - alias: { - $app: true, - $lib: true, - '$service-worker': true - } - }, - root: true -}; - -const options_regex = /(export\s+const\s+(prerender|csr|ssr|trailingSlash))\s*=/s; - -/** @type {Set} */ -const warned = new Set(); - -/** @type {PreprocessorGroup} */ -const warning_preprocessor = { - script: ({ content, filename }) => { - if (!filename) return; - - const basename = path.basename(filename); - if (basename.startsWith('+page.') || basename.startsWith('+layout.')) { - const match = content.match(options_regex); - if (match && match.index !== undefined && !should_ignore(content, match.index)) { - const fixed = basename.replace('.svelte', '(.server).js/ts'); - - const message = - `\n${colors.bold().red(path.relative('.', filename))}\n` + - `\`${match[1]}\` will be ignored — move it to ${fixed} instead. See https://svelte.dev/docs/kit/page-options for more information.`; - - if (!warned.has(message)) { - console.log(message); - warned.add(message); - } - } - } - }, - markup: ({ content, filename }) => { - if (!filename) return; - - const basename = path.basename(filename); - - if (basename.startsWith('+layout.') && !has_children(content, isSvelte5Plus())) { - const message = - `\n${colors.bold().red(path.relative('.', filename))}\n` + - `\`\`${isSvelte5Plus() ? ' or `{@render ...}` tag' : ''}` + - ' missing — inner content will not be rendered'; - - if (!warned.has(message)) { - console.log(message); - warned.add(message); - } - } - } -}; - -/** - * Returns the SvelteKit Vite plugins. - * @returns {Promise} - */ -export async function sveltekit() { - const svelte_config = await load_config(); - - /** @type {Options['preprocess']} */ - let preprocess = svelte_config.preprocess; - if (Array.isArray(preprocess)) { - preprocess = [...preprocess, warning_preprocessor]; - } else if (preprocess) { - preprocess = [preprocess, warning_preprocessor]; - } else { - preprocess = warning_preprocessor; - } - - /** @type {Options} */ - const vite_plugin_svelte_options = { - configFile: false, - extensions: svelte_config.extensions, - preprocess, - onwarn: svelte_config.onwarn, - compilerOptions: { - // @ts-ignore - ignore this property when running `pnpm check` against Svelte 5 in the ecosystem CI - hydratable: isSvelte5Plus() ? undefined : true, - ...svelte_config.compilerOptions - }, - ...svelte_config.vitePlugin - }; - - const { svelte } = await import_peer('@sveltejs/vite-plugin-svelte'); - - return [...svelte(vite_plugin_svelte_options), ...(await kit({ svelte_config }))]; -} - -// These variables live outside the `kit()` function because it is re-invoked by each Vite build - -let secondary_build_started = false; - -/** @type {import('types').ManifestData} */ -let manifest_data; - -/** @type {import('types').ServerMetadata | undefined} only set at build time once analysis is finished */ -let build_metadata = undefined; - -/** - * Returns the SvelteKit Vite plugin. Vite executes Rollup hooks as well as some of its own. - * Background reading is available at: - * - https://vitejs.dev/guide/api-plugin.html - * - https://rollupjs.org/guide/en/#plugin-development - * - * You can get an idea of the lifecycle by looking at the flow charts here: - * - https://rollupjs.org/guide/en/#build-hooks - * - https://rollupjs.org/guide/en/#output-generation-hooks - * - * @param {{ svelte_config: import('types').ValidatedConfig }} options - * @return {Promise} - */ -async function kit({ svelte_config }) { - /** @type {typeof import('vite')} */ - const vite = await import_peer('vite'); - - // @ts-ignore `vite.rolldownVersion` only exists in `vite 8` - const is_rolldown = !!vite.rolldownVersion; - - const { kit } = svelte_config; - const out = `${kit.outDir}/output`; - - const version_hash = hash(kit.version.name); - - /** @type {ResolvedConfig} */ - let vite_config; - - /** @type {ConfigEnv} */ - let vite_config_env; - - /** @type {boolean} */ - let is_build; - - /** @type {{ public: Record; private: Record }} */ - let env; - - /** @type {() => Promise} */ - let finalise; - - /** @type {UserConfig} */ - let initial_config; - - const service_worker_entry_file = resolve_entry(kit.files.serviceWorker); - const parsed_service_worker = path.parse(kit.files.serviceWorker); - - const normalized_cwd = vite.normalizePath(cwd); - const normalized_lib = vite.normalizePath(kit.files.lib); - const normalized_node_modules = vite.normalizePath(path.resolve('node_modules')); - - /** - * A map showing which features (such as `$app/server:read`) are defined - * in which chunks, so that we can later determine which routes use which features - * @type {Record} - */ - const tracked_features = {}; - - const sourcemapIgnoreList = /** @param {string} relative_path */ (relative_path) => - relative_path.includes('node_modules') || relative_path.includes(kit.outDir); - - /** @type {Plugin} */ - const plugin_setup = { - name: 'vite-plugin-sveltekit-setup', - - /** - * Build the SvelteKit-provided Vite config to be merged with the user's vite.config.js file. - * @see https://vitejs.dev/guide/api-plugin.html#config - */ - config: { - order: 'pre', - handler(config, config_env) { - initial_config = config; - vite_config_env = config_env; - is_build = config_env.command === 'build'; - - env = get_env(kit.env, vite_config_env.mode); - - const allow = new Set([ - kit.files.lib, - kit.files.routes, - kit.outDir, - path.resolve('src'), // TODO this isn't correct if user changed all his files to sth else than src (like in test/options) - path.resolve('node_modules'), - path.resolve(vite.searchForWorkspaceRoot(cwd), 'node_modules') - ]); - - // We can only add directories to the allow list, so we find out - // if there's a client hooks file and pass its directory - const client_hooks = resolve_entry(kit.files.hooks.client); - if (client_hooks) allow.add(path.dirname(client_hooks)); - - const generated = path.posix.join(kit.outDir, 'generated'); - - // dev and preview config can be shared - /** @type {UserConfig} */ - const new_config = { - resolve: { - alias: [ - { find: '__SERVER__', replacement: `${generated}/server` }, - { find: '$app', replacement: `${runtime_directory}/app` }, - ...get_config_aliases(kit) - ] - }, - root: cwd, - server: { - cors: { preflightContinue: true }, - fs: { - allow: [...allow] - }, - sourcemapIgnoreList, - watch: { - ignored: [ - // Ignore all siblings of config.kit.outDir/generated - `${posixify(kit.outDir)}/!(generated)` - ] - } - }, - preview: { - cors: { preflightContinue: true } - }, - optimizeDeps: { - entries: [ - `${kit.files.routes}/**/+*.{svelte,js,ts}`, - `!${kit.files.routes}/**/+*server.*` - ], - exclude: [ - // Without this SvelteKit will be prebundled on the client, which means we end up with two versions of Redirect etc. - // Also see https://github.com/sveltejs/kit/issues/5952#issuecomment-1218844057 - '@sveltejs/kit', - // exclude kit features so that libraries using them work even when they are prebundled - // this does not affect app code, just handling of imported libraries that use $app or $env - '$app', - '$env' - ] - }, - ssr: { - noExternal: [ - // This ensures that esm-env is inlined into the server output with the - // export conditions resolved correctly through Vite. This prevents adapters - // that bundle later on from resolving the export conditions incorrectly - // and for example include browser-only code in the server output - // because they for example use esbuild.build with `platform: 'browser'` - 'esm-env', - // This forces `$app/*` modules to be bundled, since they depend on - // virtual modules like `__sveltekit/environment` (this isn't a valid bare - // import, but it works with vite-node's externalization logic, which - // uses basic concatenation) - '@sveltejs/kit/src/runtime' - ] - } - }; - - if (kit.experimental.remoteFunctions) { - // treat .remote.js files as empty for the purposes of prebundling - // detects rolldown to avoid a warning message in vite 8 beta - const remote_id_filter = new RegExp( - `.remote(${kit.moduleExtensions.join('|')})$`.replaceAll('.', '\\.') - ); - new_config.optimizeDeps ??= {}; // for some reason ts says this could be undefined even though it was set above - if (is_rolldown) { - // @ts-ignore - new_config.optimizeDeps.rolldownOptions ??= {}; - // @ts-ignore - new_config.optimizeDeps.rolldownOptions.plugins ??= []; - // @ts-ignore - new_config.optimizeDeps.rolldownOptions.plugins.push({ - name: 'vite-plugin-sveltekit-setup:optimize-remote-functions', - load: { - filter: { id: remote_id_filter }, - handler() { - return ''; - } - } - }); - } else { - new_config.optimizeDeps.esbuildOptions ??= {}; - new_config.optimizeDeps.esbuildOptions.plugins ??= []; - new_config.optimizeDeps.esbuildOptions.plugins.push({ - name: 'vite-plugin-sveltekit-setup:optimize-remote-functions', - setup(build) { - build.onLoad({ filter: remote_id_filter }, () => ({ contents: '' })); - } - }); - } - } - - const define = { - __SVELTEKIT_APP_DIR__: s(kit.appDir), - __SVELTEKIT_EMBEDDED__: s(kit.embedded), - __SVELTEKIT_FORK_PRELOADS__: s(kit.experimental.forkPreloads), - __SVELTEKIT_PATHS_ASSETS__: s(kit.paths.assets), - __SVELTEKIT_PATHS_BASE__: s(kit.paths.base), - __SVELTEKIT_PATHS_RELATIVE__: s(kit.paths.relative), - __SVELTEKIT_CLIENT_ROUTING__: s(kit.router.resolution === 'client'), - __SVELTEKIT_HASH_ROUTING__: s(kit.router.type === 'hash'), - __SVELTEKIT_SERVER_TRACING_ENABLED__: s(kit.experimental.tracing.server), - __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__: s(kit.experimental.handleRenderingErrors) - }; - - if (is_build) { - if (!new_config.build) new_config.build = {}; - new_config.build.ssr = !secondary_build_started; - - new_config.define = { - ...define, - __SVELTEKIT_ADAPTER_NAME__: s(kit.adapter?.name), - __SVELTEKIT_APP_VERSION_FILE__: s(`${kit.appDir}/version.json`), - __SVELTEKIT_APP_VERSION_POLL_INTERVAL__: s(kit.version.pollInterval), - __SVELTEKIT_PAYLOAD__: new_config.build.ssr - ? '{}' - : `globalThis.__sveltekit_${version_hash}` - }; - - if (!secondary_build_started) { - manifest_data = sync.all(svelte_config, config_env.mode).manifest_data; - // During the initial server build we don't know yet - new_config.define.__SVELTEKIT_HAS_SERVER_LOAD__ = 'true'; - new_config.define.__SVELTEKIT_HAS_UNIVERSAL_LOAD__ = 'true'; - } else { - const nodes = Object.values( - /** @type {import('types').ServerMetadata} */ (build_metadata).nodes - ); - - // Through the finished analysis we can now check if any node has server or universal load functions - const has_server_load = nodes.some((node) => node.has_server_load); - const has_universal_load = nodes.some((node) => node.has_universal_load); - - new_config.define.__SVELTEKIT_HAS_SERVER_LOAD__ = s(has_server_load); - new_config.define.__SVELTEKIT_HAS_UNIVERSAL_LOAD__ = s(has_universal_load); - } - } else { - new_config.define = { - ...define, - __SVELTEKIT_APP_VERSION_POLL_INTERVAL__: '0', - __SVELTEKIT_PAYLOAD__: 'globalThis.__sveltekit_dev', - __SVELTEKIT_HAS_SERVER_LOAD__: 'true', - __SVELTEKIT_HAS_UNIVERSAL_LOAD__: 'true' - }; - - // @ts-ignore this prevents a reference error if `client.js` is imported on the server - globalThis.__sveltekit_dev = {}; - - // These Kit dependencies are packaged as CommonJS, which means they must always be externalized. - // Without this, the tests will still pass but `pnpm dev` will fail in projects that link `@sveltejs/kit`. - /** @type {NonNullable} */ (new_config.ssr).external = [ - 'cookie', - 'set-cookie-parser' - ]; - } - - warn_overridden_config(config, new_config); - - return new_config; - } - }, - - /** - * Stores the final config. - */ - configResolved(config) { - vite_config = config; - } - }; - - /** @type {Plugin} */ - const plugin_virtual_modules = { - name: 'vite-plugin-sveltekit-virtual-modules', - - resolveId(id, importer) { - if (id === '__sveltekit/manifest') { - return `${kit.outDir}/generated/client-optimized/app.js`; - } - - // If importing from a service-worker, only allow $service-worker & $env/static/public, but none of the other virtual modules. - // This check won't catch transitive imports, but it will warn when the import comes from a service-worker directly. - // Transitive imports will be caught during the build. - // TODO move this logic to plugin_guard - if (importer) { - const parsed_importer = path.parse(importer); - - const importer_is_service_worker = - parsed_importer.dir === parsed_service_worker.dir && - parsed_importer.name === parsed_service_worker.name; - - if (importer_is_service_worker && id !== '$service-worker' && id !== '$env/static/public') { - throw new Error( - `Cannot import ${normalize_id( - id, - normalized_lib, - normalized_cwd - )} into service-worker code. Only the modules $service-worker and $env/static/public are available in service workers.` - ); - } - } - - // treat $env/static/[public|private] as virtual - if (id.startsWith('$env/') || id === '$service-worker') { - // ids with :$ don't work with reverse proxies like nginx - return `\0virtual:${id.substring(1)}`; - } - - if (id === '__sveltekit/remote') { - return `${runtime_directory}/client/remote-functions/index.js`; - } - - if (id.startsWith('__sveltekit/')) { - return `\0virtual:${id}`; - } - }, - - load(id, options) { - const browser = !options?.ssr; - - const global = is_build - ? `globalThis.__sveltekit_${version_hash}` - : 'globalThis.__sveltekit_dev'; - - switch (id) { - case env_static_private: - return create_static_module('$env/static/private', env.private); - - case env_static_public: - return create_static_module('$env/static/public', env.public); - - case env_dynamic_private: - return create_dynamic_module( - 'private', - vite_config_env.command === 'serve' ? env.private : undefined - ); - - case env_dynamic_public: - // populate `$env/dynamic/public` from `window` - if (browser) { - return `export const env = ${global}.env;`; - } - - return create_dynamic_module( - 'public', - vite_config_env.command === 'serve' ? env.public : undefined - ); - - case service_worker: - return create_service_worker_module(svelte_config); - - case sveltekit_environment: { - const { version } = svelte_config.kit; - - return dedent` - export const version = ${s(version.name)}; - export let building = false; - export let prerendering = false; - - export function set_building() { - building = true; - } - - export function set_prerendering() { - prerendering = true; - } - `; - } - - case sveltekit_server: { - return dedent` - export let read_implementation = null; - - export let manifest = null; - - export function set_read_implementation(fn) { - read_implementation = fn; - } - - export function set_manifest(_) { - manifest = _; - } - `; - } - } - } - }; - - /** @type {Map>} */ - const import_map = new Map(); - const server_only_pattern = /.*\.server\..+/; - - /** - * Ensures that client-side code can't accidentally import server-side code, - * whether in `*.server.js` files, `$app/server`, `$lib/server`, or `$env/[static|dynamic]/private` - * @type {Plugin} - */ - const plugin_guard = { - name: 'vite-plugin-sveltekit-guard', - - // Run this plugin before built-in resolution, so that relative imports - // are added to the module graph - enforce: 'pre', - - async resolveId(id, importer, options) { - if (importer && !importer.endsWith('index.html')) { - const resolved = await this.resolve(id, importer, { ...options, skipSelf: true }); - - if (resolved) { - const normalized = normalize_id(resolved.id, normalized_lib, normalized_cwd); - - let importers = import_map.get(normalized); - - if (!importers) { - importers = new Set(); - import_map.set(normalized, importers); - } - - importers.add(normalize_id(importer, normalized_lib, normalized_cwd)); - } - } - }, - - load(id, options) { - if (options?.ssr === true || process.env.TEST === 'true') { - return; - } - - // skip .server.js files outside the cwd or in node_modules, as the filename might not mean 'server-only module' in this context - const is_internal = id.startsWith(normalized_cwd) && !id.startsWith(normalized_node_modules); - - const normalized = normalize_id(id, normalized_lib, normalized_cwd); - - const is_server_only = - normalized === '$env/static/private' || - normalized === '$env/dynamic/private' || - normalized === '$app/server' || - normalized.startsWith('$lib/server/') || - (is_internal && server_only_pattern.test(path.basename(id))); - - if (is_server_only) { - // in dev, this doesn't exist, so we need to create it - manifest_data ??= sync.all(svelte_config, vite_config_env.mode).manifest_data; - - /** @type {Set} */ - const entrypoints = new Set(); - for (const node of manifest_data.nodes) { - if (node.component) entrypoints.add(node.component); - if (node.universal) entrypoints.add(node.universal); - } - - if (manifest_data.hooks.client) entrypoints.add(manifest_data.hooks.client); - if (manifest_data.hooks.universal) entrypoints.add(manifest_data.hooks.universal); - - const normalized = normalize_id(id, normalized_lib, normalized_cwd); - const chain = [normalized]; - - let current = normalized; - let includes_remote_file = false; - - while (true) { - const importers = import_map.get(current); - if (!importers) break; - - const candidates = Array.from(importers).filter((importer) => !chain.includes(importer)); - if (candidates.length === 0) break; - - chain.push((current = candidates[0])); - - includes_remote_file ||= svelte_config.kit.moduleExtensions.some((ext) => { - return current.endsWith(`.remote${ext}`); - }); - - if (entrypoints.has(current)) { - const pyramid = chain - .reverse() - .map((id, i) => { - return `${' '.repeat(i + 1)}${id}`; - }) - .join(' imports\n'); - - if (includes_remote_file) { - error_for_missing_config( - 'remote functions', - 'kit.experimental.remoteFunctions', - 'true' - ); - } - - let message = `Cannot import ${normalized} into code that runs in the browser, as this could leak sensitive information.`; - message += `\n\n${pyramid}`; - message += `\n\nIf you're only using the import as a type, change it to \`import type\`.`; - - throw stackless(message); - } - } - - throw new Error('An impossible situation occurred'); - } - } - }; - - /** @type {ViteDevServer} */ - let dev_server; - - /** @type {Array<{ hash: string, file: string }>} */ - const remotes = []; - - /** @type {Map} Maps remote hash -> original module id */ - const remote_original_by_hash = new Map(); - - /** @type {Set} Track which remote hashes have already been emitted */ - const emitted_remote_hashes = new Set(); - - /** @type {Plugin} */ - const plugin_remote = { - name: 'vite-plugin-sveltekit-remote', - - resolveId(id) { - if (id.startsWith('\0sveltekit-remote:')) return id; - }, - - load(id) { - // On-the-fly generated entry point for remote file just forwards the original module - // We're not using manualChunks because it can cause problems with circular dependencies - // (e.g. https://github.com/sveltejs/kit/issues/14679) and module ordering in general - // (e.g. https://github.com/sveltejs/kit/issues/14590). - if (id.startsWith('\0sveltekit-remote:')) { - const hash_id = id.slice('\0sveltekit-remote:'.length); - const original = remote_original_by_hash.get(hash_id); - if (!original) throw new Error(`Expected to find metadata for remote file ${id}`); - return `import * as m from ${s(original)};\nexport default m;`; - } - }, - - configureServer(_dev_server) { - dev_server = _dev_server; - }, - - async transform(code, id, opts) { - const normalized = normalize_id(id, normalized_lib, normalized_cwd); - if (!svelte_config.kit.moduleExtensions.some((ext) => normalized.endsWith(`.remote${ext}`))) { - return; - } - - const file = posixify(path.relative(cwd, id)); - const remote = { - hash: hash(file), - file - }; - - remotes.push(remote); - - if (opts?.ssr) { - // we need to add an `await Promise.resolve()` because if the user imports this function - // on the client AND in a load function when loading the client module we will trigger - // an ssrLoadModule during dev. During a link preload, the module can be mistakenly - // loaded and transformed twice and the first time all its exports would be undefined - // triggering a dev server error. By adding a microtask we ensure that the module is fully loaded - - // Extra newlines to prevent syntax errors around missing semicolons or comments - code += - '\n\n' + - dedent` - import * as $$_self_$$ from './${path.basename(id)}'; - import { init_remote_functions as $$_init_$$ } from '@sveltejs/kit/internal'; - - ${dev_server ? 'await Promise.resolve()' : ''} - - $$_init_$$($$_self_$$, ${s(file)}, ${s(remote.hash)}); - - for (const [name, fn] of Object.entries($$_self_$$)) { - fn.__.id = ${s(remote.hash)} + '/' + name; - fn.__.name = name; - } - `; - - // Emit a dedicated entry chunk for this remote in SSR builds (prod only) - if (!dev_server) { - remote_original_by_hash.set(remote.hash, id); - if (!emitted_remote_hashes.has(remote.hash)) { - this.emitFile({ - type: 'chunk', - id: `\0sveltekit-remote:${remote.hash}`, - name: `remote-${remote.hash}` - }); - emitted_remote_hashes.add(remote.hash); - } - } - - return code; - } - - // For the client, read the exports and create a new module that only contains fetch functions with the correct metadata - - /** @type {Map} */ - const map = new Map(); - - // in dev, load the server module here (which will result in this hook - // being called again with `opts.ssr === true` if the module isn't - // already loaded) so we can determine what it exports - if (dev_server) { - const module = await dev_server.ssrLoadModule(id); - - for (const [name, value] of Object.entries(module)) { - const type = value?.__?.type; - if (type) { - map.set(name, type); - } - } - } - - // in prod, we already built and analysed the server code before - // building the client code, so `remote_exports` is populated - else if (build_metadata?.remotes) { - const exports = build_metadata?.remotes.get(remote.hash); - if (!exports) throw new Error('Expected to find metadata for remote file ' + id); - - for (const [name, value] of exports) { - map.set(name, value.type); - } - } - - let namespace = '__remote'; - let uid = 1; - while (map.has(namespace)) namespace = `__remote${uid++}`; - - const exports = Array.from(map).map(([name, type]) => { - return `export const ${name} = ${namespace}.${type}('${remote.hash}/${name}');`; - }); - - let result = `import * as ${namespace} from '__sveltekit/remote';\n\n${exports.join('\n')}\n`; - - if (dev_server) { - result += `\nimport.meta.hot?.accept();\n`; - } - - return { - code: result - }; - } - }; - - /** @type {Plugin} */ - const plugin_compile = { - name: 'vite-plugin-sveltekit-compile', - - /** - * Build the SvelteKit-provided Vite config to be merged with the user's vite.config.js file. - * @see https://vitejs.dev/guide/api-plugin.html#config - */ - config: { - // avoids overwriting the base setting that's also set by Vitest - order: 'pre', - handler(config) { - /** @type {UserConfig} */ - let new_config; - - const kit_paths_base = kit.paths.base || '/'; - - if (is_build) { - const ssr = /** @type {boolean} */ (config.build?.ssr); - const prefix = `${kit.appDir}/immutable`; - - /** @type {Record} */ - const input = {}; - - if (ssr) { - input.index = `${runtime_directory}/server/index.js`; - input.internal = `${kit.outDir}/generated/server/internal.js`; - input['remote-entry'] = `${runtime_directory}/app/server/remote/index.js`; - - // add entry points for every endpoint... - manifest_data.routes.forEach((route) => { - if (route.endpoint) { - const resolved = path.resolve(route.endpoint.file); - const relative = decodeURIComponent(path.relative(kit.files.routes, resolved)); - const name = posixify( - path.join('entries/endpoints', relative.replace(/\.js$/, '')) - ); - input[name] = resolved; - } - }); - - // ...and every component used by pages... - manifest_data.nodes.forEach((node) => { - for (const file of [node.component, node.universal, node.server]) { - if (file) { - const resolved = path.resolve(file); - const relative = decodeURIComponent(path.relative(kit.files.routes, resolved)); - - const name = relative.startsWith('..') - ? posixify(path.join('entries/fallbacks', path.basename(file))) - : posixify(path.join('entries/pages', relative.replace(/\.js$/, ''))); - input[name] = resolved; - } - } - }); - - // ...and every matcher - Object.entries(manifest_data.matchers).forEach(([key, file]) => { - const name = posixify(path.join('entries/matchers', key)); - input[name] = path.resolve(file); - }); - - // ...and the hooks files - if (manifest_data.hooks.server) { - input['entries/hooks.server'] = path.resolve(manifest_data.hooks.server); - } - if (manifest_data.hooks.universal) { - input['entries/hooks.universal'] = path.resolve(manifest_data.hooks.universal); - } - - // ...and the server instrumentation file - const server_instrumentation = resolve_entry( - path.join(kit.files.src, 'instrumentation.server') - ); - if (server_instrumentation) { - const { adapter } = kit; - if (adapter && !adapter.supports?.instrumentation?.()) { - throw new Error(`${server_instrumentation} is unsupported in ${adapter.name}.`); - } - if (!kit.experimental.instrumentation.server) { - error_for_missing_config( - '`instrumentation.server.js`', - 'kit.experimental.instrumentation.server', - 'true' - ); - } - input['instrumentation.server'] = server_instrumentation; - } - } else if (svelte_config.kit.output.bundleStrategy !== 'split') { - input['bundle'] = `${runtime_directory}/client/bundle.js`; - } else { - input['entry/start'] = `${runtime_directory}/client/entry.js`; - input['entry/app'] = `${kit.outDir}/generated/client-optimized/app.js`; - manifest_data.nodes.forEach((node, i) => { - if (node.component || node.universal) { - input[`nodes/${i}`] = `${kit.outDir}/generated/client-optimized/nodes/${i}.js`; - } - }); - } - - // see the kit.output.preloadStrategy option for details on why we have multiple options here - const ext = kit.output.preloadStrategy === 'preload-mjs' ? 'mjs' : 'js'; - - // We could always use a relative asset base path here, but it's better for performance not to. - // E.g. Vite generates `new URL('/asset.png', import.meta).href` for a relative path vs just '/asset.png'. - // That's larger and takes longer to run and also causes an HTML diff between SSR and client - // causing us to do a more expensive hydration check. - const client_base = - kit.paths.relative !== false || kit.paths.assets ? './' : kit_paths_base; - - const inline = !ssr && svelte_config.kit.output.bundleStrategy === 'inline'; - const split = ssr || svelte_config.kit.output.bundleStrategy === 'split'; - - new_config = { - base: ssr ? assets_base(kit) : client_base, - build: { - copyPublicDir: !ssr, - cssCodeSplit: svelte_config.kit.output.bundleStrategy !== 'inline', - cssMinify: - initial_config.build?.minify == null ? true : !!initial_config.build.minify, - manifest: true, - outDir: `${out}/${ssr ? 'server' : 'client'}`, - rollupOptions: { - input: inline ? input['bundle'] : input, - output: { - format: inline ? 'iife' : 'esm', - name: `__sveltekit_${version_hash}.app`, - entryFileNames: ssr ? '[name].js' : `${prefix}/[name].[hash].${ext}`, - chunkFileNames: ssr ? 'chunks/[name].js' : `${prefix}/chunks/[hash].${ext}`, - assetFileNames: `${prefix}/assets/[name].[hash][extname]`, - hoistTransitiveImports: false, - sourcemapIgnoreList, - inlineDynamicImports: is_rolldown ? undefined : !split - }, - preserveEntrySignatures: 'strict', - onwarn(warning, handler) { - if ( - (is_rolldown - ? warning.code === 'IMPORT_IS_UNDEFINED' - : warning.code === 'MISSING_EXPORT') && - warning.id === `${kit.outDir}/generated/client-optimized/app.js` - ) { - // ignore e.g. undefined `handleError` hook when - // referencing `client_hooks.handleError` - return; - } - - handler(warning); - } - }, - ssrEmitAssets: true, - target: ssr ? 'node18.13' : undefined - }, - publicDir: kit.files.assets, - worker: { - rollupOptions: { - output: { - entryFileNames: `${prefix}/workers/[name]-[hash].js`, - chunkFileNames: `${prefix}/workers/chunks/[hash].js`, - assetFileNames: `${prefix}/workers/assets/[name]-[hash][extname]`, - hoistTransitiveImports: false - } - } - } - }; - - // we must reference Vite 8 options conditionally. Otherwise, older Vite - // versions throw an error about unknown config options - if (is_rolldown && new_config?.build?.rollupOptions?.output) { - // @ts-ignore only available in Vite 8 - new_config.build.rollupOptions.output.codeSplitting = split; - } - } else { - new_config = { - appType: 'custom', - base: kit_paths_base, - build: { - rollupOptions: { - // Vite dependency crawler needs an explicit JS entry point - // even though server otherwise works without it - input: `${runtime_directory}/client/entry.js` - } - }, - publicDir: kit.files.assets - }; - } - - warn_overridden_config(config, new_config); - - return new_config; - } - }, - - /** - * Adds the SvelteKit middleware to do SSR in dev mode. - * @see https://vitejs.dev/guide/api-plugin.html#configureserver - */ - async configureServer(vite) { - return await dev(vite, vite_config, svelte_config, () => remotes); - }, - - /** - * Adds the SvelteKit middleware to do SSR in preview mode. - * @see https://vitejs.dev/guide/api-plugin.html#configurepreviewserver - */ - configurePreviewServer(vite) { - return preview(vite, vite_config, svelte_config); - }, - - /** - * Clears the output directories. - */ - buildStart() { - if (secondary_build_started) return; - - if (is_build) { - if (!vite_config.build.watch) { - rimraf(out); - } - mkdirp(out); - } - }, - - renderChunk(code, chunk) { - if (code.includes('__SVELTEKIT_TRACK__')) { - return { - // Rolldown changes our single quotes to double quotes so we need it in the regex too - code: code.replace(/__SVELTEKIT_TRACK__\(['"](.+?)['"]\)/g, (_, label) => { - (tracked_features[chunk.name + '.js'] ??= []).push(label); - // put extra whitespace at the end of the comment to preserve the source size and avoid interfering with source maps - return `/* track ${label} */`; - }), - map: null // TODO we may need to generate a sourcemap in future - }; - } - }, - - generateBundle() { - if (vite_config.build.ssr) return; - - this.emitFile({ - type: 'asset', - fileName: `${kit.appDir}/version.json`, - source: s({ version: kit.version.name }) - }); - }, - - /** - * Vite builds a single bundle. We need three bundles: client, server, and service worker. - * The user's package.json scripts will invoke the Vite CLI to execute the server build. We - * then use this hook to kick off builds for the client and service worker. - */ - writeBundle: { - sequential: true, - async handler(_options, server_bundle) { - if (secondary_build_started) return; // only run this once - - const verbose = vite_config.logLevel === 'info'; - const log = logger({ verbose }); - - /** @type {Manifest} */ - const server_manifest = JSON.parse(read(`${out}/server/.vite/manifest.json`)); - - /** @type {import('types').BuildData} */ - const build_data = { - app_dir: kit.appDir, - app_path: `${kit.paths.base.slice(1)}${kit.paths.base ? '/' : ''}${kit.appDir}`, - manifest_data, - out_dir: out, - service_worker: service_worker_entry_file ? 'service-worker.js' : null, // TODO make file configurable? - client: null, - server_manifest - }; - - const manifest_path = `${out}/server/manifest-full.js`; - fs.writeFileSync( - manifest_path, - `export const manifest = ${generate_manifest({ - build_data, - prerendered: [], - relative_path: '.', - routes: manifest_data.routes, - remotes - })};\n` - ); - - log.info('Analysing routes'); - - const { metadata } = await analyse({ - hash: kit.router.type === 'hash', - manifest_path, - manifest_data, - server_manifest, - tracked_features, - env: { ...env.private, ...env.public }, - out, - output_config: svelte_config.output, - remotes - }); - - build_metadata = metadata; - - log.info('Building app'); - - // create client build - write_client_manifest( - kit, - manifest_data, - `${kit.outDir}/generated/client-optimized`, - metadata.nodes - ); - - secondary_build_started = true; - - let client_chunks; - - try { - const bundle = /** @type {import('vite').Rollup.RollupOutput} */ ( - await vite.build({ - configFile: vite_config.configFile, - // CLI args - mode: vite_config_env.mode, - logLevel: vite_config.logLevel, - clearScreen: vite_config.clearScreen, - build: { - minify: initial_config.build?.minify, - assetsInlineLimit: vite_config.build.assetsInlineLimit, - sourcemap: vite_config.build.sourcemap - }, - optimizeDeps: { - force: vite_config.optimizeDeps.force - } - }) - ); - - client_chunks = bundle.output; - } catch (e) { - const error = - e instanceof Error ? e : new Error(/** @type {any} */ (e).message ?? e ?? ''); - - // without this, errors that occur during the secondary build - // will be logged twice - throw stackless(error.stack ?? error.message); - } - - // We use `build.ssrEmitAssets` so that asset URLs created from - // imports in server-only modules correspond to files in the build, - // but we don't want to copy over CSS imports as these are already - // accounted for in the client bundle. In most cases it would be - // a no-op, but for SSR builds `url(...)` paths are handled - // differently (relative for client, absolute for server) - // resulting in different hashes, and thus duplication - const ssr_stylesheets = new Set( - Object.values(server_manifest) - .map((chunk) => chunk.css ?? []) - .flat() - ); - - const assets_path = `${kit.appDir}/immutable/assets`; - const server_assets = `${out}/server/${assets_path}`; - const client_assets = `${out}/client/${assets_path}`; - - if (fs.existsSync(server_assets)) { - for (const file of fs.readdirSync(server_assets)) { - const src = `${server_assets}/${file}`; - const dest = `${client_assets}/${file}`; - - if (fs.existsSync(dest) || ssr_stylesheets.has(`${assets_path}/${file}`)) { - continue; - } - - if (file.endsWith('.css')) { - // make absolute paths in CSS relative, for portability - const content = fs - .readFileSync(src, 'utf-8') - .replaceAll(`${kit.paths.base}/${assets_path}`, '.'); - - fs.writeFileSync(src, content); - } - - copy(src, dest); - } - } - - /** @type {Manifest} */ - const client_manifest = JSON.parse(read(`${out}/client/.vite/manifest.json`)); - - /** - * @param {string} entry - * @param {boolean} [add_dynamic_css] - */ - const deps_of = (entry, add_dynamic_css = false) => - find_deps(client_manifest, posixify(path.relative('.', entry)), add_dynamic_css); - - if (svelte_config.kit.output.bundleStrategy === 'split') { - const start = deps_of(`${runtime_directory}/client/entry.js`); - const app = deps_of(`${kit.outDir}/generated/client-optimized/app.js`); - - build_data.client = { - start: start.file, - app: app.file, - imports: [...start.imports, ...app.imports], - stylesheets: [...start.stylesheets, ...app.stylesheets], - fonts: [...start.fonts, ...app.fonts], - uses_env_dynamic_public: client_chunks.some( - (chunk) => chunk.type === 'chunk' && chunk.modules[env_dynamic_public] - ) - }; - - // In case of server-side route resolution, we create a purpose-built route manifest that is - // similar to that on the client, with as much information computed upfront so that we - // don't need to include any code of the actual routes in the server bundle. - if (svelte_config.kit.router.resolution === 'server') { - const nodes = manifest_data.nodes.map((node, i) => { - if (node.component || node.universal) { - const entry = `${kit.outDir}/generated/client-optimized/nodes/${i}.js`; - const deps = deps_of(entry, true); - const file = resolve_symlinks( - client_manifest, - `${kit.outDir}/generated/client-optimized/nodes/${i}.js` - ).chunk.file; - - return { file, css: deps.stylesheets }; - } - }); - build_data.client.nodes = nodes.map((node) => node?.file); - build_data.client.css = nodes.map((node) => node?.css); - - build_data.client.routes = compact( - manifest_data.routes.map((route) => { - if (!route.page) return; - - return { - id: route.id, - pattern: route.pattern, - params: route.params, - layouts: route.page.layouts.map((l) => - l !== undefined ? [metadata.nodes[l].has_server_load, l] : undefined - ), - errors: route.page.errors, - leaf: [metadata.nodes[route.page.leaf].has_server_load, route.page.leaf] - }; - }) - ); - } - } else { - const start = deps_of(`${runtime_directory}/client/bundle.js`); - - build_data.client = { - start: start.file, - imports: start.imports, - stylesheets: start.stylesheets, - fonts: start.fonts, - uses_env_dynamic_public: client_chunks.some( - (chunk) => chunk.type === 'chunk' && chunk.modules[env_dynamic_public] - ) - }; - - if (svelte_config.kit.output.bundleStrategy === 'inline') { - const style = /** @type {import('vite').Rollup.OutputAsset} */ ( - client_chunks.find( - (chunk) => - chunk.type === 'asset' && - chunk.names.length === 1 && - chunk.names[0] === 'style.css' - ) - ); - - build_data.client.inline = { - script: read(`${out}/client/${start.file}`), - style: /** @type {string | undefined} */ (style?.source) - }; - } - } - - // regenerate manifest now that we have client entry... - fs.writeFileSync( - manifest_path, - `export const manifest = ${generate_manifest({ - build_data, - prerendered: [], - relative_path: '.', - routes: manifest_data.routes, - remotes - })};\n` - ); - - // regenerate nodes with the client manifest... - build_server_nodes( - out, - kit, - manifest_data, - server_manifest, - client_manifest, - assets_path, - client_chunks, - svelte_config.kit.output - ); - - // ...and prerender - const { prerendered, prerender_map } = await prerender({ - hash: kit.router.type === 'hash', - out, - manifest_path, - metadata, - verbose, - env: { ...env.private, ...env.public } - }); - - await treeshake_prerendered_remotes( - out, - remotes, - metadata, - cwd, - server_bundle, - vite_config.build.sourcemap - ); - - // generate a new manifest that doesn't include prerendered pages - fs.writeFileSync( - `${out}/server/manifest.js`, - `export const manifest = ${generate_manifest({ - build_data, - prerendered: prerendered.paths, - relative_path: '.', - routes: manifest_data.routes.filter((route) => prerender_map.get(route.id) !== true), - remotes - })};\n` - ); - - if (service_worker_entry_file) { - if (kit.paths.assets) { - throw new Error('Cannot use service worker alongside config.kit.paths.assets'); - } - - log.info('Building service worker'); - - await build_service_worker( - out, - kit, - { - ...vite_config, - build: { - ...vite_config.build, - minify: initial_config.build?.minify ?? true - } - }, - manifest_data, - service_worker_entry_file, - prerendered, - client_manifest - ); - } - - // we need to defer this to closeBundle, so that adapters copy files - // created by other Vite plugins - finalise = async () => { - console.log( - `\nRun ${colors - .bold() - .cyan('npm run preview')} to preview your production build locally.` - ); - - if (kit.adapter) { - const { adapt } = await import('../../core/adapt/index.js'); - await adapt( - svelte_config, - build_data, - metadata, - prerendered, - prerender_map, - log, - remotes, - vite_config - ); - } else { - console.log(colors.bold().yellow('\nNo adapter specified')); - - const link = colors.bold().cyan('https://svelte.dev/docs/kit/adapters'); - console.log( - `See ${link} to learn how to configure your app to run on the platform of your choosing` - ); - } - - secondary_build_started = false; - }; - } - }, - - /** - * Runs the adapter. - */ - closeBundle: { - sequential: true, - async handler() { - if (!vite_config.build.ssr) return; - await finalise?.(); - } - } - }; - - return [ - plugin_setup, - kit.experimental.remoteFunctions && plugin_remote, - plugin_virtual_modules, - plugin_guard, - plugin_compile - ].filter((p) => !!p); -} - -/** - * @param {UserConfig} config - * @param {UserConfig} resolved_config - */ -function warn_overridden_config(config, resolved_config) { - const overridden = find_overridden_config(config, resolved_config, enforced_config, '', []); - - if (overridden.length > 0) { - console.error( - colors.bold().red('The following Vite config options will be overridden by SvelteKit:') + - overridden.map((key) => `\n - ${key}`).join('') - ); - } -} - -/** - * @param {Record} config - * @param {Record} resolved_config - * @param {import('./types.js').EnforcedConfig} enforced_config - * @param {string} path - * @param {string[]} out used locally to compute the return value - */ -function find_overridden_config(config, resolved_config, enforced_config, path, out) { - if (config == null || resolved_config == null) { - return out; - } - - for (const key in enforced_config) { - if (typeof config === 'object' && key in config && key in resolved_config) { - const enforced = enforced_config[key]; - - if (enforced === true) { - if (config[key] !== resolved_config[key]) { - out.push(path + key); - } - } else { - find_overridden_config(config[key], resolved_config[key], enforced, path + key + '.', out); - } - } - } - return out; -} - -/** - * @param {import('types').ValidatedConfig} config - */ -const create_service_worker_module = (config) => dedent` - if (typeof self === 'undefined' || self instanceof ServiceWorkerGlobalScope === false) { - throw new Error('This module can only be imported inside a service worker'); - } - - export const build = []; - export const files = [ - ${create_assets(config) - .filter((asset) => config.kit.serviceWorker.files(asset.file)) - .map((asset) => `${s(`${config.kit.paths.base}/${asset.file}`)}`) - .join(',\n')} - ]; - export const prerendered = []; - export const version = ${s(config.kit.version.name)}; -`; diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/module_ids.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/module_ids.js deleted file mode 100644 index 69325f3..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/module_ids.js +++ /dev/null @@ -1,16 +0,0 @@ -import { fileURLToPath } from 'node:url'; -import { posixify } from '../../utils/filesystem.js'; - -export const env_static_private = '\0virtual:env/static/private'; -export const env_static_public = '\0virtual:env/static/public'; -export const env_dynamic_private = '\0virtual:env/dynamic/private'; -export const env_dynamic_public = '\0virtual:env/dynamic/public'; - -export const service_worker = '\0virtual:service-worker'; - -export const sveltekit_environment = '\0virtual:__sveltekit/environment'; -export const sveltekit_server = '\0virtual:__sveltekit/server'; - -export const app_server = posixify( - fileURLToPath(new URL('../../runtime/app/server/index.js', import.meta.url)) -); diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/preview/index.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/preview/index.js deleted file mode 100644 index 3b90084..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/preview/index.js +++ /dev/null @@ -1,265 +0,0 @@ -import fs from 'node:fs'; -import { join } from 'node:path'; -import { pathToFileURL } from 'node:url'; -import { lookup } from 'mrmime'; -import sirv from 'sirv'; -import { loadEnv, normalizePath } from 'vite'; -import { createReadableStream, getRequest, setResponse } from '../../../exports/node/index.js'; -import { installPolyfills } from '../../../exports/node/polyfills.js'; -import { SVELTE_KIT_ASSETS } from '../../../constants.js'; -import { is_chrome_devtools_request, not_found } from '../utils.js'; - -/** @typedef {import('http').IncomingMessage} Req */ -/** @typedef {import('http').ServerResponse} Res */ -/** @typedef {(req: Req, res: Res, next: () => void) => void} Handler */ - -/** - * @param {import('vite').PreviewServer} vite - * @param {import('vite').ResolvedConfig} vite_config - * @param {import('types').ValidatedConfig} svelte_config - */ -export async function preview(vite, vite_config, svelte_config) { - installPolyfills(); - - const { paths } = svelte_config.kit; - const base = paths.base; - const assets = paths.assets ? SVELTE_KIT_ASSETS : paths.base; - - const protocol = vite_config.preview.https ? 'https' : 'http'; - - const etag = `"${Date.now()}"`; - - const dir = join(svelte_config.kit.outDir, 'output/server'); - - if (!fs.existsSync(dir)) { - throw new Error(`Server files not found at ${dir}, did you run \`build\` first?`); - } - - const instrumentation = join(dir, 'instrumentation.server.js'); - if (fs.existsSync(instrumentation)) { - await import(pathToFileURL(instrumentation).href); - } - - /** @type {import('types').ServerInternalModule} */ - const { set_assets } = await import(pathToFileURL(join(dir, 'internal.js')).href); - - /** @type {import('types').ServerModule} */ - const { Server } = await import(pathToFileURL(join(dir, 'index.js')).href); - - const { manifest } = await import(pathToFileURL(join(dir, 'manifest.js')).href); - - set_assets(assets); - - const server = new Server(manifest); - await server.init({ - env: loadEnv(vite_config.mode, svelte_config.kit.env.dir, ''), - read: (file) => createReadableStream(`${dir}/${file}`) - }); - - const emulator = await svelte_config.kit.adapter?.emulate?.(); - - return () => { - // Remove the base middleware. It screws with the URL. - // It also only lets through requests beginning with the base path, so that requests beginning - // with the assets URL never reach us. We could serve assets separately before the base - // middleware, but we'd need that to occur after the compression and cors middlewares, so would - // need to insert it manually into the stack, which would be at least as bad as doing this. - for (let i = vite.middlewares.stack.length - 1; i > 0; i--) { - // @ts-expect-error using internals - if (vite.middlewares.stack[i].handle.name === 'viteBaseMiddleware') { - vite.middlewares.stack.splice(i, 1); - } - } - - // generated client assets and the contents of `static` - vite.middlewares.use( - scoped( - assets, - sirv(join(svelte_config.kit.outDir, 'output/client'), { - setHeaders: (res, pathname) => { - // only apply to immutable directory, not e.g. version.json - if (pathname.startsWith(`/${svelte_config.kit.appDir}/immutable`)) { - res.setHeader('cache-control', 'public,max-age=31536000,immutable'); - } - } - }) - ) - ); - - vite.middlewares.use((req, res, next) => { - const original_url = /** @type {string} */ (req.url); - const { pathname, search } = new URL(original_url, 'http://dummy'); - - // if `paths.base === '/a/b/c`, then the root route is `/a/b/c/`, - // regardless of the `trailingSlash` route option - if (base.length > 1 && pathname === base) { - let location = base + '/'; - if (search) location += search; - res.writeHead(307, { - location - }); - res.end(); - return; - } - - if (is_chrome_devtools_request(pathname, res)) { - return; - } - - if (pathname.startsWith(base)) { - next(); - } else { - res.statusCode = 404; - not_found(req, res, base); - } - }); - - // prerendered dependencies - vite.middlewares.use( - scoped(base, mutable(join(svelte_config.kit.outDir, 'output/prerendered/dependencies'))) - ); - - // prerendered pages (we can't just use sirv because we need to - // preserve the correct trailingSlash behaviour) - vite.middlewares.use( - scoped(base, (req, res, next) => { - let if_none_match_value = req.headers['if-none-match']; - - if (if_none_match_value?.startsWith('W/"')) { - if_none_match_value = if_none_match_value.substring(2); - } - - if (if_none_match_value === etag) { - res.statusCode = 304; - res.end(); - return; - } - - const { pathname, search } = new URL(/** @type {string} */ (req.url), 'http://dummy'); - - const dir = pathname.startsWith(`/${svelte_config.kit.appDir}/remote/`) ? 'data' : 'pages'; - - let filename = normalizePath( - join(svelte_config.kit.outDir, `output/prerendered/${dir}` + pathname) - ); - - try { - filename = decodeURI(filename); - } catch { - // malformed URI - } - - let prerendered = is_file(filename); - - if (!prerendered) { - const has_trailing_slash = pathname.endsWith('/'); - const html_filename = `${filename}${has_trailing_slash ? 'index.html' : '.html'}`; - - /** @type {string | undefined} */ - let redirect; - - if (is_file(html_filename)) { - filename = html_filename; - prerendered = true; - } else if (has_trailing_slash) { - if (is_file(filename.slice(0, -1) + '.html')) { - redirect = pathname.slice(0, -1); - } - } else if (is_file(filename + '/index.html')) { - redirect = pathname + '/'; - } - - if (redirect) { - if (search) redirect += search; - res.writeHead(307, { - location: redirect - }); - - res.end(); - - return; - } - } - - if (prerendered) { - res.writeHead(200, { - 'content-type': lookup(pathname) || 'text/html', - etag - }); - - fs.createReadStream(filename).pipe(res); - } else { - next(); - } - }) - ); - - // SSR - vite.middlewares.use(async (req, res) => { - const host = req.headers[':authority'] || req.headers.host; - - const request = await getRequest({ - base: `${protocol}://${host}`, - request: req - }); - - await setResponse( - res, - await server.respond(request, { - getClientAddress: () => { - const { remoteAddress } = req.socket; - if (remoteAddress) return remoteAddress; - throw new Error('Could not determine clientAddress'); - }, - read: (file) => { - if (file in manifest._.server_assets) { - return fs.readFileSync(join(dir, file)); - } - - return fs.readFileSync(join(svelte_config.kit.files.assets, file)); - }, - emulator - }) - ); - }); - }; -} - -/** - * @param {string} dir - * @returns {Handler} - */ -const mutable = (dir) => - fs.existsSync(dir) - ? sirv(dir, { - etag: true, - maxAge: 0 - }) - : (_req, _res, next) => next(); - -/** - * @param {string} scope - * @param {Handler} handler - * @returns {Handler} - */ -function scoped(scope, handler) { - if (scope === '') return handler; - - return (req, res, next) => { - if (req.url?.startsWith(scope)) { - const original_url = req.url; - req.url = req.url.slice(scope.length); - handler(req, res, () => { - req.url = original_url; - next(); - }); - } else { - next(); - } - }; -} - -/** @param {string} path */ -function is_file(path) { - return fs.existsSync(path) && !fs.statSync(path).isDirectory(); -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/index.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/index.js deleted file mode 100644 index 6d42480..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/index.js +++ /dev/null @@ -1,301 +0,0 @@ -import { tsPlugin } from '@sveltejs/acorn-typescript'; -import { Parser } from 'acorn'; -import { read } from '../../../utils/filesystem.js'; - -const valid_page_options_array = /** @type {const} */ ([ - 'ssr', - 'prerender', - 'csr', - 'trailingSlash', - 'config', - 'entries', - 'load' -]); - -/** @type {Set} */ -const valid_page_options = new Set(valid_page_options_array); - -/** @typedef {typeof valid_page_options_array[number]} ValidPageOption */ -/** @typedef {Partial>} PageOptions */ - -const skip_parsing_regex = new RegExp( - `${Array.from(valid_page_options).join('|')}|(?:export[\\s\\n]+\\*[\\s\\n]+from)` -); - -const parser = Parser.extend(tsPlugin()); - -/** - * Collects page options from a +page.js/+layout.js file, ignoring reassignments - * and using the declared value (except for load functions, for which the value is `true`). - * Returns `null` if any export is too difficult to analyse. - * @param {string} filename The name of the file to report when an error occurs - * @param {string} input - * @returns {PageOptions | null} - */ -export function statically_analyse_page_options(filename, input) { - // if there's a chance there are no page exports or an unparseable - // export all declaration, then we can skip the AST parsing which is expensive - if (!skip_parsing_regex.test(input)) { - return {}; - } - - try { - const source = parser.parse(input, { - sourceType: 'module', - ecmaVersion: 'latest' - }); - - /** @type {Map} */ - const page_options = new Map(); - - for (const statement of source.body) { - // ignore export all declarations with aliases that are not page options - if ( - statement.type === 'ExportAllDeclaration' && - statement.exported && - !valid_page_options.has(get_name(statement.exported)) - ) { - continue; - } - - if ( - statement.type === 'ExportDefaultDeclaration' || - statement.type === 'ExportAllDeclaration' - ) { - return null; - } else if (statement.type !== 'ExportNamedDeclaration') { - continue; - } - - if (statement.specifiers.length) { - /** @type {Map} */ - const export_specifiers = new Map(); - for (const specifier of statement.specifiers) { - const exported_name = get_name(specifier.exported); - if (!valid_page_options.has(exported_name)) { - continue; - } - - if (statement.source) { - return null; - } - - export_specifiers.set(get_name(specifier.local), exported_name); - } - - for (const statement of source.body) { - switch (statement.type) { - case 'ImportDeclaration': { - for (const import_specifier of statement.specifiers) { - if (export_specifiers.has(import_specifier.local.name)) { - return null; - } - } - break; - } - case 'ExportNamedDeclaration': - case 'VariableDeclaration': - case 'FunctionDeclaration': - case 'ClassDeclaration': { - const declaration = - statement.type === 'ExportNamedDeclaration' ? statement.declaration : statement; - - if (!declaration) { - break; - } - - // class and function declarations - if (declaration.type !== 'VariableDeclaration') { - if (export_specifiers.has(declaration.id.name)) { - return null; - } - break; - } - - for (const variable_declarator of declaration.declarations) { - if ( - variable_declarator.id.type !== 'Identifier' || - !export_specifiers.has(variable_declarator.id.name) - ) { - continue; - } - - if (variable_declarator.init?.type === 'Literal') { - page_options.set( - /** @type {string} */ (export_specifiers.get(variable_declarator.id.name)), - variable_declarator.init.value - ); - export_specifiers.delete(variable_declarator.id.name); - continue; - } - - // Special case: We only want to know that 'load' is exported (in a way that doesn't cause truthy checks in other places to trigger) - if (variable_declarator.id.name === 'load') { - page_options.set('load', null); - export_specifiers.delete('load'); - continue; - } - - // references a declaration we can't easily evaluate statically - return null; - } - break; - } - } - } - - // there were some export specifiers that we couldn't resolve - if (export_specifiers.size) { - return null; - } - continue; - } - - if (!statement.declaration) { - continue; - } - - // class and function declarations - if (statement.declaration.type !== 'VariableDeclaration') { - if (valid_page_options.has(statement.declaration.id.name)) { - // Special case: We only want to know that 'load' is exported (in a way that doesn't cause truthy checks in other places to trigger) - if (statement.declaration.id.name === 'load') { - page_options.set('load', null); - } else { - return null; - } - } - continue; - } - - for (const declaration of statement.declaration.declarations) { - if (declaration.id.type !== 'Identifier') { - return null; - } - - if (!valid_page_options.has(declaration.id.name)) { - continue; - } - - if (declaration.init?.type === 'Literal') { - page_options.set(declaration.id.name, declaration.init.value); - continue; - } - - // Special case: We only want to know that 'load' is exported (in a way that doesn't cause truthy checks in other places to trigger) - if (declaration.id.name === 'load') { - page_options.set('load', null); - continue; - } - - // references a declaration we can't easily evaluate statically - return null; - } - } - - return Object.fromEntries(page_options); - } catch (error) { - if (error instanceof Error) { - error.message = `Failed to statically analyse page options for ${filename}. ${error.message}`; - } - throw error; - } -} - -/** - * @param {import('acorn').Identifier | import('acorn').Literal} node - * @returns {string} - */ -function get_name(node) { - return node.type === 'Identifier' ? node.name : /** @type {string} */ (node.value); -} - -/** - * Reads and statically analyses a file for page options - * @param {string} filepath - * @returns {PageOptions | null} Returns the page options for the file or `null` if unanalysable - */ -export function get_page_options(filepath) { - try { - const input = read(filepath); - const page_options = statically_analyse_page_options(filepath, input); - if (page_options === null) { - return null; - } - - return page_options; - } catch { - return null; - } -} - -export function create_node_analyser() { - const static_exports = new Map(); - - /** - * @param {string | undefined} key - * @param {PageOptions | null} page_options - */ - const cache = (key, page_options) => { - if (key) static_exports.set(key, { page_options, children: [] }); - }; - - /** - * Computes the final page options (may include load function as `load: null`; special case) for a node (if possible). Otherwise, returns `null`. - * @param {import('types').PageNode} node - * @returns {PageOptions | null} - */ - const crawl = (node) => { - const key = node.universal || node.server; - if (key && static_exports.has(key)) { - return { ...static_exports.get(key)?.page_options }; - } - - /** @type {PageOptions} */ - let page_options = {}; - - if (node.parent) { - const parent_options = crawl(node.parent); - - const parent_key = node.parent.universal || node.parent.server; - if (key && parent_key) { - static_exports.get(parent_key)?.children.push(key); - } - - if (parent_options === null) { - // if the parent cannot be analysed, we can't know what page options - // the child node inherits, so we also mark it as unanalysable - cache(key, null); - return null; - } - - page_options = { ...parent_options }; - } - - if (node.server) { - const server_page_options = get_page_options(node.server); - if (server_page_options === null) { - cache(key, null); - return null; - } - page_options = { ...page_options, ...server_page_options }; - } - - if (node.universal) { - const universal_page_options = get_page_options(node.universal); - if (universal_page_options === null) { - cache(key, null); - return null; - } - page_options = { ...page_options, ...universal_page_options }; - } - - cache(key, page_options); - - return page_options; - }; - - return { - get_page_options: crawl - }; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/utils.js b/frontend/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/utils.js deleted file mode 100644 index c39cc06..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/utils.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Check if content has children rendering (slot, @render, or children prop forwarding) - * @param {string} content - The markup content - * @param {boolean} is_svelte_5_plus - Whether the project uses Svelte 5+ - * @returns {boolean} - */ -export function has_children(content, is_svelte_5_plus) { - return ( - content.includes('') { - in_html_comment = false; - i += 2; // Skip the '-->' part - continue; - } - - // If we're in any comment, skip processing - if (in_single_line_comment || in_multi_line_comment || in_html_comment) { - continue; - } - - // Handle escape sequences in strings - if ((in_single_quote || in_double_quote || in_template_literal) && char === '\\') { - i++; // Skip the escaped character - continue; - } - - // Handle string boundaries - if (!in_double_quote && !in_template_literal && char === "'") { - in_single_quote = !in_single_quote; - continue; - } - - if (!in_single_quote && !in_template_literal && char === '"') { - in_double_quote = !in_double_quote; - continue; - } - - if (!in_single_quote && !in_double_quote && char === '`') { - in_template_literal = !in_template_literal; - continue; - } - - // If we're inside any string, don't process comment delimiters - if (in_single_quote || in_double_quote || in_template_literal) { - continue; - } - - // Check for comment starts - if (next_two === '//') { - in_single_line_comment = true; - i++; // Skip the second '/' - continue; - } - - if (next_two === '/*') { - in_multi_line_comment = true; - i++; // Skip the '*' - continue; - } - - if (next_four === ' - * - * - *

Currently at {page.url.pathname}

- * - * {#if page.error} - * Problem detected - * {:else} - * All systems operational - * {/if} - * ``` - * - * Changes to `page` are available exclusively with runes. (The legacy reactivity syntax will not reflect any changes) - * - * ```svelte - * - * - * ``` - * - * On the server, values can only be read during rendering (in other words _not_ in e.g. `load` functions). In the browser, the values can be read at any time. - * - * @type {import('@sveltejs/kit').Page} - */ -export const page = BROWSER ? client_page : server_page; - -/** - * A read-only object representing an in-progress navigation, with `from`, `to`, `type` and (if `type === 'popstate'`) `delta` properties. - * Values are `null` when no navigation is occurring, or during server rendering. - * @type {import('@sveltejs/kit').Navigation | { from: null, to: null, type: null, willUnload: null, delta: null, complete: null }} - */ -// @ts-expect-error -export const navigating = BROWSER ? client_navigating : server_navigating; - -/** - * A read-only reactive value that's initially `false`. If [`version.pollInterval`](https://svelte.dev/docs/kit/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update `current` to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling. - * @type {{ get current(): boolean; check(): Promise; }} - */ -export const updated = BROWSER ? client_updated : server_updated; diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/app/state/server.js b/frontend/node_modules/@sveltejs/kit/src/runtime/app/state/server.js deleted file mode 100644 index 0be1693..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/app/state/server.js +++ /dev/null @@ -1,63 +0,0 @@ -import { DEV } from 'esm-env'; -import { getContext } from 'svelte'; - -function context() { - return getContext('__request__'); -} - -/** @param {string} name */ -function context_dev(name) { - try { - return context(); - } catch { - throw new Error( - `Can only read '${name}' on the server during rendering (not in e.g. \`load\` functions), as it is bound to the current request via component context. This prevents state from leaking between users. ` + - 'For more information, see https://svelte.dev/docs/kit/state-management#avoid-shared-state-on-the-server' - ); - } -} - -export const page = { - get data() { - return (DEV ? context_dev('page.data') : context()).page.data; - }, - get error() { - return (DEV ? context_dev('page.error') : context()).page.error; - }, - get form() { - return (DEV ? context_dev('page.form') : context()).page.form; - }, - get params() { - return (DEV ? context_dev('page.params') : context()).page.params; - }, - get route() { - return (DEV ? context_dev('page.route') : context()).page.route; - }, - get state() { - return (DEV ? context_dev('page.state') : context()).page.state; - }, - get status() { - return (DEV ? context_dev('page.status') : context()).page.status; - }, - get url() { - return (DEV ? context_dev('page.url') : context()).page.url; - } -}; - -export const navigating = { - from: null, - to: null, - type: null, - willUnload: null, - delta: null, - complete: null -}; - -export const updated = { - get current() { - return false; - }, - check: () => { - throw new Error('Can only call updated.check() in the browser'); - } -}; diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/app/stores.js b/frontend/node_modules/@sveltejs/kit/src/runtime/app/stores.js deleted file mode 100644 index 11e84fe..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/app/stores.js +++ /dev/null @@ -1,101 +0,0 @@ -import { getContext } from 'svelte'; -import { BROWSER, DEV } from 'esm-env'; -import { stores as browser_stores } from '../client/client.js'; - -/** - * A function that returns all of the contextual stores. On the server, this must be called during component initialization. - * Only use this if you need to defer store subscription until after the component has mounted, for some reason. - * - * @deprecated Use `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) - */ -export const getStores = () => { - const stores = BROWSER ? browser_stores : getContext('__svelte__'); - - return { - /** @type {typeof page} */ - page: { - subscribe: stores.page.subscribe - }, - /** @type {typeof navigating} */ - navigating: { - subscribe: stores.navigating.subscribe - }, - /** @type {typeof updated} */ - updated: stores.updated - }; -}; - -/** - * A readable store whose value contains page data. - * - * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. - * - * @deprecated Use `page` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) - * @type {import('svelte/store').Readable} - */ -export const page = { - subscribe(fn) { - const store = DEV ? get_store('page') : getStores().page; - return store.subscribe(fn); - } -}; - -/** - * A readable store. - * When navigating starts, its value is a `Navigation` object with `from`, `to`, `type` and (if `type === 'popstate'`) `delta` properties. - * When navigating finishes, its value reverts to `null`. - * - * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. - * - * @deprecated Use `navigating` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) - * @type {import('svelte/store').Readable} - */ -export const navigating = { - subscribe(fn) { - const store = DEV ? get_store('navigating') : getStores().navigating; - return store.subscribe(fn); - } -}; - -/** - * A readable store whose initial value is `false`. If [`version.pollInterval`](https://svelte.dev/docs/kit/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update the store value to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling. - * - * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. - * - * @deprecated Use `updated` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) - * @type {import('svelte/store').Readable & { check(): Promise }} - */ -export const updated = { - subscribe(fn) { - const store = DEV ? get_store('updated') : getStores().updated; - - if (BROWSER) { - updated.check = store.check; - } - - return store.subscribe(fn); - }, - check: () => { - throw new Error( - BROWSER - ? 'Cannot check updated store before subscribing' - : 'Can only check updated store in browser' - ); - } -}; - -/** - * @template {keyof ReturnType} Name - * @param {Name} name - * @returns {ReturnType[Name]} - */ -function get_store(name) { - try { - return getStores()[name]; - } catch { - throw new Error( - `Cannot subscribe to '${name}' store on the server outside of a Svelte component, as it is bound to the current request via component context. This prevents state from leaking between users.` + - 'For more information, see https://svelte.dev/docs/kit/state-management#avoid-shared-state-on-the-server' - ); - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/client/bundle.js b/frontend/node_modules/@sveltejs/kit/src/runtime/client/bundle.js deleted file mode 100644 index f375d02..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/client/bundle.js +++ /dev/null @@ -1,17 +0,0 @@ -/* if `bundleStrategy` is 'single' or 'inline', this file is used as the entry point */ - -import * as kit from './entry.js'; - -// @ts-expect-error -import * as app from '__sveltekit/manifest'; - -/** - * - * @param {HTMLElement} element - * @param {import('./types.js').HydrateOptions} options - */ -export function start(element, options) { - void kit.start(app, element, options); -} - -export { app }; diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/client/client.js b/frontend/node_modules/@sveltejs/kit/src/runtime/client/client.js deleted file mode 100644 index c523549..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/client/client.js +++ /dev/null @@ -1,3333 +0,0 @@ -/** @import { RemoteQueryCacheEntry } from './remote-functions/query.svelte.js' */ -import { BROWSER, DEV } from 'esm-env'; -import * as svelte from 'svelte'; -import { HttpError, Redirect, SvelteKitError } from '@sveltejs/kit/internal'; -const { onMount, tick } = svelte; -// Svelte 4 and under don't have `untrack`, so we have to fallback if `untrack` is not exported -const untrack = svelte.untrack ?? ((value) => value()); -import { - decode_params, - decode_pathname, - strip_hash, - make_trackable, - normalize_path -} from '../../utils/url.js'; -import { dev_fetch, initial_fetch, lock_fetch, subsequent_fetch, unlock_fetch } from './fetcher.js'; -import { parse, parse_server_route } from './parse.js'; -import * as storage from './session-storage.js'; -import { - find_anchor, - resolve_url, - get_link_info, - get_router_options, - is_external_url, - origin, - scroll_state, - notifiable_store, - create_updated_store, - load_css -} from './utils.js'; -import { base } from '$app/paths'; -import * as devalue from 'devalue'; -import { - HISTORY_INDEX, - NAVIGATION_INDEX, - PRELOAD_PRIORITIES, - SCROLL_KEY, - STATES_KEY, - SNAPSHOT_KEY, - PAGE_URL_KEY -} from './constants.js'; -import { validate_page_exports } from '../../utils/exports.js'; -import { noop } from '../../utils/functions.js'; -import { compact } from '../../utils/array.js'; -import { - INVALIDATED_PARAM, - TRAILING_SLASH_PARAM, - validate_depends, - validate_load_response -} from '../shared.js'; -import { get_message, get_status } from '../../utils/error.js'; -import { writable } from 'svelte/store'; -import { page, update, navigating } from './state.svelte.js'; -import { add_data_suffix, add_resolution_suffix } from '../pathname.js'; -import { noop_span } from '../telemetry/noop.js'; -import { text_decoder } from '../utils.js'; - -export { load_css }; -const ICON_REL_ATTRIBUTES = new Set(['icon', 'shortcut icon', 'apple-touch-icon']); - -let errored = false; -/** - * Set via transformError, reset and read at the end of navigate. - * Necessary because a navigation might succeed loading but during rendering - * an error occurs, at which point the navigation result needs to be overridden with the error result. - * TODO this is all very hacky, rethink for SvelteKit 3 where we can assume Svelte 5 and do an overhaul of client.js - * @type {{ error: App.Error, status: number } | null} - */ -let rendering_error = null; - -// We track the scroll position associated with each history entry in sessionStorage, -// rather than on history.state itself, because when navigation is driven by -// popstate it's too late to update the scroll position associated with the -// state we're navigating from -/** - * history index -> { x, y } - * @type {Record} - */ -const scroll_positions = storage.get(SCROLL_KEY) ?? {}; - -/** - * navigation index -> any - * @type {Record} - */ -const snapshots = storage.get(SNAPSHOT_KEY) ?? {}; - -if (DEV && BROWSER) { - let warned = false; - - const current_module_url = import.meta.url.split('?')[0]; // remove query params that vite adds to the URL when it is loaded from node_modules - - const warn = () => { - if (warned) return; - - // Rather than saving a pointer to the original history methods, which would prevent monkeypatching by other libs, - // inspect the stack trace to see if we're being called from within SvelteKit. - let stack = new Error().stack?.split('\n'); - if (!stack) return; - if (!stack[0].includes('https:') && !stack[0].includes('http:')) stack = stack.slice(1); // Chrome includes the error message in the stack - stack = stack.slice(2); // remove `warn` and the place where `warn` was called - // Can be falsy if was called directly from an anonymous function - if (stack[0]?.includes(current_module_url)) return; - - warned = true; - - console.warn( - "Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead." - ); - }; - - const push_state = history.pushState; - history.pushState = (...args) => { - warn(); - return push_state.apply(history, args); - }; - - const replace_state = history.replaceState; - history.replaceState = (...args) => { - warn(); - return replace_state.apply(history, args); - }; -} - -export const stores = { - url: /* @__PURE__ */ notifiable_store({}), - page: /* @__PURE__ */ notifiable_store({}), - navigating: /* @__PURE__ */ writable( - /** @type {import('@sveltejs/kit').Navigation | null} */ (null) - ), - updated: /* @__PURE__ */ create_updated_store() -}; - -/** @param {number} index */ -function update_scroll_positions(index) { - scroll_positions[index] = scroll_state(); -} - -/** - * @param {number} current_history_index - * @param {number} current_navigation_index - */ -function clear_onward_history(current_history_index, current_navigation_index) { - // if we navigated back, then pushed a new state, we can - // release memory by pruning the scroll/snapshot lookup - let i = current_history_index + 1; - while (scroll_positions[i]) { - delete scroll_positions[i]; - i += 1; - } - - i = current_navigation_index + 1; - while (snapshots[i]) { - delete snapshots[i]; - i += 1; - } -} - -/** - * Loads `href` the old-fashioned way, with a full page reload. - * Returns a `Promise` that never resolves (to prevent any - * subsequent work, e.g. history manipulation, from happening) - * @param {URL} url - * @param {boolean} [replace] If `true`, will replace the current `history` entry rather than creating a new one with `pushState` - */ -function native_navigation(url, replace = false) { - if (replace) { - location.replace(url.href); - } else { - location.href = url.href; - } - return new Promise(noop); -} - -/** - * Checks whether a service worker is registered, and if it is, - * tries to update it. - */ -async function update_service_worker() { - if ('serviceWorker' in navigator) { - const registration = await navigator.serviceWorker.getRegistration(base || '/'); - if (registration) { - await registration.update(); - } - } -} - -/** @type {import('types').CSRRoute[]} All routes of the app. Only available when kit.router.resolution=client */ -let routes; -/** @type {import('types').CSRPageNodeLoader} */ -let default_layout_loader; -/** @type {import('types').CSRPageNodeLoader} */ -let default_error_loader; -/** @type {HTMLElement} */ -let container; -/** @type {HTMLElement} */ -let target; - -/** @type {import('./types.js').SvelteKitApp} */ -export let app; - -/** - * Data that was serialized during SSR for queries/forms/commands. - * This is cleared before client-side loads run. - * @type {Record} - */ -export let query_responses = {}; - -/** - * Data that was serialized during SSR for prerender functions. - * This persists across client-side navigations. - * @type {Record} - */ -export let prerender_responses = {}; - -/** @type {Array<((url: URL) => boolean)>} */ -const invalidated = []; - -/** - * An array of the `+layout.svelte` and `+page.svelte` component instances - * that currently live on the page — used for capturing and restoring snapshots. - * It's updated/manipulated through `bind:this` in `Root.svelte`. - * @type {import('svelte').SvelteComponent[]} - */ -const components = []; - -/** @type {{id: string, token: {}, promise: Promise, fork: Promise | null} | null} */ -let load_cache = null; - -function discard_load_cache() { - void load_cache?.fork?.then((f) => f?.discard()); - load_cache = null; -} - -/** - * @type {Map>} - * Cache for client-side rerouting, since it could contain async calls which we want to - * avoid running multiple times which would slow down navigations (e.g. else preloading - * wouldn't help because on navigation it would be called again). Since `reroute` should be - * a pure function (i.e. always return the same) value it's safe to cache across navigations. - * The server reroute calls don't need to be cached because they are called using `import(...)` - * which is cached per the JS spec. - */ -const reroute_cache = new Map(); - -/** - * Note on before_navigate_callbacks, on_navigate_callbacks and after_navigate_callbacks: - * do not re-assign as some closures keep references to these Sets - */ -/** @type {Set<(navigation: import('@sveltejs/kit').BeforeNavigate) => void>} */ -const before_navigate_callbacks = new Set(); - -/** @type {Set<(navigation: import('@sveltejs/kit').OnNavigate) => import('types').MaybePromise<(() => void) | void>>} */ -const on_navigate_callbacks = new Set(); - -/** @type {Set<(navigation: import('@sveltejs/kit').AfterNavigate) => void>} */ -const after_navigate_callbacks = new Set(); - -/** @type {import('./types.js').NavigationState & { nav: import('@sveltejs/kit').NavigationEvent }} */ -let current = { - branch: [], - error: null, - // @ts-ignore - we need the initial value to be null - url: null, - // @ts-ignore - we need the initial value to be null - nav: null -}; - -/** this being true means we SSR'd */ -let hydrated = false; -let started = false; -let autoscroll = true; -let updating = false; -let is_navigating = false; -let hash_navigating = false; -/** True as soon as there happened one client-side navigation (excluding the SvelteKit-initialized initial one when in SPA mode) */ -let has_navigated = false; - -let force_invalidation = false; - -/** @type {import('svelte').SvelteComponent} */ -let root; - -/** @type {number} keeping track of the history index in order to prevent popstate navigation events if needed */ -let current_history_index; - -/** @type {number} */ -let current_navigation_index; - -/** @type {{}} */ -let token; - -/** - * A set of tokens which are associated to current preloads. - * If a preload becomes a real navigation, it's removed from the set. - * If a preload token is in the set and the preload errors, the error - * handling logic (for example reloading) is skipped. - */ -const preload_tokens = new Set(); - -/** @type {Promise | null} */ -export let pending_invalidate; - -/** - * @type {Map>>} - * A map of query id -> payload -> query internals for all active queries. - */ -export const query_map = new Map(); - -/** - * @param {import('./types.js').SvelteKitApp} _app - * @param {HTMLElement} _target - * @param {Parameters[1]} [hydrate] - */ -export async function start(_app, _target, hydrate) { - if (DEV && _target === document.body) { - console.warn( - 'Placing %sveltekit.body% directly inside is not recommended, as your app may break for users who have certain browser extensions installed.\n\nConsider wrapping it in an element:\n\n
\n %sveltekit.body%\n
' - ); - } - - if (__SVELTEKIT_PAYLOAD__) { - query_responses = __SVELTEKIT_PAYLOAD__.query ?? {}; - prerender_responses = __SVELTEKIT_PAYLOAD__.prerender ?? {}; - } - - // detect basic auth credentials in the current URL - // https://github.com/sveltejs/kit/pull/11179 - // if so, refresh the page without credentials - if (document.URL !== location.href) { - // eslint-disable-next-line no-self-assign - location.href = location.href; - } - - app = _app; - - await _app.hooks.init?.(); - - routes = __SVELTEKIT_CLIENT_ROUTING__ ? parse(_app) : []; - container = __SVELTEKIT_EMBEDDED__ ? _target : document.documentElement; - target = _target; - - // we import the root layout/error nodes eagerly, so that - // connectivity errors after initialisation don't nuke the app - default_layout_loader = _app.nodes[0]; - default_error_loader = _app.nodes[1]; - void default_layout_loader(); - void default_error_loader(); - - current_history_index = history.state?.[HISTORY_INDEX]; - current_navigation_index = history.state?.[NAVIGATION_INDEX]; - - if (!current_history_index) { - // we use Date.now() as an offset so that cross-document navigations - // within the app don't result in data loss - current_history_index = current_navigation_index = Date.now(); - - // create initial history entry, so we can return here - history.replaceState( - { - ...history.state, - [HISTORY_INDEX]: current_history_index, - [NAVIGATION_INDEX]: current_navigation_index - }, - '' - ); - } - - // if we reload the page, or Cmd-Shift-T back to it, - // recover scroll position - const scroll = scroll_positions[current_history_index]; - function restore_scroll() { - if (scroll) { - history.scrollRestoration = 'manual'; - scrollTo(scroll.x, scroll.y); - } - } - - if (hydrate) { - restore_scroll(); - - await _hydrate(target, hydrate); - } else { - await navigate({ - type: 'enter', - url: resolve_url(app.hash ? decode_hash(new URL(location.href)) : location.href), - replace_state: true - }); - - restore_scroll(); - } - - _start_router(); -} - -async function _invalidate(include_load_functions = true, reset_page_state = true) { - // Accept all invalidations as they come, don't swallow any while another invalidation - // is running because subsequent invalidations may make earlier ones outdated, - // but batch multiple synchronous invalidations. - await (pending_invalidate ||= Promise.resolve()); - if (!pending_invalidate) return; - pending_invalidate = null; - - const nav_token = (token = {}); - const intent = await get_navigation_intent(current.url, true); - - // Clear preload, it might be affected by the invalidation. - // Also solves an edge case where a preload is triggered, the navigation for it - // was then triggered and is still running while the invalidation kicks in, - // at which point the invalidation should take over and "win". - discard_load_cache(); - - // Rerun queries - if (force_invalidation) { - query_map.forEach((entries) => { - entries.forEach(({ resource }) => { - void resource.refresh?.(); - }); - }); - } - - if (include_load_functions) { - const prev_state = page.state; - const navigation_result = intent && (await load_route(intent)); - if (!navigation_result || nav_token !== token) return; - - if (navigation_result.type === 'redirect') { - return _goto( - new URL(navigation_result.location, current.url).href, - { replaceState: true }, - 1, - nav_token - ); - } - - // This is a bit hacky but allows us not having to pass that boolean around, making things harder to reason about - if (!reset_page_state) { - navigation_result.props.page.state = prev_state; - } - update(navigation_result.props.page); - current = { ...navigation_result.state, nav: current.nav }; - reset_invalidation(); - root.$set(navigation_result.props); - } else { - reset_invalidation(); - } - - // Don't use allSettled yet because it's too new - await Promise.all( - [...query_map.values()].flatMap((entries) => - [...entries.values()].map(({ resource }) => resource) - ) - ).catch(noop); -} - -function reset_invalidation() { - invalidated.length = 0; - force_invalidation = false; -} - -/** @param {number} index */ -function capture_snapshot(index) { - if (components.some((c) => c?.snapshot)) { - snapshots[index] = components.map((c) => c?.snapshot?.capture()); - } -} - -/** @param {number} index */ -function restore_snapshot(index) { - snapshots[index]?.forEach((value, i) => { - components[i]?.snapshot?.restore(value); - }); -} - -function persist_state() { - update_scroll_positions(current_history_index); - storage.set(SCROLL_KEY, scroll_positions); - - capture_snapshot(current_navigation_index); - storage.set(SNAPSHOT_KEY, snapshots); -} - -/** - * @param {string | URL} url - * @param {{ replaceState?: boolean; noScroll?: boolean; keepFocus?: boolean; invalidateAll?: boolean; invalidate?: Array boolean)>; state?: Record }} options - * @param {number} redirect_count - * @param {{}} [nav_token] - */ -export async function _goto(url, options, redirect_count, nav_token) { - /** @type {string[]} */ - let query_keys; - - // Clear preload cache when invalidateAll is true to ensure fresh data - // after form submissions or explicit invalidations - if (options.invalidateAll) { - discard_load_cache(); - } - - await navigate({ - type: 'goto', - url: resolve_url(url), - keepfocus: options.keepFocus, - noscroll: options.noScroll, - replace_state: options.replaceState, - state: options.state, - redirect_count, - nav_token, - accept: () => { - if (options.invalidateAll) { - force_invalidation = true; - query_keys = []; - query_map.forEach((entries, id) => { - for (const payload of entries.keys()) { - query_keys.push(id + '/' + payload); - } - }); - } - - if (options.invalidate) { - options.invalidate.forEach(push_invalidated); - } - } - }); - - if (options.invalidateAll) { - // TODO the ticks shouldn't be necessary, something inside Svelte itself is buggy - // when a query in a layout that still exists after page change is refreshed earlier than this - void svelte - .tick() - .then(svelte.tick) - .then(() => { - query_map.forEach((entries, id) => { - entries.forEach(({ resource }, payload) => { - if (query_keys?.includes(id + '/' + payload)) { - void resource.refresh?.(); - } - }); - }); - }); - } -} - -/** @param {import('./types.js').NavigationIntent} intent */ -async function _preload_data(intent) { - // Reuse the existing pending preload if it's for the same navigation. - // Prevents an edge case where same preload is triggered multiple times, - // then a later one is becoming the real navigation and the preload tokens - // get out of sync. - if (intent.id !== load_cache?.id) { - discard_load_cache(); - - const preload = {}; - preload_tokens.add(preload); - load_cache = { - id: intent.id, - token: preload, - promise: load_route({ ...intent, preload }).then((result) => { - preload_tokens.delete(preload); - if (result.type === 'loaded' && result.state.error) { - // Don't cache errors, because they might be transient - discard_load_cache(); - } - return result; - }), - fork: null - }; - - if (__SVELTEKIT_FORK_PRELOADS__ && svelte.fork) { - const lc = load_cache; - - lc.fork = lc.promise.then((result) => { - // if load_cache was discarded before load_cache.promise could - // resolve, bail rather than creating an orphan fork - if (lc === load_cache && result.type === 'loaded') { - try { - return svelte.fork(() => { - root.$set(result.props); - update(result.props.page); - }); - } catch { - // if it errors, it's because the experimental flag isn't enabled in Svelte - } - } - - return null; - }); - } - } - - return load_cache.promise; -} - -/** - * @param {URL} url - * @returns {Promise} - */ -async function _preload_code(url) { - const route = (await get_navigation_intent(url, false))?.route; - - if (route) { - await Promise.all( - /** @type {[has_server_load: boolean, node_loader: import('types').CSRPageNodeLoader][]} */ ( - [...route.layouts, route.leaf].filter(Boolean) - ).map((load) => load[1]()) - ); - } -} - -/** - * @param {import('./types.js').NavigationFinished} result - * @param {HTMLElement} target - * @param {boolean} hydrate - */ -async function initialize(result, target, hydrate) { - if (DEV && result.state.error && document.querySelector('vite-error-overlay')) return; - - /** @type {import('@sveltejs/kit').NavigationEvent} */ - const nav = { - params: current.params, - route: { id: current.route?.id ?? null }, - url: new URL(location.href) - }; - - current = { - ...result.state, - nav - }; - - const style = document.querySelector('style[data-sveltekit]'); - if (style) style.remove(); - - Object.assign(page, /** @type {import('@sveltejs/kit').Page} */ (result.props.page)); - - root = new app.root({ - target, - props: { ...result.props, stores, components }, - hydrate, - // @ts-ignore Svelte 5 specific: asynchronously instantiate the component, i.e. don't call flushSync - sync: false, - // @ts-ignore Svelte 5 specific: transformError allows to transform errors before they are passed to boundaries - transformError: __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__ - ? /** @param {unknown} e */ async (e) => { - const error = await handle_error(e, current.nav); - rendering_error = { error, status: get_status(e) }; - page.error = error; - page.status = rendering_error.status; - return error; - } - : undefined - }); - - // Wait for a microtask in case svelte experimental async is enabled, - // which causes component script blocks to run asynchronously - void (await Promise.resolve()); - - restore_snapshot(current_navigation_index); - - if (hydrate) { - /** @type {import('@sveltejs/kit').AfterNavigate} */ - const navigation = { - from: null, - to: { - ...nav, - scroll: scroll_positions[current_history_index] ?? scroll_state() - }, - willUnload: false, - type: 'enter', - complete: Promise.resolve() - }; - - after_navigate_callbacks.forEach((fn) => fn(navigation)); - } - - started = true; -} - -/** - * - * @param {{ - * url: URL; - * params: Record; - * branch: Array; - * errors?: Array; - * status: number; - * error: App.Error | null; - * route: import('types').CSRRoute | null; - * form?: Record | null; - * }} opts - */ -async function get_navigation_result_from_branch({ - url, - params, - branch, - errors, - status, - error, - route, - form -}) { - /** @type {import('types').TrailingSlash} */ - let slash = 'never'; - - // if `paths.base === '/a/b/c`, then the root route is always `/a/b/c/`, regardless of - // the `trailingSlash` route option, so that relative paths to JS and CSS work - if (base && (url.pathname === base || url.pathname === base + '/')) { - slash = 'always'; - } else { - for (const node of branch) { - if (node?.slash !== undefined) slash = node.slash; - } - } - - url.pathname = normalize_path(url.pathname, slash); - // eslint-disable-next-line no-self-assign - url.search = url.search; // turn `/?` into `/` - - /** @type {import('./types.js').NavigationFinished} */ - const result = { - type: 'loaded', - state: { - url, - params, - branch, - error, - route - }, - props: { - // @ts-ignore Somehow it's getting SvelteComponent and SvelteComponentDev mixed up - constructors: compact(branch).map((branch_node) => branch_node.node.component), - page: clone_page(page) - } - }; - - if (errors && __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__) { - let last_idx = -1; - result.props.errors = await Promise.all( - // eslint-disable-next-line @typescript-eslint/await-thenable - branch - .map((b, i) => { - if (i === 0) return undefined; // root layout wraps root error component, not the other way around - if (!b) return null; - - i--; - // Find the closest error component up to the previous branch - while (i > last_idx + 1 && !errors[i]) i -= 1; - last_idx = i; - return errors[i]?.() - .then((e) => e.component) - .catch(() => undefined); - }) - // filter out indexes where there was no branch, but keep indexes where there was a branch but no error component - .filter((e) => e !== null) - ); - } - - if (error && __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__) { - result.props.error = error; - } - - if (form !== undefined) { - result.props.form = form; - } - - let data = {}; - let data_changed = !page; - - let p = 0; - - for (let i = 0; i < Math.max(branch.length, current.branch.length); i += 1) { - const node = branch[i]; - const prev = current.branch[i]; - - if (node?.data !== prev?.data) data_changed = true; - if (!node) continue; - - data = { ...data, ...node.data }; - - // Only set props if the node actually updated. This prevents needless rerenders. - if (data_changed) { - result.props[`data_${p}`] = data; - } - - p += 1; - } - - const page_changed = - !current.url || - url.href !== current.url.href || - current.error !== error || - (form !== undefined && form !== page.form) || - data_changed; - - if (page_changed) { - result.props.page = { - error, - params, - route: { - id: route?.id ?? null - }, - state: {}, - status, - url: new URL(url), - form: form ?? null, - // The whole page store is updated, but this way the object reference stays the same - data: data_changed ? data : page.data - }; - } - - return result; -} - -/** - * Call the universal load function of the given node, if it exists. - * - * @param {{ - * loader: import('types').CSRPageNodeLoader; - * parent: () => Promise>; - * url: URL; - * params: Record; - * route: { id: string | null }; - * server_data_node: import('./types.js').DataNode | null; - * }} options - * @returns {Promise} - */ -async function load_node({ loader, parent, url, params, route, server_data_node }) { - /** @type {Record | null} */ - let data = null; - - let is_tracking = true; - - /** @type {import('types').Uses} */ - const uses = { - dependencies: new Set(), - params: new Set(), - parent: false, - route: false, - url: false, - search_params: new Set() - }; - - const node = await loader(); - - if (DEV) { - validate_page_exports(node.universal); - - if (node.universal && app.hash) { - const options = Object.keys(node.universal).filter((o) => o !== 'load'); - - if (options.length > 0) { - throw new Error( - `Page options are ignored when \`router.type === 'hash'\` (${route.id} has ${options - .filter((o) => o !== 'load') - .map((o) => `'${o}'`) - .join(', ')})` - ); - } - } - } - - if (__SVELTEKIT_HAS_UNIVERSAL_LOAD__ && node.universal?.load) { - /** @param {string[]} deps */ - function depends(...deps) { - for (const dep of deps) { - if (DEV) validate_depends(/** @type {string} */ (route.id), dep); - - const { href } = new URL(dep, url); - uses.dependencies.add(href); - } - } - - /** @type {import('@sveltejs/kit').LoadEvent} */ - const load_input = { - tracing: { enabled: false, root: noop_span, current: noop_span }, - route: new Proxy(route, { - get: (target, key) => { - if (is_tracking) { - uses.route = true; - } - return target[/** @type {'id'} */ (key)]; - } - }), - params: new Proxy(params, { - get: (target, key) => { - if (is_tracking) { - uses.params.add(/** @type {string} */ (key)); - } - return target[/** @type {string} */ (key)]; - } - }), - data: server_data_node?.data ?? null, - url: make_trackable( - url, - () => { - if (is_tracking) { - uses.url = true; - } - }, - (param) => { - if (is_tracking) { - uses.search_params.add(param); - } - }, - app.hash - ), - async fetch(resource, init) { - if (resource instanceof Request) { - // we're not allowed to modify the received `Request` object, so in order - // to fixup relative urls we create a new equivalent `init` object instead - init = { - // the request body must be consumed in memory until browsers - // implement streaming request bodies and/or the body getter - body: - resource.method === 'GET' || resource.method === 'HEAD' - ? undefined - : await resource.blob(), - cache: resource.cache, - credentials: resource.credentials, - // the server sets headers to `undefined` if there are no headers but - // the client defaults to an empty Headers object in the Request object. - // To keep the two values in sync, we explicitly set the headers to `undefined`. - // Also, not sure why, but sometimes 0 is evaluated as truthy so we need to - // explicitly compare the headers length to a number here - headers: [...resource.headers].length > 0 ? resource?.headers : undefined, - integrity: resource.integrity, - keepalive: resource.keepalive, - method: resource.method, - mode: resource.mode, - redirect: resource.redirect, - referrer: resource.referrer, - referrerPolicy: resource.referrerPolicy, - signal: resource.signal, - ...init - }; - } - - const { resolved, promise } = resolve_fetch_url(resource, init, url); - - if (is_tracking) { - depends(resolved.href); - } - - return promise; - }, - setHeaders: noop, - depends, - parent() { - if (is_tracking) { - uses.parent = true; - } - return parent(); - }, - untrack(fn) { - is_tracking = false; - try { - return fn(); - } finally { - is_tracking = true; - } - } - }; - - if (DEV) { - try { - lock_fetch(); - data = (await node.universal.load.call(null, load_input)) ?? null; - validate_load_response(data, `related to route '${route.id}'`); - } finally { - unlock_fetch(); - } - } else { - data = (await node.universal.load.call(null, load_input)) ?? null; - } - } - - return { - node, - loader, - server: server_data_node, - universal: node.universal?.load ? { type: 'data', data, uses } : null, - data: data ?? server_data_node?.data ?? null, - slash: node.universal?.trailingSlash ?? server_data_node?.slash - }; -} - -/** - * @param {Request | string | URL} input - * @param {RequestInit | undefined} init - * @param {URL} url - */ -function resolve_fetch_url(input, init, url) { - let requested = input instanceof Request ? input.url : input; - - // we must fixup relative urls so they are resolved from the target page - const resolved = new URL(requested, url); - - // match ssr serialized data url, which is important to find cached responses - if (resolved.origin === url.origin) { - requested = resolved.href.slice(url.origin.length); - } - - // prerendered pages may be served from any origin, so `initial_fetch` urls shouldn't be resolved - const promise = started - ? subsequent_fetch(requested, resolved.href, init) - : initial_fetch(requested, init); - - return { resolved, promise }; -} - -/** - * @param {boolean} parent_changed - * @param {boolean} route_changed - * @param {boolean} url_changed - * @param {Set} search_params_changed - * @param {import('types').Uses | undefined} uses - * @param {Record} params - */ -function has_changed( - parent_changed, - route_changed, - url_changed, - search_params_changed, - uses, - params -) { - if (force_invalidation) return true; - - if (!uses) return false; - - if (uses.parent && parent_changed) return true; - if (uses.route && route_changed) return true; - if (uses.url && url_changed) return true; - - for (const tracked_params of uses.search_params) { - if (search_params_changed.has(tracked_params)) return true; - } - - for (const param of uses.params) { - if (params[param] !== current.params[param]) return true; - } - - for (const href of uses.dependencies) { - if (invalidated.some((fn) => fn(new URL(href)))) return true; - } - - return false; -} - -/** - * @param {import('types').ServerDataNode | import('types').ServerDataSkippedNode | null} node - * @param {import('./types.js').DataNode | null} [previous] - * @returns {import('./types.js').DataNode | null} - */ -function create_data_node(node, previous) { - if (node?.type === 'data') return node; - if (node?.type === 'skip') return previous ?? null; - return null; -} - -/** - * @param {URL | null} old_url - * @param {URL} new_url - */ -function diff_search_params(old_url, new_url) { - if (!old_url) return new Set(new_url.searchParams.keys()); - - const changed = new Set([...old_url.searchParams.keys(), ...new_url.searchParams.keys()]); - - for (const key of changed) { - const old_values = old_url.searchParams.getAll(key); - const new_values = new_url.searchParams.getAll(key); - - if ( - old_values.every((value) => new_values.includes(value)) && - new_values.every((value) => old_values.includes(value)) - ) { - changed.delete(key); - } - } - - return changed; -} - -/** - * @param {Omit & { error: App.Error }} opts - * @returns {import('./types.js').NavigationFinished} - */ -function preload_error({ error, url, route, params }) { - return { - type: 'loaded', - state: { - error, - url, - route, - params, - branch: [] - }, - props: { - page: clone_page(page), - constructors: [] - } - }; -} - -/** - * @param {import('./types.js').NavigationIntent & { preload?: {} }} intent - * @returns {Promise} - */ -async function load_route({ id, invalidating, url, params, route, preload }) { - if (load_cache?.id === id) { - // the preload becomes the real navigation - preload_tokens.delete(load_cache.token); - return load_cache.promise; - } - - const { errors, layouts, leaf } = route; - - const loaders = [...layouts, leaf]; - - // preload modules to avoid waterfall, but handle rejections - // so they don't get reported to Sentry et al (we don't need - // to act on the failures at this point) - errors.forEach((loader) => loader?.().catch(noop)); - loaders.forEach((loader) => loader?.[1]().catch(noop)); - - /** @type {import('types').ServerNodesResponse | import('types').ServerRedirectNode | null} */ - let server_data = null; - const url_changed = current.url ? id !== get_page_key(current.url) : false; - const route_changed = current.route ? route.id !== current.route.id : false; - const search_params_changed = diff_search_params(current.url, url); - - let parent_invalid = false; - - if (__SVELTEKIT_HAS_SERVER_LOAD__) { - const invalid_server_nodes = loaders.map((loader, i) => { - const previous = current.branch[i]; - - const invalid = - !!loader?.[0] && - (previous?.loader !== loader[1] || - has_changed( - parent_invalid, - route_changed, - url_changed, - search_params_changed, - previous.server?.uses, - params - )); - - if (invalid) { - // For the next one - parent_invalid = true; - } - - return invalid; - }); - - if (invalid_server_nodes.some(Boolean)) { - try { - server_data = await load_data(url, invalid_server_nodes); - } catch (error) { - const handled_error = await handle_error(error, { url, params, route: { id } }); - - if (preload_tokens.has(preload)) { - return preload_error({ error: handled_error, url, params, route }); - } - - return load_root_error_page({ - status: get_status(error), - error: handled_error, - url, - route - }); - } - - if (server_data.type === 'redirect') { - return server_data; - } - } - } - - const server_data_nodes = server_data?.nodes; - - let parent_changed = false; - - const branch_promises = loaders.map(async (loader, i) => { - if (!loader) return; - - /** @type {import('./types.js').BranchNode | undefined} */ - const previous = current.branch[i]; - - const server_data_node = server_data_nodes?.[i]; - - // reuse data from previous load if it's still valid - const valid = - (!server_data_node || server_data_node.type === 'skip') && - loader[1] === previous?.loader && - !has_changed( - parent_changed, - route_changed, - url_changed, - search_params_changed, - previous.universal?.uses, - params - ); - if (valid) return previous; - - parent_changed = true; - - if (server_data_node?.type === 'error') { - // rethrow and catch below - throw server_data_node; - } - - return load_node({ - loader: loader[1], - url, - params, - route, - parent: async () => { - const data = {}; - for (let j = 0; j < i; j += 1) { - Object.assign(data, (await branch_promises[j])?.data); - } - return data; - }, - server_data_node: create_data_node( - // server_data_node is undefined if it wasn't reloaded from the server; - // and if current loader uses server data, we want to reuse previous data. - server_data_node === undefined && loader[0] ? { type: 'skip' } : (server_data_node ?? null), - loader[0] ? previous?.server : undefined - ) - }); - }); - - // if we don't do this, rejections will be unhandled - for (const p of branch_promises) p.catch(noop); - - /** @type {Array} */ - const branch = []; - - for (let i = 0; i < loaders.length; i += 1) { - if (loaders[i]) { - try { - branch.push(await branch_promises[i]); - } catch (err) { - if (err instanceof Redirect) { - return { - type: 'redirect', - location: err.location - }; - } - - if (preload_tokens.has(preload)) { - return preload_error({ - error: await handle_error(err, { params, url, route: { id: route.id } }), - url, - params, - route - }); - } - - let status = get_status(err); - /** @type {App.Error} */ - let error; - - if (server_data_nodes?.includes(/** @type {import('types').ServerErrorNode} */ (err))) { - // this is the server error rethrown above, reconstruct but don't invoke - // the client error handler; it should've already been handled on the server - status = /** @type {import('types').ServerErrorNode} */ (err).status ?? status; - error = /** @type {import('types').ServerErrorNode} */ (err).error; - } else if (err instanceof HttpError) { - error = err.body; - } else { - // Referenced node could have been removed due to redeploy, check - const updated = await stores.updated.check(); - if (updated) { - // Before reloading, try to update the service worker if it exists - await update_service_worker(); - return await native_navigation(url); - } - - error = await handle_error(err, { params, url, route: { id: route.id } }); - } - - const error_load = await load_nearest_error_page(i, branch, errors); - if (error_load) { - return get_navigation_result_from_branch({ - url, - params, - branch: branch.slice(0, error_load.idx).concat(error_load.node), - errors, - status, - error, - route - }); - } else { - return await server_fallback(url, { id: route.id }, error, status); - } - } - } else { - // push an empty slot so we can rewind past gaps to the - // layout that corresponds with an +error.svelte page - branch.push(undefined); - } - } - - return get_navigation_result_from_branch({ - url, - params, - branch, - errors, - status: 200, - error: null, - route, - // Reset `form` on navigation, but not invalidation - form: invalidating ? undefined : null - }); -} - -/** - * @param {number} i Start index to backtrack from - * @param {Array} branch Branch to backtrack - * @param {Array} errors All error pages for this branch - * @returns {Promise<{idx: number; node: import('./types.js').BranchNode} | undefined>} - */ -async function load_nearest_error_page(i, branch, errors) { - while (i--) { - if (errors[i]) { - let j = i; - while (!branch[j]) j -= 1; - try { - return { - idx: j + 1, - node: { - node: await /** @type {import('types').CSRPageNodeLoader } */ (errors[i])(), - loader: /** @type {import('types').CSRPageNodeLoader } */ (errors[i]), - data: {}, - server: null, - universal: null - } - }; - } catch { - continue; - } - } - } -} - -/** - * @param {{ - * status: number; - * error: App.Error; - * url: URL; - * route: { id: string | null } - * }} opts - * @returns {Promise} - */ -async function load_root_error_page({ status, error, url, route }) { - /** @type {Record} */ - const params = {}; // error page does not have params - - /** @type {import('types').ServerDataNode | null} */ - let server_data_node = null; - - if (__SVELTEKIT_HAS_SERVER_LOAD__) { - const default_layout_has_server_load = app.server_loads[0] === 0; - - if (default_layout_has_server_load) { - // TODO post-https://github.com/sveltejs/kit/discussions/6124 we can use - // existing root layout data - try { - const server_data = await load_data(url, [true]); - - if ( - server_data.type !== 'data' || - (server_data.nodes[0] && server_data.nodes[0].type !== 'data') - ) { - throw 0; - } - - server_data_node = server_data.nodes[0] ?? null; - } catch { - // at this point we have no choice but to fall back to the server, if it wouldn't - // bring us right back here, turning this into an endless loop - if (url.origin !== origin || url.pathname !== location.pathname || hydrated) { - await native_navigation(url); - } - } - } - } - - try { - const root_layout = await load_node({ - loader: default_layout_loader, - url, - params, - route, - parent: () => Promise.resolve({}), - server_data_node: create_data_node(server_data_node) - }); - - /** @type {import('./types.js').BranchNode} */ - const root_error = { - node: await default_error_loader(), - loader: default_error_loader, - universal: null, - server: null, - data: null - }; - - return get_navigation_result_from_branch({ - url, - params, - branch: [root_layout, root_error], - status, - error, - errors: [], - route: null - }); - } catch (error) { - if (error instanceof Redirect) { - // @ts-expect-error TODO investigate this - return _goto(new URL(error.location, location.href), {}, 0); - } - - // TODO: this falls back to the server when a server exists, but what about SPA mode? - throw error; - } -} - -/** - * Resolve the relative rerouted URL for a client-side navigation - * @param {URL} url - * @returns {Promise} - */ -async function get_rerouted_url(url) { - const href = url.href; - - if (reroute_cache.has(href)) { - return reroute_cache.get(href); - } - - let rerouted; - - try { - const promise = (async () => { - // reroute could alter the given URL, so we pass a copy - let rerouted = - (await app.hooks.reroute({ - url: new URL(url), - fetch: async (input, init) => { - return resolve_fetch_url(input, init, url).promise; - } - })) ?? url; - - if (typeof rerouted === 'string') { - const tmp = new URL(url); // do not mutate the incoming URL - - if (app.hash) { - tmp.hash = rerouted; - } else { - tmp.pathname = rerouted; - } - - rerouted = tmp; - } - - return rerouted; - })(); - - reroute_cache.set(href, promise); - rerouted = await promise; - } catch (e) { - reroute_cache.delete(href); - if (DEV) { - // in development, print the error... - console.error(e); - - // ...and pause execution, since otherwise we will immediately reload the page - debugger; // eslint-disable-line - } - - // fall back to native navigation - return; - } - - return rerouted; -} - -/** - * Resolve the full info (which route, params, etc.) for a client-side navigation from the URL, - * taking the reroute hook into account. If this isn't a client-side-navigation (or the URL is undefined), - * returns undefined. - * @param {URL | undefined} url - * @param {boolean} invalidating - * @returns {Promise} - */ -export async function get_navigation_intent(url, invalidating) { - if (!url) return; - if (is_external_url(url, base, app.hash)) return; - - if (__SVELTEKIT_CLIENT_ROUTING__) { - const rerouted = await get_rerouted_url(url); - if (!rerouted) return; - - const path = get_url_path(rerouted); - - for (const route of routes) { - const params = route.exec(path); - - if (params) { - return { - id: get_page_key(url), - invalidating, - route, - params: decode_params(params), - url - }; - } - } - } else { - /** @type {{ route?: import('types').CSRRouteServer, params: Record}} */ - const { route, params } = await import( - /* @vite-ignore */ - add_resolution_suffix(url.pathname) - ); - - if (!route) return; - - return { - id: get_page_key(url), - invalidating, - route: parse_server_route(route, app.nodes), - params, - url - }; - } -} - -/** @param {URL} url */ -function get_url_path(url) { - return ( - decode_pathname( - app.hash ? url.hash.replace(/^#/, '').replace(/[?#].+/, '') : url.pathname.slice(base.length) - ) || '/' - ); -} - -/** @param {URL} url */ -function get_page_key(url) { - return (app.hash ? url.hash.replace(/^#/, '') : url.pathname) + url.search; -} - -/** - * @param {{ - * url: URL; - * type: import('@sveltejs/kit').Navigation["type"]; - * intent?: import('./types.js').NavigationIntent; - * delta?: number; - * event?: PopStateEvent | MouseEvent; - * scroll?: { x: number, y: number }; - * }} opts - */ -function _before_navigate({ url, type, intent, delta, event, scroll }) { - let should_block = false; - - const nav = create_navigation(current, intent, url, type, scroll ?? null); - - if (delta !== undefined) { - nav.navigation.delta = delta; - } - - if (event !== undefined) { - // @ts-ignore - nav.navigation.event = event; - } - - const cancellable = { - ...nav.navigation, - cancel: () => { - should_block = true; - nav.reject(new Error('navigation cancelled')); - } - }; - - if (!is_navigating) { - // Don't run the event during redirects - before_navigate_callbacks.forEach((fn) => fn(cancellable)); - } - - return should_block ? null : nav; -} - -/** - * @param {{ - * type: import('@sveltejs/kit').NavigationType; - * url: URL; - * popped?: { - * state: Record; - * scroll: { x: number, y: number }; - * delta: number; - * }; - * keepfocus?: boolean; - * noscroll?: boolean; - * replace_state?: boolean; - * state?: Record; - * redirect_count?: number; - * nav_token?: {}; - * accept?: () => void; - * block?: () => void; - * event?: Event - * }} opts - */ -async function navigate({ - type, - url, - popped, - keepfocus, - noscroll, - replace_state, - state = {}, - redirect_count = 0, - nav_token = {}, - accept = noop, - block = noop, - event -}) { - const prev_token = token; - token = nav_token; - - const intent = await get_navigation_intent(url, false); - const nav = - type === 'enter' - ? create_navigation(current, intent, url, type) - : _before_navigate({ - url, - type, - delta: popped?.delta, - intent, - scroll: popped?.scroll, - // @ts-ignore - event - }); - - if (!nav) { - block(); - if (token === nav_token) token = prev_token; - return; - } - - // store this before calling `accept()`, which may change the index - const previous_history_index = current_history_index; - const previous_navigation_index = current_navigation_index; - - accept(); - - is_navigating = true; - - if (started && nav.navigation.type !== 'enter') { - stores.navigating.set((navigating.current = nav.navigation)); - } - - let navigation_result = intent && (await load_route(intent)); - - if (!navigation_result) { - if (is_external_url(url, base, app.hash)) { - if (DEV && app.hash) { - // Special case for hash mode during DEV: If someone accidentally forgets to use a hash for the link, - // they would end up here in an endless loop. Fall back to error page in that case - navigation_result = await server_fallback( - url, - { id: null }, - await handle_error( - new SvelteKitError( - 404, - 'Not Found', - `Not found: ${url.pathname} (did you forget the hash?)` - ), - { - url, - params: {}, - route: { id: null } - } - ), - 404, - replace_state - ); - } else { - return await native_navigation(url, replace_state); - } - } else { - navigation_result = await server_fallback( - url, - { id: null }, - await handle_error(new SvelteKitError(404, 'Not Found', `Not found: ${url.pathname}`), { - url, - params: {}, - route: { id: null } - }), - 404, - replace_state - ); - } - } - - // if this is an internal navigation intent, use the normalized - // URL for the rest of the function - url = intent?.url || url; - - // abort if user navigated during update - if (token !== nav_token) { - nav.reject(new Error('navigation aborted')); - return false; - } - - if (navigation_result.type === 'redirect') { - // whatwg fetch spec https://fetch.spec.whatwg.org/#http-redirect-fetch says to error after 20 redirects - if (redirect_count < 20) { - await navigate({ - type, - url: new URL(navigation_result.location, url), - popped, - keepfocus, - noscroll, - replace_state, - state, - redirect_count: redirect_count + 1, - nav_token - }); - - nav.fulfil(undefined); - return; - } - - navigation_result = await load_root_error_page({ - status: 500, - error: await handle_error(new Error('Redirect loop'), { - url, - params: {}, - route: { id: null } - }), - url, - route: { id: null } - }); - } else if (/** @type {number} */ (navigation_result.props.page.status) >= 400) { - const updated = await stores.updated.check(); - if (updated) { - // Before reloading, try to update the service worker if it exists - await update_service_worker(); - await native_navigation(url, replace_state); - } - } - - // reset invalidation only after a finished navigation. If there are redirects or - // additional invalidations, they should get the same invalidation treatment - reset_invalidation(); - - updating = true; - - update_scroll_positions(previous_history_index); - capture_snapshot(previous_navigation_index); - - // ensure the url pathname matches the page's trailing slash option - if (navigation_result.props.page.url.pathname !== url.pathname) { - url.pathname = navigation_result.props.page.url.pathname; - } - - state = popped ? popped.state : state; - - if (!popped) { - // this is a new navigation, rather than a popstate - const change = replace_state ? 0 : 1; - - const entry = { - [HISTORY_INDEX]: (current_history_index += change), - [NAVIGATION_INDEX]: (current_navigation_index += change), - [STATES_KEY]: state - }; - - const fn = replace_state ? history.replaceState : history.pushState; - fn.call(history, entry, '', url); - - if (!replace_state) { - clear_onward_history(current_history_index, current_navigation_index); - } - } - - // also compare ids to avoid using wrong fork (e.g. a new one could've been added while navigating) - const load_cache_fork = intent && load_cache?.id === intent.id ? load_cache.fork : null; - // reset preload synchronously after the history state has been set to avoid race conditions - if (load_cache?.fork && !load_cache_fork) { - // discard fork of different route - discard_load_cache(); - } - load_cache = null; - - navigation_result.props.page.state = state; - - /** - * @type {Promise | undefined} - */ - let commit_promise; - if (started) { - const after_navigate = ( - await Promise.all( - // eslint-disable-next-line @typescript-eslint/await-thenable -- we need to await because they can be asynchronous - Array.from(on_navigate_callbacks, (fn) => - fn(/** @type {import('@sveltejs/kit').OnNavigate} */ (nav.navigation)) - ) - ) - ).filter(/** @returns {value is () => void} */ (value) => typeof value === 'function'); - - if (after_navigate.length > 0) { - function cleanup() { - after_navigate.forEach((fn) => { - after_navigate_callbacks.delete(fn); - }); - } - - after_navigate.push(cleanup); - - after_navigate.forEach((fn) => { - after_navigate_callbacks.add(fn); - }); - } - - // Type-casts are save because we know this resolved a proper SvelteKit route - const target = /** @type {import('@sveltejs/kit').NavigationTarget} */ (nav.navigation.to); - current = { - ...navigation_result.state, - nav: { - params: /** @type {Record} */ (target.params), - route: target.route, - url: target.url - } - }; - - // reset url before updating page store - if (navigation_result.props.page) { - navigation_result.props.page.url = url; - } - - const fork = load_cache_fork && (await load_cache_fork); - - if (fork) { - commit_promise = fork.commit(); - } else { - rendering_error = null; // TODO this can break with forks, rethink for SvelteKit 3 where we can assume Svelte 5 - root.$set(navigation_result.props); - // Check for sync rendering error - if (rendering_error) { - Object.assign(navigation_result.props.page, rendering_error); - } - update(navigation_result.props.page); - - commit_promise = svelte.settled?.(); - } - - has_navigated = true; - } else { - await initialize(navigation_result, target, false); - } - - const { activeElement } = document; - - await commit_promise; - - // TODO 3.0 remote — the double tick is probably necessary because - // of some store shenanigans. `settled()` and `f.commit()` - // should resolve after DOM updates in newer versions - await svelte.tick(); - await svelte.tick(); - - // we reset scroll before dealing with focus, to avoid a flash of unscrolled content - /** @type {Element | null | ''} */ - let deep_linked = null; - - if (autoscroll) { - const scroll = popped ? popped.scroll : noscroll ? scroll_state() : null; - if (scroll) { - scrollTo(scroll.x, scroll.y); - } else if ((deep_linked = url.hash && document.getElementById(get_id(url)))) { - // Here we use `scrollIntoView` on the element instead of `scrollTo` - // because it natively supports the `scroll-margin` and `scroll-behavior` - // CSS properties. - deep_linked.scrollIntoView(); - } else { - scrollTo(0, 0); - } - } - - const changed_focus = - // reset focus only if any manual focus management didn't override it - document.activeElement !== activeElement && - // also refocus when activeElement is body already because the - // focus event might not have been fired on it yet - document.activeElement !== document.body; - - if (!keepfocus && !changed_focus) { - // We don't need to manually restore the scroll position if we're navigating - // to a fragment identifier. It is automatically done for us when we set the - // sequential navigation starting point with `location.replace` - reset_focus(url, !deep_linked); - } - - autoscroll = true; - - if (navigation_result.props.page) { - // Check for async rendering error - if (rendering_error) { - Object.assign(navigation_result.props.page, rendering_error); - } - Object.assign(page, navigation_result.props.page); - } - - is_navigating = false; - - if (type === 'popstate') { - restore_snapshot(current_navigation_index); - } - - nav.fulfil(undefined); - - // Update to.scroll to the actual scroll position after navigation completed - if (nav.navigation.to) { - nav.navigation.to.scroll = scroll_state(); - } - - after_navigate_callbacks.forEach((fn) => - fn(/** @type {import('@sveltejs/kit').AfterNavigate} */ (nav.navigation)) - ); - - stores.navigating.set((navigating.current = null)); - - updating = false; -} - -/** - * Does a full page reload if it wouldn't result in an endless loop in the SPA case - * @param {URL} url - * @param {{ id: string | null }} route - * @param {App.Error} error - * @param {number} status - * @param {boolean} [replace_state] - * @returns {Promise} - */ -async function server_fallback(url, route, error, status, replace_state) { - if (url.origin === origin && url.pathname === location.pathname && !hydrated) { - // We would reload the same page we're currently on, which isn't hydrated, - // which means no SSR, which means we would end up in an endless loop - return await load_root_error_page({ - status, - error, - url, - route - }); - } - - if (DEV && status !== 404) { - console.error( - 'An error occurred while loading the page. This will cause a full page reload. (This message will only appear during development.)' - ); - - debugger; // eslint-disable-line - } - - return await native_navigation(url, replace_state); -} - -if (import.meta.hot) { - import.meta.hot.on('vite:beforeUpdate', () => { - if (current.error) location.reload(); - }); -} - -/** @typedef {(typeof PRELOAD_PRIORITIES)['hover'] | (typeof PRELOAD_PRIORITIES)['tap']} PreloadDataPriority */ - -function setup_preload() { - /** @type {NodeJS.Timeout} */ - let mousemove_timeout; - /** @type {{ element: Element | SVGAElement | undefined; href: string | SVGAnimatedString | undefined }} */ - let current_a = { element: undefined, href: undefined }; - /** @type {PreloadDataPriority} */ - let current_priority; - - container.addEventListener('mousemove', (event) => { - const target = /** @type {Element} */ (event.target); - - clearTimeout(mousemove_timeout); - mousemove_timeout = setTimeout(() => { - void preload(target, PRELOAD_PRIORITIES.hover); - }, 20); - }); - - /** @param {Event} event */ - function tap(event) { - if (event.defaultPrevented) return; - void preload(/** @type {Element} */ (event.composedPath()[0]), PRELOAD_PRIORITIES.tap); - } - - container.addEventListener('mousedown', tap); - container.addEventListener('touchstart', tap, { passive: true }); - - const observer = new IntersectionObserver( - (entries) => { - for (const entry of entries) { - if (entry.isIntersecting) { - void _preload_code(new URL(/** @type {HTMLAnchorElement} */ (entry.target).href)); - observer.unobserve(entry.target); - } - } - }, - { threshold: 0 } - ); - - /** - * @param {Element} element - * @param {PreloadDataPriority} priority - */ - async function preload(element, priority) { - const a = find_anchor(element, container); - - // we don't want to preload data again if the user has already hovered/tapped - const interacted = - a === current_a.element && a?.href === current_a.href && priority >= current_priority; - if (!a || interacted) return; - - const { url, external, download } = get_link_info(a, base, app.hash); - if (external || download) return; - - const options = get_router_options(a); - - // we don't want to preload data for a page we're already on - const same_url = url && get_page_key(current.url) === get_page_key(url); - if (options.reload || same_url) return; - - if (priority <= options.preload_data) { - current_a = { element: a, href: a.href }; - // we don't want to preload data again on tap if we've already preloaded it on hover - current_priority = PRELOAD_PRIORITIES.tap; - - const intent = await get_navigation_intent(url, false); - if (!intent) return; - - if (DEV) { - void _preload_data(intent).then((result) => { - if (result.type === 'loaded' && result.state.error) { - console.warn( - `Preloading data for ${intent.url.pathname} failed with the following error: ${result.state.error.message}\n` + - 'If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. ' + - 'This route was preloaded due to a data-sveltekit-preload-data attribute. ' + - 'See https://svelte.dev/docs/kit/link-options for more info' - ); - } - }); - } else { - void _preload_data(intent); - } - } else if (priority <= options.preload_code) { - current_a = { element: a, href: a.href }; - current_priority = priority; - void _preload_code(/** @type {URL} */ (url)); - } - } - - function after_navigate() { - observer.disconnect(); - - for (const a of container.querySelectorAll('a')) { - const { url, external, download } = get_link_info(a, base, app.hash); - if (external || download) continue; - - const options = get_router_options(a); - if (options.reload) continue; - - if (options.preload_code === PRELOAD_PRIORITIES.viewport) { - observer.observe(a); - } - - if (options.preload_code === PRELOAD_PRIORITIES.eager) { - void _preload_code(/** @type {URL} */ (url)); - } - } - } - - after_navigate_callbacks.add(after_navigate); - after_navigate(); -} - -/** - * @param {unknown} error - * @param {import('@sveltejs/kit').NavigationEvent} event - * @returns {import('types').MaybePromise} - */ -function handle_error(error, event) { - if (error instanceof HttpError) { - return error.body; - } - - if (DEV) { - errored = true; - console.warn('The next HMR update will cause the page to reload'); - } - - const status = get_status(error); - const message = get_message(error); - - return ( - app.hooks.handleError({ error, event, status, message }) ?? /** @type {any} */ ({ message }) - ); -} - -/** - * @template {Function} T - * @param {Set} callbacks - * @param {T} callback - */ -function add_navigation_callback(callbacks, callback) { - onMount(() => { - callbacks.add(callback); - - return () => { - callbacks.delete(callback); - }; - }); -} - -/** - * A lifecycle function that runs the supplied `callback` when the current component mounts, and also whenever we navigate to a URL. - * - * `afterNavigate` must be called during a component initialization. It remains active as long as the component is mounted. - * @param {(navigation: import('@sveltejs/kit').AfterNavigate) => void} callback - * @returns {void} - */ -export function afterNavigate(callback) { - add_navigation_callback(after_navigate_callbacks, callback); -} - -/** - * A navigation interceptor that triggers before we navigate to a URL, whether by clicking a link, calling `goto(...)`, or using the browser back/forward controls. - * - * Calling `cancel()` will prevent the navigation from completing. If `navigation.type === 'leave'` — meaning the user is navigating away from the app (or closing the tab) — calling `cancel` will trigger the native browser unload confirmation dialog. In this case, the navigation may or may not be cancelled depending on the user's response. - * - * When a navigation isn't to a SvelteKit-owned route (and therefore controlled by SvelteKit's client-side router), `navigation.to.route.id` will be `null`. - * - * If the navigation will (if not cancelled) cause the document to unload — in other words `'leave'` navigations and `'link'` navigations where `navigation.to.route === null` — `navigation.willUnload` is `true`. - * - * `beforeNavigate` must be called during a component initialization. It remains active as long as the component is mounted. - * @param {(navigation: import('@sveltejs/kit').BeforeNavigate) => void} callback - * @returns {void} - */ -export function beforeNavigate(callback) { - add_navigation_callback(before_navigate_callbacks, callback); -} - -/** - * A lifecycle function that runs the supplied `callback` immediately before we navigate to a new URL except during full-page navigations. - * - * If you return a `Promise`, SvelteKit will wait for it to resolve before completing the navigation. This allows you to — for example — use `document.startViewTransition`. Avoid promises that are slow to resolve, since navigation will appear stalled to the user. - * - * If a function (or a `Promise` that resolves to a function) is returned from the callback, it will be called once the DOM has updated. - * - * `onNavigate` must be called during a component initialization. It remains active as long as the component is mounted. - * @param {(navigation: import('@sveltejs/kit').OnNavigate) => import('types').MaybePromise<(() => void) | void>} callback - * @returns {void} - */ -export function onNavigate(callback) { - add_navigation_callback(on_navigate_callbacks, callback); -} - -/** - * If called when the page is being updated following a navigation (in `onMount` or `afterNavigate` or an action, for example), this disables SvelteKit's built-in scroll handling. - * This is generally discouraged, since it breaks user expectations. - * @returns {void} - */ -export function disableScrollHandling() { - if (!BROWSER) { - throw new Error('Cannot call disableScrollHandling() on the server'); - } - - if (DEV && started && !updating) { - throw new Error('Can only disable scroll handling during navigation'); - } - - if (updating || !started) { - autoscroll = false; - } -} - -/** - * Allows you to navigate programmatically to a given route, with options such as keeping the current element focused. - * Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`. - * - * For external URLs, use `window.location = url` instead of calling `goto(url)`. - * - * @param {string | URL} url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app. - * @param {Object} [opts] Options related to the navigation - * @param {boolean} [opts.replaceState] If `true`, will replace the current `history` entry rather than creating a new one with `pushState` - * @param {boolean} [opts.noScroll] If `true`, the browser will maintain its scroll position rather than scrolling to the top of the page after navigation - * @param {boolean} [opts.keepFocus] If `true`, the currently focused element will retain focus after navigation. Otherwise, focus will be reset to the body - * @param {boolean} [opts.invalidateAll] If `true`, all `load` functions of the page will be rerun. See https://svelte.dev/docs/kit/load#rerunning-load-functions for more info on invalidation. - * @param {Array boolean)>} [opts.invalidate] Causes any load functions to re-run if they depend on one of the urls - * @param {App.PageState} [opts.state] An optional object that will be available as `page.state` - * @returns {Promise} - */ -export function goto(url, opts = {}) { - if (!BROWSER) { - throw new Error('Cannot call goto(...) on the server'); - } - - url = new URL(resolve_url(url)); - - if (url.origin !== origin) { - return Promise.reject( - new Error( - DEV - ? `Cannot use \`goto\` with an external URL. Use \`window.location = "${url}"\` instead` - : 'goto: invalid URL' - ) - ); - } - - return _goto(url, opts, 0); -} - -/** - * Causes any `load` functions belonging to the currently active page to re-run if they depend on the `url` in question, via `fetch` or `depends`. Returns a `Promise` that resolves when the page is subsequently updated. - * - * If the argument is given as a `string` or `URL`, it must resolve to the same URL that was passed to `fetch` or `depends` (including query parameters). - * To create a custom identifier, use a string beginning with `[a-z]+:` (e.g. `custom:state`) — this is a valid URL. - * - * The `function` argument can be used define a custom predicate. It receives the full `URL` and causes `load` to rerun if `true` is returned. - * This can be useful if you want to invalidate based on a pattern instead of a exact match. - * - * ```ts - * // Example: Match '/path' regardless of the query parameters - * import { invalidate } from '$app/navigation'; - * - * invalidate((url) => url.pathname === '/path'); - * ``` - * @param {string | URL | ((url: URL) => boolean)} resource The invalidated URL - * @returns {Promise} - */ -export function invalidate(resource) { - if (!BROWSER) { - throw new Error('Cannot call invalidate(...) on the server'); - } - - push_invalidated(resource); - - return _invalidate(); -} - -/** - * @param {string | URL | ((url: URL) => boolean)} resource The invalidated URL - */ -function push_invalidated(resource) { - if (typeof resource === 'function') { - invalidated.push(resource); - } else { - const { href } = new URL(resource, location.href); - invalidated.push((url) => url.href === href); - } -} - -/** - * Causes all `load` and `query` functions belonging to the currently active page to re-run. Returns a `Promise` that resolves when the page is subsequently updated. - * @returns {Promise} - */ -export function invalidateAll() { - if (!BROWSER) { - throw new Error('Cannot call invalidateAll() on the server'); - } - - force_invalidation = true; - return _invalidate(); -} - -/** - * Causes all currently active remote functions to refresh, and all `load` functions belonging to the currently active page to re-run (unless disabled via the option argument). - * Returns a `Promise` that resolves when the page is subsequently updated. - * @param {{ includeLoadFunctions?: boolean }} [options] - * @returns {Promise} - */ -export function refreshAll({ includeLoadFunctions = true } = {}) { - if (!BROWSER) { - throw new Error('Cannot call refreshAll() on the server'); - } - - force_invalidation = true; - return _invalidate(includeLoadFunctions, false); -} - -/** - * Programmatically preloads the given page, which means - * 1. ensuring that the code for the page is loaded, and - * 2. calling the page's load function with the appropriate options. - * - * This is the same behaviour that SvelteKit triggers when the user taps or mouses over an `` element with `data-sveltekit-preload-data`. - * If the next navigation is to `href`, the values returned from load will be used, making navigation instantaneous. - * Returns a Promise that resolves with the result of running the new route's `load` functions once the preload is complete. - * - * @param {string} href Page to preload - * @returns {Promise<{ type: 'loaded'; status: number; data: Record } | { type: 'redirect'; location: string }>} - */ -export async function preloadData(href) { - if (!BROWSER) { - throw new Error('Cannot call preloadData(...) on the server'); - } - - const url = resolve_url(href); - const intent = await get_navigation_intent(url, false); - - if (!intent) { - throw new Error(`Attempted to preload a URL that does not belong to this app: ${url}`); - } - - const result = await _preload_data(intent); - if (result.type === 'redirect') { - return { - type: result.type, - location: result.location - }; - } - - const { status, data } = result.props.page ?? page; - return { type: result.type, status, data }; -} - -/** - * Programmatically imports the code for routes that haven't yet been fetched. - * Typically, you might call this to speed up subsequent navigation. - * - * You can specify routes by any matching pathname such as `/about` (to match `src/routes/about/+page.svelte`) or `/blog/*` (to match `src/routes/blog/[slug]/+page.svelte`). - * - * Unlike `preloadData`, this won't call `load` functions. - * Returns a Promise that resolves when the modules have been imported. - * - * @param {string} pathname - * @returns {Promise} - */ -export async function preloadCode(pathname) { - if (!BROWSER) { - throw new Error('Cannot call preloadCode(...) on the server'); - } - - const url = new URL(pathname, current.url); - - if (DEV) { - if (!pathname.startsWith('/')) { - throw new Error( - 'argument passed to preloadCode must be a pathname (i.e. "/about" rather than "http://example.com/about"' - ); - } - - if (!pathname.startsWith(base)) { - throw new Error( - `pathname passed to preloadCode must start with \`paths.base\` (i.e. "${base}${pathname}" rather than "${pathname}")` - ); - } - - if (__SVELTEKIT_CLIENT_ROUTING__) { - const rerouted = await get_rerouted_url(url); - if (!rerouted || !routes.find((route) => route.exec(get_url_path(rerouted)))) { - throw new Error(`'${pathname}' did not match any routes`); - } - } - } - - return _preload_code(url); -} - -/** - * Programmatically create a new history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing). - * - * @param {string | URL} url - * @param {App.PageState} state - * @returns {void} - */ -export function pushState(url, state) { - if (!BROWSER) { - throw new Error('Cannot call pushState(...) on the server'); - } - - if (DEV) { - if (!started) { - throw new Error('Cannot call pushState(...) before router is initialized'); - } - - try { - // use `devalue.stringify` as a convenient way to ensure we exclude values that can't be properly rehydrated, such as custom class instances - devalue.stringify(state); - } catch (error) { - // @ts-expect-error - throw new Error(`Could not serialize state${error.path}`, { cause: error }); - } - } - - update_scroll_positions(current_history_index); - - const opts = { - [HISTORY_INDEX]: (current_history_index += 1), - [NAVIGATION_INDEX]: current_navigation_index, - [PAGE_URL_KEY]: page.url.href, - [STATES_KEY]: state - }; - - history.pushState(opts, '', resolve_url(url)); - has_navigated = true; - - page.state = state; - root.$set({ - // we need to assign a new page object so that subscribers are correctly notified - page: untrack(() => clone_page(page)) - }); - - clear_onward_history(current_history_index, current_navigation_index); -} - -/** - * Programmatically replace the current history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing). - * - * @param {string | URL} url - * @param {App.PageState} state - * @returns {void} - */ -export function replaceState(url, state) { - if (!BROWSER) { - throw new Error('Cannot call replaceState(...) on the server'); - } - - if (DEV) { - if (!started) { - throw new Error('Cannot call replaceState(...) before router is initialized'); - } - - try { - // use `devalue.stringify` as a convenient way to ensure we exclude values that can't be properly rehydrated, such as custom class instances - devalue.stringify(state); - } catch (error) { - // @ts-expect-error - throw new Error(`Could not serialize state${error.path}`, { cause: error }); - } - } - - const opts = { - [HISTORY_INDEX]: current_history_index, - [NAVIGATION_INDEX]: current_navigation_index, - [PAGE_URL_KEY]: page.url.href, - [STATES_KEY]: state - }; - - history.replaceState(opts, '', resolve_url(url)); - - page.state = state; - root.$set({ - page: untrack(() => clone_page(page)) - }); -} - -/** - * This action updates the `form` property of the current page with the given data and updates `page.status`. - * In case of an error, it redirects to the nearest error page. - * @template {Record | undefined} Success - * @template {Record | undefined} Failure - * @param {import('@sveltejs/kit').ActionResult} result - * @returns {Promise} - */ -export async function applyAction(result) { - if (!BROWSER) { - throw new Error('Cannot call applyAction(...) on the server'); - } - - if (result.type === 'error') { - await set_nearest_error_page(result.error, result.status); - } else if (result.type === 'redirect') { - await _goto(result.location, { invalidateAll: true }, 0); - } else { - page.form = result.data; - page.status = result.status; - - /** @type {Record} */ - root.$set({ - // this brings Svelte's view of the world in line with SvelteKit's - // after use:enhance reset the form.... - form: null, - page: clone_page(page) - }); - - // ...so that setting the `form` prop takes effect and isn't ignored - await tick(); - root.$set({ form: result.data }); - - if (result.type === 'success') { - reset_focus(page.url); - } - } -} - -/** - * @param {App.Error} error - * @param {number} status - */ -export async function set_nearest_error_page(error, status = 500) { - const url = new URL(location.href); - - const { branch, route } = current; - if (!route) return; - - const error_load = await load_nearest_error_page(current.branch.length, branch, route.errors); - if (error_load) { - const navigation_result = await get_navigation_result_from_branch({ - url, - params: current.params, - branch: branch.slice(0, error_load.idx).concat(error_load.node), - status, - error, - // do not set errors, we haven't changed the page so the previous ones are still current - route - }); - - current = { ...navigation_result.state, nav: current.nav }; - - root.$set(navigation_result.props); - update(navigation_result.props.page); - - void tick().then(() => reset_focus(current.url)); - } -} - -function _start_router() { - history.scrollRestoration = 'manual'; - - // Adopted from Nuxt.js - // Reset scrollRestoration to auto when leaving page, allowing page reload - // and back-navigation from other pages to use the browser to restore the - // scrolling position. - addEventListener('beforeunload', (e) => { - let should_block = false; - - persist_state(); - - if (!is_navigating) { - const nav = create_navigation(current, undefined, null, 'leave'); - - // If we're navigating, beforeNavigate was already called. If we end up in here during navigation, - // it's due to an external or full-page-reload link, for which we don't want to call the hook again. - /** @type {import('@sveltejs/kit').BeforeNavigate} */ - const navigation = { - ...nav.navigation, - cancel: () => { - should_block = true; - nav.reject(new Error('navigation cancelled')); - } - }; - - before_navigate_callbacks.forEach((fn) => fn(navigation)); - } - - if (should_block) { - e.preventDefault(); - e.returnValue = ''; - } else { - history.scrollRestoration = 'auto'; - } - }); - - addEventListener('visibilitychange', () => { - if (document.visibilityState === 'hidden') { - persist_state(); - } - }); - - // @ts-expect-error this isn't supported everywhere yet - if (!navigator.connection?.saveData) { - setup_preload(); - } - - /** @param {MouseEvent} event */ - container.addEventListener('click', async (event) => { - // Adapted from https://github.com/visionmedia/page.js - // MIT license https://github.com/visionmedia/page.js#license - if (event.button || event.which !== 1) return; - if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return; - if (event.defaultPrevented) return; - - const a = find_anchor(/** @type {Element} */ (event.composedPath()[0]), container); - if (!a) return; - - const { url, external, target, download } = get_link_info(a, base, app.hash); - if (!url) return; - - // bail out before `beforeNavigate` if link opens in a different tab - if (target === '_parent' || target === '_top') { - if (window.parent !== window) return; - } else if (target && target !== '_self') { - return; - } - - const options = get_router_options(a); - const is_svg_a_element = a instanceof SVGAElement; - - // Ignore URL protocols that differ to the current one and are not http(s) (e.g. `mailto:`, `tel:`, `myapp:`, etc.) - // This may be wrong when the protocol is x: and the link goes to y:.. which should be treated as an external - // navigation, but it's not clear how to handle that case and it's not likely to come up in practice. - // MEMO: Without this condition, firefox will open mailer twice. - // See: - // - https://github.com/sveltejs/kit/issues/4045 - // - https://github.com/sveltejs/kit/issues/5725 - // - https://github.com/sveltejs/kit/issues/6496 - if ( - !is_svg_a_element && - url.protocol !== location.protocol && - !(url.protocol === 'https:' || url.protocol === 'http:') - ) - return; - - if (download) return; - - const [nonhash, hash] = (app.hash ? url.hash.replace(/^#/, '') : url.href).split('#'); - const same_pathname = nonhash === strip_hash(location); - - // Ignore the following but fire beforeNavigate - if (external || (options.reload && (!same_pathname || !hash))) { - if (_before_navigate({ url, type: 'link', event })) { - // set `navigating` to `true` to prevent `beforeNavigate` callbacks - // being called when the page unloads - is_navigating = true; - } else { - event.preventDefault(); - } - - return; - } - - // Check if new url only differs by hash and use the browser default behavior in that case - // This will ensure the `hashchange` event is fired - // Removing the hash does a full page navigation in the browser, so make sure a hash is present - if (hash !== undefined && same_pathname) { - // If we are trying to navigate to the same hash, we should only - // attempt to scroll to that element and avoid any history changes. - // Otherwise, this can cause Firefox to incorrectly assign a null - // history state value without any signal that we can detect. - const [, current_hash] = current.url.href.split('#'); - if (current_hash === hash) { - event.preventDefault(); - - // We're already on /# and click on a link that goes to /#, or we're on - // /#top and click on a link that goes to /#top. In those cases just go to - // the top of the page, and avoid a history change. - if (hash === '' || (hash === 'top' && a.ownerDocument.getElementById('top') === null)) { - scrollTo({ top: 0 }); - } else { - const element = a.ownerDocument.getElementById(decodeURIComponent(hash)); - if (element) { - element.scrollIntoView(); - element.focus(); - } - } - - return; - } - // set this flag to distinguish between navigations triggered by - // clicking a hash link and those triggered by popstate - hash_navigating = true; - - update_scroll_positions(current_history_index); - - update_url(url); - - if (!options.replace_state) return; - - // hashchange event shouldn't occur if the router is replacing state. - hash_navigating = false; - } - - event.preventDefault(); - - // allow the browser to repaint before navigating — - // this prevents INP scores being penalised - await new Promise((fulfil) => { - requestAnimationFrame(() => { - setTimeout(fulfil, 0); - }); - - setTimeout(fulfil, 100); // fallback for edge case where rAF doesn't fire because e.g. tab was backgrounded - }); - - await navigate({ - type: 'link', - url, - keepfocus: options.keepfocus, - noscroll: options.noscroll, - replace_state: options.replace_state ?? url.href === location.href, - event - }); - }); - - container.addEventListener('submit', (event) => { - if (event.defaultPrevented) return; - - const form = /** @type {HTMLFormElement} */ ( - HTMLFormElement.prototype.cloneNode.call(event.target) - ); - - const submitter = /** @type {HTMLButtonElement | HTMLInputElement | null} */ (event.submitter); - - const target = submitter?.formTarget || form.target; - - if (target === '_blank') return; - - const method = submitter?.formMethod || form.method; - - if (method !== 'get') return; - - // It is impossible to use form actions with hash router, so we just ignore handling them here - const url = new URL( - (submitter?.hasAttribute('formaction') && submitter?.formAction) || form.action - ); - - if (is_external_url(url, base, false)) return; - - const event_form = /** @type {HTMLFormElement} */ (event.target); - - const options = get_router_options(event_form); - if (options.reload) return; - - event.preventDefault(); - event.stopPropagation(); - - const data = new FormData(event_form, submitter); - - // @ts-expect-error `URLSearchParams(fd)` is kosher, but typescript doesn't know that - url.search = new URLSearchParams(data).toString(); - - void navigate({ - type: 'form', - url, - keepfocus: options.keepfocus, - noscroll: options.noscroll, - replace_state: options.replace_state ?? url.href === location.href, - event - }); - }); - - addEventListener('popstate', async (event) => { - if (resetting_focus) return; - - if (event.state?.[HISTORY_INDEX]) { - const history_index = event.state[HISTORY_INDEX]; - token = {}; - - // if a popstate-driven navigation is cancelled, we need to counteract it - // with history.go, which means we end up back here, hence this check - if (history_index === current_history_index) return; - - const scroll = scroll_positions[history_index]; - const state = event.state[STATES_KEY] ?? {}; - const url = new URL(event.state[PAGE_URL_KEY] ?? location.href); - const navigation_index = event.state[NAVIGATION_INDEX]; - const is_hash_change = current.url ? strip_hash(location) === strip_hash(current.url) : false; - const shallow = - navigation_index === current_navigation_index && (has_navigated || is_hash_change); - - if (shallow) { - // We don't need to navigate, we just need to update scroll and/or state. - // This happens with hash links and `pushState`/`replaceState`. The - // exception is if we haven't navigated yet, since we could have - // got here after a modal navigation then a reload - if (state !== page.state) { - page.state = state; - } - - update_url(url); - - scroll_positions[current_history_index] = scroll_state(); - if (scroll) scrollTo(scroll.x, scroll.y); - - current_history_index = history_index; - return; - } - - const delta = history_index - current_history_index; - - await navigate({ - type: 'popstate', - url, - popped: { - state, - scroll, - delta - }, - accept: () => { - current_history_index = history_index; - current_navigation_index = navigation_index; - }, - block: () => { - history.go(-delta); - }, - nav_token: token, - event - }); - } else { - // since popstate event is also emitted when an anchor referencing the same - // document is clicked, we have to check that the router isn't already handling - // the navigation. otherwise we would be updating the page store twice. - if (!hash_navigating) { - const url = new URL(location.href); - update_url(url); - - // if the user edits the hash via the browser URL bar, trigger a full-page - // reload to align with pathname router behavior - if (app.hash) { - location.reload(); - } - } - } - }); - - addEventListener('hashchange', () => { - // if the hashchange happened as a result of clicking on a link, - // we need to update history, otherwise we have to leave it alone - if (hash_navigating) { - hash_navigating = false; - history.replaceState( - { - ...history.state, - [HISTORY_INDEX]: ++current_history_index, - [NAVIGATION_INDEX]: current_navigation_index - }, - '', - location.href - ); - } - }); - - // fix link[rel=icon], because browsers will occasionally try to load relative - // URLs after a pushState/replaceState, resulting in a 404 — see - // https://github.com/sveltejs/kit/issues/3748#issuecomment-1125980897 - for (const link of document.querySelectorAll('link')) { - if (ICON_REL_ATTRIBUTES.has(link.rel)) { - link.href = link.href; // eslint-disable-line - } - } - - addEventListener('pageshow', (event) => { - // If the user navigates to another site and then uses the back button and - // bfcache hits, we need to set navigating to null, the site doesn't know - // the navigation away from it was successful. - // Info about bfcache here: https://web.dev/bfcache - if (event.persisted) { - stores.navigating.set((navigating.current = null)); - } - }); - - /** - * @param {URL} url - */ - function update_url(url) { - current.url = page.url = url; - stores.page.set(clone_page(page)); - stores.page.notify(); - } -} - -/** - * @param {HTMLElement} target - * @param {import('./types.js').HydrateOptions} opts - */ -async function _hydrate( - target, - { status = 200, error, node_ids, params, route, server_route, data: server_data_nodes, form } -) { - hydrated = true; - - const url = new URL(location.href); - - /** @type {import('types').CSRRoute | undefined} */ - let parsed_route; - - if (__SVELTEKIT_CLIENT_ROUTING__) { - if (!__SVELTEKIT_EMBEDDED__) { - // See https://github.com/sveltejs/kit/pull/4935#issuecomment-1328093358 for one motivation - // of determining the params on the client side. - ({ params = {}, route = { id: null } } = (await get_navigation_intent(url, false)) || {}); - } - - parsed_route = routes.find(({ id }) => id === route.id); - } else { - // undefined in case of 404 - if (server_route) { - parsed_route = route = parse_server_route(server_route, app.nodes); - } else { - route = { id: null }; - params = {}; - } - } - - /** @type {import('./types.js').NavigationFinished | undefined} */ - let result; - let hydrate = true; - - try { - const branch_promises = node_ids.map(async (n, i) => { - const server_data_node = server_data_nodes[i]; - // Type isn't completely accurate, we still need to deserialize uses - if (server_data_node?.uses) { - server_data_node.uses = deserialize_uses(server_data_node.uses); - } - - return load_node({ - loader: app.nodes[n], - url, - params, - route, - parent: async () => { - const data = {}; - for (let j = 0; j < i; j += 1) { - Object.assign(data, (await branch_promises[j]).data); - } - return data; - }, - server_data_node: create_data_node(server_data_node) - }); - }); - - /** @type {Array} */ - const branch = await Promise.all(branch_promises); - - // server-side will have compacted the branch, reinstate empty slots - // so that error boundaries can be lined up correctly - if (parsed_route) { - const layouts = parsed_route.layouts; - for (let i = 0; i < layouts.length; i++) { - if (!layouts[i]) { - branch.splice(i, 0, undefined); - } - } - } - - result = await get_navigation_result_from_branch({ - url, - params, - branch, - status, - error, - errors: parsed_route?.errors, // TODO load earlier? - form, - route: parsed_route ?? null - }); - } catch (error) { - if (error instanceof Redirect) { - // this is a real edge case — `load` would need to return - // a redirect but only in the browser - await native_navigation(new URL(error.location, location.href)); - return; - } - - result = await load_root_error_page({ - status: get_status(error), - error: await handle_error(error, { url, params, route }), - url, - route - }); - - target.textContent = ''; - hydrate = false; - } finally { - query_responses = {}; - } - - if (result.props.page) { - result.props.page.state = {}; - } - - await initialize(result, target, hydrate); -} - -/** - * @param {URL} url - * @param {boolean[]} invalid - * @returns {Promise} - */ -async function load_data(url, invalid) { - const data_url = new URL(url); - data_url.pathname = add_data_suffix(url.pathname); - if (url.pathname.endsWith('/')) { - data_url.searchParams.append(TRAILING_SLASH_PARAM, '1'); - } - if (DEV && url.searchParams.has(INVALIDATED_PARAM)) { - throw new Error(`Cannot used reserved query parameter "${INVALIDATED_PARAM}"`); - } - data_url.searchParams.append(INVALIDATED_PARAM, invalid.map((i) => (i ? '1' : '0')).join('')); - - // use window.fetch directly to allow using a 3rd party-patched fetch implementation - const fetcher = DEV ? dev_fetch : window.fetch; - const res = await fetcher(data_url.href, {}); - - if (!res.ok) { - // error message is a JSON-stringified string which devalue can't handle at the top level - // turn it into a HttpError to not call handleError on the client again (was already handled on the server) - // if `__data.json` doesn't exist or the server has an internal error, - // avoid parsing the HTML error page as a JSON - /** @type {string | undefined} */ - let message; - if (res.headers.get('content-type')?.includes('application/json')) { - message = await res.json(); - } else if (res.status === 404) { - message = 'Not Found'; - } else if (res.status === 500) { - message = 'Internal Error'; - } - throw new HttpError(res.status, message); - } - - // TODO: fix eslint error / figure out if it actually applies to our situation - // eslint-disable-next-line - return new Promise(async (resolve) => { - /** - * Map of deferred promises that will be resolved by a subsequent chunk of data - * @type {Map} - */ - const deferreds = new Map(); - const reader = /** @type {ReadableStream} */ (res.body).getReader(); - - /** - * @param {any} data - */ - function deserialize(data) { - return devalue.unflatten(data, { - ...app.decoders, - Promise: (id) => { - return new Promise((fulfil, reject) => { - deferreds.set(id, { fulfil, reject }); - }); - } - }); - } - - let text = ''; - - while (true) { - // Format follows ndjson (each line is a JSON object) or regular JSON spec - const { done, value } = await reader.read(); - if (done && !text) break; - - text += !value && text ? '\n' : text_decoder.decode(value, { stream: true }); // no value -> final chunk -> add a new line to trigger the last parse - - while (true) { - const split = text.indexOf('\n'); - if (split === -1) { - break; - } - - const node = JSON.parse(text.slice(0, split)); - text = text.slice(split + 1); - - if (node.type === 'redirect') { - return resolve(node); - } - - if (node.type === 'data') { - // This is the first (and possibly only, if no pending promises) chunk - node.nodes?.forEach((/** @type {any} */ node) => { - if (node?.type === 'data') { - node.uses = deserialize_uses(node.uses); - node.data = deserialize(node.data); - } - }); - - resolve(node); - } else if (node.type === 'chunk') { - // This is a subsequent chunk containing deferred data - const { id, data, error } = node; - const deferred = /** @type {import('types').Deferred} */ (deferreds.get(id)); - deferreds.delete(id); - - if (error) { - deferred.reject(deserialize(error)); - } else { - deferred.fulfil(deserialize(data)); - } - } - } - } - }); - - // TODO edge case handling necessary? stream() read fails? -} - -/** - * @param {any} uses - * @return {import('types').Uses} - */ -function deserialize_uses(uses) { - return { - dependencies: new Set(uses?.dependencies ?? []), - params: new Set(uses?.params ?? []), - parent: !!uses?.parent, - route: !!uses?.route, - url: !!uses?.url, - search_params: new Set(uses?.search_params ?? []) - }; -} - -/** - * This flag is used to avoid client-side navigation when we're only using - * `location.replace()` to set focus. - */ -let resetting_focus = false; - -/** - * @param {URL} url - * @param {boolean} [scroll] - */ -function reset_focus(url, scroll = true) { - const autofocus = document.querySelector('[autofocus]'); - if (autofocus) { - // @ts-ignore - autofocus.focus(); - } else { - // Reset page selection and focus - - // Mimic the browsers' behaviour and set the sequential focus navigation - // starting point to the fragment identifier. - const id = get_id(url); - if (id && document.getElementById(id)) { - const { x, y } = scroll_state(); - - // `element.focus()` doesn't work on Safari and Firefox Ubuntu so we need - // to use this hack with `location.replace()` instead. - setTimeout(() => { - const history_state = history.state; - - resetting_focus = true; - location.replace(new URL(`#${id}`, location.href)); - - // Firefox has a bug that sets the history state to `null` so we need to - // restore it after. See https://bugzilla.mozilla.org/show_bug.cgi?id=1199924 - // This is also needed to restore the original hash if we're using hash routing - history.replaceState(history_state, '', url); - - // If scroll management has already happened earlier, we need to restore - // the scroll position after setting the sequential focus navigation starting point - if (scroll) scrollTo(x, y); - resetting_focus = false; - }); - } else { - // If the ID doesn't exist, we try to mimic browsers' behaviour as closely - // as possible by targeting the first scrollable region. Unfortunately, it's - // not a perfect match — e.g. shift-tabbing won't immediately cycle up from - // the end of the page on Chromium - // See https://html.spec.whatwg.org/multipage/interaction.html#get-the-focusable-area - const root = document.body; - const tabindex = root.getAttribute('tabindex'); - - root.tabIndex = -1; - // TODO: remove this when we switch to TypeScript 6 - // @ts-ignore options.focusVisible is only typed in TypeScript 6 - // See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility - root.focus({ preventScroll: true, focusVisible: false }); - - // restore `tabindex` as to prevent `root` from stealing input from elements - if (tabindex !== null) { - root.setAttribute('tabindex', tabindex); - } else { - root.removeAttribute('tabindex'); - } - } - - // capture current selection, so we can compare the state after - // snapshot restoration and afterNavigate callbacks have run - const selection = getSelection(); - - if (selection && selection.type !== 'None') { - /** @type {Range[]} */ - const ranges = []; - - for (let i = 0; i < selection.rangeCount; i += 1) { - ranges.push(selection.getRangeAt(i)); - } - - setTimeout(() => { - if (selection.rangeCount !== ranges.length) return; - - for (let i = 0; i < selection.rangeCount; i += 1) { - const a = ranges[i]; - const b = selection.getRangeAt(i); - - // we need to do a deep comparison rather than just `a !== b` because - // Safari behaves differently to other browsers - if ( - a.commonAncestorContainer !== b.commonAncestorContainer || - a.startContainer !== b.startContainer || - a.endContainer !== b.endContainer || - a.startOffset !== b.startOffset || - a.endOffset !== b.endOffset - ) { - return; - } - } - - // if the selection hasn't changed (as a result of an element being (auto)focused, - // or a programmatic selection, we reset everything as part of the navigation) - // fixes https://github.com/sveltejs/kit/issues/8439 - selection.removeAllRanges(); - }); - } - } -} - -/** - * @template {import('@sveltejs/kit').NavigationType} T - * @param {import('./types.js').NavigationState} current - * @param {import('./types.js').NavigationIntent | undefined} intent - * @param {URL | null} url - * @param {T} type - * @param {{ x: number, y: number } | null} [target_scroll] The scroll position for the target (for popstate navigations) - */ -function create_navigation(current, intent, url, type, target_scroll = null) { - /** @type {(value: any) => void} */ - let fulfil; - - /** @type {(error: any) => void} */ - let reject; - - const complete = new Promise((f, r) => { - fulfil = f; - reject = r; - }); - - // Handle any errors off-chain so that it doesn't show up as an unhandled rejection - complete.catch(noop); - - /** @type {(import('@sveltejs/kit').Navigation | import('@sveltejs/kit').AfterNavigate) & { type: T }} */ - const navigation = /** @type {any} */ ({ - from: { - params: current.params, - route: { id: current.route?.id ?? null }, - url: current.url, - scroll: scroll_state() - }, - to: url && { - params: intent?.params ?? null, - route: { id: intent?.route?.id ?? null }, - url, - scroll: target_scroll - }, - willUnload: !intent, - type, - complete - }); - - return { - navigation, - // @ts-expect-error - fulfil, - // @ts-expect-error - reject - }; -} - -/** - * TODO: remove this in 3.0 when the page store is also removed - * - * We need to assign a new page object so that subscribers are correctly notified. - * However, spreading `{ ...page }` returns an empty object so we manually - * assign to each property instead. - * - * @param {import('@sveltejs/kit').Page} page - */ -function clone_page(page) { - return { - data: page.data, - error: page.error, - form: page.form, - params: page.params, - route: page.route, - state: page.state, - status: page.status, - url: page.url - }; -} - -/** - * @param {URL} url - * @returns {URL} - */ -function decode_hash(url) { - const new_url = new URL(url); - // Safari, for some reason, does change # to %23, when entered through the address bar - new_url.hash = decodeURIComponent(url.hash); - return new_url; -} - -/** - * @param {URL} url - * @returns {string} - */ -function get_id(url) { - let id; - - if (app.hash) { - const [, , second] = url.hash.split('#', 3); - id = second ?? ''; - } else { - id = url.hash.slice(1); - } - - return decodeURIComponent(id); -} - -if (DEV) { - // Nasty hack to silence harmless warnings the user can do nothing about - const console_warn = console.warn; - console.warn = function warn(...args) { - if ( - args.length === 1 && - /<(Layout|Page|Error)(_[\w$]+)?> was created (with unknown|without expected) prop '(data|form)'/.test( - args[0] - ) - ) { - return; - } - console_warn(...args); - }; - - if (import.meta.hot) { - import.meta.hot.on('vite:beforeUpdate', () => { - if (errored) { - location.reload(); - } - }); - } -} diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/client/constants.js b/frontend/node_modules/@sveltejs/kit/src/runtime/client/constants.js deleted file mode 100644 index 982c25d..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/client/constants.js +++ /dev/null @@ -1,16 +0,0 @@ -export const SNAPSHOT_KEY = 'sveltekit:snapshot'; -export const SCROLL_KEY = 'sveltekit:scroll'; -export const STATES_KEY = 'sveltekit:states'; -export const PAGE_URL_KEY = 'sveltekit:pageurl'; - -export const HISTORY_INDEX = 'sveltekit:history'; -export const NAVIGATION_INDEX = 'sveltekit:navigation'; - -export const PRELOAD_PRIORITIES = /** @type {const} */ ({ - tap: 1, - hover: 2, - viewport: 3, - eager: 4, - off: -1, - false: -1 -}); diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/client/entry.js b/frontend/node_modules/@sveltejs/kit/src/runtime/client/entry.js deleted file mode 100644 index 74b0fb2..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/client/entry.js +++ /dev/null @@ -1,3 +0,0 @@ -// we expose this as a separate entry point (rather than treating client.js as the entry point) -// so that everything other than `start`/`load_css` can be treeshaken -export { start, load_css } from './client.js'; diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/client/fetcher.js b/frontend/node_modules/@sveltejs/kit/src/runtime/client/fetcher.js deleted file mode 100644 index f832c67..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/client/fetcher.js +++ /dev/null @@ -1,179 +0,0 @@ -import { BROWSER, DEV } from 'esm-env'; -import { noop } from '../../utils/functions.js'; -import { hash } from '../../utils/hash.js'; -import { base64_decode } from '../utils.js'; - -let loading = 0; - -/** @type {typeof fetch} */ -const native_fetch = BROWSER ? window.fetch : /** @type {any} */ (noop); - -export function lock_fetch() { - loading += 1; -} - -export function unlock_fetch() { - loading -= 1; -} - -if (DEV && BROWSER) { - let can_inspect_stack_trace = false; - - // detect whether async stack traces work - // eslint-disable-next-line @typescript-eslint/require-await - const check_stack_trace = async () => { - const stack = /** @type {string} */ (new Error().stack); - can_inspect_stack_trace = stack.includes('check_stack_trace'); - }; - - void check_stack_trace(); - - /** - * @param {RequestInfo | URL} input - * @param {RequestInit & Record | undefined} init - */ - window.fetch = (input, init) => { - // Check if fetch was called via load_node. the lock method only checks if it was called at the - // same time, but not necessarily if it was called from `load`. - // We use just the filename as the method name sometimes does not appear on the CI. - const url = input instanceof Request ? input.url : input.toString(); - const stack_array = /** @type {string} */ (new Error().stack).split('\n'); - // We need to do a cutoff because Safari and Firefox maintain the stack - // across events and for example traces a `fetch` call triggered from a button - // back to the creation of the event listener and the element creation itself, - // where at some point client.js will show up, leading to false positives. - const cutoff = stack_array.findIndex((a) => a.includes('load@') || a.includes('at load')); - const stack = stack_array.slice(0, cutoff + 2).join('\n'); - - const in_load_heuristic = can_inspect_stack_trace - ? stack.includes('src/runtime/client/client.js') - : loading; - - // This flag is set in initial_fetch and subsequent_fetch - const used_kit_fetch = init?.__sveltekit_fetch__; - - if (in_load_heuristic && !used_kit_fetch) { - console.warn( - `Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://svelte.dev/docs/kit/load#making-fetch-requests` - ); - } - - const method = input instanceof Request ? input.method : init?.method || 'GET'; - - if (method !== 'GET') { - cache.delete(build_selector(input)); - } - - return native_fetch(input, init); - }; -} else if (BROWSER) { - window.fetch = (input, init) => { - const method = input instanceof Request ? input.method : init?.method || 'GET'; - - if (method !== 'GET') { - cache.delete(build_selector(input)); - } - - return native_fetch(input, init); - }; -} - -const cache = new Map(); - -/** - * Should be called on the initial run of load functions that hydrate the page. - * Saves any requests with cache-control max-age to the cache. - * @param {URL | string} resource - * @param {RequestInit} [opts] - */ -export function initial_fetch(resource, opts) { - const selector = build_selector(resource, opts); - - const script = document.querySelector(selector); - if (script?.textContent) { - script.remove(); // In case multiple script tags match the same selector - let { body, ...init } = JSON.parse(script.textContent); - - const ttl = script.getAttribute('data-ttl'); - if (ttl) cache.set(selector, { body, init, ttl: 1000 * Number(ttl) }); - const b64 = script.getAttribute('data-b64'); - if (b64 !== null) { - // Can't use native_fetch('data:...;base64,${body}') - // csp can block the request - body = base64_decode(body); - } - - return Promise.resolve(new Response(body, init)); - } - - return DEV ? dev_fetch(resource, opts) : window.fetch(resource, opts); -} - -/** - * Tries to get the response from the cache, if max-age allows it, else does a fetch. - * @param {URL | string} resource - * @param {string} resolved - * @param {RequestInit} [opts] - */ -export function subsequent_fetch(resource, resolved, opts) { - if (cache.size > 0) { - const selector = build_selector(resource, opts); - const cached = cache.get(selector); - if (cached) { - // https://developer.mozilla.org/en-US/docs/Web/API/Request/cache#value - if ( - performance.now() < cached.ttl && - ['default', 'force-cache', 'only-if-cached', undefined].includes(opts?.cache) - ) { - return new Response(cached.body, cached.init); - } - - cache.delete(selector); - } - } - - return DEV ? dev_fetch(resolved, opts) : window.fetch(resolved, opts); -} - -/** - * @param {RequestInfo | URL} resource - * @param {RequestInit & Record | undefined} opts - */ -export function dev_fetch(resource, opts) { - const patched_opts = { ...opts }; - // This assigns the __sveltekit_fetch__ flag and makes it non-enumerable - Object.defineProperty(patched_opts, '__sveltekit_fetch__', { - value: true, - writable: true, - configurable: true - }); - return window.fetch(resource, patched_opts); -} - -/** - * Build the cache key for a given request - * @param {URL | RequestInfo} resource - * @param {RequestInit} [opts] - */ -function build_selector(resource, opts) { - const url = JSON.stringify(resource instanceof Request ? resource.url : resource); - - let selector = `script[data-sveltekit-fetched][data-url=${url}]`; - - if (opts?.headers || opts?.body) { - /** @type {import('types').StrictBody[]} */ - const values = []; - - if (opts.headers) { - values.push([...new Headers(opts.headers)].join(',')); - } - - if (opts.body && (typeof opts.body === 'string' || ArrayBuffer.isView(opts.body))) { - values.push(opts.body); - } - - selector += `[data-hash="${hash(...values)}"]`; - } - - return selector; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/client/parse.js b/frontend/node_modules/@sveltejs/kit/src/runtime/client/parse.js deleted file mode 100644 index 20445fc..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/client/parse.js +++ /dev/null @@ -1,77 +0,0 @@ -import { exec, parse_route_id } from '../../utils/routing.js'; - -/** - * @param {import('./types.js').SvelteKitApp} app - * @returns {import('types').CSRRoute[]} - */ -export function parse({ nodes, server_loads, dictionary, matchers }) { - const layouts_with_server_load = new Set(server_loads); - - return Object.entries(dictionary).map(([id, [leaf, layouts, errors]]) => { - const { pattern, params } = parse_route_id(id); - - /** @type {import('types').CSRRoute} */ - const route = { - id, - /** @param {string} path */ - exec: (path) => { - const match = pattern.exec(path); - if (match) return exec(match, params, matchers); - }, - errors: [1, ...(errors || [])].map((n) => nodes[n]), - layouts: [0, ...(layouts || [])].map(create_layout_loader), - leaf: create_leaf_loader(leaf) - }; - - // bit of a hack, but ensures that layout/error node lists are the same - // length, without which the wrong data will be applied if the route - // manifest looks like `[[a, b], [c,], d]` - route.errors.length = route.layouts.length = Math.max( - route.errors.length, - route.layouts.length - ); - - return route; - }); - - /** - * @param {number} id - * @returns {[boolean, import('types').CSRPageNodeLoader]} - */ - function create_leaf_loader(id) { - // whether or not the route uses the server data is - // encoded using the ones' complement, to save space - const uses_server_data = id < 0; - if (uses_server_data) id = ~id; - return [uses_server_data, nodes[id]]; - } - - /** - * @param {number | undefined} id - * @returns {[boolean, import('types').CSRPageNodeLoader] | undefined} - */ - function create_layout_loader(id) { - // whether or not the layout uses the server data is - // encoded in the layouts array, to save space - return id === undefined ? id : [layouts_with_server_load.has(id), nodes[id]]; - } -} - -/** - * @param {import('types').CSRRouteServer} input - * @param {import('types').CSRPageNodeLoader[]} app_nodes Will be modified if a new node is loaded that's not already in the array - * @returns {import('types').CSRRoute} - */ -export function parse_server_route({ nodes, id, leaf, layouts, errors }, app_nodes) { - return { - id, - exec: () => ({}), // dummy function; exec already happened on the server - // By writing to app_nodes only when a loader at that index is not already defined, - // we ensure that loaders have referential equality when they load the same node. - // Code elsewhere in client.js relies on this referential equality to determine - // if a loader is different and should therefore (re-)run. - errors: errors.map((n) => (n ? (app_nodes[n] ||= nodes[n]) : undefined)), - layouts: layouts.map((n) => (n ? [n[0], (app_nodes[n[1]] ||= nodes[n[1]])] : undefined)), - leaf: [leaf[0], (app_nodes[leaf[1]] ||= nodes[leaf[1]])] - }; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/command.svelte.js b/frontend/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/command.svelte.js deleted file mode 100644 index bde0e60..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/command.svelte.js +++ /dev/null @@ -1,119 +0,0 @@ -/** @import { RemoteCommand, RemoteQueryUpdate } from '@sveltejs/kit' */ -/** @import { RemoteFunctionResponse } from 'types' */ -import { app_dir, base } from '$app/paths/internal/client'; -import * as devalue from 'devalue'; -import { HttpError } from '@sveltejs/kit/internal'; -import { app } from '../client.js'; -import { stringify_remote_arg } from '../../shared.js'; -import { - get_remote_request_headers, - apply_refreshes, - categorize_updates -} from './shared.svelte.js'; - -/** - * Client-version of the `command` function from `$app/server`. - * @param {string} id - * @returns {RemoteCommand} - */ -export function command(id) { - /** @type {number} */ - let pending_count = $state(0); - - // Careful: This function MUST be synchronous (can't use the async keyword) because the return type has to be a promise with an updates() method. - // If we make it async, the return type will be a promise that resolves to a promise with an updates() method, which is not what we want. - /** @type {RemoteCommand} */ - const command_function = (arg) => { - let overrides = /** @type {Array<() => void> | null} */ (null); - - /** @type {Set | null} */ - let refreshes = null; - - /** @type {Error | undefined} */ - let updates_error; - - // Increment pending count when command starts - pending_count++; - - // No one should call commands during rendering, but this is belt and braces. - // Do this here, after Svelte's reactivity context is gone. - const headers = { - 'Content-Type': 'application/json', - ...get_remote_request_headers() - }; - - /** @type {Promise & { updates: (...args: RemoteQueryUpdate[]) => Promise }} */ - const promise = (async () => { - try { - // Wait a tick to give room for the `updates` method to be called - await Promise.resolve(); - - if (updates_error) { - throw updates_error; - } - - const response = await fetch(`${base}/${app_dir}/remote/${id}`, { - method: 'POST', - body: JSON.stringify({ - payload: stringify_remote_arg(arg, app.hooks.transport, false), - refreshes: Array.from(refreshes ?? []) - }), - headers - }); - - if (!response.ok) { - // We only end up here in case of a network error or if the server has an internal error - // (which shouldn't happen because we handle errors on the server and always send a 200 response) - throw new Error('Failed to execute remote function'); - } - - const result = /** @type {RemoteFunctionResponse} */ (await response.json()); - if (result.type === 'redirect') { - throw new Error( - 'Redirects are not allowed in commands. Return a result instead and use goto on the client' - ); - } else if (result.type === 'error') { - throw new HttpError(result.status ?? 500, result.error); - } else { - if (result.refreshes) { - apply_refreshes(result.refreshes); - } - - return devalue.parse(result.result, app.decoders); - } - } finally { - overrides?.forEach((fn) => fn()); - - // Decrement pending count when command completes - pending_count--; - } - })(); - - let updates_called = false; - promise.updates = (...args) => { - if (updates_called) { - console.warn( - 'Updates can only be sent once per command invocation. Ignoring additional updates.' - ); - return promise; - } - updates_called = true; - - try { - ({ refreshes, overrides } = categorize_updates(args)); - } catch (error) { - updates_error = /** @type {Error} */ (error); - } - - return promise; - }; - - return promise; - }; - - Object.defineProperty(command_function, 'pending', { - get: () => pending_count - }); - - return command_function; -} diff --git a/frontend/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/form.svelte.js b/frontend/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/form.svelte.js deleted file mode 100644 index 6aa9032..0000000 --- a/frontend/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/form.svelte.js +++ /dev/null @@ -1,673 +0,0 @@ -/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ -/** @import { RemoteFormInput, RemoteForm, RemoteQueryUpdate } from '@sveltejs/kit' */ -/** @import { InternalRemoteFormIssue, RemoteFunctionResponse } from 'types' */ -import { app_dir, base } from '$app/paths/internal/client'; -import * as devalue from 'devalue'; -import { DEV } from 'esm-env'; -import { HttpError } from '@sveltejs/kit/internal'; -import { app, query_responses, _goto, set_nearest_error_page, invalidateAll } from '../client.js'; -import { tick } from 'svelte'; -import { apply_refreshes, categorize_updates } from './shared.svelte.js'; -import { createAttachmentKey } from 'svelte/attachments'; -import { - convert_formdata, - flatten_issues, - create_field_proxy, - deep_set, - set_nested_value, - throw_on_old_property_access, - build_path_string, - normalize_issue, - serialize_binary_form, - BINARY_FORM_CONTENT_TYPE -} from '../../form-utils.js'; - -/** - * Merge client issues into server issues. Server issues are persisted unless - * a client-issue exists for the same path, in which case the client-issue overrides it. - * @param {FormData} form_data - * @param {InternalRemoteFormIssue[]} current_issues - * @param {InternalRemoteFormIssue[]} client_issues - * @returns {InternalRemoteFormIssue[]} - */ -function merge_with_server_issues(form_data, current_issues, client_issues) { - const merged = [ - ...current_issues.filter( - (issue) => issue.server && !client_issues.some((i) => i.name === issue.name) - ), - ...client_issues - ]; - - const keys = Array.from(form_data.keys()); - - return merged.sort((a, b) => keys.indexOf(a.name) - keys.indexOf(b.name)); -} - -/** - * Client-version of the `form` function from `$app/server`. - * @template {RemoteFormInput} T - * @template U - * @param {string} id - * @returns {RemoteForm} - */ -export function form(id) { - /** @type {Map }>} */ - const instances = new Map(); - - /** @param {string | number | boolean} [key] */ - function create_instance(key) { - const action_id_without_key = id; - const action_id = id + (key != undefined ? `/${JSON.stringify(key)}` : ''); - const action = '?/remote=' + encodeURIComponent(action_id); - - /** - * @type {Record} - */ - let input = $state({}); - - /** @type {InternalRemoteFormIssue[]} */ - let raw_issues = $state.raw([]); - - const issues = $derived(flatten_issues(raw_issues)); - - /** @type {any} */ - let result = $state.raw(query_responses[action_id]); - - /** @type {number} */ - let pending_count = $state(0); - - /** @type {StandardSchemaV1 | undefined} */ - let preflight_schema = undefined; - - /** @type {HTMLFormElement | null} */ - let element = null; - - /** @type {Record} */ - let touched = {}; - - let submitted = false; - - /** - * @param {FormData} form_data - * @returns {Record} - */ - function convert(form_data) { - const data = convert_formdata(form_data); - if (key !== undefined && !form_data.has('id')) { - data.id = key; - } - return data; - } - - /** - * @param {HTMLFormElement} form - * @param {FormData} form_data - * @param {Parameters['enhance']>[0]} callback - */ - async function handle_submit(form, form_data, callback) { - const data = convert(form_data); - - submitted = true; - - // Increment pending count immediately so that `pending` reflects - // the in-progress state during async preflight validation - pending_count++; - - const validated = await preflight_schema?.['~standard'].validate(data); - - if (validated?.issues) { - raw_issues = merge_with_server_issues( - form_data, - raw_issues, - validated.issues.map((issue) => normalize_issue(issue, false)) - ); - pending_count--; - return; - } - - // Preflight passed - clear stale client-side preflight issues - if (preflight_schema) { - raw_issues = raw_issues.filter((issue) => issue.server); - } - - // TODO 3.0 remove this warning - if (DEV) { - const error = () => { - throw new Error( - 'Remote form functions no longer get passed a FormData object. The payload is now a POJO. See https://kit.svelte.dev/docs/remote-functions#form for details.' - ); - }; - for (const key of [ - 'append', - 'delete', - 'entries', - 'forEach', - 'get', - 'getAll', - 'has', - 'keys', - 'set', - 'values' - ]) { - if (!(key in data)) { - Object.defineProperty(data, key, { get: error }); - } - } - } - - try { - // eslint-disable-next-line @typescript-eslint/await-thenable -- `callback` is typed as returning `void` to allow returning e.g. `Promise` - await callback({ - form, - data, - submit: () => submit(form_data) - }); - } catch (e) { - const error = e instanceof HttpError ? e.body : { message: /** @type {any} */ (e).message }; - const status = e instanceof HttpError ? e.status : 500; - void set_nearest_error_page(error, status); - } finally { - pending_count--; - } - } - - /** - * @param {FormData} data - * @returns {Promise & { updates: (...args: any[]) => Promise }} - */ - function submit(data) { - // Store a reference to the current instance and increment the usage count for the duration - // of the request. This ensures that the instance is not deleted in case of an optimistic update - // (e.g. when deleting an item in a list) that fails and wants to surface an error to the user afterwards. - // If the instance would be deleted in the meantime, the error property would be assigned to the old, - // no-longer-visible instance, so it would never be shown to the user. - const entry = instances.get(key); - if (entry) { - entry.count++; - } - - let overrides = /** @type {Array<() => void> | null} */ (null); - - /** @type {Set | null} */ - let refreshes = null; - - /** @type {Error | undefined} */ - let updates_error; - - /** @type {Promise & { updates: (...args: RemoteQueryUpdate[]) => Promise }} */ - const promise = (async () => { - try { - await Promise.resolve(); - - if (updates_error) { - throw updates_error; - } - - const { blob } = serialize_binary_form(convert(data), { - remote_refreshes: Array.from(refreshes ?? []) - }); - - const response = await fetch(`${base}/${app_dir}/remote/${action_id_without_key}`, { - method: 'POST', - headers: { - 'Content-Type': BINARY_FORM_CONTENT_TYPE, - // Forms cannot be called during rendering, so it's save to use location here - 'x-sveltekit-pathname': location.pathname, - 'x-sveltekit-search': location.search - }, - body: blob - }); - - if (!response.ok) { - // We only end up here in case of a network error or if the server has an internal error - // (which shouldn't happen because we handle errors on the server and always send a 200 response) - throw new Error('Failed to execute remote function'); - } - - const form_result = /** @type { RemoteFunctionResponse} */ (await response.json()); - - // reset issues in case it's a redirect or error (but issues passed in that case) - raw_issues = []; - result = undefined; - - if (form_result.type === 'result') { - ({ issues: raw_issues = [], result } = devalue.parse(form_result.result, app.decoders)); - const succeeded = raw_issues.length === 0; - - if (succeeded) { - if (form_result.refreshes) { - apply_refreshes(form_result.refreshes); - } else { - void invalidateAll(); - } - } - - return succeeded; - } else if (form_result.type === 'redirect') { - const stringified_refreshes = form_result.refreshes ?? ''; - if (stringified_refreshes) { - apply_refreshes(stringified_refreshes); - } - // Use internal version to allow redirects to external URLs - void _goto(form_result.location, { invalidateAll: !stringified_refreshes }, 0); - return true; - } else { - throw new HttpError(form_result.status ?? 500, form_result.error); - } - } catch (e) { - result = undefined; - throw e; - } finally { - overrides?.forEach((fn) => fn()); - - void tick().then(() => { - if (entry) { - entry.count--; - if (entry.count === 0) { - instances.delete(key); - } - } - }); - } - })(); - - let updates_called = false; - promise.updates = (...args) => { - if (updates_called) { - console.warn( - 'Updates can only be sent once per form submission. Ignoring additional updates.' - ); - return promise; - } - updates_called = true; - - try { - ({ refreshes, overrides } = categorize_updates(args)); - } catch (error) { - updates_error = /** @type {Error} */ (error); - } - - return promise; - }; - - return promise; - } - - /** @type {RemoteForm} */ - const instance = {}; - - instance.method = 'POST'; - instance.action = action; - - /** @param {Parameters['enhance']>[0]} callback */ - const form_onsubmit = (callback) => { - /** @param {SubmitEvent} event */ - return async (event) => { - const form = /** @type {HTMLFormElement} */ (event.target); - const method = event.submitter?.hasAttribute('formmethod') - ? /** @type {HTMLButtonElement | HTMLInputElement} */ (event.submitter).formMethod - : clone(form).method; - - if (method !== 'post') return; - - const action = new URL( - // We can't do submitter.formAction directly because that property is always set - event.submitter?.hasAttribute('formaction') - ? /** @type {HTMLButtonElement | HTMLInputElement} */ (event.submitter).formAction - : clone(form).action - ); - - if (action.searchParams.get('/remote') !== action_id) { - return; - } - - const target = event.submitter?.hasAttribute('formtarget') - ? /** @type {HTMLButtonElement | HTMLInputElement} */ (event.submitter).formTarget - : clone(form).target; - - if (target === '_blank') { - return; - } - - event.preventDefault(); - - const form_data = new FormData(form, event.submitter); - - if (DEV) { - validate_form_data(form_data, clone(form).enctype); - } - - await handle_submit(form, form_data, callback); - }; - }; - - /** @param {(event: SubmitEvent) => void} onsubmit */ - function create_attachment(onsubmit) { - return (/** @type {HTMLFormElement} */ form) => { - if (element) { - let message = `A form object can only be attached to a single \`
\` element`; - if (DEV && !key) { - const name = id.split('/').pop(); - message += `. To create multiple instances, use \`${name}.for(key)\``; - } - - throw new Error(message); - } - - element = form; - - touched = {}; - - form.addEventListener('submit', onsubmit); - - /** @param {Event} e */ - const handle_input = (e) => { - // strictly speaking it can be an HTMLTextAreaElement or HTMLSelectElement - // but that makes the types unnecessarily awkward - const element = /** @type {HTMLInputElement} */ (e.target); - - let name = element.name; - if (!name) return; - - const is_array = name.endsWith('[]'); - if (is_array) name = name.slice(0, -2); - - const is_file = element.type === 'file'; - - touched[name] = true; - - if (is_array) { - let value; - - if (element.tagName === 'SELECT') { - value = Array.from( - element.querySelectorAll('option:checked'), - (e) => /** @type {HTMLOptionElement} */ (e).value - ); - } else { - const elements = /** @type {HTMLInputElement[]} */ ( - Array.from(form.querySelectorAll(`[name="${name}[]"]`)) - ); - - if (DEV) { - for (const e of elements) { - if ((e.type === 'file') !== is_file) { - throw new Error( - `Cannot mix and match file and non-file inputs under the same name ("${element.name}")` - ); - } - } - } - - value = is_file - ? elements.map((input) => Array.from(input.files ?? [])).flat() - : elements.map((element) => element.value); - if (element.type === 'checkbox') { - value = /** @type {string[]} */ (value.filter((_, i) => elements[i].checked)); - } - } - - set_nested_value(input, name, value); - } else if (is_file) { - if (DEV && element.multiple) { - throw new Error( - `Can only use the \`multiple\` attribute when \`name\` includes a \`[]\` suffix — consider changing "${name}" to "${name}[]"` - ); - } - - const file = /** @type {HTMLInputElement & { files: FileList }} */ (element).files[0]; - - if (file) { - set_nested_value(input, name, file); - } else { - // Remove the property by setting to undefined and clean up - const path_parts = name.split(/\.|\[|\]/).filter(Boolean); - let current = /** @type {any} */ (input); - for (let i = 0; i < path_parts.length - 1; i++) { - if (current[path_parts[i]] == null) return; - current = current[path_parts[i]]; - } - delete current[path_parts[path_parts.length - 1]]; - } - } else { - set_nested_value( - input, - name, - element.type === 'checkbox' && !element.checked ? null : element.value - ); - } - - name = name.replace(/^[nb]:/, ''); - - touched[name] = true; - }; - - form.addEventListener('input', handle_input); - - const handle_reset = async () => { - // need to wait a moment, because the `reset` event occurs before - // the inputs are actually updated (so that it can be cancelled) - await tick(); - - input = convert_formdata(new FormData(form)); - }; - - form.addEventListener('reset', handle_reset); - - return () => { - form.removeEventListener('submit', onsubmit); - form.removeEventListener('input', handle_input); - form.removeEventListener('reset', handle_reset); - element = null; - preflight_schema = undefined; - }; - }; - } - - instance[createAttachmentKey()] = create_attachment( - form_onsubmit(({ submit, form }) => - submit().then((succeeded) => { - if (succeeded) { - form.reset(); - } - }) - ) - ); - - let validate_id = 0; - - // TODO 3.0 remove - if (DEV) { - throw_on_old_property_access(instance); - - Object.defineProperty(instance, 'buttonProps', { - get() { - throw new Error( - '`form.buttonProps` has been removed: Instead of ` - * ``` - */ - depends: (...deps: Array<`${string}:${string}`>) => void; - /** - * Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example: - * - * ```js - * /// file: src/routes/+page.server.js - * export async function load({ untrack, url }) { - * // Untrack url.pathname so that path changes don't trigger a rerun - * if (untrack(() => url.pathname === '/')) { - * return { message: 'Welcome!' }; - * } - * } - * ``` - */ - untrack: (fn: () => T) => T; - - /** - * Access to spans for tracing. If tracing is not enabled or the function is being run in the browser, these spans will do nothing. - * @since 2.31.0 - */ - tracing: { - /** Whether tracing is enabled. */ - enabled: boolean; - /** The root span for the request. This span is named `sveltekit.handle.root`. */ - root: Span; - /** The span associated with the current `load` function. */ - current: Span; - }; - } - - export interface NavigationEvent< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null - > { - /** - * The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object - */ - params: Params; - /** - * Info about the current route - */ - route: { - /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. - */ - id: RouteId; - }; - /** - * The URL of the current page - */ - url: URL; - } - - /** - * Information about the target of a specific navigation. - */ - export interface NavigationTarget< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null - > { - /** - * Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. - * Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route). - */ - params: Params | null; - /** - * Info about the target route - */ - route: { - /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. - */ - id: RouteId | null; - }; - /** - * The URL that is navigated to - */ - url: URL; - /** - * The scroll position associated with this navigation. - * - * For the `from` target, this is the scroll position at the moment of navigation. - * - * For the `to` target, this represents the scroll position that will be or was restored: - * - In `beforeNavigate` and `onNavigate`, this is only available for `popstate` navigations (back/forward button) - * and will be `null` for other navigation types, since the final scroll position isn't known - * ahead of time. - * - In `afterNavigate`, this is always the scroll position that was applied after the navigation - * completed. - */ - scroll: { x: number; y: number } | null; - } - - /** - * - `enter`: The app has hydrated/started - * - `form`: The user submitted a `` - * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring - * - `link`: Navigation was triggered by a link click - * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect - * - `popstate`: Navigation was triggered by back/forward navigation - */ - export type NavigationType = 'enter' | 'form' | 'leave' | 'link' | 'goto' | 'popstate'; - - export interface NavigationBase { - /** - * Where navigation was triggered from - */ - from: NavigationTarget | null; - /** - * Where navigation is going to/has gone to - */ - to: NavigationTarget | null; - /** - * Whether or not the navigation will result in the page being unloaded (i.e. not a client-side navigation). - */ - willUnload: boolean; - /** - * A promise that resolves once the navigation is complete, and rejects if the navigation - * fails or is aborted. In the case of a `willUnload` navigation, the promise will never resolve - */ - complete: Promise; - } - - export interface NavigationEnter extends NavigationBase { - /** - * The type of navigation: - * - `enter`: The app has hydrated/started - */ - type: 'enter'; - - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; - - /** - * Dispatched `Event` object when navigation occurred by `popstate` or `link`. - */ - event?: undefined; - } - - export type NavigationExternal = NavigationGoto | NavigationLeave; - - export interface NavigationGoto extends NavigationBase { - /** - * The type of navigation: - * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect - */ - type: 'goto'; - - // TODO 3.0 remove this property, so that it only exists when type is 'popstate' - // (would possibly be a breaking change to do it prior to that) - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; - } - - export interface NavigationLeave extends NavigationBase { - /** - * The type of navigation: - * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring - */ - type: 'leave'; - - // TODO 3.0 remove this property, so that it only exists when type is 'popstate' - // (would possibly be a breaking change to do it prior to that) - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; - } - - export interface NavigationFormSubmit extends NavigationBase { - /** - * The type of navigation: - * - `form`: The user submitted a `` - */ - type: 'form'; - - /** - * The `SubmitEvent` that caused the navigation - */ - event: SubmitEvent; - - // TODO 3.0 remove this property, so that it only exists when type is 'popstate' - // (would possibly be a breaking change to do it prior to that) - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; - } - - export interface NavigationPopState extends NavigationBase { - /** - * The type of navigation: - * - `popstate`: Navigation was triggered by back/forward navigation - */ - type: 'popstate'; - - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta: number; - - /** - * The `PopStateEvent` that caused the navigation - */ - event: PopStateEvent; - } - - export interface NavigationLink extends NavigationBase { - /** - * The type of navigation: - * - `link`: Navigation was triggered by a link click - */ - type: 'link'; - - /** - * The `PointerEvent` that caused the navigation - */ - event: PointerEvent; - - // TODO 3.0 remove this property, so that it only exists when type is 'popstate' - // (would possibly be a breaking change to do it prior to that) - /** - * In case of a history back/forward navigation, the number of steps to go back/forward - */ - delta?: undefined; - } - - export type Navigation = - | NavigationExternal - | NavigationFormSubmit - | NavigationPopState - | NavigationLink; - - /** - * The argument passed to [`beforeNavigate`](https://svelte.dev/docs/kit/$app-navigation#beforeNavigate) callbacks. - */ - export type BeforeNavigate = Navigation & { - /** - * Call this to prevent the navigation from starting. - */ - cancel: () => void; - }; - - /** - * The argument passed to [`onNavigate`](https://svelte.dev/docs/kit/$app-navigation#onNavigate) callbacks. - */ - export type OnNavigate = Navigation & { - type: Exclude; - /** - * Since `onNavigate` callbacks are called immediately before a client-side navigation, they will never be called with a navigation that unloads the page. - */ - willUnload: false; - }; - - /** - * The argument passed to [`afterNavigate`](https://svelte.dev/docs/kit/$app-navigation#afterNavigate) callbacks. - */ - export type AfterNavigate = (Navigation | NavigationEnter) & { - type: Exclude; - /** - * Since `afterNavigate` callbacks are called after a navigation completes, they will never be called with a navigation that unloads the page. - */ - willUnload: false; - }; - - /** - * The shape of the [`page`](https://svelte.dev/docs/kit/$app-state#page) reactive object and the [`$page`](https://svelte.dev/docs/kit/$app-stores) store. - */ - export interface Page< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null - > { - /** - * The URL of the current page. - */ - url: URL & { pathname: ResolvedPathname }; - /** - * The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. - */ - params: Params; - /** - * Info about the current route. - */ - route: { - /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. - */ - id: RouteId; - }; - /** - * HTTP status code of the current page. - */ - status: number; - /** - * The error object of the current page, if any. Filled from the `handleError` hooks. - */ - error: App.Error | null; - /** - * The merged result of all data from all `load` functions on the current page. You can type a common denominator through `App.PageData`. - */ - data: App.PageData & Record; - /** - * The page state, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`. - */ - state: App.PageState; - /** - * Filled only after a form submission. See [form actions](https://svelte.dev/docs/kit/form-actions) for more info. - */ - form: any; - } - - /** - * The shape of a param matcher. See [matching](https://svelte.dev/docs/kit/advanced-routing#Matching) for more info. - */ - export type ParamMatcher = (param: string) => boolean; - - /** - * A single entry yielded by [`requested`](https://svelte.dev/docs/kit/$app-server#requested). - * `arg` is the validated argument (the input *after* the query's schema validated and - * transformed it, if applicable); `query` is a `RemoteQuery` bound to the client's - * original cache key, so `refresh()` / `set()` will update the correct client entry. - */ - export type RequestedEntry = { - arg: Validated; - query: RemoteQuery; - }; - - export type RequestedResult = Iterable> & - AsyncIterable> & { - /** - * Call `refresh` on all queries selected by this `requested` invocation. - * This is identical to: - * ```ts - * import { requested } from '$app/server'; - * - * for await (const { query } of requested(getPost, ...)) { - * void query.refresh(); - * } - * ``` - */ - refreshAll: () => Promise; - }; - - export interface RequestEvent< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null - > { - /** - * Get or set cookies related to the current request - */ - cookies: Cookies; - /** - * `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features: - * - * - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request. - * - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context). - * - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call. - * - During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle) - * - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request. - * - * You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies). - */ - fetch: typeof fetch; - /** - * The client's IP address, set by the adapter. - */ - getClientAddress: () => string; - /** - * Contains custom data that was added to the request within the [`server handle hook`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle). - */ - locals: App.Locals; - /** - * The parameters of the current route - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. - */ - params: Params; - /** - * Additional data made available through the adapter. - */ - platform: Readonly | undefined; - /** - * The original request object. - */ - request: Request; - /** - * Info about the current route. - */ - route: { - /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. - */ - id: RouteId; - }; - /** - * If you need to set headers for the response, you can do so using the this method. This is useful if you want the page to be cached, for example: - * - * ```js - * /// file: src/routes/blog/+page.js - * export async function load({ fetch, setHeaders }) { - * const url = `https://cms.example.com/articles.json`; - * const response = await fetch(url); - * - * setHeaders({ - * age: response.headers.get('age'), - * 'cache-control': response.headers.get('cache-control') - * }); - * - * return response.json(); - * } - * ``` - * - * Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once. - * - * You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API instead. - */ - setHeaders: (headers: Record) => void; - /** - * The requested URL. - */ - url: URL; - /** - * `true` if the request comes from the client asking for `+page/layout.server.js` data. The `url` property will be stripped of the internal information - * related to the data request in this case. Use this property instead if the distinction is important to you. - */ - isDataRequest: boolean; - /** - * `true` for `+server.js` calls coming from SvelteKit without the overhead of actually making an HTTP request. This happens when you make same-origin `fetch` requests on the server. - */ - isSubRequest: boolean; - - /** - * Access to spans for tracing. If tracing is not enabled, these spans will do nothing. - * @since 2.31.0 - */ - tracing: { - /** Whether tracing is enabled. */ - enabled: boolean; - /** The root span for the request. This span is named `sveltekit.handle.root`. */ - root: Span; - /** The span associated with the current `handle` hook, `load` function, or form action. */ - current: Span; - }; - - /** - * `true` if the request comes from the client via a remote function. The `url` property will be stripped of the internal information - * related to the data request in this case. Use this property instead if the distinction is important to you. - */ - isRemoteRequest: boolean; - } - - /** - * A `(event: RequestEvent) => Response` function exported from a `+server.js` file that corresponds to an HTTP verb (`GET`, `PUT`, `PATCH`, etc) and handles requests with that method. - * - * It receives `Params` as the first generic argument, which you can skip by using [generated types](https://svelte.dev/docs/kit/types#Generated-types) instead. - */ - export type RequestHandler< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - RouteId extends AppRouteId | null = AppRouteId | null - > = (event: RequestEvent) => MaybePromise; - - export interface ResolveOptions { - /** - * Applies custom transforms to HTML. If `done` is true, it's the final chunk. Chunks are not guaranteed to be well-formed HTML - * (they could include an element's opening tag but not its closing tag, for example) - * but they will always be split at sensible boundaries such as `%sveltekit.head%` or layout/page components. - * @param input the html chunk and the info if this is the last chunk - */ - transformPageChunk?: (input: { html: string; done: boolean }) => MaybePromise; - /** - * Determines which headers should be included in serialized responses when a `load` function loads a resource with `fetch`. - * By default, none will be included. - * @param name header name - * @param value header value - */ - filterSerializedResponseHeaders?: (name: string, value: string) => boolean; - /** - * Determines what should be added to the `` tag to preload it. - * By default, `js` and `css` files will be preloaded. - * @param input the type of the file and its path - */ - preload?: (input: { type: 'font' | 'css' | 'js' | 'asset'; path: string }) => boolean; - } - - export interface RouteDefinition { - id: string; - api: { - methods: Array; - }; - page: { - methods: Array>; - }; - pattern: RegExp; - prerender: PrerenderOption; - segments: RouteSegment[]; - methods: Array; - config: Config; - } - - export class Server { - constructor(manifest: SSRManifest); - init(options: ServerInitOptions): Promise; - respond(request: Request, options: RequestOptions): Promise; - } - - export interface ServerInitOptions { - /** A map of environment variables. */ - env: Record; - /** A function that turns an asset filename into a `ReadableStream`. Required for the `read` export from `$app/server` to work. */ - read?: (file: string) => MaybePromise; - } - - export interface SSRManifest { - appDir: string; - appPath: string; - /** Static files from `kit.config.files.assets` and the service worker (if any). */ - assets: Set; - mimeTypes: Record; - - /** private fields */ - _: { - client: NonNullable; - nodes: SSRNodeLoader[]; - /** hashed filename -> import to that file */ - remotes: Record Promise>; - routes: SSRRoute[]; - prerendered_routes: Set; - matchers: () => Promise>; - /** A `[file]: size` map of all assets imported by server code. */ - server_assets: Record; - }; - } - - /** - * The generic form of `PageServerLoad` and `LayoutServerLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types)) - * rather than using `ServerLoad` directly. - */ - export type ServerLoad< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - ParentData extends Record = Record, - OutputData extends Record | void = Record | void, - RouteId extends AppRouteId | null = AppRouteId | null - > = (event: ServerLoadEvent) => MaybePromise; - - export interface ServerLoadEvent< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - ParentData extends Record = Record, - RouteId extends AppRouteId | null = AppRouteId | null - > extends RequestEvent { - /** - * `await parent()` returns data from parent `+layout.server.js` `load` functions. - * - * Be careful not to introduce accidental waterfalls when using `await parent()`. If for example you only want to merge parent data into the returned output, call it _after_ fetching your other data. - */ - parent: () => Promise; - /** - * This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun. - * - * Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`. - * - * URLs can be absolute or relative to the page being loaded, and must be [encoded](https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding). - * - * Custom identifiers have to be prefixed with one or more lowercase letters followed by a colon to conform to the [URI specification](https://www.rfc-editor.org/rfc/rfc3986.html). - * - * The following example shows how to use `depends` to register a dependency on a custom identifier, which is `invalidate`d after a button click, making the `load` function rerun. - * - * ```js - * /// file: src/routes/+page.js - * let count = 0; - * export async function load({ depends }) { - * depends('increase:count'); - * - * return { count: count++ }; - * } - * ``` - * - * ```html - * /// file: src/routes/+page.svelte - * - * - *

{data.count}

- * - * ``` - */ - depends: (...deps: string[]) => void; - /** - * Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example: - * - * ```js - * /// file: src/routes/+page.js - * export async function load({ untrack, url }) { - * // Untrack url.pathname so that path changes don't trigger a rerun - * if (untrack(() => url.pathname === '/')) { - * return { message: 'Welcome!' }; - * } - * } - * ``` - */ - untrack: (fn: () => T) => T; - - /** - * Access to spans for tracing. If tracing is not enabled, these spans will do nothing. - * @since 2.31.0 - */ - tracing: { - /** Whether tracing is enabled. */ - enabled: boolean; - /** The root span for the request. This span is named `sveltekit.handle.root`. */ - root: Span; - /** The span associated with the current server `load` function. */ - current: Span; - }; - } - - /** - * Shape of a form action method that is part of `export const actions = {...}` in `+page.server.js`. - * See [form actions](https://svelte.dev/docs/kit/form-actions) for more information. - */ - export type Action< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - OutputData extends Record | void = Record | void, - RouteId extends AppRouteId | null = AppRouteId | null - > = (event: RequestEvent) => MaybePromise; - - /** - * Shape of the `export const actions = {...}` object in `+page.server.js`. - * See [form actions](https://svelte.dev/docs/kit/form-actions) for more information. - */ - export type Actions< - Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, - OutputData extends Record | void = Record | void, - RouteId extends AppRouteId | null = AppRouteId | null - > = Record>; - - /** - * When calling a form action via fetch, the response will be one of these shapes. - * ```svelte - * { - * return ({ result }) => { - * // result is of type ActionResult - * }; - * }} - * ``` - */ - export type ActionResult< - Success extends Record | undefined = Record, - Failure extends Record | undefined = Record - > = - | { type: 'success'; status: number; data?: Success } - | { type: 'failure'; status: number; data?: Failure } - | { type: 'redirect'; status: number; location: string } - | { type: 'error'; status?: number; error: any }; - - /** - * The object returned by the [`error`](https://svelte.dev/docs/kit/@sveltejs-kit#error) function. - */ - export interface HttpError { - /** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses), in the range 400-599. */ - status: number; - /** The content of the error. */ - body: App.Error; - } - - /** - * The object returned by the [`redirect`](https://svelte.dev/docs/kit/@sveltejs-kit#redirect) function. - */ - export interface Redirect { - /** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages), in the range 300-308. */ - status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308; - /** The location to redirect to. */ - location: string; - } - - export type SubmitFunction< - Success extends Record | undefined = Record, - Failure extends Record | undefined = Record - > = (input: { - action: URL; - formData: FormData; - formElement: HTMLFormElement; - controller: AbortController; - submitter: HTMLElement | null; - cancel: () => void; - }) => MaybePromise< - | void - | ((opts: { - formData: FormData; - formElement: HTMLFormElement; - action: URL; - result: ActionResult; - /** - * Call this to get the default behavior of a form submission response. - * @param options Set `reset: false` if you don't want the `` values to be reset after a successful submission. - * @param invalidateAll Set `invalidateAll: false` if you don't want the action to call `invalidateAll` after submission. - */ - update: (options?: { reset?: boolean; invalidateAll?: boolean }) => Promise; - }) => MaybePromise) - >; - - /** - * The type of `export const snapshot` exported from a page or layout component. - */ - export interface Snapshot { - capture: () => T; - restore: (snapshot: T) => void; - } - - // If T is unknown or has an index signature, the types below will recurse indefinitely and create giant unions that TS can't handle - type WillRecurseIndefinitely = unknown extends T ? true : string extends keyof T ? true : false; - - // Input type mappings for form fields - type InputTypeMap = { - text: string; - email: string; - password: string; - url: string; - tel: string; - search: string; - number: number; - range: number; - date: string; - 'datetime-local': string; - time: string; - month: string; - week: string; - color: string; - checkbox: boolean | string[]; - radio: string; - file: File; - hidden: string; - submit: string; - button: string; - reset: string; - image: string; - select: string; - 'select multiple': string[]; - 'file multiple': File[]; - }; - - // Valid input types for a given value type - export type RemoteFormFieldType = { - [K in keyof InputTypeMap]: T extends InputTypeMap[K] ? K : never; - }[keyof InputTypeMap]; - - // Input element properties based on type - type InputElementProps = T extends 'checkbox' | 'radio' - ? { - name: string; - type: T; - value?: string; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get checked(): boolean; - set checked(value: boolean); - } - : T extends 'file' - ? { - name: string; - type: 'file'; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get files(): FileList | null; - set files(v: FileList | null); - } - : T extends 'select' - ? { - name: string; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get value(): string; - set value(v: string); - } - : T extends 'select multiple' - ? { - name: string; - multiple: true; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get value(): string[]; - set value(v: string[]); - } - : T extends 'text' - ? { - name: string; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get value(): string | number; - set value(v: string | number); - } - : { - name: string; - type: T; - 'aria-invalid': boolean | 'false' | 'true' | undefined; - get value(): string | number; - set value(v: string | number); - }; - - type RemoteFormFieldMethods = { - /** The values that will be submitted */ - value(): DeepPartial; - /** Set the values that will be submitted */ - set(input: DeepPartial): DeepPartial; - /** Validation issues, if any */ - issues(): RemoteFormIssue[] | undefined; - }; - - // These two types use "T extends unknown ? .. : .." to distribute over unions. - // Example: if "type T = A | b" then "keyof T" only contains keys that both A and B have, with "KeysOfUnion" we get the keys of both A and B - type KeysOfUnion = T extends unknown ? keyof T : never; - type ValueOfUnionKey = T extends unknown - ? K extends keyof T - ? T[K] - : never - : never; - - export type RemoteFormFieldValue = string | string[] | number | boolean | File | File[]; - - type AsArgs = Type extends 'checkbox' - ? Value extends string[] - ? [type: Type, value: Value[number] | (string & {})] - : [type: Type] | [type: Type, value: Value | (string & {})] - : Type extends 'radio' | 'submit' | 'hidden' - ? [type: Type, value: Value | (string & {})] - : Type extends 'file' | 'file multiple' - ? [type: Type] - : [type: Type] | [type: Type, value: Value | (string & {})]; - - /** - * Form field accessor type that provides name(), value(), and issues() methods - */ - export type RemoteFormField = RemoteFormFieldMethods & { - /** - * Returns an object that can be spread onto an input element with the correct type attribute, - * aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters. - * @example - * ```svelte - * - * - * - * ``` - */ - as>(...args: AsArgs): InputElementProps; - }; - - type RemoteFormFieldContainer = RemoteFormFieldMethods & { - /** Validation issues belonging to this or any of the fields that belong to it, if any */ - allIssues(): RemoteFormIssue[] | undefined; - }; - - type UnknownField = RemoteFormFieldMethods & { - /** Validation issues belonging to this or any of the fields that belong to it, if any */ - allIssues(): RemoteFormIssue[] | undefined; - /** - * Returns an object that can be spread onto an input element with the correct type attribute, - * aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters. - * @example - * ```svelte - * - * - * - * ``` - */ - as>(...args: AsArgs): InputElementProps; - } & { - [key: string | number]: UnknownField; - }; - - type RemoteFormFieldsRoot = - IsAny extends true - ? RecursiveFormFields - : Input extends void - ? { - /** Validation issues, if any */ - issues(): RemoteFormIssue[] | undefined; - /** Validation issues belonging to this or any of the fields that belong to it, if any */ - allIssues(): RemoteFormIssue[] | undefined; - } - : RemoteFormFields; - - /** - * Recursive type to build form fields structure with proxy access - */ - export type RemoteFormFields = - WillRecurseIndefinitely extends true - ? RecursiveFormFields - : NonNullable extends string | number | boolean | File - ? RemoteFormField> - : // [NonNullable] is used to prevent distributing over union while still allowing - // nullable wrappers (e.g. `string[] | undefined` from a schema with `.default([])`) - // to be treated as arrays; only the last condition should distribute over unions - [NonNullable] extends [string[] | File[]] - ? RemoteFormField> & { - [K in number]: RemoteFormField[number]>; - } - : [NonNullable] extends [Array] - ? RemoteFormFieldContainer> & { - [K in number]: RemoteFormFields; - } - : RemoteFormFieldContainer & { - [K in KeysOfUnion]-?: RemoteFormFields>; - }; - - // By breaking this out into its own type, we avoid the TS recursion depth limit - type RecursiveFormFields = RemoteFormFieldContainer & { - [key: string | number]: UnknownField; - }; - - type MaybeArray = T | T[]; - - export interface RemoteFormInput { - [key: string]: MaybeArray; - } - - export interface RemoteFormIssue { - message: string; - path: Array; - } - - // If the schema specifies `id` as a string or number, ensure that `for(...)` - // only accepts that type. Otherwise, accept `string | number` - type ExtractId = Input extends { id: infer Id } - ? Id extends string | number - ? Id - : string | number - : string | number; - - /** - * A function and proxy object used to imperatively create validation errors in form handlers. - * - * Access properties to create field-specific issues: `issue.fieldName('message')`. - * The type structure mirrors the input data structure for type-safe field access. - * Call `invalid(issue.foo(...), issue.nested.bar(...))` to throw a validation error. - */ - export type InvalidField = - WillRecurseIndefinitely extends true - ? Record - : NonNullable extends string | number | boolean | File - ? (message: string) => StandardSchemaV1.Issue - : NonNullable extends Array - ? { - [K in number]: InvalidField; - } & ((message: string) => StandardSchemaV1.Issue) - : NonNullable extends RemoteFormInput - ? { - [K in keyof T]-?: InvalidField; - } & ((message: string) => StandardSchemaV1.Issue) - : Record; - - /** - * A validation error thrown by `invalid`. - */ - export interface ValidationError { - /** The validation issues */ - issues: StandardSchemaV1.Issue[]; - } - - /** - * The return value of a remote `form` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. - */ - export type RemoteForm = { - /** Attachment that sets up an event handler that intercepts the form submission on the client to prevent a full page reload */ - [attachment: symbol]: (node: HTMLFormElement) => void; - method: 'POST'; - /** The URL to send the form to. */ - action: string; - /** Use the `enhance` method to influence what happens when the form is submitted. */ - enhance( - callback: (opts: { - form: HTMLFormElement; - data: Input; - submit: () => Promise & { - updates: (...updates: RemoteQueryUpdate[]) => Promise; - }; - }) => MaybePromise - ): { - method: 'POST'; - action: string; - [attachment: symbol]: (node: HTMLFormElement) => void; - }; - /** - * Create an instance of the form for the given `id`. - * The `id` is stringified and used for deduplication to potentially reuse existing instances. - * Useful when you have multiple forms that use the same remote form action, for example in a loop. - * ```svelte - * {#each todos as todo} - * {@const todoForm = updateTodo.for(todo.id)} - * - * {#if todoForm.result?.invalid}

Invalid data

{/if} - * ... - * - * {/each} - * ``` - */ - for(id: ExtractId): Omit, 'for'>; - /** Preflight checks */ - preflight(schema: StandardSchemaV1): RemoteForm; - /** Validate the form contents programmatically */ - validate(options?: { - /** Set this to `true` to also show validation issues of fields that haven't been touched yet. */ - includeUntouched?: boolean; - /** Set this to `true` to only run the `preflight` validation. */ - preflightOnly?: boolean; - }): Promise; - /** The result of the form submission */ - get result(): Output | undefined; - /** The number of pending submissions */ - get pending(): number; - /** Access form fields using object notation */ - fields: RemoteFormFieldsRoot; - }; - - /** - * The return value of a remote `command` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. - */ - export type RemoteCommand = { - (arg: undefined extends Input ? Input | void : Input): Promise & { - updates(...updates: RemoteQueryUpdate[]): Promise; - }; - /** The number of pending command executions */ - get pending(): number; - }; - - export type RemoteQueryUpdate = - | RemoteQuery - | RemoteQueryFunction - | RemoteQueryOverride; - - export type RemoteResource = Promise & { - /** The error in case the query fails. Most often this is a [`HttpError`](https://svelte.dev/docs/kit/@sveltejs-kit#HttpError) but it isn't guaranteed to be. */ - get error(): any; - /** `true` before the first result is available and during refreshes */ - get loading(): boolean; - } & ( - | { - /** The current value of the query. Undefined until `ready` is `true` */ - get current(): undefined; - ready: false; - } - | { - /** The current value of the query. Undefined until `ready` is `true` */ - get current(): T; - ready: true; - } - ); - - export type RemoteQuery = RemoteResource & { - /** - * Returns a plain promise with the result. - * Unlike awaiting the resource directly, this can only be used _outside_ render - * (i.e. in load functions, event handlers and so on) - */ - run(): Promise; - /** - * On the client, this function will update the value of the query without re-fetching it. - * - * On the server, this can be called in the context of a `command` or `form` and the specified data will accompany the action response back to the client. - * This prevents SvelteKit needing to refresh all queries on the page in a second server round-trip. - */ - set(value: T): void; - /** - * On the client, this function will re-fetch the query from the server. - * - * On the server, this can be called in the context of a `command` or `form` and the refreshed data will accompany the action response back to the client. - * This prevents SvelteKit needing to refresh all queries on the page in a second server round-trip. - */ - refresh(): Promise; - /** - * Temporarily override a query's value during a [single-flight mutation](https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations) to provide optimistic updates. - * - * ```svelte - * - * - *
{ - * await submit().updates( - * todos.withOverride((todos) => [...todos, { text: data.get('text') }]) - * ); - * })}> - * - * - *
- * ``` - */ - withOverride(update: (current: T) => T): RemoteQueryOverride; - }; - - export type RemoteQueryOverride = () => void; - - /** - * The return value of a remote `prerender` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. - */ - export type RemotePrerenderFunction = ( - arg: undefined extends Input ? Input | void : Input - ) => RemoteResource; - - /** - * The return value of a remote `query` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. - * - * The optional `Validated` generic parameter represents the argument type *after* the - * query's schema has validated and (optionally) transformed it — this is the type the - * query's implementation function receives on the server, and the type yielded by - * [`requested`](https://svelte.dev/docs/kit/$app-server#requested). For queries declared - * with [Standard Schema](https://standardschema.dev/) it differs from `Input` when the - * schema contains a transform (e.g. `v.pipe(v.number(), v.transform(String))` has - * `Input = number` but `Validated = string`). For `'unchecked'` validators and queries - * without arguments it defaults to `Input`. - */ - export type RemoteQueryFunction = ( - arg: undefined extends Input ? Input | void : Input - ) => RemoteQuery; - interface AdapterEntry { - /** - * A string that uniquely identifies an HTTP service (e.g. serverless function) and is used for deduplication. - * For example, `/foo/a-[b]` and `/foo/[c]` are different routes, but would both - * be represented in a Netlify _redirects file as `/foo/:param`, so they share an ID - */ - id: string; - - /** - * A function that compares the candidate route with the current route to determine - * if it should be grouped with the current route. - * - * Use cases: - * - Fallback pages: `/foo/[c]` is a fallback for `/foo/a-[b]`, and `/[...catchall]` is a fallback for all routes - * - Grouping routes that share a common `config`: `/foo` should be deployed to the edge, `/bar` and `/baz` should be deployed to a serverless function - */ - filter(route: RouteDefinition): boolean; - - /** - * A function that is invoked once the entry has been created. This is where you - * should write the function to the filesystem and generate redirect manifests. - */ - complete(entry: { generateManifest(opts: { relativePath: string }): string }): MaybePromise; - } - - // Based on https://github.com/josh-hemphill/csp-typed-directives/blob/latest/src/csp.types.ts - // - // MIT License - // - // Copyright (c) 2021-present, Joshua Hemphill - // Copyright (c) 2021, Tecnico Corporation - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to deal - // in the Software without restriction, including without limitation the rights - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - // copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in all - // copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - // SOFTWARE. - - namespace Csp { - type ActionSource = 'strict-dynamic' | 'report-sample'; - type BaseSource = - | 'self' - | 'unsafe-eval' - | 'unsafe-hashes' - | 'unsafe-inline' - | 'wasm-unsafe-eval' - | 'none'; - type CryptoSource = `${'nonce' | 'sha256' | 'sha384' | 'sha512'}-${string}`; - type FrameSource = HostSource | SchemeSource | 'self' | 'none'; - type HostNameScheme = `${string}.${string}` | 'localhost'; - type HostSource = `${HostProtocolSchemes}${HostNameScheme}${PortScheme}`; - type HostProtocolSchemes = `${string}://` | ''; - type HttpDelineator = '/' | '?' | '#' | '\\'; - type PortScheme = `:${number}` | '' | ':*'; - type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:'; - type Source = HostSource | SchemeSource | CryptoSource | BaseSource; - type Sources = Source[]; - } - - interface CspDirectives { - 'child-src'?: Csp.Sources; - 'default-src'?: Array; - 'frame-src'?: Csp.Sources; - 'worker-src'?: Csp.Sources; - 'connect-src'?: Csp.Sources; - 'font-src'?: Csp.Sources; - 'img-src'?: Csp.Sources; - 'manifest-src'?: Csp.Sources; - 'media-src'?: Csp.Sources; - 'object-src'?: Csp.Sources; - 'prefetch-src'?: Csp.Sources; - 'script-src'?: Array; - 'script-src-elem'?: Csp.Sources; - 'script-src-attr'?: Csp.Sources; - 'style-src'?: Array; - 'style-src-elem'?: Csp.Sources; - 'style-src-attr'?: Csp.Sources; - 'base-uri'?: Array; - sandbox?: Array< - | 'allow-downloads-without-user-activation' - | 'allow-forms' - | 'allow-modals' - | 'allow-orientation-lock' - | 'allow-pointer-lock' - | 'allow-popups' - | 'allow-popups-to-escape-sandbox' - | 'allow-presentation' - | 'allow-same-origin' - | 'allow-scripts' - | 'allow-storage-access-by-user-activation' - | 'allow-top-navigation' - | 'allow-top-navigation-by-user-activation' - >; - 'form-action'?: Array; - 'frame-ancestors'?: Array; - 'navigate-to'?: Array; - 'report-uri'?: string[]; - 'report-to'?: string[]; - - 'require-trusted-types-for'?: Array<'script'>; - 'trusted-types'?: Array<'none' | 'allow-duplicates' | '*' | string>; - 'upgrade-insecure-requests'?: boolean; - - /** @deprecated */ - 'require-sri-for'?: Array<'script' | 'style' | 'script style'>; - - /** @deprecated */ - 'block-all-mixed-content'?: boolean; - - /** @deprecated */ - 'plugin-types'?: Array<`${string}/${string}` | 'none'>; - - /** @deprecated */ - referrer?: Array< - | 'no-referrer' - | 'no-referrer-when-downgrade' - | 'origin' - | 'origin-when-cross-origin' - | 'same-origin' - | 'strict-origin' - | 'strict-origin-when-cross-origin' - | 'unsafe-url' - | 'none' - >; - } - - type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS'; - - interface Logger { - (msg: string): void; - success(msg: string): void; - error(msg: string): void; - warn(msg: string): void; - minor(msg: string): void; - info(msg: string): void; - } - - type MaybePromise = T | Promise; - - interface Prerendered { - /** - * A map of `path` to `{ file }` objects, where a path like `/foo` corresponds to `foo.html` and a path like `/bar/` corresponds to `bar/index.html`. - */ - pages: Map< - string, - { - /** The location of the .html file relative to the output directory */ - file: string; - } - >; - /** - * A map of `path` to `{ type }` objects. - */ - assets: Map< - string, - { - /** The MIME type of the asset */ - type: string; - } - >; - /** - * A map of redirects encountered during prerendering. - */ - redirects: Map< - string, - { - status: number; - location: string; - } - >; - /** An array of prerendered paths (without trailing slashes, regardless of the trailingSlash config) */ - paths: string[]; - } - - interface PrerenderHttpErrorHandler { - (details: { - status: number; - path: string; - referrer: string | null; - referenceType: 'linked' | 'fetched'; - message: string; - }): void; - } - - interface PrerenderMissingIdHandler { - (details: { path: string; id: string; referrers: string[]; message: string }): void; - } - - interface PrerenderEntryGeneratorMismatchHandler { - (details: { generatedFromId: string; entry: string; matchedId: string; message: string }): void; - } - - interface PrerenderUnseenRoutesHandler { - (details: { routes: string[]; message: string }): void; - } - - type PrerenderHttpErrorHandlerValue = 'fail' | 'warn' | 'ignore' | PrerenderHttpErrorHandler; - type PrerenderMissingIdHandlerValue = 'fail' | 'warn' | 'ignore' | PrerenderMissingIdHandler; - type PrerenderUnseenRoutesHandlerValue = - | 'fail' - | 'warn' - | 'ignore' - | PrerenderUnseenRoutesHandler; - type PrerenderEntryGeneratorMismatchHandlerValue = - | 'fail' - | 'warn' - | 'ignore' - | PrerenderEntryGeneratorMismatchHandler; - - export type PrerenderOption = boolean | 'auto'; - - interface RequestOptions { - getClientAddress(): string; - platform?: App.Platform; - } - - interface RouteSegment { - content: string; - dynamic: boolean; - rest: boolean; - } - - /** @default 'never' */ - type TrailingSlash = 'never' | 'always' | 'ignore'; - - type DeepPartial = T extends Record | unknown[] - ? { - [K in keyof T]?: T[K] extends Record | unknown[] - ? DeepPartial - : T[K]; - } - : T | undefined; - - type IsAny = 0 extends 1 & T ? true : false; - interface Asset { - file: string; - size: number; - type: string | null; - } - - interface BuildData { - app_dir: string; - app_path: string; - manifest_data: ManifestData; - out_dir: string; - service_worker: string | null; - client: { - /** Path to the client entry point. */ - start: string; - /** Path to the generated `app.js` file that contains the client manifest. Only set in case of `bundleStrategy === 'split'`. */ - app?: string; - /** JS files that the client entry point relies on. */ - imports: string[]; - /** - * JS files that represent the entry points of the layouts/pages. - * An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file). - * Only set in case of `router.resolution === 'server'`. - */ - nodes?: Array; - /** - * CSS files referenced in the entry points of the layouts/pages. - * An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file) or if has no CSS. - * Only set in case of `router.resolution === 'server'`. - */ - css?: Array; - /** - * Contains the client route manifest in a form suitable for the server which is used for server-side route resolution. - * Notably, it contains all routes, regardless of whether they are prerendered or not (those are missing in the optimized server route manifest). - * Only set in case of `router.resolution === 'server'`. - */ - routes?: SSRClientRoute[]; - stylesheets: string[]; - fonts: string[]; - uses_env_dynamic_public: boolean; - /** Only set in case of `bundleStrategy === 'inline'`. */ - inline?: { - script: string; - style: string | undefined; - }; - } | null; - server_manifest: import('vite').Manifest; - } - - interface ManifestData { - /** Static files from `kit.config.files.assets`. */ - assets: Asset[]; - hooks: { - client: string | null; - server: string | null; - universal: string | null; - }; - nodes: PageNode[]; - routes: RouteData[]; - matchers: Record; - } - - interface PageNode { - depth: number; - /** The `+page/layout.svelte`. */ - component?: string; // TODO supply default component if it's missing (bit of an edge case) - /** The `+page/layout.js/.ts`. */ - universal?: string; - /** The `+page/layout.server.js/ts`. */ - server?: string; - parent_id?: string; - parent?: PageNode; - /** Filled with the pages that reference this layout (if this is a layout). */ - child_pages?: PageNode[]; - /** The final page options for a node if it was statically analysable */ - page_options?: PageOptions | null; - } - - type RecursiveRequired = { - // Recursive implementation of TypeScript's Required utility type. - // Will recursively continue until it reaches a primitive or Function - // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type - [K in keyof T]-?: Extract extends never // If it does not have a Function type - ? RecursiveRequired // recursively continue through. - : T[K]; // Use the exact type for everything else - }; - - interface RouteParam { - name: string; - matcher: string; - optional: boolean; - rest: boolean; - chained: boolean; - } - - /** - * Represents a route segment in the app. It can either be an intermediate node - * with only layout/error pages, or a leaf, at which point either `page` and `leaf` - * or `endpoint` is set. - */ - interface RouteData { - id: string; - parent: RouteData | null; - - segment: string; - pattern: RegExp; - params: RouteParam[]; - - layout: PageNode | null; - error: PageNode | null; - leaf: PageNode | null; - - page: { - layouts: Array; - errors: Array; - leaf: number; - } | null; - - endpoint: { - file: string; - /** The final page options for the endpoint if it was statically analysable */ - page_options: PageOptions | null; - } | null; - } - - interface SSRComponent { - default: { - render( - props: Record, - opts: { context: Map; csp?: { nonce?: string; hash?: boolean } } - ): { - html: string; - head: string; - css: { - code: string; - map: any; // TODO - }; - /** Until we require all Svelte versions that support hashes, this might not be defined */ - hashes?: { - script: Array<`sha256-${string}`>; - }; - }; - }; - } - - type SSRComponentLoader = () => Promise; - - interface UniversalNode { - /** Is `null` in case static analysis succeeds but the node is ssr=false */ - load?: Load; - prerender?: PrerenderOption; - ssr?: boolean; - csr?: boolean; - trailingSlash?: TrailingSlash; - config?: any; - entries?: PrerenderEntryGenerator; - } - - interface ServerNode { - load?: ServerLoad; - prerender?: PrerenderOption; - ssr?: boolean; - csr?: boolean; - trailingSlash?: TrailingSlash; - actions?: Actions; - config?: any; - entries?: PrerenderEntryGenerator; - } - - interface SSRNode { - /** index into the `nodes` array in the generated `client/app.js`. */ - index: number; - /** external JS files that are loaded on the client. `imports[0]` is the entry point (e.g. `client/nodes/0.js`) */ - imports: string[]; - /** external CSS files that are loaded on the client */ - stylesheets: string[]; - /** external font files that are loaded on the client */ - fonts: string[]; - - universal_id?: string; - server_id?: string; - - /** inlined styles */ - inline_styles?(): MaybePromise< - Record string)> - >; - /** Svelte component */ - component?: SSRComponentLoader; - /** +page.js or +layout.js */ - universal?: UniversalNode; - /** +page.server.js, +layout.server.js, or +server.js */ - server?: ServerNode; - } - - type SSRNodeLoader = () => Promise; - - interface PageNodeIndexes { - errors: Array; - layouts: Array; - leaf: number; - } - - type PrerenderEntryGenerator = () => MaybePromise>>; - - type SSREndpoint = Partial> & { - prerender?: PrerenderOption; - trailingSlash?: TrailingSlash; - config?: any; - entries?: PrerenderEntryGenerator; - fallback?: RequestHandler; - }; - - interface SSRRoute { - id: string; - pattern: RegExp; - params: RouteParam[]; - page: PageNodeIndexes | null; - endpoint: (() => Promise) | null; - endpoint_id?: string; - } - - interface SSRClientRoute { - id: string; - pattern: RegExp; - params: RouteParam[]; - errors: Array; - layouts: Array<[has_server_load: boolean, node_id: number] | undefined>; - leaf: [has_server_load: boolean, node_id: number]; - } - - type ValidatedConfig = Config & { - kit: ValidatedKitConfig; - extensions: string[]; - }; - - type ValidatedKitConfig = Omit, 'adapter'> & { - adapter?: Adapter; - }; - /** - * Throws an error with a HTTP status code and an optional message. - * When called during request handling, this will cause SvelteKit to - * return an error response without invoking `handleError`. - * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. - * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. - * @param body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. - * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. - * @throws {Error} If the provided status is invalid (not between 400 and 599). - */ - export function error(status: number, body: App.Error): never; - /** - * Throws an error with a HTTP status code and an optional message. - * When called during request handling, this will cause SvelteKit to - * return an error response without invoking `handleError`. - * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. - * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. - * @param body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. - * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. - * @throws {Error} If the provided status is invalid (not between 400 and 599). - */ - export function error(status: number, body?: { - message: string; - } extends App.Error ? App.Error | string | undefined : never): never; - /** - * Checks whether this is an error thrown by {@link error}. - * @param status The status to filter for. - * */ - export function isHttpError(e: unknown, status?: T): e is (HttpError_1 & { - status: T extends undefined ? never : T; - }); - /** - * Redirect a request. When called during request handling, SvelteKit will return a redirect response. - * Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it. - * - * Most common status codes: - * * `303 See Other`: redirect as a GET request (often used after a form POST request) - * * `307 Temporary Redirect`: redirect will keep the request method - * * `308 Permanent Redirect`: redirect will keep the request method, SEO will be transferred to the new page - * - * [See all redirect status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages) - * - * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308. - * @param location The location to redirect to. - * @throws {Redirect} This error instructs SvelteKit to redirect to the specified location. - * @throws {Error} If the provided status is invalid or the location cannot be used as a header value. - * */ - export function redirect(status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | ({} & number), location: string | URL): never; - /** - * Checks whether this is a redirect thrown by {@link redirect}. - * @param e The object to check. - * */ - export function isRedirect(e: unknown): e is Redirect_1; - /** - * Create a JSON `Response` object from the supplied data. - * @param data The value that will be serialized as JSON. - * @param init Options such as `status` and `headers` that will be added to the response. `Content-Type: application/json` and `Content-Length` headers will be added automatically. - */ - export function json(data: any, init?: ResponseInit): Response; - /** - * Create a `Response` object from the supplied body. - * @param body The value that will be used as-is. - * @param init Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically. - */ - export function text(body: string, init?: ResponseInit): Response; - /** - * Create an `ActionFailure` object. Call when form submission fails. - * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. - * */ - export function fail(status: number): ActionFailure; - /** - * Create an `ActionFailure` object. Call when form submission fails. - * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. - * @param data Data associated with the failure (e.g. validation errors) - * */ - export function fail(status: number, data: T): ActionFailure; - /** - * Checks whether this is an action failure thrown by {@link fail}. - * @param e The object to check. - * */ - export function isActionFailure(e: unknown): e is ActionFailure; - /** - * Use this to throw a validation error to imperatively fail form validation. - * Can be used in combination with `issue` passed to form actions to create field-specific issues. - * - * @example - * ```ts - * import { invalid } from '@sveltejs/kit'; - * import { form } from '$app/server'; - * import { tryLogin } from '$lib/server/auth'; - * import * as v from 'valibot'; - * - * export const login = form( - * v.object({ name: v.string(), _password: v.string() }), - * async ({ name, _password }) => { - * const success = tryLogin(name, _password); - * if (!success) { - * invalid('Incorrect username or password'); - * } - * - * // ... - * } - * ); - * ``` - * @since 2.47.3 - */ - export function invalid(...issues: (StandardSchemaV1.Issue | string)[]): never; - /** - * Checks whether this is an validation error thrown by {@link invalid}. - * @param e The object to check. - * @since 2.47.3 - */ - export function isValidationError(e: unknown): e is ActionFailure; - /** - * Strips possible SvelteKit-internal suffixes and trailing slashes from the URL pathname. - * Returns the normalized URL as well as a method for adding the potential suffix back - * based on a new pathname (possibly including search) or URL. - * ```js - * import { normalizeUrl } from '@sveltejs/kit'; - * - * const { url, denormalize } = normalizeUrl('/blog/post/__data.json'); - * console.log(url.pathname); // /blog/post - * console.log(denormalize('/blog/post/a')); // /blog/post/a/__data.json - * ``` - * @since 2.18.0 - */ - export function normalizeUrl(url: URL | string): { - url: URL; - wasNormalized: boolean; - denormalize: (url?: string | URL) => URL; - }; - export type LessThan = TNumber extends TArray["length"] ? TArray[number] : LessThan; - export type NumericRange = Exclude, LessThan>; - type ValidPageOption = (typeof valid_page_options_array)[number]; - type PageOptions = Partial>; - const valid_page_options_array: readonly ["ssr", "prerender", "csr", "trailingSlash", "config", "entries", "load"]; - export const VERSION: string; - class HttpError_1 { - - constructor(status: number, body: { - message: string; - } extends App.Error ? (App.Error | string | undefined) : App.Error); - status: number; - body: App.Error; - toString(): string; - } - class Redirect_1 { - - constructor(status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308, location: string); - status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308; - location: string; - } - - export {}; -} - -declare module '@sveltejs/kit/hooks' { - import type { Handle } from '@sveltejs/kit'; - /** - * A helper function for sequencing multiple `handle` calls in a middleware-like manner. - * The behavior for the `handle` options is as follows: - * - `transformPageChunk` is applied in reverse order and merged - * - `preload` is applied in forward order, the first option "wins" and no `preload` options after it are called - * - `filterSerializedResponseHeaders` behaves the same as `preload` - * - * ```js - * /// file: src/hooks.server.js - * import { sequence } from '@sveltejs/kit/hooks'; - * - * /// type: import('@sveltejs/kit').Handle - * async function first({ event, resolve }) { - * console.log('first pre-processing'); - * const result = await resolve(event, { - * transformPageChunk: ({ html }) => { - * // transforms are applied in reverse order - * console.log('first transform'); - * return html; - * }, - * preload: () => { - * // this one wins as it's the first defined in the chain - * console.log('first preload'); - * return true; - * } - * }); - * console.log('first post-processing'); - * return result; - * } - * - * /// type: import('@sveltejs/kit').Handle - * async function second({ event, resolve }) { - * console.log('second pre-processing'); - * const result = await resolve(event, { - * transformPageChunk: ({ html }) => { - * console.log('second transform'); - * return html; - * }, - * preload: () => { - * console.log('second preload'); - * return true; - * }, - * filterSerializedResponseHeaders: () => { - * // this one wins as it's the first defined in the chain - * console.log('second filterSerializedResponseHeaders'); - * return true; - * } - * }); - * console.log('second post-processing'); - * return result; - * } - * - * export const handle = sequence(first, second); - * ``` - * - * The example above would print: - * - * ``` - * first pre-processing - * first preload - * second pre-processing - * second filterSerializedResponseHeaders - * second transform - * first transform - * second post-processing - * first post-processing - * ``` - * - * @param handlers The chain of `handle` functions - * */ - export function sequence(...handlers: Handle[]): Handle; - - export {}; -} - -declare module '@sveltejs/kit/node' { - export function getRequest({ request, base, bodySizeLimit }: { - request: import("http").IncomingMessage; - base: string; - bodySizeLimit?: number; - }): Promise; - - export function setResponse(res: import("http").ServerResponse, response: Response): Promise; - /** - * Converts a file on disk to a readable stream - * @since 2.4.0 - */ - export function createReadableStream(file: string): ReadableStream; - - export {}; -} - -declare module '@sveltejs/kit/node/polyfills' { - /** - * Make various web APIs available as globals: - * - `crypto` - * - `File` - */ - export function installPolyfills(): void; - - export {}; -} - -declare module '@sveltejs/kit/vite' { - import type { Plugin } from 'vite'; - /** - * Returns the SvelteKit Vite plugins. - * */ - export function sveltekit(): Promise; - - export {}; -} - -declare module '$app/environment' { - /** - * `true` if the app is running in the browser. - */ - export const browser: boolean; - - /** - * Whether the dev server is running. This is not guaranteed to correspond to `NODE_ENV` or `MODE`. - */ - export const dev: boolean; - - /** - * SvelteKit analyses your app during the `build` step by running it. During this process, `building` is `true`. This also applies during prerendering. - */ - export const building: boolean; - - /** - * The value of `config.kit.version.name`. - */ - export const version: string; - - export {}; -} - -declare module '$app/forms' { - /** - * Use this function to deserialize the response from a form submission. - * Usage: - * - * ```js - * import { deserialize } from '$app/forms'; - * - * async function handleSubmit(event) { - * const response = await fetch('/form?/action', { - * method: 'POST', - * body: new FormData(event.target) - * }); - * - * const result = deserialize(await response.text()); - * // ... - * } - * ``` - * */ - export function deserialize | undefined, Failure extends Record | undefined>(result: string): import("@sveltejs/kit").ActionResult; - /** - * This action enhances a `
` element that otherwise would work without JavaScript. - * - * The `submit` function is called upon submission with the given FormData and the `action` that should be triggered. - * If `cancel` is called, the form will not be submitted. - * You can use the abort `controller` to cancel the submission in case another one starts. - * If a function is returned, that function is called with the response from the server. - * If nothing is returned, the fallback will be used. - * - * If this function or its return value isn't set, it - * - falls back to updating the `form` prop with the returned data if the action is on the same page as the form - * - updates `page.status` - * - resets the `` element and invalidates all data in case of successful submission with no redirect response - * - redirects in case of a redirect response - * - redirects to the nearest error page in case of an unexpected error - * - * If you provide a custom function with a callback and want to use the default behavior, invoke `update` in your callback. - * It accepts an options object - * - `reset: false` if you don't want the `` values to be reset after a successful submission - * - `invalidateAll: false` if you don't want the action to call `invalidateAll` after submission - * @param form_element The form element - * @param submit Submit callback - */ - export function enhance | undefined, Failure extends Record | undefined>(form_element: HTMLFormElement, submit?: import("@sveltejs/kit").SubmitFunction): { - destroy(): void; - }; - /** - * This action updates the `form` property of the current page with the given data and updates `page.status`. - * In case of an error, it redirects to the nearest error page. - * */ - export function applyAction | undefined, Failure extends Record | undefined>(result: import("@sveltejs/kit").ActionResult): Promise; - - export {}; -} - -declare module '$app/navigation' { - /** - * A lifecycle function that runs the supplied `callback` when the current component mounts, and also whenever we navigate to a URL. - * - * `afterNavigate` must be called during a component initialization. It remains active as long as the component is mounted. - * */ - export function afterNavigate(callback: (navigation: import("@sveltejs/kit").AfterNavigate) => void): void; - /** - * A navigation interceptor that triggers before we navigate to a URL, whether by clicking a link, calling `goto(...)`, or using the browser back/forward controls. - * - * Calling `cancel()` will prevent the navigation from completing. If `navigation.type === 'leave'` — meaning the user is navigating away from the app (or closing the tab) — calling `cancel` will trigger the native browser unload confirmation dialog. In this case, the navigation may or may not be cancelled depending on the user's response. - * - * When a navigation isn't to a SvelteKit-owned route (and therefore controlled by SvelteKit's client-side router), `navigation.to.route.id` will be `null`. - * - * If the navigation will (if not cancelled) cause the document to unload — in other words `'leave'` navigations and `'link'` navigations where `navigation.to.route === null` — `navigation.willUnload` is `true`. - * - * `beforeNavigate` must be called during a component initialization. It remains active as long as the component is mounted. - * */ - export function beforeNavigate(callback: (navigation: import("@sveltejs/kit").BeforeNavigate) => void): void; - /** - * A lifecycle function that runs the supplied `callback` immediately before we navigate to a new URL except during full-page navigations. - * - * If you return a `Promise`, SvelteKit will wait for it to resolve before completing the navigation. This allows you to — for example — use `document.startViewTransition`. Avoid promises that are slow to resolve, since navigation will appear stalled to the user. - * - * If a function (or a `Promise` that resolves to a function) is returned from the callback, it will be called once the DOM has updated. - * - * `onNavigate` must be called during a component initialization. It remains active as long as the component is mounted. - * */ - export function onNavigate(callback: (navigation: import("@sveltejs/kit").OnNavigate) => MaybePromise<(() => void) | void>): void; - /** - * If called when the page is being updated following a navigation (in `onMount` or `afterNavigate` or an action, for example), this disables SvelteKit's built-in scroll handling. - * This is generally discouraged, since it breaks user expectations. - * */ - export function disableScrollHandling(): void; - /** - * Allows you to navigate programmatically to a given route, with options such as keeping the current element focused. - * Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`. - * - * For external URLs, use `window.location = url` instead of calling `goto(url)`. - * - * @param url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app. - * @param {Object} opts Options related to the navigation - * */ - export function goto(url: string | URL, opts?: { - replaceState?: boolean | undefined; - noScroll?: boolean | undefined; - keepFocus?: boolean | undefined; - invalidateAll?: boolean | undefined; - invalidate?: (string | URL | ((url: URL) => boolean))[] | undefined; - state?: App.PageState | undefined; - }): Promise; - /** - * Causes any `load` functions belonging to the currently active page to re-run if they depend on the `url` in question, via `fetch` or `depends`. Returns a `Promise` that resolves when the page is subsequently updated. - * - * If the argument is given as a `string` or `URL`, it must resolve to the same URL that was passed to `fetch` or `depends` (including query parameters). - * To create a custom identifier, use a string beginning with `[a-z]+:` (e.g. `custom:state`) — this is a valid URL. - * - * The `function` argument can be used define a custom predicate. It receives the full `URL` and causes `load` to rerun if `true` is returned. - * This can be useful if you want to invalidate based on a pattern instead of a exact match. - * - * ```ts - * // Example: Match '/path' regardless of the query parameters - * import { invalidate } from '$app/navigation'; - * - * invalidate((url) => url.pathname === '/path'); - * ``` - * @param resource The invalidated URL - * */ - export function invalidate(resource: string | URL | ((url: URL) => boolean)): Promise; - /** - * Causes all `load` and `query` functions belonging to the currently active page to re-run. Returns a `Promise` that resolves when the page is subsequently updated. - * */ - export function invalidateAll(): Promise; - /** - * Causes all currently active remote functions to refresh, and all `load` functions belonging to the currently active page to re-run (unless disabled via the option argument). - * Returns a `Promise` that resolves when the page is subsequently updated. - * */ - export function refreshAll({ includeLoadFunctions }?: { - includeLoadFunctions?: boolean; - }): Promise; - /** - * Programmatically preloads the given page, which means - * 1. ensuring that the code for the page is loaded, and - * 2. calling the page's load function with the appropriate options. - * - * This is the same behaviour that SvelteKit triggers when the user taps or mouses over an `` element with `data-sveltekit-preload-data`. - * If the next navigation is to `href`, the values returned from load will be used, making navigation instantaneous. - * Returns a Promise that resolves with the result of running the new route's `load` functions once the preload is complete. - * - * @param href Page to preload - * */ - export function preloadData(href: string): Promise<{ - type: "loaded"; - status: number; - data: Record; - } | { - type: "redirect"; - location: string; - }>; - /** - * Programmatically imports the code for routes that haven't yet been fetched. - * Typically, you might call this to speed up subsequent navigation. - * - * You can specify routes by any matching pathname such as `/about` (to match `src/routes/about/+page.svelte`) or `/blog/*` (to match `src/routes/blog/[slug]/+page.svelte`). - * - * Unlike `preloadData`, this won't call `load` functions. - * Returns a Promise that resolves when the modules have been imported. - * - * */ - export function preloadCode(pathname: string): Promise; - /** - * Programmatically create a new history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing). - * - * */ - export function pushState(url: string | URL, state: App.PageState): void; - /** - * Programmatically replace the current history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing). - * - * */ - export function replaceState(url: string | URL, state: App.PageState): void; - type MaybePromise = T | Promise; - - export {}; -} - -declare module '$app/paths' { - import type { RouteIdWithSearchOrHash, PathnameWithSearchOrHash, ResolvedPathname, RouteId, RouteParams, Asset, Pathname as Pathname_1 } from '$app/types'; - /** - * A string that matches [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths). - * - * Example usage: `Link` - * - * @deprecated Use [`resolve(...)`](https://svelte.dev/docs/kit/$app-paths#resolve) instead - */ - export let base: '' | `/${string}`; - - /** - * An absolute path that matches [`config.kit.paths.assets`](https://svelte.dev/docs/kit/configuration#paths). - * - * > [!NOTE] If a value for `config.kit.paths.assets` is specified, it will be replaced with `'/_svelte_kit_assets'` during `vite dev` or `vite preview`, since the assets don't yet live at their eventual URL. - * - * @deprecated Use [`asset(...)`](https://svelte.dev/docs/kit/$app-paths#asset) instead - */ - export let assets: '' | `https://${string}` | `http://${string}` | '/_svelte_kit_assets'; - - /** - * @deprecated Use [`resolve(...)`](https://svelte.dev/docs/kit/$app-paths#resolve) instead - */ - export function resolveRoute( - ...args: ResolveArgs - ): ResolvedPathname; - type StripSearchOrHash = T extends `${infer Pathname}?${string}` - ? Pathname - : T extends `${infer Pathname}#${string}` - ? Pathname - : T; - - type ResolveArgs = - T extends RouteId - ? RouteParams extends Record - ? [route: T] - : [route: T, params: RouteParams] - : StripSearchOrHash extends infer U extends RouteId - ? RouteParams extends Record - ? [route: T] - : [route: T, params: RouteParams] - : [route: T]; - /** - * Resolve the URL of an asset in your `static` directory, by prefixing it with [`config.kit.paths.assets`](https://svelte.dev/docs/kit/configuration#paths) if configured, or otherwise by prefixing it with the base path. - * - * During server rendering, the base path is relative and depends on the page currently being rendered. - * - * @example - * ```svelte - * - * - * a potato - * ``` - * @since 2.26 - * - * */ - export function asset(file: Asset): string; - /** - * Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters. - * - * During server rendering, the base path is relative and depends on the page currently being rendered. - * - * @example - * ```js - * import { resolve } from '$app/paths'; - * - * // using a pathname - * const resolved = resolve(`/blog/hello-world`); - * - * // using a route ID plus parameters - * const resolved = resolve('/blog/[slug]', { - * slug: 'hello-world' - * }); - * ``` - * @since 2.26 - * - * */ - export function resolve(...args: ResolveArgs): ResolvedPathname; - /** - * Match a path or URL to a route ID and extracts any parameters. - * - * @example - * ```js - * import { match } from '$app/paths'; - * - * const route = await match('/blog/hello-world'); - * - * if (route?.id === '/blog/[slug]') { - * const slug = route.params.slug; - * const response = await fetch(`/api/posts/${slug}`); - * const post = await response.json(); - * } - * ``` - * @since 2.52.0 - * - * */ - export function match(url: Pathname_1 | URL | (string & {})): Promise<{ - id: RouteId; - params: Record; - } | null>; - - export {}; -} - -declare module '$app/server' { - import type { RequestEvent, RemoteCommand, RemoteForm, RemoteFormInput, InvalidField, RemotePrerenderFunction, RemoteQueryFunction, RequestedResult } from '@sveltejs/kit'; - import type { StandardSchemaV1 } from '@standard-schema/spec'; - /** - * Read the contents of an imported asset from the filesystem - * @example - * ```js - * import { read } from '$app/server'; - * import somefile from './somefile.txt'; - * - * const asset = read(somefile); - * const text = await asset.text(); - * ``` - * @since 2.4.0 - */ - export function read(asset: string): Response; - /** - * Returns the current `RequestEvent`. Can be used inside server hooks, server `load` functions, actions, and endpoints (and functions called by them). - * - * In environments without [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage), this must be called synchronously (i.e. not after an `await`). - * @since 2.20.0 - * - * */ - export function getRequestEvent(): RequestEvent; - /** - * Creates a remote command. When called from the browser, the function will be invoked on the server via a `fetch` call. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. - * - * @since 2.27 - */ - export function command(fn: () => Output): RemoteCommand; - /** - * Creates a remote command. When called from the browser, the function will be invoked on the server via a `fetch` call. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. - * - * @since 2.27 - */ - export function command(validate: "unchecked", fn: (arg: Input) => Output): RemoteCommand; - /** - * Creates a remote command. When called from the browser, the function will be invoked on the server via a `fetch` call. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. - * - * @since 2.27 - */ - export function command(validate: Schema, fn: (arg: StandardSchemaV1.InferOutput) => Output): RemoteCommand, Output>; - /** - * Creates a form object that can be spread onto a `` element. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. - * - * @since 2.27 - */ - export function form(fn: () => MaybePromise): RemoteForm; - /** - * Creates a form object that can be spread onto a `` element. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. - * - * @since 2.27 - */ - export function form(validate: "unchecked", fn: (data: Input, issue: InvalidField) => MaybePromise): RemoteForm; - /** - * Creates a form object that can be spread onto a `` element. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. - * - * @since 2.27 - */ - export function form>, Output>(validate: Schema, fn: (data: StandardSchemaV1.InferOutput, issue: InvalidField>) => MaybePromise): RemoteForm, Output>; - /** - * Creates a remote prerender function. When called from the browser, the function will be invoked on the server via a `fetch` call. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. - * - * @since 2.27 - */ - export function prerender(fn: () => MaybePromise, options?: { - inputs?: RemotePrerenderInputsGenerator; - dynamic?: boolean; - } | undefined): RemotePrerenderFunction; - /** - * Creates a remote prerender function. When called from the browser, the function will be invoked on the server via a `fetch` call. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. - * - * @since 2.27 - */ - export function prerender(validate: "unchecked", fn: (arg: Input) => MaybePromise, options?: { - inputs?: RemotePrerenderInputsGenerator; - dynamic?: boolean; - } | undefined): RemotePrerenderFunction; - /** - * Creates a remote prerender function. When called from the browser, the function will be invoked on the server via a `fetch` call. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. - * - * @since 2.27 - */ - export function prerender(schema: Schema, fn: (arg: StandardSchemaV1.InferOutput) => MaybePromise, options?: { - inputs?: RemotePrerenderInputsGenerator>; - dynamic?: boolean; - } | undefined): RemotePrerenderFunction, Output>; - /** - * Creates a remote query. When called from the browser, the function will be invoked on the server via a `fetch` call. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. - * - * @since 2.27 - */ - export function query(fn: () => MaybePromise): RemoteQueryFunction; - /** - * Creates a remote query. When called from the browser, the function will be invoked on the server via a `fetch` call. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. - * - * @since 2.27 - */ - export function query(validate: "unchecked", fn: (arg: Input) => MaybePromise): RemoteQueryFunction; - /** - * Creates a remote query. When called from the browser, the function will be invoked on the server via a `fetch` call. - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. - * - * @since 2.27 - */ - export function query(schema: Schema, fn: (arg: StandardSchemaV1.InferOutput) => MaybePromise): RemoteQueryFunction, Output, StandardSchemaV1.InferOutput>; - export namespace query { - /** - * Creates a batch query function that collects multiple calls and executes them in a single request - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query.batch) for full documentation. - * - * @since 2.35 - */ - function batch(validate: "unchecked", fn: (args: Input[]) => MaybePromise<(arg: Input, idx: number) => Output>): RemoteQueryFunction; - /** - * Creates a batch query function that collects multiple calls and executes them in a single request - * - * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query.batch) for full documentation. - * - * @since 2.35 - */ - function batch(schema: Schema, fn: (args: StandardSchemaV1.InferOutput[]) => MaybePromise<(arg: StandardSchemaV1.InferOutput, idx: number) => Output>): RemoteQueryFunction, Output, StandardSchemaV1.InferOutput>; - } - /** - * In the context of a remote `command` or `form` request, returns an iterable - * of `{ arg, query }` entries for the refreshes requested by the client, up to - * the supplied `limit`. Each `query` is a `RemoteQuery` bound to the original - * client-side cache key, so `refresh()` / `set()` propagate correctly even when - * the query's schema transforms the input. `arg` is the *validated* argument, - * i.e. the value after the schema has run (so `InferOutput` for queries - * declared with a Standard Schema). - * - * Arguments that fail validation or exceed `limit` are recorded as failures in - * the response to the client. - * - * @example - * ```ts - * import { requested } from '$app/server'; - * - * for (const { arg, query } of requested(getPost, 5)) { - * // `arg` is the validated argument; `query` is bound to the client's - * // cache key. It's safe to throw away this promise -- SvelteKit will - * // await it and forward any errors to the client. - * void query.refresh(); - * } - * ``` - * - * As a shorthand for the above, you can also call `refreshAll` on the result: - * - * ```ts - * import { requested } from '$app/server'; - * - * await requested(getPost, 5).refreshAll(); - * ``` - * - * */ - export function requested(query: RemoteQueryFunction, limit: number): RequestedResult; - type RemotePrerenderInputsGenerator = () => MaybePromise; - type MaybePromise = T | Promise; - - export {}; -} - -declare module '$app/state' { - /** - * A read-only reactive object with information about the current page, serving several use cases: - * - retrieving the combined `data` of all pages/layouts anywhere in your component tree (also see [loading data](https://svelte.dev/docs/kit/load)) - * - retrieving the current value of the `form` prop anywhere in your component tree (also see [form actions](https://svelte.dev/docs/kit/form-actions)) - * - retrieving the page state that was set through `goto`, `pushState` or `replaceState` (also see [goto](https://svelte.dev/docs/kit/$app-navigation#goto) and [shallow routing](https://svelte.dev/docs/kit/shallow-routing)) - * - retrieving metadata such as the URL you're on, the current route and its parameters, and whether or not there was an error - * - * ```svelte - * - * - * - *

Currently at {page.url.pathname}

- * - * {#if page.error} - * Problem detected - * {:else} - * All systems operational - * {/if} - * ``` - * - * Changes to `page` are available exclusively with runes. (The legacy reactivity syntax will not reflect any changes) - * - * ```svelte - * - * - * ``` - * - * On the server, values can only be read during rendering (in other words _not_ in e.g. `load` functions). In the browser, the values can be read at any time. - * - * */ - export const page: import("@sveltejs/kit").Page; - /** - * A read-only object representing an in-progress navigation, with `from`, `to`, `type` and (if `type === 'popstate'`) `delta` properties. - * Values are `null` when no navigation is occurring, or during server rendering. - * */ - export const navigating: import("@sveltejs/kit").Navigation | { - from: null; - to: null; - type: null; - willUnload: null; - delta: null; - complete: null; - }; - /** - * A read-only reactive value that's initially `false`. If [`version.pollInterval`](https://svelte.dev/docs/kit/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update `current` to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling. - * */ - export const updated: { - get current(): boolean; - check(): Promise; - }; - - export {}; -} - -declare module '$app/stores' { - export function getStores(): { - - page: typeof page; - - navigating: typeof navigating; - - updated: typeof updated; - }; - /** - * A readable store whose value contains page data. - * - * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. - * - * @deprecated Use `page` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) - * */ - export const page: import("svelte/store").Readable; - /** - * A readable store. - * When navigating starts, its value is a `Navigation` object with `from`, `to`, `type` and (if `type === 'popstate'`) `delta` properties. - * When navigating finishes, its value reverts to `null`. - * - * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. - * - * @deprecated Use `navigating` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) - * */ - export const navigating: import("svelte/store").Readable; - /** - * A readable store whose initial value is `false`. If [`version.pollInterval`](https://svelte.dev/docs/kit/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update the store value to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling. - * - * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. - * - * @deprecated Use `updated` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) - * */ - export const updated: import("svelte/store").Readable & { - check(): Promise; - }; - - export {}; -}/** - * It's possible to tell SvelteKit how to type objects inside your app by declaring the `App` namespace. By default, a new project will have a file called `src/app.d.ts` containing the following: - * - * ```ts - * declare global { - * namespace App { - * // interface Error {} - * // interface Locals {} - * // interface PageData {} - * // interface PageState {} - * // interface Platform {} - * } - * } - * - * export {}; - * ``` - * - * The `export {}` line exists because without it, the file would be treated as an _ambient module_ which prevents you from adding `import` declarations. - * If you need to add ambient `declare module` declarations, do so in a separate file like `src/ambient.d.ts`. - * - * By populating these interfaces, you will gain type safety when using `event.locals`, `event.platform`, and `data` from `load` functions. - */ -declare namespace App { - /** - * Defines the common shape of expected and unexpected errors. Expected errors are thrown using the `error` function. Unexpected errors are handled by the `handleError` hooks which should return this shape. - */ - export interface Error { - message: string; - } - - /** - * The interface that defines `event.locals`, which can be accessed in server [hooks](https://svelte.dev/docs/kit/hooks) (`handle`, and `handleError`), server-only `load` functions, and `+server.js` files. - */ - export interface Locals {} - - /** - * Defines the common shape of the [page.data state](https://svelte.dev/docs/kit/$app-state#page) and [$page.data store](https://svelte.dev/docs/kit/$app-stores#page) - that is, the data that is shared between all pages. - * The `Load` and `ServerLoad` functions in `./$types` will be narrowed accordingly. - * Use optional properties for data that is only present on specific pages. Do not add an index signature (`[key: string]: any`). - */ - export interface PageData {} - - /** - * The shape of the `page.state` object, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`. - */ - export interface PageState {} - - /** - * If your adapter provides [platform-specific context](https://svelte.dev/docs/kit/adapters#Platform-specific-context) via `event.platform`, you can specify it here. - */ - export interface Platform {} -} - -/** - * This module is only available to [service workers](https://svelte.dev/docs/kit/service-workers). - */ -declare module '$service-worker' { - /** - * The `base` path of the deployment. Typically this is equivalent to `config.kit.paths.base`, but it is calculated from `location.pathname` meaning that it will continue to work correctly if the site is deployed to a subdirectory. - * Note that there is a `base` but no `assets`, since service workers cannot be used if `config.kit.paths.assets` is specified. - */ - export const base: string; - /** - * An array of URL strings representing the files generated by Vite, suitable for caching with `cache.addAll(build)`. - * During development, this is an empty array. - */ - export const build: string[]; - /** - * An array of URL strings representing the files in your static directory, or whatever directory is specified by `config.kit.files.assets`. You can customize which files are included from `static` directory using [`config.kit.serviceWorker.files`](https://svelte.dev/docs/kit/configuration#serviceWorker) - */ - export const files: string[]; - /** - * An array of pathnames corresponding to prerendered pages and endpoints. - * During development, this is an empty array. - */ - export const prerendered: string[]; - /** - * See [`config.kit.version`](https://svelte.dev/docs/kit/configuration#version). It's useful for generating unique cache names inside your service worker, so that a later deployment of your app can invalidate old caches. - */ - export const version: string; -} - -/** - * This module contains generated types for the routes in your app. - */ -declare module '$app/types' { - /** - * Interface for all generated app types. This gets extended via declaration merging. DO NOT USE THIS INTERFACE DIRECTLY. - */ - export interface AppTypes { - // These are all functions so that we can leverage function overloads to get the correct type. - // Using the return types directly would error with a "not the same type" error. - // https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces - RouteId(): string; - RouteParams(): Record>; - LayoutParams(): Record>; - Pathname(): string; - ResolvedPathname(): string; - Asset(): string; - } - - /** - * A union of all the route IDs in your app. Used for `page.route.id` and `event.route.id`. - */ - export type RouteId = ReturnType; - - /** - * `RouteId`, but possibly suffixed with a search string and/or hash. - */ - export type RouteIdWithSearchOrHash = RouteId | `${RouteId}?${string}` | `${RouteId}#${string}`; - - /** - * A utility for getting the parameters associated with a given route. - */ - export type RouteParams = T extends keyof ReturnType - ? ReturnType[T] - : Record; - - /** - * A utility for getting the parameters associated with a given layout, which is similar to `RouteParams` but also includes optional parameters for any child route. - */ - export type LayoutParams = T extends keyof ReturnType - ? ReturnType[T] - : Record; - - /** - * A union of all valid pathnames in your app. - */ - export type Pathname = ReturnType; - - /** - * `Pathname`, but possibly suffixed with a search string and/or hash. - */ - export type PathnameWithSearchOrHash = - | Pathname - | `${Pathname}?${string}` - | `${Pathname}#${string}`; - - /** - * `Pathname`, but possibly prefixed with a base path. Used for `page.url.pathname`. - */ - export type ResolvedPathname = ReturnType; - - /** - * A union of all the filenames of assets contained in your `static` directory. - */ - export type Asset = ReturnType; -} - -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/@sveltejs/kit/types/index.d.ts.map b/frontend/node_modules/@sveltejs/kit/types/index.d.ts.map deleted file mode 100644 index 3af5d06..0000000 --- a/frontend/node_modules/@sveltejs/kit/types/index.d.ts.map +++ /dev/null @@ -1,240 +0,0 @@ -{ - "version": 3, - "file": "index.d.ts", - "names": [ - "Span", - "Adapter", - "LoadProperties", - "AwaitedActions", - "OptionalUnion", - "uniqueSymbol", - "ActionFailure", - "UnpackValidationError", - "Builder", - "Config", - "Cookies", - "Emulator", - "KitConfig", - "Handle", - "HandleServerError", - "HandleValidationError", - "HandleClientError", - "HandleFetch", - "ServerInit", - "ClientInit", - "Reroute", - "Transport", - "Transporter", - "Load", - "LoadEvent", - "NavigationEvent", - "NavigationTarget", - "NavigationType", - "NavigationBase", - "NavigationEnter", - "NavigationExternal", - "NavigationGoto", - "NavigationLeave", - "NavigationFormSubmit", - "NavigationPopState", - "NavigationLink", - "Navigation", - "BeforeNavigate", - "OnNavigate", - "AfterNavigate", - "Page", - "ParamMatcher", - "RequestedEntry", - "RequestedResult", - "RequestEvent", - "RequestHandler", - "ResolveOptions", - "RouteDefinition", - "Server", - "ServerInitOptions", - "SSRManifest", - "ServerLoad", - "ServerLoadEvent", - "Action", - "Actions", - "ActionResult", - "HttpError", - "Redirect", - "SubmitFunction", - "Snapshot", - "WillRecurseIndefinitely", - "InputTypeMap", - "RemoteFormFieldType", - "InputElementProps", - "RemoteFormFieldMethods", - "KeysOfUnion", - "ValueOfUnionKey", - "RemoteFormFieldValue", - "AsArgs", - "RemoteFormField", - "RemoteFormFieldContainer", - "UnknownField", - "RemoteFormFieldsRoot", - "RemoteFormFields", - "RecursiveFormFields", - "MaybeArray", - "RemoteFormInput", - "RemoteFormIssue", - "ExtractId", - "InvalidField", - "ValidationError", - "RemoteForm", - "RemoteCommand", - "RemoteQueryUpdate", - "RemoteResource", - "RemoteQuery", - "RemoteQueryOverride", - "RemotePrerenderFunction", - "RemoteQueryFunction", - "AdapterEntry", - "Csp", - "CspDirectives", - "HttpMethod", - "Logger", - "MaybePromise", - "Prerendered", - "PrerenderHttpErrorHandler", - "PrerenderMissingIdHandler", - "PrerenderEntryGeneratorMismatchHandler", - "PrerenderUnseenRoutesHandler", - "PrerenderHttpErrorHandlerValue", - "PrerenderMissingIdHandlerValue", - "PrerenderUnseenRoutesHandlerValue", - "PrerenderEntryGeneratorMismatchHandlerValue", - "PrerenderOption", - "RequestOptions", - "RouteSegment", - "TrailingSlash", - "DeepPartial", - "IsAny", - "Asset", - "BuildData", - "ManifestData", - "PageNode", - "RecursiveRequired", - "RouteParam", - "RouteData", - "SSRComponent", - "SSRComponentLoader", - "UniversalNode", - "ServerNode", - "SSRNode", - "SSRNodeLoader", - "PageNodeIndexes", - "PrerenderEntryGenerator", - "SSREndpoint", - "SSRRoute", - "SSRClientRoute", - "ValidatedConfig", - "ValidatedKitConfig", - "isHttpError", - "redirect", - "isRedirect", - "json", - "text", - "isActionFailure", - "invalid", - "isValidationError", - "normalizeUrl", - "ValidPageOption", - "PageOptions", - "valid_page_options_array", - "VERSION", - "sequence", - "getRequest", - "setResponse", - "createReadableStream", - "installPolyfills", - "sveltekit", - "browser", - "dev", - "building", - "version", - "deserialize", - "enhance", - "applyAction", - "afterNavigate", - "beforeNavigate", - "onNavigate", - "disableScrollHandling", - "goto", - "invalidate", - "invalidateAll", - "refreshAll", - "preloadData", - "preloadCode", - "pushState", - "replaceState", - "base", - "assets", - "resolveRoute", - "StripSearchOrHash", - "ResolveArgs", - "asset", - "resolve", - "match", - "read", - "getRequestEvent", - "requested", - "RemotePrerenderInputsGenerator", - "page", - "navigating", - "updated", - "getStores" - ], - "sources": [ - "../src/exports/public.d.ts", - "../src/exports/internal/index.js", - "../src/types/private.d.ts", - "../src/types/internal.d.ts", - "../src/exports/index.js", - "../src/exports/vite/static_analysis/index.js", - "../src/version.js", - "../src/exports/hooks/sequence.js", - "../src/exports/node/index.js", - "../src/exports/node/polyfills.js", - "../src/exports/vite/index.js", - "../src/runtime/app/environment/types.d.ts", - "../src/runtime/app/forms.js", - "../src/runtime/client/client.js", - "../src/runtime/app/paths/public.d.ts", - "../src/runtime/app/paths/types.d.ts", - "../src/runtime/app/paths/client.js", - "../src/runtime/app/server/index.js", - "../src/exports/internal/event.js", - "../src/runtime/app/server/remote/requested.js", - "../src/runtime/app/state/index.js", - "../src/runtime/app/stores.js" - ], - "sourcesContent": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "mappings": ";;;;;;;;MAiCKA,IAAIA;;;;;kBAKQC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiCZC,cAAcA;;;;;;aAMdC,cAAcA;;;;;;;;MAQrBC,aAAaA;;;;;OAKJC,YAAYA;;kBAETC,aAAaA;;;;;;MAMzBC,qBAAqBA;;;;;;;;;;;kBAWTC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8IPC,MAAMA;;;;;;;;;;;kBAWNC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4DPC,QAAQA;;;;;;;;kBAQRC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAklBdC,MAAMA;;;;;;;;;;;aAWNC,iBAAiBA;;;;;;;;;;;;aAYjBC,qBAAqBA;;;;;;;;;aASrBC,iBAAiBA;;;;;;;;;;aAUjBC,WAAWA;;;;;;;;;;aAUXC,UAAUA;;;;;;aAMVC,UAAUA;;;;;;aAMVC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;aA0BPC,SAASA;;;;;kBAKJC,WAAWA;;;;;;;;;;;;aAYhBC,IAAIA;;;;;;;;;;;;kBAYCC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyHTC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BfC,gBAAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA6CrBC,cAAcA;;kBAETC,cAAcA;;;;;;;;;;;;;;;;;;;;kBAoBdC,eAAeA;;;;;;;;;;;;;;;;;;aAkBpBC,kBAAkBA;;kBAEbC,cAAcA;;;;;;;;;;;;;;;kBAedC,eAAeA;;;;;;;;;;;;;;;kBAefC,oBAAoBA;;;;;;;;;;;;;;;;;;;;kBAoBpBC,kBAAkBA;;;;;;;;;;;;;;;;;;kBAkBlBC,cAAcA;;;;;;;;;;;;;;;;;;;;aAoBnBC,UAAUA;;;;;;;;;aASVC,cAAcA;;;;;;;;;;aAUdC,UAAUA;;;;;;;;;;;aAWVC,aAAaA;;;;;;;;;;;kBAWRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8CTC,YAAYA;;;;;;;;aAQZC,cAAcA;;;;;aAKdC,eAAeA;;;;;;;;;;;;;;;;kBAgBVC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA+GjBC,cAAcA;;;;;kBAKTC,cAAcA;;;;;;;;;;;;;;;;;;;;;;;kBAuBdC,eAAeA;;;;;;;;;;;;;;;cAenBC,MAAMA;;;;;;kBAMFC,iBAAiBA;;;;;;;kBAOjBC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;;aAyBhBC,UAAUA;;;;;;;kBAOLC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAkFpBC,MAAMA;;;;;;;;;;aAUNC,OAAOA;;;;;;;;;;;;;;;;aAgBPC,YAAYA;;;;;;;;;;;;kBC1vDXC,SAASA;;;;;;;;;;kBAqBTC,QAAQA;;;;;;;aDkwDTC,cAAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6BTC,QAAQA;;;;;;MAMpBC,uBAAuBA;;;MAGvBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA6BLC,mBAAmBA;;;;;MAK1BC,iBAAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+CjBC,sBAAsBA;;;;;;;;;;;MAWtBC,WAAWA;MACXC,eAAeA;;;;;;aAMRC,oBAAoBA;;MAE3BC,MAAMA;;;;;;;;;;;;;aAaCC,eAAeA;;;;;;;;;;;;;;MActBC,wBAAwBA;;;;;MAKxBC,YAAYA;;;;;;;;;;;;;;;;;;MAkBZC,oBAAoBA;;;;;;;;;;;;;;;aAebC,gBAAgBA;;;;;;;;;;;;;;;;;;;;;MAqBvBC,mBAAmBA;;;;MAInBC,UAAUA;;kBAEEC,eAAeA;;;;kBAIfC,eAAeA;;;;;;;MAO3BC,SAASA;;;;;;;;;;;;;aAaFC,YAAYA;;;;;;;;;;;;;;;;;;kBAkBPC,eAAeA;;;;;;;;aAQpBC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAuDVC,aAAaA;;;;;;;;aAQbC,iBAAiBA;;;;;aAKjBC,cAAcA;;;;;;;;;;;;;;;;;;aAkBdC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA2CXC,mBAAmBA;;;;;aAKnBC,uBAAuBA;;;;;;;;;;;;;;;;aAgBvBC,mBAAmBA;;;WElsEdC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkDZC,GAAGA;;;;;;;;;;;;;;;;;;;;;WAqBHC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmElBC,UAAUA;;WAELC,MAAMA;;;;;;;;;MASXC,YAAYA;;WAEPC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAmCXC,yBAAyBA;;;;;;;;;;WAUzBC,yBAAyBA;;;;WAIzBC,sCAAsCA;;;;WAItCC,4BAA4BA;;;;MAIjCC,8BAA8BA;MAC9BC,8BAA8BA;MAC9BC,iCAAiCA;;;;;MAKjCC,2CAA2CA;;;;;;aAM3CC,eAAeA;;WAIVC,cAAcA;;;;;WAKdC,YAAYA;;;;;;;MAOjBC,aAAaA;;MAEbC,WAAWA;;;;;;;;MAQXC,KAAKA;WCvMAC,KAAKA;;;;;;WAeLC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAuHTC,YAAYA;;;;;;;;;;;;;WAkBZC,QAAQA;;;;;;;;;;;;;;;;MAkCbC,iBAAiBA;;;;;;;;;WAWZC,UAAUA;;;;;;;;;;;;;WAaVC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;WAwITC,YAAYA;;;;;;;;;;;;;;;;;;;;MAoBjBC,kBAAkBA;;WAEbC,aAAaA;;;;;;;;;;;WAWbC,UAAUA;;;;;;;;;;;WAWVC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;MAyBZC,aAAaA;;WA+BRC,eAAeA;;;;;;MAMpBC,uBAAuBA;;MAGvBC,WAAWA;;;;;;;;WAQNC,QAAQA;;;;;;;;;WASRC,cAAcA;;;;;;;;;MA+CnBC,eAAeA;;;;;MAKfC,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCzedC,WAAWA;;;;;;;;;;;;;;;;;;;iBAsBXC,QAAQA;;;;;iBAiBRC,UAAUA;;;;;;iBASVC,IAAIA;;;;;;iBA4BJC,IAAIA;;;;;;;;;;;;;;;;iBAkDJC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+BfC,OAAOA;;;;;;iBAYPC,iBAAiBA;;;;;;;;;;;;;;iBAmBjBC,YAAYA;;;;;;;MCpQ2BC,eAAeA;MACjBC,WAAWA;OAd1DC,wBAAwBA;cCDjBC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC4EJC,QAAQA;;;;;;iBCyCFC,UAAUA;;;;;;iBAgDVC,WAAWA;;;;;iBAgFjBC,oBAAoBA;;;;;;;;;;;iBCtOpBC,gBAAgBA;;;;;;;;;;iBCuHVC,SAASA;;;;;;;;;cCtIlBC,OAAOA;;;;;cAKPC,GAAGA;;;;;cAKHC,QAAQA;;;;;cAKRC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;iBCaJC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;iBAgDXC,OAAOA;;;;;;;iBCm1EDC,WAAWA;;;;;;;;;;;iBA9UjBC,aAAaA;;;;;;;;;;;;iBAiBbC,cAAcA;;;;;;;;;;iBAedC,UAAUA;;;;;iBASVC,qBAAqBA;;;;;;;;;;iBA8BrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCJC,UAAUA;;;;iBA0BVC,aAAaA;;;;;iBAebC,UAAUA;;;;;;;;;;;;;;iBAqBJC,WAAWA;;;;;;;;;;;;;;;;;;iBAoCXC,WAAWA;;;;;iBAsCjBC,SAASA;;;;;iBA+CTC,YAAYA;MX7tEhBzE,YAAYA;;;;;;;;;;;;;;YY/Ib0E,IAAIA;;;;;;;;;YASJC,MAAMA;;;;;iBAKDC,YAAYA;;;MCnBvBC,iBAAiBA;;;;;;MAMVC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;;;iBCWPC,KAAKA;;;;;;;;;;;;;;;;;;;;;iBA6BLC,OAAOA;;;;;;;;;;;;;;;;;;;iBAmCDC,KAAKA;;;;;;;;;;;;;;;;;;;;;;;iBCrEXC,IAAIA;;;;;;;;iBCSJC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCiBfC,SAASA;MhB8cbC,8BAA8BA;MDhW9BrF,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ckB1GXsF,IAAIA;;;;;cAQJC,UAAUA;;;;;;;;;;;cAMVC,OAAOA;;;;;;;;;iBCrDPC,SAASA;;;;;;;;;;;;;;;cAyBTH,IAAIA;;;;;;;;;;cAiBJC,UAAUA;;;;;;;;cAeVC,OAAOA", - "ignoreList": [] -} \ No newline at end of file diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/LICENSE b/frontend/node_modules/@sveltejs/vite-plugin-svelte/LICENSE deleted file mode 100644 index c1a5d8f..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 [these people](https://github.com/sveltejs/vite-plugin-svelte/graphs/contributors) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/README.md b/frontend/node_modules/@sveltejs/vite-plugin-svelte/README.md deleted file mode 100644 index 48798bc..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# @sveltejs/vite-plugin-svelte - -The official [Svelte](https://svelte.dev) plugin for [Vite](https://vitejs.dev). - -## Usage - -```js -// vite.config.js -import { defineConfig } from 'vite'; -import { svelte } from '@sveltejs/vite-plugin-svelte'; - -export default defineConfig({ - plugins: [ - svelte({ - /* plugin options */ - }) - ] -}); -``` - -## Documentation - -- [Plugin options](../../docs/config.md) -- [FAQ](../../docs/faq.md) - -## License - -[MIT](./LICENSE) diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/package.json b/frontend/node_modules/@sveltejs/vite-plugin-svelte/package.json deleted file mode 100644 index f139cbe..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "@sveltejs/vite-plugin-svelte", - "version": "7.0.0", - "license": "MIT", - "files": [ - "src", - "types" - ], - "type": "module", - "types": "types/index.d.ts", - "exports": { - ".": { - "types": "./types/index.d.ts", - "default": "./src/index.js" - } - }, - "engines": { - "node": "^20.19 || ^22.12 || >=24" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sveltejs/vite-plugin-svelte.git", - "directory": "packages/vite-plugin-svelte" - }, - "keywords": [ - "vite-plugin", - "vite plugin", - "vite", - "svelte" - ], - "bugs": { - "url": "https://github.com/sveltejs/vite-plugin-svelte/issues" - }, - "homepage": "https://github.com/sveltejs/vite-plugin-svelte#readme", - "dependencies": { - "deepmerge": "^4.3.1", - "magic-string": "^0.30.21", - "obug": "^2.1.0", - "vitefu": "^1.1.2" - }, - "peerDependencies": { - "svelte": "^5.46.4", - "vite": "^8.0.0-beta.7 || ^8.0.0" - }, - "devDependencies": { - "@types/debug": "^4.1.12", - "sass": "^1.94.2", - "svelte": "^5.45.4", - "vite": "^8.0.0-beta.7" - }, - "scripts": { - "check:publint": "publint --strict", - "check:types": "tsc --noEmit", - "generate:types": "dts-buddy -m \"@sveltejs/vite-plugin-svelte:src/public.d.ts\"" - } -} \ No newline at end of file diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/index.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/index.js deleted file mode 100644 index acc3b74..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/index.js +++ /dev/null @@ -1,42 +0,0 @@ -import process from 'node:process'; -import { log } from './utils/log.js'; -import { configure } from './plugins/configure.js'; -import { preprocess } from './plugins/preprocess.js'; -import { compile } from './plugins/compile.js'; -import { loadCompiledCss } from './plugins/load-compiled-css.js'; -import { setupOptimizer } from './plugins/setup-optimizer.js'; -import { compileModule } from './plugins/compile-module.js'; -import { svelteInspector } from './plugins/inspector/index.js'; -import { loadCustom } from './plugins/load-custom.js'; -import { hotUpdate } from './plugins/hot-update.js'; - -/** - * returns a list of plugins to handle svelte files - * plugins are named `vite-plugin-svelte:` - * - * @param {Partial} [inlineOptions] - * @returns {import('vite').Plugin[]} - */ -export function svelte(inlineOptions) { - if (process.env.DEBUG != null) { - log.setLevel('debug'); - } - /** @type {import('./types/plugin-api.js').PluginAPI} */ - // @ts-expect-error initialize empty to guard against early use - const api = {}; // initialized by configure plugin, used in others - return [ - { name: 'vite-plugin-svelte' }, // marker for detection logic in other plugins that expect this name - configure(api, inlineOptions), - setupOptimizer(api), - loadCompiledCss(api), - loadCustom(api), - preprocess(api), - compile(api), - compileModule(api), - hotUpdate(api), - svelteInspector(api) - ]; -} - -export { vitePreprocess } from './preprocess.js'; -export { loadSvelteConfig } from './utils/load-svelte-config.js'; diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile-module.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile-module.js deleted file mode 100644 index 4ae62f9..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile-module.js +++ /dev/null @@ -1,130 +0,0 @@ -import { buildModuleIdFilter, buildModuleIdParser } from '../utils/id.js'; -import * as svelteCompiler from 'svelte/compiler'; -import { log, logCompilerWarnings } from '../utils/log.js'; -import { toRollupError } from '../utils/error.js'; -import { isSvelteWithAsync } from '../utils/svelte-version.js'; - -/** - * @param {import('../types/plugin-api.d.ts').PluginAPI} api - * @returns {import('vite').Plugin} - */ -export function compileModule(api) { - /** - * @type {import("../types/options.js").ResolvedOptions} - */ - let options; - /** - * @type {import("../types/id.js").ModuleIdParser} - */ - let idParser; - - /** - * @type {import('svelte/compiler').ModuleCompileOptions} - */ - let staticModuleCompileOptions; - - /** @type {import('vite').Plugin} */ - const plugin = { - name: 'vite-plugin-svelte:compile-module', - enforce: 'post', - async configResolved() { - options = api.options; - //@ts-expect-error transform defined below but filter not in type - plugin.transform.filter = buildModuleIdFilter(options); - idParser = buildModuleIdParser(options); - staticModuleCompileOptions = filterNonModuleCompilerOptions(options.compilerOptions); - }, - transform: { - async handler(code, id) { - const ssr = this.environment.config.consumer === 'server'; - const moduleRequest = idParser(id, ssr); - if (!moduleRequest) { - return; - } - const filename = moduleRequest.filename; - /** @type {import('svelte/compiler').CompileOptions} */ - const compileOptions = { - ...staticModuleCompileOptions, - dev: !this.environment.config.isProduction, - generate: ssr ? 'server' : 'client', - filename - }; - const dynamicCompileOptions = await options?.dynamicCompileOptions?.({ - filename, - code, - compileOptions - }); - if (dynamicCompileOptions && log.debug.enabled) { - log.debug( - `dynamic compile options for ${filename}: ${JSON.stringify(dynamicCompileOptions)}`, - undefined, - 'compileModule' - ); - } - const finalCompileOptions = dynamicCompileOptions - ? { - ...compileOptions, - ...dynamicCompileOptions - } - : compileOptions; - if (dynamicCompileOptions?.experimental) { - finalCompileOptions.experimental = { - ...compileOptions.experimental, - ...dynamicCompileOptions.experimental - }; - } - const finalModuleCompileOptions = filterNonModuleCompilerOptions(finalCompileOptions); - if (log.debug.enabled) { - log.debug( - `final ModuleCompileOptions for ${filename}: ${JSON.stringify(finalModuleCompileOptions)}`, - undefined, - 'compileModule' - ); - } - try { - const compileResult = svelteCompiler.compileModule(code, finalModuleCompileOptions); - logCompilerWarnings(moduleRequest, compileResult.warnings, options); - return compileResult.js; - } catch (e) { - throw toRollupError(e, options); - } - } - } - }; - return plugin; -} - -/** - * - * @param {import('svelte/compiler').CompileOptions} compilerOptions - * @return {import('svelte/compiler').ModuleCompileOptions} - */ -function filterNonModuleCompilerOptions(compilerOptions) { - /** @type {Array} */ - const knownModuleCompileOptionNames = ['dev', 'generate', 'filename', 'rootDir', 'warningFilter']; - if (isSvelteWithAsync) { - knownModuleCompileOptionNames.push('experimental'); - } - // not typed but this is temporary until svelte itself ignores CompileOptions passed to compileModule - const experimentalModuleCompilerOptionNames = ['async']; - - /** @type {import('svelte/compiler').ModuleCompileOptions} */ - const filtered = filterByPropNames(compilerOptions, knownModuleCompileOptionNames); - if (filtered.experimental) { - filtered.experimental = filterByPropNames( - filtered.experimental, - experimentalModuleCompilerOptionNames - ); - } - return filtered; -} - -/** - * - * @param {object} o - * @param {string[]} names - * @returns {object} - */ -function filterByPropNames(o, names) { - return Object.fromEntries(Object.entries(o).filter(([name]) => names.includes(name))); -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile.js deleted file mode 100644 index e696d8c..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile.js +++ /dev/null @@ -1,65 +0,0 @@ -import { toRollupError } from '../utils/error.js'; -import { logCompilerWarnings } from '../utils/log.js'; - -/** - * @param {import('../types/plugin-api.d.ts').PluginAPI} api - * @returns {import('vite').Plugin} - */ -export function compile(api) { - /** - * @type {import("../types/options.js").ResolvedOptions} - */ - let options; - - /** - * @type {import("../types/compile.d.ts").CompileSvelte} - */ - let compileSvelte; - /** @type {import('vite').Plugin} */ - const plugin = { - name: 'vite-plugin-svelte:compile', - configResolved() { - //@ts-expect-error defined below but filter not in type - plugin.transform.filter = api.filter; - options = api.options; - compileSvelte = api.compileSvelte; - }, - transform: { - async handler(code, id) { - const ssr = this.environment.config.consumer === 'server'; - const svelteRequest = api.idParser(id, ssr); - if (!svelteRequest || svelteRequest.raw) { - return; - } - let compileData; - try { - compileData = await compileSvelte( - svelteRequest, - code, - options, - this.getCombinedSourcemap() - ); - } catch (e) { - throw toRollupError(e, options); - } - if (compileData.compiled?.warnings) { - logCompilerWarnings(svelteRequest, compileData.compiled.warnings, options); - } - - return { - ...compileData.compiled.js, - moduleType: 'js', - meta: { - vite: { - lang: compileData.lang - }, - svelte: { - css: compileData.compiled.css - } - } - }; - } - } - }; - return plugin; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/configure.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/configure.js deleted file mode 100644 index 7db265f..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/configure.js +++ /dev/null @@ -1,82 +0,0 @@ -import process from 'node:process'; -import { isDebugNamespaceEnabled, log } from '../utils/log.js'; -import { VitePluginSvelteStats } from '../utils/vite-plugin-svelte-stats.js'; -import { - buildExtraViteConfig, - validateInlineOptions, - resolveOptions, - preResolveOptions, - ensureConfigEnvironmentMainFields, - ensureConfigEnvironmentConditions -} from '../utils/options.js'; -import { buildIdFilter, buildIdParser } from '../utils/id.js'; -import { createCompileSvelte } from '../utils/compile.js'; - -/** - * @param {Partial} [inlineOptions] - * @param {import('../types/plugin-api.d.ts').PluginAPI} api - * @returns {import('vite').Plugin} - */ -export function configure(api, inlineOptions) { - validateInlineOptions(inlineOptions); - - /** - * @type {import("../types/options.d.ts").PreResolvedOptions} - */ - let preOptions; - - /** @type {import('vite').Plugin} */ - return { - name: 'vite-plugin-svelte:config', - api, - // make sure it runs first - enforce: 'pre', - config: { - order: 'pre', - async handler(config, configEnv) { - // setup logger - if (process.env.DEBUG) { - log.setLevel('debug'); - } else if (config.logLevel) { - log.setLevel(config.logLevel); - } - - preOptions = await preResolveOptions(inlineOptions, config, configEnv); - // extra vite config - const extraViteConfig = await buildExtraViteConfig(preOptions, config); - log.debug('additional vite config', extraViteConfig, 'config'); - return extraViteConfig; - } - }, - configResolved: { - order: 'pre', - handler(config) { - const options = resolveOptions(preOptions, config); - api.options = options; - if (isDebugNamespaceEnabled('stats')) { - api.options.stats = new VitePluginSvelteStats(); - } - - api.filter = buildIdFilter(options); - api.idParser = buildIdParser(options); - api.compileSvelte = createCompileSvelte(); - log.debug('resolved options', api.options, 'config'); - } - }, - - configEnvironment(name, config, opts) { - ensureConfigEnvironmentMainFields(name, config, opts); - // @ts-expect-error the function above should make `resolve.mainFields` non-nullable - config.resolve.mainFields.unshift('svelte'); - - ensureConfigEnvironmentConditions(name, config, opts); - // @ts-expect-error the function above should make `resolve.conditions` non-nullable - config.resolve.conditions.push('svelte'); - }, - - configureServer(server) { - const { options } = api; - options.server = server; - } - }; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/hot-update.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/hot-update.js deleted file mode 100644 index 9304a0a..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/hot-update.js +++ /dev/null @@ -1,196 +0,0 @@ -import { log } from '../utils/log.js'; -import { setupWatchers } from '../utils/watch.js'; -import { SVELTE_VIRTUAL_STYLE_ID_REGEX } from '../utils/constants.js'; - -/** - * @param {import('../types/plugin-api.d.ts').PluginAPI} api - * @returns {import('vite').Plugin} - */ -export function hotUpdate(api) { - /** - * @type {import("../types/options.js").ResolvedOptions} - */ - let options; - /** - * @type {import('../types/id.d.ts').IdParser} - */ - let idParser; - - /** - * - * @type {Map} - */ - const transformResultCache = new Map(); - - /** @type {import('vite').Plugin} */ - const plugin = { - name: 'vite-plugin-svelte:hot-update', - enforce: 'post', - configResolved() { - options = api.options; - idParser = api.idParser; - - // @ts-expect-error - plugin.transform.filter = { - id: { - // reinclude virtual styles to get their output - include: [...api.filter.id.include, SVELTE_VIRTUAL_STYLE_ID_REGEX], - exclude: [ - // ignore files in node_modules, we don't hot update them - /\/node_modules\//, - // remove style exclusion - ...api.filter.id.exclude.filter((filter) => filter !== SVELTE_VIRTUAL_STYLE_ID_REGEX) - ] - } - }; - }, - - applyToEnvironment(env) { - // we only handle updates for client components - // ssr frameworks have to handle updating/reloading themselves as v-p-s can't know what they prefer - const hmrEnabled = options.compilerOptions.hmr && options.emitCss; - return hmrEnabled && env.config.consumer === 'client'; - }, - - configureServer(server) { - const clientEnvironment = Object.values(server.environments).find( - (e) => e.config.consumer === 'client' - ); - if (clientEnvironment) { - setupWatchers(options); - } else { - log.warn( - 'No client environment found, not adding watchers for svelte config and preprocessor dependencies' - ); - } - }, - - buildStart() { - transformResultCache.clear(); - }, - - transform: { - order: 'post', - handler(code, id) { - transformResultCache.set(id, code); - } - }, - hotUpdate: { - order: 'post', - async handler(ctx) { - const svelteRequest = idParser(ctx.file, false, ctx.timestamp); - if (svelteRequest) { - const { modules } = ctx; - const svelteModules = []; - const nonSvelteModules = []; - for (const mod of modules) { - if (transformResultCache.has(mod.id)) { - svelteModules.push(mod); - } else { - nonSvelteModules.push(mod); - } - } - - if (svelteModules.length === 0) { - return; // nothing to do for us - } - const affectedModules = []; - const prevResults = svelteModules.map((m) => transformResultCache.get(m.id)); - - /** @type {Set} */ - const seen = new Set(); - /** @param {string} url */ - const transformRequest = async (url) => { - if (!seen.has(url)) { - seen.add(url); - await this.environment.transformRequest(url); - } - }; - - // Transform the Svelte component itself first, so that the - // CSS cache always gets updated. - await transformRequest(svelteRequest.filename); - - for (let i = 0; i < svelteModules.length; i++) { - const mod = svelteModules[i]; - const prev = prevResults[i]; - await transformRequest(mod.url); - const next = transformResultCache.get(mod.id); - if (hasCodeChanged(prev, next, mod.id)) { - affectedModules.push(mod); - } else { - log.debug( - `skipping hot update for ${mod.id} because result is unchanged`, - undefined, - 'hmr' - ); - } - } - log.debug( - `hotUpdate for ${svelteRequest.id} result: [${affectedModules.map((m) => m.id).join(', ')}]`, - undefined, - 'hmr' - ); - return [...affectedModules, ...nonSvelteModules]; - } - } - } - }; - - return plugin; -} - -/** - * @param {string | undefined | null} prev - * @param {string | undefined | null} next - * @param {string | null} id - * @returns {boolean} - */ -function hasCodeChanged(prev, next, id) { - const isStrictEqual = nullSafeEqual(prev, next); - if (isStrictEqual) { - return false; - } - const isLooseEqual = nullSafeEqual(normalize(prev), normalize(next)); - if (!isStrictEqual && isLooseEqual) { - log.debug( - `ignoring compiler output change for ${id} as it is equal to previous output after normalization`, - undefined, - 'hmr' - ); - } - return !isLooseEqual; -} - -/** - * @param {string | null | undefined} prev - * @param {string | null | undefined} next - * @returns {boolean} - */ -function nullSafeEqual(prev, next) { - return (prev == null && next == null) || (prev != null && next != null && prev === next); -} - -/** - * remove code that only changes metadata and does not require a js update for the component to keep working - * - * 1) location numbers argument from $.add_locations calls in svelte output eg [[1,2],[3,4]] - * 2) timestamp queries added to imports by vite eg ?t=0123456789123 - * - * @param {string | null | undefined } code - * @returns {string | null | undefined} - */ -function normalize(code) { - if (code == null) { - return code; - } - - return ( - code - // svelte5 $.add_locations line numbers argument [[1,2],[3,4]] - // uses matching group replace to keep the template argument intact - .replace(/(\$\.add_locations\(.*), (\[\[[\d, [\]]+]])\)/g, '$1, []') - // vite import analysis timestamp queries, ?t=0123456789123& - .replace(/[?&]t=\d{13}\b/g, '') - ); -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/index.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/index.js deleted file mode 100644 index 32e39a6..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/index.js +++ /dev/null @@ -1,123 +0,0 @@ -import { normalizePath } from 'vite'; -import fs from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { defaultInspectorOptions, parseEnvironmentOptions } from './options.js'; -import { log } from '../../utils/log.js'; - -/** - * @param {string} url - * @returns {string} url without query params or hash - */ -function cleanUrl(url) { - return url.replace(/[?#].*$/s, ''); -} - -function getInspectorPath() { - const pluginPath = normalizePath(path.dirname(fileURLToPath(import.meta.url))); - return pluginPath.replace( - /\/vite-plugin-svelte\/src\/plugins\/inspector$/, - '/vite-plugin-svelte/src/plugins/inspector/runtime/' - ); -} - -/** - * @param {import('../../types/plugin-api.d.ts').PluginAPI} api - * @returns {import('vite').Plugin} - */ -export function svelteInspector(api) { - const inspectorPath = getInspectorPath(); - log.debug(`svelte inspector path: ${inspectorPath}`, null, 'inspector'); - - /** @type {import('../../public.d.ts').InspectorOptions} */ - let inspectorOptions; - let disabled = false; - - return { - name: 'vite-plugin-svelte-inspector', - apply: 'serve', - enforce: 'pre', - - applyToEnvironment(env) { - return !disabled && env.config.consumer === 'client'; - }, - - configResolved(config) { - const environmentOptions = parseEnvironmentOptions(config); - if (environmentOptions === false) { - log.debug('environment options set to false, inspector disabled', null, 'inspector'); - disabled = true; - return; - } - const configFileOptions = api.options?.inspector; - - if (!configFileOptions && !environmentOptions) { - log.debug('no inspector options found, inspector disabled', null, 'inspector'); - disabled = true; - return; - } - - if (environmentOptions === true) { - inspectorOptions = defaultInspectorOptions; - } else { - inspectorOptions = { - ...defaultInspectorOptions, - ...(typeof configFileOptions === 'object' ? configFileOptions : {}), - ...(environmentOptions || {}) - }; - } - - inspectorOptions.__internal = { - base: config.base?.replace(/\/$/, '') || '' - }; - }, - resolveId: { - filter: { - id: /^virtual:svelte-inspector-/ - }, - async handler(id) { - if (disabled) { - return; - } - if (id === 'virtual:svelte-inspector-options') { - return id; - } else if (id.startsWith('virtual:svelte-inspector-path:') && !id.includes('..')) { - return id.replace('virtual:svelte-inspector-path:', inspectorPath); - } - } - }, - load: { - filter: { - id: { - include: [`${inspectorPath}/**`, /^virtual:svelte-inspector-options$/], - exclude: [/style&lang\.css$/] - } - }, - async handler(id) { - if (disabled) { - return; - } - if (id === 'virtual:svelte-inspector-options') { - return `export default ${JSON.stringify(inspectorOptions ?? {})}`; - } else if (id.startsWith(inspectorPath)) { - // read file ourselves to avoid getting shut out by vites fs.allow check - const file = cleanUrl(id); - if (fs.existsSync(file)) { - return await fs.promises.readFile(file, 'utf-8'); - } else { - log.error(`failed to find svelte-inspector: ${id}`, null, 'inspector'); - } - } - } - }, - transform: { - filter: { id: /vite\/dist\/client\/client\.mjs(?:\?|$)/ }, - handler(code) { - if (disabled) { - return; - } - return { code: `${code}\nimport('virtual:svelte-inspector-path:load-inspector.js')` }; - } - } - }; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/options.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/options.js deleted file mode 100644 index eeaeea7..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/options.js +++ /dev/null @@ -1,65 +0,0 @@ -import process from 'node:process'; -import { loadEnv } from 'vite'; -import { log } from '../../utils/log.js'; - -/** @type {import('../../public.d.ts').InspectorOptions} */ -export const defaultInspectorOptions = { - toggleKeyCombo: 'alt-x', - navKeys: { parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' }, - escapeKeys: ['Backspace', 'Escape'], - openKey: 'Enter', - holdMode: true, - showToggleButton: 'active', - toggleButtonPos: 'top-right', - customStyles: true -}; - -/** - * @param {import('vite').ResolvedConfig} config - * @returns {Partial | boolean | void} - */ -export function parseEnvironmentOptions(config) { - const env = loadEnv(config.mode, config.envDir ?? process.cwd(), 'SVELTE_INSPECTOR'); - const options = env?.SVELTE_INSPECTOR_OPTIONS; - const toggle = env?.SVELTE_INSPECTOR_TOGGLE; - if (options) { - try { - const parsed = JSON.parse(options); - const parsedType = typeof parsed; - if (parsedType === 'boolean') { - return parsed; - } else if (parsedType === 'object') { - if (Array.isArray(parsed)) { - throw new Error('invalid type, expected object map but got array'); - } - const parsedKeys = Object.keys(parsed); - const defaultKeys = Object.keys(defaultInspectorOptions); - const unknownKeys = parsedKeys.filter((k) => !defaultKeys.includes(k)); - if (unknownKeys.length) { - log.warn( - `[vite-plugin-svelte-inspector] ignoring unknown options in environment SVELTE_INSPECTOR_OPTIONS: ${unknownKeys.join( - ', ' - )}`, - null, - 'inspector' - ); - for (const key of unknownKeys) { - delete parsed[key]; - } - } - log.debug('loaded environment config', parsed, 'inspector'); - return parsed; - } - } catch (e) { - config.logger.error( - `[vite-plugin-svelte-inspector] failed to parse inspector options from environment SVELTE_INSPECTOR_OPTIONS="${options}"\n${e}` - ); - } - } else if (toggle) { - const keyConfig = { - toggleKeyCombo: toggle - }; - log.debug('loaded environment config', keyConfig, 'inspector'); - return keyConfig; - } -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/runtime/Inspector.svelte b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/runtime/Inspector.svelte deleted file mode 100644 index 9a03c49..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/runtime/Inspector.svelte +++ /dev/null @@ -1,411 +0,0 @@ - - - - -{#if show_toggle} - -{/if} -{#if enabled && active_el && file_loc} - {@const loc = active_el.__svelte_meta.loc} -
- <{active_el.tagName.toLowerCase()}> {file_loc} -
-
- {active_el.tagName.toLowerCase()} in file {loc.file} on line {loc.line} column {loc.column} -
-{/if} - - diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/runtime/load-inspector.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/runtime/load-inspector.js deleted file mode 100644 index 5662f9f..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/inspector/runtime/load-inspector.js +++ /dev/null @@ -1,14 +0,0 @@ -// eslint-disable-next-line n/no-missing-import -import Inspector from 'virtual:svelte-inspector-path:Inspector.svelte'; -import { mount } from 'svelte'; -function create_inspector_host() { - const id = 'svelte-inspector-host'; - if (document.getElementById(id) != null) { - throw new Error('svelte-inspector-host element already exists'); - } - const el = document.createElement('div'); - el.setAttribute('id', id); - document.documentElement.appendChild(el); - return el; -} -mount(Inspector, { target: create_inspector_host() }); diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-compiled-css.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-compiled-css.js deleted file mode 100644 index 0a9e9c2..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-compiled-css.js +++ /dev/null @@ -1,66 +0,0 @@ -import { log } from '../utils/log.js'; -import { SVELTE_VIRTUAL_STYLE_ID_REGEX } from '../utils/constants.js'; - -const filter = { id: SVELTE_VIRTUAL_STYLE_ID_REGEX }; - -/** - * @param {import('../types/plugin-api.d.ts').PluginAPI} api - * @returns {import('vite').Plugin} - */ -export function loadCompiledCss(api) { - let useLocalCache = false; - - /** @type{Map} */ - const buildWatchCssCache = new Map(); - return { - name: 'vite-plugin-svelte:load-compiled-css', - - configResolved(c) { - const isDev = c.command === 'serve'; - const isBuildWatch = !!c.build?.watch; - useLocalCache = isDev || isBuildWatch; - }, - - resolveId: { - filter, // same filter in load to ensure minimal work - handler(id) { - log.debug(`resolveId resolved virtual css module ${id}`, undefined, 'resolve'); - return id; - } - }, - load: { - filter, - async handler(id) { - const ssr = this.environment.config.consumer === 'server'; - const svelteRequest = api.idParser(id, ssr); - if (!svelteRequest) { - return; - } - let cachedCss = this.getModuleInfo(svelteRequest.filename)?.meta.svelte?.css; - // in `build --watch` or dev ssr reloads getModuleInfo only returns changed module data. - // To ensure virtual css is loaded unchanged, we cache it here separately - if (useLocalCache) { - if (cachedCss) { - buildWatchCssCache.set(svelteRequest.filename, cachedCss); - } else { - cachedCss = buildWatchCssCache.get(svelteRequest.filename); - } - } - - if (cachedCss) { - const { hasGlobal, ...css } = cachedCss; - if (hasGlobal === false) { - // hasGlobal was added in svelte 5.26.0, so make sure it is boolean false - css.meta ??= {}; - css.meta.vite ??= {}; - css.meta.vite.cssScopeTo = [svelteRequest.filename, 'default']; - } - css.moduleType = 'css'; - return css; - } else { - log.warn(`failed to load virtual css module ${id}`, undefined, 'load'); - } - } - } - }; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-custom.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-custom.js deleted file mode 100644 index 2c762c0..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-custom.js +++ /dev/null @@ -1,42 +0,0 @@ -import fs from 'node:fs'; -import { log } from '../utils/log.js'; - -/** - * if svelte config includes files that vite treats as assets (e.g. .svg) - * we have to manually load them to avoid getting urls - * - * @param {import('../types/plugin-api.d.ts').PluginAPI} api - * @returns {import('vite').Plugin} - */ -export function loadCustom(api) { - /** @type {import('vite').Plugin} */ - const plugin = { - name: 'vite-plugin-svelte:load-custom', - enforce: 'pre', // must come before vites own asset handling or custom extensions like .svg won't work - configResolved() { - //@ts-expect-error load defined below but filter not in type - plugin.load.filter = api.filter; - }, - - load: { - //filter: is set in configResolved - async handler(id) { - const config = this.environment.config; - const ssr = config.consumer === 'server'; - const svelteRequest = api.idParser(id, ssr); - if (svelteRequest) { - const { filename, query } = svelteRequest; - if (!query.url && config.assetsInclude(filename)) { - log.debug( - `loading ${filename} to prevent vite asset handling to turn it into a url by default`, - undefined, - 'load' - ); - return fs.readFileSync(filename, 'utf-8'); - } - } - } - } - }; - return plugin; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/preprocess.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/preprocess.js deleted file mode 100644 index 827885e..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/preprocess.js +++ /dev/null @@ -1,208 +0,0 @@ -import { toRollupError } from '../utils/error.js'; -import { mapToRelative } from '../utils/sourcemaps.js'; -import * as svelte from 'svelte/compiler'; -import { log } from '../utils/log.js'; -import { arraify } from '../utils/options.js'; -import fs from 'node:fs'; -import path from 'node:path'; - -/** - * @param {import('../types/plugin-api.d.ts').PluginAPI} api - * @returns {import('vite').Plugin} - */ -export function preprocess(api) { - /** - * @type {import("../types/options.js").ResolvedOptions} - */ - let options; - - /** - * @type {DependenciesCache} - */ - let dependenciesCache; - - /** - * @type {import("../types/compile.d.ts").PreprocessSvelte} - */ - let preprocessSvelte; - - /** @type {import('vite').Plugin} */ - const plugin = { - name: 'vite-plugin-svelte:preprocess', - enforce: 'pre', - configResolved(c) { - options = api.options; - if (arraify(options.preprocess).length > 0) { - preprocessSvelte = createPreprocessSvelte(options, c); - // @ts-expect-error defined below but filter not in type - plugin.transform.filter = api.filter; - } else { - log.debug( - `disabling ${plugin.name} because no preprocessor is configured`, - undefined, - 'preprocess' - ); - // @ts-expect-error force set undefined to clear memory - preprocessSvelte = undefined; - // @ts-expect-error defined below but filter not in type - plugin.transform.filter = { id: /$./ }; // never match - } - }, - configureServer(server) { - dependenciesCache = new DependenciesCache(server); - }, - buildStart() { - dependenciesCache?.clear(); - }, - transform: { - async handler(code, id) { - const ssr = this.environment.config.consumer === 'server'; - const svelteRequest = api.idParser(id, ssr); - if (!svelteRequest) { - return; - } - try { - const preprocessed = await preprocessSvelte(svelteRequest, code, options); - dependenciesCache?.update(svelteRequest, preprocessed?.dependencies ?? []); - if (!preprocessed) { - return; - } - if (options.isBuild && this.environment.config.build.watch && preprocessed.dependencies) { - for (const dep of preprocessed.dependencies) { - this.addWatchFile(dep); - } - } - - /** @type {import('vite').Rollup.SourceDescription}*/ - const result = { code: preprocessed.code }; - if (preprocessed.map) { - // @ts-expect-error type differs but should work - result.map = preprocessed.map; - } - return result; - } catch (e) { - throw toRollupError(e, options); - } - } - } - }; - return plugin; -} -/** - * @param {import("../types/options.js").ResolvedOptions} options - * @param {import("vite").ResolvedConfig} resolvedConfig - * @returns {import('../types/compile.d.ts').PreprocessSvelte} - */ -function createPreprocessSvelte(options, resolvedConfig) { - /** @type {Array} */ - const preprocessors = arraify(options.preprocess); - - for (const preprocessor of preprocessors) { - if (preprocessor.style && '__resolvedConfig' in preprocessor.style) { - preprocessor.style.__resolvedConfig = resolvedConfig; - } - } - - /** @type {import('../types/compile.d.ts').PreprocessSvelte} */ - return async function preprocessSvelte(svelteRequest, code) { - const { filename } = svelteRequest; - let preprocessed; - if (preprocessors && preprocessors.length > 0) { - try { - preprocessed = await svelte.preprocess(code, preprocessors, { filename }); // full filename here so postcss works - } catch (e) { - e.message = `Error while preprocessing ${filename}${e.message ? ` - ${e.message}` : ''}`; - throw e; - } - if (typeof preprocessed?.map === 'object') { - mapToRelative(preprocessed?.map, filename); - } - return preprocessed; - } - }; -} - -/** - * @class - * - * caches dependencies of preprocessed files and emit change events on dependants - */ -class DependenciesCache { - /** @type {Map} */ - #dependencies = new Map(); - /** @type {Map>} */ - #dependants = new Map(); - - /** @type {import('vite').ViteDevServer} */ - #server; - /** - * - * @param {import('vite').ViteDevServer} server - */ - constructor(server) { - this.#server = server; - /** @type {(filename: string) => void} */ - const emitChangeEventOnDependants = (filename) => { - const dependants = this.#dependants.get(filename); - dependants?.forEach((dependant) => { - if (fs.existsSync(dependant)) { - log.debug( - `emitting virtual change event for "${dependant}" because dependency "${filename}" changed`, - undefined, - 'hmr' - ); - server.watcher.emit('change', dependant); - } - }); - }; - server.watcher.on('change', emitChangeEventOnDependants); - server.watcher.on('unlink', emitChangeEventOnDependants); - } - - /** - * @param {string} file - */ - #ensureWatchedFile(file) { - const root = this.#server.config.root; - if ( - file && - // only need to watch if out of root - !file.startsWith(root + '/') && - // some rollup plugins use null bytes for private resolved Ids - !file.includes('\0') && - fs.existsSync(file) - ) { - // resolve file to normalized system path - this.#server.watcher.add(path.resolve(file)); - } - } - - clear() { - this.#dependencies.clear(); - this.#dependants.clear(); - } - - /** - * - * @param {import('../types/id.d.ts').SvelteRequest} svelteRequest - * @param {string[]} dependencies - */ - update(svelteRequest, dependencies) { - const id = svelteRequest.normalizedFilename; - const prevDependencies = this.#dependencies.get(id) || []; - - this.#dependencies.set(id, dependencies); - const removed = prevDependencies.filter((d) => !dependencies.includes(d)); - const added = dependencies.filter((d) => !prevDependencies.includes(d)); - added.forEach((d) => { - this.#ensureWatchedFile(d); - if (!this.#dependants.has(d)) { - this.#dependants.set(d, new Set()); - } - /** @type {Set} */ (this.#dependants.get(d)).add(svelteRequest.filename); - }); - removed.forEach((d) => { - /** @type {Set} */ (this.#dependants.get(d)).delete(svelteRequest.filename); - }); - } -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/setup-optimizer.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/setup-optimizer.js deleted file mode 100644 index c7709c1..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/setup-optimizer.js +++ /dev/null @@ -1,269 +0,0 @@ -import fs from 'node:fs/promises'; -import path from 'node:path'; -import * as svelte from 'svelte/compiler'; -import { log } from '../utils/log.js'; -import { toRollupError } from '../utils/error.js'; - -/** - * @typedef {NonNullable} RollupPlugin - */ - -const optimizeSveltePluginName = 'vite-plugin-svelte:optimize'; -const optimizeSvelteModulePluginName = 'vite-plugin-svelte:optimize-module'; - -/** - * @param {import('../types/plugin-api.d.ts').PluginAPI} api - * @returns {import('vite').Plugin} - */ -export function setupOptimizer(api) { - /** @type {import('vite').ResolvedConfig} */ - let viteConfig; - - return { - name: 'vite-plugin-svelte:setup-optimizer', - apply: 'serve', - config() { - /** @type {import('vite').UserConfig['optimizeDeps']} */ - const optimizeDeps = { - // Experimental Vite API to allow these extensions to be scanned and prebundled - extensions: ['.svelte'] - }; - // Add optimizer plugins to prebundle Svelte files. - // Currently, a placeholder as more information is needed after Vite config is resolved, - // the added plugins are patched in configResolved below - - optimizeDeps.rolldownOptions = { - plugins: [ - placeholderRolldownOptimizerPlugin(optimizeSveltePluginName), - placeholderRolldownOptimizerPlugin(optimizeSvelteModulePluginName) - ] - }; - - return { optimizeDeps }; - }, - configResolved(c) { - viteConfig = c; - const optimizeDeps = c.optimizeDeps; - const plugins = - // @ts-expect-error not typed - optimizeDeps.rolldownOptions?.plugins?.filter((p) => - [optimizeSveltePluginName, optimizeSvelteModulePluginName].includes(p.name) - ) ?? []; - for (const plugin of plugins) { - patchRolldownOptimizerPlugin(plugin, api.options); - } - }, - async buildStart() { - if (!api.options.prebundleSvelteLibraries) return; - const changed = await svelteMetadataChanged(viteConfig.cacheDir, api.options); - if (changed) { - // Force Vite to optimize again. Although we mutate the config here, it works because - // Vite's optimizer runs after `buildStart()`. - viteConfig.optimizeDeps.force = true; - } - } - }; -} - -/** - * @param {RollupPlugin} plugin - * @param {import('../types/options.d.ts').ResolvedOptions} options - */ -function patchRolldownOptimizerPlugin(plugin, options) { - const components = plugin.name === optimizeSveltePluginName; - const compileFn = components ? compileSvelte : compileSvelteModule; - const statsName = components ? 'prebundle library components' : 'prebundle library modules'; - const includeRe = components ? /^[^?#]+\.svelte(?:[?#]|$)/ : /^[^?#]+\.svelte\.[jt]s(?:[?#]|$)/; - /** @type {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection | undefined} */ - let statsCollection; - - plugin.options = (opts) => { - // @ts-expect-error plugins is an array here - const isScanner = opts.plugins.some( - (/** @type {{ name: string; }} */ p) => p.name === 'vite:dep-scan:resolve' - ); - if (isScanner) { - delete plugin.buildStart; - delete plugin.transform; - delete plugin.buildEnd; - } else { - plugin.transform = { - filter: { id: includeRe }, - /** - * @param {string} code - * @param {string} filename - */ - async handler(code, filename) { - try { - return await compileFn(options, { filename, code }, statsCollection); - } catch (e) { - throw toRollupError(e, options); - } - } - }; - plugin.buildStart = () => { - statsCollection = options.stats?.startCollection(statsName, { - logResult: (c) => c.stats.length > 1 - }); - }; - plugin.buildEnd = () => { - statsCollection?.finish(); - }; - } - }; -} - -/** - * @param {import('../types/options.d.ts').ResolvedOptions} options - * @param {{ filename: string, code: string }} input - * @param {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection} [statsCollection] - * @returns {Promise} - */ -async function compileSvelte(options, { filename, code }, statsCollection) { - let css = options.compilerOptions.css; - if (css !== 'injected') { - // TODO ideally we'd be able to externalize prebundled styles too, but for now always put them in the js - css = 'injected'; - } - /** @type {import('svelte/compiler').CompileOptions} */ - const compileOptions = { - dev: true, // default to dev: true because prebundling is only used in dev - ...options.compilerOptions, - css, - filename, - generate: 'client' - }; - - let preprocessed; - - if (options.preprocess) { - try { - preprocessed = await svelte.preprocess(code, options.preprocess, { filename }); - } catch (e) { - e.message = `Error while preprocessing ${filename}${e.message ? ` - ${e.message}` : ''}`; - throw e; - } - if (preprocessed.map) compileOptions.sourcemap = preprocessed.map; - } - - const finalCode = preprocessed ? preprocessed.code : code; - - const dynamicCompileOptions = await options?.dynamicCompileOptions?.({ - filename, - code: finalCode, - compileOptions - }); - - if (dynamicCompileOptions && log.debug.enabled) { - log.debug( - `dynamic compile options for ${filename}: ${JSON.stringify(dynamicCompileOptions)}`, - undefined, - 'compile' - ); - } - - const finalCompileOptions = dynamicCompileOptions - ? { - ...compileOptions, - ...dynamicCompileOptions - } - : compileOptions; - const endStat = statsCollection?.start(filename); - const compiled = svelte.compile(finalCode, finalCompileOptions); - if (endStat) { - endStat(); - } - return { - ...compiled.js, - moduleType: 'js' - }; -} - -/** - * @param {import('../types/options.d.ts').ResolvedOptions} options - * @param {{ filename: string; code: string }} input - * @param {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection} [statsCollection] - * @returns {Promise} - */ -async function compileSvelteModule(options, { filename, code }, statsCollection) { - const endStat = statsCollection?.start(filename); - const compiled = svelte.compileModule(code, { - dev: options.compilerOptions?.dev ?? true, // default to dev: true because prebundling is only used in dev - filename, - generate: 'client' - }); - if (endStat) { - endStat(); - } - return { - ...compiled.js, - moduleType: 'js' - }; -} - -// List of options that changes the prebundling result -/** @type {(keyof import('../types/options.d.ts').ResolvedOptions)[]} */ -const PREBUNDLE_SENSITIVE_OPTIONS = [ - 'compilerOptions', - 'configFile', - 'experimental', - 'extensions', - 'preprocess' -]; - -/** - * stores svelte metadata in cache dir and compares if it has changed - * - * @param {string} cacheDir - * @param {import('../types/options.d.ts').ResolvedOptions} options - * @returns {Promise} Whether the Svelte metadata has changed - */ -async function svelteMetadataChanged(cacheDir, options) { - const svelteMetadata = generateSvelteMetadata(options); - const svelteMetadataPath = path.resolve(cacheDir, '_svelte_metadata.json'); - - const currentSvelteMetadata = JSON.stringify(svelteMetadata, (_, value) => { - // Handle preprocessors - return typeof value === 'function' ? value.toString() : value; - }); - - /** @type {string | undefined} */ - let existingSvelteMetadata; - try { - existingSvelteMetadata = await fs.readFile(svelteMetadataPath, 'utf8'); - } catch { - // ignore - } - - await fs.mkdir(cacheDir, { recursive: true }); - await fs.writeFile(svelteMetadataPath, currentSvelteMetadata); - return currentSvelteMetadata !== existingSvelteMetadata; -} - -/** - * - * @param {string} name - * @returns {import('vite').Rollup.Plugin} - */ -function placeholderRolldownOptimizerPlugin(name) { - return { - name, - options() {}, - buildStart() {}, - buildEnd() {}, - transform: { filter: { id: /^$/ }, handler() {} } - }; -} - -/** - * @param {import('../types/options.d.ts').ResolvedOptions} options - * @returns {Partial} - */ -function generateSvelteMetadata(options) { - /** @type {Record} */ - const metadata = {}; - for (const key of PREBUNDLE_SENSITIVE_OPTIONS) { - metadata[key] = options[key]; - } - return metadata; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.js deleted file mode 100644 index 8ace662..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.js +++ /dev/null @@ -1,133 +0,0 @@ -import process from 'node:process'; -import * as vite from 'vite'; -import { mapToRelative, removeLangSuffix } from './utils/sourcemaps.js'; -const { - isCSSRequest, - preprocessCSS, - resolveConfig, - //@ts-ignore rolldown types don't exist - transformWithOxc -} = vite; -/** - * @typedef {(code: string, filename: string) => Promise<{ code: string; map?: any; deps?: Set }>} CssTransform - */ - -const supportedScriptLangs = ['ts']; - -export const lang_sep = '.vite-preprocess'; - -/** - * @param {import('./public.d.ts').VitePreprocessOptions} [opts] - * @returns {import('svelte/compiler').PreprocessorGroup} - */ -export function vitePreprocess(opts) { - /** @type {import('svelte/compiler').PreprocessorGroup} */ - const preprocessor = { name: 'vite-preprocess' }; - if (opts?.script === true) { - preprocessor.script = viteScript().script; - } - if (opts?.style !== false) { - const styleOpts = typeof opts?.style == 'object' ? opts?.style : undefined; - preprocessor.style = viteStyle(styleOpts).style; - } - return preprocessor; -} - -/** - * @returns {{ script: import('svelte/compiler').Preprocessor }} - */ -function viteScript() { - return { - async script({ attributes, content, filename = '' }) { - if (typeof attributes.lang !== 'string' || !supportedScriptLangs.includes(attributes.lang)) { - return; - } - const lang = /** @type {'ts'} */ (attributes.lang); - const { code, map } = await transformWithOxc(content, filename, { - lang, - target: 'esnext' - // TODO, how to pass tsconfig compilerOptions (or not needed as config is loaded for file - /*tsconfigRaw: { - compilerOptions: { - // svelte typescript needs this flag to work with type imports - importsNotUsedAsValues: 'preserve', - preserveValueImports: true - } - }*/ - }); - - mapToRelative(map, filename); - - return { - code, - map - }; - } - }; -} - -/** - * @param {import('vite').ResolvedConfig | import('vite').InlineConfig} config - * @returns {{ style: import('svelte/compiler').Preprocessor }} - */ -function viteStyle(config = {}) { - /** @type {Promise | CssTransform} */ - let cssTransform; - /** @type {import('svelte/compiler').Preprocessor} */ - const style = async ({ attributes, content, filename = '' }) => { - const ext = attributes.lang ? `.${attributes.lang}` : '.css'; - if (attributes.lang && !isCSSRequest(ext)) return; - if (!cssTransform) { - cssTransform = createCssTransform(style, config).then((t) => (cssTransform = t)); - } - const transform = await cssTransform; - const suffix = `${lang_sep}${ext}`; - const moduleId = `${filename}${suffix}`; - const { code, map, deps } = await transform(content, moduleId); - removeLangSuffix(map, suffix); - mapToRelative(map, filename); - const dependencies = deps ? Array.from(deps).filter((d) => !d.endsWith(suffix)) : undefined; - return { - code, - map: map ?? undefined, - dependencies - }; - }; - // @ts-expect-error tag so can be found by v-p-s - style.__resolvedConfig = null; - return { style }; -} - -/** - * @param {import('svelte/compiler').Preprocessor} style - * @param {import('vite').ResolvedConfig | import('vite').InlineConfig} config - * @returns {Promise} - */ -async function createCssTransform(style, config) { - /** @type {import('vite').ResolvedConfig} */ - let resolvedConfig; - // @ts-expect-error special prop added if running in v-p-s - if (style.__resolvedConfig) { - // @ts-expect-error not typed - resolvedConfig = style.__resolvedConfig; - } else if (isResolvedConfig(config)) { - resolvedConfig = config; - } else { - // default to "build" if no NODE_ENV is set to avoid running in dev mode for svelte-check etc. - const useBuild = !process.env.NODE_ENV || process.env.NODE_ENV === 'production'; - const command = useBuild ? 'build' : 'serve'; - const defaultMode = useBuild ? 'production' : 'development'; - resolvedConfig = await resolveConfig(config, command, defaultMode, defaultMode, false); - } - return async (code, filename) => { - return preprocessCSS(code, filename, resolvedConfig); - }; -} - -/** - * @param {any} config - * @returns {config is import('vite').ResolvedConfig} - */ -function isResolvedConfig(config) { - return !!config.inlineConfig; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/public.d.ts b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/public.d.ts deleted file mode 100644 index 0cf3687..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/public.d.ts +++ /dev/null @@ -1,271 +0,0 @@ -import type { InlineConfig, ResolvedConfig } from 'vite'; -import type { CompileOptions, Warning, PreprocessorGroup } from 'svelte/compiler'; - -export type Options = Omit & PluginOptionsInline; - -interface PluginOptionsInline extends PluginOptions { - /** - * Path to a svelte config file, either absolute or relative to Vite root - * - * set to `false` to ignore the svelte config file - * - * @see https://vitejs.dev/config/#root - */ - configFile?: string | false; -} - -export interface PluginOptions { - /** - * A `picomatch` pattern, or array of patterns, which specifies the files the plugin should - * operate on. By default, all svelte files are included. - * - * @see https://github.com/micromatch/picomatch - */ - include?: Arrayable; - /** - * A `picomatch` pattern, or array of patterns, which specifies the files to be ignored by the - * plugin. By default, no files are ignored. - * - * @see https://github.com/micromatch/picomatch - */ - exclude?: Arrayable; - /** - * Emit Svelte styles as virtual CSS files for Vite and other plugins to process - * - * @default true - */ - emitCss?: boolean; - - /** - * vite-plugin-svelte automatically handles excluding svelte libraries and reinclusion of their dependencies - * in vite.optimizeDeps. - * - * `disableDependencyReinclusion: true` disables all reinclusions - * `disableDependencyReinclusion: ['foo','bar']` disables reinclusions for dependencies of foo and bar - * - * This should be used for hybrid packages that contain both node and browser dependencies, eg Routify - * - * @default false - */ - disableDependencyReinclusion?: boolean | string[]; - /** - * Enable support for Vite's dependency optimization to prebundle Svelte libraries. - * - * To disable prebundling for a specific library, add it to `optimizeDeps.exclude`. - * - * @default true for dev, false for build - */ - prebundleSvelteLibraries?: boolean; - /** - * toggle/configure Svelte Inspector - * - * @default unset for dev, always false for build - */ - inspector?: InspectorOptions | boolean; - - /** - * A function to update `compilerOptions` before compilation - * - * `data.filename` - The file to be compiled - * `data.code` - The preprocessed Svelte code - * `data.compileOptions` - The current compiler options - * - * To change part of the compiler options, return an object with the changes you need. - * - * @example - * ``` - * ({ filename, compileOptions }) => { - * // Dynamically set runes mode per Svelte file - * if (forceRunesMode(filename) && !compileOptions.runes) { - * return { runes: true }; - * } - * } - * ``` - */ - dynamicCompileOptions?: (data: { - filename: string; - code: string; - compileOptions: Partial; - }) => Promise | void> | Partial | void; - - /** - * These options are considered experimental and breaking changes to them can occur in any release - */ - experimental?: ExperimentalOptions; -} - -export interface SvelteConfig { - /** - * A list of file extensions to be compiled by Svelte - * - * @default ['.svelte'] - */ - extensions?: string[]; - /** - * An array of preprocessors to transform the Svelte source code before compilation - * - * @see https://svelte.dev/docs/svelte/svelte-compiler#PreprocessorGroup - */ - preprocess?: Arrayable; - /** - * The options to be passed to the Svelte compiler. A few options are set by default, - * including `dev` and `css`. However, some options are non-configurable, like - * `filename`, `format`, `generate`, and `cssHash` (in dev). - * - * @see https://svelte.dev/docs/svelte/svelte-compiler#CompileOptions - */ - compilerOptions?: Omit; - - /** - * Handles warning emitted from the Svelte compiler - * - * warnings emitted for files in node_modules are logged at the debug level, to see them run - * `DEBUG=vite-plugin-svelte:node-modules-onwarn pnpm build` - * - * @example - * ``` - * (warning, defaultHandler) => { - * // ignore some warnings - * if (!['foo','bar'].includes(warning.code)) { - * defaultHandler(warning); - * } - * } - * ``` - * - */ - onwarn?: (warning: Warning, defaultHandler: (warning: Warning) => void) => void; - /** - * Options for vite-plugin-svelte - */ - vitePlugin?: PluginOptions; -} - -/** - * These options are considered experimental and breaking changes to them can occur in any release - */ -interface ExperimentalOptions { - /** - * send a websocket message with svelte compiler warnings during dev - * - */ - sendWarningsToBrowser?: boolean; - /** - * disable svelte field resolve warnings - * - * @default false - */ - disableSvelteResolveWarnings?: boolean; - - compileModule?: CompileModuleOptions; -} - -interface CompileModuleOptions { - /** - * infix that must be present in filename - * @default ['.svelte.'] - */ - infixes?: string[]; - /** - * module extensions - * @default ['.ts','.js'] - */ - extensions?: string[]; - include?: Arrayable; - exclude?: Arrayable; -} - -type Arrayable = T | T[]; - -export interface VitePreprocessOptions { - /** - * preprocess script block with vite pipeline. - * Since svelte5 this is not needed for typescript anymore - * - * @default false - */ - script?: boolean; - /** - * preprocess style blocks with vite pipeline - */ - style?: boolean | InlineConfig | ResolvedConfig; -} - -export interface InspectorOptions { - /** - * define a key combo to toggle inspector, - * @default 'alt-x' - * - * any number of modifiers `control` `shift` `alt` `meta` followed by zero or one regular key, separated by - - * examples: control-shift, control-o, control-alt-s meta-x control-meta - * Some keys have native behavior (e.g. alt-s opens history menu on firefox). - * To avoid conflicts or accidentally typing into inputs, modifier only combinations are recommended. - */ - toggleKeyCombo?: string; - - /** - * define keys to select elements with via keyboard - * @default {parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' } - * - * improves accessibility and also helps when you want to select elements that do not have a hoverable surface area - * due to tight wrapping - * - * A note for users of screen-readers: - * If you are using arrow keys to navigate the page itself, change the navKeys to avoid conflicts. - * e.g. navKeys: {parent: 'w', prev: 'a', child: 's', next: 'd'} - * - * - * parent: select closest parent - * child: select first child (or grandchild) - * next: next sibling (or parent if no next sibling exists) - * prev: previous sibling (or parent if no prev sibling exists) - */ - navKeys?: { parent: string; child: string; next: string; prev: string }; - - /** - * define key to open the editor for the currently selected dom node - * - * @default 'Enter' - */ - openKey?: string; - - /** - * define keys to close the inspector - * @default ['Backspace', 'Escape'] - */ - escapeKeys?: string[]; - - /** - * inspector is automatically disabled when releasing toggleKeyCombo after holding it for a longpress - * @default true - */ - holdMode?: boolean; - - /** - * when to show the toggle button - * @default 'active' - */ - showToggleButton?: 'always' | 'active' | 'never'; - - /** - * where to display the toggle button - * @default 'top-right' - */ - toggleButtonPos?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; - - /** - * inject custom styles when inspector is active - */ - customStyles?: boolean; - - /** - * internal options that are automatically set, not to be set or used by users - * @internal - */ - __internal?: { - // vite base url - base: string; - }; -} - -// eslint-disable-next-line n/no-missing-import -export * from './index.js'; diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/compile.d.ts b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/compile.d.ts deleted file mode 100644 index cb73d95..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/compile.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { Processed, CompileResult } from 'svelte/compiler'; -import type { SvelteRequest } from './id.d.ts'; -import type { ResolvedOptions } from './options.d.ts'; -import type { CustomPluginOptionsVite, Rollup } from 'vite'; - -export type CompileSvelte = ( - svelteRequest: SvelteRequest, - code: string, - options: Partial, - sourcemap?: Rollup.SourceMap -) => Promise; - -export type PreprocessSvelte = ( - svelteRequest: SvelteRequest, - code: string, - options: Partial -) => Promise; - -export interface Code { - code: string; - map?: any; - dependencies?: any[]; - hasGlobal?: boolean; - moduleType?: string; //vite-8 beta - meta?: { - vite?: CustomPluginOptionsVite; - }; -} - -export interface CompileData { - filename: string; - normalizedFilename: string; - cssId: string; - lang: string; - compiled: CompileResult; - ssr: boolean | undefined; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/id.d.ts b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/id.d.ts deleted file mode 100644 index f8434c7..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/id.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -export type SvelteQueryTypes = 'style'; - -export interface RequestQuery { - // our own - svelte?: boolean; - type?: SvelteQueryTypes; - // vite specific - url?: boolean; - raw?: boolean; - direct?: boolean; - inline?: boolean; -} - -export interface SvelteRequest { - id: string; - cssId: string; - filename: string; - normalizedFilename: string; - query: RequestQuery; - timestamp: number; - ssr: boolean; - raw: boolean; -} - -export interface SvelteModuleRequest { - id: string; - filename: string; - normalizedFilename: string; - query: RequestQuery; - timestamp: number; - ssr: boolean; -} - -export type IdParser = (id: string, ssr: boolean, timestamp?: number) => SvelteRequest | undefined; - -export type IdFilter = { - id: { - include: Array; - exclude: Array; - }; -}; -export type ModuleIdParser = ( - id: string, - ssr: boolean, - timestamp?: number -) => SvelteModuleRequest | undefined; diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/log.d.ts b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/log.d.ts deleted file mode 100644 index fd4f13e..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/log.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Warning } from 'svelte/compiler'; - -export interface LogFn extends SimpleLogFn { - (message: string, payload?: unknown, namespace?: string): void; - - enabled: boolean; - once: SimpleLogFn; -} - -export interface SimpleLogFn { - (message: string, payload?: unknown, namespace?: string): void; -} - -export type SvelteWarningsMessage = { - id: string; - filename: string; - normalizedFilename: string; - timestamp: number; - warnings: Warning[]; // allWarnings filtered by warnings where onwarn did not call the default handler - allWarnings: Warning[]; // includes warnings filtered by onwarn and our extra vite plugin svelte warnings - rawWarnings: Warning[]; // raw compiler output -}; - -export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'; diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/options.d.ts b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/options.d.ts deleted file mode 100644 index 5b4ca42..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/options.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { CompileOptions } from 'svelte/compiler'; -import type { ViteDevServer } from 'vite'; -// eslint-disable-next-line n/no-missing-import -import { VitePluginSvelteStats } from '../utils/vite-plugin-svelte-stats.js'; -import type { Options } from '../public.d.ts'; - -export interface PreResolvedOptions extends Options { - // these options are non-nullable after resolve - compilerOptions: CompileOptions; - // extra options - root: string; - isBuild: boolean; - isServe: boolean; - isDebug: boolean; -} - -export interface ResolvedOptions extends PreResolvedOptions { - isProduction: boolean; - server?: ViteDevServer; - stats?: VitePluginSvelteStats; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/plugin-api.d.ts b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/plugin-api.d.ts deleted file mode 100644 index ae1f3ca..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/plugin-api.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ResolvedOptions } from './options.d.ts'; -import type { IdFilter, IdParser } from './id.d.ts'; -import type { CompileSvelte } from './compile.d.ts'; - -export interface PluginAPI { - options: ResolvedOptions; - filter: IdFilter; - idParser: IdParser; - compileSvelte: CompileSvelte; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/vite-plugin-svelte-stats.d.ts b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/vite-plugin-svelte-stats.d.ts deleted file mode 100644 index 1b69ebd..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/types/vite-plugin-svelte-stats.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export interface Stat { - file: string; - pkg?: string; - start: number; - end: number; -} - -export interface StatCollection { - name: string; - options: CollectionOptions; - - start: (file: string) => () => void; - stats: Stat[]; - packageStats?: PackageStats[]; - collectionStart: number; - duration?: number; - finish: () => Promise | void; - finished: boolean; -} - -export interface PackageStats { - pkg: string; - files: number; - duration: number; -} - -export interface CollectionOptions { - logInProgress: (collection: StatCollection, now: number) => boolean; - logResult: (collection: StatCollection) => boolean; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js deleted file mode 100644 index 51cc8d8..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js +++ /dev/null @@ -1,149 +0,0 @@ -import * as svelte from 'svelte/compiler'; -import { log } from './log.js'; - -import { mapToRelative } from './sourcemaps.js'; -import { enhanceCompileError } from './error.js'; - -// TODO this is a patched version of https://github.com/sveltejs/vite-plugin-svelte/pull/796/files#diff-3bce0b33034aad4b35ca094893671f7e7ddf4d27254ae7b9b0f912027a001b15R10 -// which is closer to the other regexes in at least not falling into commented script -// but ideally would be shared exactly with svelte and other tools that use it -const scriptLangRE = - /|]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/g; - -/** - * @returns {import('../types/compile.d.ts').CompileSvelte} - */ -export function createCompileSvelte() { - /** @type {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection | undefined} */ - let stats; - /** @type {import('../types/compile.d.ts').CompileSvelte} */ - return async function compileSvelte(svelteRequest, code, options, sourcemap) { - const { filename, normalizedFilename, cssId, ssr, raw } = svelteRequest; - const { emitCss = true } = options; - /** @type {import('svelte/compiler').Warning[]} */ - const warnings = []; - - if (options.stats) { - if (options.isBuild) { - if (!stats) { - // build is either completely ssr or csr, create stats collector on first compile - // it is then finished in the buildEnd hook. - stats = options.stats.startCollection(`${ssr ? 'ssr' : 'dom'} compile`, { - logInProgress: () => false - }); - } - } else { - // dev time ssr, it's a ssr request and there are no stats, assume new page load and start collecting - if (ssr && !stats) { - stats = options.stats.startCollection('ssr compile'); - } - // stats are being collected but this isn't an ssr request, assume page loaded and stop collecting - if (!ssr && stats) { - stats.finish(); - stats = undefined; - } - // TODO find a way to trace dom compile during dev - // problem: we need to call finish at some point but have no way to tell if page load finished - // also they for hmr updates too - } - } - - /** @type {import('svelte/compiler').CompileOptions} */ - const compileOptions = { - ...options.compilerOptions, - filename, - generate: ssr ? 'server' : 'client' - }; - - let finalCode = code; - if (compileOptions.hmr && options.emitCss) { - const closeStylePos = code.lastIndexOf(''); - if (closeStylePos > -1) { - // inject rule that forces compile to attach scope class to every node in the template - // this reduces the amount of js hot updates when editing css in .svelte files - finalCode = finalCode.slice(0, closeStylePos) + ' *{}' + finalCode.slice(closeStylePos); - } - } - - const dynamicCompileOptions = await options?.dynamicCompileOptions?.({ - filename, - code: finalCode, - compileOptions - }); - if (dynamicCompileOptions && log.debug.enabled) { - log.debug( - `dynamic compile options for ${filename}: ${JSON.stringify(dynamicCompileOptions)}`, - undefined, - 'compile' - ); - } - const finalCompileOptions = dynamicCompileOptions - ? { - ...compileOptions, - ...dynamicCompileOptions - } - : compileOptions; - if (sourcemap) { - finalCompileOptions.sourcemap = sourcemap; - } - const endStat = stats?.start(filename); - /** @type {import('svelte/compiler').CompileResult} */ - let compiled; - try { - compiled = svelte.compile(finalCode, { ...finalCompileOptions, filename }); - - // patch output with partial accept until svelte does it - // TODO remove later - if ( - options.server?.config.experimental.hmrPartialAccept && - compiled.js.code.includes('import.meta.hot.accept(') - ) { - compiled.js.code = compiled.js.code.replaceAll( - 'import.meta.hot.accept(', - 'import.meta.hot.acceptExports(["default"],' - ); - } - } catch (e) { - enhanceCompileError(e, code, options.preprocess); - throw e; - } - - if (endStat) { - endStat(); - } - mapToRelative(compiled.js?.map, filename); - mapToRelative(compiled.css?.map, filename); - if (warnings.length) { - if (!compiled.warnings) { - compiled.warnings = []; - } - compiled.warnings.push(...warnings); - } - if (!raw) { - // wire css import and code for hmr - const hasCss = compiled.css?.code?.trim()?.length ?? 0 > 0; - // compiler might not emit css with mode none or it may be empty - if (emitCss && hasCss) { - // TODO properly update sourcemap? - compiled.js.code += `\nimport ${JSON.stringify(cssId)};\n`; - } - } - - let lang = 'js'; - for (const match of code.matchAll(scriptLangRE)) { - if (match[2]) { - lang = match[2]; - break; - } - } - - return { - filename, - normalizedFilename, - cssId, - lang, - compiled, - ssr - }; - }; -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/constants.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/constants.js deleted file mode 100644 index ac96e81..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/constants.js +++ /dev/null @@ -1,37 +0,0 @@ -import { createRequire } from 'node:module'; - -const sveltePkg = createRequire(import.meta.url)('svelte/package.json'); - -// list of svelte runtime dependencies to optimize together with svelte itself -export const SVELTE_RUNTIME_DEPENDENCIES = [ - 'clsx' // avoids dev server restart after page load with npm + vite6 (see #1067) -].filter((dep) => !!sveltePkg.dependencies?.[dep]); - -export const SVELTE_IMPORTS = Object.entries(sveltePkg.exports) - .map(([name, config]) => { - // ignore type only - if (typeof config === 'object' && Object.keys(config).length === 1 && config.types) { - return ''; - } - // ignore names - if (name === './package.json' || name === './compiler') { - return ''; - } - return name.replace(/^\./, 'svelte'); - }) - .filter((s) => s.length > 0); - -export const SVELTE_EXPORT_CONDITIONS = ['svelte']; - -const FAQ_URL = 'https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md'; -export const FAQ_LINK_MISSING_EXPORTS_CONDITION = `${FAQ_URL}#missing-exports-condition`; -export const FAQ_LINK_CSSHASH = `${FAQ_URL}#why-should-csshash-be-calculated-from-filename-during-dev`; - -export const LINK_TRANSFORM_WITH_PLUGIN = - 'https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/advanced-usage.md#transform-svelte-files-with-vite-plugins'; - -export const DEFAULT_SVELTE_EXT = ['.svelte']; -export const DEFAULT_SVELTE_MODULE_INFIX = ['.svelte.']; -export const DEFAULT_SVELTE_MODULE_EXT = ['.js', '.ts']; - -export const SVELTE_VIRTUAL_STYLE_ID_REGEX = /[?&]svelte&type=style&lang.css$/; diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/dependencies.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/dependencies.js deleted file mode 100644 index 341bf3c..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/dependencies.js +++ /dev/null @@ -1,60 +0,0 @@ -const COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [ - '@lukeed/uuid', - '@playwright/test', - '@sveltejs/kit', - '@sveltejs/package', - '@sveltejs/vite-plugin-svelte', - 'autoprefixer', - 'cookie', - 'dotenv', - 'esbuild', - 'eslint', - 'jest', - 'mdsvex', - 'playwright', - 'postcss', - 'prettier', - 'svelte', - 'svelte2tsx', - 'svelte-check', - 'svelte-preprocess', - 'tslib', - 'typescript', - 'vite', - 'vitest', - '__vite-browser-external' // see https://github.com/sveltejs/vite-plugin-svelte/issues/362 -]; -const COMMON_PREFIXES_WITHOUT_SVELTE_FIELD = [ - '@fontsource/', - '@postcss-plugins/', - '@rollup/', - '@sveltejs/adapter-', - '@types/', - '@typescript-eslint/', - 'eslint-', - 'jest-', - 'postcss-plugin-', - 'prettier-plugin-', - 'rollup-plugin-', - 'vite-plugin-' -]; - -/** - * Test for common dependency names that tell us it is not a package including a svelte field, eg. eslint + plugins. - * - * This speeds up the find process as we don't have to try and require the package.json for all of them - * - * @param {string} dependency - * @returns {boolean} true if it is a dependency without a svelte field - */ -export function isCommonDepWithoutSvelteField(dependency) { - return ( - COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD.includes(dependency) || - COMMON_PREFIXES_WITHOUT_SVELTE_FIELD.some( - (prefix) => - prefix.startsWith('@') - ? dependency.startsWith(prefix) - : dependency.substring(dependency.lastIndexOf('/') + 1).startsWith(prefix) // check prefix omitting @scope/ - ) - ); -} diff --git a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js b/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js deleted file mode 100644 index 6f943ae..0000000 --- a/frontend/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js +++ /dev/null @@ -1,167 +0,0 @@ -import { buildExtendedLogMessage } from './log.js'; - -/** - * convert an error thrown by svelte.compile to a RollupError so that vite displays it in a user friendly way - * @param {import('svelte/compiler').Warning & Error & {frame?: string}} error a svelte compiler error, which is a mix of Warning and an error - * @param {import('../types/options.d.ts').ResolvedOptions} options - * @returns {import('vite').Rollup.RollupError} the converted error - */ -export function toRollupError(error, options) { - const { filename, frame, start, code, name, stack } = error; - /** @type {import('vite').Rollup.RollupError} */ - const rollupError = { - name, // needed otherwise sveltekit coalesce_to_error turns it into a string - id: filename, - message: buildExtendedLogMessage(error), // include filename:line:column so that it's clickable - frame: formatFrameForVite(frame), - code, - stack: options.isBuild || options.isDebug || !frame ? stack : '' - }; - if (start) { - rollupError.loc = { - line: start.line, - column: start.column, - file: filename - }; - } - return rollupError; -} - -/** - * convert an error thrown by svelte.compile to an esbuild PartialMessage - * @param {import('svelte/compiler').Warning & Error & {frame?: string}} error a svelte compiler error, which is a mix of Warning and an error - * @param {import('../types/options.d.ts').ResolvedOptions} options - * @returns {any} the converted error as esbuild PartialMessage - * - * note: typed any to avoid esbuild devDependency for a single internal type import - */ -export function toESBuildError(error, options) { - const { filename, frame, start, stack } = error; - /** @type any */ - const partialMessage = { - text: buildExtendedLogMessage(error) - }; - if (start) { - partialMessage.location = { - line: start.line, - column: start.column, - file: filename, - lineText: lineFromFrame(start.line, frame) // needed to get a meaningful error message on cli - }; - } - if (options.isBuild || options.isDebug || !frame) { - partialMessage.detail = stack; - } - return partialMessage; -} - -/** - * extract line with number from codeframe - * - * @param {number} lineNo - * @param {string} [frame] - * @returns {string} - */ -function lineFromFrame(lineNo, frame) { - if (!frame) { - return ''; - } - const lines = frame.split('\n'); - const errorLine = lines.find((line) => line.trimStart().startsWith(`${lineNo}: `)); - return errorLine ? errorLine.substring(errorLine.indexOf(': ') + 3) : ''; -} - -/** - * vite error overlay expects a specific format to show frames - * this reformats svelte frame (colon separated, less whitespace) - * to one that vite displays on overlay ( pipe separated, more whitespace) - * e.g. - * ``` - * 1: foo - * 2: bar; - * ^ - * 3: baz - * ``` - * to - * ``` - * 1 | foo - * 2 | bar; - * ^ - * 3 | baz - * ``` - * @see https://github.com/vitejs/vite/blob/96591bf9989529de839ba89958755eafe4c445ae/packages/vite/src/client/overlay.ts#L116 - * @param {string} [frame] - * @returns {string} - */ -function formatFrameForVite(frame) { - if (!frame) { - return ''; - } - return frame - .split('\n') - .map((line) => (line.match(/^\s+\^/) ? ' ' + line : ' ' + line.replace(':', ' | '))) - .join('\n'); -} - -/** - * - * @param {string} code the svelte error code - * @see https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/errors.js - * @returns {boolean} - */ -function couldBeFixedByCssPreprocessor(code) { - return code === 'expected_token' || code === 'unexpected_eof' || code?.startsWith('css_'); -} - -/** - * @param {import('svelte/compiler').Warning & Error} err a svelte compiler error, which is a mix of Warning and an error - * @param {string} originalCode - * @param {import('../public.d.ts').Options['preprocess']} [preprocessors] - */ -export function enhanceCompileError(err, originalCode, preprocessors) { - preprocessors = arraify(preprocessors ?? []); - - /** @type {string[]} */ - const additionalMessages = []; - - // Handle incorrect CSS preprocessor usage - if (couldBeFixedByCssPreprocessor(err.code)) { - // Reference from Svelte: https://github.com/sveltejs/svelte/blob/9926347ad9dbdd0f3324d5538e25dcb7f5e442f8/packages/svelte/src/compiler/preprocess/index.js#L257 - const styleRe = - /|'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)|\s+[^=>'"/]+)*\s*)(?:\/>|>([\S\s]*?)<\/style>)/g; - - let m; - while ((m = styleRe.exec(originalCode))) { - if (m[0]?.startsWith('` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types$1.incDec, 2) - } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.plusMin, 1) - }; - - pp.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } - return this.finishOp(types$1.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types$1.incDec, 2) - } - if (next === 61) { return this.finishOp(types$1.assign, 2) } - return this.finishOp(types$1.plusMin, 1) -}; - -pp.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } - return this.finishOp(types$1.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // ` - -```js -const x = { - foo: { bar: 3 }, - array: [{ - does: 'work', - too: [ 1, 2, 3 ] - }] -} - -const y = { - foo: { baz: 4 }, - quux: 5, - array: [{ - does: 'work', - too: [ 4, 5, 6 ] - }, { - really: 'yes' - }] -} - -const output = { - foo: { - bar: 3, - baz: 4 - }, - array: [{ - does: 'work', - too: [ 1, 2, 3 ] - }, { - does: 'work', - too: [ 4, 5, 6 ] - }, { - really: 'yes' - }], - quux: 5 -} - -merge(x, y) // => output -``` - - -### Installation - -With [npm](http://npmjs.org) do: - -```sh -npm install deepmerge -``` - -deepmerge can be used directly in the browser without the use of package managers/bundlers as well: [UMD version from unpkg.com](https://unpkg.com/deepmerge/dist/umd.js). - - -### Include - -deepmerge exposes a CommonJS entry point: - -``` -const merge = require('deepmerge') -``` - -The ESM entry point was dropped due to a [Webpack bug](https://github.com/webpack/webpack/issues/6584). - -# API - - -## `merge(x, y, [options])` - -Merge two objects `x` and `y` deeply, returning a new merged object with the -elements from both `x` and `y`. - -If an element at the same key is present for both `x` and `y`, the value from -`y` will appear in the result. - -Merging creates a new object, so that neither `x` or `y` is modified. - -**Note:** By default, arrays are merged by concatenating them. - -## `merge.all(arrayOfObjects, [options])` - -Merges any number of objects into a single result object. - -```js -const foobar = { foo: { bar: 3 } } -const foobaz = { foo: { baz: 4 } } -const bar = { bar: 'yay!' } - -merge.all([ foobar, foobaz, bar ]) // => { foo: { bar: 3, baz: 4 }, bar: 'yay!' } -``` - - -## Options - -### `arrayMerge` - -There are multiple ways to merge two arrays, below are a few examples but you can also create your own custom function. - -Your `arrayMerge` function will be called with three arguments: a `target` array, the `source` array, and an `options` object with these properties: - -- `isMergeableObject(value)` -- `cloneUnlessOtherwiseSpecified(value, options)` - -#### `arrayMerge` example: overwrite target array - -Overwrites the existing array values completely rather than concatenating them: - -```js -const overwriteMerge = (destinationArray, sourceArray, options) => sourceArray - -merge( - [1, 2, 3], - [3, 2, 1], - { arrayMerge: overwriteMerge } -) // => [3, 2, 1] -``` - -#### `arrayMerge` example: combine arrays - -Combines objects at the same index in the two arrays. - -This was the default array merging algorithm pre-version-2.0.0. - -```js -const combineMerge = (target, source, options) => { - const destination = target.slice() - - source.forEach((item, index) => { - if (typeof destination[index] === 'undefined') { - destination[index] = options.cloneUnlessOtherwiseSpecified(item, options) - } else if (options.isMergeableObject(item)) { - destination[index] = merge(target[index], item, options) - } else if (target.indexOf(item) === -1) { - destination.push(item) - } - }) - return destination -} - -merge( - [{ a: true }], - [{ b: true }, 'ah yup'], - { arrayMerge: combineMerge } -) // => [{ a: true, b: true }, 'ah yup'] -``` - -### `isMergeableObject` - -By default, deepmerge clones every property from almost every kind of object. - -You may not want this, if your objects are of special types, and you want to copy the whole object instead of just copying its properties. - -You can accomplish this by passing in a function for the `isMergeableObject` option. - -If you only want to clone properties of plain objects, and ignore all "special" kinds of instantiated objects, you probably want to drop in [`is-plain-object`](https://github.com/jonschlinkert/is-plain-object). - -```js -const { isPlainObject } = require('is-plain-object') - -function SuperSpecial() { - this.special = 'oh yeah man totally' -} - -const instantiatedSpecialObject = new SuperSpecial() - -const target = { - someProperty: { - cool: 'oh for sure' - } -} - -const source = { - someProperty: instantiatedSpecialObject -} - -const defaultOutput = merge(target, source) - -defaultOutput.someProperty.cool // => 'oh for sure' -defaultOutput.someProperty.special // => 'oh yeah man totally' -defaultOutput.someProperty instanceof SuperSpecial // => false - -const customMergeOutput = merge(target, source, { - isMergeableObject: isPlainObject -}) - -customMergeOutput.someProperty.cool // => undefined -customMergeOutput.someProperty.special // => 'oh yeah man totally' -customMergeOutput.someProperty instanceof SuperSpecial // => true -``` - -### `customMerge` - -Specifies a function which can be used to override the default merge behavior for a property, based on the property name. - -The `customMerge` function will be passed the key for each property, and should return the function which should be used to merge the values for that property. - -It may also return undefined, in which case the default merge behaviour will be used. - -```js -const alex = { - name: { - first: 'Alex', - last: 'Alexson' - }, - pets: ['Cat', 'Parrot'] -} - -const tony = { - name: { - first: 'Tony', - last: 'Tonison' - }, - pets: ['Dog'] -} - -const mergeNames = (nameA, nameB) => `${nameA.first} and ${nameB.first}` - -const options = { - customMerge: (key) => { - if (key === 'name') { - return mergeNames - } - } -} - -const result = merge(alex, tony, options) - -result.name // => 'Alex and Tony' -result.pets // => ['Cat', 'Parrot', 'Dog'] -``` - - -### `clone` - -*Deprecated.* - -Defaults to `true`. - -If `clone` is `false` then child objects will be copied directly instead of being cloned. This was the default behavior before version 2.x. - - -# Testing - -With [npm](http://npmjs.org) do: - -```sh -npm test -``` - - -# License - -MIT diff --git a/frontend/node_modules/deepmerge/rollup.config.js b/frontend/node_modules/deepmerge/rollup.config.js deleted file mode 100644 index 8323ab2..0000000 --- a/frontend/node_modules/deepmerge/rollup.config.js +++ /dev/null @@ -1,22 +0,0 @@ -import resolve from 'rollup-plugin-node-resolve' -import commonjs from 'rollup-plugin-commonjs' -import pkg from './package.json' - -export default { - input: `index.js`, - plugins: [ - commonjs(), - resolve(), - ], - output: [ - { - file: pkg.main, - format: `cjs` - }, - { - name: 'deepmerge', - file: 'dist/umd.js', - format: `umd` - }, - ], -} diff --git a/frontend/node_modules/detect-libc/LICENSE b/frontend/node_modules/detect-libc/LICENSE deleted file mode 100644 index 8dada3e..0000000 --- a/frontend/node_modules/detect-libc/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/frontend/node_modules/detect-libc/README.md b/frontend/node_modules/detect-libc/README.md deleted file mode 100644 index 23212fd..0000000 --- a/frontend/node_modules/detect-libc/README.md +++ /dev/null @@ -1,163 +0,0 @@ -# detect-libc - -Node.js module to detect details of the C standard library (libc) -implementation provided by a given Linux system. - -Currently supports detection of GNU glibc and MUSL libc. - -Provides asychronous and synchronous functions for the -family (e.g. `glibc`, `musl`) and version (e.g. `1.23`, `1.2.3`). - -The version numbers of libc implementations -are not guaranteed to be semver-compliant. - -For previous v1.x releases, please see the -[v1](https://github.com/lovell/detect-libc/tree/v1) branch. - -## Install - -```sh -npm install detect-libc -``` - -## API - -### GLIBC - -```ts -const GLIBC: string = 'glibc'; -``` - -A String constant containing the value `glibc`. - -### MUSL - -```ts -const MUSL: string = 'musl'; -``` - -A String constant containing the value `musl`. - -### family - -```ts -function family(): Promise; -``` - -Resolves asychronously with: - -* `glibc` or `musl` when the libc family can be determined -* `null` when the libc family cannot be determined -* `null` when run on a non-Linux platform - -```js -const { family, GLIBC, MUSL } = require('detect-libc'); - -switch (await family()) { - case GLIBC: ... - case MUSL: ... - case null: ... -} -``` - -### familySync - -```ts -function familySync(): string | null; -``` - -Synchronous version of `family()`. - -```js -const { familySync, GLIBC, MUSL } = require('detect-libc'); - -switch (familySync()) { - case GLIBC: ... - case MUSL: ... - case null: ... -} -``` - -### version - -```ts -function version(): Promise; -``` - -Resolves asychronously with: - -* The version when it can be determined -* `null` when the libc family cannot be determined -* `null` when run on a non-Linux platform - -```js -const { version } = require('detect-libc'); - -const v = await version(); -if (v) { - const [major, minor, patch] = v.split('.'); -} -``` - -### versionSync - -```ts -function versionSync(): string | null; -``` - -Synchronous version of `version()`. - -```js -const { versionSync } = require('detect-libc'); - -const v = versionSync(); -if (v) { - const [major, minor, patch] = v.split('.'); -} -``` - -### isNonGlibcLinux - -```ts -function isNonGlibcLinux(): Promise; -``` - -Resolves asychronously with: - -* `false` when the libc family is `glibc` -* `true` when the libc family is not `glibc` -* `false` when run on a non-Linux platform - -```js -const { isNonGlibcLinux } = require('detect-libc'); - -if (await isNonGlibcLinux()) { ... } -``` - -### isNonGlibcLinuxSync - -```ts -function isNonGlibcLinuxSync(): boolean; -``` - -Synchronous version of `isNonGlibcLinux()`. - -```js -const { isNonGlibcLinuxSync } = require('detect-libc'); - -if (isNonGlibcLinuxSync()) { ... } -``` - -## Licensing - -Copyright 2017 Lovell Fuller and others. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/frontend/node_modules/detect-libc/index.d.ts b/frontend/node_modules/detect-libc/index.d.ts deleted file mode 100644 index 4c0fb2b..0000000 --- a/frontend/node_modules/detect-libc/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2017 Lovell Fuller and others. -// SPDX-License-Identifier: Apache-2.0 - -export const GLIBC: 'glibc'; -export const MUSL: 'musl'; - -export function family(): Promise; -export function familySync(): string | null; - -export function isNonGlibcLinux(): Promise; -export function isNonGlibcLinuxSync(): boolean; - -export function version(): Promise; -export function versionSync(): string | null; diff --git a/frontend/node_modules/detect-libc/lib/detect-libc.js b/frontend/node_modules/detect-libc/lib/detect-libc.js deleted file mode 100644 index 01299b4..0000000 --- a/frontend/node_modules/detect-libc/lib/detect-libc.js +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2017 Lovell Fuller and others. -// SPDX-License-Identifier: Apache-2.0 - -'use strict'; - -const childProcess = require('child_process'); -const { isLinux, getReport } = require('./process'); -const { LDD_PATH, SELF_PATH, readFile, readFileSync } = require('./filesystem'); -const { interpreterPath } = require('./elf'); - -let cachedFamilyInterpreter; -let cachedFamilyFilesystem; -let cachedVersionFilesystem; - -const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true'; -let commandOut = ''; - -const safeCommand = () => { - if (!commandOut) { - return new Promise((resolve) => { - childProcess.exec(command, (err, out) => { - commandOut = err ? ' ' : out; - resolve(commandOut); - }); - }); - } - return commandOut; -}; - -const safeCommandSync = () => { - if (!commandOut) { - try { - commandOut = childProcess.execSync(command, { encoding: 'utf8' }); - } catch (_err) { - commandOut = ' '; - } - } - return commandOut; -}; - -/** - * A String constant containing the value `glibc`. - * @type {string} - * @public - */ -const GLIBC = 'glibc'; - -/** - * A Regexp constant to get the GLIBC Version. - * @type {string} - */ -const RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i; - -/** - * A String constant containing the value `musl`. - * @type {string} - * @public - */ -const MUSL = 'musl'; - -const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-'); - -const familyFromReport = () => { - const report = getReport(); - if (report.header && report.header.glibcVersionRuntime) { - return GLIBC; - } - if (Array.isArray(report.sharedObjects)) { - if (report.sharedObjects.some(isFileMusl)) { - return MUSL; - } - } - return null; -}; - -const familyFromCommand = (out) => { - const [getconf, ldd1] = out.split(/[\r\n]+/); - if (getconf && getconf.includes(GLIBC)) { - return GLIBC; - } - if (ldd1 && ldd1.includes(MUSL)) { - return MUSL; - } - return null; -}; - -const familyFromInterpreterPath = (path) => { - if (path) { - if (path.includes('/ld-musl-')) { - return MUSL; - } else if (path.includes('/ld-linux-')) { - return GLIBC; - } - } - return null; -}; - -const getFamilyFromLddContent = (content) => { - content = content.toString(); - if (content.includes('musl')) { - return MUSL; - } - if (content.includes('GNU C Library')) { - return GLIBC; - } - return null; -}; - -const familyFromFilesystem = async () => { - if (cachedFamilyFilesystem !== undefined) { - return cachedFamilyFilesystem; - } - cachedFamilyFilesystem = null; - try { - const lddContent = await readFile(LDD_PATH); - cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); - } catch (e) {} - return cachedFamilyFilesystem; -}; - -const familyFromFilesystemSync = () => { - if (cachedFamilyFilesystem !== undefined) { - return cachedFamilyFilesystem; - } - cachedFamilyFilesystem = null; - try { - const lddContent = readFileSync(LDD_PATH); - cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); - } catch (e) {} - return cachedFamilyFilesystem; -}; - -const familyFromInterpreter = async () => { - if (cachedFamilyInterpreter !== undefined) { - return cachedFamilyInterpreter; - } - cachedFamilyInterpreter = null; - try { - const selfContent = await readFile(SELF_PATH); - const path = interpreterPath(selfContent); - cachedFamilyInterpreter = familyFromInterpreterPath(path); - } catch (e) {} - return cachedFamilyInterpreter; -}; - -const familyFromInterpreterSync = () => { - if (cachedFamilyInterpreter !== undefined) { - return cachedFamilyInterpreter; - } - cachedFamilyInterpreter = null; - try { - const selfContent = readFileSync(SELF_PATH); - const path = interpreterPath(selfContent); - cachedFamilyInterpreter = familyFromInterpreterPath(path); - } catch (e) {} - return cachedFamilyInterpreter; -}; - -/** - * Resolves with the libc family when it can be determined, `null` otherwise. - * @returns {Promise} - */ -const family = async () => { - let family = null; - if (isLinux()) { - family = await familyFromInterpreter(); - if (!family) { - family = await familyFromFilesystem(); - if (!family) { - family = familyFromReport(); - } - if (!family) { - const out = await safeCommand(); - family = familyFromCommand(out); - } - } - } - return family; -}; - -/** - * Returns the libc family when it can be determined, `null` otherwise. - * @returns {?string} - */ -const familySync = () => { - let family = null; - if (isLinux()) { - family = familyFromInterpreterSync(); - if (!family) { - family = familyFromFilesystemSync(); - if (!family) { - family = familyFromReport(); - } - if (!family) { - const out = safeCommandSync(); - family = familyFromCommand(out); - } - } - } - return family; -}; - -/** - * Resolves `true` only when the platform is Linux and the libc family is not `glibc`. - * @returns {Promise} - */ -const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC; - -/** - * Returns `true` only when the platform is Linux and the libc family is not `glibc`. - * @returns {boolean} - */ -const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC; - -const versionFromFilesystem = async () => { - if (cachedVersionFilesystem !== undefined) { - return cachedVersionFilesystem; - } - cachedVersionFilesystem = null; - try { - const lddContent = await readFile(LDD_PATH); - const versionMatch = lddContent.match(RE_GLIBC_VERSION); - if (versionMatch) { - cachedVersionFilesystem = versionMatch[1]; - } - } catch (e) {} - return cachedVersionFilesystem; -}; - -const versionFromFilesystemSync = () => { - if (cachedVersionFilesystem !== undefined) { - return cachedVersionFilesystem; - } - cachedVersionFilesystem = null; - try { - const lddContent = readFileSync(LDD_PATH); - const versionMatch = lddContent.match(RE_GLIBC_VERSION); - if (versionMatch) { - cachedVersionFilesystem = versionMatch[1]; - } - } catch (e) {} - return cachedVersionFilesystem; -}; - -const versionFromReport = () => { - const report = getReport(); - if (report.header && report.header.glibcVersionRuntime) { - return report.header.glibcVersionRuntime; - } - return null; -}; - -const versionSuffix = (s) => s.trim().split(/\s+/)[1]; - -const versionFromCommand = (out) => { - const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/); - if (getconf && getconf.includes(GLIBC)) { - return versionSuffix(getconf); - } - if (ldd1 && ldd2 && ldd1.includes(MUSL)) { - return versionSuffix(ldd2); - } - return null; -}; - -/** - * Resolves with the libc version when it can be determined, `null` otherwise. - * @returns {Promise} - */ -const version = async () => { - let version = null; - if (isLinux()) { - version = await versionFromFilesystem(); - if (!version) { - version = versionFromReport(); - } - if (!version) { - const out = await safeCommand(); - version = versionFromCommand(out); - } - } - return version; -}; - -/** - * Returns the libc version when it can be determined, `null` otherwise. - * @returns {?string} - */ -const versionSync = () => { - let version = null; - if (isLinux()) { - version = versionFromFilesystemSync(); - if (!version) { - version = versionFromReport(); - } - if (!version) { - const out = safeCommandSync(); - version = versionFromCommand(out); - } - } - return version; -}; - -module.exports = { - GLIBC, - MUSL, - family, - familySync, - isNonGlibcLinux, - isNonGlibcLinuxSync, - version, - versionSync -}; diff --git a/frontend/node_modules/detect-libc/lib/elf.js b/frontend/node_modules/detect-libc/lib/elf.js deleted file mode 100644 index aa166aa..0000000 --- a/frontend/node_modules/detect-libc/lib/elf.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 Lovell Fuller and others. -// SPDX-License-Identifier: Apache-2.0 - -'use strict'; - -const interpreterPath = (elf) => { - if (elf.length < 64) { - return null; - } - if (elf.readUInt32BE(0) !== 0x7F454C46) { - // Unexpected magic bytes - return null; - } - if (elf.readUInt8(4) !== 2) { - // Not a 64-bit ELF - return null; - } - if (elf.readUInt8(5) !== 1) { - // Not little-endian - return null; - } - const offset = elf.readUInt32LE(32); - const size = elf.readUInt16LE(54); - const count = elf.readUInt16LE(56); - for (let i = 0; i < count; i++) { - const headerOffset = offset + (i * size); - const type = elf.readUInt32LE(headerOffset); - if (type === 3) { - const fileOffset = elf.readUInt32LE(headerOffset + 8); - const fileSize = elf.readUInt32LE(headerOffset + 32); - return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, ''); - } - } - return null; -}; - -module.exports = { - interpreterPath -}; diff --git a/frontend/node_modules/detect-libc/lib/filesystem.js b/frontend/node_modules/detect-libc/lib/filesystem.js deleted file mode 100644 index 4c2443c..0000000 --- a/frontend/node_modules/detect-libc/lib/filesystem.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2017 Lovell Fuller and others. -// SPDX-License-Identifier: Apache-2.0 - -'use strict'; - -const fs = require('fs'); - -const LDD_PATH = '/usr/bin/ldd'; -const SELF_PATH = '/proc/self/exe'; -const MAX_LENGTH = 2048; - -/** - * Read the content of a file synchronous - * - * @param {string} path - * @returns {Buffer} - */ -const readFileSync = (path) => { - const fd = fs.openSync(path, 'r'); - const buffer = Buffer.alloc(MAX_LENGTH); - const bytesRead = fs.readSync(fd, buffer, 0, MAX_LENGTH, 0); - fs.close(fd, () => {}); - return buffer.subarray(0, bytesRead); -}; - -/** - * Read the content of a file - * - * @param {string} path - * @returns {Promise} - */ -const readFile = (path) => new Promise((resolve, reject) => { - fs.open(path, 'r', (err, fd) => { - if (err) { - reject(err); - } else { - const buffer = Buffer.alloc(MAX_LENGTH); - fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => { - resolve(buffer.subarray(0, bytesRead)); - fs.close(fd, () => {}); - }); - } - }); -}); - -module.exports = { - LDD_PATH, - SELF_PATH, - readFileSync, - readFile -}; diff --git a/frontend/node_modules/detect-libc/lib/process.js b/frontend/node_modules/detect-libc/lib/process.js deleted file mode 100644 index ee78ad2..0000000 --- a/frontend/node_modules/detect-libc/lib/process.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2017 Lovell Fuller and others. -// SPDX-License-Identifier: Apache-2.0 - -'use strict'; - -const isLinux = () => process.platform === 'linux'; - -let report = null; -const getReport = () => { - if (!report) { - /* istanbul ignore next */ - if (isLinux() && process.report) { - const orig = process.report.excludeNetwork; - process.report.excludeNetwork = true; - report = process.report.getReport(); - process.report.excludeNetwork = orig; - } else { - report = {}; - } - } - return report; -}; - -module.exports = { isLinux, getReport }; diff --git a/frontend/node_modules/detect-libc/package.json b/frontend/node_modules/detect-libc/package.json deleted file mode 100644 index 36d0f2b..0000000 --- a/frontend/node_modules/detect-libc/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "detect-libc", - "version": "2.1.2", - "description": "Node.js module to detect the C standard library (libc) implementation family and version", - "main": "lib/detect-libc.js", - "files": [ - "lib/", - "index.d.ts" - ], - "scripts": { - "test": "semistandard && nyc --reporter=text --check-coverage --branches=100 ava test/unit.js", - "changelog": "conventional-changelog -i CHANGELOG.md -s", - "bench": "node benchmark/detect-libc", - "bench:calls": "node benchmark/call-familySync.js && sleep 1 && node benchmark/call-isNonGlibcLinuxSync.js && sleep 1 && node benchmark/call-versionSync.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/lovell/detect-libc.git" - }, - "keywords": [ - "libc", - "glibc", - "musl" - ], - "author": "Lovell Fuller ", - "contributors": [ - "Niklas Salmoukas ", - "Vinícius Lourenço " - ], - "license": "Apache-2.0", - "devDependencies": { - "ava": "^2.4.0", - "benchmark": "^2.1.4", - "conventional-changelog-cli": "^5.0.0", - "eslint-config-standard": "^13.0.1", - "nyc": "^15.1.0", - "proxyquire": "^2.1.3", - "semistandard": "^14.2.3" - }, - "engines": { - "node": ">=8" - }, - "types": "index.d.ts" -} diff --git a/frontend/node_modules/devalue/LICENSE b/frontend/node_modules/devalue/LICENSE deleted file mode 100644 index c4e49f8..0000000 --- a/frontend/node_modules/devalue/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2018-19 [these people](https://github.com/rich-harris/devalue/graphs/contributors) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/frontend/node_modules/devalue/README.md b/frontend/node_modules/devalue/README.md deleted file mode 100644 index f57380c..0000000 --- a/frontend/node_modules/devalue/README.md +++ /dev/null @@ -1,228 +0,0 @@ -# devalue - -Like `JSON.stringify`, but handles - -- cyclical references (`obj.self = obj`) -- repeated references (`[value, value]`) -- `undefined`, `Infinity`, `NaN`, `-0` -- regular expressions -- dates -- `Map` and `Set` -- `BigInt` -- `ArrayBuffer` and Typed Arrays -- `URL` and `URLSearchParams` -- `Temporal` -- custom types via replacers, reducers and revivers - -Try it out [here](https://svelte.dev/repl/138d70def7a748ce9eda736ef1c71239?version=3.49.0). - -## Goals: - -- Performance -- Security (see [XSS mitigation](#xss-mitigation)) -- Compact output - -## Non-goals: - -- Human-readable output -- Stringifying functions - -## Usage - -There are two ways to use `devalue`: - -### `uneval` - -This function takes a JavaScript value and returns the JavaScript code to create an equivalent value — sort of like `eval` in reverse: - -```js -import * as devalue from 'devalue'; - -let obj = { message: 'hello' }; -devalue.uneval(obj); // '{message:"hello"}' - -obj.self = obj; -devalue.uneval(obj); // '(function(a){a.message="hello";a.self=a;return a}({}))' -``` - -Use `uneval` when you want the most compact possible output and don't want to include any code for parsing the serialized value. - -### `stringify` and `parse` - -These two functions are analogous to `JSON.stringify` and `JSON.parse`: - -```js -import * as devalue from 'devalue'; - -let obj = { message: 'hello' }; - -let stringified = devalue.stringify(obj); // '[{"message":1},"hello"]' -devalue.parse(stringified); // { message: 'hello' } - -obj.self = obj; - -stringified = devalue.stringify(obj); // '[{"message":1,"self":0},"hello"]' -devalue.parse(stringified); // { message: 'hello', self: [Circular] } -``` - -Use `stringify` and `parse` when evaluating JavaScript isn't an option. - -### `unflatten` - -In the case where devalued data is one part of a larger JSON string, `unflatten` allows you to revive just the bit you need: - -```js -import * as devalue from 'devalue'; - -const json = `{ - "type": "data", - "data": ${devalue.stringify(data)} -}`; - -const data = devalue.unflatten(JSON.parse(json).data); -``` - -## Custom types - -You can serialize and deserialize custom types by passing a second argument to `stringify` containing an object of types and their _reducers_, and a second argument to `parse` or `unflatten` containing an object of types and their _revivers_: - -```js -class Vector { - constructor(x, y) { - this.x = x; - this.y = y; - } - - magnitude() { - return Math.sqrt(this.x * this.x + this.y * this.y); - } -} - -const stringified = devalue.stringify(new Vector(30, 40), { - Vector: (value) => value instanceof Vector && [value.x, value.y] -}); - -console.log(stringified); // [["Vector",1],[2,3],30,40] - -const vector = devalue.parse(stringified, { - Vector: ([x, y]) => new Vector(x, y) -}); - -console.log(vector.magnitude()); // 50 -``` - -If a function passed to `stringify` returns a truthy value, it's treated as a match. - -You can also use custom types with `uneval` by specifying a custom replacer: - -```js -devalue.uneval(vector, (value, uneval) => { - if (value instanceof Vector) { - return `new Vector(${value.x},${value.y})`; - } -}); // `new Vector(30,40)` -``` - -Note that any variables referenced in the resulting JavaScript (like `Vector` in the example above) must be in scope when it runs. - -## Error handling - -If `uneval` or `stringify` encounters a function or a non-POJO that isn't handled by a custom replacer/reducer, it will throw an error. You can find where in the input data the offending value lives by inspecting `error.path`: - -```js -try { - const map = new Map(); - map.set('key', function invalid() {}); - - uneval({ - object: { - array: [map] - } - }); -} catch (e) { - console.log(e.path); // '.object.array[0].get("key")' -} -``` - -## XSS mitigation - -Say you're server-rendering a page and want to serialize some state, which could include user input. `JSON.stringify` doesn't protect against XSS attacks: - -```js -const state = { - userinput: ``; -``` - -Which would result in this: - -```html - - -``` - -Using `uneval` or `stringify`, we're protected against that attack: - -```js -const template = ` -`; -``` - -```html - -``` - -This, along with the fact that `uneval` and `stringify` bail on functions and non-POJOs, stops attackers from executing arbitrary code. Strings generated by `uneval` can be safely deserialized with `eval` or `new Function`: - -```js -const value = (0, eval)('(' + str + ')'); -``` - -## Other security considerations - -While `uneval` prevents the XSS vulnerability shown above, meaning you can use it to send data from server to client, **you should not send user data from client to server** using the same method. Since it has to be evaluated, an attacker that successfully submitted data that bypassed `uneval` would have access to your system. - -When using `eval`, ensure that you call it _indirectly_ so that the evaluated code doesn't have access to the surrounding scope: - -```js -{ - const sensitiveData = 'Setec Astronomy'; - eval('sendToEvilServer(sensitiveData)'); // pwned :( - (0, eval)('sendToEvilServer(sensitiveData)'); // nice try, evildoer! -} -``` - -Using `new Function(code)` is akin to using indirect eval. - -## See also - -- [lave](https://github.com/jed/lave) by Jed Schmidt -- [arson](https://github.com/benjamn/arson) by Ben Newman. The `stringify`/`parse` approach in `devalue` was inspired by `arson` -- [oson](https://github.com/KnorpelSenf/oson) by Steffen Trog -- [tosource](https://github.com/marcello3d/node-tosource) by Marcello Bastéa-Forte -- [serialize-javascript](https://github.com/yahoo/serialize-javascript) by Eric Ferraiuolo -- [jsesc](https://github.com/mathiasbynens/jsesc) by Mathias Bynens -- [superjson](https://github.com/blitz-js/superjson) by Blitz -- [next-json](https://github.com/iccicci/next-json) by Daniele Ricci - -## License - -[MIT](LICENSE) diff --git a/frontend/node_modules/devalue/index.js b/frontend/node_modules/devalue/index.js deleted file mode 100644 index 1e8fc6b..0000000 --- a/frontend/node_modules/devalue/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export { uneval } from './src/uneval.js'; -export { parse, unflatten } from './src/parse.js'; -export { stringify } from './src/stringify.js'; -export { DevalueError } from './src/utils.js'; diff --git a/frontend/node_modules/devalue/package.json b/frontend/node_modules/devalue/package.json deleted file mode 100644 index a595622..0000000 --- a/frontend/node_modules/devalue/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "devalue", - "description": "Gets the job done when JSON.stringify can't", - "version": "5.7.1", - "repository": "sveltejs/devalue", - "sideEffects": false, - "exports": { - ".": { - "types": "./types/index.d.ts", - "import": "./index.js", - "default": "./index.js" - } - }, - "files": [ - "index.js", - "src", - "types" - ], - "types": "./types/index.d.ts", - "devDependencies": { - "@changesets/cli": "^2.29.6", - "@js-temporal/polyfill": "^0.5.1", - "@types/node": "^24.12.0", - "dts-buddy": "^0.6.2", - "publint": "^0.3.12", - "typescript": "^5.9.2", - "uvu": "^0.5.6" - }, - "license": "MIT", - "type": "module", - "packageManager": "pnpm@8.15.9", - "scripts": { - "changeset:version": "changeset version", - "changeset:publish": "changeset publish", - "build": "dts-buddy", - "test": "uvu", - "bench": "node --allow-natives-syntax ./benchmarking/run.js", - "bench:compare": "node --allow-natives-syntax ./benchmarking/compare/index.js" - } -} \ No newline at end of file diff --git a/frontend/node_modules/devalue/src/base64.js b/frontend/node_modules/devalue/src/base64.js deleted file mode 100644 index 9562109..0000000 --- a/frontend/node_modules/devalue/src/base64.js +++ /dev/null @@ -1,60 +0,0 @@ -/* Baseline 2025 runtimes */ - -/** @type {(array_buffer: ArrayBuffer) => string} */ -export function encode_native(array_buffer) { - return new Uint8Array(array_buffer).toBase64(); -} - -/** @type {(base64: string) => ArrayBuffer} */ -export function decode_native(base64) { - return Uint8Array.fromBase64(base64).buffer; -} - -/* Node-compatible runtimes */ - -/** @type {(array_buffer: ArrayBuffer) => string} */ -export function encode_buffer(array_buffer) { - return Buffer.from(array_buffer).toString('base64'); -} - -/** @type {(base64: string) => ArrayBuffer} */ -export function decode_buffer(base64) { - return Uint8Array.from(Buffer.from(base64, 'base64')).buffer; -} - -/* Legacy runtimes */ - -/** @type {(array_buffer: ArrayBuffer) => string} */ -export function encode_legacy(array_buffer) { - const array = new Uint8Array(array_buffer); - let binary = ''; - - // the maximum number of arguments to String.fromCharCode.apply - // should be around 0xFFFF in modern engines - const chunk_size = 0x8000; - for (let i = 0; i < array.length; i += chunk_size) { - const chunk = array.subarray(i, i + chunk_size); - binary += String.fromCharCode.apply(null, chunk); - } - - return btoa(binary); -} - -/** @type {(base64: string) => ArrayBuffer} */ -export function decode_legacy(base64) { - const binary_string = atob(base64); - const len = binary_string.length; - const array = new Uint8Array(len); - - for (let i = 0; i < len; i++) { - array[i] = binary_string.charCodeAt(i); - } - - return array.buffer; -} - -const native = typeof Uint8Array.fromBase64 === 'function'; -const buffer = typeof process === 'object' && process.versions?.node !== undefined; - -export const encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy; -export const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy; diff --git a/frontend/node_modules/devalue/src/base64.test.js b/frontend/node_modules/devalue/src/base64.test.js deleted file mode 100644 index 1c3a878..0000000 --- a/frontend/node_modules/devalue/src/base64.test.js +++ /dev/null @@ -1,44 +0,0 @@ -import * as assert from 'uvu/assert'; -import { suite } from 'uvu'; -import * as base64 from './base64.js'; - -const strings = [ - '', - 'a', - 'ab', - 'abc', - 'a\r\nb', - '\xFF\xFE', - '\x00', - '\x00\x00\x00', - 'the quick brown fox etc', - 'é', - '中文', - '+/', - '😎' -]; - -const test = suite('base64_encode_decode'); - -const encoder = new TextEncoder(); -const decoder = new TextDecoder(); - -for (const string of strings) { - test(string, () => { - const data = encoder.encode(string); - - const with_buffer = base64.encode_buffer(data); - const with_legacy = base64.encode_legacy(data); - - assert.equal(with_buffer, with_legacy); - assert.equal(decoder.decode(base64.decode_buffer(with_buffer)), string); - assert.equal(decoder.decode(base64.decode_legacy(with_legacy)), string); - - if (typeof Uint8Array.fromBase64 === 'function') { - const with_native = base64.encode_native(data); - assert.equal(decoder.decode(base64.decode_native(with_native)), string); - } - }); -} - -test.run(); diff --git a/frontend/node_modules/devalue/src/constants.js b/frontend/node_modules/devalue/src/constants.js deleted file mode 100644 index 9d91cb6..0000000 --- a/frontend/node_modules/devalue/src/constants.js +++ /dev/null @@ -1,7 +0,0 @@ -export const UNDEFINED = -1; -export const HOLE = -2; -export const NAN = -3; -export const POSITIVE_INFINITY = -4; -export const NEGATIVE_INFINITY = -5; -export const NEGATIVE_ZERO = -6; -export const SPARSE = -7; diff --git a/frontend/node_modules/devalue/src/parse.js b/frontend/node_modules/devalue/src/parse.js deleted file mode 100644 index 635b183..0000000 --- a/frontend/node_modules/devalue/src/parse.js +++ /dev/null @@ -1,268 +0,0 @@ -import { decode64 } from './base64.js'; -import { - HOLE, - NAN, - NEGATIVE_INFINITY, - NEGATIVE_ZERO, - POSITIVE_INFINITY, - SPARSE, - UNDEFINED -} from './constants.js'; - -/** - * Revive a value serialized with `devalue.stringify` - * @param {string} serialized - * @param {Record any>} [revivers] - */ -export function parse(serialized, revivers) { - return unflatten(JSON.parse(serialized), revivers); -} - -/** - * Revive a value flattened with `devalue.stringify` - * @param {number | any[]} parsed - * @param {Record any>} [revivers] - */ -export function unflatten(parsed, revivers) { - if (typeof parsed === 'number') return hydrate(parsed, true); - - if (!Array.isArray(parsed) || parsed.length === 0) { - throw new Error('Invalid input'); - } - - const values = /** @type {any[]} */ (parsed); - - const hydrated = Array(values.length); - - /** - * A set of values currently being hydrated with custom revivers, - * used to detect invalid cyclical dependencies - * @type {Set | null} - */ - let hydrating = null; - - /** - * @param {number} index - * @returns {any} - */ - function hydrate(index, standalone = false) { - if (index === UNDEFINED) return undefined; - if (index === NAN) return NaN; - if (index === POSITIVE_INFINITY) return Infinity; - if (index === NEGATIVE_INFINITY) return -Infinity; - if (index === NEGATIVE_ZERO) return -0; - - if (standalone || typeof index !== 'number') { - throw new Error(`Invalid input`); - } - - if (index in hydrated) return hydrated[index]; - - const value = values[index]; - - if (!value || typeof value !== 'object') { - hydrated[index] = value; - } else if (Array.isArray(value)) { - if (typeof value[0] === 'string') { - const type = value[0]; - - const reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : undefined; - - if (reviver) { - let i = value[1]; - if (typeof i !== 'number') { - // if it's not a number, it was serialized by a builtin reviver - // so we need to munge it into the format expected by a custom reviver - i = values.push(value[1]) - 1; - } - - hydrating ??= new Set(); - - if (hydrating.has(i)) { - throw new Error('Invalid circular reference'); - } - - hydrating.add(i); - hydrated[index] = reviver(hydrate(i)); - hydrating.delete(i); - - return hydrated[index]; - } - - switch (type) { - case 'Date': - hydrated[index] = new Date(value[1]); - break; - - case 'Set': - const set = new Set(); - hydrated[index] = set; - for (let i = 1; i < value.length; i += 1) { - set.add(hydrate(value[i])); - } - break; - - case 'Map': - const map = new Map(); - hydrated[index] = map; - for (let i = 1; i < value.length; i += 2) { - map.set(hydrate(value[i]), hydrate(value[i + 1])); - } - break; - - case 'RegExp': - hydrated[index] = new RegExp(value[1], value[2]); - break; - - case 'Object': { - const wrapped_index = value[1]; - - if ( - typeof values[wrapped_index] === 'object' && - values[wrapped_index][0] !== 'BigInt' - ) { - // avoid infinite recusion in case of malformed input - throw new Error('Invalid input'); - } - - hydrated[index] = Object(hydrate(wrapped_index)); - break; - } - - case 'BigInt': - hydrated[index] = BigInt(value[1]); - break; - - case 'null': - const obj = Object.create(null); - hydrated[index] = obj; - for (let i = 1; i < value.length; i += 2) { - if (value[i] === '__proto__') { - throw new Error('Cannot parse an object with a `__proto__` property'); - } - - obj[value[i]] = hydrate(value[i + 1]); - } - break; - - case 'Int8Array': - case 'Uint8Array': - case 'Uint8ClampedArray': - case 'Int16Array': - case 'Uint16Array': - case 'Float16Array': - case 'Int32Array': - case 'Uint32Array': - case 'Float32Array': - case 'Float64Array': - case 'BigInt64Array': - case 'BigUint64Array': - case 'DataView': { - if (values[value[1]][0] !== 'ArrayBuffer') { - // without this, if we receive malformed input we could - // end up trying to hydrate in a circle or allocate - // huge amounts of memory when we call `new TypedArrayConstructor(buffer)` - throw new Error('Invalid data'); - } - - const TypedArrayConstructor = globalThis[type]; - const buffer = hydrate(value[1]); - - hydrated[index] = - value[2] !== undefined - ? new TypedArrayConstructor(buffer, value[2], value[3]) - : new TypedArrayConstructor(buffer); - - break; - } - - case 'ArrayBuffer': { - const base64 = value[1]; - if (typeof base64 !== 'string') { - throw new Error('Invalid ArrayBuffer encoding'); - } - const arraybuffer = decode64(base64); - hydrated[index] = arraybuffer; - break; - } - - case 'Temporal.Duration': - case 'Temporal.Instant': - case 'Temporal.PlainDate': - case 'Temporal.PlainTime': - case 'Temporal.PlainDateTime': - case 'Temporal.PlainMonthDay': - case 'Temporal.PlainYearMonth': - case 'Temporal.ZonedDateTime': { - const temporalName = type.slice(9); - // @ts-expect-error TS doesn't know about Temporal yet - hydrated[index] = Temporal[temporalName].from(value[1]); - break; - } - - case 'URL': { - const url = new URL(value[1]); - hydrated[index] = url; - break; - } - - case 'URLSearchParams': { - const url = new URLSearchParams(value[1]); - hydrated[index] = url; - break; - } - - default: - throw new Error(`Unknown type ${type}`); - } - } else if (value[0] === SPARSE) { - // Sparse array encoding: [SPARSE, length, idx, val, idx, val, ...] - const len = value[1]; - - if (!Number.isInteger(len) || len < 0) { - throw new Error('Invalid input'); - } - - const array = new Array(len); - hydrated[index] = array; - - for (let i = 2; i < value.length; i += 2) { - const idx = value[i]; - - if (!Number.isInteger(idx) || idx < 0 || idx >= len) { - throw new Error('Invalid input'); - } - - array[idx] = hydrate(value[i + 1]); - } - } else { - const array = new Array(value.length); - hydrated[index] = array; - - for (let i = 0; i < value.length; i += 1) { - const n = value[i]; - if (n === HOLE) continue; - - array[i] = hydrate(n); - } - } - } else { - /** @type {Record} */ - const object = {}; - hydrated[index] = object; - - for (const key of Object.keys(value)) { - if (key === '__proto__') { - throw new Error('Cannot parse an object with a `__proto__` property'); - } - - const n = value[key]; - object[key] = hydrate(n); - } - } - - return hydrated[index]; - } - - return hydrate(0); -} diff --git a/frontend/node_modules/devalue/src/stringify.js b/frontend/node_modules/devalue/src/stringify.js deleted file mode 100644 index 2019c11..0000000 --- a/frontend/node_modules/devalue/src/stringify.js +++ /dev/null @@ -1,335 +0,0 @@ -import { - DevalueError, - enumerable_symbols, - get_type, - is_plain_object, - is_primitive, - stringify_key, - stringify_string, - valid_array_indices -} from './utils.js'; -import { - HOLE, - NAN, - NEGATIVE_INFINITY, - NEGATIVE_ZERO, - POSITIVE_INFINITY, - SPARSE, - UNDEFINED -} from './constants.js'; -import { encode64 } from './base64.js'; - -/** - * Turn a value into a JSON string that can be parsed with `devalue.parse` - * @param {any} value - * @param {Record any>} [reducers] - */ -export function stringify(value, reducers) { - /** @type {any[]} */ - const stringified = []; - - /** @type {Map} */ - const indexes = new Map(); - - /** @type {Array<{ key: string, fn: (value: any) => any }>} */ - const custom = []; - if (reducers) { - for (const key of Object.getOwnPropertyNames(reducers)) { - custom.push({ key, fn: reducers[key] }); - } - } - - /** @type {string[]} */ - const keys = []; - - let p = 0; - - /** @param {any} thing */ - function flatten(thing) { - if (thing === undefined) return UNDEFINED; - if (Number.isNaN(thing)) return NAN; - if (thing === Infinity) return POSITIVE_INFINITY; - if (thing === -Infinity) return NEGATIVE_INFINITY; - if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO; - - if (indexes.has(thing)) return /** @type {number} */ (indexes.get(thing)); - - const index = p++; - indexes.set(thing, index); - - for (const { key, fn } of custom) { - const value = fn(thing); - if (value) { - stringified[index] = `["${key}",${flatten(value)}]`; - return index; - } - } - - if (typeof thing === 'function') { - throw new DevalueError(`Cannot stringify a function`, keys, thing, value); - } else if (typeof thing === 'symbol') { - throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value); - } - - let str = ''; - - if (is_primitive(thing)) { - str = stringify_primitive(thing); - } else { - const type = get_type(thing); - - switch (type) { - case 'Number': - case 'String': - case 'Boolean': - case 'BigInt': - str = `["Object",${flatten(thing.valueOf())}]`; - break; - - case 'Date': - const valid = !isNaN(thing.getDate()); - str = `["Date","${valid ? thing.toISOString() : ''}"]`; - break; - - case 'URL': - str = `["URL",${stringify_string(thing.toString())}]`; - break; - - case 'URLSearchParams': - str = `["URLSearchParams",${stringify_string(thing.toString())}]`; - break; - - case 'RegExp': - const { source, flags } = thing; - str = flags - ? `["RegExp",${stringify_string(source)},"${flags}"]` - : `["RegExp",${stringify_string(source)}]`; - break; - - case 'Array': { - // For dense arrays (no holes), we iterate normally. - // When we encounter the first hole, we call Object.keys - // to determine the sparseness, then decide between: - // - HOLE encoding: [-2, val, -2, ...] (default) - // - Sparse encoding: [-7, length, idx, val, ...] (for very sparse arrays) - // Only the sparse path avoids iterating every slot, which - // is what protects against the DoS of e.g. `arr[1000000] = 1`. - let mostly_dense = false; - - str = '['; - - for (let i = 0; i < thing.length; i += 1) { - if (i > 0) str += ','; - - if (Object.hasOwn(thing, i)) { - keys.push(`[${i}]`); - str += flatten(thing[i]); - keys.pop(); - } else if (mostly_dense) { - // Use dense encoding. The heuristic guarantees the - // array is only mildly sparse, so iterating over every - // slot is fine. - str += HOLE; - } else { - // Decide between HOLE encoding and sparse encoding. - // - // HOLE encoding: each hole is serialized as the HOLE - // sentinel (-2). For example, [, "a", ,] becomes - // [-2, 0, -2]. Each hole costs 3 chars ("-2" + comma). - // - // Sparse encoding: lists only populated indices. - // For example, [, "a", ,] becomes [-7, 3, 1, 0] — the - // -7 sentinel, the array length (3), then index-value - // pairs. This avoids paying per-hole, but each element - // costs extra chars to write its index. - // - // The values are the same size either way, so the - // choice comes down to structural overhead: - // - // HOLE overhead: - // 3 chars per hole ("-2" + comma) - // = (L - P) * 3 - // - // Sparse overhead: - // "-7," — 3 chars (sparse sentinel + comma) - // + length + "," — (d + 1) chars (array length + comma) - // + per element: index + "," — (d + 1) chars - // = (4 + d) + P * (d + 1) - // - // where L is the array length, P is the number of - // populated elements, and d is the number of digits - // in L (an upper bound on the digits in any index). - // - // Sparse encoding is cheaper when: - // (4 + d) + P * (d + 1) < (L - P) * 3 - const populated_keys = valid_array_indices(/** @type {any[]} */ (thing)); - const population = populated_keys.length; - const d = String(thing.length).length; - - const hole_cost = (thing.length - population) * 3; - const sparse_cost = 4 + d + population * (d + 1); - - if (hole_cost > sparse_cost) { - str = '[' + SPARSE + ',' + thing.length; - for (let j = 0; j < populated_keys.length; j++) { - const key = populated_keys[j]; - keys.push(`[${key}]`); - str += ',' + key + ',' + flatten(thing[key]); - keys.pop(); - } - break; - } else { - mostly_dense = true; - str += HOLE; - } - } - } - - str += ']'; - - break; - } - - case 'Set': - str = '["Set"'; - - for (const value of thing) { - str += `,${flatten(value)}`; - } - - str += ']'; - break; - - case 'Map': - str = '["Map"'; - - for (const [key, value] of thing) { - keys.push(`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`); - str += `,${flatten(key)},${flatten(value)}`; - keys.pop(); - } - - str += ']'; - break; - - case 'Int8Array': - case 'Uint8Array': - case 'Uint8ClampedArray': - case 'Int16Array': - case 'Uint16Array': - case 'Float16Array': - case 'Int32Array': - case 'Uint32Array': - case 'Float32Array': - case 'Float64Array': - case 'BigInt64Array': - case 'BigUint64Array': - case 'DataView': { - /** @type {import("./types.js").TypedArray} */ - const typedArray = thing; - str = '["' + type + '",' + flatten(typedArray.buffer); - - // handle subarrays - if (typedArray.byteLength !== typedArray.buffer.byteLength) { - // to be used with `new TypedArray(buffer, byteOffset, length)` - str += `,${typedArray.byteOffset},${typedArray.length}`; - } - - str += ']'; - break; - } - - case 'ArrayBuffer': { - /** @type {ArrayBuffer} */ - const arraybuffer = thing; - const base64 = encode64(arraybuffer); - - str = `["ArrayBuffer","${base64}"]`; - break; - } - - case 'Temporal.Duration': - case 'Temporal.Instant': - case 'Temporal.PlainDate': - case 'Temporal.PlainTime': - case 'Temporal.PlainDateTime': - case 'Temporal.PlainMonthDay': - case 'Temporal.PlainYearMonth': - case 'Temporal.ZonedDateTime': - str = `["${type}",${stringify_string(thing.toString())}]`; - break; - - default: - if (!is_plain_object(thing)) { - throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value); - } - - if (enumerable_symbols(thing).length > 0) { - throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value); - } - - if (Object.getPrototypeOf(thing) === null) { - str = '["null"'; - for (const key of Object.keys(thing)) { - if (key === '__proto__') { - throw new DevalueError( - `Cannot stringify objects with __proto__ keys`, - keys, - thing, - value - ); - } - - keys.push(stringify_key(key)); - str += `,${stringify_string(key)},${flatten(thing[key])}`; - keys.pop(); - } - str += ']'; - } else { - str = '{'; - let started = false; - for (const key of Object.keys(thing)) { - if (key === '__proto__') { - throw new DevalueError( - `Cannot stringify objects with __proto__ keys`, - keys, - thing, - value - ); - } - - if (started) str += ','; - started = true; - keys.push(stringify_key(key)); - str += `${stringify_string(key)}:${flatten(thing[key])}`; - keys.pop(); - } - str += '}'; - } - } - } - - stringified[index] = str; - return index; - } - - const index = flatten(value); - - // special case — value is represented as a negative index - if (index < 0) return `${index}`; - - return `[${stringified.join(',')}]`; -} - -/** - * @param {any} thing - * @returns {string} - */ -function stringify_primitive(thing) { - const type = typeof thing; - if (type === 'string') return stringify_string(thing); - if (thing === void 0) return UNDEFINED.toString(); - if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString(); - if (type === 'bigint') return `["BigInt","${thing}"]`; - return String(thing); -} diff --git a/frontend/node_modules/devalue/src/types.d.ts b/frontend/node_modules/devalue/src/types.d.ts deleted file mode 100644 index 5f1df84..0000000 --- a/frontend/node_modules/devalue/src/types.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export type TypedArray = - | Int8Array - | Uint8Array - | Uint8ClampedArray - | Int16Array - | Uint16Array - | Float16Array - | Int32Array - | Uint32Array - | Float32Array - | Float64Array - | BigInt64Array - | BigUint64Array; diff --git a/frontend/node_modules/devalue/src/uneval.js b/frontend/node_modules/devalue/src/uneval.js deleted file mode 100644 index 5c1f39e..0000000 --- a/frontend/node_modules/devalue/src/uneval.js +++ /dev/null @@ -1,552 +0,0 @@ -import { - DevalueError, - enumerable_symbols, - escaped, - get_type, - is_plain_object, - is_primitive, - stringify_key, - stringify_string, - valid_array_indices -} from './utils.js'; - -const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$'; -const unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g; -const reserved = - /^(?:do|if|in|for|int|let|new|try|var|byte|case|char|else|enum|goto|long|this|void|with|await|break|catch|class|const|final|float|short|super|throw|while|yield|delete|double|export|import|native|return|switch|throws|typeof|boolean|default|extends|finally|package|private|abstract|continue|debugger|function|volatile|interface|protected|transient|implements|instanceof|synchronized)$/; - -/** - * Turn a value into the JavaScript that creates an equivalent value - * @param {any} value - * @param {(value: any, uneval: (value: any) => string) => string | void} [replacer] - */ -export function uneval(value, replacer) { - const counts = new Map(); - - /** @type {string[]} */ - const keys = []; - - const custom = new Map(); - - /** @param {any} thing */ - function walk(thing) { - if (!is_primitive(thing)) { - if (counts.has(thing)) { - counts.set(thing, counts.get(thing) + 1); - return; - } - - counts.set(thing, 1); - - if (replacer) { - const str = replacer(thing, (value) => uneval(value, replacer)); - - if (typeof str === 'string') { - custom.set(thing, str); - return; - } - } - - if (typeof thing === 'function') { - throw new DevalueError(`Cannot stringify a function`, keys, thing, value); - } - - const type = get_type(thing); - - switch (type) { - case 'Number': - case 'BigInt': - case 'String': - case 'Boolean': - case 'Date': - case 'RegExp': - case 'URL': - case 'URLSearchParams': - return; - - case 'Array': - /** @type {any[]} */ (thing).forEach((value, i) => { - keys.push(`[${i}]`); - walk(value); - keys.pop(); - }); - break; - - case 'Set': - Array.from(thing).forEach(walk); - break; - - case 'Map': - for (const [key, value] of thing) { - keys.push(`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`); - walk(value); - keys.pop(); - } - break; - - case 'Int8Array': - case 'Uint8Array': - case 'Uint8ClampedArray': - case 'Int16Array': - case 'Uint16Array': - case 'Float16Array': - case 'Int32Array': - case 'Uint32Array': - case 'Float32Array': - case 'Float64Array': - case 'BigInt64Array': - case 'BigUint64Array': - case 'DataView': - walk(thing.buffer); - return; - - case 'ArrayBuffer': - return; - - case 'Temporal.Duration': - case 'Temporal.Instant': - case 'Temporal.PlainDate': - case 'Temporal.PlainTime': - case 'Temporal.PlainDateTime': - case 'Temporal.PlainMonthDay': - case 'Temporal.PlainYearMonth': - case 'Temporal.ZonedDateTime': - return; - - default: - if (!is_plain_object(thing)) { - throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value); - } - - if (enumerable_symbols(thing).length > 0) { - throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value); - } - - for (const key of Object.keys(thing)) { - if (key === '__proto__') { - throw new DevalueError( - `Cannot stringify objects with __proto__ keys`, - keys, - thing, - value - ); - } - - keys.push(stringify_key(key)); - walk(thing[key]); - keys.pop(); - } - } - } else if (typeof thing === 'symbol') { - throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value); - } - } - - walk(value); - - const names = new Map(); - - Array.from(counts) - .filter((entry) => entry[1] > 1) - .sort((a, b) => b[1] - a[1]) - .forEach((entry, i) => { - names.set(entry[0], get_name(i)); - }); - - /** - * @param {any} thing - * @returns {string} - */ - function stringify(thing) { - if (names.has(thing)) { - return names.get(thing); - } - - if (is_primitive(thing)) { - return stringify_primitive(thing); - } - - if (custom.has(thing)) { - return custom.get(thing); - } - - const type = get_type(thing); - - switch (type) { - case 'Number': - case 'String': - case 'Boolean': - case 'BigInt': - return `Object(${stringify(thing.valueOf())})`; - - case 'RegExp': - const { source, flags } = thing; - return flags - ? `new RegExp(${stringify_string(source)},"${flags}")` - : `new RegExp(${stringify_string(source)})`; - - case 'Date': - return `new Date(${thing.getTime()})`; - - case 'URL': - return `new URL(${stringify_string(thing.toString())})`; - - case 'URLSearchParams': - return `new URLSearchParams(${stringify_string(thing.toString())})`; - - case 'Array': { - // For dense arrays (no holes), we iterate normally. - // When we encounter the first hole, we call Object.keys - // to determine the sparseness, then decide between: - // - Array literal with holes: [,"a",,] (default) - // - Object.assign: Object.assign(Array(n),{...}) (for very sparse arrays) - // Only the Object.assign path avoids iterating every slot, which - // is what protects against the DoS of e.g. `arr[1000000] = 1`. - let has_holes = false; - - let result = '['; - - for (let i = 0; i < thing.length; i += 1) { - if (i > 0) result += ','; - - if (Object.hasOwn(thing, i)) { - result += stringify(thing[i]); - } else if (!has_holes) { - // Decide between array literal and Object.assign. - // - // Array literal: holes are consecutive commas. - // For example, [, "a", ,] is written as [,"a",,]. - // Each hole costs 1 char (a comma). - // - // Object.assign: populated indices are listed explicitly. - // For example, [, "a", ,] would be written as - // Object.assign(Array(3),{1:"a"}). This avoids paying - // per-hole, but has a large fixed overhead for the - // "Object.assign(Array(n),{...})" wrapper, and each - // element costs extra chars for its index and colon. - // - // The serialized values are the same size either way, so - // the choice comes down to the structural overhead: - // - // Array literal overhead: - // 1 char per element or hole (comma separators) - // + 2 chars for "[" and "]" - // = L + 2 - // - // Object.assign overhead: - // "Object.assign(Array(" — 20 chars - // + length — d chars - // + "),{" — 3 chars - // + for each populated element: - // index + ":" + "," — (d + 2) chars - // + "})" — 2 chars - // = (25 + d) + P * (d + 2) - // - // where L is the array length, P is the number of - // populated elements, and d is the number of digits - // in L (an upper bound on the digits in any index). - // - // Object.assign is cheaper when: - // (25 + d) + P * (d + 2) < L + 2 - const populated_keys = valid_array_indices(/** @type {any[]} */ (thing)); - const population = populated_keys.length; - const d = String(thing.length).length; - - const hole_cost = thing.length + 2; - const sparse_cost = 25 + d + population * (d + 2); - - if (hole_cost > sparse_cost) { - const entries = populated_keys.map((k) => `${k}:${stringify(thing[k])}`).join(','); - return `Object.assign(Array(${thing.length}),{${entries}})`; - } - - // Re-process this index as a hole in the array literal - has_holes = true; - i -= 1; - } - // else: already decided on array literal, hole is just an empty slot - // (the comma separator is all we need — no content for this position) - } - - const tail = thing.length === 0 || thing.length - 1 in thing ? '' : ','; - return result + tail + ']'; - } - - case 'Set': - case 'Map': - return `new ${type}([${Array.from(thing).map(stringify).join(',')}])`; - - case 'Int8Array': - case 'Uint8Array': - case 'Uint8ClampedArray': - case 'Int16Array': - case 'Uint16Array': - case 'Float16Array': - case 'Int32Array': - case 'Uint32Array': - case 'Float32Array': - case 'Float64Array': - case 'BigInt64Array': - case 'BigUint64Array': { - let str = `new ${type}`; - - if (!names.has(thing.buffer)) { - const array = new thing.constructor(thing.buffer); - str += `([${array}])`; - } else { - str += `(${stringify(thing.buffer)})`; - } - - // handle subarrays - if (thing.byteLength !== thing.buffer.byteLength) { - const start = thing.byteOffset / thing.BYTES_PER_ELEMENT; - const end = start + thing.length; - str += `.subarray(${start},${end})`; - } - - return str; - } - - case 'DataView': { - let str = `new DataView`; - - if (!names.has(thing.buffer)) { - str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`; - } else { - str += `(${stringify(thing.buffer)}`; - } - - // handle subviews - if (thing.byteLength !== thing.buffer.byteLength) { - str += `,${thing.startOffset},${thing.byteLength}`; - } - - return str + ')'; - } - - case 'ArrayBuffer': { - const ui8 = new Uint8Array(thing); - return `new Uint8Array([${ui8.toString()}]).buffer`; - } - - case 'Temporal.Duration': - case 'Temporal.Instant': - case 'Temporal.PlainDate': - case 'Temporal.PlainTime': - case 'Temporal.PlainDateTime': - case 'Temporal.PlainMonthDay': - case 'Temporal.PlainYearMonth': - case 'Temporal.ZonedDateTime': - return `${type}.from(${stringify_string(thing.toString())})`; - - default: - const keys = Object.keys(thing); - const obj = keys.map((key) => `${safe_key(key)}:${stringify(thing[key])}`).join(','); - const proto = Object.getPrototypeOf(thing); - if (proto === null) { - return keys.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`; - } - - return `{${obj}}`; - } - } - - const str = stringify(value); - - if (names.size) { - /** @type {string[]} */ - const params = []; - - /** @type {string[]} */ - const statements = []; - - /** @type {string[]} */ - const values = []; - - names.forEach((name, thing) => { - params.push(name); - - if (custom.has(thing)) { - values.push(/** @type {string} */ (custom.get(thing))); - return; - } - - if (is_primitive(thing)) { - values.push(stringify_primitive(thing)); - return; - } - - const type = get_type(thing); - - switch (type) { - case 'Number': - case 'String': - case 'Boolean': - case 'BigInt': - values.push(`Object(${stringify(thing.valueOf())})`); - break; - - case 'RegExp': - const { source, flags } = thing; - const regexp = flags - ? `new RegExp(${stringify_string(source)},"${flags}")` - : `new RegExp(${stringify_string(source)})` - values.push(regexp); - break; - - case 'Date': - values.push(`new Date(${thing.getTime()})`); - break; - - case 'URL': - values.push(`new URL(${stringify_string(thing.toString())})`); - break; - - case 'URLSearchParams': - values.push(`new URLSearchParams(${stringify_string(thing.toString())})`); - break; - - case 'Array': - values.push(`Array(${thing.length})`); - /** @type {any[]} */ (thing).forEach((v, i) => { - statements.push(`${name}[${i}]=${stringify(v)}`); - }); - break; - - case 'Set': - values.push(`new Set`); - statements.push( - `${name}.${Array.from(thing) - .map((v) => `add(${stringify(v)})`) - .join('.')}` - ); - break; - - case 'Map': - values.push(`new Map`); - statements.push( - `${name}.${Array.from(thing) - .map(([k, v]) => `set(${stringify(k)}, ${stringify(v)})`) - .join('.')}` - ); - break; - - case 'Int8Array': - case 'Uint8Array': - case 'Uint8ClampedArray': - case 'Int16Array': - case 'Uint16Array': - case 'Float16Array': - case 'Int32Array': - case 'Uint32Array': - case 'Float32Array': - case 'Float64Array': - case 'BigInt64Array': - case 'BigUint64Array': { - let str = `new ${type}`; - - if (!names.has(thing.buffer)) { - const array = new thing.constructor(thing.buffer); - str += `([${array}])`; - } else { - str += `(${stringify(thing.buffer)})`; - } - - // handle subarrays - if (thing.byteLength !== thing.buffer.byteLength) { - const start = thing.byteOffset / thing.BYTES_PER_ELEMENT; - const end = start + thing.length; - str += `.subarray(${start},${end})`; - } - - values.push(`{}`); - statements.push(`${name}=${str}`); - break; - } - - case 'DataView': { - let str = `new DataView`; - - if (!names.has(thing.buffer)) { - str += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`; - } else { - str += `(${stringify(thing.buffer)}`; - } - - // handle subviews - if (thing.byteLength !== thing.buffer.byteLength) { - str += `,${thing.byteOffset},${thing.byteLength}`; - } - - str += ')'; - - values.push(`{}`); - statements.push(`${name}=${str}`); - break; - } - - case 'ArrayBuffer': - values.push(`new Uint8Array([${new Uint8Array(thing)}]).buffer`); - break; - - default: - values.push(Object.getPrototypeOf(thing) === null ? 'Object.create(null)' : '{}'); - Object.keys(thing).forEach((key) => { - statements.push(`${name}${safe_prop(key)}=${stringify(thing[key])}`); - }); - } - }); - - statements.push(`return ${str}`); - - return `(function(${params.join(',')}){${statements.join(';')}}(${values.join(',')}))`; - } else { - return str; - } -} - -/** @param {number} num */ -function get_name(num) { - let name = ''; - - do { - name = chars[num % chars.length] + name; - num = ~~(num / chars.length) - 1; - } while (num >= 0); - - return reserved.test(name) ? `${name}0` : name; -} - -/** @param {string} c */ -function escape_unsafe_char(c) { - return escaped[c] || c; -} - -/** @param {string} str */ -function escape_unsafe_chars(str) { - return str.replace(unsafe_chars, escape_unsafe_char); -} - -/** @param {string} key */ -function safe_key(key) { - return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? key : escape_unsafe_chars(JSON.stringify(key)); -} - -/** @param {string} key */ -function safe_prop(key) { - return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) - ? `.${key}` - : `[${escape_unsafe_chars(JSON.stringify(key))}]`; -} - -/** @param {any} thing */ -function stringify_primitive(thing) { - const type = typeof thing; - if (type === 'string') return stringify_string(thing); - if (thing === void 0) return 'void 0'; - if (thing === 0 && 1 / thing < 0) return '-0'; - const str = String(thing); - if (type === 'number') return str.replace(/^(-)?0\./, '$1.'); - if (type === 'bigint') return thing + 'n'; - return str; -} diff --git a/frontend/node_modules/devalue/src/utils.js b/frontend/node_modules/devalue/src/utils.js deleted file mode 100644 index 42bc545..0000000 --- a/frontend/node_modules/devalue/src/utils.js +++ /dev/null @@ -1,144 +0,0 @@ -/** @type {Record} */ -export const escaped = { - '<': '\\u003C', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\u2028': '\\u2028', - '\u2029': '\\u2029' -}; - -export class DevalueError extends Error { - /** - * @param {string} message - * @param {string[]} keys - * @param {any} [value] - The value that failed to be serialized - * @param {any} [root] - The root value being serialized - */ - constructor(message, keys, value, root) { - super(message); - this.name = 'DevalueError'; - this.path = keys.join(''); - this.value = value; - this.root = root; - } -} - -/** @param {any} thing */ -export function is_primitive(thing) { - return thing === null || (typeof thing !== 'object' && typeof thing !== 'function'); -} - -const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype) - .sort() - .join('\0'); - -/** @param {any} thing */ -export function is_plain_object(thing) { - const proto = Object.getPrototypeOf(thing); - - return ( - proto === Object.prototype || - proto === null || - Object.getPrototypeOf(proto) === null || - Object.getOwnPropertyNames(proto).sort().join('\0') === object_proto_names - ); -} - -/** @param {any} thing */ -export function get_type(thing) { - return Object.prototype.toString.call(thing).slice(8, -1); -} - -/** @param {string} char */ -function get_escaped_char(char) { - switch (char) { - case '"': - return '\\"'; - case '<': - return '\\u003C'; - case '\\': - return '\\\\'; - case '\n': - return '\\n'; - case '\r': - return '\\r'; - case '\t': - return '\\t'; - case '\b': - return '\\b'; - case '\f': - return '\\f'; - case '\u2028': - return '\\u2028'; - case '\u2029': - return '\\u2029'; - default: - return char < ' ' ? `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}` : ''; - } -} - -/** @param {string} str */ -export function stringify_string(str) { - let result = ''; - let last_pos = 0; - const len = str.length; - - for (let i = 0; i < len; i += 1) { - const char = str[i]; - const replacement = get_escaped_char(char); - if (replacement) { - result += str.slice(last_pos, i) + replacement; - last_pos = i + 1; - } - } - - return `"${last_pos === 0 ? str : result + str.slice(last_pos)}"`; -} - -/** @param {Record} object */ -export function enumerable_symbols(object) { - return Object.getOwnPropertySymbols(object).filter( - (symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable - ); -} - -const is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/; - -/** @param {string} key */ -export function stringify_key(key) { - return is_identifier.test(key) ? '.' + key : '[' + JSON.stringify(key) + ']'; -} - -/** @param {string} s */ -function is_valid_array_index(s) { - if (s.length === 0) return false; - if (s.length > 1 && s.charCodeAt(0) === 48) return false; // leading zero - for (let i = 0; i < s.length; i++) { - const c = s.charCodeAt(i); - if (c < 48 || c > 57) return false; - } - // by this point we know it's a string of digits, but it has to be within the range of valid array indices - const n = +s; - if (n >= 2 ** 32 - 1) return false; - if (n < 0) return false; - return true; -} - -/** - * Finds the populated indices of an array. - * @param {unknown[]} array - */ -export function valid_array_indices(array) { - const keys = Object.keys(array); - for (var i = keys.length - 1; i >= 0; i--) { - if (is_valid_array_index(keys[i])) { - break; - } - } - keys.length = i + 1; - return keys; -} diff --git a/frontend/node_modules/devalue/src/utils.test.js b/frontend/node_modules/devalue/src/utils.test.js deleted file mode 100644 index 7173e30..0000000 --- a/frontend/node_modules/devalue/src/utils.test.js +++ /dev/null @@ -1,63 +0,0 @@ -import * as assert from 'uvu/assert'; -import { suite } from 'uvu'; -import { valid_array_indices } from './utils.js'; - -const test = suite('valid_array_indices'); - -test('returns all indices for a normal dense array', () => { - const arr = ['a', 'b', 'c']; - assert.equal(valid_array_indices(arr), ['0', '1', '2']); -}); - -test('returns empty array for an empty array', () => { - assert.equal(valid_array_indices([]), []); -}); - -test('returns populated indices for a sparse array', () => { - const arr = [, 'b', ,]; - assert.equal(valid_array_indices(arr), ['1']); -}); - -test('strips non-numeric properties from a dense array', () => { - const arr = ['a', 'b']; - arr.foo = 'x'; - arr.bar = 42; - assert.equal(valid_array_indices(arr), ['0', '1']); -}); - -test('strips non-numeric properties from a very sparse array', () => { - const arr = []; - arr[1_000_000] = 'x'; - arr.foo = 'should be ignored'; - assert.equal(valid_array_indices(arr), ['1000000']); -}); - -test('returns empty array when only non-numeric properties exist', () => { - const arr = []; - arr.foo = 'x'; - arr.bar = 42; - assert.equal(valid_array_indices(arr), []); -}); - -test('handles multiple non-numeric properties after indices', () => { - const arr = [1, 2, 3]; - arr.a = 'x'; - arr.b = 'y'; - arr.c = 'z'; - assert.equal(valid_array_indices(arr), ['0', '1', '2']); -}); - -test('handles a single-element array with non-numeric property', () => { - const arr = ['only']; - arr.extra = true; - assert.equal(valid_array_indices(arr), ['0']); -}); - -test('handles array properties pretending to be indices', () => { - const arr = ['a', 'b']; - arr[-1] = 'negative index'; - arr[2 ** 32 - 1] = 'too large index'; - assert.equal(valid_array_indices(arr), ['0', '1']); -}); - -test.run(); diff --git a/frontend/node_modules/devalue/types/index.d.ts b/frontend/node_modules/devalue/types/index.d.ts deleted file mode 100644 index 261952e..0000000 --- a/frontend/node_modules/devalue/types/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -declare module 'devalue' { - /** - * Turn a value into the JavaScript that creates an equivalent value - * - */ - export function uneval(value: any, replacer?: (value: any, uneval: (value: any) => string) => string | void): string; - /** - * Turn a value into a JSON string that can be parsed with `devalue.parse` - * - */ - export function stringify(value: any, reducers?: Record any>): string; - export class DevalueError extends Error { - /** - * @param value - The value that failed to be serialized - * @param root - The root value being serialized - */ - constructor(message: string, keys: string[], value?: any, root?: any); - path: string; - value: any; - root: any; - } - /** - * Revive a value serialized with `devalue.stringify` - * - */ - export function parse(serialized: string, revivers?: Record any>): any; - /** - * Revive a value flattened with `devalue.stringify` - * - */ - export function unflatten(parsed: number | any[], revivers?: Record any>): any; - - export {}; -} - -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/devalue/types/index.d.ts.map b/frontend/node_modules/devalue/types/index.d.ts.map deleted file mode 100644 index 231a90c..0000000 --- a/frontend/node_modules/devalue/types/index.d.ts.map +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": 3, - "file": "index.d.ts", - "names": [ - "uneval", - "stringify", - "DevalueError", - "parse", - "unflatten" - ], - "sources": [ - "../src/uneval.js", - "../src/stringify.js", - "../src/utils.js", - "../src/parse.js" - ], - "sourcesContent": [ - null, - null, - null, - null - ], - "mappings": ";;;;;iBAsBgBA,MAAMA;;;;;iBCINC,SAASA;cCbZC,YAAYA;;;;;;;;;;;;;;iBCGTC,KAAKA;;;;;iBASLC,SAASA", - "ignoreList": [] -} \ No newline at end of file diff --git a/frontend/node_modules/esm-env/CHANGELOG.md b/frontend/node_modules/esm-env/CHANGELOG.md deleted file mode 100644 index 9f387e3..0000000 --- a/frontend/node_modules/esm-env/CHANGELOG.md +++ /dev/null @@ -1,19 +0,0 @@ -# esm-env - -## 1.2.2 - -### Patch Changes - -- fix: remove warning when env cannot be determined ([#15](https://github.com/benmccann/esm-env/pull/15)) - -## 1.2.1 - -### Patch Changes - -- fix: address error in non-Vite bundlers when no conditions set ([#13](https://github.com/benmccann/esm-env/pull/13)) - -## 1.2.0 - -### Minor Changes - -- feat: Vite 6 backwards compatibility with Vite 5 to continue to allow Vite to be run without specifying `--conditions=development` during development ([#8](https://github.com/benmccann/esm-env/pull/8)) diff --git a/frontend/node_modules/esm-env/LICENSE b/frontend/node_modules/esm-env/LICENSE deleted file mode 100644 index 124fd2c..0000000 --- a/frontend/node_modules/esm-env/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2022 Benjamin McCann - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/frontend/node_modules/esm-env/README.md b/frontend/node_modules/esm-env/README.md deleted file mode 100644 index 225fb12..0000000 --- a/frontend/node_modules/esm-env/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# esm-env - -Uses export conditions to return environment information in a way that works with major bundlers and runtimes. - -## Usage - -Install with `npm install esm-env`, then import as needed: - -```js -import { BROWSER, DEV, NODE } from 'esm-env'; -``` - -Specify `conditions` in your bundler or runtime. For example: -- [Node.js](https://nodejs.org/api/cli.html#-c-condition---conditionscondition) -- [Bun](https://bun.sh/docs/runtime/modules#custom-conditions) -- [Vite/Vitest](https://vite.dev/config/shared-options#resolve-conditions) -- [webpack](https://webpack.js.org/configuration/resolve/#resolveconditionnames) - -If `esm-env` is used in both bundled code and an externalized library, you will need to specify conditions both at build-time and run-time. - -## Acknowledgements - -Thank you to [dominikg](https://github.com/dominikg) for refining the approach used by this library to suggest a more scalable method for adding additional conditions. - -## License - -[MIT](LICENSE) diff --git a/frontend/node_modules/esm-env/browser-fallback.js b/frontend/node_modules/esm-env/browser-fallback.js deleted file mode 100644 index fd81416..0000000 --- a/frontend/node_modules/esm-env/browser-fallback.js +++ /dev/null @@ -1 +0,0 @@ -export default typeof window !== 'undefined'; diff --git a/frontend/node_modules/esm-env/dev-fallback.js b/frontend/node_modules/esm-env/dev-fallback.js deleted file mode 100644 index bc8522e..0000000 --- a/frontend/node_modules/esm-env/dev-fallback.js +++ /dev/null @@ -1,2 +0,0 @@ -const node_env = globalThis.process?.env?.NODE_ENV; -export default node_env && !node_env.toLowerCase().startsWith('prod'); diff --git a/frontend/node_modules/esm-env/false.js b/frontend/node_modules/esm-env/false.js deleted file mode 100644 index 3313654..0000000 --- a/frontend/node_modules/esm-env/false.js +++ /dev/null @@ -1 +0,0 @@ -export default false; diff --git a/frontend/node_modules/esm-env/index.d.ts b/frontend/node_modules/esm-env/index.d.ts deleted file mode 100644 index ece8ce4..0000000 --- a/frontend/node_modules/esm-env/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const BROWSER: boolean; -export const DEV: boolean; -export const NODE: boolean; diff --git a/frontend/node_modules/esm-env/index.js b/frontend/node_modules/esm-env/index.js deleted file mode 100644 index 4b089fe..0000000 --- a/frontend/node_modules/esm-env/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { default as BROWSER } from 'esm-env/browser'; -export { default as DEV } from 'esm-env/development'; -export { default as NODE } from 'esm-env/node'; diff --git a/frontend/node_modules/esm-env/package.json b/frontend/node_modules/esm-env/package.json deleted file mode 100644 index f92f397..0000000 --- a/frontend/node_modules/esm-env/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "esm-env", - "version": "1.2.2", - "repository": { - "type": "git", - "url": "https://github.com/benmccann/esm-env.git" - }, - "license": "MIT", - "homepage": "https://github.com/benmccann/esm-env", - "author": "Ben McCann (https://www.benmccann.com)", - "type": "module", - "exports": { - ".": { - "types": "./index.d.ts", - "default": "./index.js" - }, - "./browser": { - "browser": "./true.js", - "development": "./false.js", - "production": "./false.js", - "default": "./browser-fallback.js" - }, - "./development": { - "development": "./true.js", - "production": "./false.js", - "default": "./dev-fallback.js" - }, - "./node": { - "node": "./true.js", - "default": "./false.js" - } - } -} \ No newline at end of file diff --git a/frontend/node_modules/esm-env/true.js b/frontend/node_modules/esm-env/true.js deleted file mode 100644 index ff3177b..0000000 --- a/frontend/node_modules/esm-env/true.js +++ /dev/null @@ -1 +0,0 @@ -export default true; diff --git a/frontend/node_modules/esrap/LICENSE b/frontend/node_modules/esrap/LICENSE deleted file mode 100644 index 97222a7..0000000 --- a/frontend/node_modules/esrap/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2023-2025 [these people](https://github.com/sveltejs/esrap/graphs/contributors) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/frontend/node_modules/esrap/README.md b/frontend/node_modules/esrap/README.md deleted file mode 100644 index 0fa7c29..0000000 --- a/frontend/node_modules/esrap/README.md +++ /dev/null @@ -1,161 +0,0 @@ -# esrap - -Parse in reverse. AST goes in, code comes out. - -## Usage - -```js -import { print } from 'esrap'; -import ts from 'esrap/languages/ts'; - -const ast = { - type: 'Program', - body: [ - { - type: 'ExpressionStatement', - expression: { - callee: { - type: 'Identifier', - name: 'alert' - }, - arguments: [ - { - type: 'Literal', - value: 'hello world!' - } - ] - } - } - ] -}; - -const { code, map } = print(ast, ts()); - -console.log(code); // alert('hello world!'); -``` - -If the nodes of the input AST have `loc` properties (e.g. the AST was generated with [`acorn`](https://github.com/acornjs/acorn/tree/master/acorn/#interface) with the `locations` option set), sourcemap mappings will be created. - -## Built-in languages - -`esrap` ships with two built-in languages — `ts()` and `tsx()` (considered experimental at present!) — which can print ASTs conforming to [`@typescript-eslint/types`](https://www.npmjs.com/package/@typescript-eslint/types) (which extends [ESTree](https://github.com/estree/estree)): - -```js -import ts from 'esrap/languages/ts'; -import tsx from 'esrap/languages/tsx'; // experimental! -``` - -Both languages accept an options object: - -```js -const { code, map } = print( - ast, - ts({ - // how string literals should be quoted — `single` (the default) or `double` - quotes: 'single', - - // an array of `{ type: 'Line' | 'Block', value: string, loc: { start, end } }` objects - comments: [], - - // a pair of functions for inserting additional comments before or after a given node. - // returns `Array<{ type: 'Line' | 'Block', value: string }>` or `undefined` - getLeadingComments: (node) => [{ type: 'Line', value: ' a comment before the node' }], - getTrailingComments: (node) => [{ type: 'Block', value: ' a comment after the node' }] - }) -); -``` - -You can generate the `comments` array by, for example, using [Acorn's](https://github.com/acornjs/acorn/tree/master/acorn/#interface) `onComment` option. - -## Custom languages - -You can also create your own languages: - -```ts -import { print, type Visitors } from 'esrap'; - -const language: Visitors = { - _(node, context, visit) { - // the `_` visitor handles any node type - context.write('['); - visit(node); - context.write(']'); - }, - List(node, context) { - // node.type === 'List' - for (const child of node.children) { - context.visit(child); - } - }, - Foo(node, context) { - // node.type === 'Foo' - context.write('foo'); - }, - Bar(node, context) { - // node.type === 'Bar' - context.write('bar'); - } -}; - -const ast: MyNodeType = { - type: 'List', - children: [{ type: 'Foo' }, { type: 'Bar' }] -}; - -const { code, map } = print(ast, language); - -code; // `[[foo][bar]]` -``` - -The `context` API has several methods: - -- `context.write(data: string, node?: BaseNode)` — add a string. If `node` is provided and has a standard `loc` property (with `start` and `end` properties each with a `line` and `column`), a sourcemap mapping will be created -- `context.indent()` — increase the indentation level, typically before adding a newline -- `context.newline()` — self-explanatory -- `context.space()` — adds a space character, if it doesn't immediately follow a newline -- `context.margin()` — causes the next newline to be repeated (consecutive newlines are otherwise merged into one) -- `context.dedent()` — decrease the indentation level (again, typically before adding a newline) -- `context.visit(node: BaseNode)` — calls the visitor corresponding to `node.type` -- `context.location(line: number, column: number)` — insert a sourcemap mapping _without_ calling `context.write(...)` -- `context.measure()` — returns the number of characters contained in `context` -- `context.empty()` — returns true if the context has no content -- `context.new()` — creates a child context -- `context.append(child)` — appends a child context - -In addition, `context.multiline` is `true` if the context has multiline content. (This is useful for knowing, for example, when to insert newlines between nodes.) - -To understand how to wield these methods effectively, read the source code for the built-in languages. - -## Options - -You can pass the following options: - -```js -const { code, map } = print(ast, ts(), { - // Populate the `sources` field of the resulting sourcemap - // (note that the AST is assumed to come from a single file) - sourceMapSource: 'input.js', - - // Populate the `sourcesContent` field of the resulting sourcemap - sourceMapContent: fs.readFileSync('input.js', 'utf-8'), - - // Whether to encode the `mappings` field of the resulting sourcemap - // as a VLQ string, rather than an unencoded array. Defaults to `true` - sourceMapEncodeMappings: false, - - // String to use for indentation — defaults to '\t' - indent: ' ' -}); -``` - -## Why not just use Prettier? - -Because it's ginormous. - -## Developing - -This repo uses [pnpm](https://pnpm.io). Once it's installed, do `pnpm install` to install dependencies, and `pnpm test` to run the tests. - -## License - -[MIT](LICENSE) diff --git a/frontend/node_modules/esrap/package.json b/frontend/node_modules/esrap/package.json deleted file mode 100644 index dd73eb7..0000000 --- a/frontend/node_modules/esrap/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "esrap", - "version": "2.2.5", - "description": "Parse in reverse", - "repository": { - "type": "git", - "url": "git+https://github.com/sveltejs/esrap.git" - }, - "type": "module", - "files": [ - "src", - "types" - ], - "exports": { - ".": { - "types": "./types/index.d.ts", - "default": "./src/index.js" - }, - "./languages/ts": { - "types": "./types/index.d.ts", - "default": "./src/languages/ts/index.js" - }, - "./languages/tsx": { - "types": "./types/index.d.ts", - "default": "./src/languages/tsx/index.js" - } - }, - "types": "./types/index.d.ts", - "devDependencies": { - "@changesets/cli": "^2.27.11", - "@sveltejs/acorn-typescript": "^1.0.5", - "@types/estree": "^1.0.8", - "@typescript-eslint/types": "^8.2.0", - "@vitest/ui": "^2.1.1", - "acorn": "^8.15.0", - "dts-buddy": "^0.6.2", - "oxc-parser": "^0.95.0", - "prettier": "^3.0.3", - "typescript": "^5.7.2", - "vitest": "^2.1.1", - "zimmerframe": "^1.0.0" - }, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "peerDependencies": { - "@typescript-eslint/types": "^8.2.0" - }, - "peerDependenciesMeta": { - "@typescript-eslint/types": { - "optional": true - } - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "changeset:version": "changeset version", - "changeset:publish": "changeset publish", - "gen": "dts-buddy -m esrap:./src/public.d.ts -m esrap/languages/ts:./src/languages/ts/public.d.ts -m esrap/languages/tsx:./src/languages/tsx/public.d.ts", - "check": "pnpm gen && tsc", - "sandbox": "node test/sandbox/index.js", - "test": "vitest --run", - "test:ui": "vitest --ui", - "format": "pnpm lint --write", - "lint": "prettier --check . --ignore-path .gitignore --ignore-path .prettierignore" - } -} \ No newline at end of file diff --git a/frontend/node_modules/esrap/src/context.js b/frontend/node_modules/esrap/src/context.js deleted file mode 100644 index 3f59d20..0000000 --- a/frontend/node_modules/esrap/src/context.js +++ /dev/null @@ -1,163 +0,0 @@ -/** @import { BaseNode, Command, Visitors } from './types' */ - -export const margin = 0; -export const newline = 1; -export const indent = 2; -export const dedent = 3; -export const space = 4; - -export class Context { - #visitors; - #commands; - #has_newline = false; - - multiline = false; - - /** - * - * @param {Visitors} visitors - * @param {Command[]} commands - */ - constructor(visitors, commands = []) { - this.#visitors = visitors; - this.#commands = commands; - } - - indent() { - this.#commands.push(indent); - } - - dedent() { - this.#commands.push(dedent); - } - - margin() { - this.#commands.push(margin); - } - - newline() { - this.#has_newline = true; - this.#commands.push(newline); - } - - space() { - this.#commands.push(space); - } - - /** - * @param {Context} context - */ - append(context) { - this.#commands.push(context.#commands); - - if (this.#has_newline || context.multiline) { - this.multiline = true; - } - } - - /** - * - * @param {string} content - * @param {BaseNode} [node] - */ - write(content, node) { - if (node?.loc) { - this.location(node.loc.start.line, node.loc.start.column); - this.#commands.push(content); - this.location(node.loc.end.line, node.loc.end.column); - } else { - this.#commands.push(content); - } - - if (this.#has_newline) { - this.multiline = true; - } - } - - /** - * - * @param {number} line - * @param {number} column - */ - location(line, column) { - this.#commands.push({ type: 'Location', line, column }); - } - - /** - * @param {{ type: string }} node - */ - visit(node) { - const visitor = this.#visitors[node.type]; - - if (!visitor) { - let message = `Not implemented: ${node.type}`; - - if (node.type.includes('TS')) { - message += ` (consider using 'esrap/languages/ts')`; - } - - if (node.type.includes('JSX')) { - message += ` (consider using 'esrap/languages/tsx')`; - } - - throw new Error(message); - } - - if (this.#visitors._) { - // @ts-ignore - this.#visitors._(node, this, (node) => visitor(node, this)); - } else { - // @ts-ignore - visitor(node, this); - } - } - - empty() { - return !this.#commands.some(has_content); - } - - measure() { - return measure(this.#commands); - } - - new() { - return new Context(this.#visitors); - } -} - -/** - * - * @param {Command[]} commands - * @param {number} [from] - * @param {number} [to] - */ -function measure(commands, from = 0, to = commands.length) { - let total = 0; - - for (let i = from; i < to; i += 1) { - const command = commands[i]; - - if (typeof command === 'string') { - total += command.length; - } else if (Array.isArray(command)) { - total += measure(command); - } - } - - return total; -} - -/** - * @param {Command} command - */ -function has_content(command) { - if (Array.isArray(command)) { - return command.some(has_content); - } - - if (typeof command === 'string') { - return command.length > 0; - } - - return false; -} diff --git a/frontend/node_modules/esrap/src/index.js b/frontend/node_modules/esrap/src/index.js deleted file mode 100644 index 03723d0..0000000 --- a/frontend/node_modules/esrap/src/index.js +++ /dev/null @@ -1,165 +0,0 @@ -/** @import { BaseNode, Command, Visitors, PrintOptions } from './types' */ -import { encode } from '@jridgewell/sourcemap-codec'; -import { Context, dedent, indent, margin, newline, space } from './context.js'; - -/** @type {(str: string) => string} str */ -let btoa = () => { - throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); -}; - -if (typeof window !== 'undefined' && typeof window.btoa === 'function') { - btoa = (str) => window.btoa(unescape(encodeURIComponent(str))); -} else if (typeof Buffer === 'function') { - btoa = (str) => Buffer.from(str, 'utf-8').toString('base64'); -} - -class SourceMap { - version = 3; - - /** @type {string[]} */ - names = []; - - /** - * @param {[number, number, number, number][][]} mappings - * @param {PrintOptions} opts - */ - constructor(mappings, opts) { - this.sources = [opts.sourceMapSource || null]; - this.sourcesContent = [opts.sourceMapContent || null]; - this.mappings = opts.sourceMapEncodeMappings === false ? mappings : encode(mappings); - } - - /** - * Returns a JSON representation suitable for saving as a `*.map` file - */ - toString() { - return JSON.stringify(this); - } - - /** - * Returns a base64-encoded JSON representation suitable for inlining at the bottom of a file with `//# sourceMappingURL={...}` - */ - toUrl() { - return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); - } -} - -/** - * @template {BaseNode} [T=BaseNode] - * @param {T} node - * @param {Visitors} visitors - * @param {PrintOptions} opts - * @returns {{ code: string, map: any }} // TODO - */ -export function print(node, visitors, opts = {}) { - /** @type {Command[]} */ - const commands = []; - - // @ts-expect-error some nonsense I don't understand - const context = new Context(visitors, commands); - - context.visit(node); - - /** @typedef {[number, number, number, number]} Segment */ - - let code = ''; - let current_column = 0; - - /** @type {Segment[][]} */ - let mappings = []; - - /** @type {Segment[]} */ - let current_line = []; - - /** @param {string} str */ - function append(str) { - code += str; - - for (let i = 0; i < str.length; i += 1) { - if (str[i] === '\n') { - mappings.push(current_line); - current_line = []; - current_column = 0; - } else { - current_column += 1; - } - } - } - - let current_newline = '\n'; - const indent_str = opts.indent ?? '\t'; - - let needs_newline = false; - let needs_margin = false; - let needs_space = false; - - /** @param {Command} command */ - function run(command) { - if (Array.isArray(command)) { - for (let i = 0; i < command.length; i += 1) { - run(command[i]); - } - return; - } - - if (typeof command === 'number') { - if (command === newline) { - needs_newline = true; - } else if (command === margin) { - needs_margin = true; - } else if (command === space) { - needs_space = true; - } else if (command === indent) { - current_newline += indent_str; - } else if (command === dedent) { - current_newline = current_newline.slice(0, -indent_str.length); - } - - return; - } - - if (needs_newline) { - append(needs_margin ? '\n' + current_newline : current_newline); - } else if (needs_space) { - append(' '); - } - - needs_margin = needs_newline = needs_space = false; - - if (typeof command === 'string') { - append(command); - return; - } - - if (command.type === 'Location') { - current_line.push([ - current_column, - 0, // source index is always zero - command.line - 1, - command.column - ]); - } - } - - for (let i = 0; i < commands.length; i += 1) { - run(commands[i]); - } - - mappings.push(current_line); - - /** @type {SourceMap} */ - let map; - - return { - code, - // create sourcemap lazily in case we don't need it - get map() { - return (map ??= new SourceMap(mappings, opts)); - } - }; -} - -// it sucks that we have to export the class rather than just -// re-exporting it via public.d.ts, but otherwise TypeScript -// gets confused about private fields because it is really dumb! -export { Context }; diff --git a/frontend/node_modules/esrap/src/languages/ts/index.js b/frontend/node_modules/esrap/src/languages/ts/index.js deleted file mode 100644 index 9d20774..0000000 --- a/frontend/node_modules/esrap/src/languages/ts/index.js +++ /dev/null @@ -1,2255 +0,0 @@ -/** @import { TSESTree } from '@typescript-eslint/types' */ -/** @import { Visitors } from '../../types.js' */ -/** @import { TSOptions, BaseComment } from '../types.js' */ -import { Context } from 'esrap'; - -/** @typedef {TSESTree.Node} Node */ - -/** @type {Record} */ -export const EXPRESSIONS_PRECEDENCE = { - JSXFragment: 20, - JSXElement: 20, - ArrayPattern: 20, - ObjectPattern: 20, - ArrayExpression: 20, - TaggedTemplateExpression: 20, - ThisExpression: 20, - Identifier: 20, - TemplateLiteral: 20, - Super: 20, - SequenceExpression: 20, - MemberExpression: 19, - MetaProperty: 19, - CallExpression: 19, - ChainExpression: 19, - ImportExpression: 19, - NewExpression: 19, - Literal: 18, - TSSatisfiesExpression: 18, - TSInstantiationExpression: 18, - TSNonNullExpression: 18, - TSTypeAssertion: 18, - AwaitExpression: 17, - ClassExpression: 17, - FunctionExpression: 17, - ObjectExpression: 17, - TSAsExpression: 16, - UpdateExpression: 16, - UnaryExpression: 15, - BinaryExpression: 14, - LogicalExpression: 13, - ConditionalExpression: 4, - ArrowFunctionExpression: 3, - AssignmentExpression: 3, - YieldExpression: 2, - RestElement: 1 -}; - -const OPERATOR_PRECEDENCE = { - '||': 2, - '&&': 3, - '??': 4, - '|': 5, - '^': 6, - '&': 7, - '==': 8, - '!=': 8, - '===': 8, - '!==': 8, - '<': 9, - '>': 9, - '<=': 9, - '>=': 9, - in: 9, - instanceof: 9, - '<<': 10, - '>>': 10, - '>>>': 10, - '+': 11, - '-': 11, - '*': 12, - '%': 12, - '/': 12, - '**': 13 -}; - -/** - * @param {BaseComment} comment - * @param {Context} context - */ -function write_comment(comment, context) { - if (comment.type === 'Line') { - context.write(`//${comment.value}`); - } else { - context.write('/*'); - const lines = comment.value.split('\n'); - - for (let i = 0; i < lines.length; i += 1) { - if (i > 0) context.newline(); - context.write(lines[i]); - } - - context.write('*/'); - if (lines.length > 1) context.newline(); - } -} - -/** - * @param {TSOptions} [options] - * @returns {Visitors} - */ -export default (options = {}) => { - const quote_char = options.quotes === 'double' ? '"' : "'"; - - const comments = options.comments ?? []; - - let comment_index = 0; - - /** - * Write additional comments for a node - * @param {Context} context - * @param {BaseComment[] | undefined} comments - * @param {('leading' | 'trailing')} position - */ - function write_additional_comments(context, comments, position) { - if (!comments) { - return; - } - - for (let i = 0; i < comments.length; i += 1) { - const comment = comments[i]; - - if (position === 'trailing' && i === 0) { - context.write(' '); - } - - write_comment(comment, context); - - if (position === 'leading') { - if (comment.type === 'Line') { - context.newline(); - } else if (comment.type === 'Block' && !comment.value.includes('\n')) { - context.write(' '); - } - } - } - } - - /** - * Set `comment_index` to be the first comment after `start`. - * Most of the time this is already correct, but if nodes - * have been moved around we may need to search for it - * @param {TSESTree.Node} node - */ - function reset_comment_index(node) { - if (!node.loc) { - comment_index = comments.length; - return; - } - - let previous = comments[comment_index - 1]; - let comment = comments[comment_index]; - - if ( - comment && - comment.loc && - !before(comment.loc.start, node.loc.start) && - (!previous || (previous.loc && before(previous.loc.start, node.loc.start))) - ) { - return; - } - - // TODO use a binary search here, account for synthetic nodes (without `loc`) - comment_index = comments.findIndex( - (comment) => comment.loc && node.loc && !before(comment.loc.start, node.loc.start) - ); - if (comment_index === -1) comment_index = comments.length; - } - - /** - * @param {Context} context - * @param {{ line: number, column: number } | null} prev - * @param {{ line: number, column: number } | null} next - */ - function flush_trailing_comments(context, prev, next) { - while (comment_index < comments.length) { - const comment = comments[comment_index]; - - if ( - comment && - prev && - comment.loc.start.line === prev.line && - (next === null || before(comment.loc.end, next)) - ) { - context.write(' '); - write_comment(comment, context); - - comment_index += 1; - - if (comment.type === 'Line') { - context.newline(); - } else { - continue; - } - } - - break; - } - } - - /** - * @param {Context} context - * @param {{ line: number, column: number } | null} from - * @param {{ line: number, column: number }} to - * @param {boolean} pad - */ - function flush_comments_until(context, from, to, pad) { - let first = true; - - while (comment_index < comments.length) { - const comment = comments[comment_index]; - - if (comment && comment.loc && to && before(comment.loc.start, to)) { - if (first && from !== null && comment.loc.start.line > from.line) { - context.margin(); - context.newline(); - } - - first = false; - - write_comment(comment, context); - - if (comment.loc.end.line < to.line) { - context.newline(); - } else if (pad) { - context.write(' '); - } - - comment_index += 1; - } else { - break; - } - } - } - - /** - * @param {TSESTree.Node} node - * @returns {boolean} - */ - function has_object_or_array_value(node) { - if (!node || node.type !== 'Property') return false; - const value = node.value?.type === 'AssignmentPattern' ? node.value.left : node.value; - return value?.type === 'ObjectExpression' || value?.type === 'ArrayExpression'; - } - - /** - * @param {Context} context - * @param {TSESTree.Node[]} nodes - * @param {{ line: number, column: number }} until - * @param {boolean} pad - */ - function sequence(context, nodes, until, pad, separator = ',') { - let multiline = false; - let length = -1; - - /** @type {boolean[]} */ - const multiline_nodes = []; - - const children = nodes.map((child, i) => { - const child_context = context.new(); - if (child) child_context.visit(child); - - multiline_nodes[i] = child_context.multiline; - - if (i < nodes.length - 1 || !child) { - child_context.write(separator); - } - - const next = i === nodes.length - 1 ? until : nodes[i + 1]?.loc?.start || null; - flush_trailing_comments(child_context, child?.loc?.end || null, next); - - length += child_context.measure() + 1; - multiline ||= child_context.multiline; - - return child_context; - }); - - multiline ||= length > 60; - - if (multiline) { - context.indent(); - context.newline(); - } else if (pad && length > 0) { - context.write(' '); - } - - /** @type {Context | null} */ - let prev = null; - - for (let i = 0; i < nodes.length; i += 1) { - const child = children[i]; - - if (prev !== null) { - if (multiline_nodes[i - 1] && multiline_nodes[i]) { - if (!has_object_or_array_value(nodes[i - 1]) || !has_object_or_array_value(nodes[i])) { - context.margin(); - } - } - - if (nodes[i]) { - if (multiline) { - context.newline(); - } else { - context.write(' '); - } - } - } - - context.append(child); - - prev = child; - } - - flush_comments_until(context, nodes[nodes.length - 1]?.loc?.end ?? null, until, false); - - if (multiline) { - context.dedent(); - context.newline(); - } else if (pad && length > 0) { - context.write(' '); - } - } - - /** - * Push a sequence of nodes onto separate lines, separating them with - * an extra newline where appropriate - * @param {Context} context - * @param {TSESTree.Node & { body: TSESTree.Node[] }} node - */ - function body(context, node) { - reset_comment_index(node); - - /** @type {string | null} */ - let prev_type = null; - let prev_multiline = false; - - for (let i = 0; i < node.body.length; i += 1) { - const child = node.body[i]; - if (child.type === 'EmptyStatement') continue; - - const child_context = context.new(); - child_context.visit(child); - - if (prev_type !== null) { - if (child_context.multiline || prev_multiline || child.type !== prev_type) { - context.margin(); - } - - context.newline(); - } - - context.append(child_context); - - flush_trailing_comments( - context, - child.loc?.end || null, - node.body[i + 1]?.loc?.end ?? node.loc?.end ?? null - ); - - prev_type = child.type; - prev_multiline = child_context.multiline; - } - - if (node.loc) { - context.newline(); - flush_comments_until( - context, - node.body[node.body.length - 1]?.loc?.end ?? null, - node.loc.end, - false - ); - } - } - - const shared = { - /** - * @param {TSESTree.ArrayExpression | TSESTree.ArrayPattern} node - * @param {Context} context - */ - 'ArrayExpression|ArrayPattern': (node, context) => { - context.write('['); - sequence( - context, - /** @type {TSESTree.Node[]} */ (node.elements), - node.loc?.end ?? null, - false - ); - context.write(']'); - }, - - /** - * @param {TSESTree.BinaryExpression | TSESTree.LogicalExpression} node - * @param {Context} context - */ - 'BinaryExpression|LogicalExpression': (node, context) => { - // TODO - // const is_in = node.operator === 'in'; - // if (is_in) { - // // Avoids confusion in `for` loops initializers - // chunks.write('('); - // } - if (needs_parens(node.left, node, false)) { - context.write('('); - context.visit(node.left); - context.write(')'); - } else { - context.visit(node.left); - } - - context.write(` ${node.operator} `); - - if (needs_parens(node.right, node, true)) { - context.write('('); - context.visit(node.right); - context.write(')'); - } else { - context.visit(node.right); - } - }, - - /** - * @param {TSESTree.BlockStatement | TSESTree.ClassBody} node - * @param {Context} context - */ - 'BlockStatement|ClassBody': (node, context) => { - if (node.loc) { - const { line, column } = node.loc.start; - context.location(line, column); - context.write('{'); - context.location(line, column + 1); - } else { - context.write('{'); - } - - const child_context = context.new(); - body(child_context, node); - - if (!child_context.empty()) { - context.indent(); - context.newline(); - context.append(child_context); - context.dedent(); - context.newline(); - } - - if (node.loc) { - const { line, column } = node.loc.end; - - context.location(line, column - 1); - context.write('}'); - context.location(line, column); - } else { - context.write('}'); - } - }, - - /** - * @param {TSESTree.CallExpression | TSESTree.NewExpression} node - * @param {Context} context - */ - 'CallExpression|NewExpression': (node, context) => { - if (node.type === 'NewExpression') { - context.write('new '); - } - - const needs_parens = - EXPRESSIONS_PRECEDENCE[node.callee.type] < EXPRESSIONS_PRECEDENCE.CallExpression || - (node.type === 'NewExpression' && has_call_expression(node.callee)); - - if (needs_parens) { - context.write('('); - context.visit(node.callee); - context.write(')'); - } else { - context.visit(node.callee); - } - - if (/** @type {TSESTree.CallExpression} */ (node).optional) { - context.write('?.'); - } - - if (node.typeArguments) context.visit(node.typeArguments); - - const open = context.new(); - const join = context.new(); - - context.write('('); - context.append(open); - - // if the final argument is multiline, it doesn't need to force all the - // other arguments to also be multiline - const child_context = context.new(); - const final_context = context.new(); - - context.append(child_context); - context.append(final_context); - - for (let i = 0; i < node.arguments.length; i += 1) { - const is_last = i === node.arguments.length - 1; - const context = is_last ? final_context : child_context; - const arg = node.arguments[i]; - - // special case — if final argument has a comment above it, - // we make the whole sequence multiline - if ( - is_last && - arg.loc && - comments[comment_index] && - comments[comment_index].loc && - comments[comment_index].loc.start.line < arg.loc.start.line - ) { - child_context.multiline = true; - } - - context.visit(arg); - - if (!is_last) context.write(','); - - const next = is_last - ? (node.loc?.end ?? null) - : (node.arguments[i + 1]?.loc?.start ?? null); - - flush_trailing_comments(context, arg.loc?.end ?? null, next); - - if (!is_last) context.append(join); - } - - context.multiline ||= child_context.multiline || final_context.multiline; - - if (child_context.multiline) { - open.indent(); - open.newline(); - join.newline(); - context.dedent(); - context.newline(); - } else { - join.write(' '); - } - - context.write(')'); - }, - - /** - * @param {TSESTree.ClassDeclaration | TSESTree.ClassExpression} node - * @param {Context} context - */ - 'ClassDeclaration|ClassExpression': (node, context) => { - if (node.decorators) { - for (const decorator of node.decorators) { - context.visit(decorator); - } - } - - if (node.declare) { - context.write('declare '); - } - - if (node.abstract) context.write('abstract '); - - context.write('class '); - - if (node.id) { - context.visit(node.id); - context.write(' '); - } - - if (node.superClass) { - context.write('extends '); - context.visit(node.superClass); - - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - var type_arguments = node.superTypeParameters ?? node.superTypeArguments; - if (type_arguments) { - context.visit(type_arguments); - } - - context.write(' '); - } - - if (node.implements && node.implements.length > 0) { - context.write('implements'); - sequence(context, node.implements, node.body.loc?.start ?? null, true); - } - - context.visit(node.body); - }, - - /** - * @param {TSESTree.ForInStatement | TSESTree.ForOfStatement} node - * @param {Context} context - */ - 'ForInStatement|ForOfStatement': (node, context) => { - context.write('for '); - if (node.type === 'ForOfStatement' && node.await) context.write('await '); - context.write('('); - - if (node.left.type === 'VariableDeclaration') { - handle_var_declaration(node.left, context); - } else { - context.visit(node.left); - } - - context.write(node.type === 'ForInStatement' ? ' in ' : ' of '); - context.visit(node.right); - context.write(') '); - context.visit(node.body); - }, - - /** - * @param {TSESTree.FunctionDeclaration | TSESTree.FunctionExpression} node - * @param {Context} context - */ - 'FunctionDeclaration|FunctionExpression': (node, context) => { - if (node.async) context.write('async '); - context.write(node.generator ? 'function* ' : 'function '); - if (node.id) context.visit(node.id); - - if (node.typeParameters) { - context.visit(node.typeParameters); - } - - context.write('('); - sequence(context, node.params, (node.returnType ?? node.body).loc?.start ?? null, false); - context.write(')'); - - if (node.returnType) context.visit(node.returnType); - - context.write(' '); - - context.visit(node.body); - }, - - /** - * @param {TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition} node - * @param {Context} context - */ - 'MethodDefinition|TSAbstractMethodDefinition': (node, context) => { - if (node.decorators) { - for (const decorator of node.decorators) { - context.visit(decorator); - } - } - - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - if (node.abstract || node.type === 'TSAbstractMethodDefinition') { - context.write('abstract '); - } - - if (node.accessibility) { - context.write(node.accessibility + ' '); - } - - if (node.override) { - context.write('override '); - } - - if (node.static) { - context.write('static '); - } - - if (node.kind === 'get' || node.kind === 'set') { - // Getter or setter - context.write(node.kind + ' '); - } - - if (node.value.async) { - context.write('async '); - } - - if (node.value.generator) { - context.write('*'); - } - - if (node.computed) context.write('['); - context.visit(node.key); - if (node.computed) context.write(']'); - - context.write('('); - sequence( - context, - node.value.params, - (node.value.returnType ?? node.value.body)?.loc?.start ?? node.loc?.end ?? null, - false - ); - context.write(')'); - - if (node.value.returnType) context.visit(node.value.returnType); - - context.write(' '); - - if (node.value.body) context.visit(node.value.body); - }, - - /** - * @param {TSESTree.PropertyDefinition | TSESTree.TSAbstractPropertyDefinition | TSESTree.AccessorProperty | TSESTree.TSAbstractAccessorProperty} node - * @param {Context} context - */ - 'PropertyDefinition|TSAbstractPropertyDefinition|AccessorProperty|TSAbstractAccessorProperty': ( - node, - context - ) => { - if (node.decorators) { - for (const decorator of node.decorators) { - context.visit(decorator); - } - } - - if (node.accessibility) { - context.write(node.accessibility + ' '); - } - - if ( - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - node.abstract || - node.type === 'TSAbstractPropertyDefinition' || - node.type === 'TSAbstractAccessorProperty' - ) { - context.write('abstract '); - } - - if (node.static) { - context.write('static '); - } - - if ( - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - node.accessor || - node.type === 'AccessorProperty' || - node.type === 'TSAbstractAccessorProperty' - ) { - context.write('accessor '); - } - - if (node.computed) { - context.write('['); - context.visit(node.key); - context.write(']'); - } else { - context.visit(node.key); - } - - if (node.typeAnnotation) { - if (node.type === 'AccessorProperty' || node.type === 'TSAbstractAccessorProperty') { - context.visit(node.typeAnnotation); - } else { - context.write(': '); - context.visit(node.typeAnnotation.typeAnnotation); - } - } - - if (node.value) { - context.write(' = '); - context.visit(node.value); - } - - context.write(';'); - - flush_trailing_comments( - context, - (node.value ?? node.typeAnnotation ?? node.key).loc?.end ?? null, - null - ); - }, - - /** - * @param {TSESTree.RestElement | TSESTree.SpreadElement} node - * @param {Context} context - */ - 'RestElement|SpreadElement': (node, context) => { - context.write('...'); - context.visit(node.argument); - - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - if (node.typeAnnotation) context.visit(node.typeAnnotation); - }, - - /** - * @param {TSESTree.TSConstructSignatureDeclaration | TSESTree.TSCallSignatureDeclaration} node - * @param {Context} context - */ - 'TSConstructSignatureDeclaration|TSCallSignatureDeclaration': (node, context) => { - if (node.type === 'TSConstructSignatureDeclaration') context.write('new'); - - if (node.typeParameters) { - context.visit(node.typeParameters); - } - - context.write('('); - - sequence( - context, - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - node.parameters ?? node.params, - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - (node.typeAnnotation ?? node.returnType)?.loc?.start ?? null, - false - ); - context.write(')'); - - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - if (node.typeAnnotation || node.returnType) { - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - context.visit(node.typeAnnotation ?? node.returnType); - } - }, - - /** - * @param {TSESTree.TSFunctionType | TSESTree.TSConstructorType} node - * @param {Context} context - */ - 'TSFunctionType|TSConstructorType': (node, context) => { - if (node.type === 'TSConstructorType') context.write('new '); - if (node.typeParameters) context.visit(node.typeParameters); - - context.write('('); - - sequence( - context, - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - node.parameters ?? node.params, - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - node.typeAnnotation?.typeAnnotation?.loc?.start ?? - node.returnType?.typeAnnotation?.loc?.start ?? - null, - false - ); - - context.write(') => '); - - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - context.visit(node.typeAnnotation?.typeAnnotation ?? node.returnType?.typeAnnotation); - } - }; - - return { - _(node, context, visit) { - write_additional_comments(context, options.getLeadingComments?.(node), 'leading'); - - if (node.loc) { - flush_comments_until(context, null, node.loc.start, true); - } - - visit(node); - - write_additional_comments(context, options.getTrailingComments?.(node), 'trailing'); - }, - - AccessorProperty: - shared[ - 'PropertyDefinition|TSAbstractPropertyDefinition|AccessorProperty|TSAbstractAccessorProperty' - ], - - ArrayExpression: shared['ArrayExpression|ArrayPattern'], - - ArrayPattern: shared['ArrayExpression|ArrayPattern'], - - ArrowFunctionExpression: (node, context) => { - if (node.async) context.write('async '); - - context.write('('); - sequence(context, node.params, node.body.loc?.start ?? null, false); - context.write(') => '); - - if ( - node.body.type === 'ObjectExpression' || - (node.body.type === 'AssignmentExpression' && node.body.left.type === 'ObjectPattern') || - (node.body.type === 'LogicalExpression' && node.body.left.type === 'ObjectExpression') || - (node.body.type === 'ConditionalExpression' && node.body.test.type === 'ObjectExpression') - ) { - context.write('('); - context.visit(node.body); - context.write(')'); - } else { - context.visit(node.body); - } - }, - - AssignmentExpression(node, context) { - context.visit(node.left); - context.write(` ${node.operator} `); - context.visit(node.right); - }, - - AssignmentPattern(node, context) { - context.visit(node.left); - context.write(' = '); - context.visit(node.right); - }, - - AwaitExpression(node, context) { - if (node.argument) { - const precedence = EXPRESSIONS_PRECEDENCE[node.argument.type]; - - if (precedence && precedence < EXPRESSIONS_PRECEDENCE.AwaitExpression) { - context.write('await ('); - context.visit(node.argument); - context.write(')'); - } else { - context.write('await '); - context.visit(node.argument); - } - } else { - context.write('await'); - } - }, - - BinaryExpression: shared['BinaryExpression|LogicalExpression'], - - BlockStatement: shared['BlockStatement|ClassBody'], - - BreakStatement(node, context) { - if (node.label) { - context.write('break '); - context.visit(node.label); - context.write(';'); - } else { - context.write('break;'); - } - }, - - CallExpression: shared['CallExpression|NewExpression'], - - ChainExpression(node, context) { - context.visit(node.expression); - }, - - ClassBody: shared['BlockStatement|ClassBody'], - - ClassDeclaration: shared['ClassDeclaration|ClassExpression'], - - ClassExpression: shared['ClassDeclaration|ClassExpression'], - - ConditionalExpression(node, context) { - if (EXPRESSIONS_PRECEDENCE[node.test.type] > EXPRESSIONS_PRECEDENCE.ConditionalExpression) { - context.visit(node.test); - } else { - context.write('('); - context.visit(node.test); - context.write(')'); - } - - const consequent = context.new(); - const alternate = context.new(); - - // TODO flush comments here, rather than in visitors - - consequent.visit(node.consequent); - alternate.visit(node.alternate); - - if ( - consequent.multiline || - alternate.multiline || - consequent.measure() + alternate.measure() > 50 - ) { - context.indent(); - context.newline(); - context.write('? '); - context.append(consequent); - context.newline(); - context.write(': '); - context.append(alternate); - context.dedent(); - } else { - context.write(' ? '); - context.append(consequent); - context.write(' : '); - context.append(alternate); - } - }, - - ContinueStatement(node, context) { - if (node.label) { - context.write('continue '); - context.visit(node.label); - context.write(';'); - } else { - context.write('continue;'); - } - }, - - DebuggerStatement(node, context) { - context.write('debugger', node); - context.write(';'); - }, - - Decorator(node, context) { - context.write('@'); - context.visit(node.expression); - context.newline(); - }, - - DoWhileStatement(node, context) { - context.write('do '); - context.visit(node.body); - context.write(' while ('); - context.visit(node.test); - context.write(');'); - }, - - EmptyStatement(node, context) { - context.write(';'); - }, - - ExportAllDeclaration(node, context) { - context.write(node.exportKind === 'type' ? 'export type * ' : 'export * '); - - if (node.exported) { - context.write('as '); - context.visit(node.exported); - } - - context.write(' from '); - context.visit(node.source); - context.write(';'); - }, - - ExportDefaultDeclaration(node, context) { - context.write('export default '); - - context.visit(node.declaration); - - if (node.declaration.type !== 'FunctionDeclaration') { - context.write(';'); - } - }, - - ExportNamedDeclaration(node, context) { - if (node.declaration) { - // Check if declaration has decorators (ClassDeclaration, ClassExpression can have them) - const decl = /** @type {any} */ (node.declaration); - if (decl.decorators && decl.decorators.length > 0) { - for (const decorator of decl.decorators) { - context.visit(decorator); - } - context.write('export '); - // Temporarily remove decorators so ClassDeclaration doesn't print them again - const savedDecorators = decl.decorators; - decl.decorators = []; - context.visit(node.declaration); - decl.decorators = savedDecorators; - } else { - context.write('export '); - context.visit(node.declaration); - } - return; - } - - context.write('export '); - - if (node.exportKind === 'type') { - context.write('type '); - } - - context.write('{'); - sequence(context, node.specifiers, node.source?.loc?.start ?? node.loc?.end ?? null, true); - context.write('}'); - - if (node.source) { - context.write(' from '); - context.visit(node.source); - } - - context.write(';'); - }, - - ExportSpecifier(node, context) { - if (node.exportKind === 'type') { - context.write('type '); - } - - context.visit(node.local); - - if ( - node.local.type === 'Identifier' && - node.exported.type === 'Identifier' && - node.local.name !== node.exported.name - ) { - context.write(' as '); - context.visit(node.exported); - } - }, - - ExpressionStatement(node, context) { - if ( - node.expression.type === 'ObjectExpression' || - (node.expression.type === 'AssignmentExpression' && - node.expression.left.type === 'ObjectPattern') || - node.expression.type === 'FunctionExpression' - ) { - // is an AssignmentExpression to an ObjectPattern - context.write('('); - context.visit(node.expression); - context.write(');'); - return; - } - - context.visit(node.expression); - context.write(';'); - }, - - ForStatement: (node, context) => { - context.write('for ('); - - if (node.init) { - if (node.init.type === 'VariableDeclaration') { - handle_var_declaration(node.init, context); - } else { - context.visit(node.init); - } - } - - context.write('; '); - if (node.test) context.visit(node.test); - context.write('; '); - if (node.update) context.visit(node.update); - - context.write(') '); - context.visit(node.body); - }, - - ForInStatement: shared['ForInStatement|ForOfStatement'], - - ForOfStatement: shared['ForInStatement|ForOfStatement'], - - FunctionDeclaration: shared['FunctionDeclaration|FunctionExpression'], - - FunctionExpression: shared['FunctionDeclaration|FunctionExpression'], - - Identifier(node, context) { - let name = node.name; - context.write(name, node); - - if (node.typeAnnotation) context.visit(node.typeAnnotation); - }, - - IfStatement(node, context) { - context.write('if ('); - context.visit(node.test); - context.write(') '); - context.visit(node.consequent); - - if (node.alternate) { - context.space(); - context.write('else '); - context.visit(node.alternate); - } - }, - - ImportDeclaration(node, context) { - if (node.specifiers.length === 0) { - context.write('import '); - context.visit(node.source); - context.write(';'); - return; - } - - /** @type {TSESTree.ImportNamespaceSpecifier | null} */ - let namespace_specifier = null; - - /** @type {TSESTree.ImportDefaultSpecifier | null} */ - let default_specifier = null; - - /** @type {TSESTree.ImportSpecifier[]} */ - const named_specifiers = []; - - for (const s of node.specifiers) { - if (s.type === 'ImportNamespaceSpecifier') { - namespace_specifier = s; - } else if (s.type === 'ImportDefaultSpecifier') { - default_specifier = s; - } else { - named_specifiers.push(s); - } - } - - context.write('import '); - if (node.importKind == 'type') context.write('type '); - - if (default_specifier) { - context.write(default_specifier.local.name, default_specifier); - if (namespace_specifier || named_specifiers.length > 0) context.write(', '); - } - - if (namespace_specifier) { - context.write('* as ' + namespace_specifier.local.name, namespace_specifier); - } - - if (named_specifiers.length > 0) { - context.write('{'); - sequence(context, named_specifiers, node.source.loc?.start ?? null, true); - context.write('}'); - } - - context.write(' from '); - context.visit(node.source); - if (node.attributes && node.attributes.length > 0) { - context.write(' with { '); - for (let index = 0; index < node.attributes.length; index++) { - const { key, value } = node.attributes[index]; - context.visit(key); - context.write(': '); - context.visit(value); - if (index + 1 !== node.attributes.length) { - context.write(', '); - } - } - context.write(' }'); - } - context.write(';'); - }, - - ImportExpression(node, context) { - context.write('import('); - context.visit(node.source); - //@ts-expect-error for some reason the types haven't been updated - if (node.arguments) { - //@ts-expect-error - for (let index = 0; index < node.arguments.length; index++) { - context.write(', '); - //@ts-expect-error - context.visit(node.arguments[index]); - } - } - if (node.options) { - context.write(', '); - context.visit(node.options); - } - context.write(')'); - }, - - ImportSpecifier(node, context) { - if ( - node.local.type === 'Identifier' && - node.imported.type === 'Identifier' && - node.local.name !== node.imported.name - ) { - context.visit(node.imported); - context.write(' as '); - } - - if (node.importKind == 'type') context.write('type '); - context.visit(node.local); - }, - - LabeledStatement(node, context) { - context.visit(node.label); - context.write(': '); - context.visit(node.body); - }, - - Literal(node, context) { - // TODO do we need to handle weird unicode characters somehow? - // str.replace(/\\u(\d{4})/g, (m, n) => String.fromCharCode(+n)) - - const value = - node.raw || - (typeof node.value === 'string' ? quote(node.value, quote_char) : String(node.value)); - - context.write(value, node); - }, - - LogicalExpression: shared['BinaryExpression|LogicalExpression'], - - MemberExpression(node, context) { - if (EXPRESSIONS_PRECEDENCE[node.object.type] < EXPRESSIONS_PRECEDENCE.MemberExpression) { - context.write('('); - context.visit(node.object); - context.write(')'); - } else { - context.visit(node.object); - } - - if (node.computed) { - if (node.optional) { - context.write('?.'); - } - context.write('['); - context.visit(node.property); - context.write(']'); - } else { - context.write(node.optional ? '?.' : '.'); - context.visit(node.property); - } - }, - - MetaProperty(node, context) { - context.visit(node.meta); - context.write('.'); - context.visit(node.property); - }, - - MethodDefinition: shared['MethodDefinition|TSAbstractMethodDefinition'], - - NewExpression: shared['CallExpression|NewExpression'], - - ObjectExpression(node, context) { - context.write('{'); - sequence(context, node.properties, node.loc?.end ?? null, true); - context.write('}'); - }, - - ObjectPattern(node, context) { - context.write('{'); - sequence(context, node.properties, node.loc?.end ?? null, true); - context.write('}'); - - if (node.typeAnnotation) context.visit(node.typeAnnotation); - }, - - // @ts-expect-error this isn't a real node type, but Acorn produces it - ParenthesizedExpression(node, context) { - context.write('('); - context.visit(node.expression); - context.write(')'); - }, - - PrivateIdentifier(node, context) { - context.write('#'); - context.write(node.name, node); - }, - - Program(node, context) { - body(context, node); - }, - - Property(node, context) { - const value = node.value.type === 'AssignmentPattern' ? node.value.left : node.value; - - const shorthand = - !node.computed && - node.kind === 'init' && - node.key.type === 'Identifier' && - value.type === 'Identifier' && - node.key.name === value.name; - - if (shorthand) { - context.visit(node.value); - return; - } - - // shorthand methods - if (node.value.type === 'FunctionExpression') { - if (node.kind !== 'init') context.write(node.kind + ' '); - if (node.value.async) context.write('async '); - if (node.value.generator) context.write('*'); - if (node.computed) context.write('['); - context.visit(node.key); - if (node.computed) context.write(']'); - context.write('('); - sequence( - context, - node.value.params, - (node.value.returnType ?? node.value.body).loc?.start ?? null, - false - ); - context.write(')'); - - if (node.value.returnType) context.visit(node.value.returnType); - - context.write(' '); - context.visit(node.value.body); - } else { - if (node.computed) context.write('['); - if (node.kind === 'get' || node.kind === 'set') context.write(node.kind + ' '); - context.visit(node.key); - context.write(node.computed ? ']: ' : ': '); - context.visit(node.value); - } - }, - - PropertyDefinition: - shared[ - 'PropertyDefinition|TSAbstractPropertyDefinition|AccessorProperty|TSAbstractAccessorProperty' - ], - - RestElement: shared['RestElement|SpreadElement'], - - ReturnStatement(node, context) { - if (node.argument) { - const contains_comment = - comments[comment_index] && - comments[comment_index].loc && - node.argument.loc && - before(comments[comment_index].loc.start, node.argument.loc.start); - - context.write(contains_comment ? 'return (' : 'return '); - context.visit(node.argument); - context.write(contains_comment ? ');' : ';'); - } else { - context.write('return;'); - } - }, - - SequenceExpression(node, context) { - context.write('('); - sequence(context, node.expressions, node.loc?.end ?? null, false); - context.write(')'); - }, - - SpreadElement: shared['RestElement|SpreadElement'], - - StaticBlock(node, context) { - context.write('static {'); - context.indent(); - context.newline(); - - body(context, node); - - context.dedent(); - context.newline(); - context.write('}'); - }, - - Super(node, context) { - context.write('super', node); - }, - - SwitchStatement(node, context) { - context.write('switch ('); - context.visit(node.discriminant); - context.write(') {'); - context.indent(); - - let first = true; - - for (const block of node.cases) { - if (!first) { - context.margin(); - } - - first = false; - - if (block.test) { - context.newline(); - context.write('case '); - context.visit(block.test); - context.write(':'); - } else { - context.newline(); - context.write('default:'); - } - - context.indent(); - - for (const statement of block.consequent) { - context.newline(); - context.visit(statement); - } - - context.dedent(); - } - - context.dedent(); - context.newline(); - context.write('}'); - }, - - TaggedTemplateExpression(node, context) { - context.visit(node.tag); - context.visit(node.quasi); - }, - - TemplateLiteral(node, context) { - context.write('`'); - - const { quasis, expressions } = node; - - for (let i = 0; i < expressions.length; i++) { - const raw = quasis[i].value.raw; - - context.write(raw + '${'); - context.visit(expressions[i]); - context.write('}'); - - if (/\n/.test(raw)) context.multiline = true; - } - - const raw = quasis[quasis.length - 1].value.raw; - - context.write(raw + '`'); - if (/\n/.test(raw)) context.multiline = true; - }, - - ThisExpression(node, context) { - context.write('this', node); - }, - - ThrowStatement(node, context) { - context.write('throw '); - if (node.argument) context.visit(node.argument); - context.write(';'); - }, - - TryStatement(node, context) { - context.write('try '); - context.visit(node.block); - - if (node.handler) { - if (node.handler.param) { - context.write(' catch('); - context.visit(node.handler.param); - context.write(') '); - } else { - context.write(' catch '); - } - - context.visit(node.handler.body); - } - - if (node.finalizer) { - context.write(' finally '); - context.visit(node.finalizer); - } - }, - - UnaryExpression(node, context) { - context.write(node.operator); - - if (node.operator.length > 1) { - context.write(' '); - } - - if (EXPRESSIONS_PRECEDENCE[node.argument.type] < EXPRESSIONS_PRECEDENCE.UnaryExpression) { - context.write('('); - context.visit(node.argument); - context.write(')'); - } else { - context.visit(node.argument); - } - }, - - UpdateExpression(node, context) { - if (node.prefix) { - context.write(node.operator); - context.visit(node.argument); - } else { - context.visit(node.argument); - context.write(node.operator); - } - }, - - VariableDeclaration(node, context) { - handle_var_declaration(node, context); - context.write(';'); - }, - - VariableDeclarator(node, context) { - context.visit(node.id); - - if (node.init) { - context.write(' = '); - context.visit(node.init); - } - }, - - WhileStatement(node, context) { - context.write('while ('); - context.visit(node.test); - context.write(') '); - context.visit(node.body); - }, - - WithStatement(node, context) { - context.write('with ('); - context.visit(node.object); - context.write(') '); - context.visit(node.body); - }, - - YieldExpression(node, context) { - if (node.argument) { - context.write(node.delegate ? `yield* ` : `yield `); - context.visit(node.argument); - } else { - context.write(node.delegate ? `yield*` : `yield`); - } - }, - - TSAbstractMethodDefinition: shared['MethodDefinition|TSAbstractMethodDefinition'], - - TSAbstractAccessorProperty: - shared[ - 'PropertyDefinition|TSAbstractPropertyDefinition|AccessorProperty|TSAbstractAccessorProperty' - ], - - TSAbstractPropertyDefinition: - shared[ - 'PropertyDefinition|TSAbstractPropertyDefinition|AccessorProperty|TSAbstractAccessorProperty' - ], - - TSDeclareFunction(node, context) { - context.write('declare '); - - if (node.async) { - context.write('async '); - } - - context.write('function'); - - if (node.generator) { - context.write('*'); - } - - if (node.id) { - context.write(' '); - context.visit(node.id); - } - - if (node.typeParameters) { - context.visit(node.typeParameters); - } - - context.write('('); - sequence(context, node.params, node.returnType?.loc?.start ?? node.loc?.end ?? null, false); - context.write(')'); - - if (node.returnType) { - context.visit(node.returnType); - } - - context.write(';'); - }, - - TSNumberKeyword(node, context) { - context.write('number', node); - }, - - TSStringKeyword(node, context) { - context.write('string', node); - }, - - TSBooleanKeyword(node, context) { - context.write('boolean', node); - }, - - TSAnyKeyword(node, context) { - context.write('any', node); - }, - - TSVoidKeyword(node, context) { - context.write('void', node); - }, - - TSUnknownKeyword(node, context) { - context.write('unknown', node); - }, - - TSNeverKeyword(node, context) { - context.write('never', node); - }, - - TSSymbolKeyword(node, context) { - context.write('symbol', node); - }, - - TSNullKeyword(node, context) { - context.write('null', node); - }, - - TSUndefinedKeyword(node, context) { - context.write('undefined', node); - }, - - TSObjectKeyword(node, context) { - context.write('object', node); - }, - - TSBigIntKeyword(node, context) { - context.write('bigint', node); - }, - - TSIntrinsicKeyword(node, context) { - context.write('intrinsic', node); - }, - - TSArrayType(node, context) { - context.visit(node.elementType); - context.write('[]'); - }, - - TSTypeAnnotation(node, context) { - context.write(': '); - context.visit(node.typeAnnotation); - }, - - TSTypeLiteral(node, context) { - context.write('{ '); - sequence(context, node.members, node.loc?.end ?? null, false, ';'); - context.write(' }'); - }, - - TSPropertySignature(node, context) { - context.visit(node.key); - if (node.optional) context.write('?'); - if (node.typeAnnotation) context.visit(node.typeAnnotation); - }, - - TSTypeReference(node, context) { - context.visit(node.typeName); - - if (node.typeArguments) { - context.visit(node.typeArguments); - } - }, - - TSTypeOperator(node, context) { - context.write(node.operator + ' '); - if (node.typeAnnotation) { - context.visit(node.typeAnnotation); - } - }, - - TSTemplateLiteralType(node, context) { - context.write('`'); - const { quasis, types } = node; - for (let i = 0; i < types.length; i++) { - const raw = quasis[i].value.raw; - - context.write(raw + '${'); - context.visit(types[i]); - context.write('}'); - - if (/\n/.test(raw)) context.multiline = true; - } - context.write('`'); - }, - - TSParameterProperty(node, context) { - if (node.accessibility) { - context.write(node.accessibility + ' '); - } - - if (node.readonly) { - context.write('readonly '); - } - - context.visit(node.parameter); - }, - - TSExportAssignment(node, context) { - context.write('export = '); - context.visit(node.expression); - context.write(';'); - }, - - TSNamespaceExportDeclaration(node, context) { - context.write('export as namespace '); - context.visit(node.id); - context.write(';'); - }, - - //@ts-expect-error I don't know why, but this is relied upon in the tests, but doesn't exist in the TSESTree types - TSExpressionWithTypeArguments(node, context) { - context.visit(node.expression); - }, - - TSTypeAssertion(node, context) { - context.write('<'); - context.visit(node.typeAnnotation); - context.write('>'); - if (EXPRESSIONS_PRECEDENCE[node.expression.type] < EXPRESSIONS_PRECEDENCE.TSTypeAssertion) { - context.write('('); - context.visit(node.expression); - context.write(')'); - } else { - context.visit(node.expression); - } - }, - - TSTypeParameterInstantiation(node, context) { - context.write('<'); - for (let i = 0; i < node.params.length; i++) { - context.visit(node.params[i]); - if (i != node.params.length - 1) context.write(', '); - } - context.write('>'); - }, - - TSTypeParameterDeclaration(node, context) { - context.write('<'); - for (let i = 0; i < node.params.length; i++) { - context.visit(node.params[i]); - if (i != node.params.length - 1) context.write(', '); - } - context.write('>'); - }, - - TSTypeParameter(node, context) { - if (node.name && node.name.type) context.visit(node.name); - // @ts-expect-error type mismatch TSESTree and acorn-typescript? - else context.write(node.name, node); - - if (node.constraint) { - context.write(' extends '); - context.visit(node.constraint); - } - }, - - TSTypePredicate(node, context) { - if (node.parameterName) { - context.visit(node.parameterName); - } else if (node.typeAnnotation) { - context.visit(node.typeAnnotation); - } - - if (node.asserts) { - context.write(' asserts '); - } else { - context.write(' is '); - } - - if (node.typeAnnotation) { - context.visit(node.typeAnnotation.typeAnnotation); - } - }, - - TSTypeQuery(node, context) { - context.write('typeof '); - context.visit(node.exprName); - }, - - TSClassImplements(node, context) { - if (node.expression) { - context.visit(node.expression); - } - }, - - TSEnumMember(node, context) { - context.visit(node.id); - if (node.initializer) { - context.write(' = '); - context.visit(node.initializer); - } - }, - - TSFunctionType: shared['TSFunctionType|TSConstructorType'], - - TSIndexSignature(node, context) { - context.write('['); - - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - sequence(context, node.parameters, node.typeAnnotation?.loc?.start ?? null, false); - context.write(']'); - - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - context.visit(node.typeAnnotation); - }, - - TSMappedType(node, context) { - context.write('{['); - - if (node.typeParameter) { - context.visit(node.typeParameter); - } else { - context.visit(node.key); - context.write(' in '); - context.visit(node.constraint); - } - - context.write(']'); - if (node.typeAnnotation) { - context.write(': '); - context.visit(node.typeAnnotation); - } - context.write('}'); - }, - - TSMethodSignature(node, context) { - context.visit(node.key); - - context.write('('); - - sequence( - context, - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - node.parameters ?? node.params, - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - (node.typeAnnotation ?? node.returnType)?.loc?.start ?? null, - false - ); - context.write(')'); - - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - if (node.typeAnnotation || node.returnType) { - // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions - context.visit(node.typeAnnotation ?? node.returnType); - } - }, - - TSTupleType(node, context) { - context.write('['); - sequence(context, node.elementTypes, node.loc?.end ?? null, false); - context.write(']'); - }, - - TSNamedTupleMember(node, context) { - context.visit(node.label); - context.write(': '); - context.visit(node.elementType); - }, - - TSUnionType(node, context) { - sequence(context, node.types, node.loc?.end ?? null, false, ' |'); - }, - - TSIntersectionType(node, context) { - sequence(context, node.types, node.loc?.end ?? null, false, ' &'); - }, - - TSInferType(node, context) { - context.write('infer '); - context.visit(node.typeParameter); - }, - - TSLiteralType(node, context) { - context.visit(node.literal); - }, - - TSCallSignatureDeclaration: - shared['TSConstructSignatureDeclaration|TSCallSignatureDeclaration'], - - TSConditionalType(node, context) { - context.visit(node.checkType); - context.write(' extends '); - context.visit(node.extendsType); - context.write(' ? '); - context.visit(node.trueType); - context.write(' : '); - context.visit(node.falseType); - }, - - TSConstructSignatureDeclaration: - shared['TSConstructSignatureDeclaration|TSCallSignatureDeclaration'], - - TSConstructorType: shared['TSFunctionType|TSConstructorType'], - - TSExternalModuleReference(node, context) { - context.write('require('); - context.visit(node.expression); - context.write(');'); - }, - - TSIndexedAccessType(node, context) { - context.visit(node.objectType); - context.write('['); - context.visit(node.indexType); - context.write(']'); - }, - - TSImportEqualsDeclaration(node, context) { - context.write('import '); - context.visit(node.id); - context.write(' = '); - context.visit(node.moduleReference); - }, - - TSImportType(node, context) { - context.write('import('); - context.visit(node.argument); - context.write(')'); - - if (node.qualifier) { - context.write('.'); - context.visit(node.qualifier); - } - }, - - TSOptionalType(node, context) { - context.visit(node.typeAnnotation); - context.write('?'); - }, - - TSRestType(node, context) { - context.write('...'); - context.visit(node.typeAnnotation); - }, - - TSThisType(node, context) { - context.write('this', node); - }, - - TSAsExpression(node, context) { - if (node.expression) { - const needs_parens = - EXPRESSIONS_PRECEDENCE[node.expression.type] < EXPRESSIONS_PRECEDENCE.TSAsExpression; - - if (needs_parens) { - context.write('('); - context.visit(node.expression); - context.write(')'); - } else { - context.visit(node.expression); - } - } - context.write(' as '); - context.visit(node.typeAnnotation); - }, - - TSEnumDeclaration(node, context) { - context.write('enum '); - context.visit(node.id); - context.write(' {'); - context.indent(); - context.newline(); - sequence(context, node.members ?? node.body.members, node.loc?.end ?? null, false); - context.dedent(); - context.newline(); - context.write('}'); - }, - - TSModuleBlock(node, context) { - context.write(' {'); - context.indent(); - context.newline(); - body(context, node); - context.dedent(); - context.newline(); - context.write('}'); - }, - - TSModuleDeclaration(node, context) { - if (node.declare) context.write('declare '); - else context.write('namespace '); - - context.visit(node.id); - - if (!node.body) return; - context.visit(node.body); - }, - - TSNonNullExpression(node, context) { - context.visit(node.expression); - context.write('!'); - }, - - TSInterfaceBody(node, context) { - sequence(context, node.body, node.loc?.end ?? null, true, ';'); - }, - - TSInterfaceDeclaration(node, context) { - context.write('interface '); - context.visit(node.id); - if (node.typeParameters) context.visit(node.typeParameters); - if (node.extends && node.extends.length > 0) { - context.write(' extends '); - sequence(context, node.extends, node.body.loc?.start ?? null, false); - } - context.write(' {'); - context.visit(node.body); - context.write('}'); - }, - - TSInstantiationExpression(node, context) { - context.visit(node.expression); - context.visit(node.typeArguments); - }, - - TSInterfaceHeritage(node, context) { - if (node.expression) { - context.visit(node.expression); - } - }, - - //@ts-expect-error I don't know why, but this is relied upon in the tests, but doesn't exist in the TSESTree types - TSParenthesizedType(node, context) { - context.write('('); - context.visit(node.typeAnnotation); - context.write(')'); - }, - - TSSatisfiesExpression(node, context) { - if (node.expression) { - const needs_parens = - EXPRESSIONS_PRECEDENCE[node.expression.type] < - EXPRESSIONS_PRECEDENCE.TSSatisfiesExpression; - - if (needs_parens) { - context.write('('); - context.visit(node.expression); - context.write(')'); - } else { - context.visit(node.expression); - } - } - context.write(' satisfies '); - context.visit(node.typeAnnotation); - }, - - TSTypeAliasDeclaration(node, context) { - context.write('type '); - context.visit(node.id); - if (node.typeParameters) context.visit(node.typeParameters); - context.write(' = '); - context.visit(node.typeAnnotation); - context.write(';'); - }, - - TSQualifiedName(node, context) { - context.visit(node.left); - context.write('.'); - context.visit(node.right); - } - }; -}; - -/** @satisfies {Visitors} */ - -/** - * - * @param {TSESTree.Expression | TSESTree.PrivateIdentifier} node - * @param {TSESTree.BinaryExpression | TSESTree.LogicalExpression} parent - * @param {boolean} is_right - * @returns - */ -function needs_parens(node, parent, is_right) { - if (node.type === 'PrivateIdentifier') return false; - - // special case where logical expressions and coalesce expressions cannot be mixed, - // either of them need to be wrapped with parentheses - if ( - node.type === 'LogicalExpression' && - parent.type === 'LogicalExpression' && - ((parent.operator === '??' && node.operator !== '??') || - (parent.operator !== '??' && node.operator === '??')) - ) { - return true; - } - - const precedence = EXPRESSIONS_PRECEDENCE[node.type]; - const parent_precedence = EXPRESSIONS_PRECEDENCE[parent.type]; - - if (precedence !== parent_precedence) { - // Different node types - return ( - (!is_right && precedence === 15 && parent_precedence === 14 && parent.operator === '**') || - precedence < parent_precedence - ); - } - - if (precedence !== 13 && precedence !== 14) { - // Not a `LogicalExpression` or `BinaryExpression` - return false; - } - - if ( - /** @type {TSESTree.BinaryExpression} */ (node).operator === '**' && - parent.operator === '**' - ) { - // Exponentiation operator has right-to-left associativity - return !is_right; - } - - if (is_right) { - // Parenthesis are used if both operators have the same precedence - return ( - OPERATOR_PRECEDENCE[/** @type {TSESTree.BinaryExpression} */ (node).operator] <= - OPERATOR_PRECEDENCE[parent.operator] - ); - } - - return ( - OPERATOR_PRECEDENCE[/** @type {TSESTree.BinaryExpression} */ (node).operator] < - OPERATOR_PRECEDENCE[parent.operator] - ); -} - -/** @param {TSESTree.Node} node */ -function has_call_expression(node) { - while (node) { - if (node.type === 'CallExpression') { - return true; - } else if (node.type === 'MemberExpression') { - node = node.object; - } else { - return false; - } - } -} - -/** - * @param {TSESTree.VariableDeclaration} node - * @param {Context} context - */ -function handle_var_declaration(node, context) { - const open = context.new(); - const join = context.new(); - const child_context = context.new(); - - context.append(child_context); - - if (node.declare) { - child_context.write('declare '); - } - - child_context.write(`${node.kind} `); - child_context.append(open); - - let first = true; - - for (const d of node.declarations) { - if (!first) child_context.append(join); - first = false; - - child_context.visit(d); - } - - const length = child_context.measure() + 2 * (node.declarations.length - 1); - - const multiline = child_context.multiline || (node.declarations.length > 1 && length > 50); - - if (multiline) { - context.multiline = true; - - if (node.declarations.length > 1) open.indent(); - join.write(','); - join.newline(); - if (node.declarations.length > 1) context.dedent(); - } else { - join.write(', '); - } -} - -/** - * @param {string} string - * @param {string} char - */ -function quote(string, char) { - let out = char; - - for (const c of string) { - if (c === '\\') { - out += '\\\\'; - } else if (c === char) { - out += '\\' + c; - } else if (c === '\n') { - out += '\\n'; - } else if (c === '\r') { - out += '\\r'; - } else { - out += c; - } - } - - return out + char; -} - -/** - * - * @param {{ line: number, column: number }} a - * @param {{ line: number, column: number }} b - */ -function before(a, b) { - if (a.line < b.line) return true; - if (a.line > b.line) return false; - return a.column < b.column; -} diff --git a/frontend/node_modules/esrap/src/languages/ts/public.d.ts b/frontend/node_modules/esrap/src/languages/ts/public.d.ts deleted file mode 100644 index da43b05..0000000 --- a/frontend/node_modules/esrap/src/languages/ts/public.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Visitors, BaseNode } from '../../types'; -import type { TSOptions, BaseComment, Comment } from '../types'; -export type { BaseComment, Comment }; -export type Node = BaseNode; -export default function ts(options?: TSOptions): Visitors; -// was Record -export declare const EXPRESSIONS_PRECEDENCE: Record; diff --git a/frontend/node_modules/esrap/src/languages/tsx/index.js b/frontend/node_modules/esrap/src/languages/tsx/index.js deleted file mode 100644 index eb39a14..0000000 --- a/frontend/node_modules/esrap/src/languages/tsx/index.js +++ /dev/null @@ -1,137 +0,0 @@ -/** @import { TSESTree } from '@typescript-eslint/types' */ -/** @import { Visitors } from '../../types.js' */ -/** @import { TSOptions } from '../types.js' */ -import ts from '../ts/index.js'; - -/** - * @param {TSOptions} [options] - * @returns {Visitors} - */ -export default (options) => ({ - ...ts(options), - - JSXElement(node, context) { - context.visit(node.openingElement); - - if (node.children.length > 0) { - context.indent(); - } - - for (const child of node.children) { - context.visit(child); - } - - if (node.children.length > 0) { - context.dedent(); - } - - if (node.closingElement) { - context.visit(node.closingElement); - } - }, - - JSXOpeningElement(node, context) { - context.write('<'); - - context.visit(node.name); - - for (const attribute of node.attributes) { - context.write(' '); - context.visit(attribute); - } - - if (node.selfClosing) { - context.write(' /'); - } - - context.write('>'); - }, - - JSXClosingElement(node, context) { - context.write(''); - }, - - JSXNamespacedName(node, context) { - context.visit(node.namespace); - context.write(':'); - context.visit(node.name); - }, - - JSXIdentifier(node, context) { - context.write(node.name, node); - }, - - JSXMemberExpression(node, context) { - context.visit(node.object); - context.write('.'); - context.visit(node.property); - }, - - JSXText(node, context) { - context.write(node.value, node); - }, - - JSXAttribute(node, context) { - context.visit(node.name); - if (node.value) { - context.write('='); - context.visit(node.value); - } - }, - - JSXEmptyExpression(node, context) {}, - - JSXFragment(node, context) { - context.visit(node.openingFragment); - - if (node.children.length > 0) { - context.indent(); - } - - for (const child of node.children) { - context.visit(child); - } - - if (node.children.length > 0) { - context.dedent(); - } - - context.visit(node.closingFragment); - }, - - JSXOpeningFragment(node, context) { - context.write('<>'); - }, - - JSXClosingFragment(node, context) { - context.write(''); - }, - - JSXExpressionContainer(node, context) { - context.write('{'); - - context.visit(node.expression); - - context.write('}'); - }, - - JSXSpreadChild(node, context) { - context.write('{...'); - - context.visit(node.expression); - - context.write('}'); - }, - - JSXSpreadAttribute(node, context) { - context.write('{...'); - - context.visit(node.argument); - - context.write('}'); - } -}); diff --git a/frontend/node_modules/esrap/src/languages/tsx/public.d.ts b/frontend/node_modules/esrap/src/languages/tsx/public.d.ts deleted file mode 100644 index 16de2ef..0000000 --- a/frontend/node_modules/esrap/src/languages/tsx/public.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Visitors, BaseNode } from '../../types'; -import type { TSOptions, BaseComment, Comment } from '../types'; -export type { BaseComment, Comment }; -export type Node = BaseNode; -export default function tsx(options?: TSOptions): Visitors; diff --git a/frontend/node_modules/esrap/src/languages/types.d.ts b/frontend/node_modules/esrap/src/languages/types.d.ts deleted file mode 100644 index 20f06e1..0000000 --- a/frontend/node_modules/esrap/src/languages/types.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { BaseNode } from '../types'; - -export type TSOptions = { - quotes?: 'double' | 'single'; - comments?: Comment[]; - getLeadingComments?: (node: BaseNode) => BaseComment[] | undefined; - getTrailingComments?: (node: BaseNode) => BaseComment[] | undefined; -}; - -interface Position { - line: number; - column: number; -} - -// this exists in TSESTree but because of the inanity around enums -// it's easier to do this ourselves -export interface BaseComment { - type: 'Line' | 'Block'; - value: string; - start?: number; - end?: number; -} - -export interface Comment extends BaseComment { - loc: { - start: Position; - end: Position; - }; -} diff --git a/frontend/node_modules/esrap/src/public.d.ts b/frontend/node_modules/esrap/src/public.d.ts deleted file mode 100644 index 7f36df5..0000000 --- a/frontend/node_modules/esrap/src/public.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { PrintOptions, Visitors } from './types'; -export * from './index'; diff --git a/frontend/node_modules/esrap/src/types.d.ts b/frontend/node_modules/esrap/src/types.d.ts deleted file mode 100644 index e862803..0000000 --- a/frontend/node_modules/esrap/src/types.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { Context } from 'esrap'; - -export type BaseNode = { - type: string; - loc?: null | { - start: { line: number; column: number }; - end: { line: number; column: number }; - }; -}; - -type NodeOf = X extends { type: T } ? X : never; - -type SpecialisedVisitors = { - [K in T['type']]?: Visitor>; -}; - -export type Visitor = (node: T, context: Context) => void; - -export type Visitors = T['type'] extends '_' - ? never - : SpecialisedVisitors & { _?: (node: T, context: Context, visit: (node: T) => void) => void }; - -export { Context }; - -type TSExpressionWithTypeArguments = { - type: 'TSExpressionWithTypeArguments'; - expression: any; -}; - -export interface Location { - type: 'Location'; - line: number; - column: number; -} - -export interface IndentChange { - type: 'IndentChange'; - offset: number; -} - -export type Command = string | number | Location | Command[]; - -export interface PrintOptions { - sourceMapSource?: string; - sourceMapContent?: string; - sourceMapEncodeMappings?: boolean; // default true - indent?: string; // default tab -} diff --git a/frontend/node_modules/esrap/types/index.d.ts b/frontend/node_modules/esrap/types/index.d.ts deleted file mode 100644 index eca0d7f..0000000 --- a/frontend/node_modules/esrap/types/index.d.ts +++ /dev/null @@ -1,181 +0,0 @@ -declare module 'esrap' { - type BaseNode = { - type: string; - loc?: null | { - start: { line: number; column: number }; - end: { line: number; column: number }; - }; - }; - - type NodeOf = X extends { type: T } ? X : never; - - type SpecialisedVisitors = { - [K in T['type']]?: Visitor>; - }; - - type Visitor = (node: T, context: Context) => void; - - export type Visitors = T['type'] extends '_' - ? never - : SpecialisedVisitors & { _?: (node: T, context: Context, visit: (node: T) => void) => void }; - - interface Location { - type: 'Location'; - line: number; - column: number; - } - - type Command = string | number | Location | Command[]; - - export interface PrintOptions { - sourceMapSource?: string; - sourceMapContent?: string; - sourceMapEncodeMappings?: boolean; // default true - indent?: string; // default tab - } - /** - * @returns // TODO - */ - export function print(node: T, visitors: Visitors, opts?: PrintOptions): { - code: string; - map: any; - }; - export class Context { - - constructor(visitors: Visitors, commands?: Command[]); - multiline: boolean; - indent(): void; - dedent(): void; - margin(): void; - newline(): void; - space(): void; - - append(context: Context): void; - - write(content: string, node?: BaseNode): void; - - location(line: number, column: number): void; - - visit(node: { - type: string; - }): void; - empty(): boolean; - measure(): number; - "new"(): Context; - #private; - } - - export {}; -} - -declare module 'esrap/languages/ts' { - import type { Context } from 'esrap'; - export type Node = BaseNode; - export default function ts(options?: TSOptions): Visitors; - // was Record - export const EXPRESSIONS_PRECEDENCE: Record; - type BaseNode = { - type: string; - loc?: null | { - start: { line: number; column: number }; - end: { line: number; column: number }; - }; - }; - - type NodeOf = X extends { type: T } ? X : never; - - type SpecialisedVisitors = { - [K in T['type']]?: Visitor>; - }; - - type Visitor = (node: T, context: Context) => void; - - type Visitors = T['type'] extends '_' - ? never - : SpecialisedVisitors & { _?: (node: T, context: Context, visit: (node: T) => void) => void }; - type TSOptions = { - quotes?: 'double' | 'single'; - comments?: Comment[]; - getLeadingComments?: (node: BaseNode) => BaseComment[] | undefined; - getTrailingComments?: (node: BaseNode) => BaseComment[] | undefined; - }; - - interface Position { - line: number; - column: number; - } - - // this exists in TSESTree but because of the inanity around enums - // it's easier to do this ourselves - export interface BaseComment { - type: 'Line' | 'Block'; - value: string; - start?: number; - end?: number; - } - - export interface Comment extends BaseComment { - loc: { - start: Position; - end: Position; - }; - } - - export {}; -} - -declare module 'esrap/languages/tsx' { - import type { Context } from 'esrap'; - export type Node = BaseNode; - export default function tsx(options?: TSOptions): Visitors; - type BaseNode = { - type: string; - loc?: null | { - start: { line: number; column: number }; - end: { line: number; column: number }; - }; - }; - - type NodeOf = X extends { type: T } ? X : never; - - type SpecialisedVisitors = { - [K in T['type']]?: Visitor>; - }; - - type Visitor = (node: T, context: Context) => void; - - type Visitors = T['type'] extends '_' - ? never - : SpecialisedVisitors & { _?: (node: T, context: Context, visit: (node: T) => void) => void }; - type TSOptions = { - quotes?: 'double' | 'single'; - comments?: Comment[]; - getLeadingComments?: (node: BaseNode) => BaseComment[] | undefined; - getTrailingComments?: (node: BaseNode) => BaseComment[] | undefined; - }; - - interface Position { - line: number; - column: number; - } - - // this exists in TSESTree but because of the inanity around enums - // it's easier to do this ourselves - export interface BaseComment { - type: 'Line' | 'Block'; - value: string; - start?: number; - end?: number; - } - - export interface Comment extends BaseComment { - loc: { - start: Position; - end: Position; - }; - } - - export {}; -} - -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/esrap/types/index.d.ts.map b/frontend/node_modules/esrap/types/index.d.ts.map deleted file mode 100644 index c7f526b..0000000 --- a/frontend/node_modules/esrap/types/index.d.ts.map +++ /dev/null @@ -1,42 +0,0 @@ -{ - "version": 3, - "file": "index.d.ts", - "names": [ - "BaseNode", - "NodeOf", - "SpecialisedVisitors", - "Visitor", - "Visitors", - "Location", - "Command", - "PrintOptions", - "print", - "Context", - "Node", - "ts", - "EXPRESSIONS_PRECEDENCE", - "TSOptions", - "Position", - "BaseComment", - "Comment", - "tsx" - ], - "sources": [ - "../src/types.d.ts", - "../src/index.js", - "../src/context.js", - "../src/languages/ts/public.d.ts", - "../src/languages/types.d.ts", - "../src/languages/tsx/public.d.ts" - ], - "sourcesContent": [ - null, - null, - null, - null, - null, - null - ], - "mappings": ";MAEYA,QAAQA;;;;;;;;MAQfC,MAAMA;;MAENC,mBAAmBA;;;;MAIZC,OAAOA;;aAEPC,QAAQA;;;;WAWHC,QAAQA;;;;;;MAWbC,OAAOA;;kBAEFC,YAAYA;;;;;;;;;iBCWbC,KAAKA;;;;cC7CRC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aCLRC,IAAIA;yBACQC,EAAEA;;cAELC,sBAAsBA;MHJ/BZ,QAAQA;;;;;;;;MAQfC,MAAMA;;MAENC,mBAAmBA;;;;MAIZC,OAAOA;;MAEPC,QAAQA;;;MIhBRS,SAASA;;;;;;;WAOXC,QAAQA;;;;;;;kBAODC,WAAWA;;;;;;;kBAOXC,OAAOA;;;;;;;;;;;;aCpBZN,IAAIA;yBACQO,GAAGA;MLFfjB,QAAQA;;;;;;;;MAQfC,MAAMA;;MAENC,mBAAmBA;;;;MAIZC,OAAOA;;MAEPC,QAAQA;;;MIhBRS,SAASA;;;;;;;WAOXC,QAAQA;;;;;;;kBAODC,WAAWA;;;;;;;kBAOXC,OAAOA", - "ignoreList": [] -} \ No newline at end of file diff --git a/frontend/node_modules/fdir/LICENSE b/frontend/node_modules/fdir/LICENSE deleted file mode 100644 index bb7fdee..0000000 --- a/frontend/node_modules/fdir/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2023 Abdullah Atta - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/frontend/node_modules/fdir/README.md b/frontend/node_modules/fdir/README.md deleted file mode 100644 index 5c70530..0000000 --- a/frontend/node_modules/fdir/README.md +++ /dev/null @@ -1,91 +0,0 @@ -

- - -

The Fastest Directory Crawler & Globber for NodeJS

-

- - - - - - - - -

-

- -⚡ **The Fastest:** Nothing similar (in the NodeJS world) beats `fdir` in speed. It can easily crawl a directory containing **1 million files in < 1 second.** - -💡 **Stupidly Easy:** `fdir` uses expressive Builder pattern to build the crawler increasing code readability. - -🤖 **Zero Dependencies\*:** `fdir` only uses NodeJS `fs` & `path` modules. - -🕺 **Astonishingly Small:** < 2KB in size gzipped & minified. - -🖮 **Hackable:** Extending `fdir` is extremely simple now that the new Builder API is here. Feel free to experiment around. - -_\* `picomatch` must be installed manually by the user to support globbing._ - -## 🚄 Quickstart - -### Installation - -You can install using `npm`: - -```sh -$ npm i fdir -``` - -or Yarn: - -```sh -$ yarn add fdir -``` - -### Usage - -```ts -import { fdir } from "fdir"; - -// create the builder -const api = new fdir().withFullPaths().crawl("path/to/dir"); - -// get all files in a directory synchronously -const files = api.sync(); - -// or asynchronously -api.withPromise().then((files) => { - // do something with the result here. -}); -``` - -## Documentation: - -Documentation for all methods is available [here](/documentation.md). - -## 📊 Benchmarks: - -Please check the benchmark against the latest version [here](/BENCHMARKS.md). - -## 🙏Used by: - -`fdir` is downloaded over 200k+ times a week by projects around the world. Here's a list of some notable projects using `fdir` in production: - -> Note: if you think your project should be here, feel free to open an issue. Notable is anything with a considerable amount of GitHub stars. - -1. [rollup/plugins](https://github.com/rollup/plugins) -2. [SuperchupuDev/tinyglobby](https://github.com/SuperchupuDev/tinyglobby) -3. [pulumi/pulumi](https://github.com/pulumi/pulumi) -4. [dotenvx/dotenvx](https://github.com/dotenvx/dotenvx) -5. [mdn/yari](https://github.com/mdn/yari) -6. [streetwriters/notesnook](https://github.com/streetwriters/notesnook) -7. [imba/imba](https://github.com/imba/imba) -8. [moroshko/react-scanner](https://github.com/moroshko/react-scanner) -9. [netlify/build](https://github.com/netlify/build) -10. [yassinedoghri/astro-i18next](https://github.com/yassinedoghri/astro-i18next) -11. [selfrefactor/rambda](https://github.com/selfrefactor/rambda) -12. [whyboris/Video-Hub-App](https://github.com/whyboris/Video-Hub-App) - -## 🦮 LICENSE - -Copyright © 2024 Abdullah Atta under MIT. [Read full text here.](https://github.com/thecodrr/fdir/raw/master/LICENSE) diff --git a/frontend/node_modules/fdir/dist/index.cjs b/frontend/node_modules/fdir/dist/index.cjs deleted file mode 100644 index 4868ffb..0000000 --- a/frontend/node_modules/fdir/dist/index.cjs +++ /dev/null @@ -1,588 +0,0 @@ -//#region rolldown:runtime -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { - key = keys[i]; - if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: ((k) => from[k]).bind(null, key), - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { - value: mod, - enumerable: true -}) : target, mod)); - -//#endregion -const path = __toESM(require("path")); -const fs = __toESM(require("fs")); - -//#region src/utils.ts -function cleanPath(path$1) { - let normalized = (0, path.normalize)(path$1); - if (normalized.length > 1 && normalized[normalized.length - 1] === path.sep) normalized = normalized.substring(0, normalized.length - 1); - return normalized; -} -const SLASHES_REGEX = /[\\/]/g; -function convertSlashes(path$1, separator) { - return path$1.replace(SLASHES_REGEX, separator); -} -const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i; -function isRootDirectory(path$1) { - return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1); -} -function normalizePath(path$1, options) { - const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options; - const pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith("."); - if (resolvePaths) path$1 = (0, path.resolve)(path$1); - if (normalizePath$1 || pathNeedsCleaning) path$1 = cleanPath(path$1); - if (path$1 === ".") return ""; - const needsSeperator = path$1[path$1.length - 1] !== pathSeparator; - return convertSlashes(needsSeperator ? path$1 + pathSeparator : path$1, pathSeparator); -} - -//#endregion -//#region src/api/functions/join-path.ts -function joinPathWithBasePath(filename, directoryPath) { - return directoryPath + filename; -} -function joinPathWithRelativePath(root, options) { - return function(filename, directoryPath) { - const sameRoot = directoryPath.startsWith(root); - if (sameRoot) return directoryPath.slice(root.length) + filename; - else return convertSlashes((0, path.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename; - }; -} -function joinPath(filename) { - return filename; -} -function joinDirectoryPath(filename, directoryPath, separator) { - return directoryPath + filename + separator; -} -function build$7(root, options) { - const { relativePaths, includeBasePath } = options; - return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath; -} - -//#endregion -//#region src/api/functions/push-directory.ts -function pushDirectoryWithRelativePath(root) { - return function(directoryPath, paths) { - paths.push(directoryPath.substring(root.length) || "."); - }; -} -function pushDirectoryFilterWithRelativePath(root) { - return function(directoryPath, paths, filters) { - const relativePath = directoryPath.substring(root.length) || "."; - if (filters.every((filter) => filter(relativePath, true))) paths.push(relativePath); - }; -} -const pushDirectory = (directoryPath, paths) => { - paths.push(directoryPath || "."); -}; -const pushDirectoryFilter = (directoryPath, paths, filters) => { - const path$1 = directoryPath || "."; - if (filters.every((filter) => filter(path$1, true))) paths.push(path$1); -}; -const empty$2 = () => {}; -function build$6(root, options) { - const { includeDirs, filters, relativePaths } = options; - if (!includeDirs) return empty$2; - if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root); - return filters && filters.length ? pushDirectoryFilter : pushDirectory; -} - -//#endregion -//#region src/api/functions/push-file.ts -const pushFileFilterAndCount = (filename, _paths, counts, filters) => { - if (filters.every((filter) => filter(filename, false))) counts.files++; -}; -const pushFileFilter = (filename, paths, _counts, filters) => { - if (filters.every((filter) => filter(filename, false))) paths.push(filename); -}; -const pushFileCount = (_filename, _paths, counts, _filters) => { - counts.files++; -}; -const pushFile = (filename, paths) => { - paths.push(filename); -}; -const empty$1 = () => {}; -function build$5(options) { - const { excludeFiles, filters, onlyCounts } = options; - if (excludeFiles) return empty$1; - if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter; - else if (onlyCounts) return pushFileCount; - else return pushFile; -} - -//#endregion -//#region src/api/functions/get-array.ts -const getArray = (paths) => { - return paths; -}; -const getArrayGroup = () => { - return [""].slice(0, 0); -}; -function build$4(options) { - return options.group ? getArrayGroup : getArray; -} - -//#endregion -//#region src/api/functions/group-files.ts -const groupFiles = (groups, directory, files) => { - groups.push({ - directory, - files, - dir: directory - }); -}; -const empty = () => {}; -function build$3(options) { - return options.group ? groupFiles : empty; -} - -//#endregion -//#region src/api/functions/resolve-symlink.ts -const resolveSymlinksAsync = function(path$1, state, callback$1) { - const { queue, fs: fs$1, options: { suppressErrors } } = state; - queue.enqueue(); - fs$1.realpath(path$1, (error, resolvedPath) => { - if (error) return queue.dequeue(suppressErrors ? null : error, state); - fs$1.stat(resolvedPath, (error$1, stat) => { - if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state); - if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state); - callback$1(stat, resolvedPath); - queue.dequeue(null, state); - }); - }); -}; -const resolveSymlinks = function(path$1, state, callback$1) { - const { queue, fs: fs$1, options: { suppressErrors } } = state; - queue.enqueue(); - try { - const resolvedPath = fs$1.realpathSync(path$1); - const stat = fs$1.statSync(resolvedPath); - if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return; - callback$1(stat, resolvedPath); - } catch (e) { - if (!suppressErrors) throw e; - } -}; -function build$2(options, isSynchronous) { - if (!options.resolveSymlinks || options.excludeSymlinks) return null; - return isSynchronous ? resolveSymlinks : resolveSymlinksAsync; -} -function isRecursive(path$1, resolved, state) { - if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state); - let parent = (0, path.dirname)(path$1); - let depth = 1; - while (parent !== state.root && depth < 2) { - const resolvedPath = state.symlinks.get(parent); - const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath)); - if (isSameRoot) depth++; - else parent = (0, path.dirname)(parent); - } - state.symlinks.set(path$1, resolved); - return depth > 1; -} -function isRecursiveUsingRealPaths(resolved, state) { - return state.visited.includes(resolved + state.options.pathSeparator); -} - -//#endregion -//#region src/api/functions/invoke-callback.ts -const onlyCountsSync = (state) => { - return state.counts; -}; -const groupsSync = (state) => { - return state.groups; -}; -const defaultSync = (state) => { - return state.paths; -}; -const limitFilesSync = (state) => { - return state.paths.slice(0, state.options.maxFiles); -}; -const onlyCountsAsync = (state, error, callback$1) => { - report(error, callback$1, state.counts, state.options.suppressErrors); - return null; -}; -const defaultAsync = (state, error, callback$1) => { - report(error, callback$1, state.paths, state.options.suppressErrors); - return null; -}; -const limitFilesAsync = (state, error, callback$1) => { - report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors); - return null; -}; -const groupsAsync = (state, error, callback$1) => { - report(error, callback$1, state.groups, state.options.suppressErrors); - return null; -}; -function report(error, callback$1, output, suppressErrors) { - if (error && !suppressErrors) callback$1(error, output); - else callback$1(null, output); -} -function build$1(options, isSynchronous) { - const { onlyCounts, group, maxFiles } = options; - if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync; - else if (group) return isSynchronous ? groupsSync : groupsAsync; - else if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync; - else return isSynchronous ? defaultSync : defaultAsync; -} - -//#endregion -//#region src/api/functions/walk-directory.ts -const readdirOpts = { withFileTypes: true }; -const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => { - state.queue.enqueue(); - if (currentDepth < 0) return state.queue.dequeue(null, state); - const { fs: fs$1 } = state; - state.visited.push(crawlPath); - state.counts.directories++; - fs$1.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => { - callback$1(entries, directoryPath, currentDepth); - state.queue.dequeue(state.options.suppressErrors ? null : error, state); - }); -}; -const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => { - const { fs: fs$1 } = state; - if (currentDepth < 0) return; - state.visited.push(crawlPath); - state.counts.directories++; - let entries = []; - try { - entries = fs$1.readdirSync(crawlPath || ".", readdirOpts); - } catch (e) { - if (!state.options.suppressErrors) throw e; - } - callback$1(entries, directoryPath, currentDepth); -}; -function build(isSynchronous) { - return isSynchronous ? walkSync : walkAsync; -} - -//#endregion -//#region src/api/queue.ts -/** -* This is a custom stateless queue to track concurrent async fs calls. -* It increments a counter whenever a call is queued and decrements it -* as soon as it completes. When the counter hits 0, it calls onQueueEmpty. -*/ -var Queue = class { - count = 0; - constructor(onQueueEmpty) { - this.onQueueEmpty = onQueueEmpty; - } - enqueue() { - this.count++; - return this.count; - } - dequeue(error, output) { - if (this.onQueueEmpty && (--this.count <= 0 || error)) { - this.onQueueEmpty(error, output); - if (error) { - output.controller.abort(); - this.onQueueEmpty = void 0; - } - } - } -}; - -//#endregion -//#region src/api/counter.ts -var Counter = class { - _files = 0; - _directories = 0; - set files(num) { - this._files = num; - } - get files() { - return this._files; - } - set directories(num) { - this._directories = num; - } - get directories() { - return this._directories; - } - /** - * @deprecated use `directories` instead - */ - /* c8 ignore next 3 */ - get dirs() { - return this._directories; - } -}; - -//#endregion -//#region src/api/aborter.ts -/** -* AbortController is not supported on Node 14 so we use this until we can drop -* support for Node 14. -*/ -var Aborter = class { - aborted = false; - abort() { - this.aborted = true; - } -}; - -//#endregion -//#region src/api/walker.ts -var Walker = class { - root; - isSynchronous; - state; - joinPath; - pushDirectory; - pushFile; - getArray; - groupFiles; - resolveSymlink; - walkDirectory; - callbackInvoker; - constructor(root, options, callback$1) { - this.isSynchronous = !callback$1; - this.callbackInvoker = build$1(options, this.isSynchronous); - this.root = normalizePath(root, options); - this.state = { - root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1), - paths: [""].slice(0, 0), - groups: [], - counts: new Counter(), - options, - queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)), - symlinks: /* @__PURE__ */ new Map(), - visited: [""].slice(0, 0), - controller: new Aborter(), - fs: options.fs || fs - }; - this.joinPath = build$7(this.root, options); - this.pushDirectory = build$6(this.root, options); - this.pushFile = build$5(options); - this.getArray = build$4(options); - this.groupFiles = build$3(options); - this.resolveSymlink = build$2(options, this.isSynchronous); - this.walkDirectory = build(this.isSynchronous); - } - start() { - this.pushDirectory(this.root, this.state.paths, this.state.options.filters); - this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk); - return this.isSynchronous ? this.callbackInvoker(this.state, null) : null; - } - walk = (entries, directoryPath, depth) => { - const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state; - if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return; - const files = this.getArray(this.state.paths); - for (let i = 0; i < entries.length; ++i) { - const entry = entries[i]; - if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) { - const filename = this.joinPath(entry.name, directoryPath); - this.pushFile(filename, files, this.state.counts, filters); - } else if (entry.isDirectory()) { - let path$1 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator); - if (exclude && exclude(entry.name, path$1)) continue; - this.pushDirectory(path$1, paths, filters); - this.walkDirectory(this.state, path$1, path$1, depth - 1, this.walk); - } else if (this.resolveSymlink && entry.isSymbolicLink()) { - let path$1 = joinPathWithBasePath(entry.name, directoryPath); - this.resolveSymlink(path$1, this.state, (stat, resolvedPath) => { - if (stat.isDirectory()) { - resolvedPath = normalizePath(resolvedPath, this.state.options); - if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return; - this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth - 1, this.walk); - } else { - resolvedPath = useRealPaths ? resolvedPath : path$1; - const filename = (0, path.basename)(resolvedPath); - const directoryPath$1 = normalizePath((0, path.dirname)(resolvedPath), this.state.options); - resolvedPath = this.joinPath(filename, directoryPath$1); - this.pushFile(resolvedPath, files, this.state.counts, filters); - } - }); - } - } - this.groupFiles(this.state.groups, directoryPath, files); - }; -}; - -//#endregion -//#region src/api/async.ts -function promise(root, options) { - return new Promise((resolve$1, reject) => { - callback(root, options, (err, output) => { - if (err) return reject(err); - resolve$1(output); - }); - }); -} -function callback(root, options, callback$1) { - let walker = new Walker(root, options, callback$1); - walker.start(); -} - -//#endregion -//#region src/api/sync.ts -function sync(root, options) { - const walker = new Walker(root, options); - return walker.start(); -} - -//#endregion -//#region src/builder/api-builder.ts -var APIBuilder = class { - constructor(root, options) { - this.root = root; - this.options = options; - } - withPromise() { - return promise(this.root, this.options); - } - withCallback(cb) { - callback(this.root, this.options, cb); - } - sync() { - return sync(this.root, this.options); - } -}; - -//#endregion -//#region src/builder/index.ts -let pm = null; -/* c8 ignore next 6 */ -try { - require.resolve("picomatch"); - pm = require("picomatch"); -} catch {} -var Builder = class { - globCache = {}; - options = { - maxDepth: Infinity, - suppressErrors: true, - pathSeparator: path.sep, - filters: [] - }; - globFunction; - constructor(options) { - this.options = { - ...this.options, - ...options - }; - this.globFunction = this.options.globFunction; - } - group() { - this.options.group = true; - return this; - } - withPathSeparator(separator) { - this.options.pathSeparator = separator; - return this; - } - withBasePath() { - this.options.includeBasePath = true; - return this; - } - withRelativePaths() { - this.options.relativePaths = true; - return this; - } - withDirs() { - this.options.includeDirs = true; - return this; - } - withMaxDepth(depth) { - this.options.maxDepth = depth; - return this; - } - withMaxFiles(limit) { - this.options.maxFiles = limit; - return this; - } - withFullPaths() { - this.options.resolvePaths = true; - this.options.includeBasePath = true; - return this; - } - withErrors() { - this.options.suppressErrors = false; - return this; - } - withSymlinks({ resolvePaths = true } = {}) { - this.options.resolveSymlinks = true; - this.options.useRealPaths = resolvePaths; - return this.withFullPaths(); - } - withAbortSignal(signal) { - this.options.signal = signal; - return this; - } - normalize() { - this.options.normalizePath = true; - return this; - } - filter(predicate) { - this.options.filters.push(predicate); - return this; - } - onlyDirs() { - this.options.excludeFiles = true; - this.options.includeDirs = true; - return this; - } - exclude(predicate) { - this.options.exclude = predicate; - return this; - } - onlyCounts() { - this.options.onlyCounts = true; - return this; - } - crawl(root) { - return new APIBuilder(root || ".", this.options); - } - withGlobFunction(fn) { - this.globFunction = fn; - return this; - } - /** - * @deprecated Pass options using the constructor instead: - * ```ts - * new fdir(options).crawl("/path/to/root"); - * ``` - * This method will be removed in v7.0 - */ - /* c8 ignore next 4 */ - crawlWithOptions(root, options) { - this.options = { - ...this.options, - ...options - }; - return new APIBuilder(root || ".", this.options); - } - glob(...patterns) { - if (this.globFunction) return this.globWithOptions(patterns); - return this.globWithOptions(patterns, ...[{ dot: true }]); - } - globWithOptions(patterns, ...options) { - const globFn = this.globFunction || pm; - /* c8 ignore next 5 */ - if (!globFn) throw new Error("Please specify a glob function to use glob matching."); - var isMatch = this.globCache[patterns.join("\0")]; - if (!isMatch) { - isMatch = globFn(patterns, ...options); - this.globCache[patterns.join("\0")] = isMatch; - } - this.options.filters.push((path$1) => isMatch(path$1)); - return this; - } -}; - -//#endregion -exports.fdir = Builder; \ No newline at end of file diff --git a/frontend/node_modules/fdir/dist/index.d.cts b/frontend/node_modules/fdir/dist/index.d.cts deleted file mode 100644 index f448ef5..0000000 --- a/frontend/node_modules/fdir/dist/index.d.cts +++ /dev/null @@ -1,155 +0,0 @@ -/// -import * as nativeFs from "fs"; -import picomatch from "picomatch"; - -//#region src/api/aborter.d.ts -/** - * AbortController is not supported on Node 14 so we use this until we can drop - * support for Node 14. - */ -declare class Aborter { - aborted: boolean; - abort(): void; -} -//#endregion -//#region src/api/queue.d.ts -type OnQueueEmptyCallback = (error: Error | null, output: WalkerState) => void; -/** - * This is a custom stateless queue to track concurrent async fs calls. - * It increments a counter whenever a call is queued and decrements it - * as soon as it completes. When the counter hits 0, it calls onQueueEmpty. - */ -declare class Queue { - private onQueueEmpty?; - count: number; - constructor(onQueueEmpty?: OnQueueEmptyCallback | undefined); - enqueue(): number; - dequeue(error: Error | null, output: WalkerState): void; -} -//#endregion -//#region src/types.d.ts -type Counts = { - files: number; - directories: number; - /** - * @deprecated use `directories` instead. Will be removed in v7.0. - */ - dirs: number; -}; -type Group = { - directory: string; - files: string[]; - /** - * @deprecated use `directory` instead. Will be removed in v7.0. - */ - dir: string; -}; -type GroupOutput = Group[]; -type OnlyCountsOutput = Counts; -type PathsOutput = string[]; -type Output = OnlyCountsOutput | PathsOutput | GroupOutput; -type FSLike = { - readdir: typeof nativeFs.readdir; - readdirSync: typeof nativeFs.readdirSync; - realpath: typeof nativeFs.realpath; - realpathSync: typeof nativeFs.realpathSync; - stat: typeof nativeFs.stat; - statSync: typeof nativeFs.statSync; -}; -type WalkerState = { - root: string; - paths: string[]; - groups: Group[]; - counts: Counts; - options: Options; - queue: Queue; - controller: Aborter; - fs: FSLike; - symlinks: Map; - visited: string[]; -}; -type ResultCallback = (error: Error | null, output: TOutput) => void; -type FilterPredicate = (path: string, isDirectory: boolean) => boolean; -type ExcludePredicate = (dirName: string, dirPath: string) => boolean; -type PathSeparator = "/" | "\\"; -type Options = { - includeBasePath?: boolean; - includeDirs?: boolean; - normalizePath?: boolean; - maxDepth: number; - maxFiles?: number; - resolvePaths?: boolean; - suppressErrors: boolean; - group?: boolean; - onlyCounts?: boolean; - filters: FilterPredicate[]; - resolveSymlinks?: boolean; - useRealPaths?: boolean; - excludeFiles?: boolean; - excludeSymlinks?: boolean; - exclude?: ExcludePredicate; - relativePaths?: boolean; - pathSeparator: PathSeparator; - signal?: AbortSignal; - globFunction?: TGlobFunction; - fs?: FSLike; -}; -type GlobMatcher = (test: string) => boolean; -type GlobFunction = (glob: string | string[], ...params: unknown[]) => GlobMatcher; -type GlobParams = T extends ((globs: string | string[], ...params: infer TParams extends unknown[]) => GlobMatcher) ? TParams : []; -//#endregion -//#region src/builder/api-builder.d.ts -declare class APIBuilder { - private readonly root; - private readonly options; - constructor(root: string, options: Options); - withPromise(): Promise; - withCallback(cb: ResultCallback): void; - sync(): TReturnType; -} -//#endregion -//#region src/builder/index.d.ts -declare class Builder { - private readonly globCache; - private options; - private globFunction?; - constructor(options?: Partial>); - group(): Builder; - withPathSeparator(separator: "/" | "\\"): this; - withBasePath(): this; - withRelativePaths(): this; - withDirs(): this; - withMaxDepth(depth: number): this; - withMaxFiles(limit: number): this; - withFullPaths(): this; - withErrors(): this; - withSymlinks({ - resolvePaths - }?: { - resolvePaths?: boolean | undefined; - }): this; - withAbortSignal(signal: AbortSignal): this; - normalize(): this; - filter(predicate: FilterPredicate): this; - onlyDirs(): this; - exclude(predicate: ExcludePredicate): this; - onlyCounts(): Builder; - crawl(root?: string): APIBuilder; - withGlobFunction(fn: TFunc): Builder; - /** - * @deprecated Pass options using the constructor instead: - * ```ts - * new fdir(options).crawl("/path/to/root"); - * ``` - * This method will be removed in v7.0 - */ - crawlWithOptions(root: string, options: Partial>): APIBuilder; - glob(...patterns: string[]): Builder; - globWithOptions(patterns: string[]): Builder; - globWithOptions(patterns: string[], ...options: GlobParams): Builder; -} -//#endregion -//#region src/index.d.ts -type Fdir = typeof Builder; -//#endregion -export { Counts, ExcludePredicate, FSLike, Fdir, FilterPredicate, GlobFunction, GlobMatcher, GlobParams, Group, GroupOutput, OnlyCountsOutput, Options, Output, PathSeparator, PathsOutput, ResultCallback, WalkerState, Builder as fdir }; \ No newline at end of file diff --git a/frontend/node_modules/fdir/dist/index.d.mts b/frontend/node_modules/fdir/dist/index.d.mts deleted file mode 100644 index f448ef5..0000000 --- a/frontend/node_modules/fdir/dist/index.d.mts +++ /dev/null @@ -1,155 +0,0 @@ -/// -import * as nativeFs from "fs"; -import picomatch from "picomatch"; - -//#region src/api/aborter.d.ts -/** - * AbortController is not supported on Node 14 so we use this until we can drop - * support for Node 14. - */ -declare class Aborter { - aborted: boolean; - abort(): void; -} -//#endregion -//#region src/api/queue.d.ts -type OnQueueEmptyCallback = (error: Error | null, output: WalkerState) => void; -/** - * This is a custom stateless queue to track concurrent async fs calls. - * It increments a counter whenever a call is queued and decrements it - * as soon as it completes. When the counter hits 0, it calls onQueueEmpty. - */ -declare class Queue { - private onQueueEmpty?; - count: number; - constructor(onQueueEmpty?: OnQueueEmptyCallback | undefined); - enqueue(): number; - dequeue(error: Error | null, output: WalkerState): void; -} -//#endregion -//#region src/types.d.ts -type Counts = { - files: number; - directories: number; - /** - * @deprecated use `directories` instead. Will be removed in v7.0. - */ - dirs: number; -}; -type Group = { - directory: string; - files: string[]; - /** - * @deprecated use `directory` instead. Will be removed in v7.0. - */ - dir: string; -}; -type GroupOutput = Group[]; -type OnlyCountsOutput = Counts; -type PathsOutput = string[]; -type Output = OnlyCountsOutput | PathsOutput | GroupOutput; -type FSLike = { - readdir: typeof nativeFs.readdir; - readdirSync: typeof nativeFs.readdirSync; - realpath: typeof nativeFs.realpath; - realpathSync: typeof nativeFs.realpathSync; - stat: typeof nativeFs.stat; - statSync: typeof nativeFs.statSync; -}; -type WalkerState = { - root: string; - paths: string[]; - groups: Group[]; - counts: Counts; - options: Options; - queue: Queue; - controller: Aborter; - fs: FSLike; - symlinks: Map; - visited: string[]; -}; -type ResultCallback = (error: Error | null, output: TOutput) => void; -type FilterPredicate = (path: string, isDirectory: boolean) => boolean; -type ExcludePredicate = (dirName: string, dirPath: string) => boolean; -type PathSeparator = "/" | "\\"; -type Options = { - includeBasePath?: boolean; - includeDirs?: boolean; - normalizePath?: boolean; - maxDepth: number; - maxFiles?: number; - resolvePaths?: boolean; - suppressErrors: boolean; - group?: boolean; - onlyCounts?: boolean; - filters: FilterPredicate[]; - resolveSymlinks?: boolean; - useRealPaths?: boolean; - excludeFiles?: boolean; - excludeSymlinks?: boolean; - exclude?: ExcludePredicate; - relativePaths?: boolean; - pathSeparator: PathSeparator; - signal?: AbortSignal; - globFunction?: TGlobFunction; - fs?: FSLike; -}; -type GlobMatcher = (test: string) => boolean; -type GlobFunction = (glob: string | string[], ...params: unknown[]) => GlobMatcher; -type GlobParams = T extends ((globs: string | string[], ...params: infer TParams extends unknown[]) => GlobMatcher) ? TParams : []; -//#endregion -//#region src/builder/api-builder.d.ts -declare class APIBuilder { - private readonly root; - private readonly options; - constructor(root: string, options: Options); - withPromise(): Promise; - withCallback(cb: ResultCallback): void; - sync(): TReturnType; -} -//#endregion -//#region src/builder/index.d.ts -declare class Builder { - private readonly globCache; - private options; - private globFunction?; - constructor(options?: Partial>); - group(): Builder; - withPathSeparator(separator: "/" | "\\"): this; - withBasePath(): this; - withRelativePaths(): this; - withDirs(): this; - withMaxDepth(depth: number): this; - withMaxFiles(limit: number): this; - withFullPaths(): this; - withErrors(): this; - withSymlinks({ - resolvePaths - }?: { - resolvePaths?: boolean | undefined; - }): this; - withAbortSignal(signal: AbortSignal): this; - normalize(): this; - filter(predicate: FilterPredicate): this; - onlyDirs(): this; - exclude(predicate: ExcludePredicate): this; - onlyCounts(): Builder; - crawl(root?: string): APIBuilder; - withGlobFunction(fn: TFunc): Builder; - /** - * @deprecated Pass options using the constructor instead: - * ```ts - * new fdir(options).crawl("/path/to/root"); - * ``` - * This method will be removed in v7.0 - */ - crawlWithOptions(root: string, options: Partial>): APIBuilder; - glob(...patterns: string[]): Builder; - globWithOptions(patterns: string[]): Builder; - globWithOptions(patterns: string[], ...options: GlobParams): Builder; -} -//#endregion -//#region src/index.d.ts -type Fdir = typeof Builder; -//#endregion -export { Counts, ExcludePredicate, FSLike, Fdir, FilterPredicate, GlobFunction, GlobMatcher, GlobParams, Group, GroupOutput, OnlyCountsOutput, Options, Output, PathSeparator, PathsOutput, ResultCallback, WalkerState, Builder as fdir }; \ No newline at end of file diff --git a/frontend/node_modules/fdir/dist/index.mjs b/frontend/node_modules/fdir/dist/index.mjs deleted file mode 100644 index 5c37e09..0000000 --- a/frontend/node_modules/fdir/dist/index.mjs +++ /dev/null @@ -1,570 +0,0 @@ -import { createRequire } from "module"; -import { basename, dirname, normalize, relative, resolve, sep } from "path"; -import * as nativeFs from "fs"; - -//#region rolldown:runtime -var __require = /* @__PURE__ */ createRequire(import.meta.url); - -//#endregion -//#region src/utils.ts -function cleanPath(path) { - let normalized = normalize(path); - if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1); - return normalized; -} -const SLASHES_REGEX = /[\\/]/g; -function convertSlashes(path, separator) { - return path.replace(SLASHES_REGEX, separator); -} -const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i; -function isRootDirectory(path) { - return path === "/" || WINDOWS_ROOT_DIR_REGEX.test(path); -} -function normalizePath(path, options) { - const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options; - const pathNeedsCleaning = process.platform === "win32" && path.includes("/") || path.startsWith("."); - if (resolvePaths) path = resolve(path); - if (normalizePath$1 || pathNeedsCleaning) path = cleanPath(path); - if (path === ".") return ""; - const needsSeperator = path[path.length - 1] !== pathSeparator; - return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator); -} - -//#endregion -//#region src/api/functions/join-path.ts -function joinPathWithBasePath(filename, directoryPath) { - return directoryPath + filename; -} -function joinPathWithRelativePath(root, options) { - return function(filename, directoryPath) { - const sameRoot = directoryPath.startsWith(root); - if (sameRoot) return directoryPath.slice(root.length) + filename; - else return convertSlashes(relative(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename; - }; -} -function joinPath(filename) { - return filename; -} -function joinDirectoryPath(filename, directoryPath, separator) { - return directoryPath + filename + separator; -} -function build$7(root, options) { - const { relativePaths, includeBasePath } = options; - return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath; -} - -//#endregion -//#region src/api/functions/push-directory.ts -function pushDirectoryWithRelativePath(root) { - return function(directoryPath, paths) { - paths.push(directoryPath.substring(root.length) || "."); - }; -} -function pushDirectoryFilterWithRelativePath(root) { - return function(directoryPath, paths, filters) { - const relativePath = directoryPath.substring(root.length) || "."; - if (filters.every((filter) => filter(relativePath, true))) paths.push(relativePath); - }; -} -const pushDirectory = (directoryPath, paths) => { - paths.push(directoryPath || "."); -}; -const pushDirectoryFilter = (directoryPath, paths, filters) => { - const path = directoryPath || "."; - if (filters.every((filter) => filter(path, true))) paths.push(path); -}; -const empty$2 = () => {}; -function build$6(root, options) { - const { includeDirs, filters, relativePaths } = options; - if (!includeDirs) return empty$2; - if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root); - return filters && filters.length ? pushDirectoryFilter : pushDirectory; -} - -//#endregion -//#region src/api/functions/push-file.ts -const pushFileFilterAndCount = (filename, _paths, counts, filters) => { - if (filters.every((filter) => filter(filename, false))) counts.files++; -}; -const pushFileFilter = (filename, paths, _counts, filters) => { - if (filters.every((filter) => filter(filename, false))) paths.push(filename); -}; -const pushFileCount = (_filename, _paths, counts, _filters) => { - counts.files++; -}; -const pushFile = (filename, paths) => { - paths.push(filename); -}; -const empty$1 = () => {}; -function build$5(options) { - const { excludeFiles, filters, onlyCounts } = options; - if (excludeFiles) return empty$1; - if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter; - else if (onlyCounts) return pushFileCount; - else return pushFile; -} - -//#endregion -//#region src/api/functions/get-array.ts -const getArray = (paths) => { - return paths; -}; -const getArrayGroup = () => { - return [""].slice(0, 0); -}; -function build$4(options) { - return options.group ? getArrayGroup : getArray; -} - -//#endregion -//#region src/api/functions/group-files.ts -const groupFiles = (groups, directory, files) => { - groups.push({ - directory, - files, - dir: directory - }); -}; -const empty = () => {}; -function build$3(options) { - return options.group ? groupFiles : empty; -} - -//#endregion -//#region src/api/functions/resolve-symlink.ts -const resolveSymlinksAsync = function(path, state, callback$1) { - const { queue, fs, options: { suppressErrors } } = state; - queue.enqueue(); - fs.realpath(path, (error, resolvedPath) => { - if (error) return queue.dequeue(suppressErrors ? null : error, state); - fs.stat(resolvedPath, (error$1, stat) => { - if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state); - if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state); - callback$1(stat, resolvedPath); - queue.dequeue(null, state); - }); - }); -}; -const resolveSymlinks = function(path, state, callback$1) { - const { queue, fs, options: { suppressErrors } } = state; - queue.enqueue(); - try { - const resolvedPath = fs.realpathSync(path); - const stat = fs.statSync(resolvedPath); - if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return; - callback$1(stat, resolvedPath); - } catch (e) { - if (!suppressErrors) throw e; - } -}; -function build$2(options, isSynchronous) { - if (!options.resolveSymlinks || options.excludeSymlinks) return null; - return isSynchronous ? resolveSymlinks : resolveSymlinksAsync; -} -function isRecursive(path, resolved, state) { - if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state); - let parent = dirname(path); - let depth = 1; - while (parent !== state.root && depth < 2) { - const resolvedPath = state.symlinks.get(parent); - const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath)); - if (isSameRoot) depth++; - else parent = dirname(parent); - } - state.symlinks.set(path, resolved); - return depth > 1; -} -function isRecursiveUsingRealPaths(resolved, state) { - return state.visited.includes(resolved + state.options.pathSeparator); -} - -//#endregion -//#region src/api/functions/invoke-callback.ts -const onlyCountsSync = (state) => { - return state.counts; -}; -const groupsSync = (state) => { - return state.groups; -}; -const defaultSync = (state) => { - return state.paths; -}; -const limitFilesSync = (state) => { - return state.paths.slice(0, state.options.maxFiles); -}; -const onlyCountsAsync = (state, error, callback$1) => { - report(error, callback$1, state.counts, state.options.suppressErrors); - return null; -}; -const defaultAsync = (state, error, callback$1) => { - report(error, callback$1, state.paths, state.options.suppressErrors); - return null; -}; -const limitFilesAsync = (state, error, callback$1) => { - report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors); - return null; -}; -const groupsAsync = (state, error, callback$1) => { - report(error, callback$1, state.groups, state.options.suppressErrors); - return null; -}; -function report(error, callback$1, output, suppressErrors) { - if (error && !suppressErrors) callback$1(error, output); - else callback$1(null, output); -} -function build$1(options, isSynchronous) { - const { onlyCounts, group, maxFiles } = options; - if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync; - else if (group) return isSynchronous ? groupsSync : groupsAsync; - else if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync; - else return isSynchronous ? defaultSync : defaultAsync; -} - -//#endregion -//#region src/api/functions/walk-directory.ts -const readdirOpts = { withFileTypes: true }; -const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => { - state.queue.enqueue(); - if (currentDepth < 0) return state.queue.dequeue(null, state); - const { fs } = state; - state.visited.push(crawlPath); - state.counts.directories++; - fs.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => { - callback$1(entries, directoryPath, currentDepth); - state.queue.dequeue(state.options.suppressErrors ? null : error, state); - }); -}; -const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => { - const { fs } = state; - if (currentDepth < 0) return; - state.visited.push(crawlPath); - state.counts.directories++; - let entries = []; - try { - entries = fs.readdirSync(crawlPath || ".", readdirOpts); - } catch (e) { - if (!state.options.suppressErrors) throw e; - } - callback$1(entries, directoryPath, currentDepth); -}; -function build(isSynchronous) { - return isSynchronous ? walkSync : walkAsync; -} - -//#endregion -//#region src/api/queue.ts -/** -* This is a custom stateless queue to track concurrent async fs calls. -* It increments a counter whenever a call is queued and decrements it -* as soon as it completes. When the counter hits 0, it calls onQueueEmpty. -*/ -var Queue = class { - count = 0; - constructor(onQueueEmpty) { - this.onQueueEmpty = onQueueEmpty; - } - enqueue() { - this.count++; - return this.count; - } - dequeue(error, output) { - if (this.onQueueEmpty && (--this.count <= 0 || error)) { - this.onQueueEmpty(error, output); - if (error) { - output.controller.abort(); - this.onQueueEmpty = void 0; - } - } - } -}; - -//#endregion -//#region src/api/counter.ts -var Counter = class { - _files = 0; - _directories = 0; - set files(num) { - this._files = num; - } - get files() { - return this._files; - } - set directories(num) { - this._directories = num; - } - get directories() { - return this._directories; - } - /** - * @deprecated use `directories` instead - */ - /* c8 ignore next 3 */ - get dirs() { - return this._directories; - } -}; - -//#endregion -//#region src/api/aborter.ts -/** -* AbortController is not supported on Node 14 so we use this until we can drop -* support for Node 14. -*/ -var Aborter = class { - aborted = false; - abort() { - this.aborted = true; - } -}; - -//#endregion -//#region src/api/walker.ts -var Walker = class { - root; - isSynchronous; - state; - joinPath; - pushDirectory; - pushFile; - getArray; - groupFiles; - resolveSymlink; - walkDirectory; - callbackInvoker; - constructor(root, options, callback$1) { - this.isSynchronous = !callback$1; - this.callbackInvoker = build$1(options, this.isSynchronous); - this.root = normalizePath(root, options); - this.state = { - root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1), - paths: [""].slice(0, 0), - groups: [], - counts: new Counter(), - options, - queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)), - symlinks: /* @__PURE__ */ new Map(), - visited: [""].slice(0, 0), - controller: new Aborter(), - fs: options.fs || nativeFs - }; - this.joinPath = build$7(this.root, options); - this.pushDirectory = build$6(this.root, options); - this.pushFile = build$5(options); - this.getArray = build$4(options); - this.groupFiles = build$3(options); - this.resolveSymlink = build$2(options, this.isSynchronous); - this.walkDirectory = build(this.isSynchronous); - } - start() { - this.pushDirectory(this.root, this.state.paths, this.state.options.filters); - this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk); - return this.isSynchronous ? this.callbackInvoker(this.state, null) : null; - } - walk = (entries, directoryPath, depth) => { - const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state; - if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return; - const files = this.getArray(this.state.paths); - for (let i = 0; i < entries.length; ++i) { - const entry = entries[i]; - if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) { - const filename = this.joinPath(entry.name, directoryPath); - this.pushFile(filename, files, this.state.counts, filters); - } else if (entry.isDirectory()) { - let path = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator); - if (exclude && exclude(entry.name, path)) continue; - this.pushDirectory(path, paths, filters); - this.walkDirectory(this.state, path, path, depth - 1, this.walk); - } else if (this.resolveSymlink && entry.isSymbolicLink()) { - let path = joinPathWithBasePath(entry.name, directoryPath); - this.resolveSymlink(path, this.state, (stat, resolvedPath) => { - if (stat.isDirectory()) { - resolvedPath = normalizePath(resolvedPath, this.state.options); - if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return; - this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk); - } else { - resolvedPath = useRealPaths ? resolvedPath : path; - const filename = basename(resolvedPath); - const directoryPath$1 = normalizePath(dirname(resolvedPath), this.state.options); - resolvedPath = this.joinPath(filename, directoryPath$1); - this.pushFile(resolvedPath, files, this.state.counts, filters); - } - }); - } - } - this.groupFiles(this.state.groups, directoryPath, files); - }; -}; - -//#endregion -//#region src/api/async.ts -function promise(root, options) { - return new Promise((resolve$1, reject) => { - callback(root, options, (err, output) => { - if (err) return reject(err); - resolve$1(output); - }); - }); -} -function callback(root, options, callback$1) { - let walker = new Walker(root, options, callback$1); - walker.start(); -} - -//#endregion -//#region src/api/sync.ts -function sync(root, options) { - const walker = new Walker(root, options); - return walker.start(); -} - -//#endregion -//#region src/builder/api-builder.ts -var APIBuilder = class { - constructor(root, options) { - this.root = root; - this.options = options; - } - withPromise() { - return promise(this.root, this.options); - } - withCallback(cb) { - callback(this.root, this.options, cb); - } - sync() { - return sync(this.root, this.options); - } -}; - -//#endregion -//#region src/builder/index.ts -let pm = null; -/* c8 ignore next 6 */ -try { - __require.resolve("picomatch"); - pm = __require("picomatch"); -} catch {} -var Builder = class { - globCache = {}; - options = { - maxDepth: Infinity, - suppressErrors: true, - pathSeparator: sep, - filters: [] - }; - globFunction; - constructor(options) { - this.options = { - ...this.options, - ...options - }; - this.globFunction = this.options.globFunction; - } - group() { - this.options.group = true; - return this; - } - withPathSeparator(separator) { - this.options.pathSeparator = separator; - return this; - } - withBasePath() { - this.options.includeBasePath = true; - return this; - } - withRelativePaths() { - this.options.relativePaths = true; - return this; - } - withDirs() { - this.options.includeDirs = true; - return this; - } - withMaxDepth(depth) { - this.options.maxDepth = depth; - return this; - } - withMaxFiles(limit) { - this.options.maxFiles = limit; - return this; - } - withFullPaths() { - this.options.resolvePaths = true; - this.options.includeBasePath = true; - return this; - } - withErrors() { - this.options.suppressErrors = false; - return this; - } - withSymlinks({ resolvePaths = true } = {}) { - this.options.resolveSymlinks = true; - this.options.useRealPaths = resolvePaths; - return this.withFullPaths(); - } - withAbortSignal(signal) { - this.options.signal = signal; - return this; - } - normalize() { - this.options.normalizePath = true; - return this; - } - filter(predicate) { - this.options.filters.push(predicate); - return this; - } - onlyDirs() { - this.options.excludeFiles = true; - this.options.includeDirs = true; - return this; - } - exclude(predicate) { - this.options.exclude = predicate; - return this; - } - onlyCounts() { - this.options.onlyCounts = true; - return this; - } - crawl(root) { - return new APIBuilder(root || ".", this.options); - } - withGlobFunction(fn) { - this.globFunction = fn; - return this; - } - /** - * @deprecated Pass options using the constructor instead: - * ```ts - * new fdir(options).crawl("/path/to/root"); - * ``` - * This method will be removed in v7.0 - */ - /* c8 ignore next 4 */ - crawlWithOptions(root, options) { - this.options = { - ...this.options, - ...options - }; - return new APIBuilder(root || ".", this.options); - } - glob(...patterns) { - if (this.globFunction) return this.globWithOptions(patterns); - return this.globWithOptions(patterns, ...[{ dot: true }]); - } - globWithOptions(patterns, ...options) { - const globFn = this.globFunction || pm; - /* c8 ignore next 5 */ - if (!globFn) throw new Error("Please specify a glob function to use glob matching."); - var isMatch = this.globCache[patterns.join("\0")]; - if (!isMatch) { - isMatch = globFn(patterns, ...options); - this.globCache[patterns.join("\0")] = isMatch; - } - this.options.filters.push((path) => isMatch(path)); - return this; - } -}; - -//#endregion -export { Builder as fdir }; \ No newline at end of file diff --git a/frontend/node_modules/fdir/package.json b/frontend/node_modules/fdir/package.json deleted file mode 100644 index e229dff..0000000 --- a/frontend/node_modules/fdir/package.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "name": "fdir", - "version": "6.5.0", - "description": "The fastest directory crawler & globbing alternative to glob, fast-glob, & tiny-glob. Crawls 1m files in < 1s", - "main": "./dist/index.cjs", - "types": "./dist/index.d.cts", - "type": "module", - "scripts": { - "prepublishOnly": "npm run test && npm run build", - "build": "tsdown", - "format": "prettier --write src __tests__ benchmarks", - "test": "vitest run __tests__/", - "test:coverage": "vitest run --coverage __tests__/", - "test:watch": "vitest __tests__/", - "bench": "ts-node benchmarks/benchmark.js", - "bench:glob": "ts-node benchmarks/glob-benchmark.ts", - "bench:fdir": "ts-node benchmarks/fdir-benchmark.ts", - "release": "./scripts/release.sh" - }, - "engines": { - "node": ">=12.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/thecodrr/fdir.git" - }, - "keywords": [ - "util", - "os", - "sys", - "fs", - "walk", - "crawler", - "directory", - "files", - "io", - "tiny-glob", - "glob", - "fast-glob", - "speed", - "javascript", - "nodejs" - ], - "author": "thecodrr ", - "license": "MIT", - "bugs": { - "url": "https://github.com/thecodrr/fdir/issues" - }, - "homepage": "https://github.com/thecodrr/fdir#readme", - "devDependencies": { - "@types/glob": "^8.1.0", - "@types/mock-fs": "^4.13.4", - "@types/node": "^20.9.4", - "@types/picomatch": "^4.0.0", - "@types/tap": "^15.0.11", - "@vitest/coverage-v8": "^0.34.6", - "all-files-in-tree": "^1.1.2", - "benny": "^3.7.1", - "csv-to-markdown-table": "^1.3.1", - "expect": "^29.7.0", - "fast-glob": "^3.3.2", - "fdir1": "npm:fdir@1.2.0", - "fdir2": "npm:fdir@2.1.0", - "fdir3": "npm:fdir@3.4.2", - "fdir4": "npm:fdir@4.1.0", - "fdir5": "npm:fdir@5.0.0", - "fs-readdir-recursive": "^1.1.0", - "get-all-files": "^4.1.0", - "glob": "^10.3.10", - "klaw-sync": "^6.0.0", - "mock-fs": "^5.2.0", - "picomatch": "^4.0.2", - "prettier": "^3.5.3", - "recur-readdir": "0.0.1", - "recursive-files": "^1.0.2", - "recursive-fs": "^2.1.0", - "recursive-readdir": "^2.2.3", - "rrdir": "^12.1.0", - "systeminformation": "^5.21.17", - "tiny-glob": "^0.2.9", - "ts-node": "^10.9.1", - "tsdown": "^0.12.5", - "typescript": "^5.3.2", - "vitest": "^0.34.6", - "walk-sync": "^3.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - }, - "module": "./dist/index.mjs", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.cjs" - }, - "./package.json": "./package.json" - } -} diff --git a/frontend/node_modules/is-reference/README.md b/frontend/node_modules/is-reference/README.md deleted file mode 100644 index a697c5b..0000000 --- a/frontend/node_modules/is-reference/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# is-reference - -Utility for determining whether an AST node is a reference. - -`foo` is a reference in these cases: - -```js -console.log(foo); -var foo; -function foo() {} -function bar(foo) {} -export { foo as x }; -``` - -`foo` is *not* a reference in these cases: - -```js -var obj = { foo: 1 }; -console.log(obj.foo); -export { x as foo }; -``` - -In all cases, `foo` is an `Identifier` node, but the two kinds must be treated differently for the purposes of scope analysis etc. (The examples are non-exhaustive.) - - -## Installation - -```bash -npm install is-reference -``` - - -## Usage - -Example using [Acorn](https://github.com/ternjs/acorn) and [estree-walker](https://github.com/Rich-Harris/estree-walker): - -```js -import { parse } from 'acorn'; -import { walk } from 'estree-walker'; -import is_reference from 'is-reference'; - -const identifiers = []; -const references = []; - -const ast = parse(`var a = b.c;`); - -walk(ast, { - enter(node, parent) { - if (node.type === 'Identifier') identifiers.push(node); - if (is_reference(node, parent)) references.push(node); - } -}); - -identifiers.forEach(node => console.log(node.name)); // a, b, c -references.forEach(node => console.log(node.name)); // a, b -``` - - -## License - -MIT diff --git a/frontend/node_modules/is-reference/package.json b/frontend/node_modules/is-reference/package.json deleted file mode 100644 index a9425d9..0000000 --- a/frontend/node_modules/is-reference/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "is-reference", - "version": "3.0.3", - "description": "Determine whether an AST node is a reference", - "type": "module", - "module": "src/index.js", - "types": "types/index.d.ts", - "exports": { - "types": "./types/index.d.ts", - "import": "./src/index.js" - }, - "files": [ - "src", - "types" - ], - "scripts": { - "test": "uvu", - "prepublishOnly": "npm test && dts-buddy" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Rich-Harris/is-reference.git" - }, - "keywords": [ - "ast", - "javascript", - "estree", - "acorn" - ], - "author": "Rich Harris", - "license": "MIT", - "bugs": { - "url": "https://github.com/Rich-Harris/is-reference/issues" - }, - "homepage": "https://github.com/Rich-Harris/is-reference#readme", - "dependencies": { - "@types/estree": "^1.0.6" - }, - "devDependencies": { - "acorn": "^8.0.5", - "acorn-class-fields": "^1.0.0", - "acorn-static-class-features": "^1.0.0", - "dts-buddy": "^0.5.3", - "estree-walker": "^3.0.0", - "typescript": "^5.6.3", - "uvu": "^0.5.6" - } -} diff --git a/frontend/node_modules/is-reference/src/index.js b/frontend/node_modules/is-reference/src/index.js deleted file mode 100644 index 23f8714..0000000 --- a/frontend/node_modules/is-reference/src/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** @import { Node } from 'estree' */ - -/** - * @param {Node} node - * @param {Node} parent - * @returns {boolean} - */ -export default function is_reference(node, parent) { - if (node.type === 'MemberExpression') { - return !node.computed && is_reference(node.object, node); - } - - if (node.type !== 'Identifier') return false; - - switch (parent?.type) { - // disregard `bar` in `foo.bar` - case 'MemberExpression': - return parent.computed || node === parent.object; - - // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}` - case 'MethodDefinition': - return parent.computed; - - // disregard the `meta` in `import.meta` - case 'MetaProperty': - return parent.meta === node; - - // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}` - case 'PropertyDefinition': - return parent.computed || node === parent.value; - - // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }` - case 'Property': - return parent.computed || node === parent.value; - - // disregard the `bar` in `export { foo as bar }` or - // the foo in `import { foo as bar }` - case 'ExportSpecifier': - case 'ImportSpecifier': - return node === parent.local; - - // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}` - case 'LabeledStatement': - case 'BreakStatement': - case 'ContinueStatement': - return false; - - default: - return true; - } -} diff --git a/frontend/node_modules/is-reference/types/index.d.ts b/frontend/node_modules/is-reference/types/index.d.ts deleted file mode 100644 index 56f82d6..0000000 --- a/frontend/node_modules/is-reference/types/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module 'is-reference' { - import type { Node } from 'estree'; - export default function is_reference(node: Node, parent: Node): boolean; - - export {}; -} - -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/frontend/node_modules/is-reference/types/index.d.ts.map b/frontend/node_modules/is-reference/types/index.d.ts.map deleted file mode 100644 index 664a3f0..0000000 --- a/frontend/node_modules/is-reference/types/index.d.ts.map +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 3, - "file": "index.d.ts", - "names": [], - "sources": [], - "sourcesContent": [], - "mappings": "", - "ignoreList": [] -} \ No newline at end of file diff --git a/frontend/node_modules/kleur/colors.d.ts b/frontend/node_modules/kleur/colors.d.ts deleted file mode 100644 index cab25c6..0000000 --- a/frontend/node_modules/kleur/colors.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -declare function print(input: string | boolean | number): string; -declare function print(input: undefined | void): undefined; -declare function print(input: null): null; -type Colorize = typeof print; - -export declare const $: { enabled: boolean }; - -// Colors -export declare const black: Colorize; -export declare const red: Colorize; -export declare const green: Colorize; -export declare const yellow: Colorize; -export declare const blue: Colorize; -export declare const magenta: Colorize; -export declare const cyan: Colorize; -export declare const white: Colorize; -export declare const gray: Colorize; -export declare const grey: Colorize; - -// Backgrounds -export declare const bgBlack: Colorize; -export declare const bgRed: Colorize; -export declare const bgGreen: Colorize; -export declare const bgYellow: Colorize; -export declare const bgBlue: Colorize; -export declare const bgMagenta: Colorize; -export declare const bgCyan: Colorize; -export declare const bgWhite: Colorize; - -// Modifiers -export declare const reset: Colorize; -export declare const bold: Colorize; -export declare const dim: Colorize; -export declare const italic: Colorize; -export declare const underline: Colorize; -export declare const inverse: Colorize; -export declare const hidden: Colorize; -export declare const strikethrough: Colorize; diff --git a/frontend/node_modules/kleur/colors.js b/frontend/node_modules/kleur/colors.js deleted file mode 100644 index 89fb012..0000000 --- a/frontend/node_modules/kleur/colors.js +++ /dev/null @@ -1,53 +0,0 @@ -let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; -if (typeof process !== 'undefined') { - ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); - isTTY = process.stdout && process.stdout.isTTY; -} - -const $ = exports.$ = { - enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && ( - FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY - ) -} - -function init(x, y) { - let rgx = new RegExp(`\\x1b\\[${y}m`, 'g'); - let open = `\x1b[${x}m`, close = `\x1b[${y}m`; - - return function (txt) { - if (!$.enabled || txt == null) return txt; - return open + (!!~(''+txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close; - }; -} - -// modifiers -exports.reset = init(0, 0); -exports.bold = init(1, 22); -exports.dim = init(2, 22); -exports.italic = init(3, 23); -exports.underline = init(4, 24); -exports.inverse = init(7, 27); -exports.hidden = init(8, 28); -exports.strikethrough = init(9, 29); - -// colors -exports.black = init(30, 39); -exports.red = init(31, 39); -exports.green = init(32, 39); -exports.yellow = init(33, 39); -exports.blue = init(34, 39); -exports.magenta = init(35, 39); -exports.cyan = init(36, 39); -exports.white = init(37, 39); -exports.gray = init(90, 39); -exports.grey = init(90, 39); - -// background colors -exports.bgBlack = init(40, 49); -exports.bgRed = init(41, 49); -exports.bgGreen = init(42, 49); -exports.bgYellow = init(43, 49); -exports.bgBlue = init(44, 49); -exports.bgMagenta = init(45, 49); -exports.bgCyan = init(46, 49); -exports.bgWhite = init(47, 49); diff --git a/frontend/node_modules/kleur/colors.mjs b/frontend/node_modules/kleur/colors.mjs deleted file mode 100644 index e9feb83..0000000 --- a/frontend/node_modules/kleur/colors.mjs +++ /dev/null @@ -1,53 +0,0 @@ -let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; -if (typeof process !== 'undefined') { - ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); - isTTY = process.stdout && process.stdout.isTTY; -} - -export const $ = { - enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && ( - FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY - ) -} - -function init(x, y) { - let rgx = new RegExp(`\\x1b\\[${y}m`, 'g'); - let open = `\x1b[${x}m`, close = `\x1b[${y}m`; - - return function (txt) { - if (!$.enabled || txt == null) return txt; - return open + (!!~(''+txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close; - }; -} - -// modifiers -export const reset = init(0, 0); -export const bold = init(1, 22); -export const dim = init(2, 22); -export const italic = init(3, 23); -export const underline = init(4, 24); -export const inverse = init(7, 27); -export const hidden = init(8, 28); -export const strikethrough = init(9, 29); - -// colors -export const black = init(30, 39); -export const red = init(31, 39); -export const green = init(32, 39); -export const yellow = init(33, 39); -export const blue = init(34, 39); -export const magenta = init(35, 39); -export const cyan = init(36, 39); -export const white = init(37, 39); -export const gray = init(90, 39); -export const grey = init(90, 39); - -// background colors -export const bgBlack = init(40, 49); -export const bgRed = init(41, 49); -export const bgGreen = init(42, 49); -export const bgYellow = init(43, 49); -export const bgBlue = init(44, 49); -export const bgMagenta = init(45, 49); -export const bgCyan = init(46, 49); -export const bgWhite = init(47, 49); diff --git a/frontend/node_modules/kleur/index.d.ts b/frontend/node_modules/kleur/index.d.ts deleted file mode 100644 index fdc26ca..0000000 --- a/frontend/node_modules/kleur/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Originally by: Rogier Schouten -// Adapted by: Madhav Varshney -declare namespace kleur { - interface Color { - (x: string | number): string; - (): Kleur; - } - - interface Kleur { - // Colors - black: Color; - red: Color; - green: Color; - yellow: Color; - blue: Color; - magenta: Color; - cyan: Color; - white: Color; - gray: Color; - grey: Color; - - // Backgrounds - bgBlack: Color; - bgRed: Color; - bgGreen: Color; - bgYellow: Color; - bgBlue: Color; - bgMagenta: Color; - bgCyan: Color; - bgWhite: Color; - - // Modifiers - reset: Color; - bold: Color; - dim: Color; - italic: Color; - underline: Color; - inverse: Color; - hidden: Color; - strikethrough: Color; - } -} - -declare let kleur: kleur.Kleur & { enabled: boolean }; -export = kleur; diff --git a/frontend/node_modules/kleur/index.js b/frontend/node_modules/kleur/index.js deleted file mode 100644 index 5800b98..0000000 --- a/frontend/node_modules/kleur/index.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; - -let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; -if (typeof process !== 'undefined') { - ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); - isTTY = process.stdout && process.stdout.isTTY; -} - -const $ = { - enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && ( - FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY - ), - - // modifiers - reset: init(0, 0), - bold: init(1, 22), - dim: init(2, 22), - italic: init(3, 23), - underline: init(4, 24), - inverse: init(7, 27), - hidden: init(8, 28), - strikethrough: init(9, 29), - - // colors - black: init(30, 39), - red: init(31, 39), - green: init(32, 39), - yellow: init(33, 39), - blue: init(34, 39), - magenta: init(35, 39), - cyan: init(36, 39), - white: init(37, 39), - gray: init(90, 39), - grey: init(90, 39), - - // background colors - bgBlack: init(40, 49), - bgRed: init(41, 49), - bgGreen: init(42, 49), - bgYellow: init(43, 49), - bgBlue: init(44, 49), - bgMagenta: init(45, 49), - bgCyan: init(46, 49), - bgWhite: init(47, 49) -}; - -function run(arr, str) { - let i=0, tmp, beg='', end=''; - for (; i < arr.length; i++) { - tmp = arr[i]; - beg += tmp.open; - end += tmp.close; - if (!!~str.indexOf(tmp.close)) { - str = str.replace(tmp.rgx, tmp.close + tmp.open); - } - } - return beg + str + end; -} - -function chain(has, keys) { - let ctx = { has, keys }; - - ctx.reset = $.reset.bind(ctx); - ctx.bold = $.bold.bind(ctx); - ctx.dim = $.dim.bind(ctx); - ctx.italic = $.italic.bind(ctx); - ctx.underline = $.underline.bind(ctx); - ctx.inverse = $.inverse.bind(ctx); - ctx.hidden = $.hidden.bind(ctx); - ctx.strikethrough = $.strikethrough.bind(ctx); - - ctx.black = $.black.bind(ctx); - ctx.red = $.red.bind(ctx); - ctx.green = $.green.bind(ctx); - ctx.yellow = $.yellow.bind(ctx); - ctx.blue = $.blue.bind(ctx); - ctx.magenta = $.magenta.bind(ctx); - ctx.cyan = $.cyan.bind(ctx); - ctx.white = $.white.bind(ctx); - ctx.gray = $.gray.bind(ctx); - ctx.grey = $.grey.bind(ctx); - - ctx.bgBlack = $.bgBlack.bind(ctx); - ctx.bgRed = $.bgRed.bind(ctx); - ctx.bgGreen = $.bgGreen.bind(ctx); - ctx.bgYellow = $.bgYellow.bind(ctx); - ctx.bgBlue = $.bgBlue.bind(ctx); - ctx.bgMagenta = $.bgMagenta.bind(ctx); - ctx.bgCyan = $.bgCyan.bind(ctx); - ctx.bgWhite = $.bgWhite.bind(ctx); - - return ctx; -} - -function init(open, close) { - let blk = { - open: `\x1b[${open}m`, - close: `\x1b[${close}m`, - rgx: new RegExp(`\\x1b\\[${close}m`, 'g') - }; - return function (txt) { - if (this !== void 0 && this.has !== void 0) { - !!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk)); - return txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+''; - } - return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+''; - }; -} - -module.exports = $; diff --git a/frontend/node_modules/kleur/index.mjs b/frontend/node_modules/kleur/index.mjs deleted file mode 100644 index 96dadad..0000000 --- a/frontend/node_modules/kleur/index.mjs +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; - -let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; -if (typeof process !== 'undefined') { - ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); - isTTY = process.stdout && process.stdout.isTTY; -} - -const $ = { - enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && ( - FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY - ), - - // modifiers - reset: init(0, 0), - bold: init(1, 22), - dim: init(2, 22), - italic: init(3, 23), - underline: init(4, 24), - inverse: init(7, 27), - hidden: init(8, 28), - strikethrough: init(9, 29), - - // colors - black: init(30, 39), - red: init(31, 39), - green: init(32, 39), - yellow: init(33, 39), - blue: init(34, 39), - magenta: init(35, 39), - cyan: init(36, 39), - white: init(37, 39), - gray: init(90, 39), - grey: init(90, 39), - - // background colors - bgBlack: init(40, 49), - bgRed: init(41, 49), - bgGreen: init(42, 49), - bgYellow: init(43, 49), - bgBlue: init(44, 49), - bgMagenta: init(45, 49), - bgCyan: init(46, 49), - bgWhite: init(47, 49) -}; - -function run(arr, str) { - let i=0, tmp, beg='', end=''; - for (; i < arr.length; i++) { - tmp = arr[i]; - beg += tmp.open; - end += tmp.close; - if (!!~str.indexOf(tmp.close)) { - str = str.replace(tmp.rgx, tmp.close + tmp.open); - } - } - return beg + str + end; -} - -function chain(has, keys) { - let ctx = { has, keys }; - - ctx.reset = $.reset.bind(ctx); - ctx.bold = $.bold.bind(ctx); - ctx.dim = $.dim.bind(ctx); - ctx.italic = $.italic.bind(ctx); - ctx.underline = $.underline.bind(ctx); - ctx.inverse = $.inverse.bind(ctx); - ctx.hidden = $.hidden.bind(ctx); - ctx.strikethrough = $.strikethrough.bind(ctx); - - ctx.black = $.black.bind(ctx); - ctx.red = $.red.bind(ctx); - ctx.green = $.green.bind(ctx); - ctx.yellow = $.yellow.bind(ctx); - ctx.blue = $.blue.bind(ctx); - ctx.magenta = $.magenta.bind(ctx); - ctx.cyan = $.cyan.bind(ctx); - ctx.white = $.white.bind(ctx); - ctx.gray = $.gray.bind(ctx); - ctx.grey = $.grey.bind(ctx); - - ctx.bgBlack = $.bgBlack.bind(ctx); - ctx.bgRed = $.bgRed.bind(ctx); - ctx.bgGreen = $.bgGreen.bind(ctx); - ctx.bgYellow = $.bgYellow.bind(ctx); - ctx.bgBlue = $.bgBlue.bind(ctx); - ctx.bgMagenta = $.bgMagenta.bind(ctx); - ctx.bgCyan = $.bgCyan.bind(ctx); - ctx.bgWhite = $.bgWhite.bind(ctx); - - return ctx; -} - -function init(open, close) { - let blk = { - open: `\x1b[${open}m`, - close: `\x1b[${close}m`, - rgx: new RegExp(`\\x1b\\[${close}m`, 'g') - }; - return function (txt) { - if (this !== void 0 && this.has !== void 0) { - !!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk)); - return txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+''; - } - return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+''; - }; -} - -export default $; diff --git a/frontend/node_modules/kleur/license b/frontend/node_modules/kleur/license deleted file mode 100644 index a3f96f8..0000000 --- a/frontend/node_modules/kleur/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Luke Edwards (lukeed.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/frontend/node_modules/kleur/package.json b/frontend/node_modules/kleur/package.json deleted file mode 100644 index 5007c05..0000000 --- a/frontend/node_modules/kleur/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "kleur", - "version": "4.1.5", - "repository": "lukeed/kleur", - "description": "The fastest Node.js library for formatting terminal text with ANSI colors~!", - "module": "index.mjs", - "types": "index.d.ts", - "main": "index.js", - "license": "MIT", - "exports": { - ".": { - "types": "./index.d.ts", - "import": "./index.mjs", - "require": "./index.js" - }, - "./colors": { - "types": "./colors.d.ts", - "import": "./colors.mjs", - "require": "./colors.js" - } - }, - "files": [ - "*.d.ts", - "colors.*", - "index.*" - ], - "author": { - "name": "Luke Edwards", - "email": "luke.edwards05@gmail.com", - "url": "https://lukeed.com" - }, - "scripts": { - "build": "node build", - "test": "uvu -r esm -i utils -i xyz" - }, - "engines": { - "node": ">=6" - }, - "keywords": [ - "ansi", - "cli", - "color", - "colors", - "console", - "terminal" - ], - "devDependencies": { - "esm": "3.2.25", - "uvu": "0.3.3" - } -} diff --git a/frontend/node_modules/kleur/readme.md b/frontend/node_modules/kleur/readme.md deleted file mode 100644 index de7f5aa..0000000 --- a/frontend/node_modules/kleur/readme.md +++ /dev/null @@ -1,232 +0,0 @@ -
- kleur -
- - - -
The fastest Node.js library for formatting terminal text with ANSI colors~!
- -## Features - -* No dependencies -* Super [lightweight](#load-time) & [performant](#performance) -* Supports [nested](#nested-methods) & [chained](#chained-methods) colors -* No `String.prototype` modifications -* Conditional [color support](#conditional-support) -* [Fully treeshakable](#individual-colors) -* Familiar [API](#api) - ---- - -As of `v3.0` the Chalk-style syntax (magical getter) is no longer used.
Please visit [History](#history) for migration paths supporting that syntax. - ---- - - -## Install - -``` -$ npm install --save kleur -``` - - -## Usage - -```js -import kleur from 'kleur'; - -// basic usage -kleur.red('red text'); - -// chained methods -kleur.blue().bold().underline('howdy partner'); - -// nested methods -kleur.bold(`${ white().bgRed('[ERROR]') } ${ kleur.red().italic('Something happened')}`); -``` - -### Chained Methods - -```js -const { bold, green } = require('kleur'); - -console.log(bold().red('this is a bold red message')); -console.log(bold().italic('this is a bold italicized message')); -console.log(bold().yellow().bgRed().italic('this is a bold yellow italicized message')); -console.log(green().bold().underline('this is a bold green underlined message')); -``` - - - -### Nested Methods - -```js -const { yellow, red, cyan } = require('kleur'); - -console.log(yellow(`foo ${red().bold('red')} bar ${cyan('cyan')} baz`)); -console.log(yellow('foo ' + red().bold('red') + ' bar ' + cyan('cyan') + ' baz')); -``` - - - - -### Conditional Support - -Toggle color support as needed; `kleur` includes simple auto-detection which may not cover all cases. - -> **Note:** Both `kleur` and `kleur/colors` share the same detection logic. - -```js -import kleur from 'kleur'; - -// manually disable -kleur.enabled = false; - -// or use another library to detect support -kleur.enabled = require('color-support').level > 0; - -console.log(kleur.red('I will only be colored red if the terminal supports colors')); -``` - -> **Important:**
Colors will be disabled automatically in non [TTY contexts](https://nodejs.org/api/process.html#process_a_note_on_process_i_o). For example, spawning another process or piping output into another process will disable colorization automatically. To force colors in your piped output, you may do so with the `FORCE_COLOR=1` environment variable: - -```sh -$ node app.js #=> COLORS -$ node app.js > log.txt #=> NO COLORS -$ FORCE_COLOR=1 node app.js > log.txt #=> COLORS -$ FORCE_COLOR=0 node app.js > log.txt #=> NO COLORS -``` - -## API - -Any `kleur` method returns a `String` when invoked with input; otherwise chaining is expected. - -> It's up to the developer to pass the output to destinations like `console.log`, `process.stdout.write`, etc. - -The methods below are grouped by type for legibility purposes only. They each can be [chained](#chained-methods) or [nested](#nested-methods) with one another. - -***Colors:*** -> black — red — green — yellow — blue — magenta — cyan — white — gray — grey - -***Backgrounds:*** -> bgBlack — bgRed — bgGreen — bgYellow — bgBlue — bgMagenta — bgCyan — bgWhite - -***Modifiers:*** -> reset — bold — dim — italic* — underline — inverse — hidden — strikethrough* - -* Not widely supported - - -## Individual Colors - -When you only need a few colors, it doesn't make sense to import _all_ of `kleur` because, as small as it is, `kleur` is not treeshakeable, and so most of its code will be doing nothing. In order to fix this, you can import from the `kleur/colors` submodule which _fully_ supports tree-shaking. - -The caveat with this approach is that color functions **are not** chainable~!
Each function receives and colorizes its input. You may combine colors, backgrounds, and modifiers by nesting function calls within other functions. - -```js -// or: import * as kleur from 'kleur/colors'; -import { red, underline, bgWhite } from 'kleur/colors'; - -red('red text'); -//~> kleur.red('red text'); - -underline(red('red underlined text')); -//~> kleur.underline().red('red underlined text'); - -bgWhite(underline(red('red underlined text w/ white background'))); -//~> kleur.bgWhite().underline().red('red underlined text w/ white background'); -``` - -> **Note:** All the same [colors, backgrounds, and modifiers](#api) are available. - -***Conditional Support*** - -The `kleur/colors` submodule also allows you to toggle color support, as needed.
-It includes the same initial assumptions as `kleur`, in an attempt to have colors enabled by default. - -Unlike `kleur`, this setting exists as `kleur.$.enabled` instead of `kleur.enabled`: - -```js -import * as kleur from 'kleur/colors'; -// or: import { $, red } from 'kleur/colors'; - -// manually disabled -kleur.$.enabled = false; - -// or use another library to detect support -kleur.$.enabled = require('color-support').level > 0; - -console.log(red('I will only be colored red if the terminal supports colors')); -``` - - -## Benchmarks - -> Using Node v10.13.0 - -### Load time - -``` -chalk :: 5.303ms -kleur :: 0.488ms -kleur/colors :: 0.369ms -ansi-colors :: 1.504ms -``` - -### Performance - -``` -# All Colors - ansi-colors x 177,625 ops/sec ±1.47% (92 runs sampled) - chalk x 611,907 ops/sec ±0.20% (92 runs sampled) - kleur x 742,509 ops/sec ±1.47% (93 runs sampled) - kleur/colors x 881,742 ops/sec ±0.19% (98 runs sampled) - -# Stacked colors - ansi-colors x 23,331 ops/sec ±1.81% (94 runs sampled) - chalk x 337,178 ops/sec ±0.20% (98 runs sampled) - kleur x 78,299 ops/sec ±1.01% (97 runs sampled) - kleur/colors x 104,431 ops/sec ±0.22% (97 runs sampled) - -# Nested colors - ansi-colors x 67,181 ops/sec ±1.15% (92 runs sampled) - chalk x 116,361 ops/sec ±0.63% (94 runs sampled) - kleur x 139,514 ops/sec ±0.76% (95 runs sampled) - kleur/colors x 145,716 ops/sec ±0.97% (97 runs sampled) -``` - - -## History - -This project originally forked [`ansi-colors`](https://github.com/doowb/ansi-colors). - -Beginning with `kleur@3.0`, the Chalk-style syntax (magical getter) has been replaced with function calls per key: - -```js -// Old: -c.red.bold.underline('old'); - -// New: -c.red().bold().underline('new'); -``` -> As I work more with Rust, the newer syntax feels so much better & more natural! - -If you prefer the old syntax, you may migrate to `ansi-colors` or newer `chalk` releases.
Versions below `kleur@3.0` have been officially deprecated. - - -## License - -MIT © [Luke Edwards](https://lukeed.com) diff --git a/frontend/node_modules/lightningcss-linux-x64-gnu/LICENSE b/frontend/node_modules/lightningcss-linux-x64-gnu/LICENSE deleted file mode 100644 index 89fe5b2..0000000 --- a/frontend/node_modules/lightningcss-linux-x64-gnu/LICENSE +++ /dev/null @@ -1,373 +0,0 @@ - Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" -means each individual or legal entity that creates, contributes to -the creation of, or owns Covered Software. - -1.2. "Contributor Version" -means the combination of the Contributions of others (if any) used -by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" -means Covered Software of a particular Contributor. - -1.4. "Covered Software" -means Source Code Form to which the initial Contributor has attached -the notice in Exhibit A, the Executable Form of such Source Code -Form, and Modifications of such Source Code Form, in each case -including portions thereof. - -1.5. "Incompatible With Secondary Licenses" -means - -(a) that the initial Contributor has attached the notice described -in Exhibit B to the Covered Software; or - -(b) that the Covered Software was made available under the terms of -version 1.1 or earlier of the License, but not also under the -terms of a Secondary License. - -1.6. "Executable Form" -means any form of the work other than Source Code Form. - -1.7. "Larger Work" -means a work that combines Covered Software with other material, in -a separate file or files, that is not Covered Software. - -1.8. "License" -means this document. - -1.9. "Licensable" -means having the right to grant, to the maximum extent possible, -whether at the time of the initial grant or subsequently, any and -all of the rights conveyed by this License. - -1.10. "Modifications" -means any of the following: - -(a) any file in Source Code Form that results from an addition to, -deletion from, or modification of the contents of Covered -Software; or - -(b) any new file in Source Code Form that contains any Covered -Software. - -1.11. "Patent Claims" of a Contributor -means any patent claim(s), including without limitation, method, -process, and apparatus claims, in any patent Licensable by such -Contributor that would be infringed, but for the grant of the -License, by the making, using, selling, offering for sale, having -made, import, or transfer of either its Contributions or its -Contributor Version. - -1.12. "Secondary License" -means either the GNU General Public License, Version 2.0, the GNU -Lesser General Public License, Version 2.1, the GNU Affero General -Public License, Version 3.0, or any later versions of those -licenses. - -1.13. "Source Code Form" -means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") -means an individual or a legal entity exercising rights under this -License. For legal entities, "You" includes any entity that -controls, is controlled by, or is under common control with You. For -purposes of this definition, "control" means (a) the power, direct -or indirect, to cause the direction or management of such entity, -whether by contract or otherwise, or (b) ownership of more than -fifty percent (50%) of the outstanding shares or beneficial -ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) -Licensable by such Contributor to use, reproduce, make available, -modify, display, perform, distribute, and otherwise exploit its -Contributions, either on an unmodified basis, with Modifications, or -as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer -for sale, have made, import, and otherwise transfer either its -Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; -or - -(b) for infringements caused by: (i) Your and any other third party's -modifications of Covered Software, or (ii) the combination of its -Contributions with other software (except as part of its Contributor -Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of -its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code -Form, as described in Section 3.1, and You must inform recipients of -the Executable Form how they can obtain a copy of such Source Code -Form by reasonable means in a timely manner, at a charge no more -than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this -License, or sublicense it under different terms, provided that the -license for the Executable Form does not attempt to limit or alter -the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - -This Source Code Form is subject to the terms of the Mozilla Public -License, v. 2.0. If a copy of the MPL was not distributed with this -file, You can obtain one at https://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - -This Source Code Form is "Incompatible With Secondary Licenses", as -defined by the Mozilla Public License, v. 2.0. diff --git a/frontend/node_modules/lightningcss-linux-x64-gnu/README.md b/frontend/node_modules/lightningcss-linux-x64-gnu/README.md deleted file mode 100644 index 84f87d3..0000000 --- a/frontend/node_modules/lightningcss-linux-x64-gnu/README.md +++ /dev/null @@ -1 +0,0 @@ -This is the x86_64-unknown-linux-gnu build of lightningcss. See https://github.com/parcel-bundler/lightningcss for details. \ No newline at end of file diff --git a/frontend/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node b/frontend/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node deleted file mode 100644 index fc7c4fb..0000000 Binary files a/frontend/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node and /dev/null differ diff --git a/frontend/node_modules/lightningcss-linux-x64-gnu/package.json b/frontend/node_modules/lightningcss-linux-x64-gnu/package.json deleted file mode 100644 index c356698..0000000 --- a/frontend/node_modules/lightningcss-linux-x64-gnu/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "lightningcss-linux-x64-gnu", - "version": "1.32.0", - "license": "MPL-2.0", - "description": "A CSS parser, transformer, and minifier written in Rust", - "main": "lightningcss.linux-x64-gnu.node", - "browserslist": "last 2 versions, not dead", - "publishConfig": { - "access": "public" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "repository": { - "type": "git", - "url": "https://github.com/parcel-bundler/lightningcss.git" - }, - "engines": { - "node": ">= 12.0.0" - }, - "files": [ - "lightningcss.linux-x64-gnu.node" - ], - "resolutions": { - "lightningcss": "link:." - }, - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], - "libc": [ - "glibc" - ] -} diff --git a/frontend/node_modules/lightningcss/LICENSE b/frontend/node_modules/lightningcss/LICENSE deleted file mode 100644 index 89fe5b2..0000000 --- a/frontend/node_modules/lightningcss/LICENSE +++ /dev/null @@ -1,373 +0,0 @@ - Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" -means each individual or legal entity that creates, contributes to -the creation of, or owns Covered Software. - -1.2. "Contributor Version" -means the combination of the Contributions of others (if any) used -by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" -means Covered Software of a particular Contributor. - -1.4. "Covered Software" -means Source Code Form to which the initial Contributor has attached -the notice in Exhibit A, the Executable Form of such Source Code -Form, and Modifications of such Source Code Form, in each case -including portions thereof. - -1.5. "Incompatible With Secondary Licenses" -means - -(a) that the initial Contributor has attached the notice described -in Exhibit B to the Covered Software; or - -(b) that the Covered Software was made available under the terms of -version 1.1 or earlier of the License, but not also under the -terms of a Secondary License. - -1.6. "Executable Form" -means any form of the work other than Source Code Form. - -1.7. "Larger Work" -means a work that combines Covered Software with other material, in -a separate file or files, that is not Covered Software. - -1.8. "License" -means this document. - -1.9. "Licensable" -means having the right to grant, to the maximum extent possible, -whether at the time of the initial grant or subsequently, any and -all of the rights conveyed by this License. - -1.10. "Modifications" -means any of the following: - -(a) any file in Source Code Form that results from an addition to, -deletion from, or modification of the contents of Covered -Software; or - -(b) any new file in Source Code Form that contains any Covered -Software. - -1.11. "Patent Claims" of a Contributor -means any patent claim(s), including without limitation, method, -process, and apparatus claims, in any patent Licensable by such -Contributor that would be infringed, but for the grant of the -License, by the making, using, selling, offering for sale, having -made, import, or transfer of either its Contributions or its -Contributor Version. - -1.12. "Secondary License" -means either the GNU General Public License, Version 2.0, the GNU -Lesser General Public License, Version 2.1, the GNU Affero General -Public License, Version 3.0, or any later versions of those -licenses. - -1.13. "Source Code Form" -means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") -means an individual or a legal entity exercising rights under this -License. For legal entities, "You" includes any entity that -controls, is controlled by, or is under common control with You. For -purposes of this definition, "control" means (a) the power, direct -or indirect, to cause the direction or management of such entity, -whether by contract or otherwise, or (b) ownership of more than -fifty percent (50%) of the outstanding shares or beneficial -ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) -Licensable by such Contributor to use, reproduce, make available, -modify, display, perform, distribute, and otherwise exploit its -Contributions, either on an unmodified basis, with Modifications, or -as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer -for sale, have made, import, and otherwise transfer either its -Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; -or - -(b) for infringements caused by: (i) Your and any other third party's -modifications of Covered Software, or (ii) the combination of its -Contributions with other software (except as part of its Contributor -Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of -its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code -Form, as described in Section 3.1, and You must inform recipients of -the Executable Form how they can obtain a copy of such Source Code -Form by reasonable means in a timely manner, at a charge no more -than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this -License, or sublicense it under different terms, provided that the -license for the Executable Form does not attempt to limit or alter -the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - -This Source Code Form is subject to the terms of the Mozilla Public -License, v. 2.0. If a copy of the MPL was not distributed with this -file, You can obtain one at https://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - -This Source Code Form is "Incompatible With Secondary Licenses", as -defined by the Mozilla Public License, v. 2.0. diff --git a/frontend/node_modules/lightningcss/README.md b/frontend/node_modules/lightningcss/README.md deleted file mode 100644 index f44d7b3..0000000 --- a/frontend/node_modules/lightningcss/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# ⚡️ Lightning CSS - -An extremely fast CSS parser, transformer, and minifier written in Rust. Use it with [Parcel](https://parceljs.org), as a standalone library or CLI, or via a plugin with any other tool. - -performance and build size charts -performance and build size charts - -## Features - -- **Extremely fast** – Parsing and minifying large files is completed in milliseconds, often with significantly smaller output than other tools. See [benchmarks](#benchmarks) below. -- **Typed property values** – many other CSS parsers treat property values as an untyped series of tokens. This means that each transformer that wants to do something with these values must interpret them itself, leading to duplicate work and inconsistencies. Lightning CSS parses all values using the grammar from the CSS specification, and exposes a specific value type for each property. -- **Browser-grade parser** – Lightning CSS is built on the [cssparser](https://github.com/servo/rust-cssparser) and [selectors](https://github.com/servo/stylo/tree/main/selectors) crates created by Mozilla and used by Firefox and Servo. These provide a solid general purpose CSS-parsing foundation on top of which Lightning CSS implements support for all specific CSS rules and properties. -- **Minification** – One of the main purposes of Lightning CSS is to minify CSS to make it smaller. This includes many optimizations including: - - Combining longhand properties into shorthands where possible. - - Merging adjacent rules with the same selectors or declarations when it is safe to do so. - - Combining CSS transforms into a single matrix or vice versa when smaller. - - Removing vendor prefixes that are not needed, based on the provided browser targets. - - Reducing `calc()` expressions where possible. - - Converting colors to shorter hex notation where possible. - - Minifying gradients. - - Minifying CSS grid templates. - - Normalizing property value order. - - Removing default property sub-values which will be inferred by browsers. - - Many micro-optimizations, e.g. converting to shorter units, removing unnecessary quotation marks, etc. -- **Vendor prefixing** – Lightning CSS accepts a list of browser targets, and automatically adds (and removes) vendor prefixes. -- **Browserslist configuration** – Lightning CSS supports opt-in browserslist configuration discovery to resolve browser targets and integrate with your existing tools and config setup. -- **Syntax lowering** – Lightning CSS parses modern CSS syntax, and generates more compatible output where needed, based on browser targets. - - CSS Nesting - - Custom media queries (draft spec) - - Logical properties - * [Color Level 5](https://drafts.csswg.org/css-color-5/) - - `color-mix()` function - - Relative color syntax, e.g. `lab(from purple calc(l * .8) a b)` - - [Color Level 4](https://drafts.csswg.org/css-color-4/) - - `lab()`, `lch()`, `oklab()`, and `oklch()` colors - - `color()` function supporting predefined color spaces such as `display-p3` and `xyz` - - Space separated components in `rgb` and `hsl` functions - - Hex with alpha syntax - - `hwb()` color syntax - - Percent syntax for opacity - - `#rgba` and `#rrggbbaa` hex colors - - Selectors - - `:not` with multiple arguments - - `:lang` with multiple arguments - - `:dir` - - `:is` - - Double position gradient stops (e.g. `red 40% 80%`) - - `clamp()`, `round()`, `rem()`, and `mod()` math functions - - Alignment shorthands (e.g. `place-items`) - - Two-value `overflow` shorthand - - Media query range syntax (e.g. `@media (width <= 100px)` or `@media (100px < width < 500px)`) - - Multi-value `display` property (e.g. `inline flex`) - - `system-ui` font family fallbacks -- **CSS modules** – Lightning CSS supports compiling a subset of [CSS modules](https://github.com/css-modules/css-modules) features. - - Locally scoped class and id selectors - - Locally scoped custom identifiers, e.g. `@keyframes` names, grid lines/areas, `@counter-style` names, etc. - - Opt-in support for locally scoped CSS variables and other dashed identifiers. - - `:local()` and `:global()` selectors - - The `composes` property -- **Custom transforms** – The Lightning CSS visitor API can be used to implement custom transform plugins. - -## Documentation - -Lightning CSS can be used from [Parcel](https://parceljs.org), as a standalone library from JavaScript or Rust, using a standalone CLI, or wrapped as a plugin within any other tool. See the [Lightning CSS website](https://lightningcss.dev/docs.html) for documentation. - -## Benchmarks - -performance and build size charts -performance and build size charts - -``` -$ node bench.js bootstrap-4.css -cssnano: 544.809ms -159636 bytes - -esbuild: 17.199ms -160332 bytes - -lightningcss: 4.16ms -143091 bytes - - -$ node bench.js animate.css -cssnano: 283.105ms -71723 bytes - -esbuild: 11.858ms -72183 bytes - -lightningcss: 1.973ms -23666 bytes - - -$ node bench.js tailwind.css -cssnano: 2.198s -1925626 bytes - -esbuild: 107.668ms -1961642 bytes - -lightningcss: 43.368ms -1824130 bytes -``` - -For more benchmarks comparing more tools and input, see [here](http://goalsmashers.github.io/css-minification-benchmark/). Note that some of the tools shown perform unsafe optimizations that may change the behavior of the original CSS in favor of smaller file size. Lightning CSS does not do this – the output CSS should always behave identically to the input. Keep this in mind when comparing file sizes between tools. diff --git a/frontend/node_modules/lightningcss/node/ast.d.ts b/frontend/node_modules/lightningcss/node/ast.d.ts deleted file mode 100644 index 28e9d09..0000000 --- a/frontend/node_modules/lightningcss/node/ast.d.ts +++ /dev/null @@ -1,9892 +0,0 @@ -/* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ - -export type String = string; -/** - * A CSS rule. - */ -export type Rule = | { - type: "media"; - value: MediaRule; - } -| { - type: "import"; - value: ImportRule; - } -| { - type: "style"; - value: StyleRule; - } -| { - type: "keyframes"; - value: KeyframesRule; - } -| { - type: "font-face"; - value: FontFaceRule; - } -| { - type: "font-palette-values"; - value: FontPaletteValuesRule; - } -| { - type: "font-feature-values"; - value: FontFeatureValuesRule; - } -| { - type: "page"; - value: PageRule; - } -| { - type: "supports"; - value: SupportsRule; - } -| { - type: "counter-style"; - value: CounterStyleRule; - } -| { - type: "namespace"; - value: NamespaceRule; - } -| { - type: "moz-document"; - value: MozDocumentRule; - } -| { - type: "nesting"; - value: NestingRule; - } -| { - type: "nested-declarations"; - value: NestedDeclarationsRule; - } -| { - type: "viewport"; - value: ViewportRule; - } -| { - type: "custom-media"; - value: CustomMediaRule; - } -| { - type: "layer-statement"; - value: LayerStatementRule; - } -| { - type: "layer-block"; - value: LayerBlockRule; - } -| { - type: "property"; - value: PropertyRule; - } -| { - type: "container"; - value: ContainerRule; - } -| { - type: "scope"; - value: ScopeRule; - } -| { - type: "starting-style"; - value: StartingStyleRule; - } -| { - type: "view-transition"; - value: ViewTransitionRule; - } -| { - type: "ignored"; - } -| { - type: "unknown"; - value: UnknownAtRule; - } -| { - type: "custom"; - value: DefaultAtRule; - }; -/** - * Represents a media condition. - */ -export type MediaCondition = - | { - type: "feature"; - value: QueryFeatureFor_MediaFeatureId; - } - | { - type: "not"; - value: MediaCondition; - } - | { - /** - * The conditions for the operator. - */ - conditions: MediaCondition[]; - /** - * The operator for the conditions. - */ - operator: Operator; - type: "operation"; - } - | { - type: "unknown"; - value: TokenOrValue[]; - }; -/** - * A generic media feature or container feature. - */ -export type QueryFeatureFor_MediaFeatureId = - | { - /** - * The name of the feature. - */ - name: MediaFeatureNameFor_MediaFeatureId; - type: "plain"; - /** - * The feature value. - */ - value: MediaFeatureValue; - } - | { - /** - * The name of the feature. - */ - name: MediaFeatureNameFor_MediaFeatureId; - type: "boolean"; - } - | { - /** - * The name of the feature. - */ - name: MediaFeatureNameFor_MediaFeatureId; - /** - * A comparator. - */ - operator: MediaFeatureComparison; - type: "range"; - /** - * The feature value. - */ - value: MediaFeatureValue; - } - | { - /** - * The end value. - */ - end: MediaFeatureValue; - /** - * A comparator for the end value. - */ - endOperator: MediaFeatureComparison; - /** - * The name of the feature. - */ - name: MediaFeatureNameFor_MediaFeatureId; - /** - * A start value. - */ - start: MediaFeatureValue; - /** - * A comparator for the start value. - */ - startOperator: MediaFeatureComparison; - type: "interval"; - }; -/** - * A media feature name. - */ -export type MediaFeatureNameFor_MediaFeatureId = MediaFeatureId | String | String; -/** - * A media query feature identifier. - */ -export type MediaFeatureId = - | "width" - | "height" - | "aspect-ratio" - | "orientation" - | "overflow-block" - | "overflow-inline" - | "horizontal-viewport-segments" - | "vertical-viewport-segments" - | "display-mode" - | "resolution" - | "scan" - | "grid" - | "update" - | "environment-blending" - | "color" - | "color-index" - | "monochrome" - | "color-gamut" - | "dynamic-range" - | "inverted-colors" - | "pointer" - | "hover" - | "any-pointer" - | "any-hover" - | "nav-controls" - | "video-color-gamut" - | "video-dynamic-range" - | "scripting" - | "prefers-reduced-motion" - | "prefers-reduced-transparency" - | "prefers-contrast" - | "forced-colors" - | "prefers-color-scheme" - | "prefers-reduced-data" - | "device-width" - | "device-height" - | "device-aspect-ratio" - | "-webkit-device-pixel-ratio" - | "-moz-device-pixel-ratio"; -/** - * [media feature value](https://drafts.csswg.org/mediaqueries/#typedef-mf-value) within a media query. - * - * See [MediaFeature](MediaFeature). - */ -export type MediaFeatureValue = - | { - type: "length"; - value: Length; - } - | { - type: "number"; - value: number; - } - | { - type: "integer"; - value: number; - } - | { - type: "boolean"; - value: boolean; - } - | { - type: "resolution"; - value: Resolution; - } - | { - type: "ratio"; - value: Ratio; - } - | { - type: "ident"; - value: String; - } - | { - type: "env"; - value: EnvironmentVariable; - }; -/** - * A CSS [``](https://www.w3.org/TR/css-values-4/#lengths) value, with support for `calc()`. - */ -export type Length = - | { - type: "value"; - value: LengthValue; - } - | { - type: "calc"; - value: CalcFor_Length; - }; -export type LengthUnit = - | "px" - | "in" - | "cm" - | "mm" - | "q" - | "pt" - | "pc" - | "em" - | "rem" - | "ex" - | "rex" - | "ch" - | "rch" - | "cap" - | "rcap" - | "ic" - | "ric" - | "lh" - | "rlh" - | "vw" - | "lvw" - | "svw" - | "dvw" - | "cqw" - | "vh" - | "lvh" - | "svh" - | "dvh" - | "cqh" - | "vi" - | "svi" - | "lvi" - | "dvi" - | "cqi" - | "vb" - | "svb" - | "lvb" - | "dvb" - | "cqb" - | "vmin" - | "svmin" - | "lvmin" - | "dvmin" - | "cqmin" - | "vmax" - | "svmax" - | "lvmax" - | "dvmax" - | "cqmax"; -/** - * A mathematical expression used within the [`calc()`](https://www.w3.org/TR/css-values-4/#calc-func) function. - * - * This type supports generic value types. Values such as [Length](super::length::Length), [Percentage](super::percentage::Percentage), [Time](super::time::Time), and [Angle](super::angle::Angle) support `calc()` expressions. - */ -export type CalcFor_Length = - | { - type: "value"; - value: Length; - } - | { - type: "number"; - value: number; - } - | { - type: "sum"; - /** - * @minItems 2 - * @maxItems 2 - */ - value: [CalcFor_Length, CalcFor_Length]; - } - | { - type: "product"; - /** - * @minItems 2 - * @maxItems 2 - */ - value: [number, CalcFor_Length]; - } - | { - type: "function"; - value: MathFunctionFor_Length; - }; -/** - * A CSS [math function](https://www.w3.org/TR/css-values-4/#math-function). - * - * Math functions may be used in most properties and values that accept numeric values, including lengths, percentages, angles, times, etc. - */ -export type MathFunctionFor_Length = - | { - type: "calc"; - value: CalcFor_Length; - } - | { - type: "min"; - value: CalcFor_Length[]; - } - | { - type: "max"; - value: CalcFor_Length[]; - } - | { - type: "clamp"; - /** - * @minItems 3 - * @maxItems 3 - */ - value: [CalcFor_Length, CalcFor_Length, CalcFor_Length]; - } - | { - type: "round"; - /** - * @minItems 3 - * @maxItems 3 - */ - value: [RoundingStrategy, CalcFor_Length, CalcFor_Length]; - } - | { - type: "rem"; - /** - * @minItems 2 - * @maxItems 2 - */ - value: [CalcFor_Length, CalcFor_Length]; - } - | { - type: "mod"; - /** - * @minItems 2 - * @maxItems 2 - */ - value: [CalcFor_Length, CalcFor_Length]; - } - | { - type: "abs"; - value: CalcFor_Length; - } - | { - type: "sign"; - value: CalcFor_Length; - } - | { - type: "hypot"; - value: CalcFor_Length[]; - }; -/** - * A [rounding strategy](https://www.w3.org/TR/css-values-4/#typedef-rounding-strategy), as used in the `round()` function. - */ -export type RoundingStrategy = "nearest" | "up" | "down" | "to-zero"; -/** - * A CSS [``](https://www.w3.org/TR/css-values-4/#resolution) value. - */ -export type Resolution = - | { - type: "dpi"; - value: number; - } - | { - type: "dpcm"; - value: number; - } - | { - type: "dppx"; - value: number; - }; -/** - * A CSS [``](https://www.w3.org/TR/css-values-4/#ratios) value, representing the ratio of two numeric values. - * - * @minItems 2 - * @maxItems 2 - */ -export type Ratio = [number, number]; -/** - * A raw CSS token, or a parsed value. - */ -export type TokenOrValue = - | { - type: "token"; - value: Token; - } - | { - type: "color"; - value: CssColor; - } - | { - type: "unresolved-color"; - value: UnresolvedColor; - } - | { - type: "url"; - value: Url; - } - | { - type: "var"; - value: Variable; - } - | { - type: "env"; - value: EnvironmentVariable; - } - | { - type: "function"; - value: Function; - } - | { - type: "length"; - value: LengthValue; - } - | { - type: "angle"; - value: Angle; - } - | { - type: "time"; - value: Time; - } - | { - type: "resolution"; - value: Resolution; - } - | { - type: "dashed-ident"; - value: String; - } - | { - type: "animation-name"; - value: AnimationName; - }; -/** - * A raw CSS token. - */ -export type Token = - | { - type: "ident"; - value: String; - } - | { - type: "at-keyword"; - value: String; - } - | { - type: "hash"; - value: String; - } - | { - type: "id-hash"; - value: String; - } - | { - type: "string"; - value: String; - } - | { - type: "unquoted-url"; - value: String; - } - | { - type: "delim"; - value: string; - } - | { - type: "number"; - /** - * The value as a float - */ - value: number; - } - | { - type: "percentage"; - /** - * The value as a float, divided by 100 so that the nominal range is 0.0 to 1.0. - */ - value: number; - } - | { - type: "dimension"; - /** - * The unit, e.g. "px" in `12px` - */ - unit: String; - /** - * The value as a float - */ - value: number; - } - | { - type: "white-space"; - value: String; - } - | { - type: "comment"; - value: String; - } - | { - type: "colon"; - } - | { - type: "semicolon"; - } - | { - type: "comma"; - } - | { - type: "include-match"; - } - | { - type: "dash-match"; - } - | { - type: "prefix-match"; - } - | { - type: "suffix-match"; - } - | { - type: "substring-match"; - } - | { - type: "cdo"; - } - | { - type: "cdc"; - } - | { - type: "function"; - value: String; - } - | { - type: "parenthesis-block"; - } - | { - type: "square-bracket-block"; - } - | { - type: "curly-bracket-block"; - } - | { - type: "bad-url"; - value: String; - } - | { - type: "bad-string"; - value: String; - } - | { - type: "close-parenthesis"; - } - | { - type: "close-square-bracket"; - } - | { - type: "close-curly-bracket"; - }; -/** - * A CSS [``](https://www.w3.org/TR/css-color-4/#color-type) value. - * - * CSS supports many different color spaces to represent colors. The most common values are stored as RGBA using a single byte per component. Less common values are stored using a `Box` to reduce the amount of memory used per color. - * - * Each color space is represented as a struct that implements the `From` and `Into` traits for all other color spaces, so it is possible to convert between color spaces easily. In addition, colors support [interpolation](#method.interpolate) as in the `color-mix()` function. - */ -export type CssColor = CurrentColor | RGBColor | LABColor | PredefinedColor | FloatColor | LightDark | SystemColor; -export type CurrentColor = { - type: "currentcolor"; -}; -export type RGBColor = { - /** - * The alpha component. - */ - alpha: number; - /** - * The blue component. - */ - b: number; - /** - * The green component. - */ - g: number; - /** - * The red component. - */ - r: number; - type: "rgb"; -}; -/** - * A color in a LAB color space, including the `lab()`, `lch()`, `oklab()`, and `oklch()` functions. - */ -export type LABColor = - | { - /** - * The a component. - */ - a: number; - /** - * The alpha component. - */ - alpha: number; - /** - * The b component. - */ - b: number; - /** - * The lightness component. - */ - l: number; - type: "lab"; - } - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The chroma component. - */ - c: number; - /** - * The hue component. - */ - h: number; - /** - * The lightness component. - */ - l: number; - type: "lch"; - } - | { - /** - * The a component. - */ - a: number; - /** - * The alpha component. - */ - alpha: number; - /** - * The b component. - */ - b: number; - /** - * The lightness component. - */ - l: number; - type: "oklab"; - } - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The chroma component. - */ - c: number; - /** - * The hue component. - */ - h: number; - /** - * The lightness component. - */ - l: number; - type: "oklch"; - }; -/** - * A color in a predefined color space, e.g. `display-p3`. - */ -export type PredefinedColor = - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The blue component. - */ - b: number; - /** - * The green component. - */ - g: number; - /** - * The red component. - */ - r: number; - type: "srgb"; - } - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The blue component. - */ - b: number; - /** - * The green component. - */ - g: number; - /** - * The red component. - */ - r: number; - type: "srgb-linear"; - } - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The blue component. - */ - b: number; - /** - * The green component. - */ - g: number; - /** - * The red component. - */ - r: number; - type: "display-p3"; - } - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The blue component. - */ - b: number; - /** - * The green component. - */ - g: number; - /** - * The red component. - */ - r: number; - type: "a98-rgb"; - } - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The blue component. - */ - b: number; - /** - * The green component. - */ - g: number; - /** - * The red component. - */ - r: number; - type: "prophoto-rgb"; - } - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The blue component. - */ - b: number; - /** - * The green component. - */ - g: number; - /** - * The red component. - */ - r: number; - type: "rec2020"; - } - | { - /** - * The alpha component. - */ - alpha: number; - type: "xyz-d50"; - /** - * The x component. - */ - x: number; - /** - * The y component. - */ - y: number; - /** - * The z component. - */ - z: number; - } - | { - /** - * The alpha component. - */ - alpha: number; - type: "xyz-d65"; - /** - * The x component. - */ - x: number; - /** - * The y component. - */ - y: number; - /** - * The z component. - */ - z: number; - }; -/** - * A floating point representation of color types that are usually stored as RGBA. These are used when there are any `none` components, which are represented as NaN. - */ -export type FloatColor = - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The blue component. - */ - b: number; - /** - * The green component. - */ - g: number; - /** - * The red component. - */ - r: number; - type: "rgb"; - } - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The hue component. - */ - h: number; - /** - * The lightness component. - */ - l: number; - /** - * The saturation component. - */ - s: number; - type: "hsl"; - } - | { - /** - * The alpha component. - */ - alpha: number; - /** - * The blackness component. - */ - b: number; - /** - * The hue component. - */ - h: number; - type: "hwb"; - /** - * The whiteness component. - */ - w: number; - }; -export type LightDark = { - dark: CssColor; - light: CssColor; - type: "light-dark"; -}; -/** - * A CSS [system color](https://drafts.csswg.org/css-color/#css-system-colors) keyword. - */ -export type SystemColor = - | "accentcolor" - | "accentcolortext" - | "activetext" - | "buttonborder" - | "buttonface" - | "buttontext" - | "canvas" - | "canvastext" - | "field" - | "fieldtext" - | "graytext" - | "highlight" - | "highlighttext" - | "linktext" - | "mark" - | "marktext" - | "selecteditem" - | "selecteditemtext" - | "visitedtext" - | "activeborder" - | "activecaption" - | "appworkspace" - | "background" - | "buttonhighlight" - | "buttonshadow" - | "captiontext" - | "inactiveborder" - | "inactivecaption" - | "inactivecaptiontext" - | "infobackground" - | "infotext" - | "menu" - | "menutext" - | "scrollbar" - | "threeddarkshadow" - | "threedface" - | "threedhighlight" - | "threedlightshadow" - | "threedshadow" - | "window" - | "windowframe" - | "windowtext"; -/** - * A color value with an unresolved alpha value (e.g. a variable). These can be converted from the modern slash syntax to older comma syntax. This can only be done when the only unresolved component is the alpha since variables can resolve to multiple tokens. - */ -export type UnresolvedColor = - | { - /** - * The unresolved alpha component. - */ - alpha: TokenOrValue[]; - /** - * The blue component. - */ - b: number; - /** - * The green component. - */ - g: number; - /** - * The red component. - */ - r: number; - type: "rgb"; - } - | { - /** - * The unresolved alpha component. - */ - alpha: TokenOrValue[]; - /** - * The hue component. - */ - h: number; - /** - * The lightness component. - */ - l: number; - /** - * The saturation component. - */ - s: number; - type: "hsl"; - } - | { - /** - * The dark value. - */ - dark: TokenOrValue[]; - /** - * The light value. - */ - light: TokenOrValue[]; - type: "light-dark"; - }; -/** - * Defines where the class names referenced in the `composes` property are located. - * - * See [Composes](Composes). - */ -export type Specifier = - | { - type: "global"; - } - | { - type: "file"; - value: String; - } - | { - type: "source-index"; - value: number; - }; -/** - * A CSS [``](https://www.w3.org/TR/css-values-4/#angles) value. - * - * Angles may be explicit or computed by `calc()`, but are always stored and serialized as their computed value. - */ -export type Angle = - | { - type: "deg"; - value: number; - } - | { - type: "rad"; - value: number; - } - | { - type: "grad"; - value: number; - } - | { - type: "turn"; - value: number; - }; -/** - * A CSS [`