Notes app :)

Compare changes

Choose any two refs to compare.

+937 -1282
+64 -422
Cargo.lock
··· 26 26 "cfg-if", 27 27 "getrandom 0.3.3", 28 28 "once_cell", 29 - "serde", 30 29 "version_check", 31 30 "zerocopy", 32 31 ] ··· 56 55 ] 57 56 58 57 [[package]] 59 - name = "allocator-api2" 60 - version = "0.2.21" 61 - source = "registry+https://github.com/rust-lang/crates.io-index" 62 - checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" 63 - 64 - [[package]] 65 58 name = "ammonia" 66 59 version = "4.1.0" 67 60 source = "registry+https://github.com/rust-lang/crates.io-index" 68 61 checksum = "3ada2ee439075a3e70b6992fce18ac4e407cd05aea9ca3f75d2c0b0c20bbb364" 69 62 dependencies = [ 70 - "cssparser 0.35.0", 63 + "cssparser", 71 64 "html5ever", 72 65 "maplit", 73 66 "tendril", ··· 90 83 ] 91 84 92 85 [[package]] 86 + name = "async-compression" 87 + version = "0.4.23" 88 + source = "registry+https://github.com/rust-lang/crates.io-index" 89 + checksum = "b37fc50485c4f3f736a4fb14199f6d5f5ba008d7f28fe710306c92780f004c07" 90 + dependencies = [ 91 + "flate2", 92 + "futures-core", 93 + "memchr", 94 + "pin-project-lite", 95 + "tokio", 96 + ] 97 + 98 + [[package]] 93 99 name = "autocfg" 94 100 version = "1.5.0" 95 101 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 102 108 checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5" 103 109 dependencies = [ 104 110 "axum-core", 111 + "axum-macros", 105 112 "bytes", 106 113 "form_urlencoded", 107 114 "futures-util", ··· 163 170 ] 164 171 165 172 [[package]] 173 + name = "axum-macros" 174 + version = "0.5.0" 175 + source = "registry+https://github.com/rust-lang/crates.io-index" 176 + checksum = "604fde5e028fea851ce1d8570bbdc034bec850d157f7569d10f347d06808c05c" 177 + dependencies = [ 178 + "proc-macro2", 179 + "quote", 180 + "syn", 181 + ] 182 + 183 + [[package]] 166 184 name = "backtrace" 167 185 version = "0.3.75" 168 186 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 202 220 dependencies = [ 203 221 "alloc-no-stdlib", 204 222 "alloc-stdlib", 205 - ] 206 - 207 - [[package]] 208 - name = "browserslist-rs" 209 - version = "0.17.0" 210 - source = "registry+https://github.com/rust-lang/crates.io-index" 211 - checksum = "74c973b79d9b6b89854493185ab760c6ef8e54bcfad10ad4e33991e46b374ac8" 212 - dependencies = [ 213 - "ahash", 214 - "chrono", 215 - "either", 216 - "indexmap", 217 - "itertools 0.13.0", 218 - "nom", 219 - "serde", 220 - "serde_json", 221 - "thiserror", 222 223 ] 223 224 224 225 [[package]] ··· 285 286 ] 286 287 287 288 [[package]] 288 - name = "codemap" 289 - version = "0.1.3" 290 - source = "registry+https://github.com/rust-lang/crates.io-index" 291 - checksum = "b9e769b5c8c8283982a987c6e948e540254f1058d5a74b8794914d4ef5fc2a24" 292 - 293 - [[package]] 294 - name = "const-str" 295 - version = "0.3.2" 296 - source = "registry+https://github.com/rust-lang/crates.io-index" 297 - checksum = "21077772762a1002bb421c3af42ac1725fa56066bfc53d9a55bb79905df2aaf3" 298 - dependencies = [ 299 - "const-str-proc-macro", 300 - ] 301 - 302 - [[package]] 303 - name = "const-str-proc-macro" 304 - version = "0.3.2" 305 - source = "registry+https://github.com/rust-lang/crates.io-index" 306 - checksum = "5e1e0fdd2e5d3041e530e1b21158aeeef8b5d0e306bc5c1e3d6cf0930d10e25a" 307 - dependencies = [ 308 - "proc-macro2", 309 - "quote", 310 - "syn 1.0.109", 311 - ] 312 - 313 - [[package]] 314 - name = "convert_case" 315 - version = "0.6.0" 316 - source = "registry+https://github.com/rust-lang/crates.io-index" 317 - checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" 318 - dependencies = [ 319 - "unicode-segmentation", 320 - ] 321 - 322 - [[package]] 323 289 name = "cookie-rs" 324 290 version = "0.4.1" 325 291 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 332 298 checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 333 299 334 300 [[package]] 335 - name = "cssparser" 336 - version = "0.33.0" 301 + name = "crc32fast" 302 + version = "1.4.2" 337 303 source = "registry+https://github.com/rust-lang/crates.io-index" 338 - checksum = "9be934d936a0fbed5bcdc01042b770de1398bf79d0e192f49fa7faea0e99281e" 304 + checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" 339 305 dependencies = [ 340 - "cssparser-macros", 341 - "dtoa-short", 342 - "itoa", 343 - "phf", 344 - "smallvec", 306 + "cfg-if", 345 307 ] 346 308 347 309 [[package]] ··· 355 317 "itoa", 356 318 "phf", 357 319 "smallvec", 358 - ] 359 - 360 - [[package]] 361 - name = "cssparser-color" 362 - version = "0.1.0" 363 - source = "registry+https://github.com/rust-lang/crates.io-index" 364 - checksum = "556c099a61d85989d7af52b692e35a8d68a57e7df8c6d07563dc0778b3960c9f" 365 - dependencies = [ 366 - "cssparser 0.33.0", 367 320 ] 368 321 369 322 [[package]] ··· 373 326 checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" 374 327 dependencies = [ 375 328 "quote", 376 - "syn 2.0.104", 329 + "syn", 377 330 ] 378 331 379 332 [[package]] ··· 396 349 dependencies = [ 397 350 "memchr", 398 351 ] 399 - 400 - [[package]] 401 - name = "data-encoding" 402 - version = "2.9.0" 403 - source = "registry+https://github.com/rust-lang/crates.io-index" 404 - checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" 405 352 406 353 [[package]] 407 354 name = "deadpool" ··· 460 407 dependencies = [ 461 408 "proc-macro2", 462 409 "quote", 463 - "syn 2.0.104", 410 + "syn", 464 411 ] 465 412 466 413 [[package]] ··· 479 426 ] 480 427 481 428 [[package]] 482 - name = "either" 483 - version = "1.15.0" 484 - source = "registry+https://github.com/rust-lang/crates.io-index" 485 - checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" 486 - 487 - [[package]] 488 - name = "equivalent" 489 - version = "1.0.2" 490 - source = "registry+https://github.com/rust-lang/crates.io-index" 491 - checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 492 - 493 - [[package]] 494 429 name = "fallible-iterator" 495 430 version = "0.3.0" 496 431 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 501 436 version = "0.1.9" 502 437 source = "registry+https://github.com/rust-lang/crates.io-index" 503 438 checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" 439 + 440 + [[package]] 441 + name = "flate2" 442 + version = "1.1.2" 443 + source = "registry+https://github.com/rust-lang/crates.io-index" 444 + checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" 445 + dependencies = [ 446 + "crc32fast", 447 + "miniz_oxide", 448 + ] 504 449 505 450 [[package]] 506 451 name = "fnv" ··· 579 524 checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" 580 525 dependencies = [ 581 526 "cfg-if", 582 - "js-sys", 583 527 "libc", 584 528 "wasi 0.11.1+wasi-snapshot-preview1", 585 - "wasm-bindgen", 586 529 ] 587 530 588 531 [[package]] ··· 604 547 checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" 605 548 606 549 [[package]] 607 - name = "grass" 608 - version = "0.13.4" 609 - source = "registry+https://github.com/rust-lang/crates.io-index" 610 - checksum = "f7a68216437ef68f0738e48d6c7bb9e6e6a92237e001b03d838314b068f33c94" 611 - dependencies = [ 612 - "getrandom 0.2.16", 613 - "grass_compiler", 614 - ] 615 - 616 - [[package]] 617 - name = "grass_compiler" 618 - version = "0.13.4" 619 - source = "registry+https://github.com/rust-lang/crates.io-index" 620 - checksum = "2d9e3df7f0222ce5184154973d247c591d9aadc28ce7a73c6cd31100c9facff6" 621 - dependencies = [ 622 - "codemap", 623 - "indexmap", 624 - "lasso", 625 - "once_cell", 626 - "phf", 627 - ] 628 - 629 - [[package]] 630 - name = "hashbrown" 631 - version = "0.14.5" 632 - source = "registry+https://github.com/rust-lang/crates.io-index" 633 - checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 634 - dependencies = [ 635 - "ahash", 636 - "allocator-api2", 637 - ] 638 - 639 - [[package]] 640 550 name = "hashbrown" 641 551 version = "0.15.4" 642 552 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 651 561 source = "registry+https://github.com/rust-lang/crates.io-index" 652 562 checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" 653 563 dependencies = [ 654 - "hashbrown 0.15.4", 564 + "hashbrown", 655 565 ] 656 566 657 567 [[package]] ··· 891 801 ] 892 802 893 803 [[package]] 894 - name = "indexmap" 895 - version = "2.10.0" 896 - source = "registry+https://github.com/rust-lang/crates.io-index" 897 - checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" 898 - dependencies = [ 899 - "equivalent", 900 - "hashbrown 0.15.4", 901 - "serde", 902 - ] 903 - 904 - [[package]] 905 - name = "itertools" 906 - version = "0.10.5" 907 - source = "registry+https://github.com/rust-lang/crates.io-index" 908 - checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 909 - dependencies = [ 910 - "either", 911 - ] 912 - 913 - [[package]] 914 - name = "itertools" 915 - version = "0.13.0" 916 - source = "registry+https://github.com/rust-lang/crates.io-index" 917 - checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" 918 - dependencies = [ 919 - "either", 920 - ] 921 - 922 - [[package]] 923 804 name = "itoa" 924 805 version = "1.0.15" 925 806 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 927 808 928 809 [[package]] 929 810 name = "jiff" 930 - version = "0.2.10" 811 + version = "0.2.15" 931 812 source = "registry+https://github.com/rust-lang/crates.io-index" 932 - checksum = "5a064218214dc6a10fbae5ec5fa888d80c45d611aba169222fc272072bf7aef6" 813 + checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" 933 814 dependencies = [ 934 815 "jiff-static", 935 816 "log", ··· 940 821 941 822 [[package]] 942 823 name = "jiff-static" 943 - version = "0.2.10" 824 + version = "0.2.15" 944 825 source = "registry+https://github.com/rust-lang/crates.io-index" 945 - checksum = "199b7932d97e325aff3a7030e141eafe7f2c6268e1d1b24859b753a627f45254" 826 + checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" 946 827 dependencies = [ 947 828 "proc-macro2", 948 829 "quote", 949 - "syn 2.0.104", 830 + "syn", 950 831 ] 951 832 952 833 [[package]] ··· 960 841 ] 961 842 962 843 [[package]] 963 - name = "lasso" 964 - version = "0.7.3" 965 - source = "registry+https://github.com/rust-lang/crates.io-index" 966 - checksum = "6e14eda50a3494b3bf7b9ce51c52434a761e383d7238ce1dd5dcec2fbc13e9fb" 967 - dependencies = [ 968 - "hashbrown 0.14.5", 969 - ] 970 - 971 - [[package]] 972 - name = "lazy_static" 973 - version = "1.5.0" 974 - source = "registry+https://github.com/rust-lang/crates.io-index" 975 - checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 976 - 977 - [[package]] 978 844 name = "libc" 979 845 version = "0.2.174" 980 846 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 992 858 ] 993 859 994 860 [[package]] 995 - name = "lightningcss" 996 - version = "1.0.0-alpha.65" 997 - source = "registry+https://github.com/rust-lang/crates.io-index" 998 - checksum = "c84f971730745f4aaac013b6cf4328baf1548efc973c0d95cfd843a3c1ca07af" 999 - dependencies = [ 1000 - "ahash", 1001 - "bitflags", 1002 - "browserslist-rs", 1003 - "const-str", 1004 - "cssparser 0.33.0", 1005 - "cssparser-color", 1006 - "data-encoding", 1007 - "getrandom 0.2.16", 1008 - "indexmap", 1009 - "itertools 0.10.5", 1010 - "lazy_static", 1011 - "lightningcss-derive", 1012 - "parcel_selectors", 1013 - "paste", 1014 - "pathdiff", 1015 - "smallvec", 1016 - ] 1017 - 1018 - [[package]] 1019 - name = "lightningcss-derive" 1020 - version = "1.0.0-alpha.43" 1021 - source = "registry+https://github.com/rust-lang/crates.io-index" 1022 - checksum = "84c12744d1279367caed41739ef094c325d53fb0ffcd4f9b84a368796f870252" 1023 - dependencies = [ 1024 - "convert_case", 1025 - "proc-macro2", 1026 - "quote", 1027 - "syn 1.0.109", 1028 - ] 1029 - 1030 - [[package]] 1031 861 name = "litemap" 1032 862 version = "0.8.0" 1033 863 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1080 910 dependencies = [ 1081 911 "proc-macro2", 1082 912 "quote", 1083 - "syn 2.0.104", 913 + "syn", 1084 914 ] 1085 915 1086 916 [[package]] ··· 1127 957 "self_cell", 1128 958 "serde", 1129 959 ] 1130 - 1131 - [[package]] 1132 - name = "minimal-lexical" 1133 - version = "0.2.1" 1134 - source = "registry+https://github.com/rust-lang/crates.io-index" 1135 - checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 1136 960 1137 961 [[package]] 1138 962 name = "miniz_oxide" ··· 1161 985 checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" 1162 986 1163 987 [[package]] 1164 - name = "nom" 1165 - version = "7.1.3" 1166 - source = "registry+https://github.com/rust-lang/crates.io-index" 1167 - checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 1168 - dependencies = [ 1169 - "memchr", 1170 - "minimal-lexical", 1171 - ] 1172 - 1173 - [[package]] 1174 988 name = "num-conv" 1175 989 version = "0.1.0" 1176 990 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1211 1025 checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 1212 1026 1213 1027 [[package]] 1214 - name = "oorandom" 1215 - version = "11.1.5" 1216 - source = "registry+https://github.com/rust-lang/crates.io-index" 1217 - checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" 1218 - 1219 - [[package]] 1220 - name = "parcel_selectors" 1221 - version = "0.28.2" 1222 - source = "registry+https://github.com/rust-lang/crates.io-index" 1223 - checksum = "54fd03f1ad26cb6b3ec1b7414fa78a3bd639e7dbb421b1a60513c96ce886a196" 1224 - dependencies = [ 1225 - "bitflags", 1226 - "cssparser 0.33.0", 1227 - "log", 1228 - "phf", 1229 - "phf_codegen", 1230 - "precomputed-hash", 1231 - "rustc-hash", 1232 - "smallvec", 1233 - ] 1234 - 1235 - [[package]] 1236 1028 name = "parking_lot" 1237 1029 version = "0.12.4" 1238 1030 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1269 1061 version = "1.0.15" 1270 1062 source = "registry+https://github.com/rust-lang/crates.io-index" 1271 1063 checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 1272 - 1273 - [[package]] 1274 - name = "pathdiff" 1275 - version = "0.2.3" 1276 - source = "registry+https://github.com/rust-lang/crates.io-index" 1277 - checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" 1278 1064 1279 1065 [[package]] 1280 1066 name = "percent-encoding" ··· 1322 1108 "phf_shared", 1323 1109 "proc-macro2", 1324 1110 "quote", 1325 - "syn 2.0.104", 1111 + "syn", 1326 1112 ] 1327 1113 1328 1114 [[package]] ··· 1558 1344 version = "0.1.25" 1559 1345 source = "registry+https://github.com/rust-lang/crates.io-index" 1560 1346 checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" 1561 - 1562 - [[package]] 1563 - name = "rustc-hash" 1564 - version = "2.1.1" 1565 - source = "registry+https://github.com/rust-lang/crates.io-index" 1566 - checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" 1567 1347 1568 1348 [[package]] 1569 1349 name = "rustversion" ··· 1606 1386 dependencies = [ 1607 1387 "proc-macro2", 1608 1388 "quote", 1609 - "syn 2.0.104", 1389 + "syn", 1610 1390 ] 1611 1391 1612 1392 [[package]] ··· 1628 1408 checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" 1629 1409 dependencies = [ 1630 1410 "itoa", 1631 - "serde", 1632 - ] 1633 - 1634 - [[package]] 1635 - name = "serde_spanned" 1636 - version = "0.6.9" 1637 - source = "registry+https://github.com/rust-lang/crates.io-index" 1638 - checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" 1639 - dependencies = [ 1640 1411 "serde", 1641 1412 ] 1642 1413 ··· 1722 1493 1723 1494 [[package]] 1724 1495 name = "syn" 1725 - version = "1.0.109" 1726 - source = "registry+https://github.com/rust-lang/crates.io-index" 1727 - checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1728 - dependencies = [ 1729 - "proc-macro2", 1730 - "quote", 1731 - "unicode-ident", 1732 - ] 1733 - 1734 - [[package]] 1735 - name = "syn" 1736 1496 version = "2.0.104" 1737 1497 source = "registry+https://github.com/rust-lang/crates.io-index" 1738 1498 checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" ··· 1756 1516 dependencies = [ 1757 1517 "proc-macro2", 1758 1518 "quote", 1759 - "syn 2.0.104", 1519 + "syn", 1760 1520 ] 1761 1521 1762 1522 [[package]] ··· 1768 1528 "futf", 1769 1529 "mac", 1770 1530 "utf-8", 1771 - ] 1772 - 1773 - [[package]] 1774 - name = "thiserror" 1775 - version = "1.0.69" 1776 - source = "registry+https://github.com/rust-lang/crates.io-index" 1777 - checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 1778 - dependencies = [ 1779 - "thiserror-impl", 1780 - ] 1781 - 1782 - [[package]] 1783 - name = "thiserror-impl" 1784 - version = "1.0.69" 1785 - source = "registry+https://github.com/rust-lang/crates.io-index" 1786 - checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" 1787 - dependencies = [ 1788 - "proc-macro2", 1789 - "quote", 1790 - "syn 2.0.104", 1791 1531 ] 1792 1532 1793 1533 [[package]] ··· 1857 1597 dependencies = [ 1858 1598 "proc-macro2", 1859 1599 "quote", 1860 - "syn 2.0.104", 1600 + "syn", 1861 1601 ] 1862 1602 1863 1603 [[package]] ··· 1874 1614 ] 1875 1615 1876 1616 [[package]] 1877 - name = "toml" 1878 - version = "0.8.23" 1879 - source = "registry+https://github.com/rust-lang/crates.io-index" 1880 - checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" 1881 - dependencies = [ 1882 - "serde", 1883 - "serde_spanned", 1884 - "toml_datetime", 1885 - "toml_edit", 1886 - ] 1887 - 1888 - [[package]] 1889 - name = "toml_datetime" 1890 - version = "0.6.11" 1891 - source = "registry+https://github.com/rust-lang/crates.io-index" 1892 - checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" 1893 - dependencies = [ 1894 - "serde", 1895 - ] 1896 - 1897 - [[package]] 1898 - name = "toml_edit" 1899 - version = "0.22.27" 1900 - source = "registry+https://github.com/rust-lang/crates.io-index" 1901 - checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" 1902 - dependencies = [ 1903 - "indexmap", 1904 - "serde", 1905 - "serde_spanned", 1906 - "toml_datetime", 1907 - "toml_write", 1908 - "winnow", 1909 - ] 1910 - 1911 - [[package]] 1912 - name = "toml_write" 1913 - version = "0.1.2" 1914 - source = "registry+https://github.com/rust-lang/crates.io-index" 1915 - checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" 1916 - 1917 - [[package]] 1918 1617 name = "tomorrow" 1919 1618 version = "0.1.0" 1920 1619 dependencies = [ ··· 1928 1627 "rand 0.9.1", 1929 1628 "random_word", 1930 1629 "serde", 1630 + "serde_json", 1931 1631 "tokio", 1632 + "tower", 1932 1633 "tower-http", 1933 - "turf", 1934 1634 ] 1935 1635 1936 1636 [[package]] ··· 1955 1655 source = "registry+https://github.com/rust-lang/crates.io-index" 1956 1656 checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" 1957 1657 dependencies = [ 1658 + "async-compression", 1958 1659 "bitflags", 1959 1660 "bytes", 1960 1661 "futures-core", ··· 2008 1709 ] 2009 1710 2010 1711 [[package]] 2011 - name = "turf" 2012 - version = "0.10.1" 2013 - source = "registry+https://github.com/rust-lang/crates.io-index" 2014 - checksum = "7a1089d791f5346abf667aee9497bc5ceb0ec68a2635e8667564ad7af94d1ef5" 2015 - dependencies = [ 2016 - "turf_macros", 2017 - ] 2018 - 2019 - [[package]] 2020 - name = "turf_internals" 2021 - version = "0.10.1" 2022 - source = "registry+https://github.com/rust-lang/crates.io-index" 2023 - checksum = "e350a183d560eab563edf57b98c65e3ebbbe5c57629fc776a349fab4ec62e06b" 2024 - dependencies = [ 2025 - "getrandom 0.2.16", 2026 - "grass", 2027 - "lightningcss", 2028 - "oorandom", 2029 - "regex", 2030 - "serde", 2031 - "thiserror", 2032 - "toml", 2033 - "xxhash-rust", 2034 - ] 2035 - 2036 - [[package]] 2037 - name = "turf_macros" 2038 - version = "0.10.1" 2039 - source = "registry+https://github.com/rust-lang/crates.io-index" 2040 - checksum = "a2a2e5cc0498385820cc1beee60cae20313477b107f56b387d778d3ced735b34" 2041 - dependencies = [ 2042 - "convert_case", 2043 - "proc-macro2", 2044 - "quote", 2045 - "turf_internals", 2046 - ] 2047 - 2048 - [[package]] 2049 1712 name = "unicase" 2050 1713 version = "2.8.1" 2051 1714 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2056 1719 version = "1.0.18" 2057 1720 source = "registry+https://github.com/rust-lang/crates.io-index" 2058 1721 checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 2059 - 2060 - [[package]] 2061 - name = "unicode-segmentation" 2062 - version = "1.12.0" 2063 - source = "registry+https://github.com/rust-lang/crates.io-index" 2064 - checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" 2065 1722 2066 1723 [[package]] 2067 1724 name = "url" ··· 2145 1802 "log", 2146 1803 "proc-macro2", 2147 1804 "quote", 2148 - "syn 2.0.104", 1805 + "syn", 2149 1806 "wasm-bindgen-shared", 2150 1807 ] 2151 1808 ··· 2167 1824 dependencies = [ 2168 1825 "proc-macro2", 2169 1826 "quote", 2170 - "syn 2.0.104", 1827 + "syn", 2171 1828 "wasm-bindgen-backend", 2172 1829 "wasm-bindgen-shared", 2173 1830 ] ··· 2214 1871 dependencies = [ 2215 1872 "proc-macro2", 2216 1873 "quote", 2217 - "syn 2.0.104", 1874 + "syn", 2218 1875 ] 2219 1876 2220 1877 [[package]] ··· 2225 1882 dependencies = [ 2226 1883 "proc-macro2", 2227 1884 "quote", 2228 - "syn 2.0.104", 1885 + "syn", 2229 1886 ] 2230 1887 2231 1888 [[package]] ··· 2335 1992 checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 2336 1993 2337 1994 [[package]] 2338 - name = "winnow" 2339 - version = "0.7.11" 2340 - source = "registry+https://github.com/rust-lang/crates.io-index" 2341 - checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" 2342 - dependencies = [ 2343 - "memchr", 2344 - ] 2345 - 2346 - [[package]] 2347 1995 name = "wit-bindgen-rt" 2348 1996 version = "0.39.0" 2349 1997 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2357 2005 version = "0.6.1" 2358 2006 source = "registry+https://github.com/rust-lang/crates.io-index" 2359 2007 checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" 2360 - 2361 - [[package]] 2362 - name = "xxhash-rust" 2363 - version = "0.8.15" 2364 - source = "registry+https://github.com/rust-lang/crates.io-index" 2365 - checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" 2366 2008 2367 2009 [[package]] 2368 2010 name = "yoke" ··· 2384 2026 dependencies = [ 2385 2027 "proc-macro2", 2386 2028 "quote", 2387 - "syn 2.0.104", 2029 + "syn", 2388 2030 "synstructure", 2389 2031 ] 2390 2032 ··· 2405 2047 dependencies = [ 2406 2048 "proc-macro2", 2407 2049 "quote", 2408 - "syn 2.0.104", 2050 + "syn", 2409 2051 ] 2410 2052 2411 2053 [[package]] ··· 2425 2067 dependencies = [ 2426 2068 "proc-macro2", 2427 2069 "quote", 2428 - "syn 2.0.104", 2070 + "syn", 2429 2071 "synstructure", 2430 2072 ] 2431 2073 ··· 2459 2101 dependencies = [ 2460 2102 "proc-macro2", 2461 2103 "quote", 2462 - "syn 2.0.104", 2104 + "syn", 2463 2105 ]
+14 -24
Cargo.toml
··· 4 4 edition = "2024" 5 5 6 6 [dependencies] 7 - axum = { version = "0.8.4", features = ["form", "json"] } 8 - minijinja = { version = "2.10.2", features = ["loader"] } 9 - serde = { version = "1.0.219", features = ["derive"] } 10 - tokio = { version = "1.45.1", features = ["full"] } 11 - tower-http = { version = "0.6.6", features = ["fs"] } 12 - deadpool-sqlite = { version = "0.11.0", features = ["bundled", "modern-full"] } 13 - chrono = { version = "0.4.41", features = ["now"] } 14 - # tower-sessions = "0.14.0" 15 - random_word = { version = "0.5.0", features = ["en"] } 16 - chrono-tz = { version = "0.10.3", features = ["serde"] } 17 - rand = "0.9.1" 18 - axum-cookie = "0.2.3" 19 - turf = "0.10.1" 20 - ammonia = "4.1.0" 21 - 22 - [package.metadata.turf] 23 - minify = false 24 - load_paths = ["./static/css"] 25 - 26 - [package.metadata.turf.class_names] 27 - template = "<original_name>" 28 - 29 - [package.metadata.turf.file_output] 30 - global_css_file_path = "./static/css/out.css" 7 + axum = { version = "0.8", features = ["form", "json", "macros"] } 8 + minijinja = { version = "2", features = ["loader"] } 9 + serde = { version = "1", features = ["derive"] } 10 + tokio = { version = "1", features = ["full"] } 11 + tower-http = { version = "0.6", features = ["fs", "compression-gzip"] } 12 + deadpool-sqlite = { version = "0.11", features = ["bundled", "modern-full"] } 13 + chrono = { version = "0.4", features = ["now"] } 14 + random_word = { version = "0.5", features = ["en"] } 15 + chrono-tz = { version = "0.10", features = ["serde"] } 16 + rand = "0.9" 17 + axum-cookie = "0.2" 18 + ammonia = "4" 19 + serde_json = "1" 20 + tower = "0.5"
+8 -11
src/main.rs
··· 2 2 route::index, 3 3 state::AppState, 4 4 task::{check_task, delete_task, new_task, pushback_task, tasks}, 5 - user::{login, new_user, user_slug}, 5 + user::{login, new_user, user_info}, 6 6 }; 7 7 use axum::{ 8 8 Router, ··· 31 31 .parse() 32 32 .unwrap(); 33 33 34 - let _css = turf::style_sheet_values!("./static/css/style.scss").0; 35 - 36 - let env = template(); 34 + let env = jinja_env(); 37 35 38 36 let cfg = Config::new("db.sqlite3"); 39 37 let pool = cfg.create_pool(Runtime::Tokio1).unwrap(); ··· 74 72 let app = Router::new() 75 73 .route("/", get(index)) 76 74 .route("/task/new", post(new_task)) 77 - .route("/task/delete", get(delete_task)) 78 - .route("/task/list", get(tasks)) 79 - .route("/task/complete", get(check_task)) 80 - .route("/task/pushback", get(pushback_task)) 75 + .route("/task/delete", post(delete_task)) 76 + .route("/task/list", post(tasks)) 77 + .route("/task/complete", post(check_task)) 78 + .route("/task/pushback", post(pushback_task)) 81 79 .route("/user/new", post(new_user)) 82 80 .route("/user/login", post(login)) 83 - .route("/htmx/user_slug", get(user_slug)) 81 + .route("/user/info", post(user_info)) 84 82 .nest_service("/static", ServeDir::new("static")) 85 83 .with_state(AppState { env, pool }) 86 84 .layer(CookieLayer::default()); ··· 96 94 Ok(()) 97 95 } 98 96 99 - fn template() -> Environment<'static> { 97 + fn jinja_env() -> Environment<'static> { 100 98 let mut env = Environment::new(); 101 99 102 100 env.set_loader(path_loader("templates")); 103 - 104 101 env 105 102 } 106 103
+22 -4
src/route.rs
··· 2 2 out, 3 3 session::session, 4 4 state::{Senv, Spool}, 5 + task::{ListTasks, TaskWhen, tasks, tasks_internal}, 5 6 }; 6 - use axum::{extract::State, response::Html}; 7 + use axum::{Form, extract::State, response::Html}; 7 8 use axum_cookie::CookieManager; 8 9 use minijinja::context; 9 10 10 11 pub async fn index(jar: CookieManager, State(env): Senv, State(pool): Spool) -> Html<String> { 11 - let (user, _jar) = session(State(pool), jar).await; 12 + let (user, _jar) = session(State(pool.clone()), jar.clone()).await; 12 13 13 - // let css = turf::style_sheet_values!("./static/css/style.scss").0; 14 + let today = tasks_internal( 15 + State(pool.clone()), 16 + jar.clone(), 17 + ListTasks { 18 + when: TaskWhen::Today, 19 + }, 20 + ) 21 + .await 22 + .unwrap_or_default(); 23 + let tomorrow = tasks_internal( 24 + State(pool), 25 + jar, 26 + ListTasks { 27 + when: TaskWhen::Tomorrow, 28 + }, 29 + ) 30 + .await 31 + .unwrap_or_default(); 14 32 15 - let out = out(&env, "index.html", context! { user }).unwrap(); 33 + let out = out(&env, "index.html", context! { user, today, tomorrow }).unwrap(); 16 34 17 35 Html(out) 18 36 }
+90 -43
src/task.rs
··· 1 1 use std::collections::HashMap; 2 2 3 3 use axum::{ 4 - Form, 4 + Form, Json, 5 5 extract::State, 6 6 http::{HeaderMap, HeaderValue}, 7 7 response::{Html, IntoResponse}, 8 8 }; 9 9 use axum_cookie::CookieManager; 10 - use serde::Deserialize; 10 + use serde::{Deserialize, Serialize}; 11 11 12 12 use crate::{SqlRes, session::session, state::Spool}; 13 13 14 - struct Task { 14 + #[derive(Serialize)] 15 + pub struct Task { 15 16 id: u64, 16 17 text: String, 18 + #[serde(skip_serializing)] 17 19 date: chrono::NaiveDate, 18 20 checked: bool, 19 21 } ··· 24 26 25 27 format!( 26 28 r#" 27 - <div class="list-item"> 28 - <li hx-target="this" hx-swap="outerHTML"> 29 - <span class="{}" hx-get="/task/complete?id={}">{}</span> &nbsp; 30 - 31 - <details name="edit"> 32 - <summary>edit</summary> 33 - <button class="button-delete" hx-get="/task/delete?id={}" hx-confirm="Are you sure you want to *delete* this item?" > 34 - del 35 - </button> 36 - <button class="button-pushback today" hx-get="/task/pushback?id={}" hx-confirm="Are you sure you want to move this item to tomorrow?" > 37 - tmrw 38 - </button> 39 - </details> 40 - </li> 41 - </div> 29 + <task-item {}message="{}" task_id="{}"></task-item> 42 30 "#, 43 - if self.checked { 44 - "task-label checked" 45 - } else { 46 - "task-label" 47 - }, 48 - self.id, 31 + if self.checked { "checked " } else { "" }, 49 32 text, 50 - self.id, 51 - self.id, 33 + self.id 52 34 ) 53 35 } 54 36 } ··· 87 69 }; 88 70 89 71 let conn = pool.get().await.unwrap(); 90 - conn.interact(move |conn| { 91 - conn.execute( 92 - "INSERT INTO tasks (text, date, user) VALUES (?1, ?2, ?3)", 93 - (text, date, user.id), 94 - )?; 72 + let task = conn 73 + .interact(move |conn| { 74 + let task = conn.query_row( 75 + "INSERT INTO tasks (text, date, user) VALUES (?1, ?2, ?3) RETURNING rowid, CAST(text as TEXT), date, checked", 76 + (text, date, user.id), 77 + |row| { 78 + Ok(Task { 79 + id: row.get(0)?, 80 + text: row.get(1)?, 81 + date: row.get(2)?, 82 + checked: row.get(3)?, 83 + }) 84 + }, 85 + )?; 95 86 96 - SqlRes::Ok(()) 97 - }) 98 - .await 99 - .unwrap() 100 - .unwrap(); 87 + SqlRes::Ok(task) 88 + }) 89 + .await 90 + .unwrap() 91 + .unwrap(); 101 92 102 93 let mut headers = HeaderMap::new(); 103 94 headers.insert("HX-Trigger", HeaderValue::from_static("taskCreated")); 104 - headers 95 + (headers, Json(serde_json::to_string(&task).unwrap())) 105 96 } 106 97 107 98 pub async fn delete_task( ··· 135 126 let task: Task = conn 136 127 .interact(move |conn| { 137 128 let mut task = conn.query_row( 138 - "SELECT rowid, text, date, checked FROM tasks WHERE rowid = ?1", 129 + "SELECT rowid, CAST(text as TEXT), date, checked FROM tasks WHERE rowid = ?1", 139 130 [id.clone()], 140 131 |row| { 141 132 Ok(Task { ··· 162 153 163 154 let headers = HeaderMap::new(); 164 155 // headers.insert("HX-Trigger", HeaderValue::from_static("taskUpdated")); 165 - (headers, task.html()) 156 + (headers) 166 157 } 167 158 168 159 pub async fn pushback_task( ··· 179 170 let conn = pool.get().await.unwrap(); 180 171 conn.interact(move |conn| { 181 172 let mut task = conn.query_row( 182 - "SELECT rowid, text, date, checked FROM tasks WHERE rowid = ?1", 173 + "SELECT rowid, CAST(text as TEXT), date, checked FROM tasks WHERE rowid = ?1", 183 174 [id.clone()], 184 175 |row| { 185 176 Ok(Task { ··· 212 203 #[derive(Deserialize)] 213 204 pub struct ListTasks { 214 205 #[serde(rename = "when")] 215 - when: TaskWhen, 206 + pub when: TaskWhen, 207 + } 208 + 209 + pub struct Unauthenticated; 210 + 211 + pub async fn tasks_internal( 212 + State(pool): Spool, 213 + jar: CookieManager, 214 + form: ListTasks, 215 + ) -> Result<Vec<Task>, Unauthenticated> { 216 + let (user, _jar) = session(State(pool.clone()), jar).await; 217 + 218 + let Some(user) = user else { 219 + return Err(Unauthenticated); 220 + }; 221 + 222 + let date = match form.when { 223 + TaskWhen::Today => user.today(), 224 + TaskWhen::Tomorrow => user.tomorrow(), 225 + }; 226 + 227 + let user_id = user.id; 228 + let conn = pool.get().await.unwrap(); 229 + let tasks = conn 230 + .interact(move |conn| { 231 + let mut stmt = conn.prepare( 232 + match form.when { 233 + TaskWhen::Today => { 234 + "SELECT rowid, CAST(text as TEXT), date, checked FROM tasks WHERE date <= ?1 AND user = ?2" 235 + 236 + }, 237 + TaskWhen::Tomorrow => { 238 + "SELECT rowid, CAST(text as TEXT), date, checked FROM tasks WHERE date = ?1 AND user = ?2" 239 + 240 + } 241 + } 242 + // "SELECT rowid, text, date, checked FROM tasks WHERE date = ?1 AND user = ?2", 243 + )?; 244 + 245 + let tasks: SqlRes<Vec<Task>> = stmt 246 + .query_map((date, user_id), |row| { 247 + Ok(Task { 248 + id: row.get(0)?, 249 + text: row.get(1)?, 250 + date: row.get(2)?, 251 + checked: row.get(3)?, 252 + }) 253 + })? 254 + .collect(); 255 + 256 + SqlRes::Ok(tasks.unwrap()) 257 + }) 258 + .await 259 + .unwrap() 260 + .unwrap(); 261 + 262 + Ok(tasks) 216 263 } 217 264 218 265 pub async fn tasks( ··· 236 283 let mut stmt = conn.prepare( 237 284 match form.when { 238 285 TaskWhen::Today => { 239 - "SELECT rowid, text, date, checked FROM tasks WHERE date <= ?1 AND user = ?2" 286 + "SELECT rowid, CAST(text as TEXT), date, checked FROM tasks WHERE date <= ?1 AND user = ?2" 240 287 241 288 }, 242 289 TaskWhen::Tomorrow => { 243 - "SELECT rowid, text, date, checked FROM tasks WHERE date = ?1 AND user = ?2" 290 + "SELECT rowid, CAST(text as TEXT), date, checked FROM tasks WHERE date = ?1 AND user = ?2" 244 291 245 292 } 246 293 }
+18 -12
src/user.rs
··· 2 2 Form, Json, 3 3 extract::State, 4 4 http::{HeaderMap, HeaderValue, StatusCode}, 5 - response::Html, 5 + response::{Html, Redirect}, 6 6 }; 7 7 use axum_cookie::CookieManager; 8 8 use chrono::{DateTime, Days, NaiveDate, Utc}; 9 9 use chrono_tz::Tz; 10 10 use serde::{Deserialize, Serialize}; 11 + use serde_json::json; 11 12 12 13 use crate::{ 13 14 SqlRes, ··· 53 54 State(pool): Spool, 54 55 jar: CookieManager, 55 56 Form(payload): Form<Login>, 56 - ) -> (HeaderMap, StatusCode) { 57 + ) -> (HeaderMap, Redirect) { 57 58 let (_, mut jar) = session(State(pool.clone()), jar).await; 58 59 59 60 let conn = pool.get().await.unwrap(); ··· 73 74 let mut map = HeaderMap::new(); 74 75 map.insert("HX-Trigger", HeaderValue::from_static("login")); 75 76 76 - (map, StatusCode::OK) 77 + (map, Redirect::to("/")) 77 78 } 78 79 79 80 #[derive(Deserialize)] ··· 121 122 [get_word(), get_word(), get_word(), get_word()].join(" ") 122 123 } 123 124 124 - pub async fn user_slug(State(pool): Spool, jar: CookieManager) -> Html<String> { 125 + type MaybeJson<T> = Result<Json<T>, ()>; 126 + fn yes_json<T>(i: T) -> MaybeJson<T> { 127 + Ok(axum::Json(i)) 128 + } 129 + fn no_json<T>() -> MaybeJson<T> { 130 + Err(()) 131 + } 132 + 133 + pub async fn user_info(State(pool): Spool, jar: CookieManager) -> (StatusCode, MaybeJson<User>) { 125 134 let (user, _jar) = session(State(pool), jar).await; 126 135 127 - if let Some(user) = user { 128 - Html(format!( 129 - "You are logged in. Your user ID is {}. <br> You are in timezone {}. <br><br> Your login code is <samp><input value=\"{}\" readonly></samp>. <br> Use this to log in on other devices. If you want to ensure your tasks are saved, write this code down.", 130 - user.id, user.timezone, user.pass 131 - )) 132 - } else { 133 - Html("You are logged out".to_string()) 134 - } 136 + let Some(user) = user else { 137 + return (StatusCode::UNAUTHORIZED, no_json()); 138 + }; 139 + 140 + (StatusCode::OK, yes_json(user)) 135 141 }
+169 -13
static/css/basic.css
··· 65 65 66 66 67 67 article { 68 - border: 2px solid light-dark(#eee, #333); 69 - border-top: none; 70 - border-bottom: none; 71 - box-shadow: 3px 5px 5px light-dark(lightgray, rgb(59, 59, 59)); 68 + 72 69 box-sizing: border-box; 73 - } 74 70 75 - .otherheading, 76 - .firstheading { 77 - font-weight: 500; 71 + filter: drop-shadow(3px 5px 5px light-dark(lightgray, hsl(250 15% 0% / 1))); 78 72 } 79 73 80 - .task-label.checked { 81 - text-decoration: line-through; 82 - text-decoration-style: solid; 83 - text-decoration-thickness: 2px; 74 + .card-body { 75 + mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 24px 100%; 84 76 } 85 77 86 78 .is-loading::after { 87 79 content: "◌"; 88 80 animation: 4s linear 0s infinite running spinner, 0.25s ease-in 0s 1 running fade-in; 89 - 90 81 } 91 82 92 83 @keyframes fade-in { ··· 107 98 to { 108 99 transform: rotate(360deg); 109 100 } 101 + } 102 + 103 + task-item { 104 + --font: "Shantell Sans", cursive; 105 + } 106 + 107 + /* Page styling */ 108 + 109 + article { 110 + flex-direction: column; 111 + display: flex; 112 + } 113 + 114 + .card-head { 115 + --rule-start: 2rem; 116 + --text-start: .3rem; 117 + --line-height: calc(2.6rem + 2px); 118 + 119 + height: 3.9rem; 120 + padding-top: 1.3rem; 121 + background-position: 0px -2px; 122 + 123 + } 124 + 125 + .ruled { 126 + --rule-color: light-dark(#abced4, #c86363); 127 + 128 + /* https://projects.verou.me/css3patterns/#lined-paper */ 129 + background-color: light-dark(white, #141414); 130 + background-image: 131 + linear-gradient(90deg, 132 + transparent var(--rule-start), 133 + var(--rule-color) var(--rule-start), 134 + var(--rule-color) calc(var(--rule-start) + 2px), 135 + transparent calc(var(--rule-start) + 2px)), 136 + linear-gradient(light-dark(#eee, #333) 2px, transparent 2px); 137 + background-size: 100% var(--line-height); 138 + } 139 + 140 + .card-head .headercontainer { 141 + margin-left: calc(var(--text-start) + var(--rule-start)); 142 + gap: .5em; 143 + } 144 + 145 + .card-head .headercontainer button { 146 + background: 0; 147 + border: 0; 148 + margin: -2px 0 0; 149 + padding: 0; 150 + font-size: 32px; 151 + line-height: 1.3; 152 + text-decoration: underline; 153 + } 154 + 155 + .card-head .headercontainer button:before, 156 + .card-head .headercontainer button:after { 157 + content: ""; 158 + width: 0; 159 + height: 0; 160 + display: block; 161 + } 162 + 163 + .card-head .headercontainer button:before { 164 + margin-bottom: -.3em; 165 + } 166 + 167 + .card-head .headercontainer button:after { 168 + margin-top: -.3em; 169 + } 170 + 171 + .card-head .headercontainer button:not([active]) { 172 + color: gray; 173 + font-style: italic; 174 + } 175 + 176 + .card-head .headercontainer { 177 + display: inline-flex; 178 + } 179 + 180 + .card { 181 + --rule-start: 2rem; 182 + --text-start: .3rem; 183 + --line-height: 21px; 184 + height: 42px; 185 + position: relative; 186 + } 187 + 188 + .card li, 189 + .card label, 190 + .card form.addtodo button { 191 + margin: 2px 0 -2px; 192 + font-size: 16px; 193 + } 194 + 195 + .card button { 196 + cursor: pointer; 197 + } 198 + 199 + .card p, 200 + .card form.addtodo { 201 + margin: 0; 202 + margin-left: calc(var(--text-start) + var(--rule-start)); 203 + flex-direction: row; 204 + align-items: baseline; 205 + gap: .5rem; 206 + margin-top: 2px; 207 + display: flex; 208 + } 209 + 210 + .card autowidth-input { 211 + min-width: 5.8ch; 212 + max-width: 17ch; 213 + margin: 2px 0 -2px; 214 + font-size: 16px; 215 + } 216 + 217 + .card button, 218 + .card input, 219 + .card form:not(.addtodo) { 220 + background: 0; 221 + border: 0; 222 + margin: 0; 223 + padding: 0; 224 + } 225 + 226 + .card-body { 227 + --rule-start: 2rem; 228 + --text-start: .3rem; 229 + --line-height: 100%; 230 + background-repeat: no-repeat; 231 + padding-top: 4px; 232 + padding-bottom: 17px; 233 + } 234 + 235 + .card-body ul { 236 + flex-direction: column; 237 + margin: 0; 238 + padding: 0; 239 + display: flex; 240 + } 241 + 242 + .card-head, 243 + .card-head input, 244 + .card-head button, 245 + .card, 246 + .card input, 247 + .card button, 248 + .card-body, 249 + .card-body input, 250 + .card-body button { 251 + font-optical-sizing: auto; 252 + font-variation-settings: "BNCE" 0, "INFM" 0, "SPAC" 0; 253 + font-synthesis: none; 254 + font-family: Shantell Sans, cursive; 255 + font-style: normal; 256 + font-weight: 400; 257 + } 258 + 259 + .card-head select, 260 + .card-head button, 261 + .card select, 262 + .card button, 263 + .card-body select, 264 + .card-body button { 265 + color: light-dark(#000, #fff); 110 266 }
-243
static/css/out.css
··· 1 - article { 2 - flex-direction: column; 3 - display: flex; 4 - } 5 - 6 - .card-head { 7 - --rule-start: 2rem; 8 - --text-start: .3rem; 9 - background-color: light-dark(#fff, #000); 10 - background-image: linear-gradient(90deg, transparent var(--rule-start), light-dark(#abced4, #c86363) var(--rule-start), light-dark(#abced4, #c86363) calc(var(--rule-start) + 2px), transparent calc(var(--rule-start) + 2px)), linear-gradient(light-dark(#eee, #333) .1em, transparent .1em); 11 - background-size: 100% 2.6rem; 12 - height: 3.9rem; 13 - padding-top: 1.3rem; 14 - } 15 - 16 - .card-head .headercontainer { 17 - margin-left: calc(var(--text-start) + var(--rule-start)); 18 - gap: .5em; 19 - } 20 - 21 - .card-head .headercontainer button { 22 - background: 0; 23 - border: 0; 24 - margin: -2px 0 0; 25 - padding: 0; 26 - font-size: 32px; 27 - line-height: 1.3; 28 - text-decoration: underline; 29 - } 30 - 31 - .card-head .headercontainer button:before, .card-head .headercontainer button:after { 32 - content: ""; 33 - width: 0; 34 - height: 0; 35 - display: block; 36 - } 37 - 38 - .card-head .headercontainer button:before { 39 - margin-bottom: -.3em; 40 - } 41 - 42 - .card-head .headercontainer button:after { 43 - margin-top: -.3em; 44 - } 45 - 46 - .card-head .headercontainer button:not([active]) { 47 - color: gray; 48 - font-style: italic; 49 - } 50 - 51 - .card-head h1 { 52 - margin: -2px 0 0; 53 - font-size: 32px; 54 - line-height: 1.3; 55 - } 56 - 57 - .card-head h1:before, .card-head h1:after { 58 - content: ""; 59 - width: 0; 60 - height: 0; 61 - display: block; 62 - } 63 - 64 - .card-head h1:before { 65 - margin-bottom: -.3em; 66 - } 67 - 68 - .card-head h1:after { 69 - margin-top: -.3em; 70 - } 71 - 72 - .card-head .headercontainer { 73 - display: inline-flex; 74 - } 75 - 76 - .card-head .firstheading { 77 - display: inline; 78 - } 79 - 80 - .card-head .otherheading { 81 - color: light-dark(#483d8b, #a498f0); 82 - cursor: pointer; 83 - font-style: italic; 84 - font-weight: 700; 85 - text-decoration: underline; 86 - } 87 - 88 - .card { 89 - --rule-start: 2rem; 90 - --text-start: .3rem; 91 - background-color: light-dark(#fff, #000); 92 - background-image: linear-gradient(90deg, transparent var(--rule-start), light-dark(#abced4, #c86363) var(--rule-start), light-dark(#abced4, #c86363) calc(var(--rule-start) + 2px), transparent calc(var(--rule-start) + 2px)), linear-gradient(light-dark(#eee, #333) .1em, transparent .1em); 93 - background-size: 100% 21px; 94 - height: 42px; 95 - position: relative; 96 - } 97 - 98 - .card p { 99 - margin: 0; 100 - font-size: 16px; 101 - line-height: 1.3; 102 - } 103 - 104 - .card p:before, .card p:after { 105 - content: ""; 106 - width: 0; 107 - height: 0; 108 - display: block; 109 - } 110 - 111 - .card p:before { 112 - margin-bottom: -.3em; 113 - } 114 - 115 - .card p:after { 116 - margin-top: -.3em; 117 - } 118 - 119 - .card li, .card label, .card form.addtodo button { 120 - margin: 2px 0 -2px; 121 - font-size: 16px; 122 - } 123 - 124 - .card button { 125 - cursor: pointer; 126 - } 127 - 128 - .card p, .card form.addtodo { 129 - margin: 0; 130 - margin-left: calc(var(--text-start) + var(--rule-start)); 131 - flex-direction: row; 132 - align-items: baseline; 133 - gap: .5rem; 134 - margin-top: 2px; 135 - display: flex; 136 - } 137 - 138 - .card autowidth-input { 139 - min-width: 5.8ch; 140 - max-width: 17ch; 141 - margin: 2px 0 -2px; 142 - font-size: 16px; 143 - } 144 - 145 - .card button, .card input, .card form:not(.addtodo) { 146 - background: 0; 147 - border: 0; 148 - margin: 0; 149 - padding: 0; 150 - } 151 - 152 - .card input::placeholder { 153 - color: light-dark(gray, #d3d3d3); 154 - } 155 - 156 - .card-body { 157 - --rule-start: 2rem; 158 - --text-start: .3rem; 159 - background-color: light-dark(#fff, #000); 160 - background-image: linear-gradient(90deg, transparent var(--rule-start), light-dark(#abced4, #c86363) var(--rule-start), light-dark(#abced4, #c86363) calc(var(--rule-start) + 2px), transparent calc(var(--rule-start) + 2px)), linear-gradient(light-dark(#eee, #333) .1em, transparent .1em); 161 - background-repeat: no-repeat; 162 - background-size: 100% 100%; 163 - padding-top: 4px; 164 - padding-bottom: 17px; 165 - } 166 - 167 - .card-body ul { 168 - flex-direction: column; 169 - margin: 0; 170 - padding: 0; 171 - display: flex; 172 - } 173 - 174 - .card-body ul .list-item { 175 - background-color: light-dark(#fff, #000); 176 - background-image: linear-gradient(90deg, transparent var(--rule-start), light-dark(#abced4, #c86363) var(--rule-start), light-dark(#abced4, #c86363) calc(var(--rule-start) + 2px), transparent calc(var(--rule-start) + 2px)), linear-gradient(light-dark(#eee, #333) .1em, transparent .1em); 177 - background-position: 0 17px; 178 - background-size: 100% 21px; 179 - display: block; 180 - position: relative; 181 - } 182 - 183 - .card-body ul .list-item:after { 184 - content: "◦"; 185 - position: absolute; 186 - top: -3px; 187 - left: 18px; 188 - } 189 - 190 - .card-body ul .list-item li { 191 - word-break: normal; 192 - overflow-wrap: anywhere; 193 - padding-inline-start: calc(var(--text-start) + var(--rule-start)); 194 - list-style-type: none; 195 - position: relative; 196 - } 197 - 198 - .card-body ul .list-item li button, .card-body ul .list-item li details { 199 - color: light-dark(gray, #d3d3d3); 200 - font-size: 10pt; 201 - font-weight: lighter; 202 - } 203 - 204 - .card-body ul .list-item li button, .card-body ul .list-item li input, .card-body ul .list-item li form:not(.addtodo) { 205 - background: 0; 206 - border: 0; 207 - margin: 0; 208 - padding: 0; 209 - } 210 - 211 - .card-body ul .list-item li details { 212 - flex-direction: row; 213 - gap: .5rem; 214 - display: inline-flex; 215 - } 216 - 217 - @supports ((-moz-appearance: none)) { 218 - .card-body ul .list-item li details { 219 - display: ruby !important; 220 - } 221 - } 222 - 223 - .card-body ul .list-item li summary { 224 - cursor: pointer; 225 - display: inline; 226 - } 227 - 228 - .card-body ul .list-item li details[open] summary:after { 229 - content: ":"; 230 - } 231 - 232 - .card-head, .card-head input, .card-head button, .card, .card input, .card button, .card-body, .card-body input, .card-body button { 233 - font-optical-sizing: auto; 234 - font-variation-settings: "BNCE" 0, "INFM" 0, "SPAC" 0; 235 - font-synthesis: none; 236 - font-family: Shantell Sans, cursive; 237 - font-style: normal; 238 - font-weight: 400; 239 - } 240 - 241 - .card-head select, .card-head button, .card select, .card button, .card-body select, .card-body button { 242 - color: light-dark(#000, #fff); 243 - }
-331
static/css/style.scss
··· 1 - /* For annoying layout stuffs */ 2 - 3 - @mixin text-crop($line-height: 1.3, 4 - $top-adjustment: 0px, 5 - $bottom-adjustment: 0px) { 6 - // Configured in Step 1 7 - $top-crop: 9; 8 - $bottom-crop: 9; 9 - $crop-font-size: 36; 10 - $crop-line-height: 1.2; 11 - 12 - // Apply values to calculate em-based margins that work with any font size 13 - $dynamic-top-crop: max(($top-crop + ($line-height - $crop-line-height) * ($crop-font-size / 2)), 14 - 0) / $crop-font-size; 15 - $dynamic-bottom-crop: max(($bottom-crop + ($line-height - $crop-line-height) * ($crop-font-size / 2)), 16 - 0) / $crop-font-size; 17 - 18 - // Mixin output 19 - line-height: $line-height; 20 - 21 - &::before, 22 - &::after { 23 - content: ""; 24 - display: block; 25 - height: 0; 26 - width: 0; 27 - } 28 - 29 - &::before { 30 - margin-bottom: calc(-#{$dynamic-top-crop}em + #{$top-adjustment}); 31 - } 32 - 33 - &::after { 34 - margin-top: calc(-#{$dynamic-bottom-crop}em + #{$bottom-adjustment}); 35 - } 36 - } 37 - 38 - // Mixin generated at: http://text-crop.eightshapes.com/?typeface-selection=custom-font&typeface=Seymour%20One&custom-typeface-name=Shantell%20Sans&custom-typeface-url=&custom-typeface-weight=400&custom-typeface-style=normal&weight-and-style=regular&size=36&line-height=1.2&top-crop=9&bottom-crop=9 39 - 40 - /* Usage Examples 41 - .my-level-1-heading-class { 42 - @include text-crop; // Will use default line height of 1.3 43 - font-size: 48px; 44 - margin: 0 0 0 16px; 45 - } 46 - 47 - .my-level-2-heading-class { 48 - @include text-crop; // Will use default line height of 1.3 49 - font-size: 32px; // Don't need to change any settings, will work with any font size automatically 50 - margin: 0 0 0 16px; 51 - } 52 - 53 - .my-body-copy-class { 54 - @include text-crop($line-height: 2); // Larger line height desired, set the line height via the mixin 55 - font-size: 16px; 56 - } 57 - 58 - // Sometimes depending on the font-size, the rendering, the browser, etc. you may need to tweak the output. 59 - // You can adjust the top and bottom cropping when invoking the component using the $top-adjustment and $bottom-adjustment settings 60 - 61 - .slight-adjustment-needed { 62 - @include text-crop($top-adjustment: -0.5px, $bottom-adjustment: 2px); 63 - font-size: 17px; 64 - } 65 - 66 - .dont-do-this { 67 - @include text-crop; 68 - font-size: 16px; 69 - line-height: 3; // DO NOT set line height outside of the mixin, the mixin needs the line height value to calculate the crop correctly 70 - } 71 - */ 72 - 73 - @mixin ruled_background($line-height) { 74 - 75 - $rule-color: light-dark(#abced4, #c86363); 76 - 77 - /* https://projects.verou.me/css3patterns/#lined-paper */ 78 - background-color: light-dark(white, black); 79 - background-image: 80 - linear-gradient(90deg, 81 - transparent var(--rule-start), 82 - $rule-color var(--rule-start), 83 - $rule-color calc(var(--rule-start) + 2px), 84 - transparent calc(var(--rule-start) + 2px)), 85 - linear-gradient(light-dark(#eee, #333) 0.1em, transparent 0.1em); 86 - background-size: 100% $line-height; 87 - } 88 - 89 - article { 90 - display: flex; 91 - flex-direction: column; 92 - } 93 - 94 - .card-head { 95 - height: 3.9rem; 96 - --rule-start: 2rem; 97 - --text-start: 0.3rem; 98 - 99 - @include ruled_background(2.6rem); 100 - 101 - padding-top: 1.3rem; 102 - 103 - .headercontainer { 104 - margin-left: calc(var(--text-start) + var(--rule-start)); 105 - gap: 0.5em; 106 - 107 - button { 108 - padding: 0; 109 - border: 0; 110 - background: 0; 111 - 112 - @include text-crop; 113 - font-size: 32px; 114 - margin: -2px 0 0 0; 115 - 116 - text-decoration: underline; 117 - } 118 - 119 - button:not([active]) { 120 - color: gray; 121 - font-style: italic; 122 - } 123 - } 124 - 125 - h1 { 126 - @include text-crop; 127 - font-size: 32px; 128 - margin: -2px 0 0 0; 129 - } 130 - 131 - 132 - .headercontainer { 133 - display: inline-flex; 134 - } 135 - 136 - .firstheading { 137 - display: inline; 138 - } 139 - 140 - .otherheading { 141 - font-weight: 700; 142 - color: light-dark(darkslateblue, #a498f0); 143 - font-style: italic; 144 - text-decoration: underline; 145 - cursor: pointer; 146 - } 147 - } 148 - 149 - .card { 150 - position: relative; 151 - --rule-start: 2rem; 152 - --text-start: 0.3rem; 153 - 154 - @include ruled_background(21px); 155 - 156 - height: 42px; 157 - 158 - p { 159 - margin: 0; 160 - } 161 - 162 - p { 163 - @include text-crop; 164 - font-size: 16px; 165 - } 166 - 167 - li, 168 - label, 169 - form.addtodo button { 170 - font-size: 16px; 171 - margin: 2px 0 -2px 0; 172 - } 173 - 174 - button { 175 - cursor: pointer; 176 - } 177 - 178 - p, 179 - form.addtodo { 180 - display: flex; 181 - flex-direction: row; 182 - margin: 0; 183 - margin-left: calc(var(--text-start) + var(--rule-start)); 184 - margin-top: 2px; 185 - align-items: baseline; 186 - gap: 0.5rem; 187 - } 188 - 189 - autowidth-input { 190 - font-size: 16px; 191 - min-width: 5.8ch; 192 - max-width: 17ch; 193 - margin: 2px 0 -2px; 194 - } 195 - 196 - button, 197 - input, 198 - form:not(.addtodo) { 199 - margin: 0; 200 - padding: 0; 201 - border: 0; 202 - background: 0; 203 - } 204 - 205 - input::placeholder { 206 - color: light-dark(gray, lightgray); 207 - } 208 - 209 - } 210 - 211 - .card-body { 212 - $my-text-nudge: 17px; 213 - $my-line-height: 21px; 214 - 215 - --rule-start: 2rem; 216 - --text-start: 0.3rem; 217 - @include ruled_background(100%); 218 - background-repeat: no-repeat; 219 - 220 - padding-top: calc($my-line-height - $my-text-nudge); 221 - padding-bottom: calc($my-text-nudge); 222 - 223 - 224 - ul { 225 - margin: 0; 226 - display: flex; 227 - flex-direction: column; 228 - padding: 0; 229 - 230 - .list-item { 231 - 232 - position: relative; 233 - 234 - &:after { 235 - content: '◦'; 236 - position: absolute; 237 - left: 18px; 238 - top: -3px; 239 - } 240 - 241 - @include ruled_background($my-line-height); 242 - background-position: 0px $my-text-nudge; 243 - 244 - display: block; 245 - 246 - // li:before { 247 - // content: '• '; 248 - // position: absolute; 249 - // } 250 - 251 - li { 252 - position: relative; 253 - list-style-type: none; 254 - 255 - padding-inline-start: calc(var(--text-start) + var(--rule-start)); 256 - word-break: normal; 257 - overflow-wrap: anywhere; 258 - 259 - button, 260 - details { 261 - color: light-dark(gray, lightgray); 262 - font-size: 10pt; 263 - font-weight: lighter; 264 - } 265 - 266 - button, 267 - input, 268 - form:not(.addtodo) { 269 - margin: 0; 270 - padding: 0; 271 - border: 0; 272 - background: 0; 273 - } 274 - 275 - details { 276 - 277 - /* Current bug on stable firefox, fixed on nightly. */ 278 - /* Revert in 2027 or something */ 279 - /* REPRODUCE: ff macOS 140.0.2 (aarch64) */ 280 - /* <3 */ 281 - @supports (-moz-appearance:none) { 282 - & { 283 - display: ruby !important; 284 - } 285 - } 286 - 287 - display: inline-flex; 288 - flex-direction: row; 289 - gap: 0.5rem; 290 - } 291 - 292 - summary { 293 - cursor: pointer; 294 - display: inline; 295 - } 296 - 297 - details[open] summary:after { 298 - content: ":"; 299 - } 300 - } 301 - } 302 - 303 - } 304 - } 305 - 306 - .card-head, 307 - .card, 308 - .card-body { 309 - 310 - &, 311 - input, 312 - button { 313 - /**/ 314 - font-family: "Shantell Sans", cursive; 315 - font-optical-sizing: auto; 316 - font-weight: 400; 317 - font-style: normal; 318 - font-variation-settings: 319 - "BNCE" 0, 320 - "INFM" 0, 321 - "SPAC" 0; 322 - 323 - font-synthesis: none; 324 - } 325 - 326 - select, 327 - button { 328 - color: light-dark(black, white); 329 - } 330 - 331 - }
+91
static/js/custom-elements/task-item.js
··· 1 + import { DeclarativeElement } from "../modules/component-element.js"; 2 + 3 + const tomorrow_ul = document.querySelector(".card-body.tomorrow ul"); 4 + 5 + 6 + class TaskItem extends DeclarativeElement { 7 + static element_name = "task-item"; 8 + 9 + static attrs = ["task_id", "checked", "day"]; 10 + 11 + start(shadow) { 12 + const messageSpan = shadow.querySelector("slot.message"); 13 + this.message = messageSpan.textContent; 14 + 15 + messageSpan.addEventListener("click", async () => { 16 + messageSpan.classList.add("is-loading"); 17 + 18 + const response = await fetch("/task/complete", { 19 + method: "POST", 20 + body: new URLSearchParams({ 21 + "id": this.task_id 22 + }) 23 + }); 24 + 25 + messageSpan.classList.remove("is-loading"); 26 + 27 + if (response.ok) { 28 + this.toggleAttribute("checked"); 29 + } 30 + }); 31 + 32 + const btn_delete = shadow.querySelector("button.button-delete"); 33 + 34 + btn_delete.addEventListener("click", async () => { 35 + btn_delete.classList.add("is-loading"); 36 + 37 + const response = await fetch("/task/delete", { 38 + method: "POST", 39 + body: new URLSearchParams({ 40 + "id": this.task_id 41 + }) 42 + }); 43 + 44 + btn_delete.classList.remove("is-loading"); 45 + 46 + if (response.ok) { 47 + this.remove(); 48 + } 49 + }) 50 + 51 + const btn_pushback = shadow.querySelector("button.button-pushback"); 52 + 53 + btn_pushback.addEventListener("click", async () => { 54 + btn_pushback.classList.add("is-loading"); 55 + 56 + const response = await fetch("/task/pushback", { 57 + method: "POST", 58 + body: new URLSearchParams({ 59 + "id": this.task_id 60 + }) 61 + }); 62 + 63 + btn_pushback.classList.remove("is-loading"); 64 + 65 + if (response.ok) { 66 + tomorrow_ul.appendChild(this); 67 + shadow.querySelectorAll("details").forEach(element => { 68 + element.removeAttribute("open"); 69 + }); 70 + } 71 + }) 72 + 73 + } 74 + 75 + attributeSet(property, oldValue, newValue) { 76 + if (newValue == null) { 77 + this.shadow.querySelector(".list-item").removeAttribute(property); 78 + 79 + } else { 80 + this.shadow.querySelector(".list-item").setAttribute(property, newValue); 81 + 82 + } 83 + } 84 + 85 + 86 + } 87 + 88 + TaskItem.define(); 89 + 90 + 91 + export { TaskItem }
+5
static/js/main.js
··· 1 + import './modules/components.js'; 2 + import './modules/user.js'; 3 + import './custom-elements/task-item.js'; 4 + import "./modules/header-nav.js"; 5 + import "./modules/add-todo.js";
+45
static/js/modules/add-todo.js
··· 1 + const form_add = document.querySelector("form.addtodo"); 2 + const list_today = document.querySelector("article div.card-body.today ul"); 3 + const list_tomorrow = document.querySelector("article div.card-body.tomorrow ul"); 4 + 5 + form_add.addEventListener("submit", async (event) => { 6 + event.preventDefault(); 7 + form_add.classList.add("is-loading"); 8 + 9 + const body = new URLSearchParams(new FormData(form_add)); 10 + 11 + const response = await fetch("/task/new", { 12 + method: "POST", 13 + body: new URLSearchParams(new FormData(form_add)) 14 + }); 15 + 16 + form_add.classList.remove("is-loading"); 17 + 18 + if (response.ok) { 19 + form_add.reset(); 20 + 21 + console.log("Response OK"); 22 + 23 + let task = JSON.parse(await response.json()); 24 + console.log(JSON.stringify(task)); 25 + console.log(task.text); 26 + 27 + const when = body.get("when"); 28 + 29 + let list; 30 + if (when === "today") { 31 + list = list_today; 32 + } else if (when === "tomorrow") { 33 + list = list_tomorrow; 34 + } 35 + 36 + let taskItem = document.createElement("task-item"); 37 + taskItem.setAttribute("task_id", task.id); 38 + taskItem.setAttribute("day", when); 39 + if (task.checked) taskItem.setAttribute("checked", ""); 40 + taskItem.innerHTML = `<span slot="message">${task.text}</span>`; 41 + 42 + list.appendChild(taskItem); 43 + } 44 + 45 + })
+67
static/js/modules/component-element.js
··· 1 + // To be paired with a server-side rendering step. 2 + class DeclarativeElement extends HTMLElement { 3 + static element_name = "never"; 4 + 5 + static attrs = []; 6 + dryAttributes = []; 7 + 8 + constructor() { 9 + super(); 10 + } 11 + 12 + connectedCallback() { 13 + const supportsDeclarative = HTMLElement.prototype.hasOwnProperty("attachInternals"); 14 + const internals = supportsDeclarative ? this.attachInternals() : undefined; 15 + 16 + // check for a Declarative Shadow Root. 17 + let shadow = internals?.shadowRoot; 18 + 19 + if (!shadow) { 20 + // there wasn't one. create a new Shadow Root: 21 + shadow = this.attachShadow({ 22 + mode: "closed", 23 + }); 24 + const templateEl = document.querySelector(`template[element="${this.constructor.element_name}"]`); 25 + shadow.append(templateEl.content.cloneNode(true)); 26 + } 27 + 28 + this.shadow = shadow; 29 + 30 + this.dryAttributes.forEach(element => { 31 + this.attributeSet(element.property, element.oldValue, element.newValue); 32 + }); 33 + this.start(shadow); 34 + } 35 + 36 + static get observedAttributes() { 37 + return this.attrs; 38 + } 39 + attributeChangedCallback(property, oldValue, newValue) { 40 + if (oldValue === newValue) return; 41 + this[property] = newValue; 42 + 43 + if (this.shadow == null) { 44 + this.dryAttributes.push({ property: property, oldValue: oldValue, newValue: newValue }); 45 + } else { 46 + this.attributeSet(property, oldValue, newValue); 47 + } 48 + } 49 + 50 + static define() { 51 + if (this.element_name === undefined) { 52 + console.warn("No template!"); 53 + } 54 + customElements.define(this.element_name, this); 55 + } 56 + 57 + start(shadow) { 58 + // ... 59 + } 60 + 61 + attributeSet(property, oldValue, newValue) { 62 + // ... 63 + } 64 + } 65 + 66 + 67 + export { DeclarativeElement };
+93
static/js/modules/components.js
··· 1 + 2 + // Credit: https://css-tricks.com/auto-growing-inputs-textareas/#comment-1787000 3 + // Please use theirs, not mine. I have modified it for my own purposes. 4 + const autoWidthTemplate = document.createElement('template'); 5 + autoWidthTemplate.innerHTML = ` 6 + <style> 7 + :host { 8 + display: inline-block; 9 + vertical-align: top; 10 + align-items: center; 11 + position: relative; 12 + } 13 + :host::after { 14 + width: auto; 15 + min-width: 1em; 16 + content: attr(data-value) ' '; 17 + visibility: hidden; 18 + white-space: pre-wrap; 19 + font: inherit; 20 + pointer-events: none; 21 + overflow-wrap: anywhere; 22 + touch-action: none; /* these two rules are just in case*/ 23 + z-index: -99; /* prevents inputs */ 24 + } 25 + input { 26 + font: inherit; 27 + width: 100%; 28 + min-width: 6ch; 29 + position: absolute; 30 + border: 0; 31 + padding: 0; /* for iOS */ 32 + background: none; 33 + } 34 + </style> 35 + <input size='1'></input> 36 + `; 37 + class AutoWidthInput extends HTMLElement { 38 + static get formAssociated() { 39 + return true; 40 + } 41 + 42 + constructor() { 43 + super(); 44 + this.internals = this.attachInternals(); 45 + 46 + this._shadowRoot = this.attachShadow({ mode: 'open' }); 47 + this._shadowRoot.appendChild(autoWidthTemplate.content.cloneNode(true)); 48 + this._input = this._shadowRoot.querySelector('input'); 49 + 50 + this.value_ = this._input.value; 51 + 52 + } 53 + _manageValidity() { 54 + const value = this._input.value; 55 + const required = this._input.hasAttribute("required"); 56 + 57 + if (value === '' && required) { 58 + this.internals.setValidity({ 59 + valueMissing: true 60 + }, 'This field is required', this._input); 61 + } else { 62 + this.internals.setValidity({}); 63 + } 64 + } 65 + 66 + connectedCallback() { 67 + this.value = this._input.value; 68 + 69 + this._input.addEventListener('input', (e) => { 70 + this.value = this._input.value; 71 + }); 72 + } 73 + 74 + formResetCallback() { 75 + this.value = ""; 76 + } 77 + get value() { 78 + return this._input.value; 79 + } 80 + set value(v) { 81 + this._input.value = v; 82 + this.dataset.value = v; 83 + this.internals.setFormValue(v); 84 + this._manageValidity(); 85 + } 86 + static get observedAttributes() { 87 + return ['placeholder', 'name', 'required']; 88 + } 89 + attributeChangedCallback(name, oldVal, newVal) { 90 + this._input.setAttribute(name, newVal); 91 + } 92 + } 93 + window.customElements.define('autowidth-input', AutoWidthInput);
+22
static/js/modules/header-nav.js
··· 1 + const btn_today = document.querySelector("button.header-today"); 2 + const btn_tomorrow = document.querySelector("button.header-tomorrow"); 3 + const main = document.querySelector("#main"); 4 + const inp_when = document.querySelector("#input-when"); 5 + 6 + btn_today.addEventListener("click", toggle_today); 7 + btn_tomorrow.addEventListener("click", toggle_tomorrow); 8 + 9 + async function toggle_today() { 10 + btn_today.setAttribute("active", ""); 11 + btn_tomorrow.removeAttribute("active"); 12 + 13 + main.setAttribute("day", "today"); 14 + inp_when.setAttribute("value", "today"); 15 + } 16 + async function toggle_tomorrow() { 17 + btn_tomorrow.setAttribute("active", ""); 18 + btn_today.removeAttribute("active"); 19 + 20 + main.setAttribute("day", "tomorrow"); 21 + inp_when.setAttribute("value", "tomorrow"); 22 + }
+23
static/js/modules/user.js
··· 1 + async function new_user() { 2 + const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; 3 + 4 + await fetch(`${location}user/new`, { 5 + method: "POST", 6 + headers: { 7 + "Content-Type": "application/json", 8 + }, 9 + body: JSON.stringify({ timezone: tz }), 10 + }); 11 + } 12 + 13 + async function check_invalidate() { 14 + const invalidate_cookie = await cookieStore.get("invalidate"); 15 + if (invalidate_cookie?.value === "true") { 16 + await new_user(); 17 + await cookieStore.delete("invalidate"); 18 + 19 + window.location.reload(); 20 + } 21 + } 22 + 23 + await check_invalidate();
-1
static/js/npm/htmx.min.js
··· 1 - var htmx=function(){"use strict";const Q={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){const n=dn(e,t||"post");return n.values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:true,allowScriptTags:true,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:false,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:false,getCacheBusterParam:false,globalViewTransitions:false,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:true,ignoreTitle:false,scrollIntoViewOnBoost:true,triggerSpecsCache:null,disableInheritance:false,responseHandling:[{code:"204",swap:false},{code:"[23]..",swap:true},{code:"[45]..",swap:false,error:true}],allowNestedOobSwaps:true,historyRestoreAsHxRequest:true},parseInterval:null,location:location,_:null,version:"2.0.6"};Q.onLoad=j;Q.process=Ft;Q.on=xe;Q.off=be;Q.trigger=ae;Q.ajax=Ln;Q.find=f;Q.findAll=x;Q.closest=g;Q.remove=z;Q.addClass=K;Q.removeClass=G;Q.toggleClass=W;Q.takeClass=Z;Q.swap=$e;Q.defineExtension=zn;Q.removeExtension=$n;Q.logAll=V;Q.logNone=_;Q.parseInterval=d;Q._=e;const n={addTriggerHandler:St,bodyContains:se,canAccessLocalStorage:B,findThisElement:Se,filterValues:yn,swap:$e,hasAttribute:s,getAttributeValue:a,getClosestAttributeValue:ne,getClosestMatch:q,getExpressionVars:Tn,getHeaders:mn,getInputValues:dn,getInternalData:oe,getSwapSpecification:bn,getTriggerSpecs:st,getTarget:Ee,makeFragment:P,mergeObjects:le,makeSettleInfo:Sn,oobSwap:He,querySelectorExt:ue,settleImmediately:Yt,shouldCancel:ht,triggerEvent:ae,triggerErrorEvent:fe,withExtensions:jt};const de=["get","post","put","delete","patch"];const T=de.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function d(e){if(e==undefined){return undefined}let t=NaN;if(e.slice(-2)=="ms"){t=parseFloat(e.slice(0,-2))}else if(e.slice(-1)=="s"){t=parseFloat(e.slice(0,-1))*1e3}else if(e.slice(-1)=="m"){t=parseFloat(e.slice(0,-1))*1e3*60}else{t=parseFloat(e)}return isNaN(t)?undefined:t}function ee(e,t){return e instanceof Element&&e.getAttribute(t)}function s(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function a(e,t){return ee(e,t)||ee(e,"data-"+t)}function u(e){const t=e.parentElement;if(!t&&e.parentNode instanceof ShadowRoot)return e.parentNode;return t}function te(){return document}function y(e,t){return e.getRootNode?e.getRootNode({composed:t}):te()}function q(e,t){while(e&&!t(e)){e=u(e)}return e||null}function o(e,t,n){const r=a(t,n);const o=a(t,"hx-disinherit");var i=a(t,"hx-inherit");if(e!==t){if(Q.config.disableInheritance){if(i&&(i==="*"||i.split(" ").indexOf(n)>=0)){return r}else{return null}}if(o&&(o==="*"||o.split(" ").indexOf(n)>=0)){return"unset"}}return r}function ne(t,n){let r=null;q(t,function(e){return!!(r=o(t,ce(e),n))});if(r!=="unset"){return r}}function h(e,t){return e instanceof Element&&e.matches(t)}function A(e){const t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;const n=t.exec(e);if(n){return n[1].toLowerCase()}else{return""}}function L(e){const t=new DOMParser;return t.parseFromString(e,"text/html")}function N(e,t){while(t.childNodes.length>0){e.append(t.childNodes[0])}}function r(e){const t=te().createElement("script");ie(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(Q.config.inlineScriptNonce){t.nonce=Q.config.inlineScriptNonce}return t}function i(e){return e.matches("script")&&(e.type==="text/javascript"||e.type==="module"||e.type==="")}function I(e){Array.from(e.querySelectorAll("script")).forEach(e=>{if(i(e)){const t=r(e);const n=e.parentNode;try{n.insertBefore(t,e)}catch(e){R(e)}finally{e.remove()}}})}function P(e){const t=e.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i,"");const n=A(t);let r;if(n==="html"){r=new DocumentFragment;const i=L(e);N(r,i.body);r.title=i.title}else if(n==="body"){r=new DocumentFragment;const i=L(t);N(r,i.body);r.title=i.title}else{const i=L('<body><template class="internal-htmx-wrapper">'+t+"</template></body>");r=i.querySelector("template").content;r.title=i.title;var o=r.querySelector("title");if(o&&o.parentNode===r){o.remove();r.title=o.innerText}}if(r){if(Q.config.allowScriptTags){I(r)}else{r.querySelectorAll("script").forEach(e=>e.remove())}}return r}function re(e){if(e){e()}}function t(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function D(e){return typeof e==="function"}function k(e){return t(e,"Object")}function oe(e){const t="htmx-internal-data";let n=e[t];if(!n){n=e[t]={}}return n}function M(t){const n=[];if(t){for(let e=0;e<t.length;e++){n.push(t[e])}}return n}function ie(t,n){if(t){for(let e=0;e<t.length;e++){n(t[e])}}}function F(e){const t=e.getBoundingClientRect();const n=t.top;const r=t.bottom;return n<window.innerHeight&&r>=0}function se(e){return e.getRootNode({composed:true})===document}function X(e){return e.trim().split(/\s+/)}function le(e,t){for(const n in t){if(t.hasOwnProperty(n)){e[n]=t[n]}}return e}function v(e){try{return JSON.parse(e)}catch(e){R(e);return null}}function B(){const e="htmx:sessionStorageTest";try{sessionStorage.setItem(e,e);sessionStorage.removeItem(e);return true}catch(e){return false}}function U(e){const t=new URL(e,"http://x");if(t){e=t.pathname+t.search}if(e!="/"){e=e.replace(/\/+$/,"")}return e}function e(e){return On(te().body,function(){return eval(e)})}function j(t){const e=Q.on("htmx:load",function(e){t(e.detail.elt)});return e}function V(){Q.logger=function(e,t,n){if(console){console.log(t,e,n)}}}function _(){Q.logger=null}function f(e,t){if(typeof e!=="string"){return e.querySelector(t)}else{return f(te(),e)}}function x(e,t){if(typeof e!=="string"){return e.querySelectorAll(t)}else{return x(te(),e)}}function b(){return window}function z(e,t){e=w(e);if(t){b().setTimeout(function(){z(e);e=null},t)}else{u(e).removeChild(e)}}function ce(e){return e instanceof Element?e:null}function $(e){return e instanceof HTMLElement?e:null}function J(e){return typeof e==="string"?e:null}function p(e){return e instanceof Element||e instanceof Document||e instanceof DocumentFragment?e:null}function K(e,t,n){e=ce(w(e));if(!e){return}if(n){b().setTimeout(function(){K(e,t);e=null},n)}else{e.classList&&e.classList.add(t)}}function G(e,t,n){let r=ce(w(e));if(!r){return}if(n){b().setTimeout(function(){G(r,t);r=null},n)}else{if(r.classList){r.classList.remove(t);if(r.classList.length===0){r.removeAttribute("class")}}}}function W(e,t){e=w(e);e.classList.toggle(t)}function Z(e,t){e=w(e);ie(e.parentElement.children,function(e){G(e,t)});K(ce(e),t)}function g(e,t){e=ce(w(e));if(e){return e.closest(t)}return null}function l(e,t){return e.substring(0,t.length)===t}function Y(e,t){return e.substring(e.length-t.length)===t}function pe(e){const t=e.trim();if(l(t,"<")&&Y(t,"/>")){return t.substring(1,t.length-2)}else{return t}}function m(t,r,n){if(r.indexOf("global ")===0){return m(t,r.slice(7),true)}t=w(t);const o=[];{let t=0;let n=0;for(let e=0;e<r.length;e++){const l=r[e];if(l===","&&t===0){o.push(r.substring(n,e));n=e+1;continue}if(l==="<"){t++}else if(l==="/"&&e<r.length-1&&r[e+1]===">"){t--}}if(n<r.length){o.push(r.substring(n))}}const i=[];const s=[];while(o.length>0){const r=pe(o.shift());let e;if(r.indexOf("closest ")===0){e=g(ce(t),pe(r.slice(8)))}else if(r.indexOf("find ")===0){e=f(p(t),pe(r.slice(5)))}else if(r==="next"||r==="nextElementSibling"){e=ce(t).nextElementSibling}else if(r.indexOf("next ")===0){e=ge(t,pe(r.slice(5)),!!n)}else if(r==="previous"||r==="previousElementSibling"){e=ce(t).previousElementSibling}else if(r.indexOf("previous ")===0){e=me(t,pe(r.slice(9)),!!n)}else if(r==="document"){e=document}else if(r==="window"){e=window}else if(r==="body"){e=document.body}else if(r==="root"){e=y(t,!!n)}else if(r==="host"){e=t.getRootNode().host}else{s.push(r)}if(e){i.push(e)}}if(s.length>0){const e=s.join(",");const c=p(y(t,!!n));i.push(...M(c.querySelectorAll(e)))}return i}var ge=function(t,e,n){const r=p(y(t,n)).querySelectorAll(e);for(let e=0;e<r.length;e++){const o=r[e];if(o.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_PRECEDING){return o}}};var me=function(t,e,n){const r=p(y(t,n)).querySelectorAll(e);for(let e=r.length-1;e>=0;e--){const o=r[e];if(o.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_FOLLOWING){return o}}};function ue(e,t){if(typeof e!=="string"){return m(e,t)[0]}else{return m(te().body,e)[0]}}function w(e,t){if(typeof e==="string"){return f(p(t)||document,e)}else{return e}}function ye(e,t,n,r){if(D(t)){return{target:te().body,event:J(e),listener:t,options:n}}else{return{target:w(e),event:J(t),listener:n,options:r}}}function xe(t,n,r,o){Gn(function(){const e=ye(t,n,r,o);e.target.addEventListener(e.event,e.listener,e.options)});const e=D(n);return e?n:r}function be(t,n,r){Gn(function(){const e=ye(t,n,r);e.target.removeEventListener(e.event,e.listener)});return D(n)?n:r}const ve=te().createElement("output");function we(t,n){const e=ne(t,n);if(e){if(e==="this"){return[Se(t,n)]}else{const r=m(t,e);const o=/(^|,)(\s*)inherit(\s*)($|,)/.test(e);if(o){const i=ce(q(t,function(e){return e!==t&&s(ce(e),n)}));if(i){r.push(...we(i,n))}}if(r.length===0){R('The selector "'+e+'" on '+n+" returned no matches!");return[ve]}else{return r}}}}function Se(e,t){return ce(q(e,function(e){return a(ce(e),t)!=null}))}function Ee(e){const t=ne(e,"hx-target");if(t){if(t==="this"){return Se(e,"hx-target")}else{return ue(e,t)}}else{const n=oe(e);if(n.boosted){return te().body}else{return e}}}function Ce(e){return Q.config.attributesToSettle.includes(e)}function Oe(t,n){ie(t.attributes,function(e){if(!n.hasAttribute(e.name)&&Ce(e.name)){t.removeAttribute(e.name)}});ie(n.attributes,function(e){if(Ce(e.name)){t.setAttribute(e.name,e.value)}})}function Re(t,e){const n=Jn(e);for(let e=0;e<n.length;e++){const r=n[e];try{if(r.isInlineSwap(t)){return true}}catch(e){R(e)}}return t==="outerHTML"}function He(e,o,i,t){t=t||te();let n="#"+CSS.escape(ee(o,"id"));let s="outerHTML";if(e==="true"){}else if(e.indexOf(":")>0){s=e.substring(0,e.indexOf(":"));n=e.substring(e.indexOf(":")+1)}else{s=e}o.removeAttribute("hx-swap-oob");o.removeAttribute("data-hx-swap-oob");const r=m(t,n,false);if(r.length){ie(r,function(e){let t;const n=o.cloneNode(true);t=te().createDocumentFragment();t.appendChild(n);if(!Re(s,e)){t=p(n)}const r={shouldSwap:true,target:e,fragment:t};if(!ae(e,"htmx:oobBeforeSwap",r))return;e=r.target;if(r.shouldSwap){qe(t);_e(s,e,e,t,i);Te()}ie(i.elts,function(e){ae(e,"htmx:oobAfterSwap",r)})});o.parentNode.removeChild(o)}else{o.parentNode.removeChild(o);fe(te().body,"htmx:oobErrorNoTarget",{content:o})}return e}function Te(){const e=f("#--htmx-preserve-pantry--");if(e){for(const t of[...e.children]){const n=f("#"+t.id);n.parentNode.moveBefore(t,n);n.remove()}e.remove()}}function qe(e){ie(x(e,"[hx-preserve], [data-hx-preserve]"),function(e){const t=a(e,"id");const n=te().getElementById(t);if(n!=null){if(e.moveBefore){let e=f("#--htmx-preserve-pantry--");if(e==null){te().body.insertAdjacentHTML("afterend","<div id='--htmx-preserve-pantry--'></div>");e=f("#--htmx-preserve-pantry--")}e.moveBefore(n,null)}else{e.parentNode.replaceChild(n,e)}}})}function Ae(l,e,c){ie(e.querySelectorAll("[id]"),function(t){const n=ee(t,"id");if(n&&n.length>0){const r=n.replace("'","\\'");const o=t.tagName.replace(":","\\:");const e=p(l);const i=e&&e.querySelector(o+"[id='"+r+"']");if(i&&i!==e){const s=t.cloneNode();Oe(t,i);c.tasks.push(function(){Oe(t,s)})}}})}function Le(e){return function(){G(e,Q.config.addedClass);Ft(ce(e));Ne(p(e));ae(e,"htmx:load")}}function Ne(e){const t="[autofocus]";const n=$(h(e,t)?e:e.querySelector(t));if(n!=null){n.focus()}}function c(e,t,n,r){Ae(e,n,r);while(n.childNodes.length>0){const o=n.firstChild;K(ce(o),Q.config.addedClass);e.insertBefore(o,t);if(o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE){r.tasks.push(Le(o))}}}function Ie(e,t){let n=0;while(n<e.length){t=(t<<5)-t+e.charCodeAt(n++)|0}return t}function Pe(t){let n=0;for(let e=0;e<t.attributes.length;e++){const r=t.attributes[e];if(r.value){n=Ie(r.name,n);n=Ie(r.value,n)}}return n}function De(t){const n=oe(t);if(n.onHandlers){for(let e=0;e<n.onHandlers.length;e++){const r=n.onHandlers[e];be(t,r.event,r.listener)}delete n.onHandlers}}function ke(e){const t=oe(e);if(t.timeout){clearTimeout(t.timeout)}if(t.listenerInfos){ie(t.listenerInfos,function(e){if(e.on){be(e.on,e.trigger,e.listener)}})}De(e);ie(Object.keys(t),function(e){if(e!=="firstInitCompleted")delete t[e]})}function S(e){ae(e,"htmx:beforeCleanupElement");ke(e);ie(e.children,function(e){S(e)})}function Me(t,e,n){if(t.tagName==="BODY"){return Ve(t,e,n)}let r;const o=t.previousSibling;const i=u(t);if(!i){return}c(i,t,e,n);if(o==null){r=i.firstChild}else{r=o.nextSibling}n.elts=n.elts.filter(function(e){return e!==t});while(r&&r!==t){if(r instanceof Element){n.elts.push(r)}r=r.nextSibling}S(t);t.remove()}function Fe(e,t,n){return c(e,e.firstChild,t,n)}function Xe(e,t,n){return c(u(e),e,t,n)}function Be(e,t,n){return c(e,null,t,n)}function Ue(e,t,n){return c(u(e),e.nextSibling,t,n)}function je(e){S(e);const t=u(e);if(t){return t.removeChild(e)}}function Ve(e,t,n){const r=e.firstChild;c(e,r,t,n);if(r){while(r.nextSibling){S(r.nextSibling);e.removeChild(r.nextSibling)}S(r);e.removeChild(r)}}function _e(t,e,n,r,o){switch(t){case"none":return;case"outerHTML":Me(n,r,o);return;case"afterbegin":Fe(n,r,o);return;case"beforebegin":Xe(n,r,o);return;case"beforeend":Be(n,r,o);return;case"afterend":Ue(n,r,o);return;case"delete":je(n);return;default:var i=Jn(e);for(let e=0;e<i.length;e++){const s=i[e];try{const l=s.handleSwap(t,n,r,o);if(l){if(Array.isArray(l)){for(let e=0;e<l.length;e++){const c=l[e];if(c.nodeType!==Node.TEXT_NODE&&c.nodeType!==Node.COMMENT_NODE){o.tasks.push(Le(c))}}}return}}catch(e){R(e)}}if(t==="innerHTML"){Ve(n,r,o)}else{_e(Q.config.defaultSwapStyle,e,n,r,o)}}}function ze(e,n,r){var t=x(e,"[hx-swap-oob], [data-hx-swap-oob]");ie(t,function(e){if(Q.config.allowNestedOobSwaps||e.parentElement===null){const t=a(e,"hx-swap-oob");if(t!=null){He(t,e,n,r)}}else{e.removeAttribute("hx-swap-oob");e.removeAttribute("data-hx-swap-oob")}});return t.length>0}function $e(h,d,p,g){if(!g){g={}}let m=null;let n=null;let e=function(){re(g.beforeSwapCallback);h=w(h);const r=g.contextElement?y(g.contextElement,false):te();const e=document.activeElement;let t={};t={elt:e,start:e?e.selectionStart:null,end:e?e.selectionEnd:null};const o=Sn(h);if(p.swapStyle==="textContent"){h.textContent=d}else{let n=P(d);o.title=g.title||n.title;if(g.historyRequest){n=n.querySelector("[hx-history-elt],[data-hx-history-elt]")||n}if(g.selectOOB){const i=g.selectOOB.split(",");for(let t=0;t<i.length;t++){const s=i[t].split(":",2);let e=s[0].trim();if(e.indexOf("#")===0){e=e.substring(1)}const l=s[1]||"true";const c=n.querySelector("#"+e);if(c){He(l,c,o,r)}}}ze(n,o,r);ie(x(n,"template"),function(e){if(e.content&&ze(e.content,o,r)){e.remove()}});if(g.select){const u=te().createDocumentFragment();ie(n.querySelectorAll(g.select),function(e){u.appendChild(e)});n=u}qe(n);_e(p.swapStyle,g.contextElement,h,n,o);Te()}if(t.elt&&!se(t.elt)&&ee(t.elt,"id")){const f=document.getElementById(ee(t.elt,"id"));const a={preventScroll:p.focusScroll!==undefined?!p.focusScroll:!Q.config.defaultFocusScroll};if(f){if(t.start&&f.setSelectionRange){try{f.setSelectionRange(t.start,t.end)}catch(e){}}f.focus(a)}}h.classList.remove(Q.config.swappingClass);ie(o.elts,function(e){if(e.classList){e.classList.add(Q.config.settlingClass)}ae(e,"htmx:afterSwap",g.eventInfo)});re(g.afterSwapCallback);if(!p.ignoreTitle){Bn(o.title)}const n=function(){ie(o.tasks,function(e){e.call()});ie(o.elts,function(e){if(e.classList){e.classList.remove(Q.config.settlingClass)}ae(e,"htmx:afterSettle",g.eventInfo)});if(g.anchor){const e=ce(w("#"+g.anchor));if(e){e.scrollIntoView({block:"start",behavior:"auto"})}}En(o.elts,p);re(g.afterSettleCallback);re(m)};if(p.settleDelay>0){b().setTimeout(n,p.settleDelay)}else{n()}};let t=Q.config.globalViewTransitions;if(p.hasOwnProperty("transition")){t=p.transition}const r=g.contextElement||te();if(t&&ae(r,"htmx:beforeTransition",g.eventInfo)&&typeof Promise!=="undefined"&&document.startViewTransition){const o=new Promise(function(e,t){m=e;n=t});const i=e;e=function(){document.startViewTransition(function(){i();return o})}}try{if(p?.swapDelay&&p.swapDelay>0){b().setTimeout(e,p.swapDelay)}else{e()}}catch(e){fe(r,"htmx:swapError",g.eventInfo);re(n);throw e}}function Je(e,t,n){const r=e.getResponseHeader(t);if(r.indexOf("{")===0){const o=v(r);for(const i in o){if(o.hasOwnProperty(i)){let e=o[i];if(k(e)){n=e.target!==undefined?e.target:n}else{e={value:e}}ae(n,i,e)}}}else{const s=r.split(",");for(let e=0;e<s.length;e++){ae(n,s[e].trim(),[])}}}const Ke=/\s/;const E=/[\s,]/;const Ge=/[_$a-zA-Z]/;const We=/[_$a-zA-Z0-9]/;const Ze=['"',"'","/"];const C=/[^\s]/;const Ye=/[{(]/;const Qe=/[})]/;function et(e){const t=[];let n=0;while(n<e.length){if(Ge.exec(e.charAt(n))){var r=n;while(We.exec(e.charAt(n+1))){n++}t.push(e.substring(r,n+1))}else if(Ze.indexOf(e.charAt(n))!==-1){const o=e.charAt(n);var r=n;n++;while(n<e.length&&e.charAt(n)!==o){if(e.charAt(n)==="\\"){n++}n++}t.push(e.substring(r,n+1))}else{const i=e.charAt(n);t.push(i)}n++}return t}function tt(e,t,n){return Ge.exec(e.charAt(0))&&e!=="true"&&e!=="false"&&e!=="this"&&e!==n&&t!=="."}function nt(r,o,i){if(o[0]==="["){o.shift();let e=1;let t=" return (function("+i+"){ return (";let n=null;while(o.length>0){const s=o[0];if(s==="]"){e--;if(e===0){if(n===null){t=t+"true"}o.shift();t+=")})";try{const l=On(r,function(){return Function(t)()},function(){return true});l.source=t;return l}catch(e){fe(te().body,"htmx:syntax:error",{error:e,source:t});return null}}}else if(s==="["){e++}if(tt(s,n,i)){t+="(("+i+"."+s+") ? ("+i+"."+s+") : (window."+s+"))"}else{t=t+s}n=o.shift()}}}function O(e,t){let n="";while(e.length>0&&!t.test(e[0])){n+=e.shift()}return n}function rt(e){let t;if(e.length>0&&Ye.test(e[0])){e.shift();t=O(e,Qe).trim();e.shift()}else{t=O(e,E)}return t}const ot="input, textarea, select";function it(e,t,n){const r=[];const o=et(t);do{O(o,C);const l=o.length;const c=O(o,/[,\[\s]/);if(c!==""){if(c==="every"){const u={trigger:"every"};O(o,C);u.pollInterval=d(O(o,/[,\[\s]/));O(o,C);var i=nt(e,o,"event");if(i){u.eventFilter=i}r.push(u)}else{const f={trigger:c};var i=nt(e,o,"event");if(i){f.eventFilter=i}O(o,C);while(o.length>0&&o[0]!==","){const a=o.shift();if(a==="changed"){f.changed=true}else if(a==="once"){f.once=true}else if(a==="consume"){f.consume=true}else if(a==="delay"&&o[0]===":"){o.shift();f.delay=d(O(o,E))}else if(a==="from"&&o[0]===":"){o.shift();if(Ye.test(o[0])){var s=rt(o)}else{var s=O(o,E);if(s==="closest"||s==="find"||s==="next"||s==="previous"){o.shift();const h=rt(o);if(h.length>0){s+=" "+h}}}f.from=s}else if(a==="target"&&o[0]===":"){o.shift();f.target=rt(o)}else if(a==="throttle"&&o[0]===":"){o.shift();f.throttle=d(O(o,E))}else if(a==="queue"&&o[0]===":"){o.shift();f.queue=O(o,E)}else if(a==="root"&&o[0]===":"){o.shift();f[a]=rt(o)}else if(a==="threshold"&&o[0]===":"){o.shift();f[a]=O(o,E)}else{fe(e,"htmx:syntax:error",{token:o.shift()})}O(o,C)}r.push(f)}}if(o.length===l){fe(e,"htmx:syntax:error",{token:o.shift()})}O(o,C)}while(o[0]===","&&o.shift());if(n){n[t]=r}return r}function st(e){const t=a(e,"hx-trigger");let n=[];if(t){const r=Q.config.triggerSpecsCache;n=r&&r[t]||it(e,t,r)}if(n.length>0){return n}else if(h(e,"form")){return[{trigger:"submit"}]}else if(h(e,'input[type="button"], input[type="submit"]')){return[{trigger:"click"}]}else if(h(e,ot)){return[{trigger:"change"}]}else{return[{trigger:"click"}]}}function lt(e){oe(e).cancelled=true}function ct(e,t,n){const r=oe(e);r.timeout=b().setTimeout(function(){if(se(e)&&r.cancelled!==true){if(!pt(n,e,Bt("hx:poll:trigger",{triggerSpec:n,target:e}))){t(e)}ct(e,t,n)}},n.pollInterval)}function ut(e){return location.hostname===e.hostname&&ee(e,"href")&&ee(e,"href").indexOf("#")!==0}function ft(e){return g(e,Q.config.disableSelector)}function at(t,n,e){if(t instanceof HTMLAnchorElement&&ut(t)&&(t.target===""||t.target==="_self")||t.tagName==="FORM"&&String(ee(t,"method")).toLowerCase()!=="dialog"){n.boosted=true;let r,o;if(t.tagName==="A"){r="get";o=ee(t,"href")}else{const i=ee(t,"method");r=i?i.toLowerCase():"get";o=ee(t,"action");if(o==null||o===""){o=location.href}if(r==="get"&&o.includes("?")){o=o.replace(/\?[^#]+/,"")}}e.forEach(function(e){gt(t,function(e,t){const n=ce(e);if(ft(n)){S(n);return}he(r,o,n,t)},n,e,true)})}}function ht(e,t){if(e.type==="submit"||e.type==="click"){t=ce(e.target)||t;if(t.tagName==="FORM"){return true}if(t.form&&t.type==="submit"){return true}t=t.closest("a");if(t&&t.href&&(t.getAttribute("href")==="#"||t.getAttribute("href").indexOf("#")!==0)){return true}}return false}function dt(e,t){return oe(e).boosted&&e instanceof HTMLAnchorElement&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function pt(e,t,n){const r=e.eventFilter;if(r){try{return r.call(t,n)!==true}catch(e){const o=r.source;fe(te().body,"htmx:eventFilter:error",{error:e,source:o});return true}}return false}function gt(l,c,e,u,f){const a=oe(l);let t;if(u.from){t=m(l,u.from)}else{t=[l]}if(u.changed){if(!("lastValue"in a)){a.lastValue=new WeakMap}t.forEach(function(e){if(!a.lastValue.has(u)){a.lastValue.set(u,new WeakMap)}a.lastValue.get(u).set(e,e.value)})}ie(t,function(i){const s=function(e){if(!se(l)){i.removeEventListener(u.trigger,s);return}if(dt(l,e)){return}if(f||ht(e,l)){e.preventDefault()}if(pt(u,l,e)){return}const t=oe(e);t.triggerSpec=u;if(t.handledFor==null){t.handledFor=[]}if(t.handledFor.indexOf(l)<0){t.handledFor.push(l);if(u.consume){e.stopPropagation()}if(u.target&&e.target){if(!h(ce(e.target),u.target)){return}}if(u.once){if(a.triggeredOnce){return}else{a.triggeredOnce=true}}if(u.changed){const n=e.target;const r=n.value;const o=a.lastValue.get(u);if(o.has(n)&&o.get(n)===r){return}o.set(n,r)}if(a.delayed){clearTimeout(a.delayed)}if(a.throttle){return}if(u.throttle>0){if(!a.throttle){ae(l,"htmx:trigger");c(l,e);a.throttle=b().setTimeout(function(){a.throttle=null},u.throttle)}}else if(u.delay>0){a.delayed=b().setTimeout(function(){ae(l,"htmx:trigger");c(l,e)},u.delay)}else{ae(l,"htmx:trigger");c(l,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:u.trigger,listener:s,on:i});i.addEventListener(u.trigger,s)})}let mt=false;let yt=null;function xt(){if(!yt){yt=function(){mt=true};window.addEventListener("scroll",yt);window.addEventListener("resize",yt);setInterval(function(){if(mt){mt=false;ie(te().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(e){bt(e)})}},200)}}function bt(e){if(!s(e,"data-hx-revealed")&&F(e)){e.setAttribute("data-hx-revealed","true");const t=oe(e);if(t.initHash){ae(e,"revealed")}else{e.addEventListener("htmx:afterProcessNode",function(){ae(e,"revealed")},{once:true})}}}function vt(e,t,n,r){const o=function(){if(!n.loaded){n.loaded=true;ae(e,"htmx:trigger");t(e)}};if(r>0){b().setTimeout(o,r)}else{o()}}function wt(t,n,e){let i=false;ie(de,function(r){if(s(t,"hx-"+r)){const o=a(t,"hx-"+r);i=true;n.path=o;n.verb=r;e.forEach(function(e){St(t,e,n,function(e,t){const n=ce(e);if(ft(n)){S(n);return}he(r,o,n,t)})})}});return i}function St(r,e,t,n){if(e.trigger==="revealed"){xt();gt(r,n,t,e);bt(ce(r))}else if(e.trigger==="intersect"){const o={};if(e.root){o.root=ue(r,e.root)}if(e.threshold){o.threshold=parseFloat(e.threshold)}const i=new IntersectionObserver(function(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.isIntersecting){ae(r,"intersect");break}}},o);i.observe(ce(r));gt(ce(r),n,t,e)}else if(!t.firstInitCompleted&&e.trigger==="load"){if(!pt(e,r,Bt("load",{elt:r}))){vt(ce(r),n,t,e.delay)}}else if(e.pollInterval>0){t.polling=true;ct(ce(r),n,e)}else{gt(r,n,t,e)}}function Et(e){const t=ce(e);if(!t){return false}const n=t.attributes;for(let e=0;e<n.length;e++){const r=n[e].name;if(l(r,"hx-on:")||l(r,"data-hx-on:")||l(r,"hx-on-")||l(r,"data-hx-on-")){return true}}return false}const Ct=(new XPathEvaluator).createExpression('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or'+' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]');function Ot(e,t){if(Et(e)){t.push(ce(e))}const n=Ct.evaluate(e);let r=null;while(r=n.iterateNext())t.push(ce(r))}function Rt(e){const t=[];if(e instanceof DocumentFragment){for(const n of e.childNodes){Ot(n,t)}}else{Ot(e,t)}return t}function Ht(e){if(e.querySelectorAll){const n=", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]";const r=[];for(const i in Vn){const s=Vn[i];if(s.getSelectors){var t=s.getSelectors();if(t){r.push(t)}}}const o=e.querySelectorAll(T+n+", form, [type='submit'],"+" [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]"+r.flat().map(e=>", "+e).join(""));return o}else{return[]}}function Tt(e){const t=At(e.target);const n=Nt(e);if(n){n.lastButtonClicked=t}}function qt(e){const t=Nt(e);if(t){t.lastButtonClicked=null}}function At(e){return g(ce(e),"button, input[type='submit']")}function Lt(e){return e.form||g(e,"form")}function Nt(e){const t=At(e.target);if(!t){return}const n=Lt(t);return oe(n)}function It(e){e.addEventListener("click",Tt);e.addEventListener("focusin",Tt);e.addEventListener("focusout",qt)}function Pt(t,e,n){const r=oe(t);if(!Array.isArray(r.onHandlers)){r.onHandlers=[]}let o;const i=function(e){On(t,function(){if(ft(t)){return}if(!o){o=new Function("event",n)}o.call(t,e)})};t.addEventListener(e,i);r.onHandlers.push({event:e,listener:i})}function Dt(t){De(t);for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;const r=t.attributes[e].value;if(l(n,"hx-on")||l(n,"data-hx-on")){const o=n.indexOf("-on")+3;const i=n.slice(o,o+1);if(i==="-"||i===":"){let e=n.slice(o+1);if(l(e,":")){e="htmx"+e}else if(l(e,"-")){e="htmx:"+e.slice(1)}else if(l(e,"htmx-")){e="htmx:"+e.slice(5)}Pt(t,e,r)}}}}function kt(t){ae(t,"htmx:beforeProcessNode");const n=oe(t);const e=st(t);const r=wt(t,n,e);if(!r){if(ne(t,"hx-boost")==="true"){at(t,n,e)}else if(s(t,"hx-trigger")){e.forEach(function(e){St(t,e,n,function(){})})}}if(t.tagName==="FORM"||ee(t,"type")==="submit"&&s(t,"form")){It(t)}n.firstInitCompleted=true;ae(t,"htmx:afterProcessNode")}function Mt(e){if(!(e instanceof Element)){return false}const t=oe(e);const n=Pe(e);if(t.initHash!==n){ke(e);t.initHash=n;return true}return false}function Ft(e){e=w(e);if(ft(e)){S(e);return}const t=[];if(Mt(e)){t.push(e)}ie(Ht(e),function(e){if(ft(e)){S(e);return}if(Mt(e)){t.push(e)}});ie(Rt(e),Dt);ie(t,kt)}function Xt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Bt(e,t){return new CustomEvent(e,{bubbles:true,cancelable:true,composed:true,detail:t})}function fe(e,t,n){ae(e,t,le({error:t},n))}function Ut(e){return e==="htmx:afterProcessNode"}function jt(e,t,n){ie(Jn(e,[],n),function(e){try{t(e)}catch(e){R(e)}})}function R(e){console.error(e)}function ae(e,t,n){e=w(e);if(n==null){n={}}n.elt=e;const r=Bt(t,n);if(Q.logger&&!Ut(t)){Q.logger(e,t,n)}if(n.error){R(n.error);ae(e,"htmx:error",{errorInfo:n})}let o=e.dispatchEvent(r);const i=Xt(t);if(o&&i!==t){const s=Bt(i,r.detail);o=o&&e.dispatchEvent(s)}jt(ce(e),function(e){o=o&&(e.onEvent(t,r)!==false&&!r.defaultPrevented)});return o}let Vt=location.pathname+location.search;function _t(e){Vt=e;if(B()){sessionStorage.setItem("htmx-current-path-for-history",e)}}function zt(){const e=te().querySelector("[hx-history-elt],[data-hx-history-elt]");return e||te().body}function $t(t,e){if(!B()){return}const n=Kt(e);const r=te().title;const o=window.scrollY;if(Q.config.historyCacheSize<=0){sessionStorage.removeItem("htmx-history-cache");return}t=U(t);const i=v(sessionStorage.getItem("htmx-history-cache"))||[];for(let e=0;e<i.length;e++){if(i[e].url===t){i.splice(e,1);break}}const s={url:t,content:n,title:r,scroll:o};ae(te().body,"htmx:historyItemCreated",{item:s,cache:i});i.push(s);while(i.length>Q.config.historyCacheSize){i.shift()}while(i.length>0){try{sessionStorage.setItem("htmx-history-cache",JSON.stringify(i));break}catch(e){fe(te().body,"htmx:historyCacheError",{cause:e,cache:i});i.shift()}}}function Jt(t){if(!B()){return null}t=U(t);const n=v(sessionStorage.getItem("htmx-history-cache"))||[];for(let e=0;e<n.length;e++){if(n[e].url===t){return n[e]}}return null}function Kt(e){const t=Q.config.requestClass;const n=e.cloneNode(true);ie(x(n,"."+t),function(e){G(e,t)});ie(x(n,"[data-disabled-by-htmx]"),function(e){e.removeAttribute("disabled")});return n.innerHTML}function Gt(){const e=zt();let t=Vt;if(B()){t=sessionStorage.getItem("htmx-current-path-for-history")}t=t||location.pathname+location.search;const n=te().querySelector('[hx-history="false" i],[data-hx-history="false" i]');if(!n){ae(te().body,"htmx:beforeHistorySave",{path:t,historyElt:e});$t(t,e)}if(Q.config.historyEnabled)history.replaceState({htmx:true},te().title,location.href)}function Wt(e){if(Q.config.getCacheBusterParam){e=e.replace(/org\.htmx\.cache-buster=[^&]*&?/,"");if(Y(e,"&")||Y(e,"?")){e=e.slice(0,-1)}}if(Q.config.historyEnabled){history.pushState({htmx:true},"",e)}_t(e)}function Zt(e){if(Q.config.historyEnabled)history.replaceState({htmx:true},"",e);_t(e)}function Yt(e){ie(e,function(e){e.call(undefined)})}function Qt(e){const t=new XMLHttpRequest;const n={swapStyle:"innerHTML",swapDelay:0,settleDelay:0};const r={path:e,xhr:t,historyElt:zt(),swapSpec:n};t.open("GET",e,true);if(Q.config.historyRestoreAsHxRequest){t.setRequestHeader("HX-Request","true")}t.setRequestHeader("HX-History-Restore-Request","true");t.setRequestHeader("HX-Current-URL",location.href);t.onload=function(){if(this.status>=200&&this.status<400){r.response=this.response;ae(te().body,"htmx:historyCacheMissLoad",r);$e(r.historyElt,r.response,n,{contextElement:r.historyElt,historyRequest:true});_t(r.path);ae(te().body,"htmx:historyRestore",{path:e,cacheMiss:true,serverResponse:r.response})}else{fe(te().body,"htmx:historyCacheMissLoadError",r)}};if(ae(te().body,"htmx:historyCacheMiss",r)){t.send()}}function en(e){Gt();e=e||location.pathname+location.search;const t=Jt(e);if(t){const n={swapStyle:"innerHTML",swapDelay:0,settleDelay:0,scroll:t.scroll};const r={path:e,item:t,historyElt:zt(),swapSpec:n};if(ae(te().body,"htmx:historyCacheHit",r)){$e(r.historyElt,t.content,n,{contextElement:r.historyElt,title:t.title});_t(r.path);ae(te().body,"htmx:historyRestore",r)}}else{if(Q.config.refreshOnHistoryMiss){Q.location.reload(true)}else{Qt(e)}}}function tn(e){let t=we(e,"hx-indicator");if(t==null){t=[e]}ie(t,function(e){const t=oe(e);t.requestCount=(t.requestCount||0)+1;e.classList.add.call(e.classList,Q.config.requestClass)});return t}function nn(e){let t=we(e,"hx-disabled-elt");if(t==null){t=[]}ie(t,function(e){const t=oe(e);t.requestCount=(t.requestCount||0)+1;e.setAttribute("disabled","");e.setAttribute("data-disabled-by-htmx","")});return t}function rn(e,t){ie(e.concat(t),function(e){const t=oe(e);t.requestCount=(t.requestCount||1)-1});ie(e,function(e){const t=oe(e);if(t.requestCount===0){e.classList.remove.call(e.classList,Q.config.requestClass)}});ie(t,function(e){const t=oe(e);if(t.requestCount===0){e.removeAttribute("disabled");e.removeAttribute("data-disabled-by-htmx")}})}function on(t,n){for(let e=0;e<t.length;e++){const r=t[e];if(r.isSameNode(n)){return true}}return false}function sn(e){const t=e;if(t.name===""||t.name==null||t.disabled||g(t,"fieldset[disabled]")){return false}if(t.type==="button"||t.type==="submit"||t.tagName==="image"||t.tagName==="reset"||t.tagName==="file"){return false}if(t.type==="checkbox"||t.type==="radio"){return t.checked}return true}function ln(t,e,n){if(t!=null&&e!=null){if(Array.isArray(e)){e.forEach(function(e){n.append(t,e)})}else{n.append(t,e)}}}function cn(t,n,r){if(t!=null&&n!=null){let e=r.getAll(t);if(Array.isArray(n)){e=e.filter(e=>n.indexOf(e)<0)}else{e=e.filter(e=>e!==n)}r.delete(t);ie(e,e=>r.append(t,e))}}function un(e){if(e instanceof HTMLSelectElement&&e.multiple){return M(e.querySelectorAll("option:checked")).map(function(e){return e.value})}if(e instanceof HTMLInputElement&&e.files){return M(e.files)}return e.value}function fn(t,n,r,e,o){if(e==null||on(t,e)){return}else{t.push(e)}if(sn(e)){const i=ee(e,"name");ln(i,un(e),n);if(o){an(e,r)}}if(e instanceof HTMLFormElement){ie(e.elements,function(e){if(t.indexOf(e)>=0){cn(e.name,un(e),n)}else{t.push(e)}if(o){an(e,r)}});new FormData(e).forEach(function(e,t){if(e instanceof File&&e.name===""){return}ln(t,e,n)})}}function an(e,t){const n=e;if(n.willValidate){ae(n,"htmx:validation:validate");if(!n.checkValidity()){t.push({elt:n,message:n.validationMessage,validity:n.validity});ae(n,"htmx:validation:failed",{message:n.validationMessage,validity:n.validity})}}}function hn(n,e){for(const t of e.keys()){n.delete(t)}e.forEach(function(e,t){n.append(t,e)});return n}function dn(e,t){const n=[];const r=new FormData;const o=new FormData;const i=[];const s=oe(e);if(s.lastButtonClicked&&!se(s.lastButtonClicked)){s.lastButtonClicked=null}let l=e instanceof HTMLFormElement&&e.noValidate!==true||a(e,"hx-validate")==="true";if(s.lastButtonClicked){l=l&&s.lastButtonClicked.formNoValidate!==true}if(t!=="get"){fn(n,o,i,Lt(e),l)}fn(n,r,i,e,l);if(s.lastButtonClicked||e.tagName==="BUTTON"||e.tagName==="INPUT"&&ee(e,"type")==="submit"){const u=s.lastButtonClicked||e;const f=ee(u,"name");ln(f,u.value,o)}const c=we(e,"hx-include");ie(c,function(e){fn(n,r,i,ce(e),l);if(!h(e,"form")){ie(p(e).querySelectorAll(ot),function(e){fn(n,r,i,e,l)})}});hn(r,o);return{errors:i,formData:r,values:kn(r)}}function pn(e,t,n){if(e!==""){e+="&"}if(String(n)==="[object Object]"){n=JSON.stringify(n)}const r=encodeURIComponent(n);e+=encodeURIComponent(t)+"="+r;return e}function gn(e){e=Pn(e);let n="";e.forEach(function(e,t){n=pn(n,t,e)});return n}function mn(e,t,n){const r={"HX-Request":"true","HX-Trigger":ee(e,"id"),"HX-Trigger-Name":ee(e,"name"),"HX-Target":a(t,"id"),"HX-Current-URL":location.href};Cn(e,"hx-headers",false,r);if(n!==undefined){r["HX-Prompt"]=n}if(oe(e).boosted){r["HX-Boosted"]="true"}return r}function yn(n,e){const t=ne(e,"hx-params");if(t){if(t==="none"){return new FormData}else if(t==="*"){return n}else if(t.indexOf("not ")===0){ie(t.slice(4).split(","),function(e){e=e.trim();n.delete(e)});return n}else{const r=new FormData;ie(t.split(","),function(t){t=t.trim();if(n.has(t)){n.getAll(t).forEach(function(e){r.append(t,e)})}});return r}}else{return n}}function xn(e){return!!ee(e,"href")&&ee(e,"href").indexOf("#")>=0}function bn(e,t){const n=t||ne(e,"hx-swap");const r={swapStyle:oe(e).boosted?"innerHTML":Q.config.defaultSwapStyle,swapDelay:Q.config.defaultSwapDelay,settleDelay:Q.config.defaultSettleDelay};if(Q.config.scrollIntoViewOnBoost&&oe(e).boosted&&!xn(e)){r.show="top"}if(n){const s=X(n);if(s.length>0){for(let e=0;e<s.length;e++){const l=s[e];if(l.indexOf("swap:")===0){r.swapDelay=d(l.slice(5))}else if(l.indexOf("settle:")===0){r.settleDelay=d(l.slice(7))}else if(l.indexOf("transition:")===0){r.transition=l.slice(11)==="true"}else if(l.indexOf("ignoreTitle:")===0){r.ignoreTitle=l.slice(12)==="true"}else if(l.indexOf("scroll:")===0){const c=l.slice(7);var o=c.split(":");const u=o.pop();var i=o.length>0?o.join(":"):null;r.scroll=u;r.scrollTarget=i}else if(l.indexOf("show:")===0){const f=l.slice(5);var o=f.split(":");const a=o.pop();var i=o.length>0?o.join(":"):null;r.show=a;r.showTarget=i}else if(l.indexOf("focus-scroll:")===0){const h=l.slice("focus-scroll:".length);r.focusScroll=h=="true"}else if(e==0){r.swapStyle=l}else{R("Unknown modifier in hx-swap: "+l)}}}}return r}function vn(e){return ne(e,"hx-encoding")==="multipart/form-data"||h(e,"form")&&ee(e,"enctype")==="multipart/form-data"}function wn(t,n,r){let o=null;jt(n,function(e){if(o==null){o=e.encodeParameters(t,r,n)}});if(o!=null){return o}else{if(vn(n)){return hn(new FormData,Pn(r))}else{return gn(r)}}}function Sn(e){return{tasks:[],elts:[e]}}function En(e,t){const n=e[0];const r=e[e.length-1];if(t.scroll){var o=null;if(t.scrollTarget){o=ce(ue(n,t.scrollTarget))}if(t.scroll==="top"&&(n||o)){o=o||n;o.scrollTop=0}if(t.scroll==="bottom"&&(r||o)){o=o||r;o.scrollTop=o.scrollHeight}if(typeof t.scroll==="number"){b().setTimeout(function(){window.scrollTo(0,t.scroll)},0)}}if(t.show){var o=null;if(t.showTarget){let e=t.showTarget;if(t.showTarget==="window"){e="body"}o=ce(ue(n,e))}if(t.show==="top"&&(n||o)){o=o||n;o.scrollIntoView({block:"start",behavior:Q.config.scrollBehavior})}if(t.show==="bottom"&&(r||o)){o=o||r;o.scrollIntoView({block:"end",behavior:Q.config.scrollBehavior})}}}function Cn(r,e,o,i,s){if(i==null){i={}}if(r==null){return i}const l=a(r,e);if(l){let e=l.trim();let t=o;if(e==="unset"){return null}if(e.indexOf("javascript:")===0){e=e.slice(11);t=true}else if(e.indexOf("js:")===0){e=e.slice(3);t=true}if(e.indexOf("{")!==0){e="{"+e+"}"}let n;if(t){n=On(r,function(){if(s){return Function("event","return ("+e+")").call(r,s)}else{return Function("return ("+e+")").call(r)}},{})}else{n=v(e)}for(const c in n){if(n.hasOwnProperty(c)){if(i[c]==null){i[c]=n[c]}}}}return Cn(ce(u(r)),e,o,i,s)}function On(e,t,n){if(Q.config.allowEval){return t()}else{fe(e,"htmx:evalDisallowedError");return n}}function Rn(e,t,n){return Cn(e,"hx-vars",true,n,t)}function Hn(e,t,n){return Cn(e,"hx-vals",false,n,t)}function Tn(e,t){return le(Rn(e,t),Hn(e,t))}function qn(t,n,r){if(r!==null){try{t.setRequestHeader(n,r)}catch(e){t.setRequestHeader(n,encodeURIComponent(r));t.setRequestHeader(n+"-URI-AutoEncoded","true")}}}function An(t){if(t.responseURL){try{const e=new URL(t.responseURL);return e.pathname+e.search}catch(e){fe(te().body,"htmx:badResponseUrl",{url:t.responseURL})}}}function H(e,t){return t.test(e.getAllResponseHeaders())}function Ln(t,n,r){t=t.toLowerCase();if(r){if(r instanceof Element||typeof r==="string"){return he(t,n,null,null,{targetOverride:w(r)||ve,returnPromise:true})}else{let e=w(r.target);if(r.target&&!e||r.source&&!e&&!w(r.source)){e=ve}return he(t,n,w(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:e,swapOverride:r.swap,select:r.select,returnPromise:true})}}else{return he(t,n,null,null,{returnPromise:true})}}function Nn(e){const t=[];while(e){t.push(e);e=e.parentElement}return t}function In(e,t,n){const r=new URL(t,location.protocol!=="about:"?location.href:window.origin);const o=location.protocol!=="about:"?location.origin:window.origin;const i=o===r.origin;if(Q.config.selfRequestsOnly){if(!i){return false}}return ae(e,"htmx:validateUrl",le({url:r,sameHost:i},n))}function Pn(e){if(e instanceof FormData)return e;const t=new FormData;for(const n in e){if(e.hasOwnProperty(n)){if(e[n]&&typeof e[n].forEach==="function"){e[n].forEach(function(e){t.append(n,e)})}else if(typeof e[n]==="object"&&!(e[n]instanceof Blob)){t.append(n,JSON.stringify(e[n]))}else{t.append(n,e[n])}}}return t}function Dn(r,o,e){return new Proxy(e,{get:function(t,e){if(typeof e==="number")return t[e];if(e==="length")return t.length;if(e==="push"){return function(e){t.push(e);r.append(o,e)}}if(typeof t[e]==="function"){return function(){t[e].apply(t,arguments);r.delete(o);t.forEach(function(e){r.append(o,e)})}}if(t[e]&&t[e].length===1){return t[e][0]}else{return t[e]}},set:function(e,t,n){e[t]=n;r.delete(o);e.forEach(function(e){r.append(o,e)});return true}})}function kn(o){return new Proxy(o,{get:function(e,t){if(typeof t==="symbol"){const r=Reflect.get(e,t);if(typeof r==="function"){return function(){return r.apply(o,arguments)}}else{return r}}if(t==="toJSON"){return()=>Object.fromEntries(o)}if(t in e){if(typeof e[t]==="function"){return function(){return o[t].apply(o,arguments)}}}const n=o.getAll(t);if(n.length===0){return undefined}else if(n.length===1){return n[0]}else{return Dn(e,t,n)}},set:function(t,n,e){if(typeof n!=="string"){return false}t.delete(n);if(e&&typeof e.forEach==="function"){e.forEach(function(e){t.append(n,e)})}else if(typeof e==="object"&&!(e instanceof Blob)){t.append(n,JSON.stringify(e))}else{t.append(n,e)}return true},deleteProperty:function(e,t){if(typeof t==="string"){e.delete(t)}return true},ownKeys:function(e){return Reflect.ownKeys(Object.fromEntries(e))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e),t)}})}function he(t,n,r,o,i,k){let s=null;let l=null;i=i!=null?i:{};if(i.returnPromise&&typeof Promise!=="undefined"){var e=new Promise(function(e,t){s=e;l=t})}if(r==null){r=te().body}const M=i.handler||jn;const F=i.select||null;if(!se(r)){re(s);return e}const c=i.targetOverride||ce(Ee(r));if(c==null||c==ve){fe(r,"htmx:targetError",{target:ne(r,"hx-target")});re(l);return e}let u=oe(r);const f=u.lastButtonClicked;if(f){const A=ee(f,"formaction");if(A!=null){n=A}const L=ee(f,"formmethod");if(L!=null){if(de.includes(L.toLowerCase())){t=L}else{re(s);return e}}}const a=ne(r,"hx-confirm");if(k===undefined){const K=function(e){return he(t,n,r,o,i,!!e)};const G={target:c,elt:r,path:n,verb:t,triggeringEvent:o,etc:i,issueRequest:K,question:a};if(ae(r,"htmx:confirm",G)===false){re(s);return e}}let h=r;let d=ne(r,"hx-sync");let p=null;let X=false;if(d){const N=d.split(":");const I=N[0].trim();if(I==="this"){h=Se(r,"hx-sync")}else{h=ce(ue(r,I))}d=(N[1]||"drop").trim();u=oe(h);if(d==="drop"&&u.xhr&&u.abortable!==true){re(s);return e}else if(d==="abort"){if(u.xhr){re(s);return e}else{X=true}}else if(d==="replace"){ae(h,"htmx:abort")}else if(d.indexOf("queue")===0){const W=d.split(" ");p=(W[1]||"last").trim()}}if(u.xhr){if(u.abortable){ae(h,"htmx:abort")}else{if(p==null){if(o){const P=oe(o);if(P&&P.triggerSpec&&P.triggerSpec.queue){p=P.triggerSpec.queue}}if(p==null){p="last"}}if(u.queuedRequests==null){u.queuedRequests=[]}if(p==="first"&&u.queuedRequests.length===0){u.queuedRequests.push(function(){he(t,n,r,o,i)})}else if(p==="all"){u.queuedRequests.push(function(){he(t,n,r,o,i)})}else if(p==="last"){u.queuedRequests=[];u.queuedRequests.push(function(){he(t,n,r,o,i)})}re(s);return e}}const g=new XMLHttpRequest;u.xhr=g;u.abortable=X;const m=function(){u.xhr=null;u.abortable=false;if(u.queuedRequests!=null&&u.queuedRequests.length>0){const e=u.queuedRequests.shift();e()}};const B=ne(r,"hx-prompt");if(B){var y=prompt(B);if(y===null||!ae(r,"htmx:prompt",{prompt:y,target:c})){re(s);m();return e}}if(a&&!k){if(!confirm(a)){re(s);m();return e}}let x=mn(r,c,y);if(t!=="get"&&!vn(r)){x["Content-Type"]="application/x-www-form-urlencoded"}if(i.headers){x=le(x,i.headers)}const U=dn(r,t);let b=U.errors;const j=U.formData;if(i.values){hn(j,Pn(i.values))}const V=Pn(Tn(r,o));const v=hn(j,V);let w=yn(v,r);if(Q.config.getCacheBusterParam&&t==="get"){w.set("org.htmx.cache-buster",ee(c,"id")||"true")}if(n==null||n===""){n=location.href}const S=Cn(r,"hx-request");const _=oe(r).boosted;let E=Q.config.methodsThatUseUrlParams.indexOf(t)>=0;const C={boosted:_,useUrlParams:E,formData:w,parameters:kn(w),unfilteredFormData:v,unfilteredParameters:kn(v),headers:x,elt:r,target:c,verb:t,errors:b,withCredentials:i.credentials||S.credentials||Q.config.withCredentials,timeout:i.timeout||S.timeout||Q.config.timeout,path:n,triggeringEvent:o};if(!ae(r,"htmx:configRequest",C)){re(s);m();return e}n=C.path;t=C.verb;x=C.headers;w=Pn(C.parameters);b=C.errors;E=C.useUrlParams;if(b&&b.length>0){ae(r,"htmx:validation:halted",C);re(s);m();return e}const z=n.split("#");const $=z[0];const O=z[1];let R=n;if(E){R=$;const Z=!w.keys().next().done;if(Z){if(R.indexOf("?")<0){R+="?"}else{R+="&"}R+=gn(w);if(O){R+="#"+O}}}if(!In(r,R,C)){fe(r,"htmx:invalidPath",C);re(l);m();return e}g.open(t.toUpperCase(),R,true);g.overrideMimeType("text/html");g.withCredentials=C.withCredentials;g.timeout=C.timeout;if(S.noHeaders){}else{for(const D in x){if(x.hasOwnProperty(D)){const Y=x[D];qn(g,D,Y)}}}const H={xhr:g,target:c,requestConfig:C,etc:i,boosted:_,select:F,pathInfo:{requestPath:n,finalRequestPath:R,responsePath:null,anchor:O}};g.onload=function(){try{const t=Nn(r);H.pathInfo.responsePath=An(g);M(r,H);if(H.keepIndicators!==true){rn(T,q)}ae(r,"htmx:afterRequest",H);ae(r,"htmx:afterOnLoad",H);if(!se(r)){let e=null;while(t.length>0&&e==null){const n=t.shift();if(se(n)){e=n}}if(e){ae(e,"htmx:afterRequest",H);ae(e,"htmx:afterOnLoad",H)}}re(s)}catch(e){fe(r,"htmx:onLoadError",le({error:e},H));throw e}finally{m()}};g.onerror=function(){rn(T,q);fe(r,"htmx:afterRequest",H);fe(r,"htmx:sendError",H);re(l);m()};g.onabort=function(){rn(T,q);fe(r,"htmx:afterRequest",H);fe(r,"htmx:sendAbort",H);re(l);m()};g.ontimeout=function(){rn(T,q);fe(r,"htmx:afterRequest",H);fe(r,"htmx:timeout",H);re(l);m()};if(!ae(r,"htmx:beforeRequest",H)){re(s);m();return e}var T=tn(r);var q=nn(r);ie(["loadstart","loadend","progress","abort"],function(t){ie([g,g.upload],function(e){e.addEventListener(t,function(e){ae(r,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});ae(r,"htmx:beforeSend",H);const J=E?null:wn(g,r,w);g.send(J);return e}function Mn(e,t){const n=t.xhr;let r=null;let o=null;if(H(n,/HX-Push:/i)){r=n.getResponseHeader("HX-Push");o="push"}else if(H(n,/HX-Push-Url:/i)){r=n.getResponseHeader("HX-Push-Url");o="push"}else if(H(n,/HX-Replace-Url:/i)){r=n.getResponseHeader("HX-Replace-Url");o="replace"}if(r){if(r==="false"){return{}}else{return{type:o,path:r}}}const i=t.pathInfo.finalRequestPath;const s=t.pathInfo.responsePath;const l=ne(e,"hx-push-url");const c=ne(e,"hx-replace-url");const u=oe(e).boosted;let f=null;let a=null;if(l){f="push";a=l}else if(c){f="replace";a=c}else if(u){f="push";a=s||i}if(a){if(a==="false"){return{}}if(a==="true"){a=s||i}if(t.pathInfo.anchor&&a.indexOf("#")===-1){a=a+"#"+t.pathInfo.anchor}return{type:f,path:a}}else{return{}}}function Fn(e,t){var n=new RegExp(e.code);return n.test(t.toString(10))}function Xn(e){for(var t=0;t<Q.config.responseHandling.length;t++){var n=Q.config.responseHandling[t];if(Fn(n,e.status)){return n}}return{swap:false}}function Bn(e){if(e){const t=f("title");if(t){t.textContent=e}else{window.document.title=e}}}function Un(e,t){if(t==="this"){return e}const n=ce(ue(e,t));if(n==null){fe(e,"htmx:targetError",{target:t});throw new Error(`Invalid re-target ${t}`)}return n}function jn(t,e){const n=e.xhr;let r=e.target;const o=e.etc;const i=e.select;if(!ae(t,"htmx:beforeOnLoad",e))return;if(H(n,/HX-Trigger:/i)){Je(n,"HX-Trigger",t)}if(H(n,/HX-Location:/i)){Gt();let e=n.getResponseHeader("HX-Location");var s;if(e.indexOf("{")===0){s=v(e);e=s.path;delete s.path}Ln("get",e,s).then(function(){Wt(e)});return}const l=H(n,/HX-Refresh:/i)&&n.getResponseHeader("HX-Refresh")==="true";if(H(n,/HX-Redirect:/i)){e.keepIndicators=true;Q.location.href=n.getResponseHeader("HX-Redirect");l&&Q.location.reload();return}if(l){e.keepIndicators=true;Q.location.reload();return}const c=Mn(t,e);const u=Xn(n);const f=u.swap;let a=!!u.error;let h=Q.config.ignoreTitle||u.ignoreTitle;let d=u.select;if(u.target){e.target=Un(t,u.target)}var p=o.swapOverride;if(p==null&&u.swapOverride){p=u.swapOverride}if(H(n,/HX-Retarget:/i)){e.target=Un(t,n.getResponseHeader("HX-Retarget"))}if(H(n,/HX-Reswap:/i)){p=n.getResponseHeader("HX-Reswap")}var g=n.response;var m=le({shouldSwap:f,serverResponse:g,isError:a,ignoreTitle:h,selectOverride:d,swapOverride:p},e);if(u.event&&!ae(r,u.event,m))return;if(!ae(r,"htmx:beforeSwap",m))return;r=m.target;g=m.serverResponse;a=m.isError;h=m.ignoreTitle;d=m.selectOverride;p=m.swapOverride;e.target=r;e.failed=a;e.successful=!a;if(m.shouldSwap){if(n.status===286){lt(t)}jt(t,function(e){g=e.transformResponse(g,n,t)});if(c.type){Gt()}var y=bn(t,p);if(!y.hasOwnProperty("ignoreTitle")){y.ignoreTitle=h}r.classList.add(Q.config.swappingClass);if(i){d=i}if(H(n,/HX-Reselect:/i)){d=n.getResponseHeader("HX-Reselect")}const x=ne(t,"hx-select-oob");const b=ne(t,"hx-select");$e(r,g,y,{select:d==="unset"?null:d||b,selectOOB:x,eventInfo:e,anchor:e.pathInfo.anchor,contextElement:t,afterSwapCallback:function(){if(H(n,/HX-Trigger-After-Swap:/i)){let e=t;if(!se(t)){e=te().body}Je(n,"HX-Trigger-After-Swap",e)}},afterSettleCallback:function(){if(H(n,/HX-Trigger-After-Settle:/i)){let e=t;if(!se(t)){e=te().body}Je(n,"HX-Trigger-After-Settle",e)}},beforeSwapCallback:function(){if(c.type){ae(te().body,"htmx:beforeHistoryUpdate",le({history:c},e));if(c.type==="push"){Wt(c.path);ae(te().body,"htmx:pushedIntoHistory",{path:c.path})}else{Zt(c.path);ae(te().body,"htmx:replacedInHistory",{path:c.path})}}}})}if(a){fe(t,"htmx:responseError",le({error:"Response Status Error Code "+n.status+" from "+e.pathInfo.requestPath},e))}}const Vn={};function _n(){return{init:function(e){return null},getSelectors:function(){return null},onEvent:function(e,t){return true},transformResponse:function(e,t,n){return e},isInlineSwap:function(e){return false},handleSwap:function(e,t,n,r){return false},encodeParameters:function(e,t,n){return null}}}function zn(e,t){if(t.init){t.init(n)}Vn[e]=le(_n(),t)}function $n(e){delete Vn[e]}function Jn(e,n,r){if(n==undefined){n=[]}if(e==undefined){return n}if(r==undefined){r=[]}const t=a(e,"hx-ext");if(t){ie(t.split(","),function(e){e=e.replace(/ /g,"");if(e.slice(0,7)=="ignore:"){r.push(e.slice(7));return}if(r.indexOf(e)<0){const t=Vn[e];if(t&&n.indexOf(t)<0){n.push(t)}}})}return Jn(ce(u(e)),n,r)}var Kn=false;te().addEventListener("DOMContentLoaded",function(){Kn=true});function Gn(e){if(Kn||te().readyState==="complete"){e()}else{te().addEventListener("DOMContentLoaded",e)}}function Wn(){if(Q.config.includeIndicatorStyles!==false){const e=Q.config.inlineStyleNonce?` nonce="${Q.config.inlineStyleNonce}"`:"";te().head.insertAdjacentHTML("beforeend","<style"+e+"> ."+Q.config.indicatorClass+"{opacity:0} ."+Q.config.requestClass+" ."+Q.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ."+Q.config.requestClass+"."+Q.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} </style>")}}function Zn(){const e=te().querySelector('meta[name="htmx-config"]');if(e){return v(e.content)}else{return null}}function Yn(){const e=Zn();if(e){Q.config=le(Q.config,e)}}Gn(function(){Yn();Wn();let e=te().body;Ft(e);const t=te().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(e){const t=e.target;const n=oe(t);if(n&&n.xhr){n.xhr.abort()}});const n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(e){if(e.state&&e.state.htmx){en();ie(t,function(e){ae(e,"htmx:restored",{document:te(),triggerEvent:ae})})}else{if(n){n(e)}}};b().setTimeout(function(){ae(e,"htmx:load",{});e=null},0)});return Q}();
-1
static/js/npm/hyperscript.min.js
··· 1 - (function(e,t){const r=t(e);if(typeof exports==="object"&&typeof exports["nodeName"]!=="string"){module.exports=r}else{e["_hyperscript"]=r;if("document"in e)e["_hyperscript"].browserInit()}})(typeof self!=="undefined"?self:this,(e=>{"use strict";const t={dynamicResolvers:[function(e,t){if(e==="Fixed"){return Number(t).toFixed()}else if(e.indexOf("Fixed:")===0){let r=e.split(":")[1];return Number(t).toFixed(parseInt(r))}}],String:function(e){if(e.toString){return e.toString()}else{return""+e}},Int:function(e){return parseInt(e)},Float:function(e){return parseFloat(e)},Number:function(e){return Number(e)},Date:function(e){return new Date(e)},Array:function(e){return Array.from(e)},JSON:function(e){return JSON.stringify(e)},Object:function(e){if(e instanceof String){e=e.toString()}if(typeof e==="string"){return JSON.parse(e)}else{return Object.assign({},e)}}};const r={attributes:"_, script, data-script",defaultTransition:"all 500ms ease-in",disableSelector:"[disable-scripting], [data-disable-scripting]",hideShowStrategies:{},conversions:t};class n{static OP_TABLE={"+":"PLUS","-":"MINUS","*":"MULTIPLY","/":"DIVIDE",".":"PERIOD","..":"ELLIPSIS","\\":"BACKSLASH",":":"COLON","%":"PERCENT","|":"PIPE","!":"EXCLAMATION","?":"QUESTION","#":"POUND","&":"AMPERSAND",$:"DOLLAR",";":"SEMI",",":"COMMA","(":"L_PAREN",")":"R_PAREN","<":"L_ANG",">":"R_ANG","<=":"LTE_ANG",">=":"GTE_ANG","==":"EQ","===":"EQQ","!=":"NEQ","!==":"NEQQ","{":"L_BRACE","}":"R_BRACE","[":"L_BRACKET","]":"R_BRACKET","=":"EQUALS","~":"TILDE"};static isValidCSSClassChar(e){return n.isAlpha(e)||n.isNumeric(e)||e==="-"||e==="_"||e===":"}static isValidCSSIDChar(e){return n.isAlpha(e)||n.isNumeric(e)||e==="-"||e==="_"||e===":"}static isWhitespace(e){return e===" "||e==="\t"||n.isNewline(e)}static positionString(e){return"[Line: "+e.line+", Column: "+e.column+"]"}static isNewline(e){return e==="\r"||e==="\n"}static isNumeric(e){return e>="0"&&e<="9"}static isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}static isIdentifierChar(e,t){return e==="_"||e==="$"}static isReservedChar(e){return e==="`"||e==="^"}static isValidSingleQuoteStringStart(e){if(e.length>0){var t=e[e.length-1];if(t.type==="IDENTIFIER"||t.type==="CLASS_REF"||t.type==="ID_REF"){return false}if(t.op&&(t.value===">"||t.value===")")){return false}}return true}static tokenize(e,t){var r=[];var a=e;var o=0;var s=0;var u=1;var l="<START>";var c=0;function f(){return t&&c===0}while(o<a.length){if(q()==="-"&&I()==="-"&&(n.isWhitespace(C(2))||C(2)===""||C(2)==="-")||q()==="/"&&I()==="/"&&(n.isWhitespace(C(2))||C(2)===""||C(2)==="/")){h()}else if(q()==="/"&&I()==="*"&&(n.isWhitespace(C(2))||C(2)===""||C(2)==="*")){v()}else{if(n.isWhitespace(q())){r.push(L())}else if(!A()&&q()==="."&&(n.isAlpha(I())||I()==="{"||I()==="-")){r.push(d())}else if(!A()&&q()==="#"&&(n.isAlpha(I())||I()==="{")){r.push(k())}else if(q()==="["&&I()==="@"){r.push(E())}else if(q()==="@"){r.push(T())}else if(q()==="*"&&n.isAlpha(I())){r.push(y())}else if(f()&&(n.isAlpha(q())||q()==="\\")){r.push(x())}else if(!f()&&(n.isAlpha(q())||n.isIdentifierChar(q()))){r.push(g())}else if(n.isNumeric(q())){r.push(b())}else if(!f()&&(q()==='"'||q()==="`")){r.push(S())}else if(!f()&&q()==="'"){if(n.isValidSingleQuoteStringStart(r)){r.push(S())}else{r.push(w())}}else if(n.OP_TABLE[q()]){if(l==="$"&&q()==="{"){c++}if(q()==="}"){c--}r.push(w())}else if(f()||n.isReservedChar(q())){r.push(p("RESERVED",R()))}else{if(o<a.length){throw Error("Unknown token: "+q()+" ")}}}}return new i(r,[],a);function m(e,t){var r=p(e,t);r.op=true;return r}function p(e,t){return{type:e,value:t||"",start:o,end:o+1,column:s,line:u}}function h(){while(q()&&!n.isNewline(q())){R()}R()}function v(){while(q()&&!(q()==="*"&&I()==="/")){R()}R();R()}function d(){var e=p("CLASS_REF");var t=R();if(q()==="{"){e.template=true;t+=R();while(q()&&q()!=="}"){t+=R()}if(q()!=="}"){throw Error("Unterminated class reference")}else{t+=R()}}else{while(n.isValidCSSClassChar(q())||q()==="\\"){if(q()==="\\"){R()}t+=R()}}e.value=t;e.end=o;return e}function E(){var e=p("ATTRIBUTE_REF");var t=R();while(o<a.length&&q()!=="]"){t+=R()}if(q()==="]"){t+=R()}e.value=t;e.end=o;return e}function T(){var e=p("ATTRIBUTE_REF");var t=R();while(n.isValidCSSIDChar(q())){t+=R()}if(q()==="="){t+=R();if(q()==='"'||q()==="'"){let e=S();t+=e.value}else if(n.isAlpha(q())||n.isNumeric(q())||n.isIdentifierChar(q())){let e=g();t+=e.value}}e.value=t;e.end=o;return e}function y(){var e=p("STYLE_REF");var t=R();while(n.isAlpha(q())||q()==="-"){t+=R()}e.value=t;e.end=o;return e}function k(){var e=p("ID_REF");var t=R();if(q()==="{"){e.template=true;t+=R();while(q()&&q()!=="}"){t+=R()}if(q()!=="}"){throw Error("Unterminated id reference")}else{R()}}else{while(n.isValidCSSIDChar(q())){t+=R()}}e.value=t;e.end=o;return e}function x(){var e=p("IDENTIFIER");var t=R();var r=t==="\\";if(r){t=""}while(n.isAlpha(q())||n.isNumeric(q())||n.isIdentifierChar(q())||q()==="\\"||q()==="{"||q()==="}"){if(q()==="$"&&r===false){break}else if(q()==="\\"){r=true;R()}else{r=false;t+=R()}}if(q()==="!"&&t==="beep"){t+=R()}e.value=t;e.end=o;return e}function g(){var e=p("IDENTIFIER");var t=R();while(n.isAlpha(q())||n.isNumeric(q())||n.isIdentifierChar(q())){t+=R()}if(q()==="!"&&t==="beep"){t+=R()}e.value=t;e.end=o;return e}function b(){var e=p("NUMBER");var t=R();while(n.isNumeric(q())){t+=R()}if(q()==="."&&n.isNumeric(I())){t+=R()}while(n.isNumeric(q())){t+=R()}if(q()==="e"||q()==="E"){if(n.isNumeric(I())){t+=R()}else if(I()==="-"){t+=R();t+=R()}}while(n.isNumeric(q())){t+=R()}e.value=t;e.end=o;return e}function w(){var e=m();var t=R();while(q()&&n.OP_TABLE[t+q()]){t+=R()}e.type=n.OP_TABLE[t];e.value=t;e.end=o;return e}function S(){var e=p("STRING");var t=R();e.template=t==="`";var r="";while(q()&&q()!==t){if(q()==="\\"){R();let t=R();if(t==="b"){r+="\b"}else if(t==="f"){r+="\f"}else if(t==="n"){r+="\n"}else if(t==="r"){r+="\r"}else if(t==="t"){r+="\t"}else if(t==="v"){r+="\v"}else if(e.template&&t==="$"){r+="\\$"}else if(t==="x"){const t=N();if(Number.isNaN(t)){throw Error("Invalid hexadecimal escape at "+n.positionString(e))}r+=String.fromCharCode(t)}else{r+=t}}else{r+=R()}}if(q()!==t){throw Error("Unterminated string at "+n.positionString(e))}else{R()}e.value=r;e.end=o;return e}function N(){const e=16;if(!q()){return NaN}let t=e*Number.parseInt(R(),e);if(!q()){return NaN}t+=Number.parseInt(R(),e);return t}function q(){return a.charAt(o)}function I(){return a.charAt(o+1)}function C(e=1){return a.charAt(o+e)}function R(){l=q();o++;s++;return l}function A(){return n.isAlpha(l)||n.isNumeric(l)||l===")"||l==='"'||l==="'"||l==="`"||l==="}"||l==="]"}function L(){var e=p("WHITESPACE");var t="";while(q()&&n.isWhitespace(q())){if(n.isNewline(q())){s=0;u++}t+=R()}e.value=t;e.end=o;return e}}tokenize(e,t){return n.tokenize(e,t)}}class i{constructor(e,t,r){this.tokens=e;this.consumed=t;this.source=r;this.consumeWhitespace()}get list(){return this.tokens}_lastConsumed=null;consumeWhitespace(){while(this.token(0,true).type==="WHITESPACE"){this.consumed.push(this.tokens.shift())}}raiseError(e,t){a.raiseParseError(e,t)}requireOpToken(e){var t=this.matchOpToken(e);if(t){return t}else{this.raiseError(this,"Expected '"+e+"' but found '"+this.currentToken().value+"'")}}matchAnyOpToken(e,t,r){for(var n=0;n<arguments.length;n++){var i=arguments[n];var a=this.matchOpToken(i);if(a){return a}}}matchAnyToken(e,t,r){for(var n=0;n<arguments.length;n++){var i=arguments[n];var a=this.matchToken(i);if(a){return a}}}matchOpToken(e){if(this.currentToken()&&this.currentToken().op&&this.currentToken().value===e){return this.consumeToken()}}requireTokenType(e,t,r,n){var i=this.matchTokenType(e,t,r,n);if(i){return i}else{this.raiseError(this,"Expected one of "+JSON.stringify([e,t,r]))}}matchTokenType(e,t,r,n){if(this.currentToken()&&this.currentToken().type&&[e,t,r,n].indexOf(this.currentToken().type)>=0){return this.consumeToken()}}requireToken(e,t){var r=this.matchToken(e,t);if(r){return r}else{this.raiseError(this,"Expected '"+e+"' but found '"+this.currentToken().value+"'")}}peekToken(e,t,r){t=t||0;r=r||"IDENTIFIER";if(this.tokens[t]&&this.tokens[t].value===e&&this.tokens[t].type===r){return this.tokens[t]}}matchToken(e,t){if(this.follows.indexOf(e)!==-1){return}t=t||"IDENTIFIER";if(this.currentToken()&&this.currentToken().value===e&&this.currentToken().type===t){return this.consumeToken()}}consumeToken(){var e=this.tokens.shift();this.consumed.push(e);this._lastConsumed=e;this.consumeWhitespace();return e}consumeUntil(e,t){var r=[];var n=this.token(0,true);while((t==null||n.type!==t)&&(e==null||n.value!==e)&&n.type!=="EOF"){var i=this.tokens.shift();this.consumed.push(i);r.push(n);n=this.token(0,true)}this.consumeWhitespace();return r}lastWhitespace(){if(this.consumed[this.consumed.length-1]&&this.consumed[this.consumed.length-1].type==="WHITESPACE"){return this.consumed[this.consumed.length-1].value}else{return""}}consumeUntilWhitespace(){return this.consumeUntil(null,"WHITESPACE")}hasMore(){return this.tokens.length>0}token(e,t){var r;var n=0;do{if(!t){while(this.tokens[n]&&this.tokens[n].type==="WHITESPACE"){n++}}r=this.tokens[n];e--;n++}while(e>-1);if(r){return r}else{return{type:"EOF",value:"<<<EOF>>>"}}}currentToken(){return this.token(0)}lastMatch(){return this._lastConsumed}static sourceFor=function(){return this.programSource.substring(this.startToken.start,this.endToken.end)};static lineFor=function(){return this.programSource.split("\n")[this.startToken.line-1]};follows=[];pushFollow(e){this.follows.push(e)}popFollow(){this.follows.pop()}clearFollows(){var e=this.follows;this.follows=[];return e}restoreFollows(e){this.follows=e}}class a{constructor(e){this.runtime=e;this.possessivesDisabled=false;this.addGrammarElement("feature",(function(e,t,r){if(r.matchOpToken("(")){var n=e.requireElement("feature",r);r.requireOpToken(")");return n}var i=e.FEATURES[r.currentToken().value||""];if(i){return i(e,t,r)}}));this.addGrammarElement("command",(function(e,t,r){if(r.matchOpToken("(")){const t=e.requireElement("command",r);r.requireOpToken(")");return t}var n=e.COMMANDS[r.currentToken().value||""];let i;if(n){i=n(e,t,r)}else if(r.currentToken().type==="IDENTIFIER"){i=e.parseElement("pseudoCommand",r)}if(i){return e.parseElement("indirectStatement",r,i)}return i}));this.addGrammarElement("commandList",(function(e,t,r){if(r.hasMore()){var n=e.parseElement("command",r);if(n){r.matchToken("then");const t=e.parseElement("commandList",r);if(t)n.next=t;return n}}return{type:"emptyCommandListCommand",op:function(e){return t.findNext(this,e)},execute:function(e){return t.unifiedExec(this,e)}}}));this.addGrammarElement("leaf",(function(e,t,r){var n=e.parseAnyOf(e.LEAF_EXPRESSIONS,r);if(n==null){return e.parseElement("symbol",r)}return n}));this.addGrammarElement("indirectExpression",(function(e,t,r,n){for(var i=0;i<e.INDIRECT_EXPRESSIONS.length;i++){var a=e.INDIRECT_EXPRESSIONS[i];n.endToken=r.lastMatch();var o=e.parseElement(a,r,n);if(o){return o}}return n}));this.addGrammarElement("indirectStatement",(function(e,t,r,n){if(r.matchToken("unless")){n.endToken=r.lastMatch();var i=e.requireElement("expression",r);var a={type:"unlessStatementModifier",args:[i],op:function(e,t){if(t){return this.next}else{return n}},execute:function(e){return t.unifiedExec(this,e)}};n.parent=a;return a}return n}));this.addGrammarElement("primaryExpression",(function(e,t,r){var n=e.parseElement("leaf",r);if(n){return e.parseElement("indirectExpression",r,n)}e.raiseParseError(r,"Unexpected value: "+r.currentToken().value)}))}use(e){e(this);return this}GRAMMAR={};COMMANDS={};FEATURES={};LEAF_EXPRESSIONS=[];INDIRECT_EXPRESSIONS=[];initElt(e,t,r){e.startToken=t;e.sourceFor=i.sourceFor;e.lineFor=i.lineFor;e.programSource=r.source}parseElement(e,t,r=undefined){var n=this.GRAMMAR[e];if(n){var i=t.currentToken();var a=n(this,this.runtime,t,r);if(a){this.initElt(a,i,t);a.endToken=a.endToken||t.lastMatch();var r=a.root;while(r!=null){this.initElt(r,i,t);r=r.root}}return a}}requireElement(e,t,r,n){var i=this.parseElement(e,t,n);if(!i)a.raiseParseError(t,r||"Expected "+e);return i}parseAnyOf(e,t){for(var r=0;r<e.length;r++){var n=e[r];var i=this.parseElement(n,t);if(i){return i}}}addGrammarElement(e,t){this.GRAMMAR[e]=t}addCommand(e,t){var r=e+"Command";var n=function(e,n,i){const a=t(e,n,i);if(a){a.type=r;a.execute=function(e){e.meta.command=a;return n.unifiedExec(this,e)};return a}};this.GRAMMAR[r]=n;this.COMMANDS[e]=n}addFeature(e,t){var r=e+"Feature";var n=function(n,i,a){var o=t(n,i,a);if(o){o.isFeature=true;o.keyword=e;o.type=r;return o}};this.GRAMMAR[r]=n;this.FEATURES[e]=n}addLeafExpression(e,t){this.LEAF_EXPRESSIONS.push(e);this.addGrammarElement(e,t)}addIndirectExpression(e,t){this.INDIRECT_EXPRESSIONS.push(e);this.addGrammarElement(e,t)}static createParserContext(e){var t=e.currentToken();var r=e.source;var n=r.split("\n");var i=t&&t.line?t.line-1:n.length-1;var a=n[i];var o=t&&t.line?t.column:a.length-1;return a+"\n"+" ".repeat(o)+"^^\n\n"}static raiseParseError(e,t){t=(t||"Unexpected Token : "+e.currentToken().value)+"\n\n"+a.createParserContext(e);var r=new Error(t);r["tokens"]=e;throw r}raiseParseError(e,t){a.raiseParseError(e,t)}parseHyperScript(e){var t=this.parseElement("hyperscript",e);if(e.hasMore())this.raiseParseError(e);if(t)return t}setParent(e,t){if(typeof e==="object"){e.parent=t;if(typeof t==="object"){t.children=t.children||new Set;t.children.add(e)}this.setParent(e.next,t)}}commandStart(e){return this.COMMANDS[e.value||""]}featureStart(e){return this.FEATURES[e.value||""]}commandBoundary(e){if(e.value=="end"||e.value=="then"||e.value=="else"||e.value=="otherwise"||e.value==")"||this.commandStart(e)||this.featureStart(e)||e.type=="EOF"){return true}return false}parseStringTemplate(e){var t=[""];do{t.push(e.lastWhitespace());if(e.currentToken().value==="$"){e.consumeToken();var r=e.matchOpToken("{");t.push(this.requireElement("expression",e));if(r){e.requireOpToken("}")}t.push("")}else if(e.currentToken().value==="\\"){e.consumeToken();e.consumeToken()}else{var n=e.consumeToken();t[t.length-1]+=n?n.value:""}}while(e.hasMore());t.push(e.lastWhitespace());return t}ensureTerminated(e){const t=this.runtime;var r={type:"implicitReturn",op:function(e){e.meta.returned=true;if(e.meta.resolve){e.meta.resolve()}return t.HALT},execute:function(e){}};var n=e;while(n.next){n=n.next}n.next=r}}class o{constructor(e,t){this.lexer=e??new n;this.parser=t??new a(this).use(T).use(y);this.parser.runtime=this}matchesSelector(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return r&&r.call(e,t)}makeEvent(t,r){var n;if(e.Event&&typeof e.Event==="function"){n=new Event(t,{bubbles:true,cancelable:true,composed:true});n["detail"]=r}else{n=document.createEvent("CustomEvent");n.initCustomEvent(t,true,true,r)}return n}triggerEvent(e,t,r,n){r=r||{};r["sender"]=n;var i=this.makeEvent(t,r);var a=e.dispatchEvent(i);return a}isArrayLike(e){return Array.isArray(e)||typeof NodeList!=="undefined"&&(e instanceof NodeList||e instanceof HTMLCollection||e instanceof FileList)}isIterable(e){return typeof e==="object"&&Symbol.iterator in e&&typeof e[Symbol.iterator]==="function"}shouldAutoIterate(e){return e!=null&&e[p]||this.isArrayLike(e)}forEach(e,t){if(e==null){}else if(this.isIterable(e)){for(const r of e){t(r)}}else if(this.isArrayLike(e)){for(var r=0;r<e.length;r++){t(e[r])}}else{t(e)}}implicitLoop(e,t){if(this.shouldAutoIterate(e)){for(const r of e)t(r)}else{t(e)}}wrapArrays(e){var t=[];for(var r=0;r<e.length;r++){var n=e[r];if(Array.isArray(n)){t.push(Promise.all(n))}else{t.push(n)}}return t}unwrapAsyncs(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.asyncWrapper){e[t]=r.value}if(Array.isArray(r)){for(var n=0;n<r.length;n++){var i=r[n];if(i.asyncWrapper){r[n]=i.value}}}}}static HALT={};HALT=o.HALT;unifiedExec(e,t){while(true){try{var r=this.unifiedEval(e,t)}catch(n){if(t.meta.handlingFinally){console.error(" Exception in finally block: ",n);r=o.HALT}else{this.registerHyperTrace(t,n);if(t.meta.errorHandler&&!t.meta.handlingError){t.meta.handlingError=true;t.locals[t.meta.errorSymbol]=n;e=t.meta.errorHandler;continue}else{t.meta.currentException=n;r=o.HALT}}}if(r==null){console.error(e," did not return a next element to execute! context: ",t);return}else if(r.then){r.then((e=>{this.unifiedExec(e,t)})).catch((e=>{this.unifiedExec({op:function(){throw e}},t)}));return}else if(r===o.HALT){if(t.meta.finallyHandler&&!t.meta.handlingFinally){t.meta.handlingFinally=true;e=t.meta.finallyHandler}else{if(t.meta.onHalt){t.meta.onHalt()}if(t.meta.currentException){if(t.meta.reject){t.meta.reject(t.meta.currentException);return}else{throw t.meta.currentException}}else{return}}}else{e=r}}}unifiedEval(e,t,r){var n=[t];var i=false;var a=false;if(e.args){for(var o=0;o<e.args.length;o++){var s=e.args[o];if(s==null){n.push(null)}else if(Array.isArray(s)){var u=[];for(var l=0;l<s.length;l++){var c=s[l];var f=c?c.evaluate(t):null;if(f){if(f.then){i=true}else if(f.asyncWrapper){a=true}}u.push(f)}n.push(u)}else if(s.evaluate){var f=s.evaluate(t);if(f){if(f.then){i=true}else if(f.asyncWrapper){a=true}}n.push(f);if(f){if(r===true){break}}else{if(r===false){break}}}else{n.push(s)}}}if(i){return new Promise(((t,r)=>{n=this.wrapArrays(n);Promise.all(n).then((function(n){if(a){this.unwrapAsyncs(n)}try{var i=e.op.apply(e,n);t(i)}catch(e){r(e)}})).catch((function(e){r(e)}))}))}else{if(a){this.unwrapAsyncs(n)}return e.op.apply(e,n)}}_scriptAttrs=null;getScriptAttributes(){if(this._scriptAttrs==null){this._scriptAttrs=r.attributes.replace(/ /g,"").split(",")}return this._scriptAttrs}getScript(e){for(var t=0;t<this.getScriptAttributes().length;t++){var r=this.getScriptAttributes()[t];if(e.hasAttribute&&e.hasAttribute(r)){return e.getAttribute(r)}}if(e instanceof HTMLScriptElement&&e.type==="text/hyperscript"){return e.innerText}return null}hyperscriptFeaturesMap=new WeakMap;getHyperscriptFeatures(e){var t=this.hyperscriptFeaturesMap.get(e);if(typeof t==="undefined"){if(e){this.hyperscriptFeaturesMap.set(e,t={})}}return t}addFeatures(e,t){if(e){Object.assign(t.locals,this.getHyperscriptFeatures(e));this.addFeatures(e.parentElement,t)}}makeContext(e,t,r,n){return new f(e,t,r,n,this)}getScriptSelector(){return this.getScriptAttributes().map((function(e){return"["+e+"]"})).join(", ")}convertValue(e,r){var n=t.dynamicResolvers;for(var i=0;i<n.length;i++){var a=n[i];var o=a(r,e);if(o!==undefined){return o}}if(e==null){return null}var s=t[r];if(s){return s(e)}throw"Unknown conversion : "+r}parse(e){const t=this.lexer,r=this.parser;var n=t.tokenize(e);if(this.parser.commandStart(n.currentToken())){var i=r.requireElement("commandList",n);if(n.hasMore())r.raiseParseError(n);r.ensureTerminated(i);return i}else if(r.featureStart(n.currentToken())){var a=r.requireElement("hyperscript",n);if(n.hasMore())r.raiseParseError(n);return a}else{var o=r.requireElement("expression",n);if(n.hasMore())r.raiseParseError(n);return o}}evaluateNoPromise(e,t){let r=e.evaluate(t);if(r.next){throw new Error(i.sourceFor.call(e)+" returned a Promise in a context that they are not allowed.")}return r}evaluate(t,r,n){class i extends EventTarget{constructor(e){super();this.module=e}toString(){return this.module.id}}var a="document"in e?e.document.body:new i(n&&n.module);r=Object.assign(this.makeContext(a,null,a,null),r||{});var o=this.parse(t);if(o.execute){o.execute(r);if(typeof r.meta.returnValue!=="undefined"){return r.meta.returnValue}else{return r.result}}else if(o.apply){o.apply(a,a,n);return this.getHyperscriptFeatures(a)}else{return o.evaluate(r)}function s(){return{}}}processNode(e){var t=this.getScriptSelector();if(this.matchesSelector(e,t)){this.initElement(e,e)}if(e instanceof HTMLScriptElement&&e.type==="text/hyperscript"){this.initElement(e,document.body)}if(e.querySelectorAll){this.forEach(e.querySelectorAll(t+", [type='text/hyperscript']"),(e=>{this.initElement(e,e instanceof HTMLScriptElement&&e.type==="text/hyperscript"?document.body:e)}))}}initElement(e,t){if(e.closest&&e.closest(r.disableSelector)){return}var n=this.getInternalData(e);if(!n.initialized){var i=this.getScript(e);if(i){try{n.initialized=true;n.script=i;const r=this.lexer,s=this.parser;var a=r.tokenize(i);var o=s.parseHyperScript(a);if(!o)return;o.apply(t||e,e);setTimeout((()=>{this.triggerEvent(t||e,"load",{hyperscript:true})}),1)}catch(t){this.triggerEvent(e,"exception",{error:t});console.error("hyperscript errors were found on the following element:",e,"\n\n",t.message,t.stack)}}}}internalDataMap=new WeakMap;getInternalData(e){var t=this.internalDataMap.get(e);if(typeof t==="undefined"){this.internalDataMap.set(e,t={})}return t}typeCheck(e,t,r){if(e==null&&r){return true}var n=Object.prototype.toString.call(e).slice(8,-1);return n===t}getElementScope(e){var t=e.meta&&e.meta.owner;if(t){var r=this.getInternalData(t);var n="elementScope";if(e.meta.feature&&e.meta.feature.behavior){n=e.meta.feature.behavior+"Scope"}var i=h(r,n);return i}else{return{}}}isReservedWord(e){return["meta","it","result","locals","event","target","detail","sender","body"].includes(e)}isHyperscriptContext(e){return e instanceof f}resolveSymbol(t,r,n){if(t==="me"||t==="my"||t==="I"){return r.me}if(t==="it"||t==="its"||t==="result"){return r.result}if(t==="you"||t==="your"||t==="yourself"){return r.you}else{if(n==="global"){return e[t]}else if(n==="element"){var i=this.getElementScope(r);return i[t]}else if(n==="local"){return r.locals[t]}else{if(r.meta&&r.meta.context){var a=r.meta.context[t];if(typeof a!=="undefined"){return a}if(r.meta.context.detail){a=r.meta.context.detail[t];if(typeof a!=="undefined"){return a}}}if(this.isHyperscriptContext(r)&&!this.isReservedWord(t)){var o=r.locals[t]}else{var o=r[t]}if(typeof o!=="undefined"){return o}else{var i=this.getElementScope(r);o=i[t];if(typeof o!=="undefined"){return o}else{return e[t]}}}}}setSymbol(t,r,n,i){if(n==="global"){e[t]=i}else if(n==="element"){var a=this.getElementScope(r);a[t]=i}else if(n==="local"){r.locals[t]=i}else{if(this.isHyperscriptContext(r)&&!this.isReservedWord(t)&&typeof r.locals[t]!=="undefined"){r.locals[t]=i}else{var a=this.getElementScope(r);var o=a[t];if(typeof o!=="undefined"){a[t]=i}else{if(this.isHyperscriptContext(r)&&!this.isReservedWord(t)){r.locals[t]=i}else{r[t]=i}}}}}findNext(e,t){if(e){if(e.resolveNext){return e.resolveNext(t)}else if(e.next){return e.next}else{return this.findNext(e.parent,t)}}}flatGet(e,t,r){if(e!=null){var n=r(e,t);if(typeof n!=="undefined"){return n}if(this.shouldAutoIterate(e)){var i=[];for(var a of e){var o=r(a,t);i.push(o)}return i}}}resolveProperty(e,t){return this.flatGet(e,t,((e,t)=>e[t]))}resolveAttribute(e,t){return this.flatGet(e,t,((e,t)=>e.getAttribute&&e.getAttribute(t)))}resolveStyle(e,t){return this.flatGet(e,t,((e,t)=>e.style&&e.style[t]))}resolveComputedStyle(e,t){return this.flatGet(e,t,((e,t)=>getComputedStyle(e).getPropertyValue(t)))}assignToNamespace(t,r,n,i){let a;if(typeof document!=="undefined"&&t===document.body){a=e}else{a=this.getHyperscriptFeatures(t)}var o;while((o=r.shift())!==undefined){var s=a[o];if(s==null){s={};a[o]=s}a=s}a[n]=i}getHyperTrace(e,t){var r=[];var n=e;while(n.meta.caller){n=n.meta.caller}if(n.meta.traceMap){return n.meta.traceMap.get(t,r)}}registerHyperTrace(e,t){var r=[];var n=null;while(e!=null){r.push(e);n=e;e=e.meta.caller}if(n.meta.traceMap==null){n.meta.traceMap=new Map}if(!n.meta.traceMap.get(t)){var i={trace:r,print:function(e){e=e||console.error;e("hypertrace /// ");var t=0;for(var n=0;n<r.length;n++){t=Math.max(t,r[n].meta.feature.displayName.length)}for(var n=0;n<r.length;n++){var i=r[n];e(" ->",i.meta.feature.displayName.padEnd(t+2),"-",i.meta.owner)}}};n.meta.traceMap.set(t,i)}}escapeSelector(e){return e.replace(/[:&()\[\]\/]/g,(function(e){return"\\"+e}))}nullCheck(e,t){if(e==null){throw new Error("'"+t.sourceFor()+"' is null")}}isEmpty(e){return e==undefined||e.length===0}doesExist(e){if(e==null){return false}if(this.shouldAutoIterate(e)){for(const t of e){return true}return false}return true}getRootNode(e){if(e&&e instanceof Node){var t=e.getRootNode();if(t instanceof Document||t instanceof ShadowRoot)return t}return document}getEventQueueFor(e,t){let r=this.getInternalData(e);var n=r.eventQueues;if(n==null){n=new Map;r.eventQueues=n}var i=n.get(t);if(i==null){i={queue:[],executing:false};n.set(t,i)}return i}beepValueToConsole(e,t,r){if(this.triggerEvent(e,"hyperscript:beep",{element:e,expression:t,value:r})){var n;if(r){if(r instanceof m){n="ElementCollection"}else if(r.constructor){n=r.constructor.name}else{n="unknown"}}else{n="object (null)"}var a=r;if(n==="String"){a='"'+a+'"'}else if(r instanceof m){a=Array.from(r)}console.log("///_ BEEP! The expression ("+i.sourceFor.call(t).replace("beep! ","")+") evaluates to:",a,"of type "+n)}}hyperscriptUrl="document"in e&&document.currentScript?document.currentScript.src:null}function s(){let e=document.cookie.split("; ").map((e=>{let t=e.split("=");return{name:t[0],value:decodeURIComponent(t[1])}}));return e}function u(e){document.cookie=e+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}function l(){for(const e of s()){u(e.name)}}const c=new Proxy({},{get(e,t){if(t==="then"||t==="asyncWrapper"){return null}else if(t==="length"){return s().length}else if(t==="clear"){return u}else if(t==="clearAll"){return l}else if(typeof t==="string"){if(!isNaN(t)){return s()[parseInt(t)]}else{let e=document.cookie.split("; ").find((e=>e.startsWith(t+"=")))?.split("=")[1];if(e){return decodeURIComponent(e)}}}else if(t===Symbol.iterator){return s()[t]}},set(e,t,r){var n=null;if("string"===typeof r){n=encodeURIComponent(r);n+=";samesite=lax"}else{n=encodeURIComponent(r.value);if(r.expires){n+=";expires="+r.maxAge}if(r.maxAge){n+=";max-age="+r.maxAge}if(r.partitioned){n+=";partitioned="+r.partitioned}if(r.path){n+=";path="+r.path}if(r.samesite){n+=";samesite="+r.path}if(r.secure){n+=";secure="+r.path}}document.cookie=t+"="+n;return true}});class f{constructor(t,r,n,i,a){this.meta={parser:a.parser,lexer:a.lexer,runtime:a,owner:t,feature:r,iterators:{},ctx:this};this.locals={cookies:c};this.me=n,this.you=undefined;this.result=undefined;this.event=i;this.target=i?i.target:null;this.detail=i?i.detail:null;this.sender=i?i.detail?i.detail.sender:null:null;this.body="document"in e?document.body:null;a.addFeatures(t,this)}}class m{constructor(e,t,r){this._css=e;this.relativeToElement=t;this.escape=r;this[p]=true}get css(){if(this.escape){return o.prototype.escapeSelector(this._css)}else{return this._css}}get className(){return this._css.substr(1)}get id(){return this.className()}contains(e){for(let t of this){if(t.contains(e)){return true}}return false}get length(){return this.selectMatches().length}[Symbol.iterator](){let e=this.selectMatches();return e[Symbol.iterator]()}selectMatches(){let e=o.prototype.getRootNode(this.relativeToElement).querySelectorAll(this.css);return e}}const p=Symbol();function h(e,t){var r=e[t];if(r){return r}else{var n={};e[t]=n;return n}}function v(e){try{return JSON.parse(e)}catch(e){d(e);return null}}function d(e){if(console.error){console.error(e)}else if(console.log){console.log("ERROR: ",e)}}function E(e,t){return new(e.bind.apply(e,[e].concat(t)))}function T(t){t.addLeafExpression("parenthesized",(function(e,t,r){if(r.matchOpToken("(")){var n=r.clearFollows();try{var i=e.requireElement("expression",r)}finally{r.restoreFollows(n)}r.requireOpToken(")");return i}}));t.addLeafExpression("string",(function(e,t,r){var i=r.matchTokenType("STRING");if(!i)return;var a=i.value;var o;if(i.template){var s=n.tokenize(a,true);o=e.parseStringTemplate(s)}else{o=[]}return{type:"string",token:i,args:o,op:function(e){var t="";for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n!==undefined){t+=n}}return t},evaluate:function(e){if(o.length===0){return a}else{return t.unifiedEval(this,e)}}}}));t.addGrammarElement("nakedString",(function(e,t,r){if(r.hasMore()){var n=r.consumeUntilWhitespace();r.matchTokenType("WHITESPACE");return{type:"nakedString",tokens:n,evaluate:function(e){return n.map((function(e){return e.value})).join("")}}}}));t.addLeafExpression("number",(function(e,t,r){var n=r.matchTokenType("NUMBER");if(!n)return;var i=n;var a=parseFloat(n.value);return{type:"number",value:a,numberToken:i,evaluate:function(){return a}}}));t.addLeafExpression("idRef",(function(e,t,r){var i=r.matchTokenType("ID_REF");if(!i)return;if(!i.value)return;if(i.template){var a=i.value.substring(2);var o=n.tokenize(a);var s=e.requireElement("expression",o);return{type:"idRefTemplate",args:[s],op:function(e,r){return t.getRootNode(e.me).getElementById(r)},evaluate:function(e){return t.unifiedEval(this,e)}}}else{const e=i.value.substring(1);return{type:"idRef",css:i.value,value:e,evaluate:function(r){return t.getRootNode(r.me).getElementById(e)}}}}));t.addLeafExpression("classRef",(function(e,t,r){var i=r.matchTokenType("CLASS_REF");if(!i)return;if(!i.value)return;if(i.template){var a=i.value.substring(2);var o=n.tokenize(a);var s=e.requireElement("expression",o);return{type:"classRefTemplate",args:[s],op:function(e,t){return new m("."+t,e.me,true)},evaluate:function(e){return t.unifiedEval(this,e)}}}else{const e=i.value;return{type:"classRef",css:e,evaluate:function(t){return new m(e,t.me,true)}}}}));class r extends m{constructor(e,t,r){super(e,t);this.templateParts=r;this.elements=r.filter((e=>e instanceof Element))}get css(){let e="",t=0;for(const r of this.templateParts){if(r instanceof Element){e+="[data-hs-query-id='"+t+++"']"}else e+=r}return e}[Symbol.iterator](){this.elements.forEach(((e,t)=>e.dataset.hsQueryId=t));const e=super[Symbol.iterator]();this.elements.forEach((e=>e.removeAttribute("data-hs-query-id")));return e}}t.addLeafExpression("queryRef",(function(e,t,i){var a=i.matchOpToken("<");if(!a)return;var o=i.consumeUntil("/");i.requireOpToken("/");i.requireOpToken(">");var s=o.map((function(e){if(e.type==="STRING"){return'"'+e.value+'"'}else{return e.value}})).join("");var u,l,c;if(/\$[^=]/.test(s)){u=true;l=n.tokenize(s,true);c=e.parseStringTemplate(l)}return{type:"queryRef",css:s,args:c,op:function(e,...t){if(u){return new r(s,e.me,t)}else{return new m(s,e.me)}},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addLeafExpression("attributeRef",(function(e,t,r){var n=r.matchTokenType("ATTRIBUTE_REF");if(!n)return;if(!n.value)return;var i=n.value;if(i.indexOf("[")===0){var a=i.substring(2,i.length-1)}else{var a=i.substring(1)}var o="["+a+"]";var s=a.split("=");var u=s[0];var l=s[1];if(l){if(l.indexOf('"')===0){l=l.substring(1,l.length-1)}}return{type:"attributeRef",name:u,css:o,value:l,op:function(e){var t=e.you||e.me;if(t){return t.getAttribute(u)}},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addLeafExpression("styleRef",(function(e,t,r){var n=r.matchTokenType("STYLE_REF");if(!n)return;if(!n.value)return;var i=n.value.substr(1);if(i.startsWith("computed-")){i=i.substr("computed-".length);return{type:"computedStyleRef",name:i,op:function(e){var r=e.you||e.me;if(r){return t.resolveComputedStyle(r,i)}},evaluate:function(e){return t.unifiedEval(this,e)}}}else{return{type:"styleRef",name:i,op:function(e){var r=e.you||e.me;if(r){return t.resolveStyle(r,i)}},evaluate:function(e){return t.unifiedEval(this,e)}}}}));t.addGrammarElement("objectKey",(function(e,t,r){var n;if(n=r.matchTokenType("STRING")){return{type:"objectKey",key:n.value,evaluate:function(){return n.value}}}else if(r.matchOpToken("[")){var i=e.parseElement("expression",r);r.requireOpToken("]");return{type:"objectKey",expr:i,args:[i],op:function(e,t){return t},evaluate:function(e){return t.unifiedEval(this,e)}}}else{var a="";do{n=r.matchTokenType("IDENTIFIER")||r.matchOpToken("-");if(n)a+=n.value}while(n);return{type:"objectKey",key:a,evaluate:function(){return a}}}}));t.addLeafExpression("objectLiteral",(function(e,t,r){if(!r.matchOpToken("{"))return;var n=[];var i=[];if(!r.matchOpToken("}")){do{var a=e.requireElement("objectKey",r);r.requireOpToken(":");var o=e.requireElement("expression",r);i.push(o);n.push(a)}while(r.matchOpToken(",")&&!r.peekToken("}",0,"R_BRACE"));r.requireOpToken("}")}return{type:"objectLiteral",args:[n,i],op:function(e,t,r){var n={};for(var i=0;i<t.length;i++){n[t[i]]=r[i]}return n},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addGrammarElement("nakedNamedArgumentList",(function(e,t,r){var n=[];var i=[];if(r.currentToken().type==="IDENTIFIER"){do{var a=r.requireTokenType("IDENTIFIER");r.requireOpToken(":");var o=e.requireElement("expression",r);i.push(o);n.push({name:a,value:o})}while(r.matchOpToken(","))}return{type:"namedArgumentList",fields:n,args:[i],op:function(e,t){var r={_namedArgList_:true};for(var i=0;i<t.length;i++){var a=n[i];r[a.name.value]=t[i]}return r},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addGrammarElement("namedArgumentList",(function(e,t,r){if(!r.matchOpToken("("))return;var n=e.requireElement("nakedNamedArgumentList",r);r.requireOpToken(")");return n}));t.addGrammarElement("symbol",(function(e,t,r){var n="default";if(r.matchToken("global")){n="global"}else if(r.matchToken("element")||r.matchToken("module")){n="element";if(r.matchOpToken("'")){r.requireToken("s")}}else if(r.matchToken("local")){n="local"}let i=r.matchOpToken(":");let a=r.matchTokenType("IDENTIFIER");if(a&&a.value){var o=a.value;if(i){o=":"+o}if(n==="default"){if(o.indexOf("$")===0){n="global"}if(o.indexOf(":")===0){n="element"}}return{type:"symbol",token:a,scope:n,name:o,evaluate:function(e){return t.resolveSymbol(o,e,n)}}}}));t.addGrammarElement("implicitMeTarget",(function(e,t,r){return{type:"implicitMeTarget",evaluate:function(e){return e.you||e.me}}}));t.addLeafExpression("boolean",(function(e,t,r){var n=r.matchToken("true")||r.matchToken("false");if(!n)return;const i=n.value==="true";return{type:"boolean",evaluate:function(e){return i}}}));t.addLeafExpression("null",(function(e,t,r){if(r.matchToken("null")){return{type:"null",evaluate:function(e){return null}}}}));t.addLeafExpression("arrayLiteral",(function(e,t,r){if(!r.matchOpToken("["))return;var n=[];if(!r.matchOpToken("]")){do{var i=e.requireElement("expression",r);n.push(i)}while(r.matchOpToken(","));r.requireOpToken("]")}return{type:"arrayLiteral",values:n,args:[n],op:function(e,t){return t},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addLeafExpression("blockLiteral",(function(e,t,r){if(!r.matchOpToken("\\"))return;var n=[];var i=r.matchTokenType("IDENTIFIER");if(i){n.push(i);while(r.matchOpToken(",")){n.push(r.requireTokenType("IDENTIFIER"))}}r.requireOpToken("-");r.requireOpToken(">");var a=e.requireElement("expression",r);return{type:"blockLiteral",args:n,expr:a,evaluate:function(e){var t=function(){for(var t=0;t<n.length;t++){e.locals[n[t].value]=arguments[t]}return a.evaluate(e)};return t}}}));t.addIndirectExpression("propertyAccess",(function(e,t,r,n){if(!r.matchOpToken("."))return;var i=r.requireTokenType("IDENTIFIER");var a={type:"propertyAccess",root:n,prop:i,args:[n],op:function(e,r){var n=t.resolveProperty(r,i.value);return n},evaluate:function(e){return t.unifiedEval(this,e)}};return e.parseElement("indirectExpression",r,a)}));t.addIndirectExpression("of",(function(e,t,r,n){if(!r.matchToken("of"))return;var i=e.requireElement("unaryExpression",r);var a=null;var o=n;while(o.root){a=o;o=o.root}if(o.type!=="symbol"&&o.type!=="attributeRef"&&o.type!=="styleRef"&&o.type!=="computedStyleRef"){e.raiseParseError(r,"Cannot take a property of a non-symbol: "+o.type)}var s=o.type==="attributeRef";var u=o.type==="styleRef"||o.type==="computedStyleRef";if(s||u){var l=o}var c=o.name;var f={type:"ofExpression",prop:o.token,root:i,attribute:l,expression:n,args:[i],op:function(e,r){if(s){return t.resolveAttribute(r,c)}else if(u){if(o.type==="computedStyleRef"){return t.resolveComputedStyle(r,c)}else{return t.resolveStyle(r,c)}}else{return t.resolveProperty(r,c)}},evaluate:function(e){return t.unifiedEval(this,e)}};if(o.type==="attributeRef"){f.attribute=o}if(a){a.root=f;a.args=[f]}else{n=f}return e.parseElement("indirectExpression",r,n)}));t.addIndirectExpression("possessive",(function(e,t,r,n){if(e.possessivesDisabled){return}var i=r.matchOpToken("'");if(i||n.type==="symbol"&&(n.name==="my"||n.name==="its"||n.name==="your")&&(r.currentToken().type==="IDENTIFIER"||r.currentToken().type==="ATTRIBUTE_REF"||r.currentToken().type==="STYLE_REF")){if(i){r.requireToken("s")}var a,o,s;a=e.parseElement("attributeRef",r);if(a==null){o=e.parseElement("styleRef",r);if(o==null){s=r.requireTokenType("IDENTIFIER")}}var u={type:"possessive",root:n,attribute:a||o,prop:s,args:[n],op:function(e,r){if(a){var n=t.resolveAttribute(r,a.name)}else if(o){var n;if(o.type==="computedStyleRef"){n=t.resolveComputedStyle(r,o["name"])}else{n=t.resolveStyle(r,o["name"])}}else{var n=t.resolveProperty(r,s.value)}return n},evaluate:function(e){return t.unifiedEval(this,e)}};return e.parseElement("indirectExpression",r,u)}}));t.addIndirectExpression("inExpression",(function(e,t,r,n){if(!r.matchToken("in"))return;var i=e.requireElement("unaryExpression",r);var a={type:"inExpression",root:n,args:[n,i],op:function(e,r,n){var i=[];if(r.css){t.implicitLoop(n,(function(e){var t=e.querySelectorAll(r.css);for(var n=0;n<t.length;n++){i.push(t[n])}}))}else if(r instanceof Element){var a=false;t.implicitLoop(n,(function(e){if(e.contains(r)){a=true}}));if(a){return r}}else{t.implicitLoop(r,(function(e){t.implicitLoop(n,(function(t){if(e===t){i.push(e)}}))}))}return i},evaluate:function(e){return t.unifiedEval(this,e)}};return e.parseElement("indirectExpression",r,a)}));t.addIndirectExpression("asExpression",(function(e,t,r,n){if(!r.matchToken("as"))return;r.matchToken("a")||r.matchToken("an");var i=e.requireElement("dotOrColonPath",r).evaluate();var a={type:"asExpression",root:n,args:[n],op:function(e,r){return t.convertValue(r,i)},evaluate:function(e){return t.unifiedEval(this,e)}};return e.parseElement("indirectExpression",r,a)}));t.addIndirectExpression("functionCall",(function(e,t,r,n){if(!r.matchOpToken("("))return;var i=[];if(!r.matchOpToken(")")){do{i.push(e.requireElement("expression",r))}while(r.matchOpToken(","));r.requireOpToken(")")}if(n.root){var a={type:"functionCall",root:n,argExressions:i,args:[n.root,i],op:function(e,r,i){t.nullCheck(r,n.root);var a=r[n.prop.value];t.nullCheck(a,n);if(a.hyperfunc){i.push(e)}return a.apply(r,i)},evaluate:function(e){return t.unifiedEval(this,e)}}}else{var a={type:"functionCall",root:n,argExressions:i,args:[n,i],op:function(e,r,i){t.nullCheck(r,n);if(r.hyperfunc){i.push(e)}var a=r.apply(null,i);return a},evaluate:function(e){return t.unifiedEval(this,e)}}}return e.parseElement("indirectExpression",r,a)}));t.addIndirectExpression("attributeRefAccess",(function(e,t,r,n){var i=e.parseElement("attributeRef",r);if(!i)return;var a={type:"attributeRefAccess",root:n,attribute:i,args:[n],op:function(e,r){var n=t.resolveAttribute(r,i.name);return n},evaluate:function(e){return t.unifiedEval(this,e)}};return a}));t.addIndirectExpression("arrayIndex",(function(e,t,r,n){if(!r.matchOpToken("["))return;var i=false;var a=false;var o=null;var s=null;if(r.matchOpToken("..")){i=true;o=e.requireElement("expression",r)}else{o=e.requireElement("expression",r);if(r.matchOpToken("..")){a=true;var u=r.currentToken();if(u.type!=="R_BRACKET"){s=e.parseElement("expression",r)}}}r.requireOpToken("]");var l={type:"arrayIndex",root:n,prop:o,firstIndex:o,secondIndex:s,args:[n,o,s],op:function(e,t,r,n){if(t==null){return null}if(i){if(r<0){r=t.length+r}return t.slice(0,r+1)}else if(a){if(n!=null){if(n<0){n=t.length+n}return t.slice(r,n+1)}else{return t.slice(r)}}else{return t[r]}},evaluate:function(e){return t.unifiedEval(this,e)}};return e.parseElement("indirectExpression",r,l)}));var a=["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","pc","pt","px"];t.addGrammarElement("postfixExpression",(function(e,t,r){var n=e.parseElement("negativeNumber",r);let i=r.matchAnyToken.apply(r,a)||r.matchOpToken("%");if(i){return{type:"stringPostfix",postfix:i.value,args:[n],op:function(e,t){return""+t+i.value},evaluate:function(e){return t.unifiedEval(this,e)}}}var o=null;if(r.matchToken("s")||r.matchToken("seconds")){o=1e3}else if(r.matchToken("ms")||r.matchToken("milliseconds")){o=1}if(o){return{type:"timeExpression",time:n,factor:o,args:[n],op:function(e,t){return t*o},evaluate:function(e){return t.unifiedEval(this,e)}}}if(r.matchOpToken(":")){var s=r.requireTokenType("IDENTIFIER");if(!s.value)return;var u=!r.matchOpToken("!");return{type:"typeCheck",typeName:s,nullOk:u,args:[n],op:function(e,r){var n=t.typeCheck(r,this.typeName.value,u);if(n){return r}else{throw new Error("Typecheck failed! Expected: "+s.value)}},evaluate:function(e){return t.unifiedEval(this,e)}}}else{return n}}));t.addGrammarElement("logicalNot",(function(e,t,r){if(!r.matchToken("not"))return;var n=e.requireElement("unaryExpression",r);return{type:"logicalNot",root:n,args:[n],op:function(e,t){return!t},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addGrammarElement("noExpression",(function(e,t,r){if(!r.matchToken("no"))return;var n=e.requireElement("unaryExpression",r);return{type:"noExpression",root:n,args:[n],op:function(e,r){return t.isEmpty(r)},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addLeafExpression("some",(function(e,t,r){if(!r.matchToken("some"))return;var n=e.requireElement("expression",r);return{type:"noExpression",root:n,args:[n],op:function(e,r){return!t.isEmpty(r)},evaluate(e){return t.unifiedEval(this,e)}}}));t.addGrammarElement("negativeNumber",(function(e,t,r){if(r.matchOpToken("-")){var n=e.requireElement("negativeNumber",r);return{type:"negativeNumber",root:n,args:[n],op:function(e,t){return-1*t},evaluate:function(e){return t.unifiedEval(this,e)}}}else{return e.requireElement("primaryExpression",r)}}));t.addGrammarElement("unaryExpression",(function(e,t,r){r.matchToken("the");return e.parseAnyOf(["beepExpression","logicalNot","relativePositionalExpression","positionalExpression","noExpression","postfixExpression"],r)}));t.addGrammarElement("beepExpression",(function(e,t,r){if(!r.matchToken("beep!"))return;var n=e.parseElement("unaryExpression",r);if(n){n["booped"]=true;var i=n.evaluate;n.evaluate=function(e){let r=i.apply(n,arguments);let a=e.me;t.beepValueToConsole(a,n,r);return r};return n}}));var s=function(e,t,r,n){var i=t.querySelectorAll(r);for(var a=0;a<i.length;a++){var o=i[a];if(o.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING){return o}}if(n){return i[0]}};var u=function(e,t,r,n){var i=t.querySelectorAll(r);for(var a=i.length-1;a>=0;a--){var o=i[a];if(o.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING){return o}}if(n){return i[i.length-1]}};var l=function(e,t,r,n){var i=[];o.prototype.forEach(t,(function(t){if(t.matches(r)||t===e){i.push(t)}}));for(var a=0;a<i.length-1;a++){var s=i[a];if(s===e){return i[a+1]}}if(n){var u=i[0];if(u&&u.matches(r)){return u}}};var c=function(e,t,r,n){return l(e,Array.from(t).reverse(),r,n)};t.addGrammarElement("relativePositionalExpression",(function(e,t,r){var n=r.matchAnyToken("next","previous");if(!n)return;var a=n.value==="next";var o=e.parseElement("expression",r);if(r.matchToken("from")){r.pushFollow("in");try{var f=e.requireElement("unaryExpression",r)}finally{r.popFollow()}}else{var f=e.requireElement("implicitMeTarget",r)}var m=false;var p;if(r.matchToken("in")){m=true;var h=e.requireElement("unaryExpression",r)}else if(r.matchToken("within")){p=e.requireElement("unaryExpression",r)}else{p=document.body}var v=false;if(r.matchToken("with")){r.requireToken("wrapping");v=true}return{type:"relativePositionalExpression",from:f,forwardSearch:a,inSearch:m,wrapping:v,inElt:h,withinElt:p,operator:n.value,args:[o,f,h,p],op:function(e,t,r,n,f){var p=t.css;if(p==null){throw"Expected a CSS value to be returned by "+i.sourceFor.apply(o)}if(m){if(n){if(a){return l(r,n,p,v)}else{return c(r,n,p,v)}}}else{if(f){if(a){return s(r,f,p,v)}else{return u(r,f,p,v)}}}},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addGrammarElement("positionalExpression",(function(e,t,r){var n=r.matchAnyToken("first","last","random");if(!n)return;r.matchAnyToken("in","from","of");var i=e.requireElement("unaryExpression",r);const a=n.value;return{type:"positionalExpression",rhs:i,operator:n.value,args:[i],op:function(e,t){if(t&&!Array.isArray(t)){if(t.children){t=t.children}else{t=Array.from(t)}}if(t){if(a==="first"){return t[0]}else if(a==="last"){return t[t.length-1]}else if(a==="random"){return t[Math.floor(Math.random()*t.length)]}}},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addGrammarElement("mathOperator",(function(e,t,r){var n=e.parseElement("unaryExpression",r);var i,a=null;i=r.matchAnyOpToken("+","-","*","/")||r.matchToken("mod");while(i){a=a||i;var o=i.value;if(a.value!==o){e.raiseParseError(r,"You must parenthesize math operations with different operators")}var s=e.parseElement("unaryExpression",r);n={type:"mathOperator",lhs:n,rhs:s,operator:o,args:[n,s],op:function(e,t,r){if(o==="+"){return t+r}else if(o==="-"){return t-r}else if(o==="*"){return t*r}else if(o==="/"){return t/r}else if(o==="mod"){return t%r}},evaluate:function(e){return t.unifiedEval(this,e)}};i=r.matchAnyOpToken("+","-","*","/")||r.matchToken("mod")}return n}));t.addGrammarElement("mathExpression",(function(e,t,r){return e.parseAnyOf(["mathOperator","unaryExpression"],r)}));function f(e,t,r){if(t["contains"]){return t.contains(r)}else if(t["includes"]){return t.includes(r)}else{throw Error("The value of "+e.sourceFor()+" does not have a contains or includes method on it")}}function p(e,t,r){if(t["match"]){return!!t.match(r)}else if(t["matches"]){return t.matches(r)}else{throw Error("The value of "+e.sourceFor()+" does not have a match or matches method on it")}}t.addGrammarElement("comparisonOperator",(function(e,t,r){var n=e.parseElement("mathExpression",r);var i=r.matchAnyOpToken("<",">","<=",">=","==","===","!=","!==");var a=i?i.value:null;var o=true;var s=false;if(a==null){if(r.matchToken("is")||r.matchToken("am")){if(r.matchToken("not")){if(r.matchToken("in")){a="not in"}else if(r.matchToken("a")||r.matchToken("an")){a="not a";s=true}else if(r.matchToken("empty")){a="not empty";o=false}else{if(r.matchToken("really")){a="!=="}else{a="!="}if(r.matchToken("equal")){r.matchToken("to")}}}else if(r.matchToken("in")){a="in"}else if(r.matchToken("a")||r.matchToken("an")){a="a";s=true}else if(r.matchToken("empty")){a="empty";o=false}else if(r.matchToken("less")){r.requireToken("than");if(r.matchToken("or")){r.requireToken("equal");r.requireToken("to");a="<="}else{a="<"}}else if(r.matchToken("greater")){r.requireToken("than");if(r.matchToken("or")){r.requireToken("equal");r.requireToken("to");a=">="}else{a=">"}}else{if(r.matchToken("really")){a="==="}else{a="=="}if(r.matchToken("equal")){r.matchToken("to")}}}else if(r.matchToken("equals")){a="=="}else if(r.matchToken("really")){r.requireToken("equals");a="==="}else if(r.matchToken("exist")||r.matchToken("exists")){a="exist";o=false}else if(r.matchToken("matches")||r.matchToken("match")){a="match"}else if(r.matchToken("contains")||r.matchToken("contain")){a="contain"}else if(r.matchToken("includes")||r.matchToken("include")){a="include"}else if(r.matchToken("do")||r.matchToken("does")){r.requireToken("not");if(r.matchToken("matches")||r.matchToken("match")){a="not match"}else if(r.matchToken("contains")||r.matchToken("contain")){a="not contain"}else if(r.matchToken("exist")||r.matchToken("exist")){a="not exist";o=false}else if(r.matchToken("include")){a="not include"}else{e.raiseParseError(r,"Expected matches or contains")}}}if(a){var u,l,c;if(s){u=r.requireTokenType("IDENTIFIER");l=!r.matchOpToken("!")}else if(o){c=e.requireElement("mathExpression",r);if(a==="match"||a==="not match"){c=c.css?c.css:c}}var m=n;n={type:"comparisonOperator",operator:a,typeName:u,nullOk:l,lhs:n,rhs:c,args:[n,c],op:function(e,r,n){if(a==="=="){return r==n}else if(a==="!="){return r!=n}if(a==="==="){return r===n}else if(a==="!=="){return r!==n}if(a==="match"){return r!=null&&p(m,r,n)}if(a==="not match"){return r==null||!p(m,r,n)}if(a==="in"){return n!=null&&f(c,n,r)}if(a==="not in"){return n==null||!f(c,n,r)}if(a==="contain"){return r!=null&&f(m,r,n)}if(a==="not contain"){return r==null||!f(m,r,n)}if(a==="include"){return r!=null&&f(m,r,n)}if(a==="not include"){return r==null||!f(m,r,n)}if(a==="==="){return r===n}else if(a==="!=="){return r!==n}else if(a==="<"){return r<n}else if(a===">"){return r>n}else if(a==="<="){return r<=n}else if(a===">="){return r>=n}else if(a==="empty"){return t.isEmpty(r)}else if(a==="not empty"){return!t.isEmpty(r)}else if(a==="exist"){return t.doesExist(r)}else if(a==="not exist"){return!t.doesExist(r)}else if(a==="a"){return t.typeCheck(r,u.value,l)}else if(a==="not a"){return!t.typeCheck(r,u.value,l)}else{throw"Unknown comparison : "+a}},evaluate:function(e){return t.unifiedEval(this,e)}}}return n}));t.addGrammarElement("comparisonExpression",(function(e,t,r){return e.parseAnyOf(["comparisonOperator","mathExpression"],r)}));t.addGrammarElement("logicalOperator",(function(e,t,r){var n=e.parseElement("comparisonExpression",r);var i,a=null;i=r.matchToken("and")||r.matchToken("or");while(i){a=a||i;if(a.value!==i.value){e.raiseParseError(r,"You must parenthesize logical operations with different operators")}var o=e.requireElement("comparisonExpression",r);const s=i.value;n={type:"logicalOperator",operator:s,lhs:n,rhs:o,args:[n,o],op:function(e,t,r){if(s==="and"){return t&&r}else{return t||r}},evaluate:function(e){return t.unifiedEval(this,e,s==="or")}};i=r.matchToken("and")||r.matchToken("or")}return n}));t.addGrammarElement("logicalExpression",(function(e,t,r){return e.parseAnyOf(["logicalOperator","mathExpression"],r)}));t.addGrammarElement("asyncExpression",(function(e,t,r){if(r.matchToken("async")){var n=e.requireElement("logicalExpression",r);var i={type:"asyncExpression",value:n,evaluate:function(e){return{asyncWrapper:true,value:this.value.evaluate(e)}}};return i}else{return e.parseElement("logicalExpression",r)}}));t.addGrammarElement("expression",(function(e,t,r){r.matchToken("the");return e.parseElement("asyncExpression",r)}));t.addGrammarElement("assignableExpression",(function(e,t,r){r.matchToken("the");var n=e.parseElement("primaryExpression",r);if(n&&(n.type==="symbol"||n.type==="ofExpression"||n.type==="propertyAccess"||n.type==="attributeRefAccess"||n.type==="attributeRef"||n.type==="styleRef"||n.type==="arrayIndex"||n.type==="possessive")){return n}else{e.raiseParseError(r,"A target expression must be writable. The expression type '"+(n&&n.type)+"' is not.")}return n}));t.addGrammarElement("hyperscript",(function(e,t,r){var n=[];if(r.hasMore()){while(e.featureStart(r.currentToken())||r.currentToken().value==="("){var i=e.requireElement("feature",r);n.push(i);r.matchToken("end")}}return{type:"hyperscript",features:n,apply:function(e,t,r){for(const i of n){i.install(e,t,r)}}}}));var v=function(e){var t=[];if(e.token(0).value==="("&&(e.token(1).value===")"||e.token(2).value===","||e.token(2).value===")")){e.matchOpToken("(");do{t.push(e.requireTokenType("IDENTIFIER"))}while(e.matchOpToken(","));e.requireOpToken(")")}return t};t.addFeature("on",(function(e,t,r){if(!r.matchToken("on"))return;var n=false;if(r.matchToken("every")){n=true}var i=[];var a=null;do{var o=e.requireElement("eventName",r,"Expected event name");var s=o.evaluate();if(a){a=a+" or "+s}else{a="on "+s}var u=v(r);var l=null;if(r.matchOpToken("[")){l=e.requireElement("expression",r);r.requireOpToken("]")}var c,f,m;if(r.currentToken().type==="NUMBER"){var p=r.consumeToken();if(!p.value)return;c=parseInt(p.value);if(r.matchToken("to")){var h=r.consumeToken();if(!h.value)return;f=parseInt(h.value)}else if(r.matchToken("and")){m=true;r.requireToken("on")}}var d,E;if(s==="intersection"){d={};if(r.matchToken("with")){d["with"]=e.requireElement("expression",r).evaluate()}if(r.matchToken("having")){do{if(r.matchToken("margin")){d["rootMargin"]=e.requireElement("stringLike",r).evaluate()}else if(r.matchToken("threshold")){d["threshold"]=e.requireElement("expression",r).evaluate()}else{e.raiseParseError(r,"Unknown intersection config specification")}}while(r.matchToken("and"))}}else if(s==="mutation"){E={};if(r.matchToken("of")){do{if(r.matchToken("anything")){E["attributes"]=true;E["subtree"]=true;E["characterData"]=true;E["childList"]=true}else if(r.matchToken("childList")){E["childList"]=true}else if(r.matchToken("attributes")){E["attributes"]=true;E["attributeOldValue"]=true}else if(r.matchToken("subtree")){E["subtree"]=true}else if(r.matchToken("characterData")){E["characterData"]=true;E["characterDataOldValue"]=true}else if(r.currentToken().type==="ATTRIBUTE_REF"){var T=r.consumeToken();if(E["attributeFilter"]==null){E["attributeFilter"]=[]}if(T.value.indexOf("@")==0){E["attributeFilter"].push(T.value.substring(1))}else{e.raiseParseError(r,"Only shorthand attribute references are allowed here")}}else{e.raiseParseError(r,"Unknown mutation config specification")}}while(r.matchToken("or"))}else{E["attributes"]=true;E["characterData"]=true;E["childList"]=true}}var y=null;var k=false;if(r.matchToken("from")){if(r.matchToken("elsewhere")){k=true}else{r.pushFollow("or");try{y=e.requireElement("expression",r)}finally{r.popFollow()}if(!y){e.raiseParseError(r,'Expected either target value or "elsewhere".')}}}if(y===null&&k===false&&r.matchToken("elsewhere")){k=true}if(r.matchToken("in")){var x=e.parseElement("unaryExpression",r)}if(r.matchToken("debounced")){r.requireToken("at");var g=e.requireElement("unaryExpression",r);var b=g.evaluate({})}else if(r.matchToken("throttled")){r.requireToken("at");var g=e.requireElement("unaryExpression",r);var w=g.evaluate({})}i.push({execCount:0,every:n,on:s,args:u,filter:l,from:y,inExpr:x,elsewhere:k,startCount:c,endCount:f,unbounded:m,debounceTime:b,throttleTime:w,mutationSpec:E,intersectionSpec:d,debounced:undefined,lastExec:undefined})}while(r.matchToken("or"));var S=true;if(!n){if(r.matchToken("queue")){if(r.matchToken("all")){var N=true;var S=false}else if(r.matchToken("first")){var q=true}else if(r.matchToken("none")){var I=true}else{r.requireToken("last")}}}var C=e.requireElement("commandList",r);e.ensureTerminated(C);var R,A;if(r.matchToken("catch")){R=r.requireTokenType("IDENTIFIER").value;A=e.requireElement("commandList",r);e.ensureTerminated(A)}if(r.matchToken("finally")){var L=e.requireElement("commandList",r);e.ensureTerminated(L)}var O={displayName:a,events:i,start:C,every:n,execCount:0,errorHandler:A,errorSymbol:R,execute:function(e){let r=t.getEventQueueFor(e.me,O);if(r.executing&&n===false){if(I||q&&r.queue.length>0){return}if(S){r.queue.length=0}r.queue.push(e);return}O.execCount++;r.executing=true;e.meta.onHalt=function(){r.executing=false;var e=r.queue.shift();if(e){setTimeout((function(){O.execute(e)}),1)}};e.meta.reject=function(r){console.error(r.message?r.message:r);var n=t.getHyperTrace(e,r);if(n){n.print()}t.triggerEvent(e.me,"exception",{error:r})};C.execute(e)},install:function(e,r){for(const r of O.events){var n;if(r.elsewhere){n=[document]}else if(r.from){n=r.from.evaluate(t.makeContext(e,O,e,null))}else{n=[e]}t.implicitLoop(n,(function(n){var i=r.on;if(n==null){console.warn("'%s' feature ignored because target does not exists:",a,e);return}if(r.mutationSpec){i="hyperscript:mutation";const e=new MutationObserver((function(e,r){if(!O.executing){t.triggerEvent(n,i,{mutationList:e,observer:r})}}));e.observe(n,r.mutationSpec)}if(r.intersectionSpec){i="hyperscript:intersection";const e=new IntersectionObserver((function(r){for(const o of r){var a={observer:e};a=Object.assign(a,o);a["intersecting"]=o.isIntersecting;t.triggerEvent(n,i,a)}}),r.intersectionSpec);e.observe(n)}var o=n.addEventListener||n.on;o.call(n,i,(function a(o){if(typeof Node!=="undefined"&&e instanceof Node&&n!==e&&!e.isConnected){n.removeEventListener(i,a);return}var s=t.makeContext(e,O,e,o);if(r.elsewhere&&e.contains(o.target)){return}if(r.from){s.result=n}for(const e of r.args){let t=s.event[e.value];if(t!==undefined){s.locals[e.value]=t}else if("detail"in s.event){s.locals[e.value]=s.event["detail"][e.value]}}s.meta.errorHandler=A;s.meta.errorSymbol=R;s.meta.finallyHandler=L;if(r.filter){var u=s.meta.context;s.meta.context=s.event;try{var l=r.filter.evaluate(s);if(l){}else{return}}finally{s.meta.context=u}}if(r.inExpr){var c=o.target;while(true){if(c.matches&&c.matches(r.inExpr.css)){s.result=c;break}else{c=c.parentElement;if(c==null){return}}}}r.execCount++;if(r.startCount){if(r.endCount){if(r.execCount<r.startCount||r.execCount>r.endCount){return}}else if(r.unbounded){if(r.execCount<r.startCount){return}}else if(r.execCount!==r.startCount){return}}if(r.debounceTime){if(r.debounced){clearTimeout(r.debounced)}r.debounced=setTimeout((function(){O.execute(s)}),r.debounceTime);return}if(r.throttleTime){if(r.lastExec&&Date.now()<r.lastExec+r.throttleTime){return}else{r.lastExec=Date.now()}}O.execute(s)}))}))}}};e.setParent(C,O);return O}));t.addFeature("def",(function(e,t,r){if(!r.matchToken("def"))return;var n=e.requireElement("dotOrColonPath",r);var i=n.evaluate();var a=i.split(".");var o=a.pop();var s=[];if(r.matchOpToken("(")){if(r.matchOpToken(")")){}else{do{s.push(r.requireTokenType("IDENTIFIER"))}while(r.matchOpToken(","));r.requireOpToken(")")}}var u=e.requireElement("commandList",r);var l,c;if(r.matchToken("catch")){l=r.requireTokenType("IDENTIFIER").value;c=e.parseElement("commandList",r)}if(r.matchToken("finally")){var f=e.requireElement("commandList",r);e.ensureTerminated(f)}var m={displayName:o+"("+s.map((function(e){return e.value})).join(", ")+")",name:o,args:s,start:u,errorHandler:c,errorSymbol:l,finallyHandler:f,install:function(e,r){var n=function(){var n=t.makeContext(r,m,e,null);n.meta.errorHandler=c;n.meta.errorSymbol=l;n.meta.finallyHandler=f;for(var i=0;i<s.length;i++){var a=s[i];var o=arguments[i];if(a){n.locals[a.value]=o}}n.meta.caller=arguments[s.length];if(n.meta.caller){n.meta.callingCommand=n.meta.caller.meta.command}var p,h=null;var v=new Promise((function(e,t){p=e;h=t}));u.execute(n);if(n.meta.returned){return n.meta.returnValue}else{n.meta.resolve=p;n.meta.reject=h;return v}};n.hyperfunc=true;n.hypername=i;t.assignToNamespace(e,a,o,n)}};e.ensureTerminated(u);if(c){e.ensureTerminated(c)}e.setParent(u,m);return m}));t.addFeature("set",(function(e,t,r){let n=e.parseElement("setCommand",r);if(n){if(n.target.scope!=="element"){e.raiseParseError(r,"variables declared at the feature level must be element scoped.")}let i={start:n,install:function(e,r){n&&n.execute(t.makeContext(e,i,e,null))}};e.ensureTerminated(n);return i}}));t.addFeature("init",(function(e,t,r){if(!r.matchToken("init"))return;var n=r.matchToken("immediately");var i=e.requireElement("commandList",r);var a={start:i,install:function(e,r){let o=function(){i&&i.execute(t.makeContext(e,a,e,null))};if(n){o()}else{setTimeout(o,0)}}};e.ensureTerminated(i);e.setParent(i,a);return a}));t.addFeature("worker",(function(e,t,r){if(r.matchToken("worker")){e.raiseParseError(r,"In order to use the 'worker' feature, include "+"the _hyperscript worker plugin. See "+"https://hyperscript.org/features/worker/ for "+"more info.");return undefined}}));t.addFeature("behavior",(function(t,r,n){if(!n.matchToken("behavior"))return;var i=t.requireElement("dotOrColonPath",n).evaluate();var a=i.split(".");var o=a.pop();var s=[];if(n.matchOpToken("(")&&!n.matchOpToken(")")){do{s.push(n.requireTokenType("IDENTIFIER").value)}while(n.matchOpToken(","));n.requireOpToken(")")}var u=t.requireElement("hyperscript",n);for(var l=0;l<u.features.length;l++){var c=u.features[l];c.behavior=i}return{install:function(t,n){r.assignToNamespace(e.document&&e.document.body,a,o,(function(e,t,n){var a=r.getInternalData(e);var o=h(a,i+"Scope");for(var l=0;l<s.length;l++){o[s[l]]=n[s[l]]}u.apply(e,t)}))}}}));t.addFeature("install",(function(t,r,n){if(!n.matchToken("install"))return;var i=t.requireElement("dotOrColonPath",n).evaluate();var a=i.split(".");var o=t.parseElement("namedArgumentList",n);var s;return s={install:function(t,n){r.unifiedEval({args:[o],op:function(r,o){var s=e;for(var u=0;u<a.length;u++){s=s[a[u]];if(typeof s!=="object"&&typeof s!=="function")throw new Error("No such behavior defined as "+i)}if(!(s instanceof Function))throw new Error(i+" is not a behavior");s(t,n,o)}},r.makeContext(t,s,t,null))}}}));t.addGrammarElement("jsBody",(function(e,t,r){var n=r.currentToken().start;var i=r.currentToken();var a=[];var o="";var s=false;while(r.hasMore()){i=r.consumeToken();var u=r.token(0,true);if(u.type==="IDENTIFIER"&&u.value==="end"){break}if(s){if(i.type==="IDENTIFIER"||i.type==="NUMBER"){o+=i.value}else{if(o!=="")a.push(o);o="";s=false}}else if(i.type==="IDENTIFIER"&&i.value==="function"){s=true}}var l=i.end+1;return{type:"jsBody",exposedFunctionNames:a,jsSource:r.source.substring(n,l)}}));t.addFeature("js",(function(t,r,n){if(!n.matchToken("js"))return;var i=t.requireElement("jsBody",n);var a=i.jsSource+"\nreturn { "+i.exposedFunctionNames.map((function(e){return e+":"+e})).join(",")+" } ";var o=new Function(a);return{jsSource:a,function:o,exposedFunctionNames:i.exposedFunctionNames,install:function(){Object.assign(e,o())}}}));t.addCommand("js",(function(t,r,n){if(!n.matchToken("js"))return;var i=[];if(n.matchOpToken("(")){if(n.matchOpToken(")")){}else{do{var a=n.requireTokenType("IDENTIFIER");i.push(a.value)}while(n.matchOpToken(","));n.requireOpToken(")")}}var o=t.requireElement("jsBody",n);n.matchToken("end");var s=E(Function,i.concat([o.jsSource]));var u={jsSource:o.jsSource,function:s,inputs:i,op:function(t){var n=[];i.forEach((function(e){n.push(r.resolveSymbol(e,t,"default"))}));var a=s.apply(e,n);if(a&&typeof a.then==="function"){return new Promise((function(e){a.then((function(n){t.result=n;e(r.findNext(this,t))}))}))}else{t.result=a;return r.findNext(this,t)}}};return u}));t.addCommand("async",(function(e,t,r){if(!r.matchToken("async"))return;if(r.matchToken("do")){var n=e.requireElement("commandList",r);var i=n;while(i.next)i=i.next;i.next=t.HALT;r.requireToken("end")}else{var n=e.requireElement("command",r)}var a={body:n,op:function(e){setTimeout((function(){n.execute(e)}));return t.findNext(this,e)}};e.setParent(n,a);return a}));t.addCommand("tell",(function(e,t,r){var n=r.currentToken();if(!r.matchToken("tell"))return;var i=e.requireElement("expression",r);var a=e.requireElement("commandList",r);if(r.hasMore()&&!e.featureStart(r.currentToken())){r.requireToken("end")}var o="tell_"+n.start;var s={value:i,body:a,args:[i],resolveNext:function(e){var r=e.meta.iterators[o];if(r.index<r.value.length){e.you=r.value[r.index++];return a}else{e.you=r.originalYou;if(this.next){return this.next}else{return t.findNext(this.parent,e)}}},op:function(e,t){if(t==null){t=[]}else if(!(Array.isArray(t)||t instanceof NodeList)){t=[t]}e.meta.iterators[o]={originalYou:e.you,index:0,value:t};return this.resolveNext(e)}};e.setParent(a,s);return s}));t.addCommand("wait",(function(e,t,r){if(!r.matchToken("wait"))return;var n;if(r.matchToken("for")){r.matchToken("a");var i=[];do{var a=r.token(0);if(a.type==="NUMBER"||a.type==="L_PAREN"){i.push({time:e.requireElement("expression",r).evaluate()})}else{i.push({name:e.requireElement("dotOrColonPath",r,"Expected event name").evaluate(),args:v(r)})}}while(r.matchToken("or"));if(r.matchToken("from")){var o=e.requireElement("expression",r)}n={event:i,on:o,args:[o],op:function(e,r){var n=r?r:e.me;if(!(n instanceof EventTarget))throw new Error("Not a valid event target: "+this.on.sourceFor());return new Promise((r=>{var a=false;for(const s of i){var o=n=>{e.result=n;if(s.args){for(const t of s.args){e.locals[t.value]=n[t.value]||(n.detail?n.detail[t.value]:null)}}if(!a){a=true;r(t.findNext(this,e))}};if(s.name){n.addEventListener(s.name,o,{once:true})}else if(s.time!=null){setTimeout(o,s.time,s.time)}}}))}};return n}else{var s;if(r.matchToken("a")){r.requireToken("tick");s=0}else{s=e.requireElement("expression",r)}n={type:"waitCmd",time:s,args:[s],op:function(e,r){return new Promise((n=>{setTimeout((()=>{n(t.findNext(this,e))}),r)}))},execute:function(e){return t.unifiedExec(this,e)}};return n}}));t.addGrammarElement("dotOrColonPath",(function(e,t,r){var n=r.matchTokenType("IDENTIFIER");if(n){var i=[n.value];var a=r.matchOpToken(".")||r.matchOpToken(":");if(a){do{i.push(r.requireTokenType("IDENTIFIER","NUMBER").value)}while(r.matchOpToken(a.value))}return{type:"dotOrColonPath",path:i,evaluate:function(){return i.join(a?a.value:"")}}}}));t.addGrammarElement("eventName",(function(e,t,r){var n;if(n=r.matchTokenType("STRING")){return{evaluate:function(){return n.value}}}return e.parseElement("dotOrColonPath",r)}));function d(e,t,r,n){var i=t.requireElement("eventName",n);var a=t.parseElement("namedArgumentList",n);if(e==="send"&&n.matchToken("to")||e==="trigger"&&n.matchToken("on")){var o=t.requireElement("expression",n)}else{var o=t.requireElement("implicitMeTarget",n)}var s={eventName:i,details:a,to:o,args:[o,i,a],op:function(e,t,n,i){r.nullCheck(t,o);r.implicitLoop(t,(function(t){r.triggerEvent(t,n,i,e.me)}));return r.findNext(s,e)}};return s}t.addCommand("trigger",(function(e,t,r){if(r.matchToken("trigger")){return d("trigger",e,t,r)}}));t.addCommand("send",(function(e,t,r){if(r.matchToken("send")){return d("send",e,t,r)}}));var T=function(e,t,r,n){if(n){if(e.commandBoundary(r.currentToken())){e.raiseParseError(r,"'return' commands must return a value. If you do not wish to return a value, use 'exit' instead.")}else{var i=e.requireElement("expression",r)}}var a={value:i,args:[i],op:function(e,r){var n=e.meta.resolve;e.meta.returned=true;e.meta.returnValue=r;if(n){if(r){n(r)}else{n()}}return t.HALT}};return a};t.addCommand("return",(function(e,t,r){if(r.matchToken("return")){return T(e,t,r,true)}}));t.addCommand("exit",(function(e,t,r){if(r.matchToken("exit")){return T(e,t,r,false)}}));t.addCommand("halt",(function(e,t,r){if(r.matchToken("halt")){if(r.matchToken("the")){r.requireToken("event");if(r.matchOpToken("'")){r.requireToken("s")}var n=true}if(r.matchToken("bubbling")){var i=true}else if(r.matchToken("default")){var a=true}var o=T(e,t,r,false);var s={keepExecuting:true,bubbling:i,haltDefault:a,exit:o,op:function(e){if(e.event){if(i){e.event.stopPropagation()}else if(a){e.event.preventDefault()}else{e.event.stopPropagation();e.event.preventDefault()}if(n){return t.findNext(this,e)}else{return o}}}};return s}}));t.addCommand("log",(function(e,t,r){if(!r.matchToken("log"))return;var n=[e.parseElement("expression",r)];while(r.matchOpToken(",")){n.push(e.requireElement("expression",r))}if(r.matchToken("with")){var i=e.requireElement("expression",r)}var a={exprs:n,withExpr:i,args:[i,n],op:function(e,r,n){if(r){r.apply(null,n)}else{console.log.apply(null,n)}return t.findNext(this,e)}};return a}));t.addCommand("beep!",(function(e,t,r){if(!r.matchToken("beep!"))return;var n=[e.parseElement("expression",r)];while(r.matchOpToken(",")){n.push(e.requireElement("expression",r))}var i={exprs:n,args:[n],op:function(e,r){for(let i=0;i<n.length;i++){const a=n[i];const o=r[i];t.beepValueToConsole(e.me,a,o)}return t.findNext(this,e)}};return i}));t.addCommand("throw",(function(e,t,r){if(!r.matchToken("throw"))return;var n=e.requireElement("expression",r);var i={expr:n,args:[n],op:function(e,r){t.registerHyperTrace(e,r);throw r}};return i}));var y=function(e,t,r){var n=e.requireElement("expression",r);var i={expr:n,args:[n],op:function(e,r){e.result=r;return t.findNext(i,e)}};return i};t.addCommand("call",(function(e,t,r){if(!r.matchToken("call"))return;var n=y(e,t,r);if(n.expr&&n.expr.type!=="functionCall"){e.raiseParseError(r,"Must be a function invocation")}return n}));t.addCommand("get",(function(e,t,r){if(r.matchToken("get")){return y(e,t,r)}}));t.addCommand("make",(function(e,t,r){if(!r.matchToken("make"))return;r.matchToken("a")||r.matchToken("an");var n=e.requireElement("expression",r);var i=[];if(n.type!=="queryRef"&&r.matchToken("from")){do{i.push(e.requireElement("expression",r))}while(r.matchOpToken(","))}if(r.matchToken("called")){var a=e.requireElement("symbol",r)}var o;if(n.type==="queryRef"){o={op:function(e){var r,i="div",o,s=[];var u=/(?:(^|#|\.)([^#\. ]+))/g;while(r=u.exec(n.css)){if(r[1]==="")i=r[2].trim();else if(r[1]==="#")o=r[2].trim();else s.push(r[2].trim())}var l=document.createElement(i);if(o!==undefined)l.id=o;for(var c=0;c<s.length;c++){var f=s[c];l.classList.add(f)}e.result=l;if(a){t.setSymbol(a.name,e,a.scope,l)}return t.findNext(this,e)}};return o}else{o={args:[n,i],op:function(e,r,n){e.result=E(r,n);if(a){t.setSymbol(a.name,e,a.scope,e.result)}return t.findNext(this,e)}};return o}}));t.addGrammarElement("pseudoCommand",(function(e,t,r){let n=r.token(1);if(!(n&&n.op&&(n.value==="."||n.value==="("))){return null}var i=e.requireElement("primaryExpression",r);var a=i.root;var o=i;while(a.root!=null){o=o.root;a=a.root}if(i.type!=="functionCall"){e.raiseParseError(r,"Pseudo-commands must be function calls")}if(o.type==="functionCall"&&o.root.root==null){if(r.matchAnyToken("the","to","on","with","into","from","at")){var s=e.requireElement("expression",r)}else if(r.matchToken("me")){var s=e.requireElement("implicitMeTarget",r)}}var u;if(s){u={type:"pseudoCommand",root:s,argExressions:o.argExressions,args:[s,o.argExressions],op:function(e,r,n){t.nullCheck(r,s);var i=r[o.root.name];t.nullCheck(i,o);if(i.hyperfunc){n.push(e)}e.result=i.apply(r,n);return t.findNext(u,e)},execute:function(e){return t.unifiedExec(this,e)}}}else{u={type:"pseudoCommand",expr:i,args:[i],op:function(e,r){e.result=r;return t.findNext(u,e)},execute:function(e){return t.unifiedExec(this,e)}}}return u}));var k=function(e,t,r,n,i){var a=n.type==="symbol";var o=n.type==="attributeRef";var s=n.type==="styleRef";var u=n.type==="arrayIndex";if(!(o||s||a)&&n.root==null){e.raiseParseError(r,"Can only put directly into symbols, not references")}var l=null;var c=null;if(a){}else if(o||s){l=e.requireElement("implicitMeTarget",r);var f=n}else if(u){c=n.firstIndex;l=n.root}else{c=n.prop?n.prop.value:null;var f=n.attribute;l=n.root}var m={target:n,symbolWrite:a,value:i,args:[l,c,i],op:function(e,r,i,o){if(a){t.setSymbol(n.name,e,n.scope,o)}else{t.nullCheck(r,l);if(u){r[i]=o}else{t.implicitLoop(r,(function(e){if(f){if(f.type==="attributeRef"){if(o==null){e.removeAttribute(f.name)}else{e.setAttribute(f.name,o)}}else{e.style[f.name]=o}}else{e[i]=o}}))}}return t.findNext(this,e)}};return m};t.addCommand("default",(function(e,t,r){if(!r.matchToken("default"))return;var n=e.requireElement("assignableExpression",r);r.requireToken("to");var i=e.requireElement("expression",r);var a=k(e,t,r,n,i);var o={target:n,value:i,setter:a,args:[n],op:function(e,r){if(r){return t.findNext(this,e)}else{return a}}};a.parent=o;return o}));t.addCommand("set",(function(e,t,r){if(!r.matchToken("set"))return;if(r.currentToken().type==="L_BRACE"){var n=e.requireElement("objectLiteral",r);r.requireToken("on");var i=e.requireElement("expression",r);var a={objectLiteral:n,target:i,args:[n,i],op:function(e,r,n){Object.assign(n,r);return t.findNext(this,e)}};return a}try{r.pushFollow("to");var i=e.requireElement("assignableExpression",r)}finally{r.popFollow()}r.requireToken("to");var o=e.requireElement("expression",r);return k(e,t,r,i,o)}));t.addCommand("if",(function(e,t,r){if(!r.matchToken("if"))return;var n=e.requireElement("expression",r);r.matchToken("then");var i=e.parseElement("commandList",r);var a=false;let o=r.matchToken("else")||r.matchToken("otherwise");if(o){let t=r.peekToken("if");a=t!=null&&t.line===o.line;if(a){var s=e.parseElement("command",r)}else{var s=e.parseElement("commandList",r)}}if(r.hasMore()&&!a){r.requireToken("end")}var u={expr:n,trueBranch:i,falseBranch:s,args:[n],op:function(e,r){if(r){return i}else if(s){return s}else{return t.findNext(this,e)}}};e.setParent(i,u);e.setParent(s,u);return u}));var x=function(e,t,r,n){var i=t.currentToken();var a;if(t.matchToken("for")||n){var o=t.requireTokenType("IDENTIFIER");a=o.value;t.requireToken("in");var s=e.requireElement("expression",t)}else if(t.matchToken("in")){a="it";var s=e.requireElement("expression",t)}else if(t.matchToken("while")){var u=e.requireElement("expression",t)}else if(t.matchToken("until")){var l=true;if(t.matchToken("event")){var c=e.requireElement("dotOrColonPath",t,"Expected event name");if(t.matchToken("from")){var f=e.requireElement("expression",t)}}else{var u=e.requireElement("expression",t)}}else{if(!e.commandBoundary(t.currentToken())&&t.currentToken().value!=="forever"){var m=e.requireElement("expression",t);t.requireToken("times")}else{t.matchToken("forever");var p=true}}if(t.matchToken("index")){var o=t.requireTokenType("IDENTIFIER");var h=o.value}else if(t.matchToken("indexed")){t.requireToken("by");var o=t.requireTokenType("IDENTIFIER");var h=o.value}var v=e.parseElement("commandList",t);if(v&&c){var d=v;while(d.next){d=d.next}var E={type:"waitATick",op:function(){return new Promise((function(e){setTimeout((function(){e(r.findNext(E))}),0)}))}};d.next=E}if(t.hasMore()){t.requireToken("end")}if(a==null){a="_implicit_repeat_"+i.start;var T=a}else{var T=a+"_"+i.start}var y={identifier:a,indexIdentifier:h,slot:T,expression:s,forever:p,times:m,until:l,event:c,on:f,whileExpr:u,resolveNext:function(){return this},loop:v,args:[u,m],op:function(e,t,n){var i=e.meta.iterators[T];var o=false;var s=null;if(this.forever){o=true}else if(this.until){if(c){o=e.meta.iterators[T].eventFired===false}else{o=t!==true}}else if(u){o=t}else if(n){o=i.index<n}else{var l=i.iterator.next();o=!l.done;s=l.value}if(o){if(i.value){e.result=e.locals[a]=s}else{e.result=i.index}if(h){e.locals[h]=i.index}i.index++;return v}else{e.meta.iterators[T]=null;return r.findNext(this.parent,e)}}};e.setParent(v,y);var k={name:"repeatInit",args:[s,c,f],op:function(e,t,r,n){var i={index:0,value:t,eventFired:false};e.meta.iterators[T]=i;if(t&&t[Symbol.iterator]){i.iterator=t[Symbol.iterator]()}if(c){var a=n||e.me;a.addEventListener(r,(function(t){e.meta.iterators[T].eventFired=true}),{once:true})}return y},execute:function(e){return r.unifiedExec(this,e)}};e.setParent(y,k);return k};t.addCommand("repeat",(function(e,t,r){if(r.matchToken("repeat")){return x(e,r,t,false)}}));t.addCommand("for",(function(e,t,r){if(r.matchToken("for")){return x(e,r,t,true)}}));t.addCommand("continue",(function(e,t,r){if(!r.matchToken("continue"))return;var n={op:function(t){for(var n=this.parent;true;n=n.parent){if(n==undefined){e.raiseParseError(r,"Command `continue` cannot be used outside of a `repeat` loop.")}if(n.loop!=undefined){return n.resolveNext(t)}}}};return n}));t.addCommand("break",(function(e,t,r){if(!r.matchToken("break"))return;var n={op:function(n){for(var i=this.parent;true;i=i.parent){if(i==undefined){e.raiseParseError(r,"Command `continue` cannot be used outside of a `repeat` loop.")}if(i.loop!=undefined){return t.findNext(i.parent,n)}}}};return n}));t.addGrammarElement("stringLike",(function(e,t,r){return e.parseAnyOf(["string","nakedString"],r)}));t.addCommand("append",(function(e,t,r){if(!r.matchToken("append"))return;var n=null;var i=e.requireElement("expression",r);var a={type:"symbol",evaluate:function(e){return t.resolveSymbol("result",e)}};if(r.matchToken("to")){n=e.requireElement("expression",r)}else{n=a}var o=null;if(n.type==="symbol"||n.type==="attributeRef"||n.root!=null){o=k(e,t,r,n,a)}var s={value:i,target:n,args:[n,i],op:function(e,r,n){if(Array.isArray(r)){r.push(n);return t.findNext(this,e)}else if(r instanceof Element){if(n instanceof Element){r.insertAdjacentElement("beforeend",n)}else{r.insertAdjacentHTML("beforeend",n)}t.processNode(r);return t.findNext(this,e)}else if(o){e.result=(r||"")+n;return o}else{throw Error("Unable to append a value!")}},execute:function(e){return t.unifiedExec(this,e)}};if(o!=null){o.parent=s}return s}));function g(e,t,r){r.matchToken("at")||r.matchToken("from");const n={includeStart:true,includeEnd:false};n.from=r.matchToken("start")?0:e.requireElement("expression",r);if(r.matchToken("to")||r.matchOpToken("..")){if(r.matchToken("end")){n.toEnd=true}else{n.to=e.requireElement("expression",r)}}if(r.matchToken("inclusive"))n.includeEnd=true;else if(r.matchToken("exclusive"))n.includeStart=false;return n}class b{constructor(e,t){this.re=e;this.str=t}next(){const e=this.re.exec(this.str);if(e===null)return{done:true};else return{value:e}}}class w{constructor(e,t,r){this.re=e;this.flags=t;this.str=r}[Symbol.iterator](){return new b(new RegExp(this.re,this.flags),this.str)}}t.addCommand("pick",((e,t,r)=>{if(!r.matchToken("pick"))return;r.matchToken("the");if(r.matchToken("item")||r.matchToken("items")||r.matchToken("character")||r.matchToken("characters")){const n=g(e,t,r);r.requireToken("from");const i=e.requireElement("expression",r);return{args:[i,n.from,n.to],op(e,r,i,a){if(n.toEnd)a=r.length;if(!n.includeStart)i++;if(n.includeEnd)a++;if(a==null||a==undefined)a=i+1;e.result=r.slice(i,a);return t.findNext(this,e)}}}if(r.matchToken("match")){r.matchToken("of");const n=e.parseElement("expression",r);let i="";if(r.matchOpToken("|")){i=r.requireTokenType("IDENTIFIER").value}r.requireToken("from");const a=e.parseElement("expression",r);return{args:[a,n],op(e,r,n){e.result=new RegExp(n,i).exec(r);return t.findNext(this,e)}}}if(r.matchToken("matches")){r.matchToken("of");const n=e.parseElement("expression",r);let i="gu";if(r.matchOpToken("|")){i="g"+r.requireTokenType("IDENTIFIER").value.replace("g","")}r.requireToken("from");const a=e.parseElement("expression",r);return{args:[a,n],op(e,r,n){e.result=new w(n,i,r);return t.findNext(this,e)}}}}));t.addCommand("increment",(function(e,t,r){if(!r.matchToken("increment"))return;var n;var i=e.parseElement("assignableExpression",r);if(r.matchToken("by")){n=e.requireElement("expression",r)}var a={type:"implicitIncrementOp",target:i,args:[i,n],op:function(e,t,r){t=t?parseFloat(t):0;r=n?parseFloat(r):1;var i=t+r;e.result=i;return i},evaluate:function(e){return t.unifiedEval(this,e)}};return k(e,t,r,i,a)}));t.addCommand("decrement",(function(e,t,r){if(!r.matchToken("decrement"))return;var n;var i=e.parseElement("assignableExpression",r);if(r.matchToken("by")){n=e.requireElement("expression",r)}var a={type:"implicitDecrementOp",target:i,args:[i,n],op:function(e,t,r){t=t?parseFloat(t):0;r=n?parseFloat(r):1;var i=t-r;e.result=i;return i},evaluate:function(e){return t.unifiedEval(this,e)}};return k(e,t,r,i,a)}));function S(e,t){var r="text";var n;e.matchToken("a")||e.matchToken("an");if(e.matchToken("json")||e.matchToken("Object")){r="json"}else if(e.matchToken("response")){r="response"}else if(e.matchToken("html")){r="html"}else if(e.matchToken("text")){}else{n=t.requireElement("dotOrColonPath",e).evaluate()}return{type:r,conversion:n}}t.addCommand("fetch",(function(e,t,r){if(!r.matchToken("fetch"))return;var n=e.requireElement("stringLike",r);if(r.matchToken("as")){var i=S(r,e)}if(r.matchToken("with")&&r.currentToken().value!=="{"){var a=e.parseElement("nakedNamedArgumentList",r)}else{var a=e.parseElement("objectLiteral",r)}if(i==null&&r.matchToken("as")){i=S(r,e)}var o=i?i.type:"text";var s=i?i.conversion:null;var u={url:n,argExpressions:a,args:[n,a],op:function(e,r,n){var i=n||{};i["sender"]=e.me;i["headers"]=i["headers"]||{};var a=new AbortController;let l=e.me.addEventListener("fetch:abort",(function(){a.abort()}),{once:true});i["signal"]=a.signal;t.triggerEvent(e.me,"hyperscript:beforeFetch",i);t.triggerEvent(e.me,"fetch:beforeRequest",i);n=i;var c=false;if(n.timeout){setTimeout((function(){if(!c){a.abort()}}),n.timeout)}return fetch(r,n).then((function(r){let n={response:r};t.triggerEvent(e.me,"fetch:afterResponse",n);r=n.response;if(o==="response"){e.result=r;t.triggerEvent(e.me,"fetch:afterRequest",{result:r});c=true;return t.findNext(u,e)}if(o==="json"){return r.json().then((function(r){e.result=r;t.triggerEvent(e.me,"fetch:afterRequest",{result:r});c=true;return t.findNext(u,e)}))}return r.text().then((function(r){if(s)r=t.convertValue(r,s);if(o==="html")r=t.convertValue(r,"Fragment");e.result=r;t.triggerEvent(e.me,"fetch:afterRequest",{result:r});c=true;return t.findNext(u,e)}))})).catch((function(r){t.triggerEvent(e.me,"fetch:error",{reason:r});throw r})).finally((function(){e.me.removeEventListener("fetch:abort",l)}))}};return u}))}function y(e){e.addCommand("settle",(function(e,t,r){if(r.matchToken("settle")){if(!e.commandBoundary(r.currentToken())){var n=e.requireElement("expression",r)}else{var n=e.requireElement("implicitMeTarget",r)}var i={type:"settleCmd",args:[n],op:function(e,r){t.nullCheck(r,n);var a=null;var o=false;var s=false;var u=new Promise((function(e){a=e}));r.addEventListener("transitionstart",(function(){s=true}),{once:true});setTimeout((function(){if(!s&&!o){a(t.findNext(i,e))}}),500);r.addEventListener("transitionend",(function(){if(!o){a(t.findNext(i,e))}}),{once:true});return u},execute:function(e){return t.unifiedExec(this,e)}};return i}}));e.addCommand("add",(function(e,t,r){if(r.matchToken("add")){var n=e.parseElement("classRef",r);var i=null;var a=null;if(n==null){i=e.parseElement("attributeRef",r);if(i==null){a=e.parseElement("styleLiteral",r);if(a==null){e.raiseParseError(r,"Expected either a class reference or attribute expression")}}}else{var o=[n];while(n=e.parseElement("classRef",r)){o.push(n)}}if(r.matchToken("to")){var s=e.requireElement("expression",r)}else{var s=e.requireElement("implicitMeTarget",r)}if(r.matchToken("when")){if(a){e.raiseParseError(r,"Only class and properties are supported with a when clause")}var u=e.requireElement("expression",r)}if(o){return{classRefs:o,to:s,args:[s,o],op:function(e,r,n){t.nullCheck(r,s);t.forEach(n,(function(n){t.implicitLoop(r,(function(r){if(u){e.result=r;let i=t.evaluateNoPromise(u,e);if(i){if(r instanceof Element)r.classList.add(n.className)}else{if(r instanceof Element)r.classList.remove(n.className)}e.result=null}else{if(r instanceof Element)r.classList.add(n.className)}}))}));return t.findNext(this,e)}}}else if(i){return{type:"addCmd",attributeRef:i,to:s,args:[s],op:function(e,r,n){t.nullCheck(r,s);t.implicitLoop(r,(function(r){if(u){e.result=r;let n=t.evaluateNoPromise(u,e);if(n){r.setAttribute(i.name,i.value)}else{r.removeAttribute(i.name)}e.result=null}else{r.setAttribute(i.name,i.value)}}));return t.findNext(this,e)},execute:function(e){return t.unifiedExec(this,e)}}}else{return{type:"addCmd",cssDeclaration:a,to:s,args:[s,a],op:function(e,r,n){t.nullCheck(r,s);t.implicitLoop(r,(function(e){e.style.cssText+=n}));return t.findNext(this,e)},execute:function(e){return t.unifiedExec(this,e)}}}}}));e.addGrammarElement("styleLiteral",(function(e,t,r){if(!r.matchOpToken("{"))return;var n=[""];var i=[];while(r.hasMore()){if(r.matchOpToken("\\")){r.consumeToken()}else if(r.matchOpToken("}")){break}else if(r.matchToken("$")){var a=r.matchOpToken("{");var o=e.parseElement("expression",r);if(a)r.requireOpToken("}");i.push(o);n.push("")}else{var s=r.consumeToken();n[n.length-1]+=r.source.substring(s.start,s.end)}n[n.length-1]+=r.lastWhitespace()}return{type:"styleLiteral",args:[i],op:function(e,t){var r="";n.forEach((function(e,n){r+=e;if(n in t)r+=t[n]}));return r},evaluate:function(e){return t.unifiedEval(this,e)}}}));e.addCommand("remove",(function(e,t,r){if(r.matchToken("remove")){var n=e.parseElement("classRef",r);var i=null;var a=null;if(n==null){i=e.parseElement("attributeRef",r);if(i==null){a=e.parseElement("expression",r);if(a==null){e.raiseParseError(r,"Expected either a class reference, attribute expression or value expression")}}}else{var o=[n];while(n=e.parseElement("classRef",r)){o.push(n)}}if(r.matchToken("from")){var s=e.requireElement("expression",r)}else{if(a==null){var s=e.requireElement("implicitMeTarget",r)}}if(a){return{elementExpr:a,from:s,args:[a,s],op:function(e,r,n){t.nullCheck(r,a);t.implicitLoop(r,(function(e){if(e.parentElement&&(n==null||n.contains(e))){e.parentElement.removeChild(e)}}));return t.findNext(this,e)}}}else{return{classRefs:o,attributeRef:i,elementExpr:a,from:s,args:[o,s],op:function(e,r,n){t.nullCheck(n,s);if(r){t.forEach(r,(function(e){t.implicitLoop(n,(function(t){t.classList.remove(e.className)}))}))}else{t.implicitLoop(n,(function(e){e.removeAttribute(i.name)}))}return t.findNext(this,e)}}}}}));e.addCommand("toggle",(function(e,t,r){if(r.matchToken("toggle")){r.matchAnyToken("the","my");if(r.currentToken().type==="STYLE_REF"){let t=r.consumeToken();var n=t.value.substr(1);var a=true;var o=i(e,r,n);if(r.matchToken("of")){r.pushFollow("with");try{var s=e.requireElement("expression",r)}finally{r.popFollow()}}else{var s=e.requireElement("implicitMeTarget",r)}}else if(r.matchToken("between")){var u=true;var l=e.parseElement("classRef",r);r.requireToken("and");var c=e.requireElement("classRef",r)}else{var l=e.parseElement("classRef",r);var f=null;if(l==null){f=e.parseElement("attributeRef",r);if(f==null){e.raiseParseError(r,"Expected either a class reference or attribute expression")}}else{var m=[l];while(l=e.parseElement("classRef",r)){m.push(l)}}}if(a!==true){if(r.matchToken("on")){var s=e.requireElement("expression",r)}else{var s=e.requireElement("implicitMeTarget",r)}}if(r.matchToken("for")){var p=e.requireElement("expression",r)}else if(r.matchToken("until")){var h=e.requireElement("dotOrColonPath",r,"Expected event name");if(r.matchToken("from")){var v=e.requireElement("expression",r)}}var d={classRef:l,classRef2:c,classRefs:m,attributeRef:f,on:s,time:p,evt:h,from:v,toggle:function(e,r,n,i){t.nullCheck(e,s);if(a){t.implicitLoop(e,(function(e){o("toggle",e)}))}else if(u){t.implicitLoop(e,(function(e){if(e.classList.contains(r.className)){e.classList.remove(r.className);e.classList.add(n.className)}else{e.classList.add(r.className);e.classList.remove(n.className)}}))}else if(i){t.forEach(i,(function(r){t.implicitLoop(e,(function(e){e.classList.toggle(r.className)}))}))}else{t.implicitLoop(e,(function(e){if(e.hasAttribute(f.name)){e.removeAttribute(f.name)}else{e.setAttribute(f.name,f.value)}}))}},args:[s,p,h,v,l,c,m],op:function(e,r,n,i,a,o,s,u){if(n){return new Promise((function(i){d.toggle(r,o,s,u);setTimeout((function(){d.toggle(r,o,s,u);i(t.findNext(d,e))}),n)}))}else if(i){return new Promise((function(n){var l=a||e.me;l.addEventListener(i,(function(){d.toggle(r,o,s,u);n(t.findNext(d,e))}),{once:true});d.toggle(r,o,s,u)}))}else{this.toggle(r,o,s,u);return t.findNext(d,e)}}};return d}}));var t={display:function(r,n,i){if(i){n.style.display=i}else if(r==="toggle"){if(getComputedStyle(n).display==="none"){t.display("show",n,i)}else{t.display("hide",n,i)}}else if(r==="hide"){const t=e.runtime.getInternalData(n);if(t.originalDisplay==null){t.originalDisplay=n.style.display}n.style.display="none"}else{const t=e.runtime.getInternalData(n);if(t.originalDisplay&&t.originalDisplay!=="none"){n.style.display=t.originalDisplay}else{n.style.removeProperty("display")}}},visibility:function(e,r,n){if(n){r.style.visibility=n}else if(e==="toggle"){if(getComputedStyle(r).visibility==="hidden"){t.visibility("show",r,n)}else{t.visibility("hide",r,n)}}else if(e==="hide"){r.style.visibility="hidden"}else{r.style.visibility="visible"}},opacity:function(e,r,n){if(n){r.style.opacity=n}else if(e==="toggle"){if(getComputedStyle(r).opacity==="0"){t.opacity("show",r,n)}else{t.opacity("hide",r,n)}}else if(e==="hide"){r.style.opacity="0"}else{r.style.opacity="1"}}};var n=function(e,t,r){var n;var i=r.currentToken();if(i.value==="when"||i.value==="with"||e.commandBoundary(i)){n=e.parseElement("implicitMeTarget",r)}else{n=e.parseElement("expression",r)}return n};var i=function(e,n,i){var a=r.defaultHideShowStrategy;var o=t;if(r.hideShowStrategies){o=Object.assign(o,r.hideShowStrategies)}i=i||a||"display";var s=o[i];if(s==null){e.raiseParseError(n,"Unknown show/hide strategy : "+i)}return s};e.addCommand("hide",(function(e,t,r){if(r.matchToken("hide")){var a=n(e,t,r);var o=null;if(r.matchToken("with")){o=r.requireTokenType("IDENTIFIER","STYLE_REF").value;if(o.indexOf("*")===0){o=o.substr(1)}}var s=i(e,r,o);return{target:a,args:[a],op:function(e,r){t.nullCheck(r,a);t.implicitLoop(r,(function(e){s("hide",e)}));return t.findNext(this,e)}}}}));e.addCommand("show",(function(e,t,r){if(r.matchToken("show")){var a=n(e,t,r);var o=null;if(r.matchToken("with")){o=r.requireTokenType("IDENTIFIER","STYLE_REF").value;if(o.indexOf("*")===0){o=o.substr(1)}}var s=null;if(r.matchOpToken(":")){var u=r.consumeUntilWhitespace();r.matchTokenType("WHITESPACE");s=u.map((function(e){return e.value})).join("")}if(r.matchToken("when")){var l=e.requireElement("expression",r)}var c=i(e,r,o);return{target:a,when:l,args:[a],op:function(e,r){t.nullCheck(r,a);t.implicitLoop(r,(function(r){if(l){e.result=r;let n=t.evaluateNoPromise(l,e);if(n){c("show",r,s)}else{c("hide",r)}e.result=null}else{c("show",r,s)}}));return t.findNext(this,e)}}}}));e.addCommand("take",(function(e,t,r){if(r.matchToken("take")){let u=null;let l=[];while(u=e.parseElement("classRef",r)){l.push(u)}var n=null;var i=null;let c=l.length>0;if(!c){n=e.parseElement("attributeRef",r);if(n==null){e.raiseParseError(r,"Expected either a class reference or attribute expression")}if(r.matchToken("with")){i=e.requireElement("expression",r)}}if(r.matchToken("from")){var a=e.requireElement("expression",r)}if(r.matchToken("for")){var o=e.requireElement("expression",r)}else{var o=e.requireElement("implicitMeTarget",r)}if(c){var s={classRefs:l,from:a,forElt:o,args:[l,a,o],op:function(e,r,n,i){t.nullCheck(i,o);t.implicitLoop(r,(function(e){var r=e.className;if(n){t.implicitLoop(n,(function(e){e.classList.remove(r)}))}else{t.implicitLoop(e,(function(e){e.classList.remove(r)}))}t.implicitLoop(i,(function(e){e.classList.add(r)}))}));return t.findNext(this,e)}};return s}else{var s={attributeRef:n,from:a,forElt:o,args:[a,o,i],op:function(e,r,i,s){t.nullCheck(r,a);t.nullCheck(i,o);t.implicitLoop(r,(function(e){if(!s){e.removeAttribute(n.name)}else{e.setAttribute(n.name,s)}}));t.implicitLoop(i,(function(e){e.setAttribute(n.name,n.value||"")}));return t.findNext(this,e)}};return s}}}));function a(t,r,n,i){if(n!=null){var a=t.resolveSymbol(n,r)}else{var a=r}if(a instanceof Element||a instanceof HTMLDocument){while(a.firstChild)a.removeChild(a.firstChild);a.append(e.runtime.convertValue(i,"Fragment"));t.processNode(a)}else{if(n!=null){t.setSymbol(n,r,null,i)}else{throw"Don't know how to put a value into "+typeof r}}}e.addCommand("put",(function(e,t,r){if(r.matchToken("put")){var n=e.requireElement("expression",r);var i=r.matchAnyToken("into","before","after");if(i==null&&r.matchToken("at")){r.matchToken("the");i=r.matchAnyToken("start","end");r.requireToken("of")}if(i==null){e.raiseParseError(r,"Expected one of 'into', 'before', 'at start of', 'at end of', 'after'")}var o=e.requireElement("expression",r);var s=i.value;var u=false;var l=false;var c=null;var f=null;if(o.type==="arrayIndex"&&s==="into"){u=true;f=o.prop;c=o.root}else if(o.prop&&o.root&&s==="into"){f=o.prop.value;c=o.root}else if(o.type==="symbol"&&s==="into"){l=true;f=o.name}else if(o.type==="attributeRef"&&s==="into"){var m=true;f=o.name;c=e.requireElement("implicitMeTarget",r)}else if(o.type==="styleRef"&&s==="into"){var p=true;f=o.name;c=e.requireElement("implicitMeTarget",r)}else if(o.attribute&&s==="into"){var m=o.attribute.type==="attributeRef";var p=o.attribute.type==="styleRef";f=o.attribute.name;c=o.root}else{c=o}var h={target:o,operation:s,symbolWrite:l,value:n,args:[c,f,n],op:function(e,r,n,i){if(l){a(t,e,n,i)}else{t.nullCheck(r,c);if(s==="into"){if(m){t.implicitLoop(r,(function(e){e.setAttribute(n,i)}))}else if(p){t.implicitLoop(r,(function(e){e.style[n]=i}))}else if(u){r[n]=i}else{t.implicitLoop(r,(function(e){a(t,e,n,i)}))}}else{var o=s==="before"?Element.prototype.before:s==="after"?Element.prototype.after:s==="start"?Element.prototype.prepend:s==="end"?Element.prototype.append:Element.prototype.append;t.implicitLoop(r,(function(e){o.call(e,i instanceof Node?i:t.convertValue(i,"Fragment"));if(e.parentElement){t.processNode(e.parentElement)}else{t.processNode(e)}}))}}return t.findNext(this,e)}};return h}}));function o(e,t,r){var n;if(r.matchToken("the")||r.matchToken("element")||r.matchToken("elements")||r.currentToken().type==="CLASS_REF"||r.currentToken().type==="ID_REF"||r.currentToken().op&&r.currentToken().value==="<"){e.possessivesDisabled=true;try{n=e.parseElement("expression",r)}finally{delete e.possessivesDisabled}if(r.matchOpToken("'")){r.requireToken("s")}}else if(r.currentToken().type==="IDENTIFIER"&&r.currentToken().value==="its"){var i=r.matchToken("its");n={type:"pseudopossessiveIts",token:i,name:i.value,evaluate:function(e){return t.resolveSymbol("it",e)}}}else{r.matchToken("my")||r.matchToken("me");n=e.parseElement("implicitMeTarget",r)}return n}e.addCommand("transition",(function(e,t,n){if(n.matchToken("transition")){var i=o(e,t,n);var a=[];var s=[];var u=[];var l=n.currentToken();while(!e.commandBoundary(l)&&l.value!=="over"&&l.value!=="using"){if(n.currentToken().type==="STYLE_REF"){let e=n.consumeToken();let t=e.value.substr(1);a.push({type:"styleRefValue",evaluate:function(){return t}})}else{a.push(e.requireElement("stringLike",n))}if(n.matchToken("from")){s.push(e.requireElement("expression",n))}else{s.push(null)}n.requireToken("to");if(n.matchToken("initial")){u.push({type:"initial_literal",evaluate:function(){return"initial"}})}else{u.push(e.requireElement("expression",n))}l=n.currentToken()}if(n.matchToken("over")){var c=e.requireElement("expression",n)}else if(n.matchToken("using")){var f=e.requireElement("expression",n)}var m={to:u,args:[i,a,s,u,f,c],op:function(e,n,a,o,s,u,l){t.nullCheck(n,i);var c=[];t.implicitLoop(n,(function(e){var n=new Promise((function(n,i){var c=e.style.transition;if(l){e.style.transition="all "+l+"ms ease-in"}else if(u){e.style.transition=u}else{e.style.transition=r.defaultTransition}var f=t.getInternalData(e);var m=getComputedStyle(e);var p={};for(var h=0;h<m.length;h++){var v=m[h];var d=m[v];p[v]=d}if(!f.initialStyles){f.initialStyles=p}for(var h=0;h<a.length;h++){var E=a[h];var T=o[h];if(T==="computed"||T==null){e.style[E]=p[E]}else{e.style[E]=T}}var y=false;var k=false;e.addEventListener("transitionend",(function(){if(!k){e.style.transition=c;k=true;n()}}),{once:true});e.addEventListener("transitionstart",(function(){y=true}),{once:true});setTimeout((function(){if(!k&&!y){e.style.transition=c;k=true;n()}}),100);setTimeout((function(){var t=[];for(var r=0;r<a.length;r++){var n=a[r];var i=s[r];if(i==="initial"){var o=f.initialStyles[n];e.style[n]=o}else{e.style[n]=i}}}),0)}));c.push(n)}));return Promise.all(c).then((function(){return t.findNext(m,e)}))}};return m}}));e.addCommand("measure",(function(e,t,r){if(!r.matchToken("measure"))return;var n=o(e,t,r);var i=[];if(!e.commandBoundary(r.currentToken()))do{i.push(r.matchTokenType("IDENTIFIER").value)}while(r.matchOpToken(","));return{properties:i,args:[n],op:function(e,r){t.nullCheck(r,n);if(0 in r)r=r[0];var a=r.getBoundingClientRect();var o={top:r.scrollTop,left:r.scrollLeft,topMax:r.scrollTopMax,leftMax:r.scrollLeftMax,height:r.scrollHeight,width:r.scrollWidth};e.result={x:a.x,y:a.y,left:a.left,top:a.top,right:a.right,bottom:a.bottom,width:a.width,height:a.height,bounds:a,scrollLeft:o.left,scrollTop:o.top,scrollLeftMax:o.leftMax,scrollTopMax:o.topMax,scrollWidth:o.width,scrollHeight:o.height,scroll:o};t.forEach(i,(function(t){if(t in e.result)e.locals[t]=e.result[t];else throw"No such measurement as "+t}));return t.findNext(this,e)}}}));e.addLeafExpression("closestExpr",(function(e,t,r){if(r.matchToken("closest")){if(r.matchToken("parent")){var n=true}var i=null;if(r.currentToken().type==="ATTRIBUTE_REF"){var a=e.requireElement("attributeRefAccess",r,null);i="["+a.attribute.name+"]"}if(i==null){var o=e.requireElement("expression",r);if(o.css==null){e.raiseParseError(r,"Expected a CSS expression")}else{i=o.css}}if(r.matchToken("to")){var s=e.parseElement("expression",r)}else{var s=e.parseElement("implicitMeTarget",r)}var u={type:"closestExpr",parentSearch:n,expr:o,css:i,to:s,args:[s],op:function(e,r){if(r==null){return null}else{let e=[];t.implicitLoop(r,(function(t){if(n){e.push(t.parentElement?t.parentElement.closest(i):null)}else{e.push(t.closest(i))}}));if(t.shouldAutoIterate(r)){return e}else{return e[0]}}},evaluate:function(e){return t.unifiedEval(this,e)}};if(a){a.root=u;a.args=[u];return a}else{return u}}}));e.addCommand("go",(function(e,t,r){if(r.matchToken("go")){if(r.matchToken("back")){var n=true}else{r.matchToken("to");if(r.matchToken("url")){var i=e.requireElement("stringLike",r);var a=true;if(r.matchToken("in")){r.requireToken("new");r.requireToken("window");var o=true}}else{r.matchToken("the");var s=r.matchAnyToken("top","middle","bottom");var u=r.matchAnyToken("left","center","right");if(s||u){r.requireToken("of")}var i=e.requireElement("unaryExpression",r);var l=r.matchAnyOpToken("+","-");if(l){r.pushFollow("px");try{var c=e.requireElement("expression",r)}finally{r.popFollow()}}r.matchToken("px");var f=r.matchAnyToken("smoothly","instantly");var m={block:"start",inline:"nearest"};if(s){if(s.value==="top"){m.block="start"}else if(s.value==="bottom"){m.block="end"}else if(s.value==="middle"){m.block="center"}}if(u){if(u.value==="left"){m.inline="start"}else if(u.value==="center"){m.inline="center"}else if(u.value==="right"){m.inline="end"}}if(f){if(f.value==="smoothly"){m.behavior="smooth"}else if(f.value==="instantly"){m.behavior="instant"}}}}var p={target:i,args:[i,c],op:function(e,r,i){if(n){window.history.back()}else if(a){if(r){if(o){window.open(r)}else{window.location.href=r}}}else{t.implicitLoop(r,(function(e){if(e===window){e=document.body}if(l){let t=e.getBoundingClientRect();let r=document.createElement("div");let n=l.value==="+"?i:i*-1;let a=m.inline=="start"||m.inline=="end"?n:0;let o=m.block=="start"||m.block=="end"?n:0;r.style.position="absolute";r.style.top=t.top+window.scrollY+o+"px";r.style.left=t.left+window.scrollX+a+"px";r.style.height=t.height+"px";r.style.width=t.width+"px";r.style.zIndex=""+Number.MIN_SAFE_INTEGER;r.style.opacity="0";document.body.appendChild(r);setTimeout((function(){document.body.removeChild(r)}),100);e=r}e.scrollIntoView(m)}))}return t.findNext(p,e)}};return p}}));r.conversions.dynamicResolvers.push((function(t,r){if(!(t==="Values"||t.indexOf("Values:")===0)){return}var n=t.split(":")[1];var i={};var a=e.runtime.implicitLoop.bind(e.runtime);a(r,(function(e){var t=s(e);if(t!==undefined){i[t.name]=t.value;return}if(e.querySelectorAll!=undefined){var r=e.querySelectorAll("input,select,textarea");r.forEach(o)}}));if(n){if(n==="JSON"){return JSON.stringify(i)}else if(n==="Form"){return new URLSearchParams(i).toString()}else{throw"Unknown conversion: "+n}}else{return i}function o(e){var t=s(e);if(t==undefined){return}if(i[t.name]==undefined){i[t.name]=t.value;return}if(Array.isArray(i[t.name])&&Array.isArray(t.value)){i[t.name]=[].concat(i[t.name],t.value);return}}function s(e){try{var t={name:e.name,value:e.value};if(t.name==undefined||t.value==undefined){return undefined}if(e.type=="radio"&&e.checked==false){return undefined}if(e.type=="checkbox"){if(e.checked==false){t.value=undefined}else if(typeof t.value==="string"){t.value=[t.value]}}if(e.type=="select-multiple"){var r=e.querySelectorAll("option[selected]");t.value=[];for(var n=0;n<r.length;n++){t.value.push(r[n].value)}}return t}catch(e){return undefined}}}));r.conversions["HTML"]=function(e){var t=function(e){if(e instanceof Array){return e.map((function(e){return t(e)})).join("")}if(e instanceof HTMLElement){return e.outerHTML}if(e instanceof NodeList){var r="";for(var n=0;n<e.length;n++){var i=e[n];if(i instanceof HTMLElement){r+=i.outerHTML}}return r}if(e.toString){return e.toString()}return""};return t(e)};r.conversions["Fragment"]=function(t){var r=document.createDocumentFragment();e.runtime.implicitLoop(t,(function(e){if(e instanceof Node)r.append(e);else{var t=document.createElement("template");t.innerHTML=e;r.append(t.content)}}));return r}}const k=new o,x=k.lexer,g=k.parser;function b(e,t){return k.evaluate(e,t)}function w(){var t=Array.from(e.document.querySelectorAll("script[type='text/hyperscript'][src]"));Promise.all(t.map((function(e){return fetch(e.src).then((function(e){return e.text()}))}))).then((e=>e.forEach((e=>S(e))))).then((()=>n((function(){a();k.processNode(document.documentElement);document.dispatchEvent(new Event("hyperscript:ready"));e.document.addEventListener("htmx:load",(function(e){k.processNode(e.detail.elt)}))}))));function n(e){if(document.readyState!=="loading"){setTimeout(e)}else{document.addEventListener("DOMContentLoaded",e)}}function i(){var e=document.querySelector('meta[name="htmx-config"]');if(e){return v(e.content)}else{return null}}function a(){var e=i();if(e){Object.assign(r,e)}}}const S=Object.assign(b,{config:r,use(e){e(S)},internals:{lexer:x,parser:g,runtime:k,Lexer:n,Tokens:i,Parser:a,Runtime:o},ElementCollection:m,addFeature:g.addFeature.bind(g),addCommand:g.addCommand.bind(g),addLeafExpression:g.addLeafExpression.bind(g),addIndirectExpression:g.addIndirectExpression.bind(g),evaluate:k.evaluate.bind(k),parse:k.parse.bind(k),processNode:k.processNode.bind(k),version:"0.9.14",browserInit:w});return S}));
-2
static/js/npm/js.cookie.min.js
··· 1 - /*! js-cookie v3.0.5 | MIT */ 2 - !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var t=function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(o[u]=n.read(c,u),e===u)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});return t}));
-118
static/js/script.123514.js
··· 1 - "use strict"; 2 - 3 - async function new_user() { 4 - const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; 5 - 6 - const response = await fetch(`${location}user/new`, { 7 - method: "POST", 8 - headers: { 9 - "Content-Type": "application/json", 10 - }, 11 - body: JSON.stringify({ timezone: tz }), 12 - }); 13 - } 14 - 15 - function check_invalidate() { 16 - if (Cookies.get("invalidate") === "true") { 17 - new_user().then(() => { 18 - Cookies.remove("invalidate"); 19 - htmx.trigger("body", "login", {}); 20 - }); 21 - } 22 - } 23 - 24 - check_invalidate(); 25 - 26 - 27 - // Credit: https://css-tricks.com/auto-growing-inputs-textareas/#comment-1787000 28 - // Please use theirs, not mine. I have modified it for my own purposes. 29 - const autoWidthTemplate = document.createElement('template'); 30 - autoWidthTemplate.innerHTML = ` 31 - <style> 32 - :host { 33 - display: inline-block; 34 - vertical-align: top; 35 - align-items: center; 36 - position: relative; 37 - } 38 - :host::after { 39 - width: auto; 40 - min-width: 1em; 41 - content: attr(data-value) ' '; 42 - visibility: hidden; 43 - white-space: pre-wrap; 44 - font: inherit; 45 - pointer-events: none; 46 - overflow-wrap: anywhere; 47 - touch-action: none; /* these two rules are just in case*/ 48 - z-index: -99; /* prevents inputs */ 49 - } 50 - input { 51 - font: inherit; 52 - width: 100%; 53 - min-width: 6ch; 54 - position: absolute; 55 - border: 0; 56 - padding: 0; /* for iOS */ 57 - background: none; 58 - } 59 - </style> 60 - <input size='1'></input> 61 - `; 62 - class AutoWidthInput extends HTMLElement { 63 - static get formAssociated() { 64 - return true; 65 - } 66 - 67 - constructor() { 68 - super(); 69 - this.internals = this.attachInternals(); 70 - 71 - this._shadowRoot = this.attachShadow({ mode: 'open' }); 72 - this._shadowRoot.appendChild(autoWidthTemplate.content.cloneNode(true)); 73 - this._input = this._shadowRoot.querySelector('input'); 74 - 75 - this.value_ = this._input.value; 76 - 77 - } 78 - _manageValidity() { 79 - const value = this._input.value; 80 - const required = this._input.hasAttribute("required"); 81 - 82 - if (value === '' && required) { 83 - this.internals.setValidity({ 84 - valueMissing: true 85 - }, 'This field is required', this._input); 86 - } else { 87 - this.internals.setValidity({}); 88 - } 89 - } 90 - 91 - connectedCallback() { 92 - this.value = this._input.value; 93 - 94 - this._input.addEventListener('input', (e) => { 95 - this.value = this._input.value; 96 - }); 97 - } 98 - 99 - formResetCallback() { 100 - this.value = ""; 101 - } 102 - get value() { 103 - return this._input.value; 104 - } 105 - set value(v) { 106 - this._input.value = v; 107 - this.dataset.value = v; 108 - this.internals.setFormValue(v); 109 - this._manageValidity(); 110 - } 111 - static get observedAttributes() { 112 - return ['placeholder', 'name', 'required']; 113 - } 114 - attributeChangedCallback(name, oldVal, newVal) { 115 - this._input.setAttribute(name, newVal); 116 - } 117 - } 118 - window.customElements.define('autowidth-input', AutoWidthInput);
+3
templates/component-import.html
··· 1 + <template element="task-item"> 2 + {% include "components/task-item.html" %} 3 + </template>
+138
templates/components/task-item.html
··· 1 + <div class="list-item"> 2 + <li> 3 + <slot class="message" name="message">You're holding it wrong.</slot> &nbsp; 4 + 5 + <details name="edit"> 6 + <summary>edit</summary> 7 + 8 + <button class="button-delete"> 9 + del 10 + </button> 11 + <button class="button-pushback today"> 12 + tmrw 13 + </button> 14 + </details> 15 + </li> 16 + </div> 17 + 18 + <style> 19 + .list-item[checked] ::slotted(span), 20 + task-item[checked] ::slotted(span) { 21 + text-decoration: line-through; 22 + color: light-dark(gray, lightgray); 23 + } 24 + 25 + .list-item[day="tomorrow"] .today, 26 + task-item[day="tomorrow"] .today { 27 + display: none; 28 + } 29 + 30 + 31 + 32 + /* Background Definition */ 33 + .list-item { 34 + --rule-color: light-dark(#abced4, #c86363); 35 + --line-height: 21px; 36 + 37 + /* https://projects.verou.me/css3patterns/#lined-paper */ 38 + background-color: light-dark(white, #141414); 39 + background-image: 40 + linear-gradient(90deg, 41 + transparent var(--rule-start), 42 + var(--rule-color) var(--rule-start), 43 + var(--rule-color) calc(var(--rule-start) + 2px), 44 + transparent calc(var(--rule-start) + 2px)), 45 + linear-gradient(light-dark(#eee, #333) 2px, transparent 2px); 46 + background-size: 100% var(--line-height); 47 + background-position: 0px 17px; 48 + 49 + } 50 + 51 + .list-item { 52 + font-family: var(--font); 53 + position: relative; 54 + display: block; 55 + 56 + &:after { 57 + content: '◦'; 58 + position: absolute; 59 + left: 18px; 60 + top: -3px; 61 + } 62 + 63 + li { 64 + position: relative; 65 + list-style-type: none; 66 + 67 + padding-inline-start: calc(var(--text-start) + var(--rule-start)); 68 + word-break: normal; 69 + overflow-wrap: anywhere; 70 + 71 + button, 72 + details { 73 + color: light-dark(gray, lightgray); 74 + font-size: 10pt; 75 + font-weight: lighter; 76 + font-family: var(--font); 77 + } 78 + 79 + button, 80 + input, 81 + form:not(.addtodo) { 82 + margin: 0; 83 + padding: 0; 84 + border: 0; 85 + background: 0; 86 + } 87 + 88 + details { 89 + 90 + /* Current bug on stable firefox, fixed on nightly. */ 91 + /* Revert in 2027 or something */ 92 + /* REPRODUCE: ff macOS 140.0.2 (aarch64) */ 93 + /* <3 */ 94 + @supports (-moz-appearance:none) { 95 + & { 96 + display: ruby !important; 97 + } 98 + } 99 + 100 + display: inline-flex; 101 + flex-direction: row; 102 + gap: 0.5rem; 103 + } 104 + 105 + summary { 106 + cursor: pointer; 107 + display: inline; 108 + } 109 + 110 + details[open] summary:after { 111 + content: ":"; 112 + } 113 + } 114 + } 115 + 116 + .is-loading::after { 117 + content: "◌"; 118 + animation: spinner 4s linear infinite; 119 + 120 + } 121 + 122 + @keyframes fade-in { 123 + from { 124 + opacity: 0; 125 + } 126 + 127 + to { 128 + opacity: 1; 129 + } 130 + } 131 + 132 + @keyframes spinner { 133 + 134 + 100% { 135 + transform: rotate(360deg); 136 + } 137 + } 138 + </style>
+20 -3
templates/index.html
··· 5 5 <header> 6 6 <details> 7 7 <summary>Authentication</summary> 8 - <div hx-get="/htmx/user_slug" hx-trigger="login from:body, load" hx-swap="innerHTML"></div> 8 + <script type="module"> 9 + const span = document.querySelector("#authentication_span"); 10 + 11 + const req = await fetch("/user/info", { method: "POST" }); 12 + 13 + if (req.ok) { 14 + const user = await req.json(); 15 + 16 + const body = `You are logged in. Your user ID is ${user.id}. 17 + <br> You are in timezone ${user.timezone}. 18 + <br><br> Your login code is <samp><input value=\"${user.pass}\" readonly></samp>. 19 + <br> Use this to log in on other devices. If you want to ensure your tasks are saved, write this code down.`; 20 + span.innerHTML = body; 21 + } else { 22 + const body = `You are not logged in`; 23 + span.innerHTML = body; 24 + } 25 + </script> 26 + <span id="authentication_span"></span> 9 27 <br /> 10 - <form hx-post="/user/login" hx-swap="none"> 28 + <form method="POST" action="/user/login" id="user-login"> 11 29 <label>Login with code: <br /><input name="pass" /></label> 12 30 <br /><button>Ok</button> 13 31 </form> ··· 43 61 <p>Acknowledgements:</p> 44 62 <ul> 45 63 <li>Axum for a lovely Rust web server.</li> 46 - <li>HTMX for dead easy single-page-app prototyping.</li> 47 64 <li> 48 65 This lovely paper background. 49 66 <a href="https://projects.verou.me/css3patterns/#lined-paper">Thanks!</a>
+29 -40
templates/list.html
··· 1 - <script type="text/hyperscript"> 2 - def today(i) 3 - tell #main 4 - set @day to "today" 5 - 6 - tell #input-when 7 - set @value to "today" 8 - end 9 - 10 - def tomorrow(i) 11 - tell #main 12 - set @day to "tomorrow" 13 - 14 - tell #input-when 15 - set @value to "tomorrow" 16 - end 17 - </script> 18 - 19 1 <style> 20 2 article[day="today"] { 21 3 .tomorrow { ··· 31 13 </style> 32 14 <article day="today" id="main"> 33 15 34 - <div class="card-head"> 16 + <div class="card-head ruled"> 35 17 <div role="tablist" class="headercontainer"> 36 - <button active role="tab" class="header-today" _=" 37 - on click today() 38 - add @active 39 - tell next <button/> 40 - remove @active">Today</button> 41 - <button role="tab" class="header-tomorrow" _=" 42 - on click tomorrow() 43 - add @active 44 - tell previous <button/> 45 - remove @active"> 18 + <button active role="tab" class="header-today">Today</button> 19 + <button role="tab" class="header-tomorrow"> 46 20 Tomorrow 47 21 </button> 48 22 </div> 49 23 </div> 50 24 51 - <div class="card"> 52 - <form class="addtodo" hx-post="/task/new" hx-swap="none" 53 - hx-on::after-request="if(event.detail.successful) this.reset()"> 25 + <div class="card ruled"> 26 + <form class="addtodo"> 54 27 <input id="input-when" name="when" type="hidden" value="today" /> 55 28 <label for="addtodoinput">I will...</label> 56 29 ··· 61 34 62 35 </div> 63 36 64 - <div class="card-body today"> 65 - <ul hx-get="/task/list?when=today" 66 - hx-trigger="taskCreated from:body, taskDeleted from:body,taskUpdated from:body, login from:body, load" 67 - hx-swap="innerHTML"></ul> 37 + <div class="card-body today ruled"> 38 + <ul> 39 + {% for task in today %} 40 + {% set message = task.text %} 41 + <task-item task_id="{{ task.id }}" day="today" {% if task.checked %}checked{% endif %}> 42 + <template shadowrootmode="closed"> 43 + {% include "components/task-item.html"%} 44 + </template> 45 + <span slot="message">{{ task.text }}</span> 46 + </task-item> 47 + {% endfor %} 48 + </ul> 68 49 </div> 69 50 70 51 71 - <div class="card-body tomorrow"> 72 - <ul hx-get="/task/list?when=tomorrow" 73 - hx-trigger="taskCreated from:body, taskDeleted from:body, taskUpdated from:body, login from:body, load" 74 - hx-swap="innerHTML"></ul> 52 + <div class="card-body tomorrow ruled"> 53 + <ul> 54 + {% for task in tomorrow %} 55 + {% set message = task.text %} 56 + <task-item task_id="{{ task.id }}" day="tomorrow" {% if task.checked %}checked{% endif %}> 57 + <template shadowrootmode="closed"> 58 + {% include "components/task-item.html"%} 59 + </template> 60 + <span slot="message">{{ task.text }}</span> 61 + </task-item> 62 + {% endfor %} 63 + </ul> 75 64 </div> 76 65 </article>
+16 -14
templates/wrap.html
··· 6 6 <meta charset="UTF-8" /> 7 7 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 8 8 9 - <!-- Selfhosted JS --> 10 - <script src="/static/js/npm/htmx.min.js"></script> <!-- https://www.npmjs.com/package/htmx.org --> 11 - <script src="/static/js/npm/hyperscript.min.js"></script> <!-- hyperscript --> 12 - <script src="/static/js/npm/js.cookie.min.js"></script> <!-- https://www.npmjs.com/package/js-cookie --> 13 - <!-- I hate the current Cookie API, and the new one is secure-context only --> 9 + <!-- Cosmetics --> 10 + <link rel="icon" href="/static/img/favicon.ico" sizes="any" /> <!-- 32×32 --> 11 + <link rel="apple-touch-icon" href="/static/img/apple-touch-icon.png" /> <!-- 180×180 --> 12 + <link rel="manifest" href="/static/meta/manifest.webmanifest"> <!-- PWA metadata --> 14 13 15 14 <!-- local styles --> 16 - <link rel="stylesheet" href="/static/css/out.css" /> 17 15 <link rel="stylesheet" href="/static/css/basic.css" /> 18 16 19 - <script src="/static/js/script.123514.js"></script> 17 + <!-- Preloads --> 18 + <link rel="modulepreload" href="/static/js/main.js" /> 19 + <link rel="modulepreload" href="/static/js/modules/add-todo.js" /> 20 + <link rel="modulepreload" href="/static/js/modules/component-element.js" /> 21 + <link rel="modulepreload" href="/static/js/modules/components.js" /> 22 + <link rel="modulepreload" href="/static/js/modules/header-nav.js" /> 23 + <link rel="modulepreload" href="/static/js/modules/user.js" /> 24 + <link rel="modulepreload" href="/static/js/custom-elements/task-item.js" /> 20 25 21 - <!-- 32×32 --> 22 - <link rel="icon" href="/static/img/favicon.ico" sizes="any" /> 23 - <!-- 180×180 --> 24 - <link rel="apple-touch-icon" href="/static/img/apple-touch-icon.png" /> 26 + <script type="module" src="/static/js/main.js"> 27 + </script> 25 28 26 - <!-- PWA metadata --> 27 - <link rel="manifest" href="/static/meta/manifest.webmanifest"> 28 29 29 - <meta name="htmx-config" content='{"requestClass": "is-loading"}' /> 30 30 {% block head_extra %}{% endblock %} 31 31 32 32 <title>{% block title %}TMRW{% endblock %}</title> ··· 34 34 </head> 35 35 36 36 <body> 37 + {% include "component-import.html" %} 38 + 37 39 <div class="wrapper"> 38 40 {% block content %}🌵🏜️{% endblock %} {% block footer %} 39 41 {% endblock %}