From 4c0db299ca1de77f00543975f71fd6b193498e97 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 14 Feb 2024 19:45:06 +0000 Subject: [PATCH] chore: update versions --- .changeset/flat-pugs-applaud.md | 2 - .changeset/odd-beans-appear.md | 10 - .changeset/popular-steaks-switch.md | 10 - .changeset/young-bulldogs-brake.md | 10 - ...667d6ca6de790b857f2b078ec9d43279aaaced5f89 | 326 + ...974318e1a53a593c72cd71749172e9fa78b463892d | 1 + ...a0aa059e7c06f8756fdd450a0e55126f0df93f61e7 | 39 + ...46df7aa7fb5fdf4b47113c3ed3c67fb93b6f477bd4 | 21 + ...8f873b0c190ea7ff8de04e96b5de2a7e66dd19d75a | 143 + ...01dcfcbd3972c2181ff7af193a7d6972a43abce779 | 1 + ...326fe62ae6bfe4e9992d90fc89b6d2e62def9e3632 | 18 + ...9a90f0e06a7f859d0cebfbddb0788c1b9fa81020a5 | 43 + ...805dafaec9379c8e35fd59fde175a96f95daf1c439 | 26 + ...5e1a00f61cd7dddabba141988dba699-index.json | 1 + ...5f8f465d767548e67b2e23c53540649ca6ba2bf994 | 49 + ...172adb129160fe8eade3be822a04c568be42b6555e | 93 + ...6eaf29e5f85dd5c6680f768109fd17c294bf9dbc7f | 247 + ...619a92795813e5d0d3c0b7aef7269147ad556077f6 | 4 + ...2d4357ab210af5e37e2179840dd12df3642466dc11 | 3 + ...49db542a003bee74d9ccd4678fb09709923a9317f7 | 1 + ...5c603e1c0324d2ab6a6a078f0c8c69fe161e8d8d4b | 35 + ...be9fc21032bea11750ff488d8b9a6dbab4b111761c | 126 + ...78f6a12af957dc4d910bb0ee12568415ca141ece0f | 12 + ...478d2d04ae7d60df21e27e0bb4cec9b-index.json | 1 + ...31657b983880ccec1742693da7fef7d10b7bb9373f | 57 + ...1d95fb43ceba0b5a2843f52caf1fa02bd699e35384 | 36 + ...75504190a1b227b655b1ea9e20387092d4b85c90db | 354 + ...d4cd12fb39f6782c25f849980483b2eb80d219a673 | 885 + ...777e9bd0a3378de566df018f403b94badeb6d7c8cd | 55 + ...8a8de551f1940b855ec03a1ca81edfd-index.json | 1 + ...dc1e76923356f66d7f90ae9c4296fe4c3e5025dd50 | 450 + ...d88b37f373c51664b541e98bbb48971537a6992171 | 57 + ...79c1687c9ec6f767907a31017d0b08e37f10ea7e62 | 83 + ...d72d8a361b5b3884f927155119811434d96e450057 | 1 + ...cbd5a33e23c14ef3c532a11d58798550189314206b | 15 + ...77387909683a8e07815d9cd7fef63cfd0ec5041ab6 | 776 + ...e3687d09a5aa3339c7fb84b8efbb9ad857d502fd94 | 70 + ...64f5b31ea15cae8331acc85c4267cb7a373a7da8f2 | 6 + ...9f9db96043def3cff4a8da891863f73dd86830f180 | 6 + ...fc728d252738026a47962efdba55f7612467d0a1bd | 4808 ++ ...bcfc59917b1698a081cef3a30e5e9d2fef36e753e8 | 139 + ...4e53bfdac9f35d570f190921c18aa0a-index.json | 1 + ...bb8d71827ae2c593680484af283167a1dc1d3b6982 | 140 + ...40d1d990052a87e8f120ed52327ba0b0f553d0e302 | 16 + ...03a0ea851a05bb0d23cef9e61b9787cacb44d1da2d | 42 + ...7ecd92b65c3dd17b9c471609917f69cac359ad1307 | 179 + ...ff1d3e0421e14ce62b15fd092a8ee42a6d255515f5 | 112 + ...aba5e08addb2de9bcb26b6685ea11bb-index.json | 1 + ...7019a6664fb9646468e664bad2e1c35683e211220b | 66 + ...1e51706227beb07e01a986b5e5d7d724caf88e22da | 40 + ...b54a5db60bf01c725c3e86bd2ef45cb2fe2ffff1f0 | 249 + ...1bc7b10a8464f2ac327edb21399a9312815be08b39 | 107 + ...5860fd6fe8beff1950a764d03e0a996641199eceaf | 1 + ...230f06af52c4b80a256fdf6c00bace556323d8af5d | 46 + ...afd470a582aafa86dfc1801fe17609d179c0041b56 | 804 + ...e92c320df59d1808981e4b9dc891f9395307b64001 | 304 + ...9797feda65305559cee729a0e1d93487fed03a0402 | 138 + ...3732a832952557eb33cacd675840baf449fc92fc4e | 47 + ...f8220dd5d336b6e80b11a4f780d7ac54a3d25bde4c | 538 + ...0c61e13382a3803f6d17c6d8fe6376d2c54b50f325 | 243 + ...7e5d033b2c22624996c1af892e6bd723dc248e58e3 | 19 + ...48104ab62929c0f8a869ddeb72d7e90a23dddf63c0 | 27 + ...3d6191b84e6f49bde2eca9a03ed17dc559f3d26375 | 2 + ...dd66d6cb69ab3fb40fdc0c127ff557793497cd27b8 | 4 + ...c116b984da4a288c690ca2ecb7d4dda877a2e9ef43 | 42 + ...a1a1fc5011495785443fd702d9b31d9abaa500826e | 74 + ...9b4ddf0e7c2ad114e7863fb913537482733eddf1dc | 5 + ...fa76b4dd333310830cbcc7050dd50f5f1a7529bd07 | 230 + ...0fdcccb0996a0ae062c0115be5f03f9-index.json | 1 + ...c71231319e48c6384ac509a0c9639fc772a36849ec | 21 + ...5e073afade2565c2f0d1265f2c2dba57837a251f58 | 266 + ...767936a94f758a2db18b2460aa1326ff79d5ec98f2 | 1 + ...410179e8a9b82b1c096783cdfb4c4238cbceb980f1 | 25 + ...4a770ad1ac48fb262379c04d4e6a354d086f7c7dd8 | 89 + ...a0643ff426b732ce78b070e945dce8786e112d03ac | 35 + ...2afc7a26aa970e72a1ffa859b63dea447d33071ba6 | 1 + ...1add2d94450386f327949ba9722b35766f5a2447c5 | 15 + ...ac1fd64655b93cda4360b44bf5afa71d1b43336326 | 94 + ...69c02980fc9cb40b492debb93ef8623e5926c08892 | 9 + ...9db6c1aa068dd393021d54cb2fb0a699b1586409c4 | 162 + ...55330b230637679e9d4fc69ea6ac8a2e9d4530f7e5 | 113 + ...10ab0be800dbfeccdbb79f81adfd441abffb05e2aa | 44 + ...a7c6ffbdd1c59b4bbb72489c561053012e40aa000a | 38 + ...58253ea81824160934711de7e2bddf879b59768d5e | 22 + ...b162e0b1bcff18ec119cdb71e84a817c280e7c2e2a | 43 + ...85278f043eae07d5c8b35aee175962d07d62460e66 | 61 + ...157fa55f6b1c28b0f0246776323f000cbc2e580ac6 | 141 + ...341f00170fd445f3963abc874bf9227a01d723274c | 113 + ...570f3098261f58e2e827d5c589bf23956e08ec199b | 47 + ...559e9d67129f209500a303bf8d07864e1904dbba92 | 4 + ...007a1695a474c4b846aceadcf2fd9da159c6358c3c | 108 + ...95fdbdeb2a9984896159fa0914146365c01cb74702 | 123 + ...da93e849eed42fc77d76174a2c80216de18b48dd4a | 123 + ...2683e7943c858003cb88b0596487dbc2a917e226dd | 3 + ...dace24e78b8cf030b7a9d0d966d354b86774969241 | 83 + ...86ae263cb9bbc9c068bf54cabc27ba1e875fd5c51b | 6 + ...ad1cb7f92c6ad00b39f7817da6dd7ef831159d515e | 138 + ...f2d7e79c4e9bb423e1bf8f3e01a6bd52e58ae486de | 1 + ...1778cdbc34ee1dfc164ab4c868e45a6cb67e797e4c | 18 + ...83ef000d803e6a7701dff05852c228bc3dcccafe82 | 19 + ...d0624cec8d13509d6c59a8016c5a527ab774b9ff86 | 3 + ...9cac2bdf269e6bb3223407863e21799375f8c56bb7 | 16 + ...c0014e7dbd72d5662047d481c586fa259c2bf28d84 | 4 + ...e447e61896afc6fa9fdb895adc357ae8ac27f38f1d | 751 + ...c1e263ab6c2db9f7b391ec02a8ce14489128615968 | 1 + ...0508ba045ea10dce3a19dd5542d6d756655fbab6f9 | 12 + ...1e5c19f221daf00743a271f465ec39d038cc8b1f8b | 240 + ...c3ec5f47ba727ba1fbecd3acf24a312b54c0c150df | 27 + ...359fa39b29f1053e268673fa6afea37596b82ca056 | 57 + ...262cf19ab391110124b5cba12850b0015256c599b5 | 56 + ...7fd89ae42da99aedea1778501f24bae6e0fc848dbf | 39 + ...1313a6f13b574a94a92eb8c53d006bc82550d4d3c1 | 20 + ...00756b6391589c9009a249f5a1266b3d92a847402f | 8 + ...6f3b3f43bf3c0f081ccba53279abe2f-index.json | 1 + ...3ed650a912de164d36dc1729726f92b2f01b67bb21 | 15 + ...bccbe5e43ee81c255274ccd502fddc61d25091de34 | 4 + ...38c8cc9e27f1b8d22fd7cf1ffd9eaaf857348965b1 | 42 + ...5d70ac8c6d57f8e2bb474d5f129a19a1f16ea83f2c | 168 + ...eff0924dbff80f8982203eebd3f83c53f9b3542b49 | 185 + ...8bb54372b6eb7f1733a3bbbba288fb43f72e80db7f | 14 + ...bca4d0fcb258c0396ef4aada27088a60aee00e8285 | 6 + ...f59295ae144a4c22794dbaf0fe4675a80eeb69f8f4 | 67 + ...da323e17741a4cd5c03aa484b42afdb-index.json | 1 + ...4716e24010c9714fefa8712094d21d0d3baf56c41b | 21 + ...c11619400663b79410392ca63331fc6760369edcb3 | 183 + ...f8932a3c7de5971c54706289d71ff5ea7862f1c6d3 | 168 + ...09d4f739d7857fb4001ab7f6e0d8ee9462f3741565 | 9 + ...4647b965bb3d0830085141538ec6e6959a81dc7c12 | 124 + ...62a12fad76ee2481ae1c25bbffb7b165a34be7c3ee | 20 + ...100b0dda5964517592d704a9b93612ddd65a4e64c3 | 1 + ...4fd6f8b1e394e3090cba60facab050386efe94969c | 154 + ...9a4d05641aa6ba2d4fb15ad6b5768ab3301ab15d15 | 4 + ...b000bc8d20ee79d2e1c6cab8f3f50d512cb7c7455e | 47 + ...a612bc3f4dc2b52bdc0e2c3b081148f9ddbace187e | 104 + ...5e830cc6e424531dd38a7352c483aa9734637d0eb6 | 80 + ...8201e5de5be560748f82fed7ab4dce97059ab739da | 24 + ...1492319a71484572e346b55dcd74b23808d37cc9fc | 62 + ...1a1a18e0f131d2dbf4244964875965c31587758642 | 18 + ...656e68f63bfb5552baaa2c3190f8bb2-index.json | 1 + ...107d8d9f65d13bbcc4a0d3257835056c2c93f9bc27 | 23 + ...c160ce3df4fe06c11f2ca4f861f10d4eb45062471e | 7 + ...95d61c300d6bcd4c110cd942ae89faf8e493eaa0c1 | 77 + ...f02af5b364490cbc93e331e1963859068ae1bedddf | 24 + ...fa5b399c2633dd66a8f0ae85b0fb9eea95eb7ec1de | 50 + ...726ba989e25a127cc3492c87760e491fa7f2756c78 | 1 + ...a8da2bcf0803c28b91db1e45aaf8472b6a2443e6b6 | 5 + ...726f7016fe64d27b8fdad4a1be3ed6f844991b3225 | 22 + ...a143b7af50c3068e24699297b4071899a781454998 | 104 + ...1065a1462c1c7404a64752fcdc59f443fea894f3be | 85 + ...488c6f3c87749d7ea3c91cd5683fb6f9cb7c5159d4 | 34 + ...6b4135692dfa1f32228cb60446ed19a1463dab1f11 | 95 + ...830240c50e20db6b7eb7b118461a50bb6d32074e53 | 52 + ...adb8312a1e6c286a846d849f7eb0640342a5ad3adb | 16 + ...ac95d36ead030a1aa0a6d4cdb305c89-index.json | 1 + ...1f1b1c30320e038f5dcd1487781997a177f9e6af1a | 3 + ...e5dd861e594a0195c337330bfc84c47ca5479d0147 | 3 + ...973fdd60ca617f80a2b8d62d0e8fc15d77f85056fe | 129 + ...50023fc10e612f0df36a43f5743877887bf2d75e5c | 137 + ...6f057cf85f153d0706f968c70663373f977e1dd190 | 39 + ...7dc4c9353bacfbe3f58e5b7ce8eae60-index.json | 1 + ...f34faaf498c690f18cad388c02abbb6c46e1c941b2 | 92 + ...91269510c28094810edb49e665a013ba759fc49725 | 49 + ...0da82715023a89ceeb792efc744f197567133c9599 | 570 + ...f49568692605100ff5ecd6360f1d0456034b63aafd | 46 + ...0690bb71ac7ef359be6b6624bb0bb073f407f28dfe | 106 + ...915aef46af7498172bec8d24790a6f45b8b2c27c2d | 1 + ...aaec086883fe40635db194c7cea95453c3a019b073 | 77 + ...fab35076e277b7bf2113a6b259dd4e75b5ad16cbde | 1 + ...8a9cc201567e3d661d3691bcfa2d1de6c4a8d7d942 | 12 + ...f2fb30dbffd3a6a87bd1263237fc0872608a5e9f1f | 18 + ...dd7fdf830c2a435cb8ff591884517bf-index.json | 1 + ...92d66e3579dcaaa5b57e45f1dc510df8290142bf71 | 487 + ...8c6757e067c1ed7c30056caaa0a21b861938f67ca7 | 50 + ...c4ebf1854ae2824cd7e00acc2e12346-index.json | 1 + ...a27019ebfa11b1781b9d20a2be3a14a7009cb2effd | 3 + ...ad555a2b419f9e960c9b3d69a22112381b39003fe4 | 7 + ...1aac650f8313fb9ce03cc3b1d97a68294eb7740c27 | 291 + ...5de013f8b6239c4b53c4fc8286ff01fbfbcb642035 | 29 + ...a08726af9746bd12930622205e78f78b9552eaa7ee | 9 + ...9e58b0bfb76d7c9acd1320d49702f61cb62c7cc772 | 51 + ...f0c1c7d5c9799bafaff27637fa05b0453f02952015 | 279 + ...5fced18c419ba02217935a3686cd822-index.json | 1 + ...ec431a42ef91bbcef59779cc4dc7c4680c06db0ca5 | 2757 + ...7f644c1d6d52a1e1e12a5cd97fb59f9968ff1439d2 | 25 + ...75165c80618f6df41090e5b421ece403a6a1ad4e36 | 17 + ...578651c8f0be16077d7af6cbc59229bff0255bdbfe | 93 + ...9d06a9377ac46aef93b57a9768dd57236cbd019d2b | 38 + ...4701b9bf94a00c65d51ec960960e95b74989ac6309 | 88 + ...46b3e71b4ed890d84e1ecc41955ca4b0bcd3bd71a7 | 61 + ...06f475de5dda543fd1cd7a728ee7cff7f4a1a145ea | 41 + ...a0df9df7e323019ccd914ae89f37a59f2f5d62e866 | 1689 + ...07ee73b2ee4d47a2798f2a294509f01abecc810e59 | 3 + ...74d5f8a28af2dd2265d67e305471b2ca3c47ad6de4 | 14 + ...1adf6335c7d44c447d0f9ef39498128450865a9e70 | 120 + ...80bd277157aaadd89b8bb65ce2c0678543e72fe630 | 57 + ...bf230c1096baa38aff34978966eda083f56010cd0c | 180 + ...3add0ebedb838e1c1ad9c47dfac8eb44159930ca40 | 87 + ...0e8ae9a9c356d721ac14780e4f73b619e44ebbdcf7 | 42 + ...b6824bd6f79146ec6651d99150873c9a475519cd12 | 135 + ...efb0129cb388d332d1a7fae651c255a-index.json | 1 + ...cac6fdf3fae2d855981e0b08b6227682fc2e1b877c | 100 + ...7824122a109cf733fab11efe043c9c8-index.json | 1 + ...714bfca14959fa4c542d1d49e6bec0621f45392d28 | 15 + ...d0d409c11d950b8a13cfcf9f0b0d2548718675a4c8 | 31 + ...344ef2e64a5b9af49319c432ecd637cd36b12cd4b9 | 63 + ...6c7600707c231c3ba77c3966ac23a77ff2b71cc0b2 | 62 + ...4f6f21d7b74a0cb5b1aa7ec938582703498c5df7b3 | 4 + ...60b29cbd1a5d27c671fdea3a140d4b8efd6e880443 | 36 + ...a8018815ec14ffb69c4b5ba1f26f6ef2a5c94db9b8 | 74 + ...fecc502df6d214df76c84236da31d43e434e624717 | 61 + ...aaa2831009ac13b482d5409ba92aeec-index.json | 1 + ...6dcd5058e429eaeb010d38917af24da02f3470a3bd | 126 + ...7f1fe4ea470dd07fb7627572440643dde7247eea37 | 74 + ...aa79dbe835ed469b560195013b83931f915104290d | 9 + ...67e6c21de368a54c30ca6aa184430dc4cd60fc3508 | 1 + ...a7d759c4c469e7cadb0541c7866a4d97b093231e71 | 30 + ...f99b7f79ac156febfae113a01be6caf806b7b9a264 | 21 + ...421b0125a567ce7258f22692c6080c203275f98dde | 128 + ...e0f346c95c0566150e19b1013e35ac7593f7e90e19 | 13 + ...9511b28ebe0ea2a8f32024645ab0ce0dad19b250db | 51 + ...abf76de96f1b8c820618ca49668350a4eb8efbe35a | 1 + ...c3b0a626965b685eeee744ecc1190d98d560ab1968 | 16 + ...9bfe515f7e5b6ac5a108c7a7f7b4337c4e6d1fdc64 | 12 + ...f736a1d89a98bb6ff86b5cf32d383cc-index.json | 1 + ...93f9e2f18d5cfa0d0078aa896dfdfa79b0c8112e98 | 3 + ...3b491659052ad4e553af54df069b5ea709e009b387 | 1 + ...1d4c9f9010e16f315111105193874626c0caa292ff | 1317 + ...65d1deb51f9f2ed5a4dfed6c09f54b3861205afc84 | 40 + ...d273643674e134d39c84bf1f016d31be5eb8c9c20c | 49 + ...01395b539a00f637dc1988a2dd0048a26d2064b8dd | 17 + ...2afed90bd62640ca277b4283111553a9a9576c77ff | 1 + ...c7947f05df4e294b9db5b0b45869ca4f925cfd20aa | 31 + ...078c9245534f72263d4675da524ca4f4b38215210f | 19 + ...78254b8ba9a35cd5c96557d8e48a4c01cdc7ce46e7 | 1 + ...4559529a30a0d0ac1b0787118b068e88826bfcc650 | 1 + ...41ddf9d0ae058c992d9cb02fd7ba9d49d39cc1c2ab | 70 + ...1507d7c85e08d60baec52a968f00160d1bab40bf2a | 70 + ...a3e75fa48b44e2e9f1b41943f0d4734325c1e8b58b | 1 + ...cff32dd9594e5213552fdea62fe7ec5dcd931149e9 | 23 + ...75b40673e220438fe0b7115a6f2957102fa5fc0711 | 45 + ...f66a60d7ee294a3f785b9090f8953731f92ecd4f6f | 1991 + ...80e9a214560d651fcaf09c0936d35107a462ea8b17 | 1 + ...217895c971a916ce1e96a864c66608943dda21cbb0 | 3 + ...67163e0341f7813c329bdce04523f6bdac677f7407 | 121 + ...e0bb4a9810f94ec6e9c8f36c5a51ee3b74673fecaf | 116 + ...877e9b8e2a3a25d343924a96587b2281a52c662458 | 9 + ...78a21a904a09aa3e6a093abb10553fb4a1b9a70e96 | 3 + ...b084af60556753138ff75c1271fac592ede8e34361 | 70 + ...96b58311c6942ea6e7006a071aa2e630658ae9324a | 79 + ...c5b33e07a4beefcc92058792a65ce11c878b10201c | 1 + ...f5f57c23fd6a521ae057087e28d4cf00e51ec2d0fe | 43 + ...122e49366150bacdbc1cf6de3a4a41f23dc82ea377 | 12 + ...51d6abdfc9b1688fb74e23100f84f1ded9b979b483 | 38 + ...02cdf113d0cbf3bcbf6292ef1efa7a74f3ba79d091 | 5 + ...3effb5ce7e3131b3b00a8e954ad2e73de371b1c16a | 76 + ...f1beb2f03c6ef1ea1d31a01e72330064a78a678ede | 66 + ...3d1b220adba57936c16f16e1f11816fa340875013d | 43 + ...467862c1bd1198f1633ccc684b02ccdb2312b91050 | 784 + ...5e861c57f7f84f870fe781fe20102ed1aef202fc99 | 1 + ...56c7264bc03c8556fc86c577a7a61ab58c9e330311 | 36 + ...4f5b9b08aed9d63a499f6359490c21a17bc13cf01c | 46 + ...8236180612ba7431c89d0ed787e546422db33538fd | 133 + ...7b6b8679fe2e1d208cb57a9167d09f093c0f5affe9 | 1 + ...b1b6487ec8dbe537824f7ab1ef8265c4f7af535369 | 23 + ...5de623996cf33d9dd1ecc31f187d2716cffc796292 | 51 + ...5d74f855098f5dfb4f9501f3c1f052cb8bf1051109 | 1 + ...bd9f7c5d56ac6859e3a303f86f0657581baeabf0d4 | 39 + ...36e08feb78191b1eed5b9cc2b22033f9d1f026da87 | 17 + ...152e07213cc3d5077d6eb7b59c58ac73021b725a10 | 1 + ...26151a7208164b547f8190e901336f429924836b13 | 360 + ...7dc316bdda2754f8c0ec707931a73915e59e4659cc | 160 + ...90a7926c0d6118e102b1afbf7df44a2855f7189a36 | 107 + ...412eebb2fc80409d2e9a02f08421a1d786fd94504d | 20 + ...e7db257c55ebda6cf8ce3e85003a9ab2e5df89b1e3 | 27 + ...5a95be3fcb1211b9beaa904c79c896f-index.json | 1 + ...7aa21b99a153f44447648f21841097449d276e83ec | 4 + ...846cefa324593708d93992ec45a744c08a3e31cdd8 | 108 + ...9d7f3224ea1919a9c4b636599ee754aebd4be88799 | 38 + ...bc8c941ffca2bfaacbceed8a30f6a8cda1a2bb182c | 32 + ...227f6afb036bdc0a7bddcf08d961f38770248ffbac | 47 + ...4aa69285f0be76fd5a9d56c3b8ec397-index.json | 1 + ...6d0a7e88baa1233d094c9236129aca6fa75d9969df | 66 + ...8598879dbb2e7403e9cab3047c16e25b7773714948 | 4 + ...31e313cc136519b7999e51ce171a09cb04dced739c | 154 + ...ad26cfadcf80892d699034ef7d774fdd0501a81a3a | 12 + ...ab312adc001979be8b06c782b55dbdbb6e9be90768 | 160 + ...cf68266fc670b0f4f9c3b912e17b0432c50212de6d | 123 + ...0987896974cb1eb030a1c86b27e006cbccc4964816 | 26 + ...edc059647016bf4ed9a0947cb451bcd-index.json | 1 + ...1b3099c02ec9b94d2905721c9336015504630e71b4 | 237 + ...f974102aa60414ca6bedca01fe12114ee8b5ea56cc | 1 + ...d546e7cb1bf2557aecf61cb5013d15f-index.json | 1 + ...98c4f54cb38ae5d75686d2f9c1d2c028899d3a7aad | 1 + ...39e58731fa55aa321c1b2eb43478842de07115cdd8 | 42 + ...bc782c121dd5eedc7a1d4d457169064cbb01092bdc | 118 + ...199e66a9c5a7fc5690eb920c780c62dd3e06397ab7 | 12 + ...16dd6b2eaf020994ebc13462a32aaf12e0ad3fc3fa | 62 + ...0a5eaa8c62bb33885b5620cfe18338db12c2b048f2 | 15 + ...b740c2d8d85978e20e5f0343c4add7c16278c3ae7b | 41 + ...d80de1595feea98134da30db6104a0e9915ca31304 | 4 + ...a804ad37830c0fb23ae2b7653da9cc0e7e5099b562 | 26 + ...ca99ea69176d78116fd023edc20b094336bac676c5 | 1 + ...cc91cef50aad77fe51943c3cb61763655fb0a32911 | 14 + ...6e32cb268d70057064ce3d03ec09d34bded6a29bae | 1 + ...7d65ec5e6a7996be35262050fc4c942e741edc90fd | 21 + ...11875150019d7c97361b7ecb62a09378db68c04963 | 25 + ...f7b5cf9019cdba38dc23122d7e57f5cf6b964b32e0 | 169 + ...b14134d3c274c41041b28e6a113fac577c8c9217c3 | 70 + ...766a2510f5af7eee089a87623052ceb4af6d322478 | 20 + ...1755f76260770ec207ef178677d39aff9f3ef8b858 | 3530 + ...08891bfc0969d64450aecdf3e74c4a26a92f04b5dc | 51 + ...b822a2dfc719be589794dee3d521f6f04d423916e9 | 32 + ...7b28ae631fe51f2f449070e612db707eff467db5db | 24 + ...7e2f653b8da2bad8bb34d70fd1a6ab99ff8b7c9413 | 1 + ...9bc7432825f777a8f661aa154cf6e159eaa2cfa1c0 | 55 + ...5826094ab2d075e3af4c665ba1f00eb32d952fe526 | 38 + ...5b04bd77c1ace4cb8bf2be66aec335977518e1c69e | 145 + ...e556e445223b21aa720cb36bd09b1127653e48032a | 60 + ...fb7ecbda99a71048f83590595db490c788c42f724c | 5 + ...1c378098ff8856b79b606256a725d6a76858d5ff16 | 58 + ...2d2dc4935ada78c527d5318d7361c9b02c9e598107 | 3 + ...f6efbf271195487c1c73d81f91d5b01752911e863f | 32 + ...60f77d7ad686368ce75b5108b541ae18b3d6b338a9 | 108 + ...7826049258d9e849e00efa8998b21aa745388b1569 | 11 + ...c1cdf088e644e62ca2d1cf71b837632b539608f60e | 13980 ++++ ...f5ccbb252b80fbfe0f3b3e44cc384e35ef123c36d6 | 86 + ...13b1a74031ba1bd4cdc594924ef8d85b5045bbda29 | 127 + ...dcbafd00830b68765b1ed99033a130b6e28f734a7e | 41 + ...f1ee1050e5ab4941205438640150a860add4e6f944 | 169 + ...5cfcf374155a1861f5af9644cc6fc67454b4dfbafb | 93 + ...99cf2c7cafac833dd612c8357a1088e83c08ebc065 | 18 + ...4d4a1d2d25af654f67b774fde00ee7e85b0f3344e5 | 49 + ...b9ada325dd557356775cccc8a0f9adfd86a2e81e02 | 23 + ...47ba67dfa2d44233ca8f2cc404f4f9431366690e8d | 35 + ...f758ad06d478963f3bcc237fadaada19345dbe4baa | 536 + ...7a9b305dc3867a3c7b0f27cbd8f2bc37ff4a3bcc36 | 54 + ...3f56e8a6334271a87b349b58a10aef110a4b0ca394 | 44 + ...47a73605ccc5c04870769a9c7bfef67c45fceb6cde | 12 + ...2b983fd10af8adf6f99f7fb1ac71d28c84ec0e0818 | 3 + ...ebce05efa9b1f073f79910622217db26b147b4adeb | 916 + ...52ec136f6d335cab9a4e825578de1c72d89bcca192 | 80 + ...df133d8abb6cf44f13dcbd147b44dd52f5dfec63df | 7 + ...97c11f461f9fd620b4778b20ed357b945a0b8be6c8 | 436 + ...f1be69cd682b2bec3db6945795b431099b3995f501 | 8 + ...fd4df8a09efe96a2472c17b1452effc408532a3861 | 46 + ...5450d1cf3c701e15f8a18318f4114bd9ca3d0b7677 | 43 + ...3f312998869f26fc6232e57e35df90103432c724dd | 1 + ...36f11e8229f4ef771ca5898f7df174dd22e63864ae | 90 + ...acab79bccc947c28510b4c79d2f0abf846a54723ac | 2611 + ...d8d373f0f87d9b60f97d25dfa106e7a362f51c714c | 1 + ...5582e8c78ef27296de51e05b98d1a3ad9121a24726 | 66 + ...9670695eb6094576fd1f30527f8939d198c945496e | 4 + ...a95c82d4fa471163cdda9dfa5c99320daaa083d375 | 32 + ...878acf9bf8e9c448301eab5f7418b6a92d6c6608d6 | 28 + ...5d3f0928b55191b7c1d6c6e03ca289ed356a593842 | 28 + ...52665bb35eb42148f3c96043116dd9a1fbb10e54e0 | 1 + ...585b199dd5feead59c57b90426b1443f5a6a967fcc | 22 + ...27fcb8a60efcd6c7cb8c5075bc6abad821eaeb5c2e | 25 + ...7aecbc3c34eb1149583006b0ed27c3957fc9f07dda | 75 + ...9920566d1f07fed3e501418b7e199bb2c8690da8cf | 71 + ...bd17a2a8a90cd4b34061a56277bc32a69bb576a70d | 113 + ...dc1be6ae9594a8481caf67ed4ab71d61a65f26ed1a | 74 + ...ab6d46e9b8740817d2eb0e39f16f215d682e38cfb6 | 51 + ...9fbfb2fa6604d5d2771643c51f9b23882a44e251ff | 157 + ...f06fe6663115b388f46db2af28d0dfe2b6001b5c32 | 72 + ...11c6009cc48fb3885119f2ee4d1174b7676929486d | 12 + ...c1133ac62c5bba3da86ee9b365e4744324d15a9392 | 45 + ...d4828ea91a886b4ccfbed87577bbcdcd00b60ca628 | 23 + ...9c6fb34f2bfead34dad6216d49250b111f08b98e42 | 40 + ...037275cdcaba1ad55c161e4a8baacb211734a040d2 | 281 + ...b1679f325aea4eb0304acc313b7b5088d9971fdf0d | 76 + ...f06a96a0bfbf3a0562c814b4ffc2d46e3f044197a0 | 110 + ...1923fb296b34156398720819a0e818379bc9a98aa3 | 28 + ...c8c5bbe0e09168d8334011f3c8296a1-index.json | 1 + ...21173939229526731cc7c27ed409b69f7254cb80e2 | 51 + ...1a41a17e43c92f1b19291989299ddd8844d5c80abb | 275 + ...d1e438a68d960f113b64a755b648049ff53a1b861d | 1 + ...6db13bcf455e7ba24285906b6452a0eb1bb5d7d38a | 355 + ...f611e6b5365402ec2c3a20c9345545e85009ef6e2c | 1 + ...9f3aa400c3bb74f31ddbbfbbb0ab096c4b288d65af | 49 + ...7fbfa0d238626419f5e75059dac1c6037daa8c832e | 46 + ...74c142333e58a5083f7b648fc01a2e1da23d80d309 | 12 + ...13eb157f45bcd6678e63744b7c969d2b96e1d26e93 | 2 + ...8d9fb8d6b499c04c075716f3fa2df31cf1d62a3b3e | 68 + ...f56daaccc9d26a5997cd212b7bd3eade8d3249351c | 21 + ...7b8722f15e93a93a70854e08e1f3d09e76d8361cb5 | 6 + ...3156c19464fee82c36148ffac92e95e6a9eef8b99e | 1 + ...c3e37488a1862ed226472e53025aa30042cc7f1393 | 270 + ...be315f942ac9695f67fbabed285870d88ec7058dc9 | 51 + ...8f43d4f3c01cc81cd7d8bd06203f135fea3cc4abf7 | 481 + ...8d493ae899a5f163d550643ebf00d5932ee46e9927 | 27 + ...077fe9dd59b7e0222f2601a6c6d27c993c0eb6d7d3 | 12 + ...cac1028411a3a61b7ab76cd0228be9c56b1ccd991a | 36 + ...9bf1b783e15d783b3d0feac9b147f50f6f4451d608 | 14 + ...d2f34e42d3ae725755099d0baa93b190303219fd24 | 3508 + ...002e0f53b323a5f225278f6223dcb429a87697f8cb | 125 + ...14f74cb3276163458286ac0852d718a-index.json | 1 + ...8a689b533736b6dcd590debe60fcc199514ad3a32f | 100 + ...57d120bad269d37184d79b96e3a079c26c59aaefed | 14 + ...6d0ff622f93dbf80e48d7e14bebe1855aa9845656b | 47 + ...945b66705c6cda817cdfd7affbef1a44e2abdd4061 | 1 + ...3f6683ed426042f0b0422689bab18da325b30d7563 | 8 + ...1ada255c0d1bbe769d112f1446fdd50-index.json | 1 + ...f4b6290659a59d3236bf9d62f93483c-index.json | 1 + ...5065fc1cbbc5706137fcbbe890a12edd8f29ea6662 | 13 + ...c54b4978c1d2041a92866bc82a4f398af488ef43ba | 129 + ...403ac82b3b3186fa71f719e6d23f49aed0de2debb8 | 1 + ...fe3aba44b1f8b92f36a6370e573794bb44f2f2aa70 | 40 + ...d1ed6c1ff02a4f08517f64fa1133471b63184d8cb2 | 1 + ...f1753b56cd30a71944ba35b610bbf3c58c9fd84379 | 1 + ...88c838243aafc21b19eb95e1edcbec912da72f5ced | 6 + ...7327985fa5ecc613f7a2a109e58f5994b358fc3b0e | 106 + ...07796e7bfba31d1069c4445c5f6cf5bc76c18a957a | 120 + ...64eb661e1b8f666a0892c333e6c85b93e04c38ad84 | 96 + ...82f326ddf79625e744475bd344b135b74b51fae9e5 | 140 + ...c2cd91dc1629264248d12e1cd66685ee2d6b014756 | 11 + ...e752e14850dafc1eb5bbd62d62ca42512acd1e1482 | 95 + ...92894846c94327ddd03499c72502a2589d010ba42b | 27 + ...865d561bbf80c7881be5e7e70899755f2a0a8f3796 | 52 + ...c72079a73c4662f51a569df6810893bc1c21711c34 | 63 + ...476b9d8c965be0ea942c62042ca865ff4468e1d447 | 192 + ...4bf5f7d61d9db2e761e726a4d8b5d7feaf52090314 | 96 + ...3b2620790d127d580c6e11f3aa83eb1bdc9106de98 | 3 + ...3949aa5f329ef1de91cbc06af2e4fc781cc0ced94b | 26 + ...d3b21ba219adab7087e7bc429d93622cd5c2f444c6 | 217 + ...f97c4c1fe2ee42846c2da5aed3bd107fc78b96776d | 392 + ...7ad84e7eeae62b589b7efcd3ec66fb21cadb7050f4 | 54 + ...0406b362e05ed747ab604ddf55058df37458c2643f | 30 + ...dfd6303d2f0b501c0f3fd69a7e0d8154846846bbc0 | 73 + ...d789ffa9abcfe1b742bde017f6a8fae9d8cc909ee0 | 1 + ...2ff4bc20384d6930acc5f1bb5f8afd280a09376731 | 34 + ...e3e1c1dc4742fd97bd86b61415c78a80ed8a9ec969 | 50 + ...5f126ea22c10d782c583a3d7aa12790aab0ae5a112 | 1 + ...e47079ecd83813149ea702bb47e00d9ba9d72e5163 | 324 + ...85f8542373e271549f54faecf98a04b4204738bab8 | 14 + ...78214e63293d5ffda0eea15e306ec5bfef48b52f00 | 46 + ...e9c9e3fab11dddc5cfa8528fd49215644012db9e76 | 74 + ...2938f6d12e611b45fcc0420f0e0f3ceb2d08dc064f | 439 + ...da9bc212cdc47e13443dc597fad13458a8d5050108 | 17 + ...2ec008ad60cc569b6819929db7ffe3b7dc42460aa4 | 20 + ...450d0be4ae6bd3c54107f4b165bfa68-index.json | 1 + ...f9cbd7a0e9b31d48ecf397809eed6fc5c119ce2110 | 91 + ...c36b231534eb786c9da5857ecd5409fb92203b5824 | 15 + ...1e0733b4a9c005174732467a29f705ea0d3e39f4a0 | 1 + ...ea1306e06472216b89c647c909ede0e150310b6616 | 55 + ...bf330601affce9b85ff4b72ad4df9e47a8b259a209 | 39 + ...46e0d7f2c2658bf037789e42ce5b786bbc88e56eb6 | 20 + ...1a1704c05c82c05595fa10e2c1a841088c0a702dc0 | 1 + ...43416b9b9699d381d807326dfb1b2b2-index.json | 1 + ...6349f3157a36a1e7ccd70f6e3c36b074800d310c3d | 33 + ...0dff44e721d7b362703e55e7f2c67643c7c0e1cc0d | 84 + ...26726ca4cc600aad256db96cfc8d5d848951549d7e | 50 + ...c5da7ae8969b09ff2f5c64e26ffe57ba02deb1e3ff | 341 + ...14416e279fca322ca4255303ca4e87c24120613dcf | 38 + ...2a47baa491025747c4c5e43b845f12c8088bd7659c | 36 + ...8ab2287b0c54a14f8bbc2697626f21be57198074fe | 59 + ...9efff2bf4c7c2f2c6d382ecc8eff91c113b7b7fd52 | 76 + ...ed286621c3e06c25121a27dc84e0eca37630103d74 | 81 + ...368c089093cf5d34188935754ea32afcd42347a461 | 70 + ...710149a25cf5768f5920aa0f44cb9848e9d121e4c0 | 45 + ...d0b995e67eabfab345c52efa6b78d5b08261b1fb78 | 50 + ...bae92a396a9ad0bad45658cfe6ee63d-index.json | 1 + ...beeb0805a72f846f65566e90f66a965e4759957e2f | 28 + ...b7d00063e0eddbb96d11e732bd2e84fcefdf1894bb | 3 + ...db0ae1177220c7aee039e673ada278dbffa6423d9d | 6 + ...2b991c8f5ae0e2d9efb5338899f35aeb487e985a43 | 2311 + ...586afb0e5d5f383681d76740243f2a9-index.json | 1 + ...27e65ae466c0eb76e2f0e173dba74d50c3458d4490 | 62 + ...59be2c264d7e0f1488b693c50d015f166989b1f109 | 220 + ...44e2e546a2204424313a84877faf4b9c34180d3056 | 12 + ...381b9ae320e9427ecf9e40a3c193043-index.json | 1 + ...1b98db8ae929185cf84d39beed15ab1b65101204eb | 16 + ...e60b3a9304f556005ff086610e5476f-index.json | 1 + ...a35ee0c8834b696f7ad5aa3363af9aebedbbf48cd8 | 635 + ...eb8de65bb11145ff3c67c3647fe0b90184fbf6826e | 17 + ...47e0012e5bdefaf3f42c2625f68e0274c242b63154 | 1438 + ...5f324f8243b8f84d0fc84a6a3bb488a8c5a59840ec | 140 + ...a28d1baa83348a6a52683e4f83f0c3e-index.json | 1 + ...4323a2cd39617b058509abb2b4ec129-index.json | 1 + ...fd549f25effbeda9a14a22e48d310a7cc9804dd626 | 20 + ...0f34a92030234bb475248220cfbc43af41d131a459 | 32 + ...46085b16e2d6e9ff181b0ae5ae7f0c8f2d63212a32 | 270 + ...f0aa817d80f7015e36647877740fdbda33199748d1 | 54 + ...b425afc980be4b62768ef7ccd0e3ed4ce6ac1bb3e7 | 45 + ...f2b037d0b51a04610882c3fa8f7b00dc8456254dfe | 28 + ...33c2f968d0f24c8c5c93b0d2b81ce4c33ee78cb272 | 25 + ...111dbe0d090eb10219657ad78e3f3d40b3108e8cac | 8 + ...d152e938f1b8161a13ff58f0d51022d4e8565c0b05 | 4 + ...fa89f79cc4fd73f4b5f1d097e79b44ee7d5351a4cd | 98 + ...c55ad0df591bbd5f56403013c8db038294a09c6815 | 133 + ...41bf7fa3e441acae207387e0b74eaf6-index.json | 1 + ...2cc4158cbf40697e6ee7a7e702a08d7-index.json | 1 + ...4e4b51a7cd92b40ed99347a336ac1e566e8f73e0b6 | 99 + ...34cef077de72541f39fc868251a44e91457bb251f8 | 27 + ...5b17face2a3bc841564344136af96d86bebbb25d41 | 166 + ...f08699cab6d76a0be478bf66b0398572539c64cb03 | 10 + ...77eabe3fdfb2dfa01850cf710ea0d585e5bd546301 | 17 + ...1a8847d9a182b7a7f7567b77b09620c53af370ff7c | 71 + ...907249dbe055117c0669a400ac4d541-index.json | 1 + ...ca9537345bb6ab2daf6fa6385425345e3573e21c31 | 1 + ...5d42772072318e687a5d00a2a5726710b3195d0ef7 | 9 + ...1ac955b0c338b1b9d49cb8886723185d405c3ff7b8 | 14 + ...d1ad4be78792513e12e263a96844f9caa12e709bca | 44 + ...5c3c79a3aa5c29b654b43f35c11ae88beb356c27cf | 36 + ...57a59d1c7743195f973f9d484bbc81f631cae03707 | 38 + ...eca28f16adde6731d1502b7bf28166919a49a0e70d | 3260 + ...c8b04de924726aeea392d3dc88be8723ffcf52c0cd | 39 + ...5df238f61e37ebc3cf87099baca028ca9b45d46ed4 | 15 + ...732c4a02535075b7879737caa59956b21645d9c910 | 18 + ...aa116c3757e7e59574fa12075c4f9b955b733530cf | 1 + ...111ba29068cd2a8c150111590c49f2ecd1d447017a | 20119 +++++ ...dbcd3494b9cc152d9c38eec26b5f5754b4e5412f4d | 30 + ...2798347c02ed40f085b35579f501af437a0e6b7e7a | 117 + ...a8d068e52a982a78fc3546e3beed632fad01ec6e77 | 1 + ...533c22da8c73168a4ec915eb93a908502c0f3971a7 | 89 + ...735071b3ba71ff2f80a0bd45456ad0edb7ee4bfa9b | 1 + ...99c7120a193561665db20945f63d582621cbbfd3da | 5 + ...03d0c7d3f7fa9fdee8a32d542470f934239e1597c3 | 1291 + ...dc5a67dabec27794b6fa65352e8eff0216da436b0d | 119 + ...855d1f92ee6137ecc046169724775e7dfd49758dcb | 11 + ...d4688f8c9bda8fefde16832290718cadd1137f317a | 14 + ...9ac254bd8507aa7f0d3d52acabfccf2d8b79633f06 | 14 + ...9fd745314bf408118c0b479d3e2bd28214a6450e90 | 62 + ...bfdf7e3a4e606ea2c0a7f4410f96c04bdb71652399 | 123 + ...3ce029ffa1f06af991482f679504609dda120acabb | 1 + ...7e2fe7cafc19464f3e64e7255504b7e5b5f5e4570e | 29 + ...0f2218fe98952575ac91aa5ebd9649e369fee9a0ee | 1 + ...bb2bfcebe69d5ab49c82652cae58fda2f718337e27 | 38 + ...ed20ad4be09e19f0e61f46560c37f46227777c35b5 | 34 + ...208bb8456304866abbc5240f4309026c35b15c589e | 1 + ...1768e42d628e96aa134699ef646ba6ce4f42d9570a | 1 + ...c5ae2f779487b41be5de5eb790fa24e6e8599326e2 | 4867 ++ ...caa50b4c354877861c4aac5ec22e078e4c7fcb5830 | 546 + ...c6fc08d3d9e092e1894369c572e890e1ffe122356d | 1 + ...0e8c134fee34245866badb79efb9034721e33f62db | 1 + ...de4ae294007bd8c5ab92e654b29080b0fb0ec5606a | 37 + ...3b00a65e10d9d47c29ab6358186e06873ee1a66c17 | 70 + ...2f21b5c98a97e8e48be4216bcaffe2e0a84e8e20e0 | 19 + ...801ed2fea4a1b2fecdeb6a1c961dc47945085750e9 | 1 + ...e314f6edc49960ec07ec2e6367da1b2ff975c50594 | 52 + ...e557b95c477ca3719f62712522ea1cf725a6837f8c | 45 + ...90d4f0e1544ef5d5d2cd0b2e8965afd6636f325d32 | 1 + ...d74a63631bab28fc38cb9e5c6aff44f1223730f2a6 | 32 + ...5696873009023ad7965b86c1d3053f1f426ef3dcfa | 3 + ...f1e9216501ee8e8dddc697a5d108d214b60d1a3d6a | 5 + ...1eba23696d3637d2ea2fc004d2bd99b9f45ef0cef0 | 12 + ...b672374794a9218f5e562c32a2d35236a39cb31637 | 1 + ...7d75aae20a67421a64c8844daa725d9565afdc9ebe | 38 + ...9cef1d7d91ab9455dc18954d6f1df1647395dac089 | 1 + ...cc7ce390ade6d0a8b8cca6dfa38a948d7df91cc3fb | 43 + ...7179755b9cc6003c1a7695c11ab39afc8368368d1f | 64 + ...6d7eee1f80bea396e86c3b72e4c6f96c032abbc633 | 46 + ...980b99cb9d86b0f7b96994c4839e264042729f7d91 | 1 + ...ba837652624c77844bd8606c13817d01c5a03de80a | 584 + ...0ecd3e2ded8dd20b89380adfd3709045b8741202dc | 13 + ...d495c5dd9e2356f2931524d51d8caefda19c941e16 | 16 + ...3fcdde61cebb5334be44923c7a889dfb7e6cbc4fe7 | 27 + ...1a176bf25829004b4403a6a25e5f66dfbb455d2b72 | 33 + ...8aea4d644438f8e0e6425b3a1bf03d1a6f77402a1a | 562 + ...4aa87fb4b64e67accd5c3c44a7e67edf0409562808 | 47 + ...27f2d24267c891b9bafedd3b1f555f7a362fc7487f | 48 + ...668838815756db8e127f606d19272ea4d75e097560 | 16 + ...88062c7fe7fd32c263f17a97f7903b59a1604f86cc | 8 + ...752473f21afa14611ea8dce9f93619b-index.json | 1 + ...1857e0d14dda4c74fff8e40ae757065-index.json | 1 + ...3987cc05ce2cbf1316fcabb4624606ae713e8397e8 | 56 + ...c6f67db40f8daa470f038561882f40f9997bf2bd7f | 1 + ...fb38ffb5f2101248ae71595245d89fe11f11ae3c08 | 224 + ...0133b5400d5963d93cc82f27a873c9ac2882189561 | 1 + ...7356d88855e57e6753a17a595477b137bf5e3f7d74 | 1 + ...de983f8a63be74c4512d3b44ddf6efd93337e28079 | 3 + ...d87bb48a573ee0bdf70566e1fb618a21a35eca2f60 | 123 + ...35060b7bcfb330002a8b9da8c23d4f5d294edd0fdb | 1019 + ...e9a3b29dd408bbb05c2ad9c215f94ac3bfef77d2b1 | 16 + ...0f03db494c5cf472b914685e27f99b48b359dd752d | 20 + ...d28fdcab6288a4ca6eb30de4ea2842bdcd59d0193f | 26 + ...53660ec073e114ff2ba7d9ccfa653cb14211bfbd5f | 47 + ...b9157773b799b736bd63f5bf71d5e502ee6fb4a3a3 | 1 + ...02fee4d547725c528f12e6c1472eee9abd32e5f4f3 | 99 + ...cef63bd6b0926a4290fa1d396148839cb115b31288 | 24 + ...9087ee3b196e0df98e6410e7052e7846297e490554 | 42 + ...256edf9379e70f4bf8d106fb325329724e788-exec | 1757 + ...4e743a7c0000c4fb3ec14f7e0866eb65543b722324 | 71 + ...cdbdab9f8f01d7a7d811a3cfb8f43aa7c89899d07f | 49 + ...d9e212f8cad5fb5103e5aee330442533caee4d0994 | 631 + ...67e5d2a96a48704ffe169e142c46a83d6ea565d612 | 119 + ...6f710c794b30b1921b9882e34c2d182b0710e6c25d | 2556 + ...539e47f78efbdf3e7931af3aed3e036b7a5050a459 | 1 + ...6e692b1580b1b8cc2388f0b67a9d2fd-index.json | 1 + ...fe9542fa00af5ac221e412a16f9effa174f8dd2d57 | 135 + ...a2219fa057be5a68fe2a268abfa6fefb3cd5178fbe | 2 + ...4a8ddec648f2c1d5d032697a626e054dc01c9f9f4d | 226 + ...b6fa62c67a5abdcc0708bef83fa9e2e2a65819c788 | 77 + ...1a1f30181bbebf97fa7bae2cc392af27bb59f7289c | 55 + ...83c2f7c5889975b59b7a7b0b1c4b532-index.json | 1 + ...92a4b31b01399472cb7b48c4092a0ff8b57bd3be6e | 40 + ...6f2989250c7a3d84a333b52b6ca4cc762401d6c046 | 77 + ...53f24618429f68e2f6a2a16cc5fa1e27a448923b52 | 52 + ...96d629e8a1467030d019c35b498bbb9901e8485adf | 41 + ...0fef1d3b8d9bd343dd2485ca06e76b8cfc53e319ef | 925 + ...5e0a3692c7b76a0dcc7c81611d12adf22a3762a92b | 537 + ...189b9665b1bebbcc370a076327c2d7957aedcbcf21 | 47 + ...e7af00bec862ab6108f4274d89ef6cf505f6d-exec | 88 + ...ff754b54fa7e1839d132451fc9668f3e826be33ab7 | 45 + ...c24b24c37f0e88f6242700f6acb351f201064e18bb | 34 + ...52aecf7de6bfa6d2ddc5e6e8b1373d844f283acb04 | 30 + ...1b2f5c3fe61ae6275ca3e96427e538ad4988285ded | 1 + ...5693657a38cc5348c989515f531a855779627e235d | 12 + ...9f0bb7fe291e7837dca807432dada2e7840846f2f1 | 51 + ...53c8c74699de0a268602cd0c6ea36db2ec39675374 | 1 + ...d2ad73b91f85851643c468b2566ecdc-index.json | 1 + ...f4b4f575ab3cfb61a64c45dda2edddfd2e0a7b8702 | 3 + ...1e73df2d1a0d7186b528066c11358b2a06515e10f3 | 68 + ...21a6875a0fdf94f4ba94d39bbd878259d235e1d2de | 48 + ...915058661504b9bd4db167cf95c45a239397f25178 | 6166 ++ ...223e362b3b277fb98a714004ec29055225a49f91e5 | 30 + ...bf6ad7eb7ace77dc292865880cf3e65fb5542aea69 | 19 + ...7f4e078422605cea9f4adc6315952ca5e2898145fe | 19 + ...4abf11db0a2fb1eb2cf828be449d067668f8d809bf | 1 + ...65459a493c0c641cb964287d2999cc7c38af695fe8 | 1 + ...47c3c72a5b364f0c8d75b180e42be77383be06d1d6 | 3 + ...995b38bfe5f31cc1a36293d8a986bc8c38f1b4a531 | 1 + ...53e60b09f271bbcd21274ef67f0e25a94c16fa1ce1 | 20126 +++++ ...84c1183b1861ad639668c3d819c07b2c54c5f9d44d | 32 + ...4c6ffab669ce7fe5456f57d819efcfd0847b88011f | 17 + ...71bc6c629f0d227375efce9f1c98ad21fc033f84c6 | 3 + ...225fe24a1e708c805b554f1c68889696d5a1f119c7 | 69 + ...55219a3f6ab153f81725fbe12cb525e6338566f5a0 | 16 + ...8a2b1786e33a0d58ae23aeaf10d1d0a3969426ce41 | 28 + ...b41f385332a354b82aaf2a18fa16707-index.json | 1 + ...a9ff95c9ff6c7211229621e3767cdc9d13cf0f7393 | 1 + ...4f1eea5b42dfed2bde9a77e80622faa1a4b1ca0b13 | 35 + ...378b279296741f3c8e184909c661c19b6cda271a38 | 263 + ...789d237b3c19d19b0bf927236b25213b0e6715ba7e | 3 + ...30f5d5b586c5a35bba390b94ae43576cbead97fea6 | 43 + ...fc46a4cec44a8446952fbc88a47dd4bb1432621a6e | 2 + ...a87302ead6de70b729946700a26fa4b60aa3b0b307 | 172 + ...8c057f908cefa3fc1c791cbeec1c017cc5bb9159c6 | 288 + ...496230e1649a96ed5a6e9a2fbfdc11b79fe542f2ae | 85 + ...3307c26881de9cc9d0b675b9140a1b6c2537604d80 | 9 + ...0f78d03c40c871e3d950fcb0978c4f8120225046f5 | 40 + ...883056d34cdc22ec6072a6c7b67db65ec5ffcec59d | 77 + ...46101a7c58729597a77f554b42d2d39bf9a0481f99 | 256 + ...0e4f1a701014d0443703e62c658519322b91df2086 | 22 + ...0fc90f07be99f961449c617b69076813144bda815e | 15 + ...1662e0d9cbb8d21d5fefc2cfe3db3f32de109e29da | 352 + ...2e6502810512b4a6283996829d8387fe2303699e8c | 291 + ...04a82cf95ea59bffde41070e490ad635312f3b5830 | 55 + ...678f5697dd3ddb50466b3228667ba1d78b7fd3a391 | 1 + ...7786ea6394f43b89b816fe46836438bb8cd2954a1c | 3 + ...bd179e217196a10dc1a5c63867c429c85455ca0607 | 1 + ...732b0ecc07457a131adbfc3544b46f281e6f668e4a | 1 + ...1e9d36ed48f024724c11c4cc5d2e7509c77e879ee8 | 8 + ...059ad93e119fd5d8712a15428974c98cf2742a6495 | 91 + ...c6f06f2b8205570869c6697c6662b0b-index.json | 1 + ...d0122f28b4ba27b03bab38ba0e691efa8cd0588579 | 22 + ...4412ef3bd2632ea2d9f4fbd600ec82bcbdfa538e88 | 4 + ...d28e56e3983783a638ef54778cf66192ebf9162940 | 14 + ...3029a2199c80bb2fd81f0d1c0143f7f2b61e033d28 | 32 + ...560b0345371f56f2beb51e2d1840adebccb32e5841 | 55 + ...485d6d2da1be2055484a1de44229dfc1bcbbdaa1a8 | 1 + ...f218885fcdfe2b618ab1c1c386548e2932a14fb2f2 | 81 + ...e38053868a0b57c986651e219e7b8df9fa1d8023ce | 4 + ...f35f605c302909b8904b8d2dac26cc65a8afab7d79 | 22 + ...faaea30d3b81e9d642338e6a82223960b83dead9a8 | 69 + ...875259ce8fd364f14d1f71377fa027eda1cd41ba05 | 413 + ...63432a970ff7fad1089cd4037aa027c84a184609f1 | 16 + ...e4c7c2a3b53ea30751cf5e81c828c775eceeb836e1 | 29 + ...95c394e293cb79a9fb383123c95255c0d0d91767fc | 44 + ...3c0388af450f1a059518890c7bc727a498f8fa66d1 | 1 + ...2a25a2368e928d50224603029302333c2723752f69 | 45 + ...680bccd1fa1ccaa3925f958e3bf33cb31862a45c1a | 2675 + ...076878fed5994b4e1449d9ab9cff0d5-index.json | 1 + ...8293c77887e1d1ed5d7ec74cda809aff8b553e6035 | 87 + ...4a5cd75265e67d8df6c233bf1ae286dc2beebc42f8 | 3 + ...703ac8441c25fdbc8bf69354d42e42b2b563eab7e3 | 1 + ...e6d828cd8b174b64a18385115da1741af679937dce | 1 + ...ef480c0f8d5d8cab3a433656af0660d697ef8317dd | 39 + ...f2721b0734107e973055c80a85b0a9292e288c717e | 1 + ...b9366e57e3b8dd813830e93497dca2aae09a0163f6 | 65 + ...fd01bfdb4d71905d9a5c9481ebf3186f32a0b8d319 | 39 + ...799349390b979e36009dc0a15cb2d5866816ba9135 | 1 + ...31455e13808a4bce52f7e3641c294edfc05fc9ffbd | 33 + ...eaf26c9ee0661c1173b5a5f150e4ab91ee6ad999d2 | 31 + ...f93eecd00215369c3d4875dee9067985221809601a | 54 + ...7617b39f52ba80f67aced8c598569ba1f745d91115 | 24 + ...b55fb6394887904cffa2e4d483beffab83b5669313 | 208 + ...093df8370f67e2fc042fcde3b592ec282212502399 | 2 + ...68c8aca40f69276a433171bc42a813b270db413811 | 21 + ...30e732858af0081fa9937b5999c03eca45d0f1a25f | 94 + ...d10204a2c626a6a335157ce4547a48f-index.json | 1 + ...66895ec053fac40c76e8cd0b443ef819829c5651b5 | 131 + ...18913a2f0af2b312e8f2c9f2feae856ba88aede8a6 | 35 + ...8d4b43915f79f41e7eac62afb754691649d5ecacb5 | 1 + ...ee2dd833a57dcd0410c963de6573af9bebf3d5d502 | 162 + ...07a40abad79aafa099b27cc01b087f90eae4faaffb | 254 + ...0a2796213073fe6a0168c4746e1581aa1acd4e373e | 241 + ...c5a30229d05fecede02780a1e742a653563e2d4157 | 26 + ...c02c840b29164d0b76520b77adc18e20905ba5b072 | 68191 ++++++++++++++++ ...9375b52c1cd64f8d33be06d205f572f0f8574d6cbc | 71 + ...97160c5904ed9204fe96f8bac5757ab7100fe93871 | 266 + ...91aad3c58ff667cf4282a1deb1e7cd29801176c8b5 | 37 + ...a69d2792de78bb667da2683b26099e9eb1d89c9ea7 | 27 + ...d7b637d5b843846ca6b8f823db9e0ddd2710ececb9 | 5 + ...7894d8ed1cee408ad850b015c79350b144366e98ea | 52 + ...5c1084ed7a3b54fa0dd86f40d76ab042b1e49d0f3a | 19 + ...e76c55da3f64e827b89fcd7cfb9992427658b72bd7 | 43 + ...48a57e82820c7366d576be883ddf808516d6473832 | 16 + ...5ee9183922e1036a263a91cc90caa25c9cf4245cb3 | 196 + ...dacbf1b9041bcbc8cdcdd379ec71518c3008edf50d | 64 + ...fbd207b10e34ccaff37d6675d2b1230c5e9f88a507 | 26 + ...20106a3f446da6fe76813230ae881a960b40ac83f6 | 162 + ...73b1a9851dd4a4a35d5590b00d98084cb5c52647e2 | 21 + ...e8988a1da00dc8a99e926f618599b93f5896bda500 | 1 + ...39a0bbea8065bae19868fb4f2f4974fbb092c688c2 | 5 + ...57f487ff8042e2cdc238dd21445999b0e5857d7b7b | 43 + ...5ac1f8a25c9e7ccb75d9beeb480ae569c4a173a427 | 22 + ...e1e4460c830d6d82c1f2fcc0d7c78cfa2a1c047803 | 102 + ...8930002cf0a12ad1c3ab885a73d843bd087a7b6705 | 8 + ...5f8c0b33f35b40bd3cd835eb3dc6c239c13e8058f4 | 1 + ...c549324cac051b472a11d09786b83636717459cb18 | 108 + ...24362ac44bca0289d81a138f6c21b3c96495996c37 | 28 + ...a6f529b60fce8cad69ed4bf9f35a549c73fe71499d | 71 + ...74379a5c7d9a568c03a296aabb9b15ec87960e23ff | 14 + ...8a3bcea93be27b5bda79763a491cffe894d5b435a3 | 976 + ...fd593f523c087dd8e6956345b55a013923c75a50a2 | 43 + ...c5bda2521d1bcea4e3e00c8e46b980dd445f51d0e7 | 127 + ...ba9293549402e8c38286c98e51cc700e5d337c6748 | 37 + ...fd0cfc8d6563e7c1d0b86dab11d01b6038d0dd541c | 49 + ...86cff97c76c6ae869cf9a440f54738acccabd6748f | 37 + ...8cf9f4ce588a34043059b54da1c8f3ecb8e0dea681 | 29 + ...70a9a532c8ea5b3ca59fb27d70eb440e16ca91df9e | 240 + ...d17480758c11b8dedb93d9e74bbde6d896b87e2a1b | 5 + ...b409b48ba012dbcaee51a0bfe2af20499b11a48b0a | 128 + ...1ae791b82b214256917d5bd2dc576c5469d738ed88 | 40 + ...d3184306803a9dd4708f5d9f33cb08fbd68af58602 | 43 + ...59af7cc988c84559b5388519a7b530a5f5fea1b5b8 | 1614 + ...59b544acc8977e7f0b7a5b5ac63970a911568ad2a9 | 199 + ...071cfa67fe27bd97a0cc2ab1869a59c9a93dbf1b59 | 19 + ...1a283468c654fe5ba8d62cae1179de5ef6d4dc5f89 | 131 + ...92eff9f229551623c886c61b2d649ae4a1fd547065 | 42 + ...e349177c5e9b1f9e4583b7dd6933059dfd4a9dc789 | 1 + ...28320707a3ed6d129fedbea788b095345215677caa | 34 + ...bc3935c4a270c931b465e0684796a43cd5e9253ca2 | 63 + ...c13598cfdda70d024bb69b77edcd6aa5aba3841090 | 135 + ...8093afb24a258898dc656e957e716d8791dcf4a365 | 31 + ...a195ed262568f5a372533fb273f3bcea2c8be3ed3d | 1 + ...65c57adcf0c7915f1b43deafc3c6bb266afa25cb67 | 713 + ...c19eb9a553467bfe3b5375fe4df5ed2a441a29d8b3 | 19 + ...60972c8a3fe390c6820261fb19ac1566aa2239a5fc | 40 + ...bc2eb27fd9ce8f54133d0e473b1e7e5aa678ddab40 | 49 + ...0dd187dab0320d2f00515b541e0bb4053a824ab79b | 111 + ...2740b508c6b6486d53b78748c4aed0131ded1e6880 | 1 + ...a46ab1d44a7e76f6c2bfc8be12dbb9a-index.json | 1 + ...e9879a2d0db343819389b53e8fec2ce90eb8adc4f8 | 157 + ...c96ec2c37654f2c54104116a2e16435c2983e45d0b | 22 + ...3c380ef43e4c6225714503f408b037cc61846116c1 | 44 + ...0eba3a0cbc8b467089f7359cb62a505e4a5d56c46a | 71 + ...2bb6791b9ab3c43a4ab9173e7ebcca40ac16649600 | 322 + ...dd7a402ae79b42e7a25b3cced27b8fd17956115239 | 156 + ...32fb7e4cfa2d956d1ecdd6c76050c38f14c6538165 | 19 + ...caa060dcf1b0a4051b52006a10e5b649bf169905ca | 25 + ...e70ac44aaacf7c8e81e5b7caf1c4bde89c059a96cb | 9 + ...9396f6a97e2920163befd2054680970b183d89c1b6 | 13 + ...e4bcce6008bda286d124e6fb37f5aea621b9935477 | 1 + ...8ddc023f2e9c908bb5f6f3f3ead16a9ba9cf15e55c | 92 + ...7510011252a4ea192fef24e52064eb2-index.json | 1 + ...e926624ab1d72e923020e65a43894bb3fa52a93dc4 | 22 + ...a6afe8f4ac904bcfc44ab5b411ab60eb0890dabf1f | 43 + ...97b4ceea4c044d15d094d37adda279df44a7ffaa55 | 53 + ...dca46eb690a4d4f4cd49d5cf54a4507-index.json | 1 + ...5b31bcb7d9f89d9f6999bc4dbb465e5c195c94fd3a | 6 + ...09099f5b24d0a04f261a246709bbac5-index.json | 1 + ...c42d3a6489a9ed7707fc73cc205e2c389926688c2c | 55 + ...1d4abe4335c2f4e5b3d5f7e75af5489bf6041cbf95 | 56 + ...26128579761d0002f5209814b66b9474d2c5727275 | 1 + ...5d67ff9cb838df273ff1909de866405774a502e355 | 42 + ...86d21e1f4879a997761554962ee26f28ff1ec396b5 | 8 + ...ad7efa76f3df01893ee2c77b400f1a5a22a2891d1e | 30 + ...72e542c3be2ba9c8ed21065b110210d1438f244f59 | 50 + ...9583d62496a34745d0dd5e5fb94c92d6888e96ec5c | 14 + ...58e2c48fb350046f5321b0e319aa8fdebc6485ec0d | 16 + ...b4f276307db1b210028842e6abcbfe2d7426893be0 | 14 + ...0398b66b0610b2537e9a24d98cb199f6ba385f9d26 | 166 + ...4a5c9f415fa85a839901d842f6564f7418a7549dce | 24 + ...af42cc839a9a61c91167e9752e5f484a41a72d67db | 68 + ...2e51759e05ae431185ad478f751c4195f63ce422e9 | 4 + ...eb2dd606c913b529fed3f71168ccefcec8ac06899f | 94 + ...50b85cb8ecb83354c181a5c444dd0cf4f4a54b242c | 51 + ...a2da87d8a54709f4b73210a199b53d8bd423455fed | 23 + ...9ee809a567ecc768b91cde61fafbec90956bd04300 | 1 + ...22ddc3db62408177ee4459799e370a4c0f978a4eae | 79 + ...f2d6a638b5e8140a2adebfa0216b386fa18fa21521 | 28 + ...3f27067a3fb2c1b560f3e3658750d8444410a51ff8 | Bin 0 -> 2726936 bytes ...ae0175b7460721f98129bcea9390c9ec727215f267 | 10 + ...40aaa05a9196a36e1659522abf2539e0d40a3f2527 | 69 + ...a1f59bb1d7bcd415487e5a0572250a50c520ba6856 | 14 + ...fda1326874750d5ece5b98f71348126fd067a9ef9d | 25 + ...dd81d5f569058dff753a8bf597fb7e339e5b6fc233 | 27 + ...63348381356f02a61161e70a9fbd74676157b268b7 | 5 + ...ab2a0b8eb8c2f5735a26156a1d0bf7f452c0e6c87a | 32 + ...604bd3e3a7789a262bde862602da552118499fd167 | 46 + ...13291c4fc320dd17a652ff767a66fa5cd2af07bc54 | 24 + ...1295d1ff4bcbfc2b3db3f2571a7f724c067bb2e0be | 67 + ...86c5de47e803e81d8bd06f3bb455e12c2abe5ad011 | 16 + ...fa2458ab65c1ae53e9bf2d3f0e8dc878b4d44af02f | 1 + ...257e8a3bfd7fea1d9b92897c21f6a53e074f8d8f1a | 61 + ...10e063be4c816f244a6042e9e3f764cba8f01dfb35 | 224 + ...fbe5cc70e5f656b6fd91a7209e3682d1d0f77d8102 | 23 + ...cb50cbcbcec0ec188ae5f0d1694f681-index.json | 1 + ...ff9f3e87162c36f5b2e98f63cd31d1a-index.json | 1 + ...c911d2f28c95881d2c78a2bc88490a82dae9708ec0 | 30 + ...738837bf48188e780b749b699f2c3d2-index.json | 1 + ...b75fa54a4d92bb660a311d53d3158fb2fcc335e07b | 64 + ...253d3e99035770fba80ce978c2322d03fd9af00905 | 431 + ...020b1f4c338add4ec1adad272121212d0d95d8fb50 | 507 + ...5fb3a561c99343f667f25ad0bf3c198000cc06f9d2 | 2 + ...52c3285a31a4bec57b6d1f539316fc3d474b80df6c | 129 + ...8cd077f32028f4535da04b4e7da7964e89b4a5d131 | 13 + ...15fc8641a46a9bf1653703204d72e32eaa71a09d76 | 34 + ...57024113ae2d09016cb860504eb5a0235a76437a0c | 2 + ...7085b97578dd1f92421b36944d3c14ee09b133cccd | 51 + ...e75eef66bb5d946bfff108cb57a8b43e1d6fc38100 | 110 + ...4e61688500059c43d6dc53dc2d87682769bcbf4570 | 26 + ...78849628760b313f1a08ff55d622443ff26558a4a5 | 13 + ...ad3e1e4244db61a0f687ffac2921f07183509c32b8 | 19 + ...9073b205ed25859906cb867cca0190c6a919542e85 | 3 + ...befe5c2f8b537446c10f79c537f5215ff34c75c5a1 | 10 + ...30076e18d6d72075538088a64a90180a4b4143214d | 45 + ...4dba31b061fcaf47770fa73f97a1fc4c4f6e7702b4 | 14 + ...bc94a91206d4b40a74410cddbb9184a210a18e1b8d | 270 + ...8f2032dc1c34c0981388355bafebeee-index.json | 1 + ...71ac842870bd388dcc1e5b673696bc0cad868422d8 | 95 + ...64fe82965f07eb036d565d336009c1358fb1d4034b | 3 + ...9d177246c2b2ce1555ed0459c563657ca79757db5d | 746 + ...e3926dc2e6d767092433dfc030a9a48ff8cbb8b8ec | 3 + ...8cba1a81cac84f7991ff80fcf28c61319f1cd22675 | 1 + ...82c4c36db6de664059c7e8d21b52a5c39917689a2b | 1 + ...b83d981d9ca1ecc0ebe2dffb295bcd163f816add10 | 22 + ...ded7a72258ca63a24f1db9941a67fc8955bb3e6717 | 102 + ...a975d57a902229fcf59b744e0650d1970e67dad260 | 181 + ...c4fbe18cb17d49e76799daeb1aca45ac8b6f11ff2c | 57 + ...4852f804924e369672d8866ca89b84e61ea060df0b | 117 + ...9bc55ad73d3880687fa3e6e2d2d78704e8f85a00b0 | 79 + ...2765fa91c3251271bcdbd52a7712c40060b6862b51 | 164 + ...0d702ea4e4233166c61b6a62febe37e7880512ad99 | 47 + ...5f1771417f4dbe4b9c21fc866390fc8c4045fea85a | 1 + ...78e426b4df9406fd87c76757bfe136defe06368bc0 | 44 + ...9f79c9d134ef88315ec61537baade8e949b0008986 | 174 + ...88cfa2ef43e7821bdd7fbdcdb59ca1b5e9b91467af | 15 + ...61a1e2bfbd14f354ea9f1f731f748533cb21af5f8b | 12 + ...fb76b7e08c443bb564d2bbb50f3f1583e411df432a | 51 + ...a75250c42b930c155bf88b580a54c5312c4c4946c7 | 20 + ...bb6b6561d3c798313f4c0449f025fcab3d8dca2aeb | 16 + ...36e99331ecd487297dab7cc9c4e232906cc4a79078 | 36 + ...205859c7f33079d20e605e9a4b1fc23414d3f9d517 | 28 + ...cdc9ae0507d4b84f0bd47cdfc84b0c931742145373 | 3 + ...db5dcd2b4c3abdb227e1104c6beaf028b44e712857 | 14 + ...a440d3ac1d074fa7b05431401c9cd74ddbe1098bd3 | 70 + ...38a56497d5d533075061422cc07aca774c50ce0ecd | 1 + ...8b94211692e5545b7dc9520ed7e81c5-index.json | 1 + ...673eeb2ac643c49b06f72dacc788c611a7e5fa4865 | 22 + ...7969de9e20aca6d75591178bde93e5b738309084cd | 70 + ...32d0dcbcf6bbe6dafc1dd2a34a5abee768bd9a7c22 | 33 + ...6e8fa13a221c129c212ab221dc60ea4a1ea5847e0e | 1 + ...e48b22eff41f8e287b32028a54fb9318bc155e59d4 | 48 + ...e1999f1e2844f97ecd5aba9b9e1be776fa8ad9bd3b | 1 + ...21ad1294e8ede5c2df8288ffa330b85d6336625604 | 1 + ...1bc457402d73c202b348fd9493afd4c8701ca9d4ea | 320 + ...03c305fdd1e2bcbcf87f89c95f19482b9b05aa5edf | 12 + ...ff93f88d79e93ccad8913ce2b465334b7a672713e5 | 12 + ...efb03eea8e904981258bd98e1128ee4cd94cc13208 | 25 + ...77e0a1f1b6694a08265a6b3155ac4286654f5d5c27 | 16 + ...4e7fa6db1fdcf433a93b27aae478ba1b25ffde3477 | 80 + ...6ee6986e69abaad88fa082bbe4bf1d4efa4cdc2a40 | 1 + ...65fbc51e00162a3482d18608ebce346bd1868cfc3a | 214 + ...8e0d060468cd073490a8c7cfed47704b75df680e16 | 33 + ...6418c4770c26fa73a7a87ec2a810f0d0b9aa2c33d2 | 994 + ...a6ac1832a707b8b7dbaffb0dbf1de0a4cbfb09e9e9 | 5 + ...38d4263a55851b6209d8e8a7766e316b2d9a55f1fd | 281 + ...55fa5aafe7b4efafa7b4def6fd008c0e99cfc7a115 | 8 + ...a159de2eaeeeb746593452675fb6e54b3444f63976 | 47 + ...1a29dc143440ac814ebc55bd037ae318383f12d153 | 82 + ...9fac7530d57144f934eab0fa98e89c00c8f8dbf11c | 1 + ...436f8df300946924729d74e75f4d205b2894156cde | 417 + ...42ca98a5969d26976a8725dc31b95c773bd582461d | 96 + ...aa372fea3a3988e6c91e196b00476179eabc249a67 | 1 + ...f5eaeaa3cf000812bc54997d77de6d6f81b9a3c821 | 20 + ...f3a5f71ec75b1e3c6fb8415771546e9b3d63738cfd | 31 + ...ce09f282de4c1f23d2e7e1d24242a748808d163708 | 320 + ...6ee1a8de1568f13bfa7657fd99436f300ea2375c85 | 89 + ...14f3c7088577fc6a1c20adc6cd2e03c-index.json | 1 + ...345cd8f455a2db429764e79d3cd5aaafb1f82ff8d1 | 15 + ...2e69ba8b11b3bb967d41e841bd9e31f442ee9853be | 55 + ...088c6259f9c0fcc0f24b083478d8ad0bac5202790a | 1 + ...ed9961bccb773fe3b3d2e449f4f8c0f67e24d65939 | 9 + ...b46070539cd66fc659ddea2cb4397246b1ccc7745b | 15523 ++++ ...3a7499f426af82bc1c247f90f502208cfa78dfbf28 | 63 + ...50b1e112ab7a10b2adf0577f2d92cedd966b7e4db3 | 36 + ...817995859fe363064b8aff206d39ec44a35e80f77f | 13 + ...0340f579f0a268228ae736d5809658d676f75366d3 | 4 + ...a4eda447523366ebbce3cbdd10ce50e4ff2317d7b6 | 17 + ...6dc8618ba38618185a833b18dcc4ba7503712cff7d | 1 + ...e1f40cf59eca0625739fbeeb0f00d81a08cf2b13a4 | 33 + ...5c83fd9d520f563bce890306c10c7cb8a43ecacd50 | 39 + ...158c83d38faf0797a067a83de9f035397a1097acb0 | 1 + ...b07de0a716aeda163b725569a7c29d071936d2476d | 296 + ...2c72bfb1fbe9a2c818cbf17bd37188c51353eff57c | 1 + ...7cb631e900c34eaca37b4f1818ed771bae25db9e8f | 52 + ...80a106602dc288a637c7c04b0a2c1f36a5fdc5696d | 14 + ...66490ea7bc4d2c2506412db22f4388ddaeed0a2eab | 250 + ...4743d0fdaf48978285feb17cf0d495281db65a0931 | 1 + ...a6b15238ab96846cad9675c7a81015c69f6b900d83 | 14 + ...fcccfa928fd6a1b70b30bf69ca52aa727aa9a12f40 | 329 + ...030f51f9e53291d54a9611c60c4ab1d9649164a5fe | 1 + ...5d6c90655273ee4a7ad99b370ed8c1dd565164c219 | 1 + ...ccbc6bd71ea439224de3495f0918b3efda1400271e | 75 + ...e3dd2c94508aa397624671d394d11b2946dbe8c0ee | 242 + ...09f2ce447b4b0e98ac0893067aa70098140fc6a748 | 42 + ...9ee4e24f8966de1d9456e5e5832efc260329ad2c3b | 312 + ...e5f875efd0ec1bd23217dc21b534eedc082f70db27 | 12 + ...db031dfb65a85a26c24dcb7cbd11be350d64557a68 | 31 + ...33d3e3fa2e5d6a52f81fc38ef485b090838dedfdf3 | 121 + ...19f64a3355eb1629df8b082f22bdf1ef0c46cf703c | 17 + ...aad49af96d90945b7e10323ed65cc59660254bc550 | 21 + ...a750caf23c638a13025f8c8fb59f0be035ed7c3890 | 1 + ...c53e22e929296a930d8817ee0a879397a5bc49b646 | 102 + ...8da6d45ddc782d35aadd098cc20483a0a47df7029f | 17 + ...9319503ee7773c409d3462b68114deec82f4f67dee | 124 + ...c9ae790b4a67d0436fede86b5fe3cb78dc7e0f4c37 | 116 + ...76d257f80a7148af6586a7a4637634c34b8e6c901e | 20 + ...ba09f3bdf88922bb5f7fe60872a1449a149734efc2 | 230 + ...f054ab59bb70fb7082836204398912399a8616c2e5 | 1012 + ...645e9a6f876bacf07d623eef42898afb3e12e92af0 | 129 + ...82dc0a47ad61fd0cc74c633ce160b8cdbe70ea35a9 | 126 + ...93545dea468e0dc6367298a6c4866ee2bbce3b0f6e | 48 + ...7b1a4a99199f1638d09123c71506cd0462368de2a5 | 1 + ...46703b240ec1f8bf1773dfae97ef78edfe1db09445 | 36 + ...77abb068d07281a5a8e404c428ad16ac129b023e7c | 29 + ...3be83971df4c1d2df85004119c7c0c1842efcca7c5 | 3503 + ...963c585b818067feccdcea50b68120a024a21d7c59 | 1 + ...b45fc6084767041340d0685f61a2a38d8f9499990b | 4 + ...3579ae2a4373bfb627d8e8d13e5c6eebd273cc2f1c | 66 + ...45bd4d3ed34cb45e2b56f589cf613fcc8068bf8081 | 173 + ...bdda17141c58b88750a0d0dc5f290bfd92ba4c0829 | 21 + ...6ab57a04bf916b0c33f423e62d90f7fe98766da4b0 | 1 + ...942f644a6b4549da736626dfdbb84a601a446c86fd | 38 + ...3de66b5eb8d4d524d8acfe052951069bc2c58523fe | 97 + ...525706196b9b377c15a9a0cdd9dc04d350fb40309c | 51 + ...027c9de37cdaba26ef5eda7320e7a112175c2e3654 | 16 + ...ee3efd2187f8d5a38a15aa766c068c2af42d8e04a4 | 91 + ...29adcb021f42e29323596af402c9f5a826ad37ed5d | 10 + ...1b065e060779922eaa390c7f28dbf842eba97fbb9e | 62 + ...4794d4f799fe413ec512c683ee5506b-index.json | 1 + ...5895a003b651a61dd8b44bf1f6d15bad8b9d2a744a | 912 + ...ccc9f0e720c3765a2775f8d6cbdd3f8-index.json | 1 + ...98a8ea712ce3dfe09fe85ab446033e583dd0698e39 | 1 + ...dc3532f67a793321d31ade5ebad75e2-index.json | 1 + ...71ad4a7d291224d7bcf776fec90cc3dfb52682d69e | 161 + ...29c6896a5ae68b39232a1ad45d7d3554428da8cfc9 | 59 + ...03ae541e47d5d811b8d59b09c816e0059f0c6723fc | 89 + ...0e6a913bd14decc03cd09932730fb045461423c655 | 160 + ...48adb02b2f904d95a7a107476a54936d9953cad117 | 25 + ...f0363a5f65cd960bc51a40593aa7e0844994019347 | 220 + ...6df99b90faea2e72fc419f36f1b8737ac6aef777f9 | 37 + ...2e44f441fdb9da49dfd24ac5f5b3b4ba77a28b7ed9 | 272 + ...cb211f1c1eb65adb4b95852adc589019d36671c4d6 | 46 + ...2958c7066b7ba7c608a6428bc519c28b0d1c46df14 | 139 + ...de1c28f20507aab960761b971720af442f00398295 | 46 + ...4d5e6e256e17a8a3b3cb9dd4a6c8a8fd64a0958622 | 4 + ...26ad87a8612b4b071986bde042f35d479dbd6165ec | 13 + ...f61e2abfcbf3ac7bc04d6eed890d776f5ecf27a7a0 | 3 + ...1dd7076bc994672c2083da2d7c6aa99710b9a4f319 | 4 + ...f44b2c16a1d5764eef6b70a12f8ba538b9aab7e500 | 1 + ...f97f2939574cddffb5fd2d070750145b5a547be9bd | 245 + ...e5de8a50a2b5316073386fc410f48372addb029300 | 118 + ...3a2f1c3079464c0bb985da6c0b9ef4199ff0e4a92c | 21 + ...8a0484a5206bd867ad48a27746cd8c7d252cbe6664 | 74 + ...28eda0dc996ee1bba3437aff0cb8c73b25e68f0ef9 | 30 + ...4f3a8176d86210ded8064fa350bd4a810601036e97 | 147 + ...d9eab07b058e7557606f6f77d7462b067c7b1d4517 | 16 + ...c323bba17ea5847575d891b51c8dee0dd1466e471b | 560 + ...03ee2795c6572ce62e7e82928729c3a2346e042f85 | 28 + ...19e998e5fc481dd17b10bb70d3a38ddb2331dfe63a | 244 + ...06bc0776595ddb4158232db692a1de3281a25b45bc | 74 + ...06b48020f14e5d0189b62ae4886edb4230ebc2635b | 16 + ...33f0ab65573454bb1a1bf1343889b66-index.json | 1 + ...90ae7231d4cff8b76eb78302907d1dfc739648ca77 | 11 + ...618041f87fb246f10a7342df53da8a56e657e69846 | 2 + ...6b1054f12469863964cb4c20f27bf69acb617b2c5b | 25 + ...25ea65781e21dd19f5541447ba2dac43f8f514e6aa | 3 + ...0c05cb17461b495c93e687f2e065713-index.json | 1 + ...ad04afbeaa82c4ccb926aa77b4f2974eb6b6ec49a7 | 1 + ...5370ef23772a4f6ad1c274ee31db395711d6221991 | 224 + ...89c7dcc31719d71d8b3f464889056f343deae87739 | 16 + ...57d1cb6b6a184ed43919008a14dd7d9da7c3e22f34 | 70 + ...b3fca4828021210b247b8441fcd241a-index.json | 1 + ...02426f20242abef35d2ce6e2cff761d96a6ecbadc9 | 34 + ...b866f0403ebafb01b2d924f3647c17e781618961fb | 16 + ...29c8fc07bf6187f635935d1b68e08db00374808d1c | 5 + ...f0e9491a1b92db52b67e030a118fb611f87d20ac88 | 78 + ...a12811b0985312f75feee8545d870d9eef6a8b34c8 | 31 + ...8c695605044fdb3fb7a06e72b2d17595cd70a315c9 | 37 + ...6c17c6d7a7fda75753f95bd8b399c6ac65c40bf522 | 64 + ...fe0fc00e1a225c7fa83bdfda3b29d703164239642a | 54 + ...7e27bdb46685d5fd89a80a130a358c58f9d30ae261 | 18 + ...47721c76f64351330be252631bee71e5277aea7e5a | 3 + ...d4889103a9f12e08c61ca8526734ba95c2ea963fb2 | 49 + ...c4eb8a29b393cb297b5ee1758a31cd3f001a860b62 | 441 + ...2ba3d085516b72e16d784b2f49c4a2609f83e0c995 | 45 + ...fbe865d7b0fc4ce876d2366bf38960f7302966c460 | 67 + ...8f7c3f3542c4352d201e8e52e57ee7afa2d414e3d6 | 19 + ...2a2a6d8852e39de63cb03797d3384ce2bfc0e6a74c | 1 + ...4a6195cd39ff180a002037f45c87919e9010cfc340 | 1 + ...57315a4cc50dc3acaeade47831ea48d69ceeffb69b | 13 + ...92fa170cd0a10674359ae37548efc047b031393b53 | 728 + ...4cb9390804ede5f799a739bf73fe6976540cf92c8c | 35 + ...5befb69887d339bd68e1ca5f302b78202491481221 | 66 + ...a6e8f6c132b7fd824a4031aab2c25d8e5ab980f8f4 | 63 + ...7789f8d1842da5205e5fc8360aa57089393c3b9fe6 | 31 + ...87146f2758d7d78ae333571780b59f13a0eacb2a98 | 4 + ...62d1164631938a87c09f527e3ae57927e87545731a | 31 + ...17e3720f12c2df1e2e7c4bc3e6169c377ef522e974 | 1 + ...6c9c103f0b6a6062200d5a925e790de380ee78f0c2 | 182 + ...d3433cc28026c0d6026e2010a8ebe785ca08c403ea | 2651 + ...b3edf3ada4f15f445637b6c1981e133673cf3780b9 | 62 + ...d8a0caf634bc9a2bec1462b23d21699c921ecc53a1 | 42 + ...5d9e04b4e4e06c848bebd73981068b00f4b2c13c4c | 39 + ...a32e6f9fc574457b5869a2b228dd56babe42f62653 | 61 + ...779710c196c6fa40d42048e3449b15c84ca5c59cb4 | 33 + ...59e20cab63ed6680d1ed07083a251766c512ae4108 | 1 + ...ef37c486f8266c962989713dd6daeda-index.json | 1 + ...cbd146d8a94c1ec8244506e861dd448d1d0a886105 | 8 + ...7937d9b105cd42fadff47f4ca8f07041e0fd9aacaa | 45 + ...19c4092b389ef3fc8c03ad98d8436a0d12a889963e | 798 + ...5201cb4a93d7ad57043898cf93af32214c1a40649f | 313 + ...09d5cd1e2d3e9e150a69f0c75c54794b85fc748245 | 7 + ...3516167ca58692a0466d43feadd9852d010b968059 | 15 + ...c9a7fcffcc77e06b020946396ed112e-index.json | 1 + ...ca52c582bc87474d8ee0fd1cd72778f780df915039 | 106 + ...c5f43c4170fb0fc48134bf23bbde60ba0f4e3b495e | 12 + ...70f890a3e144f4028e8b29392a256b0af544db9b5e | 1 + ...573319b12474a4d8b81d63f0f6a8854f83e361d4d9 | 27 + ...f7c7e011e25811554a848523fed85f077dd9c792fa | 28 + ...47701bb19cc75fca03d24d5ad8df8649e16a35def0 | 19 + ...48788180702b9ba18e9cf08de9b5cc6f3be0cb47ab | 721 + ...be52ae9ef54ba0ac4dfc8de62c0d233-index.json | 1 + ...d7052de3150673240b19df398ffa3372e85db38204 | 627 + ...8cb969dfe942727421fd4b2cf8c35139f4d44add2a | 19 + ...a9d1dfbd1be5065f31543643db39f0a4e0e3e9f089 | 15 + ...2882e60ebeb73bc174d230d85e91fc572ea0a4ee14 | 82 + ...7062542cfb584cba1ac2ef6f47411934582ccafa77 | 1 + ...c569934539efecaf6b6e8390d1087a098c2e799b0d | 46 + ...ca16123f2ec4efe59d3819f3f46661318307b37d2d | 137 + ...7119b7e2389bf7a2e5b18baacf10588c604822298f | 25 + ...326b8324e4101a56679617429a821b3ff7345158a1 | 20 + ...5a5a73d28eb90b59f7cb482fae88fdd-index.json | 1 + ...e0073df5e851e4c11a641f36ec7218cc84606ecbec | 23 + ...23cf3cb55fe44f3b6b5ee3a2815b528ef53e8a7307 | 3 + ...ce0c39cdadba91808ee112f612b713675d827fd2fb | 1 + ...94ebf79c904b661cd077c7a7b7734bc-index.json | 1 + ...2d8b4a64feb2b3bd2265fc6e562012228fb15fa404 | 1 + ...5747a5990a5cf9f280feac234b07388c8136376ab9 | 29 + ...8b450e32cfb6edf7be4d723872118434499fb0d500 | 20 + ...cfe783c97551479854926e341a107de78b77f89ef5 | 86 + ...5f01ef7a45d8490fb5ac7464a5499c90d7dc274d70 | 46 + ...9e3e11e1bed1ffa6131ec9e5083e87b0bf00070124 | 17 + ...61409683041a38fd10f781010c056fda338955bb33 | 4 + ...dc317668b4963343a7e0a78f4e8f94ae0964de43ae | 10 + ...1ba9e92f51e1585eb134b8757a0d9b1dc5a71fcb18 | 28 + ...c8092f393cfd238613837312f246aeabec838e2f34 | 2 + ...86e8e6b123746f63f6739f82834c9d9d8abbfd8dbb | 1 + ...4362f039f27d5f14a4a4632f22c7ae9dc0caab1ddb | 64 + ...9b2c09f16fd113180fa32df194a4713559d2b1f231 | 1 + ...4255ac7836c1bb2db833c52baf873da7886dbfb70b | 1 + ...21ba262fc2a78399c5c13578a0beca27b9a2f4073a | 21 + ...59d786af10501bd84ba4ef3f1a8edb021156c67e80 | 84 + ...f56747ff8c06f71e34cfb46b4c8b0f42a79389bc21 | 28 + ...cac25c726b1afa17543edcb2a841182-index.json | 1 + ...accf6751d7562f9199071e1bfe91b533f065b454d2 | 12 + ...1ceca200d42807238a002fbf01b41c780b3eddbc88 | 47 + ...d0d4fb3446d2ababa556acb1e2f7ae48091ddbb50a | 15 + ...64a75727658604c30eff462629f8841-index.json | 1 + ...2d247b404ff9387bd90dd740599185a2fff6b46b1c | 1 + ...25ac344d4a813c186f0c78c83f31bfb4a9c0d092a9 | 1 + ...57ef7153859bf383c298ceb40afa5d5c627003a3d1 | 1 + ...56db18405e48036787d2ab53c40b072ebecdfdef41 | 26 + ...c91b6ba9f7203495a7aa6d6d039ed97f255522c6fd | 3 + ...5c92b4c0b69f1999576eadcf47a4e7823f5f58bd87 | 176 + ...395a7ec84acea36b616e91a097cf67ffaf7019ac1f | 30 + ...f1b04d1e5d3528ae519fb24fb487c670a3015c332a | 8 + ...cb5805601dd2aaad9871b214a50da2e92ec97038f2 | 3 + ...14062e0e670610df576294345a7a2cfcd94ba6693c | 1 + ...1ec2c614d8124b6b2f23d3fe333a4e3-index.json | 1 + ...1325b7d64d40be5cc238b82bc09d9040ee7d5cb0d1 | 85 + ...ac0e95f2a2fdd342e458cfe1253a5e636e3d7d5e4b | 4 + ...8b286b676ea1c373bd21c4025d71207aa49616726f | 7646 ++ ...1dc0e53b48e4613a3d5f7a1ab0f6146b548fcbadd4 | 44 + ...cb82ee42b6951a4377cc9c48668f3eea00d64afb5b | 138 + ...9acc28a696d3f699ff4f1a97cb3753deee9d13fc3f | 2599 + ...e6f27806447f1c51030bd7eac6681682ae9fa7d077 | 231 + ...ee5e417d603ebc1b9bc28888d657f6ff17f1e42341 | 15 + ...c7cddfce817549027ae58eba6de0921e2040fa0a2c | 1 + ...a03c26042ff9c4022495a5d3a3d655f-index.json | 1 + ...fb8a678dc54965e3c6f3886f9349870-index.json | 1 + ...bcfb31449d2a2387210939e3fea0212afa0f4fddfe | 36 + ...245fe24a185062705f992169244bf0be55e9b800fe | 14 + ...96a828e82c19969f2a964cc6f6ea77fb27321b2d8c | 3 + ...8da73186332497a82c5cca9495c1fb79a0c5381721 | 145 + ...cd870cab40c8307979cbd3a3a07a9a088396404ec5 | 12 + ...e9d4f4e191a3d1c31302bdc9743eeaa3cb463b07d9 | 3 + ...7b18a1467af3f042829fccd6f94e6b69171098eded | 93 + ...c410fe6655c0d887325bd02b50678149501309dc0a | 207 + ...1d8dccc924e776cf460752cee7fb677f6524ee0569 | 47 + ...6754dd24f589bbeebc36bf5431fd9a1784c490190b | 3 + ...dff2827ea3135e38ede478e1fbbb966ebda5f73bb4 | 32 + ...b4979823a5441bc08497579768e0ef946eab342b6b | 706 + ...499e99de6420e7b77b8d3a238190ccb-index.json | 1 + ...69cffd5302f45dd3be3e30af90c09888fd23c5cc37 | 38 + ...d7631feba58b9382f25cade2ba16c41b92dc9c9340 | 1 + ...c9b57473373d7543082366fb1cbbfe07dbf26cb712 | 132 + ...e6b48376eeb6225b996c47e27fe8265993c58cbf69 | 1 + ...c664d98cef5f89d30f443e512773210d2b1bbc9186 | 167 + ...091dec0bae006b7de7a1e86e10143b710dcb84e380 | 3 + ...ceb69fc6bef3acaa67cca75397a6ff7d7803a93cc0 | 19 + ...51a8611018a15cf4b01c442d47abba9b056e7d8660 | 72 + ...73a420772d6f68340371e045b5aff31ec782660121 | 320 + ...1985f9fe7bb7345184f0e19653c268edd8f0e2aaf5 | 24 + ...bb156e2f2fa3ac0e0a07b6660b1b0eccf9d9d02899 | 40 + ...baf7ebd43c95a167936da595b31c0ee6f5755b48d6 | 22 + ...23d57e6840af8e33e8a0e4d2022b59d0998ce6069e | 3 + ...4f7013a648b9836a4dfe58784a3918df16137a762a | 39 + ...26cb90ec8aacbe37fec4b9cb7cb2adf91cd39bc05f | 48 + ...fb48f41b58c3e469a16febf9795189c7ce4f55dcda | 94 + ...1fe1bd578f30c1a2c3c874dd195f50181fdbd54924 | 21 + ...795c92eac6484bd86aaf458b323653fed24150debb | 22 + ...6793b750e2d445f7510c743031fb3bf13d94441b42 | 50 + ...e624c528654561a3c038a905a4d0bf1eecd36bc137 | 23 + ...8d9ef46a0c1946e68ff9c7891fb54de1cb428af170 | 258 + ...bd5cdbca6ac3e68050efb4f50c4f06337c32c84a84 | 9 + ...5b45ea4a8739dab7533ceee7270cacc217804e73d8 | 1 + ...5c58b3c885bb29b2efec3d24c9b097897e577cec88 | 1 + ...0c2d1cbf33450cd83f708b7fde200e532861a83bc1 | 11 + ...e040cc44edbe6381bde4dbec8b045ffe56882afa7c | 126 + ...2434a48885434ebca264da6c915f35027c4ffce177 | 4 + ...a7f5ed28af6cdae0204e18c60f546bf0888e6673c9 | 5 + ...9e0f2f76ed4638cbae4b8c5057578d6cbc265d1181 | 28 + ...b5a6b2dcb3dc84dca68f607dbfbaec70e5a8b7dc5e | 1 + ...25746f34f0359e6c478190055ac69d8c73aea42ebf | 54 + ...1fd501d5e5498c19eb4640e6fe13c8d8c4e97f2f16 | 26 + ...eb1b23c4868b5d703bebe3d126ea8c78cdf1b6db43 | 1 + ...a943ed63c26d37a2ac1b8d4522827253b9f1b728eb | 488 + ...fcf803f5a08781de3d80c5e3aaf8fe63c89d11a7c0 | 1 + ...61ee95486a2126f207d1b00c644034b37284fd42d5 | 239 + ...6bac405c3eb38fb7794a4486952b0150466f7b59e2 | 43 + ...d2f4cddb954c6f1fb629bc47d887cd1cf9059566b0 | 609 + ...b0a908d9b4efab3c82d9dafcae8f30e0dbe7a0a4ec | 1 + ...12d2c6924c37d0839b5f0cf432dfa71fe6038499e4 | 6 + ...3cdc539b248115235d2c29304c8bc7c4f289b8b515 | 19 + ...ab5b070f3dd57a5f6dcda8f2486c797be86956bc8a | 15 + ...8fe76ac0096389b92348a39f80f4606105f10ab38a | 148 + ...42bb2bb7b2eb67c0b47c5d5e6e132e770a16b6a016 | 11 + ...2ff1bfd08853f5b55c3e9e1c47d2d1cf93a8622c7e | 38 + ...f245ff608ef1c0e2c85d61aba6b7b3e2c80e5df14f | 19 + ...6170db66305ddd826d72ddf154ba78a49daefdd00a | 490 + ...527e7412acf4e4cb2c89e869edaf0daddbaa98605e | 33 + ...eeea0e42a6bcbfb2661880dd058628604660551e02 | 19 + ...b990259f7e6423786530d0a05abc2bd42e20a0ce33 | 371 + ...5d8fbc656536fc7d7309fa488c365aeeb0cc820885 | 1 + ...1c1a0bee3fdc5eae78e6e348294e6f1ea249d96384 | 3 + ...5d61a79593bba7d63b14dc9ef36e1fd1eec1ef04e4 | 176 + ...0c53d541a4c6a8fff94577180ba50f31fe330d8513 | 2 + ...3298d6a3b815e16d1ff7704536858be344f26aea46 | 1 + ...30dff96dc8aede235bc456dc008a215238540d9ac9 | 853 + ...2d255d592ed12fd10bd9d79a290179e2178896a5bf | 29 + ...d307aea43c870d921af33f2f3debfe1d64b8e42ccf | 20 + ...7cc95adf1b0e4a6f2ee4fa36c39f098d96d4ecdc2e | 156 + ...043643887871975f35d7341561607003c95fe6dc20 | 56 + ...25ee745a69f1c030bd50c8907661c5f09538be32c1 | 209 + ...c91a30ba956f2f175e79a2cf68842cd3d49a4de4cf | 274 + ...399552265dafba4ea128c65b80ddc36d920b279994 | 17 + ...24f7f05d44dcc632bed8424c904f89848054b740f9 | 5 + ...d4cac855bf0cfd2d2f6107412020a39870946a42b2 | 1 + ...ec10b275d1c4fa433db2ea0f5396ce2-index.json | 1 + ...3b971e5235b67ca4d9c660009f1d4c5e7015f7fbd3 | 63 + ...8c0d20a9c25243b83cb9a413fbae414170c3c08199 | 1 + ...99577d17fed7ce7386a229cd71ddb03ce29ea39e38 | 148 + ...642442366dda033bbb0ca3dfee9904c33dce758bfc | 29 + ...121a0a469c65c7a086439f89b22eb7f9d531cad15d | 3 + ...374245286f8b4f5ead33320e0e72f1f2c150163c0d | 18 + ...04e88e51b7a220677c4c85f18541751f43d8e509c2 | 1 + ...563d9c63f5957c884c22ce03d896956f76c74ba7f3 | 22 + ...e376534e69c615f39ee9600e745a8abf7206ce031a | 30 + ...25803c37b9b098edc748f09eb6dc3f84b8dcc28f9b | 35 + ...d5ffde426ecb4355d07fa87ab6ad0f77c8e3e7186f | 144 + ...02b565d33b1c2df184ef040a77aba99c4b4da7f7bb | 27 + ...d0952fbd166296fe10f58b7205747b565970f54479 | 60 + ...444e361d792efd2a304178a12545fadff261815a51 | 33 + ...5d4c0371426227836dea274bfc8aaf357f6c2796bc | 83 + ...023415d4f5ffd7764a490748bd6503ea78e718c571 | 85 + ...e969093663de1216b9e8e7bd50fff6094ede1309c8 | 2 + ...e632f9388d3c1910851670a2742bdd8b30f3c62b7d | 21 + ...ef7999040acce71e0bc12ca7af613894d277ed6bc2 | 3 + ...4ac3fc99625f2bcd00ae187a5ff37e775ecd0c450f | 30 + ...62b690abf2b3bae4bf0f4bfa39cbb242914a4f2067 | 728 + ...6f20d88a8fdfffca21acb6ae41ca4824bdf95c96e4 | 23 + ...f93a679e65f2ffca6308d449953eec96e314a895c7 | 146 + ...44189b6620617d2f0bcbc9001c0268c0cc3b935f71 | 11 + ...d85cc2a9b96a79a069236852e78dac2-index.json | 1 + ...71d8e41ca686029c8117b0b9a51d5d192aac24b262 | 6 + ...73dbe396775be3237d694b3eaf27002fa0a68243e5 | 124 + ...92dc4c7b8b2d83358e8c275eb431b1e2591347fab2 | 55 + ...f52f7b0dc0c8a173c1dc3e0490da4352f94d259c2b | 26 + ...cdd13e9a907a16a87c5ba087dc1de722e1f7e68012 | 244 + ...8605986bc5519ef15c2410843a749163e404cff4e2 | 81 + ...950c22a8ce148ba6996bf8f93cf735d98f84c3f81f | 154 + ...6ad1ae8b8a1537d826189dae05215f90fcd2d29425 | 45 + ...e61b506996615c52ccf7471ef63dcf54788b63a426 | 1 + ...1f61a0c563571f3444976ca6160c238923f7253053 | 573 + ...06a337c9dedc7c4eb22ea38b6f2263e4fa5d2191c2 | 4 + ...f6b16126791eac414ca385d62a0c253c95747359c2 | 454 + ...2056b13fa3ca6d7dc69b2ede73c917c92b84d9f2b0 | 364 + ...7bb24006451821c44a36d99d04cafab72c83503b11 | 21 + ...688f51662279e47fd9db4a220da3d3b0780450c7c1 | 14 + ...88785e3cd87e04d78e2af9e08604db1aa8e251f97d | 25 + ...1a1b8f88f202492f4241bd34cb3bda8-index.json | 1 + ...e4acb02f046ce3c5dea138ead8ac3d9061a6d87126 | 1 + ...153405121db9edacc2ef2bfead3bb8e81c879a372b | 14 + ...f451f94087b4d2767dcab695dd5ecb13a1b7956396 | 40 + ...be66ae0841ddf023687bda005490bc8e6af88fc1ad | 17 + ...078f7862081e3af10de8738984b63eace2419c7fab | 82 + ...e1bffd65132b03a32a3f100e1b248e0ef9d7cf7bbd | 21 + ...8878c660e13c8f4ca278ce61932431f577fc8cc28f | 102 + ...a5197bc8c51fbdfd60a31c862753d25720305ab54a | 3 + ...c53a63ce5dda98208e8b724eb118f6ef30c75eb3b7 | 10 + ...77cb769f70a223a120e9dc4ffffb9a1faf1d90211d | 54 + ...35838efc52da6d2b8ebc1b1cd400470-index.json | 1 + ...6be4b1429776342e2dc26ff565273e5268fd63521d | 234 + ...6d3eaf39b1858b80f23fc02632696020ade7db70db | 46 + ...f36f7f7151089e6f2c82eda1b5cf3e6acbfe5652cf | 5 + ...1e1f43b889f199acd96bb800b2fa7297bf1866fd6a | 1 + ...e6edf48084b30116b0f3e951963124577ced042109 | 10 + ...2fb26277adea41eb85d1208412442f628564e41e4e | 14 + ...f1a7f248478e1f0911ea782a34beed44e4e96b5668 | 80 + ...01d1832c16e7fe468f8f39957f86ee7e8df8b5db1a | 11 + ...8309eb6d8207c042ce705a211866717695b6d6d1be | 56 + ...3ff70e1b2b5361e4355791f3d67d321aa397ea0434 | 3 + ...b4a4177b8d8ddf665e86a657fb87b47aaeceb31f66 | 96 + ...1b59283f76e0f7f15da644de969a3fbe407ea89921 | 3 + ...3066104fb6122d3defa112bae14273b590f46d6d9e | 22 + ...199d2a16ea4d2d7b810ff25131d28af897d0d130eb | 148 + ...cb3525c2d7f1c51e2a5cd79f30f3ebec642cfcc6df | 39 + ...0e4ab35ef67c81a70f0b0a03ff59d269ac2b8de1ce | 145 + ...39be4be94edd479feaa2f722be9d144438d86125de | 1554 + ...1a1d6c2c8cae0787c713d2b4d6db27adf531d23e44 | 4 + ...67a5986f60af35b41de4d5f8756041bacce2e2389a | 20 + ...c5687afa1639eb3afe5a0838a20624cfd85bec0b94 | 22 + ...4d9b383cf53f8ee789a6cb33c023c0250a81a52d71 | 28 + ...d9ac29b86676bd8901e6e5c11ec4e02-index.json | 1 + ...bfe2479b22171baaa2b0e46c441eee17deab8cadd4 | 16 + ...8ac5204648cc1631f868c2a64b0bd0415977924999 | 346 + ...2f09c2677f30be1a4c8f63f656013e1c598b75b476 | 98 + ...3accdc32ff6ad49ef42e18534fb52047f114ec924d | 44 + ...cd927fa1bf1859d2b11f6c83c8dcb0f8e83b61bcd3 | 1 + ...3468f34d96019ed75bed2784e92a003dc0879d74ab | 6 + ...a64e3974fd23ab6f35991295fda0fb54314c618d34 | 344 + ...299563a23332f51446cbe89306f64f62a899db0998 | 506 + ...7c533522d40c2c68436a6f5859688c1dbde13f2957 | 95 + ...79e131bb78560d2611b6b1394b6fdba5f0a3c22e0c | 28 + ...436c88966a1052ca377fdbd64b3b2a97bc1c9df92d | 16 + ...b7e6fbd4b4ff5edbf580b7f6cd7f5aa51bfc8ccf95 | 111 + ...7efc5fc00c8e3f2c971ef5e6db73268c398b8a2e08 | 8 + ...a605665077a327a2373ca6e6326d1a01780390d692 | 3 + ...db7ad63325dd954ecc879f6a5d4475011909abb9ec | Bin 0 -> 2702528 bytes ...340aefa360f1d4271cb9fc0ac18bb30b33022dfbd4 | 16 + ...8b880dd0bd676999dd74612bbbabe696a9907cb0d0 | 90 + ...fdc6e03b19d1ead897d8044f044c574d7e32eba2fd | 7 + ...1185432a0b4c28c56feab5b9b8d1a1f100453bee63 | 81 + ...b8a025fc6c77475b30f607733b925cde392da40a7c | 368 + ...a2052e9fd9d60a816d2ebde7c1411fbe96b726ae71 | 17 + ...6f9973125ad3b3bab2693c3e0168951-index.json | 1 + ...7af1f31c128b3e8fc36755d2ad64739f733987815e | 12 + ...c8e33d566d760f9b2955ec2142a6676f955e6b1c51 | 1 + ...586e4c26bf500444f4f4becfca918a36de7013fad6 | 24 + ...4c49ddd00000c885ca0343b294f8f953a7ba6f69e9 | 1 + ...0045def91ec4cf7cef4b63bc0e98e96956717f815f | 13 + ...122cab42ddc7d807edac60dcaad9591928dd6b701e | 68 + ...25c07dcc86ab445e21659cb981a26c687adecaf9e2 | 23 + ...1ef9edf15cad4dd56354e90fe485384f76490e0928 | 19 + ...1b7d03d9791a588a20b772e1591aa66ae0dfaaccb6 | 289 + ...3f0330465fea1f0751f186bf73d0bae6b917bc7b18 | 29 + ...2a5190a8d315b982454a40980f49f92936875cdd5c | 728 + ...5cfb890a7f33d68382137f0727fb5edb88a2472bf1 | 16 + ...7a3d723cca39205f78f419d86a6c8debbf94c3c7fc | 3 + ...f2d62d8b5d31759aceafbceaed80782d029522772e | 60 + ...b79375cae2109ae9617cc31cfb3afb9a8bc43a361b | 10 + ...84a6cd338a031b55e0fd845054ef192f734b1f35f6 | 147 + ...073ae477eee8c47f6c346e7baaa407d646bf2301bd | 97 + ...477100d83fd1d27188fc57ccaad101a359b9c5243d | 46 + ...c3299d5f41eda84092e4b6215d46af1e46d72cd056 | 18 + ...363ca700da60f7f7d27d81c80ad1ea425dab8525db | 186 + ...25aa22f4c232618013cc75683c31cf2c5603dc9eef | 14 + ...4d1dd5f17d4768844831ccf586c36ea074be3c76ef | 1 + ...9247f32caa3b43faced540c3dae00039d2e64b4f5e | 354 + ...c86aa172f45cc2fd6b67e03c83e3fb15bd48ab2198 | 1 + ...80b6561df4deb3d1da9e2481995a5292171d0c7a40 | 4 + ...97b55be1a4c0e468b6632a476b1d439d9ff65a7d8e | 50 + ...e99aa44038a97d07ad3191db43f49d7f46134da786 | 3 + ...e932cd1ef6e672a634f0cd93c27ff73-index.json | 1 + ...8bb91b841d8cd4b9a49d928a6cf0736b22f383c376 | 20 + ...7a63ab6d1bb5930c0f4d095f9ec28072b06c2727a1 | 18 + ...002e585f9436b13fafaec344028a196f40d085ba7a | 31 + ...9584a055e452ae5cf8e661ceb24d045-index.json | 1 + ...b86b3de7d814be7ab6f2e62a49760ae-index.json | 1 + ...0919b7b1e1f667daaa935e4d12f374e311ec61d625 | 75 + ...a0bcd326ee7999b0d2a9c7cd009220a4fc597c7964 | 70 + ...999043c0a02a28104ea2bd90eec53ddbafa99e45c3 | 11 + ...aa2f50f2eba3f790ebf0d206923095cdf3da2d845e | 578 + ...2a8eafd5b8b0301464c93d6c351e2568916e16f41a | 5 + ...b7d4311242cef8739e185be7dad8f7df366172df6a | 561 + ...5503003b28856656264c8dd27df22b60f598074f39 | 1 + ...c8668be10ce21f0d8219158253643e49d8a24aa794 | 89 + ...4eb76929fbbcd0ef479092f0c0e0c134b84417921f | 126 + ...ebd72e8b13abb804113a1ae1d782c3c7e4cc7d2ab6 | 19 + ...6a78394c4e0ae1c9e8030a8e4829ce21a65cff966a | 10 + ...6f8d9ccaebced7f2e2d35a962254aff54ccab88d3d | 180 + ...c8cee01f7a27a2e40551ec21deb3af3e4b9a15271a | 4 + ...d78aaded976baa75709466895f9198df46cf17a6f1 | 8 + ...bc581a4c5b17dd51d459191f09848cecc17c2019a2 | 32 + ...e14754b4d645adc68fbc5e46ab2cbe35aa4836b775 | 860 + ...f5f16c45a6ee9b43d48752592771884e2c1b876f47 | 108 + ...763ead45044e0d3c8d321e5c5a0a4a9c2be3f72662 | 12 + ...0c0aefde6b166f929eb856c42174689daba932aae0 | 24 + ...938c3d25f2e86a393db3115bfb626e3dd93e1eb150 | 8 + ...74238806aa4b28870e0ff79f35e81af6e28affdb8d | 139 + ...eca0a094ab98a412612c5d9a417c694cb2598d69bd | 9 + ...8e5b447d61d68011a4d65ba453b84162e48501eee4 | 12 + ...174275879914690dcfc755c4327c0af2173633af0e | 47 + ...5b9fe91ca7c98461339b6db0b49f9ce26a95275ae3 | 43 + ...7ef825689ce85b28c3224f0f5c9c6e48fc33e75168 | 18 + ...4ba83a720e662e025a961e1d13873b2bd58862afe0 | 577 + ...01e7856e2f5e9e65a9ffddc7f2989e19601e6522d2 | 43 + ...be038ef6d836b4c992db9af9c34d8bacbe3ef5bffd | 251 + ...71d3d758ebe5f2f71e287b919b83a29e93b636dbfb | 36 + ...671a24a7c7595a8b36d63e8fdbd88c80ab0f29d317 | 38 + ...52cff3dd5ff0e049aaeb1a84aadca2e954b97a0b84 | 331 + ...70c378ab7620349ea6d4198f3e5817a7fd4153c1c7 | 150 + ...26dcfe36b875211eb6062123970cece9b0668f0695 | 31 + ...b4abef155d56b2bf9a5d59a78c5b8b998615fbff92 | 1 + ...6d0ead4362625487bcdf348a3e6b0e3601d0f190d3 | 25 + ...3f45b4b232e92a7594ab3060e3b1762d56b39e6ecc | 6 + ...799fe529dd6da4f6e171cf2b7e9ec9877d19d50e91 | 1 + ...c1ffd97a9541a8cced801da9d55aa1056697c39d04 | 66 + ...0a5a6f9278ce6ae3fbac6a2fff7411cb231e991188 | 12 + ...7975112453dfcd0184dd70993b268763b9aad35a96 | 74 + ...22d1e9318c8b6ce8bfebad9ab973119-index.json | 1 + ...05810b8312156799564302e28eb8017a170b57494f | 2 + ...f5ef3652388d35232a7e8c87f56a1f54915efc4f27 | 48 + ...c2c0533c321ba6d4b8bf2e71cef81fbca8b771b2d1 | 323 + ...f9bfaacd2e33fbd1a70239c3ecaa8fb94b1b6796e2 | 77 + ...70a5d1b4e4e2a6fa60ecb0cf711e123599f6cf5a92 | 115 + ...9e1b9b5cf5fa79fa14436b6f7043a1efdcd085bc68 | 1 + ...03b4e021013acb18224ef0a0fb07a13adaa367142a | 1 + ...d9659952ebadfbb5e81a856d321c81675cafb29895 | 1 + ...7a459219845c7a2f990b6dd13f4ba5b3bf5cd80472 | 15 + ...71555259173f289ec7401a1f34be31d3ca00658b99 | 86 + ...17888382d82b357c300817edb000da29bcb4219068 | 38 + ...a9e4c31e09c45a688a3b054abc57f549c030565371 | 138 + ...933eb57289fee6a673d4fa03be00e9ae8ce88bef81 | 150 + ...c037aef3ac7e204d0a2f598cbc355314bc84e38d3d | 163 + ...31141a6ffe997535ab397743988541c85f9033c437 | 50 + ...98fb95488bd6feea2be03bc80d9a0c3a813ad1a447 | 1 + ...507ef015dafa3401146973807a82f30a7a0b567b79 | 28 + ...747b6a77b57037c0ebe1c0b464ffd2a759c7cdcdba | 50 + ...7cf017709d295ebb671153c74ef89a5eff4ba8d707 | 25 + ...85a7a72ff41c83bac5f06996e0cd979e1d65a93713 | 24 + ...bcbf74b6755b0ea91b64c5db2df4dd613774d1b16f | 6 + ...2a5e2bda51a9299f159019ba72c1b05-index.json | 1 + ...40a10a4eb6b32ef7fab6334cf4e456e4eb6871b0c8 | 97 + ...5e4be6e88683286674dddddc4eee794d63e50405cb | 119 + ...f70e971e9c5fb3cb8e336a3a239b1cc1136f614a00 | 4 + ...e1ccf3ee03c48a6643fd97beedb790a1a93d2314df | 396 + ...8bbdb71d0fefc80c506631145899d37e0fb0c3d114 | 3 + ...dfce069581a02fd9690d8a4d41c68a0d842962aaf2 | 75 + ...799b23d18ff79ed009ce7cd88d91e2195ad3c3dca2 | 6 + ...b736d105d7c0f3339a4b7589f131b645f0d4e1afe9 | 623 + ...7afc05f7d1180a3a936e8bf924dd4e485a682253dd | 103 + ...546144f462b0962580ae6ba07da23892273719d262 | 43 + ...b191537073ed374953fb682756ad394-index.json | 1 + ...757b8370e5ea6f5cc72509241aea2bdb10f9d4888c | 1 + ...d1c1f7dee0d0fba0d58e2550bfd905d4a2ce96b758 | 22 + ...34157514e43eb39c71b5380c779784d46bbceb966a | 1 + ...c4b90253d22f8cd77e62f1e7b763ab9e1b481bb169 | 27 + ...123d2cdd1432a0f1be95395d68874bdf9677b51681 | 8 + ...f2b336163b8171c6ccbe669ed6f93e68740593854c | 147 + ...6c529a62b1a52a0384ee1110a682026fbf82fc4214 | 354 + ...7ea6c1854fd305d441f689ff31aa6cca1abd7f219f | 53 + ...1aaa93ffca2c71f94d38463782831d37fd0935c180 | 1 + ...4024619ab0c0a8bee4c316e16d6d411c55074a2221 | 213 + ...a9a80ac621b443f2f71cfd4a3a89c1d64b90950fb9 | 1 + ...b8f14911d70e636241173b6a454298e9ef16a031cf | 328 + ...6782dd9314cc2b4e0ccdc150563eeacfe69e50b95c | 357 + ...55a1db3d2dd9970e843033ee5034a9031d1ce9da40 | 120 + ...7db7ddd1a5a7c713755df88cda955aa7717b094ab8 | 29 + ...e74f24373d969e1a8c879086aea563ff0b03b2a76e | 36 + ...afe9fd9c53e721ce96eeb961bb3072204975c1ec8d | 1 + ...cd7bcb2fc32817c8179c356289d02485cf7936dadd | 45 + ...6065c7013c6d8b10a9c244f7cd182b6334c7a37db5 | 1 + ...cd20832aef35a47e30407cb499ef03512b8d463ca9 | 36 + ...0f14c73698a502e07fcf1cbf6e669df64f685791d1 | 74 + ...0beb764fce120d95b5a791418e16df9afd6691b064 | 24 + ...9f00a68c66463a7ab95bd5e52f17516308bffccfc9 | 44 + ...7aba5cbcfbb11b32d363c8c5f762fdf4da83d15f4d | 64 + ...faf6de2e926ea187d96c610ec61c228-index.json | 1 + ...3f51260b71b06b0bc77c00bcf78bc41a25468a02ea | 6 + ...f5792383f038d7b738d4ea1f90727c01a9f7763191 | 85 + ...17609b6aca1424b42fd7caabef6b81d799d87a3dfb | 232 + ...0032db84bdee072454ff69b5594e24f041e33263ce | 60 + ...266029862c6a36908df005983d43d478c46b2a47e3 | 7 + ...1c6bfb158ea1bbef581b72831bb588a217ef359ca8 | 77 + ...78079430d508ef5fe65af3f1dc591bb5d9f1153fe3 | 61 + ...9b293c96bddde01d7f7b010ad6f67b717cbcc5f39f | 2115 + ...b8c2161e5f58dfd1369520816a4f1458d379c9fc1a | 104 + ...d884539a0fd1a4551630d36f947e653c66017d74be | 23 + ...ca3b1a84737b9395c79a3c1edbe02090fd29564fd4 | 1 + ...83ccb3c1ee7fccf057fec5654bda0a78c89a40b3be | 46 + ...19dd055718b210e11a9e2724810ebdcb6e116a1c8c | 57 + ...d7045aff7610e299fba8f6c338c8a1cc5201fee7e4 | 108 + ...cac5525a1545daf14cfbcc6d15342fe46535f901cc | 57 + ...b6431a4fc425efa343876929178de6fb50cb1b6956 | 29 + ...56eb3f288400b7d978afebb34ca1545dc61e395693 | 4574 ++ ...ffae5967a21a0328e336bb8df4af3c6c40d200ede9 | 51 + ...43618148a977ea428567dd394ef3b29d2fd189b50c | 138 + ...66d6dbdc5693cd30cb163dc9d47478773217489061 | 7 + ...21786d0029f990930bfc1d846b69fda9028d89f041 | 23 + .../astro-ghostcms-brutalbyelian/CHANGELOG.md | 14 + .../astro-ghostcms-brutalbyelian/package.json | 4 +- .../astro-ghostcms-catppuccin/package.json | 2 +- packages/astro-ghostcms/CHANGELOG.md | 11 + packages/astro-ghostcms/package.json | 2 +- packages/create-astro-ghostcms/CHANGELOG.md | 11 + packages/create-astro-ghostcms/package.json | 2 +- 1442 files changed, 319212 insertions(+), 37 deletions(-) delete mode 100644 .changeset/flat-pugs-applaud.md delete mode 100644 .changeset/odd-beans-appear.md delete mode 100644 .changeset/popular-steaks-switch.md delete mode 100644 .changeset/young-bulldogs-brake.md create mode 100644 .pnpm-store/v3/files/00/9da7e5c01b986485fde7fc733a35f7062e5374aaa4c56747ac631dc831fa2102837828ba1cac63a52c7a667d6ca6de790b857f2b078ec9d43279aaaced5f89 create mode 100644 .pnpm-store/v3/files/00/b1e183243c132f64a667336127cdcbf5c8053509c3cfd591a32003ff42ef1a8a9d88865d4f60fbf71054974318e1a53a593c72cd71749172e9fa78b463892d create mode 100644 .pnpm-store/v3/files/01/0aa4a8a0dd99cfce36281702106dda3fec02270b7c9d3aa0c23fc27b8e78df7d781b0255a2fce509bf9ba0aa059e7c06f8756fdd450a0e55126f0df93f61e7 create mode 100644 .pnpm-store/v3/files/01/5bab70eb3bc76b4ba6edb663070370e4b36bb6fbeaf1304d136ef0a2d08c59c29e6fd38b8b354c9a3cb746df7aa7fb5fdf4b47113c3ed3c67fb93b6f477bd4 create mode 100644 .pnpm-store/v3/files/01/ab847218f19312581630e56abb9e81b6b4595f0fe02655380546335c7d35b14806ac2715f23ac34982898f873b0c190ea7ff8de04e96b5de2a7e66dd19d75a create mode 100644 .pnpm-store/v3/files/01/bda25e4c9d6ca2a10e8d82b96c1f93ec3390819842607a245be13e94bde29c88bfbf298aedea4486729001dcfcbd3972c2181ff7af193a7d6972a43abce779 create mode 100644 .pnpm-store/v3/files/02/1add646a0524f4f7bf8bb8a5a3057498e631e25f3f7524b5efd1086bf890fdd520840d9e77edbc57b1d9326fe62ae6bfe4e9992d90fc89b6d2e62def9e3632 create mode 100644 .pnpm-store/v3/files/02/35676d3e5ce3f1a2ea0a7d77c42e10c691351bd8d5ea783112492bcbbcbc37d0a2f84c1c926590948bee9a90f0e06a7f859d0cebfbddb0788c1b9fa81020a5 create mode 100644 .pnpm-store/v3/files/02/7a297ac3a3afa2633e0b9759962675a4a0cbd4a9d3e789d24a9f2d1536f4996cefc9313a09d163feffed805dafaec9379c8e35fd59fde175a96f95daf1c439 create mode 100644 .pnpm-store/v3/files/02/a1fb0b394225da8e15080a76a8a1ff39ff34c637e75da99991327391e842b078a21e7cd26d9cd8c215b9197ecbf4b0d5e1a00f61cd7dddabba141988dba699-index.json create mode 100644 .pnpm-store/v3/files/02/e96b3984f0c6af88e4710f51ec322f460ad4ba68c84dd1939ddb7e6b6381cab6226f7d0c0eca80bddf5c5f8f465d767548e67b2e23c53540649ca6ba2bf994 create mode 100644 .pnpm-store/v3/files/02/f09b197f73c5bcc68e559d386b3de32e3f298daf039eb6436d3a607eaa9eaa784807b46fd8f50f59c4d5172adb129160fe8eade3be822a04c568be42b6555e create mode 100644 .pnpm-store/v3/files/02/ff8b6e0a61b80a747592206a64593327954b9257be20f9e963a71be8bb04df4f253f91c15ec036ce41b96eaf29e5f85dd5c6680f768109fd17c294bf9dbc7f create mode 100644 .pnpm-store/v3/files/03/02291ec7586cbe1596dce4da7123459796750bfc72443de4b841fb4f37a0f77189f73a13c8a0674031d0619a92795813e5d0d3c0b7aef7269147ad556077f6 create mode 100644 .pnpm-store/v3/files/03/110f28c5274b4f87469bf794cc75ba801b444ba968938d9e977736f7527a5452ae8ce70a18ebc8e2295b2d4357ab210af5e37e2179840dd12df3642466dc11 create mode 100644 .pnpm-store/v3/files/03/ff5df5dc9453b97f23dd6cf2e2dc6ee217465a02013fed75cb6a835c47ef62b574c8d3acc3677a59ce2449db542a003bee74d9ccd4678fb09709923a9317f7 create mode 100644 .pnpm-store/v3/files/04/2535f96e69490fa6fce2bee66222381414a87ab8c568d995548d9e9122249b055155712deeb9bbe340595c603e1c0324d2ab6a6a078f0c8c69fe161e8d8d4b create mode 100644 .pnpm-store/v3/files/04/2b0ba07e08b87c7b34978fa9074646c8fba3c2c8856c8e0041b480575ea6d47452d9bf450f31b7a1d324be9fc21032bea11750ff488d8b9a6dbab4b111761c create mode 100644 .pnpm-store/v3/files/04/3618d1c65ec62f6818ee9534a6d50fa18c23750e7322cbe1c7182af698c42aa58442126352ff801fc14c78f6a12af957dc4d910bb0ee12568415ca141ece0f create mode 100644 .pnpm-store/v3/files/04/50a568b12e473a5f17dc2b9a1f4a0d2e609911c686454deeabe6ead58f06f5313800d788dcfe873ad816f655a974d78478d2d04ae7d60df21e27e0bb4cec9b-index.json create mode 100644 .pnpm-store/v3/files/04/ab856620c61edc97c8fc55969ffa1de864dec7b779c14547df7f0fa4b396fbb7d6e657c50d85347f5e0531657b983880ccec1742693da7fef7d10b7bb9373f create mode 100644 .pnpm-store/v3/files/04/c846d0e7890cbd15d2bcfc87d5fe2be619dfbb3f904c73524111e18aa372bd8a77b1094cc1ff466b1a411d95fb43ceba0b5a2843f52caf1fa02bd699e35384 create mode 100644 .pnpm-store/v3/files/05/13c39a10f9f772476a3e0f6f063f83b01fa3383b7615ec977b9b46e946430c8176bc5de188667694ef2f75504190a1b227b655b1ea9e20387092d4b85c90db create mode 100644 .pnpm-store/v3/files/05/7bb57dda89a92b5af8228ccad1bb28a81667046e15196d70f247f36d545ec4dd55f0c9ebeae752761515d4cd12fb39f6782c25f849980483b2eb80d219a673 create mode 100644 .pnpm-store/v3/files/05/886c5e76734becb19f68532c270f69437ab6d8957928c5209529e5326d18b54ff736c80af35d319b5c55777e9bd0a3378de566df018f403b94badeb6d7c8cd create mode 100644 .pnpm-store/v3/files/05/bc548a710ca0966aac7b128f56816b46e80819cddc1a179dfee3f480708f1a2cc465ce842bea987d8bf6b6897a669d68a8de551f1940b855ec03a1ca81edfd-index.json create mode 100644 .pnpm-store/v3/files/05/c2e3f92e06d48f843d63bb9c09e5b5eea00689576cafe3476b6184d7118b2e3d69571864dd2ff6671ba6dc1e76923356f66d7f90ae9c4296fe4c3e5025dd50 create mode 100644 .pnpm-store/v3/files/05/c6f1f20625bd79f8078814c6eabb53dda55fa28317e636a7f473d2697912093438ebee89b86abe2e3b61d88b37f373c51664b541e98bbb48971537a6992171 create mode 100644 .pnpm-store/v3/files/06/4f15a98a31f5a7012ab18d0b0a239923349e4633447b66ba7ece49f9f3f4536939bbc74a85f59a0112e479c1687c9ec6f767907a31017d0b08e37f10ea7e62 create mode 100644 .pnpm-store/v3/files/06/7ebd6d9c6cf03169d5ac719ec5600497358e1bc342db515a2a3891f720979621b7f372d732dde2ebbe9dd72d8a361b5b3884f927155119811434d96e450057 create mode 100644 .pnpm-store/v3/files/06/80bd1ce4324a63460c33799de41234b1e716e247690ef34f7c33f0d37eb752590fc6a0279404ed23bdc5cbd5a33e23c14ef3c532a11d58798550189314206b create mode 100644 .pnpm-store/v3/files/06/a651295c46ff6548abdcaae4d0b55de455d120143b1e2d8a85be216be3b702c934dbabd68aa819f8d89177387909683a8e07815d9cd7fef63cfd0ec5041ab6 create mode 100644 .pnpm-store/v3/files/06/c98490ccc1c3f1a3fae8b99aa5dad62883f58e2b0eceb21d205d4adfbc558550ab42b8cf568ec9df6686e3687d09a5aa3339c7fb84b8efbb9ad857d502fd94 create mode 100644 .pnpm-store/v3/files/07/558ccdd0d7d98946cb4938cef38adc025c606c1e4dce4dc0cd24c6d42280944f2b5ab2e906c0cf0d3e0464f5b31ea15cae8331acc85c4267cb7a373a7da8f2 create mode 100644 .pnpm-store/v3/files/07/d396665ce611a3806d988d20fac60ace1ff1642a059ea6d037148a06ed8ad3088ee0f01230a65911a4719f9db96043def3cff4a8da891863f73dd86830f180 create mode 100644 .pnpm-store/v3/files/08/03d7ae8436b686574fb419b519cb87482fd1e0e52e740c3a6d5914ed713126460cd01d42e863f1ec1714fc728d252738026a47962efdba55f7612467d0a1bd create mode 100644 .pnpm-store/v3/files/08/441041883b54a85ffdd842137ac6a7caf239d4aacf11ca82d5e4776b5ff9b5b3bb4c62f62540c808edbcbcfc59917b1698a081cef3a30e5e9d2fef36e753e8 create mode 100644 .pnpm-store/v3/files/08/6681b1e36dba7015d830a9c015ea4caabcfbd4f0eb95d97ad31a0b416c32866e2e3d20c4d2246c27f643229849c56b34e53bfdac9f35d570f190921c18aa0a-index.json create mode 100644 .pnpm-store/v3/files/08/8121ea58e824fea599064f914252bda778fbc58cd00284cbf7634c6cef277c80f7aee3924acbf7a72bd3bb8d71827ae2c593680484af283167a1dc1d3b6982 create mode 100644 .pnpm-store/v3/files/08/8945d883e7360966dc44b9ce7c036109139458b496cd87d85aaf6fbecfffa6828bf1599f49d372fe60fc40d1d990052a87e8f120ed52327ba0b0f553d0e302 create mode 100644 .pnpm-store/v3/files/08/f2d65d9009b99e857fd8490616a635689d1e8c307fc135a055f21c6599cb89111ddb9c3a4f5e9672adf803a0ea851a05bb0d23cef9e61b9787cacb44d1da2d create mode 100644 .pnpm-store/v3/files/09/c424d9f1ff60c08fa742efb90ecb70c6bceee2ecbb805948a5f90d6c1a2f0a83be5692424c2299abf4077ecd92b65c3dd17b9c471609917f69cac359ad1307 create mode 100644 .pnpm-store/v3/files/09/cd3a4dc61fa7e4302dd727b9556ce63606e385fd0a9a19e3eb7406aefb1fbf391df896c030f9e348fe52ff1d3e0421e14ce62b15fd092a8ee42a6d255515f5 create mode 100644 .pnpm-store/v3/files/09/d0128cd24fbd16bbae83ba45afe02d8053cd8cf33f2c815f120c7465b751240bca358496cd91816e540535da415a7e3aba5e08addb2de9bcb26b6685ea11bb-index.json create mode 100644 .pnpm-store/v3/files/09/e9b175aceda09d741fac4a786337f29b4398bee1076672757b2e9d0733b3dea5ead9af5ddccfdd1cc36f7019a6664fb9646468e664bad2e1c35683e211220b create mode 100644 .pnpm-store/v3/files/0a/0f3357ea58de7790b8c37a3392827a3a83cf8e055d106778c7cd6029721c864c1c1b857bfb5a3731473e1e51706227beb07e01a986b5e5d7d724caf88e22da create mode 100644 .pnpm-store/v3/files/0a/5d16fa64ea151dae42440a0b32f6e8a0466765c7918b44a06e83783069f241de5a0f4746e5b3b957e9abb54a5db60bf01c725c3e86bd2ef45cb2fe2ffff1f0 create mode 100644 .pnpm-store/v3/files/0a/686d54b3dc2c3d26d8461907c3c9bcc918132103506f0c71236bf29429d6cd2b19a27f66d5cdda3ba5c91bc7b10a8464f2ac327edb21399a9312815be08b39 create mode 100644 .pnpm-store/v3/files/0a/9ebaa4f77c5ebdc95c2ea411942c939a2011c3e151dbc1acfbb0cf0243fc6099993fb217249da6c6b0b35860fd6fe8beff1950a764d03e0a996641199eceaf create mode 100644 .pnpm-store/v3/files/0a/ca16570c37cdbbdefcb6dd21234b59eddcbafb75c06605a235eb526ef8df8557e07e3d92563bf3106d00230f06af52c4b80a256fdf6c00bace556323d8af5d create mode 100644 .pnpm-store/v3/files/0a/e7b862f36109e00b2938cb54c47951b56be630a54cbfb5fcbd6d72c64c9d72b0d061e085cf9f9fea2747afd470a582aafa86dfc1801fe17609d179c0041b56 create mode 100644 .pnpm-store/v3/files/0a/ff1a500c9310cf22b93035d526a7693bcaf3c37262e0ef0053e4e1c2a18435e897d385d9e56a4474b522e92c320df59d1808981e4b9dc891f9395307b64001 create mode 100644 .pnpm-store/v3/files/0b/0a11909c19d46e635ed6c35a0e0f0c61316832edc12383cf725ed863d1d225b038b9dde7300d64d48e3c9797feda65305559cee729a0e1d93487fed03a0402 create mode 100644 .pnpm-store/v3/files/0b/4fb939bfd802ede22219bde388e2a18be4555e592280c9055c9754eae21af7b368ea6b1e757b94e607963732a832952557eb33cacd675840baf449fc92fc4e create mode 100644 .pnpm-store/v3/files/0b/5485494fcc40c2bf13d59cdc9add666ca3efa461b49b04e96e0b43fbbb587ec564d4521913c0cd0d4562f8220dd5d336b6e80b11a4f780d7ac54a3d25bde4c create mode 100644 .pnpm-store/v3/files/0b/6aa006c54b42f585de2b20834d5f4f5572ecb3f1b9dc733a98ed3d442129789ab59b0f89a231f72d791f0c61e13382a3803f6d17c6d8fe6376d2c54b50f325 create mode 100644 .pnpm-store/v3/files/0b/77ddf64ef1b0ede103c05963efb663d17429dca64b896c5b65f583f08dedc9541dba0c846455a511a7057e5d033b2c22624996c1af892e6bd723dc248e58e3 create mode 100644 .pnpm-store/v3/files/0c/417a1dd52ad11a452319bf7fd302f2cd2d8f2fceb8ffbc241ad625755b2944059ec623ea1a3e1aa1ed5248104ab62929c0f8a869ddeb72d7e90a23dddf63c0 create mode 100644 .pnpm-store/v3/files/0c/4d14c281ac28afbb94c84f5bfe9695e68b7c7b10ad904cc15af1e680072415edf2d82fafdc73d20131593d6191b84e6f49bde2eca9a03ed17dc559f3d26375 create mode 100644 .pnpm-store/v3/files/0c/5f3d6e22b1dcf72e9da40eec850dec5a1d72a68bd77bbf4aeeb42f31388f3a4c7dbb8367ed7e1fe1d0d5dd66d6cb69ab3fb40fdc0c127ff557793497cd27b8 create mode 100644 .pnpm-store/v3/files/0c/61dfa2c9e4c396852c76634360911e11d24e48e87bfda0126bc094a70e200cea6356e8030399b75ef486c116b984da4a288c690ca2ecb7d4dda877a2e9ef43 create mode 100644 .pnpm-store/v3/files/0c/bdccf8cf93a8ff4c5ff095481babea3fdaad5d0661e4c75f4c245b2dc33d405f2fa21db4a90172ef48b1a1a1fc5011495785443fd702d9b31d9abaa500826e create mode 100644 .pnpm-store/v3/files/0c/d5f2f18c87c699ff3672cd3be14944c706d6255c295fc116f15040d1818f5853212716abda5a652f2f519b4ddf0e7c2ad114e7863fb913537482733eddf1dc create mode 100644 .pnpm-store/v3/files/0c/f043cb556b21065bade6f76718c8cf4806c441e1e74e09b2052deea1ae601ea5b06d172418e55bc9aacafa76b4dd333310830cbcc7050dd50f5f1a7529bd07 create mode 100644 .pnpm-store/v3/files/0e/86a7c94f48f4d97ce65532b4397c8e0ca4fa7ad40d1e4214d54caf15971977253f8593a816b206048501e1752ffe40c0fdcccb0996a0ae062c0115be5f03f9-index.json create mode 100644 .pnpm-store/v3/files/0e/917bdc2598518bd42075a09c4ee55b9cef67de71a16e6031bb11efedf14e68e0bbe58ee340776bc19e36c71231319e48c6384ac509a0c9639fc772a36849ec create mode 100644 .pnpm-store/v3/files/0e/edc411afca7b49fa05d2355d9b886a7000539228b104b09da220833ee996d5eb8428271991f5f1f5f3d85e073afade2565c2f0d1265f2c2dba57837a251f58 create mode 100644 .pnpm-store/v3/files/0f/0d8c91b21491d58deae366e09bcc75ac6de6a2492f32775f4408953a025e6f499d044f5402feb57e73be767936a94f758a2db18b2460aa1326ff79d5ec98f2 create mode 100644 .pnpm-store/v3/files/0f/3f70c3eb592f0412ae1e7e18cbbc691ac3d1a220d52155d4bec2d3fb5a64052202a06dadf3f8136f1996410179e8a9b82b1c096783cdfb4c4238cbceb980f1 create mode 100644 .pnpm-store/v3/files/0f/5b3b81c88c1e981c84576f3c0336ddbe671d628cb7ea54d79ae06eafc04cb5101a9c2efc986d7f77a2974a770ad1ac48fb262379c04d4e6a354d086f7c7dd8 create mode 100644 .pnpm-store/v3/files/0f/adb77657d36c74a5a89937a8e9c01be504d2ff2da091367d246e1ec37749540f9e0cfd25d096d0118bb8a0643ff426b732ce78b070e945dce8786e112d03ac create mode 100644 .pnpm-store/v3/files/10/0045b8c7a5a2bcabd4f9dd2d2a5b78a57de7420b477bab1bd0ea56f61855a3c2aa453f3b6ae808f384bf2afc7a26aa970e72a1ffa859b63dea447d33071ba6 create mode 100644 .pnpm-store/v3/files/10/1509bb54f17db5dcfbdd1313c3229011fc2f15e05f342dbc8cc08823f2cb7f51bd862d38208f0d74e1ec1add2d94450386f327949ba9722b35766f5a2447c5 create mode 100644 .pnpm-store/v3/files/10/67d75382078a1510998a869b812959644c60e852e589a958f09373e450cc3b09a6719643f8973268e658ac1fd64655b93cda4360b44bf5afa71d1b43336326 create mode 100644 .pnpm-store/v3/files/10/704b69091bbb3a7f815534cf64300ca5d9d8e0dfd67d7dcfec5821c9d9188ac3167279345b6556ce6cd869c02980fc9cb40b492debb93ef8623e5926c08892 create mode 100644 .pnpm-store/v3/files/10/a3c6bd8012b66b11c91c72e660d944e5b0d852c49779e8dbac50c6baedfdcad49c757c484326aa2980719db6c1aa068dd393021d54cb2fb0a699b1586409c4 create mode 100644 .pnpm-store/v3/files/10/aa3aa858aa690776303e8ef40f53b38e615bcfe5cb81bf0d0088f6dccaaaf095f0bb33182d247794fbc555330b230637679e9d4fc69ea6ac8a2e9d4530f7e5 create mode 100644 .pnpm-store/v3/files/11/5c4269c55b8afde69790d15eaa9ff095dd9bfd26352e657866f5abe9bd8dbd1d6c44462062f761c108db10ab0be800dbfeccdbb79f81adfd441abffb05e2aa create mode 100644 .pnpm-store/v3/files/11/c65b6b9de5b0d12355b5b84080011b54ff477b89fa734c1b2a9fb05183fde5fd71ed09d8428e2919c57aa7c6ffbdd1c59b4bbb72489c561053012e40aa000a create mode 100644 .pnpm-store/v3/files/11/f4c7c6546b8c908fdd3546f9684f32fc836b90023369754e4a2f93414cceefb9bd803ba17aca5a865a8758253ea81824160934711de7e2bddf879b59768d5e create mode 100644 .pnpm-store/v3/files/12/08e24a567468337af3112be09e0937da4d6b0a59205d9d8eecf89e9bce3ca515c44e7f81ea94b86d2f09b162e0b1bcff18ec119cdb71e84a817c280e7c2e2a create mode 100644 .pnpm-store/v3/files/12/2521c0430d8feb61343480c8fd1bad5180974126bef5b34d8ef96acba08ad59422904939e72360382ca385278f043eae07d5c8b35aee175962d07d62460e66 create mode 100644 .pnpm-store/v3/files/12/283ea94be58f4a17badfd9386608c2702a5558458cdf3f18148e4f91df86c812325aa54401f83ac94161157fa55f6b1c28b0f0246776323f000cbc2e580ac6 create mode 100644 .pnpm-store/v3/files/12/692c44d173da41ef2a4ca348e3148395860058e39d4208afb3c54d73b041e0e65f84f3474006a49292d8341f00170fd445f3963abc874bf9227a01d723274c create mode 100644 .pnpm-store/v3/files/12/771182ba4334136f936f32a60080109db238c884e6a93405bfeaf7cee1956f8252e7631f652274501568570f3098261f58e2e827d5c589bf23956e08ec199b create mode 100644 .pnpm-store/v3/files/12/a85fdf42275d01b5e3cdd08c434df1e1b748e81318702458723254042969084ad98e4afeae244960bae1559e9d67129f209500a303bf8d07864e1904dbba92 create mode 100644 .pnpm-store/v3/files/12/baeba5b0724486b2277bc1f471033ca83a28975133f76dfab2b0f890bc5ba918f5e38f4c91ae726ae830007a1695a474c4b846aceadcf2fd9da159c6358c3c create mode 100644 .pnpm-store/v3/files/12/c1ad9dd08df1e89841a48e58d10eb16dae8b0012497685a7e9c2ae12f78894303b3750669d0b5db9cac695fdbdeb2a9984896159fa0914146365c01cb74702 create mode 100644 .pnpm-store/v3/files/12/de242e40e9fff196d6b49bf4468a43e199c87bfd6b942fdb6623fc164743ed953e2797927ae168385b74da93e849eed42fc77d76174a2c80216de18b48dd4a create mode 100644 .pnpm-store/v3/files/12/eb8b88fbe44351539e5f8e6a73f41e22c45c0014c35b107ad2258b7316684c17c3648b8cdb1b9b3b60092683e7943c858003cb88b0596487dbc2a917e226dd create mode 100644 .pnpm-store/v3/files/13/4bf9ab48fa07a6c6c9aecbf09af39ef4af867fe72b96a5da4eddf04fe2cb21086b3cea08840b90285d03dace24e78b8cf030b7a9d0d966d354b86774969241 create mode 100644 .pnpm-store/v3/files/13/7606992ed896ab79ec3d7e7bf0438f1cd825bdd71f13e3917f29755a666283a1a70bd9e8b8d90dcd7b0186ae263cb9bbc9c068bf54cabc27ba1e875fd5c51b create mode 100644 .pnpm-store/v3/files/13/7c88b8f231684e0c3d1e96f8649d845738d4810679400561cfb1a2e79f722472f8b5c7e50f9ae8c68155ad1cb7f92c6ad00b39f7817da6dd7ef831159d515e create mode 100644 .pnpm-store/v3/files/13/eeac9f846618d44f5cdbb3f09b7eb9798a63b1406ac8e268cf5be8c300fe00a3ffa5e22aa89a952dcbbcf2d7e79c4e9bb423e1bf8f3e01a6bd52e58ae486de create mode 100644 .pnpm-store/v3/files/14/f1b380f1fa1cdfc759e74348800f9aaabef031dce8f9274b0f914c02c10670ac63ea336ef6c9f6a8d0161778cdbc34ee1dfc164ab4c868e45a6cb67e797e4c create mode 100644 .pnpm-store/v3/files/15/0788d0d20ce3379fdf87e4a6dfefbe4b6526b52c8a31031e946f1c042ec07d34aeca038b59597be4f35683ef000d803e6a7701dff05852c228bc3dcccafe82 create mode 100644 .pnpm-store/v3/files/15/33c15e43e78cabd369ceba3eddfb8cedc6baf8be47720874dda28ba57bbe30af9b3b12b45e833419c27dd0624cec8d13509d6c59a8016c5a527ab774b9ff86 create mode 100644 .pnpm-store/v3/files/15/63c3df149881dd8bd0d5f5291ee2280221b58d52a7a27f03921582f84f06fd719600e8670a1f27f61eae9cac2bdf269e6bb3223407863e21799375f8c56bb7 create mode 100644 .pnpm-store/v3/files/15/811e5d75cda90c8237c9f94fdf9de805fb267c43990ffbd79fada4a04fa821978ed7a44dd0edd2b7139fc0014e7dbd72d5662047d481c586fa259c2bf28d84 create mode 100644 .pnpm-store/v3/files/15/92578d62fc0d7411c6a73808ddf9030866ec72c97dad24bb6ddd2d41d61b9ae7e98cb901247c11cc3cd2e447e61896afc6fa9fdb895adc357ae8ac27f38f1d create mode 100644 .pnpm-store/v3/files/15/b177a8992602f66c876d49333dbc99ad6d48ed97b6fb6192f3b9d89fb09c070876442c9a288f58629bf2c1e263ab6c2db9f7b391ec02a8ce14489128615968 create mode 100644 .pnpm-store/v3/files/15/d1173748942d35bd892a62f6905836f08df8721cf6405aa04d0f231c84f990f6cc8d101fcf3ccdaf76870508ba045ea10dce3a19dd5542d6d756655fbab6f9 create mode 100644 .pnpm-store/v3/files/16/5ee1c0610790078e7c607354fa4c832abe054d5f08ca879abe55f1b496a259f50effe05c09c769e14dd11e5c19f221daf00743a271f465ec39d038cc8b1f8b create mode 100644 .pnpm-store/v3/files/16/89ee97c807163aa6f5d20e000a76db5d4475b35be257dcdd5d97639325a3af734b25cd11921e2ef92413c3ec5f47ba727ba1fbecd3acf24a312b54c0c150df create mode 100644 .pnpm-store/v3/files/16/90aa8e630da09aed7e671476bca806c92ba818128ce64f635e4e40f9419fc3e1de5a04b1a4ed0c059823359fa39b29f1053e268673fa6afea37596b82ca056 create mode 100644 .pnpm-store/v3/files/16/a7da420109160b5d7f070f38af2e0da0688e5f752afbad23c650ece809af9940894f9fc95f702c2dc228262cf19ab391110124b5cba12850b0015256c599b5 create mode 100644 .pnpm-store/v3/files/16/b9b466d076628f52134ff1581beb02db81e81594c0902e14704f98b99f92a281a4086f2b125d057780ed7fd89ae42da99aedea1778501f24bae6e0fc848dbf create mode 100644 .pnpm-store/v3/files/16/e4e0d52dfbe84c6b09f55c57c9feb9e9a8404ee5a0384d1bedd79a9817ccdb7aa939b90946e4caaac5241313a6f13b574a94a92eb8c53d006bc82550d4d3c1 create mode 100644 .pnpm-store/v3/files/16/e825a65dd06d2c5689f25ba11e812f160b0ae3be381da39419fc5a24f814ccb668540ca4618cdb76a9ae00756b6391589c9009a249f5a1266b3d92a847402f create mode 100644 .pnpm-store/v3/files/17/35555cef6086c1ad269bbdb91e28ec978cf6051f58d6d5659fc87c7fb459b0c9bb2c78acefe3c0de79cf4c80e500e486f3b3f43bf3c0f081ccba53279abe2f-index.json create mode 100644 .pnpm-store/v3/files/17/a44e9e05b25867ffe85c119d8ddd6ce3bc7bc0ba478dc95bb2027d074d9d7ce4f21f2040e3acc3f365f83ed650a912de164d36dc1729726f92b2f01b67bb21 create mode 100644 .pnpm-store/v3/files/17/c3852c045a8d503ca110edc1d6a6a60ca6b57160cae6df931e0073e343ba6f52ec8ba860192576922a1bbccbe5e43ee81c255274ccd502fddc61d25091de34 create mode 100644 .pnpm-store/v3/files/17/d1c2237db6a9034d3de44829b9c1779e36123a47f7d855839f65ec84c338b0717e6d5dcbe9bed283c81738c8cc9e27f1b8d22fd7cf1ffd9eaaf857348965b1 create mode 100644 .pnpm-store/v3/files/17/eeb5f009186b3661ffd64c2a63550af4cf4a5437bc29cf0b148403ef1955b4036bdab9cab244d0de7d075d70ac8c6d57f8e2bb474d5f129a19a1f16ea83f2c create mode 100644 .pnpm-store/v3/files/17/efed5ed583b26b7c2b8c9aed53af86bf3e4b09757f6183921ef4baa2a7bde0cd7d08c91e00bb779208e4eff0924dbff80f8982203eebd3f83c53f9b3542b49 create mode 100644 .pnpm-store/v3/files/17/fb514262ec332d07dbd2eb95044e3c022b46bed052e2cfa5f23b966bf2a4057b836202e064fcceb4612b8bb54372b6eb7f1733a3bbbba288fb43f72e80db7f create mode 100644 .pnpm-store/v3/files/18/5313dc876644d30a55a47c2d440a74179dfb968be052eeb43c44a47e55de235c81561760eb38e15ac93ebca4d0fcb258c0396ef4aada27088a60aee00e8285 create mode 100644 .pnpm-store/v3/files/18/54b6e505bbd8cfd9117ab2f8ae390be0cdf28cde00ea450cdd37ebf63054d574de543fb22354d0a37c1bf59295ae144a4c22794dbaf0fe4675a80eeb69f8f4 create mode 100644 .pnpm-store/v3/files/18/74d2352608090eec707eec67e336ac5a294682e1f2dd9b2d25ba05b82bb4bb1a84e201e62c805497fd1a358addc6130da323e17741a4cd5c03aa484b42afdb-index.json create mode 100644 .pnpm-store/v3/files/18/89f246aad8fd6704b266fe1c943aba1351c3cd6d349a59b543e8d34cbe4d02e663ad368c7af50305fbe44716e24010c9714fefa8712094d21d0d3baf56c41b create mode 100644 .pnpm-store/v3/files/18/8b46ab8c8414ec0517c094eb5b3a45433acef3c13a89f7e2eeb8690f4b907aa5e4e73a3790be09bd5e40c11619400663b79410392ca63331fc6760369edcb3 create mode 100644 .pnpm-store/v3/files/18/9100b6d8948d62123948a71d8a1013d0e8eb44f78635307ec2099bf130046d99b805fb0fc0731c4e0e36f8932a3c7de5971c54706289d71ff5ea7862f1c6d3 create mode 100644 .pnpm-store/v3/files/18/b2e1e2707acab2325da88ec774ca997812c4f3382cbeb4ee518e125525b8538a9498db96c9aa26af5cf509d4f739d7857fb4001ab7f6e0d8ee9462f3741565 create mode 100644 .pnpm-store/v3/files/19/42a59a7538d483f1bc65fe9a5c793c822a2aa920815097f0790819852ae3f42ec8edd78d3fcb5d729b024647b965bb3d0830085141538ec6e6959a81dc7c12 create mode 100644 .pnpm-store/v3/files/19/7832e3bf246a178cd56a6a3608282ba14a6d1ee1da95ee62f38fc3373dc165ebe563b167c05bd02505a262a12fad76ee2481ae1c25bbffb7b165a34be7c3ee create mode 100644 .pnpm-store/v3/files/19/8fc4a10818af3b8ec0285624867efe7e49b41dd29837c692ce17759033a3471f35c5e74e419c00374ff6100b0dda5964517592d704a9b93612ddd65a4e64c3 create mode 100644 .pnpm-store/v3/files/19/b699f1fa6997b79bb5f0891ebe24f84d0401c2f302c847c4aace525f76d11e07583a66ba087dc89b32bd4fd6f8b1e394e3090cba60facab050386efe94969c create mode 100644 .pnpm-store/v3/files/19/e5b8316cb96cf7ad07a58633b2636bb2c070ee0b80792552941c7b471a04111d97110ed1f7e612eeaba99a4d05641aa6ba2d4fb15ad6b5768ab3301ab15d15 create mode 100644 .pnpm-store/v3/files/1a/178898bebc2ad7fe9c3505a97fc9c3fea542ba3702b3580664e568e9feb759af315a447840163a88f266b000bc8d20ee79d2e1c6cab8f3f50d512cb7c7455e create mode 100644 .pnpm-store/v3/files/1a/3884cf7ed32d689a5cf595d25b10ed918ae2a6b65643e83cc754740246b79343519d4e9d5abfcfd981b6a612bc3f4dc2b52bdc0e2c3b081148f9ddbace187e create mode 100644 .pnpm-store/v3/files/1a/5c1d07fbef492d250b18df143f3fff1ba0731ea12299fde317c4ac9389af92516e2ccbedfa77025846955e830cc6e424531dd38a7352c483aa9734637d0eb6 create mode 100644 .pnpm-store/v3/files/1a/6c29b6b6c750b7d3baf8234ab3965a2072a29c10207441e863df14b1383adb2e02a818e15b16cff8b7078201e5de5be560748f82fed7ab4dce97059ab739da create mode 100644 .pnpm-store/v3/files/1a/7d2a3017c61a952f5a09fbca43073d6833d1bddd735150733830acd6896f79ab3e49c7e0dd3b24d75bc61492319a71484572e346b55dcd74b23808d37cc9fc create mode 100644 .pnpm-store/v3/files/1a/c1379d7f2a58527ad2d6f4826a69f619d1ef230181b18a9e2c2c02dfe7ed15388976a265507dbdfbf9b61a1a18e0f131d2dbf4244964875965c31587758642 create mode 100644 .pnpm-store/v3/files/1b/170329f895bf77dce1752d50e910a57d109458d6a69442556201a7be7580e289c037b1d78db13256d3c4ff656bdb689656e68f63bfb5552baaa2c3190f8bb2-index.json create mode 100644 .pnpm-store/v3/files/1b/5468b5af9a462cf9985dd2a7eeeeca5b098586e8845aea1a55790d6870bbc120d1a92f2187c3f74c07f7107d8d9f65d13bbcc4a0d3257835056c2c93f9bc27 create mode 100644 .pnpm-store/v3/files/1b/6edd2337e9eb3a27df2ff40980bf7be8f8206b4bb0929020b9a910ac902072f06ca0e670ebde5ca57af0c160ce3df4fe06c11f2ca4f861f10d4eb45062471e create mode 100644 .pnpm-store/v3/files/1b/a2d24a389899203d4ce39e05d8f8165346a8aeeeb4758e6ec073bfbe16430256f7acf0b6ad7f1bc1f13c95d61c300d6bcd4c110cd942ae89faf8e493eaa0c1 create mode 100644 .pnpm-store/v3/files/1b/b1511e5d3f254973c11acc706266f6c21a179fe201cd6df23629fbc6f39417d287ada32db79309a22b64f02af5b364490cbc93e331e1963859068ae1bedddf create mode 100644 .pnpm-store/v3/files/1c/4ce2a78ef31c871ed2b4a8a620a7be01000ff8dbbae070b1f2995c1e30b6529f759c3c1f08c6b9230157fa5b399c2633dd66a8f0ae85b0fb9eea95eb7ec1de create mode 100644 .pnpm-store/v3/files/1c/50feec44c4c39f6e03ebe95fd16acef16ee69900f1f19a41d600e7ad01dbd9e3c3e2db941fe0932fcf56726ba989e25a127cc3492c87760e491fa7f2756c78 create mode 100644 .pnpm-store/v3/files/1c/5f9d514a3ad7ed5a8358396dc9e31368e958e42e5cebb4c4712585e8c725a767d656ee4bee238a785fd2a8da2bcf0803c28b91db1e45aaf8472b6a2443e6b6 create mode 100644 .pnpm-store/v3/files/1c/d22b82dcf9ec237dd27ec82595b1c5868ae863efe0ccbfb7e77339eb7f301c58eaf7da8780cafacfdb27726f7016fe64d27b8fdad4a1be3ed6f844991b3225 create mode 100644 .pnpm-store/v3/files/1d/03cd30ead1fa46f673eb7d18305a8952e6d6102ebde217e9cde1a3b1dc19d577f63df1b7af995b3e84eea143b7af50c3068e24699297b4071899a781454998 create mode 100644 .pnpm-store/v3/files/1d/54f9f87e8bd87c444c942eb09273dc72dab76e208d1af98a2e7ad834992838b7c1fb9c728f150f1d51bc1065a1462c1c7404a64752fcdc59f443fea894f3be create mode 100644 .pnpm-store/v3/files/1d/b344a65a4bd2c31d989d70cf2e9e19c07b75d0c6e7dc7ec4baa3864e7f9444b07e9d3262107e42722c49488c6f3c87749d7ea3c91cd5683fb6f9cb7c5159d4 create mode 100644 .pnpm-store/v3/files/1d/e240bafed445b630c9818ae93704d1cefc319926fdfe169408889551592dddee97355e71b6f073d5f8ca6b4135692dfa1f32228cb60446ed19a1463dab1f11 create mode 100644 .pnpm-store/v3/files/1d/e30ac4bc33b4819e43eb6cbfa4a9c075c03de556df5d193d332a64062537f55ef806c2edf5a549283306830240c50e20db6b7eb7b118461a50bb6d32074e53 create mode 100644 .pnpm-store/v3/files/1d/e4ef29faad362f7d5f030b2b1499e7787c3d15e1b0048f762b1193b34e7ebf5f82a38c75e09b33436ba9adb8312a1e6c286a846d849f7eb0640342a5ad3adb create mode 100644 .pnpm-store/v3/files/1e/1cbe06144195e163a49daf72150d378d2a824874dfae855891aa54b6011debf4be91d3ad7480d2bc93fbbe14896e8a5ac95d36ead030a1aa0a6d4cdb305c89-index.json create mode 100644 .pnpm-store/v3/files/1e/452598d958bf1b97f67bd9de74d5fe436445f3948e97b84f30081fe0aecdf5510b5b6987b2e53fb9b56c1f1b1c30320e038f5dcd1487781997a177f9e6af1a create mode 100644 .pnpm-store/v3/files/1e/6c1e30bb48453a2887a7e80fffe9b8531b951fd122658cf0cc180b6e5acc021b15a79befc84c4580a56ee5dd861e594a0195c337330bfc84c47ca5479d0147 create mode 100644 .pnpm-store/v3/files/1e/c88ed592c0029a0bd586e2179790adec3c9b7cbea041fcf844303206d5b0a391cd85f07658ab11996539973fdd60ca617f80a2b8d62d0e8fc15d77f85056fe create mode 100644 .pnpm-store/v3/files/1f/3896a84bd9fb977daf246174b8639ccf870326331215d5666c34e5acdcdd4b2bae630eee2061bef5e8e050023fc10e612f0df36a43f5743877887bf2d75e5c create mode 100644 .pnpm-store/v3/files/1f/a776905501893145b053dd54216a54a5eda16cc732642d3d49cc12405e24730d67d9c1030332d1e0b8456f057cf85f153d0706f968c70663373f977e1dd190 create mode 100644 .pnpm-store/v3/files/20/059248a3775740fcec313c6ea69a3eb64158e756434e9035f8bdbd1b9025f4563ae8bcedece2f7e35f7e3727430fdaa7dc4c9353bacfbe3f58e5b7ce8eae60-index.json create mode 100644 .pnpm-store/v3/files/20/706ea251321fe1b8abe97a3968fc980cc55d23e18a388950469b35160a389e77345ef81f27ce21ac31eaf34faaf498c690f18cad388c02abbb6c46e1c941b2 create mode 100644 .pnpm-store/v3/files/20/c46efda521d8cf911e4de08df78bc601209de46df1709bfb2219c8bfc8c97b3e106fa3fdf5131060e7bc91269510c28094810edb49e665a013ba759fc49725 create mode 100644 .pnpm-store/v3/files/20/d594c82d695b453fa800997eab55aee6d063f8c0a190c04de2072e81e876f1adce164cc5f1a7aec842f80da82715023a89ceeb792efc744f197567133c9599 create mode 100644 .pnpm-store/v3/files/21/3ca9e6f5e429964fad7f3912c054057a7a3c1ce90eb43537b0dd664ab6b28ef24a5763f55c2b7def177df49568692605100ff5ecd6360f1d0456034b63aafd create mode 100644 .pnpm-store/v3/files/21/6e39548c22a197ee91031c300283ebf098eda3e91862aea0f732e9db282a56ebf4f2fd6133f2c8fb6e020690bb71ac7ef359be6b6624bb0bb073f407f28dfe create mode 100644 .pnpm-store/v3/files/21/d381f7faaa23fa772f189d59879c387fe28e50f118f8e3ba7b39c1a9f75ce78659308878a61dba2c3fa8915aef46af7498172bec8d24790a6f45b8b2c27c2d create mode 100644 .pnpm-store/v3/files/22/3475f740044628e602444a6251eff7745223fc351cab3b66b6660578c0c6032da743a993c750967c5004aaec086883fe40635db194c7cea95453c3a019b073 create mode 100644 .pnpm-store/v3/files/22/3d4d0ee1c75abf2f5f355f846daf6c4dff8e5aa2a53e860acfa243ac34d0d5822d6f20a30688525ff298fab35076e277b7bf2113a6b259dd4e75b5ad16cbde create mode 100644 .pnpm-store/v3/files/22/fd2eb8e77fafe5aadf5876cb6f7315e134594628eedaf7cafcb257afed8b4da49708e7636697073953c98a9cc201567e3d661d3691bcfa2d1de6c4a8d7d942 create mode 100644 .pnpm-store/v3/files/22/ff115d7879a62589931c4d137371b3fe9beb742bae4ee993a792c672acbd2a88c6b702e1d2efc841b1ecf2fb30dbffd3a6a87bd1263237fc0872608a5e9f1f create mode 100644 .pnpm-store/v3/files/23/22552facf4f4042dc5b80b680c1e6d3dd3e5829ee284c70deb2ac9d26fd4a2c7c3ecc4cf330216eb8db04cb18e2aaeedd7fdf830c2a435cb8ff591884517bf-index.json create mode 100644 .pnpm-store/v3/files/23/a169d84a425f771abeaaafe773949062e7f411145f8ff2072d5feef99c879b2d130e0bdff9ba61e55b3292d66e3579dcaaa5b57e45f1dc510df8290142bf71 create mode 100644 .pnpm-store/v3/files/23/ce575a41797c08c60bb72c85afc35e0a9e148ea89be28fdfcdb297e587ab32dde8890ae75e45a24961948c6757e067c1ed7c30056caaa0a21b861938f67ca7 create mode 100644 .pnpm-store/v3/files/23/fe1427dbecf743a406d63a8a289339154cc88849e240159ac2a8f4a15cf143b131e51f8b686fb4806c113e6ef468b35c4ebf1854ae2824cd7e00acc2e12346-index.json create mode 100644 .pnpm-store/v3/files/24/004b1b8c8b391a4e175cc336d9f531634fdf4e70fe23803d1972cd038491deba5b61f7997d7a2ebd3ac2a27019ebfa11b1781b9d20a2be3a14a7009cb2effd create mode 100644 .pnpm-store/v3/files/24/a59e65d181455152ca9cfea967b296520ed6ed18cb8b2a659bd0fb7a0b30ac02e670aa807a743e8bef40ad555a2b419f9e960c9b3d69a22112381b39003fe4 create mode 100644 .pnpm-store/v3/files/24/cd8e9158d35ffc809919a0acec8f6f7e318e502fbe17f88f6de0f810453815d0a50aaee746f687f0bf1d1aac650f8313fb9ce03cc3b1d97a68294eb7740c27 create mode 100644 .pnpm-store/v3/files/24/e3f4913cd6d212a9408f844143bdf1654ecfc4508e54f7cb6b2f1dacf3dfff74a276ebba0773050f5a335de013f8b6239c4b53c4fc8286ff01fbfbcb642035 create mode 100644 .pnpm-store/v3/files/24/f8e3eb362e9a8ada557d2b2b8ca8bbb5ed9bda04eb7733197911203328372e5af66f14172761bd8836e2a08726af9746bd12930622205e78f78b9552eaa7ee create mode 100644 .pnpm-store/v3/files/25/17c521e13ac243f75d4e95623ccafd7618574505eb07b4b1f00cf2298b39a680d547957b8fe81189b7cd9e58b0bfb76d7c9acd1320d49702f61cb62c7cc772 create mode 100644 .pnpm-store/v3/files/25/28a7560e5a667b30c29f5f0df3f805f35fcb616c64df847e4ba27573ded2e64fc3b82782c02093b54220f0c1c7d5c9799bafaff27637fa05b0453f02952015 create mode 100644 .pnpm-store/v3/files/25/cb46ed06782d20d7af90ac53078581ca44beb731395d467edeee1ebbe443e7ec015ca599642f9da02bfc70e9dcb007d5fced18c419ba02217935a3686cd822-index.json create mode 100644 .pnpm-store/v3/files/26/116ee85034926c1092663df601c1af56fe85c7ee4bd313ab4505d33734bbae7edcdb5befa6af5bbcb547ec431a42ef91bbcef59779cc4dc7c4680c06db0ca5 create mode 100644 .pnpm-store/v3/files/26/14199897facdf87d76252e49bff08e74b498cc9e51853ddff04c290a398e9fb32d3a7ec153d856e198837f644c1d6d52a1e1e12a5cd97fb59f9968ff1439d2 create mode 100644 .pnpm-store/v3/files/26/1d1005106f9d6da30798491bfd04ba86843c87586c8e5edaba47b24748f278502f50546923d0781375fd75165c80618f6df41090e5b421ece403a6a1ad4e36 create mode 100644 .pnpm-store/v3/files/26/7ef22a39a11734b95fe1ef6dff6eb1472869238d4b3616c0fcb5949d04153f279fb0d5000157484d2e96578651c8f0be16077d7af6cbc59229bff0255bdbfe create mode 100644 .pnpm-store/v3/files/26/a18618db890f01e0592251beea8a61dde64c7c8f1abc03ec9f79cf78c976ae02f17618dc6035460e4b2b9d06a9377ac46aef93b57a9768dd57236cbd019d2b create mode 100644 .pnpm-store/v3/files/26/c6b9b1e4e1c061d08abd2a88ccb737f81e3430fce405e300a8fd8d94b833d0b9d37d5f7ef7175c6033d44701b9bf94a00c65d51ec960960e95b74989ac6309 create mode 100644 .pnpm-store/v3/files/26/c846c1430c780f5891a551765a9af818ec86eaa23cc9368eb09ebcd1cb59aea14e119107cf7bec2e45bf46b3e71b4ed890d84e1ecc41955ca4b0bcd3bd71a7 create mode 100644 .pnpm-store/v3/files/26/f4bd4098133b78c31408d1ff6f666c27d162cf592a6bc87fc529d0e14a3a655f95329d2cefdb79133f1906f475de5dda543fd1cd7a728ee7cff7f4a1a145ea create mode 100644 .pnpm-store/v3/files/27/32364fe3bcb30967ee634d254ec0e9da64176fafde83ea6af1fa167c68e7853ed948b7e924bb3a0bea66a0df9df7e323019ccd914ae89f37a59f2f5d62e866 create mode 100644 .pnpm-store/v3/files/27/3d259823f1b9de1283c436d13e0534c780faeeb346bacbd8c3a8a9d3df420ea958aeddd19ba177ba73a807ee73b2ee4d47a2798f2a294509f01abecc810e59 create mode 100644 .pnpm-store/v3/files/27/3e52856d7534a3ffae7744ad73047958125a92394d99b2b26b3665340a1701b3288493ad90f78e6c7eea74d5f8a28af2dd2265d67e305471b2ca3c47ad6de4 create mode 100644 .pnpm-store/v3/files/27/4fcf2eab613487e00a66afa9ab73ebf310dee673d1ca258938457f4c99a8074a1751f10fdae7bb78a6091adf6335c7d44c447d0f9ef39498128450865a9e70 create mode 100644 .pnpm-store/v3/files/27/a371dbcbe076b85ac36aad08f440c8c6f15216626d0a2336392b8d992af3f9be5fb8470397903df6a3e780bd277157aaadd89b8bb65ce2c0678543e72fe630 create mode 100644 .pnpm-store/v3/files/27/e93e2f2d969323701bad35241595dcea6c488d53a959d11df2ac1cd979ffeb1540c5235b91643d23916fbf230c1096baa38aff34978966eda083f56010cd0c create mode 100644 .pnpm-store/v3/files/28/08ba29a0c40024f068ce04f785e6caa92b4d9b295a9a9d073a3cbd83d91ca44885eddb24ae5b71a57f843add0ebedb838e1c1ad9c47dfac8eb44159930ca40 create mode 100644 .pnpm-store/v3/files/28/28bf819186875c1183dcc86decb1cd1c7de1fb651bb3daf7925e26979d1049b10ac9990df2e0212b7c870e8ae9a9c356d721ac14780e4f73b619e44ebbdcf7 create mode 100644 .pnpm-store/v3/files/28/4b9afd2b84e6ceef2657446ff7caae02a1317162cf835a7cec7585812681c4961555d7330252dc42bcb1b6824bd6f79146ec6651d99150873c9a475519cd12 create mode 100644 .pnpm-store/v3/files/28/5ef287b188a38896b8040e29ffce35e14775003ec05ae28ad5bc2ed19907888e393e8c76546560db112fc768ed7c665efb0129cb388d332d1a7fae651c255a-index.json create mode 100644 .pnpm-store/v3/files/28/5f53b80d40e5f9d316ef05bce70a18d5b4288813878378c184896bceb3ecdf82e573853b39109800b566cac6fdf3fae2d855981e0b08b6227682fc2e1b877c create mode 100644 .pnpm-store/v3/files/28/9417d0e24acf2e188c9a34f61da56b643e727e4827525dc8f549264ce8bc79efee34815b3b1f72df9b8ffe9af92278a7824122a109cf733fab11efe043c9c8-index.json create mode 100644 .pnpm-store/v3/files/28/d8324098a59c071d4fa6b5d639cdde843800ea446d099885ce5a2a885e8559ece316a8c21d5cb7376c72714bfca14959fa4c542d1d49e6bec0621f45392d28 create mode 100644 .pnpm-store/v3/files/29/0177954077049cb119e58bbef43a26e9cc8062f7d47e5947e5f4428e70a9f950d098fd0bf0a90ddce696d0d409c11d950b8a13cfcf9f0b0d2548718675a4c8 create mode 100644 .pnpm-store/v3/files/29/0f622ecc1888adb573c0a5e2ac564c9fa0358c147e1f5182eee37a4582504120e594f8dad43444b57338344ef2e64a5b9af49319c432ecd637cd36b12cd4b9 create mode 100644 .pnpm-store/v3/files/29/3b3cf281c19749a7d93717af0b6d6af567f9dc077e924e6b520568e82d1342b743393ffbdb27237890846c7600707c231c3ba77c3966ac23a77ff2b71cc0b2 create mode 100644 .pnpm-store/v3/files/29/4123d009245ff33e41504b8e258de71c7ce323b25794f5c74d86aaec7eb9eb6c7c450edaeea4f10f17ea4f6f21d7b74a0cb5b1aa7ec938582703498c5df7b3 create mode 100644 .pnpm-store/v3/files/29/52126db48f674cb57c4a60eb76c3077e34a5e1aa74dbe27acd4db5f2c2d862ce4d1196d98a694b4db80960b29cbd1a5d27c671fdea3a140d4b8efd6e880443 create mode 100644 .pnpm-store/v3/files/29/600bcc4629ebc8dd3508acfb3468c947f4a171bfd264b8842da6c5db6878842d539c3a5819210ff33e9ba8018815ec14ffb69c4b5ba1f26f6ef2a5c94db9b8 create mode 100644 .pnpm-store/v3/files/29/72909fc8cbc3f946066bfa9eb48c10382473e7e9a679b726d40a0965b4b5bf158c9dd06be14d694a639afecc502df6d214df76c84236da31d43e434e624717 create mode 100644 .pnpm-store/v3/files/29/869de95cb9543595e061f77e3a6c78c43f5d4d8184860fed5cddd0b1b8e2a4569bf62dd9608e4e270576f9a0a3a8166aaa2831009ac13b482d5409ba92aeec-index.json create mode 100644 .pnpm-store/v3/files/29/920e835b71384aa8471ec273c8ef5a69459d9c7dc16362dd958a1032e099fa3efd7b73c469e90d5a8dbf6dcd5058e429eaeb010d38917af24da02f3470a3bd create mode 100644 .pnpm-store/v3/files/29/aa9f001a97300423fef52923c4108a3a19cf91dfa1d7ccd6fb6ef53e7099a21851358425e794d440a40c7f1fe4ea470dd07fb7627572440643dde7247eea37 create mode 100644 .pnpm-store/v3/files/29/b743398ae50a93b7dc6f7c0bcf19ec666dbc1da19179bf72bd963b8aa4e7d7973da1dae81366f83482b1aa79dbe835ed469b560195013b83931f915104290d create mode 100644 .pnpm-store/v3/files/29/c341e954144db9615e1e3f6df6a293f6686b7a27f1fbd6a6d46c4fc725b5ef85abdb152b8ec0764b880e67e6c21de368a54c30ca6aa184430dc4cd60fc3508 create mode 100644 .pnpm-store/v3/files/2a/2c02e7e5a949ef72d1c75f92e3c92d7c4db1371ce5eab01785a347cd8377729088006de1ecd9cb39cb2ca7d759c4c469e7cadb0541c7866a4d97b093231e71 create mode 100644 .pnpm-store/v3/files/2a/76ba407733b858af913c40b044091fda2c5a9cec5d66c7d775cf5d4eaddcd6511c0541ee40b8519c955ff99b7f79ac156febfae113a01be6caf806b7b9a264 create mode 100644 .pnpm-store/v3/files/2a/a2098bedde60cc02081116f0ec6ed93235d5009ff233bb6cee2f88da77a9ae207db270cf5efa61fb4103421b0125a567ce7258f22692c6080c203275f98dde create mode 100644 .pnpm-store/v3/files/2a/d61d304b83f2bd73f12980869daec7ad2c7eb3f72b13f89a0f7cdd79a8117cac06d36a0905a58d175b17e0f346c95c0566150e19b1013e35ac7593f7e90e19 create mode 100644 .pnpm-store/v3/files/2a/e89180eb52ca8e28a3ffc8d61967827012ea6dc379ba59735a5713a58b9053d2d85afacab56c136d435a9511b28ebe0ea2a8f32024645ab0ce0dad19b250db create mode 100644 .pnpm-store/v3/files/2a/f07f6ca2d51fc3e70a5de72569cf898e3841723410a939f8a5add7ff1eb877a7685671c330c417b78d8babf76de96f1b8c820618ca49668350a4eb8efbe35a create mode 100644 .pnpm-store/v3/files/2b/2f969446ef11307c8451d60e3358e8092142c13532ae780d98c8faf868d08fd87b64d4f620d6c5cc375dc3b0a626965b685eeee744ecc1190d98d560ab1968 create mode 100644 .pnpm-store/v3/files/2b/4202ec62cfe025798377b00293dc1515a9202be9ca3df446b2896228253860f3681ea81057ecee51cb6c9bfe515f7e5b6ac5a108c7a7f7b4337c4e6d1fdc64 create mode 100644 .pnpm-store/v3/files/2c/33576af1ed59a22f32f05ecd3f4ef328aa1c90a154211f4d13ba605558d32cbec28e631e2b8c87a88a78755cc1b61d9f736a1d89a98bb6ff86b5cf32d383cc-index.json create mode 100644 .pnpm-store/v3/files/2c/3f584e11726c2354459edc892e62d355146ceff9753f992710e5c861abf85dc5db2cc30ae4aaeda131e493f9e2f18d5cfa0d0078aa896dfdfa79b0c8112e98 create mode 100644 .pnpm-store/v3/files/2c/406f92a9ce77cc498035ce9b5809a0595b3aed4b873fc91e876db2fdfc8c4a3f002f2fe6f293510602953b491659052ad4e553af54df069b5ea709e009b387 create mode 100644 .pnpm-store/v3/files/2c/57ef4d96d40dc0bcd755870bf5600f0e2c79089800805a4c0006a49eb10802d26a346329ad875eeb0fc41d4c9f9010e16f315111105193874626c0caa292ff create mode 100644 .pnpm-store/v3/files/2c/835d5f8e2170ebd488a21ec6114f743d994841239b37cf10ef7128fb01d56cf420601dafb25cc96f45a565d1deb51f9f2ed5a4dfed6c09f54b3861205afc84 create mode 100644 .pnpm-store/v3/files/2c/b2ca7684ac0e4dcdd3324eb8bc2687f40a0934f42536785df502ff45371734b129fc0d3a06467e57d1a1d273643674e134d39c84bf1f016d31be5eb8c9c20c create mode 100644 .pnpm-store/v3/files/2c/e33462dc0d860cef795c5c089956f2db219e1006d8f63763f2acb0ad7c02da4210adca1d67bad49e411601395b539a00f637dc1988a2dd0048a26d2064b8dd create mode 100644 .pnpm-store/v3/files/2d/0619cc334ff2aa622055a797e3e7e62ce965e887e1b0d5f3f9bfcf0cfa16f21267007b535c0b3ac1361f2afed90bd62640ca277b4283111553a9a9576c77ff create mode 100644 .pnpm-store/v3/files/2d/b51ba9fc1dae24c3f14f66fe0b3e8fb9abee7697902caec68d777d44521200a3faf529053cec186bc074c7947f05df4e294b9db5b0b45869ca4f925cfd20aa create mode 100644 .pnpm-store/v3/files/2d/c3ad415f07ed22fbea517b3eb1472e8ea2267315d0a0172f4baa8fd1dc9705e5628935ac7376276aa57c078c9245534f72263d4675da524ca4f4b38215210f create mode 100644 .pnpm-store/v3/files/2d/d564dcbc86f3c10a491a4b7871077483abe1a36cc22298ef026cc0d82d2e786c557b545905f21f36ab0178254b8ba9a35cd5c96557d8e48a4c01cdc7ce46e7 create mode 100644 .pnpm-store/v3/files/2e/90d08b4b1b60bef9dcceae0714383f29ba103a4b2bab00444aaddd48ecbd42df48e48ee1589d209b7df14559529a30a0d0ac1b0787118b068e88826bfcc650 create mode 100644 .pnpm-store/v3/files/2e/9d3dd5209e026deae40d44f9a8a23a94535ee5a6b12ed1b1b0813163b9bc7db19a8c0aa8d982b319ccbb41ddf9d0ae058c992d9cb02fd7ba9d49d39cc1c2ab create mode 100644 .pnpm-store/v3/files/2e/ed66bb0bf938946923c45fe5aaeb5916171a595f86ed608a990bf57da1ffdaf32f7f2dbced79289ba7321507d7c85e08d60baec52a968f00160d1bab40bf2a create mode 100644 .pnpm-store/v3/files/2e/f6c3b05424555bc267c9f5eabb3581d0b881660e3407da77f4e46c3d47bfaad15e82eda88f387bcc51b6a3e75fa48b44e2e9f1b41943f0d4734325c1e8b58b create mode 100644 .pnpm-store/v3/files/2f/1dec37f692a44779a195c19425bcb74fc223a676eda3e5ce3eac60ff886f853dc0ca4cc4b2469e6ba314cff32dd9594e5213552fdea62fe7ec5dcd931149e9 create mode 100644 .pnpm-store/v3/files/2f/60ec09a2526f7c81ef26279c07c13afc58cf98409ab3f6263ae042a62467461a376c286a19a8938a13be75b40673e220438fe0b7115a6f2957102fa5fc0711 create mode 100644 .pnpm-store/v3/files/2f/8fddf6837d7a231e39b915fa9cda55ff822b950025df4b2c1a7ac78190590a27d9b1ea0ced77e06e5c63f66a60d7ee294a3f785b9090f8953731f92ecd4f6f create mode 100644 .pnpm-store/v3/files/2f/9336d11539d8659b11fdbd1bea7dc92b308f46f7281586ce6510179f0182af004709ebf0fd8e193556b980e9a214560d651fcaf09c0936d35107a462ea8b17 create mode 100644 .pnpm-store/v3/files/2f/b035febc3953a0dcb427572fe763f7afe9b5ba70f16ddcb0631c4580a9838bc9da09d726abd3dec5a45b217895c971a916ce1e96a864c66608943dda21cbb0 create mode 100644 .pnpm-store/v3/files/2f/bc8683b769f2ef38ee341db537fda0b8357b4cac8bc2e64aaea7e971f2e586d4a35b082b30c38c85e50967163e0341f7813c329bdce04523f6bdac677f7407 create mode 100644 .pnpm-store/v3/files/2f/e643ebe453d3a7322de41bddf3518a7402a27a6f0225bdf41dd7b22ee34dead5c1e777b2b0fa3e390db2e0bb4a9810f94ec6e9c8f36c5a51ee3b74673fecaf create mode 100644 .pnpm-store/v3/files/2f/e6eeadf565a970de1ad51e939babc43896d2e80090d06a01e45584188b3b2846e74b0771280b6def9769877e9b8e2a3a25d343924a96587b2281a52c662458 create mode 100644 .pnpm-store/v3/files/30/530e3a39ef661a7dd4b453c0226ec2dfd968f99c439f3fe346080ab051422f2265f9675b6bd536dca9d078a21a904a09aa3e6a093abb10553fb4a1b9a70e96 create mode 100644 .pnpm-store/v3/files/30/5d462cd39e318f95bcc648c2b7f8faf890931c13a42dcd3897487c9061dde4b92f7f662f0961326d1cfab084af60556753138ff75c1271fac592ede8e34361 create mode 100644 .pnpm-store/v3/files/30/7603c89b48438acae6735ab07071eacc092478e99bd8f925ba22fea5e14fac2aa4d9ace646132df1634496b58311c6942ea6e7006a071aa2e630658ae9324a create mode 100644 .pnpm-store/v3/files/30/88da523c457fd05a7b5dd4e8357c9ff2df185936cb73e268e858e35f39c9ac0619c16e3691f8d8bc762ac5b33e07a4beefcc92058792a65ce11c878b10201c create mode 100644 .pnpm-store/v3/files/30/bd1a02dd588064e00f6721569724a2b10b6e261c35fbad847fc1cb0f888450ae0b6d08e37628afbfc548f5f57c23fd6a521ae057087e28d4cf00e51ec2d0fe create mode 100644 .pnpm-store/v3/files/30/e9f68cced94219f92248957fc40b2657f4f8398a86ddf61e0cbc72aca0d604b0b3973682c58b8471bda1122e49366150bacdbc1cf6de3a4a41f23dc82ea377 create mode 100644 .pnpm-store/v3/files/31/48538adc249cdf5232f0b445245c69ee202636dd2734a9ed16757feeb54527dd6dfd43ce37ac9407d0e651d6abdfc9b1688fb74e23100f84f1ded9b979b483 create mode 100644 .pnpm-store/v3/files/31/590a492054d8d7b1e0fb848c4e98341250e1a3213dd6e8dd0fba841d34191547ee58f0b93434e4a2bbb002cdf113d0cbf3bcbf6292ef1efa7a74f3ba79d091 create mode 100644 .pnpm-store/v3/files/31/590d544621d8cd75e2afd46cced30621f47073150e76d8213b84c516ce7bf9b3a989bc9dbc92f77e8f713effb5ce7e3131b3b00a8e954ad2e73de371b1c16a create mode 100644 .pnpm-store/v3/files/31/9f0c394ba4d796d9af43f7a03ae9e823b47ce7beeba7fd6c593d54ecee1cbf6e03ef64a44b2550ca64a4f1beb2f03c6ef1ea1d31a01e72330064a78a678ede create mode 100644 .pnpm-store/v3/files/31/ab2a0985239bb8af14399a3fdc2c64db93360a4c3024cea7231e59134d0d159e51be80e6fd2d3865e1f73d1b220adba57936c16f16e1f11816fa340875013d create mode 100644 .pnpm-store/v3/files/31/ed234573d156d236e285b55ac12eb2d3b68c4624262ba78765c0afd09e5ea53fbd27a3b816bb7910eeba467862c1bd1198f1633ccc684b02ccdb2312b91050 create mode 100644 .pnpm-store/v3/files/31/ed8c3951e1a5836896c84ab7840abaa72eccbaf7e54702ffc1a4d1aa5a54845fbe007d7a6e77bd1f31b05e861c57f7f84f870fe781fe20102ed1aef202fc99 create mode 100644 .pnpm-store/v3/files/32/40b99fda1ee2ad0ed922c73a0bbfdc90d7187e1acf8592f08995b1e534c582261cb92a3fdcf24aaf4bf256c7264bc03c8556fc86c577a7a61ab58c9e330311 create mode 100644 .pnpm-store/v3/files/32/f6128ebe9a07e01919dbbd923cf4efbed0a8534c9cb911c78fe679b8775a8f20fa1ef03be9fe539de6294f5b9b08aed9d63a499f6359490c21a17bc13cf01c create mode 100644 .pnpm-store/v3/files/32/f62b343d897527743f1d30dc17200159584e48b5de4659fd75bf9700b532720b1116ef9d9a3a15efb6178236180612ba7431c89d0ed787e546422db33538fd create mode 100644 .pnpm-store/v3/files/33/19c3b334234b53ec9ef3b8bcdf99dc9cbd23c348cf3b4f1a4a10c49fede772d11ca7c0e446371fdb48f97b6b8679fe2e1d208cb57a9167d09f093c0f5affe9 create mode 100644 .pnpm-store/v3/files/33/538c21ee5bb14944af96f137973fa5ba82a27660e30913bcb9f8598913541ae138953af4fd74b8d5cf31b1b6487ec8dbe537824f7ab1ef8265c4f7af535369 create mode 100644 .pnpm-store/v3/files/33/5609ad3cb0dc1d02cb718288a0029507eddfa4dd17f6d15d0bb9ce44c8fb169571a05e9e7f5df48dcd165de623996cf33d9dd1ecc31f187d2716cffc796292 create mode 100644 .pnpm-store/v3/files/33/5862be1a59f1267ec190660bd18deec7a66f6d1f4d21ab7c25c59b7872562ac668acac9eaa7e0bfba6545d74f855098f5dfb4f9501f3c1f052cb8bf1051109 create mode 100644 .pnpm-store/v3/files/33/9a0a7dfd8a2fe21f2842633162ccdd706d16ba353f812a39aabcee87622ae02c8ecdc5b7d9ecad0c5948bd9f7c5d56ac6859e3a303f86f0657581baeabf0d4 create mode 100644 .pnpm-store/v3/files/34/464a8d5c7be454e75fbd540ba3813241df0bf8d092ab205ddedf882f1071ff3b407a420291e54a30bbd436e08feb78191b1eed5b9cc2b22033f9d1f026da87 create mode 100644 .pnpm-store/v3/files/34/f5e679eec0ec46643cc914dcaf81f16c38ad13178a807f63c84b8f3978bf3d654264d6a674c17a6816d6152e07213cc3d5077d6eb7b59c58ac73021b725a10 create mode 100644 .pnpm-store/v3/files/34/f74459332cbda6d7bc47bf4001bcce1505fc88ddd015d61a30da6cc46f11181fd1a79c49f573176a0bec26151a7208164b547f8190e901336f429924836b13 create mode 100644 .pnpm-store/v3/files/35/21733ec2a63453d39e002a32996d7ee3d69f505eece23705a9aaa06eecca16930135bd5406c8252ede917dc316bdda2754f8c0ec707931a73915e59e4659cc create mode 100644 .pnpm-store/v3/files/35/2350afddebf0d34ab44183da1e548fbe93a7daa125e0e0cbc79673b92da89a5d0c155253096ababa2ba190a7926c0d6118e102b1afbf7df44a2855f7189a36 create mode 100644 .pnpm-store/v3/files/35/433456f6f142491f3dded37d8337abe3816da477d2bc3dd86e2f721a7d8f78387632e14284477050c9ac412eebb2fc80409d2e9a02f08421a1d786fd94504d create mode 100644 .pnpm-store/v3/files/35/688cfefa15fb6092f4a1bdefd678fcd79cb3d30da35e7c66a8c6baea2fa85b3f8a04025953442ccad42fe7db257c55ebda6cf8ce3e85003a9ab2e5df89b1e3 create mode 100644 .pnpm-store/v3/files/35/c0e20e44cbb8f47efbe382281d2759a7c49a183f0daf1a50f2cf3106caf9bc4a2829b5fd2e617be02a61ae0f94c09505a95be3fcb1211b9beaa904c79c896f-index.json create mode 100644 .pnpm-store/v3/files/35/d1ad4f405621ba28ab9fc4e98591be60cd9f8eac07983dfd61eb23f4842bb3671805ace67161ae8541b77aa21b99a153f44447648f21841097449d276e83ec create mode 100644 .pnpm-store/v3/files/36/2e325b5c7be27a71fdab5f26f6045bb1f45101cfcb78ca1380b9a0acf1eb6d80a8a35ee0e8ce3b207702846cefa324593708d93992ec45a744c08a3e31cdd8 create mode 100644 .pnpm-store/v3/files/36/8aa10caa70cd5a887554b23cf9c21d0d3d5584194529d6bac7af1ba6116d9667cebd16786400501b0fa39d7f3224ea1919a9c4b636599ee754aebd4be88799 create mode 100644 .pnpm-store/v3/files/36/9042cd235e19912bd4f3e347449a1fe5470294eafa781764a327f3b44a0f41c7fdce527c0b509f3fec8abc8c941ffca2bfaacbceed8a30f6a8cda1a2bb182c create mode 100644 .pnpm-store/v3/files/36/9285d798df41306fae053fcc41986525a1b35c4293f9f4ff988dc206e9983e2c92ee1bf5db75e520d550227f6afb036bdc0a7bddcf08d961f38770248ffbac create mode 100644 .pnpm-store/v3/files/36/a00307c5633c52ccd95d15bc751ec30c2cc3465605a21d828fa2787b4ade16ac2f3e2a78246361ca9f07a010ac182044aa69285f0be76fd5a9d56c3b8ec397-index.json create mode 100644 .pnpm-store/v3/files/36/e297f9a8a7557e9b52952bd34dfc91a7796002080d2b1d905b97a8fbe44a6741f4f0f969faf00c2ad7866d0a7e88baa1233d094c9236129aca6fa75d9969df create mode 100644 .pnpm-store/v3/files/37/0449f7b775e82ef91f44577aeef361358c87e55581b3f3b4e9ed59b70ac151e4bd5fefa1279ff40cc2b38598879dbb2e7403e9cab3047c16e25b7773714948 create mode 100644 .pnpm-store/v3/files/38/3926abbe16fddefe60c1922d5d77d20f1c9577e2b1293f2227f0948d75a428f81a0b8bf5344a1d6ff2be31e313cc136519b7999e51ce171a09cb04dced739c create mode 100644 .pnpm-store/v3/files/38/3ea082b51b0c4e5306fb2abc56243503e80c97e38928b24e3eb2ad8298ed9642c98e3fafc83cd436d1c7ad26cfadcf80892d699034ef7d774fdd0501a81a3a create mode 100644 .pnpm-store/v3/files/38/41112e5997dbd703d3412dfaf1aeacc33a724389c10e4c018c80f7b39895e497615ced5d8e0d74d202e2ab312adc001979be8b06c782b55dbdbb6e9be90768 create mode 100644 .pnpm-store/v3/files/38/520cb5564b6e8ddf44da646191d782b9f085f45812846c59bb2bcb4c77d0413d842566ca9b9509d4e75bcf68266fc670b0f4f9c3b912e17b0432c50212de6d create mode 100644 .pnpm-store/v3/files/38/9d7eab066b0c3fce0eb80e69547b4c809394e9ca64445f2d5695478669d3449305411582e429e3cf603d0987896974cb1eb030a1c86b27e006cbccc4964816 create mode 100644 .pnpm-store/v3/files/38/bbe0781bf7bd79679c918802008b60a8e030453ec011a3d3b310fe7c4068e37ede62f35fb9896e1458ad51a256f1625edc059647016bf4ed9a0947cb451bcd-index.json create mode 100644 .pnpm-store/v3/files/38/bc68e1bbb9134c968df33ab20b021d400f3e3727482ca188f47e6b88a287b0e980bff42cfa8479bc68981b3099c02ec9b94d2905721c9336015504630e71b4 create mode 100644 .pnpm-store/v3/files/38/e22f0d2af8645c42f7b27ed86bd252a1849cb494a39f34881801e0315dce6ef64093b496be832bfe8842f974102aa60414ca6bedca01fe12114ee8b5ea56cc create mode 100644 .pnpm-store/v3/files/39/1e205076a61c26f8fcb07fcd91e589b6ab693c882df16f448ce09899c46fa9484c602941497ceaa6897136d3c9f4df2d546e7cb1bf2557aecf61cb5013d15f-index.json create mode 100644 .pnpm-store/v3/files/39/2947ebe38a35d55593cf5a76e5070824729b83489b67bf60cf5123ad8b23787372292aaa8ddc2fbc6b4998c4f54cb38ae5d75686d2f9c1d2c028899d3a7aad create mode 100644 .pnpm-store/v3/files/39/49fcaaec387ece6be69c3ecb14043ffae57064ec15da92a050fd912d3bdda1002cd7baf225618741eaca39e58731fa55aa321c1b2eb43478842de07115cdd8 create mode 100644 .pnpm-store/v3/files/39/89562c7bb9cbdea3aad91322f90ca9d5fed1107f01f3e8a5504a3277cd390e78a0c4e8270649d1f3d3f5bc782c121dd5eedc7a1d4d457169064cbb01092bdc create mode 100644 .pnpm-store/v3/files/39/c8eb0fe5dc56d92fd87e0b1fbd2c438f6e29b9bc04f6d3f7386bcf72b960d648ff58ec05eea89a62315f199e66a9c5a7fc5690eb920c780c62dd3e06397ab7 create mode 100644 .pnpm-store/v3/files/39/fc9206a273c8fd54b104192e30314f18c8a1a46444985c2ff628fdcb0762b85110e613de68cac0ce78e916dd6b2eaf020994ebc13462a32aaf12e0ad3fc3fa create mode 100644 .pnpm-store/v3/files/3a/02cb0cde6260b4ba01a2522a42968ae4fd0ca2adb74a69c4c90c4c5669889a592d2d6dd88b1169ab3e9d0a5eaa8c62bb33885b5620cfe18338db12c2b048f2 create mode 100644 .pnpm-store/v3/files/3a/20828939235f6323304eb7f347a404327c4691db5da0b9bb7cca648a8a2b25a5433a795a7b578bf180a4b740c2d8d85978e20e5f0343c4add7c16278c3ae7b create mode 100644 .pnpm-store/v3/files/3a/43ff7804e38b28ef0164b7ee0d3c27f86062d922fc8ff81a99f07510ccc756623360963a462f57f0b45cd80de1595feea98134da30db6104a0e9915ca31304 create mode 100644 .pnpm-store/v3/files/3a/6549436bca6b1899543943fe081841a08f63bf7dc5e3f31f8eab4364faf9569c8a1b3043e044c115c95da804ad37830c0fb23ae2b7653da9cc0e7e5099b562 create mode 100644 .pnpm-store/v3/files/3a/794f33eb8988588be20817a5be190358dae908a6d3dbacd758b03fbc705e3f7a373ade13e05c9e7b93efca99ea69176d78116fd023edc20b094336bac676c5 create mode 100644 .pnpm-store/v3/files/3a/b16d7512584a6f1c1994bbaaefb71d2c4b74e96bd6cb440938a9876fcecb1ba5aa3690695984706cbf08cc91cef50aad77fe51943c3cb61763655fb0a32911 create mode 100644 .pnpm-store/v3/files/3a/cc1a2cad6f6d377497e6e86d7452cd3e99c9947659ff5a75893a95e019f6d57f0c9456289c3a4315e9f86e32cb268d70057064ce3d03ec09d34bded6a29bae create mode 100644 .pnpm-store/v3/files/3b/2ce9f5bee5207a09f6b92554912398009715231c20c1d370419692c19f4e3d01da9846e32d2ed233c3327d65ec5e6a7996be35262050fc4c942e741edc90fd create mode 100644 .pnpm-store/v3/files/3b/73e19ae699be44736a49eaf74f43583c2bbe1eb44c5f2452f3ae89c807c89e59046b66ff293ec9ed25b711875150019d7c97361b7ecb62a09378db68c04963 create mode 100644 .pnpm-store/v3/files/3b/822e11ac56b5ea5d22c35b3da413c700c4221ca0f863c3c67f67ecaa2aef85017d3f2e7acde7a1f6a993f7b5cf9019cdba38dc23122d7e57f5cf6b964b32e0 create mode 100644 .pnpm-store/v3/files/3b/a3807dd5b2cd649a6d07f44e3ce61a0aa5af15cff0a391d9f57315eb8bf68c70ae68311299d0be33c238b14134d3c274c41041b28e6a113fac577c8c9217c3 create mode 100644 .pnpm-store/v3/files/3b/b8578a9d44dcc3d19d7ee00f634ebdc5f437dafe0fdebe75cb6250d655df615d72ef78d3704b7376dd65766a2510f5af7eee089a87623052ceb4af6d322478 create mode 100644 .pnpm-store/v3/files/3b/c077018941f8c44d586ae678fb3d9b0a30d30aeef222a576f25282b33d3975d9928e32592877a34f35ed1755f76260770ec207ef178677d39aff9f3ef8b858 create mode 100644 .pnpm-store/v3/files/3b/d06e54108c1d402b41b37b7d8fc48ca565919f889b2ad7c9276a217eaf4b9b66c9757f43ee639705e48808891bfc0969d64450aecdf3e74c4a26a92f04b5dc create mode 100644 .pnpm-store/v3/files/3b/fd30c7b764adc8bf233f376577144af0b3a97927a760b0b594c53dbafcbbc922c6e97d25f5f7cb6bf09eb822a2dfc719be589794dee3d521f6f04d423916e9 create mode 100644 .pnpm-store/v3/files/3c/2b17e498186e983719bc28366e93278b1ee25f3337b5f09624924a11d9b369b4c66b8e28753519ca540a7b28ae631fe51f2f449070e612db707eff467db5db create mode 100644 .pnpm-store/v3/files/3c/74292379b64c962902ef735ced73288ef351cb0899a9931eb19ad0e6b0c5ff93fcce590ed445382411c97e2f653b8da2bad8bb34d70fd1a6ab99ff8b7c9413 create mode 100644 .pnpm-store/v3/files/3c/ec2d917659aa420d22788d991493b910265b6ab785dfbff0a96ac489c9885ab53e81d8dc7487906553769bc7432825f777a8f661aa154cf6e159eaa2cfa1c0 create mode 100644 .pnpm-store/v3/files/3d/12eb1cbfae29e49687cf70b360a3782fa4ab569dbdace642f627584b7387a052abbb3a346a58e0282dce5826094ab2d075e3af4c665ba1f00eb32d952fe526 create mode 100644 .pnpm-store/v3/files/3d/1496361e64976db4b4cb2847700ac0bed147c8ad5ac22d734da2c2ace4768c53ec3783a91b9b0802040f5b04bd77c1ace4cb8bf2be66aec335977518e1c69e create mode 100644 .pnpm-store/v3/files/3d/4dcd44296e4597c2b64a5ad690ae2e8346b9ba0187a24bac023ac62510e3cb1ebda8e481493573ce3b23e556e445223b21aa720cb36bd09b1127653e48032a create mode 100644 .pnpm-store/v3/files/3d/a2b85087874794ece4213da38f04bcf4a3ff0624172c6140896732626de6f187f825c96df5eab7c8fca2fb7ecbda99a71048f83590595db490c788c42f724c create mode 100644 .pnpm-store/v3/files/3d/c836e763d0fab501eb8b7b54376620ed66249bfdfb38b3d411d737df1b987a052471b213e83349a50eed1c378098ff8856b79b606256a725d6a76858d5ff16 create mode 100644 .pnpm-store/v3/files/3d/ccd8e0329ad5c9b9530962e045eaface46a6733d3dd35efe795b4bba9bedb683f666de6d8eabe11fe7512d2dc4935ada78c527d5318d7361c9b02c9e598107 create mode 100644 .pnpm-store/v3/files/3e/081ff30bd7e298cc9f723caf7df3d348d97d4800136dab81f8136212ae73bd4eacd7076c8d9bebfcbe21f6efbf271195487c1c73d81f91d5b01752911e863f create mode 100644 .pnpm-store/v3/files/3e/30c21d684269a7399f5e5084731bb37bf2af9afeddf69a46ce37591468c0a8b0c4d50a8fd209cbc458f760f77d7ad686368ce75b5108b541ae18b3d6b338a9 create mode 100644 .pnpm-store/v3/files/3e/4ec1e64c6b671d4fc693232be2c730533a567ffe3a4294a36c1a2e85a84511d0f8fbc39c1eb03f125ab97826049258d9e849e00efa8998b21aa745388b1569 create mode 100644 .pnpm-store/v3/files/3e/57992f83bd6312c5f3c284a3f7727e21c21b1796f700f6421a932c8d2fe7bf007281fd0dabc78adb995dc1cdf088e644e62ca2d1cf71b837632b539608f60e create mode 100644 .pnpm-store/v3/files/3e/63fa890a331fa266157516286da9e2a28e39a61ac27f5d55bdce0ee400e712fe224f63d7ffb6d0971970f5ccbb252b80fbfe0f3b3e44cc384e35ef123c36d6 create mode 100644 .pnpm-store/v3/files/3e/7a0d4541b07d7e52d1d595ba4298ab3a5792a3be8eabfd0e70affa527eafddf8201fab8294d42bac031913b1a74031ba1bd4cdc594924ef8d85b5045bbda29 create mode 100644 .pnpm-store/v3/files/3e/7cee05f579aa32c563a658828c3b5442523357303fdbcd20c3489a52dd9b333a208fc0ad2d12f50aa156dcbafd00830b68765b1ed99033a130b6e28f734a7e create mode 100644 .pnpm-store/v3/files/3e/8fea77bece17ca5634337081b8881493806c9167d75db347f715baeb3c781657a092889d3c4be7eaa777f1ee1050e5ab4941205438640150a860add4e6f944 create mode 100644 .pnpm-store/v3/files/3e/c6e93f11269492ea8dbf75aabd8086352d63c8834a39b5c0c91abbda6708cf83a94e48b668782e349ead5cfcf374155a1861f5af9644cc6fc67454b4dfbafb create mode 100644 .pnpm-store/v3/files/3f/0d0db7569a8ab1a2974015be1bf62dcd4d75aebe663975a07a65d1192197e6a8df324e1a4052e35abb6299cf2c7cafac833dd612c8357a1088e83c08ebc065 create mode 100644 .pnpm-store/v3/files/3f/12e4569ebfa1f61ea4cfcd6c5811f3ac99488068e670f1c882f645b90d4544c570144a42539fd665b2034d4a1d2d25af654f67b774fde00ee7e85b0f3344e5 create mode 100644 .pnpm-store/v3/files/3f/341f36141a76060dfc904feb62e45011e54d3058bfe2aa0db245f5a863cbec8d682f2dc415836f1d65b1b9ada325dd557356775cccc8a0f9adfd86a2e81e02 create mode 100644 .pnpm-store/v3/files/3f/3c6989530c087d3888e58f25de26567cb8321f218f301c36c2d0f05c2072d4a5e6850aa1304115ca3cee47ba67dfa2d44233ca8f2cc404f4f9431366690e8d create mode 100644 .pnpm-store/v3/files/3f/3cfb95fa0f92b751bbb2dadb4d06335e8eabe46311aca2dbbfaefd3038da2029b242262b4aa0f18b3407f758ad06d478963f3bcc237fadaada19345dbe4baa create mode 100644 .pnpm-store/v3/files/3f/6b59bcddc46846c448514e7936b14c288a1871f33da570752d0360b0e45e9ac39a4296f43e86ddce6fd87a9b305dc3867a3c7b0f27cbd8f2bc37ff4a3bcc36 create mode 100644 .pnpm-store/v3/files/3f/80940711e99e5d52fc2e03056468bc29b4d9624f82c5271b10eca3b1a3022e0ef0898169f9c44a5affaf3f56e8a6334271a87b349b58a10aef110a4b0ca394 create mode 100644 .pnpm-store/v3/files/3f/c87b252e2a626a6dd52eaa0776bd36c5c1c31cbab581288509615c4fbbcd16c1b71d93687b8c0140b99047a73605ccc5c04870769a9c7bfef67c45fceb6cde create mode 100644 .pnpm-store/v3/files/3f/c8d70a7682e8e3ce4989a71b32b2ab7202bfb6d6259a7328bacec5594f3a917a7147598a39e445ee0b222b983fd10af8adf6f99f7fb1ac71d28c84ec0e0818 create mode 100644 .pnpm-store/v3/files/3f/cf36ac9e6c84211550a3709b72b619aeff0c3c5f7d62b148e52399d50b3d1fc7118d738ac24cfec003f4ebce05efa9b1f073f79910622217db26b147b4adeb create mode 100644 .pnpm-store/v3/files/40/195b04728e91e4a9f10e81ddc9211163c5b70caa728c54a5d6fa7ff2cd6d1eaf6fe2662000a53e2d27be52ec136f6d335cab9a4e825578de1c72d89bcca192 create mode 100644 .pnpm-store/v3/files/40/296a95f4b166d135b0851c1920ed55e1366f834f9adbc2dd5c03d67160f2641ad04e597e7056f5dfff0fdf133d8abb6cf44f13dcbd147b44dd52f5dfec63df create mode 100644 .pnpm-store/v3/files/40/3f36641efddd6ccbce4c71389df2fe0771aecea50be2b45a93ac0e9b603babcc8c7b7ec674da5f39005197c11f461f9fd620b4778b20ed357b945a0b8be6c8 create mode 100644 .pnpm-store/v3/files/40/42c22dd236423d2ed901c50bd9e462d72aafc4595f7942d60d7d1defad1eed686129041c83a845731bc1f1be69cd682b2bec3db6945795b431099b3995f501 create mode 100644 .pnpm-store/v3/files/40/4e1abfe359ae6f009a2a67a7b0ad1ce75a12184ddd4f6ab6b78d6f600dc54599b2eebe9d7f562c2d8c4efd4df8a09efe96a2472c17b1452effc408532a3861 create mode 100644 .pnpm-store/v3/files/40/578db34c1c7b660852c1b02815d0412d3fbd93ae0566d8b69ef6a842d5477d4bb1cd702b0bace9e2e7ab5450d1cf3c701e15f8a18318f4114bd9ca3d0b7677 create mode 100644 .pnpm-store/v3/files/40/78ca3b7978a828d32d7da76f1d8a893505893c5e1e916864ca6655fb4164aa5072411c9496ed982f24993f312998869f26fc6232e57e35df90103432c724dd create mode 100644 .pnpm-store/v3/files/40/7a06b5cc89fd8fc548dae4099c2c487648bd8e13f901bc9cd33b20856f0ab17fe1d7bb8b491e74cca35736f11e8229f4ef771ca5898f7df174dd22e63864ae create mode 100644 .pnpm-store/v3/files/40/8793f0c36d01b770525a85f95bd29e58115a54a1a11d5f70e95a9c721ab0a154cf8eac5cea4501ded010acab79bccc947c28510b4c79d2f0abf846a54723ac create mode 100644 .pnpm-store/v3/files/40/d8012a6af541921b9478693379b1d85cf3f11c13a3feccce6e1c0fce2cf5a2ca0a4b2c00ceef50ec4dddd8d373f0f87d9b60f97d25dfa106e7a362f51c714c create mode 100644 .pnpm-store/v3/files/41/0b76394ab306757ba0e4f59ab55f8ca9995742017cb99d2e1fbdf088f81c8687e0d4cec6b8329515b8475582e8c78ef27296de51e05b98d1a3ad9121a24726 create mode 100644 .pnpm-store/v3/files/41/24c11ac893af6cf3ad93059f94f2f4dc7f3e647427c19a7bbbdc5794f3273c788b6e0a93a0c3bee30c549670695eb6094576fd1f30527f8939d198c945496e create mode 100644 .pnpm-store/v3/files/41/2d6b31909dec93d944725e150914dfb09f6f3540e17c7b9bca30a0629a8ecc3e5b6ced26fd4317a9c244a95c82d4fa471163cdda9dfa5c99320daaa083d375 create mode 100644 .pnpm-store/v3/files/41/774ac516cee99aba7463e171f829bbeced4bec74fb43ecaab42eee3e129098f9c61d8faa8512cf07c871878acf9bf8e9c448301eab5f7418b6a92d6c6608d6 create mode 100644 .pnpm-store/v3/files/41/b2a2795989b535a75cbdf7db986a9c6fdd7e95f0b6c452f8840ea08181da410b100dab951aa2cb5c40f65d3f0928b55191b7c1d6c6e03ca289ed356a593842 create mode 100644 .pnpm-store/v3/files/42/19fd339ff2a0e04d39acf9b78b56592567f9436eca606a758646dfd08f54720818d7d0241a89153da7ef52665bb35eb42148f3c96043116dd9a1fbb10e54e0 create mode 100644 .pnpm-store/v3/files/42/49a57740a297801d6edbc7f3d63800c09913b39b96a364292b95521b0bd8c3c9db139b216241ba46d78b585b199dd5feead59c57b90426b1443f5a6a967fcc create mode 100644 .pnpm-store/v3/files/42/52374e2d375df6666fbe4a3d15a895085a64f5a4f1928ab810448b368c5244692a9fd3a3b972f4e2818a27fcb8a60efcd6c7cb8c5075bc6abad821eaeb5c2e create mode 100644 .pnpm-store/v3/files/42/54cf31d5abd17959aa133b60ed9e5ceaf3f4770d904b422f1b324c5170a16ac52fe911f27cb0690cb2657aecbc3c34eb1149583006b0ed27c3957fc9f07dda create mode 100644 .pnpm-store/v3/files/42/87e1503ba993c273c3d458c4818c660eea0bfc0e6e230fa8cfd8c8c5d1a85d5419e3656d969f1d50eede9920566d1f07fed3e501418b7e199bb2c8690da8cf create mode 100644 .pnpm-store/v3/files/42/90a939a6a96d76bc1a4b2a4b4b250a43b16936d2fdd9a6a98dbba3fbf94d14f6486500d1c908d57a8611bd17a2a8a90cd4b34061a56277bc32a69bb576a70d create mode 100644 .pnpm-store/v3/files/42/a4172e7583cf37bb853d31df85c1d17eab3dc5e7684519799d3acebf9f26e83435492611345e0ff2f72edc1be6ae9594a8481caf67ed4ab71d61a65f26ed1a create mode 100644 .pnpm-store/v3/files/43/010706a8e21df76faa508f4d6bd9bb36070d32e9f18616498724790490a3031eba470a9fe77ad5f863caab6d46e9b8740817d2eb0e39f16f215d682e38cfb6 create mode 100644 .pnpm-store/v3/files/43/0f5a3c80d16bd093a3f7c77d9c44b324a813211ca0279aeef14d0d911b0ca2ecedad98a116060552bccd9fbfb2fa6604d5d2771643c51f9b23882a44e251ff create mode 100644 .pnpm-store/v3/files/43/396da27c91855dec0aaf82b3abad8e1ce80db892aa03803e2c962f249e84269dd08a7e991e3344b2cf2af06fe6663115b388f46db2af28d0dfe2b6001b5c32 create mode 100644 .pnpm-store/v3/files/43/5eb32a834712806321673266886aee86b978c4989215b9eee05abe54e8377a156f8e5be3cd73a0cb5b0811c6009cc48fb3885119f2ee4d1174b7676929486d create mode 100644 .pnpm-store/v3/files/43/65c9f9ce257e01f8e203fa52330927de30069b70288caa3b495cd3a6bb3aeb42b0284104e2a29e8b4307c1133ac62c5bba3da86ee9b365e4744324d15a9392 create mode 100644 .pnpm-store/v3/files/43/dbda6e06b6189031ce1e262456cff87f240a17124b624ad8d9ceb7770643c0c8f196ec53df57e86220ebd4828ea91a886b4ccfbed87577bbcdcd00b60ca628 create mode 100644 .pnpm-store/v3/files/43/f19f066857d6182e551dbc36c8216081a2962ee819d2f674d53c10a011fa7fe6c34003f9fcfcfd638c529c6fb34f2bfead34dad6216d49250b111f08b98e42 create mode 100644 .pnpm-store/v3/files/44/5d717e2c39b16a19f143fa5b50fa3047f9b2deb03148f69d19a0734eadccde82e0137ac8bc7449f15b02037275cdcaba1ad55c161e4a8baacb211734a040d2 create mode 100644 .pnpm-store/v3/files/44/8f9557e72e290f84f681174ad43f5f3624b28d6e78ef2743c003ca3943ad65cfcd36188173bf3df63531b1679f325aea4eb0304acc313b7b5088d9971fdf0d create mode 100644 .pnpm-store/v3/files/44/c92653941768f40d6bdd80fb6f85c51ced950853d689481d8fbd29c16678da314ad5347eb9308207ffcbf06a96a0bfbf3a0562c814b4ffc2d46e3f044197a0 create mode 100644 .pnpm-store/v3/files/44/ff4d84d1d26db6c828edfa5682d8a85b79d275b4728aa31c86d33b9b5a26a71e02499b5802723020f6241923fb296b34156398720819a0e818379bc9a98aa3 create mode 100644 .pnpm-store/v3/files/45/2aaed5412e4a5ac18474d60bc3bd1673e339db8db3833bac9e2944aa048edc75cd434e3cddac4971cb0d7f98d963db1c8c5bbe0e09168d8334011f3c8296a1-index.json create mode 100644 .pnpm-store/v3/files/45/3dcd0d032fd4663286cc127c1f254b97888e40f8354f58ce602ae0691cbcc44bb8dbcc24cfaa89ed558821173939229526731cc7c27ed409b69f7254cb80e2 create mode 100644 .pnpm-store/v3/files/45/5875b569a6055daf4bcf0724a5ba1d9447e7c4152d1dbb4feda2f653ddf8382d97ecaabc0e5f73d39ca71a41a17e43c92f1b19291989299ddd8844d5c80abb create mode 100644 .pnpm-store/v3/files/45/5f6c228ff2cb18da5ba82a26ccbf398d5e68b3bc469275080f4e669471e3554b94a7f2aedb1de2fa75e0d1e438a68d960f113b64a755b648049ff53a1b861d create mode 100644 .pnpm-store/v3/files/45/654107cfc6e5e1fcd2f22da33c5a8be8693b612cab20b97828f4c5b968255fbff97a8eaae7818a6228b56db13bcf455e7ba24285906b6452a0eb1bb5d7d38a create mode 100644 .pnpm-store/v3/files/45/96ae754d3cc5984814758c1d86264c990da73638367dc75c228f74488c8753ee9199cc59182106cb8a96f611e6b5365402ec2c3a20c9345545e85009ef6e2c create mode 100644 .pnpm-store/v3/files/45/c5ab76b6e590372916843b5433e70d7e3a8f7b2de02770300b67df14149a1fa0b5acb969c79cbb777f0a9f3aa400c3bb74f31ddbbfbbb0ab096c4b288d65af create mode 100644 .pnpm-store/v3/files/45/db586587fe97c56e71e9a6eece6e0d191f94c40b879f743ffd73c8aa1350abbb95d012a5bfc9c6bec3f87fbfa0d238626419f5e75059dac1c6037daa8c832e create mode 100644 .pnpm-store/v3/files/45/e413db9e6189990ca1c9718c2a53a6bd4c260fcad9428061f5cd35c6c40dbcfdba6a36f1797aa0de644f74c142333e58a5083f7b648fc01a2e1da23d80d309 create mode 100644 .pnpm-store/v3/files/45/f13b191c39dc89dc646842f1c26d5f19eec18015c0ef4a76172ab9cd5c62e9f42b42f939fe4a07ed4f1a13eb157f45bcd6678e63744b7c969d2b96e1d26e93 create mode 100644 .pnpm-store/v3/files/45/fb3f4ef3740e9bacba03f01f8031bd5b9c65d35d53db7b0ded284152b7243910c0c282f1926a5c91fa638d9fb8d6b499c04c075716f3fa2df31cf1d62a3b3e create mode 100644 .pnpm-store/v3/files/46/436cdef1bb6fb3183688711bf9daae214335eb6629da97ffc6007002b4afbe27f4d041cc05f91252c524f56daaccc9d26a5997cd212b7bd3eade8d3249351c create mode 100644 .pnpm-store/v3/files/46/5a4594939b2d00ccd0b37b8a2358dae4594765cb03e067d5c902c06087a0c2d8354729764a9ef0a077ff7b8722f15e93a93a70854e08e1f3d09e76d8361cb5 create mode 100644 .pnpm-store/v3/files/46/a434d0dda4f9e8c62152c002fa8f796e710d4405d55f39e28a42d262d4ed314f6990ee7a4fc1270668983156c19464fee82c36148ffac92e95e6a9eef8b99e create mode 100644 .pnpm-store/v3/files/46/d7e23216df5ebcef605e3587553d164dc8892fc9f399c1af43e712b03f1c4f5527121d2e2fdd0b52a911c3e37488a1862ed226472e53025aa30042cc7f1393 create mode 100644 .pnpm-store/v3/files/47/410461c629e7ca93be006e72e4d9b2bb0ee55e9884f815004e5bb753d9d8124308ac4f216d4a6e2e6231be315f942ac9695f67fbabed285870d88ec7058dc9 create mode 100644 .pnpm-store/v3/files/47/eb15c9a903f1525ce175793b9b1f117111f085f1fd790a1efd6374d9e08ea5fba6621451188dd7cd01b28f43d4f3c01cc81cd7d8bd06203f135fea3cc4abf7 create mode 100644 .pnpm-store/v3/files/47/eec00d4eed421a2c0c3eb5af43fa8fea45ac9ebc905253a3f917d0522804f023fc60237405341fbe4afe8d493ae899a5f163d550643ebf00d5932ee46e9927 create mode 100644 .pnpm-store/v3/files/48/511352f6fbb49a667caea95aeaae455fca5f93cdf284a9f8b4c5df995b233e6d59a622a2b0fd009632fb077fe9dd59b7e0222f2601a6c6d27c993c0eb6d7d3 create mode 100644 .pnpm-store/v3/files/48/5145f619a09b30672c522481649d0215bdd9dc06c87b89560728cad093796b646e031d7b2f8b73585017cac1028411a3a61b7ab76cd0228be9c56b1ccd991a create mode 100644 .pnpm-store/v3/files/48/71c1362a7928127f76e6bb64d2f6301dae66151de794b005f2572e433a7a1887a96bc4cf15d86d24f1f49bf1b783e15d783b3d0feac9b147f50f6f4451d608 create mode 100644 .pnpm-store/v3/files/48/aa588dbd0c465b8fa2429ec5b93a2c3b039002c01a8908ee970adf8e448aa7f13bb2bcfeeb38f3a3da18d2f34e42d3ae725755099d0baa93b190303219fd24 create mode 100644 .pnpm-store/v3/files/48/d5cf7aec3adf54ac362655a781b7625acdea2675c7fe9ed8e92070de1b6b252f27766154289dc4d6bba4002e0f53b323a5f225278f6223dcb429a87697f8cb create mode 100644 .pnpm-store/v3/files/48/ef701dbea9874fc5379389c47e0c88fb1c19a879c2339dd1146968bbee06ff60f39eb9160bb4b8cc921443eac0f1e2414f74cb3276163458286ac0852d718a-index.json create mode 100644 .pnpm-store/v3/files/48/fd1fba62b8780534079cc3d8e0a9c26cc163fcd319c7d858b0de02bfa94201b90868b3d3687c34e8a5158a689b533736b6dcd590debe60fcc199514ad3a32f create mode 100644 .pnpm-store/v3/files/49/2289e0e39710ca6047d345f81a423a9f79c155794f856f322b3df804d2caeee5faccb15d37cc97ef0c3c57d120bad269d37184d79b96e3a079c26c59aaefed create mode 100644 .pnpm-store/v3/files/49/2c95a1043dfd0ad18a6802846184ff56a0e7f446b3b1e0b949654b2a6c5afa5ff2eac55c51dea7e8cb006d0ff622f93dbf80e48d7e14bebe1855aa9845656b create mode 100644 .pnpm-store/v3/files/49/3ed18ce3ead2b0d14754db859da673693c696b50d92221b041a603671f4fa71feaef6fdd60b08595513b945b66705c6cda817cdfd7affbef1a44e2abdd4061 create mode 100644 .pnpm-store/v3/files/49/406e710f1a31b9f3c880b7a5c10ce2bdb383fee569e641936c173eabcdbf22ce31d0b896d445cdfe1b643f6683ed426042f0b0422689bab18da325b30d7563 create mode 100644 .pnpm-store/v3/files/4a/35301b328ae4256a9fb1a0fb7bf7855e3b654965ec6706bb4bd1dd108b3b882a11f1656563131e69754a5dac63558071ada255c0d1bbe769d112f1446fdd50-index.json create mode 100644 .pnpm-store/v3/files/4a/6198e2c684c35f9bc04d6d87a4bf71998fc73fd0e095ac97b2ef6d0224cb6b4a137e544b881dd0c8f3a9fafce3fe0e0f4b6290659a59d3236bf9d62f93483c-index.json create mode 100644 .pnpm-store/v3/files/4a/7615dcfd1d01add1f81fd89d92827efa30c584e44cae94a5270ab46d8ffc85250cb54f24b3eb30edee5e5065fc1cbbc5706137fcbbe890a12edd8f29ea6662 create mode 100644 .pnpm-store/v3/files/4a/79dad6d1d7cc5354339d7d9c1d2a530c7b8e3ef21460951634c834480ea50fc51f179cd71a349a465550c54b4978c1d2041a92866bc82a4f398af488ef43ba create mode 100644 .pnpm-store/v3/files/4a/bbcb9fabf85e792c5b685289431abdc33bfbc424fe74138a267732eb4d4921f03083a8c5c1f2d45e9904403ac82b3b3186fa71f719e6d23f49aed0de2debb8 create mode 100644 .pnpm-store/v3/files/4a/ea9711c68947eb8eedda51fcd49f771d98bb12091b5023e959eca20cbb1a73cdc5a08fc154662447b22cfe3aba44b1f8b92f36a6370e573794bb44f2f2aa70 create mode 100644 .pnpm-store/v3/files/4a/f00313ecd8e32344884cf774ab9e8c3a775fb20e78032f7423c0692d1c1f28831843386d20d300c34a76d1ed6c1ff02a4f08517f64fa1133471b63184d8cb2 create mode 100644 .pnpm-store/v3/files/4b/384be1993df4830bc5c1ca84f95cff368a045b067e8c2554bef452ce27d32ea289e68843fd67a32893c9f1753b56cd30a71944ba35b610bbf3c58c9fd84379 create mode 100644 .pnpm-store/v3/files/4b/6a2c1432fa43602fd6581adb7c5002fb96063bf91151784dde2481708d87a5dc95a5561f5365500a905f88c838243aafc21b19eb95e1edcbec912da72f5ced create mode 100644 .pnpm-store/v3/files/4b/81bbd31fd5ddce528fb0ebcefbbda77891f124f7fab9019c5ff1bddddafbb679b5e3d131a94c02b495e47327985fa5ecc613f7a2a109e58f5994b358fc3b0e create mode 100644 .pnpm-store/v3/files/4b/85c45b3348e1e5588a616f799c4ce1c6fc492573cabe3c8ed71fc2b0a2ad86f5f7646f2fe9d94bf8cb4b07796e7bfba31d1069c4445c5f6cf5bc76c18a957a create mode 100644 .pnpm-store/v3/files/4b/8a77875eb9248a8112636ce2c874ef0d6e5f667d6f08367cc8ad679e4a1e80be26950932c1018310f32f64eb661e1b8f666a0892c333e6c85b93e04c38ad84 create mode 100644 .pnpm-store/v3/files/4b/a4e8de0b6d93c4b71d7f4d61a4fa46db8af9c7f9630cca7e9487e5f7b3b53c125c191541b20d8362b69482f326ddf79625e744475bd344b135b74b51fae9e5 create mode 100644 .pnpm-store/v3/files/4b/b8708acb57472fb8f3a0f3a36f0ee58f3f9510b080e56722d75669008648793ab5f58094769692494f99c2cd91dc1629264248d12e1cd66685ee2d6b014756 create mode 100644 .pnpm-store/v3/files/4c/15d52a55ca789ca1a9d2fcc452916f5051003063d1588863297d89969d515677b4f5e730abae2c605ad8e752e14850dafc1eb5bbd62d62ca42512acd1e1482 create mode 100644 .pnpm-store/v3/files/4c/3c711bdc76ec7cf323db05c29f27d165d0045475e26262c7aa14b18e0748e7da7bbcb474608d0bad96b292894846c94327ddd03499c72502a2589d010ba42b create mode 100644 .pnpm-store/v3/files/4c/7c3244d736f8860211d2b365fd9d2e2d8f39e8a58f8bd05869937c5f99f483ac59a53a67eb9ca5ca7c70865d561bbf80c7881be5e7e70899755f2a0a8f3796 create mode 100644 .pnpm-store/v3/files/4c/a5607d9b07967265ea50583d3ce11d971b020f9838b4d837b8dab6643dd4199a2ea997cc199912ca5d31c72079a73c4662f51a569df6810893bc1c21711c34 create mode 100644 .pnpm-store/v3/files/4c/b472c278cb7ab2c2da705fea14ac03b6753f397a1f6f103281e8965204412920ffdd535d523f7118f365476b9d8c965be0ea942c62042ca865ff4468e1d447 create mode 100644 .pnpm-store/v3/files/4c/d44d3ec04b45ea7d70b782378ecb96c4cdf7c85f2814ec47ab6fbf338797975d5546649124ea4858ca234bf5f7d61d9db2e761e726a4d8b5d7feaf52090314 create mode 100644 .pnpm-store/v3/files/4d/01be94b5b67b691e7fce71d3d2d760531ac20fe6e3b538a68f895a97e156ebf1877c72c4cb01f843ee923b2620790d127d580c6e11f3aa83eb1bdc9106de98 create mode 100644 .pnpm-store/v3/files/4d/0bd4190da8aa070144e5e6a7666209dc22fc9655206ee67cf19d0385137bf08016f4584e283d92df08193949aa5f329ef1de91cbc06af2e4fc781cc0ced94b create mode 100644 .pnpm-store/v3/files/4d/249ca6dd01037e7367abb3325ea0efeda375c21debf98348720581cc37be68098b141d74ae409116db04d3b21ba219adab7087e7bc429d93622cd5c2f444c6 create mode 100644 .pnpm-store/v3/files/4d/5d626fdb0b3fccc183896c7d74dc31070404ba6f311666cadfb3325ff2f07980d942bc7a59bc74cd3beff97c4c1fe2ee42846c2da5aed3bd107fc78b96776d create mode 100644 .pnpm-store/v3/files/4d/644a7b29c132600abca1f944b73e41845818f4ef77ca35ce7cb51ef293fdd687af63eb6f8059c8fce5c37ad84e7eeae62b589b7efcd3ec66fb21cadb7050f4 create mode 100644 .pnpm-store/v3/files/4e/298d739928bc5bbc3bcd9b8ed3061066e5712b2f56fe79fbbe26e04da13d96d5237ab5aa46c0525ba9440406b362e05ed747ab604ddf55058df37458c2643f create mode 100644 .pnpm-store/v3/files/4e/7467e3f3d9f1413a29ce4ea283bdcf5d38b3c7e74126ec51b6e4641ec3c8ec29d09b4ffb899f9b0b84acdfd6303d2f0b501c0f3fd69a7e0d8154846846bbc0 create mode 100644 .pnpm-store/v3/files/4e/ae6bc4cb70f81644f3df516ea9738e19177745837249385e5c4357be6586e50b73a437dc9d0aeac2bd8cd789ffa9abcfe1b742bde017f6a8fae9d8cc909ee0 create mode 100644 .pnpm-store/v3/files/4e/ccca0a6a205c688ca3ff755a0706d0c8f6c66f876b44005b35cd2f82b35ad6689ded916395ed9208b2542ff4bc20384d6930acc5f1bb5f8afd280a09376731 create mode 100644 .pnpm-store/v3/files/4e/e257a46e00451a171295992c484abf5c1863829a0d49ac0c09858cdb0446161b9acb341c9bc5ca692c26e3e1c1dc4742fd97bd86b61415c78a80ed8a9ec969 create mode 100644 .pnpm-store/v3/files/4e/eb77a495730b3c54aca876223dcaed49343a3c6f8a53ab2221957c0e09de6bea31e05c0953eaf801e73b5f126ea22c10d782c583a3d7aa12790aab0ae5a112 create mode 100644 .pnpm-store/v3/files/4e/f296c6348420188c544fd9c971fa0733d2816666b9315ca5780fa104b0ef2f446e7439475a76d6279d73e47079ecd83813149ea702bb47e00d9ba9d72e5163 create mode 100644 .pnpm-store/v3/files/4f/59c744ddaf1da31a86b0c5eeefde39e697b760dd20a6a83f797dfc49d5f1780ccc2e3515897297d003c885f8542373e271549f54faecf98a04b4204738bab8 create mode 100644 .pnpm-store/v3/files/4f/7f990aee5eccff9296c556c803d9dbb544c34b338fc06d195a7b6d18dd34c25ebf285dfd032674fee53278214e63293d5ffda0eea15e306ec5bfef48b52f00 create mode 100644 .pnpm-store/v3/files/4f/9d2517bb56877c3f9d3cd1828d6df7f6a305df69f8a41ccd002c6fbdb30257cc817a7710faf112ad644fe9c9e3fab11dddc5cfa8528fd49215644012db9e76 create mode 100644 .pnpm-store/v3/files/4f/a9550309b9b8302ac33e0b1af7c2b93316d3b1cee55608d936f3c6b0cfcf9b95df78a2256e05da7d96212938f6d12e611b45fcc0420f0e0f3ceb2d08dc064f create mode 100644 .pnpm-store/v3/files/4f/f271835d777d0e94b53886a164402a576e6fd709a7bba4be6a01dbd9fb2e736bfb85b69664d9a317cc22da9bc212cdc47e13443dc597fad13458a8d5050108 create mode 100644 .pnpm-store/v3/files/4f/f34480ae09548e9641092e231908bc45867ad1ec1641ad2e9428845cab39cddee125c147dfdc3b2302cd2ec008ad60cc569b6819929db7ffe3b7dc42460aa4 create mode 100644 .pnpm-store/v3/files/50/1f485e2f2f03f4b39a644b31647b6f3781a71a62468ef2f71937aeebc375d625b328b021e0c83301b6dd8b5c03aab8d450d0be4ae6bd3c54107f4b165bfa68-index.json create mode 100644 .pnpm-store/v3/files/50/489310d9abf84b628ed58e4a5da1f1500b38b70b72f24bce3706e5d7f66206acf3294e78ec0fbc40d4f7f9cbd7a0e9b31d48ecf397809eed6fc5c119ce2110 create mode 100644 .pnpm-store/v3/files/50/5f2a25928f4da9632ae6f893b142f5dd46b8efad38239867b82d8b86f051296c6292d75ddf434739bc8ac36b231534eb786c9da5857ecd5409fb92203b5824 create mode 100644 .pnpm-store/v3/files/50/6a9d80009f56d817111d55a9d8505d78762d2f187db402a50f4bb2e8e85756dbe3ba372f4a91bf9160e81e0733b4a9c005174732467a29f705ea0d3e39f4a0 create mode 100644 .pnpm-store/v3/files/50/7164fc8846371b124c44bec05fa960d41281c34eb1265e127066dfc59839ffc977c3ef590e181beb44b4ea1306e06472216b89c647c909ede0e150310b6616 create mode 100644 .pnpm-store/v3/files/50/c2df8c818a0f72aed069b47e70daec9687f7a05afd8409ff7dffd69112e15d33d104218bdab9fe141e08bf330601affce9b85ff4b72ad4df9e47a8b259a209 create mode 100644 .pnpm-store/v3/files/50/e8f86aac5859609bdc3698259d199bc6190928b7213b3fe81d336f01991444e2bcfc1569d9355bd6d18646e0d7f2c2658bf037789e42ce5b786bbc88e56eb6 create mode 100644 .pnpm-store/v3/files/50/fa9c972fbd0ff6a42aaea8e886166bee1dc532e5dfebe3ae814c8ab6fb71ccc4c1398149fe78a7e5b34d1a1704c05c82c05595fa10e2c1a841088c0a702dc0 create mode 100644 .pnpm-store/v3/files/51/2471fe8d232b3ee8f3e9442963315aa6eabc2e3a5c5adfdc813a099058cd1a3d90ced111140bc1461aa13d9b39c1ede43416b9b9699d381d807326dfb1b2b2-index.json create mode 100644 .pnpm-store/v3/files/51/7aa9c0b8387dbd777cf81f4bcf16253c833aca7e7445d37b8a03fc5abd2c4896bd8320cf4a18fc41e00b6349f3157a36a1e7ccd70f6e3c36b074800d310c3d create mode 100644 .pnpm-store/v3/files/51/c113fab7b190279a32961732bec172ba6b783bf2a39b582552b4ee4f532b879154a31de00d4b9c01e4d80dff44e721d7b362703e55e7f2c67643c7c0e1cc0d create mode 100644 .pnpm-store/v3/files/52/10c639e63900a453f0d8bf38027b2ee1226802f3b56c27ba70c8be3b3414e818c26ea907645c68ff5d5826726ca4cc600aad256db96cfc8d5d848951549d7e create mode 100644 .pnpm-store/v3/files/52/9bc54f1b705f55721ff0b8b520f4230add78d2123f659df0d6b21213d2da2f9c3a8b578a40b836f1c585c5da7ae8969b09ff2f5c64e26ffe57ba02deb1e3ff create mode 100644 .pnpm-store/v3/files/52/a3698a13bbab660a2674cbc5bbc88847c9cf697647a8b690424a505253eee948c3bd49a050f8561736aa14416e279fca322ca4255303ca4e87c24120613dcf create mode 100644 .pnpm-store/v3/files/52/c1c48e7b081a9a5efd7182f6f44ce8ea3b9b4856946badb0c5d6929832f6c8d434db610a6b2e2fe118b12a47baa491025747c4c5e43b845f12c8088bd7659c create mode 100644 .pnpm-store/v3/files/52/fe4b811c35a05fb9f790f699069a0e7de8b01c8ff1b7574f2d5c2702885db4a9d4e27bf2cf880c7043ca8ab2287b0c54a14f8bbc2697626f21be57198074fe create mode 100644 .pnpm-store/v3/files/53/0afda63e2f86526c84a0af74d9671bee77f45dd9af63945748f51a0d260f8004b1592b2ee5ed0d7aa3bb9efff2bf4c7c2f2c6d382ecc8eff91c113b7b7fd52 create mode 100644 .pnpm-store/v3/files/53/1e6b03ffe25c6acf0c6dd453d4c3756a17498018f1b493acfd8d4253f00cf71052c4bddeba158bf927afed286621c3e06c25121a27dc84e0eca37630103d74 create mode 100644 .pnpm-store/v3/files/53/24dd53dd46ad2f0f87c09f5c91511fa0bd6fbf1bed48a82d6ec76a434266f9cd643065cf90bae7a2ebf4368c089093cf5d34188935754ea32afcd42347a461 create mode 100644 .pnpm-store/v3/files/53/3b986fc78f257df1c92420a765457e303de11eee631923814ddcc66d10a0b33a309b5a096f97fa55c7f9710149a25cf5768f5920aa0f44cb9848e9d121e4c0 create mode 100644 .pnpm-store/v3/files/53/4dae81f295bdda70c1922b267c0b208ba714e669c4fe213cdfcf1ba23dc0c67f8eec3e802adbdb7ecff8d0b995e67eabfab345c52efa6b78d5b08261b1fb78 create mode 100644 .pnpm-store/v3/files/53/7d7b64ac795578364b2ea23e060e962399d74262fdea3c306142af2dbfc93fab6137dbf351dbad2594bbd9ec673a452bae92a396a9ad0bad45658cfe6ee63d-index.json create mode 100644 .pnpm-store/v3/files/53/adf3131e80871f1b6ef0719354515c56b5ec9c6d8214d53cecd78c67aa82f1f4d9fbd566099256704d63beeb0805a72f846f65566e90f66a965e4759957e2f create mode 100644 .pnpm-store/v3/files/53/b6cf79ce8b25dcb68d5c56d4bf454595196945dd690c0345b383bdb1a511f1d9649151c4b35b0e6f2e93b7d00063e0eddbb96d11e732bd2e84fcefdf1894bb create mode 100644 .pnpm-store/v3/files/53/c90c89e84e5269b967117c1fbd04eb4f91b087fb964d82eb89986d43811ff6cc037954c21173b134d448db0ae1177220c7aee039e673ada278dbffa6423d9d create mode 100644 .pnpm-store/v3/files/54/a8596453f559653e23f534d7da513e6b77fded8b3d23088d5131d029baa49fdff0a2c9c0d86ea1407db82b991c8f5ae0e2d9efb5338899f35aeb487e985a43 create mode 100644 .pnpm-store/v3/files/54/d4eb01a93f2a13b68bc76aaa7aa700739addc601c171197bd87e0f987fd59a854931051dd33ae6547b46822aab7b410586afb0e5d5f383681d76740243f2a9-index.json create mode 100644 .pnpm-store/v3/files/54/e5025edc77bb07345b1c05a811f32e12b829bc30f2f4054993886db7984ba057dc81dd0ae4231a2a604527e65ae466c0eb76e2f0e173dba74d50c3458d4490 create mode 100644 .pnpm-store/v3/files/55/132fedc50c1d255fd4219497047ec3954113613b07223b3bddea8b8f7a2e30156f1a0522fc2dbbaac1f259be2c264d7e0f1488b693c50d015f166989b1f109 create mode 100644 .pnpm-store/v3/files/55/51536173f0774aa53064f70b300f7ac5f119e573c82b635e7a5517509f0a414a00b2a063152760351c0144e2e546a2204424313a84877faf4b9c34180d3056 create mode 100644 .pnpm-store/v3/files/56/10bc8b4dcfd31f4b2862d3062f35c4d4cd5a6e34cb143f21b6bc2291fe2c5afe61bedcfc3edf17dd02bdfdf53333c33381b9ae320e9427ecf9e40a3c193043-index.json create mode 100644 .pnpm-store/v3/files/56/1ada3bee5d2dda69108ad9129e07a2745a089b44baf78533a157de6fc90fc1cf830c2a519bfc7394abb41b98db8ae929185cf84d39beed15ab1b65101204eb create mode 100644 .pnpm-store/v3/files/56/2ccd723fd1189894c90060cf0c73139a0775eb976398526db98a325a618f5732d5597b3e7d9ab0219b4abaeeea14908e60b3a9304f556005ff086610e5476f-index.json create mode 100644 .pnpm-store/v3/files/56/3b53e6dc6f24033b83f9fac86b9c5c7501dc9d3c62ef5e4c7d56bb32a374c6b412bb8cab89982e32c12da35ee0c8834b696f7ad5aa3363af9aebedbbf48cd8 create mode 100644 .pnpm-store/v3/files/56/5a87ae966fe9c265482603508a57608f1b6ec03f49f679a5a79174cfb727c1192765790ef3e4af9bac48eb8de65bb11145ff3c67c3647fe0b90184fbf6826e create mode 100644 .pnpm-store/v3/files/56/71c42b24e64979a703b67c1515359885abceff1089ec9580c7102de7e6617a186e52a73d5d1365cd6aa347e0012e5bdefaf3f42c2625f68e0274c242b63154 create mode 100644 .pnpm-store/v3/files/56/7519f260167d6b5a4a38d9dc0a46bf7f809d5cd9d954f73a937a8372a712effefc69835ee64c2e6193b85f324f8243b8f84d0fc84a6a3bb488a8c5a59840ec create mode 100644 .pnpm-store/v3/files/56/75c58885bcc8d9fd9081cdf3cc6f678c8e59c85fb4a0ec449f1f10f69c5ffc25d653af06b86c27f39e2425eaec1d006a28d1baa83348a6a52683e4f83f0c3e-index.json create mode 100644 .pnpm-store/v3/files/56/7963868a108d3e91866bf0c092bdfb7618b36a2f1666afe0854d1e24209d331f88e8b2001cdc821c2f26b26b237f6b24323a2cd39617b058509abb2b4ec129-index.json create mode 100644 .pnpm-store/v3/files/56/c18d52594184eaf83df8243fbec18951a574f54bd875be0b2e9faaf0afdc762fdde8f0b6e4f26033365dfd549f25effbeda9a14a22e48d310a7cc9804dd626 create mode 100644 .pnpm-store/v3/files/56/d579a553414b8ff44b790255568a68954953a3c98f722ef19254340b75a1e262f2cc56c6457f5699b5120f34a92030234bb475248220cfbc43af41d131a459 create mode 100644 .pnpm-store/v3/files/57/03e614d108b454607b902e7da063eaeb896f143da562ca56edde13b68c63ad123a7fa2ad93aa62bb37c246085b16e2d6e9ff181b0ae5ae7f0c8f2d63212a32 create mode 100644 .pnpm-store/v3/files/57/0437c760944990ee878ef0589f5519eb6e76e7d9d53b654d54eb9c04fe1d84a9df517a0cf3ce2854e052f0aa817d80f7015e36647877740fdbda33199748d1 create mode 100644 .pnpm-store/v3/files/57/0a6bed46aa8624118e95fdd0dfd5dc2f63cd14e1bb00db822fed90baef0d1a5f9d23c7b33f7927ac97cbb425afc980be4b62768ef7ccd0e3ed4ce6ac1bb3e7 create mode 100644 .pnpm-store/v3/files/57/33a5190d2f05125e454c0c9d39783c2713896f84e7a63b3f49afcf2f34a69af5ffe14089771bad69e083f2b037d0b51a04610882c3fa8f7b00dc8456254dfe create mode 100644 .pnpm-store/v3/files/57/57de275c9b15e82e3091f76b9f1f66aa3246e642104d14950fceef11890a29eef56625d4e3380e3a3d5e33c2f968d0f24c8c5c93b0d2b81ce4c33ee78cb272 create mode 100644 .pnpm-store/v3/files/57/a3c6db431b7f9a26abd3b26c927e3ed3f107c562b2b10cb6e7317e94b4fe6f29b5612056096089b20494111dbe0d090eb10219657ad78e3f3d40b3108e8cac create mode 100644 .pnpm-store/v3/files/57/fad82fa572c4112445ef68cc3f0c59b8e8918dc0f760e37d277fee39cd977fa64a924be25878cd473e40d152e938f1b8161a13ff58f0d51022d4e8565c0b05 create mode 100644 .pnpm-store/v3/files/58/7c4fabe5526c8f07b296adde29a91fef1e90d9d59a60a577adb0c068396303967d7e5a9b0342b98e074efa89f79cc4fd73f4b5f1d097e79b44ee7d5351a4cd create mode 100644 .pnpm-store/v3/files/58/7d4e396347f6a648ea5298c5f49536097a486dd072cd208a911704970833a6f30273df44116ffefd2559c55ad0df591bbd5f56403013c8db038294a09c6815 create mode 100644 .pnpm-store/v3/files/58/a2130472ec0479698e70d06a1afe5cae9113b32202c82b224af4a46850f72828c417d4786d25506e622e5cea8e6292941bf7fa3e441acae207387e0b74eaf6-index.json create mode 100644 .pnpm-store/v3/files/58/a679ada4829455e1ab37c0840a5e7f7f9fb8caba723281c6f849d45048c4529c48ebcdf1ed9ccedcb6886415974db232cc4158cbf40697e6ee7a7e702a08d7-index.json create mode 100644 .pnpm-store/v3/files/58/f41a92423720a69c69213eb981828bf992a4f8277f5ecf30b24eced3f17599e8e2e7673b95a97611af3e4e4b51a7cd92b40ed99347a336ac1e566e8f73e0b6 create mode 100644 .pnpm-store/v3/files/59/773d20f09dac3898b32ec080780a03dc1af3b93c77179d1472ef97b4b645e410f75281d4c4f4a8e0bd4034cef077de72541f39fc868251a44e91457bb251f8 create mode 100644 .pnpm-store/v3/files/59/d51644d1ba1232f58773dc7f4c973a689e5003dc4cc64b93366d1b86adb964514c42a1521b7262b2ae8e5b17face2a3bc841564344136af96d86bebbb25d41 create mode 100644 .pnpm-store/v3/files/5a/3c04f51b9dc1c6383b8a5db7cec7e2e6b9e2b1b112f17bdd4250f6b81aa58b16b9065195dcbbf6061d88f08699cab6d76a0be478bf66b0398572539c64cb03 create mode 100644 .pnpm-store/v3/files/5a/4947936e72229323c004bdc671a1f43c0e59fd3c5b7dedda4381107e33e6a9ea4ca4fb4b83a94eddb50677eabe3fdfb2dfa01850cf710ea0d585e5bd546301 create mode 100644 .pnpm-store/v3/files/5a/6c938669e2bc687b0108c36a665a3570c9f95c26332190675d708c127e5c9f649c3fb0b66309b64ad15a1a8847d9a182b7a7f7567b77b09620c53af370ff7c create mode 100644 .pnpm-store/v3/files/5a/a0f7d5f29400ddbc38250eca2d6eade9a62e4d1e4ccaad0a2ce36db5ec63f0cfe91298513eedac502da694dc1d61614907249dbe055117c0669a400ac4d541-index.json create mode 100644 .pnpm-store/v3/files/5a/ba9d2de4725fd52a1f9192bfcb81d8ec572cb79b2ec357aa7c3c572b106d07e6a442ef6f0235911f68faca9537345bb6ab2daf6fa6385425345e3573e21c31 create mode 100644 .pnpm-store/v3/files/5a/c24ce6a081ff333917eb634c37d42e52204a7b347e81165771de3c818c89afc01bb8965b9888af9d90b05d42772072318e687a5d00a2a5726710b3195d0ef7 create mode 100644 .pnpm-store/v3/files/5b/0afb75858928ce56a28547c2e49724ed58741807228f1d56fe70d5ac1dfbda86622df017d12dc89711d21ac955b0c338b1b9d49cb8886723185d405c3ff7b8 create mode 100644 .pnpm-store/v3/files/5b/0c0602e54144e43c366cce50bafb1f29b7ff0436f5faf56c22761a37fc69ae6528d0b6762aad2e893373d1ad4be78792513e12e263a96844f9caa12e709bca create mode 100644 .pnpm-store/v3/files/5b/2a70c4724b4dbe20fc24b9548ad30afc9f7d702b56087fcb079a437ef08c106d7e4c1db9ac0db66a9e675c3c79a3aa5c29b654b43f35c11ae88beb356c27cf create mode 100644 .pnpm-store/v3/files/5b/3308af9c5ac0b94db9ccca9e030cf72c0b7163f52077c5ad8d2afdfc99f42fb449e3adeb1532204ce32d57a59d1c7743195f973f9d484bbc81f631cae03707 create mode 100644 .pnpm-store/v3/files/5b/3ae076c139fb7786bcb53b2c6d2c6246b0f8643a595089634a3a55c5655f835a390927723814e30486e2eca28f16adde6731d1502b7bf28166919a49a0e70d create mode 100644 .pnpm-store/v3/files/5b/3ddf939669996e558fc1db027a161d94d389cf63031382689af4b7491b89168b16e6e5b3a847e90a7a29c8b04de924726aeea392d3dc88be8723ffcf52c0cd create mode 100644 .pnpm-store/v3/files/5b/3e4ec75065edba208aab774d15930d961a7b11ad1c1e86e88083cb25b61f02ba8a849c53f7cec68fb1705df238f61e37ebc3cf87099baca028ca9b45d46ed4 create mode 100644 .pnpm-store/v3/files/5b/3f70c3b429bc870e9436b57dd45836270d31568e74eca1eb142877bc6393897bbbbb24f8a9d2e89cb834732c4a02535075b7879737caa59956b21645d9c910 create mode 100644 .pnpm-store/v3/files/5b/434d7c829a98b9abdc0c899313d2c838fe90875a146c11cdedcdce179a4827680e183b859646ee896494aa116c3757e7e59574fa12075c4f9b955b733530cf create mode 100644 .pnpm-store/v3/files/5b/6d132e8257de6056cef5750a9e525cf08b542af8b0f5b7a599fb45592016b80acc75fd540e59a976233e111ba29068cd2a8c150111590c49f2ecd1d447017a create mode 100644 .pnpm-store/v3/files/5b/9076b3e75f1ff31bbeed3992cbaf7e86cb3fca0da3e135cc9f287ef3e52a893cc0d905d2e4678cd31986dbcd3494b9cc152d9c38eec26b5f5754b4e5412f4d create mode 100644 .pnpm-store/v3/files/5b/fa6328c4f9ffabf40a81c3207b10ca296ee45beea8403f1d3fcd370a4403b22ec0f901cd4e3984971d722798347c02ed40f085b35579f501af437a0e6b7e7a create mode 100644 .pnpm-store/v3/files/5c/0ccba4be29fd3f8d6bd49cf90857098b3df979e730cdcbbcf2c81120be8861eaf2b96a3686a02887d776a8d068e52a982a78fc3546e3beed632fad01ec6e77 create mode 100644 .pnpm-store/v3/files/5c/1aa701b6a8dc5b70c4d1f8cbe9a6fa7166f3d7aa1ab673803914a39fe4a5233a911fdc87e46e21beb7d6533c22da8c73168a4ec915eb93a908502c0f3971a7 create mode 100644 .pnpm-store/v3/files/5c/4994e3273b65ce2822a7677e915440289aa9f63c183e0d5709d61cdc45531045ce364c633b61ff0f9cc8735071b3ba71ff2f80a0bd45456ad0edb7ee4bfa9b create mode 100644 .pnpm-store/v3/files/5c/4fd46578f251c82ee58b395219ee2dad9b86add94bc41104ab2170624197eeb57c1225f32950e9d2d8c599c7120a193561665db20945f63d582621cbbfd3da create mode 100644 .pnpm-store/v3/files/5c/5a7dcd9244517234d7c750869ef6b9fe42a88ece077c081651ede36cd3b67c05ccd05c4cb4fe6df1a04603d0c7d3f7fa9fdee8a32d542470f934239e1597c3 create mode 100644 .pnpm-store/v3/files/5c/6920811ad9fc08d7a51ed36b9ede4a519e6d66827361ca9f7c2004ffaea0a93c19839a3ffed40f4dc63edc5a67dabec27794b6fa65352e8eff0216da436b0d create mode 100644 .pnpm-store/v3/files/5c/bcb233310c58b1cee46cc451dfc008b3a3be9539e3abf69aa4d448dcb5a335c52b0ea5d525988ba7a5f8855d1f92ee6137ecc046169724775e7dfd49758dcb create mode 100644 .pnpm-store/v3/files/5c/cff517488d6d85d7fa34e58fd7367327e80054338868ed83f6328e4a7b41858867069e23e4625df004add4688f8c9bda8fefde16832290718cadd1137f317a create mode 100644 .pnpm-store/v3/files/5c/f38b441cf0305c619f65c44568ad82dd26be65227907653cf690c1874a07e0bf1b6245a8eaf26633a5839ac254bd8507aa7f0d3d52acabfccf2d8b79633f06 create mode 100644 .pnpm-store/v3/files/5c/f5c76ea3c999a3ccc3ed6917fe8a421a7c787eb78523b6dcf0231360c01960f2b0a94288be08a0f162c29fd745314bf408118c0b479d3e2bd28214a6450e90 create mode 100644 .pnpm-store/v3/files/5c/fcb5a3bf776b4bfbfb5483c60510246367c56d3e2d945a1b03c35ebe2c3cf22f062a3632650cffeb4467bfdf7e3a4e606ea2c0a7f4410f96c04bdb71652399 create mode 100644 .pnpm-store/v3/files/5d/1f5d1ae91c59828666df451aaf922beee2168a84bb3ea917f05c9ad8d4807a87384f26471070ce5afff13ce029ffa1f06af991482f679504609dda120acabb create mode 100644 .pnpm-store/v3/files/5d/30ab5bca9875d6795716b893a3abc19799b9bd2719e96a37b32733681cfabfea40227b9a702c45b1e2bb7e2fe7cafc19464f3e64e7255504b7e5b5f5e4570e create mode 100644 .pnpm-store/v3/files/5d/395893c880a68ca32f889d7de5b7bca93eadf57a9dfdfabc4039e17e188bba92d885bb60aef5204c4b2a0f2218fe98952575ac91aa5ebd9649e369fee9a0ee create mode 100644 .pnpm-store/v3/files/5d/50cab5ebad924af907a6ea01048e73aac69d8a05a77fe6564f09fcccf53dc13b072874731bd94bb462efbb2bfcebe69d5ab49c82652cae58fda2f718337e27 create mode 100644 .pnpm-store/v3/files/5d/6804ee2bfe63f1cd7f19d9fea79c9aa5832cdeef48af496b97c29b13b6b73feacf83a4a5acf491aa048ced20ad4be09e19f0e61f46560c37f46227777c35b5 create mode 100644 .pnpm-store/v3/files/5d/7f1490a0d7c6d136830a2e7c1400302f3d974d015c48a061488cedd3b2c050715140a8363a3c181c0fa8208bb8456304866abbc5240f4309026c35b15c589e create mode 100644 .pnpm-store/v3/files/5d/ba736b874419b32787727beb955511d87cc1db40317600f9f07eaa27771aa6c311efb90b1b63b1bbe1ea1768e42d628e96aa134699ef646ba6ce4f42d9570a create mode 100644 .pnpm-store/v3/files/5d/f225d9d7b3a0f43edf5f8b95148ceabdc763c0480cfd65d5ed92da00e77b1d035b26993fdd067a36c011c5ae2f779487b41be5de5eb790fa24e6e8599326e2 create mode 100644 .pnpm-store/v3/files/5e/23929a751482caf9475312670566e1777c3545c2826ea6827193642c1db312915ba43f3332afee8cd392caa50b4c354877861c4aac5ec22e078e4c7fcb5830 create mode 100644 .pnpm-store/v3/files/5e/3660d91b3959d085a9fe5a6d28dfcd2e52986557cb8795ebab96f83ba0a113d673b6f2807527c6ab8287c6fc08d3d9e092e1894369c572e890e1ffe122356d create mode 100644 .pnpm-store/v3/files/5e/4f88b0712c66ac132d082fe136d3af199030e786614c59ddc5d49766ea955493a7b859bb957d1fb9c1a80e8c134fee34245866badb79efb9034721e33f62db create mode 100644 .pnpm-store/v3/files/5e/50de01e3d32e49a52d36947a67e3b631ae86c13c13be0f0c43a77ccede5f11189069d2aee14d2cfc64d5de4ae294007bd8c5ab92e654b29080b0fb0ec5606a create mode 100644 .pnpm-store/v3/files/5e/7720e8f6e559184590a06421faa4224e7f5e0c0057620c099b175c10e48c6d88aeaaebb9173e4aaadc263b00a65e10d9d47c29ab6358186e06873ee1a66c17 create mode 100644 .pnpm-store/v3/files/5f/1638a5e16f8f0b8a4d8def1708c520cd4be510b7b88b6cc90c2e0331056d4ad447c498479e1acf2ac52e2f21b5c98a97e8e48be4216bcaffe2e0a84e8e20e0 create mode 100644 .pnpm-store/v3/files/5f/1a0e82286516e680e3b89ab0d13de897375c20d2f109dccb3b571c268722d9f9bd2c9af1ea6990442d90801ed2fea4a1b2fecdeb6a1c961dc47945085750e9 create mode 100644 .pnpm-store/v3/files/5f/1fd0a53fc13463e519bfdb0a51da348dcbe13a48a49357d4d26fa88700af81084f0de39ddd3714c14687e314f6edc49960ec07ec2e6367da1b2ff975c50594 create mode 100644 .pnpm-store/v3/files/5f/a2e012ae2deb0fa850e40344f657261148044e44e378fb45f820975ab1af0d4269cf9a091449bbf52561e557b95c477ca3719f62712522ea1cf725a6837f8c create mode 100644 .pnpm-store/v3/files/60/1df8b399f74877bdc3208c7b049129571b2a981d494538bbe06145b040d4dcfca97993a1224b6f42ee5a90d4f0e1544ef5d5d2cd0b2e8965afd6636f325d32 create mode 100644 .pnpm-store/v3/files/60/b1d94e363dbdb22f058cd2ef39096cc66998f2d9333c3223ae7c04a604c6b7b578c25ed820ccbf8e5d6ed74a63631bab28fc38cb9e5c6aff44f1223730f2a6 create mode 100644 .pnpm-store/v3/files/60/b4389333ec4d03681fb2818289376d3e8c0f0155c813b61fe9d11ab43330e40223f6817da8b82d5ea2a05696873009023ad7965b86c1d3053f1f426ef3dcfa create mode 100644 .pnpm-store/v3/files/60/c83d9cc59a0457f8d5cdef2a76d56b6f979436b83c177dd984307c0b41ed75a500eb4267458f038d2787f1e9216501ee8e8dddc697a5d108d214b60d1a3d6a create mode 100644 .pnpm-store/v3/files/60/d8c8553f4af31976603f27227ba46a453ef365868e8c837964e77c9915a446f8122fa7f70c5ca78c7c371eba23696d3637d2ea2fc004d2bd99b9f45ef0cef0 create mode 100644 .pnpm-store/v3/files/61/046bb453ada7cd45f1b1a15460105bd10e3c0af29896224e98a60f14a95fbdacccf439e7dff23b3c3edcb672374794a9218f5e562c32a2d35236a39cb31637 create mode 100644 .pnpm-store/v3/files/61/0cd7ffe94865b86e5505186c62841c71bfbff3e63490754f7b8d756b668e3f14b2e1ebbf3ca7f781e7827d75aae20a67421a64c8844daa725d9565afdc9ebe create mode 100644 .pnpm-store/v3/files/61/14700036d1bab49b39c88db1884d3b103e54813ba88e3e4998ba939dc2553ea7c2e5f8bd5af150004be69cef1d7d91ab9455dc18954d6f1df1647395dac089 create mode 100644 .pnpm-store/v3/files/61/96bbd3533298d88feb33cad40ce88f9814c2e83280315d04c9f7b4bb0f4729b45e67400a4432bb48e64fcc7ce390ade6d0a8b8cca6dfa38a948d7df91cc3fb create mode 100644 .pnpm-store/v3/files/61/cb6c37bbf7d2cc6e093ea196719fbe3f198834f10f617ca8768588c2ff975b9ddd204c9c1585d640b28a7179755b9cc6003c1a7695c11ab39afc8368368d1f create mode 100644 .pnpm-store/v3/files/61/d0c1441cf28bc72e968faf7bedbbcc47f3a4aae33d49f7fe31c493077af2754782b6d655c4bd9a82f6306d7eee1f80bea396e86c3b72e4c6f96c032abbc633 create mode 100644 .pnpm-store/v3/files/61/e49135b312f853f1ea7bd5e3d152df500c6bf9e45e6437120093633903ae84ee5f13d95c867e34601ce6980b99cb9d86b0f7b96994c4839e264042729f7d91 create mode 100644 .pnpm-store/v3/files/61/e50a46c185044d2c6c1bd6458a3dce7195247b3750af9e7da065d9326d3cb961089c3c7273780d0f88c4ba837652624c77844bd8606c13817d01c5a03de80a create mode 100644 .pnpm-store/v3/files/62/0431d063d0ed7fe5a9156987561b65f6f71ab4422d4f540651160dde3cdfed4221d3c41d0e174a874e230ecd3e2ded8dd20b89380adfd3709045b8741202dc create mode 100644 .pnpm-store/v3/files/62/1316f5d5018702d66bb752e6fe8e292c2560ca34c6745fa56712d55cbf6f7b95f2573578e428fe52c33dd495c5dd9e2356f2931524d51d8caefda19c941e16 create mode 100644 .pnpm-store/v3/files/62/184d68c14885f2ce6bc345fec80a9297664e02c9681856bc1915b7fe90ff5066400fde2f9a96f3f46b343fcdde61cebb5334be44923c7a889dfb7e6cbc4fe7 create mode 100644 .pnpm-store/v3/files/62/2e824b982aed8ca53c4b0931ba301e57d08d507c530c8a9552a2d2cd12cd4418de74a5f2ea5403c716b11a176bf25829004b4403a6a25e5f66dfbb455d2b72 create mode 100644 .pnpm-store/v3/files/62/3ee3c727404cdca0d8b01bbf80ac58738664e1c6590aa6186c973499072f22d32653a8210ffec8c1c6e68aea4d644438f8e0e6425b3a1bf03d1a6f77402a1a create mode 100644 .pnpm-store/v3/files/62/4007c4c7b531dfa21f54b088480271d995f850cd933c3b5cf5dc6a6a60106ce154a19229b6de83ddf70c4aa87fb4b64e67accd5c3c44a7e67edf0409562808 create mode 100644 .pnpm-store/v3/files/62/86f6d6af91f071bf9e8d25167d42f1a9b2a85a11f35d2478d2c44bcc1d79010da8d56be415cf41444aee27f2d24267c891b9bafedd3b1f555f7a362fc7487f create mode 100644 .pnpm-store/v3/files/62/aa1e3a51737c0537549a448476827a6c1e7a19ff54a9a96a52ddefb05b765db4c34eb95fa7a86d7fc0ab668838815756db8e127f606d19272ea4d75e097560 create mode 100644 .pnpm-store/v3/files/62/d115ce38c1d6a967cd3ff583cacf070592790432674fda048eb5a92f9fc21faace3a7968920f68f223a288062c7fe7fd32c263f17a97f7903b59a1604f86cc create mode 100644 .pnpm-store/v3/files/62/d4fd51cb2d4c6e58ab2e31b4b882966d59a4cfe95951859e401af7451f764919b11d5e3f6991ff58db1de629f00cb59752473f21afa14611ea8dce9f93619b-index.json create mode 100644 .pnpm-store/v3/files/63/381d9afa5d445c6204508e55681aebb9da02d6cfb4a98f685b469e6c56c7e297ae31a4a545d3ff6b7378a9f914b76da1857e0d14dda4c74fff8e40ae757065-index.json create mode 100644 .pnpm-store/v3/files/64/31dd92ecaba88d9dfd85f22f67fd4f2a89e81c12d4e45613ead98672c85d31e50d2488fdf6bad9fc95473987cc05ce2cbf1316fcabb4624606ae713e8397e8 create mode 100644 .pnpm-store/v3/files/64/3acc6955b2b107e8a26997e7affff4b95505948e245ed5f97aee5328df517dd63a5ac9ef99f6d5a0eb53c6f67db40f8daa470f038561882f40f9997bf2bd7f create mode 100644 .pnpm-store/v3/files/64/618bd89892b4598123aa8549c8d1be6aa4df83e894cca9dce6aa31d285e24a41c24936a6e0a5acc64953fb38ffb5f2101248ae71595245d89fe11f11ae3c08 create mode 100644 .pnpm-store/v3/files/64/b3ec93d91687fe91bb433c56fff3723173afcd9f99b3c280044974d44ca2ae54990b0bb7873e54a156290133b5400d5963d93cc82f27a873c9ac2882189561 create mode 100644 .pnpm-store/v3/files/65/017cde6e1f56fc96a1e952d63e986eba07fb7f39b47eb2651dde2a543f035b176aec267c432a2e8103f17356d88855e57e6753a17a595477b137bf5e3f7d74 create mode 100644 .pnpm-store/v3/files/65/10b132be983ce945ed93f0c5b99f76a04b37b698da40cf2f4f1b9c1804331c769b675bd299f33add5887de983f8a63be74c4512d3b44ddf6efd93337e28079 create mode 100644 .pnpm-store/v3/files/65/11eea42a0564b7eaa1415441daf3475a4c5f5fd01221c28d70a8c696d2a0a6514ae0af001a78918d1476d87bb48a573ee0bdf70566e1fb618a21a35eca2f60 create mode 100644 .pnpm-store/v3/files/65/1206e5a21d50ee70f7e1148b9569f0ac56dda9063a3da69f82986f5e5576842f7a14573e42429122be9d35060b7bcfb330002a8b9da8c23d4f5d294edd0fdb create mode 100644 .pnpm-store/v3/files/65/4a23e1af9c3d626c806fd3af0d3b8eb53583b42acada2111312e1b59c349bbfa0e22286375f1cb001db4e9a3b29dd408bbb05c2ad9c215f94ac3bfef77d2b1 create mode 100644 .pnpm-store/v3/files/65/a02485e6a47de21d8f9a2ac73ecdd942b7eabd7dcfd971759ee06edeefe678af04ee4f5f061f129a67ad0f03db494c5cf472b914685e27f99b48b359dd752d create mode 100644 .pnpm-store/v3/files/65/a338cfc22d566b3535ec0420149ea0fc32843c6854782d16666a741a09c246aedee59710e1e30de3b8cdd28fdcab6288a4ca6eb30de4ea2842bdcd59d0193f create mode 100644 .pnpm-store/v3/files/66/cb70b6d95f9b1a90e5f7e8f3d49960e877e70e386e49a587cb9b41482bf7f710d154d07f57e239c4d96b53660ec073e114ff2ba7d9ccfa653cb14211bfbd5f create mode 100644 .pnpm-store/v3/files/66/cd04833c2083b8ca1a9953ce32ffb849de96e053814273671fefc41cfecacd70d54b9f21039c1167304cb9157773b799b736bd63f5bf71d5e502ee6fb4a3a3 create mode 100644 .pnpm-store/v3/files/66/d025f88bfd637f4a04cd9b01506d80b3ec77bdced3b48bbaa795f37273653b4d9345594314ab75371b2402fee4d547725c528f12e6c1472eee9abd32e5f4f3 create mode 100644 .pnpm-store/v3/files/66/d29ccd5476a38750cd618e5febc0d283147c2feb492cf7aa4b7928c2d1f5bd4a586e56ea048b18a11b15cef63bd6b0926a4290fa1d396148839cb115b31288 create mode 100644 .pnpm-store/v3/files/67/17445c11b69fc1dbf129004221befa2eee6d372c91155046f567c0188b5fa218540a8fa6803b144b79b99087ee3b196e0df98e6410e7052e7846297e490554 create mode 100755 .pnpm-store/v3/files/67/491daac86d7d08747d0d23cda7aeb1b176d7038e57100e8ad0265abee1488a394f76e7697a23d172e3260151c256edf9379e70f4bf8d106fb325329724e788-exec create mode 100644 .pnpm-store/v3/files/67/5582eee284f7693c7de4f1bc498d376b8ae1314f78c03b4b7e9f4fe21772b6376ebb85b448473437d5a24e743a7c0000c4fb3ec14f7e0866eb65543b722324 create mode 100644 .pnpm-store/v3/files/67/915f0d9b60e1ac9cb037238e4b2d2c2dec3eea32bdb2f58e74397c82a0975a91b3833c4f8a89ada22258cdbdab9f8f01d7a7d811a3cfb8f43aa7c89899d07f create mode 100644 .pnpm-store/v3/files/67/f22e2a6f8aab883d7a41309f4840c01d288beddea9a14e961b165777513c0b00984a20914e6d13ce6d4ed9e212f8cad5fb5103e5aee330442533caee4d0994 create mode 100644 .pnpm-store/v3/files/68/3cb750a2523f41f09c2c620a2e7851330cd7bfb8cb5e09c5dbc635652914db2ec6abf1d8a6d094feecc067e5d2a96a48704ffe169e142c46a83d6ea565d612 create mode 100644 .pnpm-store/v3/files/68/6c624274ce5c4c3e14e46cd1462581c15f88de5a7abeb3cc09f2feeb4bc31cde56dfe27bf0e47f7c8e786f710c794b30b1921b9882e34c2d182b0710e6c25d create mode 100644 .pnpm-store/v3/files/68/c886dbfa0ae88abe0414497778b9e6cc4a26a4040478fd1d9e855d1f61d179e684f4633f209fcd85d368539e47f78efbdf3e7931af3aed3e036b7a5050a459 create mode 100644 .pnpm-store/v3/files/69/4d4a612a3b4dd9d24c17a7c805ae445074ee55547b4ffabbd725b42d990b1d1081c7c2f873fb7bcece926be82a1f9166e692b1580b1b8cc2388f0b67a9d2fd-index.json create mode 100644 .pnpm-store/v3/files/69/7ebb3eb43143ed793eb8eadf2537b17fa913e53b61223612a6214dc5042b71b402e70833f9626af10270fe9542fa00af5ac221e412a16f9effa174f8dd2d57 create mode 100644 .pnpm-store/v3/files/69/9030ea691059f3b420052bd8bd8849af43b4d1321f262720ec206cbe337419118b9ad0e781088281a745a2219fa057be5a68fe2a268abfa6fefb3cd5178fbe create mode 100644 .pnpm-store/v3/files/69/c1880a14907fd2aed869cdad463309c8f650fc71c652ab0987e099ceedc6cd0b2f5b29fc9eb649e0ea874a8ddec648f2c1d5d032697a626e054dc01c9f9f4d create mode 100644 .pnpm-store/v3/files/69/d36ff5f54a1ddfc584ea83b7169e178e9d2458215b1975c3632847b34bb32d5fee3aff006ff731742f0eb6fa62c67a5abdcc0708bef83fa9e2e2a65819c788 create mode 100644 .pnpm-store/v3/files/69/d95985c0b8c0fdba5b9d10052a40639da98f4db3b74576e60d9473370443da2b45c5262cf6f63d51e0761a1f30181bbebf97fa7bae2cc392af27bb59f7289c create mode 100644 .pnpm-store/v3/files/6a/10b95b5c60a2ef8a4d78b1e2c00ef0a8b5d90fa37f88b4fad9a4dec0bece07329ec8641f1ce95dd22605e86251828a283c2f7c5889975b59b7a7b0b1c4b532-index.json create mode 100644 .pnpm-store/v3/files/6a/173dbe0c7d3b0303156e23b0498a6ebe1fc67d10b2427d2f766755f00e649e5723e21e5ab9c3a35efb9f92a4b31b01399472cb7b48c4092a0ff8b57bd3be6e create mode 100644 .pnpm-store/v3/files/6a/e33af0f4f87f90c4824824566944ef3753360cce74979d532bbcc98d995aeaf270ae7e79d6b3a59d6cae6f2989250c7a3d84a333b52b6ca4cc762401d6c046 create mode 100644 .pnpm-store/v3/files/6b/501dc03823208fbee2f20a00cf4adfd1dea1adf865a93c1d30bfc635a6e26742ac1bc39a093619a2164253f24618429f68e2f6a2a16cc5fa1e27a448923b52 create mode 100644 .pnpm-store/v3/files/6b/7af5e5cfd04b996f01eabef141ae9f8344c08a04436f28fcbccb22ac89e1c1454929272df3112797746f96d629e8a1467030d019c35b498bbb9901e8485adf create mode 100644 .pnpm-store/v3/files/6b/7bcd8018330a3bb9a194f00ab36d217ab13e7675c52866f758b8abcefd1df026922174b368f40349f1bd0fef1d3b8d9bd343dd2485ca06e76b8cfc53e319ef create mode 100644 .pnpm-store/v3/files/6b/bca64f3c672158c2ce0769816df82df6f331cb21bf32c51ff7afbc073e8fc04ebf8a51eda5ca820d4d4e5e0a3692c7b76a0dcc7c81611d12adf22a3762a92b create mode 100644 .pnpm-store/v3/files/6b/d9622021a7347151c4a3bf5db514e6bc72e80c417d3881660aba9b0ec290c00053474e5a51bb969d2b41189b9665b1bebbcc370a076327c2d7957aedcbcf21 create mode 100755 .pnpm-store/v3/files/6b/e062d6e25fa442aba7a25a86aa22a204dca90e67c8d76be258c10dd3e94772194423c8aac2f71b4a28ccafb37e7af00bec862ab6108f4274d89ef6cf505f6d-exec create mode 100644 .pnpm-store/v3/files/6c/33c221ba05eab5e7c22a2976074dc52b601dc692e2cbea455ccbc2368c2039b54bca4e6b5509ab909437ff754b54fa7e1839d132451fc9668f3e826be33ab7 create mode 100644 .pnpm-store/v3/files/6c/3eddb4364ec004baa8ea1cae5281586caee19762d66f53ba7695b2be4928234a815085b8985cfcb3f9d1c24b24c37f0e88f6242700f6acb351f201064e18bb create mode 100644 .pnpm-store/v3/files/6c/42aff0bdea7c540961b29f528417122df2915b449d7ef8998a6d837354dfb929ce2bd19c9f7656df6b6e52aecf7de6bfa6d2ddc5e6e8b1373d844f283acb04 create mode 100644 .pnpm-store/v3/files/6c/5cec4a8e2625f5b2bd697dc820eb0f83a5d18484184a5c5153657344d9e64190fe5857be634f107ff9211b2f5c3fe61ae6275ca3e96427e538ad4988285ded create mode 100644 .pnpm-store/v3/files/6c/8a17da3e4c4bcf89d1b1a4bef82029185b956dc7938ad1e1c312e8b22dff9411691279909e9ca7bfe7815693657a38cc5348c989515f531a855779627e235d create mode 100644 .pnpm-store/v3/files/6c/a67d0cee58de091d597a4aa37c275f89520516e67723df5ea4207f96726c9678c741dbe34df71dfb4e819f0bb7fe291e7837dca807432dada2e7840846f2f1 create mode 100644 .pnpm-store/v3/files/6c/acd3298f93176dfe2cf9a051e746e7591581821f1580a6e082f15a6f097a198434ce1948d881e85cbe5b53c8c74699de0a268602cd0c6ea36db2ec39675374 create mode 100644 .pnpm-store/v3/files/6c/cc4c2808e0d77101495b1cc53698038991739b755005dada45e219335f674efd1c85971242a692016b87f9c9a9a99a2d2ad73b91f85851643c468b2566ecdc-index.json create mode 100644 .pnpm-store/v3/files/6d/088d1a03bba7203eefc2c05e37ef99424c3d0eccdd86c70ce6b1b55137214f2f13c4207c3c722d4c3c5ef4b4f575ab3cfb61a64c45dda2edddfd2e0a7b8702 create mode 100644 .pnpm-store/v3/files/6d/17c975c2c08a067fcae030d28df41aa0e6afc48b4ff81d09bfdbb68df4df504b232a3401fda53049300f1e73df2d1a0d7186b528066c11358b2a06515e10f3 create mode 100644 .pnpm-store/v3/files/6d/9a07a3afb800eae672e8e4eb0f8f764662ad29b481d9ef39d7de733543901408a3d4f74b700c83042f9f21a6875a0fdf94f4ba94d39bbd878259d235e1d2de create mode 100644 .pnpm-store/v3/files/6d/9c30883ca047717a4ee24d8ba7e9eb706f77a7c68f019b4a329a880c89f44d83ebead0f6b82ce6449645915058661504b9bd4db167cf95c45a239397f25178 create mode 100644 .pnpm-store/v3/files/6d/a363cf35082f5d97b40cddf7ee393c951eb3427c0002074310e33eaa2293976daa826b47332f1b6e1d82223e362b3b277fb98a714004ec29055225a49f91e5 create mode 100644 .pnpm-store/v3/files/6d/a7e1639915f42422b7cea902c4e5d5d888d4d2c3d4e24f447d08a8c4d00a8d29e6ce35afb2eab5d3d0dcbf6ad7eb7ace77dc292865880cf3e65fb5542aea69 create mode 100644 .pnpm-store/v3/files/6d/b3440d4103440c9c5db48786be3d17d6fd3729f1b32338f1059fd66534a3ee72c82a4449e3832fe6ed4c7f4e078422605cea9f4adc6315952ca5e2898145fe create mode 100644 .pnpm-store/v3/files/6e/1565de65f3e81a6815c5e85835ef08fa45b242ef4cd6d3234d5aab98de4315c90bd930f5dd299eebdae14abf11db0a2fb1eb2cf828be449d067668f8d809bf create mode 100644 .pnpm-store/v3/files/6e/382ba40ad1a895b56585006f12fff122df8422e9f2462dda9e91a436ad27c4aa337cfd0b36e9b1f02b5065459a493c0c641cb964287d2999cc7c38af695fe8 create mode 100644 .pnpm-store/v3/files/6e/536803893a218fce94c5c5abcca73995d1a1edbf00c777a0ce9b706903964a7efcd45314712e2f416b5647c3c72a5b364f0c8d75b180e42be77383be06d1d6 create mode 100644 .pnpm-store/v3/files/6e/5d7cea1e9b9f3cbc81ac012a92742f194605434fbbfddb888d342bbe449ab406824a87ae4275a58ce203995b38bfe5f31cc1a36293d8a986bc8c38f1b4a531 create mode 100644 .pnpm-store/v3/files/6e/716e5da4cdb1294967a19b1bd4d56818433e0d6ed0250cade03cea2b7d8882a51d3bd0b52c465dd22f1253e60b09f271bbcd21274ef67f0e25a94c16fa1ce1 create mode 100644 .pnpm-store/v3/files/6e/720e9a7e80f9d5987bdbd7ef52599d5f6c87ae98335f97c46e333bf4b4a39f5819e69941ac4612791fcb84c1183b1861ad639668c3d819c07b2c54c5f9d44d create mode 100644 .pnpm-store/v3/files/6e/7f8aa176de976b78b263565f256c30c6e2d5f1d0f6c2b57692eaba18fdb1d840187c78c4c74b7a6229f04c6ffab669ce7fe5456f57d819efcfd0847b88011f create mode 100644 .pnpm-store/v3/files/6e/b7ee17c3345b171a32225bbed204416bc3c7141c9ec306de0f54d734c6688ebfbb96de017b98427ed25971bc6c629f0d227375efce9f1c98ad21fc033f84c6 create mode 100644 .pnpm-store/v3/files/6e/db0199442c6c15ece0420dbf7d3a7446bf2b7daa2196897914e64030173721aec9652bf7ba8a87bcad3a225fe24a1e708c805b554f1c68889696d5a1f119c7 create mode 100644 .pnpm-store/v3/files/6f/0b2b94295ddffcaafa470f9a7d2f1a187c3ec4e63ef6f5a84d7fc9a35ea3a0474c7a8e99427b3187abb055219a3f6ab153f81725fbe12cb525e6338566f5a0 create mode 100644 .pnpm-store/v3/files/6f/1b6252844f2eaaae20c83760c4f266cd4b94112372c1ea267fc1f324ee92a7040dd38c29d922d17c2e0c8a2b1786e33a0d58ae23aeaf10d1d0a3969426ce41 create mode 100644 .pnpm-store/v3/files/6f/306ae7c4bec7eba8d158eeac54f4524b692873999afe3fc5e3e2380d676c1f6932aa462bbad43cd81ffb5602fbb984fb41f385332a354b82aaf2a18fa16707-index.json create mode 100644 .pnpm-store/v3/files/6f/650f25f01f47810d7efbbcb47165668b6d2349f2957b54640f9fc0b895f0becb31ac14a5444f3f3401e5a9ff95c9ff6c7211229621e3767cdc9d13cf0f7393 create mode 100644 .pnpm-store/v3/files/6f/c1078215dff94fdbc3bdb6d8055734e4f26342657de277023735bea6d2b91c1d3c45b6f1d0e4b528848a4f1eea5b42dfed2bde9a77e80622faa1a4b1ca0b13 create mode 100644 .pnpm-store/v3/files/6f/d9ee31171d26e31661e15d8008851e2201f2e1396b2acf494763538b4e5b2f3e8c1158132bf9a1fda976378b279296741f3c8e184909c661c19b6cda271a38 create mode 100644 .pnpm-store/v3/files/6f/ef994b042e9ce331a792a0eb3ccb589cc22b520acc116e2461419b2db424c5586cd975d1e1bc89e8aa2a789d237b3c19d19b0bf927236b25213b0e6715ba7e create mode 100644 .pnpm-store/v3/files/70/0fb2f17147c4372f45df49d5695d6a5c60c77f9b766e63bc8b2bb0d4b853c8043c64d01ba6cbbfbc613830f5d5b586c5a35bba390b94ae43576cbead97fea6 create mode 100644 .pnpm-store/v3/files/70/6bc45f1b016672954bab2d7cf8a1cee93b134093042fc2abcfe7eea38ea2c932af6a1d354332c9a48835fc46a4cec44a8446952fbc88a47dd4bb1432621a6e create mode 100644 .pnpm-store/v3/files/70/72168d4efd01e4cda4f65df9a6f8eb84327ae3e255db63676075a9b28461504e0cf097b2fff407d648d5a87302ead6de70b729946700a26fa4b60aa3b0b307 create mode 100644 .pnpm-store/v3/files/70/729bb11fc87a9e322aa7268938c1ffe4d0b3fdaa355520e9a071b98c9fa607c0a5286f881c830bbb69398c057f908cefa3fc1c791cbeec1c017cc5bb9159c6 create mode 100644 .pnpm-store/v3/files/70/99558c15ba390305fddcd58c0b37da353af62a59f85b78684772eb1008408fbfbc0200d3732f498cdfdc496230e1649a96ed5a6e9a2fbfdc11b79fe542f2ae create mode 100644 .pnpm-store/v3/files/71/1776bd7649d9c987b7cbcd63ebe09c19f5af1f1b561e479d59f371b6a6f70045233a3f4c100b239bba1a3307c26881de9cc9d0b675b9140a1b6c2537604d80 create mode 100644 .pnpm-store/v3/files/71/34ee9cc0bbb943fae60871a682af3304f1036d271735708350ecde402116539b8d3fd83dbeed1aba22690f78d03c40c871e3d950fcb0978c4f8120225046f5 create mode 100644 .pnpm-store/v3/files/71/36853e25c96d20617b64f4ee555b174b7855b5130bcebdefda153d290a950445445439ffff5b4464b988883056d34cdc22ec6072a6c7b67db65ec5ffcec59d create mode 100644 .pnpm-store/v3/files/71/4459c8233c7038f7e8770270a27524569ad108cf1b48f9d25d236d450db7702e070220ca7c98b4342a4246101a7c58729597a77f554b42d2d39bf9a0481f99 create mode 100644 .pnpm-store/v3/files/71/4ab7e9af0058bcdb110b08692db7962db80869449183accec8c5144e6e82f907d028f2cb3c013f8659730e4f1a701014d0443703e62c658519322b91df2086 create mode 100644 .pnpm-store/v3/files/71/5efbd57ecb047ea4b48896eab490a9b6c0649f20c6b8b73d00e26a1d67fc7bcb48f0bef09e2d0ffc259e0fc90f07be99f961449c617b69076813144bda815e create mode 100644 .pnpm-store/v3/files/71/ba6117fe262be0eacd4ad28cd39729b74a0cb64e4903a49182dc3f81ac9eb07b90cefdba51bbdb6554471662e0d9cbb8d21d5fefc2cfe3db3f32de109e29da create mode 100644 .pnpm-store/v3/files/71/fc4528f329f030a664bc1988e541484bf9cfd05d80df13f98b22eb052301eb1719310be4bbfb87fa8ee92e6502810512b4a6283996829d8387fe2303699e8c create mode 100644 .pnpm-store/v3/files/72/14451d3dfdd3464aa4adbc9ff3f37e69c3a87395a80b9faa19eb2b92f0485f8aa0afc5bf00829620565704a82cf95ea59bffde41070e490ad635312f3b5830 create mode 100644 .pnpm-store/v3/files/72/452cf46cec1537c8ba84ff02e06fa8bfc245681024b5cbc9f9fa04f4ef26a6f6ad178ef8d4285dc7f5c9678f5697dd3ddb50466b3228667ba1d78b7fd3a391 create mode 100644 .pnpm-store/v3/files/72/61d1a6e92fc26e08c847cc6fe16b881b89d274ad2f107858f24f26ae8ec017aedd849c791f8bd6c873787786ea6394f43b89b816fe46836438bb8cd2954a1c create mode 100644 .pnpm-store/v3/files/72/6a66b37176261cc53aef4679430dda7791b6d63e238876f6cc1cb07f1f71126d9176823b8cd463d8f77ebd179e217196a10dc1a5c63867c429c85455ca0607 create mode 100644 .pnpm-store/v3/files/72/90101cfb19d2b4af7f6935ee5949d2e55d2bfe9a5bd7b70abfa572a885d126c501d2abce7a482eca5412732b0ecc07457a131adbfc3544b46f281e6f668e4a create mode 100644 .pnpm-store/v3/files/72/a111a3f2554ee76f23428d805e94fb894b96e9dae2a87574001f4d01233fd52ee1894a19489c6a0351261e9d36ed48f024724c11c4cc5d2e7509c77e879ee8 create mode 100644 .pnpm-store/v3/files/72/c1ebcea980d504e2e98165404f85964793c7cffba46eeda8b2b8f29e96dbd1b17ecee11134346239e4c6059ad93e119fd5d8712a15428974c98cf2742a6495 create mode 100644 .pnpm-store/v3/files/72/d4d2538e8a08bc5c691e77980a1ddb005648421719d5dd7a3a871033d25f7dc7e6b0365fcf73c98129ba4f41395cc81c6f06f2b8205570869c6697c6662b0b-index.json create mode 100644 .pnpm-store/v3/files/72/f3659fd5b642cf1e5d9bbf38965727a5259676736c561cd47978b6e50fccec87f6f36b40651ee892749fd0122f28b4ba27b03bab38ba0e691efa8cd0588579 create mode 100644 .pnpm-store/v3/files/73/1e766b743a05cb7aec90dcd690d7ae4f0c15104734e2811aa1e0b552ef2fcc0f0e59485c975a00f2c9f24412ef3bd2632ea2d9f4fbd600ec82bcbdfa538e88 create mode 100644 .pnpm-store/v3/files/73/2ddd4a9d38b691447ecde6299eed158ea5bf4d9e2d3d144594c25b996ac69327fd65d12b8de0c3ac6702d28e56e3983783a638ef54778cf66192ebf9162940 create mode 100644 .pnpm-store/v3/files/73/73c55d8af519e59d1a0dd176d7d653cc687a6d6701ded477010d3cc5c69fa992f6280b254e1af675c5693029a2199c80bb2fd81f0d1c0143f7f2b61e033d28 create mode 100644 .pnpm-store/v3/files/73/b7f867fb282eaf9a847597e408741c7fefbc96812499b71f7cc1e0994bceb3b5aa153dd1ce0a429cc70a560b0345371f56f2beb51e2d1840adebccb32e5841 create mode 100644 .pnpm-store/v3/files/73/e18399718a197931530acabf98a25226a3463a65c1e59ba0cc52f6bd3781600d725953623c2f544f6eb3485d6d2da1be2055484a1de44229dfc1bcbbdaa1a8 create mode 100644 .pnpm-store/v3/files/73/eee1a37fc6fc8cefad5cac990cb80d1693869e980a536886a2a88638897505beb45dfb5113d8db4e1ffcf218885fcdfe2b618ab1c1c386548e2932a14fb2f2 create mode 100644 .pnpm-store/v3/files/74/391a89ec2d3383f1386a792c952c6dbbb291b659e23df5767c54ff87297769b01ebd08a8b653c079570be38053868a0b57c986651e219e7b8df9fa1d8023ce create mode 100644 .pnpm-store/v3/files/74/4fa82aebcd31bb634bb36efcfa9138be40a12e96cf3329726663323cfd8e5df93636cec9c941a720e873f35f605c302909b8904b8d2dac26cc65a8afab7d79 create mode 100644 .pnpm-store/v3/files/74/5932a89b386c3f5696c0908cbc8be6ab69e16461cc4678c1d39739bac8bb90981e005bd93f97a43c8ddffaaea30d3b81e9d642338e6a82223960b83dead9a8 create mode 100644 .pnpm-store/v3/files/74/60ea954a0eae018022aa8bda1d9ccae9737dee637b753427a9eb72a8671d7161901f530f105d3d8890bb875259ce8fd364f14d1f71377fa027eda1cd41ba05 create mode 100644 .pnpm-store/v3/files/74/610dba895a5a0c2155ab531437e710d7445b9c0be864496995b11c53ca1e0da054e55fc6980ee9a8809663432a970ff7fad1089cd4037aa027c84a184609f1 create mode 100644 .pnpm-store/v3/files/74/784befb35cdb43d49a79668eeab69653fd6bb437086fce1d6b135c8cac75151f9abe165cbf409b08f936e4c7c2a3b53ea30751cf5e81c828c775eceeb836e1 create mode 100644 .pnpm-store/v3/files/74/817219a451cb33e9616419b1147f8e74f46f9f1eb8fc01e16c777ef2007e18e7c7cf3d22e4f8f591bad995c394e293cb79a9fb383123c95255c0d0d91767fc create mode 100644 .pnpm-store/v3/files/74/8bd1d298ddf671a2844e8ebb7266045459546cc4a36ee34c8b18155279087d7a47fb7287d2765cc239933c0388af450f1a059518890c7bc727a498f8fa66d1 create mode 100644 .pnpm-store/v3/files/74/a47cca82dcc3e1094168aa7ef5c9d145be803f492b3576cfa1916a03b1764db5c0295b3d478fff5b4ae52a25a2368e928d50224603029302333c2723752f69 create mode 100644 .pnpm-store/v3/files/74/ef690de530ff1406cf771bb587f2bc4fcbda956f0387eea6098472346c9c9ed18411d90a9d933bb88cc8680bccd1fa1ccaa3925f958e3bf33cb31862a45c1a create mode 100644 .pnpm-store/v3/files/75/08d2abfec76928d1338dc51469efe6478cd87b31a66c95d4f7da4959b49f3ce3c304e68ce7ba2786c2f1edfea531088076878fed5994b4e1449d9ab9cff0d5-index.json create mode 100644 .pnpm-store/v3/files/75/37f45835b9e7e4d23bc65189d472204b1ffb68f64fb15099000169580a7a305e192c85eaa437f2bcf2548293c77887e1d1ed5d7ec74cda809aff8b553e6035 create mode 100644 .pnpm-store/v3/files/75/3b13bab0d53b14d7357e203d0ac5e3ddbf9a92b3db4d18949e547e5d03e8d7d72220ec7010e9087c65b04a5cd75265e67d8df6c233bf1ae286dc2beebc42f8 create mode 100644 .pnpm-store/v3/files/75/3e7cb3d32736ac27f9430bed42fe134ab39127a67ff98ecbe8e56bed194e0af09060acaf96d78192c157703ac8441c25fdbc8bf69354d42e42b2b563eab7e3 create mode 100644 .pnpm-store/v3/files/75/4e6ee2550bbbf97e8cc9d995f1257d96183338ad875f535a7da631dc54d55c31a05694d976ce0cc46b01e6d828cd8b174b64a18385115da1741af679937dce create mode 100644 .pnpm-store/v3/files/75/d254c5f34f6a98ab49088d4a3ad003999c3d67dc8107c2bb649e439fce425b3d7a11c5cd8d4c805fa784ef480c0f8d5d8cab3a433656af0660d697ef8317dd create mode 100644 .pnpm-store/v3/files/76/049f431eb3b49855809725b92c5e58544bae036042db662809028e7604f9e374c964bcd4338771267809f2721b0734107e973055c80a85b0a9292e288c717e create mode 100644 .pnpm-store/v3/files/76/20b34714ef1abddf08b3ad427bdd0895e18dcc868f2168588a8d4dfda8a39d3f7d6973834949d30d5c70b9366e57e3b8dd813830e93497dca2aae09a0163f6 create mode 100644 .pnpm-store/v3/files/76/30ad61c18b5147a18295c2a903054b540698e320b034fd89a40a1e96d8ac48ed632200235434d8c018e9fd01bfdb4d71905d9a5c9481ebf3186f32a0b8d319 create mode 100644 .pnpm-store/v3/files/76/40cfa3f97ddca32cc4577c282f6d40c33710e5692971a71e9b0e8c17babd9c7047686ac1dd9786a8b7b1799349390b979e36009dc0a15cb2d5866816ba9135 create mode 100644 .pnpm-store/v3/files/76/6b1017635ebee3634cb0d2f2e660488972bd5c0f13b4efc0d27c906330cd8f7f249156ba91998ac8ae8631455e13808a4bce52f7e3641c294edfc05fc9ffbd create mode 100644 .pnpm-store/v3/files/76/8f2ee46121902ffa2056c30a266c7f7f3d3d2f6f67c35273b5f6c72838ad0e6fe26034d605ef656eb050eaf26c9ee0661c1173b5a5f150e4ab91ee6ad999d2 create mode 100644 .pnpm-store/v3/files/76/ea3f6c9d1cf109d576117660f82527a6739435c127a95b94efeceb191dad3d0d42adf828f179d875bc57f93eecd00215369c3d4875dee9067985221809601a create mode 100644 .pnpm-store/v3/files/76/ff59e85ed1948da6d3cb28365eafb6b16f7f24dc71c90274d215640f4ef1fc3ceed04d6b6390e5aabc367617b39f52ba80f67aced8c598569ba1f745d91115 create mode 100644 .pnpm-store/v3/files/77/1371912f12a13880f7451c089ee609657fbd4ba91b6a4c1c1f35600aa4668bd80b14d3887d749d8a3ed5b55fb6394887904cffa2e4d483beffab83b5669313 create mode 100644 .pnpm-store/v3/files/77/1b9c32b977835f9845ade8409275494f2e707357d9af36be7cce7d105232d3a1901d7b96798be9335fa8093df8370f67e2fc042fcde3b592ec282212502399 create mode 100644 .pnpm-store/v3/files/77/78da7564cef88d2336ebb71fd7608ab03f4b9d7de618b0b10e9ff29ed0b82d237586a26db445bc84638468c8aca40f69276a433171bc42a813b270db413811 create mode 100644 .pnpm-store/v3/files/77/90d88a272d7a90056170e4b9aa30e0ff4277f40fb84559d30f9c407adc644fe9b170aa0519ec2b9dceb330e732858af0081fa9937b5999c03eca45d0f1a25f create mode 100644 .pnpm-store/v3/files/77/93aebeb9e6b37183f544882b7e8a1bc399e5b12f2849084c5b671afe7a1c569295b22d26e62bee1bf62e49fdd37f80bd10204a2c626a6a335157ce4547a48f-index.json create mode 100644 .pnpm-store/v3/files/77/be2d51d22ade209f77d6d3654318ddb88befb0f75ac78561b6ae2a5792d1b8dba9ff10a3a8816429c17566895ec053fac40c76e8cd0b443ef819829c5651b5 create mode 100644 .pnpm-store/v3/files/77/e758c6b26ad6c2f75ccc410e76f0a450040848d3af673e42276833574693ff853f8d5dbde41f2baa3d7718913a2f0af2b312e8f2c9f2feae856ba88aede8a6 create mode 100644 .pnpm-store/v3/files/78/8fec10279e78bc91d5ff626ceb484592b0dd7511923b84fc73861c41154a38c266031a21b6fb7e37327c8d4b43915f79f41e7eac62afb754691649d5ecacb5 create mode 100644 .pnpm-store/v3/files/78/c3749f6901fb9f76e263809bf8cbfcedc44b767c1733a8a01dc9099ab7198ea9fad22ef392d27633a27cee2dd833a57dcd0410c963de6573af9bebf3d5d502 create mode 100644 .pnpm-store/v3/files/78/d7722df42fa19cacc19be39dafac1950c1a2a474985af6a67df833a11d69ae5ab23a48e35932c8fa3b6007a40abad79aafa099b27cc01b087f90eae4faaffb create mode 100644 .pnpm-store/v3/files/78/ddfd9503f01728337a5408a98e55eeaf693731d162ac39b59803994b9c3a31649048ff3b970d1450238f0a2796213073fe6a0168c4746e1581aa1acd4e373e create mode 100644 .pnpm-store/v3/files/78/e7a6a7bcf5821f23b97c06de4b35542b939f8448110f95dd6e4f920f1566f8ca070a0239df75aefef58ac5a30229d05fecede02780a1e742a653563e2d4157 create mode 100644 .pnpm-store/v3/files/79/684b82ae1d5878a84b22517bf8f37a4eeee570265580d6d76ab6839e3f4f6ce3e9a743eb3c108f1c1d3ec02c840b29164d0b76520b77adc18e20905ba5b072 create mode 100644 .pnpm-store/v3/files/79/84865c8f46379ae212495a97176153e741c96c5535770d29addc87059467f69fb650594db0b0c6a1929d9375b52c1cd64f8d33be06d205f572f0f8574d6cbc create mode 100644 .pnpm-store/v3/files/79/a0b3cd05eedc21a3858dca0a7d407382a3cfa2ca1e5ab507ea6e542d6d0f09aca7443d6f9f11901fb14b97160c5904ed9204fe96f8bac5757ab7100fe93871 create mode 100644 .pnpm-store/v3/files/79/c9ada0f82510288068aeaa07ec8c6f9e42a00fa90bb0d856864aac9a6f24cad4ec6fda9082e1a59b78a791aad3c58ff667cf4282a1deb1e7cd29801176c8b5 create mode 100644 .pnpm-store/v3/files/79/de5ff640d721f8262c59fa0ae724d7200e5415d5cf901cc3c789113f4114739281b5f228cac4735929dda69d2792de78bb667da2683b26099e9eb1d89c9ea7 create mode 100644 .pnpm-store/v3/files/7a/186ba690c1566f6fe15f87e86d6c99f38fa86db242e9fdefba286aa6de5331c7e95b484362e183f18f34d7b637d5b843846ca6b8f823db9e0ddd2710ececb9 create mode 100644 .pnpm-store/v3/files/7a/59eb6abd7ca5975d07902ab905c4617cc6ed5631e6b38038799bf6aa07dae528ae6c2a42d170859bf8567894d8ed1cee408ad850b015c79350b144366e98ea create mode 100644 .pnpm-store/v3/files/7a/73332217d8921a68ab49230f4080787f54664a10aaddc6466101af2d7965648c051353704f138a87a7d15c1084ed7a3b54fa0dd86f40d76ab042b1e49d0f3a create mode 100644 .pnpm-store/v3/files/7a/73b4f40793ec0b2c4a63b1aeb2a0b744c2a4bbfc74cffe5e3aff5f0cfe93f9696ad5c1b22c489388e02ce76c55da3f64e827b89fcd7cfb9992427658b72bd7 create mode 100644 .pnpm-store/v3/files/7a/95a5001adeebd7def4b3babc872bd483d317e48bc1a0df24492e3384fa191f77a44543d4fe1195cd1dcd48a57e82820c7366d576be883ddf808516d6473832 create mode 100644 .pnpm-store/v3/files/7a/c4421f0254cf3ff58ddc106f48bacc821766e6ee6fb832770fd7fa11833fb280e159f35f4b14a244b1a65ee9183922e1036a263a91cc90caa25c9cf4245cb3 create mode 100644 .pnpm-store/v3/files/7a/ebe0dd1871f21406af418ca4015da51843d450a27dae7cad019516438e7f142c0fd989b33f095260afb6dacbf1b9041bcbc8cdcdd379ec71518c3008edf50d create mode 100644 .pnpm-store/v3/files/7b/288439a31f8110f596bafce0f402e8f64cef7d884fbdbbd5ff904c37752c41d14a7bb855443af4b4b39ffbd207b10e34ccaff37d6675d2b1230c5e9f88a507 create mode 100644 .pnpm-store/v3/files/7b/5666b75c28269eba211aeb880947d6fdf8557de161e3bf6876c1321486b08e9256c9f7261a40965c8ef920106a3f446da6fe76813230ae881a960b40ac83f6 create mode 100644 .pnpm-store/v3/files/7b/61ff220451058bb5a652f7d78c30bb5cf3670203f59531449b5df019b235c20a38b759f6e88f57d45ffb73b1a9851dd4a4a35d5590b00d98084cb5c52647e2 create mode 100644 .pnpm-store/v3/files/7b/901000ebbaa2888b3c87f70d44d112f7703146a159e81cfc3d97b69ad52d5db3271782bcbaec809dd3f6e8988a1da00dc8a99e926f618599b93f5896bda500 create mode 100644 .pnpm-store/v3/files/7b/c00b48282b04978da4e77cd4889825f75f2480e69f2b27bf18e1a31066aa8ee03d44f09d0cb2bcee24a639a0bbea8065bae19868fb4f2f4974fbb092c688c2 create mode 100644 .pnpm-store/v3/files/7b/d8e196dace169d6e85ce543e11a48ac5cb20efb92e8ef8a82cd8fa4c396a559b37ed5b3331df42ea5fd457f487ff8042e2cdc238dd21445999b0e5857d7b7b create mode 100644 .pnpm-store/v3/files/7b/ee095e3c2ea65e3580ed8672edf25901c6dc869667b02b5b5a33a471893f78071138e314dd34f5fa8f9c5ac1f8a25c9e7ccb75d9beeb480ae569c4a173a427 create mode 100644 .pnpm-store/v3/files/7c/578acb0b611670548d896e089d0ed029c25abed22462b71d21a34e838b30751b95aafbccf7443ed7f10fe1e4460c830d6d82c1f2fcc0d7c78cfa2a1c047803 create mode 100644 .pnpm-store/v3/files/7c/58fe231d9c5df6f192488777fd9675d091966963784533dca032cbfbb4505861dfd5aa5c58a77e4418b68930002cf0a12ad1c3ab885a73d843bd087a7b6705 create mode 100644 .pnpm-store/v3/files/7c/6129c8a78c0e8d9040bc48d0ad338f6a267d67dfaae95538798b11ecad628b83914f641906ae4cdfaf5f5f8c0b33f35b40bd3cd835eb3dc6c239c13e8058f4 create mode 100644 .pnpm-store/v3/files/7c/e4fcd91a7eb438483e3148aa0b9356f610e48ea91282442187fc73f0e8f2b95c7e9d7d99b90f9cd33283c549324cac051b472a11d09786b83636717459cb18 create mode 100644 .pnpm-store/v3/files/7d/312027bf045b212b93727a27df27e83e0ef72355418c5fa2141f7e87cd8f55d9e3138868f43f382a4ab924362ac44bca0289d81a138f6c21b3c96495996c37 create mode 100644 .pnpm-store/v3/files/7d/78d70731a653dfa0e4c9ce7bc419a6a8549184f7ce58e2a125022770008c18b878aad751794171c380b2a6f529b60fce8cad69ed4bf9f35a549c73fe71499d create mode 100644 .pnpm-store/v3/files/7d/82b68cf90c3f9d363734c396ceb4522448775f3cdfa275b595d2a32c4b0020abf538e69503a3c2f5fe8574379a5c7d9a568c03a296aabb9b15ec87960e23ff create mode 100644 .pnpm-store/v3/files/7d/84450179d4dd1e65f602f8c90736e52383f13fc1bb390e2df1fba60a392f07318ac60432da41ef643efe8a3bcea93be27b5bda79763a491cffe894d5b435a3 create mode 100644 .pnpm-store/v3/files/7d/a99fa3c710bae677b16de1386224522de11a657b0e709803b9e9db84c7242259735b13ca7855dcabd869fd593f523c087dd8e6956345b55a013923c75a50a2 create mode 100644 .pnpm-store/v3/files/7d/e2637e8abdb4b4a1bf25f7598559b2790669ec98accd89137fd0e53a07eb3dc0d09488f9d03afebe44c2c5bda2521d1bcea4e3e00c8e46b980dd445f51d0e7 create mode 100644 .pnpm-store/v3/files/7d/f8242846ca64f910f65eb55eddf5958ce6957ad187f58d52800f49f22e1849022cb53ecf2e509a427401ba9293549402e8c38286c98e51cc700e5d337c6748 create mode 100644 .pnpm-store/v3/files/7e/19237e46cf2e77eadb44ca64ea173a48c83cfb84fa1cdfabd1dca699bfaae74d749b39b705a4ade4af05fd0cfc8d6563e7c1d0b86dab11d01b6038d0dd541c create mode 100644 .pnpm-store/v3/files/7e/29d9afa0602f2c191e96a5760a8d5a156180df8bcf3f88589659a73b1351872f4994196c1d0f82103b5186cff97c76c6ae869cf9a440f54738acccabd6748f create mode 100644 .pnpm-store/v3/files/7e/2c96eaa89d64495825fc4f6ab37fd44958591f42b9642067fa90981ffb11e5d9a5d2b0c9f4c96df2b48c8cf9f4ce588a34043059b54da1c8f3ecb8e0dea681 create mode 100644 .pnpm-store/v3/files/7e/3c452cb3f5b23e80fa480c24972497baf04a45cdcc9c1550ce2fa8656752fb5d061755e0df1647615a1370a9a532c8ea5b3ca59fb27d70eb440e16ca91df9e create mode 100644 .pnpm-store/v3/files/7e/66c2173a1b072f3a336823bae87f5e3d77e2bd13f0c3b293fce6f5c525f656932208b44540f679bfa02fd17480758c11b8dedb93d9e74bbde6d896b87e2a1b create mode 100644 .pnpm-store/v3/files/7e/9669d222b8b6bed70c7035f2387eb18f03294ae7def39b653b0b9e41ee0a3c7e3decd69c568fb55282a5b409b48ba012dbcaee51a0bfe2af20499b11a48b0a create mode 100644 .pnpm-store/v3/files/7e/c41d5a4013df61a9c87d402f46a323af9362765acf49d9d40a9727302ea1500728a56700912038a3a0361ae791b82b214256917d5bd2dc576c5469d738ed88 create mode 100644 .pnpm-store/v3/files/7f/612264399d34630bef063d5f0101b670f3540983933ba92177dd7de1a7aa011cd03b6fcc26b02c59b49ad3184306803a9dd4708f5d9f33cb08fbd68af58602 create mode 100644 .pnpm-store/v3/files/7f/daf5e8b8ad351a128d78431778d14c55e99f0fb7f5b1d91088488b78933f2e739dcf301878ac7d346a9f59af7cc988c84559b5388519a7b530a5f5fea1b5b8 create mode 100644 .pnpm-store/v3/files/7f/e6bdfdf8bb6d5663530a3bd00436d2e7325347cb8ced102c92aafa83298583b434d56f598a8883ed4e5759b544acc8977e7f0b7a5b5ac63970a911568ad2a9 create mode 100644 .pnpm-store/v3/files/80/1c483d3c8f608e84dca753c8b4af94b8bb8116e8f57c6ad299386bac3019be064cda5009b65a1faa3a6e071cfa67fe27bd97a0cc2ab1869a59c9a93dbf1b59 create mode 100644 .pnpm-store/v3/files/80/525ca17fcb5427c77a9fb5e3cf5cdf6fb6ccb9ec6ad1bb5a7f79ed13dffcfd29b757d3dff7f05c75d2c51a283468c654fe5ba8d62cae1179de5ef6d4dc5f89 create mode 100644 .pnpm-store/v3/files/80/8a60f64d00eeab96c3c2ed31a4cb8c1b82603feee646698c87a3a4ee190e8dde047bb2e578927997e1db92eff9f229551623c886c61b2d649ae4a1fd547065 create mode 100644 .pnpm-store/v3/files/80/b5a0c75e540d5ae10bcf05b38d777171f525e2c16612f6a30be3c205e37af172ff3db197758fe7c9ae16e349177c5e9b1f9e4583b7dd6933059dfd4a9dc789 create mode 100644 .pnpm-store/v3/files/80/cd7647b7ae344686b0b810c9cd8044ea07b5238e9a07082bcc2970ae949ea40752fb726a673f65ccc18e28320707a3ed6d129fedbea788b095345215677caa create mode 100644 .pnpm-store/v3/files/81/6cf2dea830a0d1b6e980ffab940bc526a48e061616b8954957afa62405f0bc704d4e3fffbaf6942149f7bc3935c4a270c931b465e0684796a43cd5e9253ca2 create mode 100644 .pnpm-store/v3/files/81/80f0a0c8f91a6a567036d72295ed8c95b1f5c0569bf9a610dee4143042157581fccaea548675ceed4604c13598cfdda70d024bb69b77edcd6aa5aba3841090 create mode 100644 .pnpm-store/v3/files/81/9bd91ca6c387f75ff6f30f966b11ecce3c2ea1f779057bc42c10ff722a5a74cea9f4030383d11af7f76f8093afb24a258898dc656e957e716d8791dcf4a365 create mode 100644 .pnpm-store/v3/files/81/a68af50880310e26b6dc5684dc589cfa7badb2832104d0f8654a5286d7a5eccb87abd9d38b2f969baa5fa195ed262568f5a372533fb273f3bcea2c8be3ed3d create mode 100644 .pnpm-store/v3/files/81/aee44c2c76459b5416b01329de8e2fee039f720243de32c37588927a50191fa60a1b5bef21f154826df965c57adcf0c7915f1b43deafc3c6bb266afa25cb67 create mode 100644 .pnpm-store/v3/files/81/cdbd39bb6e702082446d296dc28dd31f21b617e32551d9eb01ffdd433110e655a1da53b9ce0c9bfa0ea7c19eb9a553467bfe3b5375fe4df5ed2a441a29d8b3 create mode 100644 .pnpm-store/v3/files/81/d81313dd0ed37a28186758fcbb1f0c97a51338f55a7f4c84c1839bbccfe4bdcc0a3bfefac52fbdc6dcb860972c8a3fe390c6820261fb19ac1566aa2239a5fc create mode 100644 .pnpm-store/v3/files/82/06358b9f2b0f0ac2cf753842c78f577c427bfc724a8ae4b276ab675d2cd89da4dc259f8e2b789251e8b3bc2eb27fd9ce8f54133d0e473b1e7e5aa678ddab40 create mode 100644 .pnpm-store/v3/files/82/7f0a3aa49e067fc0c8c94e163f4e2d2ec1ef2e33036d737494bbc91fd84ee03fded536c2f88a6ad69a4c0dd187dab0320d2f00515b541e0bb4053a824ab79b create mode 100644 .pnpm-store/v3/files/82/a14617c4c819143e90eaef71b4e97a4504346cff1ddff8a3584b7582752318a26f4fffac5eb041a7486e2740b508c6b6486d53b78748c4aed0131ded1e6880 create mode 100644 .pnpm-store/v3/files/83/44189357590711b093e36073e96d447d88069d9fef306404c0496420deae1e8486585247afbd8ab302b93ff4f730faaa46ab1d44a7e76f6c2bfc8be12dbb9a-index.json create mode 100644 .pnpm-store/v3/files/83/502f580a08892993daeb597c45558a359d8244502ac35add8a7ee66538aea4af89e5eb26c59c804aa151e9879a2d0db343819389b53e8fec2ce90eb8adc4f8 create mode 100644 .pnpm-store/v3/files/83/7491d510bdc5ed7b783d1da36bebe0ce28964ef142a2c1d3216fc5dfa86daf0aa04363a180670deff8bfc96ec2c37654f2c54104116a2e16435c2983e45d0b create mode 100644 .pnpm-store/v3/files/83/a3061446244cf8159ba475b2523ec9c7ffceddb0ba45ca0a5095fcb4e8319fd9da94e0534ee2eb2209543c380ef43e4c6225714503f408b037cc61846116c1 create mode 100644 .pnpm-store/v3/files/83/ca2b8d5730e5e1796713a202c7197664b7190c521f06391a3d44166dee31ed17d7af0cbfad837387180d0eba3a0cbc8b467089f7359cb62a505e4a5d56c46a create mode 100644 .pnpm-store/v3/files/83/e6bc7aedd7e7cb87c1e432e9d84b696cbcab3c819243e69f359e3df89c5ebf3bf7860eca0f475be626b12bb6791b9ab3c43a4ab9173e7ebcca40ac16649600 create mode 100644 .pnpm-store/v3/files/83/f763c4ccc28071d71403422cf56f075d3a93591cf1c8f797137951bc9ef2c601c1c818e47f357ac75bd0dd7a402ae79b42e7a25b3cced27b8fd17956115239 create mode 100644 .pnpm-store/v3/files/84/60d10c37b47fddc157b18162e117a61f441f0c2da7397a35cff3590d11f54613dc89e41bece8b2caeb4632fb7e4cfa2d956d1ecdd6c76050c38f14c6538165 create mode 100644 .pnpm-store/v3/files/84/f32db517dea42b38ae04a3dbfe82af32a89aeee90af0fb69e61aebcade4e1fc9b832a344e25573021e22caa060dcf1b0a4051b52006a10e5b649bf169905ca create mode 100644 .pnpm-store/v3/files/85/0a9d410379a883be229d29bcfdbbde49736af342365b6e6de02dd72d13eae258731d93f35f1f29c5943ee70ac44aaacf7c8e81e5b7caf1c4bde89c059a96cb create mode 100644 .pnpm-store/v3/files/85/32311e7c8beaee5977b01e5bbbdd1d8060a38acdaa5e3f24398f614d7f2225a7f7ed46d8fc99b30206679396f6a97e2920163befd2054680970b183d89c1b6 create mode 100644 .pnpm-store/v3/files/85/5122404beddc0593300f65e9a8d639a4315a3731939b3edf0bb2d960dfe8c0398fd0aa03875b6808e0cfe4bcce6008bda286d124e6fb37f5aea621b9935477 create mode 100644 .pnpm-store/v3/files/85/90bc962549f6a253d477c555d7a8c1c17d2a4a387dcfb1a75dbf5e0d3e4129d759b06363ab76a18475138ddc023f2e9c908bb5f6f3f3ead16a9ba9cf15e55c create mode 100644 .pnpm-store/v3/files/85/d23c64ed5673f239fa2c0a2a739f5d6ee4b6905ed2a2e85f3e7ef2f892e9a57d83270a480280b3ab1ac8b4c04d065c67510011252a4ea192fef24e52064eb2-index.json create mode 100644 .pnpm-store/v3/files/86/7b14a1814996d0aa60b56b39e762e97be5b0d44dbb97ee108a9010bad9f7a8132604b127ead713896c00e926624ab1d72e923020e65a43894bb3fa52a93dc4 create mode 100644 .pnpm-store/v3/files/86/85b4eb8eed5452513756d56b6f198438f1e8ec72c215c1adb143813835fcace142b0ebc458422277c806a6afe8f4ac904bcfc44ab5b411ab60eb0890dabf1f create mode 100644 .pnpm-store/v3/files/86/ac6330fc0a0b7ca59024b0c4c5dea85be3e88b54acaa38ec6123720968c3f4a5f8f490a574825948783e97b4ceea4c044d15d094d37adda279df44a7ffaa55 create mode 100644 .pnpm-store/v3/files/87/0020aceca4fbe4535eb3f82b30a0ef3076534c6ded1514d1974c482b2a17778a53091d5d43324dbd2a742ba38bb5486dca46eb690a4d4f4cd49d5cf54a4507-index.json create mode 100644 .pnpm-store/v3/files/87/03513dfbc2fccd7e92aff0e33b0c0c4c49602bbec380997d451c0ecf19a50c9ef63021ad05c9f5b0e2bb5b31bcb7d9f89d9f6999bc4dbb465e5c195c94fd3a create mode 100644 .pnpm-store/v3/files/87/3bd21d4b214a909f94347540c5012c71873f55481017a04f8a62c7d1ff67dd97c37c92a32e9cdaa87b949593267449f09099f5b24d0a04f261a246709bbac5-index.json create mode 100644 .pnpm-store/v3/files/87/586a0e6cdba3a2f9edc2da4242395548d991e8b970a4e0004e477878a9dd621cbbeda26e17936ff573f5c42d3a6489a9ed7707fc73cc205e2c389926688c2c create mode 100644 .pnpm-store/v3/files/87/a602066b09e40a276ae9a7da9968fc1b4781ba558ffc9b970f1a29d98f0dd1b6220edd3ee8becdabf8011d4abe4335c2f4e5b3d5f7e75af5489bf6041cbf95 create mode 100644 .pnpm-store/v3/files/88/3b3f518b7f4362a50ddf443a5129ed40ea5bad26ba84e840ffab5f97933d4ac293cd0a7b0bbb8bcf20e926128579761d0002f5209814b66b9474d2c5727275 create mode 100644 .pnpm-store/v3/files/88/67d7902bb295b67289f36792631db121908dff17fc0ffdf7048eeb9d8319d7b76d7e5afce696abe301d25d67ff9cb838df273ff1909de866405774a502e355 create mode 100644 .pnpm-store/v3/files/88/a8b2413416321b0c0a429b87f16f55059bd212c5147e9e4d13b21753c4a4495111a49060cc9d3d8901c686d21e1f4879a997761554962ee26f28ff1ec396b5 create mode 100644 .pnpm-store/v3/files/88/bf125f60c7b88cbc6f9f10a5d89b986e6fb80a1116ef8cdddc5ed48a70bb11379d89485117b9a9572314ad7efa76f3df01893ee2c77b400f1a5a22a2891d1e create mode 100644 .pnpm-store/v3/files/88/c85551bcd40ae7ccc27ba2236bc56f8a77b14123fd17bf06ed76b4914bf7c05625bbe2544e884daf31e872e542c3be2ba9c8ed21065b110210d1438f244f59 create mode 100644 .pnpm-store/v3/files/88/ce54266e9da92e394df530bc9ad8197e78e9e82483769c85f52835bf2640b071e82897f0e1e5b066a5ec9583d62496a34745d0dd5e5fb94c92d6888e96ec5c create mode 100644 .pnpm-store/v3/files/89/6c895d04982781b986f325b409f0af5257e3c9b0c34cc94e34662bf4ebedb7fd4003ff3f9a6445d0bfc258e2c48fb350046f5321b0e319aa8fdebc6485ec0d create mode 100644 .pnpm-store/v3/files/89/7a0ed4408f1e71461cbc201f84bb06f923e55953502d21de4e44f5d871b9aed0a42b430c9d6bcf2e5654b4f276307db1b210028842e6abcbfe2d7426893be0 create mode 100644 .pnpm-store/v3/files/89/c83ff195109194be55862bf02cdc17a89ee09de9356ccb40b6049dbbdd5a997c74815535398af1672a9c0398b66b0610b2537e9a24d98cb199f6ba385f9d26 create mode 100644 .pnpm-store/v3/files/8a/0e1b78e71b704a7b0b2e1bae44fccafdf3cc89da537e98662119e5d3c067a85525101129eb43d35b99394a5c9f415fa85a839901d842f6564f7418a7549dce create mode 100644 .pnpm-store/v3/files/8a/104325c9e7a79ec76c4cb47c636a7af588d568d301b1eb1819a3c26509f0c71029356fb8c36cf119c58faf42cc839a9a61c91167e9752e5f484a41a72d67db create mode 100644 .pnpm-store/v3/files/8a/1cda07b83d04a222abfc8cc3724b6b70f1da0a5910561f6fb29392b2987f51c96caab6e501e26e6792d22e51759e05ae431185ad478f751c4195f63ce422e9 create mode 100644 .pnpm-store/v3/files/8a/3d8afab2827f439a43cfe74eda36cb0b4a1f308bad8693d74998f839a041399143616f889190207fde09eb2dd606c913b529fed3f71168ccefcec8ac06899f create mode 100644 .pnpm-store/v3/files/8a/6978d2a51629ccd3ce07e2819e69f59c342441c9bf13c02ef076ee6c26ed00e073149197fde8c380970d50b85cb8ecb83354c181a5c444dd0cf4f4a54b242c create mode 100644 .pnpm-store/v3/files/8a/b1133eecfc28f9f8847c60b44088655f55cc41dea7918d0aac29af05453441d194522c09bf488dc422ffa2da87d8a54709f4b73210a199b53d8bd423455fed create mode 100644 .pnpm-store/v3/files/8a/cc9806d9b936da280d7db0d423cbfd11d4fd8ebe6e589a37b16fee578402d0065cbec3ad832d3c8a4ab19ee809a567ecc768b91cde61fafbec90956bd04300 create mode 100644 .pnpm-store/v3/files/8a/da2c7fd60e515309dff555cc64030e0438138ea101d524c0d4eb80d31b97a2d5aae7a0b03dcb00d7803822ddc3db62408177ee4459799e370a4c0f978a4eae create mode 100644 .pnpm-store/v3/files/8a/fe620b6ea45ecde732d8e4290ef631fc3d12f4a932aad68a40278732470b61c9b61a086fa3904d704872f2d6a638b5e8140a2adebfa0216b386fa18fa21521 create mode 100644 .pnpm-store/v3/files/8b/3e675ce0889407e6a5d4d900b3d268524bbf0900378efd6b3e8f3a97c934853a7ffc388542070f4603ff3f27067a3fb2c1b560f3e3658750d8444410a51ff8 create mode 100644 .pnpm-store/v3/files/8b/4c3d4c45322b118e256bacd8d1b41d947fec780910c6e4302b7566f555b0177ae5f0dadb8fa586655e97ae0175b7460721f98129bcea9390c9ec727215f267 create mode 100644 .pnpm-store/v3/files/8b/5b979112de286cdd68728951a15c0aa861271a82f612dc5f5a9155d00e2e3fc559a89e7504ad0cdd071740aaa05a9196a36e1659522abf2539e0d40a3f2527 create mode 100644 .pnpm-store/v3/files/8c/6e21cb0d42741d2e7e83d6b7523cadc9e975165b506f6386ac391ebf3ebc11bceb181b1d1faa45ed98d3a1f59bb1d7bcd415487e5a0572250a50c520ba6856 create mode 100644 .pnpm-store/v3/files/8c/76dc3c303de4b66a4efe27db3c3cd694746d9f87c3c3a8bda6144b040be5f2d62466b44a0d1a7619ff9ffda1326874750d5ece5b98f71348126fd067a9ef9d create mode 100644 .pnpm-store/v3/files/8c/7d63dee0ef215edb6e9a4ce5b7b0f90a661722e3d9fd6b56b0b7d3348b106ea2777e9cdc46d38c6a5c38dd81d5f569058dff753a8bf597fb7e339e5b6fc233 create mode 100644 .pnpm-store/v3/files/8c/a3c30e80a651b37ff98224728525b7c7fbd6b5962fd5710964e27fdb62d11d503589449dc527f52fbac163348381356f02a61161e70a9fbd74676157b268b7 create mode 100644 .pnpm-store/v3/files/8c/fc066a80e8522e2a25a3b20d188fd7481f70e4e9cf22ed81ed7c1460312768f93b82120189e7d546b829ab2a0b8eb8c2f5735a26156a1d0bf7f452c0e6c87a create mode 100644 .pnpm-store/v3/files/8d/23fe7f504266890bb02a861ec09e8c105af4da16b9fa2fc05cca78eef34d963bb0ef1e6385010a3a6a61604bd3e3a7789a262bde862602da552118499fd167 create mode 100644 .pnpm-store/v3/files/8d/37983b3720760c2b7292127583729b0fda5be817ba7d3ee7fdda7bd7d5fb84016496b8111fb6b81e37f413291c4fc320dd17a652ff767a66fa5cd2af07bc54 create mode 100644 .pnpm-store/v3/files/8d/6e40e90573d47dd77506844c29230f99a3164a10b0d8c0026d8d8968ff310192754ae99e21d3df0ca6151295d1ff4bcbfc2b3db3f2571a7f724c067bb2e0be create mode 100644 .pnpm-store/v3/files/8d/92d968347fe07872f7e6c9081493b987d9c61e2d7fa27d6f0acdb82f9a7babc4b6ab8563abb7964f67ce86c5de47e803e81d8bd06f3bb455e12c2abe5ad011 create mode 100644 .pnpm-store/v3/files/8d/f53e5c5b67d4315c9ad84af483380b0ae8daecdfc9d00f1111c8bdd9999478f5fad06f5554a57e9ccccdfa2458ab65c1ae53e9bf2d3f0e8dc878b4d44af02f create mode 100644 .pnpm-store/v3/files/8e/6b285e1e720114a1e234eb937fb961db55b0425cf12481d318e335968c4114087aaa72a5bc9493bb6d4c257e8a3bfd7fea1d9b92897c21f6a53e074f8d8f1a create mode 100644 .pnpm-store/v3/files/8e/9271d8184a4e6579bf41495ee432bc84c2d1f268e5c56b4748c162a9e2dd76f6a167cf7d289961b1f33010e063be4c816f244a6042e9e3f764cba8f01dfb35 create mode 100644 .pnpm-store/v3/files/8e/dd5fc63cf9d97c81256d0c7988684e0fbb49a61876ac34237c870cdb50cc5e246c83b6e7aa0b88c5eefbfbe5cc70e5f656b6fd91a7209e3682d1d0f77d8102 create mode 100644 .pnpm-store/v3/files/8f/16b22ca4a1ac4aaacc9d1eba641b5614d840cdbb09f4f54f7e7e8028031682fcd892ec5ea4c9efacefe80d182ce8049cb50cbcbcec0ec188ae5f0d1694f681-index.json create mode 100644 .pnpm-store/v3/files/8f/543363c88f34f1b8a38c663b7a6dce94714dc8aa0f7320107b627cffd89c9a48a39f17bbe9dee017a395b92e68b7d79ff9f3e87162c36f5b2e98f63cd31d1a-index.json create mode 100644 .pnpm-store/v3/files/8f/7bb19812e42cb79a440587955979a85a3d1e378d0102feb9f866ce02604c3d6adaea73b38ef4d87d2cf8c911d2f28c95881d2c78a2bc88490a82dae9708ec0 create mode 100644 .pnpm-store/v3/files/8f/8b7a71c73e56c2b0607b28fa41257399de6698edabd12744808566d5b206c2e88e199e17f64177f7a5aa6db658987f0738837bf48188e780b749b699f2c3d2-index.json create mode 100644 .pnpm-store/v3/files/8f/a6c01c61f9279b1cf1476459da41046047db7656d43a726e18d4e2dff255d6ade87c0bb942f6fa51d45db75fa54a4d92bb660a311d53d3158fb2fcc335e07b create mode 100644 .pnpm-store/v3/files/8f/c0126f45a068a0ad8e1bcb2915130852fcf48dc73994571e935d94ac61b786aac5bbf243b6e660da51f9253d3e99035770fba80ce978c2322d03fd9af00905 create mode 100644 .pnpm-store/v3/files/8f/e8aa03e0c14238f40ddfd2056e8e6fe135d08203952194977d6436fb3479b3101eb85219c647a46e7bdf020b1f4c338add4ec1adad272121212d0d95d8fb50 create mode 100644 .pnpm-store/v3/files/8f/f58a157aab8c9f0d39838c29d2d75d9fef5ee049198c6bf18cd3eb416a7ba87c65f1bbdbf44ffcc7905f5fb3a561c99343f667f25ad0bf3c198000cc06f9d2 create mode 100644 .pnpm-store/v3/files/90/0a616ad2a76af1f9300cfcc7e90e78626dae756bbd9c371bf8b6a98854fb765c9ae746f3da7455688e6a52c3285a31a4bec57b6d1f539316fc3d474b80df6c create mode 100644 .pnpm-store/v3/files/90/29da66412be1bd000d237c73222660743ebf773426b53714e6df85089e74df38fe2e898626b7ecf64dc08cd077f32028f4535da04b4e7da7964e89b4a5d131 create mode 100644 .pnpm-store/v3/files/90/5949877d5bf1a4338a736814c76ff3be0c10f74080d6e6f814dc93707713482d576db59afcdff175bb8415fc8641a46a9bf1653703204d72e32eaa71a09d76 create mode 100644 .pnpm-store/v3/files/90/c955a0eeb65735022995ae4dfdd7384f27e07dbe28d0ca04d9e4f7ab06beea856e4a209418423f04365557024113ae2d09016cb860504eb5a0235a76437a0c create mode 100644 .pnpm-store/v3/files/91/43fadec88ec2a6c2a3f77fe595050beaac279ad6ccafa1026b78989670f079a63b7bbcee25c8226324fe7085b97578dd1f92421b36944d3c14ee09b133cccd create mode 100644 .pnpm-store/v3/files/91/5a63077799dd9c447ed649028fe6864ac7db4f501d10f01ba527f3fbb01644db936b3c3563242ddd1579e75eef66bb5d946bfff108cb57a8b43e1d6fc38100 create mode 100644 .pnpm-store/v3/files/91/870500921b04a8e7d405768da7ce42f3de36267c5aaeba73f7cb088fd271577d1e798bf7af984c085c9f4e61688500059c43d6dc53dc2d87682769bcbf4570 create mode 100644 .pnpm-store/v3/files/91/db2b5af37e95e30fbce9696b2c5d3f43bf136cbbba3f7934a9728e17ecc509fa968461077394202894da78849628760b313f1a08ff55d622443ff26558a4a5 create mode 100644 .pnpm-store/v3/files/91/e9118fe55652fedf176cfb58b192142820c14da808d9b2ad399b5af89bcc7422488bac56279e35880b5dad3e1e4244db61a0f687ffac2921f07183509c32b8 create mode 100644 .pnpm-store/v3/files/92/1876e8dd9cda5f666a50900da460bb5408e0d8d81bc9e6069e2935784419d5bacd87df0dc4a35bb6e86b9073b205ed25859906cb867cca0190c6a919542e85 create mode 100644 .pnpm-store/v3/files/92/f65e8366488c00698fddd36c92ddc3c51c42aad4ebeadbbfda0c4aad6e2e899de249e2ec46b0e065cae7befe5c2f8b537446c10f79c537f5215ff34c75c5a1 create mode 100644 .pnpm-store/v3/files/93/7565d3e35c8ee05fd8fc1bf1a5223680b78d5423cd9099474cfcbe42f98966de88da7b066c06572e919c30076e18d6d72075538088a64a90180a4b4143214d create mode 100644 .pnpm-store/v3/files/93/8eda9d35d4add63f80b1310ad67b24b6dd8000edb99a60eb0b90d5b3aa39eb5d80e78be6fb24ea75b45f4dba31b061fcaf47770fa73f97a1fc4c4f6e7702b4 create mode 100644 .pnpm-store/v3/files/93/a9bc330e67304e9a3bb431ed2824b12a875d49e63380bc9f42d2cf6759ab17c8e7aa55967e761eafaad6bc94a91206d4b40a74410cddbb9184a210a18e1b8d create mode 100644 .pnpm-store/v3/files/93/d19c6a1b2cc3c77b5f7a522eaddedd712eff42fbf265240a38af52a090797266f5c95f5d1fd377cf803fe542d4ee9f28f2032dc1c34c0981388355bafebeee-index.json create mode 100644 .pnpm-store/v3/files/93/f2327154e59b1f6fa2f55659fd5a8bae1da6cb4dc2ea5ef736ed6abbcbb2840286be9346bea22a3dd52371ac842870bd388dcc1e5b673696bc0cad868422d8 create mode 100644 .pnpm-store/v3/files/94/02af8588ed5c6e9a8e8e862182fa9e5671260919416df906ae00c520b4657b4dab8ad6207c0c9038d08164fe82965f07eb036d565d336009c1358fb1d4034b create mode 100644 .pnpm-store/v3/files/94/1219e41e9d3ee6791122a79a8a78a281d60149e1ab5012de813e1591269c5edce58e8516c8dcd8baaa0b9d177246c2b2ce1555ed0459c563657ca79757db5d create mode 100644 .pnpm-store/v3/files/94/43d614ff35cc21a036fcd00af3dcb6b7831c1272a50948a7742713b6a2e641f8e7ee844b0a45507960e5e3926dc2e6d767092433dfc030a9a48ff8cbb8b8ec create mode 100644 .pnpm-store/v3/files/94/5e32d575939766647bcd28803fb6a8edc03f54ad28849a46f941fa278d918403026a3f90e9d5176ef0fa8cba1a81cac84f7991ff80fcf28c61319f1cd22675 create mode 100644 .pnpm-store/v3/files/94/6aef66be215db0e1774cfed236f7f580c4394e3b36ca61c8562ecd0e3994e652cda956de6f3fb8aca20682c4c36db6de664059c7e8d21b52a5c39917689a2b create mode 100644 .pnpm-store/v3/files/94/b81117b8ff3e82ef8b7883ea4ec7ec281776a165272a23de6afff34d15f67a0806e5aef74a4c1bb54e26b83d981d9ca1ecc0ebe2dffb295bcd163f816add10 create mode 100644 .pnpm-store/v3/files/94/c9e9c8bd8675b638596957a0da3e75f0f78d7b18752045b91b0299309a218443f486f71c7e274ecc8417ded7a72258ca63a24f1db9941a67fc8955bb3e6717 create mode 100644 .pnpm-store/v3/files/94/e2d7fb4359f12dee1eeb79ce7a9292fe617188a28df287f725d49037b4847c6344bfae29ce246ef152a5a975d57a902229fcf59b744e0650d1970e67dad260 create mode 100644 .pnpm-store/v3/files/94/eced229e5e52e3ae3eff22cd355dd3e0023b9f7f2eccd9644214eba6743c9b677ced252fad6d49326e46c4fbe18cb17d49e76799daeb1aca45ac8b6f11ff2c create mode 100644 .pnpm-store/v3/files/94/feeedfb24da76070b1292fa57bf68dee5563c06c12bdeb850aeab2cf056da3aaa09f6a06dbca086066044852f804924e369672d8866ca89b84e61ea060df0b create mode 100644 .pnpm-store/v3/files/95/0725a69f7bad1b4e0b18d45b0adc757f230d76d0e9a336e65b0039f4398cecb3a5a3a875168bfd37ed7a9bc55ad73d3880687fa3e6e2d2d78704e8f85a00b0 create mode 100644 .pnpm-store/v3/files/95/5589387b9431934c6fbc96ae49005aa70d1aa733a3c790ccce80d2d261b781c8e45414c876066800cee92765fa91c3251271bcdbd52a7712c40060b6862b51 create mode 100644 .pnpm-store/v3/files/95/71ba03ab417d2ba945740b6e4221d9b00a6b1de767531954190ef68857a994074038f7f2c598daec6f070d702ea4e4233166c61b6a62febe37e7880512ad99 create mode 100644 .pnpm-store/v3/files/95/d3cf87747960e10083627b760ca2254911a0e040f56e25bfd3bd6399a9deac31982ce2e12830ac40b5785f1771417f4dbe4b9c21fc866390fc8c4045fea85a create mode 100644 .pnpm-store/v3/files/96/f785ef141498e0498fe6f064b9599863ffeb3d16b0640dc1991c50247149a7083c7ef55751bf028d975f78e426b4df9406fd87c76757bfe136defe06368bc0 create mode 100644 .pnpm-store/v3/files/98/21846c750413ebadac7389ab91e93cd745a991f7f6eb303d1875c91c6eba7790c1dedcb9d39cdd2b87e89f79c9d134ef88315ec61537baade8e949b0008986 create mode 100644 .pnpm-store/v3/files/98/2350d30de9ff41b93cd0867b3a680097cb023d352e1872bff254c15488f5e616edbcc99e7447255a0e8388cfa2ef43e7821bdd7fbdcdb59ca1b5e9b91467af create mode 100644 .pnpm-store/v3/files/98/5140c2f93ff333f91e1d4271bb18a43edf11cf365920306a66230459efc340f7448cfff6c55d34e3380661a1e2bfbd14f354ea9f1f731f748533cb21af5f8b create mode 100644 .pnpm-store/v3/files/98/6439d04a684b0aaa69a2376929c5959889a7fc1fb6e5f223c2520960184dd9c357eb8cce47af040fa326fb76b7e08c443bb564d2bbb50f3f1583e411df432a create mode 100644 .pnpm-store/v3/files/99/002e416997ce567c94757c06f216f0188a87e2ebf071d5bc8498ffac39e0210cb606621426d8adcd554ca75250c42b930c155bf88b580a54c5312c4c4946c7 create mode 100644 .pnpm-store/v3/files/99/1e493a29c310dac90a3c88f9e53176a8035650a68e4f4208894aa6c5ba554a2126682943872673950b8fbb6b6561d3c798313f4c0449f025fcab3d8dca2aeb create mode 100644 .pnpm-store/v3/files/99/2457d154aac9a6ab64a5163678edba7a289d1fe41ce8b9e721fd4512624d13d427627e3acd86c0d5786736e99331ecd487297dab7cc9c4e232906cc4a79078 create mode 100644 .pnpm-store/v3/files/99/7c78f803f05eb48e6d8056ecff8cb7bb5e7eb21757f57af31f613773b6b12ece8aabb56dfd2ec229b056205859c7f33079d20e605e9a4b1fc23414d3f9d517 create mode 100644 .pnpm-store/v3/files/99/a1d9907b716d8690ed2f9b508475b33014801b3a735ed45dbfc50cc5f7a5e4bcbf1feb5f56f1646c8577cdc9ae0507d4b84f0bd47cdfc84b0c931742145373 create mode 100644 .pnpm-store/v3/files/99/a41c672d8d40f94feff2e0fb4b94f3b8a30911f15d499c5fbadb3b48152987c710dd26ec0be8f2996a50db5dcd2b4c3abdb227e1104c6beaf028b44e712857 create mode 100644 .pnpm-store/v3/files/9b/3006a24c328f3a2a062aa74d29d7cf4e1845db42c2e64ff30d3ef09ebd5522b1c26034f7909b597762c4a440d3ac1d074fa7b05431401c9cd74ddbe1098bd3 create mode 100644 .pnpm-store/v3/files/9b/7e8748ad7a1d90c0ce83a2fd5597a580c11021e7c9f805a482fa3f6897b4f62e4c1220917e6b16e312a938a56497d5d533075061422cc07aca774c50ce0ecd create mode 100644 .pnpm-store/v3/files/9b/82f66117587d3e82577d3a2a5d95c04c1ba9affdd84a56e061362aa6a4d51b89c8525706758410c255e14cba0758d628b94211692e5545b7dc9520ed7e81c5-index.json create mode 100644 .pnpm-store/v3/files/9b/8f5c2f05306e4446b98ebf07ebe2761b2fd8f4df4fe5abe56f9f8856185ac8feaf545355e9c36822baa3673eeb2ac643c49b06f72dacc788c611a7e5fa4865 create mode 100644 .pnpm-store/v3/files/9b/f594ccd6736962eca38313ce915416e33ea1dc2b375dcaf1115dc21b0c5a6dc336c79732d44710aace4e7969de9e20aca6d75591178bde93e5b738309084cd create mode 100644 .pnpm-store/v3/files/9c/0d8ba3d1779c4a34db0ea702629f837133b168a0a6a874c49fd1ca235d421c56286f306e5171cfe1d46e32d0dcbcf6bbe6dafc1dd2a34a5abee768bd9a7c22 create mode 100644 .pnpm-store/v3/files/9c/1ac3a731dc6d44f1d2e86ace6b58833b4f58a8d8428088ee43c5e4f4c3c251b2c20c5985f45a1b7c09f76e8fa13a221c129c212ab221dc60ea4a1ea5847e0e create mode 100644 .pnpm-store/v3/files/9c/d9c4a0a0f965b30d36b8ed7915f5a133e27f83955d03aef00ee5d68389f3ed445a89a5764dc74a55f785e48b22eff41f8e287b32028a54fb9318bc155e59d4 create mode 100644 .pnpm-store/v3/files/9c/e10baeda0bf5cb29f537a98d3b7e2ab2e455ed860192602e134c24e9bdb7cccecfb2223e286e2ea9ce5fe1999f1e2844f97ecd5aba9b9e1be776fa8ad9bd3b create mode 100644 .pnpm-store/v3/files/9d/2c316308a3071635d4520ade2be25bcd3b6c0ca31d21b67f3949ecc5453ec04b1e55c30cca1fdf410e1a21ad1294e8ede5c2df8288ffa330b85d6336625604 create mode 100644 .pnpm-store/v3/files/9d/3f25f09a6d87f9f5b0145129f8c83ddc4e3b8a8938da70ae134466e643c1e00418d5b26773923732d4d11bc457402d73c202b348fd9493afd4c8701ca9d4ea create mode 100644 .pnpm-store/v3/files/9d/4c8b1e1c69bf4f6acfad48f4f06f6ef8f77789dfab4ace3f341defeebe8769d51a8137fc361031c4186103c305fdd1e2bcbcf87f89c95f19482b9b05aa5edf create mode 100644 .pnpm-store/v3/files/9d/4e46a6c22135fe5ac26b9fd563ae40e745b6097de17eb7a9c6bf723d305d360f12487eaab548dc8159e5ff93f88d79e93ccad8913ce2b465334b7a672713e5 create mode 100644 .pnpm-store/v3/files/9d/8d9dc739e961505de3c93df7e739590dc4314f287e3e844f69db5811af4560a415deb65d9d3c871ac59defb03eea8e904981258bd98e1128ee4cd94cc13208 create mode 100644 .pnpm-store/v3/files/9d/a7411f88556bfc246a03e763b78c659d19aee0bcbb725ec7fee2ba9a8cfdb6ba19bd3762443364b4f34177e0a1f1b6694a08265a6b3155ac4286654f5d5c27 create mode 100644 .pnpm-store/v3/files/9e/3986df4d351262a7daccacb42e2fb606c5e659fb5acc839fe9750f5b05590212a9c4ecf9aba59f5227784e7fa6db1fdcf433a93b27aae478ba1b25ffde3477 create mode 100644 .pnpm-store/v3/files/9e/64978f948aa2060bbfc3124ec259e629fc8084867635e817fb0d2f010f0b9cf9cdf5b9d106f7cd7ec3d86ee6986e69abaad88fa082bbe4bf1d4efa4cdc2a40 create mode 100644 .pnpm-store/v3/files/9e/6eb59931b09c4a273a771aeb4f1f1ff98703bcab5159529374306be52eec4348f785adcce85ea7fb25de65fbc51e00162a3482d18608ebce346bd1868cfc3a create mode 100644 .pnpm-store/v3/files/9e/76ad4c07714afc166d598037d429e994513716b650ea4834120f905943c5599578a95ebddf06d5af57238e0d060468cd073490a8c7cfed47704b75df680e16 create mode 100644 .pnpm-store/v3/files/9e/86f86780b3fe7b6f6b35dbe8bbe36444915e04140247de6360273e461ca1cf46277066f22c052631d60d6418c4770c26fa73a7a87ec2a810f0d0b9aa2c33d2 create mode 100644 .pnpm-store/v3/files/9e/8c0c4ac286d9b603c08ce8b7d58b87c2db56b5645d55e018a03f65b6ec07c86e57c92583822137d39afba6ac1832a707b8b7dbaffb0dbf1de0a4cbfb09e9e9 create mode 100644 .pnpm-store/v3/files/9e/992a241dd484dc2e832bb43335d8a8b413a4e52ae9d7fee0a149270928797591360f2bdebeba370f4f3f38d4263a55851b6209d8e8a7766e316b2d9a55f1fd create mode 100644 .pnpm-store/v3/files/9e/bee0a01cf45f3a937ccad6115b84f68d1f941a1c8c0ef6d741836f44ef660afd44e752894c121d75cced55fa5aafe7b4efafa7b4def6fd008c0e99cfc7a115 create mode 100644 .pnpm-store/v3/files/9e/c6d29e4f7782473db5d5fe259b2e7bd09a87841625e33a12f660bd2c32f7b22d9ed25dbacb880a8c808fa159de2eaeeeb746593452675fb6e54b3444f63976 create mode 100644 .pnpm-store/v3/files/9e/d93ea80e7e1af1b5ab46a9e79c46748c7f8dac3b95298ac3859e2435a972c032d0eeb10b49e5573143e71a29dc143440ac814ebc55bd037ae318383f12d153 create mode 100644 .pnpm-store/v3/files/9e/e3e07435cd589e9e7aa71218f5443bbf8b98a23f01614a65688033969f2179da684d29c48068cfcb89cb9fac7530d57144f934eab0fa98e89c00c8f8dbf11c create mode 100644 .pnpm-store/v3/files/9f/7f275a1e9d86272bd86af3b0082ecabe7348c1f82ac162c39935efd5fe34aade0ab96767dcbd54f879c4436f8df300946924729d74e75f4d205b2894156cde create mode 100644 .pnpm-store/v3/files/a0/0a72f7de09bceb01c4d8f816acc6505658c6775156eec14f3f63753d07086a26b9b4e9d6cd9d86cf05a942ca98a5969d26976a8725dc31b95c773bd582461d create mode 100644 .pnpm-store/v3/files/a0/3dd89801e2bc0c565a81da7777da16c7a795073c2f5ba0dbc418b081ff9d1030a5e301c9522943af8979aa372fea3a3988e6c91e196b00476179eabc249a67 create mode 100644 .pnpm-store/v3/files/a0/3ebd971c23050ec9dca59a04dfe9b1882409fe0b51637d0b233d5d59bdfa44cd52729dd6e70a0fa5ff0af5eaeaa3cf000812bc54997d77de6d6f81b9a3c821 create mode 100644 .pnpm-store/v3/files/a0/5880fbdaeb7715f23115a276a408f31896b9deb3e17c6cb7423fc5cdf58e3cf683e68f21a89d1616a99ef3a5f71ec75b1e3c6fb8415771546e9b3d63738cfd create mode 100644 .pnpm-store/v3/files/a0/b213ad797a7b5f75a516979916943e71c9a615d5cfb2e62dbb72c4b6c4802dc1b057a30e12d57b67e895ce09f282de4c1f23d2e7e1d24242a748808d163708 create mode 100644 .pnpm-store/v3/files/a1/cab34f00c6f4ac091ad072dc3311cd7556976b4c1b9043c322d8b95d480fdd1c79d8577d7f661e5482bf6ee1a8de1568f13bfa7657fd99436f300ea2375c85 create mode 100644 .pnpm-store/v3/files/a1/ee218acdf42603db9effbd55e7f5878f239b44ba7ede263708bdc23edb5f5d23a069f4ed045fa88a851e83226a3aeda14f3c7088577fc6a1c20adc6cd2e03c-index.json create mode 100644 .pnpm-store/v3/files/a1/f5845948297bdcfe55e20ae9a88c552dcc5afe5039019f8cd1795f39128268c39024b0487251f490e440345cd8f455a2db429764e79d3cd5aaafb1f82ff8d1 create mode 100644 .pnpm-store/v3/files/a2/05c01c9b03557f88b5b605a32a2010fe27fe78192c879a431e314dc4713e6666ffa6031002adcb3b4fff2e69ba8b11b3bb967d41e841bd9e31f442ee9853be create mode 100644 .pnpm-store/v3/files/a2/411eec7e0d0c64e1785a090ccc459451898a18d8e40131afaef889e1c4db32549f6bfbff09e3cc97c29b088c6259f9c0fcc0f24b083478d8ad0bac5202790a create mode 100644 .pnpm-store/v3/files/a2/62b789001f657cbf2e56b6aba0ad41095220ca57a794ac2f284836e65dcebfc403fc452ac9118824ce6ded9961bccb773fe3b3d2e449f4f8c0f67e24d65939 create mode 100644 .pnpm-store/v3/files/a2/eeabc283ed742fe102c21bec10e0032193ea69c0282278a501db3806b8d570d002e614506cfa408caae9b46070539cd66fc659ddea2cb4397246b1ccc7745b create mode 100644 .pnpm-store/v3/files/a2/fa5e1035cf43433dedcee44c288314ce07a5774549c42157f56d6df023c044e74c499270a01a424acfdf3a7499f426af82bc1c247f90f502208cfa78dfbf28 create mode 100644 .pnpm-store/v3/files/a3/0af9c703d817ea9831a425f627a05d59c15986ca37ebb536727afaadbe38d7bf5027361b701d36b7338550b1e112ab7a10b2adf0577f2d92cedd966b7e4db3 create mode 100644 .pnpm-store/v3/files/a3/3ae24078aa1d53e54cae72ed4cbbc541990a7495086321c2e358cc88c2c90bea74df3bb2cf12b762389d817995859fe363064b8aff206d39ec44a35e80f77f create mode 100644 .pnpm-store/v3/files/a3/546abbb09e6c664d6a425151ca1f80008df8b2a4883a77c2bd1fa100f56bb9a13a046cc13c03a01ad9850340f579f0a268228ae736d5809658d676f75366d3 create mode 100644 .pnpm-store/v3/files/a3/5f3208755d71f020e67dafa6d3a3b389e8fc52dc6a3c7e7de7539fc3dabca4a3d6bac68caa56ac30236fa4eda447523366ebbce3cbdd10ce50e4ff2317d7b6 create mode 100644 .pnpm-store/v3/files/a3/944b258479c61b94fab8150f5376bfc8d356c36771bd3b624947cacd1ba53eca837e4dd68c028105b1e96dc8618ba38618185a833b18dcc4ba7503712cff7d create mode 100644 .pnpm-store/v3/files/a3/a7c92c04c230006bb9019dc3520bc3a90b5cde0de5ee9f2e050ad205a4345f8603217663f68724d27de6e1f40cf59eca0625739fbeeb0f00d81a08cf2b13a4 create mode 100644 .pnpm-store/v3/files/a3/f124d8294bf3f35c021542dea7b37b0fe25d4b1487685580ee24b0751f8ac35bffeeaf47cfe8ba97cae45c83fd9d520f563bce890306c10c7cb8a43ecacd50 create mode 100644 .pnpm-store/v3/files/a4/02a29a30284c6f00e71bcd6fae2e271a7972f619d3a6113e3f7dc9d90e06e5fc2637faf44b99227c9de0158c83d38faf0797a067a83de9f035397a1097acb0 create mode 100644 .pnpm-store/v3/files/a4/3ca0724ff00e49f7e420770b261f4060927143350d2ec4dc78cff6152aa9db5522e1434af76ca332c7d1b07de0a716aeda163b725569a7c29d071936d2476d create mode 100644 .pnpm-store/v3/files/a4/64260c3b5f4350c0206e1c663378b792fd212604ddc32a0df4c01375b308784b069e7138d6000e5462a42c72bfb1fbe9a2c818cbf17bd37188c51353eff57c create mode 100644 .pnpm-store/v3/files/a4/781c7dcde5ed0587ff2c429a15d3601435c9c199d7d754172174ccab7c0809dea652cce6cc2b4c6203237cb631e900c34eaca37b4f1818ed771bae25db9e8f create mode 100644 .pnpm-store/v3/files/a4/cedb97cca462e02ac01e27fd2c5b1cc303d86c447effcb89eecd12092e3ccbf682b1e92fae54f768753280a106602dc288a637c7c04b0a2c1f36a5fdc5696d create mode 100644 .pnpm-store/v3/files/a4/d5476a91e780e8f27fa73731178ec0db9816fd9fbcb871ce567370e16654c8c5c670f3407f2074e33f6766490ea7bc4d2c2506412db22f4388ddaeed0a2eab create mode 100644 .pnpm-store/v3/files/a4/f416304e22574379c0ef2139d47000001d3bacbb87d713c59dc9627c76e4eebab4814821947a451d21f14743d0fdaf48978285feb17cf0d495281db65a0931 create mode 100644 .pnpm-store/v3/files/a4/f5de11c3f6f043ba87086f57daf05ab7e9864c2529199d754efb623037339159f1e0c39e4591e674e0c3a6b15238ab96846cad9675c7a81015c69f6b900d83 create mode 100644 .pnpm-store/v3/files/a5/2551d996d74516c241cca4caf16df82c55d8710f880f7a369c25e898cc8666f740892725b57423b9ca1afcccfa928fd6a1b70b30bf69ca52aa727aa9a12f40 create mode 100644 .pnpm-store/v3/files/a5/a738e28941de370992936814e42003cf1022173266bc4d1d2f8a03852f7ac8f1ed57a39a90d5eeb76dfc030f51f9e53291d54a9611c60c4ab1d9649164a5fe create mode 100644 .pnpm-store/v3/files/a5/afddd1262d50f6c4ea072d2b4328925b0d73d4b96f7c23bf78df2a7fcf8076efb502d8bb0970150591885d6c90655273ee4a7ad99b370ed8c1dd565164c219 create mode 100644 .pnpm-store/v3/files/a5/b02278ca69a9c7fcf8e846362711aabc06d291122bdc86187546315b317076599695fb82cfa281ec5c46ccbc6bd71ea439224de3495f0918b3efda1400271e create mode 100644 .pnpm-store/v3/files/a5/e55539f3a54f749fc2cc0f634c9b4ae410487a4b0fe6a6189d8d919e78c8fddbad5ce15a8b8800f535e1e3dd2c94508aa397624671d394d11b2946dbe8c0ee create mode 100644 .pnpm-store/v3/files/a5/f8fb7e6b3425936c725f2bcb84516b10cc649d774cf500d6139023b32967e05586b987332b074bcafb6e09f2ce447b4b0e98ac0893067aa70098140fc6a748 create mode 100644 .pnpm-store/v3/files/a6/20014558daee35e829e29bf63dfb1689400b0a4bd8a6737980add1cff446f6d3cbb8356b6daea1890ac49ee4e24f8966de1d9456e5e5832efc260329ad2c3b create mode 100644 .pnpm-store/v3/files/a6/67549517456dce6e2a7220eaf75704173dd6a80ccebad2d4daccf973744e8e451b08129b10bc2f900b8ae5f875efd0ec1bd23217dc21b534eedc082f70db27 create mode 100644 .pnpm-store/v3/files/a6/83d880c9181021481db1785cbd611f6f454155c89dbccc98f3a9adca3a98ece82cedd603236526bdb9d5db031dfb65a85a26c24dcb7cbd11be350d64557a68 create mode 100644 .pnpm-store/v3/files/a6/89a8bfa3c7f74edec133b8c1d4eec0d6d29d958e646ec5c1e905fbb17870d23bb94175cc33d956e26f2333d3e3fa2e5d6a52f81fc38ef485b090838dedfdf3 create mode 100644 .pnpm-store/v3/files/a6/d1d66c5d5e7c726101413c8519e27465cb6af3d280fbae5255436c6421f825cb89d906068c420b47d06e19f64a3355eb1629df8b082f22bdf1ef0c46cf703c create mode 100644 .pnpm-store/v3/files/a6/e8aa71fd9b82e758e0ebf48ea04f835747b63613ba020d99e52ed84aac822237327967ad686c55b9a03eaad49af96d90945b7e10323ed65cc59660254bc550 create mode 100644 .pnpm-store/v3/files/a7/33f1fd0809e6565550178581f840738c8592c6aed6e02076ff15c174ec45549ea0045579ef986980f1eba750caf23c638a13025f8c8fb59f0be035ed7c3890 create mode 100644 .pnpm-store/v3/files/a7/4f9c45c05b40db1a8b17c1d343aeae4e999bb63702f3ee1feb01e6d5c48f108853fe8e94a88e6de74f0ac53e22e929296a930d8817ee0a879397a5bc49b646 create mode 100644 .pnpm-store/v3/files/a7/79093ac349e739542b74f4ea1c4426a99ba863b81ec8c353e7b69106ef61c4010394d281948bd9fbb67c8da6d45ddc782d35aadd098cc20483a0a47df7029f create mode 100644 .pnpm-store/v3/files/a7/89e4aadebd6a7a5e30df229effb4ccec5eb1a1bbeccc902bd2cae7985dfe00d2a321cfb5f12529ee46d59319503ee7773c409d3462b68114deec82f4f67dee create mode 100644 .pnpm-store/v3/files/a7/a79129d34891e0a9cfc4837659814d484158e76338f7da2438f69aeb760c3833a823c136d2a9af85663dc9ae790b4a67d0436fede86b5fe3cb78dc7e0f4c37 create mode 100644 .pnpm-store/v3/files/a7/a98fedb94c2fcde3dc090d4e9ec1147302263a1f17d85c49e9c9180ac8863ea1e6e6d39a9482b7ab9a8a76d257f80a7148af6586a7a4637634c34b8e6c901e create mode 100644 .pnpm-store/v3/files/a7/aa6566e654526d02452bf71e23864213327b482dee35f4b3a5ea8a89a1447f54f0cf8bea548a2328695eba09f3bdf88922bb5f7fe60872a1449a149734efc2 create mode 100644 .pnpm-store/v3/files/a7/acfb991e0c6216e6cddb2ebd429d3155d87fcfb8990340b9a78ba78b969ce87e645c42221ab0bdd1e502f054ab59bb70fb7082836204398912399a8616c2e5 create mode 100644 .pnpm-store/v3/files/a7/f866f88733cf5fe65c9f4b6ac7a7b5e25f5fb522c913202dd8a8456b012c37db293c51957fa4d18da558645e9a6f876bacf07d623eef42898afb3e12e92af0 create mode 100644 .pnpm-store/v3/files/a8/6e0757e2e665a63a281798dd4e07311530aa78f0964dd8ee3c311a63c0696a26ff48d7235a7777b3909682dc0a47ad61fd0cc74c633ce160b8cdbe70ea35a9 create mode 100644 .pnpm-store/v3/files/a8/6e2b735d2d5f75dc2c333e39438e5f767e059d25359e0999eac5a8cb6d37d88acc95eee1895b690da1b093545dea468e0dc6367298a6c4866ee2bbce3b0f6e create mode 100644 .pnpm-store/v3/files/a8/a14843f6a675f56d4fa29b351e8cad04e2c97a5d7b8372ae00dec96b95bfe86b2278a0c2291dc9eefbcf7b1a4a99199f1638d09123c71506cd0462368de2a5 create mode 100644 .pnpm-store/v3/files/a8/a3d01b7ba1e4da3fb9b078d4b1894940d6af6e835a8157896e3c4fb2fc237f0a534b8709ef423967539646703b240ec1f8bf1773dfae97ef78edfe1db09445 create mode 100644 .pnpm-store/v3/files/a8/d9453919aba4af6a6412a7811bc6cec1b582a113b8f67b94bc680ea89ff06eeb745dcd3a74809faa31e977abb068d07281a5a8e404c428ad16ac129b023e7c create mode 100644 .pnpm-store/v3/files/a8/da9547e093edde4ac8542f108941fc2aa762467d2ac9ffd5cd236a239a974256942928c8e314f383c9473be83971df4c1d2df85004119c7c0c1842efcca7c5 create mode 100644 .pnpm-store/v3/files/a9/29bd31449a6a886b9a1326970ece810f487f7d91d83cd83dce1136f7191c1a7d463adaaa765a33689936963c585b818067feccdcea50b68120a024a21d7c59 create mode 100644 .pnpm-store/v3/files/a9/6d863ca2014cb6e753696b74247bcc708325d3c423b211bf6fed68577160487eb3100e579f4029c24e38b45fc6084767041340d0685f61a2a38d8f9499990b create mode 100644 .pnpm-store/v3/files/a9/a55fbdd35f1ed7a20c652053dc4386d0318e0770ec865344e5086daf820ea5ea539a0e38ebd1a53962aa3579ae2a4373bfb627d8e8d13e5c6eebd273cc2f1c create mode 100644 .pnpm-store/v3/files/a9/cee6704a4bf5f3b0d43e63be7efe3cd435ae2d533dc5229a50038611c0628a66a2224f1c3896b3920a5145bd4d3ed34cb45e2b56f589cf613fcc8068bf8081 create mode 100644 .pnpm-store/v3/files/aa/21c2c739c91a14c83c4e2ba249dc5aab8886f51454e1a1b1f4924ad5ca69a09773cdf25998b4ebe0f3ddbdda17141c58b88750a0d0dc5f290bfd92ba4c0829 create mode 100644 .pnpm-store/v3/files/aa/9b5d5ce198d3d540d03ede88b73ba117940c8d8c3c5f84c6c98bb59a885d65dcb0def8183539a2e34fa86ab57a04bf916b0c33f423e62d90f7fe98766da4b0 create mode 100644 .pnpm-store/v3/files/aa/a88cc9741f554a32fbdf2fb6d06625b7a36f744033784caf41f23c31107d763d2ab37fd4397cf0306255942f644a6b4549da736626dfdbb84a601a446c86fd create mode 100644 .pnpm-store/v3/files/ab/0d23def82ee91ca5e341e1d240b53188ade574c656d7d3b102182128c28457f68f5aaa3167ece7f60f803de66b5eb8d4d524d8acfe052951069bc2c58523fe create mode 100644 .pnpm-store/v3/files/ab/12a5d09732804b1d4de6908cfa41aa55f8871cd6451b62a65b40a0bf7acb4f9185f7173292838bd56c33525706196b9b377c15a9a0cdd9dc04d350fb40309c create mode 100644 .pnpm-store/v3/files/ab/17f727e88d3f6ba42598ba5f859e8d197361b76f8b6c0f9ced0f86ee948280ed1618abe5955b83dd61b6027c9de37cdaba26ef5eda7320e7a112175c2e3654 create mode 100644 .pnpm-store/v3/files/ab/9430e279a09b4a69c30611dbb00da32486bda78d1f6c456ac8d214ca9ca7413170e6f5b7ca6b03a70b92ee3efd2187f8d5a38a15aa766c068c2af42d8e04a4 create mode 100644 .pnpm-store/v3/files/ab/9cfe9cc74736452820d063453269188a2e6b016ec5585292610101951b20ee3216710e050f9a507b8af429adcb021f42e29323596af402c9f5a826ad37ed5d create mode 100644 .pnpm-store/v3/files/ab/acea318c0ef3f959c217d7eabaa4435468d61db91b3e9fa3be25b2cf570c6386876f0537431f52b03d011b065e060779922eaa390c7f28dbf842eba97fbb9e create mode 100644 .pnpm-store/v3/files/ab/f99e7ed11edd0970422198c43f6b5b0076d43a0a43d43cc00e34a1ffe87fac861e166e19f64ed1cdd662437d74d968a4794d4f799fe413ec512c683ee5506b-index.json create mode 100644 .pnpm-store/v3/files/ac/125df890a4c044f23a84eb5d97cf07dac095ed1047de31f6c5416097a3eae445ae504b36cf96f5fac6e75895a003b651a61dd8b44bf1f6d15bad8b9d2a744a create mode 100644 .pnpm-store/v3/files/ac/132f23396903cbfa13e489668a3ef87018aac2eb920ecc49f2229cc3c5866928af0ed7f9d39754942cf904faf731a4cccc9f0e720c3765a2775f8d6cbdd3f8-index.json create mode 100644 .pnpm-store/v3/files/ac/45a9326a659784801dedd99b7835221f9ea3a0e21e9fecca3f5b93f3f9dfe596e1b5956254b02399ef1698a8ea712ce3dfe09fe85ab446033e583dd0698e39 create mode 100644 .pnpm-store/v3/files/ac/59f2e1af72c60637e173a89b97ae0aa41a38b57c3e96d38343e7fb915e954306e0e7cc7af4f00427bd26db4525c51cddc3532f67a793321d31ade5ebad75e2-index.json create mode 100644 .pnpm-store/v3/files/ac/96538778096a0e5e511982931486c7db096c4a14ccba780368b137e7836adb7d8d1b07f6f1b49c8b491671ad4a7d291224d7bcf776fec90cc3dfb52682d69e create mode 100644 .pnpm-store/v3/files/ac/9d3a964b53689b214cc7b21b13ba9be912511e66fc8c3ba33699f38088a28228b85a51e6d5db26699e0929c6896a5ae68b39232a1ad45d7d3554428da8cfc9 create mode 100644 .pnpm-store/v3/files/ac/b14e9146e444f36c4f1e0fe3a2dbacf0a83d23673110d52e75bbf8a96c1ff69fac76b60e6e25d2e4a37803ae541e47d5d811b8d59b09c816e0059f0c6723fc create mode 100644 .pnpm-store/v3/files/ac/baee34c2feca299284281f0f2790d80887aa5acc65c9887328a40ee9be843ee8bac56134e2b4f79162d70e6a913bd14decc03cd09932730fb045461423c655 create mode 100644 .pnpm-store/v3/files/ac/d4e69646b90bf746d5b37d3cd82a3e358e4ec2859787aceca2e733c0d866907023b549ec29e002e7a13248adb02b2f904d95a7a107476a54936d9953cad117 create mode 100644 .pnpm-store/v3/files/ac/e0b895cc6251f251601aecdcffab9edffdbbfb0a8f816bff79052e2eb42f9d6931eab1ba925d76ba27f5f0363a5f65cd960bc51a40593aa7e0844994019347 create mode 100644 .pnpm-store/v3/files/ac/fcd926bd55a827531401fc3802c639a95bc5f1bd66a5d210dff86ce339cf4c3da7436a7584cd735f1e496df99b90faea2e72fc419f36f1b8737ac6aef777f9 create mode 100644 .pnpm-store/v3/files/ad/17b8ae5f00662ef6a893b5f012269be162f3fb05a01949f548668a4db9a3b41a9a9945239fe80156a26e2e44f441fdb9da49dfd24ac5f5b3b4ba77a28b7ed9 create mode 100644 .pnpm-store/v3/files/ad/476003b0723330bfb91c105ca7891751daa5b638d69a6c9684c73a25d4bfa0e270b16152ef3a8ea62b49cb211f1c1eb65adb4b95852adc589019d36671c4d6 create mode 100644 .pnpm-store/v3/files/ad/6c0954f87c11bd9e6a024e4c0cff8634faee2b2bd4d04e98ac2fdba7fd40b963cc1087e2cb38201866d42958c7066b7ba7c608a6428bc519c28b0d1c46df14 create mode 100644 .pnpm-store/v3/files/ad/8bbdcee20e96cddad6c463c982bce4f3cdddbf896592fd7da2391b1548fb70bb9052dfbd0e5e7fda748ede1c28f20507aab960761b971720af442f00398295 create mode 100644 .pnpm-store/v3/files/ad/957f9f64fdecf5d25df9a313a26340029a86e16f7710bed9b6c3c2bc56c9cb807b563e2e8ad077a819ab4d5e6e256e17a8a3b3cb9dd4a6c8a8fd64a0958622 create mode 100644 .pnpm-store/v3/files/ad/b037990715ae2ebb26b77192e2d5b66464b923898500d25af6cf56de37d7f20d2714c09fa8ba81f6023d26ad87a8612b4b071986bde042f35d479dbd6165ec create mode 100644 .pnpm-store/v3/files/ad/bb4d2344affdb143902b0cf0f2a9ad123db396b1ff645007e58ca4fd12faeb22c91130af6760ad82353df61e2abfcbf3ac7bc04d6eed890d776f5ecf27a7a0 create mode 100644 .pnpm-store/v3/files/ad/c0c1594c8af521b895fcbd85e970bbe0eb33796dbb4fc17927a023d160ea28e706f4311bc571908c177f1dd7076bc994672c2083da2d7c6aa99710b9a4f319 create mode 100644 .pnpm-store/v3/files/ae/2f100c0bf7506215032fbfafdf1ec7b59472cae537f5a4102d533a00c55def8019525c4810b725d60bb9f44b2c16a1d5764eef6b70a12f8ba538b9aab7e500 create mode 100644 .pnpm-store/v3/files/ae/50376f383b9b71966b753e21007d7a6f2dcb323a5ada4da3add4989525674b97616460708b48defe4af6f97f2939574cddffb5fd2d070750145b5a547be9bd create mode 100644 .pnpm-store/v3/files/ae/65cd47e36b82a1e599733f33b55265d06616ab306d08c5012e60b9b5f592939e4597b68ddeefcf1d7eefe5de8a50a2b5316073386fc410f48372addb029300 create mode 100644 .pnpm-store/v3/files/ae/684e89835cb11338ea2f61cf580cb20b56af615449f3093289988f555eb3f14690c9879e6a45699600cd3a2f1c3079464c0bb985da6c0b9ef4199ff0e4a92c create mode 100644 .pnpm-store/v3/files/ae/8076d6082dd7f151ba28e2b6e4eafecb0b8001e95ff555c1a82bc0b8e0b50fb3d436b2b11505972130718a0484a5206bd867ad48a27746cd8c7d252cbe6664 create mode 100644 .pnpm-store/v3/files/ae/8d09041faf1aa5caa5afcfe51589feb7e512b5f759f4651ea0156ddd1a25b78b7ddbbe6bd75f235340e628eda0dc996ee1bba3437aff0cb8c73b25e68f0ef9 create mode 100644 .pnpm-store/v3/files/ae/e3153e73c7f972996b7a017c2383ca257f1cabbccdc0d0fe25e9f06ea39e38383981b1cd84309d7d78144f3a8176d86210ded8064fa350bd4a810601036e97 create mode 100644 .pnpm-store/v3/files/af/136ba2e083ed1fec7f22be5cdbf4227c59d4c765658ef97250bc5ca76dd88570da6fefbef0ed43024339d9eab07b058e7557606f6f77d7462b067c7b1d4517 create mode 100644 .pnpm-store/v3/files/af/953743e9d913219fa173f5944c32b9f7718ade979f1f9ec81ec31a32a966b0b9a499fc594baedfb053e7c323bba17ea5847575d891b51c8dee0dd1466e471b create mode 100644 .pnpm-store/v3/files/af/aef167c81e71b21c1b17e100729bdb4f5f49afbcf47f0f96b23356a063d0b8e33cc704dfa1d4e6c8264a03ee2795c6572ce62e7e82928729c3a2346e042f85 create mode 100644 .pnpm-store/v3/files/af/afd40e6ec425da3a4b245251654e8b7f30dcfd6fb8c77876ef98007e59e3bcb9e5c88f51355133ad8dde19e998e5fc481dd17b10bb70d3a38ddb2331dfe63a create mode 100644 .pnpm-store/v3/files/b0/1f0cc547dcbb810627fc5674fd8106e34cceb46f751e9918743960c7d9e274c11a8d89721ca607314b8b06bc0776595ddb4158232db692a1de3281a25b45bc create mode 100644 .pnpm-store/v3/files/b0/446ca0379117989362f99d8d7fe211ec72b524e54a5fbca68f0d8df0be35f3b5fef65664422df9795a9e06b48020f14e5d0189b62ae4886edb4230ebc2635b create mode 100644 .pnpm-store/v3/files/b0/8b4400bcaf02ddcf64b77d435b652004e36a3de459b4bfa88de8b5456c6017598cfe14b9dcc9dc3d5f71634bd963e5833f0ab65573454bb1a1bf1343889b66-index.json create mode 100644 .pnpm-store/v3/files/b0/a695c2917b40eead11c9fb82696b5ef05a90a80b7af2f41d5ae16d9d8bc70ced3442f0670bc4fddc131b90ae7231d4cff8b76eb78302907d1dfc739648ca77 create mode 100644 .pnpm-store/v3/files/b0/ab248ff60c4696c1be68a284eb847905ce6c9abc789b1975dc244ef6e1451051b82d34828ff88a0c3d4d618041f87fb246f10a7342df53da8a56e657e69846 create mode 100644 .pnpm-store/v3/files/b0/ab8d266c58a5a5c7c611822a0480e94a7f868dcdc70a116bc977ba2a4f5d2dd2b3a19cd6d0114a25e42a6b1054f12469863964cb4c20f27bf69acb617b2c5b create mode 100644 .pnpm-store/v3/files/b1/64c069196b7c589375c22aea5c1c418e9d8f5c3e2c6c15fded89f59957cb6b626b0ec82e836a420bc93425ea65781e21dd19f5541447ba2dac43f8f514e6aa create mode 100644 .pnpm-store/v3/files/b1/744c7d0f7bd25a4e43151c287f41e03a84ec508d84fcba5789b7830fa4807d7b9800d0dab74beb76fca2c5c5cb96e700c05cb17461b495c93e687f2e065713-index.json create mode 100644 .pnpm-store/v3/files/b1/a7aca17d9885dd5d7406e650d28dbfe142c21750a0c88c2bf8ec00d295db833953647cc00388ec1c207dad04afbeaa82c4ccb926aa77b4f2974eb6b6ec49a7 create mode 100644 .pnpm-store/v3/files/b2/3063b3b003eff9d66cf615e9fb61dc42aa3574bd11f607d825b4d3e3d3e07ae17c5900ad8a24490f69ec5370ef23772a4f6ad1c274ee31db395711d6221991 create mode 100644 .pnpm-store/v3/files/b2/832a62be5aa22be32b87acb981521363796247fb98c3cd8ed47b5304c2c3abc839303ff3ba0e40808c8589c7dcc31719d71d8b3f464889056f343deae87739 create mode 100644 .pnpm-store/v3/files/b2/ad8ba45365b532013bced96d83301c641c9669fca11bff048a0f5f314860d596d759f1bc320e84ea02aa57d1cb6b6a184ed43919008a14dd7d9da7c3e22f34 create mode 100644 .pnpm-store/v3/files/b2/c061193d16ae1ebbd0d453acba22933a116eccddef68c86b4d8829badf23d40820e36fca03a6209f634aa8f88f11c45b3fca4828021210b247b8441fcd241a-index.json create mode 100644 .pnpm-store/v3/files/b2/dd3d020c74195fec52393c7a6131b6cf8cb79db9bf678090084dfd43291ac8e4d6a7ed438c108fb57d0b02426f20242abef35d2ce6e2cff761d96a6ecbadc9 create mode 100644 .pnpm-store/v3/files/b2/dff63bcc7b05d26a73c788736f50fd3f344a9d5ee882a53babd88150c6f93f5e28e887746d439b075816b866f0403ebafb01b2d924f3647c17e781618961fb create mode 100644 .pnpm-store/v3/files/b3/4390cb64173a79351fe5105ce61013e5f104d2fbfb5f6b2843297e49258d39ff8acc7eb0b19cef30902329c8fc07bf6187f635935d1b68e08db00374808d1c create mode 100644 .pnpm-store/v3/files/b3/5aff01dc6e0df1d5c5354fb93abd13f13879552be3ff83aa3534f9dc6fe8b178d72fd1bd53308ae5a426f0e9491a1b92db52b67e030a118fb611f87d20ac88 create mode 100644 .pnpm-store/v3/files/b3/6d38e6d24d989c7bc83a91e814d0e7c0f0e84b7cf842161e3a317de8698cfaa41e510868989cfbe05099a12811b0985312f75feee8545d870d9eef6a8b34c8 create mode 100644 .pnpm-store/v3/files/b3/77af688ae3782f97de8d7d5f58e971ed0d37bbdbb9d60682fda1be2ecc9eebfb786756fc126e908eba0c8c695605044fdb3fb7a06e72b2d17595cd70a315c9 create mode 100644 .pnpm-store/v3/files/b3/a2ef816e1c52fe04b89b1a8466b65e8bbbc169cc0c5b79a316d27097b6e1f5fe6df846dc0d784d2128366c17c6d7a7fda75753f95bd8b399c6ac65c40bf522 create mode 100644 .pnpm-store/v3/files/b4/14ddc783db5978d4c5b7c5894d6cfac31bdbaf81548e2c3a22c62f2e4f49de067e8f68a78e0554e59fe2fe0fc00e1a225c7fa83bdfda3b29d703164239642a create mode 100644 .pnpm-store/v3/files/b4/28fd20ac72bd8caa33c48ff8b101d733686231c3da0ae809919267437687f733c205b955b2b44a91afac7e27bdb46685d5fd89a80a130a358c58f9d30ae261 create mode 100644 .pnpm-store/v3/files/b4/321df1ba811b4dc69937d059b3b2788f3a4da00b0440544148d2ae03d2883118c47413ea0839232ba7f347721c76f64351330be252631bee71e5277aea7e5a create mode 100644 .pnpm-store/v3/files/b4/3da76a0470d2902720794b5aff8953bdad133db785cf801d960015ed68ce4e9688492298f3a803641a0cd4889103a9f12e08c61ca8526734ba95c2ea963fb2 create mode 100644 .pnpm-store/v3/files/b4/6c8af5e58c533df59662ec386716e9ba227407dff901978a6d53b0db01b2a06c1228d2817f6c84f8fdcec4eb8a29b393cb297b5ee1758a31cd3f001a860b62 create mode 100644 .pnpm-store/v3/files/b4/6f6a709c1880f1bb896531749c4eac3c31fdd223cb05d20800f77fac299fc11117a7b0f57dab666cfc052ba3d085516b72e16d784b2f49c4a2609f83e0c995 create mode 100644 .pnpm-store/v3/files/b4/7b287b64387a799b26efa6875005f1e9921df67195f8a5f021b12009da3e1bd61454b8b516dd7ea07269fbe865d7b0fc4ce876d2366bf38960f7302966c460 create mode 100644 .pnpm-store/v3/files/b4/9d32fc29631865b2b8f77fb2be70733687c20f1f895843d06a34a5ffb1f5374267d135b7fc4746fcd0228f7c3f3542c4352d201e8e52e57ee7afa2d414e3d6 create mode 100644 .pnpm-store/v3/files/b4/a7bf28ac10123ae4d9f08535db77626a2a0fbda0d80f08ba766070e5fb78918cb5898ac1abc78c5dbdbb2a2a6d8852e39de63cb03797d3384ce2bfc0e6a74c create mode 100644 .pnpm-store/v3/files/b4/c69a3dc40205fd75261c2f49a2e3c781237a5b13b5d05f0825bd42978fce22a997e08e3b2b1ea635a2bc4a6195cd39ff180a002037f45c87919e9010cfc340 create mode 100644 .pnpm-store/v3/files/b5/0ee849f290822b169e55b429083d892ef1a58488153ad63af9e2708adec12bb03c307051338cad81124757315a4cc50dc3acaeade47831ea48d69ceeffb69b create mode 100644 .pnpm-store/v3/files/b5/17c27e6efb57c2eb8faee7af745c8eca21fc812039b9242d248029bf1c0900486e42cb264016840b409492fa170cd0a10674359ae37548efc047b031393b53 create mode 100644 .pnpm-store/v3/files/b5/380eff412c03dd44d8ec5b62d6c5a38c49aeb95c5f0243ae0f25896cda7ca44ac902772b050f846805f34cb9390804ede5f799a739bf73fe6976540cf92c8c create mode 100644 .pnpm-store/v3/files/b5/792da5fa33d22efa6143ad456775902964b57f7ca065fa9390b09371886efb75e349b56ccb3ae0632b4b5befb69887d339bd68e1ca5f302b78202491481221 create mode 100644 .pnpm-store/v3/files/b5/b1c74a4c47c189b6b955dd73a07cf8cb5e43ae4fde4069487a7441cc7e5d33ffcdd31b53ec32bba0b8fca6e8f6c132b7fd824a4031aab2c25d8e5ab980f8f4 create mode 100644 .pnpm-store/v3/files/b5/cbe2a100b5eef6dd303f0bf4a1151086d264ae31e23d433aed4e8714d9781c89cb7cc2f053226d7b9c967789f8d1842da5205e5fc8360aa57089393c3b9fe6 create mode 100644 .pnpm-store/v3/files/b5/d14b9de786d49412accda9917f22bcfae7940df4b6708b90dcd0b52c0953b01bd7fba992cc9a8d92bd5e87146f2758d7d78ae333571780b59f13a0eacb2a98 create mode 100644 .pnpm-store/v3/files/b5/e8d025e2945e43af258b0bd308e1eb8f74e3809276dd30c2ad302b6e14cc8a163fd51742df1e7124c13d62d1164631938a87c09f527e3ae57927e87545731a create mode 100644 .pnpm-store/v3/files/b6/4853be2cddc90639e9acfd357e4bb2aafc7f0a86cf5400b5fc8ab7842193e18168de0950f0377392263f17e3720f12c2df1e2e7c4bc3e6169c377ef522e974 create mode 100644 .pnpm-store/v3/files/b6/8225d2c93ae418bdea765400e339251b9d5715ecf5a75b53c0dd8b87e4a0ce664bab32c219fbe765dbd96c9c103f0b6a6062200d5a925e790de380ee78f0c2 create mode 100644 .pnpm-store/v3/files/b6/a3104077eb8b8bed3c44f389bc0ebe1f4067066b70e7f3fd528d9900fe8272375a257a63c0302912d730d3433cc28026c0d6026e2010a8ebe785ca08c403ea create mode 100644 .pnpm-store/v3/files/b6/a48d2b46184a512b4fa93a492bb5bd899e620242afa0526ff8e44c435718b9e6b550bea2c25367944cd8b3edf3ada4f15f445637b6c1981e133673cf3780b9 create mode 100644 .pnpm-store/v3/files/b6/c6d84aff27b107a645b81b1f5f73ea3c29fa84bb4aed958272b8cedc164cc2c2b0f0a0f304ba701f416ad8a0caf634bc9a2bec1462b23d21699c921ecc53a1 create mode 100644 .pnpm-store/v3/files/b6/d73e1b5d11d31d61672f79e12a7e51c71b73071e0c6200bd23fb373449a4dcbb3abbf477d8b7956928b25d9e04b4e4e06c848bebd73981068b00f4b2c13c4c create mode 100644 .pnpm-store/v3/files/b6/ee193636f85ea235e9bb84483db6dac08e8a34b8c739d2ae1af2c7b522b565cd89c35d7f07c61774326da32e6f9fc574457b5869a2b228dd56babe42f62653 create mode 100644 .pnpm-store/v3/files/b7/32213c2a69b448cf087c3a3effdc660f89ecdc906b91ecfab85f5e96e48ad955ad1590c8f45a40e55993779710c196c6fa40d42048e3449b15c84ca5c59cb4 create mode 100644 .pnpm-store/v3/files/b7/536982627ade933222c41e57caf902acc9036655cdcaab822e894e8afa7baf3c38e2df366e50fbc23b9d59e20cab63ed6680d1ed07083a251766c512ae4108 create mode 100644 .pnpm-store/v3/files/b7/6bfd1b600ac5c43ccab1be586c5cb417acd40a264f4338343ee34c504254f5d0fd6153bcd49e7c8acd4a62ca848281aef37c486f8266c962989713dd6daeda-index.json create mode 100644 .pnpm-store/v3/files/b7/8eed1f60336d9a0022282b627af0e850e8108abb6799a71c9c74136ba45df8408d949c7143800131c36ccbd146d8a94c1ec8244506e861dd448d1d0a886105 create mode 100644 .pnpm-store/v3/files/b7/9eb2404293b59bcf83c61b436e548985430b8d1e742645fda6e097b107099e1479c1db2054013d8852d67937d9b105cd42fadff47f4ca8f07041e0fd9aacaa create mode 100644 .pnpm-store/v3/files/b7/c844d7c57d0bc181a1f8611dfef910ef61bae467735d2195c48ae94d8cc43fb30eb0bf67f40ade16c12d19c4092b389ef3fc8c03ad98d8436a0d12a889963e create mode 100644 .pnpm-store/v3/files/b7/cb9f8607cade56cc3ececbdf67974b8af02cf96dcd06a0f943d6717e110b919d18944d407ee34bdd7a555201cb4a93d7ad57043898cf93af32214c1a40649f create mode 100644 .pnpm-store/v3/files/b7/ce76f9e7ec9bce45061589b17d026d6c8dfcb67317317bd75dd77916ecd2e226e096928bdd4825a625b209d5cd1e2d3e9e150a69f0c75c54794b85fc748245 create mode 100644 .pnpm-store/v3/files/b8/1d43047144816ca7babd032736a33393d8f6dd8897220808670a13bf9ca5c8bc77fe4903d89e9dcf36363516167ca58692a0466d43feadd9852d010b968059 create mode 100644 .pnpm-store/v3/files/b8/90df9a2af3e051e26fa10d8eeffb733f5274c4a4795bc90cadd570c16f7ff8404a183c0bbe055bed3a31a40f3831df0c9a7fcffcc77e06b020946396ed112e-index.json create mode 100644 .pnpm-store/v3/files/b8/c05ce62b2da4722844f6902bbc2fb8cbe323f5e2afd4c558c4b340da5a18e13130b777ec910a1cceb9e7ca52c582bc87474d8ee0fd1cd72778f780df915039 create mode 100644 .pnpm-store/v3/files/b8/c47cfed40599fd251633ef50a961b1a6a43ec814e3625d8ce4ffb707d1a59ae4acc586685cdb3536aedac5f43c4170fb0fc48134bf23bbde60ba0f4e3b495e create mode 100644 .pnpm-store/v3/files/b8/cb3ceb6beb2c87135373d421c9deee97f4255ef1a96090f9c6618c055f504246b1094be63c1fa390e44570f890a3e144f4028e8b29392a256b0af544db9b5e create mode 100644 .pnpm-store/v3/files/b8/fcd5da09962a6cddae4b80b19a695bff96018db3b73e30d250ad0569a708fdf7ee48fc15bbf51aaed58c573319b12474a4d8b81d63f0f6a8854f83e361d4d9 create mode 100644 .pnpm-store/v3/files/b9/4592cf27986ee2606eab6c26d5d30b89c7f542e19b9f93c98a901b705bd8d7c7f038f3e6d39dd999799cf7c7e011e25811554a848523fed85f077dd9c792fa create mode 100644 .pnpm-store/v3/files/b9/678d0a2a24e11fea9074b0b2a96ffb2ef3f71a07d504eda6e9d6574e4b433efc58e8b788f89bd09b45d347701bb19cc75fca03d24d5ad8df8649e16a35def0 create mode 100644 .pnpm-store/v3/files/b9/9a2bffc77da0c4b4e3dabb03ada6e2f8bb327675087baec9429c76ae16d1ac0258742919f40d88c9fe5c48788180702b9ba18e9cf08de9b5cc6f3be0cb47ab create mode 100644 .pnpm-store/v3/files/b9/9db9fdb5009546397d1e0e293e2b650101af3416615f59258186b1498427ab61a1d549d475fae1e3d0e99d2a3d63fe9be52ae9ef54ba0ac4dfc8de62c0d233-index.json create mode 100644 .pnpm-store/v3/files/b9/adc0bb5fabce845c5465057c94270c0a21dc8bfdbd6ccd331c63b3fe1d0625370721d2d8b340c41aa9ded7052de3150673240b19df398ffa3372e85db38204 create mode 100644 .pnpm-store/v3/files/b9/f5f1ed1aa1fa3cdcc39c0b226b444c08f1ac18b62a73492b841178134af866620571e9e9818f581d2a208cb969dfe942727421fd4b2cf8c35139f4d44add2a create mode 100644 .pnpm-store/v3/files/ba/142198a3baa7f8521317cdb08119e12f792edc6e5eca44479997f6e146112071988d68ca3bdbd5dcb7e6a9d1dfbd1be5065f31543643db39f0a4e0e3e9f089 create mode 100644 .pnpm-store/v3/files/ba/2f517581994e50817655e253eb6d7f7349233e14408e9d00e4d0a8d7d682eb5ba6410b2c89170cc3131f2882e60ebeb73bc174d230d85e91fc572ea0a4ee14 create mode 100644 .pnpm-store/v3/files/ba/354c1fe94ff7462c03adbcd4f6ddc341a0616ea351315fce73ba7b5afdb6850d33c54c23530bbcbdb24e7062542cfb584cba1ac2ef6f47411934582ccafa77 create mode 100644 .pnpm-store/v3/files/ba/9f1263f982803651c6819f5e5cec57cf1ff6f31c88226d19e6eaa41b4c6ef5bc33f66f8b1661c0eb0800c569934539efecaf6b6e8390d1087a098c2e799b0d create mode 100644 .pnpm-store/v3/files/ba/caa430b1d98aea11b1c304da4670b12d02a894ff634ea1ebcbc97a64deeb392f7c150a7950a4613f1676ca16123f2ec4efe59d3819f3f46661318307b37d2d create mode 100644 .pnpm-store/v3/files/bb/01b1972b3cf627befa33c8e0c454464540c7e81d08aafa7c209f4dcc2e955ce1ad431e5ebed75cb6946f7119b7e2389bf7a2e5b18baacf10588c604822298f create mode 100644 .pnpm-store/v3/files/bb/03ddbd83c077730dd8fcc61b4a10e67ad7bba08f223c9cb9befcbcb3d332c9f6b9dbf7a2db5c2dd98868326b8324e4101a56679617429a821b3ff7345158a1 create mode 100644 .pnpm-store/v3/files/bb/088579b41b4d644819b09a4c405501f2aa82a28d28c276b8f5ec5de2c867133c315323a12de3d1c1bc36b3f174321a75a5a73d28eb90b59f7cb482fae88fdd-index.json create mode 100644 .pnpm-store/v3/files/bb/280b859ba609c62c3f250bce11ae38aa7364cfdd3e0ad3bbd5db0434f17ff92c457501a586fdf99df1c0e0073df5e851e4c11a641f36ec7218cc84606ecbec create mode 100644 .pnpm-store/v3/files/bb/854ed8b5b6dd5abf47915a7668b8eaad5f81e7633d06b2c91503086512741bbf41727c68b3a379dde13a23cf3cb55fe44f3b6b5ee3a2815b528ef53e8a7307 create mode 100644 .pnpm-store/v3/files/bb/8b7640f333a933dc9317e4da92919fb2b985d7b21fa19b2cdef38819299d89afaaf652ff7780a871b98ace0c39cdadba91808ee112f612b713675d827fd2fb create mode 100644 .pnpm-store/v3/files/bb/953ca98a410a9375dc1b22101d026d1d47861e06734ccb16e79dac724a31cb47087006acc746d0f44cfca12bcc02f7094ebf79c904b661cd077c7a7b7734bc-index.json create mode 100644 .pnpm-store/v3/files/bb/b722eaeb4a3bdc302e97ad8d6849f0f7a9068627344d4095fe1ff3f4223cc2605a94de9796ff62313abc2d8b4a64feb2b3bd2265fc6e562012228fb15fa404 create mode 100644 .pnpm-store/v3/files/bb/df8b3540c38173ba0b0caebb06c4ce0217a23c3e9922892cc84bc5953bf0ce590bd58c28cb548d835df25747a5990a5cf9f280feac234b07388c8136376ab9 create mode 100644 .pnpm-store/v3/files/bb/dfbfd867a3f8eab71cb3626893ca96aeee5c806dd72fc9e1a81dab9513948df9ad24ca87c3151456f9fd8b450e32cfb6edf7be4d723872118434499fb0d500 create mode 100644 .pnpm-store/v3/files/bb/e95e43df8020d175955987a36692a9c9579aaee125c484e002b999e4b28976d60bcee54a726ac2edd364cfe783c97551479854926e341a107de78b77f89ef5 create mode 100644 .pnpm-store/v3/files/bc/816a54852ce19f78ef3bff232edcc7135257bbc40e8dbf9ae9c967e4176b312de9915fdc804ec9c0d7595f01ef7a45d8490fb5ac7464a5499c90d7dc274d70 create mode 100644 .pnpm-store/v3/files/bc/847b1f82056c494494535f5017e232d6ab371ecd2ec26091853d974471efd89f3ff6205d1b24e91a57ca9e3e11e1bed1ffa6131ec9e5083e87b0bf00070124 create mode 100644 .pnpm-store/v3/files/bc/8b41e29ab4f645996648bf79db8aae8aab270c175ecc197e41c7f1271b436f1d156830bb7cd2416c861e61409683041a38fd10f781010c056fda338955bb33 create mode 100644 .pnpm-store/v3/files/bc/ac4b408873d95370151f7bf4a28d6cb851da0503fd39ca961d6803777e773e0352c02563a8aafaf1bc58dc317668b4963343a7e0a78f4e8f94ae0964de43ae create mode 100644 .pnpm-store/v3/files/bc/ef51ae5d9567b0bf1dc55a44e5384b56f667e5bad4bfcbd43bbc68057b1bc16c4a05568bfc90b9d377bb1ba9e92f51e1585eb134b8757a0d9b1dc5a71fcb18 create mode 100644 .pnpm-store/v3/files/bc/fcec0cad2f9885967a0ebb412e082e30242ec559ce37d099ed9a1cd79054d766de3fc5ab1dbdf4f20da8c8092f393cfd238613837312f246aeabec838e2f34 create mode 100644 .pnpm-store/v3/files/bd/07bf0937d1548558b6125a1a34bbf58225fe527d7debd7673f91652f28b5757e0e09b303272257ce11e686e8e6b123746f63f6739f82834c9d9d8abbfd8dbb create mode 100644 .pnpm-store/v3/files/bd/313ce42143e38e40456ab1bde968e1aaa216ff91622e12c7f096ca917b3b17e0a6b387082a4f86a81b354362f039f27d5f14a4a4632f22c7ae9dc0caab1ddb create mode 100644 .pnpm-store/v3/files/bd/3719cb793211cdf609d374b5baf8962af2282d2339582b4648363899f092ae424cdb5d33d3e0dc5f1e3b9b2c09f16fd113180fa32df194a4713559d2b1f231 create mode 100644 .pnpm-store/v3/files/bd/4d47013867e8489b781e77c3c12abfa3ee8a9e5ea871aef86cd2361dafc03a60da46f0ed5649a3691b5e4255ac7836c1bb2db833c52baf873da7886dbfb70b create mode 100644 .pnpm-store/v3/files/bd/8457c2a50278f75876ab3410df4c8061524a7e12822b4373fce9c70adb1f948f222c63feb449161ddba121ba262fc2a78399c5c13578a0beca27b9a2f4073a create mode 100644 .pnpm-store/v3/files/bd/8c5bf5acf0f540e91ae4b2ecf61601c5c71e29fcdb026535005e4b956475ce16b2cfaa2034eca430a32059d786af10501bd84ba4ef3f1a8edb021156c67e80 create mode 100644 .pnpm-store/v3/files/bd/8fd0157c1bd54c93e1af3eaf19c1d6bc621e2bd21ba9d98df2f7d6b14666b248af361299380e70b0fb37f56747ff8c06f71e34cfb46b4c8b0f42a79389bc21 create mode 100644 .pnpm-store/v3/files/bd/9609964daeeaa1d8c413938c07a0eea5311dd35f8a1eb852ed89f10a9681767672b8b46692409330d42bfab9f77fa6bcac25c726b1afa17543edcb2a841182-index.json create mode 100644 .pnpm-store/v3/files/bd/b7f28d96614ef9363c4bc912cf814909d121418d7d985dfe4ec24313c8de83eaa9ff6caf252323ef104aaccf6751d7562f9199071e1bfe91b533f065b454d2 create mode 100644 .pnpm-store/v3/files/bd/f2952e6b907b1896947a0c86b8d90560eb24e35a6ed76b3de30f825c8d02e496240199ebb5cd7255957d1ceca200d42807238a002fbf01b41c780b3eddbc88 create mode 100644 .pnpm-store/v3/files/be/029c8e026c331515cabce3d20ea687b68cc68e04391ca0d2c85e62bd4f975b84f522109ee892312828d3d0d4fb3446d2ababa556acb1e2f7ae48091ddbb50a create mode 100644 .pnpm-store/v3/files/be/0abf4787fb44399d44ecbea57f8f784dfc2374a060a7782cbed66f51c951a570cfb3e41745c70b29ce4dbc2b3d79cad64a75727658604c30eff462629f8841-index.json create mode 100644 .pnpm-store/v3/files/be/1137f53fada2e600f8377abe48d25449d3e07390d1b4963426009902743e00efa9e09c0b0e7d40fefa332d247b404ff9387bd90dd740599185a2fff6b46b1c create mode 100644 .pnpm-store/v3/files/be/1779a4a6a230c2e70730c1949b44336c280dd2b210b166ecce664af95981cfcb62aba8b4227623f1f31825ac344d4a813c186f0c78c83f31bfb4a9c0d092a9 create mode 100644 .pnpm-store/v3/files/be/7f154abe0f0c60da8875228b1cc2229d386554b1a8db369f9c6d46cf7439874a22733d707f8dea30477b57ef7153859bf383c298ceb40afa5d5c627003a3d1 create mode 100644 .pnpm-store/v3/files/be/a91ef43c16fd3c34d94efff92ffed33aba5111382d3006c284263451b314b73058bb89bfdc816ffc9ab956db18405e48036787d2ab53c40b072ebecdfdef41 create mode 100644 .pnpm-store/v3/files/bf/13ad398c5edee670dfa8d05d4746811cb704aa13b3dfc062d516efb6c79a288cbd3b46ec6cb5d615e758c91b6ba9f7203495a7aa6d6d039ed97f255522c6fd create mode 100644 .pnpm-store/v3/files/bf/20a68898abc409af3af35b8711daf4e0be4d16231102ffae0c699ab999c828c489e723ce2ce2a2f81a165c92b4c0b69f1999576eadcf47a4e7823f5f58bd87 create mode 100644 .pnpm-store/v3/files/bf/4f764a378787dd0387c3134c13e2867aaa6ce9d96caa63b7201d7126efdb73f7d2e180f9908f582ea8bb395a7ec84acea36b616e91a097cf67ffaf7019ac1f create mode 100644 .pnpm-store/v3/files/bf/9d2e8bce1eba8f7531d19cc9492c3a91a3a6c841ee22a9345e0c700c93e643a700c14e511a0aa3142378f1b04d1e5d3528ae519fb24fb487c670a3015c332a create mode 100644 .pnpm-store/v3/files/bf/b3082ada88a572cd318932da910d54332215a761bd7074f97a6de3c2000ed19ba7b128e22793e9697c73cb5805601dd2aaad9871b214a50da2e92ec97038f2 create mode 100644 .pnpm-store/v3/files/bf/b6c40241f8f4f95b442baf29b4ffb014a73f5ca44608ab253c1d8e84d03c7976a5b112d986f8b4cb344114062e0e670610df576294345a7a2cfcd94ba6693c create mode 100644 .pnpm-store/v3/files/bf/bfd3ec0b35d20ddb71638e3c071b9cc0eebdcb47cc2158086ffc4786cae22633745aac6536d71a59f471935573041cc1ec2c614d8124b6b2f23d3fe333a4e3-index.json create mode 100644 .pnpm-store/v3/files/c0/71765ab9d9e5290cf1118d0638493a74542c4501e771f9eeb25e397917dbc8977e76a36be88dd68d81251325b7d64d40be5cc238b82bc09d9040ee7d5cb0d1 create mode 100644 .pnpm-store/v3/files/c0/94c62412bb95393894055be7f979b5a013fbd96594aa0eaa18015b2b534d2bfa2b0d0fa7d9d4f5aad92fac0e95f2a2fdd342e458cfe1253a5e636e3d7d5e4b create mode 100644 .pnpm-store/v3/files/c0/d36ac934711e4c15cf62c316c1326231515c879ff5bd89d63d5b3d981a9788dbcde21d034f07e9e82e978b286b676ea1c373bd21c4025d71207aa49616726f create mode 100644 .pnpm-store/v3/files/c0/e0bbe06ebb03c8eafff1558d9e14bb6299703acbdfd3540c7e6310d8e8d2c6976d16305e1d61ef74aa4b1dc0e53b48e4613a3d5f7a1ab0f6146b548fcbadd4 create mode 100644 .pnpm-store/v3/files/c1/36f96fa049c5b4c6bb55955c68e4691bd2db2a6e201c3adfd196b03dade9a25afed4bf567b94058846a9cb82ee42b6951a4377cc9c48668f3eea00d64afb5b create mode 100644 .pnpm-store/v3/files/c1/90a8036b75442c8353fdda3abdb1fda793a99472c0c90631d70b1aecab7caa3d81025dba76e2e7367a089acc28a696d3f699ff4f1a97cb3753deee9d13fc3f create mode 100644 .pnpm-store/v3/files/c1/92b3ab6aced20af81e45c857bfb1597b1607317ffc9214714a30003788a0a615d0f5aa7b0fba4f4e7a9fe6f27806447f1c51030bd7eac6681682ae9fa7d077 create mode 100644 .pnpm-store/v3/files/c1/95ee5372dc6eb69e66401d88b1b6a1fd678c08bc4f1cf89890793ec0c3b6b6365389ba7c0928866a137dee5e417d603ebc1b9bc28888d657f6ff17f1e42341 create mode 100644 .pnpm-store/v3/files/c1/970e80bfce83d2042f600405d0b8dbe8625db907071d29e331d9e38e672c35ecea43ceb0000715e64b3dc7cddfce817549027ae58eba6de0921e2040fa0a2c create mode 100644 .pnpm-store/v3/files/c1/c8da7ab1f0d32759c1f86229b5c958b0d8f00ef257b2a18d03a96fcde11a019f21dfda41ae133afc32ce7d8fbacc16da03c26042ff9c4022495a5d3a3d655f-index.json create mode 100644 .pnpm-store/v3/files/c1/de895d49b21e6b7c4f96b6c6b794c0a7063eae9fd5ff96c082648a352a886709cf5aaa9d980fe9720af90c88594e654fb8a678dc54965e3c6f3886f9349870-index.json create mode 100644 .pnpm-store/v3/files/c2/11c9187797637969ab077daeb8b08e12b9ca3d556a34ccf1f744cf9661c3e459a77d88d8a49a32fa605dbcfb31449d2a2387210939e3fea0212afa0f4fddfe create mode 100644 .pnpm-store/v3/files/c2/31357ee4530b096062a4aeb6b23b0ad91336805e7e872835f718a2165be41017a1d0bb1791b2d37c9dbb245fe24a185062705f992169244bf0be55e9b800fe create mode 100644 .pnpm-store/v3/files/c2/a26189ae393e9db760d25d456ea734759e0ae076ed8b78eff44ed39b36c49d51df1ef1edcfa8f4b390cf96a828e82c19969f2a964cc6f6ea77fb27321b2d8c create mode 100644 .pnpm-store/v3/files/c2/f038ea2f16d7d5d85dd14b4c9bea0ad3b306fe0b550aa1e45dd70c31e822f8c928dfe6afa2c4f93e8f428da73186332497a82c5cca9495c1fb79a0c5381721 create mode 100644 .pnpm-store/v3/files/c2/f466eea9736631a3fd1c7116eb7fe8b5ec287c83a316484055973eeff3ad4a8232403feb3b4530793364cd870cab40c8307979cbd3a3a07a9a088396404ec5 create mode 100644 .pnpm-store/v3/files/c3/137c6286dfd23fa94a760d9b8547d237206965a52a992eba2f92948b1e45722b9abce26f60d8976d7f32e9d4f4e191a3d1c31302bdc9743eeaa3cb463b07d9 create mode 100644 .pnpm-store/v3/files/c3/23d914699640fc64f1e16c761e966a41b310a1c17691aaf1e1b6d541991f60958613ca30774ca96984af7b18a1467af3f042829fccd6f94e6b69171098eded create mode 100644 .pnpm-store/v3/files/c3/2846359600eda138a90719934348dfa939a7f43f6e716d69f882f9f38fca1854320f1db7ee154026cfb5c410fe6655c0d887325bd02b50678149501309dc0a create mode 100644 .pnpm-store/v3/files/c3/3ef5ab6ed7ef8ff37cd1138b63fc7c4cf86c49f3f49f7580029761c0c4312188f91668cb88c520485fae1d8dccc924e776cf460752cee7fb677f6524ee0569 create mode 100644 .pnpm-store/v3/files/c3/6074abc61331366a9638a9f1af737e97f69131a363fe17a3dce83244944bd578dfd8292cb5ec8d5c522c6754dd24f589bbeebc36bf5431fd9a1784c490190b create mode 100644 .pnpm-store/v3/files/c3/62271fc4e9b2b92ab0fe766fd8eb05dc57ff47603d682772ed0aec587e52f21d3474d6910bf2497bd3bfdff2827ea3135e38ede478e1fbbb966ebda5f73bb4 create mode 100644 .pnpm-store/v3/files/c3/cd563adad3336a607c017b7199e6725f57237a9b280ad39863d63c07085f0bc769a0fda6c6c11742c3bfb4979823a5441bc08497579768e0ef946eab342b6b create mode 100644 .pnpm-store/v3/files/c3/fe4ea53d849c8fd7bf2a70e05221577e2398da94e4f66366e7b6976637b72d4ea2d9b74aa848f8099f8655181814ddf499e99de6420e7b77b8d3a238190ccb-index.json create mode 100644 .pnpm-store/v3/files/c4/1108d9de17599ccdf432562bf8463fdbe9fe0c8e297d873adad5583be9140967b19b1ce6c7d8e3d2ecb969cffd5302f45dd3be3e30af90c09888fd23c5cc37 create mode 100644 .pnpm-store/v3/files/c4/8951ccb9755ad4002ea29f99d197c1b941de342aecdc8ac1009213095e33a7f3095d24083196568b1043d7631feba58b9382f25cade2ba16c41b92dc9c9340 create mode 100644 .pnpm-store/v3/files/c4/8cc0f942af055b1c892faf10b3a1117339585f81eaf6f223623d97904d213280dc17fa70dddb8a50e2eec9b57473373d7543082366fb1cbbfe07dbf26cb712 create mode 100644 .pnpm-store/v3/files/c4/d7160fb76b27d6bd05b628e6199cc5645fb9fea86fc81556763fb9fcb6ad27e3d27af567a968dad4e698e6b48376eeb6225b996c47e27fe8265993c58cbf69 create mode 100644 .pnpm-store/v3/files/c5/601525ad9d7dba4ed5795b1a70c683a08a900396cdc983c87b5496bcc3913e7d5873bd3ceced0cb78fd0c664d98cef5f89d30f443e512773210d2b1bbc9186 create mode 100644 .pnpm-store/v3/files/c5/9cf8bca69e757aff4b8af8dcabfe47d95fb4e07b05e9c050e889b073b2fc2494296be5ad01841fb634d1091dec0bae006b7de7a1e86e10143b710dcb84e380 create mode 100644 .pnpm-store/v3/files/c5/c41dd54f543b13159133e02b91d37606f7826dd79b7d86482dcb9e343acc5e8f839bea91707a74d49d46ceb69fc6bef3acaa67cca75397a6ff7d7803a93cc0 create mode 100644 .pnpm-store/v3/files/c5/df4941a623f3e377f5cdef1feefda75f242a0cfd4d8ea09f603bb5d9e705d6ae3c7acef1a9903052b1e351a8611018a15cf4b01c442d47abba9b056e7d8660 create mode 100644 .pnpm-store/v3/files/c5/e9fda9a0d2f72825b6ea88cf6f86035978521966c147709ba78a83a2310dd5a886225d668fcefda76e9d73a420772d6f68340371e045b5aff31ec782660121 create mode 100644 .pnpm-store/v3/files/c5/f52cec630ac34f9f550e334fc0440f1f184fd17e4755ac62197a8da600078b77bc8c62d99e3abd1b6a0f1985f9fe7bb7345184f0e19653c268edd8f0e2aaf5 create mode 100644 .pnpm-store/v3/files/c6/be11ed6751aea4add3d2cb6be682bd9850df794de710c6bdbba21ac101f3a3adecea8acd7cd45184e02bbb156e2f2fa3ac0e0a07b6660b1b0eccf9d9d02899 create mode 100644 .pnpm-store/v3/files/c6/f86be1f50b9e92a9ef7422b66db4a456ff8bdfb1e944699850c08895d2b33197d62b1707d1914dc3523bbaf7ebd43c95a167936da595b31c0ee6f5755b48d6 create mode 100644 .pnpm-store/v3/files/c7/24dd039c525c4680916ab5c5d87e0823fb86eed82cb61b348e0a211f58e2d328c3667525555eec603ac823d57e6840af8e33e8a0e4d2022b59d0998ce6069e create mode 100644 .pnpm-store/v3/files/c7/3d52bcde88836296d52b2d23292589d985021f731ac5c48b46abc9e565a153afc8f0c36fc5c4e69d14dd4f7013a648b9836a4dfe58784a3918df16137a762a create mode 100644 .pnpm-store/v3/files/c7/af86dd900b39f77f80a383e6db4fd4d0abef2f142c050adb74a25fe07dab718fb9809009c72d30e6d68526cb90ec8aacbe37fec4b9cb7cb2adf91cd39bc05f create mode 100644 .pnpm-store/v3/files/c8/40cbc2cb5fd5f731b761b4575d8304aea297f2a070ee2f34987c86756d8f5131243695ef050110787fe7fb48f41b58c3e469a16febf9795189c7ce4f55dcda create mode 100644 .pnpm-store/v3/files/c8/a8568eabb70d8aff93ec8ab40b08d5ab7c0c0bed035df272d18aa3a9c1a8ca90e4fcd1998472c84a9e851fe1bd578f30c1a2c3c874dd195f50181fdbd54924 create mode 100644 .pnpm-store/v3/files/c8/b01f56b16dd7af73dd37c3c8f55a1b223a141b3f9f59bb4c6960acb8e81ab83ea820c2db6d660b4c61a2795c92eac6484bd86aaf458b323653fed24150debb create mode 100644 .pnpm-store/v3/files/c9/966a66202e6f816ae76a855b0e116e2e1c09c2d81bd42d940b3464467e526de85ad0f2db320dbb5fdeda6793b750e2d445f7510c743031fb3bf13d94441b42 create mode 100644 .pnpm-store/v3/files/c9/a20966c5f82733da948ade369d53e2cb40e4ea3f7118c97191c1ed98e6063b347efbaf24aed649f1c971e624c528654561a3c038a905a4d0bf1eecd36bc137 create mode 100644 .pnpm-store/v3/files/c9/a5d575f5bb39a3e1ae3ba493392f82d7de9291beef84a188f182fa3d0df26b80133b98884bca111d58928d9ef46a0c1946e68ff9c7891fb54de1cb428af170 create mode 100644 .pnpm-store/v3/files/c9/b377334c6d54587f7c6c6bb5513e0557ee9be1225480c616e5725ccfa04752f1b724e2033d3f49266181bd5cdbca6ac3e68050efb4f50c4f06337c32c84a84 create mode 100644 .pnpm-store/v3/files/ca/035d34d97691c0fce3fe825250215c92ed488ff91682f962139d6237f30cbaae92e94c44f197f7029ba95b45ea4a8739dab7533ceee7270cacc217804e73d8 create mode 100644 .pnpm-store/v3/files/ca/1f93a596dffaa74ed0e67183068d6020a64e58d174bcf0ecaf21f176ae49aa5b3f72ac107b16a87e9a945c58b3c885bb29b2efec3d24c9b097897e577cec88 create mode 100644 .pnpm-store/v3/files/ca/71844be182092f7689736e5b5b8a09722f7f69c45f83501d586ff7cce69d003b7099d72950f8cf35acab0c2d1cbf33450cd83f708b7fde200e532861a83bc1 create mode 100644 .pnpm-store/v3/files/ca/71beee098d193a43bd54c912445367657e9bb0c9ecf5096eb4f827f9468f504a480e36a8b107e86a1cf2e040cc44edbe6381bde4dbec8b045ffe56882afa7c create mode 100644 .pnpm-store/v3/files/ca/bb4e390273ad858ebc99ea3e67d5e93a1c1834d19bf671d1c8ca5b93d3cb54993ba1b067cb0d746868212434a48885434ebca264da6c915f35027c4ffce177 create mode 100644 .pnpm-store/v3/files/ca/caff2f6466de0c90a26cd7cfe03c7b4675427c832e198c435b2d4f8b61de058c96ed3d1102fed5e8c5a3a7f5ed28af6cdae0204e18c60f546bf0888e6673c9 create mode 100644 .pnpm-store/v3/files/ca/d130e46bfd940d3a713a9b4a4ebfad228f7312c064d0a52e9715897da996132dd39388f4a6c5534643279e0f2f76ed4638cbae4b8c5057578d6cbc265d1181 create mode 100644 .pnpm-store/v3/files/ca/fa5ec6e380add3db9c7895695ca4319e97617ba6f3e82a3d03fd461d45d9264452c5f79b44f117d1c787b5a6b2dcb3dc84dca68f607dbfbaec70e5a8b7dc5e create mode 100644 .pnpm-store/v3/files/cb/68604a9f0baa584816c11caf646767d34b0e7512e0da07c43f53af82a447ea165dd45c87bd68d65f6c7d25746f34f0359e6c478190055ac69d8c73aea42ebf create mode 100644 .pnpm-store/v3/files/cb/cb0979ed0b29b16d7094d7804777e97b8b19b171fc17f2285283b822df8959761ade0617d2fa6bf3e1ec1fd501d5e5498c19eb4640e6fe13c8d8c4e97f2f16 create mode 100644 .pnpm-store/v3/files/cb/d698cc9aa686db66fd72e59219fdcf4e011391a8c04300a222bef5947c1aeab2ac189b7677ede27e53dceb1b23c4868b5d703bebe3d126ea8c78cdf1b6db43 create mode 100644 .pnpm-store/v3/files/cc/8b9d622c0e18b592663605f2962e0b527eec68e2c190dfe4e80a0df54fa634ee2a23995825b27c108e3aa943ed63c26d37a2ac1b8d4522827253b9f1b728eb create mode 100644 .pnpm-store/v3/files/cc/ccc360ac37dc1db2f177e596d0958fff52bf238c5809b963e859d77abedfe45e1da63c2b07c542e60febfcf803f5a08781de3d80c5e3aaf8fe63c89d11a7c0 create mode 100644 .pnpm-store/v3/files/cd/0d84352c4c8af8f09582bb375841384fb2897e791284906c87f4e6cd6935da9cd7dc385a87e60ee583e561ee95486a2126f207d1b00c644034b37284fd42d5 create mode 100644 .pnpm-store/v3/files/cd/addc1f4f794ab208d20a2b379aa5f1873b5efb711a08c11c41b20524d1e50c77f26cf5b686b61f0315ad6bac405c3eb38fb7794a4486952b0150466f7b59e2 create mode 100644 .pnpm-store/v3/files/cd/aef513923c42e6975b1255c871ab1ff60f0ee7293c4f4739b87b610596ab09fc43c3da11f5426a6e5632d2f4cddb954c6f1fb629bc47d887cd1cf9059566b0 create mode 100644 .pnpm-store/v3/files/cd/b340297a81ef2b97b4c714d1301ffc7250619d34cafbc9627e4b9e07548a5010943761d4ad39fc03b277b0a908d9b4efab3c82d9dafcae8f30e0dbe7a0a4ec create mode 100644 .pnpm-store/v3/files/cd/c58bde2ec4ae2ee3a7a02d194e94927dcf34fc0ca0cd50db9b1e6d6635a8847d6a90fcc4182622b4a0cc12d2c6924c37d0839b5f0cf432dfa71fe6038499e4 create mode 100644 .pnpm-store/v3/files/cd/d788f7d811231426732a2410cd25902631e387d9536fc188e85eb64f91e88b106b37a2bc4518dd7709873cdc539b248115235d2c29304c8bc7c4f289b8b515 create mode 100644 .pnpm-store/v3/files/ce/1d7203451d96e15763a027541d3c0c59caa9ef62d4ac5865eee98db7c5d81e3e7e9e100ee5eae0257806ab5b070f3dd57a5f6dcda8f2486c797be86956bc8a create mode 100644 .pnpm-store/v3/files/ce/3ee87f508160ceed77b75e45b297e72a0e14fd19346e43e51aab3d1d74a69c11999a9e34b527c84c6e638fe76ac0096389b92348a39f80f4606105f10ab38a create mode 100644 .pnpm-store/v3/files/ce/4293ef3c731f0d3790c6dbd21e71f171e2c5072c299daf2d4a7cb73429936d586f13ab688108e2fbf22542bb2bb7b2eb67c0b47c5d5e6e132e770a16b6a016 create mode 100644 .pnpm-store/v3/files/ce/7eee0aa606087ad514a7927516cd427b6e45e5bc7697eceb89a24ae3ce4687d5024722fe687288ac49d12ff1bfd08853f5b55c3e9e1c47d2d1cf93a8622c7e create mode 100644 .pnpm-store/v3/files/ce/f68ce19be92f771e111f356ad507fd76bcd5db5c038c91ef6d277db2c3d1480e887bc0f923312e1575eff245ff608ef1c0e2c85d61aba6b7b3e2c80e5df14f create mode 100644 .pnpm-store/v3/files/cf/03885e514245266254e7430c789b8d5c044704385cbd5b2e9df049273f9d3f341a3bcaaaa07e9e464cca6170db66305ddd826d72ddf154ba78a49daefdd00a create mode 100644 .pnpm-store/v3/files/cf/0569840da700e7abd2e2097af0b5f950420063715a08957b67d3b3293ebd2e967193aa4edca8498b5655527e7412acf4e4cb2c89e869edaf0daddbaa98605e create mode 100644 .pnpm-store/v3/files/cf/1789262006bb98210ae81c9d34ca412892783935a310be9e5e0361977f3faf34735461d2c8e6dc907585eeea0e42a6bcbfb2661880dd058628604660551e02 create mode 100644 .pnpm-store/v3/files/cf/307e42987ecb888c99b58e6b59e379fbf31fd6fb0a32b464b672b0b18185b912f1ae46e193f68b2267f8b990259f7e6423786530d0a05abc2bd42e20a0ce33 create mode 100644 .pnpm-store/v3/files/cf/57760f6513caf90d2c444d7e7685524d87cb335a92054eb9a28bbfcb1f5d1c063105eb791f749b1ad5dd5d8fbc656536fc7d7309fa488c365aeeb0cc820885 create mode 100644 .pnpm-store/v3/files/cf/5e6cc9f849e62ce226328e4672635f3aa6185a273a96760bf44c36efe5c4de38cefbc4da5353038577901c1a0bee3fdc5eae78e6e348294e6f1ea249d96384 create mode 100644 .pnpm-store/v3/files/cf/7a7661163058ed3fd88b8fcf65d71cd6591f0f6f406910232fde3eff35f74c403f556b131bbf7940aa235d61a79593bba7d63b14dc9ef36e1fd1eec1ef04e4 create mode 100644 .pnpm-store/v3/files/cf/a0d0bf3b7f81d2ed97a3d79d96a470a93b55cced5313caad0124e0faad227505fee185583c2d9d03a1c70c53d541a4c6a8fff94577180ba50f31fe330d8513 create mode 100644 .pnpm-store/v3/files/cf/c9205d758bedbc48a5f867de0ef0414bc745f0e9875419d236523c14c1d269cc3559b6e43374539cf1803298d6a3b815e16d1ff7704536858be344f26aea46 create mode 100644 .pnpm-store/v3/files/cf/e815fafe186a78b85cc8fbb71f4e5d93131a1b2a376b7bf6fbb771e9ef76465a6cb78d30e3160677752a30dff96dc8aede235bc456dc008a215238540d9ac9 create mode 100644 .pnpm-store/v3/files/cf/efb203225682f73ceef654b284cb6a09ac280e46607d96259926dc868c3168fbef75264d84205946f2e82d255d592ed12fd10bd9d79a290179e2178896a5bf create mode 100644 .pnpm-store/v3/files/d0/cb5981fc7faefec93151434e2f91604a94c9ccc6ed3d29bf68d614c61a0c39eeafdb1fa46ff2345169fcd307aea43c870d921af33f2f3debfe1d64b8e42ccf create mode 100644 .pnpm-store/v3/files/d0/f648a27953f0965a51eebdebdbc9b9ea8eba8b2acac0adf29ab349b0b19f96c119032654e740cf5063ff7cc95adf1b0e4a6f2ee4fa36c39f098d96d4ecdc2e create mode 100644 .pnpm-store/v3/files/d1/0b60da1cd631a2200c700a12c78ce237bd37be2d1cdf332f94168bc5db28e468c934d1fd4a19f3d6f22c043643887871975f35d7341561607003c95fe6dc20 create mode 100644 .pnpm-store/v3/files/d1/5a20bf2851cf876a882afec2b88c53c6d654350186209fa332fd698645e306127291cce3e0016cb5548325ee745a69f1c030bd50c8907661c5f09538be32c1 create mode 100644 .pnpm-store/v3/files/d1/68cf2bff797824069eae892ddfcfa71b45dc3f91b3c3c0aa8f5e0030b4ed43bbd402040c600640b85dadc91a30ba956f2f175e79a2cf68842cd3d49a4de4cf create mode 100644 .pnpm-store/v3/files/d1/977d29b384392c1443409e02b27fdee1d7eb041913f0e619b30f42436d0ef96685c07f398ff4427f74c8399552265dafba4ea128c65b80ddc36d920b279994 create mode 100644 .pnpm-store/v3/files/d1/e47cd2538c3d765b8a468f3cf5e18d94b1ac6f69766e94057475f126eb824b0be457d7c3bfbc889f47b824f7f05d44dcc632bed8424c904f89848054b740f9 create mode 100644 .pnpm-store/v3/files/d1/ea87a7f99c550830245c63d83e34f1ead0b903cfbe9093063e2dbad1d1df1cfd7241eba37b130c84a049d4cac855bf0cfd2d2f6107412020a39870946a42b2 create mode 100644 .pnpm-store/v3/files/d2/0e0fea32e045136786c731c3b9d0f511c6aca27550f3e21cf7adf984f74d751c9b2e264e2620a3dfa41907f96e3cabcec10b275d1c4fa433db2ea0f5396ce2-index.json create mode 100644 .pnpm-store/v3/files/d2/1313929289773401041ee33c3ef9a611fccc0130a9a17335d671c950d67508cdac89d090ff577476d2813b971e5235b67ca4d9c660009f1d4c5e7015f7fbd3 create mode 100644 .pnpm-store/v3/files/d2/2bea17af8af9458df306b3fc35ebbf656d24467a1b2fb48bba1141989c80f8fc455f620b65a90d63fab48c0d20a9c25243b83cb9a413fbae414170c3c08199 create mode 100644 .pnpm-store/v3/files/d2/773dceabee2b142a006b7846d99251b87b52251ac111ded717c65769eae2f9a153b117555de1290a69eb99577d17fed7ce7386a229cd71ddb03ce29ea39e38 create mode 100644 .pnpm-store/v3/files/d2/7b384896262a21ee272fe9f1cf26e4817465cf215a656e6d135e32bdd3dce71a6b9b4eef1a0a583d68e8642442366dda033bbb0ca3dfee9904c33dce758bfc create mode 100644 .pnpm-store/v3/files/d2/81b7663540edc3c02b1538c14bd619e4348d6e83b9e232bb448e9d15d7cbbc6beb2e105d5eea8a40b8bb121a0a469c65c7a086439f89b22eb7f9d531cad15d create mode 100644 .pnpm-store/v3/files/d2/9cc2ff14e1e1259a6722d9f6cb7b9990935d192e065ad814f57d5912c7f79386648303aaecdce05f1def374245286f8b4f5ead33320e0e72f1f2c150163c0d create mode 100644 .pnpm-store/v3/files/d2/aea9dc995f0310d3a4c6b8310adf319bad2e5b599197ce829eded0bb6aab8cc767f5699be6349f81062b04e88e51b7a220677c4c85f18541751f43d8e509c2 create mode 100644 .pnpm-store/v3/files/d2/bb4586c928a86dbab3e858a4f2199625fe14090fe35151ff878d9e4005ff645766ac4f2eff94b4e1ee36563d9c63f5957c884c22ce03d896956f76c74ba7f3 create mode 100644 .pnpm-store/v3/files/d2/da611c708f0e66c11028af691456a7a627c9df65d5cc9f5a68c99c85005f1a89c4d0e270547e21f2617ee376534e69c615f39ee9600e745a8abf7206ce031a create mode 100644 .pnpm-store/v3/files/d3/08a91b496c9fbd2db7d8b907d660142172342e990755093d892cf2b8382504119593bb83882f37db71e925803c37b9b098edc748f09eb6dc3f84b8dcc28f9b create mode 100644 .pnpm-store/v3/files/d3/0b6a34e8d5890d63c3ed27d7e178b316fb5af1b7c7d7d8a9cd7fed4741ed2f72deb4865d3889fc23856cd5ffde426ecb4355d07fa87ab6ad0f77c8e3e7186f create mode 100644 .pnpm-store/v3/files/d3/4190e204bade050d096d53d29242c3e3584270b2730b0d1f729cd76aaf179ea90e5846f6788f5df208b202b565d33b1c2df184ef040a77aba99c4b4da7f7bb create mode 100644 .pnpm-store/v3/files/d3/c5a1a03a787a7179ecc850018deb5b3a2dab49cec940dd00ac3404f8559090849c9d660d8d6dc91bc482d0952fbd166296fe10f58b7205747b565970f54479 create mode 100644 .pnpm-store/v3/files/d3/e066e7d09561b714aba85567ee5b5e62f2334858b8e58945b07cdea801510c020bf60a519d951cfe09f1444e361d792efd2a304178a12545fadff261815a51 create mode 100644 .pnpm-store/v3/files/d3/f444bad85a6a19a55556028ad5593b0cbce23a8b9aeb961723fcc2677ae63aef593c3ff3b011c58b1b995d4c0371426227836dea274bfc8aaf357f6c2796bc create mode 100644 .pnpm-store/v3/files/d3/fa744262cc57d288d618ace2f335829cfeb6110809db08d48747ef04b3773b7f574a68ba31df1b1678c4023415d4f5ffd7764a490748bd6503ea78e718c571 create mode 100644 .pnpm-store/v3/files/d4/21a0e841571ff25ab793c1e1af7a4a2814312e75d27cbb0f5930e24f9d595fbc8f4a279fec14c5896334e969093663de1216b9e8e7bd50fff6094ede1309c8 create mode 100644 .pnpm-store/v3/files/d4/5417c939b5794eb072d27a90e880de53615425c86135ae381a21e92dad78f87f0d99155d3322d8ef4ff7e632f9388d3c1910851670a2742bdd8b30f3c62b7d create mode 100644 .pnpm-store/v3/files/d4/57fc3f74b54349b1f68c7949f7f3e0d27edafeaeebcaa8d8f001e5d421087adcd3610ff22ef2697ef9a5ef7999040acce71e0bc12ca7af613894d277ed6bc2 create mode 100644 .pnpm-store/v3/files/d4/cfc64f217fc5dff20353599c228bb324d32502d827014fe7cceaceb49e57a5e51df6a14b104265ea74de4ac3fc99625f2bcd00ae187a5ff37e775ecd0c450f create mode 100644 .pnpm-store/v3/files/d4/df42fadca4ca234a3ccd1f9d5e4ae080362a003363809f55b6ab9cbe77dc8c529d4dc22cbf0cf5acc37d62b690abf2b3bae4bf0f4bfa39cbb242914a4f2067 create mode 100644 .pnpm-store/v3/files/d4/f854e05f2d69c557810d4baab8ea3732d91e239c2c92dd14ac55b9efc4df95e938be08abd1497a18b7df6f20d88a8fdfffca21acb6ae41ca4824bdf95c96e4 create mode 100644 .pnpm-store/v3/files/d5/1f41f444830441749c877d4eb57ee97a8a0b17709e4b2ef4770191e64e0b30946aee5745e612df4a1198f93a679e65f2ffca6308d449953eec96e314a895c7 create mode 100644 .pnpm-store/v3/files/d5/92e7e9164c239dca8487ec040a7ea7d308939fa050bf7bbf21f1e8c4bab41c179516a03bcaa83b98095444189b6620617d2f0bcbc9001c0268c0cc3b935f71 create mode 100644 .pnpm-store/v3/files/d5/ab38ac34e055624ede7d6e1e6518aaaee7b05808350f6efa645c5e98de38c2549af8aa34a8dc641ed47d166b94cecc8d85cc2a9b96a79a069236852e78dac2-index.json create mode 100644 .pnpm-store/v3/files/d5/b01c2dac7be237f7a9a57645921d566b512b9495f53052c3c11638423d97fd165136a8949cdf48376ee671d8e41ca686029c8117b0b9a51d5d192aac24b262 create mode 100644 .pnpm-store/v3/files/d5/c57973ce453719e17b20e8d4bc3d4170aa720a4ff5f0b1ad15c106e736b57d4bf9412ad1465913b0e66973dbe396775be3237d694b3eaf27002fa0a68243e5 create mode 100644 .pnpm-store/v3/files/d5/d15f964105764c96466b62a83b733e62e39e107dcdfb62ee6b76ed343a3d8947e543c13b0ae476f0c45792dc4c7b8b2d83358e8c275eb431b1e2591347fab2 create mode 100644 .pnpm-store/v3/files/d5/d1871550516a2e908ea113f729600d9128ee8c9a4966531fb039d263c914d7dc70e2138122c419b085abf52f7b0dc0c8a173c1dc3e0490da4352f94d259c2b create mode 100644 .pnpm-store/v3/files/d5/d870ae54123f4882e67c98d9ff1f99e4c7d882e1949b88a022b11fe137f9e730fe0d1a5ba0f198b27b45cdd13e9a907a16a87c5ba087dc1de722e1f7e68012 create mode 100644 .pnpm-store/v3/files/d5/f47a9eecfcac5fa690d42c00cde50554e39796ad5f128e3c6253e2225e1d3298a5249a4626814322ca568605986bc5519ef15c2410843a749163e404cff4e2 create mode 100644 .pnpm-store/v3/files/d6/a0ca27efb854cf135527d10b833a6114a9f1cbcb12131269fbbfc4babe58ff4d94ff08697936ecb9fe7c950c22a8ce148ba6996bf8f93cf735d98f84c3f81f create mode 100644 .pnpm-store/v3/files/d6/c02a080aa06c2fac388b7664748b6dc1ba797913bae1c261debad3e0d3670eca5c2d101800ccec8f0b6a6ad1ae8b8a1537d826189dae05215f90fcd2d29425 create mode 100644 .pnpm-store/v3/files/d6/e350e81e813454e9403d44815b4cd0c61511adcca10f98262de481968f40454b48afa41225c502652e66e61b506996615c52ccf7471ef63dcf54788b63a426 create mode 100644 .pnpm-store/v3/files/d7/026775ee055ec18b65104c7c4151e82c495dec2ac1dae6289fb01129d21df95312b74839926f6fcc11611f61a0c563571f3444976ca6160c238923f7253053 create mode 100644 .pnpm-store/v3/files/d7/1bddab4084d9a070e92783d5971df903f13127a5bcf843ba48e7ad68ca6305486d51c9f9d34737709c6c06a337c9dedc7c4eb22ea38b6f2263e4fa5d2191c2 create mode 100644 .pnpm-store/v3/files/d7/462b6ee620aeaddba71a61a60531c507b5b5fb69e23f12cea44b101eb4e3e68e1b8c20680bc0f21dfb5df6b16126791eac414ca385d62a0c253c95747359c2 create mode 100644 .pnpm-store/v3/files/d7/711cac52e3c8445e6fefadf9f2cd17243855ce0e944257bcd885b6d5e778678eca4dc3863820c5dc0c382056b13fa3ca6d7dc69b2ede73c917c92b84d9f2b0 create mode 100644 .pnpm-store/v3/files/d7/871f5289ae7e9f80c78650472faee4c1cf86897ad87d18283b7a3b3c0f3c3a66c38f01bf192077b9db1d7bb24006451821c44a36d99d04cafab72c83503b11 create mode 100644 .pnpm-store/v3/files/d7/a31945910796085a9bc3408020918cec3a3d34078810724039f76310ff4e2dcc24b4ea9a483d537b0045688f51662279e47fd9db4a220da3d3b0780450c7c1 create mode 100644 .pnpm-store/v3/files/d7/a489218a5df470dce8bb298f006b926bdab5ee896458009e9ee962492cd0c3846f995dfb26341cbc487688785e3cd87e04d78e2af9e08604db1aa8e251f97d create mode 100644 .pnpm-store/v3/files/d7/fb61e0c1e39f09dcc17b085ba40cce5bd82fd906e5efc2a55bcb4597b85cf6bc4ce50d6c210baa6be10e69e436c023c1a1b8f88f202492f4241bd34cb3bda8-index.json create mode 100644 .pnpm-store/v3/files/d8/1ccec857e376788d117180c4a987a7bae98fb317c2392b37a1f740494390ac9bc2071daf563a67f0c1dfe4acb02f046ce3c5dea138ead8ac3d9061a6d87126 create mode 100644 .pnpm-store/v3/files/d8/65fd30cb314cf7e4239c94b52b3970094ff672339b3142eecf42e027b60f6363c19d864d5bfd66e9fe09153405121db9edacc2ef2bfead3bb8e81c879a372b create mode 100644 .pnpm-store/v3/files/d8/7f1eac61d5a99a782fa8c410c3bdf244874c50f78b19914c1565e0572e856d2b511dd02b61a6455ea71af451f94087b4d2767dcab695dd5ecb13a1b7956396 create mode 100644 .pnpm-store/v3/files/d9/3a6975fb90a8511edb3bd227f9e6a0ee0616721245b88041976ceb02a077ca866a2ca2d7ad07967f93c6be66ae0841ddf023687bda005490bc8e6af88fc1ad create mode 100644 .pnpm-store/v3/files/d9/71f51de5b3758868343b6a17f61798b7f0d4a8698937176b662bba0fbc44d9e814b0562a8d3890fbde18078f7862081e3af10de8738984b63eace2419c7fab create mode 100644 .pnpm-store/v3/files/d9/a8530a632bdc0111cc54e72af94c8073f5a81c28b3ecdcb568715affd9b09140f2afd3982c83ebdbc49de1bffd65132b03a32a3f100e1b248e0ef9d7cf7bbd create mode 100644 .pnpm-store/v3/files/d9/db7e8fcbfcf3c277b3756e4d311c2107ab5171e2513a1b3b36bb541b529b3b2ce06e992d7b932b99b32a8878c660e13c8f4ca278ce61932431f577fc8cc28f create mode 100644 .pnpm-store/v3/files/d9/e1be91c9439d07fd83285e961b5852e7436049ea7492766e492a307b0045cb0809950a2a4c6ec7da6bb6a5197bc8c51fbdfd60a31c862753d25720305ab54a create mode 100644 .pnpm-store/v3/files/d9/fafe207f6f4ea7627b2554943251f901ec2e28b7898fdd09e4c09f5855c4453d0ab4ee00e7855b99bbdac53a63ce5dda98208e8b724eb118f6ef30c75eb3b7 create mode 100644 .pnpm-store/v3/files/da/0cd674de86af1d1288dfafa1c17017df472753381d0ace3b9e6f10cfab054f0e1825b9bfec65151048a877cb769f70a223a120e9dc4ffffb9a1faf1d90211d create mode 100644 .pnpm-store/v3/files/da/435d80460488b79e7abdf091a80d0550cf6b7663ee604378cec3de26260570342c2c1ddad40bdde012cdc0d6f46bda735838efc52da6d2b8ebc1b1cd400470-index.json create mode 100644 .pnpm-store/v3/files/da/509d1acfe91217ccd58a2a397a520a116aff334156bd95ffc7365709598a6ab2d8f681c970a57b5f9c636be4b1429776342e2dc26ff565273e5268fd63521d create mode 100644 .pnpm-store/v3/files/da/c39eabd447e64d40fc7c4d34fc293e029b71d560eb0a79b46990cb0f6ef4d77c2b36826e95e7b29cff236d3eaf39b1858b80f23fc02632696020ade7db70db create mode 100644 .pnpm-store/v3/files/da/ebba6d1ecc2ff9ba8adb6a3409ba129b1bc15342b5be809aef75128da3c831ed79fd77603c8feb2af8e0f36f7f7151089e6f2c82eda1b5cf3e6acbfe5652cf create mode 100644 .pnpm-store/v3/files/db/24407d36d867df6410b7373d97664f3066c59b252e182596ee28bbec27e6a27d1d27b2bf8b1b780ad94c1e1f43b889f199acd96bb800b2fa7297bf1866fd6a create mode 100644 .pnpm-store/v3/files/db/6be5e3602187f5f2eb01a60c6a93655039981b503697001142396227b35b47e78d1dd2d480be68c51104e6edf48084b30116b0f3e951963124577ced042109 create mode 100644 .pnpm-store/v3/files/db/8ac98c2c5c990f31c48816ca060b4485681618706b1767b59f101f26d6df21113b6674bdbd50646d5e7c2fb26277adea41eb85d1208412442f628564e41e4e create mode 100644 .pnpm-store/v3/files/db/c477ee0ab614676766ab1442ac4faa8628383f9bff744e6becd38b3e11364a996342bd9f21c7889a17f6f1a7f248478e1f0911ea782a34beed44e4e96b5668 create mode 100644 .pnpm-store/v3/files/db/f090e8e5df343e6cfd1402b6387e6566115944554ae19e43176f6d81f27d88e7209ffdaa95f0a9158a9901d1832c16e7fe468f8f39957f86ee7e8df8b5db1a create mode 100644 .pnpm-store/v3/files/dc/291a9457cffc5f6eb39694fd91c72877502829bef01b07dad5df47a11751b2910e1807d52842fad38d8b8309eb6d8207c042ce705a211866717695b6d6d1be create mode 100644 .pnpm-store/v3/files/dc/4cc46d4720947e75b0ce9f1abeb3380e9c9fc9e2c156fa992b040a676e824a0f7d4afac627b0c6d593c33ff70e1b2b5361e4355791f3d67d321aa397ea0434 create mode 100644 .pnpm-store/v3/files/dc/806829ca64167dcc22121db0a5e55b7a3b5517daf81cb661249789e5fdfde6a88ab4723097ced7d2b8cdb4a4177b8d8ddf665e86a657fb87b47aaeceb31f66 create mode 100644 .pnpm-store/v3/files/dc/854a4750783bf8c2845e7a1eba05345d730504a293c42a0a6d25f85571fc67f08cb44909947f3d6036181b59283f76e0f7f15da644de969a3fbe407ea89921 create mode 100644 .pnpm-store/v3/files/dc/c04483428abbe4012c6b9b0e79270e85410811c1f5cb86dd7d3a6700bee841398b2566931d7a291be0e33066104fb6122d3defa112bae14273b590f46d6d9e create mode 100644 .pnpm-store/v3/files/dc/c239c6028484d203a0650357492f5184d0cdd19f5670913f14eeb4b0a8758e4071eb71ad1e1f1fc1534b199d2a16ea4d2d7b810ff25131d28af897d0d130eb create mode 100644 .pnpm-store/v3/files/dc/c263995b784f6e394fb2c97171c097ab82eb063eaf5fbc5c8ac1de41c073aae740c13e64bc606574e49ccb3525c2d7f1c51e2a5cd79f30f3ebec642cfcc6df create mode 100644 .pnpm-store/v3/files/dc/d2507295419b97834ae8108b540937ee435e445846dadaa0d973965875b6c25b8d707ef9601c806d36230e4ab35ef67c81a70f0b0a03ff59d269ac2b8de1ce create mode 100644 .pnpm-store/v3/files/dc/df8861b30745fb803a3751a8a0e068b35ca0f9dd81cad87e1d64b076a52ff1322e8df5c4a2f2d6b8d33a39be4be94edd479feaa2f722be9d144438d86125de create mode 100644 .pnpm-store/v3/files/dd/477e03655829674dbd51288545c00986953d0756637927b798fc6fb308e306a851ce72d74689e05c42a51a1d6c2c8cae0787c713d2b4d6db27adf531d23e44 create mode 100644 .pnpm-store/v3/files/dd/4d59c4a7866d991e077419a111ae6de01d3bed4233fe25f083a74f4d075a986479c8de9f80b794de5f2567a5986f60af35b41de4d5f8756041bacce2e2389a create mode 100644 .pnpm-store/v3/files/dd/ac709f746d50ac539d77d8609f7abb990862c6739290ee88389fc560bdce48604ee3ccd170894b0cdc3cc5687afa1639eb3afe5a0838a20624cfd85bec0b94 create mode 100644 .pnpm-store/v3/files/de/1d2fcfd8925a5c297ea43032a822137a38b5082776ef724cb225cd9a73099ba35088f74d39354845b5614d9b383cf53f8ee789a6cb33c023c0250a81a52d71 create mode 100644 .pnpm-store/v3/files/de/3a5c74f003ecbc07514893da96538f653cd88d93720836a153ef2b1867ea60c8d8e9fab5fbcf4138c0238eb6f065060d9ac29b86676bd8901e6e5c11ec4e02-index.json create mode 100644 .pnpm-store/v3/files/de/8447f1684fa4fe993ffedec05a96ceba3ed5998f5ed9c1a23719b561d87a26fa9d28aab1c845bba7110fbfe2479b22171baaa2b0e46c441eee17deab8cadd4 create mode 100644 .pnpm-store/v3/files/de/847c6a89521c531f02ce22aff6ba7bb63dcd55bf3d576bfb21bb80c1f9c621a9e7dffabb752fa0d7f4738ac5204648cc1631f868c2a64b0bd0415977924999 create mode 100644 .pnpm-store/v3/files/de/baeea7ec481e1e6072eb8a02c37fd56c165397dc258b3757b2aa577d30682bfb2108df05f181feea96ec2f09c2677f30be1a4c8f63f656013e1c598b75b476 create mode 100644 .pnpm-store/v3/files/de/cac6728b38c728e79edfdc8d12abe22102d0738d837c650d035228b9df80c1e6f05aa6259596884761dc3accdc32ff6ad49ef42e18534fb52047f114ec924d create mode 100644 .pnpm-store/v3/files/de/d45626f3919dca8afab051adf04bc33b61b9e0cb045759f91566ab2e877635b8e9c30b5783074ad29141cd927fa1bf1859d2b11f6c83c8dcb0f8e83b61bcd3 create mode 100644 .pnpm-store/v3/files/de/d805995e03804941066d555f7f368c5917e2b7a29dfcdc010ad75a1e27e7262d44b36ad58613d3e7e3bd3468f34d96019ed75bed2784e92a003dc0879d74ab create mode 100644 .pnpm-store/v3/files/de/f17888764f74e654856d1a270e8b63a3578bf3507c1aa5db6f6c0223219bb2d9658b82f2c57938b636c2a64e3974fd23ab6f35991295fda0fb54314c618d34 create mode 100644 .pnpm-store/v3/files/df/0711db43ae536735dea518b14ce85129375c68dbcb30d01116876b20ab9cbbc01ab3a18a7a989edb8173299563a23332f51446cbe89306f64f62a899db0998 create mode 100644 .pnpm-store/v3/files/df/0995033785f141735f85fab192d81d8d8f218d13c90f8c5a5251efc0d997fbfbc212bbc6507094b4b5737c533522d40c2c68436a6f5859688c1dbde13f2957 create mode 100644 .pnpm-store/v3/files/df/1ebd366baed9f046daae3afaf2eb139def9378134d8909a2d5a6afeb253304c8e9dafe662ad817f15b0879e131bb78560d2611b6b1394b6fdba5f0a3c22e0c create mode 100644 .pnpm-store/v3/files/df/7f5ccf3225ee453e89b1cdb00f48789f555c16a9ba42f3dba85e0cb2b08518fcc28edd2682faca05180d436c88966a1052ca377fdbd64b3b2a97bc1c9df92d create mode 100644 .pnpm-store/v3/files/df/84d333ffa638472a9f0e20b0bc071fb07dc38d4b2e1e6b791de6cd5a3262dfca90a18bbae16c365c496fb7e6fbd4b4ff5edbf580b7f6cd7f5aa51bfc8ccf95 create mode 100644 .pnpm-store/v3/files/df/bb6537ecbffbb9f7c0a18827c0619c82e4e9ae16527874140963d14cae38bfce4c91cc66527c09d3a1597efc5fc00c8e3f2c971ef5e6db73268c398b8a2e08 create mode 100644 .pnpm-store/v3/files/df/e9253ae21ee3bbb4b172a95c9d8498085c4ce903d0c9a7d0b771ebbde37ceadaada3d3d69628794ae957a605665077a327a2373ca6e6326d1a01780390d692 create mode 100644 .pnpm-store/v3/files/e0/1eede7fa26a7a960fe0d894c2224f42a2a6bd520112c553b2abdf47fcb0872960ab7405b8706a57bfa98db7ad63325dd954ecc879f6a5d4475011909abb9ec create mode 100644 .pnpm-store/v3/files/e0/4e6be831a58197376099a799c5813e48c571d2a460c02fe0a7699a3fcfe55bf1dc2ebc77c4342f8c3488340aefa360f1d4271cb9fc0ac18bb30b33022dfbd4 create mode 100644 .pnpm-store/v3/files/e0/5c81128a0b04b53ee0dd61513f96b8e8d3035acb1f73d56b56dd3d8f41f4a2a63dfe52e8da6eed603b788b880dd0bd676999dd74612bbbabe696a9907cb0d0 create mode 100644 .pnpm-store/v3/files/e0/7c51623a02f1a10f0ed71b3e166ddcdea9655e586277c317354665466b19ec296de499217ec44f258653fdc6e03b19d1ead897d8044f044c574d7e32eba2fd create mode 100644 .pnpm-store/v3/files/e0/8576812d8d1653052c9c32a7baf57929c9f066438adcb903b3af9f4205a1d1520c6f0f51d57ee04a9c181185432a0b4c28c56feab5b9b8d1a1f100453bee63 create mode 100644 .pnpm-store/v3/files/e0/9acc43c332d4b2a1728db53073617942e8382694a22214f8905b0e0e110cbec2f741dcfb6a58a5c839c5b8a025fc6c77475b30f607733b925cde392da40a7c create mode 100644 .pnpm-store/v3/files/e0/be09835c4ec8f6ebbfe62daaad0b5a5b777990be676032fad8d8787b94a7fac2c1cb15c9cd46c1e640a6a2052e9fd9d60a816d2ebde7c1411fbe96b726ae71 create mode 100644 .pnpm-store/v3/files/e0/c6b18da668d6b7f9b87bc319ada66e75f1018558a23d7ea113692f87c4dc5a04c52d4a6b60a2346427fd2e1b1cc179d6f9973125ad3b3bab2693c3e0168951-index.json create mode 100644 .pnpm-store/v3/files/e0/d3f1a4f1dc9c3526a98bc1884f87483af104ce8eb64e14d4a8157b7e31e62af48b3014cc3d75907d25b37af1f31c128b3e8fc36755d2ad64739f733987815e create mode 100644 .pnpm-store/v3/files/e0/f3adff0b22504f73dd621394d023744849c4943de62db052da4b8a34adb12faf6d49fcc2c603b77ec532c8e33d566d760f9b2955ec2142a6676f955e6b1c51 create mode 100644 .pnpm-store/v3/files/e1/5f55f1341fc63af559fc2ab0b7ae4f9168703c1600eda95077746aa5a27a0dbef60b231c564989eaed09586e4c26bf500444f4f4becfca918a36de7013fad6 create mode 100644 .pnpm-store/v3/files/e1/6ce68c4cfd494f056cbaeb2d344eea212055fc36249c4148753b2e8cc7861a4c89de98a1b73328a898c64c49ddd00000c885ca0343b294f8f953a7ba6f69e9 create mode 100644 .pnpm-store/v3/files/e1/74fda6c36717de898e44e73ae9de54df28cb81dbd686d6437ece5272b62a36a6fe101b52f367ab7356f90045def91ec4cf7cef4b63bc0e98e96956717f815f create mode 100644 .pnpm-store/v3/files/e1/a27e3fd933e07bfea13e36dc46b63209c1407efb0e5a10441f3be47fa24b95098dcb20ffafd91ad1a35a122cab42ddc7d807edac60dcaad9591928dd6b701e create mode 100644 .pnpm-store/v3/files/e1/cfbb2067740285392d480ce23ed1f04333edb597228a9a2fb6b1bd9c0b9ca79deff93122898b030c23bb25c07dcc86ab445e21659cb981a26c687adecaf9e2 create mode 100644 .pnpm-store/v3/files/e1/d7d72604b6b03857878c71dac4bb709aa04d1471bca134bd4d962dc742e9b2d486a6c24f971837d9e7321ef9edf15cad4dd56354e90fe485384f76490e0928 create mode 100644 .pnpm-store/v3/files/e1/e3a7466f909543459bf8c207679344e48a6a45ea24503030a47230362af3415066319fd32dd9e858b5551b7d03d9791a588a20b772e1591aa66ae0dfaaccb6 create mode 100644 .pnpm-store/v3/files/e1/e6207de961f0d380ad2cbf9b85e344b18a170f1fe605b4d652fce3500e369b623854b4fddcca90c6d29b3f0330465fea1f0751f186bf73d0bae6b917bc7b18 create mode 100644 .pnpm-store/v3/files/e2/b5de7cf5d887029b3e2d85bf7b309295b8c74adb1f5270d9ce0e8306390d7f394b12e704e93fe2dd1a462a5190a8d315b982454a40980f49f92936875cdd5c create mode 100644 .pnpm-store/v3/files/e2/c21f9c567f898fa6f41bb1e2a11d238029c9a2eb18809c3d723472d49b3e26694bad6c479d7146fd82f75cfb890a7f33d68382137f0727fb5edb88a2472bf1 create mode 100644 .pnpm-store/v3/files/e2/f61a79d29a323b1965d8dccdc91cfa3855b47f1007e0777e078a996545991699ded3cb16606077252ef47a3d723cca39205f78f419d86a6c8debbf94c3c7fc create mode 100644 .pnpm-store/v3/files/e2/f67a1dca281557113de4ebc2fbfc08bec4896bc2af795f4f87d13d332fdc51dc79e738a09f8b78ebcb93f2d62d8b5d31759aceafbceaed80782d029522772e create mode 100644 .pnpm-store/v3/files/e3/3b9f72bbef1c38cfc41c151f024bfe9c02bb7de0659363b3abb6d79b30bf2756d36dfcb6f01b4d2b37f7b79375cae2109ae9617cc31cfb3afb9a8bc43a361b create mode 100644 .pnpm-store/v3/files/e3/552117446f9e155ccbbe3515a937be63919bca7170559d1adc2a67577a6f07a773a9f535a7a55b36accb84a6cd338a031b55e0fd845054ef192f734b1f35f6 create mode 100644 .pnpm-store/v3/files/e3/db4a63d5ed5030e83c9c398f76e1e3e4191ecc99f6de346c84aa0d41468a31d3f778819c737a3aec8651073ae477eee8c47f6c346e7baaa407d646bf2301bd create mode 100644 .pnpm-store/v3/files/e4/7a6ee320aa39c4c269e7dfc4d286c97eb16612a348797ac6b0e68a4c82bd684a70df643884100e278e62477100d83fd1d27188fc57ccaad101a359b9c5243d create mode 100644 .pnpm-store/v3/files/e4/7e23ce9359d882e4ce67f4ecc2421edc00a56fcf274cd0e8ca7b7ca210fc8edf0a943bfae550f908a3d9c3299d5f41eda84092e4b6215d46af1e46d72cd056 create mode 100644 .pnpm-store/v3/files/e4/a44afe471d766468d5212082650d910aeefdfc30f0462336f1b88d241f7df7de3888d6439cfee350dca0363ca700da60f7f7d27d81c80ad1ea425dab8525db create mode 100644 .pnpm-store/v3/files/e4/bd8845fbe9f1062068541f7818796f626694ce4a15392b6292732df070fdddb2ff6b92ff0b07b335616c25aa22f4c232618013cc75683c31cf2c5603dc9eef create mode 100644 .pnpm-store/v3/files/e4/e02375c3e20c3d1595e2ed864e40360e9d1192aa96466fdc44afca401636e36176dc35449179a52406d24d1dd5f17d4768844831ccf586c36ea074be3c76ef create mode 100644 .pnpm-store/v3/files/e4/f107ee75df3d6088d574b43a5bc65f20f2035fb81fb2739025da22614f7d71c5d8316b3afba8444e0c149247f32caa3b43faced540c3dae00039d2e64b4f5e create mode 100644 .pnpm-store/v3/files/e5/140bed9428c96aeb88d014c2e3206e26cfec922cd364662d0b974e57dbfcabf8b4c605d219942aa0936ac86aa172f45cc2fd6b67e03c83e3fb15bd48ab2198 create mode 100644 .pnpm-store/v3/files/e5/fc174e121b303cb1d8a1ead969b8a47628cc1569b91267788a6c7c0b21d5795fe3720797c13cc2b0afe380b6561df4deb3d1da9e2481995a5292171d0c7a40 create mode 100644 .pnpm-store/v3/files/e6/40cbbc261b33c8553cfd7ad827e791d1c27ec224a86d87a6b7200a71bdb98eaeec8ac5851492de0a8f6b97b55be1a4c0e468b6632a476b1d439d9ff65a7d8e create mode 100644 .pnpm-store/v3/files/e6/6cc5f83a9c28325da8a7b1445328f473e0e8bb86d49e8e8c9c20648303bfbf8488f45a3a63a87ca9617ce99aa44038a97d07ad3191db43f49d7f46134da786 create mode 100644 .pnpm-store/v3/files/e6/ad35ef934e8dd76aa6fbf353e9038923809383df74ee85bf0096a10e913bbad3cc47bcbe5a3ee0755f7270111210f89e932cd1ef6e672a634f0cd93c27ff73-index.json create mode 100644 .pnpm-store/v3/files/e6/b8878a2f63cd9d0b00a332416b2fe1f941582d145d290b682bb1767f23ce7c38923b51c5dacea72c098f8bb91b841d8cd4b9a49d928a6cf0736b22f383c376 create mode 100644 .pnpm-store/v3/files/e6/c58a00464ce622f00ad410715cfb5e2184aac1846cb38ba9adb8a5b90909376b71b0596737236e6709507a63ab6d1bb5930c0f4d095f9ec28072b06c2727a1 create mode 100644 .pnpm-store/v3/files/e6/d52cd31eb9761613d4f1edc8ed1794c8613c669802ae115562ef0f8dcf6dbd98245ec9b18039a6153f43002e585f9436b13fafaec344028a196f40d085ba7a create mode 100644 .pnpm-store/v3/files/e7/84648cb9a5a8c5250bca3c9c3095cc1db90f5cf32b87ad87eff7b90cedef7f6a53453dd8dc6e64a636d400e3f51a7f99584a055e452ae5cf8e661ceb24d045-index.json create mode 100644 .pnpm-store/v3/files/e7/924d2ae216fafab829ed418ce4e333661cb5022f093ec61731f099f64f1a8e709eb82489dd1842d9c095e152aae9999b86b3de7d814be7ab6f2e62a49760ae-index.json create mode 100644 .pnpm-store/v3/files/e7/f47eb96db3b7533522163a656ddfc5c7f6e15017e7216795f15ba32a1c051b6d4a42f02897bb75ea75150919b7b1e1f667daaa935e4d12f374e311ec61d625 create mode 100644 .pnpm-store/v3/files/e7/f733191e232a18bec9a5ae1e8c80b9d8826c588cec2d7917a1f79c4f9b6ab69d6e305fb25e1fea21e35ca0bcd326ee7999b0d2a9c7cd009220a4fc597c7964 create mode 100644 .pnpm-store/v3/files/e8/046912e916564e18827db5a08e970a1a2f89278c1e20f6e5e7ef042bd32fd90717201a086c0622f0ee8e999043c0a02a28104ea2bd90eec53ddbafa99e45c3 create mode 100644 .pnpm-store/v3/files/e8/651dab34593afff9f32edf8887909f6e44de17fc681497a30dd99829bc3abd26d2381ab8393039dc027eaa2f50f2eba3f790ebf0d206923095cdf3da2d845e create mode 100644 .pnpm-store/v3/files/e8/927f9d2c5e2e1cc3ec4422aea0978e98602b6d3a9d6053f1c83d7305326847fdab863ce8a9aa0c7482772a8eafd5b8b0301464c93d6c351e2568916e16f41a create mode 100644 .pnpm-store/v3/files/e8/ef8a1b4e243f6e6ab574d4ce01fda3fb11468637aa9f04668cc5a4e108e06a42025ccc5fb34777d9ad44b7d4311242cef8739e185be7dad8f7df366172df6a create mode 100644 .pnpm-store/v3/files/e8/f16e3fe2253fdd599239851c38a3a38f5032b6235d938e54d1075ffe59635245df11be26bd14407d36ad5503003b28856656264c8dd27df22b60f598074f39 create mode 100644 .pnpm-store/v3/files/e9/009a0d70c4e984eb85c4bbd6bb3c4fd4e482e29c07b49eb97979dd5aba4ee9fafc7358dc9fb83c00247dc8668be10ce21f0d8219158253643e49d8a24aa794 create mode 100644 .pnpm-store/v3/files/e9/1208a7653992056b6ddd002f9a59d3be10ba50815ce51982fbeb77ac3475bc381744217b21d733fb200d4eb76929fbbcd0ef479092f0c0e0c134b84417921f create mode 100644 .pnpm-store/v3/files/e9/906854d96f94d4dfdac77031957373428d857e8968372300bc33b2df7f6ce4f9815261f73af12e7d530febd72e8b13abb804113a1ae1d782c3c7e4cc7d2ab6 create mode 100644 .pnpm-store/v3/files/e9/d36e38140023e4d15ffd5509b03335b0bf7049e78285865b54602efb4e260e6294cab162f22413f0de016a78394c4e0ae1c9e8030a8e4829ce21a65cff966a create mode 100644 .pnpm-store/v3/files/e9/f4f758f88cdb0b68fdcdebfd41d9586bc915e307609154204f9010411e5cc2832e13080d55b2d7180d876f8d9ccaebced7f2e2d35a962254aff54ccab88d3d create mode 100644 .pnpm-store/v3/files/ea/455e521fa642abead9fbac51007178b091c212d4e53badaf2b895dcbe4552038df2afb134636695510dbc8cee01f7a27a2e40551ec21deb3af3e4b9a15271a create mode 100644 .pnpm-store/v3/files/ea/56182522797309f56dd69918154dc0fb0cdbe45f1a4cc4b758aee9d6e63617f41ad5b75840ff79ffaf89d78aaded976baa75709466895f9198df46cf17a6f1 create mode 100644 .pnpm-store/v3/files/ea/cabd58b5c35d58e3e113b83e5c16063b6bc3c63071a67908c68c2f95ca9d00163baeca240eb40d507d9abc581a4c5b17dd51d459191f09848cecc17c2019a2 create mode 100644 .pnpm-store/v3/files/ea/dd6f2737877e65fbbb248c95ad53774a8e5c75e05a07318662134e014031dea4f1952c25141d169cb806e14754b4d645adc68fbc5e46ab2cbe35aa4836b775 create mode 100644 .pnpm-store/v3/files/ea/f4054dfd55ecd49b83360fadc7690be0c305cc997bc3d7d82cad865633385dba1654a8952d7209d9ea4ef5f16c45a6ee9b43d48752592771884e2c1b876f47 create mode 100644 .pnpm-store/v3/files/eb/46f55f7a02b99c33e54ab41620c839f57e5a431594581d21921b3413b632b70ced764a751dadc656e62b763ead45044e0d3c8d321e5c5a0a4a9c2be3f72662 create mode 100644 .pnpm-store/v3/files/eb/50a4dd9a643fdcf052725df8680320107adaf7eb43a2709890fd62b2538853325d9f75c63ac9db9c12240c0aefde6b166f929eb856c42174689daba932aae0 create mode 100644 .pnpm-store/v3/files/eb/7604a0e466510225596e59b1e208ad02117ebfd5eb5a933462e3a65365ca255e43eb803c405f266a3c56938c3d25f2e86a393db3115bfb626e3dd93e1eb150 create mode 100644 .pnpm-store/v3/files/eb/77b569ea96dd63798eff6d968db38cf0f53af94b1750dad9db9868bf788272838a53a46fefe069dceba674238806aa4b28870e0ff79f35e81af6e28affdb8d create mode 100644 .pnpm-store/v3/files/eb/9b0641a35548db5fc0d78ab9ca3a9bb61be9fd5c4002c21ae7e47b5aa22276ead404ad56362c6b6ff7ffeca0a094ab98a412612c5d9a417c694cb2598d69bd create mode 100644 .pnpm-store/v3/files/eb/9ddc6fc6e61bdffcf089ca69e2a1d79579ecf10b837635b30986b5aa13cc1c5bd79e980330b8f68142aa8e5b447d61d68011a4d65ba453b84162e48501eee4 create mode 100644 .pnpm-store/v3/files/ec/05bb9b6155ad17232c5f5b253bec386e328127e9bebf842e98160234569e34116f79577344c04be9cbb3174275879914690dcfc755c4327c0af2173633af0e create mode 100644 .pnpm-store/v3/files/ec/374568d4522680b2ab7dcc28e2db7f7c5bfe558c286e0fac4d9f06e3d4c5a832a9a9a2c5260d8587b2415b9fe91ca7c98461339b6db0b49f9ce26a95275ae3 create mode 100644 .pnpm-store/v3/files/ec/5c7e76de0ee47a9db49c1465c9e6d1a874bc6f7f1c04cba0c9edad6fe729d9f573624e5e8f11bdd2cc3c7ef825689ce85b28c3224f0f5c9c6e48fc33e75168 create mode 100644 .pnpm-store/v3/files/ec/7545608ff83eba02d16a4b6c1fa8d70c7c96462e1f611502ea7c025e4675e8888f64042d2c8d204ef2984ba83a720e662e025a961e1d13873b2bd58862afe0 create mode 100644 .pnpm-store/v3/files/ec/9f546a5ed4413c566d18fcd15e73cc8d84e8a1719f9a9a1ee2438214b42d95b4e972400dfe404f79b31c01e7856e2f5e9e65a9ffddc7f2989e19601e6522d2 create mode 100644 .pnpm-store/v3/files/ec/e992d33d7b5e763bdc6e82fb0e34b6be4b028da52dc945607812cf7331656fdee2262b6ee944d6d37f65be038ef6d836b4c992db9af9c34d8bacbe3ef5bffd create mode 100644 .pnpm-store/v3/files/ed/31e9be25418391c15e2ef6416a7c80294ee124a80070e24ec63188ea576d9c9ea9c1ffaf51b54509bf6771d3d758ebe5f2f71e287b919b83a29e93b636dbfb create mode 100644 .pnpm-store/v3/files/ed/46d82240a81fa2774e9b118584b72519839588bc8d02ac9a90933a7ab40ba2dcc2c87e8ea706da08deab671a24a7c7595a8b36d63e8fdbd88c80ab0f29d317 create mode 100644 .pnpm-store/v3/files/ed/566f87581f2de1d1927f701accdd22e6655dffe877eb92a25838b73254858229547de879f8848f68b48b52cff3dd5ff0e049aaeb1a84aadca2e954b97a0b84 create mode 100644 .pnpm-store/v3/files/ee/be223509096225cc5cdb3fd5206f1abe8645d46f1258a2fe015eda3e8874a77088dc837e66bf1d7064b470c378ab7620349ea6d4198f3e5817a7fd4153c1c7 create mode 100644 .pnpm-store/v3/files/ee/f5fbb0d6c04e1c10bd027245466592a1cba724d36199e98c9f534351e6142f80686d82a3ad06ba2f2d7126dcfe36b875211eb6062123970cece9b0668f0695 create mode 100644 .pnpm-store/v3/files/ef/26c8f399900c16b2b21285a795e7616e27272547ecd18c58fdd61a672ccd548b345080e6797de66bb7b3b4abef155d56b2bf9a5d59a78c5b8b998615fbff92 create mode 100644 .pnpm-store/v3/files/ef/4cdc6e2e056343bc0394abdd82d78e7b4f420edae6694f6619866e246b28766b535b027a400ec3a8d3766d0ead4362625487bcdf348a3e6b0e3601d0f190d3 create mode 100644 .pnpm-store/v3/files/ef/4f170a6ba72b412ae931c017d737d1499b1aa03430afa193ff71509b0c13b4548ac3b9a64391d4c683783f45b4b232e92a7594ab3060e3b1762d56b39e6ecc create mode 100644 .pnpm-store/v3/files/ef/6e2854c31f33d1bb91992b5a63e6686c65616b5255195ecf11d447eb4c3fdc4a410efa3dfc45916fb6e1799fe529dd6da4f6e171cf2b7e9ec9877d19d50e91 create mode 100644 .pnpm-store/v3/files/ef/837a677af0864139c2da46bbce7d66a446cf752fdd3add2f56b12c84257c0ace0bc3ce8b8575560a7cdcc1ffd97a9541a8cced801da9d55aa1056697c39d04 create mode 100644 .pnpm-store/v3/files/f0/2e54509519ad82b2c2372645be968011b04896d67e262435fd3b22f55925e5efbe5277f44c993ea429220a5a6f9278ce6ae3fbac6a2fff7411cb231e991188 create mode 100644 .pnpm-store/v3/files/f0/30b519e4c544737aae909e642262c2d9ab148e6ee060d7b43732c32a7254498ac5770324fc0595f6b0cc7975112453dfcd0184dd70993b268763b9aad35a96 create mode 100644 .pnpm-store/v3/files/f0/6711459373687c4acc13d4ded2ad14d8a7839ef5fc6c0f05e0af980530d3206d7c4d9755dd3314a2483125a41c970f422d1e9318c8b6ce8bfebad9ab973119-index.json create mode 100644 .pnpm-store/v3/files/f0/6decddb0a71b838e03ef0f5954217a464195cd5d52fce5c150d509e2aa2c80ffd7f455ebce15ab18141e05810b8312156799564302e28eb8017a170b57494f create mode 100644 .pnpm-store/v3/files/f0/81ecca42c2f69734cc831c06b93178a15ae89aa5339f187bb79a96af25a331e1bfc04a5542d49706eafef5ef3652388d35232a7e8c87f56a1f54915efc4f27 create mode 100644 .pnpm-store/v3/files/f0/b6667555d5177bc2a2ad8b899dc80d67eb132b44230b672d8ef137a245f843d1226b52c5df247336e061c2c0533c321ba6d4b8bf2e71cef81fbca8b771b2d1 create mode 100644 .pnpm-store/v3/files/f0/b8ec82f056e2d94de463c38353f0556f4430f4d1881ff29534d88589d058db4308bbc0d72650a1fba199f9bfaacd2e33fbd1a70239c3ecaa8fb94b1b6796e2 create mode 100644 .pnpm-store/v3/files/f0/c638a7658523eb4ba1c4aff1885df1765ff97069ab30460d64923bb03696d3cdc1e05b66cc1351b9e97e70a5d1b4e4e2a6fa60ecb0cf711e123599f6cf5a92 create mode 100644 .pnpm-store/v3/files/f0/d6574e901c931e91578ce314d87daec640aca0db7a733c69baed594928a11cfb1153ea7ae9f91336f34a9e1b9b5cf5fa79fa14436b6f7043a1efdcd085bc68 create mode 100644 .pnpm-store/v3/files/f0/e6a4f8eb10716fb4754dbac1e2202eda9474573270285d24da3875943703052271a4770628e0bb2b023803b4e021013acb18224ef0a0fb07a13adaa367142a create mode 100644 .pnpm-store/v3/files/f1/15640cb9436f6ba6abf5bff5e6a89bd01ef828b921281c2e53780c410d4a4f1c5ef30f63c7deed2366c6d9659952ebadfbb5e81a856d321c81675cafb29895 create mode 100644 .pnpm-store/v3/files/f1/3579f71973ca14c7a09d82aad59612cb5ad5eb7832e8c7e95348e29d924350aab3f34677c4e37884c59b7a459219845c7a2f990b6dd13f4ba5b3bf5cd80472 create mode 100644 .pnpm-store/v3/files/f1/710a395442db75e1b0492eebf6de34f26f1420501611e6093c60a2dfe3bcffd3ef39ff3b7c14d7054b8471555259173f289ec7401a1f34be31d3ca00658b99 create mode 100644 .pnpm-store/v3/files/f1/719e2a5b9ec1c9ecb8815bdec60939fed4cb6704bdae071400ad188c8014d75c075e51c5c246289034e717888382d82b357c300817edb000da29bcb4219068 create mode 100644 .pnpm-store/v3/files/f1/8f45122d4cecdf71a4755be202d581dffac0de7a62e92a0e1c29419c7bdafb30d156e23246a80072cfcea9e4c31e09c45a688a3b054abc57f549c030565371 create mode 100644 .pnpm-store/v3/files/f1/936cee2ae4e6533ce61783f25318ce36b7746676be7c2d6894b27155a65d760797ce8752536185442930933eb57289fee6a673d4fa03be00e9ae8ce88bef81 create mode 100644 .pnpm-store/v3/files/f1/bda479300fd36b3c72c9d75c6760acd4046b527c3df5823e38c6f4064bd8205fe052e6613ebe21a57211c037aef3ac7e204d0a2f598cbc355314bc84e38d3d create mode 100644 .pnpm-store/v3/files/f2/1915f119e5ff3201fc49aa189803eb5b3bfd60cee4794901398230a2a7c0dd877e987bf111575257481331141a6ffe997535ab397743988541c85f9033c437 create mode 100644 .pnpm-store/v3/files/f2/4b610c0f6d13f2342edba1f59e1162fc5ce9afd4f5bbfad808d81d6d7356d6672625e73bebfb50dcb84a98fb95488bd6feea2be03bc80d9a0c3a813ad1a447 create mode 100644 .pnpm-store/v3/files/f2/9d3cdd6262b87245740fd6109eb45d83181dd9364a547131ae6e395393ab1ce1b2b99310443947f11539507ef015dafa3401146973807a82f30a7a0b567b79 create mode 100644 .pnpm-store/v3/files/f2/c93d1676f10ee56575077d3c3d00ec0a94d5ab8251b2f84a0367fead55558984021d679d7502a685e2a4747b6a77b57037c0ebe1c0b464ffd2a759c7cdcdba create mode 100644 .pnpm-store/v3/files/f2/d1c9c9465f69bc9085bdfdfb5558013b42c091843f1fe1b55a97311a2a4d7cd96ea7297567555dfe1a037cf017709d295ebb671153c74ef89a5eff4ba8d707 create mode 100644 .pnpm-store/v3/files/f3/42e34668281afb3eb57309d07a020758911a72174030cda9e7b4ce6e2bd0b47092f04df1c6946440267885a7a72ff41c83bac5f06996e0cd979e1d65a93713 create mode 100644 .pnpm-store/v3/files/f3/7d86aca605693e56ce108dfdeafe1bdc274769f069016af7a6b8b3f3b514207699f05be6733ec39656d6bcbf74b6755b0ea91b64c5db2df4dd613774d1b16f create mode 100644 .pnpm-store/v3/files/f3/b2022a0539b794b3393eec04c7c2399436ac78d153e3dc6fd06820b318cfad345ba0e45512c504fc10d7c830515be082a5e2bda51a9299f159019ba72c1b05-index.json create mode 100644 .pnpm-store/v3/files/f4/83d1e510178a0bb71833f369addb6f3128d400c8f847d094f3964662bc374132e8120f2afdb38056668040a10a4eb6b32ef7fab6334cf4e456e4eb6871b0c8 create mode 100644 .pnpm-store/v3/files/f4/a8e6681ae5907b6edaa44695399f41fbe6b517ff587158348ec69a80216d05fbf303af26f230b590e0845e4be6e88683286674dddddc4eee794d63e50405cb create mode 100644 .pnpm-store/v3/files/f4/afc03aef522ed9dc877f50f8c968bbe995298dd20fe679c8ad94b066ca0ea03f538798432f49b70e9b43f70e971e9c5fb3cb8e336a3a239b1cc1136f614a00 create mode 100644 .pnpm-store/v3/files/f4/eeefe0210eefc6aa435f281660e2e25f654910a678bd606a10ffbaf13d4f704bfac2be439dfc12409c16e1ccf3ee03c48a6643fd97beedb790a1a93d2314df create mode 100644 .pnpm-store/v3/files/f5/3ee769e8481ff44a3f07950a20123ca53d176ef4cfa14794270fe091bfce04b48871f193ada22a23fe218bbdb71d0fefc80c506631145899d37e0fb0c3d114 create mode 100644 .pnpm-store/v3/files/f5/97fcb5f0bb8e28b43961dfeebd188b7348045bddc16bf25caac7816dee9c824cfc44bd292b723ebc7631dfce069581a02fd9690d8a4d41c68a0d842962aaf2 create mode 100644 .pnpm-store/v3/files/f5/b912cb9c841a3284a5a3abfa7a3cf38c827dc051bb47d018b4a63960884433da4fed61af824fa65d5c43799b23d18ff79ed009ce7cd88d91e2195ad3c3dca2 create mode 100644 .pnpm-store/v3/files/f6/17b994fa592a511ed5a61469249f4142808aa3bccfd0e9efa6f8a38455d0abeb89301242c95b1cfdbd7bb736d105d7c0f3339a4b7589f131b645f0d4e1afe9 create mode 100644 .pnpm-store/v3/files/f6/59814d9699f5f16a38ff7911870d09a82bc28392e05dc27e2f8934f0446efaf705e79d31b56dc6dae0097afc05f7d1180a3a936e8bf924dd4e485a682253dd create mode 100644 .pnpm-store/v3/files/f6/870e91567628bf650ca116d88ca2f2ba89046c8942ef5d3ef79fff01f0f465e4bfbbb6c064874073dd7f546144f462b0962580ae6ba07da23892273719d262 create mode 100644 .pnpm-store/v3/files/f6/d70a82a29bb37c4627e36d285da774e0412d5c0f8e5d521f13d091ddfaaf70e58abc37c5651e19a4dbaabeee1997136b191537073ed374953fb682756ad394-index.json create mode 100644 .pnpm-store/v3/files/f6/ff743fb77bce9f0b198da8bd65577c017daf89a556bad48c3c24a7d62e6b0b2db85731c93d1df88a6e40757b8370e5ea6f5cc72509241aea2bdb10f9d4888c create mode 100644 .pnpm-store/v3/files/f7/148eb9bb60629bfdca58b774f39534e8cd75b5d85b35041c33229cbffdc6b1fbe30a3cc69b5f5b1afd5fd1c1f7dee0d0fba0d58e2550bfd905d4a2ce96b758 create mode 100644 .pnpm-store/v3/files/f7/96d4e8727366707d4031fc2107ce9e4b07234086b33112a49f65225f9f375f527a9d8e07a66f8d57edf834157514e43eb39c71b5380c779784d46bbceb966a create mode 100644 .pnpm-store/v3/files/f7/a94de04cfea569fb09ee980ae74bbf788719d7f764fa833796700ecc8c3471143239be76a2d677842188c4b90253d22f8cd77e62f1e7b763ab9e1b481bb169 create mode 100644 .pnpm-store/v3/files/f7/df2f42df8d3ad1293a2d2a232163bf7bb15a238ecbb2e262ada5a26a7424dcab0f6088680d6cc10351d6123d2cdd1432a0f1be95395d68874bdf9677b51681 create mode 100644 .pnpm-store/v3/files/f7/eb7b089bce90d529de5a0d59364a73681a73aa79d1cee953f20ee88071a440b435f0a1d1700805db4ab1f2b336163b8171c6ccbe669ed6f93e68740593854c create mode 100644 .pnpm-store/v3/files/f8/1aec4613cda47312beeff2e7e6b4982b6c552b6b86178f79464da95a53ecf49eba2b3ffdb2011e35c3c06c529a62b1a52a0384ee1110a682026fbf82fc4214 create mode 100644 .pnpm-store/v3/files/f8/27e9a5580f6f80506ecb472d6af6ac506c49982601698fee7ff92a354121c8b00dcc8c03adf81d3319ec7ea6c1854fd305d441f689ff31aa6cca1abd7f219f create mode 100644 .pnpm-store/v3/files/f8/2965a8e3bd83206915f4f5236d9510e8d925e642134e4e3c2f7ab04130b92c67ee83d62153a8548a24441aaa93ffca2c71f94d38463782831d37fd0935c180 create mode 100644 .pnpm-store/v3/files/f8/63004ad1e633601954850cea8d8a21169004df5a2611934160f3d6849199546f43477a6eea1661936a494024619ab0c0a8bee4c316e16d6d411c55074a2221 create mode 100644 .pnpm-store/v3/files/f8/93640d51a2d6f4396ddf1eb805b15dc87449465ba0aeca28a4467d9bc1dc9af3b801edded1c9244dbecea9a80ac621b443f2f71cfd4a3a89c1d64b90950fb9 create mode 100644 .pnpm-store/v3/files/f8/a9ca06b80b4f0379516f36299e9273a6c48652efca270e766d4f158228b8330ff08beec653dede19aae0b8f14911d70e636241173b6a454298e9ef16a031cf create mode 100644 .pnpm-store/v3/files/f8/bd03782a906210f1e9520857eb7d7afbf60452d4d0b39f0401ea84cf4bc049017d5455f3871fb76275b76782dd9314cc2b4e0ccdc150563eeacfe69e50b95c create mode 100644 .pnpm-store/v3/files/f9/4453c45429861ffdae07eebcfb61aa705e529ca411446903315e9d307539a5612b0178cfa8314d23e7d755a1db3d2dd9970e843033ee5034a9031d1ce9da40 create mode 100644 .pnpm-store/v3/files/f9/446db4af3ee08720de8791745aacb43446bb8a6d56739f33118c4eff94b84672f2f9edb445f2be63d91e7db7ddd1a5a7c713755df88cda955aa7717b094ab8 create mode 100644 .pnpm-store/v3/files/f9/97f2d8634af9617c9c1d7e059ea962ee917c0c55aee026cfed65e85f15af016113a1bdadbffc1aabc44fe74f24373d969e1a8c879086aea563ff0b03b2a76e create mode 100644 .pnpm-store/v3/files/f9/b9e904555087177d6e587b50a043fc2a7ba610177d0196bde80a83cd1fa18dcc5aa0e585b046404b6dbcafe9fd9c53e721ce96eeb961bb3072204975c1ec8d create mode 100644 .pnpm-store/v3/files/f9/da30ad56b384551976904f79dca38b36ff4b108574c6ee3c18741d3fdf631c15745eb7211ed6a7d7e969cd7bcb2fc32817c8179c356289d02485cf7936dadd create mode 100644 .pnpm-store/v3/files/f9/eb4d6c75dbbf6e25582c852345550200cdae89fe6811fa34e5c28f90744bc3e953124bb71c81d311f5016065c7013c6d8b10a9c244f7cd182b6334c7a37db5 create mode 100644 .pnpm-store/v3/files/fa/136a0edaa99fdb509e994fb0122d10854ea24d25db2cf1b0bb1696dabd12f2b359119f72e91e1ae919cecd20832aef35a47e30407cb499ef03512b8d463ca9 create mode 100644 .pnpm-store/v3/files/fa/28b62313823edebcbc078d9561e40a188d0afc5506da7ca900f0916f2848e10f6d5194c276c5afd923d80f14c73698a502e07fcf1cbf6e669df64f685791d1 create mode 100644 .pnpm-store/v3/files/fa/65b32dc96c44501551a1140777ab360c78ecaae4b637a63b5f9a23a9b6e37e7937830b98ebee4c4b6c220beb764fce120d95b5a791418e16df9afd6691b064 create mode 100644 .pnpm-store/v3/files/fa/732c7a139e8203b831b20aadeab820eb6a069c5ba7ff9fd6043928ae1a43d69877ff530530684607a75b9f00a68c66463a7ab95bd5e52f17516308bffccfc9 create mode 100644 .pnpm-store/v3/files/fa/dc0c09b8a16da8efce9d47a6ba88b24afd2c45cc96c98ccf088dabd3149cfcee320d6531c7b13e0d89f47aba5cbcfbb11b32d363c8c5f762fdf4da83d15f4d create mode 100644 .pnpm-store/v3/files/fb/1ac3d8158ba6f1ca3665f641ba5da6c05a5a74716a13302633be29993624e1258f99d298a7b3c92d41e2ef906c73135faf6de2e926ea187d96c610ec61c228-index.json create mode 100644 .pnpm-store/v3/files/fb/1dd16f3273b3ecb2de56c4711976d4bfa843fd541f21e4ad4a345c94ba53a70d2fdf1eb6d4b44a1532d33f51260b71b06b0bc77c00bcf78bc41a25468a02ea create mode 100644 .pnpm-store/v3/files/fb/2ad0d34b83ad9344aa769ca90bd0bcf156d766c63004d9308028980a67ad083a43350e70458b3808dd9bf5792383f038d7b738d4ea1f90727c01a9f7763191 create mode 100644 .pnpm-store/v3/files/fb/2d334ffb7f3da1f0faa513acd7533f318a5b56558ff82c54ab3cd2e88c3ce865bb52a6895b00fb134cd217609b6aca1424b42fd7caabef6b81d799d87a3dfb create mode 100644 .pnpm-store/v3/files/fb/9763151bcae8fbd954b4cbae848f7b9b68abc5db3a5d55b718c6144b7bfe667b70632dc56e0956a2156e0032db84bdee072454ff69b5594e24f041e33263ce create mode 100644 .pnpm-store/v3/files/fb/cd3eea1132490dee4ac3fd70f599a71401b0b8a4cce26a97c9c96d0762d381a605802cb0a9b90be416cb266029862c6a36908df005983d43d478c46b2a47e3 create mode 100644 .pnpm-store/v3/files/fc/18f4c2369a4220bac63839ff2cb08a966d786477e539387d728f9573150e5b2b623dd1e46c0a0efb523c1c6bfb158ea1bbef581b72831bb588a217ef359ca8 create mode 100644 .pnpm-store/v3/files/fc/1d68c99ab5f5690eb8c35790cb308b0f25d3773d0f22af8c09028f39be7b85a743bfc74df02adadb0a2278079430d508ef5fe65af3f1dc591bb5d9f1153fe3 create mode 100644 .pnpm-store/v3/files/fc/242c99fd15fd27936f812f0bf446f46cff5291a6994d2729f87e48424c73d52aaa9b9ace48d51e9fc2339b293c96bddde01d7f7b010ad6f67b717cbcc5f39f create mode 100644 .pnpm-store/v3/files/fc/cc8cb41288e972e0ecb4b23e86b48b82d032873c479ff215d18c1e15812afdab622fc37254a2833475b2b8c2161e5f58dfd1369520816a4f1458d379c9fc1a create mode 100644 .pnpm-store/v3/files/fc/d44b13b0333f424c23b6a9e6d3afb77a98a11ee52f5120d1df1d04cd9b9fac9f67c0cb6ee7dd709c222fd884539a0fd1a4551630d36f947e653c66017d74be create mode 100644 .pnpm-store/v3/files/fd/10e5a0725371d18247353bb1ddd16a2a73766ac0fe004512a54df0eefc9b7770264bdc3118459463d943ca3b1a84737b9395c79a3c1edbe02090fd29564fd4 create mode 100644 .pnpm-store/v3/files/fd/1360cbc34d1d2a41b0d79a575df3bc4d82d38d88182644327d6d9e9fe07cf72b25f8fdf301d82dccb2a383ccb3c1ee7fccf057fec5654bda0a78c89a40b3be create mode 100644 .pnpm-store/v3/files/fd/c60bb860cde455f477352d22b067a23a6f480e6085ad2ae3147e22a97ff05de38752d7409ddce61e09e119dd055718b210e11a9e2724810ebdcb6e116a1c8c create mode 100644 .pnpm-store/v3/files/fe/36facd109652128f4105ddaf33b8f1cfa5cbf2345d3e8dbed228164c39848bf8f4a87f761427d1711d78d7045aff7610e299fba8f6c338c8a1cc5201fee7e4 create mode 100644 .pnpm-store/v3/files/fe/eecf2fed5267da24c6635aa916b26d03c442e6d641108ce79f3012bb460d6fca805bb36ff10845ab9284cac5525a1545daf14cfbcc6d15342fe46535f901cc create mode 100644 .pnpm-store/v3/files/ff/0cb26587e5b4847d117a947c04b60ea6864eb3356a7b2a4f7a7353890fdae0f236099ca48601ab802bdeb6431a4fc425efa343876929178de6fb50cb1b6956 create mode 100644 .pnpm-store/v3/files/ff/361061d7a6f28c7085367a68f566cad902e6616522cb0016f2d394d446f740e7d25069b4e1d21914036556eb3f288400b7d978afebb34ca1545dc61e395693 create mode 100644 .pnpm-store/v3/files/ff/53c355ae03cff74ad2a6fb24f0f694af6caf3d04d978fe8500d31a63e6db1df117710aabab849d763900ffae5967a21a0328e336bb8df4af3c6c40d200ede9 create mode 100644 .pnpm-store/v3/files/ff/5c9ecca29c0e05d1f6153f7ce2035e8e808f67f79794d5f8fbe1bd0e77b6be136bc9b05aa65a0a2fada943618148a977ea428567dd394ef3b29d2fd189b50c create mode 100644 .pnpm-store/v3/files/ff/9d36fb11418901e518c40a1105f103448e4b809d7e30d53dc2a1b922e725693d2d1809715b58cc46e5db66d6dbdc5693cd30cb163dc9d47478773217489061 create mode 100644 .pnpm-store/v3/files/ff/cf8d75d2922863d765cd0ab7b8d75c6af9dd09a57d4d13df3e1ff18465f43417dcfdf24b345a1e4b6bbc21786d0029f990930bfc1d846b69fda9028d89f041 diff --git a/.changeset/flat-pugs-applaud.md b/.changeset/flat-pugs-applaud.md deleted file mode 100644 index a845151c..00000000 --- a/.changeset/flat-pugs-applaud.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.changeset/odd-beans-appear.md b/.changeset/odd-beans-appear.md deleted file mode 100644 index 9399a3dc..00000000 --- a/.changeset/odd-beans-appear.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@matthiesenxyz/create-astro-ghostcms": patch ---- - -Bump dependencies: - -- @astrojs/rss from to -- vite from to -- unocss from to -- astro-font from to diff --git a/.changeset/popular-steaks-switch.md b/.changeset/popular-steaks-switch.md deleted file mode 100644 index ccfc098a..00000000 --- a/.changeset/popular-steaks-switch.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@matthiesenxyz/astro-ghostcms-brutalbyelian": patch ---- - -Bump dependencies: - -- @astrojs/rss from to -- vite from to -- unocss from to -- astro-font from to diff --git a/.changeset/young-bulldogs-brake.md b/.changeset/young-bulldogs-brake.md deleted file mode 100644 index a209f294..00000000 --- a/.changeset/young-bulldogs-brake.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@matthiesenxyz/astro-ghostcms": patch ---- - -Bump dependencies: - -- @astrojs/rss from to -- vite from to -- unocss from to -- astro-font from to diff --git a/.pnpm-store/v3/files/00/9da7e5c01b986485fde7fc733a35f7062e5374aaa4c56747ac631dc831fa2102837828ba1cac63a52c7a667d6ca6de790b857f2b078ec9d43279aaaced5f89 b/.pnpm-store/v3/files/00/9da7e5c01b986485fde7fc733a35f7062e5374aaa4c56747ac631dc831fa2102837828ba1cac63a52c7a667d6ca6de790b857f2b078ec9d43279aaaced5f89 new file mode 100644 index 00000000..6f2a3429 --- /dev/null +++ b/.pnpm-store/v3/files/00/9da7e5c01b986485fde7fc733a35f7062e5374aaa4c56747ac631dc831fa2102837828ba1cac63a52c7a667d6ca6de790b857f2b078ec9d43279aaaced5f89 @@ -0,0 +1,326 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handleKindModifiers = exports.register = void 0; +const semver = require("semver"); +const getUserPreferences_1 = require("../../configs/getUserPreferences"); +const PConst = require("../../protocol.const"); +const shared_1 = require("../../shared"); +const modifiers_1 = require("../../utils/modifiers"); +function register(ctx) { + const { ts } = ctx; + const lt_320 = semver.lt(ts.version, '3.2.0'); + const gte_300 = semver.gte(ts.version, '3.0.0'); + return async (uri, position, options) => { + const document = ctx.getTextDocument(uri); + if (!document) + return; + const preferences = await (0, getUserPreferences_1.getUserPreferences)(ctx, document); + const fileName = ctx.uriToFileName(document.uri); + const offset = document.offsetAt(position); + const completionContext = (0, shared_1.safeCall)(() => ctx.languageService.getCompletionsAtPosition(fileName, offset, { + ...preferences, + ...options, + })); + if (completionContext === undefined) + return; + const wordRange = completionContext.optionalReplacementSpan ? { + start: document.positionAt(completionContext.optionalReplacementSpan.start), + end: document.positionAt(completionContext.optionalReplacementSpan.start + completionContext.optionalReplacementSpan.length), + } : undefined; + let line = document.getText({ + start: { line: position.line, character: 0 }, + end: { line: position.line + 1, character: 0 }, + }); + if (line.endsWith('\n')) { + line = line.substring(0, line.length - 1); + } + const dotAccessorContext = getDotAccessorContext(document); + const entries = completionContext.entries + .map(tsEntry => toVScodeItem(tsEntry, document)); + return { + isIncomplete: !!completionContext.isIncomplete, + items: entries, + }; + function toVScodeItem(tsEntry, document) { + const item = { label: tsEntry.name }; + item.kind = convertKind(tsEntry.kind); + if (tsEntry.source && tsEntry.hasAction) { + // De-prioritize auto-imports + // https://github.com/microsoft/vscode/issues/40311 + item.sortText = '\uffff' + tsEntry.sortText; + } + else { + item.sortText = tsEntry.sortText; + } + const { sourceDisplay, isSnippet, labelDetails } = tsEntry; + if (sourceDisplay) { + item.labelDetails ??= {}; + item.labelDetails.description = ts.displayPartsToString(sourceDisplay); + } + if (labelDetails) { + item.labelDetails ??= {}; + Object.assign(item.labelDetails, labelDetails); + } + item.preselect = tsEntry.isRecommended; + let range = getRangeFromReplacementSpan(tsEntry, document); + item.commitCharacters = getCommitCharacters(tsEntry, { + isNewIdentifierLocation: completionContext.isNewIdentifierLocation, + isInValidCommitCharacterContext: isInValidCommitCharacterContext(document, position), + enableCallCompletions: true, // TODO: suggest.completeFunctionCalls + }); + item.insertText = tsEntry.insertText; + item.insertTextFormat = isSnippet ? 2 : 1; + item.filterText = getFilterText(tsEntry, wordRange, line, tsEntry.insertText); + if (completionContext?.isMemberCompletion && dotAccessorContext && !isSnippet) { + item.filterText = dotAccessorContext.text + (item.insertText || item.label); + if (!range) { + const replacementRange = wordRange; + if (replacementRange) { + range = { + inserting: dotAccessorContext.range, + replacing: rangeUnion(dotAccessorContext.range, replacementRange), + }; + } + else { + range = dotAccessorContext.range; + } + item.insertText = item.filterText; + } + } + handleKindModifiers(item, tsEntry); + if (!range && wordRange) { + range = { + inserting: { start: wordRange.start, end: position }, + replacing: wordRange, + }; + } + if (range) { + if ('start' in range) { + item.textEdit = { + range, + newText: item.insertText || item.label, + }; + } + else { + item.textEdit = { + insert: range.inserting, + replace: range.replacing, + newText: item.insertText || item.label, + }; + } + } + return { + ...item, + data: { + uri, + fileName, + offset, + originalItem: { + name: tsEntry.name, + source: tsEntry.source, + data: tsEntry.data, + labelDetails: tsEntry.labelDetails, + }, + }, + }; + } + function getDotAccessorContext(document) { + let dotAccessorContext; + if (gte_300) { + if (!completionContext) + return; + const isMemberCompletion = completionContext.isMemberCompletion; + if (isMemberCompletion) { + const dotMatch = line.slice(0, position.character).match(/\??\.\s*$/) || undefined; + if (dotMatch) { + const range = { + start: { line: position.line, character: position.character - dotMatch[0].length }, + end: position, + }; + const text = document.getText(range); + dotAccessorContext = { range, text }; + } + } + } + return dotAccessorContext; + } + // from vscode typescript + function getRangeFromReplacementSpan(tsEntry, document) { + if (!tsEntry.replacementSpan) { + return; + } + let replaceRange = { + start: document.positionAt(tsEntry.replacementSpan.start), + end: document.positionAt(tsEntry.replacementSpan.start + tsEntry.replacementSpan.length), + }; + // Make sure we only replace a single line at most + if (replaceRange.start.line !== replaceRange.end.line) { + replaceRange = { + start: { + line: replaceRange.start.line, + character: replaceRange.start.character, + }, + end: { + line: replaceRange.start.line, + character: document.positionAt(document.offsetAt({ line: replaceRange.start.line + 1, character: 0 }) - 1).character, + }, + }; + } + // If TS returns an explicit replacement range, we should use it for both types of completion + return { + inserting: replaceRange, + replacing: replaceRange, + }; + } + function getFilterText(tsEntry, wordRange, line, insertText) { + // Handle private field completions + if (tsEntry.name.startsWith('#')) { + const wordStart = wordRange ? line.charAt(wordRange.start.character) : undefined; + if (insertText) { + if (insertText.startsWith('this.#')) { + return wordStart === '#' ? insertText : insertText.replace(/^this\.#/, ''); + } + else { + return insertText; + } + } + else { + return wordStart === '#' ? undefined : tsEntry.name.replace(/^#/, ''); + } + } + // For `this.` completions, generally don't set the filter text since we don't want them to be overly prioritized. #74164 + if (insertText?.startsWith('this.')) { + return undefined; + } + // Handle the case: + // ``` + // const xyz = { 'ab c': 1 }; + // xyz.ab| + // ``` + // In which case we want to insert a bracket accessor but should use `.abc` as the filter text instead of + // the bracketed insert text. + else if (insertText?.startsWith('[')) { + return insertText.replace(/^\[['"](.+)[['"]\]$/, '.$1'); + } + // In all other cases, fallback to using the insertText + return insertText; + } + function convertKind(kind) { + switch (kind) { + case PConst.Kind.primitiveType: + case PConst.Kind.keyword: + return 14; + case PConst.Kind.const: + case PConst.Kind.let: + case PConst.Kind.variable: + case PConst.Kind.localVariable: + case PConst.Kind.alias: + case PConst.Kind.parameter: + return 6; + case PConst.Kind.memberVariable: + case PConst.Kind.memberGetAccessor: + case PConst.Kind.memberSetAccessor: + return 5; + case PConst.Kind.function: + case PConst.Kind.localFunction: + return 3; + case PConst.Kind.method: + case PConst.Kind.constructSignature: + case PConst.Kind.callSignature: + case PConst.Kind.indexSignature: + return 2; + case PConst.Kind.enum: + return 13; + case PConst.Kind.enumMember: + return 20; + case PConst.Kind.module: + case PConst.Kind.externalModuleName: + return 9; + case PConst.Kind.class: + case PConst.Kind.type: + return 7; + case PConst.Kind.interface: + return 8; + case PConst.Kind.warning: + return 1; + case PConst.Kind.script: + return 17; + case PConst.Kind.directory: + return 19; + case PConst.Kind.string: + return 21; + default: + return 10; + } + } + function getCommitCharacters(entry, context) { + if (entry.kind === PConst.Kind.warning) { // Ambient JS word based suggestion + return undefined; + } + if (context.isNewIdentifierLocation || !context.isInValidCommitCharacterContext) { + return undefined; + } + const commitCharacters = ['.', ',', ';']; + if (context.enableCallCompletions) { + commitCharacters.push('('); + } + return commitCharacters; + } + function isInValidCommitCharacterContext(document, position) { + if (lt_320) { + // Workaround for https://github.com/microsoft/TypeScript/issues/27742 + // Only enable dot completions when the previous character is not a dot preceded by whitespace. + // Prevents incorrectly completing while typing spread operators. + if (position.character > 1) { + const preText = document.getText({ + start: { line: position.line, character: 0 }, + end: position, + }); + return preText.match(/(\s|^)\.$/ig) === null; + } + } + return true; + } + }; +} +exports.register = register; +function handleKindModifiers(item, tsEntry) { + if (tsEntry.kindModifiers) { + const kindModifiers = (0, modifiers_1.parseKindModifier)(tsEntry.kindModifiers); + if (kindModifiers.has(PConst.KindModifiers.optional)) { + if (!item.insertText) { + item.insertText = item.label; + } + if (!item.filterText) { + item.filterText = item.label; + } + item.label += '?'; + } + if (kindModifiers.has(PConst.KindModifiers.deprecated)) { + item.tags = [1]; + } + if (kindModifiers.has(PConst.KindModifiers.color)) { + item.kind = 16; + } + if (tsEntry.kind === PConst.Kind.script) { + for (const extModifier of PConst.KindModifiers.fileExtensionKindModifiers) { + if (kindModifiers.has(extModifier)) { + if (tsEntry.name.toLowerCase().endsWith(extModifier)) { + item.detail = tsEntry.name; + } + else { + item.detail = tsEntry.name + extModifier; + } + break; + } + } + } + } +} +exports.handleKindModifiers = handleKindModifiers; +function rangeUnion(a, b) { + const start = (a.start.line < b.start.line || (a.start.line === b.start.line && a.start.character < b.start.character)) ? a.start : b.start; + const end = (a.end.line > b.end.line || (a.end.line === b.end.line && a.end.character > b.end.character)) ? a.end : b.end; + return { start, end }; +} +//# sourceMappingURL=basic.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/00/b1e183243c132f64a667336127cdcbf5c8053509c3cfd591a32003ff42ef1a8a9d88865d4f60fbf71054974318e1a53a593c72cd71749172e9fa78b463892d b/.pnpm-store/v3/files/00/b1e183243c132f64a667336127cdcbf5c8053509c3cfd591a32003ff42ef1a8a9d88865d4f60fbf71054974318e1a53a593c72cd71749172e9fa78b463892d new file mode 100644 index 00000000..982b91b4 --- /dev/null +++ b/.pnpm-store/v3/files/00/b1e183243c132f64a667336127cdcbf5c8053509c3cfd591a32003ff42ef1a8a9d88865d4f60fbf71054974318e1a53a593c72cd71749172e9fa78b463892d @@ -0,0 +1 @@ +{"version":3,"file":"prefer-ts-expect-error.js","sourceRoot":"","sources":["../../src/rules/prefer-ts-expect-error.ts"],"names":[],"mappings":";;AACA,oDAA2D;AAG3D,kCAAqC;AAIrC,kBAAe,IAAA,iBAAU,EAAiB;IACxC,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,oDAAoD;YACjE,WAAW,EAAE,QAAQ;SACtB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,wBAAwB,EACtB,yEAAyE;SAC5E;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;QACxD,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;QAE9D,SAAS,aAAa,CAAC,OAAyB;YAC9C,OAAO,OAAO,CAAC,IAAI,KAAK,uBAAe,CAAC,IAAI,CAAC;QAC/C,CAAC;QAED,SAAS,kBAAkB,CAAC,OAAyB;YACnD,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC3B,OAAO,OAAO,CAAC,KAAK,CAAC;YACvB,CAAC;YAED,0DAA0D;YAC1D,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC/C,OAAO,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC/C,CAAC;QAED,SAAS,sBAAsB,CAAC,OAAyB;YACvD,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;YACzC,OAAO,aAAa,CAAC,OAAO,CAAC;gBAC3B,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;gBACrC,CAAC,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;QAED,OAAO;YACL,OAAO;gBACL,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;gBACrD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;oBACzB,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;wBACpC,MAAM,oBAAoB,GAAG,CAAC,KAAgB,EAAW,EAAE,CACzD,KAAK,CAAC,WAAW,CACf,OAAO,EACP,KAAK,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,kBAAkB,CAAC,EAAE,CAC/D,CAAC;wBAEJ,MAAM,qBAAqB,GAAG,CAAC,KAAgB,EAAW,EAAE,CAC1D,KAAK,CAAC,WAAW,CACf,OAAO,EACP,KAAK,OAAO,CAAC,KAAK,CAAC,OAAO,CACxB,YAAY,EACZ,kBAAkB,CACnB,IAAI,CACN,CAAC;wBAEJ,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,OAAO;4BACb,SAAS,EAAE,0BAA0B;4BACrC,GAAG,EAAE,aAAa,CAAC,OAAO,CAAC;gCACzB,CAAC,CAAC,oBAAoB;gCACtB,CAAC,CAAC,qBAAqB;yBAC1B,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/01/0aa4a8a0dd99cfce36281702106dda3fec02270b7c9d3aa0c23fc27b8e78df7d781b0255a2fce509bf9ba0aa059e7c06f8756fdd450a0e55126f0df93f61e7 b/.pnpm-store/v3/files/01/0aa4a8a0dd99cfce36281702106dda3fec02270b7c9d3aa0c23fc27b8e78df7d781b0255a2fce509bf9ba0aa059e7c06f8756fdd450a0e55126f0df93f61e7 new file mode 100644 index 00000000..ca39824b --- /dev/null +++ b/.pnpm-store/v3/files/01/0aa4a8a0dd99cfce36281702106dda3fec02270b7c9d3aa0c23fc27b8e78df7d781b0255a2fce509bf9ba0aa059e7c06f8756fdd450a0e55126f0df93f61e7 @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createWorkspaceFolderManager = void 0; +function createWorkspaceFolderManager() { + let folders = []; + const onDidAddCallbacks = new Set(); + const onDidRemoveCallbacks = new Set(); + return { + add(folder) { + if (!folders.some(uri => uri.toString() === folder.toString())) { + folders.push(folder); + } + }, + remove(folder) { + folders = folders.filter(uri => uri.toString() !== folder.toString()); + }, + getAll() { + return folders; + }, + onDidAdd(cb) { + onDidAddCallbacks.add(cb); + return { + dispose() { + onDidAddCallbacks.delete(cb); + }, + }; + }, + onDidRemove(cb) { + onDidRemoveCallbacks.add(cb); + return { + dispose() { + onDidRemoveCallbacks.delete(cb); + }, + }; + }, + }; +} +exports.createWorkspaceFolderManager = createWorkspaceFolderManager; +//# sourceMappingURL=workspaceFolderManager.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/01/5bab70eb3bc76b4ba6edb663070370e4b36bb6fbeaf1304d136ef0a2d08c59c29e6fd38b8b354c9a3cb746df7aa7fb5fdf4b47113c3ed3c67fb93b6f477bd4 b/.pnpm-store/v3/files/01/5bab70eb3bc76b4ba6edb663070370e4b36bb6fbeaf1304d136ef0a2d08c59c29e6fd38b8b354c9a3cb746df7aa7fb5fdf4b47113c3ed3c67fb93b6f477bd4 new file mode 100644 index 00000000..26f21f73 --- /dev/null +++ b/.pnpm-store/v3/files/01/5bab70eb3bc76b4ba6edb663070370e4b36bb6fbeaf1304d136ef0a2d08c59c29e6fd38b8b354c9a3cb746df7aa7fb5fdf4b47113c3ed3c67fb93b6f477bd4 @@ -0,0 +1,21 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var ToInt32 = require('../ToInt32'); +var ToUint32 = require('../ToUint32'); + +// https://262.ecma-international.org/11.0/#sec-numeric-types-number-leftShift + +module.exports = function NumberLeftShift(x, y) { + if (typeof x !== 'number' || typeof y !== 'number') { + throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers'); + } + + var lnum = ToInt32(x); + var rnum = ToUint32(y); + + var shiftCount = rnum & 0x1F; + + return lnum << shiftCount; +}; diff --git a/.pnpm-store/v3/files/01/ab847218f19312581630e56abb9e81b6b4595f0fe02655380546335c7d35b14806ac2715f23ac34982898f873b0c190ea7ff8de04e96b5de2a7e66dd19d75a b/.pnpm-store/v3/files/01/ab847218f19312581630e56abb9e81b6b4595f0fe02655380546335c7d35b14806ac2715f23ac34982898f873b0c190ea7ff8de04e96b5de2a7e66dd19d75a new file mode 100644 index 00000000..fbe41941 --- /dev/null +++ b/.pnpm-store/v3/files/01/ab847218f19312581630e56abb9e81b6b4595f0fe02655380546335c7d35b14806ac2715f23ac34982898f873b0c190ea7ff8de04e96b5de2a7e66dd19d75a @@ -0,0 +1,143 @@ +'use strict'; + +var hasOwn = require('hasown'); +var inspect = require('object-inspect'); +var supportsDescriptors = require('define-properties').supportsDescriptors; +var v = require('es-value-fixtures'); + +var forEach = require('for-each'); +var availableFlags = require('available-regexp-flags'); +var regexProperties = require('available-regexp-flags/properties'); + +var sortedFlags = availableFlags.slice().sort(function (a, b) { return a.localeCompare(b); }).join(''); + +var getRegexLiteral = function (stringRegex) { + try { + // eslint-disable-next-line no-new-func + return Function('return ' + stringRegex + ';')(); + } catch (e) { /**/ } + return null; +}; + +module.exports = function runTests(flags, t) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { flags(nonObject); }, + TypeError, + 'throws when called with a non-object receiver: ' + inspect(nonObject) + ); + }); + + t.equal(flags(/a/g), 'g', 'flags(/a/g) !== "g"'); + t.equal(flags(/a/gmi), 'gim', 'flags(/a/gmi) !== "gim"'); + t.equal(flags(new RegExp('a', 'gmi')), 'gim', 'flags(new RegExp("a", "gmi")) !== "gim"'); + t.equal(flags(/a/), '', 'flags(/a/) !== ""'); + t.equal(flags(new RegExp('a')), '', 'flags(new RegExp("a")) !== ""'); + + forEach(availableFlags, function (flag) { + var property = regexProperties[flag]; + t.test(property + ' flag', function (st) { + st.equal(flags(getRegexLiteral('/a/' + flag)), flag, 'flags(/a/' + flag + ') !== ' + inspect(flag)); + st.equal(flags(new RegExp('a', flag)), flag, 'flags(new RegExp("a", ' + inspect(flag) + ')) !== ' + inspect(flag)); + st.end(); + }); + }); + + t.test('sorting', function (st) { + st.equal(flags(/a/gim), 'gim', 'flags(/a/gim) !== "gim"'); + st.equal(flags(/a/mig), 'gim', 'flags(/a/mig) !== "gim"'); + st.equal(flags(/a/mgi), 'gim', 'flags(/a/mgi) !== "gim"'); + if (hasOwn(RegExp.prototype, 'sticky')) { + st.equal(flags(getRegexLiteral('/a/gyim')), 'gimy', 'flags(/a/gyim) !== "gimy"'); + } + if (hasOwn(RegExp.prototype, 'unicode')) { + st.equal(flags(getRegexLiteral('/a/ugmi')), 'gimu', 'flags(/a/ugmi) !== "gimu"'); + } + if (hasOwn(RegExp.prototype, 'dotAll')) { + st.equal(flags(getRegexLiteral('/a/sgmi')), 'gims', 'flags(/a/sgmi) !== "gims"'); + } + + var randomFlags = availableFlags.slice().sort(function () { return Math.random() > 0.5 ? 1 : -1; }).join('').replace('v', ''); + st.equal( + flags(getRegexLiteral('/a/' + randomFlags)), + sortedFlags.replace('v', ''), + 'random: flags(/a/' + randomFlags + ') === ' + inspect(sortedFlags) + ); + + st.end(); + }); + + t.test('basic examples', function (st) { + st.equal(flags(/a/g), 'g', '(/a/g).flags !== "g"'); + st.equal(flags(/a/gmi), 'gim', '(/a/gmi).flags !== "gim"'); + st.equal(flags(new RegExp('a', 'gmi')), 'gim', 'new RegExp("a", "gmi").flags !== "gim"'); + st.equal(flags(/a/), '', '(/a/).flags !== ""'); + st.equal(flags(new RegExp('a')), '', 'new RegExp("a").flags !== ""'); + + st.end(); + }); + + t.test('generic flags', function (st) { + st.equal(flags({}), ''); + st.equal(flags({ ignoreCase: true }), 'i'); + st.equal(flags({ dotAll: 1, global: 0, sticky: 1, unicode: 1 }), 'suy'); + st.equal(flags({ __proto__: { multiline: true } }), 'm'); + + var obj = {}; + forEach(availableFlags, function (flag) { + if (flag !== 'v') { + obj[regexProperties[flag]] = true; + } + }); + st.equal(flags(obj), sortedFlags.replace('v', ''), 'an object with every available flag: ' + sortedFlags); + + st.end(); + }); + + t.test('getters', { skip: !supportsDescriptors }, function (st) { + /* eslint getter-return: 0 */ + var calls = ''; + var re = {}; + Object.defineProperty(re, 'hasIndices', { + get: function () { + calls += 'd'; + } + }); + Object.defineProperty(re, 'global', { + get: function () { + calls += 'g'; + } + }); + Object.defineProperty(re, 'ignoreCase', { + get: function () { + calls += 'i'; + } + }); + Object.defineProperty(re, 'multiline', { + get: function () { + calls += 'm'; + } + }); + Object.defineProperty(re, 'dotAll', { + get: function () { + calls += 's'; + } + }); + Object.defineProperty(re, 'unicode', { + get: function () { + calls += 'u'; + } + }); + Object.defineProperty(re, 'sticky', { + get: function () { + calls += 'y'; + } + }); + + flags(re); + + st.equal(calls, 'dgimsuy', 'getters are called in expected order'); + + st.end(); + }); +}; diff --git a/.pnpm-store/v3/files/01/bda25e4c9d6ca2a10e8d82b96c1f93ec3390819842607a245be13e94bde29c88bfbf298aedea4486729001dcfcbd3972c2181ff7af193a7d6972a43abce779 b/.pnpm-store/v3/files/01/bda25e4c9d6ca2a10e8d82b96c1f93ec3390819842607a245be13e94bde29c88bfbf298aedea4486729001dcfcbd3972c2181ff7af193a7d6972a43abce779 new file mode 100644 index 00000000..940db01f --- /dev/null +++ b/.pnpm-store/v3/files/01/bda25e4c9d6ca2a10e8d82b96c1f93ec3390819842607a245be13e94bde29c88bfbf298aedea4486729001dcfcbd3972c2181ff7af193a7d6972a43abce779 @@ -0,0 +1 @@ +{"version":3,"file":"disable-type-checked.js","sourceRoot":"","sources":["../../src/configs/disable-type-checked.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,mDAAmD;AACnD,EAAE;AACF,4DAA4D;AAC5D,sDAAsD;AAItD,iBAAS;IACP,aAAa,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;IAChD,KAAK,EAAE;QACL,mCAAmC,EAAE,KAAK;QAC1C,4CAA4C,EAAE,KAAK;QACnD,iCAAiC,EAAE,KAAK;QACxC,sCAAsC,EAAE,KAAK;QAC7C,oCAAoC,EAAE,KAAK;QAC3C,sCAAsC,EAAE,KAAK;QAC7C,iDAAiD,EAAE,KAAK;QACxD,mDAAmD,EAAE,KAAK;QAC1D,yCAAyC,EAAE,KAAK;QAChD,oCAAoC,EAAE,KAAK;QAC3C,oCAAoC,EAAE,KAAK;QAC3C,iDAAiD,EAAE,KAAK;QACxD,wCAAwC,EAAE,KAAK;QAC/C,mCAAmC,EAAE,KAAK;QAC1C,mDAAmD,EAAE,KAAK;QAC1D,qCAAqC,EAAE,KAAK;QAC5C,2DAA2D,EAAE,KAAK;QAClE,6CAA6C,EAAE,KAAK;QACpD,6CAA6C,EAAE,KAAK;QACpD,kDAAkD,EAAE,KAAK;QACzD,kDAAkD,EAAE,KAAK;QACzD,uCAAuC,EAAE,KAAK;QAC9C,yCAAyC,EAAE,KAAK;QAChD,mCAAmC,EAAE,KAAK;QAC1C,8CAA8C,EAAE,KAAK;QACrD,4CAA4C,EAAE,KAAK;QACnD,qCAAqC,EAAE,KAAK;QAC5C,0CAA0C,EAAE,KAAK;QACjD,iDAAiD,EAAE,KAAK;QACxD,sDAAsD,EAAE,KAAK;QAC7D,yCAAyC,EAAE,KAAK;QAChD,gCAAgC,EAAE,KAAK;QACvC,oCAAoC,EAAE,KAAK;QAC3C,8CAA8C,EAAE,KAAK;QACrD,0CAA0C,EAAE,KAAK;QACjD,iDAAiD,EAAE,KAAK;QACxD,oCAAoC,EAAE,KAAK;QAC3C,oDAAoD,EAAE,KAAK;QAC3D,iDAAiD,EAAE,KAAK;QACxD,uCAAuC,EAAE,KAAK;QAC9C,4CAA4C,EAAE,KAAK;QACnD,mDAAmD,EAAE,KAAK;QAC1D,2CAA2C,EAAE,KAAK;QAClD,+CAA+C,EAAE,KAAK;QACtD,kCAAkC,EAAE,KAAK;QACzC,2CAA2C,EAAE,KAAK;QAClD,kDAAkD,EAAE,KAAK;QACzD,iCAAiC,EAAE,KAAK;QACxC,+CAA+C,EAAE,KAAK;QACtD,gDAAgD,EAAE,KAAK;QACvD,mCAAmC,EAAE,KAAK;KAC3C;CAC6B,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/02/1add646a0524f4f7bf8bb8a5a3057498e631e25f3f7524b5efd1086bf890fdd520840d9e77edbc57b1d9326fe62ae6bfe4e9992d90fc89b6d2e62def9e3632 b/.pnpm-store/v3/files/02/1add646a0524f4f7bf8bb8a5a3057498e631e25f3f7524b5efd1086bf890fdd520840d9e77edbc57b1d9326fe62ae6bfe4e9992d90fc89b6d2e62def9e3632 new file mode 100644 index 00000000..ebd9f746 --- /dev/null +++ b/.pnpm-store/v3/files/02/1add646a0524f4f7bf8bb8a5a3057498e631e25f3f7524b5efd1086bf890fdd520840d9e77edbc57b1d9326fe62ae6bfe4e9992d90fc89b6d2e62def9e3632 @@ -0,0 +1,18 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var isNaN = require('../../helpers/isNaN'); + +// https://262.ecma-international.org/11.0/#sec-numeric-types-number-equal + +module.exports = function NumberEqual(x, y) { + if (typeof x !== 'number' || typeof y !== 'number') { + throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers'); + } + if (isNaN(x) || isNaN(y)) { + return false; + } + // shortcut for the actual spec mechanics + return x === y; +}; diff --git a/.pnpm-store/v3/files/02/35676d3e5ce3f1a2ea0a7d77c42e10c691351bd8d5ea783112492bcbbcbc37d0a2f84c1c926590948bee9a90f0e06a7f859d0cebfbddb0788c1b9fa81020a5 b/.pnpm-store/v3/files/02/35676d3e5ce3f1a2ea0a7d77c42e10c691351bd8d5ea783112492bcbbcbc37d0a2f84c1c926590948bee9a90f0e06a7f859d0cebfbddb0788c1b9fa81020a5 new file mode 100644 index 00000000..3a452db7 --- /dev/null +++ b/.pnpm-store/v3/files/02/35676d3e5ce3f1a2ea0a7d77c42e10c691351bd8d5ea783112492bcbbcbc37d0a2f84c1c926590948bee9a90f0e06a7f859d0cebfbddb0788c1b9fa81020a5 @@ -0,0 +1,43 @@ +import v8 from 'node:v8'; +import { c as createForksRpcOptions, u as unwrapForksConfig } from '../vendor/utils.GbToHGHI.js'; +import { r as runVmTests } from '../vendor/vm.jVxKtN5R.js'; +import '@vitest/utils'; +import 'node:vm'; +import 'node:url'; +import 'pathe'; +import '../chunks/runtime-console.Iloo9fIt.js'; +import 'node:stream'; +import 'node:console'; +import 'node:path'; +import '../vendor/date.Ns1pGd_X.js'; +import '../vendor/execute.TxmaEFIQ.js'; +import 'vite-node/client'; +import 'vite-node/utils'; +import '@vitest/utils/error'; +import '../path.js'; +import 'node:fs'; +import '../vendor/base.QYERqzkH.js'; +import 'node:module'; +import 'vite-node/constants'; +import '../vendor/index.rJjbcrrp.js'; +import 'std-env'; +import '@vitest/runner/utils'; +import '../vendor/global.CkGT_TMy.js'; + +class ForksVmWorker { + getRpcOptions() { + return createForksRpcOptions(v8); + } + async runTests(state) { + const exit = process.exit; + state.ctx.config = unwrapForksConfig(state.ctx.config); + try { + await runVmTests(state); + } finally { + process.exit = exit; + } + } +} +var vmForks = new ForksVmWorker(); + +export { vmForks as default }; diff --git a/.pnpm-store/v3/files/02/7a297ac3a3afa2633e0b9759962675a4a0cbd4a9d3e789d24a9f2d1536f4996cefc9313a09d163feffed805dafaec9379c8e35fd59fde175a96f95daf1c439 b/.pnpm-store/v3/files/02/7a297ac3a3afa2633e0b9759962675a4a0cbd4a9d3e789d24a9f2d1536f4996cefc9313a09d163feffed805dafaec9379c8e35fd59fde175a96f95daf1c439 new file mode 100644 index 00000000..9f6ef045 --- /dev/null +++ b/.pnpm-store/v3/files/02/7a297ac3a3afa2633e0b9759962675a4a0cbd4a9d3e789d24a9f2d1536f4996cefc9313a09d163feffed805dafaec9379c8e35fd59fde175a96f95daf1c439 @@ -0,0 +1,26 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); + +var isPropertyDescriptor = require('../helpers/records/property-descriptor'); + +// https://262.ecma-international.org/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor'); + } + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/.pnpm-store/v3/files/02/a1fb0b394225da8e15080a76a8a1ff39ff34c637e75da99991327391e842b078a21e7cd26d9cd8c215b9197ecbf4b0d5e1a00f61cd7dddabba141988dba699-index.json b/.pnpm-store/v3/files/02/a1fb0b394225da8e15080a76a8a1ff39ff34c637e75da99991327391e842b078a21e7cd26d9cd8c215b9197ecbf4b0d5e1a00f61cd7dddabba141988dba699-index.json new file mode 100644 index 00000000..ead9b00d --- /dev/null +++ b/.pnpm-store/v3/files/02/a1fb0b394225da8e15080a76a8a1ff39ff34c637e75da99991327391e842b078a21e7cd26d9cd8c215b9197ecbf4b0d5e1a00f61cd7dddabba141988dba699-index.json @@ -0,0 +1 @@ +{"files":{"LICENSE":{"checkedAt":1707939899662,"integrity":"sha512-GInyRqrY/WcEsmb+HJQ6uhNRw81tNJpZtUPo00y+TQLmY602jHr1AwX75EcW4kAQyXFP76hxIJTSHQ07r1bEGw==","mode":420,"size":1087},"examples/CodeSlot.astro":{"checkedAt":1707939899662,"integrity":"sha512-mFFAwvk/8zP5Hh1CcbsYpD7fEc82WSAwamYjBFnvw0D3RIz/9sVdNOM4BmGh4r+9FPNU6p8fcx90hTPLIa9fiw==","mode":420,"size":364},"lib/GhostRender.astro":{"checkedAt":1707939899662,"integrity":"sha512-5H4jzpNZ2ILkzmf07MJCHtwApW/PJ0zQ6Mp7fKIQ/I7fCpQ7+uVQ+Qij2cMpnV9B7ahAkuS2IV1Grx5G1yzQVg==","mode":420,"size":497},"examples/H1.astro":{"checkedAt":1707939899662,"integrity":"sha512-jKPDDoCmUbN/+YIkcoUlt8f71rWWL9VxCWTif9ti0R1QNYlEncUn9S+6wWM0g4E1bwKmEWHnCp+9dGdhV7Jotw==","mode":420,"size":49},"examples/H2.astro":{"checkedAt":1707939899662,"integrity":"sha512-HF+dUUo61+1ag1g5bcnjE2jpWOQuXOu0xHElhejHJadn1lbuS+4jinhf0qjaK88IA8KLkdseRar4RytqJEPmtg==","mode":420,"size":49},"examples/H3.astro":{"checkedAt":1707939899662,"integrity":"sha512-0eR80lOMPXZbikaPPPXhjZSxrG9pdm6UBXR18SbrgksL5FfXw7+8iJ9HuCT38F1E3MYyvthCTJBPiYSAVLdA+Q==","mode":420,"size":49},"examples/H4.astro":{"checkedAt":1707939899662,"integrity":"sha512-PaK4UIeHR5Ts5CE9o48EvPSj/wYkFyxhQIlnMmJt5vGH+CXJbfXqt8j8ovt+y9qZpxBI+DWQWV20kMeIxC9yTA==","mode":420,"size":49},"examples/H5.astro":{"checkedAt":1707939899663,"integrity":"sha512-fmbCFzobBy86M2gjuuh/Xj134r0T8MOyk/zm9cUl9laTIgi0RUD2eb+gL9F0gHWMEbje25PZ50u95tiWuH4qGw==","mode":420,"size":49},"examples/H6.astro":{"checkedAt":1707939899663,"integrity":"sha512-6JJ/nSxeLhzD7EQirqCXjphgK206nWBT8cg9cwUyaEf9q4Y86KmqDHSCdyqOr9W4sDAUZMk9bDUeJWiRbhb0Gg==","mode":420,"size":49},"examples/Paragraph.astro":{"checkedAt":1707939899663,"integrity":"sha512-2ahTCmMr3AERzFTnKvlMgHP1qBwos+zctWhxWv/ZsJFA8q/TmCyD69vEneG//WUTKwOjKj8QDhskjg751897vQ==","mode":420,"size":366},"package.json":{"checkedAt":1707939899663,"integrity":"sha512-vfKVLmuQexiWlHoMhrjZBWDrJONabtdrPeMPglyNAuSWJAGZ67XNclWVfRzsogDUKAcjigAvvwG0HHgLPt28iA==","mode":420,"size":1031},"CHANGELOG.md":{"checkedAt":1707939899663,"integrity":"sha512-ozriQHiqHVPlTK5y7Uy7xUGZCnSVCGMhwuNYzIjCyQvqdN87ss8St2I4nYF5lYWf42MGS4r/IG057ESjXoD3fw==","mode":420,"size":159},"README.md":{"checkedAt":1707939899663,"integrity":"sha512-nA2Lo9F3nEo02w6nAmKfg3EzsWigpqh0xJ/RyiNdQhxWKG8wblFxz+HUbjLQ3Lz2u+ba/B3So0pavudovZp8Ig==","mode":420,"size":1008},"lib/env.d.ts":{"checkedAt":1707939899663,"integrity":"sha512-8Oak+OsQcW+0dU26weIgLtqUdFcycChdJNo4dZQ3AwUicaR3BijguysCOAO04CEBOssYIk7woPsHoTrao2cUKg==","mode":420,"size":39},"examples/index.ts":{"checkedAt":1707939899663,"integrity":"sha512-998vQt+NOtEpOi0qIyFjv3uxWiOOy7LiYq2lomp0JNyrD2CIaA1swQNR1hI9LN0UMqDxvpU5XWiHS9+Wd7UWgQ==","mode":420,"size":369},"index.ts":{"checkedAt":1707939899664,"integrity":"sha512-95bU6HJzZnB9QDH8IQfOnksHI0CGszESpJ9lIl+fN19Sep2OB6ZvjVft+DQVdRTkPrOccbU4DHeXhNRrvOuWag==","mode":420,"size":66},"lib/utils.ts":{"checkedAt":1707939899664,"integrity":"sha512-rJ06lktTaJshTMeyGxO6m+kSUR5m/Iw7ozaZ84CIooIouFpR5tXbJmmeCSnGiWpa5os5Iyoa1F19NVRCjajPyQ==","mode":420,"size":1782}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/02/e96b3984f0c6af88e4710f51ec322f460ad4ba68c84dd1939ddb7e6b6381cab6226f7d0c0eca80bddf5c5f8f465d767548e67b2e23c53540649ca6ba2bf994 b/.pnpm-store/v3/files/02/e96b3984f0c6af88e4710f51ec322f460ad4ba68c84dd1939ddb7e6b6381cab6226f7d0c0eca80bddf5c5f8f465d767548e67b2e23c53540649ca6ba2bf994 new file mode 100644 index 00000000..5423984a --- /dev/null +++ b/.pnpm-store/v3/files/02/e96b3984f0c6af88e4710f51ec322f460ad4ba68c84dd1939ddb7e6b6381cab6226f7d0c0eca80bddf5c5f8f465d767548e67b2e23c53540649ca6ba2bf994 @@ -0,0 +1,49 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var Call = require('./Call'); +var CompletionRecord = require('./CompletionRecord'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://262.ecma-international.org/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion) && !(completion instanceof CompletionRecord)) { + throw new $TypeError('Assertion failed: completion is not a thunk representing a Completion Record, nor a Completion Record instance'); + } + var completionThunk = completion instanceof CompletionRecord ? function () { return completion['?'](); } : completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/.pnpm-store/v3/files/02/f09b197f73c5bcc68e559d386b3de32e3f298daf039eb6436d3a607eaa9eaa784807b46fd8f50f59c4d5172adb129160fe8eade3be822a04c568be42b6555e b/.pnpm-store/v3/files/02/f09b197f73c5bcc68e559d386b3de32e3f298daf039eb6436d3a607eaa9eaa784807b46fd8f50f59c4d5172adb129160fe8eade3be822a04c568be42b6555e new file mode 100644 index 00000000..6b4d7ff9 --- /dev/null +++ b/.pnpm-store/v3/files/02/f09b197f73c5bcc68e559d386b3de32e3f298daf039eb6436d3a607eaa9eaa784807b46fd8f50f59c4d5172adb129160fe8eade3be822a04c568be42b6555e @@ -0,0 +1,93 @@ +{ + "name": "array-buffer-byte-length", + "version": "1.0.1", + "description": "Get the byte length of an ArrayBuffer, even in engines without a `.byteLength` method.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p .", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "keywords": [ + "shim", + "polyfill", + "ArrayBuffer", + "byteLength", + "byte", + "length", + "es-shim API", + "es-shims" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/array-buffer-byte-length.git" + }, + "bugs": { + "url": "https://github.com/inspect-js/array-buffer-byte-length/issues" + }, + "homepage": "https://github.com/inspect-js/array-buffer-byte-length#readme", + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "@types/call-bind": "^1.0.5", + "@types/es-value-fixtures": "^1.4.4", + "@types/for-each": "^0.3.3", + "@types/object-inspect": "^1.8.4", + "@types/tape": "^5.6.4", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "es-value-fixtures": "^1.4.2", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.1", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4", + "typescript": "^5.4.0-dev.20240202" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "testling": { + "files": "test/index.js" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/.pnpm-store/v3/files/02/ff8b6e0a61b80a747592206a64593327954b9257be20f9e963a71be8bb04df4f253f91c15ec036ce41b96eaf29e5f85dd5c6680f768109fd17c294bf9dbc7f b/.pnpm-store/v3/files/02/ff8b6e0a61b80a747592206a64593327954b9257be20f9e963a71be8bb04df4f253f91c15ec036ce41b96eaf29e5f85dd5c6680f768109fd17c294bf9dbc7f new file mode 100644 index 00000000..c421f3f9 --- /dev/null +++ b/.pnpm-store/v3/files/02/ff8b6e0a61b80a747592206a64593327954b9257be20f9e963a71be8bb04df4f253f91c15ec036ce41b96eaf29e5f85dd5c6680f768109fd17c294bf9dbc7f @@ -0,0 +1,247 @@ +import type { ClassicConfig, FlatConfig, SharedConfig } from './Config'; +import type { Parser } from './Parser'; +import type { Processor as ProcessorType } from './Processor'; +import type { AnyRuleCreateFunction, AnyRuleModule, RuleCreateFunction, RuleFix, RuleModule } from './Rule'; +import type { SourceCode } from './SourceCode'; +export type MinimalRuleModule = Partial, 'create'>> & Pick, 'create'>; +declare class LinterBase { + /** + * Initialize the Linter. + * @param config the config object + */ + constructor(config?: Linter.LinterOptions); + /** + * Define a new parser module + * @param parserId Name of the parser + * @param parserModule The parser object + */ + defineParser(parserId: string, parserModule: Parser.LooseParserModule): void; + /** + * Defines a new linting rule. + * @param ruleId A unique rule identifier + * @param ruleModule Function from context to object mapping AST node types to event handlers + */ + defineRule(ruleId: string, ruleModule: MinimalRuleModule | RuleCreateFunction): void; + /** + * Defines many new linting rules. + * @param rulesToDefine map from unique rule identifier to rule + */ + defineRules(rulesToDefine: Record | RuleCreateFunction>): void; + /** + * Gets an object with all loaded rules. + * @returns All loaded rules + */ + getRules(): Map>; + /** + * Gets the `SourceCode` object representing the parsed source. + * @returns The `SourceCode` object. + */ + getSourceCode(): SourceCode; + /** + * Verifies the text against the rules specified by the second argument. + * @param textOrSourceCode The text to parse or a SourceCode object. + * @param config An ESLintConfig instance to configure everything. + * @param filenameOrOptions The optional filename of the file being checked. + * If this is not set, the filename will default to '' in the rule context. + * If this is an object, then it has "filename", "allowInlineConfig", and some properties. + * @returns The results as an array of messages or an empty array if no messages. + */ + verify(textOrSourceCode: SourceCode | string, config: Linter.ConfigType, filenameOrOptions?: Linter.VerifyOptions | string): Linter.LintMessage[]; + /** + * Performs multiple autofix passes over the text until as many fixes as possible have been applied. + * @param code The source text to apply fixes to. + * @param config The ESLint config object to use. + * @param options The ESLint options object to use. + * @returns The result of the fix operation as returned from the SourceCodeFixer. + */ + verifyAndFix(code: string, config: Linter.ConfigType, options: Linter.FixOptions): Linter.FixReport; + /** + * The version from package.json. + */ + readonly version: string; + /** + * The version from package.json. + */ + static readonly version: string; +} +declare namespace Linter { + interface LinterOptions { + /** + * path to a directory that should be considered as the current working directory. + */ + cwd?: string; + } + type EnvironmentConfig = SharedConfig.EnvironmentConfig; + type GlobalsConfig = SharedConfig.GlobalsConfig; + type GlobalVariableOption = SharedConfig.GlobalVariableOption; + type GlobalVariableOptionBase = SharedConfig.GlobalVariableOptionBase; + type ParserOptions = SharedConfig.ParserOptions; + type PluginMeta = SharedConfig.PluginMeta; + type RuleEntry = SharedConfig.RuleEntry; + type RuleLevel = SharedConfig.RuleLevel; + type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions; + type RulesRecord = SharedConfig.RulesRecord; + type Severity = SharedConfig.Severity; + type SeverityString = SharedConfig.SeverityString; + /** @deprecated use Linter.ConfigType instead */ + type Config = ClassicConfig.Config; + type ConfigType = ClassicConfig.Config | FlatConfig.ConfigArray; + /** @deprecated use ClassicConfig.ConfigOverride instead */ + type ConfigOverride = ClassicConfig.ConfigOverride; + interface VerifyOptions { + /** + * Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied. + * Useful if you want to validate JS without comments overriding rules. + */ + allowInlineConfig?: boolean; + /** + * if `true` then the linter doesn't make `fix` properties into the lint result. + */ + disableFixes?: boolean; + /** + * the filename of the source code. + */ + filename?: string; + /** + * the predicate function that selects adopt code blocks. + */ + filterCodeBlock?: (filename: string, text: string) => boolean; + /** + * postprocessor for report messages. + * If provided, this should accept an array of the message lists + * for each code block returned from the preprocessor, apply a mapping to + * the messages as appropriate, and return a one-dimensional array of + * messages. + */ + postprocess?: ProcessorType.PostProcess; + /** + * preprocessor for source text. + * If provided, this should accept a string of source text, and return an array of code blocks to lint. + */ + preprocess?: ProcessorType.PreProcess; + /** + * Adds reported errors for unused `eslint-disable` directives. + */ + reportUnusedDisableDirectives?: SeverityString | boolean; + } + interface FixOptions extends VerifyOptions { + /** + * Determines whether fixes should be applied. + */ + fix?: boolean; + } + interface LintSuggestion { + desc: string; + fix: RuleFix; + messageId?: string; + } + interface LintMessage { + /** + * The 1-based column number. + */ + column: number; + /** + * The 1-based column number of the end location. + */ + endColumn?: number; + /** + * The 1-based line number of the end location. + */ + endLine?: number; + /** + * If `true` then this is a fatal error. + */ + fatal?: true; + /** + * Information for autofix. + */ + fix?: RuleFix; + /** + * The 1-based line number. + */ + line: number; + /** + * The error message. + */ + message: string; + messageId?: string; + nodeType: string; + /** + * The ID of the rule which makes this message. + */ + ruleId: string | null; + /** + * The severity of this message. + */ + severity: Severity; + source: string | null; + /** + * Information for suggestions + */ + suggestions?: LintSuggestion[]; + } + interface FixReport { + /** + * True, if the code was fixed + */ + fixed: boolean; + /** + * Fixed code text (might be the same as input if no fixes were applied). + */ + output: string; + /** + * Collection of all messages for the given code + */ + messages: LintMessage[]; + } + /** @deprecated use Parser.ParserModule */ + type ParserModule = Parser.LooseParserModule; + /** @deprecated use Parser.ParseResult */ + type ESLintParseResult = Parser.ParseResult; + /** @deprecated use Processor.ProcessorModule */ + type Processor = ProcessorType.ProcessorModule; + interface Environment { + /** + * The definition of global variables. + */ + globals?: GlobalsConfig; + /** + * The parser options that will be enabled under this environment. + */ + parserOptions?: ParserOptions; + } + type LegacyPluginRules = Record; + type PluginRules = Record; + interface Plugin { + /** + * The definition of plugin configs. + */ + configs?: Record; + /** + * The definition of plugin environments. + */ + environments?: Record; + /** + * Metadata about your plugin for easier debugging and more effective caching of plugins. + */ + meta?: PluginMeta; + /** + * The definition of plugin processors. + */ + processors?: Record; + /** + * The definition of plugin rules. + */ + rules?: LegacyPluginRules; + } +} +declare const Linter_base: typeof LinterBase; +/** + * The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it + * simply parses and reports on the code. In particular, the Linter object does not process configuration objects + * or files. + */ +declare class Linter extends Linter_base { +} +export { Linter }; +//# sourceMappingURL=Linter.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/03/02291ec7586cbe1596dce4da7123459796750bfc72443de4b841fb4f37a0f77189f73a13c8a0674031d0619a92795813e5d0d3c0b7aef7269147ad556077f6 b/.pnpm-store/v3/files/03/02291ec7586cbe1596dce4da7123459796750bfc72443de4b841fb4f37a0f77189f73a13c8a0674031d0619a92795813e5d0d3c0b7aef7269147ad556077f6 new file mode 100644 index 00000000..2e87da8f --- /dev/null +++ b/.pnpm-store/v3/files/03/02291ec7586cbe1596dce4da7123459796750bfc72443de4b841fb4f37a0f77189f73a13c8a0674031d0619a92795813e5d0d3c0b7aef7269147ad556077f6 @@ -0,0 +1,4 @@ +import type * as vscode from '@volar/language-service'; +import type { SharedContext } from '../types'; +export declare function register(ctx: SharedContext): (uri: string, position: vscode.Position) => vscode.DocumentHighlight[]; +//# sourceMappingURL=documentHighlight.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/03/110f28c5274b4f87469bf794cc75ba801b444ba968938d9e977736f7527a5452ae8ce70a18ebc8e2295b2d4357ab210af5e37e2179840dd12df3642466dc11 b/.pnpm-store/v3/files/03/110f28c5274b4f87469bf794cc75ba801b444ba968938d9e977736f7527a5452ae8ce70a18ebc8e2295b2d4357ab210af5e37e2179840dd12df3642466dc11 new file mode 100644 index 00000000..91e6fef1 --- /dev/null +++ b/.pnpm-store/v3/files/03/110f28c5274b4f87469bf794cc75ba801b444ba968938d9e977736f7527a5452ae8ce70a18ebc8e2295b2d4357ab210af5e37e2179840dd12df3642466dc11 @@ -0,0 +1,3 @@ +declare function hasOwn(o: T, p: PropertyKey): p is keyof T; + +export = hasOwn; \ No newline at end of file diff --git a/.pnpm-store/v3/files/03/ff5df5dc9453b97f23dd6cf2e2dc6ee217465a02013fed75cb6a835c47ef62b574c8d3acc3677a59ce2449db542a003bee74d9ccd4678fb09709923a9317f7 b/.pnpm-store/v3/files/03/ff5df5dc9453b97f23dd6cf2e2dc6ee217465a02013fed75cb6a835c47ef62b574c8d3acc3677a59ce2449db542a003bee74d9ccd4678fb09709923a9317f7 new file mode 100644 index 00000000..e693b41e --- /dev/null +++ b/.pnpm-store/v3/files/03/ff5df5dc9453b97f23dd6cf2e2dc6ee217465a02013fed75cb6a835c47ef62b574c8d3acc3677a59ce2449db542a003bee74d9ccd4678fb09709923a9317f7 @@ -0,0 +1 @@ +{"version":3,"file":"no-base-to-string.js","sourceRoot":"","sources":["../../src/rules/no-base-to-string.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/04/2535f96e69490fa6fce2bee66222381414a87ab8c568d995548d9e9122249b055155712deeb9bbe340595c603e1c0324d2ab6a6a078f0c8c69fe161e8d8d4b b/.pnpm-store/v3/files/04/2535f96e69490fa6fce2bee66222381414a87ab8c568d995548d9e9122249b055155712deeb9bbe340595c603e1c0324d2ab6a6a078f0c8c69fe161e8d8d4b new file mode 100644 index 00000000..a246d8a4 --- /dev/null +++ b/.pnpm-store/v3/files/04/2535f96e69490fa6fce2bee66222381414a87ab8c568d995548d9e9122249b055155712deeb9bbe340595c603e1c0324d2ab6a6a078f0c8c69fe161e8d8d4b @@ -0,0 +1,35 @@ +'use strict'; + +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); + +var whichTypedArray = require('which-typed-array'); +var availableTypedArrays = require('available-typed-arrays')(); + +var IsArray = require('./IsArray'); +var TypedArrayCreate = require('./TypedArrayCreate'); + +var getConstructor = require('../helpers/typedArrayConstructors'); + +// https://262.ecma-international.org/14.0/#sec-typedarray-create-same-type + +module.exports = function TypedArrayCreateSameType(exemplar, argumentList) { + if (availableTypedArrays.length === 0) { + throw new $SyntaxError('Assertion failed: Typed Arrays are not supported in this environment'); + } + + var kind = whichTypedArray(exemplar); + if (!kind) { + throw new $TypeError('Assertion failed: exemplar must be a TypedArray'); // step 1 + } + if (!IsArray(argumentList)) { + throw new $TypeError('Assertion failed: `argumentList` must be a List'); // step 1 + } + + var constructor = getConstructor(kind); // step 2 + if (typeof constructor !== 'function') { + throw new $SyntaxError('Assertion failed: `constructor` of `exemplar` (' + kind + ') must exist. Please report this!'); + } + + return TypedArrayCreate(constructor, argumentList); // steps 3 - 6 +}; diff --git a/.pnpm-store/v3/files/04/2b0ba07e08b87c7b34978fa9074646c8fba3c2c8856c8e0041b480575ea6d47452d9bf450f31b7a1d324be9fc21032bea11750ff488d8b9a6dbab4b111761c b/.pnpm-store/v3/files/04/2b0ba07e08b87c7b34978fa9074646c8fba3c2c8856c8e0041b480575ea6d47452d9bf450f31b7a1d324be9fc21032bea11750ff488d8b9a6dbab4b111761c new file mode 100644 index 00000000..b4354e2c --- /dev/null +++ b/.pnpm-store/v3/files/04/2b0ba07e08b87c7b34978fa9074646c8fba3c2c8856c8e0041b480575ea6d47452d9bf450f31b7a1d324be9fc21032bea11750ff488d8b9a6dbab4b111761c @@ -0,0 +1,126 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'consistent-indexed-object-style', + meta: { + type: 'suggestion', + docs: { + description: 'Require or disallow the `Record` type', + recommended: 'stylistic', + }, + messages: { + preferRecord: 'A record is preferred over an index signature.', + preferIndexSignature: 'An index signature is preferred over a record.', + }, + fixable: 'code', + schema: [ + { + type: 'string', + enum: ['record', 'index-signature'], + }, + ], + }, + defaultOptions: ['record'], + create(context, [mode]) { + function checkMembers(members, node, parentId, prefix, postfix, safeFix = true) { + if (members.length !== 1) { + return; + } + const [member] = members; + if (member.type !== utils_1.AST_NODE_TYPES.TSIndexSignature) { + return; + } + const parameter = member.parameters.at(0); + if (parameter?.type !== utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const keyType = parameter.typeAnnotation; + if (!keyType) { + return; + } + const valueType = member.typeAnnotation; + if (!valueType) { + return; + } + if (parentId) { + const scope = context.sourceCode.getScope(parentId); + const superVar = utils_1.ASTUtils.findVariable(scope, parentId.name); + if (superVar) { + const isCircular = superVar.references.some(item => item.isTypeReference && + node.range[0] <= item.identifier.range[0] && + node.range[1] >= item.identifier.range[1]); + if (isCircular) { + return; + } + } + } + context.report({ + node, + messageId: 'preferRecord', + fix: safeFix + ? (fixer) => { + const key = context.sourceCode.getText(keyType.typeAnnotation); + const value = context.sourceCode.getText(valueType.typeAnnotation); + const record = member.readonly + ? `Readonly>` + : `Record<${key}, ${value}>`; + return fixer.replaceText(node, `${prefix}${record}${postfix}`); + } + : null, + }); + } + return { + ...(mode === 'index-signature' && { + TSTypeReference(node) { + const typeName = node.typeName; + if (typeName.type !== utils_1.AST_NODE_TYPES.Identifier) { + return; + } + if (typeName.name !== 'Record') { + return; + } + const params = node.typeArguments?.params; + if (params?.length !== 2) { + return; + } + context.report({ + node, + messageId: 'preferIndexSignature', + fix(fixer) { + const key = context.sourceCode.getText(params[0]); + const type = context.sourceCode.getText(params[1]); + return fixer.replaceText(node, `{ [key: ${key}]: ${type} }`); + }, + }); + }, + }), + ...(mode === 'record' && { + TSTypeLiteral(node) { + const parent = findParentDeclaration(node); + checkMembers(node.members, node, parent?.id, '', ''); + }, + TSInterfaceDeclaration(node) { + let genericTypes = ''; + if (node.typeParameters?.params.length) { + genericTypes = `<${node.typeParameters.params + .map(p => context.sourceCode.getText(p)) + .join(', ')}>`; + } + checkMembers(node.body.body, node, node.id, `type ${node.id.name}${genericTypes} = `, ';', !node.extends.length); + }, + }), + }; + }, +}); +function findParentDeclaration(node) { + if (node.parent && node.parent.type !== utils_1.AST_NODE_TYPES.TSTypeAnnotation) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration) { + return node.parent; + } + return findParentDeclaration(node.parent); + } + return undefined; +} +//# sourceMappingURL=consistent-indexed-object-style.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/04/3618d1c65ec62f6818ee9534a6d50fa18c23750e7322cbe1c7182af698c42aa58442126352ff801fc14c78f6a12af957dc4d910bb0ee12568415ca141ece0f b/.pnpm-store/v3/files/04/3618d1c65ec62f6818ee9534a6d50fa18c23750e7322cbe1c7182af698c42aa58442126352ff801fc14c78f6a12af957dc4d910bb0ee12568415ca141ece0f new file mode 100644 index 00000000..bb361dea --- /dev/null +++ b/.pnpm-store/v3/files/04/3618d1c65ec62f6818ee9534a6d50fa18c23750e7322cbe1c7182af698c42aa58442126352ff801fc14c78f6a12af957dc4d910bb0ee12568415ca141ece0f @@ -0,0 +1,12 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +// https://262.ecma-international.org/11.0/#sec-binaryand + +module.exports = function BinaryAnd(x, y) { + if ((x !== 0 && x !== 1) || (y !== 0 && y !== 1)) { + throw new $TypeError('Assertion failed: `x` and `y` must be either 0 or 1'); + } + return x & y; +}; diff --git a/.pnpm-store/v3/files/04/50a568b12e473a5f17dc2b9a1f4a0d2e609911c686454deeabe6ead58f06f5313800d788dcfe873ad816f655a974d78478d2d04ae7d60df21e27e0bb4cec9b-index.json b/.pnpm-store/v3/files/04/50a568b12e473a5f17dc2b9a1f4a0d2e609911c686454deeabe6ead58f06f5313800d788dcfe873ad816f655a974d78478d2d04ae7d60df21e27e0bb4cec9b-index.json new file mode 100644 index 00000000..ea544290 --- /dev/null +++ b/.pnpm-store/v3/files/04/50a568b12e473a5f17dc2b9a1f4a0d2e609911c686454deeabe6ead58f06f5313800d788dcfe873ad816f655a974d78478d2d04ae7d60df21e27e0bb4cec9b-index.json @@ -0,0 +1 @@ +{"files":{"dist/bin.js":{"checkedAt":1707939899101,"integrity":"sha512-Rd4m8UeAB44vSqNKrzBCbLmoHiOKeVM3uCvAY7FTLVrjI57NvDXhkLJF8PBCVOGmFJ3rHqjLH7W7jH3kbpG0Fg==","mode":493,"size":363},"dist/index.js":{"checkedAt":1707939899101,"integrity":"sha512-ZtAl+Iv9Y39KBM2bAVBtgLPsd73O07SLuqeV83JzZTtNk0VZQxSrdTcbJAL+5NVHclxSjxLmwUcu7pq9MuX08w==","mode":420,"size":3990},"dist/options.js":{"checkedAt":1707939899101,"integrity":"sha512-pTJro//hT/se/BU4kjU6++dK0sA6bPVf28EbuSXblPg1zCeNSqd+lt3Cy03zDinooQBjV2QfOwbKxXb34fbAZg==","mode":420,"size":1346},"dist/bin.d.ts":{"checkedAt":1707939899101,"integrity":"sha512-TuHIj4w/TkzTTLbAAzm/nW0Db/St469J6HHMiWa4THKdi3VJKsxkE8mmZKwApXlYIjrBPEIp2oxi6+alPk94Pw==","mode":420,"size":11},"dist/index.d.ts":{"checkedAt":1707939899101,"integrity":"sha512-Hdyyxbwm8kCzaAIV9bRB3qlPn4peer4x2mmYYHXknKZ1PQGa5xUXcbECJj7l+E2KtKGqDOL78vpNkageFPpatQ==","mode":420,"size":927},"dist/options.d.ts":{"checkedAt":1707939899101,"integrity":"sha512-6/P7tfaYF3O8Sw2xCjWH+Axhg3MLNfpUBjmjF3zTdeReolpkCnDxFN7oL87Bhb/LYNh7npWZ0CNPfPTXcF1vzg==","mode":420,"size":1574},"LICENSE":{"checkedAt":1707939899101,"integrity":"sha512-ZGZL3q3cqWfh6/hM1VUk2uyHxv8yb6flHo+YPGjbtIsJlROJyfk5mnVwX1/Ms0hZKIqi7PwvPZ9MaOxaFDXq3w==","mode":420,"size":1085},"package.json":{"checkedAt":1707939899101,"integrity":"sha512-C0+5Ob/YAu3iIhm944jioYvkVV5ZIoDJBVyXVOriGvezaOprHnV7lOYHljcyqDKVJVfrM8rNZ1hAuvRJ/JL8Tg==","mode":420,"size":1047}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/04/ab856620c61edc97c8fc55969ffa1de864dec7b779c14547df7f0fa4b396fbb7d6e657c50d85347f5e0531657b983880ccec1742693da7fef7d10b7bb9373f b/.pnpm-store/v3/files/04/ab856620c61edc97c8fc55969ffa1de864dec7b779c14547df7f0fa4b396fbb7d6e657c50d85347f5e0531657b983880ccec1742693da7fef7d10b7bb9373f new file mode 100644 index 00000000..bb33ff94 --- /dev/null +++ b/.pnpm-store/v3/files/04/ab856620c61edc97c8fc55969ffa1de864dec7b779c14547df7f0fa4b396fbb7d6e657c50d85347f5e0531657b983880ccec1742693da7fef7d10b7bb9373f @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%', true); +var $gOPD = require('gopd'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://262.ecma-international.org/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/.pnpm-store/v3/files/04/c846d0e7890cbd15d2bcfc87d5fe2be619dfbb3f904c73524111e18aa372bd8a77b1094cc1ff466b1a411d95fb43ceba0b5a2843f52caf1fa02bd699e35384 b/.pnpm-store/v3/files/04/c846d0e7890cbd15d2bcfc87d5fe2be619dfbb3f904c73524111e18aa372bd8a77b1094cc1ff466b1a411d95fb43ceba0b5a2843f52caf1fa02bd699e35384 new file mode 100644 index 00000000..e57032fb --- /dev/null +++ b/.pnpm-store/v3/files/04/c846d0e7890cbd15d2bcfc87d5fe2be619dfbb3f904c73524111e18aa372bd8a77b1094cc1ff466b1a411d95fb43ceba0b5a2843f52caf1fa02bd699e35384 @@ -0,0 +1,36 @@ +import { defaultSplitRE, isValidSelector } from '@unocss/core'; + +const sourceMapRE = /\/\/#\s*sourceMappingURL=.*\n?/g; +function removeSourceMap(code) { + if (code.includes("sourceMappingURL=")) + return code.replace(sourceMapRE, ""); + return code; +} + +const quotedArbitraryValuesRE = /(?:[\w&:[\]-]|\[\S{1,64}=\S{1,64}\]){1,64}\[\\?['"]?\S{1,64}?['"]\]\]?[\w:-]{0,64}/g; +const arbitraryPropertyRE = /\[(\\\W|[\w-]){1,64}:[^\s:]{0,64}?("\S{1,64}?"|'\S{1,64}?'|`\S{1,64}?`|[^\s:]{1,64}?)[^\s:]{0,64}?\)?\]/g; +const arbitraryPropertyCandidateRE = /^\[(\\\W|[\w-]){1,64}:['"]?\S{1,64}?['"]?\]$/; +function splitCodeWithArbitraryVariants(code) { + const result = []; + for (const match of code.matchAll(arbitraryPropertyRE)) { + if (match.index !== 0 && !/^[\s'"`]/.test(code[match.index - 1] ?? "")) + continue; + result.push(match[0]); + } + for (const match of code.matchAll(quotedArbitraryValuesRE)) + result.push(match[0]); + code.split(defaultSplitRE).forEach((match) => { + if (isValidSelector(match) && !arbitraryPropertyCandidateRE.test(match)) + result.push(match); + }); + return result; +} +const extractorArbitraryVariants = { + name: "@unocss/extractor-arbitrary-variants", + order: 0, + extract({ code }) { + return splitCodeWithArbitraryVariants(removeSourceMap(code)); + } +}; + +export { arbitraryPropertyRE, extractorArbitraryVariants as default, extractorArbitraryVariants, quotedArbitraryValuesRE, splitCodeWithArbitraryVariants }; diff --git a/.pnpm-store/v3/files/05/13c39a10f9f772476a3e0f6f063f83b01fa3383b7615ec977b9b46e946430c8176bc5de188667694ef2f75504190a1b227b655b1ea9e20387092d4b85c90db b/.pnpm-store/v3/files/05/13c39a10f9f772476a3e0f6f063f83b01fa3383b7615ec977b9b46e946430c8176bc5de188667694ef2f75504190a1b227b655b1ea9e20387092d4b85c90db new file mode 100644 index 00000000..8450b1ac --- /dev/null +++ b/.pnpm-store/v3/files/05/13c39a10f9f772476a3e0f6f063f83b01fa3383b7615ec977b9b46e946430c8176bc5de188667694ef2f75504190a1b227b655b1ea9e20387092d4b85c90db @@ -0,0 +1,354 @@ +import { C as Colors } from './shared/preset-mini.hpPpX7ws.mjs'; +import '@unocss/core'; + +declare const colors: { + inherit: string; + current: string; + transparent: string; + black: string; + white: string; + rose: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + pink: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + fuchsia: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + purple: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + violet: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + indigo: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + blue: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + sky: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + cyan: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + teal: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + emerald: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + green: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + lime: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + yellow: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + amber: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + orange: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + red: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + gray: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + slate: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + zinc: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + neutral: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + stone: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + light: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + dark: { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + 950: string; + }; + readonly lightblue: string | (Colors & { + DEFAULT?: string | undefined; + }); + readonly lightBlue: string | (Colors & { + DEFAULT?: string | undefined; + }); + readonly warmgray: string | (Colors & { + DEFAULT?: string | undefined; + }); + readonly warmGray: string | (Colors & { + DEFAULT?: string | undefined; + }); + readonly truegray: string | (Colors & { + DEFAULT?: string | undefined; + }); + readonly trueGray: string | (Colors & { + DEFAULT?: string | undefined; + }); + readonly coolgray: string | (Colors & { + DEFAULT?: string | undefined; + }); + readonly coolGray: string | (Colors & { + DEFAULT?: string | undefined; + }); + readonly bluegray: string | (Colors & { + DEFAULT?: string | undefined; + }); + readonly blueGray: string | (Colors & { + DEFAULT?: string | undefined; + }); +}; + +export { colors }; diff --git a/.pnpm-store/v3/files/05/7bb57dda89a92b5af8228ccad1bb28a81667046e15196d70f247f36d545ec4dd55f0c9ebeae752761515d4cd12fb39f6782c25f849980483b2eb80d219a673 b/.pnpm-store/v3/files/05/7bb57dda89a92b5af8228ccad1bb28a81667046e15196d70f247f36d545ec4dd55f0c9ebeae752761515d4cd12fb39f6782c25f849980483b2eb80d219a673 new file mode 100644 index 00000000..be29b6f7 --- /dev/null +++ b/.pnpm-store/v3/files/05/7bb57dda89a92b5af8228ccad1bb28a81667046e15196d70f247f36d545ec4dd55f0c9ebeae752761515d4cd12fb39f6782c25f849980483b2eb80d219a673 @@ -0,0 +1,885 @@ +import limit from 'p-limit'; +import { getSafeTimers, createDefer, format, isObject, objDisplay, objectAttr, noop, toArray, shuffle } from '@vitest/utils'; +import { processError } from '@vitest/utils/error'; +export { processError } from '@vitest/utils/error'; +import { createChainable, generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, partitionSuiteChildren, hasTests, hasFailed } from './utils.js'; +import { relative } from 'pathe'; + +const fnMap = /* @__PURE__ */ new WeakMap(); +const fixtureMap = /* @__PURE__ */ new WeakMap(); +const hooksMap = /* @__PURE__ */ new WeakMap(); +function setFn(key, fn) { + fnMap.set(key, fn); +} +function getFn(key) { + return fnMap.get(key); +} +function setFixture(key, fixture) { + fixtureMap.set(key, fixture); +} +function getFixture(key) { + return fixtureMap.get(key); +} +function setHooks(key, hooks) { + hooksMap.set(key, hooks); +} +function getHooks(key) { + return hooksMap.get(key); +} + +class PendingError extends Error { + constructor(message, task) { + super(message); + this.message = message; + this.taskId = task.id; + } + code = "VITEST_PENDING"; + taskId; +} + +const collectorContext = { + tasks: [], + currentSuite: null +}; +function collectTask(task) { + var _a; + (_a = collectorContext.currentSuite) == null ? void 0 : _a.tasks.push(task); +} +async function runWithSuite(suite, fn) { + const prev = collectorContext.currentSuite; + collectorContext.currentSuite = suite; + await fn(); + collectorContext.currentSuite = prev; +} +function withTimeout(fn, timeout, isHook = false) { + if (timeout <= 0 || timeout === Number.POSITIVE_INFINITY) + return fn; + const { setTimeout, clearTimeout } = getSafeTimers(); + return (...args) => { + return Promise.race([fn(...args), new Promise((resolve, reject) => { + var _a; + const timer = setTimeout(() => { + clearTimeout(timer); + reject(new Error(makeTimeoutMsg(isHook, timeout))); + }, timeout); + (_a = timer.unref) == null ? void 0 : _a.call(timer); + })]); + }; +} +function createTestContext(test, runner) { + var _a; + const context = function() { + throw new Error("done() callback is deprecated, use promise instead"); + }; + context.task = test; + context.skip = () => { + test.pending = true; + throw new PendingError("test is skipped; abort execution", test); + }; + context.onTestFailed = (fn) => { + test.onFailed || (test.onFailed = []); + test.onFailed.push(fn); + }; + return ((_a = runner.extendTaskContext) == null ? void 0 : _a.call(runner, context)) || context; +} +function makeTimeoutMsg(isHook, timeout) { + return `${isHook ? "Hook" : "Test"} timed out in ${timeout}ms. +If this is a long-running ${isHook ? "hook" : "test"}, pass a timeout value as the last argument or configure it globally with "${isHook ? "hookTimeout" : "testTimeout"}".`; +} + +function mergeContextFixtures(fixtures, context = {}) { + const fixtureArray = Object.entries(fixtures).map(([prop, value], index) => { + const isFn = typeof value === "function"; + return { + prop, + value, + index, + isFn + }; + }); + if (Array.isArray(context.fixtures)) + context.fixtures = context.fixtures.concat(fixtureArray); + else + context.fixtures = fixtureArray; + fixtureArray.forEach((fixture) => { + if (fixture.isFn) { + const usedProps = getUsedProps(fixture.value); + if (usedProps.length) + fixture.deps = context.fixtures.filter(({ prop }) => prop !== fixture.prop && usedProps.includes(prop)); + } + }); + return context; +} +const fixtureValueMaps = /* @__PURE__ */ new Map(); +const cleanupFnArrayMap = /* @__PURE__ */ new Map(); +async function callFixtureCleanup(context) { + const cleanupFnArray = cleanupFnArrayMap.get(context) ?? []; + for (const cleanup of cleanupFnArray.reverse()) + await cleanup(); + cleanupFnArrayMap.delete(context); +} +function withFixtures(fn, testContext) { + return (hookContext) => { + const context = hookContext || testContext; + if (!context) + return fn({}); + const fixtures = getFixture(context); + if (!(fixtures == null ? void 0 : fixtures.length)) + return fn(context); + const usedProps = getUsedProps(fn); + if (!usedProps.length) + return fn(context); + if (!fixtureValueMaps.get(context)) + fixtureValueMaps.set(context, /* @__PURE__ */ new Map()); + const fixtureValueMap = fixtureValueMaps.get(context); + if (!cleanupFnArrayMap.has(context)) + cleanupFnArrayMap.set(context, []); + const cleanupFnArray = cleanupFnArrayMap.get(context); + const usedFixtures = fixtures.filter(({ prop }) => usedProps.includes(prop)); + const pendingFixtures = resolveDeps(usedFixtures); + if (!pendingFixtures.length) + return fn(context); + async function resolveFixtures() { + for (const fixture of pendingFixtures) { + if (fixtureValueMap.has(fixture)) + continue; + const resolvedValue = fixture.isFn ? await resolveFixtureFunction(fixture.value, context, cleanupFnArray) : fixture.value; + context[fixture.prop] = resolvedValue; + fixtureValueMap.set(fixture, resolvedValue); + cleanupFnArray.unshift(() => { + fixtureValueMap.delete(fixture); + }); + } + } + return resolveFixtures().then(() => fn(context)); + }; +} +async function resolveFixtureFunction(fixtureFn, context, cleanupFnArray) { + const useFnArgPromise = createDefer(); + let isUseFnArgResolved = false; + const fixtureReturn = fixtureFn(context, async (useFnArg) => { + isUseFnArgResolved = true; + useFnArgPromise.resolve(useFnArg); + const useReturnPromise = createDefer(); + cleanupFnArray.push(async () => { + useReturnPromise.resolve(); + await fixtureReturn; + }); + await useReturnPromise; + }).catch((e) => { + if (!isUseFnArgResolved) { + useFnArgPromise.reject(e); + return; + } + throw e; + }); + return useFnArgPromise; +} +function resolveDeps(fixtures, depSet = /* @__PURE__ */ new Set(), pendingFixtures = []) { + fixtures.forEach((fixture) => { + if (pendingFixtures.includes(fixture)) + return; + if (!fixture.isFn || !fixture.deps) { + pendingFixtures.push(fixture); + return; + } + if (depSet.has(fixture)) + throw new Error(`Circular fixture dependency detected: ${fixture.prop} <- ${[...depSet].reverse().map((d) => d.prop).join(" <- ")}`); + depSet.add(fixture); + resolveDeps(fixture.deps, depSet, pendingFixtures); + pendingFixtures.push(fixture); + depSet.clear(); + }); + return pendingFixtures; +} +function getUsedProps(fn) { + const match = fn.toString().match(/[^(]*\(([^)]*)/); + if (!match) + return []; + const args = splitByComma(match[1]); + if (!args.length) + return []; + const first = args[0]; + if (!(first.startsWith("{") && first.endsWith("}"))) + throw new Error(`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "${first}".`); + const _first = first.slice(1, -1).replace(/\s/g, ""); + const props = splitByComma(_first).map((prop) => { + return prop.replace(/\:.*|\=.*/g, ""); + }); + const last = props.at(-1); + if (last && last.startsWith("...")) + throw new Error(`Rest parameters are not supported in fixtures, received "${last}".`); + return props; +} +function splitByComma(s) { + const result = []; + const stack = []; + let start = 0; + for (let i = 0; i < s.length; i++) { + if (s[i] === "{" || s[i] === "[") { + stack.push(s[i] === "{" ? "}" : "]"); + } else if (s[i] === stack[stack.length - 1]) { + stack.pop(); + } else if (!stack.length && s[i] === ",") { + const token = s.substring(start, i).trim(); + if (token) + result.push(token); + start = i + 1; + } + } + const lastToken = s.substring(start).trim(); + if (lastToken) + result.push(lastToken); + return result; +} + +let _test; +function setCurrentTest(test) { + _test = test; +} +function getCurrentTest() { + return _test; +} + +const suite = createSuite(); +const test = createTest( + function(name, fn, options) { + if (getCurrentTest()) + throw new Error('Calling the test function inside another test function is not allowed. Please put it inside "describe" or "suite" so it can be properly collected.'); + getCurrentSuite().test.fn.call(this, formatName(name), fn, options); + } +); +const describe = suite; +const it = test; +let runner; +let defaultSuite; +function getDefaultSuite() { + return defaultSuite; +} +function getRunner() { + return runner; +} +function clearCollectorContext(currentRunner) { + if (!defaultSuite) + defaultSuite = currentRunner.config.sequence.shuffle ? suite.shuffle("") : currentRunner.config.sequence.concurrent ? suite.concurrent("") : suite(""); + runner = currentRunner; + collectorContext.tasks.length = 0; + defaultSuite.clear(); + collectorContext.currentSuite = defaultSuite; +} +function getCurrentSuite() { + return collectorContext.currentSuite || defaultSuite; +} +function createSuiteHooks() { + return { + beforeAll: [], + afterAll: [], + beforeEach: [], + afterEach: [] + }; +} +function createSuiteCollector(name, factory = () => { +}, mode, concurrent, sequential, shuffle, each, suiteOptions) { + const tasks = []; + const factoryQueue = []; + let suite2; + initSuite(); + const task = function(name2 = "", options = {}) { + const task2 = { + id: "", + name: name2, + suite: void 0, + each: options.each, + fails: options.fails, + context: void 0, + type: "custom", + retry: options.retry ?? runner.config.retry, + repeats: options.repeats, + mode: options.only ? "only" : options.skip ? "skip" : options.todo ? "todo" : "run", + meta: options.meta ?? /* @__PURE__ */ Object.create(null) + }; + const handler = options.handler; + if (options.concurrent || !options.sequential && runner.config.sequence.concurrent) + task2.concurrent = true; + if (shuffle) + task2.shuffle = true; + const context = createTestContext(task2, runner); + Object.defineProperty(task2, "context", { + value: context, + enumerable: false + }); + setFixture(context, options.fixtures); + if (handler) { + setFn(task2, withTimeout( + withFixtures(handler, context), + (options == null ? void 0 : options.timeout) ?? runner.config.testTimeout + )); + } + tasks.push(task2); + return task2; + }; + const test2 = createTest(function(name2, fn = noop, options = {}) { + if (typeof options === "number") + options = { timeout: options }; + if (typeof suiteOptions === "object") + options = Object.assign({}, suiteOptions, options); + options.concurrent = this.concurrent || !this.sequential && (options == null ? void 0 : options.concurrent); + options.sequential = this.sequential || !this.concurrent && (options == null ? void 0 : options.sequential); + const test3 = task( + formatName(name2), + { ...this, ...options, handler: fn } + ); + test3.type = "test"; + }); + const collector = { + type: "collector", + name, + mode, + options: suiteOptions, + test: test2, + tasks, + collect, + task, + clear, + on: addHook + }; + function addHook(name2, ...fn) { + getHooks(suite2)[name2].push(...fn); + } + function initSuite() { + if (typeof suiteOptions === "number") + suiteOptions = { timeout: suiteOptions }; + suite2 = { + id: "", + type: "suite", + name, + mode, + each, + shuffle, + tasks: [], + meta: /* @__PURE__ */ Object.create(null), + projectName: "" + }; + setHooks(suite2, createSuiteHooks()); + } + function clear() { + tasks.length = 0; + factoryQueue.length = 0; + initSuite(); + } + async function collect(file) { + factoryQueue.length = 0; + if (factory) + await runWithSuite(collector, () => factory(test2)); + const allChildren = []; + for (const i of [...factoryQueue, ...tasks]) + allChildren.push(i.type === "collector" ? await i.collect(file) : i); + suite2.file = file; + suite2.tasks = allChildren; + allChildren.forEach((task2) => { + task2.suite = suite2; + if (file) + task2.file = file; + }); + return suite2; + } + collectTask(collector); + return collector; +} +function createSuite() { + function suiteFn(name, factory, options = {}) { + const mode = this.only ? "only" : this.skip ? "skip" : this.todo ? "todo" : "run"; + const currentSuite = getCurrentSuite(); + if (typeof options === "number") + options = { timeout: options }; + if (currentSuite == null ? void 0 : currentSuite.options) + options = { ...currentSuite.options, ...options }; + options.concurrent = this.concurrent || !this.sequential && (options == null ? void 0 : options.concurrent); + options.sequential = this.sequential || !this.concurrent && (options == null ? void 0 : options.sequential); + return createSuiteCollector(formatName(name), factory, mode, this.concurrent, this.sequential, this.shuffle, this.each, options); + } + suiteFn.each = function(cases, ...args) { + const suite2 = this.withContext(); + this.setContext("each", true); + if (Array.isArray(cases) && args.length) + cases = formatTemplateString(cases, args); + return (name, fn, options) => { + const _name = formatName(name); + const arrayOnlyCases = cases.every(Array.isArray); + cases.forEach((i, idx) => { + const items = Array.isArray(i) ? i : [i]; + arrayOnlyCases ? suite2(formatTitle(_name, items, idx), () => fn(...items), options) : suite2(formatTitle(_name, items, idx), () => fn(i), options); + }); + this.setContext("each", void 0); + }; + }; + suiteFn.skipIf = (condition) => condition ? suite.skip : suite; + suiteFn.runIf = (condition) => condition ? suite : suite.skip; + return createChainable( + ["concurrent", "sequential", "shuffle", "skip", "only", "todo"], + suiteFn + ); +} +function createTaskCollector(fn, context) { + const taskFn = fn; + taskFn.each = function(cases, ...args) { + const test2 = this.withContext(); + this.setContext("each", true); + if (Array.isArray(cases) && args.length) + cases = formatTemplateString(cases, args); + return (name, fn2, options) => { + const _name = formatName(name); + const arrayOnlyCases = cases.every(Array.isArray); + cases.forEach((i, idx) => { + const items = Array.isArray(i) ? i : [i]; + arrayOnlyCases ? test2(formatTitle(_name, items, idx), () => fn2(...items), options) : test2(formatTitle(_name, items, idx), () => fn2(i), options); + }); + this.setContext("each", void 0); + }; + }; + taskFn.skipIf = function(condition) { + return condition ? this.skip : this; + }; + taskFn.runIf = function(condition) { + return condition ? this : this.skip; + }; + taskFn.extend = function(fixtures) { + const _context = mergeContextFixtures(fixtures, context); + return createTest(function fn2(name, fn2, options) { + getCurrentSuite().test.fn.call(this, formatName(name), fn2, options); + }, _context); + }; + const _test = createChainable( + ["concurrent", "sequential", "skip", "only", "todo", "fails"], + taskFn + ); + if (context) + _test.mergeContext(context); + return _test; +} +function createTest(fn, context) { + return createTaskCollector(fn, context); +} +function formatName(name) { + return typeof name === "string" ? name : name instanceof Function ? name.name || "" : String(name); +} +function formatTitle(template, items, idx) { + if (template.includes("%#")) { + template = template.replace(/%%/g, "__vitest_escaped_%__").replace(/%#/g, `${idx}`).replace(/__vitest_escaped_%__/g, "%%"); + } + const count = template.split("%").length - 1; + let formatted = format(template, ...items.slice(0, count)); + if (isObject(items[0])) { + formatted = formatted.replace( + /\$([$\w_.]+)/g, + // https://github.com/chaijs/chai/pull/1490 + (_, key) => { + var _a, _b; + return objDisplay(objectAttr(items[0], key), { truncate: (_b = (_a = runner == null ? void 0 : runner.config) == null ? void 0 : _a.chaiConfig) == null ? void 0 : _b.truncateThreshold }); + } + ); + } + return formatted; +} +function formatTemplateString(cases, args) { + const header = cases.join("").trim().replace(/ /g, "").split("\n").map((i) => i.split("|"))[0]; + const res = []; + for (let i = 0; i < Math.floor(args.length / header.length); i++) { + const oneCase = {}; + for (let j = 0; j < header.length; j++) + oneCase[header[j]] = args[i * header.length + j]; + res.push(oneCase); + } + return res; +} + +async function runSetupFiles(config, runner) { + const files = toArray(config.setupFiles); + if (config.sequence.setupFiles === "parallel") { + await Promise.all( + files.map(async (fsPath) => { + await runner.importFile(fsPath, "setup"); + }) + ); + } else { + for (const fsPath of files) + await runner.importFile(fsPath, "setup"); + } +} + +const now$1 = Date.now; +async function collectTests(paths, runner) { + const files = []; + const config = runner.config; + for (const filepath of paths) { + const path = relative(config.root, filepath); + const file = { + id: generateHash(`${path}${config.name || ""}`), + name: path, + type: "suite", + mode: "run", + filepath, + tasks: [], + meta: /* @__PURE__ */ Object.create(null), + projectName: config.name + }; + clearCollectorContext(runner); + try { + const setupStart = now$1(); + await runSetupFiles(config, runner); + const collectStart = now$1(); + file.setupDuration = collectStart - setupStart; + await runner.importFile(filepath, "collect"); + const defaultTasks = await getDefaultSuite().collect(file); + setHooks(file, getHooks(defaultTasks)); + for (const c of [...defaultTasks.tasks, ...collectorContext.tasks]) { + if (c.type === "test") { + file.tasks.push(c); + } else if (c.type === "custom") { + file.tasks.push(c); + } else if (c.type === "suite") { + file.tasks.push(c); + } else if (c.type === "collector") { + const suite = await c.collect(file); + if (suite.name || suite.tasks.length) + file.tasks.push(suite); + } + } + file.collectDuration = now$1() - collectStart; + } catch (e) { + const error = processError(e); + file.result = { + state: "fail", + errors: [error] + }; + } + calculateSuiteHash(file); + const hasOnlyTasks = someTasksAreOnly(file); + interpretTaskModes(file, config.testNamePattern, hasOnlyTasks, false, config.allowOnly); + files.push(file); + } + return files; +} + +const now = Date.now; +function updateSuiteHookState(suite, name, state, runner) { + var _a; + if (!suite.result) + suite.result = { state: "run" }; + if (!((_a = suite.result) == null ? void 0 : _a.hooks)) + suite.result.hooks = {}; + const suiteHooks = suite.result.hooks; + if (suiteHooks) { + suiteHooks[name] = state; + updateTask(suite, runner); + } +} +function getSuiteHooks(suite, name, sequence) { + const hooks = getHooks(suite)[name]; + if (sequence === "stack" && (name === "afterAll" || name === "afterEach")) + return hooks.slice().reverse(); + return hooks; +} +async function callSuiteHook(suite, currentTask, name, runner, args) { + const sequence = runner.config.sequence.hooks; + const callbacks = []; + if (name === "beforeEach" && suite.suite) { + callbacks.push( + ...await callSuiteHook(suite.suite, currentTask, name, runner, args) + ); + } + updateSuiteHookState(currentTask, name, "run", runner); + const hooks = getSuiteHooks(suite, name, sequence); + if (sequence === "parallel") { + callbacks.push(...await Promise.all(hooks.map((fn) => fn(...args)))); + } else { + for (const hook of hooks) + callbacks.push(await hook(...args)); + } + updateSuiteHookState(currentTask, name, "pass", runner); + if (name === "afterEach" && suite.suite) { + callbacks.push( + ...await callSuiteHook(suite.suite, currentTask, name, runner, args) + ); + } + return callbacks; +} +const packs = /* @__PURE__ */ new Map(); +let updateTimer; +let previousUpdate; +function updateTask(task, runner) { + packs.set(task.id, [task.result, task.meta]); + const { clearTimeout, setTimeout } = getSafeTimers(); + clearTimeout(updateTimer); + updateTimer = setTimeout(() => { + previousUpdate = sendTasksUpdate(runner); + }, 10); +} +async function sendTasksUpdate(runner) { + var _a; + const { clearTimeout } = getSafeTimers(); + clearTimeout(updateTimer); + await previousUpdate; + if (packs.size) { + const taskPacks = Array.from(packs).map(([id, task]) => { + return [ + id, + task[0], + task[1] + ]; + }); + const p = (_a = runner.onTaskUpdate) == null ? void 0 : _a.call(runner, taskPacks); + packs.clear(); + return p; + } +} +async function callCleanupHooks(cleanups) { + await Promise.all(cleanups.map(async (fn) => { + if (typeof fn !== "function") + return; + await fn(); + })); +} +async function runTest(test, runner) { + var _a, _b, _c, _d, _e, _f, _g; + await ((_a = runner.onBeforeRunTask) == null ? void 0 : _a.call(runner, test)); + if (test.mode !== "run") + return; + if (((_b = test.result) == null ? void 0 : _b.state) === "fail") { + updateTask(test, runner); + return; + } + const start = now(); + test.result = { + state: "run", + startTime: start, + retryCount: 0 + }; + updateTask(test, runner); + setCurrentTest(test); + const repeats = test.repeats ?? 0; + for (let repeatCount = 0; repeatCount <= repeats; repeatCount++) { + const retry = test.retry ?? 0; + for (let retryCount = 0; retryCount <= retry; retryCount++) { + let beforeEachCleanups = []; + try { + await ((_c = runner.onBeforeTryTask) == null ? void 0 : _c.call(runner, test, { retry: retryCount, repeats: repeatCount })); + test.result.repeatCount = repeatCount; + beforeEachCleanups = await callSuiteHook(test.suite, test, "beforeEach", runner, [test.context, test.suite]); + if (runner.runTask) { + await runner.runTask(test); + } else { + const fn = getFn(test); + if (!fn) + throw new Error("Test function is not found. Did you add it using `setFn`?"); + await fn(); + } + if (test.promises) { + const result = await Promise.allSettled(test.promises); + const errors = result.map((r) => r.status === "rejected" ? r.reason : void 0).filter(Boolean); + if (errors.length) + throw errors; + } + await ((_d = runner.onAfterTryTask) == null ? void 0 : _d.call(runner, test, { retry: retryCount, repeats: repeatCount })); + if (test.result.state !== "fail") { + if (!test.repeats) + test.result.state = "pass"; + else if (test.repeats && retry === retryCount) + test.result.state = "pass"; + } + } catch (e) { + failTask(test.result, e, runner.config.diffOptions); + } + if (test.pending || ((_e = test.result) == null ? void 0 : _e.state) === "skip") { + test.mode = "skip"; + test.result = { state: "skip" }; + updateTask(test, runner); + setCurrentTest(void 0); + return; + } + try { + await callSuiteHook(test.suite, test, "afterEach", runner, [test.context, test.suite]); + await callCleanupHooks(beforeEachCleanups); + await callFixtureCleanup(test.context); + } catch (e) { + failTask(test.result, e, runner.config.diffOptions); + } + if (test.result.state === "pass") + break; + if (retryCount < retry) { + test.result.state = "run"; + test.result.retryCount = (test.result.retryCount ?? 0) + 1; + } + updateTask(test, runner); + } + } + if (test.result.state === "fail") + await Promise.all(((_f = test.onFailed) == null ? void 0 : _f.map((fn) => fn(test.result))) || []); + if (test.fails) { + if (test.result.state === "pass") { + const error = processError(new Error("Expect test to fail")); + test.result.state = "fail"; + test.result.errors = [error]; + } else { + test.result.state = "pass"; + test.result.errors = void 0; + } + } + setCurrentTest(void 0); + test.result.duration = now() - start; + await ((_g = runner.onAfterRunTask) == null ? void 0 : _g.call(runner, test)); + updateTask(test, runner); +} +function failTask(result, err, diffOptions) { + if (err instanceof PendingError) { + result.state = "skip"; + return; + } + result.state = "fail"; + const errors = Array.isArray(err) ? err : [err]; + for (const e of errors) { + const error = processError(e, diffOptions); + result.errors ?? (result.errors = []); + result.errors.push(error); + } +} +function markTasksAsSkipped(suite, runner) { + suite.tasks.forEach((t) => { + t.mode = "skip"; + t.result = { ...t.result, state: "skip" }; + updateTask(t, runner); + if (t.type === "suite") + markTasksAsSkipped(t, runner); + }); +} +async function runSuite(suite, runner) { + var _a, _b, _c, _d; + await ((_a = runner.onBeforeRunSuite) == null ? void 0 : _a.call(runner, suite)); + if (((_b = suite.result) == null ? void 0 : _b.state) === "fail") { + markTasksAsSkipped(suite, runner); + updateTask(suite, runner); + return; + } + const start = now(); + suite.result = { + state: "run", + startTime: start + }; + updateTask(suite, runner); + let beforeAllCleanups = []; + if (suite.mode === "skip") { + suite.result.state = "skip"; + } else if (suite.mode === "todo") { + suite.result.state = "todo"; + } else { + try { + beforeAllCleanups = await callSuiteHook(suite, suite, "beforeAll", runner, [suite]); + if (runner.runSuite) { + await runner.runSuite(suite); + } else { + for (let tasksGroup of partitionSuiteChildren(suite)) { + if (tasksGroup[0].concurrent === true) { + const mutex = limit(runner.config.maxConcurrency); + await Promise.all(tasksGroup.map((c) => mutex(() => runSuiteChild(c, runner)))); + } else { + const { sequence } = runner.config; + if (sequence.shuffle || suite.shuffle) { + const suites = tasksGroup.filter((group) => group.type === "suite"); + const tests = tasksGroup.filter((group) => group.type === "test"); + const groups = shuffle([suites, tests], sequence.seed); + tasksGroup = groups.flatMap((group) => shuffle(group, sequence.seed)); + } + for (const c of tasksGroup) + await runSuiteChild(c, runner); + } + } + } + } catch (e) { + failTask(suite.result, e, runner.config.diffOptions); + } + try { + await callSuiteHook(suite, suite, "afterAll", runner, [suite]); + await callCleanupHooks(beforeAllCleanups); + } catch (e) { + failTask(suite.result, e, runner.config.diffOptions); + } + if (suite.mode === "run") { + if (!runner.config.passWithNoTests && !hasTests(suite)) { + suite.result.state = "fail"; + if (!((_c = suite.result.errors) == null ? void 0 : _c.length)) { + const error = processError(new Error(`No test found in suite ${suite.name}`)); + suite.result.errors = [error]; + } + } else if (hasFailed(suite)) { + suite.result.state = "fail"; + } else { + suite.result.state = "pass"; + } + } + updateTask(suite, runner); + suite.result.duration = now() - start; + await ((_d = runner.onAfterRunSuite) == null ? void 0 : _d.call(runner, suite)); + } +} +async function runSuiteChild(c, runner) { + if (c.type === "test" || c.type === "custom") + return runTest(c, runner); + else if (c.type === "suite") + return runSuite(c, runner); +} +async function runFiles(files, runner) { + var _a, _b; + for (const file of files) { + if (!file.tasks.length && !runner.config.passWithNoTests) { + if (!((_b = (_a = file.result) == null ? void 0 : _a.errors) == null ? void 0 : _b.length)) { + const error = processError(new Error(`No test suite found in file ${file.filepath}`)); + file.result = { + state: "fail", + errors: [error] + }; + } + } + await runSuite(file, runner); + } +} +async function startTests(paths, runner) { + var _a, _b, _c, _d; + await ((_a = runner.onBeforeCollect) == null ? void 0 : _a.call(runner, paths)); + const files = await collectTests(paths, runner); + (_b = runner.onCollected) == null ? void 0 : _b.call(runner, files); + await ((_c = runner.onBeforeRunFiles) == null ? void 0 : _c.call(runner, files)); + await runFiles(files, runner); + await ((_d = runner.onAfterRunFiles) == null ? void 0 : _d.call(runner, files)); + await sendTasksUpdate(runner); + return files; +} + +function getDefaultHookTimeout() { + return getRunner().config.hookTimeout; +} +function beforeAll(fn, timeout) { + return getCurrentSuite().on("beforeAll", withTimeout(fn, timeout ?? getDefaultHookTimeout(), true)); +} +function afterAll(fn, timeout) { + return getCurrentSuite().on("afterAll", withTimeout(fn, timeout ?? getDefaultHookTimeout(), true)); +} +function beforeEach(fn, timeout) { + return getCurrentSuite().on("beforeEach", withTimeout(withFixtures(fn), timeout ?? getDefaultHookTimeout(), true)); +} +function afterEach(fn, timeout) { + return getCurrentSuite().on("afterEach", withTimeout(withFixtures(fn), timeout ?? getDefaultHookTimeout(), true)); +} +const onTestFailed = createTestHook("onTestFailed", (test, handler) => { + test.onFailed || (test.onFailed = []); + test.onFailed.push(handler); +}); +function createTestHook(name, handler) { + return (fn) => { + const current = getCurrentTest(); + if (!current) + throw new Error(`Hook ${name}() can only be called inside a test`); + handler(current, fn); + }; +} + +export { afterAll, afterEach, beforeAll, beforeEach, createTaskCollector, describe, getCurrentSuite, getCurrentTest, getFn, getHooks, it, onTestFailed, setFn, setHooks, startTests, suite, test, updateTask }; diff --git a/.pnpm-store/v3/files/05/886c5e76734becb19f68532c270f69437ab6d8957928c5209529e5326d18b54ff736c80af35d319b5c55777e9bd0a3378de566df018f403b94badeb6d7c8cd b/.pnpm-store/v3/files/05/886c5e76734becb19f68532c270f69437ab6d8957928c5209529e5326d18b54ff736c80af35d319b5c55777e9bd0a3378de566df018f403b94badeb6d7c8cd new file mode 100644 index 00000000..4a2f915e --- /dev/null +++ b/.pnpm-store/v3/files/05/886c5e76734becb19f68532c270f69437ab6d8957928c5209529e5326d18b54ff736c80af35d319b5c55777e9bd0a3378de566df018f403b94badeb6d7c8cd @@ -0,0 +1,55 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var Call = require('./Call'); +var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow'); +var Get = require('./Get'); +var HasProperty = require('./HasProperty'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); + +// https://262.ecma-international.org/10.0/#sec-flattenintoarray + +module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { + var mapperFunction; + if (arguments.length > 5) { + mapperFunction = arguments[5]; + } + + var targetIndex = start; + var sourceIndex = 0; + while (sourceIndex < sourceLen) { + var P = ToString(sourceIndex); + var exists = HasProperty(source, P); + if (exists === true) { + var element = Get(source, P); + if (typeof mapperFunction !== 'undefined') { + if (arguments.length <= 6) { + throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); + } + element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); + } + var shouldFlatten = false; + if (depth > 0) { + shouldFlatten = IsArray(element); + } + if (shouldFlatten) { + var elementLen = ToLength(Get(element, 'length')); + targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); + } else { + if (targetIndex >= MAX_SAFE_INTEGER) { + throw new $TypeError('index too large'); + } + CreateDataPropertyOrThrow(target, ToString(targetIndex), element); + targetIndex += 1; + } + } + sourceIndex += 1; + } + + return targetIndex; +}; diff --git a/.pnpm-store/v3/files/05/bc548a710ca0966aac7b128f56816b46e80819cddc1a179dfee3f480708f1a2cc465ce842bea987d8bf6b6897a669d68a8de551f1940b855ec03a1ca81edfd-index.json b/.pnpm-store/v3/files/05/bc548a710ca0966aac7b128f56816b46e80819cddc1a179dfee3f480708f1a2cc465ce842bea987d8bf6b6897a669d68a8de551f1940b855ec03a1ca81edfd-index.json new file mode 100644 index 00000000..a2cbf31c --- /dev/null +++ b/.pnpm-store/v3/files/05/bc548a710ca0966aac7b128f56816b46e80819cddc1a179dfee3f480708f1a2cc465ce842bea987d8bf6b6897a669d68a8de551f1940b855ec03a1ca81edfd-index.json @@ -0,0 +1 @@ +{"files":{"LICENSE":{"checkedAt":1707939899407,"integrity":"sha512-o7HEIFnimZVIAv9KTD/PP6FfDvz7SNoM2Tyqrp7XIlPMtKl8zX2zLmOOIbS4YIvXl2tcZX7YPsvHpuGTYVMULQ==","mode":420,"size":1076},"lib/binarySearch.js":{"checkedAt":1707939899407,"integrity":"sha512-0ns4SJYmKiHuJy/p8c8m5IF0Zc8hWmVubRNeMr3T3Ocaa5tO7xoKWD1o6GQkQjZt2gM7uwyj3+6ZBMM9znWL/A==","mode":420,"size":893},"lib/buildMappings.js":{"checkedAt":1707939899407,"integrity":"sha512-8tHJyUZfabyQhb39+1VYATtCwJGEPx/htVqXMRoqTXzZbqcpdWdVXf4aA3zwF3CdKV67ZxFTx074ml7/S6jXBw==","mode":420,"size":738},"lib/buildStacks.js":{"checkedAt":1707939899408,"integrity":"sha512-VzOlGQ0vBRJeRUwMnTl4PCcTiW+E56Y7P0mvzy80ppr1/+FAiXcbrWngg/KwN9C1GgRhCILD+o97ANyEViVN/g==","mode":420,"size":794},"index.js":{"checkedAt":1707939899408,"integrity":"sha512-lLgRF7j/PoLvi3iD6k7H7CgXdqFlJyoj3mr/800V9noIBuWu90pMG7VOJrg9mB2coezA6+Lf+ylbzRY/gWrdEA==","mode":420,"size":1055},"lib/sourceMap.js":{"checkedAt":1707939899408,"integrity":"sha512-T50lF7tWh3w/nTzRgo1t9/ajBd9p+KQczQAsb72zAlfMgXp3EPrxEq1kT+nJ4/qxHd3Fz6hSj9SSFWRAEtuedg==","mode":420,"size":3004},"lib/translateOffset.js":{"checkedAt":1707939899408,"integrity":"sha512-uB1DBHFEgWynur0DJzajM5PY9t2IlyIICGcKE7+cpci8d/5JA9ienc82NjUWFnylhpKgRm1D/q3ZhS0BC5aAWQ==","mode":420,"size":567},"package.json":{"checkedAt":1707939899408,"integrity":"sha512-tCj9IKxyvYyqM8SP+LEB1zNoYjHD2groCZGSZ0N2h/czwgW5VbK0SpGvrH4nvbRmhdX9iagKEwo1jFj50wriYQ==","mode":420,"size":350},"README.md":{"checkedAt":1707939899409,"integrity":"sha512-/RNgy8NNHSpBsNeaV13zvE2C042IGCZEMn1tnp/gfPcrJfj98wHYLcyyo4PMs8Huf8zwV/7FZUvaCnjImkCzvg==","mode":420,"size":1560},"lib/binarySearch.d.ts":{"checkedAt":1707939899409,"integrity":"sha512-2uu6bR7ML/m6ittqNAm6EpsbwVNCtb6Amu91Eo2jyDHtef13YDyP6yr44PNvf3FRCJ5vLILtobXPPmrL/lZSzw==","mode":420,"size":148},"lib/buildMappings.d.ts":{"checkedAt":1707939899409,"integrity":"sha512-U7bPec6LJdy2jVxW1L9FRZUZaUXdaQwDRbODvbGlEfHZZJFRxLNbDm8uk7fQAGPg7du5bRHnMr0uhPzv3xiUuw==","mode":420,"size":168},"lib/buildStacks.d.ts":{"checkedAt":1707939899409,"integrity":"sha512-708XCmunK0Eq6THAF9c30UmbGqA0MK+hk/9xUJsME7RUisO5pkOR1MaDeD9FtLIy6Sp1lKswYOOxdi1Ws55uzA==","mode":420,"size":225},"index.d.ts":{"checkedAt":1707939899409,"integrity":"sha512-e8ALSCgrBJeNpOd81IiYJfdfJIDmnysnvxjhoxBmqo7gPUTwnQyyvO4kpjmgu+qAZbrhmGj7Ty9JdPuwksaIwg==","mode":420,"size":175},"lib/sourceMap.d.ts":{"checkedAt":1707939899409,"integrity":"sha512-1FQXyTm1eU6wctJ6kOiA3lNhVCXIYTWuOBoh6S2tePh/DZkVXTMi2O9P9+Yy+TiNPBkQhRZwonQr3Ysw88YrfQ==","mode":420,"size":1022},"lib/translateOffset.d.ts":{"checkedAt":1707939899410,"integrity":"sha512-pAKimjAoTG8A5xvNb64uJxp5cvYZ06YRPj99ydkOBuX8Jjf69EuZInyd4BWMg9OPrweXoGeoPenwNTl6EJessA==","mode":420,"size":139}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/05/c2e3f92e06d48f843d63bb9c09e5b5eea00689576cafe3476b6184d7118b2e3d69571864dd2ff6671ba6dc1e76923356f66d7f90ae9c4296fe4c3e5025dd50 b/.pnpm-store/v3/files/05/c2e3f92e06d48f843d63bb9c09e5b5eea00689576cafe3476b6184d7118b2e3d69571864dd2ff6671ba6dc1e76923356f66d7f90ae9c4296fe4c3e5025dd50 new file mode 100644 index 00000000..545f6627 --- /dev/null +++ b/.pnpm-store/v3/files/05/c2e3f92e06d48f843d63bb9c09e5b5eea00689576cafe3476b6184d7118b2e3d69571864dd2ff6671ba6dc1e76923356f66d7f90ae9c4296fe4c3e5025dd50 @@ -0,0 +1,450 @@ +import { createRequire } from 'node:module'; +import { dirname } from 'node:path'; +import { pathToFileURL, fileURLToPath } from 'node:url'; +import vm from 'node:vm'; +import { resolve } from 'pathe'; +import createDebug from 'debug'; +import { createImportMetaEnvProxy, normalizeModuleId, slash, isInternalRequest, isNodeBuiltin, normalizeRequestId, toFilePath, cleanUrl, isPrimitive } from './utils.mjs'; +import { extractSourceMap } from './source-map.mjs'; +import 'node:fs'; + +const { setTimeout, clearTimeout } = globalThis; +const debugExecute = createDebug("vite-node:client:execute"); +const debugNative = createDebug("vite-node:client:native"); +const clientStub = { + injectQuery: (id) => id, + createHotContext: () => { + return { + accept: () => { + }, + prune: () => { + }, + dispose: () => { + }, + decline: () => { + }, + invalidate: () => { + }, + on: () => { + }, + send: () => { + } + }; + }, + updateStyle: () => { + }, + removeStyle: () => { + } +}; +const env = createImportMetaEnvProxy(); +const DEFAULT_REQUEST_STUBS = { + "/@vite/client": clientStub, + "@vite/client": clientStub +}; +class ModuleCacheMap extends Map { + normalizePath(fsPath) { + return normalizeModuleId(fsPath); + } + /** + * Assign partial data to the map + */ + update(fsPath, mod) { + fsPath = this.normalizePath(fsPath); + if (!super.has(fsPath)) + this.setByModuleId(fsPath, mod); + else + Object.assign(super.get(fsPath), mod); + return this; + } + setByModuleId(modulePath, mod) { + return super.set(modulePath, mod); + } + set(fsPath, mod) { + return this.setByModuleId(this.normalizePath(fsPath), mod); + } + getByModuleId(modulePath) { + if (!super.has(modulePath)) + this.setByModuleId(modulePath, {}); + const mod = super.get(modulePath); + if (!mod.imports) { + Object.assign(mod, { + imports: /* @__PURE__ */ new Set(), + importers: /* @__PURE__ */ new Set() + }); + } + return mod; + } + get(fsPath) { + return this.getByModuleId(this.normalizePath(fsPath)); + } + deleteByModuleId(modulePath) { + return super.delete(modulePath); + } + delete(fsPath) { + return this.deleteByModuleId(this.normalizePath(fsPath)); + } + invalidateModule(mod) { + var _a, _b; + delete mod.evaluated; + delete mod.resolving; + delete mod.promise; + delete mod.exports; + (_a = mod.importers) == null ? void 0 : _a.clear(); + (_b = mod.imports) == null ? void 0 : _b.clear(); + return true; + } + /** + * Invalidate modules that dependent on the given modules, up to the main entry + */ + invalidateDepTree(ids, invalidated = /* @__PURE__ */ new Set()) { + for (const _id of ids) { + const id = this.normalizePath(_id); + if (invalidated.has(id)) + continue; + invalidated.add(id); + const mod = super.get(id); + if (mod == null ? void 0 : mod.importers) + this.invalidateDepTree(mod.importers, invalidated); + super.delete(id); + } + return invalidated; + } + /** + * Invalidate dependency modules of the given modules, down to the bottom-level dependencies + */ + invalidateSubDepTree(ids, invalidated = /* @__PURE__ */ new Set()) { + for (const _id of ids) { + const id = this.normalizePath(_id); + if (invalidated.has(id)) + continue; + invalidated.add(id); + const subIds = Array.from(super.entries()).filter(([, mod]) => { + var _a; + return (_a = mod.importers) == null ? void 0 : _a.has(id); + }).map(([key]) => key); + subIds.length && this.invalidateSubDepTree(subIds, invalidated); + super.delete(id); + } + return invalidated; + } + /** + * Return parsed source map based on inlined source map of the module + */ + getSourceMap(id) { + const cache = this.get(id); + if (cache.map) + return cache.map; + const map = cache.code && extractSourceMap(cache.code); + if (map) { + cache.map = map; + return map; + } + return null; + } +} +class ViteNodeRunner { + constructor(options) { + this.options = options; + this.root = options.root ?? process.cwd(); + this.moduleCache = options.moduleCache ?? new ModuleCacheMap(); + this.debug = options.debug ?? (typeof process !== "undefined" ? !!process.env.VITE_NODE_DEBUG_RUNNER : false); + } + root; + debug; + /** + * Holds the cache of modules + * Keys of the map are filepaths, or plain package names + */ + moduleCache; + async executeFile(file) { + const url = `/@fs/${slash(resolve(file))}`; + return await this.cachedRequest(url, url, []); + } + async executeId(rawId) { + const [id, url] = await this.resolveUrl(rawId); + return await this.cachedRequest(id, url, []); + } + /** @internal */ + async cachedRequest(id, fsPath, callstack) { + const importee = callstack[callstack.length - 1]; + const mod = this.moduleCache.get(fsPath); + const { imports, importers } = mod; + if (importee) + importers.add(importee); + const getStack = () => `stack: +${[...callstack, fsPath].reverse().map((p) => ` - ${p}`).join("\n")}`; + if (callstack.includes(fsPath) || Array.from(imports.values()).some((i) => importers.has(i))) { + if (mod.exports) + return mod.exports; + } + let debugTimer; + if (this.debug) + debugTimer = setTimeout(() => console.warn(`[vite-node] module ${fsPath} takes over 2s to load. +${getStack()}`), 2e3); + try { + if (mod.promise) + return await mod.promise; + const promise = this.directRequest(id, fsPath, callstack); + Object.assign(mod, { promise, evaluated: false }); + return await promise; + } finally { + mod.evaluated = true; + if (debugTimer) + clearTimeout(debugTimer); + } + } + shouldResolveId(id, _importee) { + return !isInternalRequest(id) && !isNodeBuiltin(id) && !id.startsWith("data:"); + } + async _resolveUrl(id, importer) { + var _a, _b; + const dep = normalizeRequestId(id, this.options.base); + if (!this.shouldResolveId(dep)) + return [dep, dep]; + const { path, exists } = toFilePath(dep, this.root); + if (!this.options.resolveId || exists) + return [dep, path]; + const resolved = await this.options.resolveId(dep, importer); + if ((_b = (_a = resolved == null ? void 0 : resolved.meta) == null ? void 0 : _a["vite:alias"]) == null ? void 0 : _b.noResolved) { + const error = new Error( + `Cannot find module '${id}'${importer ? ` imported from '${importer}'` : ""}. + +- If you rely on tsconfig.json's "paths" to resolve modules, please install "vite-tsconfig-paths" plugin to handle module resolution. +- Make sure you don't have relative aliases in your Vitest config. Use absolute paths instead. Read more: https://vitest.dev/guide/common-errors` + ); + Object.defineProperty(error, "code", { value: "ERR_MODULE_NOT_FOUND", enumerable: true }); + Object.defineProperty(error, Symbol.for("vitest.error.not_found.data"), { value: { id: dep, importer }, enumerable: false }); + throw error; + } + const resolvedId = resolved ? normalizeRequestId(resolved.id, this.options.base) : dep; + return [resolvedId, resolvedId]; + } + async resolveUrl(id, importee) { + const resolveKey = `resolve:${id}`; + this.moduleCache.setByModuleId(resolveKey, { resolving: true }); + try { + return await this._resolveUrl(id, importee); + } finally { + this.moduleCache.deleteByModuleId(resolveKey); + } + } + /** @internal */ + async dependencyRequest(id, fsPath, callstack) { + return await this.cachedRequest(id, fsPath, callstack); + } + /** @internal */ + async directRequest(id, fsPath, _callstack) { + const moduleId = normalizeModuleId(fsPath); + const callstack = [..._callstack, moduleId]; + const mod = this.moduleCache.getByModuleId(moduleId); + const request = async (dep) => { + const [id2, depFsPath] = await this.resolveUrl(String(dep), fsPath); + const depMod = this.moduleCache.getByModuleId(depFsPath); + depMod.importers.add(moduleId); + mod.imports.add(depFsPath); + return this.dependencyRequest(id2, depFsPath, callstack); + }; + const requestStubs = this.options.requestStubs || DEFAULT_REQUEST_STUBS; + if (id in requestStubs) + return requestStubs[id]; + let { code: transformed, externalize } = await this.options.fetchModule(id); + if (externalize) { + debugNative(externalize); + const exports2 = await this.interopedImport(externalize); + mod.exports = exports2; + return exports2; + } + if (transformed == null) + throw new Error(`[vite-node] Failed to load "${id}" imported from ${callstack[callstack.length - 2]}`); + const { Object: Object2, Reflect: Reflect2, Symbol: Symbol2 } = this.getContextPrimitives(); + const modulePath = cleanUrl(moduleId); + const href = pathToFileURL(modulePath).href; + const __filename = fileURLToPath(href); + const __dirname = dirname(__filename); + const meta = { + url: href, + env, + filename: __filename, + dirname: __dirname + }; + const exports = Object2.create(null); + Object2.defineProperty(exports, Symbol2.toStringTag, { + value: "Module", + enumerable: false, + configurable: false + }); + const SYMBOL_NOT_DEFINED = Symbol2("not defined"); + let moduleExports = SYMBOL_NOT_DEFINED; + const cjsExports = new Proxy(exports, { + get: (target, p, receiver) => { + if (Reflect2.has(target, p)) + return Reflect2.get(target, p, receiver); + return Reflect2.get(Object2.prototype, p, receiver); + }, + getPrototypeOf: () => Object2.prototype, + set: (_, p, value) => { + if (p === "default" && this.shouldInterop(modulePath, { default: value }) && cjsExports !== value) { + exportAll(cjsExports, value); + exports.default = value; + return true; + } + if (!Reflect2.has(exports, "default")) + exports.default = {}; + if (moduleExports !== SYMBOL_NOT_DEFINED && isPrimitive(moduleExports)) { + defineExport(exports, p, () => void 0); + return true; + } + if (!isPrimitive(exports.default)) + exports.default[p] = value; + if (p !== "default") + defineExport(exports, p, () => value); + return true; + } + }); + Object2.assign(mod, { code: transformed, exports }); + const moduleProxy = { + set exports(value) { + exportAll(cjsExports, value); + exports.default = value; + moduleExports = value; + }, + get exports() { + return cjsExports; + } + }; + let hotContext; + if (this.options.createHotContext) { + Object2.defineProperty(meta, "hot", { + enumerable: true, + get: () => { + var _a, _b; + hotContext || (hotContext = (_b = (_a = this.options).createHotContext) == null ? void 0 : _b.call(_a, this, moduleId)); + return hotContext; + }, + set: (value) => { + hotContext = value; + } + }); + } + const context = this.prepareContext({ + // esm transformed by Vite + __vite_ssr_import__: request, + __vite_ssr_dynamic_import__: request, + __vite_ssr_exports__: exports, + __vite_ssr_exportAll__: (obj) => exportAll(exports, obj), + __vite_ssr_import_meta__: meta, + // cjs compact + require: createRequire(href), + exports: cjsExports, + module: moduleProxy, + __filename, + __dirname + }); + debugExecute(__filename); + if (transformed[0] === "#") + transformed = transformed.replace(/^\#\!.*/, (s) => " ".repeat(s.length)); + await this.runModule(context, transformed); + return exports; + } + getContextPrimitives() { + return { Object, Reflect, Symbol }; + } + async runModule(context, transformed) { + const codeDefinition = `'use strict';async (${Object.keys(context).join(",")})=>{{`; + const code = `${codeDefinition}${transformed} +}}`; + const options = { + filename: context.__filename, + lineOffset: 0, + columnOffset: -codeDefinition.length + }; + const fn = vm.runInThisContext(code, options); + await fn(...Object.values(context)); + } + prepareContext(context) { + return context; + } + /** + * Define if a module should be interop-ed + * This function mostly for the ability to override by subclass + */ + shouldInterop(path, mod) { + if (this.options.interopDefault === false) + return false; + return !path.endsWith(".mjs") && "default" in mod; + } + importExternalModule(path) { + return import(path); + } + /** + * Import a module and interop it + */ + async interopedImport(path) { + const importedModule = await this.importExternalModule(path); + if (!this.shouldInterop(path, importedModule)) + return importedModule; + const { mod, defaultExport } = interopModule(importedModule); + return new Proxy(mod, { + get(mod2, prop) { + if (prop === "default") + return defaultExport; + return mod2[prop] ?? (defaultExport == null ? void 0 : defaultExport[prop]); + }, + has(mod2, prop) { + if (prop === "default") + return defaultExport !== void 0; + return prop in mod2 || defaultExport && prop in defaultExport; + }, + getOwnPropertyDescriptor(mod2, prop) { + const descriptor = Reflect.getOwnPropertyDescriptor(mod2, prop); + if (descriptor) + return descriptor; + if (prop === "default" && defaultExport !== void 0) { + return { + value: defaultExport, + enumerable: true, + configurable: true + }; + } + } + }); + } +} +function interopModule(mod) { + if (isPrimitive(mod)) { + return { + mod: { default: mod }, + defaultExport: mod + }; + } + let defaultExport = "default" in mod ? mod.default : mod; + if (!isPrimitive(defaultExport) && "__esModule" in defaultExport) { + mod = defaultExport; + if ("default" in defaultExport) + defaultExport = defaultExport.default; + } + return { mod, defaultExport }; +} +function defineExport(exports, key, value) { + Object.defineProperty(exports, key, { + enumerable: true, + configurable: true, + get: value + }); +} +function exportAll(exports, sourceModule) { + if (exports === sourceModule) + return; + if (isPrimitive(sourceModule) || Array.isArray(sourceModule) || sourceModule instanceof Promise) + return; + for (const key in sourceModule) { + if (key !== "default") { + try { + defineExport(exports, key, () => sourceModule[key]); + } catch (_err) { + } + } + } +} + +export { DEFAULT_REQUEST_STUBS, ModuleCacheMap, ViteNodeRunner }; diff --git a/.pnpm-store/v3/files/05/c6f1f20625bd79f8078814c6eabb53dda55fa28317e636a7f473d2697912093438ebee89b86abe2e3b61d88b37f373c51664b541e98bbb48971537a6992171 b/.pnpm-store/v3/files/05/c6f1f20625bd79f8078814c6eabb53dda55fa28317e636a7f473d2697912093438ebee89b86abe2e3b61d88b37f373c51664b541e98bbb48971537a6992171 new file mode 100644 index 00000000..4116379d --- /dev/null +++ b/.pnpm-store/v3/files/05/c6f1f20625bd79f8078814c6eabb53dda55fa28317e636a7f473d2697912093438ebee89b86abe2e3b61d88b37f373c51664b541e98bbb48971537a6992171 @@ -0,0 +1,57 @@ +export { B as BaseSequencer, b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor/node.Zme77R4t.js'; +import 'pathe'; +import 'vite'; +import 'node:path'; +import 'node:url'; +import 'node:process'; +import 'node:fs'; +import './vendor/constants.i1PoEnhr.js'; +import './vendor/_commonjsHelpers.jjO7Zipk.js'; +import 'os'; +import 'path'; +import './vendor/index.xL8XjTLv.js'; +import 'util'; +import 'stream'; +import 'events'; +import 'fs'; +import 'picocolors'; +import 'vite-node/client'; +import '@vitest/snapshot/manager'; +import 'vite-node/server'; +import './vendor/index.rJjbcrrp.js'; +import 'std-env'; +import '@vitest/runner/utils'; +import '@vitest/utils'; +import './vendor/global.CkGT_TMy.js'; +import './vendor/coverage.E7sG1b3r.js'; +import './path.js'; +import 'node:v8'; +import 'node:os'; +import 'node:events'; +import 'tinypool'; +import './vendor/index.cAUulNDf.js'; +import './vendor/base.QYERqzkH.js'; +import 'node:worker_threads'; +import 'node:fs/promises'; +import 'node:perf_hooks'; +import 'execa'; +import '@vitest/utils/source-map'; +import 'module'; +import 'acorn-walk'; +import './vendor/reporters.cA9x-5v-.js'; +import './chunks/runtime-console.Iloo9fIt.js'; +import 'node:stream'; +import 'node:console'; +import './vendor/date.Ns1pGd_X.js'; +import './vendor/tasks.IknbGB2n.js'; +import 'node:module'; +import 'local-pkg'; +import 'node:crypto'; +import 'vite-node/utils'; +import 'assert'; +import 'magic-string'; +import '@vitest/utils/ast'; +import 'strip-literal'; +import './vendor/environments.sU0TD7wX.js'; +import 'node:readline'; +import 'readline'; diff --git a/.pnpm-store/v3/files/06/4f15a98a31f5a7012ab18d0b0a239923349e4633447b66ba7ece49f9f3f4536939bbc74a85f59a0112e479c1687c9ec6f767907a31017d0b08e37f10ea7e62 b/.pnpm-store/v3/files/06/4f15a98a31f5a7012ab18d0b0a239923349e4633447b66ba7ece49f9f3f4536939bbc74a85f59a0112e479c1687c9ec6f767907a31017d0b08e37f10ea7e62 new file mode 100644 index 00000000..5e7f84c5 --- /dev/null +++ b/.pnpm-store/v3/files/06/4f15a98a31f5a7012ab18d0b0a239923349e4633447b66ba7ece49f9f3f4536939bbc74a85f59a0112e479c1687c9ec6f767907a31017d0b08e37f10ea7e62 @@ -0,0 +1,83 @@ +import { Comparer, Comparison, SortedReadonlyArray } from "./corePublic"; +/** + * Iterates through `array` by index and performs the callback on each element of array until the callback + * returns a falsey value, then returns false. + * If no such value is found, the callback is applied to each element of array and `true` is returned. + */ +export declare function every(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean; +/** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */ +export declare function findIndex(array: readonly T[] | undefined, predicate: (element: T, index: number) => boolean, startIndex?: number): number; +export declare function indexOfAnyCharCode(text: string, charCodes: readonly number[], start?: number): number; +export declare function map(array: readonly T[], f: (x: T, i: number) => U): U[]; +export declare function map(array: readonly T[] | undefined, f: (x: T, i: number) => U): U[] | undefined; +/** + * Flattens an array containing a mix of array or non-array elements. + * + * @param array The array to flatten. + */ +export declare function flatten(array: T[][] | readonly (T | readonly T[] | undefined)[]): T[]; +/** + * Maps an array. If the mapped value is an array, it is spread into the result. + * + * @param array The array to map. + * @param mapfn The callback used to map the result into one or more values. + */ +export declare function flatMap(array: readonly T[] | undefined, mapfn: (x: T, i: number) => U | readonly U[] | undefined): readonly U[]; +export declare function some(array: readonly T[] | undefined): array is readonly T[]; +export declare function some(array: readonly T[] | undefined, predicate: (value: T) => boolean): boolean; +/** + * Returns a new sorted array. + */ +export declare function sort(array: readonly T[], comparer?: Comparer): SortedReadonlyArray; +/** + * Returns the last element of an array if non-empty, `undefined` otherwise. + */ +export declare function lastOrUndefined(array: readonly T[] | undefined): T | undefined; +export declare function last(array: readonly T[]): T; +/** + * Compare the equality of two strings using a case-sensitive ordinal comparison. + * + * Case-sensitive comparisons compare both strings one code-point at a time using the integer + * value of each code-point after applying `toUpperCase` to each string. We always map both + * strings to their upper-case form as some unicode characters do not properly round-trip to + * lowercase (such as `ẞ` (German sharp capital s)). + */ +export declare function equateStringsCaseInsensitive(a: string, b: string): boolean; +/** + * Compare the equality of two strings using a case-sensitive ordinal comparison. + * + * Case-sensitive comparisons compare both strings one code-point at a time using the + * integer value of each code-point. + */ +export declare function equateStringsCaseSensitive(a: string, b: string): boolean; +/** + * Compare two strings using a case-insensitive ordinal comparison. + * + * Ordinal comparisons are based on the difference between the unicode code points of both + * strings. Characters with multiple unicode representations are considered unequal. Ordinal + * comparisons provide predictable ordering, but place "a" after "B". + * + * Case-insensitive comparisons compare both strings one code-point at a time using the integer + * value of each code-point after applying `toUpperCase` to each string. We always map both + * strings to their upper-case form as some unicode characters do not properly round-trip to + * lowercase (such as `ẞ` (German sharp capital s)). + */ +declare function compareStringsCaseInsensitive(a: string, b: string): Comparison; +/** + * Compare two strings using a case-sensitive ordinal comparison. + * + * Ordinal comparisons are based on the difference between the unicode code points of both + * strings. Characters with multiple unicode representations are considered unequal. Ordinal + * comparisons provide predictable ordering, but place "a" after "B". + * + * Case-sensitive comparisons compare both strings one code-point at a time using the integer + * value of each code-point. + */ +export declare function compareStringsCaseSensitive(a: string | undefined, b: string | undefined): Comparison; +export declare function getStringComparer(ignoreCase?: boolean): typeof compareStringsCaseInsensitive; +export declare function endsWith(str: string, suffix: string): boolean; +export declare function stringContains(str: string, substring: string): boolean; +type GetCanonicalFileName = (fileName: string) => string; +export declare function createGetCanonicalFileName(useCaseSensitiveFileNames: boolean): GetCanonicalFileName; +export declare function startsWith(str: string, prefix: string): boolean; +export {}; diff --git a/.pnpm-store/v3/files/06/7ebd6d9c6cf03169d5ac719ec5600497358e1bc342db515a2a3891f720979621b7f372d732dde2ebbe9dd72d8a361b5b3884f927155119811434d96e450057 b/.pnpm-store/v3/files/06/7ebd6d9c6cf03169d5ac719ec5600497358e1bc342db515a2a3891f720979621b7f372d732dde2ebbe9dd72d8a361b5b3884f927155119811434d96e450057 new file mode 100644 index 00000000..f31dc798 --- /dev/null +++ b/.pnpm-store/v3/files/06/7ebd6d9c6cf03169d5ac719ec5600497358e1bc342db515a2a3891f720979621b7f372d732dde2ebbe9dd72d8a361b5b3884f927155119811434d96e450057 @@ -0,0 +1 @@ +{"version":3,"file":"ban-tslint-comment.js","sourceRoot":"","sources":["../../src/rules/ban-tslint-comment.ts"],"names":[],"mappings":";;AAAA,oDAA2D;AAE3D,kCAAqC;AAErC,eAAe;AACf,iHAAiH;AACjH,MAAM,oBAAoB,GACxB,2DAA2D,CAAC;AAE9D,MAAM,MAAM,GAAG,CACb,IAAY,EACZ,IAAkD,EAC1C,EAAE,CACV,IAAI,KAAK,uBAAe,CAAC,IAAI;IAC3B,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;IAC/B,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE1C,kBAAe,IAAA,iBAAU,EAAC;IACxB,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,2CAA2C;YACxD,WAAW,EAAE,WAAW;SACzB;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,uCAAuC;SACzD;QACD,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,MAAM;KAChB;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,OAAO,CAAC,EAAE;QAChB,OAAO;YACL,OAAO;gBACL,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;gBACrD,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBACnB,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;wBACvC,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE;4BACvC,IAAI,EAAE,CAAC;4BACP,SAAS,EAAE,iBAAiB;4BAC5B,GAAG,CAAC,KAAK;gCACP,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC;oCACpD,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;oCAC3D,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI;iCACvB,CAAC,CAAC;gCACH,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC;oCAClD,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM;oCACxB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI;iCACrB,CAAC,CAAC;gCACH,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,UAAU,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;4BACvD,CAAC;yBACF,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/06/80bd1ce4324a63460c33799de41234b1e716e247690ef34f7c33f0d37eb752590fc6a0279404ed23bdc5cbd5a33e23c14ef3c532a11d58798550189314206b b/.pnpm-store/v3/files/06/80bd1ce4324a63460c33799de41234b1e716e247690ef34f7c33f0d37eb752590fc6a0279404ed23bdc5cbd5a33e23c14ef3c532a11d58798550189314206b new file mode 100644 index 00000000..90967d66 --- /dev/null +++ b/.pnpm-store/v3/files/06/80bd1ce4324a63460c33799de41234b1e716e247690ef34f7c33f0d37eb752590fc6a0279404ed23bdc5cbd5a33e23c14ef3c532a11d58798550189314206b @@ -0,0 +1,15 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var BigIntLeftShift = require('./leftShift'); + +// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-signedRightShift + +module.exports = function BigIntSignedRightShift(x, y) { + if (typeof x !== 'bigint' || typeof y !== 'bigint') { + throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts'); + } + + return BigIntLeftShift(x, -y); +}; diff --git a/.pnpm-store/v3/files/06/a651295c46ff6548abdcaae4d0b55de455d120143b1e2d8a85be216be3b702c934dbabd68aa819f8d89177387909683a8e07815d9cd7fef63cfd0ec5041ab6 b/.pnpm-store/v3/files/06/a651295c46ff6548abdcaae4d0b55de455d120143b1e2d8a85be216be3b702c934dbabd68aa819f8d89177387909683a8e07815d9cd7fef63cfd0ec5041ab6 new file mode 100644 index 00000000..5d72b818 --- /dev/null +++ b/.pnpm-store/v3/files/06/a651295c46ff6548abdcaae4d0b55de455d120143b1e2d8a85be216be3b702c934dbabd68aa819f8d89177387909683a8e07815d9cd7fef63cfd0ec5041ab6 @@ -0,0 +1,776 @@ +'use strict'; + +const utilities = require('./preset-mini.UhMMbd34.cjs'); +const ruleUtils = require('@unocss/rule-utils'); +const core = require('@unocss/core'); + +const variantAria = { + name: "aria", + match(matcher, ctx) { + const variant = ruleUtils.variantGetParameter("aria-", matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest] = variant; + const aria = utilities.h.bracket(match) ?? ctx.theme.aria?.[match] ?? ""; + if (aria) { + return { + matcher: rest, + selector: (s) => `${s}[aria-${aria}]` + }; + } + } + } +}; + +function calcMaxWidthBySize(size) { + const value = size.match(/^-?[0-9]+\.?[0-9]*/)?.[0] || ""; + const unit = size.slice(value.length); + if (unit === "px") { + const maxWidth = Number.parseFloat(value) - 0.1; + return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`; + } + return `calc(${size} - 0.1px)`; +} +function variantBreakpoints() { + const regexCache = {}; + return { + name: "breakpoints", + match(matcher, context) { + const variantEntries = (utilities.resolveBreakpoints(context) ?? []).map(({ point, size }, idx) => [point, size, idx]); + for (const [point, size, idx] of variantEntries) { + if (!regexCache[point]) + regexCache[point] = new RegExp(`^((?:([al]t-|[<~]|max-))?${point}(?:${context.generator.config.separators.join("|")}))`); + const match = matcher.match(regexCache[point]); + if (!match) + continue; + const [, pre] = match; + const m = matcher.slice(pre.length); + if (m === "container") + continue; + const isLtPrefix = pre.startsWith("lt-") || pre.startsWith("<") || pre.startsWith("max-"); + const isAtPrefix = pre.startsWith("at-") || pre.startsWith("~"); + let order = 3e3; + if (isLtPrefix) { + order -= idx + 1; + return { + matcher: m, + handle: (input, next) => next({ + ...input, + parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (max-width: ${calcMaxWidthBySize(size)})`, + parentOrder: order + }) + }; + } + order += idx + 1; + if (isAtPrefix && idx < variantEntries.length - 1) { + return { + matcher: m, + handle: (input, next) => next({ + ...input, + parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size}) and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})`, + parentOrder: order + }) + }; + } + return { + matcher: m, + handle: (input, next) => next({ + ...input, + parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (min-width: ${size})`, + parentOrder: order + }) + }; + } + }, + multiPass: true, + autocomplete: "(at-|lt-|max-|)$breakpoints:" + }; +} + +function scopeMatcher(name, combinator) { + return { + name: `combinator:${name}`, + match(matcher, ctx) { + if (!matcher.startsWith(name)) + return; + const separators = ctx.generator.config.separators; + let body = ruleUtils.variantGetBracket(`${name}-`, matcher, separators); + if (!body) { + for (const separator of separators) { + if (matcher.startsWith(`${name}${separator}`)) { + body = ["", matcher.slice(name.length + separator.length)]; + break; + } + } + if (!body) + return; + } + let bracketValue = utilities.h.bracket(body[0]) ?? ""; + if (bracketValue === "") + bracketValue = "*"; + return { + matcher: body[1], + selector: (s) => `${s}${combinator}${bracketValue}` + }; + }, + multiPass: true + }; +} +const variantCombinators = [ + scopeMatcher("all", " "), + scopeMatcher("children", ">"), + scopeMatcher("next", "+"), + scopeMatcher("sibling", "+"), + scopeMatcher("siblings", "~") +]; + +const variantContainerQuery = { + name: "@", + match(matcher, ctx) { + if (matcher.startsWith("@container")) + return; + const variant = ruleUtils.variantGetParameter("@", matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest, label] = variant; + const unbracket = utilities.h.bracket(match); + let container; + if (unbracket) { + const minWidth = utilities.h.numberWithUnit(unbracket); + if (minWidth) + container = `(min-width: ${minWidth})`; + } else { + container = ctx.theme.containers?.[match] ?? ""; + } + if (container) { + core.warnOnce("The container query variant is experimental and may not follow semver."); + let order = 1e3 + Object.keys(ctx.theme.containers ?? {}).indexOf(match); + if (label) + order += 1e3; + return { + matcher: rest, + handle: (input, next) => next({ + ...input, + parent: `${input.parent ? `${input.parent} $$ ` : ""}@container${label ? ` ${label} ` : " "}${container}`, + parentOrder: order + }) + }; + } + } + }, + multiPass: true +}; + +function variantColorsMediaOrClass(options = {}) { + if (options?.dark === "class" || typeof options.dark === "object") { + const { dark = ".dark", light = ".light" } = typeof options.dark === "string" ? {} : options.dark; + return [ + ruleUtils.variantMatcher("dark", (input) => ({ prefix: `${dark} $$ ${input.prefix}` })), + ruleUtils.variantMatcher("light", (input) => ({ prefix: `${light} $$ ${input.prefix}` })) + ]; + } + return [ + ruleUtils.variantParentMatcher("dark", "@media (prefers-color-scheme: dark)"), + ruleUtils.variantParentMatcher("light", "@media (prefers-color-scheme: light)") + ]; +} + +const variantDataAttribute = { + name: "data", + match(matcher, ctx) { + const variant = ruleUtils.variantGetParameter("data-", matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest] = variant; + const dataAttribute = utilities.h.bracket(match) ?? ctx.theme.data?.[match] ?? ""; + if (dataAttribute) { + return { + matcher: rest, + selector: (s) => `${s}[data-${dataAttribute}]` + }; + } + } + } +}; +function taggedData(tagName) { + return { + name: `${tagName}-data`, + match(matcher, ctx) { + const variant = ruleUtils.variantGetParameter(`${tagName}-data-`, matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest] = variant; + const dataAttribute = utilities.h.bracket(match) ?? ctx.theme.data?.[match] ?? ""; + if (dataAttribute) { + return { + matcher: `${tagName}-[[data-${dataAttribute}]]:${rest}` + }; + } + } + } + }; +} +const variantTaggedDataAttributes = [ + taggedData("group"), + taggedData("peer"), + taggedData("parent"), + taggedData("previous") +]; + +const variantLanguageDirections = [ + ruleUtils.variantMatcher("rtl", (input) => ({ prefix: `[dir="rtl"] $$ ${input.prefix}` })), + ruleUtils.variantMatcher("ltr", (input) => ({ prefix: `[dir="ltr"] $$ ${input.prefix}` })) +]; + +const variantSelector = { + name: "selector", + match(matcher, ctx) { + const variant = ruleUtils.variantGetBracket("selector-", matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest] = variant; + const selector = utilities.h.bracket(match); + if (selector) { + return { + matcher: rest, + selector: () => selector + }; + } + } + } +}; +const variantCssLayer = { + name: "layer", + match(matcher, ctx) { + const variant = ruleUtils.variantGetParameter("layer-", matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest] = variant; + const layer = utilities.h.bracket(match) ?? match; + if (layer) { + return { + matcher: rest, + handle: (input, next) => next({ + ...input, + parent: `${input.parent ? `${input.parent} $$ ` : ""}@layer ${layer}` + }) + }; + } + } + } +}; +const variantInternalLayer = { + name: "uno-layer", + match(matcher, ctx) { + const variant = ruleUtils.variantGetParameter("uno-layer-", matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest] = variant; + const layer = utilities.h.bracket(match) ?? match; + if (layer) { + return { + matcher: rest, + layer + }; + } + } + } +}; +const variantScope = { + name: "scope", + match(matcher, ctx) { + const variant = ruleUtils.variantGetBracket("scope-", matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest] = variant; + const scope = utilities.h.bracket(match); + if (scope) { + return { + matcher: rest, + selector: (s) => `${scope} $$ ${s}` + }; + } + } + } +}; +const variantVariables = { + name: "variables", + match(matcher, ctx) { + if (!matcher.startsWith("[")) + return; + const [match, rest] = ruleUtils.getBracket(matcher, "[", "]") ?? []; + if (!(match && rest)) + return; + let newMatcher; + for (const separator of ctx.generator.config.separators) { + if (rest.startsWith(separator)) { + newMatcher = rest.slice(separator.length); + break; + } + } + if (newMatcher == null) + return; + const variant = utilities.h.bracket(match) ?? ""; + const useParent = variant.startsWith("@"); + if (!(useParent || variant.includes("&"))) + return; + return { + matcher: newMatcher, + handle(input, next) { + const updates = useParent ? { + parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}` + } : { + selector: variant.replace(/&/g, input.selector) + }; + return next({ + ...input, + ...updates + }); + } + }; + }, + multiPass: true +}; + +const anchoredNumberRE = /^-?[0-9.]+(?:[a-z]+|%)?$/; +const numberRE = /-?[0-9.]+(?:[a-z]+|%)?/; +const ignoreProps = [ + /\b(opacity|color|flex|backdrop-filter|^filter|transform)\b/ +]; +function negateMathFunction(value) { + const match = value.match(utilities.cssMathFnRE); + if (match) { + const [fnBody, rest] = ruleUtils.getStringComponent(`(${match[2]})${match[3]}`, "(", ")", " ") ?? []; + if (fnBody) + return `calc(${match[1]}${fnBody} * -1)${rest ? ` ${rest}` : ""}`; + } +} +const negateFunctionBodyRE = /\b(hue-rotate)\s*(\(.*)/; +function negateFunctionBody(value) { + const match = value.match(negateFunctionBodyRE); + if (match) { + const [fnBody, rest] = ruleUtils.getStringComponent(match[2], "(", ")", " ") ?? []; + if (fnBody) { + const body = anchoredNumberRE.test(fnBody.slice(1, -1)) ? fnBody.replace(numberRE, (i) => i.startsWith("-") ? i.slice(1) : `-${i}`) : `(calc(${fnBody} * -1))`; + return `${match[1]}${body}${rest ? ` ${rest}` : ""}`; + } + } +} +const variantNegative = { + name: "negative", + match(matcher) { + if (!matcher.startsWith("-")) + return; + return { + matcher: matcher.slice(1), + body: (body) => { + if (body.find((v) => v[0] === utilities.CONTROL_MINI_NO_NEGATIVE)) + return; + let changed = false; + body.forEach((v) => { + const value = v[1]?.toString(); + if (!value || value === "0") + return; + if (ignoreProps.some((i) => i.test(v[0]))) + return; + const negatedFn = negateMathFunction(value); + if (negatedFn) { + v[1] = negatedFn; + changed = true; + return; + } + const negatedBody = negateFunctionBody(value); + if (negatedBody) { + v[1] = negatedBody; + changed = true; + return; + } + if (anchoredNumberRE.test(value)) { + v[1] = value.replace(numberRE, (i) => i.startsWith("-") ? i.slice(1) : `-${i}`); + changed = true; + } + }); + if (changed) + return body; + return []; + } + }; + } +}; + +function variantImportant() { + let re; + return { + name: "important", + match(matcher, ctx) { + if (!re) + re = new RegExp(`^(important(?:${ctx.generator.config.separators.join("|")})|!)`); + let base; + const match = matcher.match(re); + if (match) + base = matcher.slice(match[0].length); + else if (matcher.endsWith("!")) + base = matcher.slice(0, -1); + if (base) { + return { + matcher: base, + body: (body) => { + body.forEach((v) => { + if (v[1]) + v[1] += " !important"; + }); + return body; + } + }; + } + } + }; +} + +const variantPrint = ruleUtils.variantParentMatcher("print", "@media print"); +const variantCustomMedia = { + name: "media", + match(matcher, ctx) { + const variant = ruleUtils.variantGetParameter("media-", matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest] = variant; + let media = utilities.h.bracket(match) ?? ""; + if (media === "") + media = ctx.theme.media?.[match] ?? ""; + if (media) { + return { + matcher: rest, + handle: (input, next) => next({ + ...input, + parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}` + }) + }; + } + } + }, + multiPass: true +}; + +const variantSupports = { + name: "supports", + match(matcher, ctx) { + const variant = ruleUtils.variantGetParameter("supports-", matcher, ctx.generator.config.separators); + if (variant) { + const [match, rest] = variant; + let supports = utilities.h.bracket(match) ?? ""; + if (supports === "") + supports = ctx.theme.supports?.[match] ?? ""; + if (supports) { + return { + matcher: rest, + handle: (input, next) => next({ + ...input, + parent: `${input.parent ? `${input.parent} $$ ` : ""}@supports ${supports}` + }) + }; + } + } + }, + multiPass: true +}; + +const PseudoClasses = Object.fromEntries([ + // pseudo elements part 1 + ["first-letter", "::first-letter"], + ["first-line", "::first-line"], + // location + "any-link", + "link", + "visited", + "target", + ["open", "[open]"], + // forms + "default", + "checked", + "indeterminate", + "placeholder-shown", + "autofill", + "optional", + "required", + "valid", + "invalid", + "user-valid", + "user-invalid", + "in-range", + "out-of-range", + "read-only", + "read-write", + // content + "empty", + // interactions + "focus-within", + "hover", + "focus", + "focus-visible", + "active", + "enabled", + "disabled", + // tree-structural + "root", + "empty", + ["even-of-type", ":nth-of-type(even)"], + ["even", ":nth-child(even)"], + ["odd-of-type", ":nth-of-type(odd)"], + ["odd", ":nth-child(odd)"], + "first-of-type", + ["first", ":first-child"], + "last-of-type", + ["last", ":last-child"], + "only-child", + "only-of-type", + // pseudo elements part 2 + ["backdrop-element", "::backdrop"], + ["placeholder", "::placeholder"], + ["before", "::before"], + ["after", "::after"], + ["selection", "::selection"], + ["marker", "::marker"], + ["file", "::file-selector-button"] +].map((key) => Array.isArray(key) ? key : [key, `:${key}`])); +const PseudoClassesKeys = Object.keys(PseudoClasses); +const PseudoClassesColon = Object.fromEntries([ + ["backdrop", "::backdrop"] +].map((key) => Array.isArray(key) ? key : [key, `:${key}`])); +const PseudoClassesColonKeys = Object.keys(PseudoClassesColon); +const PseudoClassFunctions = [ + "not", + "is", + "where", + "has" +]; +const PseudoClassesStr = Object.entries(PseudoClasses).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).sort((a, b) => b.length - a.length).join("|"); +const PseudoClassesColonStr = Object.entries(PseudoClassesColon).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).sort((a, b) => b.length - a.length).join("|"); +const PseudoClassFunctionsStr = PseudoClassFunctions.join("|"); +function taggedPseudoClassMatcher(tag, parent, combinator) { + const rawRE = new RegExp(`^(${core.escapeRegExp(parent)}:)(\\S+)${core.escapeRegExp(combinator)}\\1`); + let splitRE; + let pseudoRE; + let pseudoColonRE; + let pseudoVarRE; + const matchBracket = (input) => { + const body = ruleUtils.variantGetBracket(`${tag}-`, input, []); + if (!body) + return; + const [match, rest] = body; + const bracketValue = utilities.h.bracket(match); + if (bracketValue == null) + return; + const label = rest.split(splitRE, 1)?.[0] ?? ""; + const prefix = `${parent}${core.escapeSelector(label)}`; + return [ + label, + input.slice(input.length - (rest.length - label.length - 1)), + bracketValue.includes("&") ? bracketValue.replace(/&/g, prefix) : `${prefix}${bracketValue}` + ]; + }; + const matchPseudo = (input) => { + const match = input.match(pseudoRE) || input.match(pseudoColonRE); + if (!match) + return; + const [original, fn, pseudoKey] = match; + const label = match[3] ?? ""; + let pseudo = PseudoClasses[pseudoKey] || PseudoClassesColon[pseudoKey] || `:${pseudoKey}`; + if (fn) + pseudo = `:${fn}(${pseudo})`; + return [ + label, + input.slice(original.length), + `${parent}${core.escapeSelector(label)}${pseudo}`, + pseudoKey + ]; + }; + const matchPseudoVar = (input) => { + const match = input.match(pseudoVarRE); + if (!match) + return; + const [original, fn, pseudoValue] = match; + const label = match[3] ?? ""; + const pseudo = `:${fn}(${pseudoValue})`; + return [ + label, + input.slice(original.length), + `${parent}${core.escapeSelector(label)}${pseudo}` + ]; + }; + return { + name: `pseudo:${tag}`, + match(input, ctx) { + if (!(splitRE && pseudoRE && pseudoColonRE)) { + splitRE = new RegExp(`(?:${ctx.generator.config.separators.join("|")})`); + pseudoRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))(?:(/\\w+))?(?:${ctx.generator.config.separators.join("|")})`); + pseudoColonRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))(?:(/\\w+))?(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`); + pseudoVarRE = new RegExp(`^${tag}-(?:(${PseudoClassFunctionsStr})-)?\\[(.+)\\](?:(/\\w+))?(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`); + } + if (!input.startsWith(tag)) + return; + const result = matchBracket(input) || matchPseudo(input) || matchPseudoVar(input); + if (!result) + return; + const [label, matcher, prefix, pseudoName = ""] = result; + if (label !== "") + core.warnOnce("The labeled variant is experimental and may not follow semver."); + return { + matcher, + handle: (input2, next) => next({ + ...input2, + prefix: `${prefix}${combinator}${input2.prefix}`.replace(rawRE, "$1$2:"), + sort: PseudoClassesKeys.indexOf(pseudoName) ?? PseudoClassesColonKeys.indexOf(pseudoName) + }) + }; + }, + multiPass: true + }; +} +const excludedPseudo = [ + "::-webkit-resizer", + "::-webkit-scrollbar", + "::-webkit-scrollbar-button", + "::-webkit-scrollbar-corner", + "::-webkit-scrollbar-thumb", + "::-webkit-scrollbar-track", + "::-webkit-scrollbar-track-piece", + "::file-selector-button" +]; +const PseudoClassesAndElementsStr = Object.entries(PseudoClasses).map(([key]) => key).sort((a, b) => b.length - a.length).join("|"); +const PseudoClassesAndElementsColonStr = Object.entries(PseudoClassesColon).map(([key]) => key).sort((a, b) => b.length - a.length).join("|"); +function variantPseudoClassesAndElements() { + let PseudoClassesAndElementsRE; + let PseudoClassesAndElementsColonRE; + return { + name: "pseudo", + match(input, ctx) { + if (!(PseudoClassesAndElementsRE && PseudoClassesAndElementsRE)) { + PseudoClassesAndElementsRE = new RegExp(`^(${PseudoClassesAndElementsStr})(?:${ctx.generator.config.separators.join("|")})`); + PseudoClassesAndElementsColonRE = new RegExp(`^(${PseudoClassesAndElementsColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`); + } + const match = input.match(PseudoClassesAndElementsRE) || input.match(PseudoClassesAndElementsColonRE); + if (match) { + const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`; + let index = PseudoClassesKeys.indexOf(match[1]); + if (index === -1) + index = PseudoClassesColonKeys.indexOf(match[1]); + if (index === -1) + index = void 0; + return { + matcher: input.slice(match[0].length), + handle: (input2, next) => { + const selectors = pseudo.startsWith("::") && !excludedPseudo.includes(pseudo) ? { + pseudo: `${input2.pseudo}${pseudo}` + } : { + selector: `${input2.selector}${pseudo}` + }; + return next({ + ...input2, + ...selectors, + sort: index, + noMerge: true + }); + } + }; + } + }, + multiPass: true, + autocomplete: `(${PseudoClassesAndElementsStr}|${PseudoClassesAndElementsColonStr}):` + }; +} +function variantPseudoClassFunctions() { + let PseudoClassFunctionsRE; + let PseudoClassColonFunctionsRE; + let PseudoClassVarFunctionRE; + return { + match(input, ctx) { + if (!(PseudoClassFunctionsRE && PseudoClassColonFunctionsRE)) { + PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})(?:${ctx.generator.config.separators.join("|")})`); + PseudoClassColonFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`); + PseudoClassVarFunctionRE = new RegExp(`^(${PseudoClassFunctionsStr})-(\\[.+\\])(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`); + } + const match = input.match(PseudoClassFunctionsRE) || input.match(PseudoClassColonFunctionsRE) || input.match(PseudoClassVarFunctionRE); + if (match) { + const fn = match[1]; + const fnVal = ruleUtils.getBracket(match[2], "[", "]"); + const pseudo = fnVal ? utilities.h.bracket(match[2]) : PseudoClasses[match[2]] || PseudoClassesColon[match[2]] || `:${match[2]}`; + return { + matcher: input.slice(match[0].length), + selector: (s) => `${s}:${fn}(${pseudo})` + }; + } + }, + multiPass: true, + autocomplete: `(${PseudoClassFunctionsStr})-(${PseudoClassesStr}|${PseudoClassesColonStr}):` + }; +} +function variantTaggedPseudoClasses(options = {}) { + const attributify = !!options?.attributifyPseudo; + let firstPrefix = options?.prefix ?? ""; + firstPrefix = (Array.isArray(firstPrefix) ? firstPrefix : [firstPrefix]).filter(Boolean)[0] ?? ""; + const tagWithPrefix = (tag, combinator) => taggedPseudoClassMatcher(tag, attributify ? `[${firstPrefix}${tag}=""]` : `.${firstPrefix}${tag}`, combinator); + return [ + tagWithPrefix("group", " "), + tagWithPrefix("peer", "~"), + tagWithPrefix("parent", ">"), + tagWithPrefix("previous", "+") + ]; +} +const PartClassesRE = /(part-\[(.+)]:)(.+)/; +const variantPartClasses = { + match(input) { + const match = input.match(PartClassesRE); + if (match) { + const part = `part(${match[2]})`; + return { + matcher: input.slice(match[1].length), + selector: (s) => `${s}::${part}` + }; + } + }, + multiPass: true +}; + +function variants(options) { + return [ + variantAria, + variantDataAttribute, + variantCssLayer, + variantSelector, + variantInternalLayer, + variantNegative, + variantImportant(), + variantSupports, + variantPrint, + variantCustomMedia, + variantBreakpoints(), + ...variantCombinators, + variantPseudoClassesAndElements(), + variantPseudoClassFunctions(), + ...variantTaggedPseudoClasses(options), + variantPartClasses, + ...variantColorsMediaOrClass(options), + ...variantLanguageDirections, + variantScope, + variantContainerQuery, + variantVariables, + ...variantTaggedDataAttributes + ]; +} + +exports.calcMaxWidthBySize = calcMaxWidthBySize; +exports.variantAria = variantAria; +exports.variantBreakpoints = variantBreakpoints; +exports.variantColorsMediaOrClass = variantColorsMediaOrClass; +exports.variantCombinators = variantCombinators; +exports.variantContainerQuery = variantContainerQuery; +exports.variantCssLayer = variantCssLayer; +exports.variantCustomMedia = variantCustomMedia; +exports.variantDataAttribute = variantDataAttribute; +exports.variantImportant = variantImportant; +exports.variantInternalLayer = variantInternalLayer; +exports.variantLanguageDirections = variantLanguageDirections; +exports.variantNegative = variantNegative; +exports.variantPartClasses = variantPartClasses; +exports.variantPrint = variantPrint; +exports.variantPseudoClassFunctions = variantPseudoClassFunctions; +exports.variantPseudoClassesAndElements = variantPseudoClassesAndElements; +exports.variantScope = variantScope; +exports.variantSelector = variantSelector; +exports.variantSupports = variantSupports; +exports.variantTaggedDataAttributes = variantTaggedDataAttributes; +exports.variantTaggedPseudoClasses = variantTaggedPseudoClasses; +exports.variantVariables = variantVariables; +exports.variants = variants; diff --git a/.pnpm-store/v3/files/06/c98490ccc1c3f1a3fae8b99aa5dad62883f58e2b0eceb21d205d4adfbc558550ab42b8cf568ec9df6686e3687d09a5aa3339c7fb84b8efbb9ad857d502fd94 b/.pnpm-store/v3/files/06/c98490ccc1c3f1a3fae8b99aa5dad62883f58e2b0eceb21d205d4adfbc558550ab42b8cf568ec9df6686e3687d09a5aa3339c7fb84b8efbb9ad857d502fd94 new file mode 100644 index 00000000..b63aefcc --- /dev/null +++ b/.pnpm-store/v3/files/06/c98490ccc1c3f1a3fae8b99aa5dad62883f58e2b0eceb21d205d4adfbc558550ab42b8cf568ec9df6686e3687d09a5aa3339c7fb84b8efbb9ad857d502fd94 @@ -0,0 +1,70 @@ +{ + "name": "@typescript-eslint/scope-manager", + "version": "7.0.1", + "description": "TypeScript scope analyser for ESLint", + "files": [ + "dist", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/scope-manager" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "scripts": { + "build": "npx nx build", + "clean": "npx nx clean", + "clean-fixtures": "npx nx clean-fixtures", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "generate-lib": "npx nx generate-lib", + "lint": "npx nx lint", + "test": "npx nx test --code-coverage", + "typecheck": "npx nx typecheck" + }, + "dependencies": { + "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/visitor-keys": "7.0.1" + }, + "devDependencies": { + "@types/glob": "*", + "@typescript-eslint/typescript-estree": "7.0.1", + "glob": "*", + "jest-specific-snapshot": "*", + "make-dir": "*", + "pretty-format": "*", + "typescript": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<4.7": { + "*": [ + "_ts4.3/*" + ] + } + } +} diff --git a/.pnpm-store/v3/files/07/558ccdd0d7d98946cb4938cef38adc025c606c1e4dce4dc0cd24c6d42280944f2b5ab2e906c0cf0d3e0464f5b31ea15cae8331acc85c4267cb7a373a7da8f2 b/.pnpm-store/v3/files/07/558ccdd0d7d98946cb4938cef38adc025c606c1e4dce4dc0cd24c6d42280944f2b5ab2e906c0cf0d3e0464f5b31ea15cae8331acc85c4267cb7a373a7da8f2 new file mode 100644 index 00000000..7911c022 --- /dev/null +++ b/.pnpm-store/v3/files/07/558ccdd0d7d98946cb4938cef38adc025c606c1e4dce4dc0cd24c6d42280944f2b5ab2e906c0cf0d3e0464f5b31ea15cae8331acc85c4267cb7a373a7da8f2 @@ -0,0 +1,6 @@ +import type * as vscode from '@volar/language-service'; +import type * as ts from 'typescript'; +import type { SharedContext } from '../types'; +export declare function register(ctx: SharedContext): (uri: string, position: vscode.Position, newName: string) => Promise; +export declare function fileTextChangesToWorkspaceEdit(changes: readonly ts.FileTextChanges[], ctx: SharedContext): vscode.WorkspaceEdit; +//# sourceMappingURL=rename.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/07/d396665ce611a3806d988d20fac60ace1ff1642a059ea6d037148a06ed8ad3088ee0f01230a65911a4719f9db96043def3cff4a8da891863f73dd86830f180 b/.pnpm-store/v3/files/07/d396665ce611a3806d988d20fac60ace1ff1642a059ea6d037148a06ed8ad3088ee0f01230a65911a4719f9db96043def3cff4a8da891863f73dd86830f180 new file mode 100644 index 00000000..1e772fff --- /dev/null +++ b/.pnpm-store/v3/files/07/d396665ce611a3806d988d20fac60ace1ff1642a059ea6d037148a06ed8ad3088ee0f01230a65911a4719f9db96043def3cff4a8da891863f73dd86830f180 @@ -0,0 +1,6 @@ +import type { FormattingOptions } from '@volar/language-service'; +import type * as ts from 'typescript'; +import type { TextDocument } from 'vscode-languageserver-textdocument'; +import type { SharedContext } from '../types'; +export declare function getFormatCodeSettings(ctx: SharedContext, document: TextDocument, options?: FormattingOptions): Promise; +//# sourceMappingURL=getFormatCodeSettings.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/08/03d7ae8436b686574fb419b519cb87482fd1e0e52e740c3a6d5914ed713126460cd01d42e863f1ec1714fc728d252738026a47962efdba55f7612467d0a1bd b/.pnpm-store/v3/files/08/03d7ae8436b686574fb419b519cb87482fd1e0e52e740c3a6d5914ed713126460cd01d42e863f1ec1714fc728d252738026a47962efdba55f7612467d0a1bd new file mode 100644 index 00000000..46412c2f --- /dev/null +++ b/.pnpm-store/v3/files/08/03d7ae8436b686574fb419b519cb87482fd1e0e52e740c3a6d5914ed713126460cd01d42e863f1ec1714fc728d252738026a47962efdba55f7612467d0a1bd @@ -0,0 +1,4808 @@ +import { existsSync, promises } from 'node:fs'; +import { dirname } from 'pathe'; +import { c as createBirpc } from '../vendor/index.cAUulNDf.js'; +import require$$0$2 from 'stream'; +import require$$0 from 'zlib'; +import require$$0$1 from 'buffer'; +import require$$1 from 'crypto'; +import require$$2 from 'events'; +import require$$1$1 from 'https'; +import require$$2$1 from 'http'; +import require$$3 from 'net'; +import require$$4 from 'tls'; +import require$$7 from 'url'; +import { g as getDefaultExportFromCjs } from '../vendor/_commonjsHelpers.jjO7Zipk.js'; +import { isFileServingAllowed } from 'vite'; +import { A as API_PATH } from '../vendor/constants.i1PoEnhr.js'; +import '../vendor/index.rJjbcrrp.js'; +import { W as WorkspaceProject } from '../vendor/node.Zme77R4t.js'; +import '@vitest/utils'; +import { parseErrorStacktrace } from '@vitest/utils/source-map'; +import { a as isPrimitive } from '../vendor/base.QYERqzkH.js'; +import 'std-env'; +import '@vitest/runner/utils'; +import '../vendor/global.CkGT_TMy.js'; +import 'node:path'; +import 'node:url'; +import 'node:process'; +import 'os'; +import 'path'; +import '../vendor/index.xL8XjTLv.js'; +import 'util'; +import 'fs'; +import 'picocolors'; +import 'vite-node/client'; +import '@vitest/snapshot/manager'; +import 'vite-node/server'; +import '../vendor/coverage.E7sG1b3r.js'; +import '../path.js'; +import 'node:v8'; +import 'node:os'; +import 'node:events'; +import 'tinypool'; +import 'node:worker_threads'; +import 'node:fs/promises'; +import 'node:perf_hooks'; +import 'execa'; +import 'module'; +import 'acorn-walk'; +import '../vendor/reporters.cA9x-5v-.js'; +import './runtime-console.Iloo9fIt.js'; +import 'node:stream'; +import 'node:console'; +import '../vendor/date.Ns1pGd_X.js'; +import '../vendor/tasks.IknbGB2n.js'; +import 'node:module'; +import 'local-pkg'; +import 'node:crypto'; +import 'vite-node/utils'; +import 'assert'; +import 'magic-string'; +import '@vitest/utils/ast'; +import 'strip-literal'; +import '../vendor/environments.sU0TD7wX.js'; +import 'node:readline'; +import 'readline'; + +async function getModuleGraph(ctx, id) { + const graph = {}; + const externalized = /* @__PURE__ */ new Set(); + const inlined = /* @__PURE__ */ new Set(); + function clearId(id2) { + return (id2 == null ? void 0 : id2.replace(/\?v=\w+$/, "")) || ""; + } + async function get(mod, seen = /* @__PURE__ */ new Map()) { + if (!mod || !mod.id) + return; + if (seen.has(mod)) + return seen.get(mod); + let id2 = clearId(mod.id); + seen.set(mod, id2); + const rewrote = await ctx.vitenode.shouldExternalize(id2); + if (rewrote) { + id2 = rewrote; + externalized.add(id2); + seen.set(mod, id2); + } else { + inlined.add(id2); + } + const mods = Array.from(mod.importedModules).filter((i) => i.id && !i.id.includes("/vitest/dist/")); + graph[id2] = (await Promise.all(mods.map((m) => get(m, seen)))).filter(Boolean); + return id2; + } + await get(ctx.server.moduleGraph.getModuleById(id)); + return { + graph, + externalized: Array.from(externalized), + inlined: Array.from(inlined) + }; +} + +function cloneByOwnProperties(value) { + return Object.getOwnPropertyNames(value).reduce((clone, prop) => ({ + ...clone, + [prop]: value[prop] + }), {}); +} +function stringifyReplace(key, value) { + if (value instanceof Error) + return cloneByOwnProperties(value); + else + return value; +} + +/*! (c) 2020 Andrea Giammarchi */ + +const {parse: $parse, stringify: $stringify} = JSON; +const {keys} = Object; + +const Primitive = String; // it could be Number +const primitive = 'string'; // it could be 'number' + +const ignore = {}; +const object = 'object'; + +const noop = (_, value) => value; + +const primitives = value => ( + value instanceof Primitive ? Primitive(value) : value +); + +const Primitives = (_, value) => ( + typeof value === primitive ? new Primitive(value) : value +); + +const revive = (input, parsed, output, $) => { + const lazy = []; + for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) { + const k = ke[y]; + const value = output[k]; + if (value instanceof Primitive) { + const tmp = input[value]; + if (typeof tmp === object && !parsed.has(tmp)) { + parsed.add(tmp); + output[k] = ignore; + lazy.push({k, a: [input, parsed, tmp, $]}); + } + else + output[k] = $.call(output, k, tmp); + } + else if (output[k] !== ignore) + output[k] = $.call(output, k, value); + } + for (let {length} = lazy, i = 0; i < length; i++) { + const {k, a} = lazy[i]; + output[k] = $.call(output, k, revive.apply(null, a)); + } + return output; +}; + +const set = (known, input, value) => { + const index = Primitive(input.push(value) - 1); + known.set(value, index); + return index; +}; + +const parse$3 = (text, reviver) => { + const input = $parse(text, Primitives).map(primitives); + const value = input[0]; + const $ = reviver || noop; + const tmp = typeof value === object && value ? + revive(input, new Set, value, $) : + value; + return $.call({'': tmp}, '', tmp); +}; + +const stringify = (value, replacer, space) => { + const $ = replacer && typeof replacer === object ? + (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) : + (replacer || noop); + const known = new Map; + const input = []; + const output = []; + let i = +set(known, input, $.call({'': value}, '', value)); + let firstRun = !i; + while (i < input.length) { + firstRun = true; + output[i] = $stringify(input[i++], replace, space); + } + return '[' + output.join(',') + ']'; + function replace(key, value) { + if (firstRun) { + firstRun = !firstRun; + return value; + } + const after = $.call(this, key, value); + switch (typeof after) { + case object: + if (after === null) return after; + case primitive: + return known.get(after) || set(known, input, after); + } + return after; + } +}; + +var bufferUtil$1 = {exports: {}}; + +var constants = { + BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'], + EMPTY_BUFFER: Buffer.alloc(0), + GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', + kForOnEventAttribute: Symbol('kIsForOnEventAttribute'), + kListener: Symbol('kListener'), + kStatusCode: Symbol('status-code'), + kWebSocket: Symbol('websocket'), + NOOP: () => {} +}; + +var unmask$1; +var mask; + +const { EMPTY_BUFFER: EMPTY_BUFFER$3 } = constants; + +const FastBuffer$2 = Buffer[Symbol.species]; + +/** + * Merges an array of buffers into a new buffer. + * + * @param {Buffer[]} list The array of buffers to concat + * @param {Number} totalLength The total length of buffers in the list + * @return {Buffer} The resulting buffer + * @public + */ +function concat$1(list, totalLength) { + if (list.length === 0) return EMPTY_BUFFER$3; + if (list.length === 1) return list[0]; + + const target = Buffer.allocUnsafe(totalLength); + let offset = 0; + + for (let i = 0; i < list.length; i++) { + const buf = list[i]; + target.set(buf, offset); + offset += buf.length; + } + + if (offset < totalLength) { + return new FastBuffer$2(target.buffer, target.byteOffset, offset); + } + + return target; +} + +/** + * Masks a buffer using the given mask. + * + * @param {Buffer} source The buffer to mask + * @param {Buffer} mask The mask to use + * @param {Buffer} output The buffer where to store the result + * @param {Number} offset The offset at which to start writing + * @param {Number} length The number of bytes to mask. + * @public + */ +function _mask(source, mask, output, offset, length) { + for (let i = 0; i < length; i++) { + output[offset + i] = source[i] ^ mask[i & 3]; + } +} + +/** + * Unmasks a buffer using the given mask. + * + * @param {Buffer} buffer The buffer to unmask + * @param {Buffer} mask The mask to use + * @public + */ +function _unmask(buffer, mask) { + for (let i = 0; i < buffer.length; i++) { + buffer[i] ^= mask[i & 3]; + } +} + +/** + * Converts a buffer to an `ArrayBuffer`. + * + * @param {Buffer} buf The buffer to convert + * @return {ArrayBuffer} Converted buffer + * @public + */ +function toArrayBuffer$1(buf) { + if (buf.length === buf.buffer.byteLength) { + return buf.buffer; + } + + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length); +} + +/** + * Converts `data` to a `Buffer`. + * + * @param {*} data The data to convert + * @return {Buffer} The buffer + * @throws {TypeError} + * @public + */ +function toBuffer$2(data) { + toBuffer$2.readOnly = true; + + if (Buffer.isBuffer(data)) return data; + + let buf; + + if (data instanceof ArrayBuffer) { + buf = new FastBuffer$2(data); + } else if (ArrayBuffer.isView(data)) { + buf = new FastBuffer$2(data.buffer, data.byteOffset, data.byteLength); + } else { + buf = Buffer.from(data); + toBuffer$2.readOnly = false; + } + + return buf; +} + +bufferUtil$1.exports = { + concat: concat$1, + mask: _mask, + toArrayBuffer: toArrayBuffer$1, + toBuffer: toBuffer$2, + unmask: _unmask +}; + +/* istanbul ignore else */ +if (!process.env.WS_NO_BUFFER_UTIL) { + try { + const bufferUtil = require('bufferutil'); + + mask = bufferUtil$1.exports.mask = function (source, mask, output, offset, length) { + if (length < 48) _mask(source, mask, output, offset, length); + else bufferUtil.mask(source, mask, output, offset, length); + }; + + unmask$1 = bufferUtil$1.exports.unmask = function (buffer, mask) { + if (buffer.length < 32) _unmask(buffer, mask); + else bufferUtil.unmask(buffer, mask); + }; + } catch (e) { + // Continue regardless of the error. + } +} + +var bufferUtilExports = bufferUtil$1.exports; + +const kDone = Symbol('kDone'); +const kRun = Symbol('kRun'); + +/** + * A very simple job queue with adjustable concurrency. Adapted from + * https://github.com/STRML/async-limiter + */ +let Limiter$1 = class Limiter { + /** + * Creates a new `Limiter`. + * + * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed + * to run concurrently + */ + constructor(concurrency) { + this[kDone] = () => { + this.pending--; + this[kRun](); + }; + this.concurrency = concurrency || Infinity; + this.jobs = []; + this.pending = 0; + } + + /** + * Adds a job to the queue. + * + * @param {Function} job The job to run + * @public + */ + add(job) { + this.jobs.push(job); + this[kRun](); + } + + /** + * Removes a job from the queue and runs it if possible. + * + * @private + */ + [kRun]() { + if (this.pending === this.concurrency) return; + + if (this.jobs.length) { + const job = this.jobs.shift(); + + this.pending++; + job(this[kDone]); + } + } +}; + +var limiter = Limiter$1; + +const zlib = require$$0; + +const bufferUtil = bufferUtilExports; +const Limiter = limiter; +const { kStatusCode: kStatusCode$2 } = constants; + +const FastBuffer$1 = Buffer[Symbol.species]; +const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]); +const kPerMessageDeflate = Symbol('permessage-deflate'); +const kTotalLength = Symbol('total-length'); +const kCallback = Symbol('callback'); +const kBuffers = Symbol('buffers'); +const kError$1 = Symbol('error'); + +// +// We limit zlib concurrency, which prevents severe memory fragmentation +// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913 +// and https://github.com/websockets/ws/issues/1202 +// +// Intentionally global; it's the global thread pool that's an issue. +// +let zlibLimiter; + +/** + * permessage-deflate implementation. + */ +let PerMessageDeflate$4 = class PerMessageDeflate { + /** + * Creates a PerMessageDeflate instance. + * + * @param {Object} [options] Configuration options + * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support + * for, or request, a custom client window size + * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/ + * acknowledge disabling of client context takeover + * @param {Number} [options.concurrencyLimit=10] The number of concurrent + * calls to zlib + * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the + * use of a custom server window size + * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept + * disabling of server context takeover + * @param {Number} [options.threshold=1024] Size (in bytes) below which + * messages should not be compressed if context takeover is disabled + * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on + * deflate + * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on + * inflate + * @param {Boolean} [isServer=false] Create the instance in either server or + * client mode + * @param {Number} [maxPayload=0] The maximum allowed message length + */ + constructor(options, isServer, maxPayload) { + this._maxPayload = maxPayload | 0; + this._options = options || {}; + this._threshold = + this._options.threshold !== undefined ? this._options.threshold : 1024; + this._isServer = !!isServer; + this._deflate = null; + this._inflate = null; + + this.params = null; + + if (!zlibLimiter) { + const concurrency = + this._options.concurrencyLimit !== undefined + ? this._options.concurrencyLimit + : 10; + zlibLimiter = new Limiter(concurrency); + } + } + + /** + * @type {String} + */ + static get extensionName() { + return 'permessage-deflate'; + } + + /** + * Create an extension negotiation offer. + * + * @return {Object} Extension parameters + * @public + */ + offer() { + const params = {}; + + if (this._options.serverNoContextTakeover) { + params.server_no_context_takeover = true; + } + if (this._options.clientNoContextTakeover) { + params.client_no_context_takeover = true; + } + if (this._options.serverMaxWindowBits) { + params.server_max_window_bits = this._options.serverMaxWindowBits; + } + if (this._options.clientMaxWindowBits) { + params.client_max_window_bits = this._options.clientMaxWindowBits; + } else if (this._options.clientMaxWindowBits == null) { + params.client_max_window_bits = true; + } + + return params; + } + + /** + * Accept an extension negotiation offer/response. + * + * @param {Array} configurations The extension negotiation offers/reponse + * @return {Object} Accepted configuration + * @public + */ + accept(configurations) { + configurations = this.normalizeParams(configurations); + + this.params = this._isServer + ? this.acceptAsServer(configurations) + : this.acceptAsClient(configurations); + + return this.params; + } + + /** + * Releases all resources used by the extension. + * + * @public + */ + cleanup() { + if (this._inflate) { + this._inflate.close(); + this._inflate = null; + } + + if (this._deflate) { + const callback = this._deflate[kCallback]; + + this._deflate.close(); + this._deflate = null; + + if (callback) { + callback( + new Error( + 'The deflate stream was closed while data was being processed' + ) + ); + } + } + } + + /** + * Accept an extension negotiation offer. + * + * @param {Array} offers The extension negotiation offers + * @return {Object} Accepted configuration + * @private + */ + acceptAsServer(offers) { + const opts = this._options; + const accepted = offers.find((params) => { + if ( + (opts.serverNoContextTakeover === false && + params.server_no_context_takeover) || + (params.server_max_window_bits && + (opts.serverMaxWindowBits === false || + (typeof opts.serverMaxWindowBits === 'number' && + opts.serverMaxWindowBits > params.server_max_window_bits))) || + (typeof opts.clientMaxWindowBits === 'number' && + !params.client_max_window_bits) + ) { + return false; + } + + return true; + }); + + if (!accepted) { + throw new Error('None of the extension offers can be accepted'); + } + + if (opts.serverNoContextTakeover) { + accepted.server_no_context_takeover = true; + } + if (opts.clientNoContextTakeover) { + accepted.client_no_context_takeover = true; + } + if (typeof opts.serverMaxWindowBits === 'number') { + accepted.server_max_window_bits = opts.serverMaxWindowBits; + } + if (typeof opts.clientMaxWindowBits === 'number') { + accepted.client_max_window_bits = opts.clientMaxWindowBits; + } else if ( + accepted.client_max_window_bits === true || + opts.clientMaxWindowBits === false + ) { + delete accepted.client_max_window_bits; + } + + return accepted; + } + + /** + * Accept the extension negotiation response. + * + * @param {Array} response The extension negotiation response + * @return {Object} Accepted configuration + * @private + */ + acceptAsClient(response) { + const params = response[0]; + + if ( + this._options.clientNoContextTakeover === false && + params.client_no_context_takeover + ) { + throw new Error('Unexpected parameter "client_no_context_takeover"'); + } + + if (!params.client_max_window_bits) { + if (typeof this._options.clientMaxWindowBits === 'number') { + params.client_max_window_bits = this._options.clientMaxWindowBits; + } + } else if ( + this._options.clientMaxWindowBits === false || + (typeof this._options.clientMaxWindowBits === 'number' && + params.client_max_window_bits > this._options.clientMaxWindowBits) + ) { + throw new Error( + 'Unexpected or invalid parameter "client_max_window_bits"' + ); + } + + return params; + } + + /** + * Normalize parameters. + * + * @param {Array} configurations The extension negotiation offers/reponse + * @return {Array} The offers/response with normalized parameters + * @private + */ + normalizeParams(configurations) { + configurations.forEach((params) => { + Object.keys(params).forEach((key) => { + let value = params[key]; + + if (value.length > 1) { + throw new Error(`Parameter "${key}" must have only a single value`); + } + + value = value[0]; + + if (key === 'client_max_window_bits') { + if (value !== true) { + const num = +value; + if (!Number.isInteger(num) || num < 8 || num > 15) { + throw new TypeError( + `Invalid value for parameter "${key}": ${value}` + ); + } + value = num; + } else if (!this._isServer) { + throw new TypeError( + `Invalid value for parameter "${key}": ${value}` + ); + } + } else if (key === 'server_max_window_bits') { + const num = +value; + if (!Number.isInteger(num) || num < 8 || num > 15) { + throw new TypeError( + `Invalid value for parameter "${key}": ${value}` + ); + } + value = num; + } else if ( + key === 'client_no_context_takeover' || + key === 'server_no_context_takeover' + ) { + if (value !== true) { + throw new TypeError( + `Invalid value for parameter "${key}": ${value}` + ); + } + } else { + throw new Error(`Unknown parameter "${key}"`); + } + + params[key] = value; + }); + }); + + return configurations; + } + + /** + * Decompress data. Concurrency limited. + * + * @param {Buffer} data Compressed data + * @param {Boolean} fin Specifies whether or not this is the last fragment + * @param {Function} callback Callback + * @public + */ + decompress(data, fin, callback) { + zlibLimiter.add((done) => { + this._decompress(data, fin, (err, result) => { + done(); + callback(err, result); + }); + }); + } + + /** + * Compress data. Concurrency limited. + * + * @param {(Buffer|String)} data Data to compress + * @param {Boolean} fin Specifies whether or not this is the last fragment + * @param {Function} callback Callback + * @public + */ + compress(data, fin, callback) { + zlibLimiter.add((done) => { + this._compress(data, fin, (err, result) => { + done(); + callback(err, result); + }); + }); + } + + /** + * Decompress data. + * + * @param {Buffer} data Compressed data + * @param {Boolean} fin Specifies whether or not this is the last fragment + * @param {Function} callback Callback + * @private + */ + _decompress(data, fin, callback) { + const endpoint = this._isServer ? 'client' : 'server'; + + if (!this._inflate) { + const key = `${endpoint}_max_window_bits`; + const windowBits = + typeof this.params[key] !== 'number' + ? zlib.Z_DEFAULT_WINDOWBITS + : this.params[key]; + + this._inflate = zlib.createInflateRaw({ + ...this._options.zlibInflateOptions, + windowBits + }); + this._inflate[kPerMessageDeflate] = this; + this._inflate[kTotalLength] = 0; + this._inflate[kBuffers] = []; + this._inflate.on('error', inflateOnError); + this._inflate.on('data', inflateOnData); + } + + this._inflate[kCallback] = callback; + + this._inflate.write(data); + if (fin) this._inflate.write(TRAILER); + + this._inflate.flush(() => { + const err = this._inflate[kError$1]; + + if (err) { + this._inflate.close(); + this._inflate = null; + callback(err); + return; + } + + const data = bufferUtil.concat( + this._inflate[kBuffers], + this._inflate[kTotalLength] + ); + + if (this._inflate._readableState.endEmitted) { + this._inflate.close(); + this._inflate = null; + } else { + this._inflate[kTotalLength] = 0; + this._inflate[kBuffers] = []; + + if (fin && this.params[`${endpoint}_no_context_takeover`]) { + this._inflate.reset(); + } + } + + callback(null, data); + }); + } + + /** + * Compress data. + * + * @param {(Buffer|String)} data Data to compress + * @param {Boolean} fin Specifies whether or not this is the last fragment + * @param {Function} callback Callback + * @private + */ + _compress(data, fin, callback) { + const endpoint = this._isServer ? 'server' : 'client'; + + if (!this._deflate) { + const key = `${endpoint}_max_window_bits`; + const windowBits = + typeof this.params[key] !== 'number' + ? zlib.Z_DEFAULT_WINDOWBITS + : this.params[key]; + + this._deflate = zlib.createDeflateRaw({ + ...this._options.zlibDeflateOptions, + windowBits + }); + + this._deflate[kTotalLength] = 0; + this._deflate[kBuffers] = []; + + this._deflate.on('data', deflateOnData); + } + + this._deflate[kCallback] = callback; + + this._deflate.write(data); + this._deflate.flush(zlib.Z_SYNC_FLUSH, () => { + if (!this._deflate) { + // + // The deflate stream was closed while data was being processed. + // + return; + } + + let data = bufferUtil.concat( + this._deflate[kBuffers], + this._deflate[kTotalLength] + ); + + if (fin) { + data = new FastBuffer$1(data.buffer, data.byteOffset, data.length - 4); + } + + // + // Ensure that the callback will not be called again in + // `PerMessageDeflate#cleanup()`. + // + this._deflate[kCallback] = null; + + this._deflate[kTotalLength] = 0; + this._deflate[kBuffers] = []; + + if (fin && this.params[`${endpoint}_no_context_takeover`]) { + this._deflate.reset(); + } + + callback(null, data); + }); + } +}; + +var permessageDeflate = PerMessageDeflate$4; + +/** + * The listener of the `zlib.DeflateRaw` stream `'data'` event. + * + * @param {Buffer} chunk A chunk of data + * @private + */ +function deflateOnData(chunk) { + this[kBuffers].push(chunk); + this[kTotalLength] += chunk.length; +} + +/** + * The listener of the `zlib.InflateRaw` stream `'data'` event. + * + * @param {Buffer} chunk A chunk of data + * @private + */ +function inflateOnData(chunk) { + this[kTotalLength] += chunk.length; + + if ( + this[kPerMessageDeflate]._maxPayload < 1 || + this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload + ) { + this[kBuffers].push(chunk); + return; + } + + this[kError$1] = new RangeError('Max payload size exceeded'); + this[kError$1].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'; + this[kError$1][kStatusCode$2] = 1009; + this.removeListener('data', inflateOnData); + this.reset(); +} + +/** + * The listener of the `zlib.InflateRaw` stream `'error'` event. + * + * @param {Error} err The emitted error + * @private + */ +function inflateOnError(err) { + // + // There is no need to call `Zlib#close()` as the handle is automatically + // closed when an error is emitted. + // + this[kPerMessageDeflate]._inflate = null; + err[kStatusCode$2] = 1007; + this[kCallback](err); +} + +var validation = {exports: {}}; + +var isValidUTF8_1; + +const { isUtf8 } = require$$0$1; + +// +// Allowed token characters: +// +// '!', '#', '$', '%', '&', ''', '*', '+', '-', +// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~' +// +// tokenChars[32] === 0 // ' ' +// tokenChars[33] === 1 // '!' +// tokenChars[34] === 0 // '"' +// ... +// +// prettier-ignore +const tokenChars$2 = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 + 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127 +]; + +/** + * Checks if a status code is allowed in a close frame. + * + * @param {Number} code The status code + * @return {Boolean} `true` if the status code is valid, else `false` + * @public + */ +function isValidStatusCode$2(code) { + return ( + (code >= 1000 && + code <= 1014 && + code !== 1004 && + code !== 1005 && + code !== 1006) || + (code >= 3000 && code <= 4999) + ); +} + +/** + * Checks if a given buffer contains only correct UTF-8. + * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by + * Markus Kuhn. + * + * @param {Buffer} buf The buffer to check + * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false` + * @public + */ +function _isValidUTF8(buf) { + const len = buf.length; + let i = 0; + + while (i < len) { + if ((buf[i] & 0x80) === 0) { + // 0xxxxxxx + i++; + } else if ((buf[i] & 0xe0) === 0xc0) { + // 110xxxxx 10xxxxxx + if ( + i + 1 === len || + (buf[i + 1] & 0xc0) !== 0x80 || + (buf[i] & 0xfe) === 0xc0 // Overlong + ) { + return false; + } + + i += 2; + } else if ((buf[i] & 0xf0) === 0xe0) { + // 1110xxxx 10xxxxxx 10xxxxxx + if ( + i + 2 >= len || + (buf[i + 1] & 0xc0) !== 0x80 || + (buf[i + 2] & 0xc0) !== 0x80 || + (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong + (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF) + ) { + return false; + } + + i += 3; + } else if ((buf[i] & 0xf8) === 0xf0) { + // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + if ( + i + 3 >= len || + (buf[i + 1] & 0xc0) !== 0x80 || + (buf[i + 2] & 0xc0) !== 0x80 || + (buf[i + 3] & 0xc0) !== 0x80 || + (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong + (buf[i] === 0xf4 && buf[i + 1] > 0x8f) || + buf[i] > 0xf4 // > U+10FFFF + ) { + return false; + } + + i += 4; + } else { + return false; + } + } + + return true; +} + +validation.exports = { + isValidStatusCode: isValidStatusCode$2, + isValidUTF8: _isValidUTF8, + tokenChars: tokenChars$2 +}; + +if (isUtf8) { + isValidUTF8_1 = validation.exports.isValidUTF8 = function (buf) { + return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf); + }; +} /* istanbul ignore else */ else if (!process.env.WS_NO_UTF_8_VALIDATE) { + try { + const isValidUTF8 = require('utf-8-validate'); + + isValidUTF8_1 = validation.exports.isValidUTF8 = function (buf) { + return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf); + }; + } catch (e) { + // Continue regardless of the error. + } +} + +var validationExports = validation.exports; + +const { Writable } = require$$0$2; + +const PerMessageDeflate$3 = permessageDeflate; +const { + BINARY_TYPES: BINARY_TYPES$1, + EMPTY_BUFFER: EMPTY_BUFFER$2, + kStatusCode: kStatusCode$1, + kWebSocket: kWebSocket$2 +} = constants; +const { concat, toArrayBuffer, unmask } = bufferUtilExports; +const { isValidStatusCode: isValidStatusCode$1, isValidUTF8 } = validationExports; + +const FastBuffer = Buffer[Symbol.species]; +const promise = Promise.resolve(); + +// +// `queueMicrotask()` is not available in Node.js < 11. +// +const queueTask = + typeof queueMicrotask === 'function' ? queueMicrotask : queueMicrotaskShim; + +const GET_INFO = 0; +const GET_PAYLOAD_LENGTH_16 = 1; +const GET_PAYLOAD_LENGTH_64 = 2; +const GET_MASK = 3; +const GET_DATA = 4; +const INFLATING = 5; +const WAIT_MICROTASK = 6; + +/** + * HyBi Receiver implementation. + * + * @extends Writable + */ +let Receiver$1 = class Receiver extends Writable { + /** + * Creates a Receiver instance. + * + * @param {Object} [options] Options object + * @param {String} [options.binaryType=nodebuffer] The type for binary data + * @param {Object} [options.extensions] An object containing the negotiated + * extensions + * @param {Boolean} [options.isServer=false] Specifies whether to operate in + * client or server mode + * @param {Number} [options.maxPayload=0] The maximum allowed message length + * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or + * not to skip UTF-8 validation for text and close messages + */ + constructor(options = {}) { + super(); + + this._binaryType = options.binaryType || BINARY_TYPES$1[0]; + this._extensions = options.extensions || {}; + this._isServer = !!options.isServer; + this._maxPayload = options.maxPayload | 0; + this._skipUTF8Validation = !!options.skipUTF8Validation; + this[kWebSocket$2] = undefined; + + this._bufferedBytes = 0; + this._buffers = []; + + this._compressed = false; + this._payloadLength = 0; + this._mask = undefined; + this._fragmented = 0; + this._masked = false; + this._fin = false; + this._opcode = 0; + + this._totalPayloadLength = 0; + this._messageLength = 0; + this._fragments = []; + + this._state = GET_INFO; + this._loop = false; + } + + /** + * Implements `Writable.prototype._write()`. + * + * @param {Buffer} chunk The chunk of data to write + * @param {String} encoding The character encoding of `chunk` + * @param {Function} cb Callback + * @private + */ + _write(chunk, encoding, cb) { + if (this._opcode === 0x08 && this._state == GET_INFO) return cb(); + + this._bufferedBytes += chunk.length; + this._buffers.push(chunk); + this.startLoop(cb); + } + + /** + * Consumes `n` bytes from the buffered data. + * + * @param {Number} n The number of bytes to consume + * @return {Buffer} The consumed bytes + * @private + */ + consume(n) { + this._bufferedBytes -= n; + + if (n === this._buffers[0].length) return this._buffers.shift(); + + if (n < this._buffers[0].length) { + const buf = this._buffers[0]; + this._buffers[0] = new FastBuffer( + buf.buffer, + buf.byteOffset + n, + buf.length - n + ); + + return new FastBuffer(buf.buffer, buf.byteOffset, n); + } + + const dst = Buffer.allocUnsafe(n); + + do { + const buf = this._buffers[0]; + const offset = dst.length - n; + + if (n >= buf.length) { + dst.set(this._buffers.shift(), offset); + } else { + dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset); + this._buffers[0] = new FastBuffer( + buf.buffer, + buf.byteOffset + n, + buf.length - n + ); + } + + n -= buf.length; + } while (n > 0); + + return dst; + } + + /** + * Starts the parsing loop. + * + * @param {Function} cb Callback + * @private + */ + startLoop(cb) { + let err; + this._loop = true; + + do { + switch (this._state) { + case GET_INFO: + err = this.getInfo(); + break; + case GET_PAYLOAD_LENGTH_16: + err = this.getPayloadLength16(); + break; + case GET_PAYLOAD_LENGTH_64: + err = this.getPayloadLength64(); + break; + case GET_MASK: + this.getMask(); + break; + case GET_DATA: + err = this.getData(cb); + break; + case INFLATING: + this._loop = false; + return; + default: + // + // `WAIT_MICROTASK`. + // + this._loop = false; + + queueTask(() => { + this._state = GET_INFO; + this.startLoop(cb); + }); + return; + } + } while (this._loop); + + cb(err); + } + + /** + * Reads the first two bytes of a frame. + * + * @return {(RangeError|undefined)} A possible error + * @private + */ + getInfo() { + if (this._bufferedBytes < 2) { + this._loop = false; + return; + } + + const buf = this.consume(2); + + if ((buf[0] & 0x30) !== 0x00) { + this._loop = false; + return error( + RangeError, + 'RSV2 and RSV3 must be clear', + true, + 1002, + 'WS_ERR_UNEXPECTED_RSV_2_3' + ); + } + + const compressed = (buf[0] & 0x40) === 0x40; + + if (compressed && !this._extensions[PerMessageDeflate$3.extensionName]) { + this._loop = false; + return error( + RangeError, + 'RSV1 must be clear', + true, + 1002, + 'WS_ERR_UNEXPECTED_RSV_1' + ); + } + + this._fin = (buf[0] & 0x80) === 0x80; + this._opcode = buf[0] & 0x0f; + this._payloadLength = buf[1] & 0x7f; + + if (this._opcode === 0x00) { + if (compressed) { + this._loop = false; + return error( + RangeError, + 'RSV1 must be clear', + true, + 1002, + 'WS_ERR_UNEXPECTED_RSV_1' + ); + } + + if (!this._fragmented) { + this._loop = false; + return error( + RangeError, + 'invalid opcode 0', + true, + 1002, + 'WS_ERR_INVALID_OPCODE' + ); + } + + this._opcode = this._fragmented; + } else if (this._opcode === 0x01 || this._opcode === 0x02) { + if (this._fragmented) { + this._loop = false; + return error( + RangeError, + `invalid opcode ${this._opcode}`, + true, + 1002, + 'WS_ERR_INVALID_OPCODE' + ); + } + + this._compressed = compressed; + } else if (this._opcode > 0x07 && this._opcode < 0x0b) { + if (!this._fin) { + this._loop = false; + return error( + RangeError, + 'FIN must be set', + true, + 1002, + 'WS_ERR_EXPECTED_FIN' + ); + } + + if (compressed) { + this._loop = false; + return error( + RangeError, + 'RSV1 must be clear', + true, + 1002, + 'WS_ERR_UNEXPECTED_RSV_1' + ); + } + + if ( + this._payloadLength > 0x7d || + (this._opcode === 0x08 && this._payloadLength === 1) + ) { + this._loop = false; + return error( + RangeError, + `invalid payload length ${this._payloadLength}`, + true, + 1002, + 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH' + ); + } + } else { + this._loop = false; + return error( + RangeError, + `invalid opcode ${this._opcode}`, + true, + 1002, + 'WS_ERR_INVALID_OPCODE' + ); + } + + if (!this._fin && !this._fragmented) this._fragmented = this._opcode; + this._masked = (buf[1] & 0x80) === 0x80; + + if (this._isServer) { + if (!this._masked) { + this._loop = false; + return error( + RangeError, + 'MASK must be set', + true, + 1002, + 'WS_ERR_EXPECTED_MASK' + ); + } + } else if (this._masked) { + this._loop = false; + return error( + RangeError, + 'MASK must be clear', + true, + 1002, + 'WS_ERR_UNEXPECTED_MASK' + ); + } + + if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16; + else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64; + else return this.haveLength(); + } + + /** + * Gets extended payload length (7+16). + * + * @return {(RangeError|undefined)} A possible error + * @private + */ + getPayloadLength16() { + if (this._bufferedBytes < 2) { + this._loop = false; + return; + } + + this._payloadLength = this.consume(2).readUInt16BE(0); + return this.haveLength(); + } + + /** + * Gets extended payload length (7+64). + * + * @return {(RangeError|undefined)} A possible error + * @private + */ + getPayloadLength64() { + if (this._bufferedBytes < 8) { + this._loop = false; + return; + } + + const buf = this.consume(8); + const num = buf.readUInt32BE(0); + + // + // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned + // if payload length is greater than this number. + // + if (num > Math.pow(2, 53 - 32) - 1) { + this._loop = false; + return error( + RangeError, + 'Unsupported WebSocket frame: payload length > 2^53 - 1', + false, + 1009, + 'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH' + ); + } + + this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); + return this.haveLength(); + } + + /** + * Payload length has been read. + * + * @return {(RangeError|undefined)} A possible error + * @private + */ + haveLength() { + if (this._payloadLength && this._opcode < 0x08) { + this._totalPayloadLength += this._payloadLength; + if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { + this._loop = false; + return error( + RangeError, + 'Max payload size exceeded', + false, + 1009, + 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH' + ); + } + } + + if (this._masked) this._state = GET_MASK; + else this._state = GET_DATA; + } + + /** + * Reads mask bytes. + * + * @private + */ + getMask() { + if (this._bufferedBytes < 4) { + this._loop = false; + return; + } + + this._mask = this.consume(4); + this._state = GET_DATA; + } + + /** + * Reads data bytes. + * + * @param {Function} cb Callback + * @return {(Error|RangeError|undefined)} A possible error + * @private + */ + getData(cb) { + let data = EMPTY_BUFFER$2; + + if (this._payloadLength) { + if (this._bufferedBytes < this._payloadLength) { + this._loop = false; + return; + } + + data = this.consume(this._payloadLength); + + if ( + this._masked && + (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0 + ) { + unmask(data, this._mask); + } + } + + if (this._opcode > 0x07) return this.controlMessage(data); + + if (this._compressed) { + this._state = INFLATING; + this.decompress(data, cb); + return; + } + + if (data.length) { + // + // This message is not compressed so its length is the sum of the payload + // length of all fragments. + // + this._messageLength = this._totalPayloadLength; + this._fragments.push(data); + } + + return this.dataMessage(); + } + + /** + * Decompresses data. + * + * @param {Buffer} data Compressed data + * @param {Function} cb Callback + * @private + */ + decompress(data, cb) { + const perMessageDeflate = this._extensions[PerMessageDeflate$3.extensionName]; + + perMessageDeflate.decompress(data, this._fin, (err, buf) => { + if (err) return cb(err); + + if (buf.length) { + this._messageLength += buf.length; + if (this._messageLength > this._maxPayload && this._maxPayload > 0) { + return cb( + error( + RangeError, + 'Max payload size exceeded', + false, + 1009, + 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH' + ) + ); + } + + this._fragments.push(buf); + } + + const er = this.dataMessage(); + if (er) return cb(er); + + this.startLoop(cb); + }); + } + + /** + * Handles a data message. + * + * @return {(Error|undefined)} A possible error + * @private + */ + dataMessage() { + if (this._fin) { + const messageLength = this._messageLength; + const fragments = this._fragments; + + this._totalPayloadLength = 0; + this._messageLength = 0; + this._fragmented = 0; + this._fragments = []; + + if (this._opcode === 2) { + let data; + + if (this._binaryType === 'nodebuffer') { + data = concat(fragments, messageLength); + } else if (this._binaryType === 'arraybuffer') { + data = toArrayBuffer(concat(fragments, messageLength)); + } else { + data = fragments; + } + + this.emit('message', data, true); + } else { + const buf = concat(fragments, messageLength); + + if (!this._skipUTF8Validation && !isValidUTF8(buf)) { + this._loop = false; + return error( + Error, + 'invalid UTF-8 sequence', + true, + 1007, + 'WS_ERR_INVALID_UTF8' + ); + } + + this.emit('message', buf, false); + } + } + + this._state = WAIT_MICROTASK; + } + + /** + * Handles a control message. + * + * @param {Buffer} data Data to handle + * @return {(Error|RangeError|undefined)} A possible error + * @private + */ + controlMessage(data) { + if (this._opcode === 0x08) { + this._loop = false; + + if (data.length === 0) { + this.emit('conclude', 1005, EMPTY_BUFFER$2); + this.end(); + + this._state = GET_INFO; + } else { + const code = data.readUInt16BE(0); + + if (!isValidStatusCode$1(code)) { + return error( + RangeError, + `invalid status code ${code}`, + true, + 1002, + 'WS_ERR_INVALID_CLOSE_CODE' + ); + } + + const buf = new FastBuffer( + data.buffer, + data.byteOffset + 2, + data.length - 2 + ); + + if (!this._skipUTF8Validation && !isValidUTF8(buf)) { + return error( + Error, + 'invalid UTF-8 sequence', + true, + 1007, + 'WS_ERR_INVALID_UTF8' + ); + } + + this.emit('conclude', code, buf); + this.end(); + + this._state = GET_INFO; + } + } else if (this._opcode === 0x09) { + this.emit('ping', data); + this._state = WAIT_MICROTASK; + } else { + this.emit('pong', data); + this._state = WAIT_MICROTASK; + } + } +}; + +var receiver = Receiver$1; + +/** + * Builds an error object. + * + * @param {function(new:Error|RangeError)} ErrorCtor The error constructor + * @param {String} message The error message + * @param {Boolean} prefix Specifies whether or not to add a default prefix to + * `message` + * @param {Number} statusCode The status code + * @param {String} errorCode The exposed error code + * @return {(Error|RangeError)} The error + * @private + */ +function error(ErrorCtor, message, prefix, statusCode, errorCode) { + const err = new ErrorCtor( + prefix ? `Invalid WebSocket frame: ${message}` : message + ); + + Error.captureStackTrace(err, error); + err.code = errorCode; + err[kStatusCode$1] = statusCode; + return err; +} + +/** + * A shim for `queueMicrotask()`. + * + * @param {Function} cb Callback + */ +function queueMicrotaskShim(cb) { + promise.then(cb).catch(throwErrorNextTick); +} + +/** + * Throws an error. + * + * @param {Error} err The error to throw + * @private + */ +function throwError(err) { + throw err; +} + +/** + * Throws an error in the next tick. + * + * @param {Error} err The error to throw + * @private + */ +function throwErrorNextTick(err) { + process.nextTick(throwError, err); +} + +/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex" }] */ +const { randomFillSync } = require$$1; + +const PerMessageDeflate$2 = permessageDeflate; +const { EMPTY_BUFFER: EMPTY_BUFFER$1 } = constants; +const { isValidStatusCode } = validationExports; +const { mask: applyMask, toBuffer: toBuffer$1 } = bufferUtilExports; + +const kByteLength = Symbol('kByteLength'); +const maskBuffer = Buffer.alloc(4); + +/** + * HyBi Sender implementation. + */ +let Sender$1 = class Sender { + /** + * Creates a Sender instance. + * + * @param {Duplex} socket The connection socket + * @param {Object} [extensions] An object containing the negotiated extensions + * @param {Function} [generateMask] The function used to generate the masking + * key + */ + constructor(socket, extensions, generateMask) { + this._extensions = extensions || {}; + + if (generateMask) { + this._generateMask = generateMask; + this._maskBuffer = Buffer.alloc(4); + } + + this._socket = socket; + + this._firstFragment = true; + this._compress = false; + + this._bufferedBytes = 0; + this._deflating = false; + this._queue = []; + } + + /** + * Frames a piece of data according to the HyBi WebSocket protocol. + * + * @param {(Buffer|String)} data The data to frame + * @param {Object} options Options object + * @param {Boolean} [options.fin=false] Specifies whether or not to set the + * FIN bit + * @param {Function} [options.generateMask] The function used to generate the + * masking key + * @param {Boolean} [options.mask=false] Specifies whether or not to mask + * `data` + * @param {Buffer} [options.maskBuffer] The buffer used to store the masking + * key + * @param {Number} options.opcode The opcode + * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be + * modified + * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the + * RSV1 bit + * @return {(Buffer|String)[]} The framed data + * @public + */ + static frame(data, options) { + let mask; + let merge = false; + let offset = 2; + let skipMasking = false; + + if (options.mask) { + mask = options.maskBuffer || maskBuffer; + + if (options.generateMask) { + options.generateMask(mask); + } else { + randomFillSync(mask, 0, 4); + } + + skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0; + offset = 6; + } + + let dataLength; + + if (typeof data === 'string') { + if ( + (!options.mask || skipMasking) && + options[kByteLength] !== undefined + ) { + dataLength = options[kByteLength]; + } else { + data = Buffer.from(data); + dataLength = data.length; + } + } else { + dataLength = data.length; + merge = options.mask && options.readOnly && !skipMasking; + } + + let payloadLength = dataLength; + + if (dataLength >= 65536) { + offset += 8; + payloadLength = 127; + } else if (dataLength > 125) { + offset += 2; + payloadLength = 126; + } + + const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset); + + target[0] = options.fin ? options.opcode | 0x80 : options.opcode; + if (options.rsv1) target[0] |= 0x40; + + target[1] = payloadLength; + + if (payloadLength === 126) { + target.writeUInt16BE(dataLength, 2); + } else if (payloadLength === 127) { + target[2] = target[3] = 0; + target.writeUIntBE(dataLength, 4, 6); + } + + if (!options.mask) return [target, data]; + + target[1] |= 0x80; + target[offset - 4] = mask[0]; + target[offset - 3] = mask[1]; + target[offset - 2] = mask[2]; + target[offset - 1] = mask[3]; + + if (skipMasking) return [target, data]; + + if (merge) { + applyMask(data, mask, target, offset, dataLength); + return [target]; + } + + applyMask(data, mask, data, 0, dataLength); + return [target, data]; + } + + /** + * Sends a close message to the other peer. + * + * @param {Number} [code] The status code component of the body + * @param {(String|Buffer)} [data] The message component of the body + * @param {Boolean} [mask=false] Specifies whether or not to mask the message + * @param {Function} [cb] Callback + * @public + */ + close(code, data, mask, cb) { + let buf; + + if (code === undefined) { + buf = EMPTY_BUFFER$1; + } else if (typeof code !== 'number' || !isValidStatusCode(code)) { + throw new TypeError('First argument must be a valid error code number'); + } else if (data === undefined || !data.length) { + buf = Buffer.allocUnsafe(2); + buf.writeUInt16BE(code, 0); + } else { + const length = Buffer.byteLength(data); + + if (length > 123) { + throw new RangeError('The message must not be greater than 123 bytes'); + } + + buf = Buffer.allocUnsafe(2 + length); + buf.writeUInt16BE(code, 0); + + if (typeof data === 'string') { + buf.write(data, 2); + } else { + buf.set(data, 2); + } + } + + const options = { + [kByteLength]: buf.length, + fin: true, + generateMask: this._generateMask, + mask, + maskBuffer: this._maskBuffer, + opcode: 0x08, + readOnly: false, + rsv1: false + }; + + if (this._deflating) { + this.enqueue([this.dispatch, buf, false, options, cb]); + } else { + this.sendFrame(Sender.frame(buf, options), cb); + } + } + + /** + * Sends a ping message to the other peer. + * + * @param {*} data The message to send + * @param {Boolean} [mask=false] Specifies whether or not to mask `data` + * @param {Function} [cb] Callback + * @public + */ + ping(data, mask, cb) { + let byteLength; + let readOnly; + + if (typeof data === 'string') { + byteLength = Buffer.byteLength(data); + readOnly = false; + } else { + data = toBuffer$1(data); + byteLength = data.length; + readOnly = toBuffer$1.readOnly; + } + + if (byteLength > 125) { + throw new RangeError('The data size must not be greater than 125 bytes'); + } + + const options = { + [kByteLength]: byteLength, + fin: true, + generateMask: this._generateMask, + mask, + maskBuffer: this._maskBuffer, + opcode: 0x09, + readOnly, + rsv1: false + }; + + if (this._deflating) { + this.enqueue([this.dispatch, data, false, options, cb]); + } else { + this.sendFrame(Sender.frame(data, options), cb); + } + } + + /** + * Sends a pong message to the other peer. + * + * @param {*} data The message to send + * @param {Boolean} [mask=false] Specifies whether or not to mask `data` + * @param {Function} [cb] Callback + * @public + */ + pong(data, mask, cb) { + let byteLength; + let readOnly; + + if (typeof data === 'string') { + byteLength = Buffer.byteLength(data); + readOnly = false; + } else { + data = toBuffer$1(data); + byteLength = data.length; + readOnly = toBuffer$1.readOnly; + } + + if (byteLength > 125) { + throw new RangeError('The data size must not be greater than 125 bytes'); + } + + const options = { + [kByteLength]: byteLength, + fin: true, + generateMask: this._generateMask, + mask, + maskBuffer: this._maskBuffer, + opcode: 0x0a, + readOnly, + rsv1: false + }; + + if (this._deflating) { + this.enqueue([this.dispatch, data, false, options, cb]); + } else { + this.sendFrame(Sender.frame(data, options), cb); + } + } + + /** + * Sends a data message to the other peer. + * + * @param {*} data The message to send + * @param {Object} options Options object + * @param {Boolean} [options.binary=false] Specifies whether `data` is binary + * or text + * @param {Boolean} [options.compress=false] Specifies whether or not to + * compress `data` + * @param {Boolean} [options.fin=false] Specifies whether the fragment is the + * last one + * @param {Boolean} [options.mask=false] Specifies whether or not to mask + * `data` + * @param {Function} [cb] Callback + * @public + */ + send(data, options, cb) { + const perMessageDeflate = this._extensions[PerMessageDeflate$2.extensionName]; + let opcode = options.binary ? 2 : 1; + let rsv1 = options.compress; + + let byteLength; + let readOnly; + + if (typeof data === 'string') { + byteLength = Buffer.byteLength(data); + readOnly = false; + } else { + data = toBuffer$1(data); + byteLength = data.length; + readOnly = toBuffer$1.readOnly; + } + + if (this._firstFragment) { + this._firstFragment = false; + if ( + rsv1 && + perMessageDeflate && + perMessageDeflate.params[ + perMessageDeflate._isServer + ? 'server_no_context_takeover' + : 'client_no_context_takeover' + ] + ) { + rsv1 = byteLength >= perMessageDeflate._threshold; + } + this._compress = rsv1; + } else { + rsv1 = false; + opcode = 0; + } + + if (options.fin) this._firstFragment = true; + + if (perMessageDeflate) { + const opts = { + [kByteLength]: byteLength, + fin: options.fin, + generateMask: this._generateMask, + mask: options.mask, + maskBuffer: this._maskBuffer, + opcode, + readOnly, + rsv1 + }; + + if (this._deflating) { + this.enqueue([this.dispatch, data, this._compress, opts, cb]); + } else { + this.dispatch(data, this._compress, opts, cb); + } + } else { + this.sendFrame( + Sender.frame(data, { + [kByteLength]: byteLength, + fin: options.fin, + generateMask: this._generateMask, + mask: options.mask, + maskBuffer: this._maskBuffer, + opcode, + readOnly, + rsv1: false + }), + cb + ); + } + } + + /** + * Dispatches a message. + * + * @param {(Buffer|String)} data The message to send + * @param {Boolean} [compress=false] Specifies whether or not to compress + * `data` + * @param {Object} options Options object + * @param {Boolean} [options.fin=false] Specifies whether or not to set the + * FIN bit + * @param {Function} [options.generateMask] The function used to generate the + * masking key + * @param {Boolean} [options.mask=false] Specifies whether or not to mask + * `data` + * @param {Buffer} [options.maskBuffer] The buffer used to store the masking + * key + * @param {Number} options.opcode The opcode + * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be + * modified + * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the + * RSV1 bit + * @param {Function} [cb] Callback + * @private + */ + dispatch(data, compress, options, cb) { + if (!compress) { + this.sendFrame(Sender.frame(data, options), cb); + return; + } + + const perMessageDeflate = this._extensions[PerMessageDeflate$2.extensionName]; + + this._bufferedBytes += options[kByteLength]; + this._deflating = true; + perMessageDeflate.compress(data, options.fin, (_, buf) => { + if (this._socket.destroyed) { + const err = new Error( + 'The socket was closed while data was being compressed' + ); + + if (typeof cb === 'function') cb(err); + + for (let i = 0; i < this._queue.length; i++) { + const params = this._queue[i]; + const callback = params[params.length - 1]; + + if (typeof callback === 'function') callback(err); + } + + return; + } + + this._bufferedBytes -= options[kByteLength]; + this._deflating = false; + options.readOnly = false; + this.sendFrame(Sender.frame(buf, options), cb); + this.dequeue(); + }); + } + + /** + * Executes queued send operations. + * + * @private + */ + dequeue() { + while (!this._deflating && this._queue.length) { + const params = this._queue.shift(); + + this._bufferedBytes -= params[3][kByteLength]; + Reflect.apply(params[0], this, params.slice(1)); + } + } + + /** + * Enqueues a send operation. + * + * @param {Array} params Send operation parameters. + * @private + */ + enqueue(params) { + this._bufferedBytes += params[3][kByteLength]; + this._queue.push(params); + } + + /** + * Sends a frame. + * + * @param {Buffer[]} list The frame to send + * @param {Function} [cb] Callback + * @private + */ + sendFrame(list, cb) { + if (list.length === 2) { + this._socket.cork(); + this._socket.write(list[0]); + this._socket.write(list[1], cb); + this._socket.uncork(); + } else { + this._socket.write(list[0], cb); + } + } +}; + +var sender = Sender$1; + +const { kForOnEventAttribute: kForOnEventAttribute$1, kListener: kListener$1 } = constants; + +const kCode = Symbol('kCode'); +const kData = Symbol('kData'); +const kError = Symbol('kError'); +const kMessage = Symbol('kMessage'); +const kReason = Symbol('kReason'); +const kTarget = Symbol('kTarget'); +const kType = Symbol('kType'); +const kWasClean = Symbol('kWasClean'); + +/** + * Class representing an event. + */ +class Event { + /** + * Create a new `Event`. + * + * @param {String} type The name of the event + * @throws {TypeError} If the `type` argument is not specified + */ + constructor(type) { + this[kTarget] = null; + this[kType] = type; + } + + /** + * @type {*} + */ + get target() { + return this[kTarget]; + } + + /** + * @type {String} + */ + get type() { + return this[kType]; + } +} + +Object.defineProperty(Event.prototype, 'target', { enumerable: true }); +Object.defineProperty(Event.prototype, 'type', { enumerable: true }); + +/** + * Class representing a close event. + * + * @extends Event + */ +class CloseEvent extends Event { + /** + * Create a new `CloseEvent`. + * + * @param {String} type The name of the event + * @param {Object} [options] A dictionary object that allows for setting + * attributes via object members of the same name + * @param {Number} [options.code=0] The status code explaining why the + * connection was closed + * @param {String} [options.reason=''] A human-readable string explaining why + * the connection was closed + * @param {Boolean} [options.wasClean=false] Indicates whether or not the + * connection was cleanly closed + */ + constructor(type, options = {}) { + super(type); + + this[kCode] = options.code === undefined ? 0 : options.code; + this[kReason] = options.reason === undefined ? '' : options.reason; + this[kWasClean] = options.wasClean === undefined ? false : options.wasClean; + } + + /** + * @type {Number} + */ + get code() { + return this[kCode]; + } + + /** + * @type {String} + */ + get reason() { + return this[kReason]; + } + + /** + * @type {Boolean} + */ + get wasClean() { + return this[kWasClean]; + } +} + +Object.defineProperty(CloseEvent.prototype, 'code', { enumerable: true }); +Object.defineProperty(CloseEvent.prototype, 'reason', { enumerable: true }); +Object.defineProperty(CloseEvent.prototype, 'wasClean', { enumerable: true }); + +/** + * Class representing an error event. + * + * @extends Event + */ +class ErrorEvent extends Event { + /** + * Create a new `ErrorEvent`. + * + * @param {String} type The name of the event + * @param {Object} [options] A dictionary object that allows for setting + * attributes via object members of the same name + * @param {*} [options.error=null] The error that generated this event + * @param {String} [options.message=''] The error message + */ + constructor(type, options = {}) { + super(type); + + this[kError] = options.error === undefined ? null : options.error; + this[kMessage] = options.message === undefined ? '' : options.message; + } + + /** + * @type {*} + */ + get error() { + return this[kError]; + } + + /** + * @type {String} + */ + get message() { + return this[kMessage]; + } +} + +Object.defineProperty(ErrorEvent.prototype, 'error', { enumerable: true }); +Object.defineProperty(ErrorEvent.prototype, 'message', { enumerable: true }); + +/** + * Class representing a message event. + * + * @extends Event + */ +class MessageEvent extends Event { + /** + * Create a new `MessageEvent`. + * + * @param {String} type The name of the event + * @param {Object} [options] A dictionary object that allows for setting + * attributes via object members of the same name + * @param {*} [options.data=null] The message content + */ + constructor(type, options = {}) { + super(type); + + this[kData] = options.data === undefined ? null : options.data; + } + + /** + * @type {*} + */ + get data() { + return this[kData]; + } +} + +Object.defineProperty(MessageEvent.prototype, 'data', { enumerable: true }); + +/** + * This provides methods for emulating the `EventTarget` interface. It's not + * meant to be used directly. + * + * @mixin + */ +const EventTarget = { + /** + * Register an event listener. + * + * @param {String} type A string representing the event type to listen for + * @param {(Function|Object)} handler The listener to add + * @param {Object} [options] An options object specifies characteristics about + * the event listener + * @param {Boolean} [options.once=false] A `Boolean` indicating that the + * listener should be invoked at most once after being added. If `true`, + * the listener would be automatically removed when invoked. + * @public + */ + addEventListener(type, handler, options = {}) { + for (const listener of this.listeners(type)) { + if ( + !options[kForOnEventAttribute$1] && + listener[kListener$1] === handler && + !listener[kForOnEventAttribute$1] + ) { + return; + } + } + + let wrapper; + + if (type === 'message') { + wrapper = function onMessage(data, isBinary) { + const event = new MessageEvent('message', { + data: isBinary ? data : data.toString() + }); + + event[kTarget] = this; + callListener(handler, this, event); + }; + } else if (type === 'close') { + wrapper = function onClose(code, message) { + const event = new CloseEvent('close', { + code, + reason: message.toString(), + wasClean: this._closeFrameReceived && this._closeFrameSent + }); + + event[kTarget] = this; + callListener(handler, this, event); + }; + } else if (type === 'error') { + wrapper = function onError(error) { + const event = new ErrorEvent('error', { + error, + message: error.message + }); + + event[kTarget] = this; + callListener(handler, this, event); + }; + } else if (type === 'open') { + wrapper = function onOpen() { + const event = new Event('open'); + + event[kTarget] = this; + callListener(handler, this, event); + }; + } else { + return; + } + + wrapper[kForOnEventAttribute$1] = !!options[kForOnEventAttribute$1]; + wrapper[kListener$1] = handler; + + if (options.once) { + this.once(type, wrapper); + } else { + this.on(type, wrapper); + } + }, + + /** + * Remove an event listener. + * + * @param {String} type A string representing the event type to remove + * @param {(Function|Object)} handler The listener to remove + * @public + */ + removeEventListener(type, handler) { + for (const listener of this.listeners(type)) { + if (listener[kListener$1] === handler && !listener[kForOnEventAttribute$1]) { + this.removeListener(type, listener); + break; + } + } + } +}; + +var eventTarget = { + CloseEvent, + ErrorEvent, + Event, + EventTarget, + MessageEvent +}; + +/** + * Call an event listener + * + * @param {(Function|Object)} listener The listener to call + * @param {*} thisArg The value to use as `this`` when calling the listener + * @param {Event} event The event to pass to the listener + * @private + */ +function callListener(listener, thisArg, event) { + if (typeof listener === 'object' && listener.handleEvent) { + listener.handleEvent.call(listener, event); + } else { + listener.call(thisArg, event); + } +} + +const { tokenChars: tokenChars$1 } = validationExports; + +/** + * Adds an offer to the map of extension offers or a parameter to the map of + * parameters. + * + * @param {Object} dest The map of extension offers or parameters + * @param {String} name The extension or parameter name + * @param {(Object|Boolean|String)} elem The extension parameters or the + * parameter value + * @private + */ +function push(dest, name, elem) { + if (dest[name] === undefined) dest[name] = [elem]; + else dest[name].push(elem); +} + +/** + * Parses the `Sec-WebSocket-Extensions` header into an object. + * + * @param {String} header The field value of the header + * @return {Object} The parsed object + * @public + */ +function parse$2(header) { + const offers = Object.create(null); + let params = Object.create(null); + let mustUnescape = false; + let isEscaping = false; + let inQuotes = false; + let extensionName; + let paramName; + let start = -1; + let code = -1; + let end = -1; + let i = 0; + + for (; i < header.length; i++) { + code = header.charCodeAt(i); + + if (extensionName === undefined) { + if (end === -1 && tokenChars$1[code] === 1) { + if (start === -1) start = i; + } else if ( + i !== 0 && + (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */ + ) { + if (end === -1 && start !== -1) end = i; + } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) { + if (start === -1) { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + + if (end === -1) end = i; + const name = header.slice(start, end); + if (code === 0x2c) { + push(offers, name, params); + params = Object.create(null); + } else { + extensionName = name; + } + + start = end = -1; + } else { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + } else if (paramName === undefined) { + if (end === -1 && tokenChars$1[code] === 1) { + if (start === -1) start = i; + } else if (code === 0x20 || code === 0x09) { + if (end === -1 && start !== -1) end = i; + } else if (code === 0x3b || code === 0x2c) { + if (start === -1) { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + + if (end === -1) end = i; + push(params, header.slice(start, end), true); + if (code === 0x2c) { + push(offers, extensionName, params); + params = Object.create(null); + extensionName = undefined; + } + + start = end = -1; + } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) { + paramName = header.slice(start, i); + start = end = -1; + } else { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + } else { + // + // The value of a quoted-string after unescaping must conform to the + // token ABNF, so only token characters are valid. + // Ref: https://tools.ietf.org/html/rfc6455#section-9.1 + // + if (isEscaping) { + if (tokenChars$1[code] !== 1) { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + if (start === -1) start = i; + else if (!mustUnescape) mustUnescape = true; + isEscaping = false; + } else if (inQuotes) { + if (tokenChars$1[code] === 1) { + if (start === -1) start = i; + } else if (code === 0x22 /* '"' */ && start !== -1) { + inQuotes = false; + end = i; + } else if (code === 0x5c /* '\' */) { + isEscaping = true; + } else { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) { + inQuotes = true; + } else if (end === -1 && tokenChars$1[code] === 1) { + if (start === -1) start = i; + } else if (start !== -1 && (code === 0x20 || code === 0x09)) { + if (end === -1) end = i; + } else if (code === 0x3b || code === 0x2c) { + if (start === -1) { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + + if (end === -1) end = i; + let value = header.slice(start, end); + if (mustUnescape) { + value = value.replace(/\\/g, ''); + mustUnescape = false; + } + push(params, paramName, value); + if (code === 0x2c) { + push(offers, extensionName, params); + params = Object.create(null); + extensionName = undefined; + } + + paramName = undefined; + start = end = -1; + } else { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + } + } + + if (start === -1 || inQuotes || code === 0x20 || code === 0x09) { + throw new SyntaxError('Unexpected end of input'); + } + + if (end === -1) end = i; + const token = header.slice(start, end); + if (extensionName === undefined) { + push(offers, token, params); + } else { + if (paramName === undefined) { + push(params, token, true); + } else if (mustUnescape) { + push(params, paramName, token.replace(/\\/g, '')); + } else { + push(params, paramName, token); + } + push(offers, extensionName, params); + } + + return offers; +} + +/** + * Builds the `Sec-WebSocket-Extensions` header field value. + * + * @param {Object} extensions The map of extensions and parameters to format + * @return {String} A string representing the given object + * @public + */ +function format$1(extensions) { + return Object.keys(extensions) + .map((extension) => { + let configurations = extensions[extension]; + if (!Array.isArray(configurations)) configurations = [configurations]; + return configurations + .map((params) => { + return [extension] + .concat( + Object.keys(params).map((k) => { + let values = params[k]; + if (!Array.isArray(values)) values = [values]; + return values + .map((v) => (v === true ? k : `${k}=${v}`)) + .join('; '); + }) + ) + .join('; '); + }) + .join(', '); + }) + .join(', '); +} + +var extension$1 = { format: format$1, parse: parse$2 }; + +/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex|Readable$" }] */ + +const EventEmitter$1 = require$$2; +const https = require$$1$1; +const http$1 = require$$2$1; +const net = require$$3; +const tls = require$$4; +const { randomBytes, createHash: createHash$1 } = require$$1; +const { URL: URL$1 } = require$$7; + +const PerMessageDeflate$1 = permessageDeflate; +const Receiver = receiver; +const Sender = sender; +const { + BINARY_TYPES, + EMPTY_BUFFER, + GUID: GUID$1, + kForOnEventAttribute, + kListener, + kStatusCode, + kWebSocket: kWebSocket$1, + NOOP +} = constants; +const { + EventTarget: { addEventListener, removeEventListener } +} = eventTarget; +const { format, parse: parse$1 } = extension$1; +const { toBuffer } = bufferUtilExports; + +const closeTimeout = 30 * 1000; +const kAborted = Symbol('kAborted'); +const protocolVersions = [8, 13]; +const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']; +const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/; + +/** + * Class representing a WebSocket. + * + * @extends EventEmitter + */ +let WebSocket$1 = class WebSocket extends EventEmitter$1 { + /** + * Create a new `WebSocket`. + * + * @param {(String|URL)} address The URL to which to connect + * @param {(String|String[])} [protocols] The subprotocols + * @param {Object} [options] Connection options + */ + constructor(address, protocols, options) { + super(); + + this._binaryType = BINARY_TYPES[0]; + this._closeCode = 1006; + this._closeFrameReceived = false; + this._closeFrameSent = false; + this._closeMessage = EMPTY_BUFFER; + this._closeTimer = null; + this._extensions = {}; + this._paused = false; + this._protocol = ''; + this._readyState = WebSocket.CONNECTING; + this._receiver = null; + this._sender = null; + this._socket = null; + + if (address !== null) { + this._bufferedAmount = 0; + this._isServer = false; + this._redirects = 0; + + if (protocols === undefined) { + protocols = []; + } else if (!Array.isArray(protocols)) { + if (typeof protocols === 'object' && protocols !== null) { + options = protocols; + protocols = []; + } else { + protocols = [protocols]; + } + } + + initAsClient(this, address, protocols, options); + } else { + this._isServer = true; + } + } + + /** + * This deviates from the WHATWG interface since ws doesn't support the + * required default "blob" type (instead we define a custom "nodebuffer" + * type). + * + * @type {String} + */ + get binaryType() { + return this._binaryType; + } + + set binaryType(type) { + if (!BINARY_TYPES.includes(type)) return; + + this._binaryType = type; + + // + // Allow to change `binaryType` on the fly. + // + if (this._receiver) this._receiver._binaryType = type; + } + + /** + * @type {Number} + */ + get bufferedAmount() { + if (!this._socket) return this._bufferedAmount; + + return this._socket._writableState.length + this._sender._bufferedBytes; + } + + /** + * @type {String} + */ + get extensions() { + return Object.keys(this._extensions).join(); + } + + /** + * @type {Boolean} + */ + get isPaused() { + return this._paused; + } + + /** + * @type {Function} + */ + /* istanbul ignore next */ + get onclose() { + return null; + } + + /** + * @type {Function} + */ + /* istanbul ignore next */ + get onerror() { + return null; + } + + /** + * @type {Function} + */ + /* istanbul ignore next */ + get onopen() { + return null; + } + + /** + * @type {Function} + */ + /* istanbul ignore next */ + get onmessage() { + return null; + } + + /** + * @type {String} + */ + get protocol() { + return this._protocol; + } + + /** + * @type {Number} + */ + get readyState() { + return this._readyState; + } + + /** + * @type {String} + */ + get url() { + return this._url; + } + + /** + * Set up the socket and the internal resources. + * + * @param {Duplex} socket The network socket between the server and client + * @param {Buffer} head The first packet of the upgraded stream + * @param {Object} options Options object + * @param {Function} [options.generateMask] The function used to generate the + * masking key + * @param {Number} [options.maxPayload=0] The maximum allowed message size + * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or + * not to skip UTF-8 validation for text and close messages + * @private + */ + setSocket(socket, head, options) { + const receiver = new Receiver({ + binaryType: this.binaryType, + extensions: this._extensions, + isServer: this._isServer, + maxPayload: options.maxPayload, + skipUTF8Validation: options.skipUTF8Validation + }); + + this._sender = new Sender(socket, this._extensions, options.generateMask); + this._receiver = receiver; + this._socket = socket; + + receiver[kWebSocket$1] = this; + socket[kWebSocket$1] = this; + + receiver.on('conclude', receiverOnConclude); + receiver.on('drain', receiverOnDrain); + receiver.on('error', receiverOnError); + receiver.on('message', receiverOnMessage); + receiver.on('ping', receiverOnPing); + receiver.on('pong', receiverOnPong); + + // + // These methods may not be available if `socket` is just a `Duplex`. + // + if (socket.setTimeout) socket.setTimeout(0); + if (socket.setNoDelay) socket.setNoDelay(); + + if (head.length > 0) socket.unshift(head); + + socket.on('close', socketOnClose); + socket.on('data', socketOnData); + socket.on('end', socketOnEnd); + socket.on('error', socketOnError$1); + + this._readyState = WebSocket.OPEN; + this.emit('open'); + } + + /** + * Emit the `'close'` event. + * + * @private + */ + emitClose() { + if (!this._socket) { + this._readyState = WebSocket.CLOSED; + this.emit('close', this._closeCode, this._closeMessage); + return; + } + + if (this._extensions[PerMessageDeflate$1.extensionName]) { + this._extensions[PerMessageDeflate$1.extensionName].cleanup(); + } + + this._receiver.removeAllListeners(); + this._readyState = WebSocket.CLOSED; + this.emit('close', this._closeCode, this._closeMessage); + } + + /** + * Start a closing handshake. + * + * +----------+ +-----------+ +----------+ + * - - -|ws.close()|-->|close frame|-->|ws.close()|- - - + * | +----------+ +-----------+ +----------+ | + * +----------+ +-----------+ | + * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING + * +----------+ +-----------+ | + * | | | +---+ | + * +------------------------+-->|fin| - - - - + * | +---+ | +---+ + * - - - - -|fin|<---------------------+ + * +---+ + * + * @param {Number} [code] Status code explaining why the connection is closing + * @param {(String|Buffer)} [data] The reason why the connection is + * closing + * @public + */ + close(code, data) { + if (this.readyState === WebSocket.CLOSED) return; + if (this.readyState === WebSocket.CONNECTING) { + const msg = 'WebSocket was closed before the connection was established'; + abortHandshake$1(this, this._req, msg); + return; + } + + if (this.readyState === WebSocket.CLOSING) { + if ( + this._closeFrameSent && + (this._closeFrameReceived || this._receiver._writableState.errorEmitted) + ) { + this._socket.end(); + } + + return; + } + + this._readyState = WebSocket.CLOSING; + this._sender.close(code, data, !this._isServer, (err) => { + // + // This error is handled by the `'error'` listener on the socket. We only + // want to know if the close frame has been sent here. + // + if (err) return; + + this._closeFrameSent = true; + + if ( + this._closeFrameReceived || + this._receiver._writableState.errorEmitted + ) { + this._socket.end(); + } + }); + + // + // Specify a timeout for the closing handshake to complete. + // + this._closeTimer = setTimeout( + this._socket.destroy.bind(this._socket), + closeTimeout + ); + } + + /** + * Pause the socket. + * + * @public + */ + pause() { + if ( + this.readyState === WebSocket.CONNECTING || + this.readyState === WebSocket.CLOSED + ) { + return; + } + + this._paused = true; + this._socket.pause(); + } + + /** + * Send a ping. + * + * @param {*} [data] The data to send + * @param {Boolean} [mask] Indicates whether or not to mask `data` + * @param {Function} [cb] Callback which is executed when the ping is sent + * @public + */ + ping(data, mask, cb) { + if (this.readyState === WebSocket.CONNECTING) { + throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); + } + + if (typeof data === 'function') { + cb = data; + data = mask = undefined; + } else if (typeof mask === 'function') { + cb = mask; + mask = undefined; + } + + if (typeof data === 'number') data = data.toString(); + + if (this.readyState !== WebSocket.OPEN) { + sendAfterClose(this, data, cb); + return; + } + + if (mask === undefined) mask = !this._isServer; + this._sender.ping(data || EMPTY_BUFFER, mask, cb); + } + + /** + * Send a pong. + * + * @param {*} [data] The data to send + * @param {Boolean} [mask] Indicates whether or not to mask `data` + * @param {Function} [cb] Callback which is executed when the pong is sent + * @public + */ + pong(data, mask, cb) { + if (this.readyState === WebSocket.CONNECTING) { + throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); + } + + if (typeof data === 'function') { + cb = data; + data = mask = undefined; + } else if (typeof mask === 'function') { + cb = mask; + mask = undefined; + } + + if (typeof data === 'number') data = data.toString(); + + if (this.readyState !== WebSocket.OPEN) { + sendAfterClose(this, data, cb); + return; + } + + if (mask === undefined) mask = !this._isServer; + this._sender.pong(data || EMPTY_BUFFER, mask, cb); + } + + /** + * Resume the socket. + * + * @public + */ + resume() { + if ( + this.readyState === WebSocket.CONNECTING || + this.readyState === WebSocket.CLOSED + ) { + return; + } + + this._paused = false; + if (!this._receiver._writableState.needDrain) this._socket.resume(); + } + + /** + * Send a data message. + * + * @param {*} data The message to send + * @param {Object} [options] Options object + * @param {Boolean} [options.binary] Specifies whether `data` is binary or + * text + * @param {Boolean} [options.compress] Specifies whether or not to compress + * `data` + * @param {Boolean} [options.fin=true] Specifies whether the fragment is the + * last one + * @param {Boolean} [options.mask] Specifies whether or not to mask `data` + * @param {Function} [cb] Callback which is executed when data is written out + * @public + */ + send(data, options, cb) { + if (this.readyState === WebSocket.CONNECTING) { + throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); + } + + if (typeof options === 'function') { + cb = options; + options = {}; + } + + if (typeof data === 'number') data = data.toString(); + + if (this.readyState !== WebSocket.OPEN) { + sendAfterClose(this, data, cb); + return; + } + + const opts = { + binary: typeof data !== 'string', + mask: !this._isServer, + compress: true, + fin: true, + ...options + }; + + if (!this._extensions[PerMessageDeflate$1.extensionName]) { + opts.compress = false; + } + + this._sender.send(data || EMPTY_BUFFER, opts, cb); + } + + /** + * Forcibly close the connection. + * + * @public + */ + terminate() { + if (this.readyState === WebSocket.CLOSED) return; + if (this.readyState === WebSocket.CONNECTING) { + const msg = 'WebSocket was closed before the connection was established'; + abortHandshake$1(this, this._req, msg); + return; + } + + if (this._socket) { + this._readyState = WebSocket.CLOSING; + this._socket.destroy(); + } + } +}; + +/** + * @constant {Number} CONNECTING + * @memberof WebSocket + */ +Object.defineProperty(WebSocket$1, 'CONNECTING', { + enumerable: true, + value: readyStates.indexOf('CONNECTING') +}); + +/** + * @constant {Number} CONNECTING + * @memberof WebSocket.prototype + */ +Object.defineProperty(WebSocket$1.prototype, 'CONNECTING', { + enumerable: true, + value: readyStates.indexOf('CONNECTING') +}); + +/** + * @constant {Number} OPEN + * @memberof WebSocket + */ +Object.defineProperty(WebSocket$1, 'OPEN', { + enumerable: true, + value: readyStates.indexOf('OPEN') +}); + +/** + * @constant {Number} OPEN + * @memberof WebSocket.prototype + */ +Object.defineProperty(WebSocket$1.prototype, 'OPEN', { + enumerable: true, + value: readyStates.indexOf('OPEN') +}); + +/** + * @constant {Number} CLOSING + * @memberof WebSocket + */ +Object.defineProperty(WebSocket$1, 'CLOSING', { + enumerable: true, + value: readyStates.indexOf('CLOSING') +}); + +/** + * @constant {Number} CLOSING + * @memberof WebSocket.prototype + */ +Object.defineProperty(WebSocket$1.prototype, 'CLOSING', { + enumerable: true, + value: readyStates.indexOf('CLOSING') +}); + +/** + * @constant {Number} CLOSED + * @memberof WebSocket + */ +Object.defineProperty(WebSocket$1, 'CLOSED', { + enumerable: true, + value: readyStates.indexOf('CLOSED') +}); + +/** + * @constant {Number} CLOSED + * @memberof WebSocket.prototype + */ +Object.defineProperty(WebSocket$1.prototype, 'CLOSED', { + enumerable: true, + value: readyStates.indexOf('CLOSED') +}); + +[ + 'binaryType', + 'bufferedAmount', + 'extensions', + 'isPaused', + 'protocol', + 'readyState', + 'url' +].forEach((property) => { + Object.defineProperty(WebSocket$1.prototype, property, { enumerable: true }); +}); + +// +// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes. +// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface +// +['open', 'error', 'close', 'message'].forEach((method) => { + Object.defineProperty(WebSocket$1.prototype, `on${method}`, { + enumerable: true, + get() { + for (const listener of this.listeners(method)) { + if (listener[kForOnEventAttribute]) return listener[kListener]; + } + + return null; + }, + set(handler) { + for (const listener of this.listeners(method)) { + if (listener[kForOnEventAttribute]) { + this.removeListener(method, listener); + break; + } + } + + if (typeof handler !== 'function') return; + + this.addEventListener(method, handler, { + [kForOnEventAttribute]: true + }); + } + }); +}); + +WebSocket$1.prototype.addEventListener = addEventListener; +WebSocket$1.prototype.removeEventListener = removeEventListener; + +var websocket = WebSocket$1; + +/** + * Initialize a WebSocket client. + * + * @param {WebSocket} websocket The client to initialize + * @param {(String|URL)} address The URL to which to connect + * @param {Array} protocols The subprotocols + * @param {Object} [options] Connection options + * @param {Boolean} [options.followRedirects=false] Whether or not to follow + * redirects + * @param {Function} [options.generateMask] The function used to generate the + * masking key + * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the + * handshake request + * @param {Number} [options.maxPayload=104857600] The maximum allowed message + * size + * @param {Number} [options.maxRedirects=10] The maximum number of redirects + * allowed + * @param {String} [options.origin] Value of the `Origin` or + * `Sec-WebSocket-Origin` header + * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable + * permessage-deflate + * @param {Number} [options.protocolVersion=13] Value of the + * `Sec-WebSocket-Version` header + * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or + * not to skip UTF-8 validation for text and close messages + * @private + */ +function initAsClient(websocket, address, protocols, options) { + const opts = { + protocolVersion: protocolVersions[1], + maxPayload: 100 * 1024 * 1024, + skipUTF8Validation: false, + perMessageDeflate: true, + followRedirects: false, + maxRedirects: 10, + ...options, + createConnection: undefined, + socketPath: undefined, + hostname: undefined, + protocol: undefined, + timeout: undefined, + method: 'GET', + host: undefined, + path: undefined, + port: undefined + }; + + if (!protocolVersions.includes(opts.protocolVersion)) { + throw new RangeError( + `Unsupported protocol version: ${opts.protocolVersion} ` + + `(supported versions: ${protocolVersions.join(', ')})` + ); + } + + let parsedUrl; + + if (address instanceof URL$1) { + parsedUrl = address; + } else { + try { + parsedUrl = new URL$1(address); + } catch (e) { + throw new SyntaxError(`Invalid URL: ${address}`); + } + } + + if (parsedUrl.protocol === 'http:') { + parsedUrl.protocol = 'ws:'; + } else if (parsedUrl.protocol === 'https:') { + parsedUrl.protocol = 'wss:'; + } + + websocket._url = parsedUrl.href; + + const isSecure = parsedUrl.protocol === 'wss:'; + const isIpcUrl = parsedUrl.protocol === 'ws+unix:'; + let invalidUrlMessage; + + if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) { + invalidUrlMessage = + 'The URL\'s protocol must be one of "ws:", "wss:", ' + + '"http:", "https", or "ws+unix:"'; + } else if (isIpcUrl && !parsedUrl.pathname) { + invalidUrlMessage = "The URL's pathname is empty"; + } else if (parsedUrl.hash) { + invalidUrlMessage = 'The URL contains a fragment identifier'; + } + + if (invalidUrlMessage) { + const err = new SyntaxError(invalidUrlMessage); + + if (websocket._redirects === 0) { + throw err; + } else { + emitErrorAndClose(websocket, err); + return; + } + } + + const defaultPort = isSecure ? 443 : 80; + const key = randomBytes(16).toString('base64'); + const request = isSecure ? https.request : http$1.request; + const protocolSet = new Set(); + let perMessageDeflate; + + opts.createConnection = isSecure ? tlsConnect : netConnect; + opts.defaultPort = opts.defaultPort || defaultPort; + opts.port = parsedUrl.port || defaultPort; + opts.host = parsedUrl.hostname.startsWith('[') + ? parsedUrl.hostname.slice(1, -1) + : parsedUrl.hostname; + opts.headers = { + ...opts.headers, + 'Sec-WebSocket-Version': opts.protocolVersion, + 'Sec-WebSocket-Key': key, + Connection: 'Upgrade', + Upgrade: 'websocket' + }; + opts.path = parsedUrl.pathname + parsedUrl.search; + opts.timeout = opts.handshakeTimeout; + + if (opts.perMessageDeflate) { + perMessageDeflate = new PerMessageDeflate$1( + opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, + false, + opts.maxPayload + ); + opts.headers['Sec-WebSocket-Extensions'] = format({ + [PerMessageDeflate$1.extensionName]: perMessageDeflate.offer() + }); + } + if (protocols.length) { + for (const protocol of protocols) { + if ( + typeof protocol !== 'string' || + !subprotocolRegex.test(protocol) || + protocolSet.has(protocol) + ) { + throw new SyntaxError( + 'An invalid or duplicated subprotocol was specified' + ); + } + + protocolSet.add(protocol); + } + + opts.headers['Sec-WebSocket-Protocol'] = protocols.join(','); + } + if (opts.origin) { + if (opts.protocolVersion < 13) { + opts.headers['Sec-WebSocket-Origin'] = opts.origin; + } else { + opts.headers.Origin = opts.origin; + } + } + if (parsedUrl.username || parsedUrl.password) { + opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; + } + + if (isIpcUrl) { + const parts = opts.path.split(':'); + + opts.socketPath = parts[0]; + opts.path = parts[1]; + } + + let req; + + if (opts.followRedirects) { + if (websocket._redirects === 0) { + websocket._originalIpc = isIpcUrl; + websocket._originalSecure = isSecure; + websocket._originalHostOrSocketPath = isIpcUrl + ? opts.socketPath + : parsedUrl.host; + + const headers = options && options.headers; + + // + // Shallow copy the user provided options so that headers can be changed + // without mutating the original object. + // + options = { ...options, headers: {} }; + + if (headers) { + for (const [key, value] of Object.entries(headers)) { + options.headers[key.toLowerCase()] = value; + } + } + } else if (websocket.listenerCount('redirect') === 0) { + const isSameHost = isIpcUrl + ? websocket._originalIpc + ? opts.socketPath === websocket._originalHostOrSocketPath + : false + : websocket._originalIpc + ? false + : parsedUrl.host === websocket._originalHostOrSocketPath; + + if (!isSameHost || (websocket._originalSecure && !isSecure)) { + // + // Match curl 7.77.0 behavior and drop the following headers. These + // headers are also dropped when following a redirect to a subdomain. + // + delete opts.headers.authorization; + delete opts.headers.cookie; + + if (!isSameHost) delete opts.headers.host; + + opts.auth = undefined; + } + } + + // + // Match curl 7.77.0 behavior and make the first `Authorization` header win. + // If the `Authorization` header is set, then there is nothing to do as it + // will take precedence. + // + if (opts.auth && !options.headers.authorization) { + options.headers.authorization = + 'Basic ' + Buffer.from(opts.auth).toString('base64'); + } + + req = websocket._req = request(opts); + + if (websocket._redirects) { + // + // Unlike what is done for the `'upgrade'` event, no early exit is + // triggered here if the user calls `websocket.close()` or + // `websocket.terminate()` from a listener of the `'redirect'` event. This + // is because the user can also call `request.destroy()` with an error + // before calling `websocket.close()` or `websocket.terminate()` and this + // would result in an error being emitted on the `request` object with no + // `'error'` event listeners attached. + // + websocket.emit('redirect', websocket.url, req); + } + } else { + req = websocket._req = request(opts); + } + + if (opts.timeout) { + req.on('timeout', () => { + abortHandshake$1(websocket, req, 'Opening handshake has timed out'); + }); + } + + req.on('error', (err) => { + if (req === null || req[kAborted]) return; + + req = websocket._req = null; + emitErrorAndClose(websocket, err); + }); + + req.on('response', (res) => { + const location = res.headers.location; + const statusCode = res.statusCode; + + if ( + location && + opts.followRedirects && + statusCode >= 300 && + statusCode < 400 + ) { + if (++websocket._redirects > opts.maxRedirects) { + abortHandshake$1(websocket, req, 'Maximum redirects exceeded'); + return; + } + + req.abort(); + + let addr; + + try { + addr = new URL$1(location, address); + } catch (e) { + const err = new SyntaxError(`Invalid URL: ${location}`); + emitErrorAndClose(websocket, err); + return; + } + + initAsClient(websocket, addr, protocols, options); + } else if (!websocket.emit('unexpected-response', req, res)) { + abortHandshake$1( + websocket, + req, + `Unexpected server response: ${res.statusCode}` + ); + } + }); + + req.on('upgrade', (res, socket, head) => { + websocket.emit('upgrade', res); + + // + // The user may have closed the connection from a listener of the + // `'upgrade'` event. + // + if (websocket.readyState !== WebSocket$1.CONNECTING) return; + + req = websocket._req = null; + + if (res.headers.upgrade.toLowerCase() !== 'websocket') { + abortHandshake$1(websocket, socket, 'Invalid Upgrade header'); + return; + } + + const digest = createHash$1('sha1') + .update(key + GUID$1) + .digest('base64'); + + if (res.headers['sec-websocket-accept'] !== digest) { + abortHandshake$1(websocket, socket, 'Invalid Sec-WebSocket-Accept header'); + return; + } + + const serverProt = res.headers['sec-websocket-protocol']; + let protError; + + if (serverProt !== undefined) { + if (!protocolSet.size) { + protError = 'Server sent a subprotocol but none was requested'; + } else if (!protocolSet.has(serverProt)) { + protError = 'Server sent an invalid subprotocol'; + } + } else if (protocolSet.size) { + protError = 'Server sent no subprotocol'; + } + + if (protError) { + abortHandshake$1(websocket, socket, protError); + return; + } + + if (serverProt) websocket._protocol = serverProt; + + const secWebSocketExtensions = res.headers['sec-websocket-extensions']; + + if (secWebSocketExtensions !== undefined) { + if (!perMessageDeflate) { + const message = + 'Server sent a Sec-WebSocket-Extensions header but no extension ' + + 'was requested'; + abortHandshake$1(websocket, socket, message); + return; + } + + let extensions; + + try { + extensions = parse$1(secWebSocketExtensions); + } catch (err) { + const message = 'Invalid Sec-WebSocket-Extensions header'; + abortHandshake$1(websocket, socket, message); + return; + } + + const extensionNames = Object.keys(extensions); + + if ( + extensionNames.length !== 1 || + extensionNames[0] !== PerMessageDeflate$1.extensionName + ) { + const message = 'Server indicated an extension that was not requested'; + abortHandshake$1(websocket, socket, message); + return; + } + + try { + perMessageDeflate.accept(extensions[PerMessageDeflate$1.extensionName]); + } catch (err) { + const message = 'Invalid Sec-WebSocket-Extensions header'; + abortHandshake$1(websocket, socket, message); + return; + } + + websocket._extensions[PerMessageDeflate$1.extensionName] = + perMessageDeflate; + } + + websocket.setSocket(socket, head, { + generateMask: opts.generateMask, + maxPayload: opts.maxPayload, + skipUTF8Validation: opts.skipUTF8Validation + }); + }); + + if (opts.finishRequest) { + opts.finishRequest(req, websocket); + } else { + req.end(); + } +} + +/** + * Emit the `'error'` and `'close'` events. + * + * @param {WebSocket} websocket The WebSocket instance + * @param {Error} The error to emit + * @private + */ +function emitErrorAndClose(websocket, err) { + websocket._readyState = WebSocket$1.CLOSING; + websocket.emit('error', err); + websocket.emitClose(); +} + +/** + * Create a `net.Socket` and initiate a connection. + * + * @param {Object} options Connection options + * @return {net.Socket} The newly created socket used to start the connection + * @private + */ +function netConnect(options) { + options.path = options.socketPath; + return net.connect(options); +} + +/** + * Create a `tls.TLSSocket` and initiate a connection. + * + * @param {Object} options Connection options + * @return {tls.TLSSocket} The newly created socket used to start the connection + * @private + */ +function tlsConnect(options) { + options.path = undefined; + + if (!options.servername && options.servername !== '') { + options.servername = net.isIP(options.host) ? '' : options.host; + } + + return tls.connect(options); +} + +/** + * Abort the handshake and emit an error. + * + * @param {WebSocket} websocket The WebSocket instance + * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to + * abort or the socket to destroy + * @param {String} message The error message + * @private + */ +function abortHandshake$1(websocket, stream, message) { + websocket._readyState = WebSocket$1.CLOSING; + + const err = new Error(message); + Error.captureStackTrace(err, abortHandshake$1); + + if (stream.setHeader) { + stream[kAborted] = true; + stream.abort(); + + if (stream.socket && !stream.socket.destroyed) { + // + // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if + // called after the request completed. See + // https://github.com/websockets/ws/issues/1869. + // + stream.socket.destroy(); + } + + process.nextTick(emitErrorAndClose, websocket, err); + } else { + stream.destroy(err); + stream.once('error', websocket.emit.bind(websocket, 'error')); + stream.once('close', websocket.emitClose.bind(websocket)); + } +} + +/** + * Handle cases where the `ping()`, `pong()`, or `send()` methods are called + * when the `readyState` attribute is `CLOSING` or `CLOSED`. + * + * @param {WebSocket} websocket The WebSocket instance + * @param {*} [data] The data to send + * @param {Function} [cb] Callback + * @private + */ +function sendAfterClose(websocket, data, cb) { + if (data) { + const length = toBuffer(data).length; + + // + // The `_bufferedAmount` property is used only when the peer is a client and + // the opening handshake fails. Under these circumstances, in fact, the + // `setSocket()` method is not called, so the `_socket` and `_sender` + // properties are set to `null`. + // + if (websocket._socket) websocket._sender._bufferedBytes += length; + else websocket._bufferedAmount += length; + } + + if (cb) { + const err = new Error( + `WebSocket is not open: readyState ${websocket.readyState} ` + + `(${readyStates[websocket.readyState]})` + ); + process.nextTick(cb, err); + } +} + +/** + * The listener of the `Receiver` `'conclude'` event. + * + * @param {Number} code The status code + * @param {Buffer} reason The reason for closing + * @private + */ +function receiverOnConclude(code, reason) { + const websocket = this[kWebSocket$1]; + + websocket._closeFrameReceived = true; + websocket._closeMessage = reason; + websocket._closeCode = code; + + if (websocket._socket[kWebSocket$1] === undefined) return; + + websocket._socket.removeListener('data', socketOnData); + process.nextTick(resume, websocket._socket); + + if (code === 1005) websocket.close(); + else websocket.close(code, reason); +} + +/** + * The listener of the `Receiver` `'drain'` event. + * + * @private + */ +function receiverOnDrain() { + const websocket = this[kWebSocket$1]; + + if (!websocket.isPaused) websocket._socket.resume(); +} + +/** + * The listener of the `Receiver` `'error'` event. + * + * @param {(RangeError|Error)} err The emitted error + * @private + */ +function receiverOnError(err) { + const websocket = this[kWebSocket$1]; + + if (websocket._socket[kWebSocket$1] !== undefined) { + websocket._socket.removeListener('data', socketOnData); + + // + // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See + // https://github.com/websockets/ws/issues/1940. + // + process.nextTick(resume, websocket._socket); + + websocket.close(err[kStatusCode]); + } + + websocket.emit('error', err); +} + +/** + * The listener of the `Receiver` `'finish'` event. + * + * @private + */ +function receiverOnFinish() { + this[kWebSocket$1].emitClose(); +} + +/** + * The listener of the `Receiver` `'message'` event. + * + * @param {Buffer|ArrayBuffer|Buffer[])} data The message + * @param {Boolean} isBinary Specifies whether the message is binary or not + * @private + */ +function receiverOnMessage(data, isBinary) { + this[kWebSocket$1].emit('message', data, isBinary); +} + +/** + * The listener of the `Receiver` `'ping'` event. + * + * @param {Buffer} data The data included in the ping frame + * @private + */ +function receiverOnPing(data) { + const websocket = this[kWebSocket$1]; + + websocket.pong(data, !websocket._isServer, NOOP); + websocket.emit('ping', data); +} + +/** + * The listener of the `Receiver` `'pong'` event. + * + * @param {Buffer} data The data included in the pong frame + * @private + */ +function receiverOnPong(data) { + this[kWebSocket$1].emit('pong', data); +} + +/** + * Resume a readable stream + * + * @param {Readable} stream The readable stream + * @private + */ +function resume(stream) { + stream.resume(); +} + +/** + * The listener of the socket `'close'` event. + * + * @private + */ +function socketOnClose() { + const websocket = this[kWebSocket$1]; + + this.removeListener('close', socketOnClose); + this.removeListener('data', socketOnData); + this.removeListener('end', socketOnEnd); + + websocket._readyState = WebSocket$1.CLOSING; + + let chunk; + + // + // The close frame might not have been received or the `'end'` event emitted, + // for example, if the socket was destroyed due to an error. Ensure that the + // `receiver` stream is closed after writing any remaining buffered data to + // it. If the readable side of the socket is in flowing mode then there is no + // buffered data as everything has been already written and `readable.read()` + // will return `null`. If instead, the socket is paused, any possible buffered + // data will be read as a single chunk. + // + if ( + !this._readableState.endEmitted && + !websocket._closeFrameReceived && + !websocket._receiver._writableState.errorEmitted && + (chunk = websocket._socket.read()) !== null + ) { + websocket._receiver.write(chunk); + } + + websocket._receiver.end(); + + this[kWebSocket$1] = undefined; + + clearTimeout(websocket._closeTimer); + + if ( + websocket._receiver._writableState.finished || + websocket._receiver._writableState.errorEmitted + ) { + websocket.emitClose(); + } else { + websocket._receiver.on('error', receiverOnFinish); + websocket._receiver.on('finish', receiverOnFinish); + } +} + +/** + * The listener of the socket `'data'` event. + * + * @param {Buffer} chunk A chunk of data + * @private + */ +function socketOnData(chunk) { + if (!this[kWebSocket$1]._receiver.write(chunk)) { + this.pause(); + } +} + +/** + * The listener of the socket `'end'` event. + * + * @private + */ +function socketOnEnd() { + const websocket = this[kWebSocket$1]; + + websocket._readyState = WebSocket$1.CLOSING; + websocket._receiver.end(); + this.end(); +} + +/** + * The listener of the socket `'error'` event. + * + * @private + */ +function socketOnError$1() { + const websocket = this[kWebSocket$1]; + + this.removeListener('error', socketOnError$1); + this.on('error', NOOP); + + if (websocket) { + websocket._readyState = WebSocket$1.CLOSING; + this.destroy(); + } +} + +const { tokenChars } = validationExports; + +/** + * Parses the `Sec-WebSocket-Protocol` header into a set of subprotocol names. + * + * @param {String} header The field value of the header + * @return {Set} The subprotocol names + * @public + */ +function parse(header) { + const protocols = new Set(); + let start = -1; + let end = -1; + let i = 0; + + for (i; i < header.length; i++) { + const code = header.charCodeAt(i); + + if (end === -1 && tokenChars[code] === 1) { + if (start === -1) start = i; + } else if ( + i !== 0 && + (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */ + ) { + if (end === -1 && start !== -1) end = i; + } else if (code === 0x2c /* ',' */) { + if (start === -1) { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + + if (end === -1) end = i; + + const protocol = header.slice(start, end); + + if (protocols.has(protocol)) { + throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`); + } + + protocols.add(protocol); + start = end = -1; + } else { + throw new SyntaxError(`Unexpected character at index ${i}`); + } + } + + if (start === -1 || end !== -1) { + throw new SyntaxError('Unexpected end of input'); + } + + const protocol = header.slice(start, i); + + if (protocols.has(protocol)) { + throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`); + } + + protocols.add(protocol); + return protocols; +} + +var subprotocol$1 = { parse }; + +/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex$" }] */ + +const EventEmitter = require$$2; +const http = require$$2$1; +const { createHash } = require$$1; + +const extension = extension$1; +const PerMessageDeflate = permessageDeflate; +const subprotocol = subprotocol$1; +const WebSocket = websocket; +const { GUID, kWebSocket } = constants; + +const keyRegex = /^[+/0-9A-Za-z]{22}==$/; + +const RUNNING = 0; +const CLOSING = 1; +const CLOSED = 2; + +/** + * Class representing a WebSocket server. + * + * @extends EventEmitter + */ +class WebSocketServer extends EventEmitter { + /** + * Create a `WebSocketServer` instance. + * + * @param {Object} options Configuration options + * @param {Number} [options.backlog=511] The maximum length of the queue of + * pending connections + * @param {Boolean} [options.clientTracking=true] Specifies whether or not to + * track clients + * @param {Function} [options.handleProtocols] A hook to handle protocols + * @param {String} [options.host] The hostname where to bind the server + * @param {Number} [options.maxPayload=104857600] The maximum allowed message + * size + * @param {Boolean} [options.noServer=false] Enable no server mode + * @param {String} [options.path] Accept only connections matching this path + * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable + * permessage-deflate + * @param {Number} [options.port] The port where to bind the server + * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S + * server to use + * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or + * not to skip UTF-8 validation for text and close messages + * @param {Function} [options.verifyClient] A hook to reject connections + * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket` + * class to use. It must be the `WebSocket` class or class that extends it + * @param {Function} [callback] A listener for the `listening` event + */ + constructor(options, callback) { + super(); + + options = { + maxPayload: 100 * 1024 * 1024, + skipUTF8Validation: false, + perMessageDeflate: false, + handleProtocols: null, + clientTracking: true, + verifyClient: null, + noServer: false, + backlog: null, // use default (511 as implemented in net.js) + server: null, + host: null, + path: null, + port: null, + WebSocket, + ...options + }; + + if ( + (options.port == null && !options.server && !options.noServer) || + (options.port != null && (options.server || options.noServer)) || + (options.server && options.noServer) + ) { + throw new TypeError( + 'One and only one of the "port", "server", or "noServer" options ' + + 'must be specified' + ); + } + + if (options.port != null) { + this._server = http.createServer((req, res) => { + const body = http.STATUS_CODES[426]; + + res.writeHead(426, { + 'Content-Length': body.length, + 'Content-Type': 'text/plain' + }); + res.end(body); + }); + this._server.listen( + options.port, + options.host, + options.backlog, + callback + ); + } else if (options.server) { + this._server = options.server; + } + + if (this._server) { + const emitConnection = this.emit.bind(this, 'connection'); + + this._removeListeners = addListeners(this._server, { + listening: this.emit.bind(this, 'listening'), + error: this.emit.bind(this, 'error'), + upgrade: (req, socket, head) => { + this.handleUpgrade(req, socket, head, emitConnection); + } + }); + } + + if (options.perMessageDeflate === true) options.perMessageDeflate = {}; + if (options.clientTracking) { + this.clients = new Set(); + this._shouldEmitClose = false; + } + + this.options = options; + this._state = RUNNING; + } + + /** + * Returns the bound address, the address family name, and port of the server + * as reported by the operating system if listening on an IP socket. + * If the server is listening on a pipe or UNIX domain socket, the name is + * returned as a string. + * + * @return {(Object|String|null)} The address of the server + * @public + */ + address() { + if (this.options.noServer) { + throw new Error('The server is operating in "noServer" mode'); + } + + if (!this._server) return null; + return this._server.address(); + } + + /** + * Stop the server from accepting new connections and emit the `'close'` event + * when all existing connections are closed. + * + * @param {Function} [cb] A one-time listener for the `'close'` event + * @public + */ + close(cb) { + if (this._state === CLOSED) { + if (cb) { + this.once('close', () => { + cb(new Error('The server is not running')); + }); + } + + process.nextTick(emitClose, this); + return; + } + + if (cb) this.once('close', cb); + + if (this._state === CLOSING) return; + this._state = CLOSING; + + if (this.options.noServer || this.options.server) { + if (this._server) { + this._removeListeners(); + this._removeListeners = this._server = null; + } + + if (this.clients) { + if (!this.clients.size) { + process.nextTick(emitClose, this); + } else { + this._shouldEmitClose = true; + } + } else { + process.nextTick(emitClose, this); + } + } else { + const server = this._server; + + this._removeListeners(); + this._removeListeners = this._server = null; + + // + // The HTTP/S server was created internally. Close it, and rely on its + // `'close'` event. + // + server.close(() => { + emitClose(this); + }); + } + } + + /** + * See if a given request should be handled by this server instance. + * + * @param {http.IncomingMessage} req Request object to inspect + * @return {Boolean} `true` if the request is valid, else `false` + * @public + */ + shouldHandle(req) { + if (this.options.path) { + const index = req.url.indexOf('?'); + const pathname = index !== -1 ? req.url.slice(0, index) : req.url; + + if (pathname !== this.options.path) return false; + } + + return true; + } + + /** + * Handle a HTTP Upgrade request. + * + * @param {http.IncomingMessage} req The request object + * @param {Duplex} socket The network socket between the server and client + * @param {Buffer} head The first packet of the upgraded stream + * @param {Function} cb Callback + * @public + */ + handleUpgrade(req, socket, head, cb) { + socket.on('error', socketOnError); + + const key = req.headers['sec-websocket-key']; + const version = +req.headers['sec-websocket-version']; + + if (req.method !== 'GET') { + const message = 'Invalid HTTP method'; + abortHandshakeOrEmitwsClientError(this, req, socket, 405, message); + return; + } + + if (req.headers.upgrade.toLowerCase() !== 'websocket') { + const message = 'Invalid Upgrade header'; + abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); + return; + } + + if (!key || !keyRegex.test(key)) { + const message = 'Missing or invalid Sec-WebSocket-Key header'; + abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); + return; + } + + if (version !== 8 && version !== 13) { + const message = 'Missing or invalid Sec-WebSocket-Version header'; + abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); + return; + } + + if (!this.shouldHandle(req)) { + abortHandshake(socket, 400); + return; + } + + const secWebSocketProtocol = req.headers['sec-websocket-protocol']; + let protocols = new Set(); + + if (secWebSocketProtocol !== undefined) { + try { + protocols = subprotocol.parse(secWebSocketProtocol); + } catch (err) { + const message = 'Invalid Sec-WebSocket-Protocol header'; + abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); + return; + } + } + + const secWebSocketExtensions = req.headers['sec-websocket-extensions']; + const extensions = {}; + + if ( + this.options.perMessageDeflate && + secWebSocketExtensions !== undefined + ) { + const perMessageDeflate = new PerMessageDeflate( + this.options.perMessageDeflate, + true, + this.options.maxPayload + ); + + try { + const offers = extension.parse(secWebSocketExtensions); + + if (offers[PerMessageDeflate.extensionName]) { + perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]); + extensions[PerMessageDeflate.extensionName] = perMessageDeflate; + } + } catch (err) { + const message = + 'Invalid or unacceptable Sec-WebSocket-Extensions header'; + abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); + return; + } + } + + // + // Optionally call external client verification handler. + // + if (this.options.verifyClient) { + const info = { + origin: + req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`], + secure: !!(req.socket.authorized || req.socket.encrypted), + req + }; + + if (this.options.verifyClient.length === 2) { + this.options.verifyClient(info, (verified, code, message, headers) => { + if (!verified) { + return abortHandshake(socket, code || 401, message, headers); + } + + this.completeUpgrade( + extensions, + key, + protocols, + req, + socket, + head, + cb + ); + }); + return; + } + + if (!this.options.verifyClient(info)) return abortHandshake(socket, 401); + } + + this.completeUpgrade(extensions, key, protocols, req, socket, head, cb); + } + + /** + * Upgrade the connection to WebSocket. + * + * @param {Object} extensions The accepted extensions + * @param {String} key The value of the `Sec-WebSocket-Key` header + * @param {Set} protocols The subprotocols + * @param {http.IncomingMessage} req The request object + * @param {Duplex} socket The network socket between the server and client + * @param {Buffer} head The first packet of the upgraded stream + * @param {Function} cb Callback + * @throws {Error} If called more than once with the same socket + * @private + */ + completeUpgrade(extensions, key, protocols, req, socket, head, cb) { + // + // Destroy the socket if the client has already sent a FIN packet. + // + if (!socket.readable || !socket.writable) return socket.destroy(); + + if (socket[kWebSocket]) { + throw new Error( + 'server.handleUpgrade() was called more than once with the same ' + + 'socket, possibly due to a misconfiguration' + ); + } + + if (this._state > RUNNING) return abortHandshake(socket, 503); + + const digest = createHash('sha1') + .update(key + GUID) + .digest('base64'); + + const headers = [ + 'HTTP/1.1 101 Switching Protocols', + 'Upgrade: websocket', + 'Connection: Upgrade', + `Sec-WebSocket-Accept: ${digest}` + ]; + + const ws = new this.options.WebSocket(null); + + if (protocols.size) { + // + // Optionally call external protocol selection handler. + // + const protocol = this.options.handleProtocols + ? this.options.handleProtocols(protocols, req) + : protocols.values().next().value; + + if (protocol) { + headers.push(`Sec-WebSocket-Protocol: ${protocol}`); + ws._protocol = protocol; + } + } + + if (extensions[PerMessageDeflate.extensionName]) { + const params = extensions[PerMessageDeflate.extensionName].params; + const value = extension.format({ + [PerMessageDeflate.extensionName]: [params] + }); + headers.push(`Sec-WebSocket-Extensions: ${value}`); + ws._extensions = extensions; + } + + // + // Allow external modification/inspection of handshake headers. + // + this.emit('headers', headers, req); + + socket.write(headers.concat('\r\n').join('\r\n')); + socket.removeListener('error', socketOnError); + + ws.setSocket(socket, head, { + maxPayload: this.options.maxPayload, + skipUTF8Validation: this.options.skipUTF8Validation + }); + + if (this.clients) { + this.clients.add(ws); + ws.on('close', () => { + this.clients.delete(ws); + + if (this._shouldEmitClose && !this.clients.size) { + process.nextTick(emitClose, this); + } + }); + } + + cb(ws, req); + } +} + +var websocketServer = WebSocketServer; + +/** + * Add event listeners on an `EventEmitter` using a map of + * pairs. + * + * @param {EventEmitter} server The event emitter + * @param {Object.} map The listeners to add + * @return {Function} A function that will remove the added listeners when + * called + * @private + */ +function addListeners(server, map) { + for (const event of Object.keys(map)) server.on(event, map[event]); + + return function removeListeners() { + for (const event of Object.keys(map)) { + server.removeListener(event, map[event]); + } + }; +} + +/** + * Emit a `'close'` event on an `EventEmitter`. + * + * @param {EventEmitter} server The event emitter + * @private + */ +function emitClose(server) { + server._state = CLOSED; + server.emit('close'); +} + +/** + * Handle socket errors. + * + * @private + */ +function socketOnError() { + this.destroy(); +} + +/** + * Close the connection when preconditions are not fulfilled. + * + * @param {Duplex} socket The socket of the upgrade request + * @param {Number} code The HTTP response status code + * @param {String} [message] The HTTP response body + * @param {Object} [headers] Additional HTTP response headers + * @private + */ +function abortHandshake(socket, code, message, headers) { + // + // The socket is writable unless the user destroyed or ended it before calling + // `server.handleUpgrade()` or in the `verifyClient` function, which is a user + // error. Handling this does not make much sense as the worst that can happen + // is that some of the data written by the user might be discarded due to the + // call to `socket.end()` below, which triggers an `'error'` event that in + // turn causes the socket to be destroyed. + // + message = message || http.STATUS_CODES[code]; + headers = { + Connection: 'close', + 'Content-Type': 'text/html', + 'Content-Length': Buffer.byteLength(message), + ...headers + }; + + socket.once('finish', socket.destroy); + + socket.end( + `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` + + Object.keys(headers) + .map((h) => `${h}: ${headers[h]}`) + .join('\r\n') + + '\r\n\r\n' + + message + ); +} + +/** + * Emit a `'wsClientError'` event on a `WebSocketServer` if there is at least + * one listener for it, otherwise call `abortHandshake()`. + * + * @param {WebSocketServer} server The WebSocket server + * @param {http.IncomingMessage} req The request object + * @param {Duplex} socket The socket of the upgrade request + * @param {Number} code The HTTP response status code + * @param {String} message The HTTP response body + * @private + */ +function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) { + if (server.listenerCount('wsClientError')) { + const err = new Error(message); + Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError); + + server.emit('wsClientError', err, socket, req); + } else { + abortHandshake(socket, code, message); + } +} + +var WebSocketServer$1 = /*@__PURE__*/getDefaultExportFromCjs(websocketServer); + +function setup(vitestOrWorkspace, _server) { + var _a; + const ctx = "ctx" in vitestOrWorkspace ? vitestOrWorkspace.ctx : vitestOrWorkspace; + const wss = new WebSocketServer$1({ noServer: true }); + const clients = /* @__PURE__ */ new Map(); + const server = _server || ctx.server; + (_a = server.httpServer) == null ? void 0 : _a.on("upgrade", (request, socket, head) => { + if (!request.url) + return; + const { pathname } = new URL(request.url, "http://localhost"); + if (pathname !== API_PATH) + return; + wss.handleUpgrade(request, socket, head, (ws) => { + wss.emit("connection", ws, request); + setupClient(ws); + }); + }); + function checkFileAccess(path) { + if (!isFileServingAllowed(path, server)) + throw new Error(`Access denied to "${path}". See Vite config documentation for "server.fs": https://vitejs.dev/config/server-options.html#server-fs-strict.`); + } + function setupClient(ws) { + const rpc = createBirpc( + { + async onUnhandledError(error, type) { + ctx.state.catchError(error, type); + }, + async onDone(testId) { + var _a2; + return (_a2 = ctx.state.browserTestPromises.get(testId)) == null ? void 0 : _a2.resolve(true); + }, + async onCollected(files) { + ctx.state.collectFiles(files); + await ctx.report("onCollected", files); + }, + async onTaskUpdate(packs) { + ctx.state.updateTasks(packs); + await ctx.report("onTaskUpdate", packs); + }, + onAfterSuiteRun(meta) { + var _a2; + (_a2 = ctx.coverageProvider) == null ? void 0 : _a2.onAfterSuiteRun(meta); + }, + getFiles() { + return ctx.state.getFiles(); + }, + getPaths() { + return ctx.state.getPaths(); + }, + sendLog(log) { + return ctx.report("onUserConsoleLog", log); + }, + resolveSnapshotPath(testPath) { + return ctx.snapshot.resolvePath(testPath); + }, + resolveSnapshotRawPath(testPath, rawPath) { + return ctx.snapshot.resolveRawPath(testPath, rawPath); + }, + async readSnapshotFile(snapshotPath) { + checkFileAccess(snapshotPath); + if (!existsSync(snapshotPath)) + return null; + return promises.readFile(snapshotPath, "utf-8"); + }, + async readTestFile(id) { + if (!ctx.state.filesMap.has(id) || !existsSync(id)) + return null; + return promises.readFile(id, "utf-8"); + }, + async saveTestFile(id, content) { + if (!ctx.state.filesMap.has(id) || !existsSync(id)) + throw new Error(`Test file "${id}" was not registered, so it cannot be updated using the API.`); + return promises.writeFile(id, content, "utf-8"); + }, + async saveSnapshotFile(id, content) { + checkFileAccess(id); + await promises.mkdir(dirname(id), { recursive: true }); + return promises.writeFile(id, content, "utf-8"); + }, + async removeSnapshotFile(id) { + checkFileAccess(id); + if (!existsSync(id)) + throw new Error(`Snapshot file "${id}" does not exist.`); + return promises.unlink(id); + }, + snapshotSaved(snapshot) { + ctx.snapshot.add(snapshot); + }, + async rerun(files) { + await ctx.rerunFiles(files); + }, + getConfig() { + if (vitestOrWorkspace instanceof WorkspaceProject) + return wrapConfig(vitestOrWorkspace.getSerializableConfig()); + return vitestOrWorkspace.config; + }, + async getTransformResult(id) { + const result = await ctx.vitenode.transformRequest(id); + if (result) { + try { + result.source = result.source || await promises.readFile(id, "utf-8"); + } catch { + } + return result; + } + }, + async getModuleGraph(id) { + return getModuleGraph(ctx, id); + }, + updateSnapshot(file) { + if (!file) + return ctx.updateSnapshot(); + return ctx.updateSnapshot([file.filepath]); + }, + onCancel(reason) { + ctx.cancelCurrentRun(reason); + }, + getCountOfFailedTests() { + return ctx.state.getCountOfFailedTests(); + }, + // browser should have a separate RPC in the future, UI doesn't care for provided context + getProvidedContext() { + return "ctx" in vitestOrWorkspace ? vitestOrWorkspace.getProvidedContext() : {}; + }, + getUnhandledErrors() { + return ctx.state.getUnhandledErrors(); + } + }, + { + post: (msg) => ws.send(msg), + on: (fn) => ws.on("message", fn), + eventNames: ["onUserConsoleLog", "onFinished", "onCollected", "onCancel"], + serialize: (data) => stringify(data, stringifyReplace), + deserialize: parse$3 + } + ); + ctx.onCancel((reason) => rpc.onCancel(reason)); + clients.set(ws, rpc); + ws.on("close", () => { + clients.delete(ws); + }); + } + ctx.reporters.push(new WebSocketReporter(ctx, wss, clients)); +} +class WebSocketReporter { + constructor(ctx, wss, clients) { + this.ctx = ctx; + this.wss = wss; + this.clients = clients; + } + onCollected(files) { + if (this.clients.size === 0) + return; + this.clients.forEach((client) => { + var _a; + (_a = client.onCollected) == null ? void 0 : _a.call(client, files); + }); + } + async onTaskUpdate(packs) { + if (this.clients.size === 0) + return; + packs.forEach(([taskId, result]) => { + var _a; + const project = this.ctx.getProjectByTaskId(taskId); + const parserOptions = { + getSourceMap: (file) => project.getBrowserSourceMapModuleById(file) + }; + (_a = result == null ? void 0 : result.errors) == null ? void 0 : _a.forEach((error) => { + if (!isPrimitive(error)) + error.stacks = parseErrorStacktrace(error, parserOptions); + }); + }); + this.clients.forEach((client) => { + var _a; + (_a = client.onTaskUpdate) == null ? void 0 : _a.call(client, packs); + }); + } + onFinished(files, errors) { + this.clients.forEach((client) => { + var _a; + (_a = client.onFinished) == null ? void 0 : _a.call(client, files, errors); + }); + } + onUserConsoleLog(log) { + this.clients.forEach((client) => { + var _a; + (_a = client.onUserConsoleLog) == null ? void 0 : _a.call(client, log); + }); + } +} +function wrapConfig(config) { + return { + ...config, + // workaround RegExp serialization + testNamePattern: config.testNamePattern ? config.testNamePattern.toString() : void 0 + }; +} + +export { setup }; diff --git a/.pnpm-store/v3/files/08/441041883b54a85ffdd842137ac6a7caf239d4aacf11ca82d5e4776b5ff9b5b3bb4c62f62540c808edbcbcfc59917b1698a081cef3a30e5e9d2fef36e753e8 b/.pnpm-store/v3/files/08/441041883b54a85ffdd842137ac6a7caf239d4aacf11ca82d5e4776b5ff9b5b3bb4c62f62540c808edbcbcfc59917b1698a081cef3a30e5e9d2fef36e753e8 new file mode 100644 index 00000000..4214f16a --- /dev/null +++ b/.pnpm-store/v3/files/08/441041883b54a85ffdd842137ac6a7caf239d4aacf11ca82d5e4776b5ff9b5b3bb4c62f62540c808edbcbcfc59917b1698a081cef3a30e5e9d2fef36e753e8 @@ -0,0 +1,139 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.searchExternalFiles = exports.decorateLanguageServiceHost = void 0; +const language_core_1 = require("@volar/language-core"); +const resolveModuleName_1 = require("../resolveModuleName"); +function decorateLanguageServiceHost(virtualFiles, languageServiceHost, ts) { + let extraProjectVersion = 0; + const { languagePlugins } = virtualFiles; + const exts = languagePlugins + .map(plugin => plugin.typescript?.extraFileExtensions.map(ext => '.' + ext.extension) ?? []) + .flat(); + const scripts = new Map(); + const readDirectory = languageServiceHost.readDirectory?.bind(languageServiceHost); + const resolveModuleNameLiterals = languageServiceHost.resolveModuleNameLiterals?.bind(languageServiceHost); + const resolveModuleNames = languageServiceHost.resolveModuleNames?.bind(languageServiceHost); + const getProjectVersion = languageServiceHost.getProjectVersion?.bind(languageServiceHost); + const getScriptSnapshot = languageServiceHost.getScriptSnapshot.bind(languageServiceHost); + const getScriptKind = languageServiceHost.getScriptKind?.bind(languageServiceHost); + // path completion + if (readDirectory) { + languageServiceHost.readDirectory = (path, extensions, exclude, include, depth) => { + if (extensions) { + for (const ext of exts) { + if (!extensions.includes(ext)) { + extensions = [...extensions, ...ext]; + } + } + } + return readDirectory(path, extensions, exclude, include, depth); + }; + } + if (languagePlugins.some(language => language.typescript?.extraFileExtensions.length)) { + const resolveModuleName = (0, resolveModuleName_1.createResolveModuleName)(ts, languageServiceHost, languagePlugins, fileName => virtualFiles.get(fileName)); + if (resolveModuleNameLiterals) { + languageServiceHost.resolveModuleNameLiterals = (moduleLiterals, containingFile, redirectedReference, options, ...rest) => { + return [ + ...resolveModuleNameLiterals(moduleLiterals.filter(name => !exts.some(ext => name.text.endsWith(ext))), containingFile, redirectedReference, options, ...rest), + ...moduleLiterals + .filter(name => exts.some(ext => name.text.endsWith(ext))) + .map(name => resolveModuleName(name.text, containingFile, options, undefined, redirectedReference)), + ]; + }; + } + if (resolveModuleNames) { + languageServiceHost.resolveModuleNames = (moduleNames, containingFile, reusedNames, redirectedReference, options, containingSourceFile) => { + return [ + ...resolveModuleNames(moduleNames.filter(name => !exts.some(ext => name.endsWith(ext))), containingFile, reusedNames, redirectedReference, options, containingSourceFile), + ...moduleNames + .filter(name => exts.some(ext => name.endsWith(ext))) + .map(moduleName => resolveModuleName(moduleName, containingFile, options, undefined, redirectedReference).resolvedModule), + ]; + }; + } + } + if (getProjectVersion) { + languageServiceHost.getProjectVersion = () => { + return getProjectVersion() + ':' + extraProjectVersion; + }; + } + languageServiceHost.getScriptSnapshot = fileName => { + if (exts.some(ext => fileName.endsWith(ext))) { + updateScript(fileName); + return scripts.get(fileName)?.snapshot; + } + return getScriptSnapshot(fileName); + }; + if (getScriptKind) { + languageServiceHost.getScriptKind = fileName => { + if (exts.some(ext => fileName.endsWith(ext))) { + updateScript(fileName); + const script = scripts.get(fileName); + if (script) { + return script.kind; + } + return ts.ScriptKind.Deferred; + } + return getScriptKind(fileName); + }; + } + function updateScript(fileName) { + const version = languageServiceHost.getScriptVersion(fileName); + if (version !== scripts.get(fileName)?.version) { + let extension = '.ts'; + let snapshotSnapshot; + let scriptKind = ts.ScriptKind.TS; + const snapshot = getScriptSnapshot(fileName); + if (snapshot) { + extraProjectVersion++; + const sourceFile = virtualFiles.set(fileName, (0, language_core_1.resolveCommonLanguageId)(fileName), snapshot); + if (sourceFile.generated) { + const text = snapshot.getText(0, snapshot.getLength()); + let patchedText = text.split('\n').map(line => ' '.repeat(line.length)).join('\n'); + const script = sourceFile.generated.languagePlugin.typescript?.getScript(sourceFile.generated.code); + if (script) { + extension = script.extension; + scriptKind = script.scriptKind; + patchedText += script.code.snapshot.getText(0, script.code.snapshot.getLength()); + } + snapshotSnapshot = ts.ScriptSnapshot.fromString(patchedText); + if (sourceFile.generated.languagePlugin.typescript?.getExtraScripts) { + console.warn('getExtraScripts() is not available in this use case.'); + } + } + } + else if (virtualFiles.get(fileName)) { + extraProjectVersion++; + virtualFiles.delete(fileName); + } + scripts.set(fileName, { + version, + extension, + snapshot: snapshotSnapshot, + kind: scriptKind, + }); + } + return scripts.get(fileName); + } +} +exports.decorateLanguageServiceHost = decorateLanguageServiceHost; +function searchExternalFiles(ts, project, exts) { + if (project.projectKind !== ts.server.ProjectKind.Configured) { + return []; + } + const configFile = project.getProjectName(); + const config = ts.readJsonConfigFile(configFile, project.readFile.bind(project)); + const parseHost = { + useCaseSensitiveFileNames: project.useCaseSensitiveFileNames(), + fileExists: project.fileExists.bind(project), + readFile: project.readFile.bind(project), + readDirectory: (...args) => { + args[1] = exts; + return project.readDirectory(...args); + }, + }; + const parsed = ts.parseJsonSourceFileConfigFileContent(config, parseHost, project.getCurrentDirectory()); + return parsed.fileNames; +} +exports.searchExternalFiles = searchExternalFiles; +//# sourceMappingURL=decorateLanguageServiceHost.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/08/6681b1e36dba7015d830a9c015ea4caabcfbd4f0eb95d97ad31a0b416c32866e2e3d20c4d2246c27f643229849c56b34e53bfdac9f35d570f190921c18aa0a-index.json b/.pnpm-store/v3/files/08/6681b1e36dba7015d830a9c015ea4caabcfbd4f0eb95d97ad31a0b416c32866e2e3d20c4d2246c27f643229849c56b34e53bfdac9f35d570f190921c18aa0a-index.json new file mode 100644 index 00000000..2d0e8878 --- /dev/null +++ b/.pnpm-store/v3/files/08/6681b1e36dba7015d830a9c015ea4caabcfbd4f0eb95d97ad31a0b416c32866e2e3d20c4d2246c27f643229849c56b34e53bfdac9f35d570f190921c18aa0a-index.json @@ -0,0 +1 @@ +{"files":{"LICENSE":{"checkedAt":1707939899490,"integrity":"sha512-e6Azp98T3IIh9uy4NT357Iu8c0dWTrVyQAKq389D3dnKyCEDwFK6e48wfzxsS4H7m3M2HK9BEAXSnmzdHmCNWQ==","mode":420,"size":1067},"lib/index.js":{"checkedAt":1707939899490,"integrity":"sha512-dO9pDeUw/xQGz3cbtYfyvE/L2pVvA4fupgmEcjRsnJ7RhBHZCp2TO7iMyGgLzNH6HMqjkl+VjjvzPLMYYqRcGg==","mode":420,"size":85190},"package.json":{"checkedAt":1707939899490,"integrity":"sha512-W/pjKMT5/6v0CoHDIHsQyilu5FvuqEA/HT/NNwpEA7IuwPkBzU45hJcdcieYNHwC7UDwhbNVefUBr0N6Dmt+eg==","mode":420,"size":3966},"README.md":{"checkedAt":1707939899490,"integrity":"sha512-fJaIr5hWbni+kiq3HKquSIT4KkoIuANjI2D/k3WPM925vn65Ktx1uJTN4HHcM36pvusDOdckwbCU8FWuDlJZfg==","mode":420,"size":7897},"lib/index.mjs":{"checkedAt":1707939899491,"integrity":"sha512-tqMQQHfri4vtPETzibwOvh9AZwZrcOfz/VKNmQD+gnI3WiV6Y8AwKRLXMNNDPMKAJsDWAm4gEKjr54XKCMQD6g==","mode":420,"size":83020},"lib/index.d.mts":{"checkedAt":1707939899491,"integrity":"sha512-7VZvh1gfLeHRkn9wGszdIuZlXf/od+uSolg4tzJUhYIpVH3oefiEj2i0i1LP891f8OBJqusahKrcoulUuXoLhA==","mode":420,"size":12610},"lib/index.d.ts":{"checkedAt":1707939899491,"integrity":"sha512-7VZvh1gfLeHRkn9wGszdIuZlXf/od+uSolg4tzJUhYIpVH3oefiEj2i0i1LP891f8OBJqusahKrcoulUuXoLhA==","mode":420,"size":12610}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/08/8121ea58e824fea599064f914252bda778fbc58cd00284cbf7634c6cef277c80f7aee3924acbf7a72bd3bb8d71827ae2c593680484af283167a1dc1d3b6982 b/.pnpm-store/v3/files/08/8121ea58e824fea599064f914252bda778fbc58cd00284cbf7634c6cef277c80f7aee3924acbf7a72bd3bb8d71827ae2c593680484af283167a1dc1d3b6982 new file mode 100644 index 00000000..7100909b --- /dev/null +++ b/.pnpm-store/v3/files/08/8121ea58e824fea599064f914252bda778fbc58cd00284cbf7634c6cef277c80f7aee3924acbf7a72bd3bb8d71827ae2c593680484af283167a1dc1d3b6982 @@ -0,0 +1,140 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'space-before-function-paren', + meta: { + deprecated: true, + replacedBy: ['@stylistic/ts/space-before-function-paren'], + type: 'layout', + docs: { + description: 'Enforce consistent spacing before function parenthesis', + extendsBaseRule: true, + }, + fixable: 'whitespace', + schema: [ + { + oneOf: [ + { + type: 'string', + enum: ['always', 'never'], + }, + { + type: 'object', + properties: { + anonymous: { + type: 'string', + enum: ['always', 'never', 'ignore'], + }, + named: { + type: 'string', + enum: ['always', 'never', 'ignore'], + }, + asyncArrow: { + type: 'string', + enum: ['always', 'never', 'ignore'], + }, + }, + additionalProperties: false, + }, + ], + }, + ], + messages: { + unexpected: 'Unexpected space before function parentheses.', + missing: 'Missing space before function parentheses.', + }, + }, + defaultOptions: ['always'], + create(context, [firstOption]) { + const baseConfig = typeof firstOption === 'string' ? firstOption : 'always'; + const overrideConfig = typeof firstOption === 'object' ? firstOption : {}; + /** + * Determines whether a function has a name. + * @param node The function node. + * @returns Whether the function has a name. + */ + function isNamedFunction(node) { + if (node.id != null) { + return true; + } + const parent = node.parent; + return (parent.type === utils_1.AST_NODE_TYPES.MethodDefinition || + parent.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition || + (parent.type === utils_1.AST_NODE_TYPES.Property && + (parent.kind === 'get' || parent.kind === 'set' || parent.method))); + } + /** + * Gets the config for a given function + * @param node The function node + */ + function getConfigForFunction(node) { + if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar + if (node.async && + (0, util_1.isOpeningParenToken)(context.sourceCode.getFirstToken(node, { skip: 1 }))) { + return overrideConfig.asyncArrow ?? baseConfig; + } + } + else if (isNamedFunction(node)) { + return overrideConfig.named ?? baseConfig; + // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` + } + else if (!node.generator) { + return overrideConfig.anonymous ?? baseConfig; + } + return 'ignore'; + } + /** + * Checks the parens of a function node + * @param node A function node + */ + function checkFunction(node) { + const functionConfig = getConfigForFunction(node); + if (functionConfig === 'ignore') { + return; + } + let leftToken; + let rightToken; + if (node.typeParameters) { + leftToken = context.sourceCode.getLastToken(node.typeParameters); + rightToken = context.sourceCode.getTokenAfter(leftToken); + } + else { + rightToken = context.sourceCode.getFirstToken(node, util_1.isOpeningParenToken); + leftToken = context.sourceCode.getTokenBefore(rightToken); + } + const hasSpacing = context.sourceCode.isSpaceBetween(leftToken, rightToken); + if (hasSpacing && functionConfig === 'never') { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start, + }, + messageId: 'unexpected', + fix: fixer => fixer.removeRange([leftToken.range[1], rightToken.range[0]]), + }); + } + else if (!hasSpacing && + functionConfig === 'always' && + (!node.typeParameters || node.id)) { + context.report({ + node, + loc: rightToken.loc, + messageId: 'missing', + fix: fixer => fixer.insertTextAfter(leftToken, ' '), + }); + } + } + return { + ArrowFunctionExpression: checkFunction, + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction, + TSEmptyBodyFunctionExpression: checkFunction, + TSDeclareFunction: checkFunction, + }; + }, +}); +//# sourceMappingURL=space-before-function-paren.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/08/8945d883e7360966dc44b9ce7c036109139458b496cd87d85aaf6fbecfffa6828bf1599f49d372fe60fc40d1d990052a87e8f120ed52327ba0b0f553d0e302 b/.pnpm-store/v3/files/08/8945d883e7360966dc44b9ce7c036109139458b496cd87d85aaf6fbecfffa6828bf1599f49d372fe60fc40d1d990052a87e8f120ed52327ba0b0f553d0e302 new file mode 100644 index 00000000..b2f48c69 --- /dev/null +++ b/.pnpm-store/v3/files/08/8945d883e7360966dc44b9ce7c036109139458b496cd87d85aaf6fbecfffa6828bf1599f49d372fe60fc40d1d990052a87e8f120ed52327ba0b0f553d0e302 @@ -0,0 +1,16 @@ +type TypedArray = + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array + | BigInt64Array + | BigUint64Array; + +declare function isTypedArray(value: unknown): value is TypedArray; + +export = isTypedArray; \ No newline at end of file diff --git a/.pnpm-store/v3/files/08/f2d65d9009b99e857fd8490616a635689d1e8c307fc135a055f21c6599cb89111ddb9c3a4f5e9672adf803a0ea851a05bb0d23cef9e61b9787cacb44d1da2d b/.pnpm-store/v3/files/08/f2d65d9009b99e857fd8490616a635689d1e8c307fc135a055f21c6599cb89111ddb9c3a4f5e9672adf803a0ea851a05bb0d23cef9e61b9787cacb44d1da2d new file mode 100644 index 00000000..12368e8a --- /dev/null +++ b/.pnpm-store/v3/files/08/f2d65d9009b99e857fd8490616a635689d1e8c307fc135a055f21c6599cb89111ddb9c3a4f5e9672adf803a0ea851a05bb0d23cef9e61b9787cacb44d1da2d @@ -0,0 +1,42 @@ +{ + "name": "@unocss/extractor-arbitrary-variants", + "version": "0.58.5", + "description": "Extractor arbitrary variants for utilities", + "author": "Anthony Fu ", + "license": "MIT", + "funding": "https://github.com/sponsors/antfu", + "homepage": "https://github.com/unocss/unocss/tree/main/packages/extractor-arbitrary-variants#readme", + "repository": { + "type": "git", + "url": "https://github.com/unocss/unocss", + "directory": "packages/extractor-arbitrary-variants" + }, + "bugs": { + "url": "https://github.com/unocss/unocss/issues" + }, + "keywords": [ + "unocss", + "unocss-extractor" + ], + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + } + }, + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "dependencies": { + "@unocss/core": "0.58.5" + }, + "scripts": { + "build": "unbuild", + "stub": "unbuild --stub" + } +} \ No newline at end of file diff --git a/.pnpm-store/v3/files/09/c424d9f1ff60c08fa742efb90ecb70c6bceee2ecbb805948a5f90d6c1a2f0a83be5692424c2299abf4077ecd92b65c3dd17b9c471609917f69cac359ad1307 b/.pnpm-store/v3/files/09/c424d9f1ff60c08fa742efb90ecb70c6bceee2ecbb805948a5f90d6c1a2f0a83be5692424c2299abf4077ecd92b65c3dd17b9c471609917f69cac359ad1307 new file mode 100644 index 00000000..14c8729d --- /dev/null +++ b/.pnpm-store/v3/files/09/c424d9f1ff60c08fa742efb90ecb70c6bceee2ecbb805948a5f90d6c1a2f0a83be5692424c2299abf4077ecd92b65c3dd17b9c471609917f69cac359ad1307 @@ -0,0 +1,179 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'method-signature-style', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using a particular method signature syntax', + }, + fixable: 'code', + messages: { + errorMethod: 'Shorthand method signature is forbidden. Use a function property instead.', + errorProperty: 'Function property signature is forbidden. Use a method shorthand instead.', + }, + schema: [ + { + type: 'string', + enum: ['property', 'method'], + }, + ], + }, + defaultOptions: ['property'], + create(context, [mode]) { + function getMethodKey(node) { + let key = context.sourceCode.getText(node.key); + if (node.computed) { + key = `[${key}]`; + } + if (node.optional) { + key = `${key}?`; + } + if (node.readonly) { + key = `readonly ${key}`; + } + return key; + } + function getMethodParams(node) { + let params = '()'; + if (node.params.length > 0) { + const openingParen = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(node.params[0], util_1.isOpeningParenToken), 'Missing opening paren before first parameter'); + const closingParen = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.params[node.params.length - 1], util_1.isClosingParenToken), 'Missing closing paren after last parameter'); + params = context.sourceCode.text.substring(openingParen.range[0], closingParen.range[1]); + } + if (node.typeParameters != null) { + const typeParams = context.sourceCode.getText(node.typeParameters); + params = `${typeParams}${params}`; + } + return params; + } + function getMethodReturnType(node) { + return node.returnType == null + ? // if the method has no return type, it implicitly has an `any` return type + // we just make it explicit here so we can do the fix + 'any' + : context.sourceCode.getText(node.returnType.typeAnnotation); + } + function getDelimiter(node) { + const lastToken = context.sourceCode.getLastToken(node); + if (lastToken && + ((0, util_1.isSemicolonToken)(lastToken) || (0, util_1.isCommaToken)(lastToken))) { + return lastToken.value; + } + return ''; + } + function isNodeParentModuleDeclaration(node) { + if (!node.parent) { + return false; + } + if (node.parent.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration) { + return true; + } + if (node.parent.type === utils_1.AST_NODE_TYPES.Program) { + return false; + } + return isNodeParentModuleDeclaration(node.parent); + } + return { + ...(mode === 'property' && { + TSMethodSignature(methodNode) { + if (methodNode.kind !== 'method') { + return; + } + const parent = methodNode.parent; + const members = parent.type === utils_1.AST_NODE_TYPES.TSInterfaceBody + ? parent.body + : parent.type === utils_1.AST_NODE_TYPES.TSTypeLiteral + ? parent.members + : []; + const duplicatedKeyMethodNodes = members.filter((element) => element.type === utils_1.AST_NODE_TYPES.TSMethodSignature && + element !== methodNode && + getMethodKey(element) === getMethodKey(methodNode)); + const isParentModule = isNodeParentModuleDeclaration(methodNode); + if (duplicatedKeyMethodNodes.length > 0) { + if (isParentModule) { + context.report({ + node: methodNode, + messageId: 'errorMethod', + }); + } + else { + context.report({ + node: methodNode, + messageId: 'errorMethod', + *fix(fixer) { + const methodNodes = [ + methodNode, + ...duplicatedKeyMethodNodes, + ].sort((a, b) => (a.range[0] < b.range[0] ? -1 : 1)); + const typeString = methodNodes + .map(node => { + const params = getMethodParams(node); + const returnType = getMethodReturnType(node); + return `(${params} => ${returnType})`; + }) + .join(' & '); + const key = getMethodKey(methodNode); + const delimiter = getDelimiter(methodNode); + yield fixer.replaceText(methodNode, `${key}: ${typeString}${delimiter}`); + for (const node of duplicatedKeyMethodNodes) { + const lastToken = context.sourceCode.getLastToken(node); + if (lastToken) { + const nextToken = context.sourceCode.getTokenAfter(lastToken); + if (nextToken) { + yield fixer.remove(node); + yield fixer.replaceTextRange([lastToken.range[1], nextToken.range[0]], ''); + } + } + } + }, + }); + } + return; + } + if (isParentModule) { + context.report({ + node: methodNode, + messageId: 'errorMethod', + }); + } + else { + context.report({ + node: methodNode, + messageId: 'errorMethod', + fix: fixer => { + const key = getMethodKey(methodNode); + const params = getMethodParams(methodNode); + const returnType = getMethodReturnType(methodNode); + const delimiter = getDelimiter(methodNode); + return fixer.replaceText(methodNode, `${key}: ${params} => ${returnType}${delimiter}`); + }, + }); + } + }, + }), + ...(mode === 'method' && { + TSPropertySignature(propertyNode) { + const typeNode = propertyNode.typeAnnotation?.typeAnnotation; + if (typeNode?.type !== utils_1.AST_NODE_TYPES.TSFunctionType) { + return; + } + context.report({ + node: propertyNode, + messageId: 'errorProperty', + fix: fixer => { + const key = getMethodKey(propertyNode); + const params = getMethodParams(typeNode); + const returnType = getMethodReturnType(typeNode); + const delimiter = getDelimiter(propertyNode); + return fixer.replaceText(propertyNode, `${key}${params}: ${returnType}${delimiter}`); + }, + }); + }, + }), + }; + }, +}); +//# sourceMappingURL=method-signature-style.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/09/cd3a4dc61fa7e4302dd727b9556ce63606e385fd0a9a19e3eb7406aefb1fbf391df896c030f9e348fe52ff1d3e0421e14ce62b15fd092a8ee42a6d255515f5 b/.pnpm-store/v3/files/09/cd3a4dc61fa7e4302dd727b9556ce63606e385fd0a9a19e3eb7406aefb1fbf391df896c030f9e348fe52ff1d3e0421e14ce62b15fd092a8ee42a6d255515f5 new file mode 100644 index 00000000..3818a6e1 --- /dev/null +++ b/.pnpm-store/v3/files/09/cd3a4dc61fa7e4302dd727b9556ce63606e385fd0a9a19e3eb7406aefb1fbf391df896c030f9e348fe52ff1d3e0421e14ce62b15fd092a8ee42a6d255515f5 @@ -0,0 +1,112 @@ +import { Path } from "./types"; +/** + * Internally, we represent paths as strings with '/' as the directory separator. + * When we make system calls (eg: LanguageServiceHost.getDirectory()), + * we expect the host to correctly handle paths in our specified format. + */ +export declare const directorySeparator = "/"; +/** + * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path + * like `c:`, `c:\` or `c:/`). + */ +export declare function isRootedDiskPath(path: string): boolean; +export declare function hasExtension(fileName: string): boolean; +export declare function fileExtensionIsOneOf(path: string, extensions: readonly string[]): boolean; +/** + * Returns the path except for its basename. Semantics align with NodeJS's `path.dirname` + * except that we support URLs as well. + * + * ```ts + * // POSIX + * getDirectoryPath("/path/to/file.ext") === "/path/to" + * getDirectoryPath("/path/to/") === "/path" + * getDirectoryPath("/") === "/" + * // DOS + * getDirectoryPath("c:/path/to/file.ext") === "c:/path/to" + * getDirectoryPath("c:/path/to/") === "c:/path" + * getDirectoryPath("c:/") === "c:/" + * getDirectoryPath("c:") === "c:" + * // URL + * getDirectoryPath("http://typescriptlang.org/path/to/file.ext") === "http://typescriptlang.org/path/to" + * getDirectoryPath("http://typescriptlang.org/path/to") === "http://typescriptlang.org/path" + * getDirectoryPath("http://typescriptlang.org/") === "http://typescriptlang.org/" + * getDirectoryPath("http://typescriptlang.org") === "http://typescriptlang.org" + * ``` + */ +export declare function getDirectoryPath(path: Path): Path; +/** + * Returns the path except for its basename. Semantics align with NodeJS's `path.dirname` + * except that we support URLs as well. + * + * ```ts + * // POSIX + * getDirectoryPath("/path/to/file.ext") === "/path/to" + * getDirectoryPath("/path/to/") === "/path" + * getDirectoryPath("/") === "/" + * // DOS + * getDirectoryPath("c:/path/to/file.ext") === "c:/path/to" + * getDirectoryPath("c:/path/to/") === "c:/path" + * getDirectoryPath("c:/") === "c:/" + * getDirectoryPath("c:") === "c:" + * // URL + * getDirectoryPath("http://typescriptlang.org/path/to/file.ext") === "http://typescriptlang.org/path/to" + * getDirectoryPath("http://typescriptlang.org/path/to") === "http://typescriptlang.org/path" + * getDirectoryPath("http://typescriptlang.org/") === "http://typescriptlang.org/" + * getDirectoryPath("http://typescriptlang.org") === "http://typescriptlang.org" + * getDirectoryPath("file://server/path/to/file.ext") === "file://server/path/to" + * getDirectoryPath("file://server/path/to") === "file://server/path" + * getDirectoryPath("file://server/") === "file://server/" + * getDirectoryPath("file://server") === "file://server" + * getDirectoryPath("file:///path/to/file.ext") === "file:///path/to" + * getDirectoryPath("file:///path/to") === "file:///path" + * getDirectoryPath("file:///") === "file:///" + * getDirectoryPath("file://") === "file://" + * ``` + */ +export declare function getDirectoryPath(path: string): string; +/** + * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. + * + * ```ts + * // Non-rooted + * combinePaths("path", "to", "file.ext") === "path/to/file.ext" + * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" + * // POSIX + * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" + * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" + * // DOS + * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" + * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" + * // URL + * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" + * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" + * ``` + */ +export declare function combinePaths(path: string, ...paths: (string | undefined)[]): string; +/** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] + * ``` + */ +export declare function getNormalizedPathComponents(path: string, currentDirectory: string | undefined): string[]; +export declare function normalizePath(path: string): string; +/** + * Removes a trailing directory separator from a path, if it does not already have one. + * + * ```ts + * removeTrailingDirectorySeparator("/path/to/file.ext") === "/path/to/file.ext" + * removeTrailingDirectorySeparator("/path/to/file.ext/") === "/path/to/file.ext" + * ``` + */ +export declare function removeTrailingDirectorySeparator(path: Path): Path; +export declare function removeTrailingDirectorySeparator(path: string): string; +/** + * Determines whether a `parent` path contains a `child` path using the provide case sensitivity. + */ +export declare function containsPath(parent: string, child: string, ignoreCase?: boolean): boolean; +export declare function containsPath(parent: string, child: string, currentDirectory: string, ignoreCase?: boolean): boolean; diff --git a/.pnpm-store/v3/files/09/d0128cd24fbd16bbae83ba45afe02d8053cd8cf33f2c815f120c7465b751240bca358496cd91816e540535da415a7e3aba5e08addb2de9bcb26b6685ea11bb-index.json b/.pnpm-store/v3/files/09/d0128cd24fbd16bbae83ba45afe02d8053cd8cf33f2c815f120c7465b751240bca358496cd91816e540535da415a7e3aba5e08addb2de9bcb26b6685ea11bb-index.json new file mode 100644 index 00000000..922987a6 --- /dev/null +++ b/.pnpm-store/v3/files/09/d0128cd24fbd16bbae83ba45afe02d8053cd8cf33f2c815f120c7465b751240bca358496cd91816e540535da415a7e3aba5e08addb2de9bcb26b6685ea11bb-index.json @@ -0,0 +1 @@ +{"files":{".eslintrc":{"checkedAt":1707939899760,"integrity":"sha512-EBDRW6cKPexAflK5TvXZbx9EvGejXIyoPbyjoNOLl5Echn8KK7Z7Gs0WknJhkWSuAIaaX8pLKKihPo6R+hPg1Q==","mode":420,"size":122},".nycrc":{"checkedAt":1707939899760,"integrity":"sha512-42sgwWzusJB1Dzhl78jX/Zg65Oi0HDDMOGXS/Uklv1kCYn4fHtRsD/JFPwdu+d40vome9XdUspzRWEQAcTGEeQ==","mode":420,"size":216},"LICENSE":{"checkedAt":1707939899760,"integrity":"sha512-zSWZlPMHqdrYcu0iKn0DZJ7EU8PHWsyOsYC+m2L4TRgwzvU+9Xsi8DCgqVoMt3xcoyvGCZp05dGObt+3xshLBw==","mode":420,"size":1071},"index.js":{"checkedAt":1707939899760,"integrity":"sha512-epWlABre69fe9LO6vIcr1IPTF+SLwaDfJEkuM4T6GR93pEVD1P4Rlc0dzUilfoKCDHNm1Xa+iD3fgIUW1kc4Mg==","mode":420,"size":387},"test/index.js":{"checkedAt":1707939899760,"integrity":"sha512-/ZDSNI7rWFZiwI0Qtfj+ZAliLzTdqkXYwc2Y+t5U3lxKMaHVucArl4ViQ2qLRZFJk23xAoFwM20UUt8iLP7NEQ==","mode":420,"size":878},"package.json":{"checkedAt":1707939899760,"integrity":"sha512-njmG3001EmKn2systC4vtgbF5ln7WsyDn+l1D1sFWQISqcTs+auln1IneE5/ptsf3PQzqTsnquR4uhsl/940dw==","mode":420,"size":2031},"CHANGELOG.md":{"checkedAt":1707939899760,"integrity":"sha512-famfo8cQuuZ3sW3hOGIkUi3hGmV7DnCYA7np24THJCJZc1sTynhV3KvYaf1ZP1I8CH3Y5pVjRbVaATkjx1pQog==","mode":420,"size":3108},"README.md":{"checkedAt":1707939899760,"integrity":"sha512-Tm2RKyZJrD1cQ1Kd3R97BY83jb/QCldnnVNO/enG1YfOiGGi+ua/g7nZ1rJG40aUH0jy8Bq0jNssYHfGFe4GWg==","mode":420,"size":1828},".github/FUNDING.yml":{"checkedAt":1707939899760,"integrity":"sha512-TGZqAhBMHbhTCfCT8T6ONDQvaV9qM11rdJSG7+4xFjQ8oF35q7fORDZJiS+OkzzLOXVEkImW4oQIf6WTo1He0w==","mode":420,"size":586}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/09/e9b175aceda09d741fac4a786337f29b4398bee1076672757b2e9d0733b3dea5ead9af5ddccfdd1cc36f7019a6664fb9646468e664bad2e1c35683e211220b b/.pnpm-store/v3/files/09/e9b175aceda09d741fac4a786337f29b4398bee1076672757b2e9d0733b3dea5ead9af5ddccfdd1cc36f7019a6664fb9646468e664bad2e1c35683e211220b new file mode 100644 index 00000000..680744d3 --- /dev/null +++ b/.pnpm-store/v3/files/09/e9b175aceda09d741fac4a786337f29b4398bee1076672757b2e9d0733b3dea5ead9af5ddccfdd1cc36f7019a6664fb9646468e664bad2e1c35683e211220b @@ -0,0 +1,66 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.generateMap = exports.clone = void 0; +const sourcemap_codec_1 = require("@jridgewell/sourcemap-codec"); +const vscode_languageserver_textdocument_1 = require("vscode-languageserver-textdocument"); +const base_1 = require("./base"); +function clone(segments) { + const cloned = []; + for (const s of segments) { + if (typeof s === 'string') { + cloned.push(s); + } + else { + cloned.push([...s]); + } + } + return cloned; +} +exports.clone = clone; +function generateMap(segments, readSource) { + const cloned = clone(segments); + const mappings = []; + const sourceCode = new Map(); + let newLineIndex = (0, base_1.toString)(cloned).indexOf('\n'); + while (newLineIndex >= 0) { + onLine((0, base_1.overwrite)(cloned, [0, newLineIndex + 1])); + newLineIndex = (0, base_1.toString)(cloned).indexOf('\n'); + } + onLine((0, base_1.overwrite)(cloned, [0, (0, base_1.getLength)(cloned)])); + return (0, sourcemap_codec_1.encode)(mappings); + function onLine(lineSegments) { + const lineMapping = []; + let currentColumn = 0; + let hasCodeMapping = false; + for (const s of lineSegments) { + if (typeof s === 'string') { + if (hasCodeMapping) { + hasCodeMapping = false; + // we don't break off last mapping for now + } + currentColumn += s.length; + } + else { + hasCodeMapping = true; + const source = s[1]; + const sourceOffset = s[2][0]; + if (!sourceCode.has(source)) { + const readed = readSource(source); + sourceCode.set(source, [readed[0], vscode_languageserver_textdocument_1.TextDocument.create('', '', 0, readed[1])]); + } + const [sourceIndex, document] = sourceCode.get(source); + const position = document.positionAt(sourceOffset); + lineMapping.push([ + currentColumn, + sourceIndex, + position.line, + position.character, + ]); + currentColumn += s[0].length; + } + } + mappings.push(lineMapping); + } +} +exports.generateMap = generateMap; +//# sourceMappingURL=map.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0a/0f3357ea58de7790b8c37a3392827a3a83cf8e055d106778c7cd6029721c864c1c1b857bfb5a3731473e1e51706227beb07e01a986b5e5d7d724caf88e22da b/.pnpm-store/v3/files/0a/0f3357ea58de7790b8c37a3392827a3a83cf8e055d106778c7cd6029721c864c1c1b857bfb5a3731473e1e51706227beb07e01a986b5e5d7d724caf88e22da new file mode 100644 index 00000000..87d01a8f --- /dev/null +++ b/.pnpm-store/v3/files/0a/0f3357ea58de7790b8c37a3392827a3a83cf8e055d106778c7cd6029721c864c1c1b857bfb5a3731473e1e51706227beb07e01a986b5e5d7d724caf88e22da @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.register = void 0; +const featureWorkers_1 = require("../utils/featureWorkers"); +const cancellation_1 = require("../utils/cancellation"); +const language_core_1 = require("@volar/language-core"); +function register(context) { + return (uri, position, lastChange, token = cancellation_1.NoneCancellationToken) => { + return (0, featureWorkers_1.languageFeatureWorker)(context, uri, () => ({ position, lastChange }), function* (map) { + for (const mappedPosition of map.getGeneratedPositions(position, language_core_1.isAutoInsertEnabled)) { + const range = map.getGeneratedRange(lastChange.range); + if (range) { + yield { + position: mappedPosition, + lastChange: { + text: lastChange.text, + range, + }, + }; + } + } + }, (service, document, args) => { + if (token.isCancellationRequested) { + return; + } + return service[1].provideAutoInsertionEdit?.(document, args.position, args.lastChange, token); + }, (item, map) => { + if (!map || typeof item === 'string') { + return item; + } + const range = map.getSourceRange(item.range, language_core_1.isAutoInsertEnabled); + if (range) { + item.range = range; + return item; + } + }); + }; +} +exports.register = register; +//# sourceMappingURL=provideAutoInsertionEdit.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0a/5d16fa64ea151dae42440a0b32f6e8a0466765c7918b44a06e83783069f241de5a0f4746e5b3b957e9abb54a5db60bf01c725c3e86bd2ef45cb2fe2ffff1f0 b/.pnpm-store/v3/files/0a/5d16fa64ea151dae42440a0b32f6e8a0466765c7918b44a06e83783069f241de5a0f4746e5b3b957e9abb54a5db60bf01c725c3e86bd2ef45cb2fe2ffff1f0 new file mode 100644 index 00000000..879e3063 --- /dev/null +++ b/.pnpm-store/v3/files/0a/5d16fa64ea151dae42440a0b32f6e8a0466765c7918b44a06e83783069f241de5a0f4746e5b3b957e9abb54a5db60bf01c725c3e86bd2ef45cb2fe2ffff1f0 @@ -0,0 +1,249 @@ +--- +description: "Require explicit return and argument types on exported functions' and classes' public class methods." +--- + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/explicit-module-boundary-types** for documentation. + +Explicit types for function return values and arguments makes it clear to any calling code what is the module boundary's input and output. +Adding explicit type annotations for those types can help improve code readability. +It can also improve TypeScript type checking performance on larger codebases. + +## Examples + + + +### ❌ Incorrect + +```ts +// Should indicate that no value is returned (void) +export function test() { + return; +} + +// Should indicate that a string is returned +export var arrowFn = () => 'test'; + +// All arguments should be typed +export var arrowFn = (arg): string => `test ${arg}`; +export var arrowFn = (arg: any): string => `test ${arg}`; + +export class Test { + // Should indicate that no value is returned (void) + method() { + return; + } +} +``` + +### ✅ Correct + +```ts +// A function with no return value (void) +export function test(): void { + return; +} + +// A return value of type string +export var arrowFn = (): string => 'test'; + +// All arguments should be typed +export var arrowFn = (arg: string): string => `test ${arg}`; +export var arrowFn = (arg: unknown): string => `test ${arg}`; + +export class Test { + // A class method with no return value (void) + method(): void { + return; + } +} + +// The function does not apply because it is not an exported function. +function test() { + return; +} +``` + +## Options + +### Configuring in a mixed JS/TS codebase + +If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files. + +```jsonc +{ + "rules": { + // disable the rule for all files + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + "overrides": [ + { + // enable the rule specifically for TypeScript files + "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "error", + }, + }, + ], +} +``` + +### `allowArgumentsExplicitlyTypedAsAny` + +Examples of code for this rule with `{ allowArgumentsExplicitlyTypedAsAny: false }`: + + + +#### ❌ Incorrect + +```ts option='{ "allowArgumentsExplicitlyTypedAsAny": false }' +export const func = (value: any): number => value + 1; +``` + +#### ✅ Correct + +```ts option='{ "allowArgumentsExplicitlyTypedAsAny": false }' +export const func = (value: number): number => value + 1; +``` + +### `allowDirectConstAssertionInArrowFunctions` + +Examples of code for this rule with `{ allowDirectConstAssertionInArrowFunctions: false }`: + + + +#### ❌ Incorrect + +```ts option='{ "allowArgumentsExplicitlyTypedAsAny": false }' +export const func = (value: number) => ({ type: 'X', value }); +export const foo = () => ({ + bar: true, +}); +export const bar = () => 1; +``` + +#### ✅ Correct + +```ts option='{ "allowArgumentsExplicitlyTypedAsAny": false }' +export const func = (value: number) => ({ type: 'X', value }) as const; +export const foo = () => + ({ + bar: true, + }) as const; +export const bar = () => 1 as const; +``` + +### `allowedNames` + +You may pass function/method names you would like this rule to ignore, like so: + +```json +{ + "@typescript-eslint/explicit-module-boundary-types": [ + "error", + { + "allowedNames": ["ignoredFunctionName", "ignoredMethodName"] + } + ] +} +``` + +### `allowHigherOrderFunctions` + +Examples of code for this rule with `{ allowHigherOrderFunctions: false }`: + + + +#### ❌ Incorrect + +```ts option='{ "allowHigherOrderFunctions": false }' +export const arrowFn = () => () => {}; + +export function fn() { + return function () {}; +} + +export function foo(outer: string) { + return function (inner: string) {}; +} +``` + +#### ✅ Correct + +```ts option='{ "allowHigherOrderFunctions": false }' +export const arrowFn = () => (): void => {}; + +export function fn() { + return function (): void {}; +} + +export function foo(outer: string) { + return function (inner: string): void {}; +} +``` + +### `allowTypedFunctionExpressions` + +Examples of code for this rule with `{ allowTypedFunctionExpressions: false }`: + + + +#### ❌ Incorrect + +```ts option='{ "allowTypedFunctionExpressions": false }' +export let arrowFn = () => 'test'; + +export let funcExpr = function () { + return 'test'; +}; + +export let objectProp = { + foo: () => 1, +}; + +export const foo = bar => {}; +``` + +#### ✅ Correct + +```ts option='{ "allowTypedFunctionExpressions": false }' +type FuncType = () => string; + +export let arrowFn: FuncType = () => 'test'; + +export let funcExpr: FuncType = function () { + return 'test'; +}; + +export let asTyped = (() => '') as () => string; +export let castTyped = <() => string>(() => ''); + +interface ObjectType { + foo(): number; +} +export let objectProp: ObjectType = { + foo: () => 1, +}; +export let objectPropAs = { + foo: () => 1, +} as ObjectType; +export let objectPropCast = { + foo: () => 1, +}; + +type FooType = (bar: string) => void; +export const foo: FooType = bar => {}; +``` + +## When Not To Use It + +If your project is not used by downstream consumers that are sensitive to API types, you can disable this rule. + +## Further Reading + +- TypeScript [Functions](https://www.typescriptlang.org/docs/handbook/functions.html#function-types) + +## Related To + +- [explicit-function-return-type](./explicit-function-return-type.md) diff --git a/.pnpm-store/v3/files/0a/686d54b3dc2c3d26d8461907c3c9bcc918132103506f0c71236bf29429d6cd2b19a27f66d5cdda3ba5c91bc7b10a8464f2ac327edb21399a9312815be08b39 b/.pnpm-store/v3/files/0a/686d54b3dc2c3d26d8461907c3c9bcc918132103506f0c71236bf29429d6cd2b19a27f66d5cdda3ba5c91bc7b10a8464f2ac327edb21399a9312815be08b39 new file mode 100644 index 00000000..8ba64cff --- /dev/null +++ b/.pnpm-store/v3/files/0a/686d54b3dc2c3d26d8461907c3c9bcc918132103506f0c71236bf29429d6cd2b19a27f66d5cdda3ba5c91bc7b10a8464f2ac327edb21399a9312815be08b39 @@ -0,0 +1,107 @@ +'use strict'; + +var test = require('tape'); +var whichTypedArray = require('../'); +var isCallable = require('is-callable'); +var hasToStringTag = require('has-tostringtag/shams')(); +var generators = require('make-generator-function')(); +var arrows = require('make-arrow-function').list(); +var forEach = require('for-each'); + +var typedArrayNames = [ + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array' +]; + +test('not arrays', function (t) { + t.test('non-number/string primitives', function (st) { + // @ts-expect-error + st.equal(false, whichTypedArray(), 'undefined is not typed array'); + st.equal(false, whichTypedArray(null), 'null is not typed array'); + st.equal(false, whichTypedArray(false), 'false is not typed array'); + st.equal(false, whichTypedArray(true), 'true is not typed array'); + st.end(); + }); + + t.equal(false, whichTypedArray({}), 'object is not typed array'); + t.equal(false, whichTypedArray(/a/g), 'regex literal is not typed array'); + t.equal(false, whichTypedArray(new RegExp('a', 'g')), 'regex object is not typed array'); + t.equal(false, whichTypedArray(new Date()), 'new Date() is not typed array'); + + t.test('numbers', function (st) { + st.equal(false, whichTypedArray(42), 'number is not typed array'); + st.equal(false, whichTypedArray(Object(42)), 'number object is not typed array'); + st.equal(false, whichTypedArray(NaN), 'NaN is not typed array'); + st.equal(false, whichTypedArray(Infinity), 'Infinity is not typed array'); + st.end(); + }); + + t.test('strings', function (st) { + st.equal(false, whichTypedArray('foo'), 'string primitive is not typed array'); + st.equal(false, whichTypedArray(Object('foo')), 'string object is not typed array'); + st.end(); + }); + + t.end(); +}); + +test('Functions', function (t) { + t.equal(false, whichTypedArray(function () {}), 'function is not typed array'); + t.end(); +}); + +test('Generators', { skip: generators.length === 0 }, function (t) { + forEach(generators, function (genFn) { + t.equal(false, whichTypedArray(genFn), 'generator function ' + genFn + ' is not typed array'); + }); + t.end(); +}); + +test('Arrow functions', { skip: arrows.length === 0 }, function (t) { + forEach(arrows, function (arrowFn) { + t.equal(false, whichTypedArray(arrowFn), 'arrow function ' + arrowFn + ' is not typed array'); + }); + t.end(); +}); + +test('@@toStringTag', { skip: !hasToStringTag }, function (t) { + forEach(typedArrayNames, function (typedArray) { + // @ts-expect-error TODO: fix + if (typeof global[typedArray] === 'function') { + // @ts-expect-error TODO: fix + var fakeTypedArray = []; + // @ts-expect-error TODO: fix + fakeTypedArray[Symbol.toStringTag] = typedArray; + // @ts-expect-error TODO: fix + t.equal(false, whichTypedArray(fakeTypedArray), 'faked ' + typedArray + ' is not typed array'); + } else { + t.comment('# SKIP ' + typedArray + ' is not supported'); + } + }); + t.end(); +}); + +/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | BigInt64ArrayConstructor | BigUint64ArrayConstructor} TypedArrayConstructor */ + +test('Typed Arrays', function (t) { + forEach(typedArrayNames, function (typedArray) { + // @ts-expect-error TODO: fix + /** @type {TypedArrayConstructor} */ var TypedArray = global[typedArray]; + if (isCallable(TypedArray)) { + var arr = new TypedArray(10); + t.equal(whichTypedArray(arr), typedArray, 'new ' + typedArray + '(10) is typed array of type ' + typedArray); + } else { + t.comment('# SKIP ' + typedArray + ' is not supported'); + } + }); + t.end(); +}); diff --git a/.pnpm-store/v3/files/0a/9ebaa4f77c5ebdc95c2ea411942c939a2011c3e151dbc1acfbb0cf0243fc6099993fb217249da6c6b0b35860fd6fe8beff1950a764d03e0a996641199eceaf b/.pnpm-store/v3/files/0a/9ebaa4f77c5ebdc95c2ea411942c939a2011c3e151dbc1acfbb0cf0243fc6099993fb217249da6c6b0b35860fd6fe8beff1950a764d03e0a996641199eceaf new file mode 100644 index 00000000..f2ff705a --- /dev/null +++ b/.pnpm-store/v3/files/0a/9ebaa4f77c5ebdc95c2ea411942c939a2011c3e151dbc1acfbb0cf0243fc6099993fb217249da6c6b0b35860fd6fe8beff1950a764d03e0a996641199eceaf @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAEA,wDAAgC;AAChC,0DAAkC;AAClC,0FAAgE;AAChE,sFAA6D;AAC7D,wEAAgD;AAChD,kGAAwE;AACxE,8DAAsC;AACtC,wFAA8D;AAC9D,oEAA4C;AAC5C,8FAAoE;AACpE,oDAA4B;AAE5B,sHAAsH;AACtH,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAGlD,CAAC;AAEF,iBAAS;IACP,OAAO,EAAE;QACP,GAAG,EAAH,aAAG;QACH,IAAI,EAAJ,cAAI;QACJ,sBAAsB,EAAE,8BAAkB;QAC1C,oBAAoB,EAAE,4BAAiB;QACvC,WAAW,EAAX,qBAAW;QACX,mEAAmE;QACnE,qCAAqC,EAAE,kCAAsB;QAC7D,0BAA0B,EAAE,kCAAsB;QAClD,MAAM,EAAN,gBAAM;QACN,qBAAqB,EAAE,6BAAiB;QACxC,SAAS,EAAT,mBAAS;QACT,wBAAwB,EAAE,gCAAoB;KAC/C;IACD,IAAI,EAAE;QACJ,IAAI;QACJ,OAAO;KACR;IACD,KAAK,EAAL,eAAK;CACkB,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/0a/ca16570c37cdbbdefcb6dd21234b59eddcbafb75c06605a235eb526ef8df8557e07e3d92563bf3106d00230f06af52c4b80a256fdf6c00bace556323d8af5d b/.pnpm-store/v3/files/0a/ca16570c37cdbbdefcb6dd21234b59eddcbafb75c06605a235eb526ef8df8557e07e3d92563bf3106d00230f06af52c4b80a256fdf6c00bace556323d8af5d new file mode 100644 index 00000000..8c8ae63a --- /dev/null +++ b/.pnpm-store/v3/files/0a/ca16570c37cdbbdefcb6dd21234b59eddcbafb75c06605a235eb526ef8df8557e07e3d92563bf3106d00230f06af52c4b80a256fdf6c00bace556323d8af5d @@ -0,0 +1,46 @@ +import { VariantObject, Variant } from '@unocss/core'; +import { PresetMiniOptions } from './index.cjs'; +import { T as Theme } from './shared/preset-mini.hpPpX7ws.cjs'; +import './shared/preset-mini.YxT4AwuI.cjs'; +import './colors.cjs'; +import './shared/preset-mini.20fUBpHS.cjs'; + +declare const variantAria: VariantObject; + +declare function calcMaxWidthBySize(size: string): string; +declare function variantBreakpoints(): VariantObject; + +declare const variantCombinators: Variant[]; + +declare const variantContainerQuery: VariantObject; + +declare function variantColorsMediaOrClass(options?: PresetMiniOptions): Variant[]; + +declare const variantDataAttribute: VariantObject; +declare const variantTaggedDataAttributes: Variant[]; + +declare function variants(options: PresetMiniOptions): Variant[]; + +declare const variantLanguageDirections: Variant[]; + +declare function variantImportant(): VariantObject; + +declare const variantPrint: VariantObject; +declare const variantCustomMedia: VariantObject; + +declare const variantSelector: Variant; +declare const variantCssLayer: Variant; +declare const variantInternalLayer: Variant; +declare const variantScope: Variant; +declare const variantVariables: Variant; + +declare const variantNegative: Variant; + +declare function variantPseudoClassesAndElements(): VariantObject; +declare function variantPseudoClassFunctions(): VariantObject; +declare function variantTaggedPseudoClasses(options?: PresetMiniOptions): VariantObject[]; +declare const variantPartClasses: VariantObject; + +declare const variantSupports: VariantObject; + +export { calcMaxWidthBySize, variantAria, variantBreakpoints, variantColorsMediaOrClass, variantCombinators, variantContainerQuery, variantCssLayer, variantCustomMedia, variantDataAttribute, variantImportant, variantInternalLayer, variantLanguageDirections, variantNegative, variantPartClasses, variantPrint, variantPseudoClassFunctions, variantPseudoClassesAndElements, variantScope, variantSelector, variantSupports, variantTaggedDataAttributes, variantTaggedPseudoClasses, variantVariables, variants }; diff --git a/.pnpm-store/v3/files/0a/e7b862f36109e00b2938cb54c47951b56be630a54cbfb5fcbd6d72c64c9d72b0d061e085cf9f9fea2747afd470a582aafa86dfc1801fe17609d179c0041b56 b/.pnpm-store/v3/files/0a/e7b862f36109e00b2938cb54c47951b56be630a54cbfb5fcbd6d72c64c9d72b0d061e085cf9f9fea2747afd470a582aafa86dfc1801fe17609d179c0041b56 new file mode 100644 index 00000000..17e26699 --- /dev/null +++ b/.pnpm-store/v3/files/0a/e7b862f36109e00b2938cb54c47951b56be630a54cbfb5fcbd6d72c64c9d72b0d061e085cf9f9fea2747afd470a582aafa86dfc1801fe17609d179c0041b56 @@ -0,0 +1,804 @@ +import '@vite/env'; + +class HMRContext { + constructor(hmrClient, ownerPath) { + this.hmrClient = hmrClient; + this.ownerPath = ownerPath; + if (!hmrClient.dataMap.has(ownerPath)) { + hmrClient.dataMap.set(ownerPath, {}); + } + // when a file is hot updated, a new context is created + // clear its stale callbacks + const mod = hmrClient.hotModulesMap.get(ownerPath); + if (mod) { + mod.callbacks = []; + } + // clear stale custom event listeners + const staleListeners = hmrClient.ctxToListenersMap.get(ownerPath); + if (staleListeners) { + for (const [event, staleFns] of staleListeners) { + const listeners = hmrClient.customListenersMap.get(event); + if (listeners) { + hmrClient.customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l))); + } + } + } + this.newListeners = new Map(); + hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners); + } + get data() { + return this.hmrClient.dataMap.get(this.ownerPath); + } + accept(deps, callback) { + if (typeof deps === 'function' || !deps) { + // self-accept: hot.accept(() => {}) + this.acceptDeps([this.ownerPath], ([mod]) => deps === null || deps === void 0 ? void 0 : deps(mod)); + } + else if (typeof deps === 'string') { + // explicit deps + this.acceptDeps([deps], ([mod]) => callback === null || callback === void 0 ? void 0 : callback(mod)); + } + else if (Array.isArray(deps)) { + this.acceptDeps(deps, callback); + } + else { + throw new Error(`invalid hot.accept() usage.`); + } + } + // export names (first arg) are irrelevant on the client side, they're + // extracted in the server for propagation + acceptExports(_, callback) { + this.acceptDeps([this.ownerPath], ([mod]) => callback === null || callback === void 0 ? void 0 : callback(mod)); + } + dispose(cb) { + this.hmrClient.disposeMap.set(this.ownerPath, cb); + } + prune(cb) { + this.hmrClient.pruneMap.set(this.ownerPath, cb); + } + // Kept for backward compatibility (#11036) + // eslint-disable-next-line @typescript-eslint/no-empty-function + decline() { } + invalidate(message) { + this.hmrClient.notifyListeners('vite:invalidate', { + path: this.ownerPath, + message, + }); + this.send('vite:invalidate', { path: this.ownerPath, message }); + this.hmrClient.logger.debug(`[vite] invalidate ${this.ownerPath}${message ? `: ${message}` : ''}`); + } + on(event, cb) { + const addToMap = (map) => { + const existing = map.get(event) || []; + existing.push(cb); + map.set(event, existing); + }; + addToMap(this.hmrClient.customListenersMap); + addToMap(this.newListeners); + } + off(event, cb) { + const removeFromMap = (map) => { + const existing = map.get(event); + if (existing === undefined) { + return; + } + const pruned = existing.filter((l) => l !== cb); + if (pruned.length === 0) { + map.delete(event); + return; + } + map.set(event, pruned); + }; + removeFromMap(this.hmrClient.customListenersMap); + removeFromMap(this.newListeners); + } + send(event, data) { + this.hmrClient.messenger.send(JSON.stringify({ type: 'custom', event, data })); + } + acceptDeps(deps, callback = () => { }) { + const mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || { + id: this.ownerPath, + callbacks: [], + }; + mod.callbacks.push({ + deps, + fn: callback, + }); + this.hmrClient.hotModulesMap.set(this.ownerPath, mod); + } +} +class HMRMessenger { + constructor(connection) { + this.connection = connection; + this.queue = []; + } + send(message) { + this.queue.push(message); + this.flush(); + } + flush() { + if (this.connection.isReady()) { + this.queue.forEach((msg) => this.connection.send(msg)); + this.queue = []; + } + } +} +class HMRClient { + constructor(logger, connection, + // This allows implementing reloading via different methods depending on the environment + importUpdatedModule) { + this.logger = logger; + this.importUpdatedModule = importUpdatedModule; + this.hotModulesMap = new Map(); + this.disposeMap = new Map(); + this.pruneMap = new Map(); + this.dataMap = new Map(); + this.customListenersMap = new Map(); + this.ctxToListenersMap = new Map(); + this.updateQueue = []; + this.pendingUpdateQueue = false; + this.messenger = new HMRMessenger(connection); + } + async notifyListeners(event, data) { + const cbs = this.customListenersMap.get(event); + if (cbs) { + await Promise.allSettled(cbs.map((cb) => cb(data))); + } + } + clear() { + this.hotModulesMap.clear(); + this.disposeMap.clear(); + this.pruneMap.clear(); + this.dataMap.clear(); + this.customListenersMap.clear(); + this.ctxToListenersMap.clear(); + } + // After an HMR update, some modules are no longer imported on the page + // but they may have left behind side effects that need to be cleaned up + // (.e.g style injections) + // TODO Trigger their dispose callbacks. + prunePaths(paths) { + paths.forEach((path) => { + const fn = this.pruneMap.get(path); + if (fn) { + fn(this.dataMap.get(path)); + } + }); + } + warnFailedUpdate(err, path) { + if (!err.message.includes('fetch')) { + this.logger.error(err); + } + this.logger.error(`[hmr] Failed to reload ${path}. ` + + `This could be due to syntax errors or importing non-existent ` + + `modules. (see errors above)`); + } + /** + * buffer multiple hot updates triggered by the same src change + * so that they are invoked in the same order they were sent. + * (otherwise the order may be inconsistent because of the http request round trip) + */ + async queueUpdate(payload) { + this.updateQueue.push(this.fetchUpdate(payload)); + if (!this.pendingUpdateQueue) { + this.pendingUpdateQueue = true; + await Promise.resolve(); + this.pendingUpdateQueue = false; + const loading = [...this.updateQueue]; + this.updateQueue = []; + (await Promise.all(loading)).forEach((fn) => fn && fn()); + } + } + async fetchUpdate(update) { + const { path, acceptedPath } = update; + const mod = this.hotModulesMap.get(path); + if (!mod) { + // In a code-splitting project, + // it is common that the hot-updating module is not loaded yet. + // https://github.com/vitejs/vite/issues/721 + return; + } + let fetchedModule; + const isSelfUpdate = path === acceptedPath; + // determine the qualified callbacks before we re-import the modules + const qualifiedCallbacks = mod.callbacks.filter(({ deps }) => deps.includes(acceptedPath)); + if (isSelfUpdate || qualifiedCallbacks.length > 0) { + const disposer = this.disposeMap.get(acceptedPath); + if (disposer) + await disposer(this.dataMap.get(acceptedPath)); + try { + fetchedModule = await this.importUpdatedModule(update); + } + catch (e) { + this.warnFailedUpdate(e, acceptedPath); + } + } + return () => { + for (const { deps, fn } of qualifiedCallbacks) { + fn(deps.map((dep) => (dep === acceptedPath ? fetchedModule : undefined))); + } + const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`; + this.logger.debug(`[vite] hot updated: ${loggedPath}`); + }; + } +} + +const hmrConfigName = __HMR_CONFIG_NAME__; +const base$1 = __BASE__ || '/'; +// set :host styles to make playwright detect the element as visible +const template = /*html*/ ` + +
+
+
+

+    

+    

+    
+ Click outside, press Esc key, or fix the code to dismiss.
+ You can also disable this overlay by setting + server.hmr.overlay to false in ${hmrConfigName}. +
+
+
+`; +const fileRE = /(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g; +const codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm; +// Allow `ErrorOverlay` to extend `HTMLElement` even in environments where +// `HTMLElement` was not originally defined. +const { HTMLElement = class { +} } = globalThis; +class ErrorOverlay extends HTMLElement { + constructor(err, links = true) { + var _a; + super(); + this.root = this.attachShadow({ mode: 'open' }); + this.root.innerHTML = template; + codeframeRE.lastIndex = 0; + const hasFrame = err.frame && codeframeRE.test(err.frame); + const message = hasFrame + ? err.message.replace(codeframeRE, '') + : err.message; + if (err.plugin) { + this.text('.plugin', `[plugin:${err.plugin}] `); + } + this.text('.message-body', message.trim()); + const [file] = (((_a = err.loc) === null || _a === void 0 ? void 0 : _a.file) || err.id || 'unknown file').split(`?`); + if (err.loc) { + this.text('.file', `${file}:${err.loc.line}:${err.loc.column}`, links); + } + else if (err.id) { + this.text('.file', file); + } + if (hasFrame) { + this.text('.frame', err.frame.trim()); + } + this.text('.stack', err.stack, links); + this.root.querySelector('.window').addEventListener('click', (e) => { + e.stopPropagation(); + }); + this.addEventListener('click', () => { + this.close(); + }); + this.closeOnEsc = (e) => { + if (e.key === 'Escape' || e.code === 'Escape') { + this.close(); + } + }; + document.addEventListener('keydown', this.closeOnEsc); + } + text(selector, text, linkFiles = false) { + const el = this.root.querySelector(selector); + if (!linkFiles) { + el.textContent = text; + } + else { + let curIndex = 0; + let match; + fileRE.lastIndex = 0; + while ((match = fileRE.exec(text))) { + const { 0: file, index } = match; + if (index != null) { + const frag = text.slice(curIndex, index); + el.appendChild(document.createTextNode(frag)); + const link = document.createElement('a'); + link.textContent = file; + link.className = 'file-link'; + link.onclick = () => { + fetch(new URL(`${base$1}__open-in-editor?file=${encodeURIComponent(file)}`, import.meta.url)); + }; + el.appendChild(link); + curIndex += frag.length + file.length; + } + } + } + } + close() { + var _a; + (_a = this.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this); + document.removeEventListener('keydown', this.closeOnEsc); + } +} +const overlayId = 'vite-error-overlay'; +const { customElements } = globalThis; // Ensure `customElements` is defined before the next line. +if (customElements && !customElements.get(overlayId)) { + customElements.define(overlayId, ErrorOverlay); +} + +console.debug('[vite] connecting...'); +const importMetaUrl = new URL(import.meta.url); +// use server configuration, then fallback to inference +const serverHost = __SERVER_HOST__; +const socketProtocol = __HMR_PROTOCOL__ || (importMetaUrl.protocol === 'https:' ? 'wss' : 'ws'); +const hmrPort = __HMR_PORT__; +const socketHost = `${__HMR_HOSTNAME__ || importMetaUrl.hostname}:${hmrPort || importMetaUrl.port}${__HMR_BASE__}`; +const directSocketHost = __HMR_DIRECT_TARGET__; +const base = __BASE__ || '/'; +let socket; +try { + let fallback; + // only use fallback when port is inferred to prevent confusion + if (!hmrPort) { + fallback = () => { + // fallback to connecting directly to the hmr server + // for servers which does not support proxying websocket + socket = setupWebSocket(socketProtocol, directSocketHost, () => { + const currentScriptHostURL = new URL(import.meta.url); + const currentScriptHost = currentScriptHostURL.host + + currentScriptHostURL.pathname.replace(/@vite\/client$/, ''); + console.error('[vite] failed to connect to websocket.\n' + + 'your current setup:\n' + + ` (browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)\n` + + ` (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)\n` + + 'Check out your Vite / network configuration and https://vitejs.dev/config/server-options.html#server-hmr .'); + }); + socket.addEventListener('open', () => { + console.info('[vite] Direct websocket connection fallback. Check out https://vitejs.dev/config/server-options.html#server-hmr to remove the previous connection error.'); + }, { once: true }); + }; + } + socket = setupWebSocket(socketProtocol, socketHost, fallback); +} +catch (error) { + console.error(`[vite] failed to connect to websocket (${error}). `); +} +function setupWebSocket(protocol, hostAndPath, onCloseWithoutOpen) { + const socket = new WebSocket(`${protocol}://${hostAndPath}`, 'vite-hmr'); + let isOpened = false; + socket.addEventListener('open', () => { + isOpened = true; + notifyListeners('vite:ws:connect', { webSocket: socket }); + }, { once: true }); + // Listen for messages + socket.addEventListener('message', async ({ data }) => { + handleMessage(JSON.parse(data)); + }); + // ping server + socket.addEventListener('close', async ({ wasClean }) => { + if (wasClean) + return; + if (!isOpened && onCloseWithoutOpen) { + onCloseWithoutOpen(); + return; + } + notifyListeners('vite:ws:disconnect', { webSocket: socket }); + console.log(`[vite] server connection lost. polling for restart...`); + await waitForSuccessfulPing(protocol, hostAndPath); + location.reload(); + }); + return socket; +} +function cleanUrl(pathname) { + const url = new URL(pathname, location.toString()); + url.searchParams.delete('direct'); + return url.pathname + url.search; +} +let isFirstUpdate = true; +const outdatedLinkTags = new WeakSet(); +const debounceReload = (time) => { + let timer; + return () => { + if (timer) { + clearTimeout(timer); + timer = null; + } + timer = setTimeout(() => { + location.reload(); + }, time); + }; +}; +const pageReload = debounceReload(50); +const hmrClient = new HMRClient(console, { + isReady: () => socket && socket.readyState === 1, + send: (message) => socket.send(message), +}, async function importUpdatedModule({ acceptedPath, timestamp, explicitImportRequired, isWithinCircularImport, }) { + const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`); + const importPromise = import( + /* @vite-ignore */ + base + + acceptedPathWithoutQuery.slice(1) + + `?${explicitImportRequired ? 'import&' : ''}t=${timestamp}${query ? `&${query}` : ''}`); + if (isWithinCircularImport) { + importPromise.catch(() => { + console.info(`[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. ` + + `To debug and break the circular import, you can run \`vite --debug hmr\` to log the circular dependency path if a file change triggered it.`); + pageReload(); + }); + } + return await importPromise; +}); +async function handleMessage(payload) { + switch (payload.type) { + case 'connected': + console.debug(`[vite] connected.`); + hmrClient.messenger.flush(); + // proxy(nginx, docker) hmr ws maybe caused timeout, + // so send ping package let ws keep alive. + setInterval(() => { + if (socket.readyState === socket.OPEN) { + socket.send('{"type":"ping"}'); + } + }, __HMR_TIMEOUT__); + break; + case 'update': + notifyListeners('vite:beforeUpdate', payload); + // if this is the first update and there's already an error overlay, it + // means the page opened with existing server compile error and the whole + // module script failed to load (since one of the nested imports is 500). + // in this case a normal update won't work and a full reload is needed. + if (isFirstUpdate && hasErrorOverlay()) { + window.location.reload(); + return; + } + else { + clearErrorOverlay(); + isFirstUpdate = false; + } + await Promise.all(payload.updates.map(async (update) => { + if (update.type === 'js-update') { + return hmrClient.queueUpdate(update); + } + // css-update + // this is only sent when a css file referenced with is updated + const { path, timestamp } = update; + const searchUrl = cleanUrl(path); + // can't use querySelector with `[href*=]` here since the link may be + // using relative paths so we need to use link.href to grab the full + // URL for the include check. + const el = Array.from(document.querySelectorAll('link')).find((e) => !outdatedLinkTags.has(e) && cleanUrl(e.href).includes(searchUrl)); + if (!el) { + return; + } + const newPath = `${base}${searchUrl.slice(1)}${searchUrl.includes('?') ? '&' : '?'}t=${timestamp}`; + // rather than swapping the href on the existing tag, we will + // create a new link tag. Once the new stylesheet has loaded we + // will remove the existing link tag. This removes a Flash Of + // Unstyled Content that can occur when swapping out the tag href + // directly, as the new stylesheet has not yet been loaded. + return new Promise((resolve) => { + const newLinkTag = el.cloneNode(); + newLinkTag.href = new URL(newPath, el.href).href; + const removeOldEl = () => { + el.remove(); + console.debug(`[vite] css hot updated: ${searchUrl}`); + resolve(); + }; + newLinkTag.addEventListener('load', removeOldEl); + newLinkTag.addEventListener('error', removeOldEl); + outdatedLinkTags.add(el); + el.after(newLinkTag); + }); + })); + notifyListeners('vite:afterUpdate', payload); + break; + case 'custom': { + notifyListeners(payload.event, payload.data); + break; + } + case 'full-reload': + notifyListeners('vite:beforeFullReload', payload); + if (payload.path && payload.path.endsWith('.html')) { + // if html file is edited, only reload the page if the browser is + // currently on that page. + const pagePath = decodeURI(location.pathname); + const payloadPath = base + payload.path.slice(1); + if (pagePath === payloadPath || + payload.path === '/index.html' || + (pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath)) { + pageReload(); + } + return; + } + else { + pageReload(); + } + break; + case 'prune': + notifyListeners('vite:beforePrune', payload); + hmrClient.prunePaths(payload.paths); + break; + case 'error': { + notifyListeners('vite:error', payload); + const err = payload.err; + if (enableOverlay) { + createErrorOverlay(err); + } + else { + console.error(`[vite] Internal Server Error\n${err.message}\n${err.stack}`); + } + break; + } + default: { + const check = payload; + return check; + } + } +} +function notifyListeners(event, data) { + hmrClient.notifyListeners(event, data); +} +const enableOverlay = __HMR_ENABLE_OVERLAY__; +function createErrorOverlay(err) { + clearErrorOverlay(); + document.body.appendChild(new ErrorOverlay(err)); +} +function clearErrorOverlay() { + document.querySelectorAll(overlayId).forEach((n) => n.close()); +} +function hasErrorOverlay() { + return document.querySelectorAll(overlayId).length; +} +async function waitForSuccessfulPing(socketProtocol, hostAndPath, ms = 1000) { + const pingHostProtocol = socketProtocol === 'wss' ? 'https' : 'http'; + const ping = async () => { + // A fetch on a websocket URL will return a successful promise with status 400, + // but will reject a networking error. + // When running on middleware mode, it returns status 426, and an cors error happens if mode is not no-cors + try { + await fetch(`${pingHostProtocol}://${hostAndPath}`, { + mode: 'no-cors', + headers: { + // Custom headers won't be included in a request with no-cors so (ab)use one of the + // safelisted headers to identify the ping request + Accept: 'text/x-vite-ping', + }, + }); + return true; + } + catch { } + return false; + }; + if (await ping()) { + return; + } + await wait(ms); + // eslint-disable-next-line no-constant-condition + while (true) { + if (document.visibilityState === 'visible') { + if (await ping()) { + break; + } + await wait(ms); + } + else { + await waitForWindowShow(); + } + } +} +function wait(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} +function waitForWindowShow() { + return new Promise((resolve) => { + const onChange = async () => { + if (document.visibilityState === 'visible') { + resolve(); + document.removeEventListener('visibilitychange', onChange); + } + }; + document.addEventListener('visibilitychange', onChange); + }); +} +const sheetsMap = new Map(); +// collect existing style elements that may have been inserted during SSR +// to avoid FOUC or duplicate styles +if ('document' in globalThis) { + document + .querySelectorAll('style[data-vite-dev-id]') + .forEach((el) => { + sheetsMap.set(el.getAttribute('data-vite-dev-id'), el); + }); +} +// all css imports should be inserted at the same position +// because after build it will be a single css file +let lastInsertedStyle; +function updateStyle(id, content) { + let style = sheetsMap.get(id); + if (!style) { + style = document.createElement('style'); + style.setAttribute('type', 'text/css'); + style.setAttribute('data-vite-dev-id', id); + style.textContent = content; + if (!lastInsertedStyle) { + document.head.appendChild(style); + // reset lastInsertedStyle after async + // because dynamically imported css will be splitted into a different file + setTimeout(() => { + lastInsertedStyle = undefined; + }, 0); + } + else { + lastInsertedStyle.insertAdjacentElement('afterend', style); + } + lastInsertedStyle = style; + } + else { + style.textContent = content; + } + sheetsMap.set(id, style); +} +function removeStyle(id) { + const style = sheetsMap.get(id); + if (style) { + document.head.removeChild(style); + sheetsMap.delete(id); + } +} +function createHotContext(ownerPath) { + return new HMRContext(hmrClient, ownerPath); +} +/** + * urls here are dynamic import() urls that couldn't be statically analyzed + */ +function injectQuery(url, queryToInject) { + // skip urls that won't be handled by vite + if (url[0] !== '.' && url[0] !== '/') { + return url; + } + // can't use pathname from URL since it may be relative like ../ + const pathname = url.replace(/[?#].*$/s, ''); + const { search, hash } = new URL(url, 'http://vitejs.dev'); + return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${hash || ''}`; +} + +export { ErrorOverlay, createHotContext, injectQuery, removeStyle, updateStyle }; +//# sourceMappingURL=client.mjs.map diff --git a/.pnpm-store/v3/files/0a/ff1a500c9310cf22b93035d526a7693bcaf3c37262e0ef0053e4e1c2a18435e897d385d9e56a4474b522e92c320df59d1808981e4b9dc891f9395307b64001 b/.pnpm-store/v3/files/0a/ff1a500c9310cf22b93035d526a7693bcaf3c37262e0ef0053e4e1c2a18435e897d385d9e56a4474b522e92c320df59d1808981e4b9dc891f9395307b64001 new file mode 100644 index 00000000..f11eef6a --- /dev/null +++ b/.pnpm-store/v3/files/0a/ff1a500c9310cf22b93035d526a7693bcaf3c37262e0ef0053e4e1c2a18435e897d385d9e56a4474b522e92c320df59d1808981e4b9dc891f9395307b64001 @@ -0,0 +1,304 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createLanguage = void 0; +const language_core_1 = require("@volar/language-core"); +const language_core_2 = require("@volar/language-core"); +const path = require("path-browserify"); +const resolveModuleName_1 = require("../resolveModuleName"); +const scriptVersions = new Map(); +const fsFileSnapshots = new Map(); +function createLanguage(ts, sys, languagePlugins, configFileName, projectHost, { fileIdToFileName, fileNameToFileId }) { + const files = (0, language_core_1.createFileRegistry)(languagePlugins, sys.useCaseSensitiveFileNames, fileId => { + const fileName = fileIdToFileName(fileId); + // opened files + let snapshot = projectHost.getScriptSnapshot(fileName); + if (!snapshot) { + // fs files + const cache = fsFileSnapshots.get(fileName); + const modifiedTime = sys.getModifiedTime?.(fileName)?.valueOf(); + if (!cache || cache[0] !== modifiedTime) { + if (sys.fileExists(fileName)) { + const text = sys.readFile(fileName); + const snapshot = text !== undefined ? ts.ScriptSnapshot.fromString(text) : undefined; + fsFileSnapshots.set(fileName, [modifiedTime, snapshot]); + } + else { + fsFileSnapshots.set(fileName, [modifiedTime, undefined]); + } + } + snapshot = fsFileSnapshots.get(fileName)?.[1]; + } + if (snapshot) { + files.set(fileId, projectHost.getLanguageId(fileId), snapshot); + } + else { + files.delete(fileId); + } + }); + let { languageServiceHost, getExtraScript } = createLanguageServiceHost(); + for (const language of languagePlugins) { + if (language.typescript?.resolveLanguageServiceHost) { + languageServiceHost = language.typescript.resolveLanguageServiceHost(languageServiceHost); + } + } + if (languagePlugins.some(language => language.typescript?.extraFileExtensions.length)) { + // TODO: can this share between monorepo packages? + const moduleCache = ts.createModuleResolutionCache(languageServiceHost.getCurrentDirectory(), languageServiceHost.useCaseSensitiveFileNames ? s => s : s => s.toLowerCase(), languageServiceHost.getCompilationSettings()); + const resolveModuleName = (0, resolveModuleName_1.createResolveModuleName)(ts, languageServiceHost, languagePlugins, fileName => files.get(fileNameToFileId(fileName))); + let lastSysVersion = 'version' in sys ? sys.version : undefined; + languageServiceHost.resolveModuleNameLiterals = (moduleLiterals, containingFile, redirectedReference, options, sourceFile) => { + if ('version' in sys && lastSysVersion !== sys.version) { + lastSysVersion = sys.version; + moduleCache.clear(); + } + return moduleLiterals.map(moduleLiteral => { + return resolveModuleName(moduleLiteral.text, containingFile, options, moduleCache, redirectedReference, sourceFile.impliedNodeFormat); + }); + }; + languageServiceHost.resolveModuleNames = (moduleNames, containingFile, _reusedNames, redirectedReference, options) => { + if ('version' in sys && lastSysVersion !== sys.version) { + lastSysVersion = sys.version; + moduleCache.clear(); + } + return moduleNames.map(moduleName => { + return resolveModuleName(moduleName, containingFile, options, moduleCache, redirectedReference).resolvedModule; + }); + }; + } + return { + files, + typescript: { + configFileName, + sys, + projectHost, + languageServiceHost, + getExtraScript, + }, + }; + function createLanguageServiceHost() { + let lastProjectVersion; + let tsProjectVersion = 0; + let tsFileRegistry = new language_core_1.FileMap(sys.useCaseSensitiveFileNames); + let extraScriptRegistry = new language_core_1.FileMap(sys.useCaseSensitiveFileNames); + let lastTsVirtualFileSnapshots = new Set(); + let lastOtherVirtualFileSnapshots = new Set(); + const languageServiceHost = { + ...sys, + getCurrentDirectory: projectHost.getCurrentDirectory, + getCompilationSettings() { + const options = projectHost.getCompilationSettings(); + if (languagePlugins.some(language => language.typescript?.extraFileExtensions.length)) { + options.allowNonTsExtensions ??= true; + if (!options.allowNonTsExtensions) { + console.warn('`allowNonTsExtensions` must be `true`.'); + } + } + return options; + }, + getLocalizedDiagnosticMessages: projectHost.getLocalizedDiagnosticMessages, + getProjectReferences: projectHost.getProjectReferences, + getDefaultLibFileName: options => { + try { + return ts.getDefaultLibFilePath(options); + } + catch { + // web + return `/node_modules/typescript/lib/${ts.getDefaultLibFileName(options)}`; + } + }, + useCaseSensitiveFileNames() { + return sys.useCaseSensitiveFileNames; + }, + getNewLine() { + return sys.newLine; + }, + getTypeRootsVersion: () => { + return 'version' in sys ? sys.version : -1; // TODO: only update for /node_modules changes? + }, + getDirectories(dirName) { + return sys.getDirectories(dirName); + }, + readDirectory(dirName, extensions, excludes, includes, depth) { + const exts = new Set(extensions); + for (const languagePlugin of languagePlugins) { + for (const ext of languagePlugin.typescript?.extraFileExtensions ?? []) { + exts.add('.' + ext.extension); + } + } + extensions = [...exts]; + return sys.readDirectory(dirName, extensions, excludes, includes, depth); + }, + readFile(fileName) { + const snapshot = getScriptSnapshot(fileName); + if (snapshot) { + return snapshot.getText(0, snapshot.getLength()); + } + }, + fileExists(fileName) { + return getScriptVersion(fileName) !== ''; + }, + getProjectVersion() { + sync(); + return tsProjectVersion + ('version' in sys ? `:${sys.version}` : ''); + }, + getScriptFileNames() { + sync(); + return [...tsFileRegistry.keys()]; + }, + getScriptKind(fileName) { + sync(); + if (extraScriptRegistry.has(fileName)) { + return extraScriptRegistry.get(fileName).scriptKind; + } + const sourceFile = files.get(fileNameToFileId(fileName)); + if (sourceFile?.generated) { + const tsCode = sourceFile.generated.languagePlugin.typescript?.getScript(sourceFile.generated.code); + if (tsCode) { + return tsCode.scriptKind; + } + } + switch (path.extname(fileName)) { + case '.js': + case '.cjs': + case '.mjs': + return ts.ScriptKind.JS; + case '.jsx': + return ts.ScriptKind.JSX; + case '.ts': + case '.cts': + case '.mts': + return ts.ScriptKind.TS; + case '.tsx': + return ts.ScriptKind.TSX; + case '.json': + return ts.ScriptKind.JSON; + default: + return ts.ScriptKind.Unknown; + } + }, + getScriptVersion, + getScriptSnapshot, + }; + return { + languageServiceHost, + getExtraScript, + }; + function getExtraScript(fileName) { + sync(); + return extraScriptRegistry.get(fileName); + } + function sync() { + const newProjectVersion = projectHost.getProjectVersion?.(); + const shouldUpdate = newProjectVersion === undefined || newProjectVersion !== lastProjectVersion; + if (!shouldUpdate) { + return; + } + lastProjectVersion = newProjectVersion; + extraScriptRegistry.clear(); + const newTsVirtualFileSnapshots = new Set(); + const newOtherVirtualFileSnapshots = new Set(); + const tsFileNamesSet = new Set(); + for (const fileName of projectHost.getScriptFileNames()) { + const sourceFile = files.get(fileNameToFileId(fileName)); + if (sourceFile?.generated) { + const script = sourceFile.generated.languagePlugin.typescript?.getScript(sourceFile.generated.code); + if (script) { + newTsVirtualFileSnapshots.add(script.code.snapshot); + tsFileNamesSet.add(fileName); + } + for (const extraScript of sourceFile.generated.languagePlugin.typescript?.getExtraScripts?.(fileName, sourceFile.generated.code) ?? []) { + newTsVirtualFileSnapshots.add(extraScript.code.snapshot); + tsFileNamesSet.add(extraScript.fileName); + extraScriptRegistry.set(extraScript.fileName, extraScript); + } + for (const code of (0, language_core_2.forEachEmbeddedCode)(sourceFile.generated.code)) { + newOtherVirtualFileSnapshots.add(code.snapshot); + } + } + else { + tsFileNamesSet.add(fileName); + } + } + if (!setEquals(lastTsVirtualFileSnapshots, newTsVirtualFileSnapshots)) { + tsProjectVersion++; + } + else if (setEquals(lastOtherVirtualFileSnapshots, newOtherVirtualFileSnapshots)) { + // no any meta language files update, it mean project version was update by source files this time + tsProjectVersion++; + } + lastTsVirtualFileSnapshots = newTsVirtualFileSnapshots; + lastOtherVirtualFileSnapshots = newOtherVirtualFileSnapshots; + tsFileRegistry.clear(); + for (const fileName of tsFileNamesSet) { + tsFileRegistry.set(fileName, true); + } + } + function getScriptSnapshot(fileName) { + sync(); + if (extraScriptRegistry.has(fileName)) { + return extraScriptRegistry.get(fileName).code.snapshot; + } + const sourceFile = files.get(fileNameToFileId(fileName)); + if (sourceFile?.generated) { + const script = sourceFile.generated.languagePlugin.typescript?.getScript(sourceFile.generated.code); + if (script) { + return script.code.snapshot; + } + } + else if (sourceFile) { + return sourceFile.snapshot; + } + } + function getScriptVersion(fileName) { + sync(); + if (!scriptVersions.has(fileName)) { + scriptVersions.set(fileName, { lastVersion: 0, map: new WeakMap() }); + } + const version = scriptVersions.get(fileName); + if (extraScriptRegistry.has(fileName)) { + const snapshot = extraScriptRegistry.get(fileName).code.snapshot; + if (!version.map.has(snapshot)) { + version.map.set(snapshot, version.lastVersion++); + } + return version.map.get(snapshot).toString(); + } + const sourceFile = files.get(fileNameToFileId(fileName)); + if (sourceFile?.generated) { + const script = sourceFile.generated.languagePlugin.typescript?.getScript(sourceFile.generated.code); + if (script) { + if (!version.map.has(script.code.snapshot)) { + version.map.set(script.code.snapshot, version.lastVersion++); + } + return version.map.get(script.code.snapshot).toString(); + } + } + const isOpenedFile = !!projectHost.getScriptSnapshot(fileName); + if (isOpenedFile) { + const sourceFile = files.get(fileNameToFileId(fileName)); + if (sourceFile && !sourceFile.generated) { + if (!version.map.has(sourceFile.snapshot)) { + version.map.set(sourceFile.snapshot, version.lastVersion++); + } + return version.map.get(sourceFile.snapshot).toString(); + } + } + if (sys.fileExists(fileName)) { + return sys.getModifiedTime?.(fileName)?.valueOf().toString() ?? '0'; + } + return ''; + } + } +} +exports.createLanguage = createLanguage; +function setEquals(a, b) { + if (a.size !== b.size) { + return false; + } + for (const item of a) { + if (!b.has(item)) { + return false; + } + } + return true; +} +//# sourceMappingURL=createProject.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0b/0a11909c19d46e635ed6c35a0e0f0c61316832edc12383cf725ed863d1d225b038b9dde7300d64d48e3c9797feda65305559cee729a0e1d93487fed03a0402 b/.pnpm-store/v3/files/0b/0a11909c19d46e635ed6c35a0e0f0c61316832edc12383cf725ed863d1d225b038b9dde7300d64d48e3c9797feda65305559cee729a0e1d93487fed03a0402 new file mode 100644 index 00000000..92d8e321 --- /dev/null +++ b/.pnpm-store/v3/files/0b/0a11909c19d46e635ed6c35a0e0f0c61316832edc12383cf725ed863d1d225b038b9dde7300d64d48e3c9797feda65305559cee729a0e1d93487fed03a0402 @@ -0,0 +1,138 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SnapshotDocument = void 0; +const vscode_languageserver_textdocument_1 = require("vscode-languageserver-textdocument"); +const combine_1 = require("./combine"); +class SnapshotDocument { + constructor(uri, languageId, version, text) { + this.snapshots = []; + this.document = vscode_languageserver_textdocument_1.TextDocument.create(uri, languageId, version, text); + this.resetChanges(); + } + get uri() { + return this.document.uri; + } + get languageId() { + return this.document.languageId; + } + get version() { + return this.document.version; + } + get lineCount() { + return this.document.lineCount; + } + getText(range) { + return this.document.getText(range); + } + positionAt(offset) { + return this.document.positionAt(offset); + } + offsetAt(position) { + return this.document.offsetAt(position); + } + /** + * Update the document with the given content changes and version. + * If all changes is incremental, calculate the change range and add a new snapshot. + * Otherwise, reset the changes. + */ + update(contentChanges, version) { + if (contentChanges.every(change => 'range' in change)) { + const { minStart, oldLength, lengthDiff } = this.calculateChangeRange(contentChanges); + vscode_languageserver_textdocument_1.TextDocument.update(this.document, contentChanges, version); + this.snapshots.push({ + changeRange: { + span: { + start: minStart, + length: oldLength, + }, + newLength: oldLength + lengthDiff, + }, + version, + ref: undefined, + }); + } + else { + vscode_languageserver_textdocument_1.TextDocument.update(this.document, contentChanges, version); + this.resetChanges(); + } + } + getSnapshot() { + this.clearUnreferencedVersions(); + const lastChange = this.snapshots[this.snapshots.length - 1]; + if (!lastChange.ref) { + const text = this.document.getText(); + const changeRangeCache = new WeakMap(); + const snapshot = { + getText: (start, end) => text.substring(start, end), + getLength: () => text.length, + getChangeRange: oldSnapshot => { + if (!changeRangeCache.has(oldSnapshot)) { + const oldIndex = this.snapshots.findIndex(change => change.ref?.deref() === oldSnapshot); + if (oldIndex >= 0) { + const start = oldIndex + 1; + const end = this.snapshots.indexOf(lastChange) + 1; + const changeRanges = this.snapshots + .slice(start, end) + .map(change => change.changeRange); + const changeRange = (0, combine_1.combineChangeRanges)(...changeRanges); + changeRangeCache.set(oldSnapshot, changeRange); + } + else { + changeRangeCache.set(oldSnapshot, undefined); + } + } + return changeRangeCache.get(oldSnapshot); + }, + }; + lastChange.ref = new WeakRef(snapshot); + } + return lastChange.ref.deref(); + } + resetChanges() { + this.snapshots = [ + { + changeRange: { + span: { + start: 0, + length: 0, + }, + newLength: this.document.getText().length, + }, + version: this.document.version, + ref: undefined, + } + ]; + } + /** + * Calculate the change range from the given content changes. + */ + calculateChangeRange(contentChanges) { + let lengthDiff = 0; + const starts = []; + const ends = []; + for (const contentChange of contentChanges) { + if (!('range' in contentChange)) { + continue; + } + const start = this.offsetAt(contentChange.range.start); + const length = contentChange.rangeLength ?? this.offsetAt(contentChange.range.end) - start; + const end = start + length; + starts.push(start); + ends.push(end); + lengthDiff += contentChange.text.length - length; + } + const minStart = Math.min(...starts); + const maxEnd = Math.max(...ends); + const oldLength = maxEnd - minStart; + return { minStart, oldLength, lengthDiff }; + } + clearUnreferencedVersions() { + let firstReferencedIndex = 0; + while (firstReferencedIndex < this.snapshots.length - 1 && !this.snapshots[firstReferencedIndex].ref?.deref()) { + firstReferencedIndex++; + } + this.snapshots = this.snapshots.slice(firstReferencedIndex); + } +} +exports.SnapshotDocument = SnapshotDocument; +//# sourceMappingURL=snapshotDocument.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0b/4fb939bfd802ede22219bde388e2a18be4555e592280c9055c9754eae21af7b368ea6b1e757b94e607963732a832952557eb33cacd675840baf449fc92fc4e b/.pnpm-store/v3/files/0b/4fb939bfd802ede22219bde388e2a18be4555e592280c9055c9754eae21af7b368ea6b1e757b94e607963732a832952557eb33cacd675840baf449fc92fc4e new file mode 100644 index 00000000..d360a8e0 --- /dev/null +++ b/.pnpm-store/v3/files/0b/4fb939bfd802ede22219bde388e2a18be4555e592280c9055c9754eae21af7b368ea6b1e757b94e607963732a832952557eb33cacd675840baf449fc92fc4e @@ -0,0 +1,47 @@ +{ + "name": "@astrojs/check", + "version": "0.5.4", + "author": "withastro", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/withastro/language-tools", + "directory": "packages/astro-check" + }, + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "bin": { + "astro-check": "./dist/bin.js" + }, + "files": [ + "bin", + "dist/**/*.js", + "dist/**/*.d.ts" + ], + "dependencies": { + "@astrojs/language-server": "^2.7.4", + "chokidar": "^3.5.3", + "fast-glob": "^3.3.1", + "kleur": "^4.1.5", + "yargs": "^17.7.2" + }, + "devDependencies": { + "@types/node": "^18.17.8", + "@types/yargs": "^17.0.24", + "@types/chai": "^4.3.5", + "@types/mocha": "^10.0.1", + "chai": "^4.3.7", + "mocha": "^10.2.0", + "tsx": "^3.12.7" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "test": "mocha --timeout 50000 --require tsx test/**/*.test.ts", + "test:match": "pnpm run test -g" + } +} \ No newline at end of file diff --git a/.pnpm-store/v3/files/0b/5485494fcc40c2bf13d59cdc9add666ca3efa461b49b04e96e0b43fbbb587ec564d4521913c0cd0d4562f8220dd5d336b6e80b11a4f780d7ac54a3d25bde4c b/.pnpm-store/v3/files/0b/5485494fcc40c2bf13d59cdc9add666ca3efa461b49b04e96e0b43fbbb587ec564d4521913c0cd0d4562f8220dd5d336b6e80b11a4f780d7ac54a3d25bde4c new file mode 100644 index 00000000..574da422 --- /dev/null +++ b/.pnpm-store/v3/files/0b/5485494fcc40c2bf13d59cdc9add666ca3efa461b49b04e96e0b43fbbb587ec564d4521913c0cd0d4562f8220dd5d336b6e80b11a4f780d7ac54a3d25bde4c @@ -0,0 +1,538 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +// Truthiness utilities +// #region +const isTruthyLiteral = (type) => tsutils.isTrueLiteralType(type) || + // || type. + (type.isLiteral() && !!type.value); +const isPossiblyFalsy = (type) => tsutils + .unionTypeParts(type) + // Intersections like `string & {}` can also be possibly falsy, + // requiring us to look into the intersection. + .flatMap(type => tsutils.intersectionTypeParts(type)) + // PossiblyFalsy flag includes literal values, so exclude ones that + // are definitely truthy + .filter(t => !isTruthyLiteral(t)) + .some(type => (0, util_1.isTypeFlagSet)(type, ts.TypeFlags.PossiblyFalsy)); +const isPossiblyTruthy = (type) => tsutils + .unionTypeParts(type) + .map(type => tsutils.intersectionTypeParts(type)) + .some(intersectionParts => +// It is possible to define intersections that are always falsy, +// like `"" & { __brand: string }`. +intersectionParts.every(type => !tsutils.isFalsyType(type))); +// Nullish utilities +const nullishFlag = ts.TypeFlags.Undefined | ts.TypeFlags.Null; +const isNullishType = (type) => (0, util_1.isTypeFlagSet)(type, nullishFlag); +const isPossiblyNullish = (type) => tsutils.unionTypeParts(type).some(isNullishType); +const isAlwaysNullish = (type) => tsutils.unionTypeParts(type).every(isNullishType); +// isLiteralType only covers numbers and strings, this is a more exhaustive check. +const isLiteral = (type) => tsutils.isBooleanLiteralType(type) || + type.flags === ts.TypeFlags.Undefined || + type.flags === ts.TypeFlags.Null || + type.flags === ts.TypeFlags.Void || + type.isLiteral(); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-condition', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow conditionals where the type is always truthy or always falsy', + recommended: 'strict', + requiresTypeChecking: true, + }, + schema: [ + { + type: 'object', + properties: { + allowConstantLoopConditions: { + description: 'Whether to ignore constant loop conditions, such as `while (true)`.', + type: 'boolean', + }, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + description: 'Whether to not error when running with a tsconfig that has strictNullChecks turned.', + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + fixable: 'code', + messages: { + alwaysTruthy: 'Unnecessary conditional, value is always truthy.', + alwaysFalsy: 'Unnecessary conditional, value is always falsy.', + alwaysTruthyFunc: 'This callback should return a conditional, but return is always truthy.', + alwaysFalsyFunc: 'This callback should return a conditional, but return is always falsy.', + neverNullish: 'Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined.', + alwaysNullish: 'Unnecessary conditional, left-hand side of `??` operator is always `null` or `undefined`.', + literalBooleanExpression: 'Unnecessary conditional, both sides of the expression are literal values.', + noOverlapBooleanExpression: 'Unnecessary conditional, the types have no overlap.', + never: 'Unnecessary conditional, value is `never`.', + neverOptionalChain: 'Unnecessary optional chain on a non-nullish value.', + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + }, + }, + defaultOptions: [ + { + allowConstantLoopConditions: false, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + }, + ], + create(context, [{ allowConstantLoopConditions, allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, },]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { line: 0, column: 0 }, + end: { line: 0, column: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + function nodeIsArrayType(node) { + const nodeType = (0, util_1.getConstrainedTypeAtLocation)(services, node); + return checker.isArrayType(nodeType); + } + function nodeIsTupleType(node) { + const nodeType = (0, util_1.getConstrainedTypeAtLocation)(services, node); + return checker.isTupleType(nodeType); + } + function isArrayIndexExpression(node) { + return ( + // Is an index signature + node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.computed && + // ...into an array type + (nodeIsArrayType(node.object) || + // ... or a tuple type + (nodeIsTupleType(node.object) && + // Exception: literal index into a tuple - will have a sound type + node.property.type !== utils_1.AST_NODE_TYPES.Literal))); + } + function isNullableMemberExpression(node) { + const objectType = services.getTypeAtLocation(node.object); + if (node.computed) { + const propertyType = services.getTypeAtLocation(node.property); + return isNullablePropertyType(objectType, propertyType); + } + const property = node.property; + if (property.type === utils_1.AST_NODE_TYPES.Identifier) { + const propertyType = objectType.getProperty(property.name); + if (propertyType && + tsutils.isSymbolFlagSet(propertyType, ts.SymbolFlags.Optional)) { + return true; + } + } + return false; + } + /** + * Checks if a conditional node is necessary: + * if the type of the node is always true or always false, it's not necessary. + */ + function checkNode(node, isUnaryNotArgument = false) { + // Check if the node is Unary Negation expression and handle it + if (node.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.operator === '!') { + return checkNode(node.argument, true); + } + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (isArrayIndexExpression(node)) { + return; + } + // When checking logical expressions, only check the right side + // as the left side has been checked by checkLogicalExpressionForUnnecessaryConditionals + // + // Unless the node is nullish coalescing, as it's common to use patterns like `nullBool ?? true` to to strict + // boolean checks if we inspect the right here, it'll usually be a constant condition on purpose. + // In this case it's better to inspect the type of the expression as a whole. + if (node.type === utils_1.AST_NODE_TYPES.LogicalExpression && + node.operator !== '??') { + return checkNode(node.right); + } + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + // Conditional is always necessary if it involves: + // `any` or `unknown` or a naked type variable + if (tsutils + .unionTypeParts(type) + .some(part => (0, util_1.isTypeAnyType)(part) || + (0, util_1.isTypeUnknownType)(part) || + (0, util_1.isTypeFlagSet)(part, ts.TypeFlags.TypeVariable))) { + return; + } + let messageId = null; + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Never)) { + messageId = 'never'; + } + else if (!isPossiblyTruthy(type)) { + messageId = !isUnaryNotArgument ? 'alwaysFalsy' : 'alwaysTruthy'; + } + else if (!isPossiblyFalsy(type)) { + messageId = !isUnaryNotArgument ? 'alwaysTruthy' : 'alwaysFalsy'; + } + if (messageId) { + context.report({ node, messageId }); + } + } + function checkNodeForNullish(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + // Conditional is always necessary if it involves `any`, `unknown` or a naked type parameter + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.TypeParameter | + ts.TypeFlags.TypeVariable)) { + return; + } + let messageId = null; + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Never)) { + messageId = 'never'; + } + else if (!isPossiblyNullish(type) && + !(node.type === utils_1.AST_NODE_TYPES.MemberExpression && + isNullableMemberExpression(node))) { + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (!isArrayIndexExpression(node) && + !(node.type === utils_1.AST_NODE_TYPES.ChainExpression && + node.expression.type !== utils_1.AST_NODE_TYPES.TSNonNullExpression && + optionChainContainsOptionArrayIndex(node.expression))) { + messageId = 'neverNullish'; + } + } + else if (isAlwaysNullish(type)) { + messageId = 'alwaysNullish'; + } + if (messageId) { + context.report({ node, messageId }); + } + } + /** + * Checks that a binary expression is necessarily conditional, reports otherwise. + * If both sides of the binary expression are literal values, it's not a necessary condition. + * + * NOTE: It's also unnecessary if the types that don't overlap at all + * but that case is handled by the Typescript compiler itself. + * Known exceptions: + * - https://github.com/microsoft/TypeScript/issues/32627 + * - https://github.com/microsoft/TypeScript/issues/37160 (handled) + */ + const BOOL_OPERATORS = new Set([ + '<', + '>', + '<=', + '>=', + '==', + '===', + '!=', + '!==', + ]); + function checkIfBinaryExpressionIsNecessaryConditional(node) { + if (!BOOL_OPERATORS.has(node.operator)) { + return; + } + const leftType = (0, util_1.getConstrainedTypeAtLocation)(services, node.left); + const rightType = (0, util_1.getConstrainedTypeAtLocation)(services, node.right); + if (isLiteral(leftType) && isLiteral(rightType)) { + context.report({ node, messageId: 'literalBooleanExpression' }); + return; + } + // Workaround for https://github.com/microsoft/TypeScript/issues/37160 + if (isStrictNullChecks) { + const UNDEFINED = ts.TypeFlags.Undefined; + const NULL = ts.TypeFlags.Null; + const VOID = ts.TypeFlags.Void; + const isComparable = (type, flag) => { + // Allow comparison to `any`, `unknown` or a naked type parameter. + flag |= + ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.TypeParameter | + ts.TypeFlags.TypeVariable; + // Allow loose comparison to nullish values. + if (node.operator === '==' || node.operator === '!=') { + flag |= NULL | UNDEFINED | VOID; + } + return (0, util_1.isTypeFlagSet)(type, flag); + }; + if ((leftType.flags === UNDEFINED && + !isComparable(rightType, UNDEFINED | VOID)) || + (rightType.flags === UNDEFINED && + !isComparable(leftType, UNDEFINED | VOID)) || + (leftType.flags === NULL && !isComparable(rightType, NULL)) || + (rightType.flags === NULL && !isComparable(leftType, NULL))) { + context.report({ node, messageId: 'noOverlapBooleanExpression' }); + return; + } + } + } + /** + * Checks that a logical expression contains a boolean, reports otherwise. + */ + function checkLogicalExpressionForUnnecessaryConditionals(node) { + if (node.operator === '??') { + checkNodeForNullish(node.left); + return; + } + // Only checks the left side, since the right side might not be "conditional" at all. + // The right side will be checked if the LogicalExpression is used in a conditional context + checkNode(node.left); + } + /** + * Checks that a testable expression of a loop is necessarily conditional, reports otherwise. + */ + function checkIfLoopIsNecessaryConditional(node) { + if (node.test == null) { + // e.g. `for(;;)` + return; + } + /** + * Allow: + * while (true) {} + * for (;true;) {} + * do {} while (true) + */ + if (allowConstantLoopConditions && + tsutils.isTrueLiteralType((0, util_1.getConstrainedTypeAtLocation)(services, node.test))) { + return; + } + checkNode(node.test); + } + const ARRAY_PREDICATE_FUNCTIONS = new Set([ + 'filter', + 'find', + 'some', + 'every', + ]); + function isArrayPredicateFunction(node) { + const { callee } = node; + return ( + // looks like `something.filter` or `something.find` + callee.type === utils_1.AST_NODE_TYPES.MemberExpression && + callee.property.type === utils_1.AST_NODE_TYPES.Identifier && + ARRAY_PREDICATE_FUNCTIONS.has(callee.property.name) && + // and the left-hand side is an array, according to the types + (nodeIsArrayType(callee.object) || nodeIsTupleType(callee.object))); + } + function checkCallExpression(node) { + // If this is something like arr.filter(x => /*condition*/), check `condition` + if (isArrayPredicateFunction(node) && node.arguments.length) { + const callback = node.arguments[0]; + // Inline defined functions + if (callback.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + callback.type === utils_1.AST_NODE_TYPES.FunctionExpression) { + // Two special cases, where we can directly check the node that's returned: + // () => something + if (callback.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + return checkNode(callback.body); + } + // () => { return something; } + const callbackBody = callback.body.body; + if (callbackBody.length === 1 && + callbackBody[0].type === utils_1.AST_NODE_TYPES.ReturnStatement && + callbackBody[0].argument) { + return checkNode(callbackBody[0].argument); + } + // Potential enhancement: could use code-path analysis to check + // any function with a single return statement + // (Value to complexity ratio is dubious however) + } + // Otherwise just do type analysis on the function as a whole. + const returnTypes = tsutils + .getCallSignaturesOfType((0, util_1.getConstrainedTypeAtLocation)(services, callback)) + .map(sig => sig.getReturnType()); + /* istanbul ignore if */ if (returnTypes.length === 0) { + // Not a callable function + return; + } + // Predicate is always necessary if it involves `any` or `unknown` + if (returnTypes.some(t => (0, util_1.isTypeAnyType)(t) || (0, util_1.isTypeUnknownType)(t))) { + return; + } + if (!returnTypes.some(isPossiblyFalsy)) { + return context.report({ + node: callback, + messageId: 'alwaysTruthyFunc', + }); + } + if (!returnTypes.some(isPossiblyTruthy)) { + return context.report({ + node: callback, + messageId: 'alwaysFalsyFunc', + }); + } + } + } + // Recursively searches an optional chain for an array index expression + // Has to search the entire chain, because an array index will "infect" the rest of the types + // Example: + // ``` + // [{x: {y: "z"} }][n] // type is {x: {y: "z"}} + // ?.x // type is {y: "z"} + // ?.y // This access is considered "unnecessary" according to the types + // ``` + function optionChainContainsOptionArrayIndex(node) { + const lhsNode = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node.object; + if (node.optional && isArrayIndexExpression(lhsNode)) { + return true; + } + if (lhsNode.type === utils_1.AST_NODE_TYPES.MemberExpression || + lhsNode.type === utils_1.AST_NODE_TYPES.CallExpression) { + return optionChainContainsOptionArrayIndex(lhsNode); + } + return false; + } + function isNullablePropertyType(objType, propertyType) { + if (propertyType.isUnion()) { + return propertyType.types.some(type => isNullablePropertyType(objType, type)); + } + if (propertyType.isNumberLiteral() || propertyType.isStringLiteral()) { + const propType = (0, util_1.getTypeOfPropertyOfName)(checker, objType, propertyType.value.toString()); + if (propType) { + return (0, util_1.isNullableType)(propType); + } + } + const typeName = (0, util_1.getTypeName)(checker, propertyType); + return !!checker + .getIndexInfosOfType(objType) + .find(info => (0, util_1.getTypeName)(checker, info.keyType) === typeName); + } + // Checks whether a member expression is nullable or not regardless of it's previous node. + // Example: + // ``` + // // 'bar' is nullable if 'foo' is null. + // // but this function checks regardless of 'foo' type, so returns 'true'. + // declare const foo: { bar : { baz: string } } | null + // foo?.bar; + // ``` + function isMemberExpressionNullableOriginFromObject(node) { + const prevType = (0, util_1.getConstrainedTypeAtLocation)(services, node.object); + const property = node.property; + if (prevType.isUnion() && (0, util_1.isIdentifier)(property)) { + const isOwnNullable = prevType.types.some(type => { + if (node.computed) { + const propertyType = (0, util_1.getConstrainedTypeAtLocation)(services, node.property); + return isNullablePropertyType(type, propertyType); + } + const propType = (0, util_1.getTypeOfPropertyOfName)(checker, type, property.name); + if (propType) { + return (0, util_1.isNullableType)(propType); + } + return !!checker.getIndexInfoOfType(type, ts.IndexKind.String); + }); + return !isOwnNullable && (0, util_1.isNullableType)(prevType); + } + return false; + } + function isCallExpressionNullableOriginFromCallee(node) { + const prevType = (0, util_1.getConstrainedTypeAtLocation)(services, node.callee); + if (prevType.isUnion()) { + const isOwnNullable = prevType.types.some(type => { + const signatures = type.getCallSignatures(); + return signatures.some(sig => (0, util_1.isNullableType)(sig.getReturnType(), { allowUndefined: true })); + }); + return (!isOwnNullable && (0, util_1.isNullableType)(prevType, { allowUndefined: true })); + } + return false; + } + function isOptionableExpression(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + const isOwnNullable = node.type === utils_1.AST_NODE_TYPES.MemberExpression + ? !isMemberExpressionNullableOriginFromObject(node) + : node.type === utils_1.AST_NODE_TYPES.CallExpression + ? !isCallExpressionNullableOriginFromCallee(node) + : true; + const possiblyVoid = (0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Void); + return ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown) || + (isOwnNullable && ((0, util_1.isNullableType)(type) || possiblyVoid))); + } + function checkOptionalChain(node, beforeOperator, fix) { + // We only care if this step in the chain is optional. If just descend + // from an optional chain, then that's fine. + if (!node.optional) { + return; + } + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (optionChainContainsOptionArrayIndex(node)) { + return; + } + const nodeToCheck = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node.object; + if (isOptionableExpression(nodeToCheck)) { + return; + } + const questionDotOperator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(beforeOperator, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && token.value === '?.'), util_1.NullThrowsReasons.MissingToken('operator', node.type)); + context.report({ + node, + loc: questionDotOperator.loc, + messageId: 'neverOptionalChain', + fix(fixer) { + return fixer.replaceText(questionDotOperator, fix); + }, + }); + } + function checkOptionalMemberExpression(node) { + checkOptionalChain(node, node.object, node.computed ? '' : '.'); + } + function checkOptionalCallExpression(node) { + checkOptionalChain(node, node.callee, ''); + } + function checkAssignmentExpression(node) { + // Similar to checkLogicalExpressionForUnnecessaryConditionals, since + // a ||= b is equivalent to a || (a = b) + if (['||=', '&&='].includes(node.operator)) { + checkNode(node.left); + } + else if (node.operator === '??=') { + checkNodeForNullish(node.left); + } + } + return { + AssignmentExpression: checkAssignmentExpression, + BinaryExpression: checkIfBinaryExpressionIsNecessaryConditional, + CallExpression: checkCallExpression, + ConditionalExpression: (node) => checkNode(node.test), + DoWhileStatement: checkIfLoopIsNecessaryConditional, + ForStatement: checkIfLoopIsNecessaryConditional, + IfStatement: (node) => checkNode(node.test), + LogicalExpression: checkLogicalExpressionForUnnecessaryConditionals, + WhileStatement: checkIfLoopIsNecessaryConditional, + 'MemberExpression[optional = true]': checkOptionalMemberExpression, + 'CallExpression[optional = true]': checkOptionalCallExpression, + }; + }, +}); +//# sourceMappingURL=no-unnecessary-condition.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0b/6aa006c54b42f585de2b20834d5f4f5572ecb3f1b9dc733a98ed3d442129789ab59b0f89a231f72d791f0c61e13382a3803f6d17c6d8fe6376d2c54b50f325 b/.pnpm-store/v3/files/0b/6aa006c54b42f585de2b20834d5f4f5572ecb3f1b9dc733a98ed3d442129789ab59b0f89a231f72d791f0c61e13382a3803f6d17c6d8fe6376d2c54b50f325 new file mode 100644 index 00000000..922e9cb5 --- /dev/null +++ b/.pnpm-store/v3/files/0b/6aa006c54b42f585de2b20834d5f4f5572ecb3f1b9dc733a98ed3d442129789ab59b0f89a231f72d791f0c61e13382a3803f6d17c6d8fe6376d2c54b50f325 @@ -0,0 +1,243 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const typescript_1 = require("typescript"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'consistent-type-exports', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce consistent usage of type exports', + requiresTypeChecking: true, + }, + messages: { + typeOverValue: 'All exports in the declaration are only used as types. Use `export type`.', + singleExportIsType: 'Type export {{exportNames}} is not a value and should be exported using `export type`.', + multipleExportsAreTypes: 'Type exports {{exportNames}} are not values and should be exported using `export type`.', + }, + schema: [ + { + type: 'object', + properties: { + fixMixedExportsWithInlineTypeSpecifier: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + fixable: 'code', + }, + defaultOptions: [ + { + fixMixedExportsWithInlineTypeSpecifier: false, + }, + ], + create(context, [{ fixMixedExportsWithInlineTypeSpecifier }]) { + const sourceExportsMap = {}; + const services = (0, util_1.getParserServices)(context); + /** + * Helper for identifying if an export specifier resolves to a + * JavaScript value or a TypeScript type. + * + * @returns True/false if is a type or not, or undefined if the specifier + * can't be resolved. + */ + function isSpecifierTypeBased(specifier) { + const checker = services.program.getTypeChecker(); + const symbol = services.getSymbolAtLocation(specifier.exported); + if (!symbol) { + return undefined; + } + const aliasedSymbol = checker.getAliasedSymbol(symbol); + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison + if (aliasedSymbol.escapedName === 'unknown') { + return undefined; + } + return !(aliasedSymbol.flags & typescript_1.SymbolFlags.Value); + } + return { + ExportNamedDeclaration(node) { + // Coerce the source into a string for use as a lookup entry. + const source = getSourceFromExport(node) ?? 'undefined'; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + const sourceExports = (sourceExportsMap[source] ||= { + source, + reportValueExports: [], + typeOnlyNamedExport: null, + valueOnlyNamedExport: null, + }); + // Cache the first encountered exports for the package. We will need to come + // back to these later when fixing the problems. + if (node.exportKind === 'type') { + if (sourceExports.typeOnlyNamedExport == null) { + // The export is a type export + sourceExports.typeOnlyNamedExport = node; + } + } + else if (sourceExports.valueOnlyNamedExport == null) { + // The export is a value export + sourceExports.valueOnlyNamedExport = node; + } + // Next for the current export, we will separate type/value specifiers. + const typeBasedSpecifiers = []; + const inlineTypeSpecifiers = []; + const valueSpecifiers = []; + // Note: it is valid to export values as types. We will avoid reporting errors + // when this is encountered. + if (node.exportKind !== 'type') { + for (const specifier of node.specifiers) { + if (specifier.exportKind === 'type') { + inlineTypeSpecifiers.push(specifier); + continue; + } + const isTypeBased = isSpecifierTypeBased(specifier); + if (isTypeBased === true) { + typeBasedSpecifiers.push(specifier); + } + else if (isTypeBased === false) { + // When isTypeBased is undefined, we should avoid reporting them. + valueSpecifiers.push(specifier); + } + } + } + if ((node.exportKind === 'value' && typeBasedSpecifiers.length) || + (node.exportKind === 'type' && valueSpecifiers.length)) { + sourceExports.reportValueExports.push({ + node, + typeBasedSpecifiers, + valueSpecifiers, + inlineTypeSpecifiers, + }); + } + }, + 'Program:exit'() { + for (const sourceExports of Object.values(sourceExportsMap)) { + // If this export has no issues, move on. + if (sourceExports.reportValueExports.length === 0) { + continue; + } + for (const report of sourceExports.reportValueExports) { + if (report.valueSpecifiers.length === 0) { + // Export is all type-only with no type specifiers; convert the entire export to `export type`. + context.report({ + node: report.node, + messageId: 'typeOverValue', + *fix(fixer) { + yield* fixExportInsertType(fixer, context.sourceCode, report.node); + }, + }); + continue; + } + // We have both type and value violations. + const allExportNames = report.typeBasedSpecifiers.map(specifier => specifier.local.name); + if (allExportNames.length === 1) { + const exportNames = allExportNames[0]; + context.report({ + node: report.node, + messageId: 'singleExportIsType', + data: { exportNames }, + *fix(fixer) { + if (fixMixedExportsWithInlineTypeSpecifier) { + yield* fixAddTypeSpecifierToNamedExports(fixer, report); + } + else { + yield* fixSeparateNamedExports(fixer, context.sourceCode, report); + } + }, + }); + } + else { + const exportNames = (0, util_1.formatWordList)(allExportNames); + context.report({ + node: report.node, + messageId: 'multipleExportsAreTypes', + data: { exportNames }, + *fix(fixer) { + if (fixMixedExportsWithInlineTypeSpecifier) { + yield* fixAddTypeSpecifierToNamedExports(fixer, report); + } + else { + yield* fixSeparateNamedExports(fixer, context.sourceCode, report); + } + }, + }); + } + } + } + }, + }; + }, +}); +/** + * Inserts "type" into an export. + * + * Example: + * + * export type { Foo } from 'foo'; + * ^^^^ + */ +function* fixExportInsertType(fixer, sourceCode, node) { + const exportToken = (0, util_1.nullThrows)(sourceCode.getFirstToken(node), util_1.NullThrowsReasons.MissingToken('export', node.type)); + yield fixer.insertTextAfter(exportToken, ' type'); + for (const specifier of node.specifiers) { + if (specifier.exportKind === 'type') { + const kindToken = (0, util_1.nullThrows)(sourceCode.getFirstToken(specifier), util_1.NullThrowsReasons.MissingToken('export', specifier.type)); + const firstTokenAfter = (0, util_1.nullThrows)(sourceCode.getTokenAfter(kindToken, { + includeComments: true, + }), 'Missing token following the export kind.'); + yield fixer.removeRange([kindToken.range[0], firstTokenAfter.range[0]]); + } + } +} +/** + * Separates the exports which mismatch the kind of export the given + * node represents. For example, a type export's named specifiers which + * represent values will be inserted in a separate `export` statement. + */ +function* fixSeparateNamedExports(fixer, sourceCode, report) { + const { node, typeBasedSpecifiers, inlineTypeSpecifiers, valueSpecifiers } = report; + const typeSpecifiers = typeBasedSpecifiers.concat(inlineTypeSpecifiers); + const source = getSourceFromExport(node); + const specifierNames = typeSpecifiers.map(getSpecifierText).join(', '); + const exportToken = (0, util_1.nullThrows)(sourceCode.getFirstToken(node), util_1.NullThrowsReasons.MissingToken('export', node.type)); + // Filter the bad exports from the current line. + const filteredSpecifierNames = valueSpecifiers + .map(getSpecifierText) + .join(', '); + const openToken = (0, util_1.nullThrows)(sourceCode.getFirstToken(node, util_1.isOpeningBraceToken), util_1.NullThrowsReasons.MissingToken('{', node.type)); + const closeToken = (0, util_1.nullThrows)(sourceCode.getLastToken(node, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', node.type)); + // Remove exports from the current line which we're going to re-insert. + yield fixer.replaceTextRange([openToken.range[1], closeToken.range[0]], ` ${filteredSpecifierNames} `); + // Insert the bad exports into a new export line above. + yield fixer.insertTextBefore(exportToken, `export type { ${specifierNames} }${source ? ` from '${source}'` : ''};\n`); +} +function* fixAddTypeSpecifierToNamedExports(fixer, report) { + if (report.node.exportKind === 'type') { + return; + } + for (const specifier of report.typeBasedSpecifiers) { + yield fixer.insertTextBefore(specifier, 'type '); + } +} +/** + * Returns the source of the export, or undefined if the named export has no source. + */ +function getSourceFromExport(node) { + if (node.source?.type === utils_1.AST_NODE_TYPES.Literal && + typeof node.source.value === 'string') { + return node.source.value; + } + return undefined; +} +/** + * Returns the specifier text for the export. If it is aliased, we take care to return + * the proper formatting. + */ +function getSpecifierText(specifier) { + return `${specifier.local.name}${specifier.exported.name !== specifier.local.name + ? ` as ${specifier.exported.name}` + : ''}`; +} +//# sourceMappingURL=consistent-type-exports.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0b/77ddf64ef1b0ede103c05963efb663d17429dca64b896c5b65f583f08dedc9541dba0c846455a511a7057e5d033b2c22624996c1af892e6bd723dc248e58e3 b/.pnpm-store/v3/files/0b/77ddf64ef1b0ede103c05963efb663d17429dca64b896c5b65f583f08dedc9541dba0c846455a511a7057e5d033b2c22624996c1af892e6bd723dc248e58e3 new file mode 100644 index 00000000..4a283a4b --- /dev/null +++ b/.pnpm-store/v3/files/0b/77ddf64ef1b0ede103c05963efb663d17429dca64b896c5b65f583f08dedc9541dba0c846455a511a7057e5d033b2c22624996c1af892e6bd723dc248e58e3 @@ -0,0 +1,19 @@ +'use strict'; + +var $EvalError = require('es-errors/eval'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://262.ecma-international.org/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/.pnpm-store/v3/files/0c/417a1dd52ad11a452319bf7fd302f2cd2d8f2fceb8ffbc241ad625755b2944059ec623ea1a3e1aa1ed5248104ab62929c0f8a869ddeb72d7e90a23dddf63c0 b/.pnpm-store/v3/files/0c/417a1dd52ad11a452319bf7fd302f2cd2d8f2fceb8ffbc241ad625755b2944059ec623ea1a3e1aa1ed5248104ab62929c0f8a869ddeb72d7e90a23dddf63c0 new file mode 100644 index 00000000..ef2e10f4 --- /dev/null +++ b/.pnpm-store/v3/files/0c/417a1dd52ad11a452319bf7fd302f2cd2d8f2fceb8ffbc241ad625755b2944059ec623ea1a3e1aa1ed5248104ab62929c0f8a869ddeb72d7e90a23dddf63c0 @@ -0,0 +1,27 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://262.ecma-international.org/13.0/#sec-createnonenumerabledatapropertyorthrow + +module.exports = function CreateNonEnumerableDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefinePropertyOrThrow(O, P, newDesc); +}; diff --git a/.pnpm-store/v3/files/0c/4d14c281ac28afbb94c84f5bfe9695e68b7c7b10ad904cc15af1e680072415edf2d82fafdc73d20131593d6191b84e6f49bde2eca9a03ed17dc559f3d26375 b/.pnpm-store/v3/files/0c/4d14c281ac28afbb94c84f5bfe9695e68b7c7b10ad904cc15af1e680072415edf2d82fafdc73d20131593d6191b84e6f49bde2eca9a03ed17dc559f3d26375 new file mode 100644 index 00000000..0d08a699 --- /dev/null +++ b/.pnpm-store/v3/files/0c/4d14c281ac28afbb94c84f5bfe9695e68b7c7b10ad904cc15af1e680072415edf2d82fafdc73d20131593d6191b84e6f49bde2eca9a03ed17dc559f3d26375 @@ -0,0 +1,2 @@ +import '@unocss/core'; +export { a as combineLoaders, b as createCDNFetchLoader, c as createPresetIcons, g as getEnvFlags, i as icons } from './shared/preset-icons.0wSl5XJL.mjs'; diff --git a/.pnpm-store/v3/files/0c/5f3d6e22b1dcf72e9da40eec850dec5a1d72a68bd77bbf4aeeb42f31388f3a4c7dbb8367ed7e1fe1d0d5dd66d6cb69ab3fb40fdc0c127ff557793497cd27b8 b/.pnpm-store/v3/files/0c/5f3d6e22b1dcf72e9da40eec850dec5a1d72a68bd77bbf4aeeb42f31388f3a4c7dbb8367ed7e1fe1d0d5dd66d6cb69ab3fb40fdc0c127ff557793497cd27b8 new file mode 100644 index 00000000..e911e026 --- /dev/null +++ b/.pnpm-store/v3/files/0c/5f3d6e22b1dcf72e9da40eec850dec5a1d72a68bd77bbf4aeeb42f31388f3a4c7dbb8367ed7e1fe1d0d5dd66d6cb69ab3fb40fdc0c127ff557793497cd27b8 @@ -0,0 +1,4 @@ +import type * as vscode from '@volar/language-service'; +import type { SharedContext } from '../types'; +export declare function register(ctx: SharedContext): (uri: string, position: vscode.Position, referenceContext: vscode.ReferenceContext) => vscode.Location[]; +//# sourceMappingURL=references.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0c/61dfa2c9e4c396852c76634360911e11d24e48e87bfda0126bc094a70e200cea6356e8030399b75ef486c116b984da4a288c690ca2ecb7d4dda877a2e9ef43 b/.pnpm-store/v3/files/0c/61dfa2c9e4c396852c76634360911e11d24e48e87bfda0126bc094a70e200cea6356e8030399b75ef486c116b984da4a288c690ca2ecb7d4dda877a2e9ef43 new file mode 100644 index 00000000..eb186ec6 --- /dev/null +++ b/.pnpm-store/v3/files/0c/61dfa2c9e4c396852c76634360911e11d24e48e87bfda0126bc094a70e200cea6356e8030399b75ef486c116b984da4a288c690ca2ecb7d4dda877a2e9ef43 @@ -0,0 +1,42 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/inspect-js/has-tostringtag/compare/v1.0.1...v1.0.2) - 2024-02-01 + +### Fixed + +- [Fix] move `has-symbols` back to prod deps [`#3`](https://github.com/inspect-js/has-tostringtag/issues/3) + +## [v1.0.1](https://github.com/inspect-js/has-tostringtag/compare/v1.0.0...v1.0.1) - 2024-02-01 + +### Commits + +- [patch] add types [`9276414`](https://github.com/inspect-js/has-tostringtag/commit/9276414b22fab3eeb234688841722c4be113201f) +- [meta] use `npmignore` to autogenerate an npmignore file [`5c0dcd1`](https://github.com/inspect-js/has-tostringtag/commit/5c0dcd1ff66419562a30d1fd88b966cc36bce5fc) +- [actions] reuse common workflows [`dee9509`](https://github.com/inspect-js/has-tostringtag/commit/dee950904ab5719b62cf8d73d2ac950b09093266) +- [actions] update codecov uploader [`b8cb3a0`](https://github.com/inspect-js/has-tostringtag/commit/b8cb3a0b8ffbb1593012c4c2daa45fb25642825d) +- [Tests] generate coverage [`be5b288`](https://github.com/inspect-js/has-tostringtag/commit/be5b28889e2735cdbcef387f84c2829995f2f05e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`69a0827`](https://github.com/inspect-js/has-tostringtag/commit/69a0827974e9b877b2c75b70b057555da8f25a65) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`4c9e210`](https://github.com/inspect-js/has-tostringtag/commit/4c9e210a5682f0557a3235d36b68ce809d7fb825) +- [actions] update rebase action to use reusable workflow [`ca8dcd3`](https://github.com/inspect-js/has-tostringtag/commit/ca8dcd3a6f3f5805d7e3fd461b654aedba0946e7) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`07f3eaf`](https://github.com/inspect-js/has-tostringtag/commit/07f3eafa45dd98208c94479737da77f9a69b94c4) +- [Deps] update `has-symbols` [`999e009`](https://github.com/inspect-js/has-tostringtag/commit/999e0095a7d1749a58f55472ec8bf8108cdfdcf3) +- [Tests] remove staging tests since they fail on modern node [`9d9526b`](https://github.com/inspect-js/has-tostringtag/commit/9d9526b1dc1ca7f2292b52efda4c3d857b0e39bd) + +## v1.0.0 - 2021-08-05 + +### Commits + +- Tests [`6b6f573`](https://github.com/inspect-js/has-tostringtag/commit/6b6f5734dc2058badb300ff0783efdad95fe1a65) +- Initial commit [`2f8190e`](https://github.com/inspect-js/has-tostringtag/commit/2f8190e799fac32ba9b95a076c0255e01d7ce475) +- [meta] do not publish github action workflow files [`6e08cc4`](https://github.com/inspect-js/has-tostringtag/commit/6e08cc4e0fea7ec71ef66e70734b2af2c4a8b71b) +- readme [`94bed6c`](https://github.com/inspect-js/has-tostringtag/commit/94bed6c9560cbbfda034f8d6c260bb7b0db33c1a) +- npm init [`be67840`](https://github.com/inspect-js/has-tostringtag/commit/be67840ab92ee7adb98bcc65261975543f815fa5) +- Implementation [`c4914ec`](https://github.com/inspect-js/has-tostringtag/commit/c4914ecc51ddee692c85b471ae0a5d8123030fbf) +- [meta] use `auto-changelog` [`4aaf768`](https://github.com/inspect-js/has-tostringtag/commit/4aaf76895ae01d7b739f2b19f967ef2372506cd7) +- Only apps should have lockfiles [`bc4d99e`](https://github.com/inspect-js/has-tostringtag/commit/bc4d99e4bf494afbaa235c5f098df6e642edf724) +- [meta] add `safe-publish-latest` [`6523c05`](https://github.com/inspect-js/has-tostringtag/commit/6523c05c9b87140f3ae74c9daf91633dd9ff4e1f) diff --git a/.pnpm-store/v3/files/0c/bdccf8cf93a8ff4c5ff095481babea3fdaad5d0661e4c75f4c245b2dc33d405f2fa21db4a90172ef48b1a1a1fc5011495785443fd702d9b31d9abaa500826e b/.pnpm-store/v3/files/0c/bdccf8cf93a8ff4c5ff095481babea3fdaad5d0661e4c75f4c245b2dc33d405f2fa21db4a90172ef48b1a1a1fc5011495785443fd702d9b31d9abaa500826e new file mode 100644 index 00000000..e5a4e037 --- /dev/null +++ b/.pnpm-store/v3/files/0c/bdccf8cf93a8ff4c5ff095481babea3fdaad5d0661e4c75f4c245b2dc33d405f2fa21db4a90172ef48b1a1a1fc5011495785443fd702d9b31d9abaa500826e @@ -0,0 +1,74 @@ +{ + "name": "@astrojs/language-server", + "version": "2.7.4", + "author": "withastro", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/withastro/language-tools", + "directory": "packages/language-server" + }, + "type": "commonjs", + "main": "dist/index.js", + "files": [ + "bin", + "dist/**/*.js", + "dist/**/*.d.ts", + "types/**/*.d.ts" + ], + "bin": { + "astro-ls": "./bin/nodeServer.js" + }, + "dependencies": { + "@astrojs/compiler": "^2.4.0", + "@jridgewell/sourcemap-codec": "^1.4.15", + "@volar/kit": "~2.0.4", + "@volar/language-core": "~2.0.4", + "@volar/language-server": "~2.0.4", + "@volar/language-service": "~2.0.4", + "@volar/typescript": "~2.0.4", + "fast-glob": "^3.2.12", + "volar-service-css": "0.0.29", + "volar-service-emmet": "0.0.29", + "volar-service-html": "0.0.29", + "volar-service-prettier": "0.0.29", + "volar-service-typescript": "0.0.29", + "volar-service-typescript-twoslash-queries": "0.0.29", + "vscode-html-languageservice": "^5.1.2", + "vscode-uri": "^3.0.8" + }, + "devDependencies": { + "svelte": "^4.2.10", + "@astrojs/svelte": "^5.0.3", + "@astrojs/vue": "^4.0.8", + "@types/chai": "^4.3.5", + "@types/mocha": "^10.0.1", + "@types/node": "^18.17.8", + "@volar/test-utils": "~2.0.4", + "astro": "^4.3.5", + "chai": "^4.3.7", + "mocha": "^10.2.0", + "tsx": "^3.12.7", + "typescript": "^5.2.2", + "vscode-languageserver-protocol": "^3.17.5", + "vscode-languageserver-textdocument": "^1.0.11" + }, + "peerDependencies": { + "prettier": "^3.0.0", + "prettier-plugin-astro": ">=0.11.0" + }, + "peerDependenciesMeta": { + "prettier": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + } + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "test": "mocha --timeout 10000 --require tsx --require test/takedown.ts test/misc/init.test.ts test/**/*.test.ts", + "test:match": "pnpm run test -g" + } +} \ No newline at end of file diff --git a/.pnpm-store/v3/files/0c/d5f2f18c87c699ff3672cd3be14944c706d6255c295fc116f15040d1818f5853212716abda5a652f2f519b4ddf0e7c2ad114e7863fb913537482733eddf1dc b/.pnpm-store/v3/files/0c/d5f2f18c87c699ff3672cd3be14944c706d6255c295fc116f15040d1818f5853212716abda5a652f2f519b4ddf0e7c2ad114e7863fb913537482733eddf1dc new file mode 100644 index 00000000..95f2e533 --- /dev/null +++ b/.pnpm-store/v3/files/0c/d5f2f18c87c699ff3672cd3be14944c706d6255c295fc116f15040d1818f5853212716abda5a652f2f519b4ddf0e7c2ad114e7863fb913537482733eddf1dc @@ -0,0 +1,5 @@ +import type { ParseResult } from '@astrojs/compiler/types'; +import { type VirtualCode } from '@volar/language-core'; +import type ts from 'typescript'; +import type { HTMLDocument } from 'vscode-html-languageservice'; +export declare function extractScriptTags(snapshot: ts.IScriptSnapshot, htmlDocument: HTMLDocument, ast: ParseResult['ast']): VirtualCode[]; diff --git a/.pnpm-store/v3/files/0c/f043cb556b21065bade6f76718c8cf4806c441e1e74e09b2052deea1ae601ea5b06d172418e55bc9aacafa76b4dd333310830cbcc7050dd50f5f1a7529bd07 b/.pnpm-store/v3/files/0c/f043cb556b21065bade6f76718c8cf4806c441e1e74e09b2052deea1ae601ea5b06d172418e55bc9aacafa76b4dd333310830cbcc7050dd50f5f1a7529bd07 new file mode 100644 index 00000000..c8c03bd0 --- /dev/null +++ b/.pnpm-store/v3/files/0c/f043cb556b21065bade6f76718c8cf4806c441e1e74e09b2052deea1ae601ea5b06d172418e55bc9aacafa76b4dd333310830cbcc7050dd50f5f1a7529bd07 @@ -0,0 +1,230 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const regexpp_1 = require("@eslint-community/regexpp"); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-includes', + defaultOptions: [], + meta: { + type: 'suggestion', + docs: { + description: 'Enforce `includes` method over `indexOf` method', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferIncludes: "Use 'includes()' method instead.", + preferStringIncludes: 'Use `String#includes()` method with a string instead.', + }, + schema: [], + }, + create(context) { + const globalScope = context.sourceCode.getScope(context.sourceCode.ast); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function isNumber(node, value) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + return evaluated != null && evaluated.value === value; + } + function isPositiveCheck(node) { + switch (node.operator) { + case '!==': + case '!=': + case '>': + return isNumber(node.right, -1); + case '>=': + return isNumber(node.right, 0); + default: + return false; + } + } + function isNegativeCheck(node) { + switch (node.operator) { + case '===': + case '==': + case '<=': + return isNumber(node.right, -1); + case '<': + return isNumber(node.right, 0); + default: + return false; + } + } + function hasSameParameters(nodeA, nodeB) { + if (!ts.isFunctionLike(nodeA) || !ts.isFunctionLike(nodeB)) { + return false; + } + const paramsA = nodeA.parameters; + const paramsB = nodeB.parameters; + if (paramsA.length !== paramsB.length) { + return false; + } + for (let i = 0; i < paramsA.length; ++i) { + const paramA = paramsA[i]; + const paramB = paramsB[i]; + // Check name, type, and question token once. + if (paramA.getText() !== paramB.getText()) { + return false; + } + } + return true; + } + /** + * Parse a given node if it's a `RegExp` instance. + * @param node The node to parse. + */ + function parseRegExp(node) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + if (evaluated == null || !(evaluated.value instanceof RegExp)) { + return null; + } + const { pattern, flags } = (0, regexpp_1.parseRegExpLiteral)(evaluated.value); + if (pattern.alternatives.length !== 1 || + flags.ignoreCase || + flags.global) { + return null; + } + // Check if it can determine a unique string. + const chars = pattern.alternatives[0].elements; + if (!chars.every(c => c.type === 'Character')) { + return null; + } + // To string. + return String.fromCodePoint(...chars.map(c => c.value)); + } + function escapeString(str) { + const EscapeMap = { + '\0': '\\0', + "'": "\\'", + '\\': '\\\\', + '\n': '\\n', + '\r': '\\r', + '\v': '\\v', + '\t': '\\t', + '\f': '\\f', + // "\b" cause unexpected replacements + // '\b': '\\b', + }; + const replaceRegex = new RegExp(Object.values(EscapeMap).join('|'), 'g'); + return str.replace(replaceRegex, char => EscapeMap[char]); + } + function checkArrayIndexOf(node, allowFixing) { + // Check if the comparison is equivalent to `includes()`. + const callNode = node.parent; + const compareNode = (callNode.parent.type === utils_1.AST_NODE_TYPES.ChainExpression + ? callNode.parent.parent + : callNode.parent); + const negative = isNegativeCheck(compareNode); + if (!negative && !isPositiveCheck(compareNode)) { + return; + } + // Get the symbol of `indexOf` method. + const indexofMethodDeclarations = services + .getSymbolAtLocation(node.property) + ?.getDeclarations(); + if (indexofMethodDeclarations == null || + indexofMethodDeclarations.length === 0) { + return; + } + // Check if every declaration of `indexOf` method has `includes` method + // and the two methods have the same parameters. + for (const instanceofMethodDecl of indexofMethodDeclarations) { + const typeDecl = instanceofMethodDecl.parent; + const type = checker.getTypeAtLocation(typeDecl); + const includesMethodDecl = type + .getProperty('includes') + ?.getDeclarations(); + if (!includesMethodDecl?.some(includesMethodDecl => hasSameParameters(includesMethodDecl, instanceofMethodDecl))) { + return; + } + } + // Report it. + context.report({ + node: compareNode, + messageId: 'preferIncludes', + ...(allowFixing && { + *fix(fixer) { + if (negative) { + yield fixer.insertTextBefore(callNode, '!'); + } + yield fixer.replaceText(node.property, 'includes'); + yield fixer.removeRange([callNode.range[1], compareNode.range[1]]); + }, + }), + }); + } + return { + // a.indexOf(b) !== 1 + "BinaryExpression > CallExpression.left > MemberExpression.callee[property.name='indexOf'][computed=false]"(node) { + checkArrayIndexOf(node, /* allowFixing */ true); + }, + // a?.indexOf(b) !== 1 + "BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name='indexOf'][computed=false]"(node) { + checkArrayIndexOf(node, /* allowFixing */ false); + }, + // /bar/.test(foo) + 'CallExpression[arguments.length=1] > MemberExpression.callee[property.name="test"][computed=false]'(node) { + const callNode = node.parent; + const text = parseRegExp(node.object); + if (text == null) { + return; + } + //check the argument type of test methods + const argument = callNode.arguments[0]; + const type = (0, util_1.getConstrainedTypeAtLocation)(services, argument); + const includesMethodDecl = type + .getProperty('includes') + ?.getDeclarations(); + if (includesMethodDecl == null) { + return; + } + context.report({ + node: callNode, + messageId: 'preferStringIncludes', + *fix(fixer) { + const argNode = callNode.arguments[0]; + const needsParen = argNode.type !== utils_1.AST_NODE_TYPES.Literal && + argNode.type !== utils_1.AST_NODE_TYPES.TemplateLiteral && + argNode.type !== utils_1.AST_NODE_TYPES.Identifier && + argNode.type !== utils_1.AST_NODE_TYPES.MemberExpression && + argNode.type !== utils_1.AST_NODE_TYPES.CallExpression; + yield fixer.removeRange([callNode.range[0], argNode.range[0]]); + yield fixer.removeRange([argNode.range[1], callNode.range[1]]); + if (needsParen) { + yield fixer.insertTextBefore(argNode, '('); + yield fixer.insertTextAfter(argNode, ')'); + } + yield fixer.insertTextAfter(argNode, `${node.optional ? '?.' : '.'}includes('${escapeString(text)}')`); + }, + }); + }, + }; + }, +}); +//# sourceMappingURL=prefer-includes.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0e/86a7c94f48f4d97ce65532b4397c8e0ca4fa7ad40d1e4214d54caf15971977253f8593a816b206048501e1752ffe40c0fdcccb0996a0ae062c0115be5f03f9-index.json b/.pnpm-store/v3/files/0e/86a7c94f48f4d97ce65532b4397c8e0ca4fa7ad40d1e4214d54caf15971977253f8593a816b206048501e1752ffe40c0fdcccb0996a0ae062c0115be5f03f9-index.json new file mode 100644 index 00000000..fb210210 --- /dev/null +++ b/.pnpm-store/v3/files/0e/86a7c94f48f4d97ce65532b4397c8e0ca4fa7ad40d1e4214d54caf15971977253f8593a816b206048501e1752ffe40c0fdcccb0996a0ae062c0115be5f03f9-index.json @@ -0,0 +1 @@ +{"files":{"LICENSE":{"checkedAt":1707939899160,"integrity":"sha512-o7HEIFnimZVIAv9KTD/PP6FfDvz7SNoM2Tyqrp7XIlPMtKl8zX2zLmOOIbS4YIvXl2tcZX7YPsvHpuGTYVMULQ==","mode":420,"size":1076},"lib/utils/cancellation.js":{"checkedAt":1707939899160,"integrity":"sha512-NnuIdKEticCK6ICOhRohn2X8xm984o8qXDKfdgaz1ZR1fI6ueTKXR/gH6k+1rpXKdRL9q1WgqA2B2yl0pPzHtA==","mode":420,"size":291},"lib/utils/common.js":{"checkedAt":1707939899160,"integrity":"sha512-x6+G3ZALOfd/gKOD5ttP1NCr7y8ULAUK23SiX+B9q3GPuYCQCcctMObWhSbLkOyKrL43/sS5y3yyrfkc05vAXw==","mode":420,"size":1502},"lib/utils/dedupe.js":{"checkedAt":1707939899160,"integrity":"sha512-bg2jI9P5WxMc3N0O5MNXjacG0ad0x/XRNl1nYPIMSmbbnvRXmhNsw0a1NmEbpTcgyTZFBClWQFLKLP1xtiFcEw==","mode":420,"size":3712},"lib/documents.js":{"checkedAt":1707939899160,"integrity":"sha512-icg/8ZUQkZS+VYYr8CzcF6ie4J3pNWzLQLYEnbvdWpl8dIFVNTmK8WcqnAOYtmsGELJTfpok2Yyxmfa6OF+dJg==","mode":420,"size":7105},"lib/utils/featureWorkers.js":{"checkedAt":1707939899161,"integrity":"sha512-uMBc5istpHIoRPaQK7wvuMvjI/Xir9TFWMSzQNpaGOExMLd37JEKHM6558pSxYK8h0dNjuD9HNcnePeA35FQOQ==","mode":420,"size":4436},"index.js":{"checkedAt":1707939899161,"integrity":"sha512-diCzRxTvGr3fCLOtQnvdCJXhjcyGjyFoWIqNTf2oo50/fWlzg0lJ0w1ccLk2blfjuN2BODDpNJfcoqrgmgFj9g==","mode":420,"size":2227},"lib/languageService.js":{"checkedAt":1707939899161,"integrity":"sha512-e1Zmt1woJp66IRrriAlH1v34VX3hYeO/aHbBMhSGsI6SVsn3JhpAllyO+SAQaj9Ebab+doEyMK6IGpYLQKyD9g==","mode":420,"size":8531},"lib/features/provideAutoInsertionEdit.js":{"checkedAt":1707939899161,"integrity":"sha512-Cg8zV+pY3neQuMN6M5KCejqDz44FXRBneMfNYClyHIZMHBuFe/taNzFHPh5RcGInvrB+AamGteXX1yTK+I4i2g==","mode":420,"size":1684},"lib/features/provideCallHierarchyItems.js":{"checkedAt":1707939899161,"integrity":"sha512-OEERLlmX29cD00Et+vGurMM6ckOJwQ5MAYyA97OYleSXYVztXY4NdNIC4qsxKtwAGXm+iwbHgrVdvbtum+kHaA==","mode":420,"size":7160},"lib/features/provideCodeActions.js":{"checkedAt":1707939899162,"integrity":"sha512-QpCpOaapbXa8GksqS0slCkOxaTbS/dmmqY27o/v5TRT2SGUA0ckI1XqGEb0XoqipDNSzQGGlYne8MqabtXanDQ==","mode":420,"size":5230},"lib/features/provideCodeLenses.js":{"checkedAt":1707939899162,"integrity":"sha512-tu4ZNjb4XqI16buESD222sCOijS4xznSrhryx7UitWXNicNdfwfGF3QybaMub5/FdEV7WGmisijdVrq+QvYmUw==","mode":420,"size":2376},"lib/features/provideColorPresentations.js":{"checkedAt":1707939899162,"integrity":"sha512-Yob21q+R8HG/no0lFn1C8amyqFoR810keNLES8wdeQENqNVr5BXPQURK7ify0kJnyJG5uv7dOx9VX3o2L8dIfw==","mode":420,"size":2011},"lib/features/provideCompletionItems.js":{"checkedAt":1707939899162,"integrity":"sha512-z3p2YRYwWO0/2IuPz2XXHNZZHw9vQGkQIy/ePv8190xAP1VrExu/eUCqI11hp5WTu6fWOxTcnvNuH9Huwe8E5A==","mode":420,"size":8847},"lib/features/provideDefinition.js":{"checkedAt":1707939899163,"integrity":"sha512-L+ZD6+RT06cyLeQb3fNRinQConpvAiW99B3Xsi7jTerVwed3srD6PjkNsuC7SpgQ+U7G6cjzbFpR7jt0Zz/srw==","mode":420,"size":6108},"lib/features/provideDiagnostics.js":{"checkedAt":1707939899163,"integrity":"sha512-eN39lQPwFygzelQIqY5V7q9pNzHRYqw5tZgDmUucOjFkkEj/O5cNFFAjjwonliEwc/5qAWjEdG4VgaoazU43Pg==","mode":420,"size":10164},"lib/features/provideDocumentColors.js":{"checkedAt":1707939899163,"integrity":"sha512-TszKCmogXGiMo/91WgcG0Mj2xm+Ha0QAWzXNL4KzWtZone2RY5XtkgiyVC/0vCA4TWkwrMXxu1+K/SgKCTdnMQ==","mode":420,"size":1367},"lib/features/provideDocumentDropEdits.js":{"checkedAt":1707939899163,"integrity":"sha512-jH1j3uDvIV7bbppM5bew+QpmFyLj2f1rVrC30zSLEG6id36c3EbTjGpcON2B1fVpBY3/dTqL9Zf7fjOeW2/CMw==","mode":420,"size":1176},"lib/features/provideDocumentFormattingEdits.js":{"checkedAt":1707939899166,"integrity":"sha512-0WjPK/95eCQGnq6JLd/PpxtF3D+Rs8PAqo9eADC07UO71AIEDGAGQLhdrckaMLqVby8XXnmiz2iELNPUmk3kzw==","mode":420,"size":13982},"lib/features/provideDocumentHighlights.js":{"checkedAt":1707939899166,"integrity":"sha512-euvg3Rhx8hQGr0GMpAFdpRhD1FCifa58rQGVFkOOfxQsD9mJsz8JUmCvttrL8bkEG8vIzc3TeexxUYwwCO31DQ==","mode":420,"size":3156},"lib/features/provideDocumentLinks.js":{"checkedAt":1707939899166,"integrity":"sha512-UhDGOeY5AKRT8Ni/OAJ7LuEiaALztWwnunDIvjs0FOgYwm6pB2RcaP9dWCZybKTMYAqtJW25bPyNXYSJUVSdfg==","mode":420,"size":1979},"lib/features/provideDocumentSemanticTokens.js":{"checkedAt":1707939899166,"integrity":"sha512-8XEKOVRC23XhsEku6/beNPJvFCBQFhHmCTxgot/jvP/T7zn/O3wU1wVLhHFVUlkXPyiex0AaHzS+MdPKAGWLmQ==","mode":420,"size":3883},"lib/features/provideDocumentSymbols.js":{"checkedAt":1707939899166,"integrity":"sha512-T3+ZCu5ezP+SlsVWyAPZ27VEw0szj8BtGVp7bRjdNMJevyhd/QMmdP7lMnghTmMpPV/9oO6hXjBuxb/vSLUvAA==","mode":420,"size":2031},"lib/features/provideFileReferences.js":{"checkedAt":1707939899166,"integrity":"sha512-tTgO/0EsA91E2OxbYtbFo4xJrrlcXwJDrg8liWzafKRKyQJ3KwUPhGgF80y5OQgE7eX3mac5v3P+aXZUDPksjA==","mode":420,"size":1539},"lib/features/provideFileRenameEdits.js":{"checkedAt":1707939899167,"integrity":"sha512-tcvioQC17vbdMD8L9KEVEIbSZK4x4j1DOu1OhxTZeByJy3zC8FMibXuclneJ+NGELaUgXl/INgqlcIk5PDuf5g==","mode":420,"size":1249},"lib/features/provideFoldingRanges.js":{"checkedAt":1707939899167,"integrity":"sha512-61Ck3ZpkP9zwUnJd+GgDIBB62vfrQ6JwmJD9YrJTiFMyXZ91xjrJ25wSJAwK795rFm+SnrhWxCF0aJ2rqTKq4A==","mode":420,"size":1137},"lib/features/provideHover.js":{"checkedAt":1707939899167,"integrity":"sha512-4FyBEooLBLU+4N1hUT+WuOjTA1rLH3PVa1bdPY9B9KKmPf5S6Npu7WA7eIuIDdC9Z2mZ3XRhK7ur5papkHyw0A==","mode":420,"size":4021},"lib/features/provideInlayHints.js":{"checkedAt":1707939899167,"integrity":"sha512-+yrQ00uDrZNEqnacqQvQvPFW12bGMATZMIAomApnrQg6QzUOcEWLOAjdm/V5I4PwONe3ONTqH5ByfAGp93YxkQ==","mode":420,"size":3755},"lib/features/provideLinkedEditingRanges.js":{"checkedAt":1707939899167,"integrity":"sha512-nnatTAdxSvwWbVmAN9Qp6ZRRNxa2UOpINBIPkFlDxVmVeKlevd8G1a9XI44NBgRozQc0kKjHz+1HcEt132gOFg==","mode":420,"size":1383},"lib/features/provideReferences.js":{"checkedAt":1707939899168,"integrity":"sha512-Lu1muwv5OJRpI8Rf5arrWRYXGllfhu1gipkL9X2h/9rzL38tvO15KJunMhUH18heCNYLrsUqlo8AFg0bq0C/Kg==","mode":420,"size":3556},"lib/features/provideRenameEdits.js":{"checkedAt":1707939899168,"integrity":"sha512-gYDwoMj5GmpWcDbXIpXtjJWx9cBWm/mmEN7kFDBCFXWB/MrqVIZ1zu1GBME1mM/dpw0CS7abd+3NaqWro4QQkA==","mode":420,"size":6359},"lib/features/provideRenameRange.js":{"checkedAt":1707939899168,"integrity":"sha512-zwVphA2nAOer0uIJevC1+VBCAGNxWgiVe2fTsyk+vS6WcZOqTtyoSYtWVVJ+dBKs9OTLLInoae2vDa3bqphgXg==","mode":420,"size":1364},"lib/features/provideSelectionRanges.js":{"checkedAt":1707939899168,"integrity":"sha512-s6LvgW4cUv4EuJsahGa2Xou7wWnMDFt5oxbScJe24fX+bfhG3A14TSEoNmwXxten/adXU/lb2LOZxqxlxAv1Ig==","mode":420,"size":2710},"lib/features/provideSignatureHelp.js":{"checkedAt":1707939899168,"integrity":"sha512-bxtiUoRPLqquIMg3YMTyZs1LlBEjcsHqJn/B8yTukqcEDdOMKdki0XwuDIorF4bjOg1YriOurxDR0KOWlCbOQQ==","mode":420,"size":1368},"lib/features/provideWorkspaceSymbols.js":{"checkedAt":1707939899168,"integrity":"sha512-lveF7xQUmOBJj+bwZLlZmGP/6z0WsGQNwZkcUCRxSacIPH71V1G/Ao2XX3jkJrTflAb9h8dnV7/hNt7+BjaLwA==","mode":420,"size":1757},"lib/features/resolveCodeAction.js":{"checkedAt":1707939899169,"integrity":"sha512-QXdKxRbO6Zq6dGPhcfgpu+ztS+x0+0PsqrQu7j4SkJj5xh2PqoUSzwfIcYeKz5v46cRIMB6rX3QYtqktbGYI1g==","mode":420,"size":1086},"lib/features/resolveCodeLens.js":{"checkedAt":1707939899169,"integrity":"sha512-96lN4Ez+pWn7Ce6YCudLv3iHGdf3ZPqDN5ZwDsyMNHEUMjm+dqLWd4QhiMS5AlPSL4zXfmLx57djq54bSBuxaQ==","mode":420,"size":1196},"lib/features/resolveCompletionItem.js":{"checkedAt":1707939899169,"integrity":"sha512-mSRX0VSqyaarZKUWNnjtunoonR/kHOi55yH9RRJiTRPUJ2J+Os2GwNV4ZzbpkzHs1Icpfat8ycTiMpBsxKeQeA==","mode":420,"size":1568},"lib/features/resolveDocumentLink.js":{"checkedAt":1707939899169,"integrity":"sha512-80LjRmgoGvs+tXMJ0HoCB1iRGnIXQDDNqee0zm4r0LRwkvBN8caUZEAmeIWnpy/0HIO6xfBpluDNl54dZak3Ew==","mode":420,"size":904},"lib/features/resolveInlayHint.js":{"checkedAt":1707939899169,"integrity":"sha512-FuTg1S376ExrCfVcV8n+uemoQE7loDhNG+3XmpgXzNt6qTm5CUbkyqrFJBMTpvE7V0qUqS64xT0Aa8glUNTTwQ==","mode":420,"size":701},"lib/utils/SemanticTokensBuilder.js":{"checkedAt":1707939899169,"integrity":"sha512-4DOUp91nGAMl3XgbTUx/5zg9CSHqtR9SAJVzd/OUmtMqt7SAOlTURbQZmiBlQ20u6+/zWHmMXoVAuOpuTdleqA==","mode":420,"size":1240},"lib/utils/transform.js":{"checkedAt":1707939899169,"integrity":"sha512-j8ASb0WgaKCtjhvLKRUTCFL89I3HOZRXHpNdlKxht4aqxbvyQ7bmYNpR+SU9PpkDV3D7qAzpeMIyLQP9mvAJBQ==","mode":420,"size":18043},"lib/types.js":{"checkedAt":1707939899170,"integrity":"sha512-S7hwistXRy+486Dzo28O5Y8/lRCwgOVnItdWaQCGSHk6tfWAlHaWkklPmcLNkdwWKSZCSNEuHNZmhe4tawFHVg==","mode":420,"size":439},"package.json":{"checkedAt":1707939899170,"integrity":"sha512-puiqcf2bgudY4Ov0jqBPg1dHtjYTugINmeUu2EqsgiI3MnlnrWhsVbmgPqrUmvltkJRbfhAyPtZcxZZgJUvFUA==","mode":420,"size":492},"lib/utils/cancellation.d.ts":{"checkedAt":1707939899170,"integrity":"sha512-j/WKFXqrjJ8NOYOMKdLXXZ/vXuBJGYxr8YzT60Fqe6h8ZfG72/RP/MeQX1+zpWHJk0P2Z/Ja0L88GYAAzAb50g==","mode":420,"size":133},"lib/utils/common.d.ts":{"checkedAt":1707939899170,"integrity":"sha512-2fr+IH9vTqdieyVUlDJR+QHsLii3iY/dCeTAn1hVxEU9CrTuAOeFW5m72sU6Y85d2pggjotyTrEY9u8wx16ztw==","mode":420,"size":581},"lib/utils/dedupe.d.ts":{"checkedAt":1707939899170,"integrity":"sha512-Wwr7dYWJKM5WooVHwuSXJO1YdBgHIo8dVv5w1awd+9qGYi3wF9EtyJcR0hrJVbDDOLG51Jy4iGcjGF1AXD/3uA==","mode":420,"size":1139},"lib/documents.d.ts":{"checkedAt":1707939899171,"integrity":"sha512-UqNpihO7q2YKJnTLxbvIiEfJz2l2R6i2kEJKUFJT7ulIw71JoFD4Vhc2qhRBbiefyjIspCVTA8pOh8JBIGE9zw==","mode":420,"size":3850},"lib/utils/featureWorkers.d.ts":{"checkedAt":1707939899171,"integrity":"sha512-hQqdQQN5qIO+Ip0pvP273klzavNCNltubeAt1y0T6uJYcx2T818fKcWUPucKxEqqz3yOgeW3yvHEveicBZqWyw==","mode":420,"size":1740},"index.d.ts":{"checkedAt":1707939899171,"integrity":"sha512-37tlN+y/+7n3wKGIJ8BhnILk6a4WUnh0FAlj0UyuOL/OTJHMZlJ8CdOhWX78X8AMjj8slx715ttzJow5i4ouCA==","mode":420,"size":394},"lib/languageService.d.ts":{"checkedAt":1707939899171,"integrity":"sha512-EiUhwEMNj+thNDSAyP0brVGAl0EmvvWzTY75asugitWUIpBJOecjYDgso4UnjwQ+rgfVyLNa7hdZYtB9YkYOZg==","mode":420,"size":6209},"lib/features/provideAutoInsertionEdit.d.ts":{"checkedAt":1707939899171,"integrity":"sha512-3tgFmV4DgElBBm1VX382jFkX4reinfzcAQrXWh4n5yYtRLNq1YYT0+fjvTRo802WAZ7XW+0nhOkqAD3Ah510qw==","mode":420,"size":355},"lib/features/provideCallHierarchyItems.d.ts":{"checkedAt":1707939899171,"integrity":"sha512-SnYV3P0dAa3R+B/YnZKCfvowxYTkTK6UpScKtG2P/IUlDLVPJLPrMO3uXlBl/By7xXBhN/y76JChLt2PKepmYg==","mode":420,"size":763},"lib/features/provideCodeActions.d.ts":{"checkedAt":1707939899171,"integrity":"sha512-EHBLaQkbuzp/gVU0z2QwDKXZ2ODf1n19z+xYIcnZGIrDFnJ5NFtlVs5s2GnAKYD8nLQLSS3ruT74Yj5ZJsCIkg==","mode":420,"size":492},"lib/features/provideCodeLenses.d.ts":{"checkedAt":1707939899172,"integrity":"sha512-rxNrouCD7R/sfyK+XNv0InxZ1MdlZY75clC8XKdt2IVw2m/vvvDtQwJDOdnqsHsFjnVXYG9vd9dGKwZ8ex1FFw==","mode":420,"size":588},"lib/features/provideColorPresentations.d.ts":{"checkedAt":1707939899172,"integrity":"sha512-3+klOuIe47u0sXKpXJ2EmAhcTOkD0Mmn0Ldx673jfOraraPT1pYoeUrpV6YFZlB3oyeiNzym5jJtGgF4A5DWkg==","mode":420,"size":312},"lib/features/provideCompletionItems.d.ts":{"checkedAt":1707939899172,"integrity":"sha512-ybN3M0xtVFh/fGxrtVE+BVfum+EiVIDGFuVyXM+gR1LxtyTiAz0/SSZhgb1c28pqw+aAUO+09QxPBjN8MshKhA==","mode":420,"size":544},"lib/features/provideDefinition.d.ts":{"checkedAt":1707939899172,"integrity":"sha512-6kVeUh+mQqvq2fusUQBxeLCRwhLU5TutryuJXcvkVSA43yr7E0Y2aVUQ28jO4B96J6LkBVHsId6zrz5LmhUnGg==","mode":420,"size":488},"lib/features/provideDiagnostics.d.ts":{"checkedAt":1707939899172,"integrity":"sha512-gc29ObtucCCCRG0pbcKN0x8hthfjJVHZ6wH/3UMxEOZVodpTuc4Mm/oOp8GeuaVTRnv+O1N1/k317SpEGinYsw==","mode":420,"size":790},"lib/features/provideDocumentColors.d.ts":{"checkedAt":1707939899172,"integrity":"sha512-blNoA4k6IY/OlMXFq8ynOZXRoe2/AMd3oM6bcGkDlkp+/NRTFHEuL0FrVkfDxypbNk8MjXWxgOQr53ODvgbR1g==","mode":420,"size":269},"lib/features/provideDocumentDropEdits.d.ts":{"checkedAt":1707939899173,"integrity":"sha512-Jz0lmCPxud4Sg8Q20T4FNMeA+u6zRrrL2MOoqdPfQg6pWK7d0Zuhd7pzqAfuc7LuTUeieY8qKUUJ8Bq+zIEOWQ==","mode":420,"size":369},"lib/features/provideDocumentFormattingEdits.d.ts":{"checkedAt":1707939899173,"integrity":"sha512-hwNRPfvC/M1+kq/w4zsMDExJYCu+w4CZfUUcDs8ZpQye9jAhrQXJ9bDiu1sxvLfZ+J2faZm8TbtGXlwZXJT9Og==","mode":420,"size":407},"lib/features/provideDocumentHighlights.d.ts":{"checkedAt":1707939899173,"integrity":"sha512-2eG+kclDnQf9gyhelhtYUudDYEnqdJJ2bkkqMHsARcsICZUKKkxux9prtqUZe8jFH739YKMchidT0lcgMFq1Sg==","mode":420,"size":297},"lib/features/provideDocumentLinks.d.ts":{"checkedAt":1707939899173,"integrity":"sha512-iKiyQTQWMhsMCkKbh/FvVQWb0hLFFH6eTROyF1PEpElREaSQYMydPYkBxobSHh9IeamXdhVUli7ibyj/HsOWtQ==","mode":420,"size":383},"lib/features/provideDocumentSemanticTokens.d.ts":{"checkedAt":1707939899173,"integrity":"sha512-tDId8bqBG03GmTfQWbOyeI86TaALBEBUQUjSrgPSiDEYxHQT6gg5Iyun80dyHHb2Q1EzC+JSYxvuceUneup+Wg==","mode":420,"size":408},"lib/features/provideDocumentSymbols.d.ts":{"checkedAt":1707939899173,"integrity":"sha512-xyTdA5xSXEaAkWq1xdh+CCP7hu7YLLYbNI4KIR9Y4tMow2Z1JVVe7GA6yCPVfmhAr44z6KDk0gIrWdCZjOYGng==","mode":420,"size":267},"lib/features/provideFileReferences.d.ts":{"checkedAt":1707939899174,"integrity":"sha512-brfuF8M0WxcaMiJbvtIEQWvDxxQcnsMG3g9U1zTGaI6/u5beAXuYQn7SWXG8bGKfDSJzde/OnxyYrSH8Az+Exg==","mode":420,"size":272},"lib/features/provideFileRenameEdits.d.ts":{"checkedAt":1707939899174,"integrity":"sha512-5mzF+DqcKDJdqKexRFMo9HPg6LuG1J6OjJwgZIMDv7+EiPRaOmOofKlhfOmapEA4qX0HrTGR20P0nX9GE02nhg==","mode":420,"size":268},"lib/features/provideFoldingRanges.d.ts":{"checkedAt":1707939899174,"integrity":"sha512-JABLG4yLORpOF1zDNtn1MWNP305w/iOAPRlyzQOEkd66W2H3mX16Lr06wqJwGev6EbF4G50gor46FKcAnLLv/Q==","mode":420,"size":250},"lib/features/provideHover.d.ts":{"checkedAt":1707939899174,"integrity":"sha512-wxN8Yobf0j+pSnYNm4VH0jcgaWWlKpkuui+SlIseRXIrmrzib2DYl21/MunU9OGRo9HDEwK9yXQ+6qPLRjsH2Q==","mode":420,"size":283},"lib/features/provideInlayHints.d.ts":{"checkedAt":1707939899174,"integrity":"sha512-V6PG20Mbf5omq9OybJJ+PtPxB8VisrEMtucxfpS0/m8ptWEgVglgibIElBEdvg0JDrECGWV6144/PUCzEI6MrA==","mode":420,"size":417},"lib/features/provideLinkedEditingRanges.d.ts":{"checkedAt":1707939899174,"integrity":"sha512-TQG+lLW2e2kef85x09LXYFMawg/m47U4po+JWpfhVuvxh3xyxMsB+EPukjsmIHkNEn1YDG4R86qD6xvckQbemA==","mode":420,"size":297},"lib/features/provideReferences.d.ts":{"checkedAt":1707939899175,"integrity":"sha512-v7MIKtqIpXLNMYky2pENVDMiFadhvXB0+Xpt48IADtGbp7Eo4ieT6Wl8c8tYBWAd0qqtmHGyFKUNoukuyXA48g==","mode":420,"size":331},"lib/features/provideRenameEdits.d.ts":{"checkedAt":1707939899175,"integrity":"sha512-ihzaB7g9BKIiq/yMw3JLa3Dx2gpZEFYfb7KTkrKYf1HJbKq25QHibmeS0i5RdZ4FrkMRha1Hj3UcQZX2POQi6Q==","mode":420,"size":426},"lib/features/provideRenameRange.d.ts":{"checkedAt":1707939899175,"integrity":"sha512-6lYYJSJ5cwn1bdaZGBVNwPsM2+RfGkzEt1iu6dbmNhf0GtW3WED/ef+videKre2Xa6p1cJRmiV+RmN9Gzxem8Q==","mode":420,"size":366},"lib/features/provideSelectionRanges.d.ts":{"checkedAt":1707939899175,"integrity":"sha512-3EzEbUcglH51sM6fGr6zOA6cn8niwVb6mSsECmdugkoPfUr6xiewxtWTwz/3DhsrU2HkNVeR89Z9Mhqjl+oENA==","mode":420,"size":297},"lib/features/provideSignatureHelp.d.ts":{"checkedAt":1707939899175,"integrity":"sha512-HkUlmNlYvxuX9nvZ3nTV/kNkRfOUjpe4TzAIH+CuzfVRC1tph7LlP7m1bB8bHDAyDgOPXc0Uh3gZl6F3+eavGg==","mode":420,"size":343},"lib/features/provideWorkspaceSymbols.d.ts":{"checkedAt":1707939899175,"integrity":"sha512-rbtNI0Sv/bFDkCsM8PKprRI9s5ax/2RQB+WMpP0S+usiyREwr2dgrYI1PfYeKr/L86x7wE1u7YkNd29ezyenoA==","mode":420,"size":258},"lib/features/resolveCodeAction.d.ts":{"checkedAt":1707939899176,"integrity":"sha512-YLQ4kzPsTQNoH7KBgok3bT6MDwFVyBO2H+nRGrQzMOQCI/aBfai4LV6ioFaWhzAJAjrXlluGwdMFPx9CbvPc+g==","mode":420,"size":261},"lib/features/resolveCodeLens.d.ts":{"checkedAt":1707939899176,"integrity":"sha512-1Ff8P3S1Q0mx9ox5Sffz4NJ+2v6u68qo2PAB5dQhCHrc02EP8i7yaX75pe95mQQKzOceC8Esp69hOJTSd+1rwg==","mode":420,"size":257},"lib/features/resolveCompletionItem.d.ts":{"checkedAt":1707939899176,"integrity":"sha512-P8jXCnaC6OPOSYmnGzKyq3ICv7bWJZpzKLrOxVlPOpF6cUdZijnkRe4LIiuYP9EK+K32+Z9/saxx0oyE7A4IGA==","mode":420,"size":269},"lib/features/resolveDocumentLink.d.ts":{"checkedAt":1707939899176,"integrity":"sha512-u4VO2LW23Vq/R5Fadmi46q1fgedjPQayyRUDCGUSdBu/QXJ8aLOjed3hOiPPPLVf5E87a17jooFbUo71PopzBw==","mode":420,"size":265},"lib/features/resolveInlayHint.d.ts":{"checkedAt":1707939899176,"integrity":"sha512-wqJhia45Pp23YNJdRW6nNHWeCuB27Yt47/RO05s2xJ1R3x7x7c+o9LOQz5aoKOgsGZafKpZMxvbqd/snMhstjA==","mode":420,"size":259},"lib/utils/SemanticTokensBuilder.d.ts":{"checkedAt":1707939899176,"integrity":"sha512-kdsrWvN+leMPvOlpayxdP0O/E2y7uj95NKlyjhfsxQn6loRhB3OUICiU2niElih2CzE/Ggj/VdYiRD/yZVikpQ==","mode":420,"size":418},"lib/utils/transform.d.ts":{"checkedAt":1707939899177,"integrity":"sha512-xvhr4fULnpKp73Qitm20pFb/i9+x6URpmFDAiJXSszGX1isXB9GRTcNSO7r369Q8laFnk22llbMcDub1dVtI1g==","mode":420,"size":2845},"lib/types.d.ts":{"checkedAt":1707939899177,"integrity":"sha512-3NJQcpVBm5eDSugQi1QJN+5DXkRYRtraoNlzllh1tsJbjXB++WAcgG02Iw5Ks172fIGnDwsKA/9Z0mmsK43hzg==","mode":420,"size":9804}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/0e/917bdc2598518bd42075a09c4ee55b9cef67de71a16e6031bb11efedf14e68e0bbe58ee340776bc19e36c71231319e48c6384ac509a0c9639fc772a36849ec b/.pnpm-store/v3/files/0e/917bdc2598518bd42075a09c4ee55b9cef67de71a16e6031bb11efedf14e68e0bbe58ee340776bc19e36c71231319e48c6384ac509a0c9639fc772a36849ec new file mode 100644 index 00000000..eae28590 --- /dev/null +++ b/.pnpm-store/v3/files/0e/917bdc2598518bd42075a09c4ee55b9cef67de71a16e6031bb11efedf14e68e0bbe58ee340776bc19e36c71231319e48c6384ac509a0c9639fc772a36849ec @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.pnpm-store/v3/files/0e/edc411afca7b49fa05d2355d9b886a7000539228b104b09da220833ee996d5eb8428271991f5f1f5f3d85e073afade2565c2f0d1265f2c2dba57837a251f58 b/.pnpm-store/v3/files/0e/edc411afca7b49fa05d2355d9b886a7000539228b104b09da220833ee996d5eb8428271991f5f1f5f3d85e073afade2565c2f0d1265f2c2dba57837a251f58 new file mode 100644 index 00000000..d5532d03 --- /dev/null +++ b/.pnpm-store/v3/files/0e/edc411afca7b49fa05d2355d9b886a7000539228b104b09da220833ee996d5eb8428271991f5f1f5f3d85e073afade2565c2f0d1265f2c2dba57837a251f58 @@ -0,0 +1,266 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.astroDirectives = exports.astroAttributes = exports.astroElements = exports.classListAttribute = void 0; +const vscode_html_languageservice_1 = require("vscode-html-languageservice"); +const defaultProvider = (0, vscode_html_languageservice_1.getDefaultHTMLDataProvider)(); +const slotAttr = defaultProvider.provideAttributes('div').find((attr) => attr.name === 'slot'); +exports.classListAttribute = (0, vscode_html_languageservice_1.newHTMLDataProvider)('class-list', { + version: 1, + globalAttributes: [ + { + name: 'class:list', + description: 'Utility to provide a list of class', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#classlist', + }, + ], + }, + ], +}); +exports.astroElements = (0, vscode_html_languageservice_1.newHTMLDataProvider)('astro-elements', { + version: 1, + tags: [ + { + name: 'slot', + description: 'The slot element is a placeholder for external HTML content, allowing you to inject (or “slot”) child elements from other files into your component template.', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/core-concepts/astro-components/#slots', + }, + ], + attributes: [ + { + name: 'name', + description: 'The name attribute allows you to pass only HTML elements with the corresponding slot name into a slot’s location.', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/core-concepts/astro-components/#named-slots', + }, + ], + }, + ], + }, + { + name: 'script', + attributes: [ + { + // The VS Code tag definitions does not provide a description for the deprecated `charset` attribute on script tags + // Which mean that since we get no hover info for this, we instead get JSX hover info. So we'll just specify a description ourselves for this specific case + name: 'charset', + description: "**Deprecated**\n\nIt's unnecessary to specify the charset attribute, because documents must use UTF-8, and the script element inherits its character encoding from the document.", + }, + { + name: 'define:vars', + description: 'Passes serializable server-side variables into a client-side script element', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#definevars', + }, + ], + }, + { + name: 'hoist', + description: '**Deprecated in Astro >= 0.26.0**\n\nBuilds, optimizes, and bundles your script with the other JavaScript on the page', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/core-concepts/astro-components/#using-hoisted-scripts', + }, + ], + }, + { + name: 'is:inline', + description: 'Leave a script tag inline in the page template. No processing will be done on its content', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#isinline', + }, + ], + }, + ], + }, + { + name: 'style', + attributes: [ + { + name: 'define:vars', + description: 'Passes serializable server-side variables into a client-side style element', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#definevars', + }, + ], + }, + { + name: 'global', + description: '**Deprecated in favor of `is:global` in >= Astro 0.26.0**\n\nOpts-out of automatic CSS scoping, all contents will be available globally', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#isglobal', + }, + ], + }, + { + name: 'is:global', + description: 'Opts-out of automatic CSS scoping, all contents will be available globally', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#isglobal', + }, + ], + }, + { + name: 'is:inline', + description: 'Leave a style tag inline in the page template. No processing will be done on its content', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#isinline', + }, + ], + }, + ], + }, + ], +}); +exports.astroAttributes = (0, vscode_html_languageservice_1.newHTMLDataProvider)('astro-attributes', { + version: 1, + globalAttributes: [ + { + name: 'set:html', + description: 'Inject unescaped HTML into this tag', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#sethtml', + }, + ], + }, + { + name: 'set:text', + description: 'Inject escaped text into this tag', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#settext', + }, + ], + }, + { + name: 'is:raw', + description: 'Instructs the Astro compiler to treat any children of this element as text', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#israw', + }, + ], + }, + { + name: 'transition:animate', + description: 'Specifies an animation to use with this element on page transition.', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/guides/view-transitions/#transition-directives', + }, + ], + }, + { + name: 'transition:name', + description: 'Specifies a `view-transition-name` for this element. The name must be unique on the page.', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/guides/view-transitions/#transition-directives', + }, + ], + }, + { + name: 'transition:persist', + description: 'Marks this element to be moved to the next page during view transitions.', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/guides/view-transitions/#transition-directives', + }, + ], + }, + slotAttr, + ], +}); +exports.astroDirectives = (0, vscode_html_languageservice_1.newHTMLDataProvider)('astro-directives', { + version: 1, + globalAttributes: [ + { + name: 'client:load', + description: 'Start importing the component JS at page load. Hydrate the component when import completes.', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#clientload', + }, + ], + }, + { + name: 'client:idle', + description: 'Start importing the component JS as soon as main thread is free (uses requestIdleCallback()). Hydrate the component when import completes.', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#clientidle', + }, + ], + }, + { + name: 'client:visible', + description: 'Start importing the component JS as soon as the element enters the viewport (uses IntersectionObserver). Hydrate the component when import completes. Useful for content lower down on the page.', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#clientvisible', + }, + ], + }, + { + name: 'client:media', + description: 'Start importing the component JS as soon as the browser matches the given media query (uses matchMedia). Hydrate the component when import completes. Useful for sidebar toggles, or other elements that should only display on mobile or desktop devices.', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#clientmedia', + }, + ], + }, + { + name: 'client:only', + description: 'Start importing the component JS at page load and hydrate when the import completes, similar to client:load. The component will be skipped at build time, useful for components that are entirely dependent on client-side APIs. This is best avoided unless absolutely needed, in most cases it is best to render placeholder content on the server and delay any browser API calls until the component hydrates in the browser.', + valueSet: 'v', + references: [ + { + name: 'Astro reference', + url: 'https://docs.astro.build/en/reference/directives-reference/#clientonly', + }, + ], + }, + ], +}); +//# sourceMappingURL=html-data.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0f/0d8c91b21491d58deae366e09bcc75ac6de6a2492f32775f4408953a025e6f499d044f5402feb57e73be767936a94f758a2db18b2460aa1326ff79d5ec98f2 b/.pnpm-store/v3/files/0f/0d8c91b21491d58deae366e09bcc75ac6de6a2492f32775f4408953a025e6f499d044f5402feb57e73be767936a94f758a2db18b2460aa1326ff79d5ec98f2 new file mode 100644 index 00000000..07128420 --- /dev/null +++ b/.pnpm-store/v3/files/0f/0d8c91b21491d58deae366e09bcc75ac6de6a2492f32775f4408953a025e6f499d044f5402feb57e73be767936a94f758a2db18b2460aa1326ff79d5ec98f2 @@ -0,0 +1 @@ +{"version":3,"file":"block-spacing.js","sourceRoot":"","sources":["../../src/rules/block-spacing.ts"],"names":[],"mappings":";;AACA,oDAA2D;AAM3D,kCAAwD;AACxD,iEAA8D;AAE9D,MAAM,QAAQ,GAAG,IAAA,qCAAiB,EAAC,eAAe,CAAC,CAAC;AAKpD,kBAAe,IAAA,iBAAU,EAAsB;IAC7C,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE;QACJ,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,CAAC,6BAA6B,CAAC;QAC3C,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EACT,0FAA0F;YAC5F,eAAe,EAAE,IAAI;SACtB;QACD,OAAO,EAAE,YAAY;QACrB,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,cAAc;QAC5C,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;QAC5B,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ;KACjC;IACD,cAAc,EAAE,CAAC,QAAQ,CAAC;IAE1B,MAAM,CAAC,OAAO,EAAE,CAAC,iBAAiB,CAAC;QACjC,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,MAAM,GAAG,iBAAiB,KAAK,OAAO,CAAC;QAC7C,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;QAC/C;;;WAGG;QACH,SAAS,YAAY,CACnB,IAAgC;YAEhC,uBAAuB;YACvB,uDAAuD;YACvD,OAAO,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE;gBAC5C,MAAM,EAAE,KAAK,CAAC,EAAE,CACd,KAAK,CAAC,IAAI,KAAK,uBAAe,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,KAAK,GAAG;aACnE,CAA6B,CAAC;QACjC,CAAC;QAED;;;;;;;;;;WAUG;QACH,SAAS,OAAO,CAAC,IAAoB,EAAE,KAAqB;YAC1D,OAAO,CACL,CAAC,IAAA,wBAAiB,EAAC,IAAI,EAAE,KAAK,CAAC;gBAC/B,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,MAAM,CAC1D,CAAC;QACJ,CAAC;QAED;;WAEG;QACH,SAAS,wBAAwB,CAAC,IAAgC;YAChE,mDAAmD;YACnD,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAE,CAAC;YAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,EAAE;gBAC7D,eAAe,EAAE,IAAI;aACtB,CAAE,CAAC;YACJ,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,UAAU,EAAE;gBAC9D,eAAe,EAAE,IAAI;aACtB,CAAE,CAAC;YAEJ,wCAAwC;YACxC,IACE,SAAS,CAAC,KAAK,KAAK,GAAG;gBACvB,UAAU,CAAC,IAAI,KAAK,uBAAe,CAAC,UAAU;gBAC9C,UAAU,CAAC,KAAK,KAAK,GAAG;gBACxB,UAAU,KAAK,UAAU,EACzB,CAAC;gBACD,OAAO;YACT,CAAC;YAED,sCAAsC;YACtC,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,IAAI,KAAK,uBAAe,CAAC,IAAI,EAAE,CAAC;gBACxD,OAAO;YACT,CAAC;YAED,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC;gBACpC,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC;gBAExB,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;oBAC1B,GAAG,GAAG;wBACJ,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG;wBACxB,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK;qBAC1B,CAAC;gBACJ,CAAC;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,GAAG;oBACH,SAAS;oBACT,IAAI,EAAE;wBACJ,QAAQ,EAAE,OAAO;wBACjB,KAAK,EAAE,SAAS,CAAC,KAAK;qBACvB;oBACD,GAAG,CAAC,KAAK;wBACP,IAAI,MAAM,EAAE,CAAC;4BACX,OAAO,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;wBACjD,CAAC;wBAED,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACtE,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC;gBACpC,IAAI,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;gBAEzB,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;oBAC1B,GAAG,GAAG;wBACJ,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG;wBACxB,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK;qBAC1B,CAAC;gBACJ,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,GAAG;oBACH,SAAS;oBACT,IAAI,EAAE;wBACJ,QAAQ,EAAE,QAAQ;wBAClB,KAAK,EAAE,UAAU,CAAC,KAAK;qBACxB;oBACD,GAAG,CAAC,KAAK;wBACP,IAAI,MAAM,EAAE,CAAC;4BACX,OAAO,KAAK,CAAC,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;wBAC/C,CAAC;wBAED,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACtE,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,OAAO;YACL,GAAG,SAAS;YAEZ,mEAAmE;YACnE,mIAAmI;YACnI,wFAAwF;YACxF,sEAAsE;YACtE,eAAe,EAAE,SAAS,CAAC,cAAuB;YAClD,aAAa,EAAE,SAAS,CAAC,cAAuB;YAChD,iBAAiB,EAAE,wBAAwB;SAC5C,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/0f/3f70c3eb592f0412ae1e7e18cbbc691ac3d1a220d52155d4bec2d3fb5a64052202a06dadf3f8136f1996410179e8a9b82b1c096783cdfb4c4238cbceb980f1 b/.pnpm-store/v3/files/0f/3f70c3eb592f0412ae1e7e18cbbc691ac3d1a220d52155d4bec2d3fb5a64052202a06dadf3f8136f1996410179e8a9b82b1c096783cdfb4c4238cbceb980f1 new file mode 100644 index 00000000..27db5213 --- /dev/null +++ b/.pnpm-store/v3/files/0f/3f70c3eb592f0412ae1e7e18cbbc691ac3d1a220d52155d4bec2d3fb5a64052202a06dadf3f8136f1996410179e8a9b82b1c096783cdfb4c4238cbceb980f1 @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $BigInt = GetIntrinsic('%BigInt%', true); +var $RangeError = require('es-errors/range'); +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); + +var IsIntegralNumber = require('./IsIntegralNumber'); + +// https://262.ecma-international.org/12.0/#sec-numbertobigint + +module.exports = function NumberToBigInt(number) { + if (typeof number !== 'number') { + throw new $TypeError('Assertion failed: `number` must be a String'); + } + if (!IsIntegralNumber(number)) { + throw new $RangeError('The number ' + number + ' cannot be converted to a BigInt because it is not an integer'); + } + if (!$BigInt) { + throw new $SyntaxError('BigInts are not supported in this environment'); + } + return $BigInt(number); +}; diff --git a/.pnpm-store/v3/files/0f/5b3b81c88c1e981c84576f3c0336ddbe671d628cb7ea54d79ae06eafc04cb5101a9c2efc986d7f77a2974a770ad1ac48fb262379c04d4e6a354d086f7c7dd8 b/.pnpm-store/v3/files/0f/5b3b81c88c1e981c84576f3c0336ddbe671d628cb7ea54d79ae06eafc04cb5101a9c2efc986d7f77a2974a770ad1ac48fb262379c04d4e6a354d086f7c7dd8 new file mode 100644 index 00000000..74e490e1 --- /dev/null +++ b/.pnpm-store/v3/files/0f/5b3b81c88c1e981c84576f3c0336ddbe671d628cb7ea54d79ae06eafc04cb5101a9c2efc986d7f77a2974a770ad1ac48fb262379c04d4e6a354d086f7c7dd8 @@ -0,0 +1,89 @@ +import type { ParserServices, TSESTree } from '../ts-estree'; +import type { ParserOptions } from './ParserOptions'; +import type { Scope } from './Scope'; +export declare namespace Parser { + interface ParserMeta { + /** + * The unique name of the parser. + */ + name: string; + /** + * The a string identifying the version of the parser. + */ + version?: string; + } + /** + * A loose definition of the ParserModule type for use with configs + * This type intended to relax validation of configs so that parsers that have + * different AST types or scope managers can still be passed to configs + */ + type LooseParserModule = { + /** + * Information about the parser to uniquely identify it when serializing. + */ + meta?: ParserMeta; + /** + * Parses the given text into an ESTree AST + */ + parse(text: string, options?: unknown): unknown; + } | { + /** + * Information about the parser to uniquely identify it when serializing. + */ + meta?: ParserMeta; + /** + * Parses the given text into an AST + */ + parseForESLint(text: string, options?: unknown): { + [k in keyof ParseResult]: unknown; + }; + }; + type ParserModule = { + /** + * Information about the parser to uniquely identify it when serializing. + */ + meta?: ParserMeta; + /** + * Parses the given text into an ESTree AST + */ + parse(text: string, options?: ParserOptions): TSESTree.Program; + } | { + /** + * Information about the parser to uniquely identify it when serializing. + */ + meta?: ParserMeta; + /** + * Parses the given text into an AST + */ + parseForESLint(text: string, options?: ParserOptions): ParseResult; + }; + interface ParseResult { + /** + * The ESTree AST + */ + ast: TSESTree.Program; + /** + * Any parser-dependent services (such as type checkers for nodes). + * The value of the services property is available to rules as `context.sourceCode.parserServices`. + * The default is an empty object. + */ + services?: ParserServices; + /** + * A `ScopeManager` object. + * Custom parsers can use customized scope analysis for experimental/enhancement syntaxes. + * The default is the `ScopeManager` object which is created by `eslint-scope`. + */ + scopeManager?: Scope.ScopeManager; + /** + * An object to customize AST traversal. + * The keys of the object are the type of AST nodes. + * Each value is an array of the property names which should be traversed. + * The default is `KEYS` of `eslint-visitor-keys`. + */ + visitorKeys?: VisitorKeys; + } + interface VisitorKeys { + [nodeType: string]: readonly string[]; + } +} +//# sourceMappingURL=Parser.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/0f/adb77657d36c74a5a89937a8e9c01be504d2ff2da091367d246e1ec37749540f9e0cfd25d096d0118bb8a0643ff426b732ce78b070e945dce8786e112d03ac b/.pnpm-store/v3/files/0f/adb77657d36c74a5a89937a8e9c01be504d2ff2da091367d246e1ec37749540f9e0cfd25d096d0118bb8a0643ff426b732ce78b070e945dce8786e112d03ac new file mode 100644 index 00000000..57d186b1 --- /dev/null +++ b/.pnpm-store/v3/files/0f/adb77657d36c74a5a89937a8e9c01be504d2ff2da091367d246e1ec37749540f9e0cfd25d096d0118bb8a0643ff426b732ce78b070e945dce8786e112d03ac @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-loss-of-precision'); +exports.default = (0, util_1.createRule)({ + name: 'no-loss-of-precision', + meta: { + type: 'problem', + docs: { + description: 'Disallow literal numbers that lose precision', + recommended: 'recommended', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + schema: [], + messages: baseRule.meta.messages, + }, + defaultOptions: [], + create(context) { + const rules = baseRule.create(context); + function isSeparatedNumeric(node) { + return typeof node.value === 'number' && node.raw.includes('_'); + } + return { + Literal(node) { + rules.Literal({ + ...node, + raw: isSeparatedNumeric(node) ? node.raw.replace(/_/g, '') : node.raw, + }); + }, + }; + }, +}); +//# sourceMappingURL=no-loss-of-precision.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/10/0045b8c7a5a2bcabd4f9dd2d2a5b78a57de7420b477bab1bd0ea56f61855a3c2aa453f3b6ae808f384bf2afc7a26aa970e72a1ffa859b63dea447d33071ba6 b/.pnpm-store/v3/files/10/0045b8c7a5a2bcabd4f9dd2d2a5b78a57de7420b477bab1bd0ea56f61855a3c2aa453f3b6ae808f384bf2afc7a26aa970e72a1ffa859b63dea447d33071ba6 new file mode 100644 index 00000000..3a7935af --- /dev/null +++ b/.pnpm-store/v3/files/10/0045b8c7a5a2bcabd4f9dd2d2a5b78a57de7420b477bab1bd0ea56f61855a3c2aa453f3b6ae808f384bf2afc7a26aa970e72a1ffa859b63dea447d33071ba6 @@ -0,0 +1 @@ +{"version":3,"file":"no-unused-vars.js","sourceRoot":"","sources":["../../src/rules/no-unused-vars.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/10/1509bb54f17db5dcfbdd1313c3229011fc2f15e05f342dbc8cc08823f2cb7f51bd862d38208f0d74e1ec1add2d94450386f327949ba9722b35766f5a2447c5 b/.pnpm-store/v3/files/10/1509bb54f17db5dcfbdd1313c3229011fc2f15e05f342dbc8cc08823f2cb7f51bd862d38208f0d74e1ec1add2d94450386f327949ba9722b35766f5a2447c5 new file mode 100644 index 00000000..2aa0d488 --- /dev/null +++ b/.pnpm-store/v3/files/10/1509bb54f17db5dcfbdd1313c3229011fc2f15e05f342dbc8cc08823f2cb7f51bd862d38208f0d74e1ec1add2d94450386f327949ba9722b35766f5a2447c5 @@ -0,0 +1,15 @@ +'use strict'; + +// eslint-disable-next-line consistent-return +module.exports = /** @type {(t: import('tape').Test) => void | false} */ function runSymbolTests(t) { + t.equal(typeof Symbol, 'function', 'global Symbol is a function'); + t.ok(Symbol.toStringTag, 'Symbol.toStringTag exists'); + + if (typeof Symbol !== 'function' || !Symbol.toStringTag) { return false; } + + /** @type {{ [Symbol.toStringTag]?: 'test'}} */ + var obj = {}; + obj[Symbol.toStringTag] = 'test'; + + t.equal(Object.prototype.toString.call(obj), '[object test]'); +}; diff --git a/.pnpm-store/v3/files/10/67d75382078a1510998a869b812959644c60e852e589a958f09373e450cc3b09a6719643f8973268e658ac1fd64655b93cda4360b44bf5afa71d1b43336326 b/.pnpm-store/v3/files/10/67d75382078a1510998a869b812959644c60e852e589a958f09373e450cc3b09a6719643f8973268e658ac1fd64655b93cda4360b44bf5afa71d1b43336326 new file mode 100644 index 00000000..e2c533c1 --- /dev/null +++ b/.pnpm-store/v3/files/10/67d75382078a1510998a869b812959644c60e852e589a958f09373e450cc3b09a6719643f8973268e658ac1fd64655b93cda4360b44bf5afa71d1b43336326 @@ -0,0 +1,94 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.register = void 0; +const PConst = require("../protocol.const"); +const shared_1 = require("../shared"); +const modifiers_1 = require("../utils/modifiers"); +const getSymbolKind = (kind) => { + switch (kind) { + case PConst.Kind.module: return 2; + case PConst.Kind.class: return 5; + case PConst.Kind.enum: return 10; + case PConst.Kind.interface: return 11; + case PConst.Kind.method: return 6; + case PConst.Kind.memberVariable: return 7; + case PConst.Kind.memberGetAccessor: return 7; + case PConst.Kind.memberSetAccessor: return 7; + case PConst.Kind.variable: return 13; + case PConst.Kind.const: return 13; + case PConst.Kind.localVariable: return 13; + case PConst.Kind.function: return 12; + case PConst.Kind.localFunction: return 12; + case PConst.Kind.constructSignature: return 9; + case PConst.Kind.constructorImplementation: return 9; + } + return 13; +}; +function register(ctx) { + return (uri) => { + const document = ctx.getTextDocument(uri); + if (!document) + return []; + const fileName = ctx.uriToFileName(document.uri); + const barItems = (0, shared_1.safeCall)(() => ctx.languageService.getNavigationTree(fileName)); + if (!barItems) + return []; + // The root represents the file. Ignore this when showing in the UI + const result = barItems.childItems + ?.map(function convertNavTree(item) { + if (!shouldIncludeEntry(item)) { + return []; + } + let remain = item.childItems ?? []; + return item.spans.map(span => { + const childItems = []; + remain = remain.filter(child => { + const childStart = child.spans[0].start; + const childEnd = child.spans[child.spans.length - 1].start + child.spans[child.spans.length - 1].length; + if (childStart >= span.start && childEnd <= span.start + span.length) { + childItems.push(child); + return false; + } + return true; + }); + const nameSpan = item.spans.length === 1 + ? (item.nameSpan ?? span) + : span; + const fullRange = { + start: Math.min(span.start, nameSpan.start), + end: Math.max(span.start + span.length, nameSpan.start + nameSpan.length), + }; + const symbol = { + name: item.text, + kind: getSymbolKind(item.kind), + range: { + start: document.positionAt(fullRange.start), + end: document.positionAt(fullRange.end), + }, + selectionRange: { + start: document.positionAt(nameSpan.start), + end: document.positionAt(nameSpan.start + nameSpan.length), + }, + children: childItems.map(convertNavTree).flat(), + }; + const kindModifiers = (0, modifiers_1.parseKindModifier)(item.kindModifiers); + if (kindModifiers.has(PConst.KindModifiers.deprecated)) { + symbol.deprecated = true; + symbol.tags ??= []; + symbol.tags.push(1); + } + return symbol; + }); + }) + .flat(); + return result ?? []; + function shouldIncludeEntry(item) { + if (item.kind === PConst.Kind.alias) { + return false; + } + return !!(item.text && item.text !== '' && item.text !== ''); + } + }; +} +exports.register = register; +//# sourceMappingURL=documentSymbol.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/10/704b69091bbb3a7f815534cf64300ca5d9d8e0dfd67d7dcfec5821c9d9188ac3167279345b6556ce6cd869c02980fc9cb40b492debb93ef8623e5926c08892 b/.pnpm-store/v3/files/10/704b69091bbb3a7f815534cf64300ca5d9d8e0dfd67d7dcfec5821c9d9188ac3167279345b6556ce6cd869c02980fc9cb40b492debb93ef8623e5926c08892 new file mode 100644 index 00000000..44991da3 --- /dev/null +++ b/.pnpm-store/v3/files/10/704b69091bbb3a7f815534cf64300ca5d9d8e0dfd67d7dcfec5821c9d9188ac3167279345b6556ce6cd869c02980fc9cb40b492debb93ef8623e5926c08892 @@ -0,0 +1,9 @@ +import type * as vscode from 'vscode-languageserver-protocol'; +import type { ServiceContext } from '../types'; +export interface ServiceCodeActionData { + uri: string; + version: number; + original: Pick; + serviceIndex: number; +} +export declare function register(context: ServiceContext): (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext, token?: vscode.CancellationToken) => Promise; diff --git a/.pnpm-store/v3/files/10/a3c6bd8012b66b11c91c72e660d944e5b0d852c49779e8dbac50c6baedfdcad49c757c484326aa2980719db6c1aa068dd393021d54cb2fb0a699b1586409c4 b/.pnpm-store/v3/files/10/a3c6bd8012b66b11c91c72e660d944e5b0d852c49779e8dbac50c6baedfdcad49c757c484326aa2980719db6c1aa068dd393021d54cb2fb0a699b1586409c4 new file mode 100644 index 00000000..d90dd7d5 --- /dev/null +++ b/.pnpm-store/v3/files/10/a3c6bd8012b66b11c91c72e660d944e5b0d852c49779e8dbac50c6baedfdcad49c757c484326aa2980719db6c1aa068dd393021d54cb2fb0a699b1586409c4 @@ -0,0 +1,162 @@ +import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-1evA5lom.js'; +import 'vite'; +import '@vitest/runner'; +import 'vite-node'; +import '@vitest/snapshot'; +import '@vitest/expect'; +import '@vitest/runner/utils'; +import '@vitest/utils'; +import 'tinybench'; +import 'vite-node/client'; +import '@vitest/snapshot/manager'; +import 'vite-node/server'; +import 'node:worker_threads'; +import 'node:fs'; +import 'chai'; + +interface CoverageSummaryData { + lines: Totals; + statements: Totals; + branches: Totals; + functions: Totals; +} + +declare class CoverageSummary { + constructor(data: CoverageSummary | CoverageSummaryData); + merge(obj: CoverageSummary): CoverageSummary; + toJSON(): CoverageSummaryData; + isEmpty(): boolean; + data: CoverageSummaryData; + lines: Totals; + statements: Totals; + branches: Totals; + functions: Totals; +} + +interface CoverageMapData { + [key: string]: FileCoverage | FileCoverageData; +} + +declare class CoverageMap { + constructor(data: CoverageMapData | CoverageMap); + addFileCoverage(pathOrObject: string | FileCoverage | FileCoverageData): void; + files(): string[]; + fileCoverageFor(filename: string): FileCoverage; + filter(callback: (key: string) => boolean): void; + getCoverageSummary(): CoverageSummary; + merge(data: CoverageMapData | CoverageMap): void; + toJSON(): CoverageMapData; + data: CoverageMapData; +} + +interface Location { + line: number; + column: number; +} + +interface Range { + start: Location; + end: Location; +} + +interface BranchMapping { + loc: Range; + type: string; + locations: Range[]; + line: number; +} + +interface FunctionMapping { + name: string; + decl: Range; + loc: Range; + line: number; +} + +interface FileCoverageData { + path: string; + statementMap: { [key: string]: Range }; + fnMap: { [key: string]: FunctionMapping }; + branchMap: { [key: string]: BranchMapping }; + s: { [key: string]: number }; + f: { [key: string]: number }; + b: { [key: string]: number[] }; +} + +interface Totals { + total: number; + covered: number; + skipped: number; + pct: number; +} + +interface Coverage { + covered: number; + total: number; + coverage: number; +} + +declare class FileCoverage implements FileCoverageData { + constructor(data: string | FileCoverage | FileCoverageData); + merge(other: FileCoverageData): void; + getBranchCoverageByLine(): { [line: number]: Coverage }; + getLineCoverage(): { [line: number]: number }; + getUncoveredLines(): number[]; + resetHits(): void; + computeBranchTotals(): Totals; + computeSimpleTotals(): Totals; + toSummary(): CoverageSummary; + toJSON(): object; + + data: FileCoverageData; + path: string; + statementMap: { [key: string]: Range }; + fnMap: { [key: string]: FunctionMapping }; + branchMap: { [key: string]: BranchMapping }; + s: { [key: string]: number }; + f: { [key: string]: number }; + b: { [key: string]: number[] }; +} + +type Threshold = 'lines' | 'functions' | 'statements' | 'branches'; +interface ResolvedThreshold { + coverageMap: CoverageMap; + name: string; + thresholds: Partial>; +} +declare class BaseCoverageProvider { + /** + * Check if current coverage is above configured thresholds and bump the thresholds if needed + */ + updateThresholds({ thresholds: allThresholds, perFile, configurationFile }: { + thresholds: ResolvedThreshold[]; + perFile?: boolean; + configurationFile: { + read(): unknown; + write(): void; + }; + }): void; + /** + * Check collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached. + */ + checkThresholds({ thresholds: allThresholds, perFile }: { + thresholds: ResolvedThreshold[]; + perFile?: boolean; + }): void; + /** + * Constructs collected coverage and users' threshold options into separate sets + * where each threshold set holds their own coverage maps. Threshold set is either + * for specific files defined by glob pattern or global for all other files. + */ + resolveThresholds({ coverageMap, thresholds, createCoverageMap }: { + coverageMap: CoverageMap; + thresholds: NonNullable; + createCoverageMap: () => CoverageMap; + }): ResolvedThreshold[]; + /** + * Resolve reporters from various configuration options + */ + resolveReporters(configReporters: NonNullable): ResolvedCoverageOptions['reporter']; +} + +export { BaseCoverageProvider }; diff --git a/.pnpm-store/v3/files/10/aa3aa858aa690776303e8ef40f53b38e615bcfe5cb81bf0d0088f6dccaaaf095f0bb33182d247794fbc555330b230637679e9d4fc69ea6ac8a2e9d4530f7e5 b/.pnpm-store/v3/files/10/aa3aa858aa690776303e8ef40f53b38e615bcfe5cb81bf0d0088f6dccaaaf095f0bb33182d247794fbc555330b230637679e9d4fc69ea6ac8a2e9d4530f7e5 new file mode 100644 index 00000000..55605bbc --- /dev/null +++ b/.pnpm-store/v3/files/10/aa3aa858aa690776303e8ef40f53b38e615bcfe5cb81bf0d0088f6dccaaaf095f0bb33182d247794fbc555330b230637679e9d4fc69ea6ac8a2e9d4530f7e5 @@ -0,0 +1,113 @@ +'use strict'; + +var forEach = require('for-each'); +var availableTypedArrays = require('available-typed-arrays'); +var callBind = require('call-bind'); +var callBound = require('call-bind/callBound'); +var gOPD = require('gopd'); + +var $toString = callBound('Object.prototype.toString'); +var hasToStringTag = require('has-tostringtag/shams')(); + +var g = typeof globalThis === 'undefined' ? global : globalThis; +var typedArrays = availableTypedArrays(); + +var $slice = callBound('String.prototype.slice'); +var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof'); + +var $indexOf = callBound('Array.prototype.indexOf', true) || /** @type {(array: readonly unknown[], value: unknown) => keyof array} */ function indexOf(array, value) { + for (var i = 0; i < array.length; i += 1) { + if (array[i] === value) { + return i; + } + } + return -1; +}; + +/** @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array} TypedArray */ +/** @typedef {'Int8Array' | 'Uint8Array' | 'Uint8ClampedArray' | 'Int16Array' | 'Uint16Array' | 'Int32Array' | 'Uint32Array' | 'Float32Array' | 'Float64Array' | 'BigInt64Array' | 'BigUint64Array'} TypedArrayName */ +/** @type {{ [k in `\$${TypedArrayName}`]?: (receiver: TypedArray) => string | typeof Uint8Array.prototype.slice.call | typeof Uint8Array.prototype.set.call } & { __proto__: null }} */ +var cache = { __proto__: null }; +if (hasToStringTag && gOPD && getPrototypeOf) { + forEach(typedArrays, function (typedArray) { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + // @ts-expect-error TS won't narrow inside a closure + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + // @ts-expect-error TS won't narrow inside a closure + descriptor = gOPD(superProto, Symbol.toStringTag); + } + // @ts-expect-error TODO: fix + cache['$' + typedArray] = callBind(descriptor.get); + } + }); +} else { + forEach(typedArrays, function (typedArray) { + var arr = new g[typedArray](); + var fn = arr.slice || arr.set; + if (fn) { + // @ts-expect-error TODO: fix + cache['$' + typedArray] = callBind(fn); + } + }); +} + +/** @type {import('.')} */ +var tryTypedArrays = function tryAllTypedArrays(value) { + /** @type {ReturnType} */ var found = false; + forEach( + // eslint-disable-next-line no-extra-parens + /** @type {Record<`\$${TypedArrayName}`, typeof cache>} */ /** @type {any} */ (cache), + /** @type {(getter: typeof cache, name: `\$${TypedArrayName}`) => void} */ function (getter, typedArray) { + if (!found) { + try { + // @ts-expect-error TODO: fix + if ('$' + getter(value) === typedArray) { + found = $slice(typedArray, 1); + } + } catch (e) { /**/ } + } + } + ); + return found; +}; + +/** @type {import('.')} */ +var trySlices = function tryAllSlices(value) { + /** @type {ReturnType} */ var found = false; + forEach( + // eslint-disable-next-line no-extra-parens + /** @type {any} */ (cache), + /** @type {(getter: typeof cache, name: `\$${TypedArrayName}`) => void} */ function (getter, name) { + if (!found) { + try { + // @ts-expect-error TODO: fix + getter(value); + found = $slice(name, 1); + } catch (e) { /**/ } + } + } + ); + return found; +}; + +/** @type {import('.')} */ +module.exports = function whichTypedArray(value) { + if (!value || typeof value !== 'object') { return false; } + if (!hasToStringTag) { + var tag = $slice($toString(value), 8, -1); + if ($indexOf(typedArrays, tag) > -1) { + return tag; + } + if (tag !== 'Object') { + return false; + } + // node < 0.6 hits here on real Typed Arrays + return trySlices(value); + } + if (!gOPD) { return null; } // unknown engine + return tryTypedArrays(value); +}; diff --git a/.pnpm-store/v3/files/11/5c4269c55b8afde69790d15eaa9ff095dd9bfd26352e657866f5abe9bd8dbd1d6c44462062f761c108db10ab0be800dbfeccdbb79f81adfd441abffb05e2aa b/.pnpm-store/v3/files/11/5c4269c55b8afde69790d15eaa9ff095dd9bfd26352e657866f5abe9bd8dbd1d6c44462062f761c108db10ab0be800dbfeccdbb79f81adfd441abffb05e2aa new file mode 100644 index 00000000..57164208 --- /dev/null +++ b/.pnpm-store/v3/files/11/5c4269c55b8afde69790d15eaa9ff095dd9bfd26352e657866f5abe9bd8dbd1d6c44462062f761c108db10ab0be800dbfeccdbb79f81adfd441abffb05e2aa @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-namespace-keyword', + meta: { + type: 'suggestion', + docs: { + description: 'Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules', + recommended: 'stylistic', + }, + fixable: 'code', + messages: { + useNamespace: "Use 'namespace' instead of 'module' to declare custom TypeScript modules.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + TSModuleDeclaration(node) { + // Do nothing if the name is a string. + if (node.id.type === utils_1.AST_NODE_TYPES.Literal) { + return; + } + // Get tokens of the declaration header. + const moduleType = context.sourceCode.getTokenBefore(node.id); + if (moduleType && + moduleType.type === utils_1.AST_TOKEN_TYPES.Identifier && + moduleType.value === 'module') { + context.report({ + node, + messageId: 'useNamespace', + fix(fixer) { + return fixer.replaceText(moduleType, 'namespace'); + }, + }); + } + }, + }; + }, +}); +//# sourceMappingURL=prefer-namespace-keyword.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/11/c65b6b9de5b0d12355b5b84080011b54ff477b89fa734c1b2a9fb05183fde5fd71ed09d8428e2919c57aa7c6ffbdd1c59b4bbb72489c561053012e40aa000a b/.pnpm-store/v3/files/11/c65b6b9de5b0d12355b5b84080011b54ff477b89fa734c1b2a9fb05183fde5fd71ed09d8428e2919c57aa7c6ffbdd1c59b4bbb72489c561053012e40aa000a new file mode 100644 index 00000000..a628fb95 --- /dev/null +++ b/.pnpm-store/v3/files/11/c65b6b9de5b0d12355b5b84080011b54ff477b89fa734c1b2a9fb05183fde5fd71ed09d8428e2919c57aa7c6ffbdd1c59b4bbb72489c561053012e40aa000a @@ -0,0 +1,38 @@ +import { V as VitestRunMode, U as UserConfig, d as VitestOptions, e as Vitest, R as ResolvedConfig, P as ProvidedContext, W as WorkspaceProject, f as RuntimeRPC, T as TestSequencer, g as WorkspaceSpec } from './reporters-1evA5lom.js'; +export { l as BrowserProvider, k as BrowserProviderInitializationOptions, m as BrowserProviderOptions, h as ProcessPool, j as TestSequencerConstructor, i as VitestPackageInstaller, s as startVitest } from './reporters-1evA5lom.js'; +import { UserConfig as UserConfig$1, Plugin } from 'vite'; +import '@vitest/runner'; +import 'vite-node'; +import '@vitest/snapshot'; +import '@vitest/expect'; +import '@vitest/runner/utils'; +import '@vitest/utils'; +import 'tinybench'; +import 'vite-node/client'; +import '@vitest/snapshot/manager'; +import 'vite-node/server'; +import 'node:worker_threads'; +import 'node:fs'; +import 'chai'; + +declare function createVitest(mode: VitestRunMode, options: UserConfig, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise; + +declare function VitestPlugin(options?: UserConfig, ctx?: Vitest): Promise; + +declare function registerConsoleShortcuts(ctx: Vitest): () => void; + +interface GlobalSetupContext { + config: ResolvedConfig; + provide(key: T, value: ProvidedContext[T]): void; +} + +declare function createMethodsRPC(project: WorkspaceProject): RuntimeRPC; + +declare class BaseSequencer implements TestSequencer { + protected ctx: Vitest; + constructor(ctx: Vitest); + shard(files: WorkspaceSpec[]): Promise; + sort(files: WorkspaceSpec[]): Promise; +} + +export { BaseSequencer, type GlobalSetupContext, TestSequencer, Vitest, VitestPlugin, WorkspaceProject, WorkspaceSpec, createMethodsRPC, createVitest, registerConsoleShortcuts }; diff --git a/.pnpm-store/v3/files/11/f4c7c6546b8c908fdd3546f9684f32fc836b90023369754e4a2f93414cceefb9bd803ba17aca5a865a8758253ea81824160934711de7e2bddf879b59768d5e b/.pnpm-store/v3/files/11/f4c7c6546b8c908fdd3546f9684f32fc836b90023369754e4a2f93414cceefb9bd803ba17aca5a865a8758253ea81824160934711de7e2bddf879b59768d5e new file mode 100644 index 00000000..b22775b1 --- /dev/null +++ b/.pnpm-store/v3/files/11/f4c7c6546b8c908fdd3546f9684f32fc836b90023369754e4a2f93414cceefb9bd803ba17aca5a865a8758253ea81824160934711de7e2bddf879b59768d5e @@ -0,0 +1,22 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var ToInt32 = require('../ToInt32'); +var ToUint32 = require('../ToUint32'); +var modulo = require('../modulo'); + +// https://262.ecma-international.org/12.0/#sec-numeric-types-number-signedRightShift + +module.exports = function NumberSignedRightShift(x, y) { + if (typeof x !== 'number' || typeof y !== 'number') { + throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers'); + } + + var lnum = ToInt32(x); + var rnum = ToUint32(y); + + var shiftCount = modulo(rnum, 32); + + return lnum >> shiftCount; +}; diff --git a/.pnpm-store/v3/files/12/08e24a567468337af3112be09e0937da4d6b0a59205d9d8eecf89e9bce3ca515c44e7f81ea94b86d2f09b162e0b1bcff18ec119cdb71e84a817c280e7c2e2a b/.pnpm-store/v3/files/12/08e24a567468337af3112be09e0937da4d6b0a59205d9d8eecf89e9bce3ca515c44e7f81ea94b86d2f09b162e0b1bcff18ec119cdb71e84a817c280e7c2e2a new file mode 100644 index 00000000..c542a035 --- /dev/null +++ b/.pnpm-store/v3/files/12/08e24a567468337af3112be09e0937da4d6b0a59205d9d8eecf89e9bce3ca515c44e7f81ea94b86d2f09b162e0b1bcff18ec119cdb71e84a817c280e7c2e2a @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $TypeError = require('es-errors/type'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('call-bind/callBound'); +var regexTester = require('safe-regex-test'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +var $trim = require('string.prototype.trim'); + +// https://262.ecma-international.org/13.0/#sec-stringtonumber + +module.exports = function StringToNumber(argument) { + if (typeof argument !== 'string') { + throw new $TypeError('Assertion failed: `argument` is not a String'); + } + if (isBinary(argument)) { + return $Number($parseInteger($strSlice(argument, 2), 2)); + } + if (isOctal(argument)) { + return $Number($parseInteger($strSlice(argument, 2), 8)); + } + if (hasNonWS(argument) || isInvalidHexLiteral(argument)) { + return NaN; + } + var trimmed = $trim(argument); + if (trimmed !== argument) { + return StringToNumber(trimmed); + } + return $Number(argument); +}; diff --git a/.pnpm-store/v3/files/12/2521c0430d8feb61343480c8fd1bad5180974126bef5b34d8ef96acba08ad59422904939e72360382ca385278f043eae07d5c8b35aee175962d07d62460e66 b/.pnpm-store/v3/files/12/2521c0430d8feb61343480c8fd1bad5180974126bef5b34d8ef96acba08ad59422904939e72360382ca385278f043eae07d5c8b35aee175962d07d62460e66 new file mode 100644 index 00000000..b981206f --- /dev/null +++ b/.pnpm-store/v3/files/12/2521c0430d8feb61343480c8fd1bad5180974126bef5b34d8ef96acba08ad59422904939e72360382ca385278f043eae07d5c8b35aee175962d07d62460e66 @@ -0,0 +1,61 @@ +import { type LanguageContext } from '@volar/language-core'; +import type * as vscode from 'vscode-languageserver-protocol'; +import type { ServiceContext, ServiceEnvironment, ServicePlugin } from './types'; +export type LanguageService = ReturnType; +export declare function createLanguageService(languageContext: LanguageContext, servicePlugins: ServicePlugin[], env: ServiceEnvironment): { + getTriggerCharacters: () => string[]; + getAutoFormatTriggerCharacters: () => string[]; + getSignatureHelpTriggerCharacters: () => string[]; + getSignatureHelpRetriggerCharacters: () => string[]; + format: (uri: string, options: vscode.FormattingOptions, range: vscode.Range | undefined, onTypeParams: { + ch: string; + position: vscode.Position; + } | undefined, token?: vscode.CancellationToken) => Promise; + getFoldingRanges: (uri: string, token?: vscode.CancellationToken) => Promise; + getSelectionRanges: (uri: string, positions: vscode.Position[], token?: vscode.CancellationToken) => Promise; + findLinkedEditingRanges: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise; + findDocumentSymbols: (uri: string, token?: vscode.CancellationToken) => Promise; + findDocumentColors: (uri: string, token?: vscode.CancellationToken) => Promise; + getColorPresentations: (uri: string, color: vscode.Color, range: vscode.Range, token?: vscode.CancellationToken) => Promise; + doValidation: (uri: string, token?: vscode.CancellationToken, response?: ((result: vscode.Diagnostic[]) => void) | undefined) => Promise; + findReferences: (uri: string, position: vscode.Position, referenceContext: vscode.ReferenceContext, token?: vscode.CancellationToken) => Promise; + findFileReferences: (uri: string, token?: vscode.CancellationToken) => import("./types").NullableResult; + findDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise; + findTypeDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise; + findImplementations: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise; + prepareRename: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise; + doRename: (uri: string, position: vscode.Position, newName: string, token?: vscode.CancellationToken) => Promise; + getEditsForFileRename: (oldUri: string, newUri: string, token?: vscode.CancellationToken) => Promise; + getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, token?: vscode.CancellationToken, _reportProgress?: ((tokens: vscode.SemanticTokens) => void) | undefined) => Promise; + doHover: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise; + doComplete: (uri: string, position: vscode.Position, completionContext?: vscode.CompletionContext, token?: vscode.CancellationToken) => Promise; + doCodeActions: (uri: string, range: vscode.Range, codeActionContext: vscode.CodeActionContext, token?: vscode.CancellationToken) => Promise; + doCodeActionResolve: (item: vscode.CodeAction, token?: vscode.CancellationToken) => Promise; + doCompletionResolve: (item: vscode.CompletionItem, token?: vscode.CancellationToken) => Promise; + getSignatureHelp: (uri: string, position: vscode.Position, signatureHelpContext?: vscode.SignatureHelpContext, token?: vscode.CancellationToken) => Promise; + doCodeLens: (uri: string, token?: vscode.CancellationToken) => Promise; + doCodeLensResolve: (item: vscode.CodeLens, token?: vscode.CancellationToken) => Promise; + findDocumentHighlights: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise; + findDocumentLinks: (uri: string, token?: vscode.CancellationToken) => Promise; + doDocumentLinkResolve: (item: vscode.DocumentLink, token?: vscode.CancellationToken) => Promise; + findWorkspaceSymbols: (query: string, token?: vscode.CancellationToken) => Promise; + doAutoInsert: (uri: string, position: vscode.Position, lastChange: { + range: vscode.Range; + text: string; + }, token?: vscode.CancellationToken) => Promise; + doDocumentDrop: (uri: string, position: vscode.Position, dataTransfer: Map, token?: vscode.CancellationToken) => Promise; + getInlayHints: (uri: string, range: vscode.Range, token?: vscode.CancellationToken) => Promise; + doInlayHintResolve: (item: vscode.InlayHint, token?: vscode.CancellationToken) => Promise; + callHierarchy: { + doPrepare(uri: string, position: vscode.Position, token?: vscode.CancellationToken): Promise; + getIncomingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise; + getOutgoingCalls(item: vscode.CallHierarchyItem, token: vscode.CancellationToken): Promise; + }; + dispose: () => void; + context: ServiceContext; +}; diff --git a/.pnpm-store/v3/files/12/283ea94be58f4a17badfd9386608c2702a5558458cdf3f18148e4f91df86c812325aa54401f83ac94161157fa55f6b1c28b0f0246776323f000cbc2e580ac6 b/.pnpm-store/v3/files/12/283ea94be58f4a17badfd9386608c2702a5558458cdf3f18148e4f91df86c812325aa54401f83ac94161157fa55f6b1c28b0f0246776323f000cbc2e580ac6 new file mode 100644 index 00000000..39664374 --- /dev/null +++ b/.pnpm-store/v3/files/12/283ea94be58f4a17badfd9386608c2702a5558458cdf3f18148e4f91df86c812325aa54401f83ac94161157fa55f6b1c28b0f0246776323f000cbc2e580ac6 @@ -0,0 +1,141 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.collectClassesAndIdsFromDocument = exports.extractStylesheets = void 0; +const utils_1 = require("@astrojs/compiler/utils"); +const language_core_1 = require("@volar/language-core"); +function extractStylesheets(snapshot, htmlDocument, ast) { + const embeddedCSSCodes = findEmbeddedStyles(snapshot, htmlDocument.roots); + const inlineStyles = findInlineStyles(ast); + if (inlineStyles.length > 0) { + const codes = []; + for (const inlineStyle of inlineStyles) { + codes.push('x { '); + codes.push([ + inlineStyle.value, + undefined, + inlineStyle.position.start.offset + 'style="'.length, + { + completion: true, + verification: false, + semantic: true, + navigation: true, + structure: true, + format: false, + }, + ]); + codes.push(' }\n'); + } + const mappings = (0, language_core_1.buildMappings)(codes); + const text = (0, language_core_1.toString)(codes); + embeddedCSSCodes.push({ + id: 'inline.css', + languageId: 'css', + snapshot: { + getText: (start, end) => text.substring(start, end), + getLength: () => text.length, + getChangeRange: () => undefined, + }, + embeddedCodes: [], + mappings, + }); + } + return embeddedCSSCodes; +} +exports.extractStylesheets = extractStylesheets; +/** + * Find all embedded styles in a document. + * Embedded styles are styles that are defined in `\n
\n
\n
\n
\n    
\n    
\n    
\n Click outside, press Esc key, or fix the code to dismiss.
\n You can also disable this overlay by setting\n server.hmr.overlay to false in ${hmrConfigName}.\n
\n
\n
\n`\n\nconst fileRE = /(?:[a-zA-Z]:\\\\|\\/).*?:\\d+:\\d+/g\nconst codeframeRE = /^(?:>?\\s*\\d+\\s+\\|.*|\\s+\\|\\s*\\^.*)\\r?\\n/gm\n\n// Allow `ErrorOverlay` to extend `HTMLElement` even in environments where\n// `HTMLElement` was not originally defined.\nconst { HTMLElement = class {} as typeof globalThis.HTMLElement } = globalThis\nexport class ErrorOverlay extends HTMLElement {\n root: ShadowRoot\n closeOnEsc: (e: KeyboardEvent) => void\n\n constructor(err: ErrorPayload['err'], links = true) {\n super()\n this.root = this.attachShadow({ mode: 'open' })\n this.root.innerHTML = template\n\n codeframeRE.lastIndex = 0\n const hasFrame = err.frame && codeframeRE.test(err.frame)\n const message = hasFrame\n ? err.message.replace(codeframeRE, '')\n : err.message\n if (err.plugin) {\n this.text('.plugin', `[plugin:${err.plugin}] `)\n }\n this.text('.message-body', message.trim())\n\n const [file] = (err.loc?.file || err.id || 'unknown file').split(`?`)\n if (err.loc) {\n this.text('.file', `${file}:${err.loc.line}:${err.loc.column}`, links)\n } else if (err.id) {\n this.text('.file', file)\n }\n\n if (hasFrame) {\n this.text('.frame', err.frame!.trim())\n }\n this.text('.stack', err.stack, links)\n\n this.root.querySelector('.window')!.addEventListener('click', (e) => {\n e.stopPropagation()\n })\n\n this.addEventListener('click', () => {\n this.close()\n })\n\n this.closeOnEsc = (e: KeyboardEvent) => {\n if (e.key === 'Escape' || e.code === 'Escape') {\n this.close()\n }\n }\n\n document.addEventListener('keydown', this.closeOnEsc)\n }\n\n text(selector: string, text: string, linkFiles = false): void {\n const el = this.root.querySelector(selector)!\n if (!linkFiles) {\n el.textContent = text\n } else {\n let curIndex = 0\n let match: RegExpExecArray | null\n fileRE.lastIndex = 0\n while ((match = fileRE.exec(text))) {\n const { 0: file, index } = match\n if (index != null) {\n const frag = text.slice(curIndex, index)\n el.appendChild(document.createTextNode(frag))\n const link = document.createElement('a')\n link.textContent = file\n link.className = 'file-link'\n link.onclick = () => {\n fetch(\n new URL(\n `${base}__open-in-editor?file=${encodeURIComponent(file)}`,\n import.meta.url,\n ),\n )\n }\n el.appendChild(link)\n curIndex += frag.length + file.length\n }\n }\n }\n }\n close(): void {\n this.parentNode?.removeChild(this)\n document.removeEventListener('keydown', this.closeOnEsc)\n }\n}\n\nexport const overlayId = 'vite-error-overlay'\nconst { customElements } = globalThis // Ensure `customElements` is defined before the next line.\nif (customElements && !customElements.get(overlayId)) {\n customElements.define(overlayId, ErrorOverlay)\n}\n","import type { ErrorPayload, HMRPayload } from 'types/hmrPayload'\nimport type { ViteHotContext } from 'types/hot'\nimport type { InferCustomEventPayload } from 'types/customEvent'\nimport { HMRClient, HMRContext } from '../shared/hmr'\nimport { ErrorOverlay, overlayId } from './overlay'\nimport '@vite/env'\n\n// injected by the hmr plugin when served\ndeclare const __BASE__: string\ndeclare const __SERVER_HOST__: string\ndeclare const __HMR_PROTOCOL__: string | null\ndeclare const __HMR_HOSTNAME__: string | null\ndeclare const __HMR_PORT__: number | null\ndeclare const __HMR_DIRECT_TARGET__: string\ndeclare const __HMR_BASE__: string\ndeclare const __HMR_TIMEOUT__: number\ndeclare const __HMR_ENABLE_OVERLAY__: boolean\n\nconsole.debug('[vite] connecting...')\n\nconst importMetaUrl = new URL(import.meta.url)\n\n// use server configuration, then fallback to inference\nconst serverHost = __SERVER_HOST__\nconst socketProtocol =\n __HMR_PROTOCOL__ || (importMetaUrl.protocol === 'https:' ? 'wss' : 'ws')\nconst hmrPort = __HMR_PORT__\nconst socketHost = `${__HMR_HOSTNAME__ || importMetaUrl.hostname}:${\n hmrPort || importMetaUrl.port\n}${__HMR_BASE__}`\nconst directSocketHost = __HMR_DIRECT_TARGET__\nconst base = __BASE__ || '/'\n\nlet socket: WebSocket\ntry {\n let fallback: (() => void) | undefined\n // only use fallback when port is inferred to prevent confusion\n if (!hmrPort) {\n fallback = () => {\n // fallback to connecting directly to the hmr server\n // for servers which does not support proxying websocket\n socket = setupWebSocket(socketProtocol, directSocketHost, () => {\n const currentScriptHostURL = new URL(import.meta.url)\n const currentScriptHost =\n currentScriptHostURL.host +\n currentScriptHostURL.pathname.replace(/@vite\\/client$/, '')\n console.error(\n '[vite] failed to connect to websocket.\\n' +\n 'your current setup:\\n' +\n ` (browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)\\n` +\n ` (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)\\n` +\n 'Check out your Vite / network configuration and https://vitejs.dev/config/server-options.html#server-hmr .',\n )\n })\n socket.addEventListener(\n 'open',\n () => {\n console.info(\n '[vite] Direct websocket connection fallback. Check out https://vitejs.dev/config/server-options.html#server-hmr to remove the previous connection error.',\n )\n },\n { once: true },\n )\n }\n }\n\n socket = setupWebSocket(socketProtocol, socketHost, fallback)\n} catch (error) {\n console.error(`[vite] failed to connect to websocket (${error}). `)\n}\n\nfunction setupWebSocket(\n protocol: string,\n hostAndPath: string,\n onCloseWithoutOpen?: () => void,\n) {\n const socket = new WebSocket(`${protocol}://${hostAndPath}`, 'vite-hmr')\n let isOpened = false\n\n socket.addEventListener(\n 'open',\n () => {\n isOpened = true\n notifyListeners('vite:ws:connect', { webSocket: socket })\n },\n { once: true },\n )\n\n // Listen for messages\n socket.addEventListener('message', async ({ data }) => {\n handleMessage(JSON.parse(data))\n })\n\n // ping server\n socket.addEventListener('close', async ({ wasClean }) => {\n if (wasClean) return\n\n if (!isOpened && onCloseWithoutOpen) {\n onCloseWithoutOpen()\n return\n }\n\n notifyListeners('vite:ws:disconnect', { webSocket: socket })\n\n console.log(`[vite] server connection lost. polling for restart...`)\n await waitForSuccessfulPing(protocol, hostAndPath)\n location.reload()\n })\n\n return socket\n}\n\nfunction cleanUrl(pathname: string): string {\n const url = new URL(pathname, location.toString())\n url.searchParams.delete('direct')\n return url.pathname + url.search\n}\n\nlet isFirstUpdate = true\nconst outdatedLinkTags = new WeakSet()\n\nconst debounceReload = (time: number) => {\n let timer: ReturnType | null\n return () => {\n if (timer) {\n clearTimeout(timer)\n timer = null\n }\n timer = setTimeout(() => {\n location.reload()\n }, time)\n }\n}\nconst pageReload = debounceReload(50)\n\nconst hmrClient = new HMRClient(\n console,\n {\n isReady: () => socket && socket.readyState === 1,\n send: (message) => socket.send(message),\n },\n async function importUpdatedModule({\n acceptedPath,\n timestamp,\n explicitImportRequired,\n isWithinCircularImport,\n }) {\n const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`)\n const importPromise = import(\n /* @vite-ignore */\n base +\n acceptedPathWithoutQuery.slice(1) +\n `?${explicitImportRequired ? 'import&' : ''}t=${timestamp}${\n query ? `&${query}` : ''\n }`\n )\n if (isWithinCircularImport) {\n importPromise.catch(() => {\n console.info(\n `[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. ` +\n `To debug and break the circular import, you can run \\`vite --debug hmr\\` to log the circular dependency path if a file change triggered it.`,\n )\n pageReload()\n })\n }\n return await importPromise\n },\n)\n\nasync function handleMessage(payload: HMRPayload) {\n switch (payload.type) {\n case 'connected':\n console.debug(`[vite] connected.`)\n hmrClient.messenger.flush()\n // proxy(nginx, docker) hmr ws maybe caused timeout,\n // so send ping package let ws keep alive.\n setInterval(() => {\n if (socket.readyState === socket.OPEN) {\n socket.send('{\"type\":\"ping\"}')\n }\n }, __HMR_TIMEOUT__)\n break\n case 'update':\n notifyListeners('vite:beforeUpdate', payload)\n // if this is the first update and there's already an error overlay, it\n // means the page opened with existing server compile error and the whole\n // module script failed to load (since one of the nested imports is 500).\n // in this case a normal update won't work and a full reload is needed.\n if (isFirstUpdate && hasErrorOverlay()) {\n window.location.reload()\n return\n } else {\n clearErrorOverlay()\n isFirstUpdate = false\n }\n await Promise.all(\n payload.updates.map(async (update): Promise => {\n if (update.type === 'js-update') {\n return hmrClient.queueUpdate(update)\n }\n\n // css-update\n // this is only sent when a css file referenced with is updated\n const { path, timestamp } = update\n const searchUrl = cleanUrl(path)\n // can't use querySelector with `[href*=]` here since the link may be\n // using relative paths so we need to use link.href to grab the full\n // URL for the include check.\n const el = Array.from(\n document.querySelectorAll('link'),\n ).find(\n (e) =>\n !outdatedLinkTags.has(e) && cleanUrl(e.href).includes(searchUrl),\n )\n\n if (!el) {\n return\n }\n\n const newPath = `${base}${searchUrl.slice(1)}${\n searchUrl.includes('?') ? '&' : '?'\n }t=${timestamp}`\n\n // rather than swapping the href on the existing tag, we will\n // create a new link tag. Once the new stylesheet has loaded we\n // will remove the existing link tag. This removes a Flash Of\n // Unstyled Content that can occur when swapping out the tag href\n // directly, as the new stylesheet has not yet been loaded.\n return new Promise((resolve) => {\n const newLinkTag = el.cloneNode() as HTMLLinkElement\n newLinkTag.href = new URL(newPath, el.href).href\n const removeOldEl = () => {\n el.remove()\n console.debug(`[vite] css hot updated: ${searchUrl}`)\n resolve()\n }\n newLinkTag.addEventListener('load', removeOldEl)\n newLinkTag.addEventListener('error', removeOldEl)\n outdatedLinkTags.add(el)\n el.after(newLinkTag)\n })\n }),\n )\n notifyListeners('vite:afterUpdate', payload)\n break\n case 'custom': {\n notifyListeners(payload.event, payload.data)\n break\n }\n case 'full-reload':\n notifyListeners('vite:beforeFullReload', payload)\n if (payload.path && payload.path.endsWith('.html')) {\n // if html file is edited, only reload the page if the browser is\n // currently on that page.\n const pagePath = decodeURI(location.pathname)\n const payloadPath = base + payload.path.slice(1)\n if (\n pagePath === payloadPath ||\n payload.path === '/index.html' ||\n (pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath)\n ) {\n pageReload()\n }\n return\n } else {\n pageReload()\n }\n break\n case 'prune':\n notifyListeners('vite:beforePrune', payload)\n hmrClient.prunePaths(payload.paths)\n break\n case 'error': {\n notifyListeners('vite:error', payload)\n const err = payload.err\n if (enableOverlay) {\n createErrorOverlay(err)\n } else {\n console.error(\n `[vite] Internal Server Error\\n${err.message}\\n${err.stack}`,\n )\n }\n break\n }\n default: {\n const check: never = payload\n return check\n }\n }\n}\n\nfunction notifyListeners(\n event: T,\n data: InferCustomEventPayload,\n): void\nfunction notifyListeners(event: string, data: any): void {\n hmrClient.notifyListeners(event, data)\n}\n\nconst enableOverlay = __HMR_ENABLE_OVERLAY__\n\nfunction createErrorOverlay(err: ErrorPayload['err']) {\n clearErrorOverlay()\n document.body.appendChild(new ErrorOverlay(err))\n}\n\nfunction clearErrorOverlay() {\n document.querySelectorAll(overlayId).forEach((n) => n.close())\n}\n\nfunction hasErrorOverlay() {\n return document.querySelectorAll(overlayId).length\n}\n\nasync function waitForSuccessfulPing(\n socketProtocol: string,\n hostAndPath: string,\n ms = 1000,\n) {\n const pingHostProtocol = socketProtocol === 'wss' ? 'https' : 'http'\n\n const ping = async () => {\n // A fetch on a websocket URL will return a successful promise with status 400,\n // but will reject a networking error.\n // When running on middleware mode, it returns status 426, and an cors error happens if mode is not no-cors\n try {\n await fetch(`${pingHostProtocol}://${hostAndPath}`, {\n mode: 'no-cors',\n headers: {\n // Custom headers won't be included in a request with no-cors so (ab)use one of the\n // safelisted headers to identify the ping request\n Accept: 'text/x-vite-ping',\n },\n })\n return true\n } catch {}\n return false\n }\n\n if (await ping()) {\n return\n }\n await wait(ms)\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (document.visibilityState === 'visible') {\n if (await ping()) {\n break\n }\n await wait(ms)\n } else {\n await waitForWindowShow()\n }\n }\n}\n\nfunction wait(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nfunction waitForWindowShow() {\n return new Promise((resolve) => {\n const onChange = async () => {\n if (document.visibilityState === 'visible') {\n resolve()\n document.removeEventListener('visibilitychange', onChange)\n }\n }\n document.addEventListener('visibilitychange', onChange)\n })\n}\n\nconst sheetsMap = new Map()\n\n// collect existing style elements that may have been inserted during SSR\n// to avoid FOUC or duplicate styles\nif ('document' in globalThis) {\n document\n .querySelectorAll('style[data-vite-dev-id]')\n .forEach((el) => {\n sheetsMap.set(el.getAttribute('data-vite-dev-id')!, el)\n })\n}\n\n// all css imports should be inserted at the same position\n// because after build it will be a single css file\nlet lastInsertedStyle: HTMLStyleElement | undefined\n\nexport function updateStyle(id: string, content: string): void {\n let style = sheetsMap.get(id)\n if (!style) {\n style = document.createElement('style')\n style.setAttribute('type', 'text/css')\n style.setAttribute('data-vite-dev-id', id)\n style.textContent = content\n\n if (!lastInsertedStyle) {\n document.head.appendChild(style)\n\n // reset lastInsertedStyle after async\n // because dynamically imported css will be splitted into a different file\n setTimeout(() => {\n lastInsertedStyle = undefined\n }, 0)\n } else {\n lastInsertedStyle.insertAdjacentElement('afterend', style)\n }\n lastInsertedStyle = style\n } else {\n style.textContent = content\n }\n sheetsMap.set(id, style)\n}\n\nexport function removeStyle(id: string): void {\n const style = sheetsMap.get(id)\n if (style) {\n document.head.removeChild(style)\n sheetsMap.delete(id)\n }\n}\n\nexport function createHotContext(ownerPath: string): ViteHotContext {\n return new HMRContext(hmrClient, ownerPath)\n}\n\n/**\n * urls here are dynamic import() urls that couldn't be statically analyzed\n */\nexport function injectQuery(url: string, queryToInject: string): string {\n // skip urls that won't be handled by vite\n if (url[0] !== '.' && url[0] !== '/') {\n return url\n }\n\n // can't use pathname from URL since it may be relative like ../\n const pathname = url.replace(/[?#].*$/s, '')\n const { search, hash } = new URL(url, 'http://vitejs.dev')\n\n return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${\n hash || ''\n }`\n}\n\nexport { ErrorOverlay }\n"],"names":["base"],"mappings":"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","x_google_ignoreList":[0,1,2]} \ No newline at end of file diff --git a/.pnpm-store/v3/files/5d/f225d9d7b3a0f43edf5f8b95148ceabdc763c0480cfd65d5ed92da00e77b1d035b26993fdd067a36c011c5ae2f779487b41be5de5eb790fa24e6e8599326e2 b/.pnpm-store/v3/files/5d/f225d9d7b3a0f43edf5f8b95148ceabdc763c0480cfd65d5ed92da00e77b1d035b26993fdd067a36c011c5ae2f779487b41be5de5eb790fa24e6e8599326e2 new file mode 100644 index 00000000..4975f432 --- /dev/null +++ b/.pnpm-store/v3/files/5d/f225d9d7b3a0f43edf5f8b95148ceabdc763c0480cfd65d5ed92da00e77b1d035b26993fdd067a36c011c5ae2f779487b41be5de5eb790fa24e6e8599326e2 @@ -0,0 +1,4867 @@ +/* + @license + Rollup.js v4.10.0 + Sat, 10 Feb 2024 05:58:12 GMT - commit 762420860765e8e46e24d48b38f5b98ca31735fa + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +import { resolve } from 'node:path'; +import process$1 from 'node:process'; +import { picomatch as picomatch$2, getAugmentedNamespace, fseventsImporter, createFilter, rollupInternal } from './node-entry.js'; +import { platform } from 'node:os'; +import require$$0$1 from 'fs'; +import require$$2 from 'util'; +import require$$1 from 'stream'; +import require$$0$2 from 'path'; +import require$$2$1 from 'os'; +import require$$0$3 from 'events'; +import './parseAst.js'; +import '../../native.js'; +import 'node:perf_hooks'; +import 'node:fs/promises'; +import 'tty'; + +var chokidar = {}; + +const fs$3 = require$$0$1; +const { Readable } = require$$1; +const sysPath$3 = require$$0$2; +const { promisify: promisify$3 } = require$$2; +const picomatch$1 = picomatch$2; + +const readdir$1 = promisify$3(fs$3.readdir); +const stat$3 = promisify$3(fs$3.stat); +const lstat$2 = promisify$3(fs$3.lstat); +const realpath$1 = promisify$3(fs$3.realpath); + +/** + * @typedef {Object} EntryInfo + * @property {String} path + * @property {String} fullPath + * @property {fs.Stats=} stats + * @property {fs.Dirent=} dirent + * @property {String} basename + */ + +const BANG$2 = '!'; +const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; +const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); +const FILE_TYPE = 'files'; +const DIR_TYPE = 'directories'; +const FILE_DIR_TYPE = 'files_directories'; +const EVERYTHING_TYPE = 'all'; +const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; + +const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); +const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); +const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); + +const normalizeFilter = filter => { + if (filter === undefined) return; + if (typeof filter === 'function') return filter; + + if (typeof filter === 'string') { + const glob = picomatch$1(filter.trim()); + return entry => glob(entry.basename); + } + + if (Array.isArray(filter)) { + const positive = []; + const negative = []; + for (const item of filter) { + const trimmed = item.trim(); + if (trimmed.charAt(0) === BANG$2) { + negative.push(picomatch$1(trimmed.slice(1))); + } else { + positive.push(picomatch$1(trimmed)); + } + } + + if (negative.length > 0) { + if (positive.length > 0) { + return entry => + positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); + } + return entry => !negative.some(f => f(entry.basename)); + } + return entry => positive.some(f => f(entry.basename)); + } +}; + +class ReaddirpStream extends Readable { + static get defaultOptions() { + return { + root: '.', + /* eslint-disable no-unused-vars */ + fileFilter: (path) => true, + directoryFilter: (path) => true, + /* eslint-enable no-unused-vars */ + type: FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false + }; + } + + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark || 4096 + }); + const opts = { ...ReaddirpStream.defaultOptions, ...options }; + const { root, type } = opts; + + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + + const statMethod = opts.lstat ? lstat$2 : stat$3; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = path => statMethod(path, { bigint: true }); + } else { + this._stat = statMethod; + } + + this._maxDepth = opts.depth; + this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsEverything = type === EVERYTHING_TYPE; + this._root = sysPath$3.resolve(root); + this._isDirent = ('Dirent' in fs$3) && !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + + async _read(batch) { + if (this.reading) return; + this.reading = true; + + try { + while (!this.destroyed && batch > 0) { + const { path, depth, files = [] } = this.parent || {}; + + if (files.length > 0) { + const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); + for (const entry of await Promise.all(slice)) { + if (this.destroyed) return; + + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + + if (this._wantsDir) { + this.push(entry); + batch--; + } + } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) return; + } + } + } catch (error) { + this.destroy(error); + } finally { + this.reading = false; + } + } + + async _exploreDir(path, depth) { + let files; + try { + files = await readdir$1(path, this._rdOptions); + } catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + + async _formatEntry(dirent, path) { + let entry; + try { + const basename = this._isDirent ? dirent.name : dirent; + const fullPath = sysPath$3.resolve(sysPath$3.join(path, basename)); + entry = { path: sysPath$3.relative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } catch (err) { + this._onError(err); + } + return entry; + } + + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } else { + this.destroy(err); + } + } + + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + const stats = entry && entry[this._statsProp]; + if (!stats) { + return; + } + if (stats.isFile()) { + return 'file'; + } + if (stats.isDirectory()) { + return 'directory'; + } + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath$1(full); + const entryRealPathStats = await lstat$2(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath$3.sep) { + const recursiveError = new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + ); + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } catch (error) { + this._onError(error); + } + } + } + + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + + return stats && this._wantsEverything && !stats.isDirectory(); + } +} + +/** + * @typedef {Object} ReaddirpArguments + * @property {Function=} fileFilter + * @property {Function=} directoryFilter + * @property {String=} type + * @property {Number=} depth + * @property {String=} root + * @property {Boolean=} lstat + * @property {Boolean=} bigint + */ + +/** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param {String} root Root directory + * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth + */ +const readdirp$1 = (root, options = {}) => { + let type = options.entryType || options.type; + if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility + if (type) options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + + options.root = root; + return new ReaddirpStream(options); +}; + +const readdirpPromise = (root, options = {}) => { + return new Promise((resolve, reject) => { + const files = []; + readdirp$1(root, options) + .on('data', entry => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', error => reject(error)); + }); +}; + +readdirp$1.promise = readdirpPromise; +readdirp$1.ReaddirpStream = ReaddirpStream; +readdirp$1.default = readdirp$1; + +var readdirp_1 = readdirp$1; + +var anymatch$2 = {exports: {}}; + +/*! + * normalize-path + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +var normalizePath$2 = function(path, stripTrailing) { + if (typeof path !== 'string') { + throw new TypeError('expected path to be a string'); + } + + if (path === '\\' || path === '/') return '/'; + + var len = path.length; + if (len <= 1) return path; + + // ensure that win32 namespaces has two leading slashes, so that the path is + // handled properly by the win32 version of path.parse() after being normalized + // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + var prefix = ''; + if (len > 4 && path[3] === '\\') { + var ch = path[2]; + if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { + path = path.slice(2); + prefix = '//'; + } + } + + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); + } + return prefix + segs.join('/'); +}; + +var anymatch_1 = anymatch$2.exports; + +Object.defineProperty(anymatch_1, "__esModule", { value: true }); + +const picomatch = picomatch$2; +const normalizePath$1 = normalizePath$2; + +/** + * @typedef {(testString: string) => boolean} AnymatchFn + * @typedef {string|RegExp|AnymatchFn} AnymatchPattern + * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher + */ +const BANG$1 = '!'; +const DEFAULT_OPTIONS = {returnIndex: false}; +const arrify$1 = (item) => Array.isArray(item) ? item : [item]; + +/** + * @param {AnymatchPattern} matcher + * @param {object} options + * @returns {AnymatchFn} + */ +const createPattern = (matcher, options) => { + if (typeof matcher === 'function') { + return matcher; + } + if (typeof matcher === 'string') { + const glob = picomatch(matcher, options); + return (string) => matcher === string || glob(string); + } + if (matcher instanceof RegExp) { + return (string) => matcher.test(string); + } + return (string) => false; +}; + +/** + * @param {Array} patterns + * @param {Array} negPatterns + * @param {String|Array} args + * @param {Boolean} returnIndex + * @returns {boolean|number} + */ +const matchPatterns = (patterns, negPatterns, args, returnIndex) => { + const isList = Array.isArray(args); + const _path = isList ? args[0] : args; + if (!isList && typeof _path !== 'string') { + throw new TypeError('anymatch: second argument must be a string: got ' + + Object.prototype.toString.call(_path)) + } + const path = normalizePath$1(_path, false); + + for (let index = 0; index < negPatterns.length; index++) { + const nglob = negPatterns[index]; + if (nglob(path)) { + return returnIndex ? -1 : false; + } + } + + const applied = isList && [path].concat(args.slice(1)); + for (let index = 0; index < patterns.length; index++) { + const pattern = patterns[index]; + if (isList ? pattern(...applied) : pattern(path)) { + return returnIndex ? index : true; + } + } + + return returnIndex ? -1 : false; +}; + +/** + * @param {AnymatchMatcher} matchers + * @param {Array|string} testString + * @param {object} options + * @returns {boolean|number|Function} + */ +const anymatch$1 = (matchers, testString, options = DEFAULT_OPTIONS) => { + if (matchers == null) { + throw new TypeError('anymatch: specify first argument'); + } + const opts = typeof options === 'boolean' ? {returnIndex: options} : options; + const returnIndex = opts.returnIndex || false; + + // Early cache for matchers. + const mtchers = arrify$1(matchers); + const negatedGlobs = mtchers + .filter(item => typeof item === 'string' && item.charAt(0) === BANG$1) + .map(item => item.slice(1)) + .map(item => picomatch(item, opts)); + const patterns = mtchers + .filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG$1)) + .map(matcher => createPattern(matcher, opts)); + + if (testString == null) { + return (testString, ri = false) => { + const returnIndex = typeof ri === 'boolean' ? ri : false; + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); + } + } + + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); +}; + +anymatch$1.default = anymatch$1; +anymatch$2.exports = anymatch$1; + +var anymatchExports = anymatch$2.exports; + +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob$1 = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; + +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = isExtglob$1; +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var isGlob$2 = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); +}; + +var isGlob$1 = isGlob$2; +var pathPosixDirname = require$$0$2.posix.dirname; +var isWin32 = require$$2$1.platform() === 'win32'; + +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ +var globParent$1 = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob$1(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; + +var utils$3 = {}; + +(function (exports) { + + exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; + }; + + /** + * Find a node of the given type + */ + + exports.find = (node, type) => node.nodes.find(node => node.type === type); + + /** + * Find a node of the given type + */ + + exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; + }; + + /** + * Escape the given node with '\\' before node.value + */ + + exports.escapeNode = (block, n = 0, type) => { + let node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } + }; + + /** + * Returns true if the given brace node should be enclosed in literal braces + */ + + exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a brace node is invalid. + */ + + exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a node is an open or close node + */ + + exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; + }; + + /** + * Reduce an array of text nodes. + */ + + exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; + }, []); + + /** + * Flatten an array + */ + + exports.flatten = (...args) => { + const result = []; + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + let ele = arr[i]; + Array.isArray(ele) ? flat(ele) : ele !== void 0 && result.push(ele); + } + return result; + }; + flat(args); + return result; + }; +} (utils$3)); + +const utils$2 = utils$3; + +var stringify$4 = (ast, options = {}) => { + let stringify = (node, parent = {}) => { + let invalidBlock = options.escapeInvalid && utils$2.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; + + if (node.value) { + if ((invalidBlock || invalidNode) && utils$2.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } + + if (node.value) { + return node.value; + } + + if (node.nodes) { + for (let child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); +}; + +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ + +var isNumber$2 = function(num) { + if (typeof num === 'number') { + return num - num === 0; + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; +}; + +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + +const isNumber$1 = isNumber$2; + +const toRegexRange$1 = (min, max, options) => { + if (isNumber$1(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); + } + + if (max === void 0 || min === max) { + return String(min); + } + + if (isNumber$1(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); + } + + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; + } + + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + + if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) { + return toRegexRange$1.cache[cacheKey].result; + } + + let a = Math.min(min, max); + let b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives); + + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; + } + + toRegexRange$1.cache[cacheKey] = state; + return state.result; +}; + +function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false) || []; + let onlyPositive = filterPatterns(pos, neg, '', false) || []; + let intersected = filterPatterns(neg, pos, '-?', true) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); +} + +function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops = [...stops]; + stops.sort(compare); + return stops; +} + +/** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + +function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; + + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit); + + } else { + count++; + } + } + + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } + + return { pattern, count: [count], digits }; +} + +function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(max, tok, options); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } + + return tokens; +} + +function filterPatterns(arr, comparison, prefix, intersection, options) { + let result = []; + + for (let ele of arr) { + let { string } = ele; + + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } + + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); + } + } + return result; +} + +/** + * Zip strings + */ + +function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; +} + +function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; +} + +function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); +} + +function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); +} + +function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); +} + +function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; +} + +function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; +} + +function hasPadding(str) { + return /^-?(0+)\d/.test(str); +} + +function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } + + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; + + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } +} + +/** + * Cache + */ + +toRegexRange$1.cache = {}; +toRegexRange$1.clearCache = () => (toRegexRange$1.cache = {}); + +/** + * Expose `toRegexRange` + */ + +var toRegexRange_1 = toRegexRange$1; + +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + +const util = require$$2; +const toRegexRange = toRegexRange_1; + +const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + +const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); +}; + +const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); +}; + +const isNumber = num => Number.isInteger(+num); + +const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; +}; + +const stringify$3 = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; + } + return options.stringify === true; +}; + +const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); + } + if (toNumber === false) { + return String(input); + } + return input; +}; + +const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; +}; + +const toSequence = (parts, options) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; + + if (parts.positives.length) { + positives = parts.positives.join('|'); + } + + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.join('|')})`; + } + + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } + + if (options.wrap) { + return `(${prefix}${result})`; + } + + return result; +}; + +const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); + } + + let start = String.fromCharCode(a); + if (a === b) return start; + + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; +}; + +const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); + } + return toRegexRange(start, end, options); +}; + +const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util.inspect(...args)); +}; + +const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; +}; + +const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; +}; + +const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); + + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } + + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; + + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); + + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify$3(start, end, options) === false; + let format = options.transform || transform(toNumber); + + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + } + + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options) + : toRegex(range, null, { wrap: false, ...options }); + } + + return range; +}; + +const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } + + + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); + + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } + + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } + + return range; +}; + +const fill$2 = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); + } + + if (typeof step === 'function') { + return fill$2(start, end, 1, { transform: step }); + } + + if (isObject(step)) { + return fill$2(start, end, 0, step); + } + + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill$2(start, end, 1, step); + } + + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); +}; + +var fillRange = fill$2; + +const fill$1 = fillRange; +const utils$1 = utils$3; + +const compile$1 = (ast, options = {}) => { + let walk = (node, parent = {}) => { + let invalidBlock = utils$1.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let invalid = invalidBlock === true || invalidNode === true; + let prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + if (node.isClose === true) { + return prefix + node.value; + } + + if (node.type === 'open') { + return invalid ? (prefix + node.value) : '('; + } + + if (node.type === 'close') { + return invalid ? (prefix + node.value) : ')'; + } + + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); + } + + if (node.value) { + return node.value; + } + + if (node.nodes && node.ranges > 0) { + let args = utils$1.reduce(node.nodes); + let range = fill$1(...args, { ...options, wrap: false, toRegex: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (let child of node.nodes) { + output += walk(child, node); + } + } + return output; + }; + + return walk(ast); +}; + +var compile_1 = compile$1; + +const fill = fillRange; +const stringify$2 = stringify$4; +const utils = utils$3; + +const append = (queue = '', stash = '', enclose = false) => { + let result = []; + + queue = [].concat(queue); + stash = [].concat(stash); + + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; + } + + for (let item of queue) { + if (Array.isArray(item)) { + for (let value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele)); + } + } + } + return utils.flatten(result); +}; + +const expand$1 = (ast, options = {}) => { + let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; + + let walk = (node, parent = {}) => { + node.queue = []; + + let p = parent; + let q = parent.queue; + + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } + + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify$2(node, options))); + return; + } + + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ['{}'])); + return; + } + + if (node.nodes && node.ranges > 0) { + let args = utils.reduce(node.nodes); + + if (utils.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } + + let range = fill(...args, options); + if (range.length === 0) { + range = stringify$2(node, options); + } + + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } + + let enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; + + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } + + for (let i = 0; i < node.nodes.length; i++) { + let child = node.nodes[i]; + + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } + + if (child.type === 'close') { + q.push(append(q.pop(), queue, enclose)); + continue; + } + + if (child.value && child.type !== 'open') { + queue.push(append(queue.pop(), child.value)); + continue; + } + + if (child.nodes) { + walk(child, node); + } + } + + return queue; + }; + + return utils.flatten(walk(ast)); +}; + +var expand_1 = expand$1; + +var constants$1 = { + MAX_LENGTH: 1024 * 64, + + // Digits + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ + + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ + + CHAR_ASTERISK: '*', /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ +}; + +const stringify$1 = stringify$4; + +/** + * Constants + */ + +const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE +} = constants$1; + +/** + * parse + */ + +const parse$1 = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + let opts = options || {}; + let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + let ast = { type: 'root', input, nodes: [] }; + let stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + let length = input.length; + let index = 0; + let depth = 0; + let value; + + /** + * Helpers + */ + + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } + + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + + push({ type: 'bos' }); + + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); + + /** + * Invalid chars + */ + + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + + /** + * Escaped chars + */ + + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } + + /** + * Right square bracket (literal): ']' + */ + + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } + + /** + * Left square bracket: '[' + */ + + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + let next; + + while (index < length && (next = advance())) { + value += next; + + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + + if (brackets === 0) { + break; + } + } + } + + push({ type: 'text', value }); + continue; + } + + /** + * Parentheses + */ + + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } + + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } + + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + let open = value; + let next; + + if (options.keepQuotes !== true) { + value = ''; + } + + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + + value += next; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Left curly brace: '{' + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + + let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + let brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } + + /** + * Right curly brace: '}' + */ + + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } + + let type = 'close'; + block = stack.pop(); + block.close = true; + + push({ type, value }); + depth--; + + block = stack[stack.length - 1]; + continue; + } + + /** + * Comma: ',' + */ + + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + let open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify$1(block) }]; + } + + push({ type: 'comma', value }); + block.commas++; + continue; + } + + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + let siblings = block.nodes; + + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } + + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; + + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } + + block.ranges++; + block.args = []; + continue; + } + + if (prev.type === 'range') { + siblings.pop(); + + let before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + + push({ type: 'dot', value }); + continue; + } + + /** + * Text + */ + + push({ type: 'text', value }); + } + + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); + + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + + // get the location of the block on parent.nodes (block's siblings) + let parent = stack[stack.length - 1]; + let index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + + push({ type: 'eos' }); + return ast; +}; + +var parse_1 = parse$1; + +const stringify = stringify$4; +const compile = compile_1; +const expand = expand_1; +const parse = parse_1; + +/** + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + +const braces$1 = (input, options = {}) => { + let output = []; + + if (Array.isArray(input)) { + for (let pattern of input) { + let result = braces$1.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces$1.create(input, options)); + } + + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; + } + return output; +}; + +/** + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public + */ + +braces$1.parse = (input, options = {}) => parse(input, options); + +/** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces$1.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify(braces$1.parse(input, options), options); + } + return stringify(input, options); +}; + +/** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. + * + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces$1.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces$1.parse(input, options); + } + return compile(input, options); +}; + +/** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. + * + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces$1.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces$1.parse(input, options); + } + + let result = expand(input, options); + + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); + } + + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; + } + + return result; +}; + +/** + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces$1.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } + + return options.expand !== true + ? braces$1.compile(input, options) + : braces$1.expand(input, options); +}; + +/** + * Expose "braces" + */ + +var braces_1 = braces$1; + +const require$$0 = [ + "3dm", + "3ds", + "3g2", + "3gp", + "7z", + "a", + "aac", + "adp", + "ai", + "aif", + "aiff", + "alz", + "ape", + "apk", + "appimage", + "ar", + "arj", + "asf", + "au", + "avi", + "bak", + "baml", + "bh", + "bin", + "bk", + "bmp", + "btif", + "bz2", + "bzip2", + "cab", + "caf", + "cgm", + "class", + "cmx", + "cpio", + "cr2", + "cur", + "dat", + "dcm", + "deb", + "dex", + "djvu", + "dll", + "dmg", + "dng", + "doc", + "docm", + "docx", + "dot", + "dotm", + "dra", + "DS_Store", + "dsk", + "dts", + "dtshd", + "dvb", + "dwg", + "dxf", + "ecelp4800", + "ecelp7470", + "ecelp9600", + "egg", + "eol", + "eot", + "epub", + "exe", + "f4v", + "fbs", + "fh", + "fla", + "flac", + "flatpak", + "fli", + "flv", + "fpx", + "fst", + "fvt", + "g3", + "gh", + "gif", + "graffle", + "gz", + "gzip", + "h261", + "h263", + "h264", + "icns", + "ico", + "ief", + "img", + "ipa", + "iso", + "jar", + "jpeg", + "jpg", + "jpgv", + "jpm", + "jxr", + "key", + "ktx", + "lha", + "lib", + "lvp", + "lz", + "lzh", + "lzma", + "lzo", + "m3u", + "m4a", + "m4v", + "mar", + "mdi", + "mht", + "mid", + "midi", + "mj2", + "mka", + "mkv", + "mmr", + "mng", + "mobi", + "mov", + "movie", + "mp3", + "mp4", + "mp4a", + "mpeg", + "mpg", + "mpga", + "mxu", + "nef", + "npx", + "numbers", + "nupkg", + "o", + "odp", + "ods", + "odt", + "oga", + "ogg", + "ogv", + "otf", + "ott", + "pages", + "pbm", + "pcx", + "pdb", + "pdf", + "pea", + "pgm", + "pic", + "png", + "pnm", + "pot", + "potm", + "potx", + "ppa", + "ppam", + "ppm", + "pps", + "ppsm", + "ppsx", + "ppt", + "pptm", + "pptx", + "psd", + "pya", + "pyc", + "pyo", + "pyv", + "qt", + "rar", + "ras", + "raw", + "resources", + "rgb", + "rip", + "rlc", + "rmf", + "rmvb", + "rpm", + "rtf", + "rz", + "s3m", + "s7z", + "scpt", + "sgi", + "shar", + "snap", + "sil", + "sketch", + "slk", + "smv", + "snk", + "so", + "stl", + "suo", + "sub", + "swf", + "tar", + "tbz", + "tbz2", + "tga", + "tgz", + "thmx", + "tif", + "tiff", + "tlz", + "ttc", + "ttf", + "txz", + "udf", + "uvh", + "uvi", + "uvm", + "uvp", + "uvs", + "uvu", + "viv", + "vob", + "war", + "wav", + "wax", + "wbmp", + "wdp", + "weba", + "webm", + "webp", + "whl", + "wim", + "wm", + "wma", + "wmv", + "wmx", + "woff", + "woff2", + "wrm", + "wvx", + "xbm", + "xif", + "xla", + "xlam", + "xls", + "xlsb", + "xlsm", + "xlsx", + "xlt", + "xltm", + "xltx", + "xm", + "xmind", + "xpi", + "xpm", + "xwd", + "xz", + "z", + "zip", + "zipx" +]; + +var binaryExtensions$1 = require$$0; + +const path = require$$0$2; +const binaryExtensions = binaryExtensions$1; + +const extensions = new Set(binaryExtensions); + +var isBinaryPath$1 = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); + +var constants = {}; + +(function (exports) { + + const {sep} = require$$0$2; + const {platform} = process; + const os = require$$2$1; + + exports.EV_ALL = 'all'; + exports.EV_READY = 'ready'; + exports.EV_ADD = 'add'; + exports.EV_CHANGE = 'change'; + exports.EV_ADD_DIR = 'addDir'; + exports.EV_UNLINK = 'unlink'; + exports.EV_UNLINK_DIR = 'unlinkDir'; + exports.EV_RAW = 'raw'; + exports.EV_ERROR = 'error'; + + exports.STR_DATA = 'data'; + exports.STR_END = 'end'; + exports.STR_CLOSE = 'close'; + + exports.FSEVENT_CREATED = 'created'; + exports.FSEVENT_MODIFIED = 'modified'; + exports.FSEVENT_DELETED = 'deleted'; + exports.FSEVENT_MOVED = 'moved'; + exports.FSEVENT_CLONED = 'cloned'; + exports.FSEVENT_UNKNOWN = 'unknown'; + exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1; + exports.FSEVENT_TYPE_FILE = 'file'; + exports.FSEVENT_TYPE_DIRECTORY = 'directory'; + exports.FSEVENT_TYPE_SYMLINK = 'symlink'; + + exports.KEY_LISTENERS = 'listeners'; + exports.KEY_ERR = 'errHandlers'; + exports.KEY_RAW = 'rawEmitters'; + exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW]; + + exports.DOT_SLASH = `.${sep}`; + + exports.BACK_SLASH_RE = /\\/g; + exports.DOUBLE_SLASH_RE = /\/\//; + exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/; + exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; + exports.REPLACER_RE = /^\.[/\\]/; + + exports.SLASH = '/'; + exports.SLASH_SLASH = '//'; + exports.BRACE_START = '{'; + exports.BANG = '!'; + exports.ONE_DOT = '.'; + exports.TWO_DOTS = '..'; + exports.STAR = '*'; + exports.GLOBSTAR = '**'; + exports.ROOT_GLOBSTAR = '/**/*'; + exports.SLASH_GLOBSTAR = '/**'; + exports.DIR_SUFFIX = 'Dir'; + exports.ANYMATCH_OPTS = {dot: true}; + exports.STRING_TYPE = 'string'; + exports.FUNCTION_TYPE = 'function'; + exports.EMPTY_STR = ''; + exports.EMPTY_FN = () => {}; + exports.IDENTITY_FN = val => val; + + exports.isWindows = platform === 'win32'; + exports.isMacos = platform === 'darwin'; + exports.isLinux = platform === 'linux'; + exports.isIBMi = os.type() === 'OS400'; +} (constants)); + +const fs$2 = require$$0$1; +const sysPath$2 = require$$0$2; +const { promisify: promisify$2 } = require$$2; +const isBinaryPath = isBinaryPath$1; +const { + isWindows: isWindows$1, + isLinux, + EMPTY_FN: EMPTY_FN$2, + EMPTY_STR: EMPTY_STR$1, + KEY_LISTENERS, + KEY_ERR, + KEY_RAW, + HANDLER_KEYS, + EV_CHANGE: EV_CHANGE$2, + EV_ADD: EV_ADD$2, + EV_ADD_DIR: EV_ADD_DIR$2, + EV_ERROR: EV_ERROR$2, + STR_DATA: STR_DATA$1, + STR_END: STR_END$2, + BRACE_START: BRACE_START$1, + STAR +} = constants; + +const THROTTLE_MODE_WATCH = 'watch'; + +const open = promisify$2(fs$2.open); +const stat$2 = promisify$2(fs$2.stat); +const lstat$1 = promisify$2(fs$2.lstat); +const close = promisify$2(fs$2.close); +const fsrealpath = promisify$2(fs$2.realpath); + +const statMethods$1 = { lstat: lstat$1, stat: stat$2 }; + +// TODO: emit errors properly. Example: EMFILE on Macos. +const foreach = (val, fn) => { + if (val instanceof Set) { + val.forEach(fn); + } else { + fn(val); + } +}; + +const addAndConvert = (main, prop, item) => { + let container = main[prop]; + if (!(container instanceof Set)) { + main[prop] = container = new Set([container]); + } + container.add(item); +}; + +const clearItem = cont => key => { + const set = cont[key]; + if (set instanceof Set) { + set.clear(); + } else { + delete cont[key]; + } +}; + +const delFromSet = (main, prop, item) => { + const container = main[prop]; + if (container instanceof Set) { + container.delete(item); + } else if (container === item) { + delete main[prop]; + } +}; + +const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val; + +/** + * @typedef {String} Path + */ + +// fs_watch helpers + +// object to hold per-process fs_watch instances +// (may be shared across chokidar FSWatcher instances) + +/** + * @typedef {Object} FsWatchContainer + * @property {Set} listeners + * @property {Set} errHandlers + * @property {Set} rawEmitters + * @property {fs.FSWatcher=} watcher + * @property {Boolean=} watcherUnusable + */ + +/** + * @type {Map} + */ +const FsWatchInstances = new Map(); + +/** + * Instantiates the fs_watch interface + * @param {String} path to be watched + * @param {Object} options to be passed to fs_watch + * @param {Function} listener main event handler + * @param {Function} errHandler emits info about errors + * @param {Function} emitRaw emits raw event data + * @returns {fs.FSWatcher} new fsevents instance + */ +function createFsWatchInstance(path, options, listener, errHandler, emitRaw) { + const handleEvent = (rawEvent, evPath) => { + listener(path); + emitRaw(rawEvent, evPath, {watchedPath: path}); + + // emit based on events occurring for files from a directory's watcher in + // case the file's watcher misses it (and rely on throttling to de-dupe) + if (evPath && path !== evPath) { + fsWatchBroadcast( + sysPath$2.resolve(path, evPath), KEY_LISTENERS, sysPath$2.join(path, evPath) + ); + } + }; + try { + return fs$2.watch(path, options, handleEvent); + } catch (error) { + errHandler(error); + } +} + +/** + * Helper for passing fs_watch event data to a collection of listeners + * @param {Path} fullPath absolute path bound to fs_watch instance + * @param {String} type listener type + * @param {*=} val1 arguments to be passed to listeners + * @param {*=} val2 + * @param {*=} val3 + */ +const fsWatchBroadcast = (fullPath, type, val1, val2, val3) => { + const cont = FsWatchInstances.get(fullPath); + if (!cont) return; + foreach(cont[type], (listener) => { + listener(val1, val2, val3); + }); +}; + +/** + * Instantiates the fs_watch interface or binds listeners + * to an existing one covering the same file system entry + * @param {String} path + * @param {String} fullPath absolute path + * @param {Object} options to be passed to fs_watch + * @param {Object} handlers container for event listener functions + */ +const setFsWatchListener = (path, fullPath, options, handlers) => { + const {listener, errHandler, rawEmitter} = handlers; + let cont = FsWatchInstances.get(fullPath); + + /** @type {fs.FSWatcher=} */ + let watcher; + if (!options.persistent) { + watcher = createFsWatchInstance( + path, options, listener, errHandler, rawEmitter + ); + return watcher.close.bind(watcher); + } + if (cont) { + addAndConvert(cont, KEY_LISTENERS, listener); + addAndConvert(cont, KEY_ERR, errHandler); + addAndConvert(cont, KEY_RAW, rawEmitter); + } else { + watcher = createFsWatchInstance( + path, + options, + fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), + errHandler, // no need to use broadcast here + fsWatchBroadcast.bind(null, fullPath, KEY_RAW) + ); + if (!watcher) return; + watcher.on(EV_ERROR$2, async (error) => { + const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); + cont.watcherUnusable = true; // documented since Node 10.4.1 + // Workaround for https://github.com/joyent/node/issues/4337 + if (isWindows$1 && error.code === 'EPERM') { + try { + const fd = await open(path, 'r'); + await close(fd); + broadcastErr(error); + } catch (err) {} + } else { + broadcastErr(error); + } + }); + cont = { + listeners: listener, + errHandlers: errHandler, + rawEmitters: rawEmitter, + watcher + }; + FsWatchInstances.set(fullPath, cont); + } + // const index = cont.listeners.indexOf(listener); + + // removes this instance's listeners and closes the underlying fs_watch + // instance if there are no more listeners left + return () => { + delFromSet(cont, KEY_LISTENERS, listener); + delFromSet(cont, KEY_ERR, errHandler); + delFromSet(cont, KEY_RAW, rawEmitter); + if (isEmptySet(cont.listeners)) { + // Check to protect against issue gh-730. + // if (cont.watcherUnusable) { + cont.watcher.close(); + // } + FsWatchInstances.delete(fullPath); + HANDLER_KEYS.forEach(clearItem(cont)); + cont.watcher = undefined; + Object.freeze(cont); + } + }; +}; + +// fs_watchFile helpers + +// object to hold per-process fs_watchFile instances +// (may be shared across chokidar FSWatcher instances) +const FsWatchFileInstances = new Map(); + +/** + * Instantiates the fs_watchFile interface or binds listeners + * to an existing one covering the same file system entry + * @param {String} path to be watched + * @param {String} fullPath absolute path + * @param {Object} options options to be passed to fs_watchFile + * @param {Object} handlers container for event listener functions + * @returns {Function} closer + */ +const setFsWatchFileListener = (path, fullPath, options, handlers) => { + const {listener, rawEmitter} = handlers; + let cont = FsWatchFileInstances.get(fullPath); + + const copts = cont && cont.options; + if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) { + fs$2.unwatchFile(fullPath); + cont = undefined; + } + + /* eslint-enable no-unused-vars, prefer-destructuring */ + + if (cont) { + addAndConvert(cont, KEY_LISTENERS, listener); + addAndConvert(cont, KEY_RAW, rawEmitter); + } else { + // TODO + // listeners.add(listener); + // rawEmitters.add(rawEmitter); + cont = { + listeners: listener, + rawEmitters: rawEmitter, + options, + watcher: fs$2.watchFile(fullPath, options, (curr, prev) => { + foreach(cont.rawEmitters, (rawEmitter) => { + rawEmitter(EV_CHANGE$2, fullPath, {curr, prev}); + }); + const currmtime = curr.mtimeMs; + if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { + foreach(cont.listeners, (listener) => listener(path, curr)); + } + }) + }; + FsWatchFileInstances.set(fullPath, cont); + } + // const index = cont.listeners.indexOf(listener); + + // Removes this instance's listeners and closes the underlying fs_watchFile + // instance if there are no more listeners left. + return () => { + delFromSet(cont, KEY_LISTENERS, listener); + delFromSet(cont, KEY_RAW, rawEmitter); + if (isEmptySet(cont.listeners)) { + FsWatchFileInstances.delete(fullPath); + fs$2.unwatchFile(fullPath); + cont.options = cont.watcher = undefined; + Object.freeze(cont); + } + }; +}; + +/** + * @mixin + */ +let NodeFsHandler$1 = class NodeFsHandler { + +/** + * @param {import("../index").FSWatcher} fsW + */ +constructor(fsW) { + this.fsw = fsW; + this._boundHandleError = (error) => fsW._handleError(error); +} + +/** + * Watch file for changes with fs_watchFile or fs_watch. + * @param {String} path to file or dir + * @param {Function} listener on fs change + * @returns {Function} closer for the watcher instance + */ +_watchWithNodeFs(path, listener) { + const opts = this.fsw.options; + const directory = sysPath$2.dirname(path); + const basename = sysPath$2.basename(path); + const parent = this.fsw._getWatchedDir(directory); + parent.add(basename); + const absolutePath = sysPath$2.resolve(path); + const options = {persistent: opts.persistent}; + if (!listener) listener = EMPTY_FN$2; + + let closer; + if (opts.usePolling) { + options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? + opts.binaryInterval : opts.interval; + closer = setFsWatchFileListener(path, absolutePath, options, { + listener, + rawEmitter: this.fsw._emitRaw + }); + } else { + closer = setFsWatchListener(path, absolutePath, options, { + listener, + errHandler: this._boundHandleError, + rawEmitter: this.fsw._emitRaw + }); + } + return closer; +} + +/** + * Watch a file and emit add event if warranted. + * @param {Path} file Path + * @param {fs.Stats} stats result of fs_stat + * @param {Boolean} initialAdd was the file added at watch instantiation? + * @returns {Function} closer for the watcher instance + */ +_handleFile(file, stats, initialAdd) { + if (this.fsw.closed) { + return; + } + const dirname = sysPath$2.dirname(file); + const basename = sysPath$2.basename(file); + const parent = this.fsw._getWatchedDir(dirname); + // stats is always present + let prevStats = stats; + + // if the file is already being watched, do nothing + if (parent.has(basename)) return; + + const listener = async (path, newStats) => { + if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; + if (!newStats || newStats.mtimeMs === 0) { + try { + const newStats = await stat$2(file); + if (this.fsw.closed) return; + // Check that change event was not fired because of changed only accessTime. + const at = newStats.atimeMs; + const mt = newStats.mtimeMs; + if (!at || at <= mt || mt !== prevStats.mtimeMs) { + this.fsw._emit(EV_CHANGE$2, file, newStats); + } + if (isLinux && prevStats.ino !== newStats.ino) { + this.fsw._closeFile(path); + prevStats = newStats; + this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener)); + } else { + prevStats = newStats; + } + } catch (error) { + // Fix issues where mtime is null but file is still present + this.fsw._remove(dirname, basename); + } + // add is about to be emitted if file not already tracked in parent + } else if (parent.has(basename)) { + // Check that change event was not fired because of changed only accessTime. + const at = newStats.atimeMs; + const mt = newStats.mtimeMs; + if (!at || at <= mt || mt !== prevStats.mtimeMs) { + this.fsw._emit(EV_CHANGE$2, file, newStats); + } + prevStats = newStats; + } + }; + // kick off the watcher + const closer = this._watchWithNodeFs(file, listener); + + // emit an add event if we're supposed to + if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { + if (!this.fsw._throttle(EV_ADD$2, file, 0)) return; + this.fsw._emit(EV_ADD$2, file, stats); + } + + return closer; +} + +/** + * Handle symlinks encountered while reading a dir. + * @param {Object} entry returned by readdirp + * @param {String} directory path of dir being read + * @param {String} path of this item + * @param {String} item basename of this item + * @returns {Promise} true if no more processing is needed for this entry. + */ +async _handleSymlink(entry, directory, path, item) { + if (this.fsw.closed) { + return; + } + const full = entry.fullPath; + const dir = this.fsw._getWatchedDir(directory); + + if (!this.fsw.options.followSymlinks) { + // watch symlink directly (don't follow) and detect changes + this.fsw._incrReadyCount(); + + let linkPath; + try { + linkPath = await fsrealpath(path); + } catch (e) { + this.fsw._emitReady(); + return true; + } + + if (this.fsw.closed) return; + if (dir.has(item)) { + if (this.fsw._symlinkPaths.get(full) !== linkPath) { + this.fsw._symlinkPaths.set(full, linkPath); + this.fsw._emit(EV_CHANGE$2, path, entry.stats); + } + } else { + dir.add(item); + this.fsw._symlinkPaths.set(full, linkPath); + this.fsw._emit(EV_ADD$2, path, entry.stats); + } + this.fsw._emitReady(); + return true; + } + + // don't follow the same symlink more than once + if (this.fsw._symlinkPaths.has(full)) { + return true; + } + + this.fsw._symlinkPaths.set(full, true); +} + +_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { + // Normalize the directory name on Windows + directory = sysPath$2.join(directory, EMPTY_STR$1); + + if (!wh.hasGlob) { + throttler = this.fsw._throttle('readdir', directory, 1000); + if (!throttler) return; + } + + const previous = this.fsw._getWatchedDir(wh.path); + const current = new Set(); + + let stream = this.fsw._readdirp(directory, { + fileFilter: entry => wh.filterPath(entry), + directoryFilter: entry => wh.filterDir(entry), + depth: 0 + }).on(STR_DATA$1, async (entry) => { + if (this.fsw.closed) { + stream = undefined; + return; + } + const item = entry.path; + let path = sysPath$2.join(directory, item); + current.add(item); + + if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) { + return; + } + + if (this.fsw.closed) { + stream = undefined; + return; + } + // Files that present in current directory snapshot + // but absent in previous are added to watch list and + // emit `add` event. + if (item === target || !target && !previous.has(item)) { + this.fsw._incrReadyCount(); + + // ensure relativeness of path is preserved in case of watcher reuse + path = sysPath$2.join(dir, sysPath$2.relative(dir, path)); + + this._addToNodeFs(path, initialAdd, wh, depth + 1); + } + }).on(EV_ERROR$2, this._boundHandleError); + + return new Promise(resolve => + stream.once(STR_END$2, () => { + if (this.fsw.closed) { + stream = undefined; + return; + } + const wasThrottled = throttler ? throttler.clear() : false; + + resolve(); + + // Files that absent in current directory snapshot + // but present in previous emit `remove` event + // and are removed from @watched[directory]. + previous.getChildren().filter((item) => { + return item !== directory && + !current.has(item) && + // in case of intersecting globs; + // a path may have been filtered out of this readdir, but + // shouldn't be removed because it matches a different glob + (!wh.hasGlob || wh.filterPath({ + fullPath: sysPath$2.resolve(directory, item) + })); + }).forEach((item) => { + this.fsw._remove(directory, item); + }); + + stream = undefined; + + // one more time for any missed in case changes came in extremely quickly + if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler); + }) + ); +} + +/** + * Read directory to add / remove files from `@watched` list and re-read it on change. + * @param {String} dir fs path + * @param {fs.Stats} stats + * @param {Boolean} initialAdd + * @param {Number} depth relative to user-supplied path + * @param {String} target child path targeted for watch + * @param {Object} wh Common watch helpers for this path + * @param {String} realpath + * @returns {Promise} closer for the watcher instance. + */ +async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) { + const parentDir = this.fsw._getWatchedDir(sysPath$2.dirname(dir)); + const tracked = parentDir.has(sysPath$2.basename(dir)); + if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) { + if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR$2, dir, stats); + } + + // ensure dir is tracked (harmless if redundant) + parentDir.add(sysPath$2.basename(dir)); + this.fsw._getWatchedDir(dir); + let throttler; + let closer; + + const oDepth = this.fsw.options.depth; + if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) { + if (!target) { + await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler); + if (this.fsw.closed) return; + } + + closer = this._watchWithNodeFs(dir, (dirPath, stats) => { + // if current directory is removed, do nothing + if (stats && stats.mtimeMs === 0) return; + + this._handleRead(dirPath, false, wh, target, dir, depth, throttler); + }); + } + return closer; +} + +/** + * Handle added file, directory, or glob pattern. + * Delegates call to _handleFile / _handleDir after checks. + * @param {String} path to file or ir + * @param {Boolean} initialAdd was the file added at watch instantiation? + * @param {Object} priorWh depth relative to user-supplied path + * @param {Number} depth Child path actually targeted for watch + * @param {String=} target Child path actually targeted for watch + * @returns {Promise} + */ +async _addToNodeFs(path, initialAdd, priorWh, depth, target) { + const ready = this.fsw._emitReady; + if (this.fsw._isIgnored(path) || this.fsw.closed) { + ready(); + return false; + } + + const wh = this.fsw._getWatchHelpers(path, depth); + if (!wh.hasGlob && priorWh) { + wh.hasGlob = priorWh.hasGlob; + wh.globFilter = priorWh.globFilter; + wh.filterPath = entry => priorWh.filterPath(entry); + wh.filterDir = entry => priorWh.filterDir(entry); + } + + // evaluate what is at the path we're being asked to watch + try { + const stats = await statMethods$1[wh.statMethod](wh.watchPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(wh.watchPath, stats)) { + ready(); + return false; + } + + const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START$1); + let closer; + if (stats.isDirectory()) { + const absPath = sysPath$2.resolve(path); + const targetPath = follow ? await fsrealpath(path) : path; + if (this.fsw.closed) return; + closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); + if (this.fsw.closed) return; + // preserve this symlink's target path + if (absPath !== targetPath && targetPath !== undefined) { + this.fsw._symlinkPaths.set(absPath, targetPath); + } + } else if (stats.isSymbolicLink()) { + const targetPath = follow ? await fsrealpath(path) : path; + if (this.fsw.closed) return; + const parent = sysPath$2.dirname(wh.watchPath); + this.fsw._getWatchedDir(parent).add(wh.watchPath); + this.fsw._emit(EV_ADD$2, wh.watchPath, stats); + closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath); + if (this.fsw.closed) return; + + // preserve this symlink's target path + if (targetPath !== undefined) { + this.fsw._symlinkPaths.set(sysPath$2.resolve(path), targetPath); + } + } else { + closer = this._handleFile(wh.watchPath, stats, initialAdd); + } + ready(); + + this.fsw._addPathCloser(path, closer); + return false; + + } catch (error) { + if (this.fsw._handleError(error)) { + ready(); + return path; + } + } +} + +}; + +var nodefsHandler = NodeFsHandler$1; + +var fseventsHandler = {exports: {}}; + +const require$$3 = /*@__PURE__*/getAugmentedNamespace(fseventsImporter); + +const fs$1 = require$$0$1; +const sysPath$1 = require$$0$2; +const { promisify: promisify$1 } = require$$2; + +let fsevents; +try { + fsevents = require$$3.getFsEvents(); +} catch (error) { + if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error); +} + +if (fsevents) { + // TODO: real check + const mtch = process.version.match(/v(\d+)\.(\d+)/); + if (mtch && mtch[1] && mtch[2]) { + const maj = Number.parseInt(mtch[1], 10); + const min = Number.parseInt(mtch[2], 10); + if (maj === 8 && min < 16) { + fsevents = undefined; + } + } +} + +const { + EV_ADD: EV_ADD$1, + EV_CHANGE: EV_CHANGE$1, + EV_ADD_DIR: EV_ADD_DIR$1, + EV_UNLINK: EV_UNLINK$1, + EV_ERROR: EV_ERROR$1, + STR_DATA, + STR_END: STR_END$1, + FSEVENT_CREATED, + FSEVENT_MODIFIED, + FSEVENT_DELETED, + FSEVENT_MOVED, + // FSEVENT_CLONED, + FSEVENT_UNKNOWN, + FSEVENT_FLAG_MUST_SCAN_SUBDIRS, + FSEVENT_TYPE_FILE, + FSEVENT_TYPE_DIRECTORY, + FSEVENT_TYPE_SYMLINK, + + ROOT_GLOBSTAR, + DIR_SUFFIX, + DOT_SLASH, + FUNCTION_TYPE: FUNCTION_TYPE$1, + EMPTY_FN: EMPTY_FN$1, + IDENTITY_FN +} = constants; + +const Depth = (value) => isNaN(value) ? {} : {depth: value}; + +const stat$1 = promisify$1(fs$1.stat); +const lstat = promisify$1(fs$1.lstat); +const realpath = promisify$1(fs$1.realpath); + +const statMethods = { stat: stat$1, lstat }; + +/** + * @typedef {String} Path + */ + +/** + * @typedef {Object} FsEventsWatchContainer + * @property {Set} listeners + * @property {Function} rawEmitter + * @property {{stop: Function}} watcher + */ + +// fsevents instance helper functions +/** + * Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances) + * @type {Map} + */ +const FSEventsWatchers = new Map(); + +// Threshold of duplicate path prefixes at which to start +// consolidating going forward +const consolidateThreshhold = 10; + +const wrongEventFlags = new Set([ + 69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912 +]); + +/** + * Instantiates the fsevents interface + * @param {Path} path path to be watched + * @param {Function} callback called when fsevents is bound and ready + * @returns {{stop: Function}} new fsevents instance + */ +const createFSEventsInstance = (path, callback) => { + const stop = fsevents.watch(path, callback); + return {stop}; +}; + +/** + * Instantiates the fsevents interface or binds listeners to an existing one covering + * the same file tree. + * @param {Path} path - to be watched + * @param {Path} realPath - real path for symlinks + * @param {Function} listener - called when fsevents emits events + * @param {Function} rawEmitter - passes data to listeners of the 'raw' event + * @returns {Function} closer + */ +function setFSEventsListener(path, realPath, listener, rawEmitter) { + let watchPath = sysPath$1.extname(realPath) ? sysPath$1.dirname(realPath) : realPath; + + const parentPath = sysPath$1.dirname(watchPath); + let cont = FSEventsWatchers.get(watchPath); + + // If we've accumulated a substantial number of paths that + // could have been consolidated by watching one directory + // above the current one, create a watcher on the parent + // path instead, so that we do consolidate going forward. + if (couldConsolidate(parentPath)) { + watchPath = parentPath; + } + + const resolvedPath = sysPath$1.resolve(path); + const hasSymlink = resolvedPath !== realPath; + + const filteredListener = (fullPath, flags, info) => { + if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath); + if ( + fullPath === resolvedPath || + !fullPath.indexOf(resolvedPath + sysPath$1.sep) + ) listener(fullPath, flags, info); + }; + + // check if there is already a watcher on a parent path + // modifies `watchPath` to the parent path when it finds a match + let watchedParent = false; + for (const watchedPath of FSEventsWatchers.keys()) { + if (realPath.indexOf(sysPath$1.resolve(watchedPath) + sysPath$1.sep) === 0) { + watchPath = watchedPath; + cont = FSEventsWatchers.get(watchPath); + watchedParent = true; + break; + } + } + + if (cont || watchedParent) { + cont.listeners.add(filteredListener); + } else { + cont = { + listeners: new Set([filteredListener]), + rawEmitter, + watcher: createFSEventsInstance(watchPath, (fullPath, flags) => { + if (!cont.listeners.size) return; + if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return; + const info = fsevents.getInfo(fullPath, flags); + cont.listeners.forEach(list => { + list(fullPath, flags, info); + }); + + cont.rawEmitter(info.event, fullPath, info); + }) + }; + FSEventsWatchers.set(watchPath, cont); + } + + // removes this instance's listeners and closes the underlying fsevents + // instance if there are no more listeners left + return () => { + const lst = cont.listeners; + + lst.delete(filteredListener); + if (!lst.size) { + FSEventsWatchers.delete(watchPath); + if (cont.watcher) return cont.watcher.stop().then(() => { + cont.rawEmitter = cont.watcher = undefined; + Object.freeze(cont); + }); + } + }; +} + +// Decide whether or not we should start a new higher-level +// parent watcher +const couldConsolidate = (path) => { + let count = 0; + for (const watchPath of FSEventsWatchers.keys()) { + if (watchPath.indexOf(path) === 0) { + count++; + if (count >= consolidateThreshhold) { + return true; + } + } + } + + return false; +}; + +// returns boolean indicating whether fsevents can be used +const canUse = () => fsevents && FSEventsWatchers.size < 128; + +// determines subdirectory traversal levels from root to path +const calcDepth = (path, root) => { + let i = 0; + while (!path.indexOf(root) && (path = sysPath$1.dirname(path)) !== root) i++; + return i; +}; + +// returns boolean indicating whether the fsevents' event info has the same type +// as the one returned by fs.stat +const sameTypes = (info, stats) => ( + info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || + info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || + info.type === FSEVENT_TYPE_FILE && stats.isFile() +); + +/** + * @mixin + */ +let FsEventsHandler$1 = class FsEventsHandler { + +/** + * @param {import('../index').FSWatcher} fsw + */ +constructor(fsw) { + this.fsw = fsw; +} +checkIgnored(path, stats) { + const ipaths = this.fsw._ignoredPaths; + if (this.fsw._isIgnored(path, stats)) { + ipaths.add(path); + if (stats && stats.isDirectory()) { + ipaths.add(path + ROOT_GLOBSTAR); + } + return true; + } + + ipaths.delete(path); + ipaths.delete(path + ROOT_GLOBSTAR); +} + +addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) { + const event = watchedDir.has(item) ? EV_CHANGE$1 : EV_ADD$1; + this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts); +} + +async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) { + try { + const stats = await stat$1(path); + if (this.fsw.closed) return; + if (sameTypes(info, stats)) { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } catch (error) { + if (error.code === 'EACCES') { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } +} + +handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) { + if (this.fsw.closed || this.checkIgnored(path)) return; + + if (event === EV_UNLINK$1) { + const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY; + // suppress unlink events on never before seen files + if (isDirectory || watchedDir.has(item)) { + this.fsw._remove(parent, item, isDirectory); + } + } else { + if (event === EV_ADD$1) { + // track new directories + if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path); + + if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) { + // push symlinks back to the top of the stack to get handled + const curDepth = opts.depth === undefined ? + undefined : calcDepth(fullPath, realPath) + 1; + return this._addToFsEvents(path, false, true, curDepth); + } + + // track new paths + // (other than symlinks being followed, which will be tracked soon) + this.fsw._getWatchedDir(parent).add(item); + } + /** + * @type {'add'|'addDir'|'unlink'|'unlinkDir'} + */ + const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event; + this.fsw._emit(eventName, path); + if (eventName === EV_ADD_DIR$1) this._addToFsEvents(path, false, true); + } +} + +/** + * Handle symlinks encountered during directory scan + * @param {String} watchPath - file/dir path to be watched with fsevents + * @param {String} realPath - real path (in case of symlinks) + * @param {Function} transform - path transformer + * @param {Function} globFilter - path filter in case a glob pattern was provided + * @returns {Function} closer for the watcher instance +*/ +_watchWithFsEvents(watchPath, realPath, transform, globFilter) { + if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; + const opts = this.fsw.options; + const watchCallback = async (fullPath, flags, info) => { + if (this.fsw.closed) return; + if ( + opts.depth !== undefined && + calcDepth(fullPath, realPath) > opts.depth + ) return; + const path = transform(sysPath$1.join( + watchPath, sysPath$1.relative(watchPath, fullPath) + )); + if (globFilter && !globFilter(path)) return; + // ensure directories are tracked + const parent = sysPath$1.dirname(path); + const item = sysPath$1.basename(path); + const watchedDir = this.fsw._getWatchedDir( + info.type === FSEVENT_TYPE_DIRECTORY ? path : parent + ); + + // correct for wrong events emitted + if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) { + if (typeof opts.ignored === FUNCTION_TYPE$1) { + let stats; + try { + stats = await stat$1(path); + } catch (error) {} + if (this.fsw.closed) return; + if (this.checkIgnored(path, stats)) return; + if (sameTypes(info, stats)) { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } else { + this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } else { + switch (info.event) { + case FSEVENT_CREATED: + case FSEVENT_MODIFIED: + return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + case FSEVENT_DELETED: + case FSEVENT_MOVED: + return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } + }; + + const closer = setFSEventsListener( + watchPath, + realPath, + watchCallback, + this.fsw._emitRaw + ); + + this.fsw._emitReady(); + return closer; +} + +/** + * Handle symlinks encountered during directory scan + * @param {String} linkPath path to symlink + * @param {String} fullPath absolute path to the symlink + * @param {Function} transform pre-existing path transformer + * @param {Number} curDepth level of subdirectories traversed to where symlink is + * @returns {Promise} + */ +async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { + // don't follow the same symlink more than once + if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return; + + this.fsw._symlinkPaths.set(fullPath, true); + this.fsw._incrReadyCount(); + + try { + const linkTarget = await realpath(linkPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(linkTarget)) { + return this.fsw._emitReady(); + } + + this.fsw._incrReadyCount(); + + // add the linkTarget for watching with a wrapper for transform + // that causes emitted paths to incorporate the link's path + this._addToFsEvents(linkTarget || linkPath, (path) => { + let aliasedPath = linkPath; + if (linkTarget && linkTarget !== DOT_SLASH) { + aliasedPath = path.replace(linkTarget, linkPath); + } else if (path !== DOT_SLASH) { + aliasedPath = sysPath$1.join(linkPath, path); + } + return transform(aliasedPath); + }, false, curDepth); + } catch(error) { + if (this.fsw._handleError(error)) { + return this.fsw._emitReady(); + } + } +} + +/** + * + * @param {Path} newPath + * @param {fs.Stats} stats + */ +emitAdd(newPath, stats, processPath, opts, forceAdd) { + const pp = processPath(newPath); + const isDir = stats.isDirectory(); + const dirObj = this.fsw._getWatchedDir(sysPath$1.dirname(pp)); + const base = sysPath$1.basename(pp); + + // ensure empty dirs get tracked + if (isDir) this.fsw._getWatchedDir(pp); + if (dirObj.has(base)) return; + dirObj.add(base); + + if (!opts.ignoreInitial || forceAdd === true) { + this.fsw._emit(isDir ? EV_ADD_DIR$1 : EV_ADD$1, pp, stats); + } +} + +initWatch(realPath, path, wh, processPath) { + if (this.fsw.closed) return; + const closer = this._watchWithFsEvents( + wh.watchPath, + sysPath$1.resolve(realPath || wh.watchPath), + processPath, + wh.globFilter + ); + this.fsw._addPathCloser(path, closer); +} + +/** + * Handle added path with fsevents + * @param {String} path file/dir path or glob pattern + * @param {Function|Boolean=} transform converts working path to what the user expects + * @param {Boolean=} forceAdd ensure add is emitted + * @param {Number=} priorDepth Level of subdirectories already traversed. + * @returns {Promise} + */ +async _addToFsEvents(path, transform, forceAdd, priorDepth) { + if (this.fsw.closed) { + return; + } + const opts = this.fsw.options; + const processPath = typeof transform === FUNCTION_TYPE$1 ? transform : IDENTITY_FN; + + const wh = this.fsw._getWatchHelpers(path); + + // evaluate what is at the path we're being asked to watch + try { + const stats = await statMethods[wh.statMethod](wh.watchPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(wh.watchPath, stats)) { + throw null; + } + if (stats.isDirectory()) { + // emit addDir unless this is a glob parent + if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd); + + // don't recurse further if it would exceed depth setting + if (priorDepth && priorDepth > opts.depth) return; + + // scan the contents of the dir + this.fsw._readdirp(wh.watchPath, { + fileFilter: entry => wh.filterPath(entry), + directoryFilter: entry => wh.filterDir(entry), + ...Depth(opts.depth - (priorDepth || 0)) + }).on(STR_DATA, (entry) => { + // need to check filterPath on dirs b/c filterDir is less restrictive + if (this.fsw.closed) { + return; + } + if (entry.stats.isDirectory() && !wh.filterPath(entry)) return; + + const joinedPath = sysPath$1.join(wh.watchPath, entry.path); + const {fullPath} = entry; + + if (wh.followSymlinks && entry.stats.isSymbolicLink()) { + // preserve the current depth here since it can't be derived from + // real paths past the symlink + const curDepth = opts.depth === undefined ? + undefined : calcDepth(joinedPath, sysPath$1.resolve(wh.watchPath)) + 1; + + this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth); + } else { + this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd); + } + }).on(EV_ERROR$1, EMPTY_FN$1).on(STR_END$1, () => { + this.fsw._emitReady(); + }); + } else { + this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd); + this.fsw._emitReady(); + } + } catch (error) { + if (!error || this.fsw._handleError(error)) { + // TODO: Strange thing: "should not choke on an ignored watch path" will be failed without 2 ready calls -__- + this.fsw._emitReady(); + this.fsw._emitReady(); + } + } + + if (opts.persistent && forceAdd !== true) { + if (typeof transform === FUNCTION_TYPE$1) { + // realpath has already been resolved + this.initWatch(undefined, path, wh, processPath); + } else { + let realPath; + try { + realPath = await realpath(wh.watchPath); + } catch (e) {} + this.initWatch(realPath, path, wh, processPath); + } + } +} + +}; + +fseventsHandler.exports = FsEventsHandler$1; +fseventsHandler.exports.canUse = canUse; + +var fseventsHandlerExports = fseventsHandler.exports; + +const { EventEmitter } = require$$0$3; +const fs = require$$0$1; +const sysPath = require$$0$2; +const { promisify } = require$$2; +const readdirp = readdirp_1; +const anymatch = anymatchExports.default; +const globParent = globParent$1; +const isGlob = isGlob$2; +const braces = braces_1; +const normalizePath = normalizePath$2; + +const NodeFsHandler = nodefsHandler; +const FsEventsHandler = fseventsHandlerExports; +const { + EV_ALL, + EV_READY, + EV_ADD, + EV_CHANGE, + EV_UNLINK, + EV_ADD_DIR, + EV_UNLINK_DIR, + EV_RAW, + EV_ERROR, + + STR_CLOSE, + STR_END, + + BACK_SLASH_RE, + DOUBLE_SLASH_RE, + SLASH_OR_BACK_SLASH_RE, + DOT_RE, + REPLACER_RE, + + SLASH, + SLASH_SLASH, + BRACE_START, + BANG, + ONE_DOT, + TWO_DOTS, + GLOBSTAR, + SLASH_GLOBSTAR, + ANYMATCH_OPTS, + STRING_TYPE, + FUNCTION_TYPE, + EMPTY_STR, + EMPTY_FN, + + isWindows, + isMacos, + isIBMi +} = constants; + +const stat = promisify(fs.stat); +const readdir = promisify(fs.readdir); + +/** + * @typedef {String} Path + * @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName + * @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType + */ + +/** + * + * @typedef {Object} WatchHelpers + * @property {Boolean} followSymlinks + * @property {'stat'|'lstat'} statMethod + * @property {Path} path + * @property {Path} watchPath + * @property {Function} entryPath + * @property {Boolean} hasGlob + * @property {Object} globFilter + * @property {Function} filterPath + * @property {Function} filterDir + */ + +const arrify = (value = []) => Array.isArray(value) ? value : [value]; +const flatten = (list, result = []) => { + list.forEach(item => { + if (Array.isArray(item)) { + flatten(item, result); + } else { + result.push(item); + } + }); + return result; +}; + +const unifyPaths = (paths_) => { + /** + * @type {Array} + */ + const paths = flatten(arrify(paths_)); + if (!paths.every(p => typeof p === STRING_TYPE)) { + throw new TypeError(`Non-string provided as watch path: ${paths}`); + } + return paths.map(normalizePathToUnix); +}; + +// If SLASH_SLASH occurs at the beginning of path, it is not replaced +// because "//StoragePC/DrivePool/Movies" is a valid network path +const toUnix = (string) => { + let str = string.replace(BACK_SLASH_RE, SLASH); + let prepend = false; + if (str.startsWith(SLASH_SLASH)) { + prepend = true; + } + while (str.match(DOUBLE_SLASH_RE)) { + str = str.replace(DOUBLE_SLASH_RE, SLASH); + } + if (prepend) { + str = SLASH + str; + } + return str; +}; + +// Our version of upath.normalize +// TODO: this is not equal to path-normalize module - investigate why +const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path))); + +const normalizeIgnored = (cwd = EMPTY_STR) => (path) => { + if (typeof path !== STRING_TYPE) return path; + return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path)); +}; + +const getAbsolutePath = (path, cwd) => { + if (sysPath.isAbsolute(path)) { + return path; + } + if (path.startsWith(BANG)) { + return BANG + sysPath.join(cwd, path.slice(1)); + } + return sysPath.join(cwd, path); +}; + +const undef = (opts, key) => opts[key] === undefined; + +/** + * Directory entry. + * @property {Path} path + * @property {Set} items + */ +class DirEntry { + /** + * @param {Path} dir + * @param {Function} removeWatcher + */ + constructor(dir, removeWatcher) { + this.path = dir; + this._removeWatcher = removeWatcher; + /** @type {Set} */ + this.items = new Set(); + } + + add(item) { + const {items} = this; + if (!items) return; + if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item); + } + + async remove(item) { + const {items} = this; + if (!items) return; + items.delete(item); + if (items.size > 0) return; + + const dir = this.path; + try { + await readdir(dir); + } catch (err) { + if (this._removeWatcher) { + this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir)); + } + } + } + + has(item) { + const {items} = this; + if (!items) return; + return items.has(item); + } + + /** + * @returns {Array} + */ + getChildren() { + const {items} = this; + if (!items) return; + return [...items.values()]; + } + + dispose() { + this.items.clear(); + delete this.path; + delete this._removeWatcher; + delete this.items; + Object.freeze(this); + } +} + +const STAT_METHOD_F = 'stat'; +const STAT_METHOD_L = 'lstat'; +class WatchHelper { + constructor(path, watchPath, follow, fsw) { + this.fsw = fsw; + this.path = path = path.replace(REPLACER_RE, EMPTY_STR); + this.watchPath = watchPath; + this.fullWatchPath = sysPath.resolve(watchPath); + this.hasGlob = watchPath !== path; + /** @type {object|boolean} */ + if (path === EMPTY_STR) this.hasGlob = false; + this.globSymlink = this.hasGlob && follow ? undefined : false; + this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false; + this.dirParts = this.getDirParts(path); + this.dirParts.forEach((parts) => { + if (parts.length > 1) parts.pop(); + }); + this.followSymlinks = follow; + this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L; + } + + checkGlobSymlink(entry) { + // only need to resolve once + // first entry should always have entry.parentDir === EMPTY_STR + if (this.globSymlink === undefined) { + this.globSymlink = entry.fullParentDir === this.fullWatchPath ? + false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath}; + } + + if (this.globSymlink) { + return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath); + } + + return entry.fullPath; + } + + entryPath(entry) { + return sysPath.join(this.watchPath, + sysPath.relative(this.watchPath, this.checkGlobSymlink(entry)) + ); + } + + filterPath(entry) { + const {stats} = entry; + if (stats && stats.isSymbolicLink()) return this.filterDir(entry); + const resolvedPath = this.entryPath(entry); + const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? + this.globFilter(resolvedPath) : true; + return matchesGlob && + this.fsw._isntIgnored(resolvedPath, stats) && + this.fsw._hasReadPermissions(stats); + } + + getDirParts(path) { + if (!this.hasGlob) return []; + const parts = []; + const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path]; + expandedPath.forEach((path) => { + parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE)); + }); + return parts; + } + + filterDir(entry) { + if (this.hasGlob) { + const entryParts = this.getDirParts(this.checkGlobSymlink(entry)); + let globstar = false; + this.unmatchedGlob = !this.dirParts.some((parts) => { + return parts.every((part, i) => { + if (part === GLOBSTAR) globstar = true; + return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS); + }); + }); + } + return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats); + } +} + +/** + * Watches files & directories for changes. Emitted events: + * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error` + * + * new FSWatcher() + * .add(directories) + * .on('add', path => log('File', path, 'was added')) + */ +class FSWatcher extends EventEmitter { +// Not indenting methods for history sake; for now. +constructor(_opts) { + super(); + + const opts = {}; + if (_opts) Object.assign(opts, _opts); // for frozen objects + + /** @type {Map} */ + this._watched = new Map(); + /** @type {Map} */ + this._closers = new Map(); + /** @type {Set} */ + this._ignoredPaths = new Set(); + + /** @type {Map} */ + this._throttled = new Map(); + + /** @type {Map} */ + this._symlinkPaths = new Map(); + + this._streams = new Set(); + this.closed = false; + + // Set up default options. + if (undef(opts, 'persistent')) opts.persistent = true; + if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false; + if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false; + if (undef(opts, 'interval')) opts.interval = 100; + if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300; + if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false; + opts.enableBinaryInterval = opts.binaryInterval !== opts.interval; + + // Enable fsevents on OS X when polling isn't explicitly enabled. + if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling; + + // If we can't use fsevents, ensure the options reflect it's disabled. + const canUseFsEvents = FsEventsHandler.canUse(); + if (!canUseFsEvents) opts.useFsEvents = false; + + // Use polling on Mac if not using fsevents. + // Other platforms use non-polling fs_watch. + if (undef(opts, 'usePolling') && !opts.useFsEvents) { + opts.usePolling = isMacos; + } + + // Always default to polling on IBM i because fs.watch() is not available on IBM i. + if(isIBMi) { + opts.usePolling = true; + } + + // Global override (useful for end-developers that need to force polling for all + // instances of chokidar, regardless of usage/dependency depth) + const envPoll = process.env.CHOKIDAR_USEPOLLING; + if (envPoll !== undefined) { + const envLower = envPoll.toLowerCase(); + + if (envLower === 'false' || envLower === '0') { + opts.usePolling = false; + } else if (envLower === 'true' || envLower === '1') { + opts.usePolling = true; + } else { + opts.usePolling = !!envLower; + } + } + const envInterval = process.env.CHOKIDAR_INTERVAL; + if (envInterval) { + opts.interval = Number.parseInt(envInterval, 10); + } + + // Editor atomic write normalization enabled by default with fs.watch + if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents; + if (opts.atomic) this._pendingUnlinks = new Map(); + + if (undef(opts, 'followSymlinks')) opts.followSymlinks = true; + + if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false; + if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {}; + const awf = opts.awaitWriteFinish; + if (awf) { + if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000; + if (!awf.pollInterval) awf.pollInterval = 100; + this._pendingWrites = new Map(); + } + if (opts.ignored) opts.ignored = arrify(opts.ignored); + + let readyCalls = 0; + this._emitReady = () => { + readyCalls++; + if (readyCalls >= this._readyCount) { + this._emitReady = EMPTY_FN; + this._readyEmitted = true; + // use process.nextTick to allow time for listener to be bound + process.nextTick(() => this.emit(EV_READY)); + } + }; + this._emitRaw = (...args) => this.emit(EV_RAW, ...args); + this._readyEmitted = false; + this.options = opts; + + // Initialize with proper watcher. + if (opts.useFsEvents) { + this._fsEventsHandler = new FsEventsHandler(this); + } else { + this._nodeFsHandler = new NodeFsHandler(this); + } + + // You’re frozen when your heart’s not open. + Object.freeze(opts); +} + +// Public methods + +/** + * Adds paths to be watched on an existing FSWatcher instance + * @param {Path|Array} paths_ + * @param {String=} _origAdd private; for handling non-existent paths to be watched + * @param {Boolean=} _internal private; indicates a non-user add + * @returns {FSWatcher} for chaining + */ +add(paths_, _origAdd, _internal) { + const {cwd, disableGlobbing} = this.options; + this.closed = false; + let paths = unifyPaths(paths_); + if (cwd) { + paths = paths.map((path) => { + const absPath = getAbsolutePath(path, cwd); + + // Check `path` instead of `absPath` because the cwd portion can't be a glob + if (disableGlobbing || !isGlob(path)) { + return absPath; + } + return normalizePath(absPath); + }); + } + + // set aside negated glob strings + paths = paths.filter((path) => { + if (path.startsWith(BANG)) { + this._ignoredPaths.add(path.slice(1)); + return false; + } + + // if a path is being added that was previously ignored, stop ignoring it + this._ignoredPaths.delete(path); + this._ignoredPaths.delete(path + SLASH_GLOBSTAR); + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + + return true; + }); + + if (this.options.useFsEvents && this._fsEventsHandler) { + if (!this._readyCount) this._readyCount = paths.length; + if (this.options.persistent) this._readyCount += paths.length; + paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path)); + } else { + if (!this._readyCount) this._readyCount = 0; + this._readyCount += paths.length; + Promise.all( + paths.map(async path => { + const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd); + if (res) this._emitReady(); + return res; + }) + ).then(results => { + if (this.closed) return; + results.filter(item => item).forEach(item => { + this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); + }); + }); + } + + return this; +} + +/** + * Close watchers or start ignoring events from specified paths. + * @param {Path|Array} paths_ - string or array of strings, file/directory paths and/or globs + * @returns {FSWatcher} for chaining +*/ +unwatch(paths_) { + if (this.closed) return this; + const paths = unifyPaths(paths_); + const {cwd} = this.options; + + paths.forEach((path) => { + // convert to absolute path unless relative path already matches + if (!sysPath.isAbsolute(path) && !this._closers.has(path)) { + if (cwd) path = sysPath.join(cwd, path); + path = sysPath.resolve(path); + } + + this._closePath(path); + + this._ignoredPaths.add(path); + if (this._watched.has(path)) { + this._ignoredPaths.add(path + SLASH_GLOBSTAR); + } + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + }); + + return this; +} + +/** + * Close watchers and remove all listeners from watched paths. + * @returns {Promise}. +*/ +close() { + if (this.closed) return this._closePromise; + this.closed = true; + + // Memory management. + this.removeAllListeners(); + const closers = []; + this._closers.forEach(closerList => closerList.forEach(closer => { + const promise = closer(); + if (promise instanceof Promise) closers.push(promise); + })); + this._streams.forEach(stream => stream.destroy()); + this._userIgnored = undefined; + this._readyCount = 0; + this._readyEmitted = false; + this._watched.forEach(dirent => dirent.dispose()); + ['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => { + this[`_${key}`].clear(); + }); + + this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve(); + return this._closePromise; +} + +/** + * Expose list of watched paths + * @returns {Object} for chaining +*/ +getWatched() { + const watchList = {}; + this._watched.forEach((entry, dir) => { + const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir; + watchList[key || ONE_DOT] = entry.getChildren().sort(); + }); + return watchList; +} + +emitWithAll(event, args) { + this.emit(...args); + if (event !== EV_ERROR) this.emit(EV_ALL, ...args); +} + +// Common helpers +// -------------- + +/** + * Normalize and emit events. + * Calling _emit DOES NOT MEAN emit() would be called! + * @param {EventName} event Type of event + * @param {Path} path File or directory path + * @param {*=} val1 arguments to be passed with event + * @param {*=} val2 + * @param {*=} val3 + * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ +async _emit(event, path, val1, val2, val3) { + if (this.closed) return; + + const opts = this.options; + if (isWindows) path = sysPath.normalize(path); + if (opts.cwd) path = sysPath.relative(opts.cwd, path); + /** @type Array */ + const args = [event, path]; + if (val3 !== undefined) args.push(val1, val2, val3); + else if (val2 !== undefined) args.push(val1, val2); + else if (val1 !== undefined) args.push(val1); + + const awf = opts.awaitWriteFinish; + let pw; + if (awf && (pw = this._pendingWrites.get(path))) { + pw.lastChange = new Date(); + return this; + } + + if (opts.atomic) { + if (event === EV_UNLINK) { + this._pendingUnlinks.set(path, args); + setTimeout(() => { + this._pendingUnlinks.forEach((entry, path) => { + this.emit(...entry); + this.emit(EV_ALL, ...entry); + this._pendingUnlinks.delete(path); + }); + }, typeof opts.atomic === 'number' ? opts.atomic : 100); + return this; + } + if (event === EV_ADD && this._pendingUnlinks.has(path)) { + event = args[0] = EV_CHANGE; + this._pendingUnlinks.delete(path); + } + } + + if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) { + const awfEmit = (err, stats) => { + if (err) { + event = args[0] = EV_ERROR; + args[1] = err; + this.emitWithAll(event, args); + } else if (stats) { + // if stats doesn't exist the file must have been deleted + if (args.length > 2) { + args[2] = stats; + } else { + args.push(stats); + } + this.emitWithAll(event, args); + } + }; + + this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit); + return this; + } + + if (event === EV_CHANGE) { + const isThrottled = !this._throttle(EV_CHANGE, path, 50); + if (isThrottled) return this; + } + + if (opts.alwaysStat && val1 === undefined && + (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE) + ) { + const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path; + let stats; + try { + stats = await stat(fullPath); + } catch (err) {} + // Suppress event when fs_stat fails, to avoid sending undefined 'stat' + if (!stats || this.closed) return; + args.push(stats); + } + this.emitWithAll(event, args); + + return this; +} + +/** + * Common handler for errors + * @param {Error} error + * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ +_handleError(error) { + const code = error && error.code; + if (error && code !== 'ENOENT' && code !== 'ENOTDIR' && + (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES')) + ) { + this.emit(EV_ERROR, error); + } + return error || this.closed; +} + +/** + * Helper utility for throttling + * @param {ThrottleType} actionType type being throttled + * @param {Path} path being acted upon + * @param {Number} timeout duration of time to suppress duplicate actions + * @returns {Object|false} tracking object or false if action should be suppressed + */ +_throttle(actionType, path, timeout) { + if (!this._throttled.has(actionType)) { + this._throttled.set(actionType, new Map()); + } + + /** @type {Map} */ + const action = this._throttled.get(actionType); + /** @type {Object} */ + const actionPath = action.get(path); + + if (actionPath) { + actionPath.count++; + return false; + } + + let timeoutObject; + const clear = () => { + const item = action.get(path); + const count = item ? item.count : 0; + action.delete(path); + clearTimeout(timeoutObject); + if (item) clearTimeout(item.timeoutObject); + return count; + }; + timeoutObject = setTimeout(clear, timeout); + const thr = {timeoutObject, clear, count: 0}; + action.set(path, thr); + return thr; +} + +_incrReadyCount() { + return this._readyCount++; +} + +/** + * Awaits write operation to finish. + * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback. + * @param {Path} path being acted upon + * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished + * @param {EventName} event + * @param {Function} awfEmit Callback to be called when ready for event to be emitted. + */ +_awaitWriteFinish(path, threshold, event, awfEmit) { + let timeoutHandler; + + let fullPath = path; + if (this.options.cwd && !sysPath.isAbsolute(path)) { + fullPath = sysPath.join(this.options.cwd, path); + } + + const now = new Date(); + + const awaitWriteFinish = (prevStat) => { + fs.stat(fullPath, (err, curStat) => { + if (err || !this._pendingWrites.has(path)) { + if (err && err.code !== 'ENOENT') awfEmit(err); + return; + } + + const now = Number(new Date()); + + if (prevStat && curStat.size !== prevStat.size) { + this._pendingWrites.get(path).lastChange = now; + } + const pw = this._pendingWrites.get(path); + const df = now - pw.lastChange; + + if (df >= threshold) { + this._pendingWrites.delete(path); + awfEmit(undefined, curStat); + } else { + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval, + curStat + ); + } + }); + }; + + if (!this._pendingWrites.has(path)) { + this._pendingWrites.set(path, { + lastChange: now, + cancelWait: () => { + this._pendingWrites.delete(path); + clearTimeout(timeoutHandler); + return event; + } + }); + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval + ); + } +} + +_getGlobIgnored() { + return [...this._ignoredPaths.values()]; +} + +/** + * Determines whether user has asked to ignore this path. + * @param {Path} path filepath or dir + * @param {fs.Stats=} stats result of fs.stat + * @returns {Boolean} + */ +_isIgnored(path, stats) { + if (this.options.atomic && DOT_RE.test(path)) return true; + if (!this._userIgnored) { + const {cwd} = this.options; + const ign = this.options.ignored; + + const ignored = ign && ign.map(normalizeIgnored(cwd)); + const paths = arrify(ignored) + .filter((path) => typeof path === STRING_TYPE && !isGlob(path)) + .map((path) => path + SLASH_GLOBSTAR); + const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths); + this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS); + } + + return this._userIgnored([path, stats]); +} + +_isntIgnored(path, stat) { + return !this._isIgnored(path, stat); +} + +/** + * Provides a set of common helpers and properties relating to symlink and glob handling. + * @param {Path} path file, directory, or glob pattern being watched + * @param {Number=} depth at any depth > 0, this isn't a glob + * @returns {WatchHelper} object containing helpers for this path + */ +_getWatchHelpers(path, depth) { + const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path); + const follow = this.options.followSymlinks; + + return new WatchHelper(path, watchPath, follow, this); +} + +// Directory helpers +// ----------------- + +/** + * Provides directory tracking objects + * @param {String} directory path of the directory + * @returns {DirEntry} the directory's tracking object + */ +_getWatchedDir(directory) { + if (!this._boundRemove) this._boundRemove = this._remove.bind(this); + const dir = sysPath.resolve(directory); + if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove)); + return this._watched.get(dir); +} + +// File helpers +// ------------ + +/** + * Check for read permissions. + * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405 + * @param {fs.Stats} stats - object, result of fs_stat + * @returns {Boolean} indicates whether the file can be read +*/ +_hasReadPermissions(stats) { + if (this.options.ignorePermissionErrors) return true; + + // stats.mode may be bigint + const md = stats && Number.parseInt(stats.mode, 10); + const st = md & 0o777; + const it = Number.parseInt(st.toString(8)[0], 10); + return Boolean(4 & it); +} + +/** + * Handles emitting unlink events for + * files and directories, and via recursion, for + * files and directories within directories that are unlinked + * @param {String} directory within which the following item is located + * @param {String} item base path of item/directory + * @returns {void} +*/ +_remove(directory, item, isDirectory) { + // if what is being deleted is a directory, get that directory's paths + // for recursive deleting and cleaning of watched object + // if it is not a directory, nestedDirectoryChildren will be empty array + const path = sysPath.join(directory, item); + const fullPath = sysPath.resolve(path); + isDirectory = isDirectory != null + ? isDirectory + : this._watched.has(path) || this._watched.has(fullPath); + + // prevent duplicate handling in case of arriving here nearly simultaneously + // via multiple paths (such as _handleFile and _handleDir) + if (!this._throttle('remove', path, 100)) return; + + // if the only watched file is removed, watch for its return + if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) { + this.add(directory, item, true); + } + + // This will create a new entry in the watched object in either case + // so we got to do the directory check beforehand + const wp = this._getWatchedDir(path); + const nestedDirectoryChildren = wp.getChildren(); + + // Recursively remove children directories / files. + nestedDirectoryChildren.forEach(nested => this._remove(path, nested)); + + // Check if item was on the watched list and remove it + const parent = this._getWatchedDir(directory); + const wasTracked = parent.has(item); + parent.remove(item); + + // Fixes issue #1042 -> Relative paths were detected and added as symlinks + // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), + // but never removed from the map in case the path was deleted. + // This leads to an incorrect state if the path was recreated: + // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 + if (this._symlinkPaths.has(fullPath)) { + this._symlinkPaths.delete(fullPath); + } + + // If we wait for this file to be fully written, cancel the wait. + let relPath = path; + if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path); + if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { + const event = this._pendingWrites.get(relPath).cancelWait(); + if (event === EV_ADD) return; + } + + // The Entry will either be a directory that just got removed + // or a bogus entry to a file, in either case we have to remove it + this._watched.delete(path); + this._watched.delete(fullPath); + const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK; + if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path); + + // Avoid conflicts if we later create another file with the same name + if (!this.options.useFsEvents) { + this._closePath(path); + } +} + +/** + * Closes all watchers for a path + * @param {Path} path + */ +_closePath(path) { + this._closeFile(path); + const dir = sysPath.dirname(path); + this._getWatchedDir(dir).remove(sysPath.basename(path)); +} + +/** + * Closes only file-specific watchers + * @param {Path} path + */ +_closeFile(path) { + const closers = this._closers.get(path); + if (!closers) return; + closers.forEach(closer => closer()); + this._closers.delete(path); +} + +/** + * + * @param {Path} path + * @param {Function} closer + */ +_addPathCloser(path, closer) { + if (!closer) return; + let list = this._closers.get(path); + if (!list) { + list = []; + this._closers.set(path, list); + } + list.push(closer); +} + +_readdirp(root, opts) { + if (this.closed) return; + const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts}; + let stream = readdirp(root, options); + this._streams.add(stream); + stream.once(STR_CLOSE, () => { + stream = undefined; + }); + stream.once(STR_END, () => { + if (stream) { + this._streams.delete(stream); + stream = undefined; + } + }); + return stream; +} + +} + +// Export FSWatcher class +chokidar.FSWatcher = FSWatcher; + +/** + * Instantiates watcher with paths to be tracked. + * @param {String|Array} paths file/directory paths and/or globs + * @param {Object=} options chokidar opts + * @returns an instance of FSWatcher for chaining. + */ +const watch = (paths, options) => { + const watcher = new FSWatcher(options); + watcher.add(paths); + return watcher; +}; + +chokidar.watch = watch; + +class FileWatcher { + constructor(task, chokidarOptions) { + this.transformWatchers = new Map(); + this.chokidarOptions = chokidarOptions; + this.task = task; + this.watcher = this.createWatcher(null); + } + close() { + this.watcher.close(); + for (const watcher of this.transformWatchers.values()) { + watcher.close(); + } + } + unwatch(id) { + this.watcher.unwatch(id); + const transformWatcher = this.transformWatchers.get(id); + if (transformWatcher) { + this.transformWatchers.delete(id); + transformWatcher.close(); + } + } + watch(id, isTransformDependency) { + if (isTransformDependency) { + const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id); + watcher.add(id); + this.transformWatchers.set(id, watcher); + } + else { + this.watcher.add(id); + } + } + createWatcher(transformWatcherId) { + const task = this.task; + const isLinux = platform() === 'linux'; + const isTransformDependency = transformWatcherId !== null; + const handleChange = (id, event) => { + const changedId = transformWatcherId || id; + if (isLinux) { + // unwatching and watching fixes an issue with chokidar where on certain systems, + // a file that was unlinked and immediately recreated would create a change event + // but then no longer any further events + watcher.unwatch(changedId); + watcher.add(changedId); + } + task.invalidate(changedId, { event, isTransformDependency }); + }; + const watcher = chokidar + .watch([], this.chokidarOptions) + .on('add', id => handleChange(id, 'create')) + .on('change', id => handleChange(id, 'update')) + .on('unlink', id => handleChange(id, 'delete')); + return watcher; + } +} + +const eventsRewrites = { + create: { + create: 'buggy', + delete: null, //delete file from map + update: 'create' + }, + delete: { + create: 'update', + delete: 'buggy', + update: 'buggy' + }, + update: { + create: 'buggy', + delete: 'delete', + update: 'update' + } +}; +class Watcher { + constructor(optionsList, emitter) { + this.buildDelay = 0; + this.buildTimeout = null; + this.closed = false; + this.invalidatedIds = new Map(); + this.rerun = false; + this.running = true; + this.emitter = emitter; + emitter.close = this.close.bind(this); + this.tasks = optionsList.map(options => new Task(this, options)); + for (const { watch } of optionsList) { + if (watch && typeof watch.buildDelay === 'number') { + this.buildDelay = Math.max(this.buildDelay, watch.buildDelay); + } + } + process$1.nextTick(() => this.run()); + } + async close() { + if (this.closed) + return; + this.closed = true; + if (this.buildTimeout) + clearTimeout(this.buildTimeout); + for (const task of this.tasks) { + task.close(); + } + await this.emitter.emit('close'); + this.emitter.removeAllListeners(); + } + invalidate(file) { + if (file) { + const previousEvent = this.invalidatedIds.get(file.id); + const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event; + if (event === 'buggy') { + //TODO: throws or warn? Currently just ignore, uses new event + this.invalidatedIds.set(file.id, file.event); + } + else if (event === null) { + this.invalidatedIds.delete(file.id); + } + else { + this.invalidatedIds.set(file.id, event); + } + } + if (this.running) { + this.rerun = true; + return; + } + if (this.buildTimeout) + clearTimeout(this.buildTimeout); + this.buildTimeout = setTimeout(async () => { + this.buildTimeout = null; + try { + await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event }))); + this.invalidatedIds.clear(); + await this.emitter.emit('restart'); + this.emitter.removeListenersForCurrentRun(); + this.run(); + } + catch (error) { + this.invalidatedIds.clear(); + await this.emitter.emit('event', { + code: 'ERROR', + error, + result: null + }); + await this.emitter.emit('event', { + code: 'END' + }); + } + }, this.buildDelay); + } + async run() { + this.running = true; + await this.emitter.emit('event', { + code: 'START' + }); + for (const task of this.tasks) { + await task.run(); + } + this.running = false; + await this.emitter.emit('event', { + code: 'END' + }); + if (this.rerun) { + this.rerun = false; + this.invalidate(); + } + } +} +class Task { + constructor(watcher, options) { + this.cache = { modules: [] }; + this.watchFiles = []; + this.closed = false; + this.invalidated = true; + this.watched = new Set(); + this.watcher = watcher; + this.options = options; + this.skipWrite = Boolean(options.watch && options.watch.skipWrite); + this.outputs = this.options.output; + this.outputFiles = this.outputs.map(output => { + if (output.file || output.dir) + return resolve(output.file || output.dir); + return undefined; + }); + const watchOptions = this.options.watch || {}; + this.filter = createFilter(watchOptions.include, watchOptions.exclude); + this.fileWatcher = new FileWatcher(this, { + ...watchOptions.chokidar, + disableGlobbing: true, + ignoreInitial: true + }); + } + close() { + this.closed = true; + this.fileWatcher.close(); + } + invalidate(id, details) { + this.invalidated = true; + if (details.isTransformDependency) { + for (const module of this.cache.modules) { + if (!module.transformDependencies.includes(id)) + continue; + // effective invalidation + module.originalCode = null; + } + } + this.watcher.invalidate({ event: details.event, id }); + } + async run() { + if (!this.invalidated) + return; + this.invalidated = false; + const options = { + ...this.options, + cache: this.cache + }; + const start = Date.now(); + await this.watcher.emitter.emit('event', { + code: 'BUNDLE_START', + input: this.options.input, + output: this.outputFiles + }); + let result = null; + try { + result = await rollupInternal(options, this.watcher.emitter); + if (this.closed) { + return; + } + this.updateWatchedFiles(result); + if (!this.skipWrite) { + await Promise.all(this.outputs.map(output => result.write(output))); + if (this.closed) { + return; + } + this.updateWatchedFiles(result); + } + await this.watcher.emitter.emit('event', { + code: 'BUNDLE_END', + duration: Date.now() - start, + input: this.options.input, + output: this.outputFiles, + result + }); + } + catch (error) { + if (!this.closed) { + if (Array.isArray(error.watchFiles)) { + for (const id of error.watchFiles) { + this.watchFile(id); + } + } + if (error.id) { + this.cache.modules = this.cache.modules.filter(module => module.id !== error.id); + } + } + await this.watcher.emitter.emit('event', { + code: 'ERROR', + error, + result + }); + } + } + updateWatchedFiles(result) { + const previouslyWatched = this.watched; + this.watched = new Set(); + this.watchFiles = result.watchFiles; + this.cache = result.cache; + for (const id of this.watchFiles) { + this.watchFile(id); + } + for (const module of this.cache.modules) { + for (const depId of module.transformDependencies) { + this.watchFile(depId, true); + } + } + for (const id of previouslyWatched) { + if (!this.watched.has(id)) { + this.fileWatcher.unwatch(id); + } + } + } + watchFile(id, isTransformDependency = false) { + if (!this.filter(id)) + return; + this.watched.add(id); + if (this.outputFiles.includes(id)) { + throw new Error('Cannot import the generated bundle'); + } + // this is necessary to ensure that any 'renamed' files + // continue to be watched following an error + this.fileWatcher.watch(id, isTransformDependency); + } +} + +export { Task, Watcher }; diff --git a/.pnpm-store/v3/files/5e/23929a751482caf9475312670566e1777c3545c2826ea6827193642c1db312915ba43f3332afee8cd392caa50b4c354877861c4aac5ec22e078e4c7fcb5830 b/.pnpm-store/v3/files/5e/23929a751482caf9475312670566e1777c3545c2826ea6827193642c1db312915ba43f3332afee8cd392caa50b4c354877861c4aac5ec22e078e4c7fcb5830 new file mode 100644 index 00000000..ac2a4aae --- /dev/null +++ b/.pnpm-store/v3/files/5e/23929a751482caf9475312670566e1777c3545c2826ea6827193642c1db312915ba43f3332afee8cd392caa50b4c354877861c4aac5ec22e078e4c7fcb5830 @@ -0,0 +1,546 @@ +/* + @license + Rollup.js v4.10.0 + Sat, 10 Feb 2024 05:58:12 GMT - commit 762420860765e8e46e24d48b38f5b98ca31735fa + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +const promises = require('node:fs/promises'); +const node_path = require('node:path'); +const process$1 = require('node:process'); +const node_url = require('node:url'); +const rollup = require('./rollup.js'); +const parseAst_js = require('./parseAst.js'); +const getLogFilter_js = require('../getLogFilter.js'); + +function batchWarnings(command) { + const silent = !!command.silent; + const logFilter = generateLogFilter(command); + let count = 0; + const deferredWarnings = new Map(); + let warningOccurred = false; + const add = (warning) => { + count += 1; + warningOccurred = true; + if (silent) + return; + if (warning.code in deferredHandlers) { + rollup.getOrCreate(deferredWarnings, warning.code, rollup.getNewArray).push(warning); + } + else if (warning.code in immediateHandlers) { + immediateHandlers[warning.code](warning); + } + else { + title(warning.message); + defaultBody(warning); + } + }; + return { + add, + get count() { + return count; + }, + flush() { + if (count === 0 || silent) + return; + const codes = [...deferredWarnings.keys()].sort((a, b) => deferredWarnings.get(b).length - deferredWarnings.get(a).length); + for (const code of codes) { + deferredHandlers[code](deferredWarnings.get(code)); + } + deferredWarnings.clear(); + count = 0; + }, + log(level, log) { + if (!logFilter(log)) + return; + switch (level) { + case parseAst_js.LOGLEVEL_WARN: { + return add(log); + } + case parseAst_js.LOGLEVEL_DEBUG: { + if (!silent) { + rollup.stderr(rollup.bold(rollup.blue(log.message))); + defaultBody(log); + } + return; + } + default: { + if (!silent) { + rollup.stderr(rollup.bold(rollup.cyan(log.message))); + defaultBody(log); + } + } + } + }, + get warningOccurred() { + return warningOccurred; + } + }; +} +const immediateHandlers = { + MISSING_NODE_BUILTINS(warning) { + title(`Missing shims for Node.js built-ins`); + rollup.stderr(`Creating a browser bundle that depends on ${parseAst_js.printQuotedStringList(warning.ids)}. You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`); + }, + UNKNOWN_OPTION(warning) { + title(`You have passed an unrecognized option`); + rollup.stderr(warning.message); + } +}; +const deferredHandlers = { + CIRCULAR_DEPENDENCY(warnings) { + title(`Circular dependenc${warnings.length > 1 ? 'ies' : 'y'}`); + const displayed = warnings.length > 5 ? warnings.slice(0, 3) : warnings; + for (const warning of displayed) { + rollup.stderr(warning.ids.map(parseAst_js.relativeId).join(' -> ')); + } + if (warnings.length > displayed.length) { + rollup.stderr(`...and ${warnings.length - displayed.length} more`); + } + }, + EMPTY_BUNDLE(warnings) { + title(`Generated${warnings.length === 1 ? ' an' : ''} empty ${warnings.length > 1 ? 'chunks' : 'chunk'}`); + rollup.stderr(parseAst_js.printQuotedStringList(warnings.map(warning => warning.names[0]))); + }, + EVAL(warnings) { + title('Use of eval is strongly discouraged'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_AVOIDING_EVAL)); + showTruncatedWarnings(warnings); + }, + MISSING_EXPORT(warnings) { + title('Missing exports'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_NAME_IS_NOT_EXPORTED)); + for (const warning of warnings) { + rollup.stderr(rollup.bold(parseAst_js.relativeId(warning.id))); + rollup.stderr(`${warning.binding} is not exported by ${parseAst_js.relativeId(warning.exporter)}`); + rollup.stderr(rollup.gray(warning.frame)); + } + }, + MISSING_GLOBAL_NAME(warnings) { + title(`Missing global variable ${warnings.length > 1 ? 'names' : 'name'}`); + info(parseAst_js.getRollupUrl(parseAst_js.URL_OUTPUT_GLOBALS)); + rollup.stderr(`Use "output.globals" to specify browser global variable names corresponding to external modules:`); + for (const warning of warnings) { + rollup.stderr(`${rollup.bold(warning.id)} (guessing "${warning.names[0]}")`); + } + }, + MIXED_EXPORTS(warnings) { + title('Mixing named and default exports'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_OUTPUT_EXPORTS)); + rollup.stderr(rollup.bold('The following entry modules are using named and default exports together:')); + warnings.sort((a, b) => (a.id < b.id ? -1 : 1)); + const displayedWarnings = warnings.length > 5 ? warnings.slice(0, 3) : warnings; + for (const warning of displayedWarnings) { + rollup.stderr(parseAst_js.relativeId(warning.id)); + } + if (displayedWarnings.length < warnings.length) { + rollup.stderr(`...and ${warnings.length - displayedWarnings.length} other entry modules`); + } + rollup.stderr(`\nConsumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`); + }, + NAMESPACE_CONFLICT(warnings) { + title(`Conflicting re-exports`); + for (const warning of warnings) { + rollup.stderr(`"${rollup.bold(parseAst_js.relativeId(warning.reexporter))}" re-exports "${warning.binding}" from both "${parseAst_js.relativeId(warning.ids[0])}" and "${parseAst_js.relativeId(warning.ids[1])}" (will be ignored).`); + } + }, + PLUGIN_WARNING(warnings) { + const nestedByPlugin = nest(warnings, 'plugin'); + for (const { key: plugin, items } of nestedByPlugin) { + const nestedByMessage = nest(items, 'message'); + let lastUrl = ''; + for (const { key: message, items } of nestedByMessage) { + title(`Plugin ${plugin}: ${message}`); + for (const warning of items) { + if (warning.url && warning.url !== lastUrl) + info((lastUrl = warning.url)); + const id = warning.id || warning.loc?.file; + if (id) { + let loc = parseAst_js.relativeId(id); + if (warning.loc) { + loc += `: (${warning.loc.line}:${warning.loc.column})`; + } + rollup.stderr(rollup.bold(loc)); + } + if (warning.frame) + info(warning.frame); + } + } + } + }, + SOURCEMAP_BROKEN(warnings) { + title(`Broken sourcemap`); + info(parseAst_js.getRollupUrl(parseAst_js.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT)); + const plugins = [...new Set(warnings.map(({ plugin }) => plugin).filter(Boolean))]; + rollup.stderr(`Plugins that transform code (such as ${parseAst_js.printQuotedStringList(plugins)}) should generate accompanying sourcemaps.`); + }, + THIS_IS_UNDEFINED(warnings) { + title('"this" has been rewritten to "undefined"'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_THIS_IS_UNDEFINED)); + showTruncatedWarnings(warnings); + }, + UNRESOLVED_IMPORT(warnings) { + title('Unresolved dependencies'); + info(parseAst_js.getRollupUrl(parseAst_js.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY)); + const dependencies = new Map(); + for (const warning of warnings) { + rollup.getOrCreate(dependencies, parseAst_js.relativeId(warning.exporter), rollup.getNewArray).push(parseAst_js.relativeId(warning.id)); + } + for (const [dependency, importers] of dependencies) { + rollup.stderr(`${rollup.bold(dependency)} (imported by ${parseAst_js.printQuotedStringList(importers)})`); + } + }, + UNUSED_EXTERNAL_IMPORT(warnings) { + title('Unused external imports'); + for (const warning of warnings) { + rollup.stderr(warning.names + + ' imported from external module "' + + warning.exporter + + '" but never used in ' + + parseAst_js.printQuotedStringList(warning.ids.map(parseAst_js.relativeId)) + + '.'); + } + } +}; +function defaultBody(log) { + if (log.url) { + info(parseAst_js.getRollupUrl(log.url)); + } + const id = log.loc?.file || log.id; + if (id) { + const loc = log.loc ? `${parseAst_js.relativeId(id)} (${log.loc.line}:${log.loc.column})` : parseAst_js.relativeId(id); + rollup.stderr(rollup.bold(parseAst_js.relativeId(loc))); + } + if (log.frame) + info(log.frame); +} +function title(string_) { + rollup.stderr(rollup.bold(rollup.yellow(`(!) ${string_}`))); +} +function info(url) { + rollup.stderr(rollup.gray(url)); +} +function nest(array, property) { + const nested = []; + const lookup = new Map(); + for (const item of array) { + const key = item[property]; + rollup.getOrCreate(lookup, key, () => { + const items = { + items: [], + key + }; + nested.push(items); + return items; + }).items.push(item); + } + return nested; +} +function showTruncatedWarnings(warnings) { + const nestedByModule = nest(warnings, 'id'); + const displayedByModule = nestedByModule.length > 5 ? nestedByModule.slice(0, 3) : nestedByModule; + for (const { key: id, items } of displayedByModule) { + rollup.stderr(rollup.bold(parseAst_js.relativeId(id))); + rollup.stderr(rollup.gray(items[0].frame)); + if (items.length > 1) { + rollup.stderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`); + } + } + if (nestedByModule.length > displayedByModule.length) { + rollup.stderr(`\n...and ${nestedByModule.length - displayedByModule.length} other files`); + } +} +function generateLogFilter(command) { + const filters = rollup.ensureArray(command.filterLogs).flatMap(filter => String(filter).split(',')); + if (process.env.ROLLUP_FILTER_LOGS) { + filters.push(...process.env.ROLLUP_FILTER_LOGS.split(',')); + } + return getLogFilter_js.getLogFilter(filters); +} + +const stdinName = '-'; +let stdinResult = null; +function stdinPlugin(argument) { + const suffix = typeof argument == 'string' && argument.length > 0 ? '.' + argument : ''; + return { + load(id) { + if (id === stdinName || id.startsWith(stdinName + '.')) { + return stdinResult || (stdinResult = readStdin()); + } + }, + name: 'stdin', + resolveId(id) { + if (id === stdinName) { + return id + suffix; + } + } + }; +} +function readStdin() { + return new Promise((resolve, reject) => { + const chunks = []; + process$1.stdin.setEncoding('utf8'); + process$1.stdin + .on('data', chunk => chunks.push(chunk)) + .on('end', () => { + const result = chunks.join(''); + resolve(result); + }) + .on('error', error => { + reject(error); + }); + }); +} + +function waitForInputPlugin() { + return { + async buildStart(options) { + const inputSpecifiers = Array.isArray(options.input) + ? options.input + : Object.keys(options.input); + let lastAwaitedSpecifier = null; + checkSpecifiers: while (true) { + for (const specifier of inputSpecifiers) { + if ((await this.resolve(specifier)) === null) { + if (lastAwaitedSpecifier !== specifier) { + rollup.stderr(`waiting for input ${rollup.bold(specifier)}...`); + lastAwaitedSpecifier = specifier; + } + await new Promise(resolve => setTimeout(resolve, 500)); + continue checkSpecifiers; + } + } + break; + } + }, + name: 'wait-for-input' + }; +} + +async function addCommandPluginsToInputOptions(inputOptions, command) { + if (command.stdin !== false) { + inputOptions.plugins.push(stdinPlugin(command.stdin)); + } + if (command.waitForBundleInput === true) { + inputOptions.plugins.push(waitForInputPlugin()); + } + await addPluginsFromCommandOption(command.plugin, inputOptions); +} +async function addPluginsFromCommandOption(commandPlugin, inputOptions) { + if (commandPlugin) { + const plugins = await rollup.normalizePluginOption(commandPlugin); + for (const plugin of plugins) { + if (/[={}]/.test(plugin)) { + // -p plugin=value + // -p "{transform(c,i){...}}" + await loadAndRegisterPlugin(inputOptions, plugin); + } + else { + // split out plugins joined by commas + // -p node-resolve,commonjs,buble + for (const p of plugin.split(',')) { + await loadAndRegisterPlugin(inputOptions, p); + } + } + } + } +} +async function loadAndRegisterPlugin(inputOptions, pluginText) { + let plugin = null; + let pluginArgument = undefined; + if (pluginText[0] === '{') { + // -p "{transform(c,i){...}}" + plugin = new Function('return ' + pluginText); + } + else { + const match = pluginText.match(/^([\w./:@\\^{|}-]+)(=(.*))?$/); + if (match) { + // -p plugin + // -p plugin=arg + pluginText = match[1]; + pluginArgument = new Function('return ' + match[3])(); + } + else { + throw new Error(`Invalid --plugin argument format: ${JSON.stringify(pluginText)}`); + } + if (!/^\.|^rollup-plugin-|[/@\\]/.test(pluginText)) { + // Try using plugin prefix variations first if applicable. + // Prefix order is significant - left has higher precedence. + for (const prefix of ['@rollup/plugin-', 'rollup-plugin-']) { + try { + plugin = await requireOrImport(prefix + pluginText); + break; + } + catch { + // if this does not work, we try requiring the actual name below + } + } + } + if (!plugin) { + try { + if (pluginText[0] == '.') + pluginText = node_path.resolve(pluginText); + // Windows absolute paths must be specified as file:// protocol URL + // Note that we do not have coverage for Windows-only code paths + else if (/^[A-Za-z]:\\/.test(pluginText)) { + pluginText = node_url.pathToFileURL(node_path.resolve(pluginText)).href; + } + plugin = await requireOrImport(pluginText); + } + catch (error) { + throw new Error(`Cannot load plugin "${pluginText}": ${error.message}.`); + } + } + } + // some plugins do not use `module.exports` for their entry point, + // in which case we try the named default export and the plugin name + if (typeof plugin === 'object') { + plugin = plugin.default || plugin[getCamelizedPluginBaseName(pluginText)]; + } + if (!plugin) { + throw new Error(`Cannot find entry for plugin "${pluginText}". The plugin needs to export a function either as "default" or "${getCamelizedPluginBaseName(pluginText)}" for Rollup to recognize it.`); + } + inputOptions.plugins.push(typeof plugin === 'function' ? plugin.call(plugin, pluginArgument) : plugin); +} +function getCamelizedPluginBaseName(pluginText) { + return (pluginText.match(/(@rollup\/plugin-|rollup-plugin-)(.+)$/)?.[2] || pluginText) + .split(/[/\\]/) + .slice(-1)[0] + .split('.')[0] + .split('-') + .map((part, index) => (index === 0 || !part ? part : part[0].toUpperCase() + part.slice(1))) + .join(''); +} +async function requireOrImport(pluginPath) { + try { + // eslint-disable-next-line unicorn/prefer-module + return require(pluginPath); + } + catch { + return import(pluginPath); + } +} + +const loadConfigFile = async (fileName, commandOptions = {}, watchMode = false) => { + const configs = await getConfigList(getDefaultFromCjs(await getConfigFileExport(fileName, commandOptions, watchMode)), commandOptions); + const warnings = batchWarnings(commandOptions); + try { + const normalizedConfigs = []; + for (const config of configs) { + const options = await rollup.mergeOptions(config, watchMode, commandOptions, warnings.log); + await addCommandPluginsToInputOptions(options, commandOptions); + normalizedConfigs.push(options); + } + return { options: normalizedConfigs, warnings }; + } + catch (error_) { + warnings.flush(); + throw error_; + } +}; +async function getConfigFileExport(fileName, commandOptions, watchMode) { + if (commandOptions.configPlugin || commandOptions.bundleConfigAsCjs) { + try { + return await loadTranspiledConfigFile(fileName, commandOptions); + } + catch (error_) { + if (error_.message.includes('not defined in ES module scope')) { + return parseAst_js.error(parseAst_js.logCannotBundleConfigAsEsm(error_)); + } + throw error_; + } + } + let cannotLoadEsm = false; + const handleWarning = (warning) => { + if (warning.message.includes('To load an ES module')) { + cannotLoadEsm = true; + } + }; + process$1.on('warning', handleWarning); + try { + const fileUrl = node_url.pathToFileURL(fileName); + if (watchMode) { + // We are adding the current date to allow reloads in watch mode + fileUrl.search = `?${Date.now()}`; + } + return (await import(fileUrl.href)).default; + } + catch (error_) { + if (cannotLoadEsm) { + return parseAst_js.error(parseAst_js.logCannotLoadConfigAsCjs(error_)); + } + if (error_.message.includes('not defined in ES module scope')) { + return parseAst_js.error(parseAst_js.logCannotLoadConfigAsEsm(error_)); + } + throw error_; + } + finally { + process$1.off('warning', handleWarning); + } +} +function getDefaultFromCjs(namespace) { + return namespace.default || namespace; +} +async function loadTranspiledConfigFile(fileName, commandOptions) { + const { bundleConfigAsCjs, configPlugin, silent } = commandOptions; + const warnings = batchWarnings(commandOptions); + const inputOptions = { + external: (id) => (id[0] !== '.' && !node_path.isAbsolute(id)) || id.slice(-5, id.length) === '.json', + input: fileName, + onwarn: warnings.add, + plugins: [], + treeshake: false + }; + await addPluginsFromCommandOption(configPlugin, inputOptions); + const bundle = await rollup.rollup(inputOptions); + const { output: [{ code }] } = await bundle.generate({ + exports: 'named', + format: bundleConfigAsCjs ? 'cjs' : 'es', + plugins: [ + { + name: 'transpile-import-meta', + resolveImportMeta(property, { moduleId }) { + if (property === 'url') { + return `'${node_url.pathToFileURL(moduleId).href}'`; + } + if (property == null) { + return `{url:'${node_url.pathToFileURL(moduleId).href}'}`; + } + } + } + ] + }); + if (!silent && warnings.count > 0) { + rollup.stderr(rollup.bold(`loaded ${parseAst_js.relativeId(fileName)} with warnings`)); + warnings.flush(); + } + return loadConfigFromWrittenFile(node_path.join(node_path.dirname(fileName), `rollup.config-${Date.now()}.${bundleConfigAsCjs ? 'cjs' : 'mjs'}`), code); +} +async function loadConfigFromWrittenFile(bundledFileName, bundledCode) { + await promises.writeFile(bundledFileName, bundledCode); + try { + return (await import(node_url.pathToFileURL(bundledFileName).href)).default; + } + finally { + promises.unlink(bundledFileName).catch(error => console.warn(error?.message || error)); + } +} +async function getConfigList(configFileExport, commandOptions) { + const config = await (typeof configFileExport === 'function' + ? configFileExport(commandOptions) + : configFileExport); + if (Object.keys(config).length === 0) { + return parseAst_js.error(parseAst_js.logMissingConfig()); + } + return Array.isArray(config) ? config : [config]; +} + +exports.addCommandPluginsToInputOptions = addCommandPluginsToInputOptions; +exports.batchWarnings = batchWarnings; +exports.loadConfigFile = loadConfigFile; +exports.stdinName = stdinName; +//# sourceMappingURL=loadConfigFile.js.map diff --git a/.pnpm-store/v3/files/5e/3660d91b3959d085a9fe5a6d28dfcd2e52986557cb8795ebab96f83ba0a113d673b6f2807527c6ab8287c6fc08d3d9e092e1894369c572e890e1ffe122356d b/.pnpm-store/v3/files/5e/3660d91b3959d085a9fe5a6d28dfcd2e52986557cb8795ebab96f83ba0a113d673b6f2807527c6ab8287c6fc08d3d9e092e1894369c572e890e1ffe122356d new file mode 100644 index 00000000..a3fe7168 --- /dev/null +++ b/.pnpm-store/v3/files/5e/3660d91b3959d085a9fe5a6d28dfcd2e52986557cb8795ebab96f83ba0a113d673b6f2807527c6ab8287c6fc08d3d9e092e1894369c572e890e1ffe122356d @@ -0,0 +1 @@ +{"version":3,"file":"prefer-enum-initializers.js","sourceRoot":"","sources":["../../src/rules/prefer-enum-initializers.ts"],"names":[],"mappings":";;AAEA,kCAAqC;AAIrC,kBAAe,IAAA,iBAAU,EAAiB;IACxC,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,6DAA6D;SAChE;QACD,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACR,iBAAiB,EACf,oEAAoE;YACtE,2BAA2B,EACzB,8CAA8C;SACjD;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,SAAS,iBAAiB,CAAC,IAAgC;YACzD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;YAEzB,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAChC,IAAI,MAAM,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;oBAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;oBAChD,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,MAAM;wBACZ,SAAS,EAAE,mBAAmB;wBAC9B,IAAI,EAAE;4BACJ,IAAI;yBACL;wBACD,OAAO,EAAE;4BACP;gCACE,SAAS,EAAE,6BAA6B;gCACxC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE;gCAChC,GAAG,EAAE,CAAC,KAAK,EAAoB,EAAE;oCAC/B,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,IAAI,MAAM,KAAK,EAAE,CAAC,CAAC;gCACzD,CAAC;6BACF;4BACD;gCACE,SAAS,EAAE,6BAA6B;gCACxC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,EAAE;gCACpC,GAAG,EAAE,CAAC,KAAK,EAAoB,EAAE;oCAC/B,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;gCAC7D,CAAC;6BACF;4BACD;gCACE,SAAS,EAAE,6BAA6B;gCACxC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,GAAG,EAAE;gCACtC,GAAG,EAAE,CAAC,KAAK,EAAoB,EAAE;oCAC/B,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,IAAI,OAAO,IAAI,GAAG,CAAC,CAAC;gCAC1D,CAAC;6BACF;yBACF;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,iBAAiB;SAClB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/5e/4f88b0712c66ac132d082fe136d3af199030e786614c59ddc5d49766ea955493a7b859bb957d1fb9c1a80e8c134fee34245866badb79efb9034721e33f62db b/.pnpm-store/v3/files/5e/4f88b0712c66ac132d082fe136d3af199030e786614c59ddc5d49766ea955493a7b859bb957d1fb9c1a80e8c134fee34245866badb79efb9034721e33f62db new file mode 100644 index 00000000..3ea9ee7f --- /dev/null +++ b/.pnpm-store/v3/files/5e/4f88b0712c66ac132d082fe136d3af199030e786614c59ddc5d49766ea955493a7b859bb957d1fb9c1a80e8c134fee34245866badb79efb9034721e33f62db @@ -0,0 +1 @@ +{"version":3,"file":"explicit-member-accessibility.js","sourceRoot":"","sources":["../../src/rules/explicit-member-accessibility.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/5e/50de01e3d32e49a52d36947a67e3b631ae86c13c13be0f0c43a77ccede5f11189069d2aee14d2cfc64d5de4ae294007bd8c5ab92e654b29080b0fb0ec5606a b/.pnpm-store/v3/files/5e/50de01e3d32e49a52d36947a67e3b631ae86c13c13be0f0c43a77ccede5f11189069d2aee14d2cfc64d5de4ae294007bd8c5ab92e654b29080b0fb0ec5606a new file mode 100644 index 00000000..a746baa0 --- /dev/null +++ b/.pnpm-store/v3/files/5e/50de01e3d32e49a52d36947a67e3b631ae86c13c13be0f0c43a77ccede5f11189069d2aee14d2cfc64d5de4ae294007bd8c5ab92e654b29080b0fb0ec5606a @@ -0,0 +1,37 @@ +/* + @license + Rollup.js v4.10.0 + Sat, 10 Feb 2024 05:58:12 GMT - commit 762420860765e8e46e24d48b38f5b98ca31735fa + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +let fsEvents; +let fsEventsImportError; +async function loadFsEvents() { + try { + ({ default: fsEvents } = await import('fsevents')); + } + catch (error) { + fsEventsImportError = error; + } +} +// A call to this function will be injected into the chokidar code +function getFsEvents() { + if (fsEventsImportError) + throw fsEventsImportError; + return fsEvents; +} + +const fseventsImporter = /*#__PURE__*/Object.defineProperty({ + __proto__: null, + getFsEvents, + loadFsEvents +}, Symbol.toStringTag, { value: 'Module' }); + +exports.fseventsImporter = fseventsImporter; +exports.loadFsEvents = loadFsEvents; +//# sourceMappingURL=fsevents-importer.js.map diff --git a/.pnpm-store/v3/files/5e/7720e8f6e559184590a06421faa4224e7f5e0c0057620c099b175c10e48c6d88aeaaebb9173e4aaadc263b00a65e10d9d47c29ab6358186e06873ee1a66c17 b/.pnpm-store/v3/files/5e/7720e8f6e559184590a06421faa4224e7f5e0c0057620c099b175c10e48c6d88aeaaebb9173e4aaadc263b00a65e10d9d47c29ab6358186e06873ee1a66c17 new file mode 100644 index 00000000..8866f6bc --- /dev/null +++ b/.pnpm-store/v3/files/5e/7720e8f6e559184590a06421faa4224e7f5e0c0057620c099b175c10e48c6d88aeaaebb9173e4aaadc263b00a65e10d9d47c29ab6358186e06873ee1a66c17 @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.arrayItemsEqual = exports.createLanguageServicePlugin = void 0; +const decorateLanguageService_1 = require("../node/decorateLanguageService"); +const decorateLanguageServiceHost_1 = require("../node/decorateLanguageServiceHost"); +const language_core_1 = require("@volar/language-core"); +const externalFiles = new WeakMap(); +const projectExternalFileExtensions = new WeakMap(); +const decoratedLanguageServices = new WeakSet(); +const decoratedLanguageServiceHosts = new WeakSet(); +function createLanguageServicePlugin(loadLanguagePlugins) { + return modules => { + const { typescript: ts } = modules; + const pluginModule = { + create(info) { + if (!decoratedLanguageServices.has(info.languageService) + && !decoratedLanguageServiceHosts.has(info.languageServiceHost)) { + decoratedLanguageServices.add(info.languageService); + decoratedLanguageServiceHosts.add(info.languageServiceHost); + const languagePlugins = loadLanguagePlugins(ts, info); + const extensions = languagePlugins + .map(plugin => plugin.typescript?.extraFileExtensions.map(ext => '.' + ext.extension) ?? []) + .flat(); + projectExternalFileExtensions.set(info.project, extensions); + const getScriptSnapshot = info.languageServiceHost.getScriptSnapshot.bind(info.languageServiceHost); + const files = (0, language_core_1.createFileRegistry)(languagePlugins, ts.sys.useCaseSensitiveFileNames, fileName => { + const snapshot = getScriptSnapshot(fileName); + if (snapshot) { + files.set(fileName, (0, language_core_1.resolveCommonLanguageId)(fileName), snapshot); + } + else { + files.delete(fileName); + } + }); + (0, decorateLanguageService_1.decorateLanguageService)(files, info.languageService); + (0, decorateLanguageServiceHost_1.decorateLanguageServiceHost)(files, info.languageServiceHost, ts); + } + return info.languageService; + }, + getExternalFiles(project, updateLevel = 0) { + if (updateLevel >= (1) + || !externalFiles.has(project)) { + const oldFiles = externalFiles.get(project); + const newFiles = (0, decorateLanguageServiceHost_1.searchExternalFiles)(ts, project, projectExternalFileExtensions.get(project)); + externalFiles.set(project, newFiles); + if (oldFiles && !arrayItemsEqual(oldFiles, newFiles)) { + project.refreshDiagnostics(); + } + } + return externalFiles.get(project); + }, + }; + return pluginModule; + }; +} +exports.createLanguageServicePlugin = createLanguageServicePlugin; +function arrayItemsEqual(a, b) { + if (a.length !== b.length) { + return false; + } + const set = new Set(a); + for (const file of b) { + if (!set.has(file)) { + return false; + } + } + return true; +} +exports.arrayItemsEqual = arrayItemsEqual; +//# sourceMappingURL=createLanguageServicePlugin.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/5f/1638a5e16f8f0b8a4d8def1708c520cd4be510b7b88b6cc90c2e0331056d4ad447c498479e1acf2ac52e2f21b5c98a97e8e48be4216bcaffe2e0a84e8e20e0 b/.pnpm-store/v3/files/5f/1638a5e16f8f0b8a4d8def1708c520cd4be510b7b88b6cc90c2e0331056d4ad447c498479e1acf2ac52e2f21b5c98a97e8e48be4216bcaffe2e0a84e8e20e0 new file mode 100644 index 00000000..a2e4c5da --- /dev/null +++ b/.pnpm-store/v3/files/5f/1638a5e16f8f0b8a4d8def1708c520cd4be510b7b88b6cc90c2e0331056d4ad447c498479e1acf2ac52e2f21b5c98a97e8e48be4216bcaffe2e0a84e8e20e0 @@ -0,0 +1,19 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +const presetWind = require('@unocss/preset-wind'); + +function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } + +const presetWind__default = /*#__PURE__*/_interopDefaultCompat(presetWind); + + + +exports.default = presetWind__default; +Object.keys(presetWind).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) k === '__proto__' ? Object.defineProperty(exports, k, { + enumerable: true, + value: presetWind[k] + }) : exports[k] = presetWind[k]; +}); diff --git a/.pnpm-store/v3/files/5f/1a0e82286516e680e3b89ab0d13de897375c20d2f109dccb3b571c268722d9f9bd2c9af1ea6990442d90801ed2fea4a1b2fecdeb6a1c961dc47945085750e9 b/.pnpm-store/v3/files/5f/1a0e82286516e680e3b89ab0d13de897375c20d2f109dccb3b571c268722d9f9bd2c9af1ea6990442d90801ed2fea4a1b2fecdeb6a1c961dc47945085750e9 new file mode 100644 index 00000000..54e2d92f --- /dev/null +++ b/.pnpm-store/v3/files/5f/1a0e82286516e680e3b89ab0d13de897375c20d2f109dccb3b571c268722d9f9bd2c9af1ea6990442d90801ed2fea4a1b2fecdeb6a1c961dc47945085750e9 @@ -0,0 +1 @@ +{"version":3,"file":"func-call-spacing.js","sourceRoot":"","sources":["../../src/rules/func-call-spacing.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/5f/1fd0a53fc13463e519bfdb0a51da348dcbe13a48a49357d4d26fa88700af81084f0de39ddd3714c14687e314f6edc49960ec07ec2e6367da1b2ff975c50594 b/.pnpm-store/v3/files/5f/1fd0a53fc13463e519bfdb0a51da348dcbe13a48a49357d4d26fa88700af81084f0de39ddd3714c14687e314f6edc49960ec07ec2e6367da1b2ff975c50594 new file mode 100644 index 00000000..1cfcf0ce --- /dev/null +++ b/.pnpm-store/v3/files/5f/1fd0a53fc13463e519bfdb0a51da348dcbe13a48a49357d4d26fa88700af81084f0de39ddd3714c14687e314f6edc49960ec07ec2e6367da1b2ff975c50594 @@ -0,0 +1,52 @@ +var implementation = require('../implementation'); +var callBind = require('call-bind'); +var test = require('tape'); +var runTests = require('./tests'); + +var hasStrictMode = require('has-strict-mode')(); + +test('as a function', function (t) { + t.test('bad array/this value', function (st) { + /* eslint no-useless-call: 1 */ + st['throws'](function () { implementation.call(undefined, 'a'); }, TypeError, 'undefined is not an object'); + st['throws'](function () { implementation.call(null, 'a'); }, TypeError, 'null is not an object'); + st.end(); + }); + + t.test('receiver boxing', function (st) { + st.plan(hasStrictMode ? 3 : 2); + + var context = 'x'; + + implementation.call( + 'f', + function () { + st.equal(typeof this, 'object'); + st.equal(String.prototype.toString.call(this), context); + }, + context + ); + + st.test('strict mode', { skip: !hasStrictMode }, function (sst) { + sst.plan(2); + + implementation.call( + 'f', + function () { + 'use strict'; + + sst.equal(typeof this, 'string'); + sst.equal(this, context); + }, + context + ); + sst.end(); + }); + + st.end(); + }); + + runTests(callBind(implementation), t); + + t.end(); +}); diff --git a/.pnpm-store/v3/files/5f/a2e012ae2deb0fa850e40344f657261148044e44e378fb45f820975ab1af0d4269cf9a091449bbf52561e557b95c477ca3719f62712522ea1cf725a6837f8c b/.pnpm-store/v3/files/5f/a2e012ae2deb0fa850e40344f657261148044e44e378fb45f820975ab1af0d4269cf9a091449bbf52561e557b95c477ca3719f62712522ea1cf725a6837f8c new file mode 100644 index 00000000..f3409284 --- /dev/null +++ b/.pnpm-store/v3/files/5f/a2e012ae2deb0fa850e40344f657261148044e44e378fb45f820975ab1af0d4269cf9a091449bbf52561e557b95c477ca3719f62712522ea1cf725a6837f8c @@ -0,0 +1,45 @@ +{ + "name": "@unocss/transformer-compile-class", + "version": "0.58.5", + "description": "Compile group of classes into one class", + "author": "Anthony Fu ", + "license": "MIT", + "funding": "https://github.com/sponsors/antfu", + "homepage": "https://github.com/unocss/unocss/tree/main/packages/transformer-compile-class#readme", + "repository": { + "type": "git", + "url": "https://github.com/unocss/unocss", + "directory": "packages/transformer-compile-class" + }, + "bugs": { + "url": "https://github.com/unocss/unocss/issues" + }, + "keywords": [ + "unocss", + "unocss-transformer" + ], + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + } + }, + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "dependencies": { + "@unocss/core": "0.58.5" + }, + "devDependencies": { + "magic-string": "^0.30.6" + }, + "scripts": { + "build": "unbuild", + "stub": "unbuild --stub" + } +} \ No newline at end of file diff --git a/.pnpm-store/v3/files/60/1df8b399f74877bdc3208c7b049129571b2a981d494538bbe06145b040d4dcfca97993a1224b6f42ee5a90d4f0e1544ef5d5d2cd0b2e8965afd6636f325d32 b/.pnpm-store/v3/files/60/1df8b399f74877bdc3208c7b049129571b2a981d494538bbe06145b040d4dcfca97993a1224b6f42ee5a90d4f0e1544ef5d5d2cd0b2e8965afd6636f325d32 new file mode 100644 index 00000000..d85156db --- /dev/null +++ b/.pnpm-store/v3/files/60/1df8b399f74877bdc3208c7b049129571b2a981d494538bbe06145b040d4dcfca97993a1224b6f42ee5a90d4f0e1544ef5d5d2cd0b2e8965afd6636f325d32 @@ -0,0 +1 @@ +{"version":3,"file":"space-infix-ops.js","sourceRoot":"","sources":["../../src/rules/space-infix-ops.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/60/b1d94e363dbdb22f058cd2ef39096cc66998f2d9333c3223ae7c04a604c6b7b578c25ed820ccbf8e5d6ed74a63631bab28fc38cb9e5c6aff44f1223730f2a6 b/.pnpm-store/v3/files/60/b1d94e363dbdb22f058cd2ef39096cc66998f2d9333c3223ae7c04a604c6b7b578c25ed820ccbf8e5d6ed74a63631bab28fc38cb9e5c6aff44f1223730f2a6 new file mode 100644 index 00000000..318cef0b --- /dev/null +++ b/.pnpm-store/v3/files/60/b1d94e363dbdb22f058cd2ef39096cc66998f2d9333c3223ae7c04a604c6b7b578c25ed820ccbf8e5d6ed74a63631bab28fc38cb9e5c6aff44f1223730f2a6 @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = require('es-errors/type'); +var $SyntaxError = require('es-errors/syntax'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://262.ecma-international.org/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (Type(intrinsic) !== 'Object') { + throw new $TypeError('intrinsicDefaultProto must be an object'); + } + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $SyntaxError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/.pnpm-store/v3/files/60/b4389333ec4d03681fb2818289376d3e8c0f0155c813b61fe9d11ab43330e40223f6817da8b82d5ea2a05696873009023ad7965b86c1d3053f1f426ef3dcfa b/.pnpm-store/v3/files/60/b4389333ec4d03681fb2818289376d3e8c0f0155c813b61fe9d11ab43330e40223f6817da8b82d5ea2a05696873009023ad7965b86c1d3053f1f426ef3dcfa new file mode 100644 index 00000000..d31a89e2 --- /dev/null +++ b/.pnpm-store/v3/files/60/b4389333ec4d03681fb2818289376d3e8c0f0155c813b61fe9d11ab43330e40223f6817da8b82d5ea2a05696873009023ad7965b86c1d3053f1f426ef3dcfa @@ -0,0 +1,3 @@ +import type * as vscode from 'vscode-languageserver-protocol'; +import type { ServiceContext } from '../types'; +export declare function register(context: ServiceContext): (item: vscode.CodeAction, token?: vscode.CancellationToken) => Promise; diff --git a/.pnpm-store/v3/files/60/c83d9cc59a0457f8d5cdef2a76d56b6f979436b83c177dd984307c0b41ed75a500eb4267458f038d2787f1e9216501ee8e8dddc697a5d108d214b60d1a3d6a b/.pnpm-store/v3/files/60/c83d9cc59a0457f8d5cdef2a76d56b6f979436b83c177dd984307c0b41ed75a500eb4267458f038d2787f1e9216501ee8e8dddc697a5d108d214b60d1a3d6a new file mode 100644 index 00000000..9fef60f5 --- /dev/null +++ b/.pnpm-store/v3/files/60/c83d9cc59a0457f8d5cdef2a76d56b6f979436b83c177dd984307c0b41ed75a500eb4267458f038d2787f1e9216501ee8e8dddc697a5d108d214b60d1a3d6a @@ -0,0 +1,5 @@ +import type { ServiceEnvironment } from '@volar/language-service'; +import * as vscode from 'vscode-languageserver'; +export declare function createConfigurationHost(params: vscode.InitializeParams, connection: vscode.Connection): Pick & { + ready(): void; +}; diff --git a/.pnpm-store/v3/files/60/d8c8553f4af31976603f27227ba46a453ef365868e8c837964e77c9915a446f8122fa7f70c5ca78c7c371eba23696d3637d2ea2fc004d2bd99b9f45ef0cef0 b/.pnpm-store/v3/files/60/d8c8553f4af31976603f27227ba46a453ef365868e8c837964e77c9915a446f8122fa7f70c5ca78c7c371eba23696d3637d2ea2fc004d2bd99b9f45ef0cef0 new file mode 100644 index 00000000..a4e862ca --- /dev/null +++ b/.pnpm-store/v3/files/60/d8c8553f4af31976603f27227ba46a453ef365868e8c837964e77c9915a446f8122fa7f70c5ca78c7c371eba23696d3637d2ea2fc004d2bd99b9f45ef0cef0 @@ -0,0 +1,12 @@ +'use strict'; + +const colors = require('@unocss/preset-mini/colors'); + + + +Object.keys(colors).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) k === '__proto__' ? Object.defineProperty(exports, k, { + enumerable: true, + value: colors[k] + }) : exports[k] = colors[k]; +}); diff --git a/.pnpm-store/v3/files/61/046bb453ada7cd45f1b1a15460105bd10e3c0af29896224e98a60f14a95fbdacccf439e7dff23b3c3edcb672374794a9218f5e562c32a2d35236a39cb31637 b/.pnpm-store/v3/files/61/046bb453ada7cd45f1b1a15460105bd10e3c0af29896224e98a60f14a95fbdacccf439e7dff23b3c3edcb672374794a9218f5e562c32a2d35236a39cb31637 new file mode 100644 index 00000000..a0a1784a --- /dev/null +++ b/.pnpm-store/v3/files/61/046bb453ada7cd45f1b1a15460105bd10e3c0af29896224e98a60f14a95fbdacccf439e7dff23b3c3edcb672374794a9218f5e562c32a2d35236a39cb31637 @@ -0,0 +1 @@ +{"version":3,"file":"consistent-type-definitions.js","sourceRoot":"","sources":["../../src/rules/consistent-type-definitions.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/61/0cd7ffe94865b86e5505186c62841c71bfbff3e63490754f7b8d756b668e3f14b2e1ebbf3ca7f781e7827d75aae20a67421a64c8844daa725d9565afdc9ebe b/.pnpm-store/v3/files/61/0cd7ffe94865b86e5505186c62841c71bfbff3e63490754f7b8d756b668e3f14b2e1ebbf3ca7f781e7827d75aae20a67421a64c8844daa725d9565afdc9ebe new file mode 100644 index 00000000..309ac190 --- /dev/null +++ b/.pnpm-store/v3/files/61/0cd7ffe94865b86e5505186c62841c71bfbff3e63490754f7b8d756b668e3f14b2e1ebbf3ca7f781e7827d75aae20a67421a64c8844daa725d9565afdc9ebe @@ -0,0 +1,38 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +var isPropertyDescriptor = require('../helpers/records/property-descriptor'); + +// https://262.ecma-international.org/5.1/#sec-8.10.4 + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor'); + } + + if (IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + +}; diff --git a/.pnpm-store/v3/files/61/14700036d1bab49b39c88db1884d3b103e54813ba88e3e4998ba939dc2553ea7c2e5f8bd5af150004be69cef1d7d91ab9455dc18954d6f1df1647395dac089 b/.pnpm-store/v3/files/61/14700036d1bab49b39c88db1884d3b103e54813ba88e3e4998ba939dc2553ea7c2e5f8bd5af150004be69cef1d7d91ab9455dc18954d6f1df1647395dac089 new file mode 100644 index 00000000..039fff98 --- /dev/null +++ b/.pnpm-store/v3/files/61/14700036d1bab49b39c88db1884d3b103e54813ba88e3e4998ba939dc2553ea7c2e5f8bd5af150004be69cef1d7d91ab9455dc18954d6f1df1647395dac089 @@ -0,0 +1 @@ +{"version":3,"file":"consistent-generic-constructors.js","sourceRoot":"","sources":["../../src/rules/consistent-generic-constructors.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/61/96bbd3533298d88feb33cad40ce88f9814c2e83280315d04c9f7b4bb0f4729b45e67400a4432bb48e64fcc7ce390ade6d0a8b8cca6dfa38a948d7df91cc3fb b/.pnpm-store/v3/files/61/96bbd3533298d88feb33cad40ce88f9814c2e83280315d04c9f7b4bb0f4729b45e67400a4432bb48e64fcc7ce390ade6d0a8b8cca6dfa38a948d7df91cc3fb new file mode 100644 index 00000000..14497f7b --- /dev/null +++ b/.pnpm-store/v3/files/61/96bbd3533298d88feb33cad40ce88f9814c2e83280315d04c9f7b4bb0f4729b45e67400a4432bb48e64fcc7ce390ade6d0a8b8cca6dfa38a948d7df91cc3fb @@ -0,0 +1,43 @@ +--- +description: 'Enforce consistent spacing before blocks.' +--- + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/space-before-blocks** for documentation. + +This rule extends the base [`eslint/space-before-blocks`](https://eslint.org/docs/rules/space-before-blocks) rule. +It adds support for interfaces and enums. + + + +### ❌ Incorrect + + +```ts +enum Breakpoint{ + Large, + Medium, +} + +interface State{ + currentBreakpoint: Breakpoint; +} +``` + +### ✅ Correct + +```ts +enum Breakpoint { + Large, + Medium, +} + +interface State { + currentBreakpoint: Breakpoint; +} +``` + +## Options + +In case a more specific options object is passed these blocks will follow `classes` configuration option. diff --git a/.pnpm-store/v3/files/61/cb6c37bbf7d2cc6e093ea196719fbe3f198834f10f617ca8768588c2ff975b9ddd204c9c1585d640b28a7179755b9cc6003c1a7695c11ab39afc8368368d1f b/.pnpm-store/v3/files/61/cb6c37bbf7d2cc6e093ea196719fbe3f198834f10f617ca8768588c2ff975b9ddd204c9c1585d640b28a7179755b9cc6003c1a7695c11ab39afc8368368d1f new file mode 100644 index 00000000..10c4a7a6 --- /dev/null +++ b/.pnpm-store/v3/files/61/cb6c37bbf7d2cc6e093ea196719fbe3f198834f10f617ca8768588c2ff975b9ddd204c9c1585d640b28a7179755b9cc6003c1a7695c11ab39afc8368368d1f @@ -0,0 +1,64 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// SEE https://typescript-eslint.io/linting/configs +// +// For developers working in the typescript-eslint monorepo: +// You can regenerate it using `yarn generate:configs` +module.exports = { + parserOptions: { project: false, program: null }, + rules: { + '@typescript-eslint/await-thenable': 'off', + '@typescript-eslint/consistent-type-exports': 'off', + '@typescript-eslint/dot-notation': 'off', + '@typescript-eslint/naming-convention': 'off', + '@typescript-eslint/no-array-delete': 'off', + '@typescript-eslint/no-base-to-string': 'off', + '@typescript-eslint/no-confusing-void-expression': 'off', + '@typescript-eslint/no-duplicate-type-constituents': 'off', + '@typescript-eslint/no-floating-promises': 'off', + '@typescript-eslint/no-for-in-array': 'off', + '@typescript-eslint/no-implied-eval': 'off', + '@typescript-eslint/no-meaningless-void-operator': 'off', + '@typescript-eslint/no-misused-promises': 'off', + '@typescript-eslint/no-mixed-enums': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'off', + '@typescript-eslint/no-throw-literal': 'off', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', + '@typescript-eslint/no-unnecessary-condition': 'off', + '@typescript-eslint/no-unnecessary-qualifier': 'off', + '@typescript-eslint/no-unnecessary-type-arguments': 'off', + '@typescript-eslint/no-unnecessary-type-assertion': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-enum-comparison': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-unary-minus': 'off', + '@typescript-eslint/no-useless-template-literals': 'off', + '@typescript-eslint/non-nullable-type-assertion-style': 'off', + '@typescript-eslint/prefer-destructuring': 'off', + '@typescript-eslint/prefer-find': 'off', + '@typescript-eslint/prefer-includes': 'off', + '@typescript-eslint/prefer-nullish-coalescing': 'off', + '@typescript-eslint/prefer-optional-chain': 'off', + '@typescript-eslint/prefer-promise-reject-errors': 'off', + '@typescript-eslint/prefer-readonly': 'off', + '@typescript-eslint/prefer-readonly-parameter-types': 'off', + '@typescript-eslint/prefer-reduce-type-parameter': 'off', + '@typescript-eslint/prefer-regexp-exec': 'off', + '@typescript-eslint/prefer-return-this-type': 'off', + '@typescript-eslint/prefer-string-starts-ends-with': 'off', + '@typescript-eslint/promise-function-async': 'off', + '@typescript-eslint/require-array-sort-compare': 'off', + '@typescript-eslint/require-await': 'off', + '@typescript-eslint/restrict-plus-operands': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/return-await': 'off', + '@typescript-eslint/strict-boolean-expressions': 'off', + '@typescript-eslint/switch-exhaustiveness-check': 'off', + '@typescript-eslint/unbound-method': 'off', + }, +}; +//# sourceMappingURL=disable-type-checked.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/61/d0c1441cf28bc72e968faf7bedbbcc47f3a4aae33d49f7fe31c493077af2754782b6d655c4bd9a82f6306d7eee1f80bea396e86c3b72e4c6f96c032abbc633 b/.pnpm-store/v3/files/61/d0c1441cf28bc72e968faf7bedbbcc47f3a4aae33d49f7fe31c493077af2754782b6d655c4bd9a82f6306d7eee1f80bea396e86c3b72e4c6f96c032abbc633 new file mode 100644 index 00000000..71745fe4 --- /dev/null +++ b/.pnpm-store/v3/files/61/d0c1441cf28bc72e968faf7bedbbcc47f3a4aae33d49f7fe31c493077af2754782b6d655c4bd9a82f6306d7eee1f80bea396e86c3b72e4c6f96c032abbc633 @@ -0,0 +1,46 @@ +/* +We purposely don't generate types for our plugin because TL;DR: +1) there's no real reason that anyone should do a typed import of our rules, +2) it would require us to change our code so there aren't as many inferred types + +This type declaration exists as a hacky way to add a type to the export for our +internal packages that require it. + +*** Long reason *** + +When you turn on declaration files, TS requires all types to be "fully resolvable" +without changes to the code. +All of our lint rules `export default createRule(...)`, which means they all +implicitly reference the `TSESLint.Rule` type for the export. + +TS wants to transpile each rule file to this `.d.ts` file: + +```ts +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule; +export default _default; +``` + +Because we don't import `TSESLint` in most files, it means that TS would have to +insert a new import during the declaration emit to make this work. +However TS wants to avoid adding new imports to the file because a new module +could have type side-effects (like global augmentation) which could cause weird +type side-effects in the decl file that wouldn't exist in source TS file. + +So TS errors on most of our rules with the following error: +``` +The inferred type of 'default' cannot be named without a reference to +'../../../../node_modules/@typescript-eslint/utils/src/ts-eslint/Rule'. +This is likely not portable. A type annotation is necessary. ts(2742) +``` +*/ + +import type { RuleModule } from '@typescript-eslint/utils/ts-eslint'; + +export type TypeScriptESLintRules = Record< + string, + RuleModule +>; +declare const rules: TypeScriptESLintRules; +// eslint-disable-next-line import/no-default-export +export default rules; diff --git a/.pnpm-store/v3/files/61/e49135b312f853f1ea7bd5e3d152df500c6bf9e45e6437120093633903ae84ee5f13d95c867e34601ce6980b99cb9d86b0f7b96994c4839e264042729f7d91 b/.pnpm-store/v3/files/61/e49135b312f853f1ea7bd5e3d152df500c6bf9e45e6437120093633903ae84ee5f13d95c867e34601ce6980b99cb9d86b0f7b96994c4839e264042729f7d91 new file mode 100644 index 00000000..25339070 --- /dev/null +++ b/.pnpm-store/v3/files/61/e49135b312f853f1ea7bd5e3d152df500c6bf9e45e6437120093633903ae84ee5f13d95c867e34601ce6980b99cb9d86b0f7b96994c4839e264042729f7d91 @@ -0,0 +1 @@ +{"version":3,"file":"eslint-recommended-raw.js","sourceRoot":"","sources":["../../src/configs/eslint-recommended-raw.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;;AAEvE;;;;GAIG;AACH,kBAAe,CACb,KAA2B,EAI3B,EAAE,CAAC,CAAC;IACJ,KAAK,EACH,KAAK,KAAK,MAAM;QACd,CAAC,CAAC,kCAAkC;YAClC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;QACrC,CAAC,CAAC,oCAAoC;YACpC,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC;IACrD,KAAK,EAAE;QACL,mBAAmB,EAAE,KAAK,EAAE,sBAAsB;QAClD,eAAe,EAAE,KAAK,EAAE,WAAW;QACnC,iBAAiB,EAAE,KAAK,EAAE,WAAW;QACrC,cAAc,EAAE,KAAK,EAAE,WAAW;QAClC,uBAAuB,EAAE,KAAK,EAAE,sBAAsB;QACtD,cAAc,EAAE,KAAK,EAAE,WAAW;QAClC,gBAAgB,EAAE,KAAK,EAAE,WAAW;QACpC,kBAAkB,EAAE,KAAK,EAAE,sBAAsB;QACjD,eAAe,EAAE,KAAK,EAAE,WAAW;QACnC,cAAc,EAAE,KAAK,EAAE,WAAW;QAClC,cAAc,EAAE,KAAK,EAAE,WAAW;QAClC,kBAAkB,EAAE,KAAK,EAAE,WAAW;QACtC,sBAAsB,EAAE,KAAK,EAAE,uBAAuB;QACtD,UAAU,EAAE,KAAK,EAAE,sBAAsB;QACzC,gBAAgB,EAAE,KAAK,EAAE,WAAW;QACpC,oBAAoB,EAAE,KAAK,EAAE,iCAAiC;QAC9D,QAAQ,EAAE,OAAO,EAAE,+DAA+D;QAClF,cAAc,EAAE,OAAO,EAAE,sCAAsC;QAC/D,oBAAoB,EAAE,OAAO,EAAE,yDAAyD;QACxF,eAAe,EAAE,OAAO,EAAE,6DAA6D;KACxF;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/61/e50a46c185044d2c6c1bd6458a3dce7195247b3750af9e7da065d9326d3cb961089c3c7273780d0f88c4ba837652624c77844bd8606c13817d01c5a03de80a b/.pnpm-store/v3/files/61/e50a46c185044d2c6c1bd6458a3dce7195247b3750af9e7da065d9326d3cb961089c3c7273780d0f88c4ba837652624c77844bd8606c13817d01c5a03de80a new file mode 100644 index 00000000..08437aa6 --- /dev/null +++ b/.pnpm-store/v3/files/61/e50a46c185044d2c6c1bd6458a3dce7195247b3750af9e7da065d9326d3cb961089c3c7273780d0f88c4ba837652624c77844bd8606c13817d01c5a03de80a @@ -0,0 +1,584 @@ +type QueryValue = string | number | undefined | null | boolean | Array | Record; +type QueryObject = Record; +type ParsedQuery = Record; +/** + * Parses and decodes a query string into an object. + * + * input can be a query string with or without the leading `?` + * + * @note + * The `__proto__` and `constructor` keys are ignored to prevent prototype pollution. + * + * @group qeury + */ +declare function parseQuery(parametersString?: string): T; +/** + * Encodes a pair of key and value into a url query string value. + * + * If the value is an array, it will be encoded as multiple key-value pairs with the same key. + * + * @group qeury + */ +declare function encodeQueryItem(key: string, value: QueryValue | QueryValue[]): string; +/** + * Stringfies and encodes a query object into a query string. + * + * @group qeury + */ +declare function stringifyQuery(query: QueryObject): string; + +/** + * Encode characters that need to be encoded on the path, search and hash + * sections of the URL. + * + * @group encoding + * + * @param text - string to encode + * @returns encoded string + */ +declare function encode(text: string | number): string; +/** + * Encode characters that need to be encoded on the hash section of the URL. + * + * @group encoding + * + * @param text - string to encode + * @returns encoded string + */ +declare function encodeHash(text: string): string; +/** + * Encode characters that need to be encoded query values on the query + * section of the URL. + * + * @group encoding + * + * @param input - string to encode + * @returns encoded string + */ +declare function encodeQueryValue(input: QueryValue): string; +/** + * Encode characters that need to be encoded query values on the query + * section of the URL and also encodes the `=` character. + * + * @group encoding + * + * @param text - string to encode + */ +declare function encodeQueryKey(text: string | number): string; +/** + * Encode characters that need to be encoded on the path section of the URL. + * + * @group encoding + * + * @param text - string to encode + * @returns encoded string + */ +declare function encodePath(text: string | number): string; +/** + * Encode characters that need to be encoded on the path section of the URL as a + * param. This function encodes everything `encodePath` does plus the + * slash (`/`) character. + * + * @group encoding + * + * @param text - string to encode + * @returns encoded string + */ +declare function encodeParam(text: string | number): string; +/** + * Decode text using `decodeURIComponent`. Returns the original text if it + * fails. + * + * @group encoding + * + * @param text - string to decode + * @returns decoded string + */ +declare function decode(text?: string | number): string; +/** + * Decode path section of URL (consistent with encodePath for slash encoding). + * + * @group encoding + * + * @param text - string to decode + * @returns decoded string + */ +declare function decodePath(text: string): string; +/** + * Decodes query key (consistent with `encodeQueryKey` for plus encoding). + * + * @group encoding + * + * @param text - string to decode + * @returns decoded string + */ +declare function decodeQueryKey(text: string): string; +/** + * Decode query value (consistent with encodeQueryValue for plus encoding). + * + * @group encoding + * + * @param text - string to decode + * @returns decoded string + */ +declare function decodeQueryValue(text: string): string; +/** + * Encodes hostname with punycode encoding. + * + * @group encoding + */ +declare function encodeHost(name?: string): string; + +declare const protocolRelative: unique symbol; +interface ParsedURL { + protocol?: string; + host?: string; + auth?: string; + href?: string; + pathname: string; + hash: string; + search: string; + [protocolRelative]?: boolean; +} +interface ParsedAuth { + username: string; + password: string; +} +interface ParsedHost { + hostname: string; + port: string; +} +/** + * Takes a URL string and returns an object with the URL's `protocol`, `auth`, `host`, `pathname`, `search`, and `hash`. + * + * @example + * + * ```js + * parseURL("http://foo.com/foo?test=123#token"); + * // { protocol: 'http:', auth: '', host: 'foo.com', pathname: '/foo', search: '?test=123', hash: '#token' } + * + * parseURL("foo.com/foo?test=123#token"); + * // { pathname: 'foo.com/foo', search: '?test=123', hash: '#token' } + * + * parseURL("foo.com/foo?test=123#token", "https://"); + * // { protocol: 'https:', auth: '', host: 'foo.com', pathname: '/foo', search: '?test=123', hash: '#token' } + * ``` + * + * @group parsing + * + * @param [input] - The URL to parse. + * @param [defaultProto] - The default protocol to use if the input doesn't have one. + * @returns A parsed URL object. + */ +declare function parseURL(input?: string, defaultProto?: string): ParsedURL; +/** + * Splits the input string into three parts, and returns an object with those three parts. + * + * @group parsing + * + * @param [input] - The URL to parse. + * @returns An object with three properties: `pathname`, `search`, and `hash`. + */ +declare function parsePath(input?: string): ParsedURL; +/** + * Takes a string of the form `username:password` and returns an object with the username and + * password decoded. + * + * @group parsing + * + * @param [input] - The URL to parse. + * @returns An object with two properties: username and password. + */ +declare function parseAuth(input?: string): ParsedAuth; +/** + * Takes a string, and returns an object with two properties: `hostname` and `port`. + * + * @group parsing + * + * @param [input] - The URL to parse. + * @returns A function that takes a string and returns an object with two properties: `hostname` and + * `port`. + */ +declare function parseHost(input?: string): ParsedHost; +/** + * Takes a `ParsedURL` object and returns the stringified URL. + * + * @group parsing + * + * @example + * + * ```js + * const obj = parseURL("http://foo.com/foo?test=123#token"); + * obj.host = "bar.com"; + * + * stringifyParsedURL(obj); // "http://bar.com/foo?test=123#token" + * ``` + * + * @param [parsed] - The parsed URL + * @returns A stringified URL. + */ +declare function stringifyParsedURL(parsed: Partial): string; +/** + * Parses a url and returns last segment in path as filename. + * + * If `{ strict: true }` is passed as the second argument, it will only return the last segment only if ending with an extension. + * + * @group parsing + * + * @example + * + * ```js + * // Result: filename.ext + * parseFilename("http://example.com/path/to/filename.ext"); + * + * // Result: undefined + * parseFilename("/path/to/.hidden-file", { strict: true }); + * ``` + */ +declare function parseFilename(input: string, { strict }: { + strict: any; +}): string | undefined; + +/** + * @deprecated use native URL with `new URL(input)` or `ufo.parseURL(input)` + */ +declare class $URL implements URL { + protocol: string; + host: string; + auth: string; + pathname: string; + query: QueryObject; + hash: string; + constructor(input?: string); + get hostname(): string; + get port(): string; + get username(): string; + get password(): string; + get hasProtocol(): number; + get isAbsolute(): number | boolean; + get search(): string; + get searchParams(): URLSearchParams; + get origin(): string; + get fullpath(): string; + get encodedAuth(): string; + get href(): string; + append(url: $URL): void; + toJSON(): string; + toString(): string; +} +/** + * @deprecated use native URL with `new URL(input)` or `ufo.parseURL(input)` + */ +declare function createURL(input: string): $URL; + +/** + * Check if a path starts with `./` or `../`. + * + * @example + * ```js + * isRelative("./foo"); // true + * ``` + * + * @group utils + */ +declare function isRelative(inputString: string): boolean; +interface HasProtocolOptions { + acceptRelative?: boolean; + strict?: boolean; +} +/** + * Checks if the input has a protocol. + * + * You can use `{ acceptRelative: true }` to accept relative URLs as valid protocol. + * + * @group utils + */ +declare function hasProtocol(inputString: string, opts?: HasProtocolOptions): boolean; +/** @deprecated Same as { hasProtocol(inputString, { acceptRelative: true }) */ +declare function hasProtocol(inputString: string, acceptRelative: boolean): boolean; +/** + * Checks if the input protocol is any of the dangerous `blob:`, `data:`, `javascript`: or `vbscript:` protocols. + * + * @group utils + */ +declare function isScriptProtocol(protocol?: string): boolean; +/** + * Checks if the input has a trailing slash. + * + * @group utils + */ +declare function hasTrailingSlash(input?: string, respectQueryAndFragment?: boolean): boolean; +/** + * Removes trailing slash from the URL or pathname. + * + * If second argument is is true, it will only remove the trailing slash if it's not part of the query or fragment with cost of more expensive operations. + * + * @example + * + * ```js + * withoutTrailingSlash("/foo/"); // "/foo" + * + * withoutTrailingSlash("/path/?query=true", true); // "/path?query=true" + * ``` + * + * @group utils + */ +declare function withoutTrailingSlash(input?: string, respectQueryAndFragment?: boolean): string; +/** + * Ensures url ends with a trailing slash. + * + * If seccond argument is `true`, it will only add the trailing slash if it's not part of the query or fragment with cost of more expensive operation. + * + * @example + * + * ```js + * withTrailingSlash("/foo"); // "/foo/" + * + * withTrailingSlash("/path?query=true", true); // "/path/?query=true" + * ``` + * + * @group utils + */ +declare function withTrailingSlash(input?: string, respectQueryAndFragment?: boolean): string; +/** + * Checks if the input has a leading slash. (e.g. `/foo`) + * + * @group utils + */ +declare function hasLeadingSlash(input?: string): boolean; +/** + * Removes leading slash from the URL or pathname. + * + * @group utils + */ +declare function withoutLeadingSlash(input?: string): string; +/** + * Ensures the URL or pathname has a leading slash. + * + * @group utils + */ +declare function withLeadingSlash(input?: string): string; +/** + * Removes double slashes from the URL. + * + * @example + * + * ```js + * cleanDoubleSlashes("//foo//bar//"); // "/foo/bar/" + * + * cleanDoubleSlashes("http://example.com/analyze//http://localhost:3000//"); + * // Returns "http://example.com/analyze/http://localhost:3000/" + * ``` + * + * @group utils + */ +declare function cleanDoubleSlashes(input?: string): string; +/** + * Ensures the URL or pathname has a trailing slash. + * + * If input aleady start with base, it will not be added again. + * + * @group utils + */ +declare function withBase(input: string, base: string): string; +/** + * Removes the base from the URL or pathname. + * + * If input does not start with base, it will not be removed. + * + * @group utils + */ +declare function withoutBase(input: string, base: string): string; +/** + * Add/Replace the query section of the URL. + * + * @example + * + * ```js + * withQuery("/foo?page=a", { token: "secret" }); // "/foo?page=a&token=secret" + * ``` + * + * @group utils + */ +declare function withQuery(input: string, query: QueryObject): string; +/** + * Parses and decods the query object of an input URL into an object. + * + * @example + * + * ```js + * getQuery("http://foo.com/foo?test=123&unicode=%E5%A5%BD"); + * // { test: "123", unicode: "好" } + * ``` + * @group utils + */ +declare function getQuery(input: string): T; +/** + * Checks if the input url is empty or `/`. + * + * @group utils + */ +declare function isEmptyURL(url: string): boolean; +/** + * Checks if the input url is not empty nor `/`. + * + * @group utils + */ +declare function isNonEmptyURL(url: string): boolean; +/** + * Joins multiple URL segments into a single URL. + * + * @example + * + * ```js + * joinURL("a", "/b", "/c"); // "a/b/c" + * ``` + * + * @group utils + */ +declare function joinURL(base: string, ...input: string[]): string; +/** + * Adds or replaces url protocol to `http://`. + * + * @example + * + * ```js + * withHttp("https://example.com"); // http://example.com + * ``` + * + * @group utils + */ +declare function withHttp(input: string): string; +/** + * Adds or replaces url protocol to `https://`. + * + * @example + * + * ```js + * withHttps("http://example.com"); // https://example.com + * ``` + * + * @group utils + */ +declare function withHttps(input: string): string; +/** + * Removes the protocol from the input. + * + * @example + * ```js + * withoutProtocol("http://example.com"); // "example.com" + * ``` + */ +declare function withoutProtocol(input: string): string; +/** + * Adds or Replaces protocol of the input URL. + * + * @example + * ```js + * withProtocol("http://example.com", "ftp://"); // "ftp://example.com" + * ``` + * + * @group utils + */ +declare function withProtocol(input: string, protocol: string): string; +/** + * Normlizes inputed url: + * + * - Ensures url is properly encoded + * - Ensures pathname starts with slash + * - Preserves protocol/host if provided + * + * @example + * + * ```js + * normalizeURL("test?query=123 123#hash, test"); + * // Returns "test?query=123%20123#hash,%20test" + * + * normalizeURL("http://localhost:3000"); + * // Returns "http://localhost:3000" + * ``` + * + * @group utils + */ +declare function normalizeURL(input: string): string; +/** + * Resolves multiple URL segments into a single URL. + * + * @example + * + * ```js + * resolveURL("http://foo.com/foo?test=123#token", "bar", "baz"); + * // Returns "http://foo.com/foo/bar/baz?test=123#token" + * ``` + * + * @group utils + */ +declare function resolveURL(base?: string, ...inputs: string[]): string; +/** + * Check two paths are equal or not. Trailing slash and encoding are normalized before comparison. + * + * @example + * ```js + * isSamePath("/foo", "/foo/"); // true + * ``` + * + * @group utils + */ +declare function isSamePath(p1: string, p2: string): boolean; +interface CompareURLOptions { + trailingSlash?: boolean; + leadingSlash?: boolean; + encoding?: boolean; +} +/** + * Checks if two paths are equal regardless of encoding, trailing slash, and leading slash differences. + * + * You can make slash check strict by setting `{ trailingSlash: true, leadingSlash: true }` as options. + * + * You can make encoding check strict by setting `{ encoding: true }` as options. + * + * @example + * + * ```js + * isEqual("/foo", "foo"); // true + * isEqual("foo/", "foo"); // true + * isEqual("/foo bar", "/foo%20bar"); // true + * + * // Strict compare + * isEqual("/foo", "foo", { leadingSlash: true }); // false + * isEqual("foo/", "foo", { trailingSlash: true }); // false + * isEqual("/foo bar", "/foo%20bar", { encoding: true }); // false + * ``` + * + * @group utils + */ +declare function isEqual(a: string, b: string, options?: CompareURLOptions): boolean; +/** + * Add/Replace the fragment section of the URL. + * + * @example + * + * ```js + * withFragment("/foo", "bar"); // "/foo#bar" + * withFragment("/foo#bar", "baz"); // "/foo#baz" + * withFragment("/foo#bar", ""); // "/foo" + * ``` + * + * @group utils + */ +declare function withFragment(input: string, hash: string): string; +/** + * Removes the fragment section from the URL. + * + * @example + * + * ```js + * withoutFragment("http://example.com/foo?q=123#bar") + * // Returns "http://example.com/foo?q=123" + * ``` + * + * @group utils + */ +declare function withoutFragment(input: string): string; + +export { $URL, type HasProtocolOptions, type ParsedAuth, type ParsedHost, type ParsedQuery, type ParsedURL, type QueryObject, type QueryValue, cleanDoubleSlashes, createURL, decode, decodePath, decodeQueryKey, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isEqual, isNonEmptyURL, isRelative, isSamePath, isScriptProtocol, joinURL, normalizeURL, parseAuth, parseFilename, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withFragment, withHttp, withHttps, withLeadingSlash, withProtocol, withQuery, withTrailingSlash, withoutBase, withoutFragment, withoutLeadingSlash, withoutProtocol, withoutTrailingSlash }; diff --git a/.pnpm-store/v3/files/62/0431d063d0ed7fe5a9156987561b65f6f71ab4422d4f540651160dde3cdfed4221d3c41d0e174a874e230ecd3e2ded8dd20b89380adfd3709045b8741202dc b/.pnpm-store/v3/files/62/0431d063d0ed7fe5a9156987561b65f6f71ab4422d4f540651160dde3cdfed4221d3c41d0e174a874e230ecd3e2ded8dd20b89380adfd3709045b8741202dc new file mode 100644 index 00000000..756a025e --- /dev/null +++ b/.pnpm-store/v3/files/62/0431d063d0ed7fe5a9156987561b65f6f71ab4422d4f540651160dde3cdfed4221d3c41d0e174a874e230ecd3e2ded8dd20b89380adfd3709045b8741202dc @@ -0,0 +1,13 @@ +import type { + ClassicConfig, + FlatConfig, +} from '@typescript-eslint/utils/ts-eslint'; + +import type rules from './rules'; + +declare const cjsExport: { + configs: Record; + meta: FlatConfig.PluginMeta; + rules: typeof rules; +}; +export = cjsExport; diff --git a/.pnpm-store/v3/files/62/1316f5d5018702d66bb752e6fe8e292c2560ca34c6745fa56712d55cbf6f7b95f2573578e428fe52c33dd495c5dd9e2356f2931524d51d8caefda19c941e16 b/.pnpm-store/v3/files/62/1316f5d5018702d66bb752e6fe8e292c2560ca34c6745fa56712d55cbf6f7b95f2573578e428fe52c33dd495c5dd9e2356f2931524d51d8caefda19c941e16 new file mode 100644 index 00000000..1ba4ade7 --- /dev/null +++ b/.pnpm-store/v3/files/62/1316f5d5018702d66bb752e6fe8e292c2560ca34c6745fa56712d55cbf6f7b95f2573578e428fe52c33dd495c5dd9e2356f2931524d51d8caefda19c941e16 @@ -0,0 +1,16 @@ +type TypedArrayName = + | 'Int8Array' + | 'Uint8Array' + | 'Uint8ClampedArray' + | 'Int16Array' + | 'Uint16Array' + | 'Int32Array' + | 'Uint32Array' + | 'Float32Array' + | 'Float64Array' + | 'BigInt64Array' + | 'BigUint64Array'; + +declare function whichTypedArray(value: unknown): TypedArrayName | false | null; + +export = whichTypedArray; \ No newline at end of file diff --git a/.pnpm-store/v3/files/62/184d68c14885f2ce6bc345fec80a9297664e02c9681856bc1915b7fe90ff5066400fde2f9a96f3f46b343fcdde61cebb5334be44923c7a889dfb7e6cbc4fe7 b/.pnpm-store/v3/files/62/184d68c14885f2ce6bc345fec80a9297664e02c9681856bc1915b7fe90ff5066400fde2f9a96f3f46b343fcdde61cebb5334be44923c7a889dfb7e6cbc4fe7 new file mode 100644 index 00000000..07385c9a --- /dev/null +++ b/.pnpm-store/v3/files/62/184d68c14885f2ce6bc345fec80a9297664e02c9681856bc1915b7fe90ff5066400fde2f9a96f3f46b343fcdde61cebb5334be44923c7a889dfb7e6cbc4fe7 @@ -0,0 +1,27 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var callBound = require('call-bind/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); + +// https://262.ecma-international.org/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (typeof tag !== 'string' || typeof attribute !== 'string') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/.pnpm-store/v3/files/62/2e824b982aed8ca53c4b0931ba301e57d08d507c530c8a9552a2d2cd12cd4418de74a5f2ea5403c716b11a176bf25829004b4403a6a25e5f66dfbb455d2b72 b/.pnpm-store/v3/files/62/2e824b982aed8ca53c4b0931ba301e57d08d507c530c8a9552a2d2cd12cd4418de74a5f2ea5403c716b11a176bf25829004b4403a6a25e5f66dfbb455d2b72 new file mode 100644 index 00000000..8cf091b4 --- /dev/null +++ b/.pnpm-store/v3/files/62/2e824b982aed8ca53c4b0931ba301e57d08d507c530c8a9552a2d2cd12cd4418de74a5f2ea5403c716b11a176bf25829004b4403a6a25e5f66dfbb455d2b72 @@ -0,0 +1,33 @@ +--- +description: 'Require or disallow padding lines between statements.' +--- + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/padding-line-between-statements** for documentation. + +This rule extends the base [`eslint/padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) rule. +It adds support for TypeScript constructs such as `interface` and `type`. + +## Options + +In addition to options provided by ESLint, `interface` and `type` can be used as statement types. + +For example, to add blank lines before interfaces and type definitions: + +```jsonc +{ + // Example - Add blank lines before interface and type definitions. + "padding-line-between-statements": "off", + "@typescript-eslint/padding-line-between-statements": [ + "error", + { + "blankLine": "always", + "prev": "*", + "next": ["interface", "type"], + }, + ], +} +``` + +**Note:** ESLint `cjs-export` and `cjs-import` statement types are renamed to `exports` and `require` respectively. diff --git a/.pnpm-store/v3/files/62/3ee3c727404cdca0d8b01bbf80ac58738664e1c6590aa6186c973499072f22d32653a8210ffec8c1c6e68aea4d644438f8e0e6425b3a1bf03d1a6f77402a1a b/.pnpm-store/v3/files/62/3ee3c727404cdca0d8b01bbf80ac58738664e1c6590aa6186c973499072f22d32653a8210ffec8c1c6e68aea4d644438f8e0e6425b3a1bf03d1a6f77402a1a new file mode 100644 index 00000000..dad87016 --- /dev/null +++ b/.pnpm-store/v3/files/62/3ee3c727404cdca0d8b01bbf80ac58738664e1c6590aa6186c973499072f22d32653a8210ffec8c1c6e68aea4d644438f8e0e6425b3a1bf03d1a6f77402a1a @@ -0,0 +1,562 @@ +/* + @license + Rollup.js v4.10.0 + Sat, 10 Feb 2024 05:58:12 GMT - commit 762420860765e8e46e24d48b38f5b98ca31735fa + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +'use strict'; + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const promises = require('node:fs/promises'); +const process$2 = require('node:process'); +const index = require('./index.js'); +const cli = require('../bin/rollup'); +const rollup = require('./rollup.js'); +const parseAst_js = require('./parseAst.js'); +const loadConfigFile_js = require('./loadConfigFile.js'); +const node_child_process = require('node:child_process'); +const rollup_js = require('../rollup.js'); +require('fs'); +require('util'); +require('stream'); +require('path'); +require('os'); +require('./fsevents-importer.js'); +require('events'); +require('node:path'); +require('tty'); +require('node:perf_hooks'); +require('../native.js'); +require('node:url'); +require('../getLogFilter.js'); + +function timeZone(date = new Date()) { + const offset = date.getTimezoneOffset(); + const absOffset = Math.abs(offset); + const hours = Math.floor(absOffset / 60); + const minutes = absOffset % 60; + const minutesOut = minutes > 0 ? ':' + ('0' + minutes).slice(-2) : ''; + return (offset < 0 ? '+' : '-') + hours + minutesOut; +} + +function dateTime(options = {}) { + let { + date = new Date(), + local = true, + showTimeZone = false, + showMilliseconds = false + } = options; + + if (local) { + // Offset the date so it will return the correct value when getting the ISO string. + date = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)); + } + + let end = ''; + + if (showTimeZone) { + end = ' UTC' + (local ? timeZone(date) : ''); + } + + if (showMilliseconds && date.getUTCMilliseconds() > 0) { + end = ` ${date.getUTCMilliseconds()}ms${end}`; + } + + return date + .toISOString() + .replace(/T/, ' ') + .replace(/\..+/, end); +} + +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +const signals = []; +signals.push('SIGHUP', 'SIGINT', 'SIGTERM'); +if (process.platform !== 'win32') { + signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ); +} +if (process.platform === 'linux') { + signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT'); +} + +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +const processOk = (process) => !!process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function'; +const kExitEmitter = Symbol.for('signal-exit emitter'); +const global = globalThis; +const ObjectDefineProperty = Object.defineProperty.bind(Object); +// teeny special purpose ee +class Emitter { + emitted = { + afterExit: false, + exit: false, + }; + listeners = { + afterExit: [], + exit: [], + }; + count = 0; + id = Math.random(); + constructor() { + if (global[kExitEmitter]) { + return global[kExitEmitter]; + } + ObjectDefineProperty(global, kExitEmitter, { + value: this, + writable: false, + enumerable: false, + configurable: false, + }); + } + on(ev, fn) { + this.listeners[ev].push(fn); + } + removeListener(ev, fn) { + const list = this.listeners[ev]; + const i = list.indexOf(fn); + /* c8 ignore start */ + if (i === -1) { + return; + } + /* c8 ignore stop */ + if (i === 0 && list.length === 1) { + list.length = 0; + } + else { + list.splice(i, 1); + } + } + emit(ev, code, signal) { + if (this.emitted[ev]) { + return false; + } + this.emitted[ev] = true; + let ret = false; + for (const fn of this.listeners[ev]) { + ret = fn(code, signal) === true || ret; + } + if (ev === 'exit') { + ret = this.emit('afterExit', code, signal) || ret; + } + return ret; + } +} +class SignalExitBase { +} +const signalExitWrap = (handler) => { + return { + onExit(cb, opts) { + return handler.onExit(cb, opts); + }, + load() { + return handler.load(); + }, + unload() { + return handler.unload(); + }, + }; +}; +class SignalExitFallback extends SignalExitBase { + onExit() { + return () => { }; + } + load() { } + unload() { } +} +class SignalExit extends SignalExitBase { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + /* c8 ignore start */ + #hupSig = process$1.platform === 'win32' ? 'SIGINT' : 'SIGHUP'; + /* c8 ignore stop */ + #emitter = new Emitter(); + #process; + #originalProcessEmit; + #originalProcessReallyExit; + #sigListeners = {}; + #loaded = false; + constructor(process) { + super(); + this.#process = process; + // { : , ... } + this.#sigListeners = {}; + for (const sig of signals) { + this.#sigListeners[sig] = () => { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + const listeners = this.#process.listeners(sig); + let { count } = this.#emitter; + // This is a workaround for the fact that signal-exit v3 and signal + // exit v4 are not aware of each other, and each will attempt to let + // the other handle it, so neither of them do. To correct this, we + // detect if we're the only handler *except* for previous versions + // of signal-exit, and increment by the count of listeners it has + // created. + /* c8 ignore start */ + const p = process; + if (typeof p.__signal_exit_emitter__ === 'object' && + typeof p.__signal_exit_emitter__.count === 'number') { + count += p.__signal_exit_emitter__.count; + } + /* c8 ignore stop */ + if (listeners.length === count) { + this.unload(); + const ret = this.#emitter.emit('exit', null, sig); + /* c8 ignore start */ + const s = sig === 'SIGHUP' ? this.#hupSig : sig; + if (!ret) + process.kill(process.pid, s); + /* c8 ignore stop */ + } + }; + } + this.#originalProcessReallyExit = process.reallyExit; + this.#originalProcessEmit = process.emit; + } + onExit(cb, opts) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return () => { }; + } + /* c8 ignore stop */ + if (this.#loaded === false) { + this.load(); + } + const ev = opts?.alwaysLast ? 'afterExit' : 'exit'; + this.#emitter.on(ev, cb); + return () => { + this.#emitter.removeListener(ev, cb); + if (this.#emitter.listeners['exit'].length === 0 && + this.#emitter.listeners['afterExit'].length === 0) { + this.unload(); + } + }; + } + load() { + if (this.#loaded) { + return; + } + this.#loaded = true; + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + this.#emitter.count += 1; + for (const sig of signals) { + try { + const fn = this.#sigListeners[sig]; + if (fn) + this.#process.on(sig, fn); + } + catch (_) { } + } + this.#process.emit = (ev, ...a) => { + return this.#processEmit(ev, ...a); + }; + this.#process.reallyExit = (code) => { + return this.#processReallyExit(code); + }; + } + unload() { + if (!this.#loaded) { + return; + } + this.#loaded = false; + signals.forEach(sig => { + const listener = this.#sigListeners[sig]; + /* c8 ignore start */ + if (!listener) { + throw new Error('Listener not defined for signal: ' + sig); + } + /* c8 ignore stop */ + try { + this.#process.removeListener(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }); + this.#process.emit = this.#originalProcessEmit; + this.#process.reallyExit = this.#originalProcessReallyExit; + this.#emitter.count -= 1; + } + #processReallyExit(code) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return 0; + } + this.#process.exitCode = code || 0; + /* c8 ignore stop */ + this.#emitter.emit('exit', this.#process.exitCode, null); + return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); + } + #processEmit(ev, ...args) { + const og = this.#originalProcessEmit; + if (ev === 'exit' && processOk(this.#process)) { + if (typeof args[0] === 'number') { + this.#process.exitCode = args[0]; + /* c8 ignore start */ + } + /* c8 ignore start */ + const ret = og.call(this.#process, ev, ...args); + /* c8 ignore start */ + this.#emitter.emit('exit', this.#process.exitCode, null); + /* c8 ignore stop */ + return ret; + } + else { + return og.call(this.#process, ev, ...args); + } + } +} +const process$1 = globalThis.process; +// wrap so that we call the method on the actual handler, without +// exporting it directly. +const { +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +onExit, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +load, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +unload, } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback()); + +const CLEAR_SCREEN = '\u001Bc'; +function getResetScreen(configs, allowClearScreen) { + let clearScreen = allowClearScreen; + for (const config of configs) { + if (config.watch && config.watch.clearScreen === false) { + clearScreen = false; + } + } + if (clearScreen) { + return (heading) => rollup.stderr(CLEAR_SCREEN + heading); + } + let firstRun = true; + return (heading) => { + if (firstRun) { + rollup.stderr(heading); + firstRun = false; + } + }; +} + +function extractWatchHooks(command) { + if (!Array.isArray(command.watch)) + return {}; + return command.watch + .filter(value => typeof value === 'object') + .reduce((accumulator, keyValueOption) => ({ ...accumulator, ...keyValueOption }), {}); +} +function createWatchHooks(command) { + const watchHooks = extractWatchHooks(command); + return function (hook) { + if (watchHooks[hook]) { + const cmd = watchHooks[hook]; + if (!command.silent) { + rollup.stderr(rollup.cyan$1(`watch.${hook} ${rollup.bold(`$ ${cmd}`)}`)); + } + try { + // !! important - use stderr for all writes from execSync + const stdio = [process.stdin, process.stderr, process.stderr]; + node_child_process.execSync(cmd, { stdio: command.silent ? 'ignore' : stdio }); + } + catch (error) { + rollup.stderr(error.message); + } + } + }; +} + +async function watch(command) { + process$2.env.ROLLUP_WATCH = 'true'; + const isTTY = process$2.stderr.isTTY; + const silent = command.silent; + let watcher; + let configWatcher; + let resetScreen; + const configFile = command.config ? await cli.getConfigPath(command.config) : null; + const runWatchHook = createWatchHooks(command); + onExit(close); + process$2.on('uncaughtException', closeWithError); + if (!process$2.stdin.isTTY) { + process$2.stdin.on('end', close); + process$2.stdin.resume(); + } + async function loadConfigFromFileAndTrack(configFile) { + let configFileData = null; + let configFileRevision = 0; + configWatcher = index.chokidar.watch(configFile).on('change', reloadConfigFile); + await reloadConfigFile(); + async function reloadConfigFile() { + try { + const newConfigFileData = await promises.readFile(configFile, 'utf8'); + if (newConfigFileData === configFileData) { + return; + } + configFileRevision++; + const currentConfigFileRevision = configFileRevision; + if (configFileData) { + rollup.stderr(`\nReloading updated config...`); + } + configFileData = newConfigFileData; + const { options, warnings } = await loadConfigFile_js.loadConfigFile(configFile, command, true); + if (currentConfigFileRevision !== configFileRevision) { + return; + } + if (watcher) { + await watcher.close(); + } + start(options, warnings); + } + catch (error) { + rollup.handleError(error, true); + } + } + } + if (configFile) { + await loadConfigFromFileAndTrack(configFile); + } + else { + const { options, warnings } = await cli.loadConfigFromCommand(command, true); + await start(options, warnings); + } + async function start(configs, warnings) { + watcher = rollup_js.watch(configs); + watcher.on('event', event => { + switch (event.code) { + case 'ERROR': { + warnings.flush(); + rollup.handleError(event.error, true); + runWatchHook('onError'); + break; + } + case 'START': { + if (!silent) { + if (!resetScreen) { + resetScreen = getResetScreen(configs, isTTY); + } + resetScreen(rollup.underline(`rollup v${rollup.version}`)); + } + runWatchHook('onStart'); + break; + } + case 'BUNDLE_START': { + if (!silent) { + let input = event.input; + if (typeof input !== 'string') { + input = Array.isArray(input) + ? input.join(', ') + : Object.values(input).join(', '); + } + rollup.stderr(rollup.cyan$1(`bundles ${rollup.bold(input)} → ${rollup.bold(event.output.map(parseAst_js.relativeId).join(', '))}...`)); + } + runWatchHook('onBundleStart'); + break; + } + case 'BUNDLE_END': { + warnings.flush(); + if (!silent) + rollup.stderr(rollup.green(`created ${rollup.bold(event.output.map(parseAst_js.relativeId).join(', '))} in ${rollup.bold(cli.prettyMilliseconds(event.duration))}`)); + runWatchHook('onBundleEnd'); + if (event.result && event.result.getTimings) { + cli.printTimings(event.result.getTimings()); + } + break; + } + case 'END': { + runWatchHook('onEnd'); + if (!silent && isTTY) { + rollup.stderr(`\n[${dateTime()}] waiting for changes...`); + } + } + } + if ('result' in event && event.result) { + event.result.close().catch(error => rollup.handleError(error, true)); + } + }); + } + async function close(code) { + process$2.removeListener('uncaughtException', closeWithError); + // removing a non-existent listener is a no-op + process$2.stdin.removeListener('end', close); + if (watcher) + await watcher.close(); + if (configWatcher) + configWatcher.close(); + if (code) + process$2.exit(code); + } + // return a promise that never resolves to keep the process running + return new Promise(() => { }); +} +function closeWithError(error) { + error.name = `Uncaught ${error.name}`; + rollup.handleError(error); +} + +exports.watch = watch; +//# sourceMappingURL=watch-cli.js.map diff --git a/.pnpm-store/v3/files/62/4007c4c7b531dfa21f54b088480271d995f850cd933c3b5cf5dc6a6a60106ce154a19229b6de83ddf70c4aa87fb4b64e67accd5c3c44a7e67edf0409562808 b/.pnpm-store/v3/files/62/4007c4c7b531dfa21f54b088480271d995f850cd933c3b5cf5dc6a6a60106ce154a19229b6de83ddf70c4aa87fb4b64e67accd5c3c44a7e67edf0409562808 new file mode 100644 index 00000000..dd62775f --- /dev/null +++ b/.pnpm-store/v3/files/62/4007c4c7b531dfa21f54b088480271d995f850cd933c3b5cf5dc6a6a60106ce154a19229b6de83ddf70c4aa87fb4b64e67accd5c3c44a7e67edf0409562808 @@ -0,0 +1,47 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var callBound = require('call-bind/callBound'); +var $indexOf = callBound('String.prototype.indexOf', true); + +var Canonicalize = require('./Canonicalize'); + +var caseFolding = require('../helpers/caseFolding.json'); +var forEach = require('../helpers/forEach'); +var isRegExpRecord = require('../helpers/records/regexp-record'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var basicWordChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'; // step 1 + +// https://262.ecma-international.org/14.0/#sec-runtime-semantics-wordcharacters-abstract-operation + +module.exports = function WordCharacters(rer) { + if (!isRegExpRecord(rer)) { + throw new $TypeError('Assertion failed: `rer` must be a RegExp Record'); + } + + var extraWordChars = ''; + forEach(OwnPropertyKeys(caseFolding.C), function (c) { + if ( + $indexOf(basicWordChars, c) === -1 // c not in A + && $indexOf(basicWordChars, Canonicalize(rer, c)) > -1 // canonicalized c IS in A + ) { + extraWordChars += caseFolding.C[c]; // step 3 + } + }); + forEach(OwnPropertyKeys(caseFolding.S), function (c) { + if ( + $indexOf(basicWordChars, c) === -1 // c not in A + && $indexOf(basicWordChars, Canonicalize(rer, c)) > -1 // canonicalized c IS in A + ) { + extraWordChars += caseFolding.S[c]; // step 3 + } + }); + + if ((!rer['[[Unicode]]'] || !rer['[[IgnoreCase]]']) && extraWordChars.length > 0) { + throw new $TypeError('Assertion failed: `extraWordChars` must be empty when `rer.[[IgnoreCase]]` and `rer.[[Unicode]]` are not both true'); // step 3 + } + + return basicWordChars + extraWordChars; // step 4 +}; diff --git a/.pnpm-store/v3/files/62/86f6d6af91f071bf9e8d25167d42f1a9b2a85a11f35d2478d2c44bcc1d79010da8d56be415cf41444aee27f2d24267c891b9bafedd3b1f555f7a362fc7487f b/.pnpm-store/v3/files/62/86f6d6af91f071bf9e8d25167d42f1a9b2a85a11f35d2478d2c44bcc1d79010da8d56be415cf41444aee27f2d24267c891b9bafedd3b1f555f7a362fc7487f new file mode 100644 index 00000000..57cfc3b4 --- /dev/null +++ b/.pnpm-store/v3/files/62/86f6d6af91f071bf9e8d25167d42f1a9b2a85a11f35d2478d2c44bcc1d79010da8d56be415cf41444aee27f2d24267c891b9bafedd3b1f555f7a362fc7487f @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.register = void 0; +const featureWorkers_1 = require("../utils/featureWorkers"); +const common_1 = require("../utils/common"); +const cancellation_1 = require("../utils/cancellation"); +const language_core_1 = require("@volar/language-core"); +function register(context) { + return (uri, color, range, token = cancellation_1.NoneCancellationToken) => { + return (0, featureWorkers_1.languageFeatureWorker)(context, uri, () => range, function* (map) { + for (const mappedRange of map.getGeneratedRanges(range, language_core_1.isColorEnabled)) { + yield mappedRange; + } + }, (service, document, range) => { + if (token.isCancellationRequested) { + return; + } + return service[1].provideColorPresentations?.(document, color, range, token); + }, (data, map) => { + if (!map) { + return data; + } + return data + .map(colorPresentation => { + if (colorPresentation.textEdit) { + const range = map.getSourceRange(colorPresentation.textEdit.range); + if (!range) { + return undefined; + } + colorPresentation.textEdit.range = range; + } + if (colorPresentation.additionalTextEdits) { + for (const textEdit of colorPresentation.additionalTextEdits) { + const range = map.getSourceRange(textEdit.range); + if (!range) { + return undefined; + } + textEdit.range = range; + } + } + return colorPresentation; + }) + .filter(common_1.notEmpty); + }); + }; +} +exports.register = register; +//# sourceMappingURL=provideColorPresentations.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/62/aa1e3a51737c0537549a448476827a6c1e7a19ff54a9a96a52ddefb05b765db4c34eb95fa7a86d7fc0ab668838815756db8e127f606d19272ea4d75e097560 b/.pnpm-store/v3/files/62/aa1e3a51737c0537549a448476827a6c1e7a19ff54a9a96a52ddefb05b765db4c34eb95fa7a86d7fc0ab668838815756db8e127f606d19272ea4d75e097560 new file mode 100644 index 00000000..dda738aa --- /dev/null +++ b/.pnpm-store/v3/files/62/aa1e3a51737c0537549a448476827a6c1e7a19ff54a9a96a52ddefb05b765db4c34eb95fa7a86d7fc0ab668838815756db8e127f606d19272ea4d75e097560 @@ -0,0 +1,16 @@ +'use strict'; + +var callBound = require('call-bind/callBound'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://262.ecma-international.org/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (typeof value === 'number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/.pnpm-store/v3/files/62/d115ce38c1d6a967cd3ff583cacf070592790432674fda048eb5a92f9fc21faace3a7968920f68f223a288062c7fe7fd32c263f17a97f7903b59a1604f86cc b/.pnpm-store/v3/files/62/d115ce38c1d6a967cd3ff583cacf070592790432674fda048eb5a92f9fc21faace3a7968920f68f223a288062c7fe7fd32c263f17a97f7903b59a1604f86cc new file mode 100644 index 00000000..b05a9536 --- /dev/null +++ b/.pnpm-store/v3/files/62/d115ce38c1d6a967cd3ff583cacf070592790432674fda048eb5a92f9fc21faace3a7968920f68f223a288062c7fe7fd32c263f17a97f7903b59a1604f86cc @@ -0,0 +1,8 @@ +export { createTaskCollector, getCurrentSuite, getFn, getHooks, setFn, setHooks } from '@vitest/runner'; +export { createChainable } from '@vitest/runner/utils'; +export { g as getBenchFn, a as getBenchOptions } from './vendor/benchmark.IlKmJkUU.js'; +import '@vitest/utils'; +import './vendor/index.rJjbcrrp.js'; +import 'pathe'; +import 'std-env'; +import './vendor/global.CkGT_TMy.js'; diff --git a/.pnpm-store/v3/files/62/d4fd51cb2d4c6e58ab2e31b4b882966d59a4cfe95951859e401af7451f764919b11d5e3f6991ff58db1de629f00cb59752473f21afa14611ea8dce9f93619b-index.json b/.pnpm-store/v3/files/62/d4fd51cb2d4c6e58ab2e31b4b882966d59a4cfe95951859e401af7451f764919b11d5e3f6991ff58db1de629f00cb59752473f21afa14611ea8dce9f93619b-index.json new file mode 100644 index 00000000..6974d02f --- /dev/null +++ b/.pnpm-store/v3/files/62/d4fd51cb2d4c6e58ab2e31b4b882966d59a4cfe95951859e401af7451f764919b11d5e3f6991ff58db1de629f00cb59752473f21afa14611ea8dce9f93619b-index.json @@ -0,0 +1 @@ +{"files":{"LICENSE":{"checkedAt":1707939899483,"integrity":"sha512-C59tYrPCcukZUKudOlNlwkk+oggDACbctqCFOGzU7huYdFircnSRFq/oruzaRASlFVQcXWIxVk8cPJoVukEbQQ==","mode":420,"size":1097},"dist/builtinSymbolLikes.js":{"checkedAt":1707939899483,"integrity":"sha512-UEHA0zjLWx8aldYf+d+heo1fukcFH9F/k87Ri8s0kA4003p+fya31mQV7EPD6lttN9yNy8O/nN+0EWI11rNhHw==","mode":420,"size":4866},"dist/containsAllTypesByName.js":{"checkedAt":1707939899483,"integrity":"sha512-TLLWzhqi80IGFkVFeBiXJrrSJX16ndHdHC4yMNEHqnpK4Vxr+0tEGqmcH1oNtPAhN/SsDqhVWkoythO2U9ofqQ==","mode":420,"size":2687},"dist/getConstrainedTypeAtLocation.js":{"checkedAt":1707939899483,"integrity":"sha512-1PHzmMTYdOmo1xcTMlObIPxzCF/Klbnf5WyUj1o1uEgHSYZtnt7HuiaNQo1+IQCO/y4iJ5LJcAM3VObQdnbe1Q==","mode":420,"size":614},"dist/getContextualType.js":{"checkedAt":1707939899483,"integrity":"sha512-6NoSKkLqZIbW2lFN3APcxtKjmT3yXyuXaFgSMPqbgNE82tKL1l3lmdivL8mQYY63/rCh6ALSC6SljcXXtY/wmQ==","mode":420,"size":2752},"dist/getDeclaration.js":{"checkedAt":1707939899483,"integrity":"sha512-smotwc2Bg359LMQWdAgAutf5qHFw6RiZNbRhwrfYhOiuTFt4UCCpuUXiD2OUIj4UVZM0X85NjTs/qvwG2RQTlQ==","mode":420,"size":482},"dist/getSourceFileOfNode.js":{"checkedAt":1707939899483,"integrity":"sha512-ZVCNJL3WX15GfkhQOhQATG8+miFXHx9flqeUbiVzAwtIVRHf+HrVTcL6p6GT+1WDcwFgtLiI0J9fPoomeygIzw==","mode":420,"size":1480},"dist/getTokenAtPosition.js":{"checkedAt":1707939899483,"integrity":"sha512-/IKnIysU631QyQcgT/xPh0+gpC6qiKNBG6zXDQ1CPYkz9iYM0rqobYJ7uPrmlp88IT+Odn03wn+QYet2VAJHYA==","mode":420,"size":2061},"dist/getTypeArguments.js":{"checkedAt":1707939899483,"integrity":"sha512-MHJvWAR92fHoWRDyX5kwJON3Bad8zH+F0aVTvZ9xFbPFS/75Vb9zcMsFJIMMUeiILm9RfwRPIhQjJBZg+pNcBQ==","mode":420,"size":552},"dist/getTypeName.js":{"checkedAt":1707939899484,"integrity":"sha512-Lzrbo67AQEUNrvtZDe+rV4DFnZnBY15dTJrY7Dnn3a2SNpbGivlJVG7yET19Y6ogpkYdXau2/Nah2aaXh1HQeA==","mode":420,"size":3140},"dist/index.js":{"checkedAt":1707939899484,"integrity":"sha512-XEqs1qSRj9zHXUgvBQ5Wq0fTNf5vIg74sIuV+GgWI1VZe2bjhNTGEzdOXzwI1ujWNMUfNMZQlyyvs6iBciVvrg==","mode":420,"size":2324},"dist/isSymbolFromDefaultLibrary.js":{"checkedAt":1707939899484,"integrity":"sha512-5x3jwjYIGf6uiKWVTuZsoRYulrOO6mENQYrUNiltE5VB8OTcmkMNQ0gWZshcLkFAIcX97ImdaZB63/MPLUBcSA==","mode":420,"size":625},"dist/isTypeReadonly.js":{"checkedAt":1707939899484,"integrity":"sha512-OlISeOLumgG/GVWJa/U1gxmjrF/0WcIyS6H3dkPCCgNtbcsd/etGTwWAcKFNSIq37zvk87oGizU7XPwP8bflHA==","mode":420,"size":10327},"dist/isUnsafeAssignment.js":{"checkedAt":1707939899484,"integrity":"sha512-9haiy0SYNHFg5ZiFTdcVB4CFk2F5tN3OvheewfnrWhVby7uhtxoetEew+ndHmiCm1dFpK1xfeDqeSJDH8gItZw==","mode":420,"size":4462},"dist/predicates.js":{"checkedAt":1707939899484,"integrity":"sha512-ugwB7l7Sim5n+mlHMfePMh7rh4WW9URvP9Cv8hG9wGvewxjuDEWMak18E/qVlaGmlzFytPoDnUX5enrRGlO8Og==","mode":420,"size":6518},"dist/propertyTypes.js":{"checkedAt":1707939899484,"integrity":"sha512-eRKsxN6PVUccL8cFPapfX/4cwvWFwidd0BHt+/VZorfagTUH6/NZyRQHk8rrZ2ao4o6cOqeeMUfK4ktvdlpZww==","mode":420,"size":1792},"dist/requiresQuoting.js":{"checkedAt":1707939899484,"integrity":"sha512-kfcIoyjFD+KFsn6VyoDGPjVDe5WtNrNyprIxsELZoHJUr/Iyx5E9xpNSMXYgoe89hawkb8jnHVLsHtAkWwgCPw==","mode":420,"size":1654},"dist/typeFlagUtils.js":{"checkedAt":1707939899484,"integrity":"sha512-+TcGVnJsoCIx5b/u1rEyU79HHwll9bSb5JVFbHVrNfLo6vs8UdNN2OUvb88+QQYh7AxE8vEgup1UiXQUxiYSOQ==","mode":420,"size":2412},"dist/TypeOrValueSpecifier.js":{"checkedAt":1707939899485,"integrity":"sha512-C1rjsXcCf9ud32+TWc0MBAfAIB9hesYde3PlI4uriHNgUXxjrcyN1u3AY7nVvMAruptD/iT0K0DBuAqXfsF+Rg==","mode":420,"size":6992},"package.json":{"checkedAt":1707939899485,"integrity":"sha512-c+7ho3/G/IzvrVysmQy4DRaThp6YClNohqKohjiJdQW+tF37URPY204f/PIYiF/N/ithirHBw4ZUjikyoU+y8g==","mode":420,"size":1998},"dist/builtinSymbolLikes.d.ts.map":{"checkedAt":1707939899485,"integrity":"sha512-sem5IzNcZ1RptGw/qQzoZ2bigMK5Vdm6iRe+lczcnTcH5BcyVBxAxEdxy3j2jDeUtP6aSULSZymeBYSaOkDvRQ==","mode":420,"size":1385},"dist/builtinSymbolLikes.js.map":{"checkedAt":1707939899485,"integrity":"sha512-NV1p3CYbT5V8g3aQjVr+alN+6VWkEDnkrux9akwbdvuKN2cp9X1U0tracht4syXThFAVaPTZLUZvUh9FavEoGQ==","mode":420,"size":2894},"dist/containsAllTypesByName.d.ts.map":{"checkedAt":1707939899485,"integrity":"sha512-K979UoVae8nhxSLYkr1FcZ1OJrasCAKQGbRzjjMtc3S1M77CiYQWAdfxlbyn4s93MG8jJNzB54zrNU3jEykXxA==","mode":420,"size":327},"dist/containsAllTypesByName.js.map":{"checkedAt":1707939899485,"integrity":"sha512-oko+orm4RT5NROiEHkevZIdML2zB26O0qwGc+OpdPo9sfax8S5MsRiwrjAQVtOkfGpVaaTBh4vzZKUnIRZCYTA==","mode":420,"size":1228},"dist/getConstrainedTypeAtLocation.d.ts.map":{"checkedAt":1707939899485,"integrity":"sha512-oCn8qcJcWh+tJ7vpaj+sVtDWkXTZ/hC87h9hjk3ZesF7solQVby2nK9Yw8LPtFArnk7i0crKYYresAXHH6Myjw==","mode":420,"size":361},"dist/getConstrainedTypeAtLocation.js.map":{"checkedAt":1707939899485,"integrity":"sha512-jrAzu75Z8gQcDa7/UmQptDN3TG1titJ6LoML25x6IbPStbdRg0f2mWpVIvr8eVrdKEF5ivtHhPhO+ksJEXoEcg==","mode":420,"size":399},"dist/getContextualType.d.ts.map":{"checkedAt":1707939899485,"integrity":"sha512-2zDWgFmiGJMfeitJUX4So6IK82MW4jcluqW1BK3CW1+ZSlzDL+voNVy0tuFYSWVsRi3V5tpy1S/4mSw8xXH4fw==","mode":420,"size":295},"dist/getContextualType.js.map":{"checkedAt":1707939899485,"integrity":"sha512-2J1Oq/DISDD/wKu5qrGaLtYOie13alYqh8xMAbwwPdXbh3TQ2shQQZN2Fp14E3DwTvh8KCv1jqH1uzu7UfwsaQ==","mode":420,"size":1407},"dist/getDeclaration.d.ts.map":{"checkedAt":1707939899486,"integrity":"sha512-0dkeXj3r6IMjrUbBHYJw+OzKOPUTBQlz0WpyaM84UAQMg189Evin7YsRSUJeZz6R+pskGLIPHSaN4m3G998lPQ==","mode":420,"size":342},"dist/getDeclaration.js.map":{"checkedAt":1707939899486,"integrity":"sha512-zib7G5/87TokY6HgR1BztyG5dk32PLTNGa/i8xjG37JWPIanK1DndHkjQHagAza8bYvtq8+wNA935zRX2oQRPA==","mode":420,"size":410},"dist/getSourceFileOfNode.d.ts.map":{"checkedAt":1707939899486,"integrity":"sha512-+YlGb4QNF5eViutonQoKiXMV4G0csHhbLjEj5NMYhN0beeJHuzSS2M3cpuS/qicJcM4CMT/bpORpHDUjA8dlgg==","mode":420,"size":253},"dist/getSourceFileOfNode.js.map":{"checkedAt":1707939899486,"integrity":"sha512-mmuyui6d6JRo4dNIBgvNyXP+nbsO1x5BcO+ZGgKRtdgfOCZwiVS27vaz8mQIvQrTidoEUJYzarEIpruLK6+sEg==","mode":420,"size":363},"dist/getTokenAtPosition.d.ts.map":{"checkedAt":1707939899486,"integrity":"sha512-dZErX5fEGPKILP9BeXn1AU7OHnaaxuass+4mBUkVEwSIAbs0CrLkkoBT6R1meOrQhEd/EeVqy/QcvAhvniVjww==","mode":420,"size":262},"dist/getTokenAtPosition.js.map":{"checkedAt":1707939899486,"integrity":"sha512-xjArb/jJtC15VAUPjuLGoTkB7pWlYtxtH5cG4YmHsJUD+6ZV4dLU5uNZFaRx+UJEWxWZc6bB5QgIlYDRTtP+gw==","mode":420,"size":856},"dist/getTypeArguments.d.ts.map":{"checkedAt":1707939899486,"integrity":"sha512-awP2on5QzOr5j3bZAZjnczAw7qrNhcx5r+30wxD/+ibBzNuwR4BCeOzdqIZ37fK7zONTBT8EDPEGJs2J3ji0RQ==","mode":420,"size":295},"dist/getTypeArguments.js.map":{"checkedAt":1707939899486,"integrity":"sha512-ybCRjlxEHj9x0nbC5zteo9Y2BAn74gbF2KEF/jUboEor8EEyKuqb0VSGP/a6sbPtOFWeXP8ObQs2S2E9Jy0Q2w==","mode":420,"size":364},"dist/getTypeName.d.ts.map":{"checkedAt":1707939899486,"integrity":"sha512-1HkyMBrqNNzXyTKDkYSl0fcL3vuAlr/5cu+ikqI8cJU8K4n9Pa1tfmj0L3EbjplkhFKbs/BVY9XDgGbupbRnCA==","mode":420,"size":259},"dist/getTypeName.js.map":{"checkedAt":1707939899486,"integrity":"sha512-mL742ZW9TJFM+1BhC+0iaO56a39sZhybb2FfBFHkvqJgbb12ft1MvLe9WVt0lcYV2yqciq84BUQ8G4TFpfKTrw==","mode":420,"size":1411},"dist/index.d.ts.map":{"checkedAt":1707939899486,"integrity":"sha512-ky15V9MtUFBJY0fAgKS3CpnK0bCPj0FhOC96Kj9UJqPmsp+oRMZnG81gIgzQcL4+DSoEC5BgKiJqh4IsLgpYzg==","mode":420,"size":555},"dist/index.js.map":{"checkedAt":1707939899486,"integrity":"sha512-fe3pxgX3QT5wa4RHI4sZm9U4VyPNDFjeIjNrBt6Hy5APY1Ryb3gYmuxG8ad7tKKUlbfj7hpcS9Tlfv0tNwAghg==","mode":420,"size":417},"dist/isSymbolFromDefaultLibrary.d.ts.map":{"checkedAt":1707939899487,"integrity":"sha512-FfpRxu1XluojT91i2sJB+WrjI6S8WuknoufjIRGIsB6Vtf+bsWukaco+m7lEFVB3NlCimo8bgO+mZAeSuTDOAA==","mode":420,"size":293},"dist/isSymbolFromDefaultLibrary.js.map":{"checkedAt":1707939899487,"integrity":"sha512-e12K9KA5riXV18vdMZDNF5UbhdOpvDcc6d96dJU1ljFzc3uELpioMAD9mTnpv83R/LY59Apzzx5WlOxXr1dUJw==","mode":420,"size":528},"dist/isTypeReadonly.d.ts.map":{"checkedAt":1707939899487,"integrity":"sha512-NxIuWfq0LAH10a8udIY/VIx35Fmbx2wBRm+HPELDA9Uamkyl75kVtY+St5w3UyxJRe0HK+f0T1jkRY7MZjJJ4w==","mode":420,"size":615},"dist/isTypeReadonly.js.map":{"checkedAt":1707939899487,"integrity":"sha512-Ty9eJn2dmqdqVoBmELzaRjltSf5PiGVeHtQT+5x9cwpD4iZu5WMBAmKVc+viAgYDhhG4wrjvXMkSxJn5VCuwSg==","mode":420,"size":6510},"dist/isUnsafeAssignment.d.ts.map":{"checkedAt":1707939899487,"integrity":"sha512-W21XQc0f6w8e6DpA7Owkgy6ynTwqqjRJ5Hn9ELkQlRW4z3/kW9Cr8DlhBPPnSxVs3Es6oMJDTOpLZuCdGacqnQ==","mode":420,"size":485},"dist/isUnsafeAssignment.js.map":{"checkedAt":1707939899487,"integrity":"sha512-dHx9X42HNOwA73vDIVe1Q1nZ5YoZAmIyD4p3gOL9HNsZvMOis+YQ8nU5Li8x4S9Q4OKuwSsu9GhfEsyKKL+z+g==","mode":420,"size":2111},"dist/predicates.d.ts.map":{"checkedAt":1707939899487,"integrity":"sha512-1x6pa+/UWJY/UNBG3A+Xgc1EXFN8+hde7Zmlfd52txZvAvmzclhG3TOZqa9LmusLQWwhelEARgYtxiEV0e//Ow==","mode":420,"size":1453},"dist/predicates.js.map":{"checkedAt":1707939899487,"integrity":"sha512-gIDAl0v2wBH9Fqh2/TGl2Qru9IL1eL+pTRQfqyjPpJ618u35s7kAHduHzEOLl3Nmht7EPyRTYjFDARo5z3o/aw==","mode":420,"size":3523},"dist/propertyTypes.d.ts.map":{"checkedAt":1707939899487,"integrity":"sha512-MZePvz5AFyQlgMQ01RcdsE1OYqiqWosjAtap2Nx7I+JcJNm+kOFQCQbQEOuW4tG4+E8mvTNvB0Xxfu//VmGrPA==","mode":420,"size":481},"dist/propertyTypes.js.map":{"checkedAt":1707939899487,"integrity":"sha512-qTw4TED1qETGMjQsM7890dUowuyjy8sZ+FDxV+mrfqjAamXR4ZNdyPCIXPhOfFyxvT8A0nj1lNdqpIGr4V0KDg==","mode":420,"size":1083},"dist/requiresQuoting.d.ts.map":{"checkedAt":1707939899487,"integrity":"sha512-PYDMTPtg47QPam8gk0U8YnIyaFmouGoa9QlcQg7Z4eInpzPPDtkLCRlvqfF98tkPFALPHjZO9uUiH/PnVAVCpg==","mode":420,"size":274},"dist/requiresQuoting.js.map":{"checkedAt":1707939899487,"integrity":"sha512-Woqj5l5hyIcRaMzKsSHW3ud+DP5mZINoGlsLq2Arfk3YabHxg0z2FFa2MNajUR3Dr4zvKQfsn53mhXlOK7ekMw==","mode":420,"size":687},"dist/typeFlagUtils.d.ts.map":{"checkedAt":1707939899487,"integrity":"sha512-MOZCGDr62wOxAVcyXrNEm9Ipa9eZ9Nas8yYM3THWS8tKdDtE2zduJKhN8wbtSKBYWIeqj6DTMBIbxMgvSI0vtQ==","mode":420,"size":376},"dist/typeFlagUtils.js.map":{"checkedAt":1707939899487,"integrity":"sha512-yKoGH/eMnKZPe9OJFO1JuT5+hsZAFkjrbpZyZhwmVTAjN8LAsodZ1YVcXzrGz5tz11tOHr+zb6UUh9tlJ8tQEA==","mode":420,"size":748},"dist/TypeOrValueSpecifier.d.ts.map":{"checkedAt":1707939899487,"integrity":"sha512-Bpp7M3MWMXFPy0/Oney1snNzVXVC5DpbSa7qoaHqVUeQdGyA7Y403W4g2kN/RzxzDfOL9aua/cHeAUJdEcSPPQ==","mode":420,"size":773},"dist/TypeOrValueSpecifier.js.map":{"checkedAt":1707939899487,"integrity":"sha512-VXjkite7sX4fg4/AL1M5l16Wcx1hl2BNm2rnPPIIdPMhnN8CVt0eypWdTId/FzwR1Zd6YRmm1vVndJjZOaJxNg==","mode":420,"size":4050},"README.md":{"checkedAt":1707939899487,"integrity":"sha512-0YL97S87fK5ThtQSSDcvqjKOggMOM/nD3W0z6404MicS49DOqzkPgrI4LXM+a1luIJSf0uj4cldRp8zYGsJy9Q==","mode":420,"size":867},"dist/builtinSymbolLikes.d.ts":{"checkedAt":1707939899487,"integrity":"sha512-0lcwr9MZsVJm+lksox5jRQILKng1g1Ii/B75p/uEE3A4n/n1PHhnWrehH2G/AihHLq37o/dxpJM2ZfX8A1CkRw==","mode":420,"size":1474},"dist/containsAllTypesByName.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-8CkQ2rk5Ih1EsGKUXrR78xjw1LDcz/bOmiEdjxD9PDWt0o1/RebV0wVAYT6pwJYOahcX8wWDo/K07P29GqoMhQ==","mode":420,"size":641},"dist/getConstrainedTypeAtLocation.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-u0ueNWjHyoC34nGyT1OhD1AI74aMcGhqEFasR0TcR1UKUVEsTbuO1aBT7Rx7h0ESFm75mzt3McSRCxlWEuT9Yw==","mode":420,"size":436},"dist/getContextualType.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-jnlqTbvS3jqB2SwKpR3+pbf8P4d5s1LWuvYsQEvSVYULktNS7tuBjxNWt1sj5bQnGwh0WNnIsUR5YTBSHO6RKA==","mode":420,"size":413},"dist/getDeclaration.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-qFnyrrTnsiP9+W4+cKbtUOq1IGtXrHNJ5XQ5K60SS/l8LBSLi1QdZUALUSFKhvnlw345DhgonwKe+Kcy08B56Q==","mode":420,"size":372},"dist/getSourceFileOfNode.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-XooHV6+DgkfeU2JmJwj//utlUkaytTVed4hKtkQEn9fXZGqwlamQrprIpGJNpbQuL9K1Ybv+CPiVQMF+qJV7qg==","mode":420,"size":207},"dist/getTokenAtPosition.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-b/E5cWb/cl52WSVuvx75hZlIH3MoiGwUmWA9g5FGzQr37plbYaaAilpBta/CGDkV44aoU/uA3rqbY30ptWImXg==","mode":420,"size":180},"dist/getTypeArguments.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-rnL6fiX81OMtLlOFrHwmIZQn7Ex8WYh+k5TToYM9d3RRy9ucXshkRfHDhxU5gk+K2JfKcybi5czMZSxds4hOsw==","mode":420,"size":252},"dist/getTypeName.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-nZ0FagI4Wp4ljNgsHJAIfQE1Ds80h+BxCIvNesRdQycFZTyq25kQ7z7KvOihnjU4AQacq4BjG1mfj+UriSIFxg==","mode":420,"size":322},"dist/index.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-0SsY61k7dYmBK6wQnZTJ82fpxfzob+TXprfoW90/3o7QT4vgPJcNBj3zH/WTJIDLaXb3k5hXWdj6MrExxNcVeg==","mode":420,"size":780},"dist/isSymbolFromDefaultLibrary.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-Op0bDo7IjigSldbYJQ4bv6rDcuUhmW5uarWsTMbaSb0/M9CaNGAeXiCC8pwppReaUe+TPEoUDGu4/JC985IMAg==","mode":420,"size":208},"dist/isTypeReadonly.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-s18pbZJr37YHwrgrrNB5DepqRWp3NvfeWl0LYjpXvahaekjGDf989VgJuIuEY2WOSiUA/SWc7DSMG5KmapN0BA==","mode":420,"size":899},"dist/isUnsafeAssignment.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-We9kf89ZsjAGozftnvkuAiSUWUGlwkfwP0mF9KtMnRAiEaByHzOMXYO/yu8YoIB9pxEfFM9FYqRO1nDUz2kHOA==","mode":420,"size":736},"dist/predicates.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-086KIFDAW9Ufpy9rEl48TnrUQpQYpQ/VGaRW0aZbGCaTv+7M3yTyljT40HVCAPD3VMkbKxIzb5o53JmMz1tdTA==","mode":420,"size":2225},"dist/propertyTypes.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-CHsnIl8u9LWR3Z5/7MCg3ktBClTyvTiNfZBtCIpfA4dQELgpaECzHzvddFJlPIUutrDmi+dJQUNEK9khojShCg==","mode":420,"size":364},"dist/requiresQuoting.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-3CiHeEgUSAqfVDGV4LgNd+9Xo4HG1KoQH7S9xVGjuOSsV4TXher7Pi3/8mvdoZI1f3BJMjhJ83iEuygRUJ86TQ==","mode":420,"size":190},"dist/typeFlagUtils.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-7XiQHSFTtBtRQlAp0aCnUblHYzAgbUydmthqgVtcGyJ+lHj86AfhNnLHFKU7bV6EYY/XAeSrqObyy/3RgnYXrQ==","mode":420,"size":751},"dist/TypeOrValueSpecifier.d.ts":{"checkedAt":1707939899488,"integrity":"sha512-7rR+8cW6IzXF/3QHgzFd9hsggZ+spL5Er97OHCKedPagLFW9mTqGlTaMfuzv3K8JtjY1VCQVRUAD9NCq+qvIFQ==","mode":420,"size":721}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/63/381d9afa5d445c6204508e55681aebb9da02d6cfb4a98f685b469e6c56c7e297ae31a4a545d3ff6b7378a9f914b76da1857e0d14dda4c74fff8e40ae757065-index.json b/.pnpm-store/v3/files/63/381d9afa5d445c6204508e55681aebb9da02d6cfb4a98f685b469e6c56c7e297ae31a4a545d3ff6b7378a9f914b76da1857e0d14dda4c74fff8e40ae757065-index.json new file mode 100644 index 00000000..9f2614b9 --- /dev/null +++ b/.pnpm-store/v3/files/63/381d9afa5d445c6204508e55681aebb9da02d6cfb4a98f685b469e6c56c7e297ae31a4a545d3ff6b7378a9f914b76da1857e0d14dda4c74fff8e40ae757065-index.json @@ -0,0 +1 @@ +{"files":{"LICENSE":{"checkedAt":1707939899428,"integrity":"sha512-o7HEIFnimZVIAv9KTD/PP6FfDvz7SNoM2Tyqrp7XIlPMtKl8zX2zLmOOIbS4YIvXl2tcZX7YPsvHpuGTYVMULQ==","mode":420,"size":1076},"lib/combine.js":{"checkedAt":1707939899428,"integrity":"sha512-/wyyZYfltIR9EXqUfAS2DqaGTrM1ansqT3pzU4kP2uDyNgmcpIYBq4Ar3rZDGk/EJe+jQ4dpKReN5vtQyxtpVg==","mode":420,"size":1221},"index.js":{"checkedAt":1707939899428,"integrity":"sha512-Wz9ww7QpvIcOlDa1fdRYNicNMVaOdOyh6xQod7xjk4l7u7sk+KnS6Jy4NHMsSgJTUHW3h5c3yqWZVrIWRdnJEA==","mode":420,"size":848},"lib/snapshotDocument.js":{"checkedAt":1707939899428,"integrity":"sha512-CwoRkJwZ1G5jXtbDWg4PDGExaDLtwSODz3Je2GPR0iWwOLnd5zANZNSOPJeX/tplMFVZzucpoOHZNIf+0DoEAg==","mode":420,"size":5294},"package.json":{"checkedAt":1707939899428,"integrity":"sha512-6ZBoVNlvlNTf2sdwMZVzc0KNhX6JaDcjALwzst9/bOT5gVJh9zrxLn1TD+vXLosTq7gEEToa4deCw8fkzH0qtg==","mode":420,"size":433},"lib/combine.d.ts":{"checkedAt":1707939899429,"integrity":"sha512-vPzsDK0vmIWWeg67QS4ILjAkLsVZzjfQme2aHNeQVNdm3j/Fqx299PINqMgJLzk8/SOGE4NzEvJGrqvsg44vNA==","mode":420,"size":143},"index.d.ts":{"checkedAt":1707939899429,"integrity":"sha512-y9aYzJqmhttm/XLlkhn9z04BE5GowEMAoiK+9ZR8GuqyrBibdnft4n5T3OsbI8SGi11wO+vj0SbqjHjN8bbbQw==","mode":420,"size":40},"lib/snapshotDocument.d.ts":{"checkedAt":1707939899429,"integrity":"sha512-mXx4+APwXrSObYBW7P+Mt7tefrIXV/V68x9hN3O2sS7Oiqu1bf0uwimwViBYWcfzMHnSDmBemksfwjQU0/nVFw==","mode":420,"size":1174}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/64/31dd92ecaba88d9dfd85f22f67fd4f2a89e81c12d4e45613ead98672c85d31e50d2488fdf6bad9fc95473987cc05ce2cbf1316fcabb4624606ae713e8397e8 b/.pnpm-store/v3/files/64/31dd92ecaba88d9dfd85f22f67fd4f2a89e81c12d4e45613ead98672c85d31e50d2488fdf6bad9fc95473987cc05ce2cbf1316fcabb4624606ae713e8397e8 new file mode 100644 index 00000000..117e4f27 --- /dev/null +++ b/.pnpm-store/v3/files/64/31dd92ecaba88d9dfd85f22f67fd4f2a89e81c12d4e45613ead98672c85d31e50d2488fdf6bad9fc95473987cc05ce2cbf1316fcabb4624606ae713e8397e8 @@ -0,0 +1,56 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = require('es-errors/type'); +var $SyntaxError = require('es-errors/syntax'); + +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +var forEach = require('../helpers/forEach'); + +var SLOT = require('internal-slot'); + +var hasProto = require('has-proto')(); + +// https://262.ecma-international.org/11.0/#sec-objectcreate + +module.exports = function OrdinaryObjectCreate(proto) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1]; + if (!IsArray(additionalInternalSlotsList)) { + throw new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array'); + } + + // var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1 + // internalSlotsList.push(...additionalInternalSlotsList); // step 2 + // var O = MakeBasicObject(internalSlotsList); // step 3 + // setProto(O, proto); // step 4 + // return O; // step 5 + + var O; + if ($ObjectCreate) { + O = $ObjectCreate(proto); + } else if (hasProto) { + O = { __proto__: proto }; + } else { + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + O = new T(); + } + + if (additionalInternalSlotsList.length > 0) { + forEach(additionalInternalSlotsList, function (slot) { + SLOT.set(O, slot, void undefined); + }); + } + + return O; +}; diff --git a/.pnpm-store/v3/files/64/3acc6955b2b107e8a26997e7affff4b95505948e245ed5f97aee5328df517dd63a5ac9ef99f6d5a0eb53c6f67db40f8daa470f038561882f40f9997bf2bd7f b/.pnpm-store/v3/files/64/3acc6955b2b107e8a26997e7affff4b95505948e245ed5f97aee5328df517dd63a5ac9ef99f6d5a0eb53c6f67db40f8daa470f038561882f40f9997bf2bd7f new file mode 100644 index 00000000..0063886b --- /dev/null +++ b/.pnpm-store/v3/files/64/3acc6955b2b107e8a26997e7affff4b95505948e245ed5f97aee5328df517dd63a5ac9ef99f6d5a0eb53c6f67db40f8daa470f038561882f40f9997bf2bd7f @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/util/location.ts","../src/parse-error/module-errors.ts","../src/parse-error/to-node-description.ts","../src/parse-error/standard-errors.ts","../src/parse-error/strict-mode-errors.ts","../src/parse-error/pipeline-operator-errors.ts","../src/parse-error.ts","../src/plugins/estree.ts","../src/tokenizer/context.ts","../src/tokenizer/types.ts","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.ts","../src/util/scope.ts","../src/plugins/flow/scope.ts","../src/parser/base.ts","../src/parser/comments.ts","../src/util/whitespace.ts","../src/tokenizer/state.ts","../../babel-helper-string-parser/src/index.ts","../src/tokenizer/index.ts","../src/util/class-scope.ts","../src/util/expression-scope.ts","../src/util/production-parameter.ts","../src/parser/util.ts","../src/parser/node.ts","../src/plugins/flow/index.ts","../src/plugins/jsx/xhtml.ts","../src/plugins/jsx/index.ts","../src/plugins/typescript/scope.ts","../src/parser/lval.ts","../src/plugins/typescript/index.ts","../src/plugins/placeholders.ts","../src/plugins/v8intrinsic.ts","../src/plugin-utils.ts","../src/options.ts","../src/parser/expression.ts","../src/parser/statement.ts","../src/parser/index.ts","../src/index.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\n\nconst code = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code,\n },\n} satisfies ParseErrorTemplates;\n","const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\n// @ts-expect-error prefix is specified only when type is UpdateExpression\n// eslint-disable-next-line no-confusing-arrow\nconst toNodeDescription = ({ type, prefix }: NodeWithDescription) =>\n type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[String(prefix) as \"true\" | \"false\"]\n : NodeDescriptions[type];\n\nexport default toNodeDescription;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\"; prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"ImportSpecifier\"\n | \"ImportNamespaceSpecifier\"\n | \"ImportDefaultSpecifier\"\n | \"ParenthesizedExpression\"\n | \"ObjectPattern\"\n | \"RestElement\"\n | \"VariableDeclarator\";\n };\n\nexport default {\n AccessorIsGenerator: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter:\n \"'await' is not allowed in async function parameters.\",\n AwaitUsingNotInAsyncContext:\n \"'await using' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions.\",\n BadGetterArity: \"A 'get' accessor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accessor must have exactly one formal parameter.\",\n BadSetterRestParameter:\n \"A 'set' accessor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind,\n }: {\n kind: \"const\" | \"destructuring\";\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorArgumentsOutsideParentheses:\n \"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.\",\n DecoratorsBeforeAfterExport:\n \"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeferImportRequiresNamespace:\n 'Only `import defer * as x from \"./module\"` is valid.',\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({ exportName }: { exportName: string }) =>\n `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n DynamicImportPhaseRequiresImportExpressions: ({ phase }: { phase: string }) =>\n `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`,\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName,\n }: {\n localName: string;\n exportName: string;\n }) =>\n `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'.\",\n\n ForInOfLoopInitializer: ({\n type,\n }: {\n type: \"ForInStatement\" | \"ForOfStatement\";\n }) =>\n `'${\n type === \"ForInStatement\" ? \"for-in\" : \"for-of\"\n }' loop variable declaration may not have an initializer.`,\n ForInUsing: \"For-in loop may not start with 'using' declaration.\",\n\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block.\",\n\n IllegalBreakContinue: ({\n type,\n }: {\n type: \"BreakStatement\" | \"ContinueStatement\";\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportAttributesUseAssert:\n \"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.\",\n ImportBindingIsString: ({ importName }: { importName: string }) =>\n `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArgumentTrailingComma:\n \"Trailing comma is disallowed inside import(...) arguments.\",\n ImportCallArity: ({ maxArgumentCount }: { maxArgumentCount: 1 | 2 }) =>\n `\\`import()\\` requires exactly ${\n maxArgumentCount === 1 ? \"one argument\" : \"one or two arguments\"\n }.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault:\n \"A JSON module can only be imported with `default`.\",\n ImportReflectionHasAssertion: \"`import module x` cannot have assertions.\",\n ImportReflectionNotBinding:\n 'Only `import module x from \"./module\"` is valid.',\n IncompatibleRegExpUVFlags:\n \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({ radix }: { radix: number }) =>\n `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({ identifierName }: { identifierName: string }) =>\n `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsOptionalChaining: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid optional chaining in the left-hand side of ${toNodeDescription(\n ancestor,\n )}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({ unexpected }: { unexpected: string }) =>\n `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName,\n }: {\n identifierName: string;\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({ labelName }: { labelName: string }) =>\n `Label '${labelName}' is already declared.`,\n LetInLexicalBinding: \"'let' is disallowed as a lexically bound name.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({ missingPlugin }: { missingPlugin: [string] }) =>\n `This experimental syntax requires enabling the parser plugin: ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n // FIXME: Would be nice to make this \"missingPlugins\" instead.\n // Also, seems like we can drop the \"(s)\" from the message and just make it \"s\".\n MissingOneOfPlugins: ({ missingPlugin }: { missingPlugin: string[] }) =>\n `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({ key }: { key: string }) =>\n `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode,\n }: {\n surrogateCharCode: number;\n }) =>\n `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(\n 16,\n )}'.`,\n ModuleExportUndefined: ({ localName }: { localName: string }) =>\n `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar:\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor:\n \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({ identifierName }: { identifierName: string }) =>\n `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level or inside a block.\",\n SloppyFunctionAnnexB:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n SourcePhaseImportRequiresDefault:\n 'Only `import source x from \"./module\"` is valid.',\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed:\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({ keyword }: { keyword: string }) =>\n `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget:\n \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected,\n }: {\n expected?: string | null;\n unexpected?: string | null;\n }) =>\n `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${\n expected ? `, expected \"${expected}\"` : \"\"\n }`,\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnexpectedUsingDeclaration:\n \"Using declaration cannot appear in the top level when source type is `script`.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport:\n \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName,\n }: {\n target: string;\n onlyValidPropertyName: string;\n }) =>\n `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper:\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n UsingDeclarationHasBindingPattern:\n \"Using declaration cannot have destructuring patterns.\",\n VarRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Identifier '${identifierName}' has already been declared.`,\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error\";\n\nexport default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType> = T extends Set\n ? M\n : unknown;\n\nexport type UnparenthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparenthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n} satisfies ParseErrorTemplates;\n","import { Position } from \"./util/location.ts\";\n\ntype SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\ntype ParseErrorCode =\n | \"BABEL_PARSER_SYNTAX_ERROR\"\n | \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\n// Babel uses \"normal\" SyntaxErrors for it's errors, but adds some extra\n// functionality. This functionality is defined in the\n// `ParseErrorSpecification` interface below. We may choose to change to someday\n// give our errors their own full-blown class, but until then this allow us to\n// keep all the desirable properties of SyntaxErrors (like their name in stack\n// traces, etc.), and also allows us to punt on any publicly facing\n// class-hierarchy decisions until Babel 8.\ninterface ParseErrorSpecification {\n // Look, these *could* be readonly, but then Flow complains when we initially\n // set them. We could do a whole dance and make a special interface that's not\n // readonly for when we create the error, then cast it to the readonly\n // interface for public use, but the previous implementation didn't have them\n // as readonly, so let's just not worry about it for now.\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n missingPlugin?: string | string[];\n loc: Position;\n details: ErrorDetails;\n\n // We should consider removing this as it now just contains the same\n // information as `loc.index`.\n // pos: number;\n}\n\nexport type ParseError = SyntaxError &\n ParseErrorSpecification;\n\n// By `ParseErrorConstructor`, we mean something like the new-less style\n// `ErrorConstructor`[1], since `ParseError`'s are not themselves actually\n// separate classes from `SyntaxError`'s.\n//\n// 1. https://github.com/microsoft/TypeScript/blob/v4.5.5/lib/lib.es5.d.ts#L1027\nexport type ParseErrorConstructor = (\n loc: Position,\n details: ErrorDetails,\n) => ParseError;\n\ntype ToMessage = (self: ErrorDetails) => string;\n\ntype ParseErrorCredentials = {\n code: string;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage;\n};\n\nfunction defineHidden(obj: object, key: string, value: unknown) {\n Object.defineProperty(obj, key, {\n enumerable: false,\n configurable: true,\n value,\n });\n}\n\nfunction toParseErrorConstructor({\n toMessage,\n ...properties\n}: ParseErrorCredentials): ParseErrorConstructor {\n return function constructor(loc: Position, details: ErrorDetails) {\n const error = new SyntaxError();\n Object.assign(error, properties, { loc, pos: loc.index });\n if (\"missingPlugin\" in details) {\n Object.assign(error, { missingPlugin: details.missingPlugin });\n }\n\n type Overrides = {\n loc?: Position;\n details?: ErrorDetails;\n };\n defineHidden(error, \"clone\", function clone(overrides: Overrides = {}) {\n const { line, column, index } = overrides.loc ?? loc;\n return constructor(new Position(line, column, index), {\n ...details,\n ...overrides.details,\n });\n });\n\n defineHidden(error, \"details\", details);\n\n Object.defineProperty(error, \"message\", {\n configurable: true,\n get(this: ParseError): string {\n const message = `${toMessage(details)} (${loc.line}:${loc.column})`;\n this.message = message;\n return message;\n },\n set(value: string) {\n Object.defineProperty(this, \"message\", { value, writable: true });\n },\n });\n\n return error as ParseError;\n };\n}\n\ntype ParseErrorTemplate =\n | string\n | ToMessage\n | { message: string | ToMessage; code?: ParseErrorCode };\n\nexport type ParseErrorTemplates = { [reasonCode: string]: ParseErrorTemplate };\n\n// This is the templated form of `ParseErrorEnum`.\n//\n// Note: We could factor out the return type calculation into something like\n// `ParseErrorConstructor`, and then we could\n// reuse it in the non-templated form of `ParseErrorEnum`, but TypeScript\n// doesn't seem to drill down that far when showing you the computed type of\n// an object in an editor, so we'll leave it inlined for now.\nexport function ParseErrorEnum(a: TemplateStringsArray): <\n T extends ParseErrorTemplates,\n>(\n parseErrorTemplates: T,\n) => {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : {}\n : T[K] extends ToMessage\n ? Parameters[0]\n : {}\n >;\n};\n\nexport function ParseErrorEnum(\n parseErrorTemplates: T,\n syntaxPlugin?: SyntaxPlugin,\n): {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : {}\n : T[K] extends ToMessage\n ? Parameters[0]\n : {}\n >;\n};\n\n// You call `ParseErrorEnum` with a mapping from `ReasonCode`'s to either:\n//\n// 1. a static error message,\n// 2. `toMessage` functions that define additional necessary `details` needed by\n// the `ParseError`, or\n// 3. Objects that contain a `message` of one of the above and overridden `code`\n// and/or `reasonCode`:\n//\n// ParseErrorEnum `optionalSyntaxPlugin` ({\n// ErrorWithStaticMessage: \"message\",\n// ErrorWithDynamicMessage: ({ type } : { type: string }) => `${type}`),\n// ErrorWithOverriddenCodeAndOrReasonCode: {\n// message: ({ type }: { type: string }) => `${type}`),\n// code: \"AN_ERROR_CODE\",\n// ...(BABEL_8_BREAKING ? { } : { reasonCode: \"CustomErrorReasonCode\" })\n// }\n// });\n//\nexport function ParseErrorEnum(\n argument: TemplateStringsArray | ParseErrorTemplates,\n syntaxPlugin?: SyntaxPlugin,\n) {\n // If the first parameter is an array, that means we were called with a tagged\n // template literal. Extract the syntaxPlugin from this, and call again in\n // the \"normalized\" form.\n if (Array.isArray(argument)) {\n return (parseErrorTemplates: ParseErrorTemplates) =>\n ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n\n const ParseErrorConstructors = {} as Record<\n string,\n ParseErrorConstructor\n >;\n\n for (const reasonCode of Object.keys(argument)) {\n const template = (argument as ParseErrorTemplates)[reasonCode];\n const { message, ...rest } =\n typeof template === \"string\"\n ? { message: () => template }\n : typeof template === \"function\"\n ? { message: template }\n : template;\n const toMessage = typeof message === \"string\" ? () => message : message;\n\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor({\n code: \"BABEL_PARSER_SYNTAX_ERROR\",\n reasonCode,\n toMessage,\n ...(syntaxPlugin ? { syntaxPlugin } : {}),\n ...rest,\n });\n }\n\n return ParseErrorConstructors;\n}\n\nimport ModuleErrors from \"./parse-error/module-errors.ts\";\nimport StandardErrors from \"./parse-error/standard-errors.ts\";\nimport StrictModeErrors from \"./parse-error/strict-mode-errors.ts\";\nimport PipelineOperatorErrors from \"./parse-error/pipeline-operator-errors.ts\";\n\nexport const Errors = {\n ...ParseErrorEnum(ModuleErrors),\n ...ParseErrorEnum(StandardErrors),\n ...ParseErrorEnum(StrictModeErrors),\n ...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),\n};\n\nexport type { LValAncestor } from \"./parse-error/standard-errors.ts\";\n","import type { TokenType } from \"../tokenizer/types.ts\";\nimport type Parser from \"../parser/index.ts\";\nimport type { ExpressionErrors } from \"../parser/util.ts\";\nimport type * as N from \"../types.ts\";\nimport type { Node as NodeType, NodeBase, File } from \"../types.ts\";\nimport type { Position } from \"../util/location.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { BindingFlag } from \"../util/scopeflags.ts\";\n\nconst { defineProperty } = Object;\nconst toUnenumerable = (object: any, key: string) =>\n defineProperty(object, key, { enumerable: false, value: object[key] });\n\nfunction toESTreeLocation(node: any) {\n node.loc.start && toUnenumerable(node.loc.start, \"index\");\n node.loc.end && toUnenumerable(node.loc.end, \"index\");\n\n return node;\n}\n\nexport default (superClass: typeof Parser) =>\n class ESTreeParserMixin extends superClass implements Parser {\n parse(): File {\n const file = toESTreeLocation(super.parse());\n\n if (this.options.tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n\n return file;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseRegExpLiteral({ pattern, flags }): N.EstreeRegExpLiteral {\n let regex: RegExp | null = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt: BigInt | null;\n try {\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal: null = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any) {\n // @ts-expect-error ESTree plugin changes node types\n return this.parseLiteral(value, \"Literal\");\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n return this.estreeParseLiteral(value);\n }\n\n // Cast a Directive to an ExpressionStatement. Mutates the input Directive.\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const expression = directive.value as any as N.EstreeLiteral;\n delete directive.value;\n\n expression.type = \"Literal\";\n // @ts-expect-error N.EstreeLiteral.raw is not defined.\n expression.raw = expression.extra.raw;\n expression.value = expression.extra.expressionValue;\n\n const stmt = directive as any as N.ExpressionStatement;\n stmt.type = \"ExpressionStatement\";\n stmt.expression = expression;\n // @ts-expect-error N.ExpressionStatement.directive is not defined\n stmt.directive = expression.extra.rawValue;\n\n delete expression.extra;\n\n return stmt;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(node: N.BodilessFunctionOrMethodBase, isAsync: boolean): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n // @ts-expect-error plugin typings\n this.checkDeclaration((node as unknown as N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return (method as any as N.EstreeProperty | N.EstreeMethodDefinition)\n .value.params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n super.parseBlockBody(\n node,\n allowDirectives,\n topLevel,\n end,\n afterBlockParse,\n );\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n // @ts-expect-error estree plugin typings\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // @ts-expect-error mutate AST types\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = node as any;\n delete node.id;\n // @ts-expect-error mutate AST types\n node.name = name;\n // @ts-expect-error mutate AST types\n node.type = \"PrivateIdentifier\";\n return node as unknown as N.EstreePrivateIdentifier;\n }\n\n isPrivateName(node: N.Node): boolean {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n getPrivateNameSV(node: N.Node): string {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node);\n }\n }\n return node.name;\n }\n\n // @ts-expect-error plugin may override interfaces\n parseLiteral(value: any, type: T[\"type\"]): T {\n const node = super.parseLiteral(value, type);\n // @ts-expect-error mutating AST types\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n // @ts-expect-error plugin may override interfaces\n parseMethod<\n T extends N.ClassPrivateMethod | N.ObjectMethod | N.ClassMethod,\n >(\n node: Undone,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ): N.EstreeMethodDefinition {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n // @ts-expect-error todo(flow->ts)\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error mutate AST types\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // @ts-expect-error mutate AST types\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone,\n \"MethodDefinition\",\n );\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = super.parseClassProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = super.parseClassPrivateProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): N.ObjectMethod | undefined | null {\n const node: N.EstreeProperty = super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ) as any;\n\n if (node) {\n node.type = \"Property\";\n if ((node as any as N.ClassMethod).kind === \"method\") {\n node.kind = \"init\";\n }\n node.shorthand = false;\n }\n\n return node as any;\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n const node: N.EstreeProperty = super.parseObjectProperty(\n prop,\n startLoc,\n isPattern,\n refExpressionErrors,\n ) as any;\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return node as any;\n }\n\n isValidLVal(\n type: string,\n isUnparenthesizedInAssign: boolean,\n binding: BindingFlag,\n ) {\n return type === \"Property\"\n ? \"value\"\n : super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (node != null && this.isObjectProperty(node)) {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: N.Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(Errors.PatternHasAccessor, prop.key);\n } else if (prop.method) {\n this.raise(Errors.PatternHasMethod, prop.key);\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n\n finishCallExpression(\n unfinished: Undone,\n optional: boolean,\n ): T {\n const node = super.finishCallExpression(unfinished, optional);\n\n if (node.callee.type === \"Import\") {\n (node as N.Node as N.EstreeImportExpression).type = \"ImportExpression\";\n (node as N.Node as N.EstreeImportExpression).source = node.arguments[0];\n if (\n this.hasPlugin(\"importAttributes\") ||\n this.hasPlugin(\"importAssertions\")\n ) {\n (node as N.Node as N.EstreeImportExpression).options =\n node.arguments[1] ?? null;\n // compatibility with previous ESTree AST\n (node as N.Node as N.EstreeImportExpression).attributes =\n node.arguments[1] ?? null;\n }\n // arguments isn't optional in the type definition\n delete node.arguments;\n // callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(\n unfinished: Undone,\n decorators: N.Decorator[] | null,\n ) {\n const exportStartLoc = this.state.lastTokStartLoc;\n const node = super.parseExport(unfinished, decorators);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n // @ts-expect-error mutating AST types\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n // @ts-expect-error mutating AST types\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n // @ts-expect-error mutating AST types\n node.type = \"ExportAllDeclaration\";\n // @ts-expect-error mutating AST types\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n // fallthrough\n case \"ExportDefaultDeclaration\":\n {\n const { declaration } = node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n declaration.decorators?.length > 0 &&\n // decorator comes before export\n declaration.start === node.start\n ) {\n this.resetStartLocation(\n node,\n // For compatibility with ESLint's keyword-spacing rule, which assumes that an\n // export declaration must start with export.\n // https://github.com/babel/babel/issues/15085\n // Here we reset export declaration's start to be the start of the export token\n exportStartLoc,\n );\n }\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ) {\n const node = super.parseSubscript(base, startLoc, noCalls, state);\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n node.type = node.type.substring(8); // strip Optional prefix\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n node.optional = false;\n }\n\n return node;\n }\n\n isOptionalMemberExpression(node: N.Node) {\n if (node.type === \"ChainExpression\") {\n return node.expression.type === \"MemberExpression\";\n }\n return super.isOptionalMemberExpression(node);\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n // @ts-expect-error override interfaces\n isObjectProperty(node: N.Node): boolean {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n isObjectMethod(node: N.Node): boolean {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n\n finishNodeAt(\n node: Undone,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n\n resetStartLocation(node: N.Node, startLoc: Position) {\n super.resetStartLocation(node, startLoc);\n toESTreeLocation(node);\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc,\n ): void {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n };\n","// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext;\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"...\", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n","import { types as tc, type TokContext } from \"./context.ts\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string;\n beforeExpr?: boolean;\n startsExpr?: boolean;\n rightAssociative?: boolean;\n isLoop?: boolean;\n isAssign?: boolean;\n prefix?: boolean;\n postfix?: boolean;\n binop?: number | null;\n};\n\n// Internally the tokenizer stores token as a number\nexport type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: string | undefined | null;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: number | undefined | null;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext:\n | ((context: Array) => void)\n | undefined\n | null;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\n// A map from keyword/keyword-like string value to the token type\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\nfunction createKeywordLike(\n name: string,\n options: TokenOptions = {},\n): TokenType {\n ++tokenTypeCounter;\n keywords.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n // In the exported token type, we set the label as \"name\" for backward compatibility with Babel 7\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport type InternalTokenTypes = typeof tt;\n\nexport const tt = {\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n // start: isTemplate\n templateTail: createToken(\"...`\", { startsExpr }),\n templateNonTail: createToken(\"...${\", { beforeExpr, startsExpr }),\n // end: isTemplate\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // These are only needed to support % and ^ as a Hack-pipe topic token.\n // When the proposal settles on a token, the others can be merged with\n // tt.assign.\n xorAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n\n // More possible topic tokens.\n // When the proposal settles on a token, at least one of these may be removed.\n doubleCaret: createToken(\"^^\", { startsExpr }),\n doubleAt: createToken(\"@@\", { startsExpr }),\n\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\"/<=/>=\", 7),\n gt: createBinop(\"/<=/>=\", 7),\n relational: createBinop(\"/<=/>=\", 7),\n bitShift: createBinop(\"<>/>>>\", 8),\n bitShiftL: createBinop(\"<>/>>>\", 8),\n bitShiftR: createBinop(\"<>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isLiteralPropertyName\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // Primary literals\n // start: isIdentifier\n _as: createKeywordLike(\"as\", { startsExpr }),\n _assert: createKeywordLike(\"assert\", { startsExpr }),\n _async: createKeywordLike(\"async\", { startsExpr }),\n _await: createKeywordLike(\"await\", { startsExpr }),\n _defer: createKeywordLike(\"defer\", { startsExpr }),\n _from: createKeywordLike(\"from\", { startsExpr }),\n _get: createKeywordLike(\"get\", { startsExpr }),\n _let: createKeywordLike(\"let\", { startsExpr }),\n _meta: createKeywordLike(\"meta\", { startsExpr }),\n _of: createKeywordLike(\"of\", { startsExpr }),\n _sent: createKeywordLike(\"sent\", { startsExpr }),\n _set: createKeywordLike(\"set\", { startsExpr }),\n _source: createKeywordLike(\"source\", { startsExpr }),\n _static: createKeywordLike(\"static\", { startsExpr }),\n _using: createKeywordLike(\"using\", { startsExpr }),\n _yield: createKeywordLike(\"yield\", { startsExpr }),\n\n // Flow and TypeScript Keywordlike\n _asserts: createKeywordLike(\"asserts\", { startsExpr }),\n _checks: createKeywordLike(\"checks\", { startsExpr }),\n _exports: createKeywordLike(\"exports\", { startsExpr }),\n _global: createKeywordLike(\"global\", { startsExpr }),\n _implements: createKeywordLike(\"implements\", { startsExpr }),\n _intrinsic: createKeywordLike(\"intrinsic\", { startsExpr }),\n _infer: createKeywordLike(\"infer\", { startsExpr }),\n _is: createKeywordLike(\"is\", { startsExpr }),\n _mixins: createKeywordLike(\"mixins\", { startsExpr }),\n _proto: createKeywordLike(\"proto\", { startsExpr }),\n _require: createKeywordLike(\"require\", { startsExpr }),\n _satisfies: createKeywordLike(\"satisfies\", { startsExpr }),\n // start: isTSTypeOperator\n _keyof: createKeywordLike(\"keyof\", { startsExpr }),\n _readonly: createKeywordLike(\"readonly\", { startsExpr }),\n _unique: createKeywordLike(\"unique\", { startsExpr }),\n // end: isTSTypeOperator\n // start: isTSDeclarationStart\n _abstract: createKeywordLike(\"abstract\", { startsExpr }),\n _declare: createKeywordLike(\"declare\", { startsExpr }),\n _enum: createKeywordLike(\"enum\", { startsExpr }),\n _module: createKeywordLike(\"module\", { startsExpr }),\n _namespace: createKeywordLike(\"namespace\", { startsExpr }),\n // start: isFlowInterfaceOrTypeOrOpaque\n _interface: createKeywordLike(\"interface\", { startsExpr }),\n _type: createKeywordLike(\"type\", { startsExpr }),\n // end: isTSDeclarationStart\n _opaque: createKeywordLike(\"opaque\", { startsExpr }),\n // end: isFlowInterfaceOrTypeOrOpaque\n name: createToken(\"name\", { startsExpr }),\n // end: isIdentifier\n\n string: createToken(\"string\", { startsExpr }),\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n decimal: createToken(\"decimal\", { startsExpr }),\n // end: isLiteralPropertyName\n regexp: createToken(\"regexp\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr: true }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr: true }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr: true }),\n} as const;\n\nexport function tokenIsIdentifier(token: TokenType): boolean {\n return token >= tt._as && token <= tt.name;\n}\n\nexport function tokenKeywordOrIdentifierIsKeyword(token: TokenType): boolean {\n // we can remove the token >= tt._in check when we\n // know a token is either keyword or identifier\n return token <= tt._while;\n}\n\nexport function tokenIsKeywordOrIdentifier(token: TokenType): boolean {\n return token >= tt._in && token <= tt.name;\n}\n\nexport function tokenIsLiteralPropertyName(token: TokenType): boolean {\n return token >= tt._in && token <= tt.decimal;\n}\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsFlowInterfaceOrTypeOrOpaque(token: TokenType): boolean {\n return token >= tt._interface && token <= tt._opaque;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenIsTSTypeOperator(token: TokenType): boolean {\n return token >= tt._keyof && token <= tt._unique;\n}\n\nexport function tokenIsTSDeclarationStart(token: TokenType): boolean {\n return token >= tt._abstract && token <= tt._type;\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsBinaryOperator(token: TokenType): boolean {\n return tokenBinops[token] !== -1;\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function tokenIsTemplate(token: TokenType): boolean {\n return token >= tt.templateTail && token <= tt.templateNonTail;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n","import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","import * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n","import { ScopeFlag, BindingFlag } from \"./scopeflags.ts\";\nimport type { Position } from \"./location.ts\";\nimport type * as N from \"../types.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type Tokenizer from \"../tokenizer/index.ts\";\n\nexport const enum NameType {\n // var-declared names in the current lexical scope\n Var = 1 << 0,\n // lexically-declared names in the current lexical scope\n Lexical = 1 << 1,\n // lexically-declared FunctionDeclaration names in the current lexical scope\n Function = 1 << 2,\n}\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n flags: ScopeFlag = 0;\n names: Map = new Map();\n firstLexicalName = \"\";\n\n constructor(flags: ScopeFlag) {\n this.flags = flags;\n }\n}\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler {\n parser: Tokenizer;\n scopeStack: Array = [];\n inModule: boolean;\n undefinedExports: Map = new Map();\n\n constructor(parser: Tokenizer, inModule: boolean) {\n this.parser = parser;\n this.inModule = inModule;\n }\n\n get inTopLevel() {\n return (this.currentScope().flags & ScopeFlag.PROGRAM) > 0;\n }\n get inFunction() {\n return (this.currentVarScopeFlags() & ScopeFlag.FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & ScopeFlag.CLASS) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (flags & ScopeFlag.CLASS) > 0 && (flags & ScopeFlag.FUNCTION) === 0;\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.STATIC_BLOCK) {\n return true;\n }\n if (flags & (ScopeFlag.VAR | ScopeFlag.CLASS)) {\n // function body, module body, class property initializers\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & ScopeFlag.FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlag): Scope {\n return new Scope(flags);\n }\n\n enter(flags: ScopeFlag) {\n /*:: +createScope: (flags:ScopeFlag) => IScope; */\n // @ts-expect-error This method will be overwritten by subclasses\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit(): ScopeFlag {\n const scope = this.scopeStack.pop();\n return scope.flags;\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & (ScopeFlag.FUNCTION | ScopeFlag.STATIC_BLOCK) ||\n (!this.parser.inModule && scope.flags & ScopeFlag.PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n let scope = this.currentScope();\n if (\n bindingType & BindingFlag.SCOPE_LEXICAL ||\n bindingType & BindingFlag.SCOPE_FUNCTION\n ) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n\n let type = scope.names.get(name) || 0;\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n type = type | NameType.Function;\n } else {\n if (!scope.firstLexicalName) {\n scope.firstLexicalName = name;\n }\n type = type | NameType.Lexical;\n }\n\n scope.names.set(name, type);\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BindingFlag.SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n scope.names.set(name, (scope.names.get(name) || 0) | NameType.Var);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & ScopeFlag.VAR) break;\n }\n }\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n loc: Position,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.parser.raise(Errors.VarRedeclaration, loc, {\n identifierName: name,\n });\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (!(bindingType & BindingFlag.KIND_VALUE)) return false;\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n return scope.names.has(name);\n }\n\n const type = scope.names.get(name);\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n return (\n (type & NameType.Lexical) > 0 ||\n (!this.treatFunctionsAsVarInScope(scope) && (type & NameType.Var) > 0)\n );\n }\n\n return (\n ((type & NameType.Lexical) > 0 &&\n // Annex B.3.4\n // https://tc39.es/ecma262/#sec-variablestatements-in-catch-blocks\n !(\n scope.flags & ScopeFlag.SIMPLE_CATCH &&\n scope.firstLexicalName === name\n )) ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n (type & NameType.Function) > 0)\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n const topLevelScope = this.scopeStack[0];\n if (!topLevelScope.names.has(name)) {\n this.undefinedExports.set(name, id.loc.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n currentVarScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.VAR) {\n return flags;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n currentThisScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (\n flags & (ScopeFlag.VAR | ScopeFlag.CLASS) &&\n !(flags & ScopeFlag.ARROW)\n ) {\n return flags;\n }\n }\n }\n}\n","import type { Position } from \"../../util/location.ts\";\nimport ScopeHandler, { NameType, Scope } from \"../../util/scope.ts\";\nimport { BindingFlag, type ScopeFlag } from \"../../util/scopeflags.ts\";\nimport type * as N from \"../../types.ts\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlag): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n const scope = this.currentScope();\n if (bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n\n if (\n bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN &&\n !scope.declareFunctions.has(name)\n ) {\n const type = scope.names.get(name);\n return (type & NameType.Function) > 0 || (type & NameType.Lexical) > 0;\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n","import type { Options } from \"../options.ts\";\nimport type State from \"../tokenizer/state.ts\";\nimport type { PluginsMap } from \"./index.ts\";\nimport type ScopeHandler from \"../util/scope.ts\";\nimport type ExpressionScopeHandler from \"../util/expression-scope.ts\";\nimport type ClassScopeHandler from \"../util/class-scope.ts\";\nimport type ProductionParameterHandler from \"../util/production-parameter.ts\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings.ts\";\nimport type * as N from \"../types.ts\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n // Comment store for Program.comments\n declare comments: Array;\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions)?.[\n name\n ];\n }\n}\n","/*:: declare var invariant; */\n\nimport BaseParser from \"./base.ts\";\nimport type { Comment, Node, Identifier } from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport type { Undone } from \"./node.ts\";\n\n/**\n * A whitespace token containing comments\n */\nexport type CommentWhitespace = {\n /**\n * the start of the whitespace token.\n */\n start: number;\n /**\n * the end of the whitespace token.\n */\n end: number;\n /**\n * the containing comments\n */\n comments: Array;\n /**\n * the immediately preceding AST node of the whitespace token\n */\n leadingNode: Node | null;\n /**\n * the immediately following AST node of the whitespace token\n */\n trailingNode: Node | null;\n /**\n * the innermost AST node containing the whitespace with minimal size (|end - start|)\n */\n containingNode: Node | null;\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setTrailingComments(node: Undone, comments: Array) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setLeadingComments(node: Undone, comments: Array) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nexport function setInnerComments(\n node: Undone,\n comments?: Array,\n) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n */\nfunction adjustInnerComments(\n node: Undone,\n elements: Array,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n const { commentsLen } = this.state;\n if (this.comments.length != commentsLen) this.comments.length = commentsLen;\n this.comments.push(comment);\n this.state.commentsLen++;\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (this.input.charCodeAt(commentStart - 1) === charCodes.comma) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * async /* 1 *​/ function f() {}\n * ```\n * the comment whitespace `/* 1 *​/` has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark `/* 1 *​/` as\n * inner comments. So `/* 1 *​/` should be detached from the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node leading comments, assuming that `node` is a\n * single-token node. Used in import phase modifiers parsing. We parse\n * `module` in `import module foo from ...` as an identifier but may\n * reinterpret it into a phase modifier later. In this case the identifier is\n * not part of the AST and we should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * import /* 1 *​/ module a from \"a\";\n * ```\n * the comment whitespace `/* 1 *​/` has trailing node Identifier(module). When\n * we see that `module` is not a default import binding, we mark `/* 1 *​/` as\n * inner comments of the ImportDeclaration. So `/* 1 *​/` should be detached from\n * the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousIdentifierLeadingComments(node: Identifier) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n\n if (commentStack[length - 1].trailingNode === node) {\n commentStack[length - 1].trailingNode = null;\n } else if (length >= 2 && commentStack[length - 2].trailingNode === node) {\n commentStack[length - 2].trailingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n","import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/g;\n\n// Skip whitespace and single-line comments, including /* no newline here */.\n// After this RegExp matches, its lastIndex points to a line terminator, or\n// the start of multi-line comment (which is effectively a line terminator),\n// or the end of string.\nexport const skipWhiteSpaceToLineBreak = new RegExp(\n // Unfortunately JS doesn't support Perl's atomic /(?>pattern)/ or\n // possessive quantifiers, so we use a trick to prevent backtracking\n // when the look-ahead for line terminator fails.\n \"(?=(\" +\n // Capture the whitespace and comments that should be skipped inside\n // a look-ahead assertion, and then re-match the group as a unit.\n skipWhiteSpaceInLine.source +\n \"))\\\\1\" +\n // Look-ahead for either line terminator, start of multi-line comment,\n // or end of string.\n /(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)/.source,\n \"y\", // sticky\n);\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","import type { Options } from \"../options.ts\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location.ts\";\n\nimport { types as ct, type TokContext } from \"./context.ts\";\nimport { tt, type TokenType } from \"./types.ts\";\nimport type { Errors } from \"../parse-error.ts\";\nimport type { ParseError } from \"../parse-error.ts\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number;\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0;\n};\n\nconst enum StateFlags {\n None = 0,\n Strict = 1 << 0,\n maybeInArrowParameters = 1 << 1,\n inType = 1 << 2,\n noAnonFunctionType = 1 << 3,\n hasFlowComment = 1 << 4,\n isAmbientContext = 1 << 5,\n inAbstractClass = 1 << 6,\n inDisallowConditionalTypesContext = 1 << 7,\n soloAwait = 1 << 8,\n inFSharpPipelineDirectBody = 1 << 9,\n canStartJSXElement = 1 << 10,\n containsEsc = 1 << 11,\n}\n\nexport const enum LoopLabelKind {\n Loop = 1,\n Switch = 2,\n}\n\nexport default class State {\n flags: number = StateFlags.canStartJSXElement;\n\n get strict(): boolean {\n return (this.flags & StateFlags.Strict) > 0;\n }\n set strict(value: boolean) {\n if (value) {\n this.flags |= StateFlags.Strict;\n } else {\n this.flags &= ~StateFlags.Strict;\n }\n }\n curLine: number;\n lineStart: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init({ strictMode, sourceType, startLine, startColumn }: Options): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);\n }\n\n errors: ParseError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n get maybeInArrowParameters(): boolean {\n return (this.flags & StateFlags.maybeInArrowParameters) > 0;\n }\n set maybeInArrowParameters(value: boolean) {\n if (value) {\n this.flags |= StateFlags.maybeInArrowParameters;\n } else {\n this.flags &= ~StateFlags.maybeInArrowParameters;\n }\n }\n get inType(): boolean {\n return (this.flags & StateFlags.inType) > 0;\n }\n set inType(value: boolean) {\n if (value) {\n this.flags |= StateFlags.inType;\n } else {\n this.flags &= ~StateFlags.inType;\n }\n }\n get noAnonFunctionType(): boolean {\n return (this.flags & StateFlags.noAnonFunctionType) > 0;\n }\n set noAnonFunctionType(value: boolean) {\n if (value) {\n this.flags |= StateFlags.noAnonFunctionType;\n } else {\n this.flags &= ~StateFlags.noAnonFunctionType;\n }\n }\n get hasFlowComment(): boolean {\n return (this.flags & StateFlags.hasFlowComment) > 0;\n }\n set hasFlowComment(value: boolean) {\n if (value) {\n this.flags |= StateFlags.hasFlowComment;\n } else {\n this.flags &= ~StateFlags.hasFlowComment;\n }\n }\n get isAmbientContext(): boolean {\n return (this.flags & StateFlags.isAmbientContext) > 0;\n }\n set isAmbientContext(value: boolean) {\n if (value) {\n this.flags |= StateFlags.isAmbientContext;\n } else {\n this.flags &= ~StateFlags.isAmbientContext;\n }\n }\n get inAbstractClass(): boolean {\n return (this.flags & StateFlags.inAbstractClass) > 0;\n }\n set inAbstractClass(value: boolean) {\n if (value) {\n this.flags |= StateFlags.inAbstractClass;\n } else {\n this.flags &= ~StateFlags.inAbstractClass;\n }\n }\n get inDisallowConditionalTypesContext(): boolean {\n return (this.flags & StateFlags.inDisallowConditionalTypesContext) > 0;\n }\n set inDisallowConditionalTypesContext(value: boolean) {\n if (value) {\n this.flags |= StateFlags.inDisallowConditionalTypesContext;\n } else {\n this.flags &= ~StateFlags.inDisallowConditionalTypesContext;\n }\n }\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n get soloAwait(): boolean {\n return (this.flags & StateFlags.soloAwait) > 0;\n }\n set soloAwait(value: boolean) {\n if (value) {\n this.flags |= StateFlags.soloAwait;\n } else {\n this.flags &= ~StateFlags.soloAwait;\n }\n }\n get inFSharpPipelineDirectBody(): boolean {\n return (this.flags & StateFlags.inFSharpPipelineDirectBody) > 0;\n }\n set inFSharpPipelineDirectBody(value: boolean) {\n if (value) {\n this.flags |= StateFlags.inFSharpPipelineDirectBody;\n } else {\n this.flags &= ~StateFlags.inFSharpPipelineDirectBody;\n }\n }\n\n // Labels in scope.\n labels: Array<{\n kind: LoopLabelKind;\n name?: string | null;\n statementStart?: number;\n }> = [];\n\n commentsLen = 0;\n // Comment attachment store\n commentStack: Array = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array = [ct.brace];\n // Used to track whether a JSX element is allowed to form\n get canStartJSXElement(): boolean {\n return (this.flags & StateFlags.canStartJSXElement) > 0;\n }\n set canStartJSXElement(value: boolean) {\n if (value) {\n this.flags |= StateFlags.canStartJSXElement;\n } else {\n this.flags &= ~StateFlags.canStartJSXElement;\n }\n }\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n get containsEsc(): boolean {\n return (this.flags & StateFlags.containsEsc) > 0;\n }\n set containsEsc(value: boolean) {\n if (value) {\n this.flags |= StateFlags.containsEsc;\n } else {\n this.flags &= ~StateFlags.containsEsc;\n }\n }\n\n // Used to track invalid escape sequences in template literals,\n // that must be reported if the template is not tagged.\n firstInvalidTemplateEscapePos: null | Position = null;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n /**\n * When we add a new property, we must manually update the `clone` method\n * @see State#clone\n */\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart, this.pos);\n }\n\n clone(): State {\n const state = new State();\n state.flags = this.flags;\n state.curLine = this.curLine;\n state.lineStart = this.lineStart;\n state.startLoc = this.startLoc;\n state.endLoc = this.endLoc;\n state.errors = this.errors.slice();\n state.potentialArrowAt = this.potentialArrowAt;\n state.noArrowAt = this.noArrowAt.slice();\n state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();\n state.topicContext = this.topicContext;\n state.labels = this.labels.slice();\n state.commentsLen = this.commentsLen;\n state.commentStack = this.commentStack.slice();\n state.pos = this.pos;\n state.type = this.type;\n state.value = this.value;\n state.start = this.start;\n state.end = this.end;\n state.lastTokEndLoc = this.lastTokEndLoc;\n state.lastTokStartLoc = this.lastTokStartLoc;\n state.context = this.context.slice();\n state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;\n state.strictErrors = this.strictErrors;\n state.tokensLength = this.tokensLength;\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number;\n value: any;\n type: TokenType;\n start: number;\n end: number;\n context: TokContext[];\n startLoc: Position;\n lastTokEndLoc: Position;\n curLine: number;\n lineStart: number;\n curPosition: () => Position;\n /* Used only in readToken_mult_modulo */\n inType: boolean;\n // These boolean properties are not initialized in createLookaheadState()\n // instead they will only be set by the tokenizer\n containsEsc?: boolean;\n};\n","import * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = input.slice(startPos, pos + 2).match(/^[0-7]+/)!;\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n","/*:: declare var invariant; */\n\nimport type { Options } from \"../options.ts\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location.ts\";\nimport CommentsParser, { type CommentWhitespace } from \"../parser/comments.ts\";\nimport type * as N from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier.ts\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types.ts\";\nimport type { TokContext } from \"./context.ts\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n} from \"../parse-error.ts\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n skipWhiteSpaceInLine,\n} from \"../util/whitespace.ts\";\nimport State from \"./state.ts\";\nimport type { LookaheadState, DeferredStrictError } from \"./state.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { Node } from \"../types.ts\";\n\nimport {\n readInt,\n readCodePoint,\n readStringContents,\n type IntErrorHandlers,\n type CodePointErrorHandlers,\n type StringContentsErrorHandlers,\n} from \"@babel/helper-string-parser\";\n\nimport type { Plugin } from \"../typings.ts\";\n\nfunction buildPosition(pos: number, lineStart: number, curLine: number) {\n return new Position(curLine, pos - lineStart, pos);\n}\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n charCodes.lowercaseV,\n]);\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default abstract class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.comments = [];\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // @ts-expect-error For performance we use a simplified tokenizer state structure\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n /**\n * Similar to nextToken, but it will stop at line break when it is seen before the next token\n *\n * @returns {number} position of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n nextTokenInLineStart(): number {\n return this.nextTokenInLineStartSince(this.state.pos);\n }\n\n nextTokenInLineStartSince(pos: number): number {\n skipWhiteSpaceInLine.lastIndex = pos;\n return skipWhiteSpaceInLine.test(this.input)\n ? skipWhiteSpaceInLine.lastIndex\n : pos;\n }\n\n /**\n * Similar to lookaheadCharCode, but it will return the char code of line break if it is\n * seen before the next token\n *\n * @returns {number} char code of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n lookaheadInLineCharCode(): number {\n return this.input.charCodeAt(this.nextTokenInLineStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, at),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related properties.\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n // Skips a block comment, whose end is marked by commentEnd.\n // *-/ is used by the Flow plugin, when parsing block comments nested\n // inside Flow comments.\n skipBlockComment(commentEnd: \"*/\" | \"*-/\"): N.CommentBlock | undefined {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, this.state.curPosition());\n }\n\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment: N.CommentBlock = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start,\n end: end + commentEnd.length,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | undefined {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment: N.CommentLine = {\n type: \"CommentLine\",\n value,\n start,\n end,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (\n ch === charCodes.dash &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // ` + +#### ❌ Incorrect + +```ts option='{"paths":[{"name":"import-foo","message":"Please use import-bar instead.","allowTypeImports":true},{"name":"import-baz","message":"Please use import-quux instead.","allowTypeImports":true}]}' +import foo from 'import-foo'; +export { Foo } from 'import-foo'; + +import baz from 'import-baz'; +export { Baz } from 'import-baz'; +``` + +#### ✅ Correct + +```ts option='{"paths":[{"name":"import-foo","message":"Please use import-bar instead.","allowTypeImports":true},{"name":"import-baz","message":"Please use import-quux instead.","allowTypeImports":true}]}' +import { foo } from 'other-module'; + +import type foo from 'import-foo'; +export type { Foo } from 'import-foo'; + +import type baz from 'import-baz'; +export type { Baz } from 'import-baz'; +``` diff --git a/.pnpm-store/v3/files/67/915f0d9b60e1ac9cb037238e4b2d2c2dec3eea32bdb2f58e74397c82a0975a91b3833c4f8a89ada22258cdbdab9f8f01d7a7d811a3cfb8f43aa7c89899d07f b/.pnpm-store/v3/files/67/915f0d9b60e1ac9cb037238e4b2d2c2dec3eea32bdb2f58e74397c82a0975a91b3833c4f8a89ada22258cdbdab9f8f01d7a7d811a3cfb8f43aa7c89899d07f new file mode 100644 index 00000000..9b291bdd --- /dev/null +++ b/.pnpm-store/v3/files/67/915f0d9b60e1ac9cb037238e4b2d2c2dec3eea32bdb2f58e74397c82a0975a91b3833c4f8a89ada22258cdbdab9f8f01d7a7d811a3cfb8f43aa7c89899d07f @@ -0,0 +1,49 @@ +# es-define-property [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +`Object.defineProperty`, but not IE 8's broken one. + +## Example + +```js +const assert = require('assert'); + +const $defineProperty = require('es-define-property'); + +if ($defineProperty) { + assert.equal($defineProperty, Object.defineProperty); +} else if (Object.defineProperty) { + assert.equal($defineProperty, false, 'this is IE 8'); +} else { + assert.equal($defineProperty, false, 'this is an ES3 engine'); +} +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-define-property +[npm-version-svg]: https://versionbadg.es/ljharb/es-define-property.svg +[deps-svg]: https://david-dm.org/ljharb/es-define-property.svg +[deps-url]: https://david-dm.org/ljharb/es-define-property +[dev-deps-svg]: https://david-dm.org/ljharb/es-define-property/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-define-property#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-define-property.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-define-property.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-define-property.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-define-property +[codecov-image]: https://codecov.io/gh/ljharb/es-define-property/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-define-property/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-define-property +[actions-url]: https://github.com/ljharb/es-define-property/actions diff --git a/.pnpm-store/v3/files/67/f22e2a6f8aab883d7a41309f4840c01d288beddea9a14e961b165777513c0b00984a20914e6d13ce6d4ed9e212f8cad5fb5103e5aee330442533caee4d0994 b/.pnpm-store/v3/files/67/f22e2a6f8aab883d7a41309f4840c01d288beddea9a14e961b165777513c0b00984a20914e6d13ce6d4ed9e212f8cad5fb5103e5aee330442533caee4d0994 new file mode 100644 index 00000000..9aaf622d --- /dev/null +++ b/.pnpm-store/v3/files/67/f22e2a6f8aab883d7a41309f4840c01d288beddea9a14e961b165777513c0b00984a20914e6d13ce6d4ed9e212f8cad5fb5103e5aee330442533caee4d0994 @@ -0,0 +1,631 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const LT = `[${Array.from(new Set(['\r\n', '\r', '\n', '\u2028', '\u2029'])).join('')}]`; +const PADDING_LINE_SEQUENCE = new RegExp(String.raw `^(\s*?${LT})\s*${LT}(\s*;?)$`, 'u'); +/** + * Creates tester which check if a node starts with specific keyword with the + * appropriate AST_NODE_TYPES. + * @param keyword The keyword to test. + * @returns the created tester. + * @private + */ +function newKeywordTester(type, keyword) { + return { + test(node, sourceCode) { + const isSameKeyword = sourceCode.getFirstToken(node)?.value === keyword; + const isSameType = Array.isArray(type) + ? type.some(val => val === node.type) + : type === node.type; + return isSameKeyword && isSameType; + }, + }; +} +/** + * Creates tester which check if a node starts with specific keyword and spans a single line. + * @param keyword The keyword to test. + * @returns the created tester. + * @private + */ +function newSinglelineKeywordTester(keyword) { + return { + test(node, sourceCode) { + return (node.loc.start.line === node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword); + }, + }; +} +/** + * Creates tester which check if a node starts with specific keyword and spans multiple lines. + * @param keyword The keyword to test. + * @returns the created tester. + * @private + */ +function newMultilineKeywordTester(keyword) { + return { + test(node, sourceCode) { + return (node.loc.start.line !== node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword); + }, + }; +} +/** + * Creates tester which check if a node is specific type. + * @param type The node type to test. + * @returns the created tester. + * @private + */ +function newNodeTypeTester(type) { + return { + test: (node) => node.type === type, + }; +} +/** + * Skips a chain expression node + * @param node The node to test + * @returnsA non-chain expression + * @private + */ +function skipChainExpression(node) { + return node.type === utils_1.AST_NODE_TYPES.ChainExpression ? node.expression : node; +} +/** + * Checks the given node is an expression statement of IIFE. + * @param node The node to check. + * @returns `true` if the node is an expression statement of IIFE. + * @private + */ +function isIIFEStatement(node) { + if (node.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + let expression = skipChainExpression(node.expression); + if (expression.type === utils_1.AST_NODE_TYPES.UnaryExpression) { + expression = skipChainExpression(expression.argument); + } + if (expression.type === utils_1.AST_NODE_TYPES.CallExpression) { + let node = expression.callee; + while (node.type === utils_1.AST_NODE_TYPES.SequenceExpression) { + node = node.expressions[node.expressions.length - 1]; + } + return (0, util_1.isFunction)(node); + } + } + return false; +} +/** + * Checks the given node is a CommonJS require statement + * @param node The node to check. + * @returns `true` if the node is a CommonJS require statement. + * @private + */ +function isCJSRequire(node) { + if (node.type === utils_1.AST_NODE_TYPES.VariableDeclaration) { + const declaration = node.declarations.at(0); + if (declaration?.init) { + let call = declaration.init; + while (call.type === utils_1.AST_NODE_TYPES.MemberExpression) { + call = call.object; + } + if (call.type === utils_1.AST_NODE_TYPES.CallExpression && + call.callee.type === utils_1.AST_NODE_TYPES.Identifier) { + return call.callee.name === 'require'; + } + } + } + return false; +} +/** + * Checks whether the given node is a block-like statement. + * This checks the last token of the node is the closing brace of a block. + * @param node The node to check. + * @param sourceCode The source code to get tokens. + * @returns `true` if the node is a block-like statement. + * @private + */ +function isBlockLikeStatement(node, sourceCode) { + // do-while with a block is a block-like statement. + if (node.type === utils_1.AST_NODE_TYPES.DoWhileStatement && + node.body.type === utils_1.AST_NODE_TYPES.BlockStatement) { + return true; + } + /** + * IIFE is a block-like statement specially from + * JSCS#disallowPaddingNewLinesAfterBlocks. + */ + if (isIIFEStatement(node)) { + return true; + } + // Checks the last token is a closing brace of blocks. + const lastToken = sourceCode.getLastToken(node, util_1.isNotSemicolonToken); + const belongingNode = lastToken && (0, util_1.isClosingBraceToken)(lastToken) + ? sourceCode.getNodeByRangeIndex(lastToken.range[0]) + : null; + return (!!belongingNode && + (belongingNode.type === utils_1.AST_NODE_TYPES.BlockStatement || + belongingNode.type === utils_1.AST_NODE_TYPES.SwitchStatement)); +} +/** + * Check whether the given node is a directive or not. + * @param node The node to check. + * @param sourceCode The source code object to get tokens. + * @returns `true` if the node is a directive. + */ +function isDirective(node, sourceCode) { + return (node.type === utils_1.AST_NODE_TYPES.ExpressionStatement && + (node.parent.type === utils_1.AST_NODE_TYPES.Program || + (node.parent.type === utils_1.AST_NODE_TYPES.BlockStatement && + (0, util_1.isFunction)(node.parent.parent))) && + node.expression.type === utils_1.AST_NODE_TYPES.Literal && + typeof node.expression.value === 'string' && + !(0, util_1.isParenthesized)(node.expression, sourceCode)); +} +/** + * Check whether the given node is a part of directive prologue or not. + * @param node The node to check. + * @param sourceCode The source code object to get tokens. + * @returns `true` if the node is a part of directive prologue. + */ +function isDirectivePrologue(node, sourceCode) { + if (isDirective(node, sourceCode) && + node.parent && + 'body' in node.parent && + Array.isArray(node.parent.body)) { + for (const sibling of node.parent.body) { + if (sibling === node) { + break; + } + if (!isDirective(sibling, sourceCode)) { + return false; + } + } + return true; + } + return false; +} +/** + * Checks the given node is a CommonJS export statement + * @param node The node to check. + * @returns `true` if the node is a CommonJS export statement. + * @private + */ +function isCJSExport(node) { + if (node.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + const expression = node.expression; + if (expression.type === utils_1.AST_NODE_TYPES.AssignmentExpression) { + let left = expression.left; + if (left.type === utils_1.AST_NODE_TYPES.MemberExpression) { + while (left.object.type === utils_1.AST_NODE_TYPES.MemberExpression) { + left = left.object; + } + return (left.object.type === utils_1.AST_NODE_TYPES.Identifier && + (left.object.name === 'exports' || + (left.object.name === 'module' && + left.property.type === utils_1.AST_NODE_TYPES.Identifier && + left.property.name === 'exports'))); + } + } + } + return false; +} +/** + * Check whether the given node is an expression + * @param node The node to check. + * @param sourceCode The source code object to get tokens. + * @returns `true` if the node is an expression + */ +function isExpression(node, sourceCode) { + return (node.type === utils_1.AST_NODE_TYPES.ExpressionStatement && + !isDirectivePrologue(node, sourceCode)); +} +/** + * Gets the actual last token. + * + * If a semicolon is semicolon-less style's semicolon, this ignores it. + * For example: + * + * foo() + * ;[1, 2, 3].forEach(bar) + * @param node The node to get. + * @param sourceCode The source code to get tokens. + * @returns The actual last token. + * @private + */ +function getActualLastToken(node, sourceCode) { + const semiToken = sourceCode.getLastToken(node); + const prevToken = sourceCode.getTokenBefore(semiToken); + const nextToken = sourceCode.getTokenAfter(semiToken); + const isSemicolonLessStyle = prevToken && + nextToken && + prevToken.range[0] >= node.range[0] && + (0, util_1.isSemicolonToken)(semiToken) && + semiToken.loc.start.line !== prevToken.loc.end.line && + semiToken.loc.end.line === nextToken.loc.start.line; + return isSemicolonLessStyle ? prevToken : semiToken; +} +/** + * This returns the concatenation of the first 2 captured strings. + * @param _ Unused. Whole matched string. + * @param trailingSpaces The trailing spaces of the first line. + * @param indentSpaces The indentation spaces of the last line. + * @returns The concatenation of trailingSpaces and indentSpaces. + * @private + */ +function replacerToRemovePaddingLines(_, trailingSpaces, indentSpaces) { + return trailingSpaces + indentSpaces; +} +/** + * Check and report statements for `any` configuration. + * It does nothing. + * + * @private + */ +function verifyForAny() { + // Empty +} +/** + * Check and report statements for `never` configuration. + * This autofix removes blank lines between the given 2 statements. + * However, if comments exist between 2 blank lines, it does not remove those + * blank lines automatically. + * @param context The rule context to report. + * @param _ Unused. The previous node to check. + * @param nextNode The next node to check. + * @param paddingLines The array of token pairs that blank + * lines exist between the pair. + * + * @private + */ +function verifyForNever(context, _, nextNode, paddingLines) { + if (paddingLines.length === 0) { + return; + } + context.report({ + node: nextNode, + messageId: 'unexpectedBlankLine', + fix(fixer) { + if (paddingLines.length >= 2) { + return null; + } + const prevToken = paddingLines[0][0]; + const nextToken = paddingLines[0][1]; + const start = prevToken.range[1]; + const end = nextToken.range[0]; + const text = context.sourceCode.text + .slice(start, end) + .replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines); + return fixer.replaceTextRange([start, end], text); + }, + }); +} +/** + * Check and report statements for `always` configuration. + * This autofix inserts a blank line between the given 2 statements. + * If the `prevNode` has trailing comments, it inserts a blank line after the + * trailing comments. + * @param context The rule context to report. + * @param prevNode The previous node to check. + * @param nextNode The next node to check. + * @param paddingLines The array of token pairs that blank + * lines exist between the pair. + * + * @private + */ +function verifyForAlways(context, prevNode, nextNode, paddingLines) { + if (paddingLines.length > 0) { + return; + } + context.report({ + node: nextNode, + messageId: 'expectedBlankLine', + fix(fixer) { + let prevToken = getActualLastToken(prevNode, context.sourceCode); + const nextToken = context.sourceCode.getFirstTokenBetween(prevToken, nextNode, { + includeComments: true, + /** + * Skip the trailing comments of the previous node. + * This inserts a blank line after the last trailing comment. + * + * For example: + * + * foo(); // trailing comment. + * // comment. + * bar(); + * + * Get fixed to: + * + * foo(); // trailing comment. + * + * // comment. + * bar(); + * @param token The token to check. + * @returns `true` if the token is not a trailing comment. + * @private + */ + filter(token) { + if ((0, util_1.isTokenOnSameLine)(prevToken, token)) { + prevToken = token; + return false; + } + return true; + }, + }) ?? nextNode; + const insertText = (0, util_1.isTokenOnSameLine)(prevToken, nextToken) + ? '\n\n' + : '\n'; + return fixer.insertTextAfter(prevToken, insertText); + }, + }); +} +/** + * Types of blank lines. + * `any`, `never`, and `always` are defined. + * Those have `verify` method to check and report statements. + * @private + */ +const PaddingTypes = { + any: { verify: verifyForAny }, + never: { verify: verifyForNever }, + always: { verify: verifyForAlways }, +}; +/** + * Types of statements. + * Those have `test` method to check it matches to the given statement. + * @private + */ +const StatementTypes = { + '*': { test: () => true }, + 'block-like': { test: isBlockLikeStatement }, + exports: { test: isCJSExport }, + require: { test: isCJSRequire }, + directive: { test: isDirectivePrologue }, + expression: { test: isExpression }, + iife: { test: isIIFEStatement }, + 'multiline-block-like': { + test: (node, sourceCode) => node.loc.start.line !== node.loc.end.line && + isBlockLikeStatement(node, sourceCode), + }, + 'multiline-expression': { + test: (node, sourceCode) => node.loc.start.line !== node.loc.end.line && + node.type === utils_1.AST_NODE_TYPES.ExpressionStatement && + !isDirectivePrologue(node, sourceCode), + }, + 'multiline-const': newMultilineKeywordTester('const'), + 'multiline-let': newMultilineKeywordTester('let'), + 'multiline-var': newMultilineKeywordTester('var'), + 'singleline-const': newSinglelineKeywordTester('const'), + 'singleline-let': newSinglelineKeywordTester('let'), + 'singleline-var': newSinglelineKeywordTester('var'), + block: newNodeTypeTester(utils_1.AST_NODE_TYPES.BlockStatement), + empty: newNodeTypeTester(utils_1.AST_NODE_TYPES.EmptyStatement), + function: newNodeTypeTester(utils_1.AST_NODE_TYPES.FunctionDeclaration), + break: newKeywordTester(utils_1.AST_NODE_TYPES.BreakStatement, 'break'), + case: newKeywordTester(utils_1.AST_NODE_TYPES.SwitchCase, 'case'), + class: newKeywordTester(utils_1.AST_NODE_TYPES.ClassDeclaration, 'class'), + const: newKeywordTester(utils_1.AST_NODE_TYPES.VariableDeclaration, 'const'), + continue: newKeywordTester(utils_1.AST_NODE_TYPES.ContinueStatement, 'continue'), + debugger: newKeywordTester(utils_1.AST_NODE_TYPES.DebuggerStatement, 'debugger'), + default: newKeywordTester([utils_1.AST_NODE_TYPES.SwitchCase, utils_1.AST_NODE_TYPES.ExportDefaultDeclaration], 'default'), + do: newKeywordTester(utils_1.AST_NODE_TYPES.DoWhileStatement, 'do'), + export: newKeywordTester([ + utils_1.AST_NODE_TYPES.ExportDefaultDeclaration, + utils_1.AST_NODE_TYPES.ExportNamedDeclaration, + ], 'export'), + for: newKeywordTester([ + utils_1.AST_NODE_TYPES.ForStatement, + utils_1.AST_NODE_TYPES.ForInStatement, + utils_1.AST_NODE_TYPES.ForOfStatement, + ], 'for'), + if: newKeywordTester(utils_1.AST_NODE_TYPES.IfStatement, 'if'), + import: newKeywordTester(utils_1.AST_NODE_TYPES.ImportDeclaration, 'import'), + let: newKeywordTester(utils_1.AST_NODE_TYPES.VariableDeclaration, 'let'), + return: newKeywordTester(utils_1.AST_NODE_TYPES.ReturnStatement, 'return'), + switch: newKeywordTester(utils_1.AST_NODE_TYPES.SwitchStatement, 'switch'), + throw: newKeywordTester(utils_1.AST_NODE_TYPES.ThrowStatement, 'throw'), + try: newKeywordTester(utils_1.AST_NODE_TYPES.TryStatement, 'try'), + var: newKeywordTester(utils_1.AST_NODE_TYPES.VariableDeclaration, 'var'), + while: newKeywordTester([utils_1.AST_NODE_TYPES.WhileStatement, utils_1.AST_NODE_TYPES.DoWhileStatement], 'while'), + with: newKeywordTester(utils_1.AST_NODE_TYPES.WithStatement, 'with'), + // Additional Typescript constructs + interface: newKeywordTester(utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, 'interface'), + type: newKeywordTester(utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration, 'type'), +}; +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +exports.default = (0, util_1.createRule)({ + name: 'padding-line-between-statements', + meta: { + deprecated: true, + replacedBy: ['@stylistic/ts/padding-line-between-statements'], + type: 'layout', + docs: { + description: 'Require or disallow padding lines between statements', + extendsBaseRule: true, + }, + fixable: 'whitespace', + hasSuggestions: false, + // This is intentionally an array schema as you can pass 0..n config objects + schema: { + $defs: { + paddingType: { + type: 'string', + enum: Object.keys(PaddingTypes), + }, + statementType: { + anyOf: [ + { + type: 'string', + enum: Object.keys(StatementTypes), + }, + { + type: 'array', + items: { + type: 'string', + enum: Object.keys(StatementTypes), + }, + minItems: 1, + uniqueItems: true, + additionalItems: false, + }, + ], + }, + }, + type: 'array', + additionalItems: false, + items: { + type: 'object', + properties: { + blankLine: { $ref: '#/$defs/paddingType' }, + prev: { $ref: '#/$defs/statementType' }, + next: { $ref: '#/$defs/statementType' }, + }, + additionalProperties: false, + required: ['blankLine', 'prev', 'next'], + }, + }, + messages: { + unexpectedBlankLine: 'Unexpected blank line before this statement.', + expectedBlankLine: 'Expected blank line before this statement.', + }, + }, + defaultOptions: [], + create(context) { + // eslint-disable-next-line no-restricted-syntax -- We need all raw options. + const configureList = context.options; + let scopeInfo = null; + /** + * Processes to enter to new scope. + * This manages the current previous statement. + * + * @private + */ + function enterScope() { + scopeInfo = { + upper: scopeInfo, + prevNode: null, + }; + } + /** + * Processes to exit from the current scope. + * + * @private + */ + function exitScope() { + if (scopeInfo) { + scopeInfo = scopeInfo.upper; + } + } + /** + * Checks whether the given node matches the given type. + * @param node The statement node to check. + * @param type The statement type to check. + * @returns `true` if the statement node matched the type. + * @private + */ + function match(node, type) { + let innerStatementNode = node; + while (innerStatementNode.type === utils_1.AST_NODE_TYPES.LabeledStatement) { + innerStatementNode = innerStatementNode.body; + } + if (Array.isArray(type)) { + return type.some(match.bind(null, innerStatementNode)); + } + return StatementTypes[type].test(innerStatementNode, context.sourceCode); + } + /** + * Finds the last matched configure from configureList. + * @paramprevNode The previous statement to match. + * @paramnextNode The current statement to match. + * @returns The tester of the last matched configure. + * @private + */ + function getPaddingType(prevNode, nextNode) { + for (let i = configureList.length - 1; i >= 0; --i) { + const configure = configureList[i]; + if (match(prevNode, configure.prev) && + match(nextNode, configure.next)) { + return PaddingTypes[configure.blankLine]; + } + } + return PaddingTypes.any; + } + /** + * Gets padding line sequences between the given 2 statements. + * Comments are separators of the padding line sequences. + * @paramprevNode The previous statement to count. + * @paramnextNode The current statement to count. + * @returns The array of token pairs. + * @private + */ + function getPaddingLineSequences(prevNode, nextNode) { + const pairs = []; + let prevToken = getActualLastToken(prevNode, context.sourceCode); + if (nextNode.loc.start.line - prevToken.loc.end.line >= 2) { + do { + const token = context.sourceCode.getTokenAfter(prevToken, { + includeComments: true, + }); + if (token.loc.start.line - prevToken.loc.end.line >= 2) { + pairs.push([prevToken, token]); + } + prevToken = token; + } while (prevToken.range[0] < nextNode.range[0]); + } + return pairs; + } + /** + * Verify padding lines between the given node and the previous node. + * @param node The node to verify. + * + * @private + */ + function verify(node) { + if (!node.parent || + ![ + utils_1.AST_NODE_TYPES.BlockStatement, + utils_1.AST_NODE_TYPES.Program, + utils_1.AST_NODE_TYPES.SwitchCase, + utils_1.AST_NODE_TYPES.SwitchStatement, + utils_1.AST_NODE_TYPES.TSModuleBlock, + ].includes(node.parent.type)) { + return; + } + // Save this node as the current previous statement. + const prevNode = scopeInfo.prevNode; + // Verify. + if (prevNode) { + const type = getPaddingType(prevNode, node); + const paddingLines = getPaddingLineSequences(prevNode, node); + type.verify(context, prevNode, node, paddingLines); + } + scopeInfo.prevNode = node; + } + /** + * Verify padding lines between the given node and the previous node. + * Then process to enter to new scope. + * @param node The node to verify. + * + * @private + */ + function verifyThenEnterScope(node) { + verify(node); + enterScope(); + } + return { + Program: enterScope, + BlockStatement: enterScope, + SwitchStatement: enterScope, + TSModuleBlock: enterScope, + 'Program:exit': exitScope, + 'BlockStatement:exit': exitScope, + 'SwitchStatement:exit': exitScope, + 'TSModuleBlock:exit': exitScope, + ':statement': verify, + SwitchCase: verifyThenEnterScope, + TSDeclareFunction: verifyThenEnterScope, + 'SwitchCase:exit': exitScope, + 'TSDeclareFunction:exit': exitScope, + }; + }, +}); +//# sourceMappingURL=padding-line-between-statements.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/68/3cb750a2523f41f09c2c620a2e7851330cd7bfb8cb5e09c5dbc635652914db2ec6abf1d8a6d094feecc067e5d2a96a48704ffe169e142c46a83d6ea565d612 b/.pnpm-store/v3/files/68/3cb750a2523f41f09c2c620a2e7851330cd7bfb8cb5e09c5dbc635652914db2ec6abf1d8a6d094feecc067e5d2a96a48704ffe169e142c46a83d6ea565d612 new file mode 100644 index 00000000..0f5a3e17 --- /dev/null +++ b/.pnpm-store/v3/files/68/3cb750a2523f41f09c2c620a2e7851330cd7bfb8cb5e09c5dbc635652914db2ec6abf1d8a6d094feecc067e5d2a96a48704ffe169e142c46a83d6ea565d612 @@ -0,0 +1,119 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.overwrite = exports.replaceAll = exports.replace = exports.toString = exports.getLength = void 0; +const binarySearch_1 = require("./binarySearch"); +const track_1 = require("./track"); +function getLength(segments) { + let length = 0; + for (const segment of segments) { + length += typeof segment == 'string' ? segment.length : segment[0].length; + } + return length; +} +exports.getLength = getLength; +function toString(segments) { + return segments.map(s => typeof s === 'string' ? s : s[0]).join(''); +} +exports.toString = toString; +function replace(segments, pattern, ...replacers) { + const str = toString(segments); + const match = str.match(pattern); + if (match && match.index !== undefined) { + const start = match.index; + const end = start + match[0].length; + (0, track_1.offsetStack)(); + overwrite(segments, [start, end], ...replacers.map(replacer => typeof replacer === 'function' ? replacer(match[0]) : replacer)); + (0, track_1.resetOffsetStack)(); + } +} +exports.replace = replace; +function replaceAll(segments, pattern, ...replacers) { + const str = toString(segments); + const allMatch = str.matchAll(pattern); + let length = str.length; + let lengthDiff = 0; + for (const match of allMatch) { + if (match.index !== undefined) { + const start = match.index + lengthDiff; + const end = start + match[0].length; + (0, track_1.offsetStack)(); + overwrite(segments, [start, end], ...replacers.map(replacer => typeof replacer === 'function' ? replacer(match[0]) : replacer)); + (0, track_1.resetOffsetStack)(); + const newLength = getLength(segments); + lengthDiff += newLength - length; + length = newLength; + } + } +} +exports.replaceAll = replaceAll; +function overwrite(segments, range, ...inserts) { + const offsets = toOffsets(segments); + const [start, end] = typeof range === 'number' ? [range, range] : range; + const startIndex = (0, binarySearch_1.binarySearch)(offsets, start); + const endIndex = (0, binarySearch_1.binarySearch)(offsets, end); + const startSegment = segments[startIndex]; + const endSegment = segments[endIndex]; + const startSegmentStart = offsets[startIndex]; + const endSegmentStart = offsets[endIndex]; + const endSegmentEnd = offsets[endIndex] + (typeof endSegment === 'string' ? endSegment.length : endSegment[0].length); + if (start > startSegmentStart) { + inserts.unshift(trimSegmentEnd(startSegment, start - startSegmentStart)); + } + if (end < endSegmentEnd) { + inserts.push(trimSegmentStart(endSegment, end - endSegmentStart)); + } + (0, track_1.offsetStack)(); + const deleted = segments.splice(startIndex, endIndex - startIndex + 1, ...inserts); + (0, track_1.resetOffsetStack)(); + if (end < endSegmentEnd) { + deleted[deleted.length - 1] = trimSegmentEnd(deleted[deleted.length - 1], end - endSegmentStart); + } + if (start > startSegmentStart) { + deleted[0] = trimSegmentStart(deleted[0], start - startSegmentStart); + } + return deleted; +} +exports.overwrite = overwrite; +function trimSegmentEnd(segment, trimEnd) { + if (typeof segment === 'string') { + return segment.slice(0, trimEnd); + } + const originalString = segment[0]; + const originalRange = segment[2]; + const newString = originalString.slice(0, trimEnd); + const newRange = typeof originalRange === 'number' ? originalRange : [originalRange[0], originalRange[1] - (originalString.length - newString.length)]; + return [ + newString, + segment[1], + newRange, + ...segment.slice(3), + ]; +} +function trimSegmentStart(segment, trimStart) { + if (typeof segment === 'string') { + return segment.slice(trimStart); + } + const originalString = segment[0]; + const originalRange = segment[2]; + const newString = originalString.slice(trimStart); + if (trimStart < 0) { + trimStart += originalString.length; + } + const newRange = typeof originalRange === 'number' ? originalRange + trimStart : [originalRange[0] + trimStart, originalRange[1]]; + return [ + newString, + segment[1], + newRange, + ...segment.slice(3), + ]; +} +function toOffsets(segments) { + const offsets = []; + let offset = 0; + for (const segment of segments) { + offsets.push(offset); + offset += typeof segment == 'string' ? segment.length : segment[0].length; + } + return offsets; +} +//# sourceMappingURL=basic.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/68/6c624274ce5c4c3e14e46cd1462581c15f88de5a7abeb3cc09f2feeb4bc31cde56dfe27bf0e47f7c8e786f710c794b30b1921b9882e34c2d182b0710e6c25d b/.pnpm-store/v3/files/68/6c624274ce5c4c3e14e46cd1462581c15f88de5a7abeb3cc09f2feeb4bc31cde56dfe27bf0e47f7c8e786f710c794b30b1921b9882e34c2d182b0710e6c25d new file mode 100644 index 00000000..0a45129c --- /dev/null +++ b/.pnpm-store/v3/files/68/6c624274ce5c4c3e14e46cd1462581c15f88de5a7abeb3cc09f2feeb4bc31cde56dfe27bf0e47f7c8e786f710c794b30b1921b9882e34c2d182b0710e6c25d @@ -0,0 +1,2556 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var _Converter_instances, _Converter_checkModifiers, _Converter_throwUnlessAllowInvalidAST, _Converter_withDeprecatedAliasGetter, _Converter_throwError, _Converter_checkForStatementDeclaration; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Converter = exports.convertError = void 0; +/* eslint-disable @typescript-eslint/no-unnecessary-condition */ +// There's lots of funny stuff due to the typing of ts.Node +/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access */ +const ts = __importStar(require("typescript")); +const getModifiers_1 = require("./getModifiers"); +const node_utils_1 = require("./node-utils"); +const ts_estree_1 = require("./ts-estree"); +const SyntaxKind = ts.SyntaxKind; +/** + * Extends and formats a given error object + * @param error the error object + * @returns converted error object + */ +function convertError(error) { + return (0, node_utils_1.createError)(('message' in error && error.message) || error.messageText, error.file, error.start); +} +exports.convertError = convertError; +class Converter { + /** + * Converts a TypeScript node into an ESTree node + * @param ast the full TypeScript AST + * @param options additional options for the conversion + * @returns the converted ESTreeNode + */ + constructor(ast, options) { + _Converter_instances.add(this); + this.esTreeNodeToTSNodeMap = new WeakMap(); + this.tsNodeToESTreeNodeMap = new WeakMap(); + this.allowPattern = false; + this.ast = ast; + this.options = { ...options }; + } + getASTMaps() { + return { + esTreeNodeToTSNodeMap: this.esTreeNodeToTSNodeMap, + tsNodeToESTreeNodeMap: this.tsNodeToESTreeNodeMap, + }; + } + convertProgram() { + return this.converter(this.ast); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param node the child ts.Node + * @param parent parentNode + * @param allowPattern flag to determine if patterns are allowed + * @returns the converted ESTree node + */ + converter(node, parent, allowPattern) { + /** + * Exit early for null and undefined + */ + if (!node) { + return null; + } + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_checkModifiers).call(this, node); + const pattern = this.allowPattern; + if (allowPattern !== undefined) { + this.allowPattern = allowPattern; + } + const result = this.convertNode(node, (parent ?? node.parent)); + this.registerTSNodeInNodeMap(node, result); + this.allowPattern = pattern; + return result; + } + /** + * Fixes the exports of the given ts.Node + * @param node the ts.Node + * @param result result + * @returns the ESTreeNode with fixed exports + */ + fixExports(node, result) { + const isNamespaceNode = ts.isModuleDeclaration(node) && + Boolean(node.flags & ts.NodeFlags.Namespace); + const modifiers = isNamespaceNode + ? (0, node_utils_1.getNamespaceModifiers)(node) + : (0, getModifiers_1.getModifiers)(node); + if (modifiers?.[0].kind === SyntaxKind.ExportKeyword) { + /** + * Make sure that original node is registered instead of export + */ + this.registerTSNodeInNodeMap(node, result); + const exportKeyword = modifiers[0]; + const nextModifier = modifiers[1]; + const declarationIsDefault = nextModifier?.kind === SyntaxKind.DefaultKeyword; + const varToken = declarationIsDefault + ? (0, node_utils_1.findNextToken)(nextModifier, this.ast, this.ast) + : (0, node_utils_1.findNextToken)(exportKeyword, this.ast, this.ast); + result.range[0] = varToken.getStart(this.ast); + result.loc = (0, node_utils_1.getLocFor)(result.range, this.ast); + if (declarationIsDefault) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration, + declaration: result, + range: [exportKeyword.getStart(this.ast), result.range[1]], + exportKind: 'value', + }); + } + const isType = result.type === ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration || + result.type === ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration; + const isDeclare = 'declare' in result && result.declare; + return this.createNode(node, + // @ts-expect-error - TODO, narrow the types here + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration, + declaration: result, + specifiers: [], + source: null, + exportKind: isType || isDeclare ? 'type' : 'value', + range: [exportKeyword.getStart(this.ast), result.range[1]], + attributes: [], + }, 'assertions', 'attributes', true)); + } + return result; + } + /** + * Register specific TypeScript node into map with first ESTree node provided + */ + registerTSNodeInNodeMap(node, result) { + if (result && this.options.shouldPreserveNodeMaps) { + if (!this.tsNodeToESTreeNodeMap.has(node)) { + this.tsNodeToESTreeNodeMap.set(node, result); + } + } + } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertPattern(child, parent) { + return this.converter(child, parent, true); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertChild(child, parent) { + return this.converter(child, parent, false); + } + createNode( + // The 'parent' property will be added later if specified + node, data) { + const result = data; + result.range ??= (0, node_utils_1.getRange)(node, this.ast); + result.loc ??= (0, node_utils_1.getLocFor)(result.range, this.ast); + if (result && this.options.shouldPreserveNodeMaps) { + this.esTreeNodeToTSNodeMap.set(result, node); + } + return result; + } + convertBindingNameWithTypeAnnotation(name, tsType, parent) { + const id = this.convertPattern(name); + if (tsType) { + id.typeAnnotation = this.convertTypeAnnotation(tsType, parent); + this.fixParentLocation(id, id.typeAnnotation.range); + } + return id; + } + /** + * Converts a child into a type annotation. This creates an intermediary + * TypeAnnotation node to match what Flow does. + * @param child The TypeScript AST node to convert. + * @param parent parentNode + * @returns The type annotation node. + */ + convertTypeAnnotation(child, parent) { + // in FunctionType and ConstructorType typeAnnotation has 2 characters `=>` and in other places is just colon + const offset = parent?.kind === SyntaxKind.FunctionType || + parent?.kind === SyntaxKind.ConstructorType + ? 2 + : 1; + const annotationStartCol = child.getFullStart() - offset; + const range = [annotationStartCol, child.end]; + const loc = (0, node_utils_1.getLocFor)(range, this.ast); + return { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAnnotation, + loc, + range, + typeAnnotation: this.convertChild(child), + }; + } + /** + * Coverts body Nodes and add a directive field to StringLiterals + * @param nodes of ts.Node + * @param parent parentNode + * @returns Array of body statements + */ + convertBodyExpressions(nodes, parent) { + let allowDirectives = (0, node_utils_1.canContainDirective)(parent); + return (nodes + .map(statement => { + const child = this.convertChild(statement); + if (allowDirectives) { + if (child?.expression && + ts.isExpressionStatement(statement) && + ts.isStringLiteral(statement.expression)) { + const raw = child.expression.raw; + child.directive = raw.slice(1, -1); + return child; // child can be null, but it's filtered below + } + allowDirectives = false; + } + return child; // child can be null, but it's filtered below + }) + // filter out unknown nodes for now + .filter(statement => statement)); + } + /** + * Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node + * @param typeArguments ts.NodeArray typeArguments + * @param node parent used to create this node + * @returns TypeParameterInstantiation node + */ + convertTypeArgumentsToTypeParameterInstantiation(typeArguments, node) { + const greaterThanToken = (0, node_utils_1.findNextToken)(typeArguments, this.ast, this.ast); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterInstantiation, + range: [typeArguments.pos - 1, greaterThanToken.end], + params: typeArguments.map(typeArgument => this.convertChild(typeArgument)), + }); + } + /** + * Converts a ts.Node's typeParameters to TSTypeParameterDeclaration node + * @param typeParameters ts.Node typeParameters + * @returns TypeParameterDeclaration node + */ + convertTSTypeParametersToTypeParametersDeclaration(typeParameters) { + const greaterThanToken = (0, node_utils_1.findNextToken)(typeParameters, this.ast, this.ast); + const range = [ + typeParameters.pos - 1, + greaterThanToken.end, + ]; + return { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterDeclaration, + range, + loc: (0, node_utils_1.getLocFor)(range, this.ast), + params: typeParameters.map(typeParameter => this.convertChild(typeParameter)), + }; + } + /** + * Converts an array of ts.Node parameters into an array of ESTreeNode params + * @param parameters An array of ts.Node params to be converted + * @returns an array of converted ESTreeNode params + */ + convertParameters(parameters) { + if (!parameters?.length) { + return []; + } + return parameters.map(param => { + const convertedParam = this.convertChild(param); + convertedParam.decorators = + (0, getModifiers_1.getDecorators)(param)?.map(el => this.convertChild(el)) ?? []; + return convertedParam; + }); + } + convertChainExpression(node, tsNode) { + const { child, isOptional } = (() => { + if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) { + return { child: node.object, isOptional: node.optional }; + } + if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) { + return { child: node.callee, isOptional: node.optional }; + } + return { child: node.expression, isOptional: false }; + })(); + const isChildUnwrappable = (0, node_utils_1.isChildUnwrappableOptionalChain)(tsNode, child); + if (!isChildUnwrappable && !isOptional) { + return node; + } + if (isChildUnwrappable && (0, node_utils_1.isChainExpression)(child)) { + // unwrap the chain expression child + const newChild = child.expression; + if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) { + node.object = newChild; + } + else if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) { + node.callee = newChild; + } + else { + node.expression = newChild; + } + } + return this.createNode(tsNode, { + type: ts_estree_1.AST_NODE_TYPES.ChainExpression, + expression: node, + }); + } + /** + * For nodes that are copied directly from the TypeScript AST into + * ESTree mostly as-is. The only difference is the addition of a type + * property instead of a kind property. Recursively copies all children. + */ + deeplyCopy(node) { + if (node.kind === ts.SyntaxKind.JSDocFunctionType) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, node, 'JSDoc types can only be used inside documentation comments.'); + } + const customType = `TS${SyntaxKind[node.kind]}`; + /** + * If the "errorOnUnknownASTType" option is set to true, throw an error, + * otherwise fallback to just including the unknown type as-is. + */ + if (this.options.errorOnUnknownASTType && !ts_estree_1.AST_NODE_TYPES[customType]) { + throw new Error(`Unknown AST_NODE_TYPE: "${customType}"`); + } + const result = this.createNode(node, { + type: customType, + }); + if ('type' in node) { + result.typeAnnotation = + node.type && 'kind' in node.type && ts.isTypeNode(node.type) + ? this.convertTypeAnnotation(node.type, node) + : null; + } + if ('typeArguments' in node) { + result.typeArguments = + node.typeArguments && 'pos' in node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node) + : null; + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, result, 'typeParameters', 'typeArguments'); + } + if ('typeParameters' in node) { + result.typeParameters = + node.typeParameters && 'pos' in node.typeParameters + ? this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters) + : null; + } + const decorators = (0, getModifiers_1.getDecorators)(node); + if (decorators?.length) { + result.decorators = decorators.map(el => this.convertChild(el)); + } + // keys we never want to clone from the base typescript node as they + // introduce garbage into our AST + const KEYS_TO_NOT_COPY = new Set([ + '_children', + 'decorators', + 'end', + 'flags', + 'illegalDecorators', + 'heritageClauses', + 'locals', + 'localSymbol', + 'jsDoc', + 'kind', + 'modifierFlagsCache', + 'modifiers', + 'nextContainer', + 'parent', + 'pos', + 'symbol', + 'transformFlags', + 'type', + 'typeArguments', + 'typeParameters', + ]); + Object.entries(node) + .filter(([key]) => !KEYS_TO_NOT_COPY.has(key)) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + result[key] = value.map(el => this.convertChild(el)); + } + else if (value && typeof value === 'object' && value.kind) { + // need to check node[key].kind to ensure we don't try to convert a symbol + result[key] = this.convertChild(value); + } + else { + result[key] = value; + } + }); + return result; + } + convertJSXIdentifier(node) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.getText(), + }); + this.registerTSNodeInNodeMap(node, result); + return result; + } + convertJSXNamespaceOrIdentifier(node) { + // TypeScript@5.1 added in ts.JsxNamespacedName directly + // We prefer using that if it's relevant for this node type + if (node.kind === ts.SyntaxKind.JsxNamespacedName) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName, + namespace: this.createNode(node.namespace, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.namespace.text, + }), + name: this.createNode(node.name, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.name.text, + }), + }); + this.registerTSNodeInNodeMap(node, result); + return result; + } + // TypeScript@<5.1 has to manually parse the JSX attributes + const text = node.getText(); + const colonIndex = text.indexOf(':'); + // this is intentional we can ignore conversion if `:` is in first character + if (colonIndex > 0) { + const range = (0, node_utils_1.getRange)(node, this.ast); + // @ts-expect-error -- TypeScript@<5.1 doesn't have ts.JsxNamespacedName + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName, + namespace: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: text.slice(0, colonIndex), + range: [range[0], range[0] + colonIndex], + }), + name: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: text.slice(colonIndex + 1), + range: [range[0] + colonIndex + 1, range[1]], + }), + range, + }); + this.registerTSNodeInNodeMap(node, result); + return result; + } + return this.convertJSXIdentifier(node); + } + /** + * Converts a TypeScript JSX node.tagName into an ESTree node.name + * @param node the tagName object from a JSX ts.Node + * @returns the converted ESTree name object + */ + convertJSXTagName(node, parent) { + let result; + switch (node.kind) { + case SyntaxKind.PropertyAccessExpression: + if (node.name.kind === SyntaxKind.PrivateIdentifier) { + // This is one of the few times where TS explicitly errors, and doesn't even gracefully handle the syntax. + // So we shouldn't ever get into this state to begin with. + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, node.name, 'Non-private identifier expected.'); + } + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXMemberExpression, + object: this.convertJSXTagName(node.expression, parent), + property: this.convertJSXIdentifier(node.name), + }); + break; + case SyntaxKind.ThisKeyword: + case SyntaxKind.Identifier: + default: + return this.convertJSXNamespaceOrIdentifier(node); + } + this.registerTSNodeInNodeMap(node, result); + return result; + } + convertMethodSignature(node) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSMethodSignature, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + kind: (() => { + switch (node.kind) { + case SyntaxKind.GetAccessor: + return 'get'; + case SyntaxKind.SetAccessor: + return 'set'; + case SyntaxKind.MethodSignature: + return 'method'; + } + })(), + optional: (0, node_utils_1.isOptional)(node), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + convertImportAttributes(node) { + return node === undefined + ? [] + : node.elements.map(element => this.convertChild(element)); + } + /** + * Uses the provided range location to adjust the location data of the given Node + * @param result The node that will have its location data mutated + * @param childRange The child node range used to expand location + */ + fixParentLocation(result, childRange) { + if (childRange[0] < result.range[0]) { + result.range[0] = childRange[0]; + result.loc.start = (0, node_utils_1.getLineAndCharacterFor)(result.range[0], this.ast); + } + if (childRange[1] > result.range[1]) { + result.range[1] = childRange[1]; + result.loc.end = (0, node_utils_1.getLineAndCharacterFor)(result.range[1], this.ast); + } + } + assertModuleSpecifier(node, allowNull) { + if (!allowNull && node.moduleSpecifier == null) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node, 'Module specifier must be a string literal.'); + } + if (node.moduleSpecifier && + node.moduleSpecifier?.kind !== SyntaxKind.StringLiteral) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node.moduleSpecifier, 'Module specifier must be a string literal.'); + } + } + /** + * Converts a TypeScript node into an ESTree node. + * The core of the conversion logic: + * Identify and convert each relevant TypeScript SyntaxKind + * @param node the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertNode(node, parent) { + switch (node.kind) { + case SyntaxKind.SourceFile: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Program, + body: this.convertBodyExpressions(node.statements, node), + comments: undefined, + range: [node.getStart(this.ast), node.endOfFileToken.end], + sourceType: node.externalModuleIndicator ? 'module' : 'script', + tokens: undefined, + }); + } + case SyntaxKind.Block: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.BlockStatement, + body: this.convertBodyExpressions(node.statements, node), + }); + } + case SyntaxKind.Identifier: { + if ((0, node_utils_1.isThisInTypeQuery)(node)) { + // special case for `typeof this.foo` - TS emits an Identifier for `this` + // but we want to treat it as a ThisExpression for consistency + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThisExpression, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + decorators: [], + name: node.text, + optional: false, + typeAnnotation: undefined, + }); + } + case SyntaxKind.PrivateIdentifier: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.PrivateIdentifier, + // typescript includes the `#` in the text + name: node.text.slice(1), + }); + } + case SyntaxKind.WithStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.WithStatement, + object: this.convertChild(node.expression), + body: this.convertChild(node.statement), + }); + // Control Flow + case SyntaxKind.ReturnStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ReturnStatement, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.LabeledStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.LabeledStatement, + label: this.convertChild(node.label), + body: this.convertChild(node.statement), + }); + case SyntaxKind.ContinueStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ContinueStatement, + label: this.convertChild(node.label), + }); + case SyntaxKind.BreakStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.BreakStatement, + label: this.convertChild(node.label), + }); + // Choice + case SyntaxKind.IfStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.IfStatement, + test: this.convertChild(node.expression), + consequent: this.convertChild(node.thenStatement), + alternate: this.convertChild(node.elseStatement), + }); + case SyntaxKind.SwitchStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SwitchStatement, + discriminant: this.convertChild(node.expression), + cases: node.caseBlock.clauses.map(el => this.convertChild(el)), + }); + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SwitchCase, + // expression is present in case only + test: node.kind === SyntaxKind.CaseClause + ? this.convertChild(node.expression) + : null, + consequent: node.statements.map(el => this.convertChild(el)), + }); + // Exceptions + case SyntaxKind.ThrowStatement: + if (node.expression.end === node.expression.pos) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node, 'A throw statement must throw an expression.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThrowStatement, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.TryStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TryStatement, + block: this.convertChild(node.tryBlock), + handler: this.convertChild(node.catchClause), + finalizer: this.convertChild(node.finallyBlock), + }); + case SyntaxKind.CatchClause: + if (node.variableDeclaration?.initializer) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, node.variableDeclaration.initializer, 'Catch clause variable cannot have an initializer.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.CatchClause, + param: node.variableDeclaration + ? this.convertBindingNameWithTypeAnnotation(node.variableDeclaration.name, node.variableDeclaration.type) + : null, + body: this.convertChild(node.block), + }); + // Loops + case SyntaxKind.WhileStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.WhileStatement, + test: this.convertChild(node.expression), + body: this.convertChild(node.statement), + }); + /** + * Unlike other parsers, TypeScript calls a "DoWhileStatement" + * a "DoStatement" + */ + case SyntaxKind.DoStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.DoWhileStatement, + test: this.convertChild(node.expression), + body: this.convertChild(node.statement), + }); + case SyntaxKind.ForStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForStatement, + init: this.convertChild(node.initializer), + test: this.convertChild(node.condition), + update: this.convertChild(node.incrementor), + body: this.convertChild(node.statement), + }); + case SyntaxKind.ForInStatement: + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_checkForStatementDeclaration).call(this, node.initializer); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForInStatement, + left: this.convertPattern(node.initializer), + right: this.convertChild(node.expression), + body: this.convertChild(node.statement), + }); + case SyntaxKind.ForOfStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForOfStatement, + left: this.convertPattern(node.initializer), + right: this.convertChild(node.expression), + body: this.convertChild(node.statement), + await: Boolean(node.awaitModifier && + node.awaitModifier.kind === SyntaxKind.AwaitKeyword), + }); + // Declarations + case SyntaxKind.FunctionDeclaration: { + const isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const result = this.createNode(node, { + type: isDeclare || !node.body + ? ts_estree_1.AST_NODE_TYPES.TSDeclareFunction + : ts_estree_1.AST_NODE_TYPES.FunctionDeclaration, + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body) || undefined, + declare: isDeclare, + expression: false, + generator: !!node.asteriskToken, + id: this.convertChild(node.name), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + return this.fixExports(node, result); + } + case SyntaxKind.VariableDeclaration: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclarator, + definite: !!node.exclamationToken, + id: this.convertBindingNameWithTypeAnnotation(node.name, node.type, node), + init: this.convertChild(node.initializer), + }); + } + case SyntaxKind.VariableStatement: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarationList.declarations.map(el => this.convertChild(el)), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + kind: (0, node_utils_1.getDeclarationKind)(node.declarationList), + }); + if (!result.declarations.length) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node, 'A variable declaration list must have at least one variable declarator.'); + } + if (result.kind === 'using' || result.kind === 'await using') { + node.declarationList.declarations.forEach((declaration, i) => { + if (result.declarations[i].init == null) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, declaration, `'${result.kind}' declarations must be initialized.`); + } + if (result.declarations[i].id.type !== ts_estree_1.AST_NODE_TYPES.Identifier) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, declaration.name, `'${result.kind}' declarations may not have binding patterns.`); + } + }); + } + /** + * Semantically, decorators are not allowed on variable declarations, + * Pre 4.8 TS would include them in the AST, so we did as well. + * However as of 4.8 TS no longer includes it (as it is, well, invalid). + * + * So for consistency across versions, we no longer include it either. + */ + return this.fixExports(node, result); + } + // mostly for for-of, for-in + case SyntaxKind.VariableDeclarationList: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarations.map(el => this.convertChild(el)), + declare: false, + kind: (0, node_utils_1.getDeclarationKind)(node), + }); + if (result.kind === 'using' || result.kind === 'await using') { + node.declarations.forEach((declaration, i) => { + if (result.declarations[i].init != null) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, declaration, `'${result.kind}' declarations may not be initialized in for statement.`); + } + if (result.declarations[i].id.type !== ts_estree_1.AST_NODE_TYPES.Identifier) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, declaration.name, `'${result.kind}' declarations may not have binding patterns.`); + } + }); + } + return result; + } + // Expressions + case SyntaxKind.ExpressionStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExpressionStatement, + directive: undefined, + expression: this.convertChild(node.expression), + }); + case SyntaxKind.ThisKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThisExpression, + }); + case SyntaxKind.ArrayLiteralExpression: { + // TypeScript uses ArrayLiteralExpression in destructuring assignment, too + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayPattern, + decorators: [], + elements: node.elements.map(el => this.convertPattern(el)), + optional: false, + typeAnnotation: undefined, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayExpression, + elements: node.elements.map(el => this.convertChild(el)), + }); + } + case SyntaxKind.ObjectLiteralExpression: { + // TypeScript uses ObjectLiteralExpression in destructuring assignment, too + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectPattern, + decorators: [], + optional: false, + properties: node.properties.map(el => this.convertPattern(el)), + typeAnnotation: undefined, + }); + } + const properties = []; + for (const property of node.properties) { + if ((property.kind === SyntaxKind.GetAccessor || + property.kind === SyntaxKind.SetAccessor || + property.kind === SyntaxKind.MethodDeclaration) && + !property.body) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, property.end - 1, "'{' expected."); + } + properties.push(this.convertChild(property)); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectExpression, + properties, + }); + } + case SyntaxKind.PropertyAssignment: { + // eslint-disable-next-line deprecation/deprecation + const { questionToken, exclamationToken } = node; + if (questionToken) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, questionToken, 'A property assignment cannot have a question token.'); + } + if (exclamationToken) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, exclamationToken, 'A property assignment cannot have an exclamation token.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + key: this.convertChild(node.name), + value: this.converter(node.initializer, node, this.allowPattern), + computed: (0, node_utils_1.isComputedProperty)(node.name), + method: false, + optional: false, + shorthand: false, + kind: 'init', + }); + } + case SyntaxKind.ShorthandPropertyAssignment: { + // eslint-disable-next-line deprecation/deprecation + const { modifiers, questionToken, exclamationToken } = node; + if (modifiers) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifiers[0], 'A shorthand property assignment cannot have modifiers.'); + } + if (questionToken) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, questionToken, 'A shorthand property assignment cannot have a question token.'); + } + if (exclamationToken) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, exclamationToken, 'A shorthand property assignment cannot have an exclamation token.'); + } + if (node.objectAssignmentInitializer) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + key: this.convertChild(node.name), + value: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: this.convertPattern(node.name), + optional: false, + right: this.convertChild(node.objectAssignmentInitializer), + typeAnnotation: undefined, + }), + computed: false, + method: false, + optional: false, + shorthand: true, + kind: 'init', + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: false, + key: this.convertChild(node.name), + kind: 'init', + method: false, + optional: false, + shorthand: true, + value: this.convertChild(node.name), + }); + } + case SyntaxKind.ComputedPropertyName: + return this.convertChild(node.expression); + case SyntaxKind.PropertyDeclaration: { + const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node); + if (isAbstract && node.initializer) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, node.initializer, `Abstract property cannot have an initializer.`); + } + const isAccessor = (0, node_utils_1.hasModifier)(SyntaxKind.AccessorKeyword, node); + const type = (() => { + if (isAccessor) { + if (isAbstract) { + return ts_estree_1.AST_NODE_TYPES.TSAbstractAccessorProperty; + } + return ts_estree_1.AST_NODE_TYPES.AccessorProperty; + } + if (isAbstract) { + return ts_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition; + } + return ts_estree_1.AST_NODE_TYPES.PropertyDefinition; + })(); + const key = this.convertChild(node.name); + return this.createNode(node, { + type, + key, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + value: isAbstract ? null : this.convertChild(node.initializer), + computed: (0, node_utils_1.isComputedProperty)(node.name), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + decorators: (0, getModifiers_1.getDecorators)(node)?.map(el => this.convertChild(el)) ?? [], + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node), + typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node), + optional: (key.type === ts_estree_1.AST_NODE_TYPES.Literal || + node.name.kind === SyntaxKind.Identifier || + node.name.kind === SyntaxKind.ComputedPropertyName || + node.name.kind === SyntaxKind.PrivateIdentifier) && + !!node.questionToken, + definite: !!node.exclamationToken, + }); + } + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: { + if (node.parent.kind === SyntaxKind.InterfaceDeclaration || + node.parent.kind === SyntaxKind.TypeLiteral) { + return this.convertMethodSignature(node); + } + } + // otherwise, it is a non-type accessor - intentional fallthrough + case SyntaxKind.MethodDeclaration: { + const method = this.createNode(node, { + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression + : ts_estree_1.AST_NODE_TYPES.FunctionExpression, + id: null, + generator: !!node.asteriskToken, + expression: false, // ESTreeNode as ESTreeNode here + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body), + declare: false, + range: [node.parameters.pos - 1, node.end], + params: [], + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + if (method.typeParameters) { + this.fixParentLocation(method, method.typeParameters.range); + } + let result; + if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + method.params = node.parameters.map(el => this.convertChild(el)); + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + key: this.convertChild(node.name), + value: method, + computed: (0, node_utils_1.isComputedProperty)(node.name), + optional: !!node.questionToken, + method: node.kind === SyntaxKind.MethodDeclaration, + shorthand: false, + kind: 'init', + }); + } + else { + // class + /** + * Unlike in object literal methods, class method params can have decorators + */ + method.params = this.convertParameters(node.parameters); + /** + * TypeScript class methods can be defined as "abstract" + */ + const methodDefinitionType = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node) + ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition + : ts_estree_1.AST_NODE_TYPES.MethodDefinition; + result = this.createNode(node, { + type: methodDefinitionType, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + decorators: (0, getModifiers_1.getDecorators)(node)?.map(el => this.convertChild(el)) ?? [], + key: this.convertChild(node.name), + kind: 'method', + optional: !!node.questionToken, + override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + value: method, + }); + } + if (node.kind === SyntaxKind.GetAccessor) { + result.kind = 'get'; + } + else if (node.kind === SyntaxKind.SetAccessor) { + result.kind = 'set'; + } + else if (!result.static && + node.name.kind === SyntaxKind.StringLiteral && + node.name.text === 'constructor' && + result.type !== ts_estree_1.AST_NODE_TYPES.Property) { + result.kind = 'constructor'; + } + return result; + } + // TypeScript uses this even for static methods named "constructor" + case SyntaxKind.Constructor: { + const lastModifier = (0, node_utils_1.getLastModifier)(node); + const constructorToken = (lastModifier && (0, node_utils_1.findNextToken)(lastModifier, node, this.ast)) ?? + node.getFirstToken(); + const constructor = this.createNode(node, { + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression + : ts_estree_1.AST_NODE_TYPES.FunctionExpression, + async: false, + body: this.convertChild(node.body), + declare: false, + expression: false, // is not present in ESTreeNode + generator: false, + id: null, + params: this.convertParameters(node.parameters), + range: [node.parameters.pos - 1, node.end], + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + if (constructor.typeParameters) { + this.fixParentLocation(constructor, constructor.typeParameters.range); + } + const constructorKey = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + decorators: [], + name: 'constructor', + optional: false, + range: [constructorToken.getStart(this.ast), constructorToken.end], + typeAnnotation: undefined, + }); + const isStatic = (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node); + return this.createNode(node, { + type: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node) + ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition + : ts_estree_1.AST_NODE_TYPES.MethodDefinition, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: false, + decorators: [], + optional: false, + key: constructorKey, + kind: isStatic ? 'method' : 'constructor', + override: false, + static: isStatic, + value: constructor, + }); + } + case SyntaxKind.FunctionExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.FunctionExpression, + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body), + declare: false, + expression: false, + generator: !!node.asteriskToken, + id: this.convertChild(node.name), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + case SyntaxKind.SuperKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Super, + }); + case SyntaxKind.ArrayBindingPattern: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayPattern, + decorators: [], + elements: node.elements.map(el => this.convertPattern(el)), + optional: false, + typeAnnotation: undefined, + }); + // occurs with missing array elements like [,] + case SyntaxKind.OmittedExpression: + return null; + case SyntaxKind.ObjectBindingPattern: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectPattern, + decorators: [], + optional: false, + properties: node.elements.map(el => this.convertPattern(el)), + typeAnnotation: undefined, + }); + case SyntaxKind.BindingElement: { + if (parent.kind === SyntaxKind.ArrayBindingPattern) { + const arrayItem = this.convertChild(node.name, parent); + if (node.initializer) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: arrayItem, + optional: false, + right: this.convertChild(node.initializer), + typeAnnotation: undefined, + }); + } + else if (node.dotDotDotToken) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: arrayItem, + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + return arrayItem; + } + let result; + if (node.dotDotDotToken) { + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertChild(node.propertyName ?? node.name), + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + else { + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + key: this.convertChild(node.propertyName ?? node.name), + value: this.convertChild(node.name), + computed: Boolean(node.propertyName && + node.propertyName.kind === SyntaxKind.ComputedPropertyName), + method: false, + optional: false, + shorthand: !node.propertyName, + kind: 'init', + }); + } + if (node.initializer) { + result.value = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: this.convertChild(node.name), + optional: false, + range: [node.name.getStart(this.ast), node.initializer.end], + right: this.convertChild(node.initializer), + typeAnnotation: undefined, + }); + } + return result; + } + case SyntaxKind.ArrowFunction: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression, + generator: false, + id: null, + params: this.convertParameters(node.parameters), + body: this.convertChild(node.body), + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + expression: node.body.kind !== SyntaxKind.Block, + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + case SyntaxKind.YieldExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.YieldExpression, + delegate: !!node.asteriskToken, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.AwaitExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AwaitExpression, + argument: this.convertChild(node.expression), + }); + // Template Literals + case SyntaxKind.NoSubstitutionTemplateLiteral: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral, + quasis: [ + this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateElement, + value: { + raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - 1), + cooked: node.text, + }, + tail: true, + }), + ], + expressions: [], + }); + case SyntaxKind.TemplateExpression: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral, + quasis: [this.convertChild(node.head)], + expressions: [], + }); + node.templateSpans.forEach(templateSpan => { + result.expressions.push(this.convertChild(templateSpan.expression)); + result.quasis.push(this.convertChild(templateSpan.literal)); + }); + return result; + } + case SyntaxKind.TaggedTemplateExpression: + return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.TaggedTemplateExpression, + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + tag: this.convertChild(node.tag), + quasi: this.convertChild(node.template), + }, 'typeParameters', 'typeArguments')); + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + case SyntaxKind.TemplateTail: { + const tail = node.kind === SyntaxKind.TemplateTail; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateElement, + value: { + raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - (tail ? 1 : 2)), + cooked: node.text, + }, + tail, + }); + } + // Patterns + case SyntaxKind.SpreadAssignment: + case SyntaxKind.SpreadElement: { + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertPattern(node.expression), + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SpreadElement, + argument: this.convertChild(node.expression), + }); + } + case SyntaxKind.Parameter: { + let parameter; + let result; + if (node.dotDotDotToken) { + parameter = result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertChild(node.name), + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + else if (node.initializer) { + parameter = this.convertChild(node.name); + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: parameter, + optional: false, + right: this.convertChild(node.initializer), + typeAnnotation: undefined, + }); + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers) { + // AssignmentPattern should not contain modifiers in range + result.range[0] = parameter.range[0]; + result.loc = (0, node_utils_1.getLocFor)(result.range, this.ast); + } + } + else { + parameter = result = this.convertChild(node.name, parent); + } + if (node.type) { + parameter.typeAnnotation = this.convertTypeAnnotation(node.type, node); + this.fixParentLocation(parameter, parameter.typeAnnotation.range); + } + if (node.questionToken) { + if (node.questionToken.end > parameter.range[1]) { + parameter.range[1] = node.questionToken.end; + parameter.loc.end = (0, node_utils_1.getLineAndCharacterFor)(parameter.range[1], this.ast); + } + parameter.optional = true; + } + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSParameterProperty, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + decorators: [], + override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node), + parameter: result, + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + }); + } + return result; + } + // Classes + case SyntaxKind.ClassDeclaration: + if (!node.name && + (!(0, node_utils_1.hasModifier)(ts.SyntaxKind.ExportKeyword, node) || + !(0, node_utils_1.hasModifier)(ts.SyntaxKind.DefaultKeyword, node))) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node, "A class declaration without the 'default' modifier must have a name."); + } + /* intentional fallthrough */ + case SyntaxKind.ClassExpression: { + const heritageClauses = node.heritageClauses ?? []; + const classNodeType = node.kind === SyntaxKind.ClassDeclaration + ? ts_estree_1.AST_NODE_TYPES.ClassDeclaration + : ts_estree_1.AST_NODE_TYPES.ClassExpression; + let extendsClause; + let implementsClause; + for (const heritageClause of heritageClauses) { + const { token, types } = heritageClause; + if (types.length === 0) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, heritageClause, `'${ts.tokenToString(token)}' list cannot be empty.`); + } + if (token === SyntaxKind.ExtendsKeyword) { + if (extendsClause) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, heritageClause, "'extends' clause already seen."); + } + if (implementsClause) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, heritageClause, "'extends' clause must precede 'implements' clause."); + } + if (types.length > 1) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, types[1], 'Classes can only extend a single class.'); + } + extendsClause ??= heritageClause; + } + else if (token === SyntaxKind.ImplementsKeyword) { + if (implementsClause) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, heritageClause, "'implements' clause already seen."); + } + implementsClause ??= heritageClause; + } + } + const result = this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: classNodeType, + abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node), + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ClassBody, + body: node.members + .filter(node_utils_1.isESTreeClassMember) + .map(el => this.convertChild(el)), + range: [node.members.pos - 1, node.end], + }), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + decorators: (0, getModifiers_1.getDecorators)(node)?.map(el => this.convertChild(el)) ?? [], + id: this.convertChild(node.name), + implements: implementsClause?.types.map(el => this.convertChild(el)) ?? [], + superClass: extendsClause?.types[0] + ? this.convertChild(extendsClause.types[0].expression) + : null, + superTypeArguments: undefined, + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }, 'superTypeParameters', 'superTypeArguments')); + if (extendsClause?.types[0]?.typeArguments) { + result.superTypeArguments = + this.convertTypeArgumentsToTypeParameterInstantiation(extendsClause.types[0].typeArguments, extendsClause.types[0]); + } + return this.fixExports(node, result); + } + // Modules + case SyntaxKind.ModuleBlock: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSModuleBlock, + body: this.convertBodyExpressions(node.statements, node), + }); + case SyntaxKind.ImportDeclaration: { + this.assertModuleSpecifier(node, false); + const result = this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.ImportDeclaration, + source: this.convertChild(node.moduleSpecifier), + specifiers: [], + importKind: 'value', + attributes: this.convertImportAttributes( + // eslint-disable-next-line deprecation/deprecation -- TS <5.3 + node.attributes ?? node.assertClause), + }, 'assertions', 'attributes', true)); + if (node.importClause) { + if (node.importClause.isTypeOnly) { + result.importKind = 'type'; + } + if (node.importClause.name) { + result.specifiers.push(this.convertChild(node.importClause)); + } + if (node.importClause.namedBindings) { + switch (node.importClause.namedBindings.kind) { + case SyntaxKind.NamespaceImport: + result.specifiers.push(this.convertChild(node.importClause.namedBindings)); + break; + case SyntaxKind.NamedImports: + result.specifiers = result.specifiers.concat(node.importClause.namedBindings.elements.map(el => this.convertChild(el))); + break; + } + } + } + return result; + } + case SyntaxKind.NamespaceImport: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportNamespaceSpecifier, + local: this.convertChild(node.name), + }); + case SyntaxKind.ImportSpecifier: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportSpecifier, + local: this.convertChild(node.name), + imported: this.convertChild(node.propertyName ?? node.name), + importKind: node.isTypeOnly ? 'type' : 'value', + }); + case SyntaxKind.ImportClause: { + const local = this.convertChild(node.name); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportDefaultSpecifier, + local, + range: local.range, + }); + } + case SyntaxKind.ExportDeclaration: { + if (node.exportClause?.kind === SyntaxKind.NamedExports) { + this.assertModuleSpecifier(node, true); + return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration, + source: this.convertChild(node.moduleSpecifier), + specifiers: node.exportClause.elements.map(el => this.convertChild(el)), + exportKind: node.isTypeOnly ? 'type' : 'value', + declaration: null, + attributes: this.convertImportAttributes( + // eslint-disable-next-line deprecation/deprecation -- TS <5.3 + node.attributes ?? node.assertClause), + }, 'assertions', 'attributes', true)); + } + this.assertModuleSpecifier(node, false); + return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.ExportAllDeclaration, + source: this.convertChild(node.moduleSpecifier), + exportKind: node.isTypeOnly ? 'type' : 'value', + exported: node.exportClause?.kind === SyntaxKind.NamespaceExport + ? this.convertChild(node.exportClause.name) + : null, + attributes: this.convertImportAttributes( + // eslint-disable-next-line deprecation/deprecation -- TS <5.3 + node.attributes ?? node.assertClause), + }, 'assertions', 'attributes', true)); + } + case SyntaxKind.ExportSpecifier: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportSpecifier, + local: this.convertChild(node.propertyName ?? node.name), + exported: this.convertChild(node.name), + exportKind: node.isTypeOnly ? 'type' : 'value', + }); + case SyntaxKind.ExportAssignment: + if (node.isExportEquals) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSExportAssignment, + expression: this.convertChild(node.expression), + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration, + declaration: this.convertChild(node.expression), + exportKind: 'value', + }); + // Unary Operations + case SyntaxKind.PrefixUnaryExpression: + case SyntaxKind.PostfixUnaryExpression: { + const operator = (0, node_utils_1.getTextForTokenKind)(node.operator); + /** + * ESTree uses UpdateExpression for ++/-- + */ + if (operator === '++' || operator === '--') { + if (!(0, node_utils_1.isValidAssignmentTarget)(node.operand)) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node.operand, 'Invalid left-hand side expression in unary operation'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UpdateExpression, + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + argument: this.convertChild(node.operand), + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + argument: this.convertChild(node.operand), + }); + } + case SyntaxKind.DeleteExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + operator: 'delete', + prefix: true, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.VoidExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + operator: 'void', + prefix: true, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.TypeOfExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + operator: 'typeof', + prefix: true, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.TypeOperator: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeOperator, + operator: (0, node_utils_1.getTextForTokenKind)(node.operator), + typeAnnotation: this.convertChild(node.type), + }); + // Binary Operations + case SyntaxKind.BinaryExpression: { + // TypeScript uses BinaryExpression for sequences as well + if ((0, node_utils_1.isComma)(node.operatorToken)) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SequenceExpression, + expressions: [], + }); + const left = this.convertChild(node.left); + if (left.type === ts_estree_1.AST_NODE_TYPES.SequenceExpression && + node.left.kind !== SyntaxKind.ParenthesizedExpression) { + result.expressions = result.expressions.concat(left.expressions); + } + else { + result.expressions.push(left); + } + result.expressions.push(this.convertChild(node.right)); + return result; + } + const expressionType = (0, node_utils_1.getBinaryExpressionType)(node.operatorToken); + if (this.allowPattern && + expressionType.type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: this.convertPattern(node.left, node), + optional: false, + right: this.convertChild(node.right), + typeAnnotation: undefined, + }); + } + return this.createNode(node, { + ...expressionType, + left: this.converter(node.left, node, expressionType.type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression), + right: this.convertChild(node.right), + }); + } + case SyntaxKind.PropertyAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.name); + const computed = false; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MemberExpression, + object, + property, + computed, + optional: node.questionDotToken !== undefined, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.ElementAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.argumentExpression); + const computed = true; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MemberExpression, + object, + property, + computed, + optional: node.questionDotToken !== undefined, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.CallExpression: { + if (node.expression.kind === SyntaxKind.ImportKeyword) { + if (node.arguments.length !== 1 && node.arguments.length !== 2) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node.arguments[2] ?? node, 'Dynamic import requires exactly one or two arguments.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportExpression, + source: this.convertChild(node.arguments[0]), + attributes: node.arguments[1] + ? this.convertChild(node.arguments[1]) + : null, + }); + } + const callee = this.convertChild(node.expression); + const args = node.arguments.map(el => this.convertChild(el)); + const typeArguments = node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node); + const result = this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.CallExpression, + callee, + arguments: args, + optional: node.questionDotToken !== undefined, + typeArguments, + }, 'typeParameters', 'typeArguments')); + return this.convertChainExpression(result, node); + } + case SyntaxKind.NewExpression: { + const typeArguments = node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node); + // NOTE - NewExpression cannot have an optional chain in it + return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.NewExpression, + arguments: node.arguments + ? node.arguments.map(el => this.convertChild(el)) + : [], + callee: this.convertChild(node.expression), + typeArguments, + }, 'typeParameters', 'typeArguments')); + } + case SyntaxKind.ConditionalExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ConditionalExpression, + test: this.convertChild(node.condition), + consequent: this.convertChild(node.whenTrue), + alternate: this.convertChild(node.whenFalse), + }); + case SyntaxKind.MetaProperty: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MetaProperty, + meta: this.createNode( + // TODO: do we really want to convert it to Token? + node.getFirstToken(), { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + decorators: [], + name: (0, node_utils_1.getTextForTokenKind)(node.keywordToken), + optional: false, + typeAnnotation: undefined, + }), + property: this.convertChild(node.name), + }); + } + case SyntaxKind.Decorator: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Decorator, + expression: this.convertChild(node.expression), + }); + } + // Literals + case SyntaxKind.StringLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: parent.kind === SyntaxKind.JsxAttribute + ? (0, node_utils_1.unescapeStringLiteralText)(node.text) + : node.text, + raw: node.getText(), + }); + } + case SyntaxKind.NumericLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: Number(node.text), + raw: node.getText(), + }); + } + case SyntaxKind.BigIntLiteral: { + const range = (0, node_utils_1.getRange)(node, this.ast); + const rawValue = this.ast.text.slice(range[0], range[1]); + const bigint = rawValue + // remove suffix `n` + .slice(0, -1) + // `BigInt` doesn't accept numeric separator + // and `bigint` property should not include numeric separator + .replace(/_/g, ''); + const value = typeof BigInt !== 'undefined' ? BigInt(bigint) : null; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: rawValue, + value: value, + bigint: value == null ? bigint : String(value), + range, + }); + } + case SyntaxKind.RegularExpressionLiteral: { + const pattern = node.text.slice(1, node.text.lastIndexOf('/')); + const flags = node.text.slice(node.text.lastIndexOf('/') + 1); + let regex = null; + try { + regex = new RegExp(pattern, flags); + } + catch { + // Intentionally blank, so regex stays null + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: regex, + raw: node.text, + regex: { + pattern, + flags, + }, + }); + } + case SyntaxKind.TrueKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: true, + raw: 'true', + }); + case SyntaxKind.FalseKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: false, + raw: 'false', + }); + case SyntaxKind.NullKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: null, + raw: 'null', + }); + } + case SyntaxKind.EmptyStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.EmptyStatement, + }); + case SyntaxKind.DebuggerStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.DebuggerStatement, + }); + // JSX + case SyntaxKind.JsxElement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXElement, + openingElement: this.convertChild(node.openingElement), + closingElement: this.convertChild(node.closingElement), + children: node.children.map(el => this.convertChild(el)), + }); + case SyntaxKind.JsxFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXFragment, + openingFragment: this.convertChild(node.openingFragment), + closingFragment: this.convertChild(node.closingFragment), + children: node.children.map(el => this.convertChild(el)), + }); + case SyntaxKind.JsxSelfClosingElement: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXElement, + /** + * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, + * TypeScript does not seem to have the idea of openingElement when tag is self-closing + */ + openingElement: this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement, + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node) + : undefined, + selfClosing: true, + name: this.convertJSXTagName(node.tagName, node), + attributes: node.attributes.properties.map(el => this.convertChild(el)), + range: (0, node_utils_1.getRange)(node, this.ast), + }, 'typeParameters', 'typeArguments')), + closingElement: null, + children: [], + }); + } + case SyntaxKind.JsxOpeningElement: { + return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement, + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + selfClosing: false, + name: this.convertJSXTagName(node.tagName, node), + attributes: node.attributes.properties.map(el => this.convertChild(el)), + }, 'typeParameters', 'typeArguments')); + } + case SyntaxKind.JsxClosingElement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXClosingElement, + name: this.convertJSXTagName(node.tagName, node), + }); + case SyntaxKind.JsxOpeningFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningFragment, + }); + case SyntaxKind.JsxClosingFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXClosingFragment, + }); + case SyntaxKind.JsxExpression: { + const expression = node.expression + ? this.convertChild(node.expression) + : this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXEmptyExpression, + range: [node.getStart(this.ast) + 1, node.getEnd() - 1], + }); + if (node.dotDotDotToken) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXSpreadChild, + expression, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXExpressionContainer, + expression, + }); + } + case SyntaxKind.JsxAttribute: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXAttribute, + name: this.convertJSXNamespaceOrIdentifier(node.name), + value: this.convertChild(node.initializer), + }); + } + case SyntaxKind.JsxText: { + const start = node.getFullStart(); + const end = node.getEnd(); + const text = this.ast.text.slice(start, end); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXText, + value: (0, node_utils_1.unescapeStringLiteralText)(text), + raw: text, + range: [start, end], + }); + } + case SyntaxKind.JsxSpreadAttribute: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXSpreadAttribute, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.QualifiedName: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName, + left: this.convertChild(node.left), + right: this.convertChild(node.right), + }); + } + // TypeScript specific + case SyntaxKind.TypeReference: + return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeReference, + typeName: this.convertChild(node.typeName), + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + }, 'typeParameters', 'typeArguments')); + case SyntaxKind.TypeParameter: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameter, + name: this.convertChild(node.name), + constraint: node.constraint && this.convertChild(node.constraint), + default: node.default ? this.convertChild(node.default) : undefined, + in: (0, node_utils_1.hasModifier)(SyntaxKind.InKeyword, node), + out: (0, node_utils_1.hasModifier)(SyntaxKind.OutKeyword, node), + const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node), + }); + } + case SyntaxKind.ThisType: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSThisType, + }); + case SyntaxKind.AnyKeyword: + case SyntaxKind.BigIntKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.NeverKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.ObjectKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.SymbolKeyword: + case SyntaxKind.UnknownKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.UndefinedKeyword: + case SyntaxKind.IntrinsicKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}`], + }); + } + case SyntaxKind.NonNullExpression: { + const nnExpr = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNonNullExpression, + expression: this.convertChild(node.expression), + }); + return this.convertChainExpression(nnExpr, node); + } + case SyntaxKind.TypeLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeLiteral, + members: node.members.map(el => this.convertChild(el)), + }); + } + case SyntaxKind.ArrayType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSArrayType, + elementType: this.convertChild(node.elementType), + }); + } + case SyntaxKind.IndexedAccessType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIndexedAccessType, + objectType: this.convertChild(node.objectType), + indexType: this.convertChild(node.indexType), + }); + } + case SyntaxKind.ConditionalType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSConditionalType, + checkType: this.convertChild(node.checkType), + extendsType: this.convertChild(node.extendsType), + trueType: this.convertChild(node.trueType), + falseType: this.convertChild(node.falseType), + }); + } + case SyntaxKind.TypeQuery: + return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery, + exprName: this.convertChild(node.exprName), + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + }, 'typeParameters', 'typeArguments')); + case SyntaxKind.MappedType: { + if (node.members && node.members.length > 0) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node.members[0], 'A mapped type may not declare properties or methods.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSMappedType, + nameType: this.convertChild(node.nameType) ?? null, + optional: node.questionToken && + (node.questionToken.kind === SyntaxKind.QuestionToken || + (0, node_utils_1.getTextForTokenKind)(node.questionToken.kind)), + readonly: node.readonlyToken && + (node.readonlyToken.kind === SyntaxKind.ReadonlyKeyword || + (0, node_utils_1.getTextForTokenKind)(node.readonlyToken.kind)), + typeAnnotation: node.type && this.convertChild(node.type), + typeParameter: this.convertChild(node.typeParameter), + }); + } + case SyntaxKind.ParenthesizedExpression: + return this.convertChild(node.expression, parent); + case SyntaxKind.TypeAliasDeclaration: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration, + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + id: this.convertChild(node.name), + typeAnnotation: this.convertChild(node.type), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + return this.fixExports(node, result); + } + case SyntaxKind.MethodSignature: { + return this.convertMethodSignature(node); + } + case SyntaxKind.PropertySignature: { + // eslint-disable-next-line deprecation/deprecation + const { initializer } = node; + if (initializer) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, initializer, 'A property signature cannot have an initializer.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSPropertySignature, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + optional: (0, node_utils_1.isOptional)(node), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node), + }); + } + case SyntaxKind.IndexSignature: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIndexSignature, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + parameters: node.parameters.map(el => this.convertChild(el)), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node), + }); + } + case SyntaxKind.ConstructorType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSConstructorType, + abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + case SyntaxKind.FunctionType: { + // eslint-disable-next-line deprecation/deprecation + const { modifiers } = node; + if (modifiers) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifiers[0], 'A function type cannot have modifiers.'); + } + } + // intentional fallthrough + case SyntaxKind.ConstructSignature: + case SyntaxKind.CallSignature: { + const type = node.kind === SyntaxKind.ConstructSignature + ? ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration + : node.kind === SyntaxKind.CallSignature + ? ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration + : ts_estree_1.AST_NODE_TYPES.TSFunctionType; + return this.createNode(node, { + type, + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + } + case SyntaxKind.ExpressionWithTypeArguments: { + const parentKind = parent.kind; + const type = parentKind === SyntaxKind.InterfaceDeclaration + ? ts_estree_1.AST_NODE_TYPES.TSInterfaceHeritage + : parentKind === SyntaxKind.HeritageClause + ? ts_estree_1.AST_NODE_TYPES.TSClassImplements + : ts_estree_1.AST_NODE_TYPES.TSInstantiationExpression; + return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type, + expression: this.convertChild(node.expression), + typeArguments: node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node), + }, 'typeParameters', 'typeArguments')); + } + case SyntaxKind.InterfaceDeclaration: { + const interfaceHeritageClauses = node.heritageClauses ?? []; + const interfaceExtends = []; + for (const heritageClause of interfaceHeritageClauses) { + if (heritageClause.token !== SyntaxKind.ExtendsKeyword) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, heritageClause, heritageClause.token === SyntaxKind.ImplementsKeyword + ? "Interface declaration cannot have 'implements' clause." + : 'Unexpected token.'); + } + for (const heritageType of heritageClause.types) { + interfaceExtends.push(this.convertChild(heritageType, node)); + } + } + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration, + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInterfaceBody, + body: node.members.map(member => this.convertChild(member)), + range: [node.members.pos - 1, node.end], + }), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + extends: interfaceExtends, + id: this.convertChild(node.name), + typeParameters: node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters), + }); + return this.fixExports(node, result); + } + case SyntaxKind.TypePredicate: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypePredicate, + asserts: node.assertsModifier !== undefined, + parameterName: this.convertChild(node.parameterName), + typeAnnotation: null, + }); + /** + * Specific fix for type-guard location data + */ + if (node.type) { + result.typeAnnotation = this.convertTypeAnnotation(node.type, node); + result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; + result.typeAnnotation.range = + result.typeAnnotation.typeAnnotation.range; + } + return result; + } + case SyntaxKind.ImportType: { + const range = (0, node_utils_1.getRange)(node, this.ast); + if (node.isTypeOf) { + const token = (0, node_utils_1.findNextToken)(node.getFirstToken(), node, this.ast); + range[0] = token.getStart(this.ast); + } + const result = this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, { + type: ts_estree_1.AST_NODE_TYPES.TSImportType, + argument: this.convertChild(node.argument), + qualifier: this.convertChild(node.qualifier), + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node) + : null, + range: range, + }, 'typeParameters', 'typeArguments')); + if (node.isTypeOf) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery, + exprName: result, + typeArguments: undefined, + typeParameters: undefined, + }); + } + return result; + } + case SyntaxKind.EnumDeclaration: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSEnumDeclaration, + const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + id: this.convertChild(node.name), + members: node.members.map(el => this.convertChild(el)), + }); + return this.fixExports(node, result); + } + case SyntaxKind.EnumMember: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSEnumMember, + computed: node.name.kind === ts.SyntaxKind.ComputedPropertyName, + id: this.convertChild(node.name), + initializer: node.initializer && this.convertChild(node.initializer), + }); + } + case SyntaxKind.ModuleDeclaration: { + let isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSModuleDeclaration, + ...(() => { + // the constraints checked by this function are syntactically enforced by TS + // the checks mostly exist for type's sake + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + const id = this.convertChild(node.name); + const body = this.convertChild(node.body); + if (body == null || + body.type === ts_estree_1.AST_NODE_TYPES.TSModuleDeclaration) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node.body ?? node, 'Expected a valid module body'); + } + if (id.type !== ts_estree_1.AST_NODE_TYPES.Identifier) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node.name, 'global module augmentation must have an Identifier id'); + } + return { + kind: 'global', + body: body, + declare: false, + global: false, + id, + }; + } + if (!(node.flags & ts.NodeFlags.Namespace)) { + const body = this.convertChild(node.body); + return { + kind: 'module', + ...(body != null ? { body } : {}), + declare: false, + global: false, + id: this.convertChild(node.name), + }; + } + // Nested module declarations are stored in TypeScript as nested tree nodes. + // We "unravel" them here by making our own nested TSQualifiedName, + // with the innermost node's body as the actual node body. + if (node.body == null) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node, 'Expected a module body'); + } + if (node.name.kind !== ts.SyntaxKind.Identifier) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwUnlessAllowInvalidAST).call(this, node.name, '`namespace`s must have an Identifier id'); + } + let name = this.createNode(node.name, { + decorators: [], + name: node.name.text, + optional: false, + range: [node.name.getStart(this.ast), node.name.getEnd()], + type: ts_estree_1.AST_NODE_TYPES.Identifier, + typeAnnotation: undefined, + }); + while (node.body && + ts.isModuleDeclaration(node.body) && + node.body.name) { + node = node.body; + isDeclare ||= (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const nextName = node.name; + const right = this.createNode(nextName, { + decorators: [], + name: nextName.text, + optional: false, + range: [nextName.getStart(this.ast), nextName.getEnd()], + type: ts_estree_1.AST_NODE_TYPES.Identifier, + typeAnnotation: undefined, + }); + name = this.createNode(nextName, { + left: name, + right: right, + range: [name.range[0], right.range[1]], + type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName, + }); + } + return { + kind: 'namespace', + body: this.convertChild(node.body), + declare: false, + global: false, + id: name, + }; + })(), + }); + result.declare = isDeclare; + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + result.global = true; + } + return this.fixExports(node, result); + } + // TypeScript specific types + case SyntaxKind.ParenthesizedType: { + return this.convertChild(node.type); + } + case SyntaxKind.UnionType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSUnionType, + types: node.types.map(el => this.convertChild(el)), + }); + } + case SyntaxKind.IntersectionType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIntersectionType, + types: node.types.map(el => this.convertChild(el)), + }); + } + case SyntaxKind.AsExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSAsExpression, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + case SyntaxKind.InferType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInferType, + typeParameter: this.convertChild(node.typeParameter), + }); + } + case SyntaxKind.LiteralType: { + if (node.literal.kind === SyntaxKind.NullKeyword) { + // 4.0 started nesting null types inside a LiteralType node + // but our AST is designed around the old way of null being a keyword + return this.createNode(node.literal, { + type: ts_estree_1.AST_NODE_TYPES.TSNullKeyword, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSLiteralType, + literal: this.convertChild(node.literal), + }); + } + case SyntaxKind.TypeAssertionExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAssertion, + typeAnnotation: this.convertChild(node.type), + expression: this.convertChild(node.expression), + }); + } + case SyntaxKind.ImportEqualsDeclaration: { + return this.fixExports(node, this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSImportEqualsDeclaration, + id: this.convertChild(node.name), + importKind: node.isTypeOnly ? 'type' : 'value', + moduleReference: this.convertChild(node.moduleReference), + })); + } + case SyntaxKind.ExternalModuleReference: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSExternalModuleReference, + expression: this.convertChild(node.expression), + }); + } + case SyntaxKind.NamespaceExportDeclaration: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNamespaceExportDeclaration, + id: this.convertChild(node.name), + }); + } + case SyntaxKind.AbstractKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSAbstractKeyword, + }); + } + // Tuple + case SyntaxKind.TupleType: { + const elementTypes = node.elements.map(el => this.convertChild(el)); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTupleType, + elementTypes, + }); + } + case SyntaxKind.NamedTupleMember: { + const member = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNamedTupleMember, + elementType: this.convertChild(node.type, node), + label: this.convertChild(node.name, node), + optional: node.questionToken != null, + }); + if (node.dotDotDotToken) { + // adjust the start to account for the "..." + member.range[0] = member.label.range[0]; + member.loc.start = member.label.loc.start; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSRestType, + typeAnnotation: member, + }); + } + return member; + } + case SyntaxKind.OptionalType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSOptionalType, + typeAnnotation: this.convertChild(node.type), + }); + } + case SyntaxKind.RestType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSRestType, + typeAnnotation: this.convertChild(node.type), + }); + } + // Template Literal Types + case SyntaxKind.TemplateLiteralType: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTemplateLiteralType, + quasis: [this.convertChild(node.head)], + types: [], + }); + node.templateSpans.forEach(templateSpan => { + result.types.push(this.convertChild(templateSpan.type)); + result.quasis.push(this.convertChild(templateSpan.literal)); + }); + return result; + } + case SyntaxKind.ClassStaticBlockDeclaration: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.StaticBlock, + body: this.convertBodyExpressions(node.body.statements, node), + }); + } + // eslint-disable-next-line deprecation/deprecation -- required for backwards-compatibility + case SyntaxKind.AssertEntry: + case SyntaxKind.ImportAttribute: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportAttribute, + key: this.convertChild(node.name), + value: this.convertChild(node.value), + }); + } + case SyntaxKind.SatisfiesExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSSatisfiesExpression, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + default: + return this.deeplyCopy(node); + } + } +} +exports.Converter = Converter; +_Converter_instances = new WeakSet(), _Converter_checkModifiers = function _Converter_checkModifiers(node) { + if (this.options.allowInvalidAST) { + return; + } + // typescript<5.0.0 + if ((0, node_utils_1.nodeHasIllegalDecorators)(node)) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, node.illegalDecorators[0], 'Decorators are not valid here.'); + } + for (const decorator of (0, getModifiers_1.getDecorators)(node, + /* includeIllegalDecorators */ true) ?? []) { + // `checkGrammarModifiers` function in typescript + if (!(0, node_utils_1.nodeCanBeDecorated)(node)) { + if (ts.isMethodDeclaration(node) && !(0, node_utils_1.nodeIsPresent)(node.body)) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, decorator, 'A decorator can only decorate a method implementation, not an overload.'); + } + else { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, decorator, 'Decorators are not valid here.'); + } + } + } + for (const modifier of (0, getModifiers_1.getModifiers)(node, + /* includeIllegalModifiers */ true) ?? []) { + if (modifier.kind !== SyntaxKind.ReadonlyKeyword) { + if (node.kind === SyntaxKind.PropertySignature || + node.kind === SyntaxKind.MethodSignature) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a type member`); + } + if (node.kind === SyntaxKind.IndexSignature && + (modifier.kind !== SyntaxKind.StaticKeyword || + !ts.isClassLike(node.parent))) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on an index signature`); + } + } + if (modifier.kind !== SyntaxKind.InKeyword && + modifier.kind !== SyntaxKind.OutKeyword && + modifier.kind !== SyntaxKind.ConstKeyword && + node.kind === SyntaxKind.TypeParameter) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a type parameter`); + } + if ((modifier.kind === SyntaxKind.InKeyword || + modifier.kind === SyntaxKind.OutKeyword) && + (node.kind !== SyntaxKind.TypeParameter || + !(ts.isInterfaceDeclaration(node.parent) || + ts.isClassLike(node.parent) || + ts.isTypeAliasDeclaration(node.parent)))) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, `'${ts.tokenToString(modifier.kind)}' modifier can only appear on a type parameter of a class, interface or type alias`); + } + if (modifier.kind === SyntaxKind.ReadonlyKeyword && + node.kind !== SyntaxKind.PropertyDeclaration && + node.kind !== SyntaxKind.PropertySignature && + node.kind !== SyntaxKind.IndexSignature && + node.kind !== SyntaxKind.Parameter) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, "'readonly' modifier can only appear on a property declaration or index signature."); + } + if (modifier.kind === SyntaxKind.DeclareKeyword && + ts.isClassLike(node.parent) && + !ts.isPropertyDeclaration(node)) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on class elements of this kind.`); + } + if (modifier.kind === SyntaxKind.DeclareKeyword && + ts.isVariableStatement(node)) { + const declarationKind = (0, node_utils_1.getDeclarationKind)(node.declarationList); + if (declarationKind === 'using' || declarationKind === 'await using') { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, `'declare' modifier cannot appear on a '${declarationKind}' declaration.`); + } + } + if (modifier.kind === SyntaxKind.AbstractKeyword && + node.kind !== SyntaxKind.ClassDeclaration && + node.kind !== SyntaxKind.ConstructorType && + node.kind !== SyntaxKind.MethodDeclaration && + node.kind !== SyntaxKind.PropertyDeclaration && + node.kind !== SyntaxKind.GetAccessor && + node.kind !== SyntaxKind.SetAccessor) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, `'${ts.tokenToString(modifier.kind)}' modifier can only appear on a class, method, or property declaration.`); + } + if ((modifier.kind === SyntaxKind.StaticKeyword || + modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.PrivateKeyword) && + (node.parent.kind === SyntaxKind.ModuleBlock || + node.parent.kind === SyntaxKind.SourceFile)) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a module or namespace element.`); + } + if (modifier.kind === SyntaxKind.AccessorKeyword && + node.kind !== SyntaxKind.PropertyDeclaration) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, "'accessor' modifier can only appear on a property declaration."); + } + // `checkGrammarAsyncModifier` function in `typescript` + if (modifier.kind === SyntaxKind.AsyncKeyword && + node.kind !== SyntaxKind.MethodDeclaration && + node.kind !== SyntaxKind.FunctionDeclaration && + node.kind !== SyntaxKind.FunctionExpression && + node.kind !== SyntaxKind.ArrowFunction) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, "'async' modifier cannot be used here."); + } + // `checkGrammarModifiers` function in `typescript` + if (node.kind === SyntaxKind.Parameter && + (modifier.kind === SyntaxKind.StaticKeyword || + modifier.kind === SyntaxKind.ExportKeyword || + modifier.kind === SyntaxKind.DeclareKeyword || + modifier.kind === SyntaxKind.AsyncKeyword)) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a parameter.`); + } + // `checkGrammarModifiers` function in `typescript` + if (modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.PrivateKeyword) { + for (const anotherModifier of (0, getModifiers_1.getModifiers)(node) ?? []) { + if (anotherModifier !== modifier && + (anotherModifier.kind === SyntaxKind.PublicKeyword || + anotherModifier.kind === SyntaxKind.ProtectedKeyword || + anotherModifier.kind === SyntaxKind.PrivateKeyword)) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, anotherModifier, `Accessibility modifier already seen.`); + } + } + } + // `checkParameter` function in `typescript` + if (node.kind === SyntaxKind.Parameter && + // In `typescript` package, it's `ts.hasSyntacticModifier(node, ts.ModifierFlags.ParameterPropertyModifier)` + // https://github.com/typescript-eslint/typescript-eslint/pull/6615#discussion_r1136489935 + (modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.PrivateKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.ReadonlyKeyword || + modifier.kind === SyntaxKind.OverrideKeyword)) { + const func = (0, node_utils_1.getContainingFunction)(node); + if (!(func.kind === SyntaxKind.Constructor && (0, node_utils_1.nodeIsPresent)(func.body))) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, modifier, 'A parameter property is only allowed in a constructor implementation.'); + } + } + } +}, _Converter_throwUnlessAllowInvalidAST = function _Converter_throwUnlessAllowInvalidAST(node, message) { + if (!this.options.allowInvalidAST) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, node, message); + } +}, _Converter_withDeprecatedAliasGetter = function _Converter_withDeprecatedAliasGetter(node, aliasKey, valueKey, suppressWarnings = false) { + let warned = suppressWarnings; + Object.defineProperty(node, aliasKey, { + configurable: true, + get: this.options.suppressDeprecatedPropertyWarnings + ? () => node[valueKey] + : () => { + if (!warned) { + process.emitWarning(`The '${aliasKey}' property is deprecated on ${node.type} nodes. Use '${valueKey}' instead. See https://typescript-eslint.io/linting/troubleshooting#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, 'DeprecationWarning'); + warned = true; + } + return node[valueKey]; + }, + set(value) { + Object.defineProperty(node, aliasKey, { + enumerable: true, + writable: true, + value, + }); + }, + }); + return node; +}, _Converter_throwError = function _Converter_throwError(node, message) { + let start; + let end; + if (typeof node === 'number') { + start = end = node; + } + else { + start = node.getStart(this.ast); + end = node.getEnd(); + } + throw (0, node_utils_1.createError)(message, this.ast, start, end); +}, _Converter_checkForStatementDeclaration = function _Converter_checkForStatementDeclaration(initializer) { + if (ts.isVariableDeclarationList(initializer)) { + if ((initializer.flags & ts.NodeFlags.Using) !== 0) { + __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, initializer, "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."); + } + } +}; +//# sourceMappingURL=convert.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/68/c886dbfa0ae88abe0414497778b9e6cc4a26a4040478fd1d9e855d1f61d179e684f4633f209fcd85d368539e47f78efbdf3e7931af3aed3e036b7a5050a459 b/.pnpm-store/v3/files/68/c886dbfa0ae88abe0414497778b9e6cc4a26a4040478fd1d9e855d1f61d179e684f4633f209fcd85d368539e47f78efbdf3e7931af3aed3e036b7a5050a459 new file mode 100644 index 00000000..fc9eeef3 --- /dev/null +++ b/.pnpm-store/v3/files/68/c886dbfa0ae88abe0414497778b9e6cc4a26a4040478fd1d9e855d1f61d179e684f4633f209fcd85d368539e47f78efbdf3e7931af3aed3e036b7a5050a459 @@ -0,0 +1 @@ +{"version":3,"names":["_validateNode","require","_deprecationWarning","arrayExpression","elements","validateNode","type","assignmentExpression","operator","left","right","binaryExpression","interpreterDirective","value","directive","directiveLiteral","blockStatement","body","directives","breakStatement","label","callExpression","callee","_arguments","arguments","catchClause","param","conditionalExpression","test","consequent","alternate","continueStatement","debuggerStatement","doWhileStatement","emptyStatement","expressionStatement","expression","file","program","comments","tokens","forInStatement","forStatement","init","update","functionDeclaration","id","params","generator","async","functionExpression","identifier","name","ifStatement","labeledStatement","stringLiteral","numericLiteral","nullLiteral","booleanLiteral","regExpLiteral","pattern","flags","logicalExpression","memberExpression","object","property","computed","optional","newExpression","sourceType","interpreter","objectExpression","properties","objectMethod","kind","key","objectProperty","shorthand","decorators","restElement","argument","returnStatement","sequenceExpression","expressions","parenthesizedExpression","switchCase","switchStatement","discriminant","cases","thisExpression","throwStatement","tryStatement","block","handler","finalizer","unaryExpression","prefix","updateExpression","variableDeclaration","declarations","variableDeclarator","whileStatement","withStatement","assignmentPattern","arrayPattern","arrowFunctionExpression","classBody","classExpression","superClass","classDeclaration","exportAllDeclaration","source","exportDefaultDeclaration","declaration","exportNamedDeclaration","specifiers","exportSpecifier","local","exported","forOfStatement","_await","await","importDeclaration","importDefaultSpecifier","importNamespaceSpecifier","importSpecifier","imported","importExpression","options","metaProperty","meta","classMethod","_static","static","objectPattern","spreadElement","_super","taggedTemplateExpression","tag","quasi","templateElement","tail","templateLiteral","quasis","yieldExpression","delegate","awaitExpression","_import","bigIntLiteral","exportNamespaceSpecifier","optionalMemberExpression","optionalCallExpression","classProperty","typeAnnotation","classAccessorProperty","classPrivateProperty","classPrivateMethod","privateName","staticBlock","anyTypeAnnotation","arrayTypeAnnotation","elementType","booleanTypeAnnotation","booleanLiteralTypeAnnotation","nullLiteralTypeAnnotation","classImplements","typeParameters","declareClass","_extends","extends","declareFunction","declareInterface","declareModule","declareModuleExports","declareTypeAlias","declareOpaqueType","supertype","declareVariable","declareExportDeclaration","declareExportAllDeclaration","declaredPredicate","existsTypeAnnotation","functionTypeAnnotation","rest","returnType","functionTypeParam","genericTypeAnnotation","inferredPredicate","interfaceExtends","interfaceDeclaration","interfaceTypeAnnotation","intersectionTypeAnnotation","types","mixedTypeAnnotation","emptyTypeAnnotation","nullableTypeAnnotation","numberLiteralTypeAnnotation","numberTypeAnnotation","objectTypeAnnotation","indexers","callProperties","internalSlots","exact","objectTypeInternalSlot","method","objectTypeCallProperty","objectTypeIndexer","variance","objectTypeProperty","proto","objectTypeSpreadProperty","opaqueType","impltype","qualifiedTypeIdentifier","qualification","stringLiteralTypeAnnotation","stringTypeAnnotation","symbolTypeAnnotation","thisTypeAnnotation","tupleTypeAnnotation","typeofTypeAnnotation","typeAlias","typeCastExpression","typeParameter","bound","_default","default","typeParameterDeclaration","typeParameterInstantiation","unionTypeAnnotation","voidTypeAnnotation","enumDeclaration","enumBooleanBody","members","explicitType","hasUnknownMembers","enumNumberBody","enumStringBody","enumSymbolBody","enumBooleanMember","enumNumberMember","enumStringMember","enumDefaultedMember","indexedAccessType","objectType","indexType","optionalIndexedAccessType","jsxAttribute","jsxClosingElement","jsxElement","openingElement","closingElement","children","selfClosing","jsxEmptyExpression","jsxExpressionContainer","jsxSpreadChild","jsxIdentifier","jsxMemberExpression","jsxNamespacedName","namespace","jsxOpeningElement","attributes","jsxSpreadAttribute","jsxText","jsxFragment","openingFragment","closingFragment","jsxOpeningFragment","jsxClosingFragment","noop","placeholder","expectedNode","v8IntrinsicIdentifier","argumentPlaceholder","bindExpression","importAttribute","decorator","doExpression","exportDefaultSpecifier","recordExpression","tupleExpression","decimalLiteral","moduleExpression","topicReference","pipelineTopicExpression","pipelineBareFunction","pipelinePrimaryTopicReference","tsParameterProperty","parameter","tsDeclareFunction","tsDeclareMethod","tsQualifiedName","tsCallSignatureDeclaration","parameters","tsConstructSignatureDeclaration","tsPropertySignature","tsMethodSignature","tsIndexSignature","tsAnyKeyword","tsBooleanKeyword","tsBigIntKeyword","tsIntrinsicKeyword","tsNeverKeyword","tsNullKeyword","tsNumberKeyword","tsObjectKeyword","tsStringKeyword","tsSymbolKeyword","tsUndefinedKeyword","tsUnknownKeyword","tsVoidKeyword","tsThisType","tsFunctionType","tsConstructorType","tsTypeReference","typeName","tsTypePredicate","parameterName","asserts","tsTypeQuery","exprName","tsTypeLiteral","tsArrayType","tsTupleType","elementTypes","tsOptionalType","tsRestType","tsNamedTupleMember","tsUnionType","tsIntersectionType","tsConditionalType","checkType","extendsType","trueType","falseType","tsInferType","tsParenthesizedType","tsTypeOperator","tsIndexedAccessType","tsMappedType","nameType","tsLiteralType","literal","tsExpressionWithTypeArguments","tsInterfaceDeclaration","tsInterfaceBody","tsTypeAliasDeclaration","tsInstantiationExpression","tsAsExpression","tsSatisfiesExpression","tsTypeAssertion","tsEnumDeclaration","tsEnumMember","initializer","tsModuleDeclaration","tsModuleBlock","tsImportType","qualifier","tsImportEqualsDeclaration","moduleReference","isExport","tsExternalModuleReference","tsNonNullExpression","tsExportAssignment","tsNamespaceExportDeclaration","tsTypeAnnotation","tsTypeParameterInstantiation","tsTypeParameterDeclaration","tsTypeParameter","constraint","NumberLiteral","deprecationWarning","RegexLiteral","RestProperty","SpreadProperty"],"sources":["../../../src/builders/generated/index.ts"],"sourcesContent":["/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport validateNode from \"../validateNode.ts\";\nimport type * as t from \"../../index.ts\";\nimport deprecationWarning from \"../../utils/deprecationWarning.ts\";\nexport function arrayExpression(\n elements: Array = [],\n): t.ArrayExpression {\n return validateNode({\n type: \"ArrayExpression\",\n elements,\n });\n}\nexport function assignmentExpression(\n operator: string,\n left: t.LVal | t.OptionalMemberExpression,\n right: t.Expression,\n): t.AssignmentExpression {\n return validateNode({\n type: \"AssignmentExpression\",\n operator,\n left,\n right,\n });\n}\nexport function binaryExpression(\n operator:\n | \"+\"\n | \"-\"\n | \"/\"\n | \"%\"\n | \"*\"\n | \"**\"\n | \"&\"\n | \"|\"\n | \">>\"\n | \">>>\"\n | \"<<\"\n | \"^\"\n | \"==\"\n | \"===\"\n | \"!=\"\n | \"!==\"\n | \"in\"\n | \"instanceof\"\n | \">\"\n | \"<\"\n | \">=\"\n | \"<=\"\n | \"|>\",\n left: t.Expression | t.PrivateName,\n right: t.Expression,\n): t.BinaryExpression {\n return validateNode({\n type: \"BinaryExpression\",\n operator,\n left,\n right,\n });\n}\nexport function interpreterDirective(value: string): t.InterpreterDirective {\n return validateNode({\n type: \"InterpreterDirective\",\n value,\n });\n}\nexport function directive(value: t.DirectiveLiteral): t.Directive {\n return validateNode({\n type: \"Directive\",\n value,\n });\n}\nexport function directiveLiteral(value: string): t.DirectiveLiteral {\n return validateNode({\n type: \"DirectiveLiteral\",\n value,\n });\n}\nexport function blockStatement(\n body: Array,\n directives: Array = [],\n): t.BlockStatement {\n return validateNode({\n type: \"BlockStatement\",\n body,\n directives,\n });\n}\nexport function breakStatement(\n label: t.Identifier | null = null,\n): t.BreakStatement {\n return validateNode({\n type: \"BreakStatement\",\n label,\n });\n}\nexport function callExpression(\n callee: t.Expression | t.Super | t.V8IntrinsicIdentifier,\n _arguments: Array<\n t.Expression | t.SpreadElement | t.JSXNamespacedName | t.ArgumentPlaceholder\n >,\n): t.CallExpression {\n return validateNode({\n type: \"CallExpression\",\n callee,\n arguments: _arguments,\n });\n}\nexport function catchClause(\n param:\n | t.Identifier\n | t.ArrayPattern\n | t.ObjectPattern\n | null\n | undefined = null,\n body: t.BlockStatement,\n): t.CatchClause {\n return validateNode({\n type: \"CatchClause\",\n param,\n body,\n });\n}\nexport function conditionalExpression(\n test: t.Expression,\n consequent: t.Expression,\n alternate: t.Expression,\n): t.ConditionalExpression {\n return validateNode({\n type: \"ConditionalExpression\",\n test,\n consequent,\n alternate,\n });\n}\nexport function continueStatement(\n label: t.Identifier | null = null,\n): t.ContinueStatement {\n return validateNode({\n type: \"ContinueStatement\",\n label,\n });\n}\nexport function debuggerStatement(): t.DebuggerStatement {\n return {\n type: \"DebuggerStatement\",\n };\n}\nexport function doWhileStatement(\n test: t.Expression,\n body: t.Statement,\n): t.DoWhileStatement {\n return validateNode({\n type: \"DoWhileStatement\",\n test,\n body,\n });\n}\nexport function emptyStatement(): t.EmptyStatement {\n return {\n type: \"EmptyStatement\",\n };\n}\nexport function expressionStatement(\n expression: t.Expression,\n): t.ExpressionStatement {\n return validateNode({\n type: \"ExpressionStatement\",\n expression,\n });\n}\nexport function file(\n program: t.Program,\n comments: Array | null = null,\n tokens: Array | null = null,\n): t.File {\n return validateNode({\n type: \"File\",\n program,\n comments,\n tokens,\n });\n}\nexport function forInStatement(\n left: t.VariableDeclaration | t.LVal,\n right: t.Expression,\n body: t.Statement,\n): t.ForInStatement {\n return validateNode({\n type: \"ForInStatement\",\n left,\n right,\n body,\n });\n}\nexport function forStatement(\n init: t.VariableDeclaration | t.Expression | null | undefined = null,\n test: t.Expression | null | undefined = null,\n update: t.Expression | null | undefined = null,\n body: t.Statement,\n): t.ForStatement {\n return validateNode({\n type: \"ForStatement\",\n init,\n test,\n update,\n body,\n });\n}\nexport function functionDeclaration(\n id: t.Identifier | null | undefined = null,\n params: Array,\n body: t.BlockStatement,\n generator: boolean = false,\n async: boolean = false,\n): t.FunctionDeclaration {\n return validateNode({\n type: \"FunctionDeclaration\",\n id,\n params,\n body,\n generator,\n async,\n });\n}\nexport function functionExpression(\n id: t.Identifier | null | undefined = null,\n params: Array,\n body: t.BlockStatement,\n generator: boolean = false,\n async: boolean = false,\n): t.FunctionExpression {\n return validateNode({\n type: \"FunctionExpression\",\n id,\n params,\n body,\n generator,\n async,\n });\n}\nexport function identifier(name: string): t.Identifier {\n return validateNode({\n type: \"Identifier\",\n name,\n });\n}\nexport function ifStatement(\n test: t.Expression,\n consequent: t.Statement,\n alternate: t.Statement | null = null,\n): t.IfStatement {\n return validateNode({\n type: \"IfStatement\",\n test,\n consequent,\n alternate,\n });\n}\nexport function labeledStatement(\n label: t.Identifier,\n body: t.Statement,\n): t.LabeledStatement {\n return validateNode({\n type: \"LabeledStatement\",\n label,\n body,\n });\n}\nexport function stringLiteral(value: string): t.StringLiteral {\n return validateNode({\n type: \"StringLiteral\",\n value,\n });\n}\nexport function numericLiteral(value: number): t.NumericLiteral {\n return validateNode({\n type: \"NumericLiteral\",\n value,\n });\n}\nexport function nullLiteral(): t.NullLiteral {\n return {\n type: \"NullLiteral\",\n };\n}\nexport function booleanLiteral(value: boolean): t.BooleanLiteral {\n return validateNode({\n type: \"BooleanLiteral\",\n value,\n });\n}\nexport function regExpLiteral(\n pattern: string,\n flags: string = \"\",\n): t.RegExpLiteral {\n return validateNode({\n type: \"RegExpLiteral\",\n pattern,\n flags,\n });\n}\nexport function logicalExpression(\n operator: \"||\" | \"&&\" | \"??\",\n left: t.Expression,\n right: t.Expression,\n): t.LogicalExpression {\n return validateNode({\n type: \"LogicalExpression\",\n operator,\n left,\n right,\n });\n}\nexport function memberExpression(\n object: t.Expression | t.Super,\n property: t.Expression | t.Identifier | t.PrivateName,\n computed: boolean = false,\n optional: true | false | null = null,\n): t.MemberExpression {\n return validateNode({\n type: \"MemberExpression\",\n object,\n property,\n computed,\n optional,\n });\n}\nexport function newExpression(\n callee: t.Expression | t.Super | t.V8IntrinsicIdentifier,\n _arguments: Array<\n t.Expression | t.SpreadElement | t.JSXNamespacedName | t.ArgumentPlaceholder\n >,\n): t.NewExpression {\n return validateNode({\n type: \"NewExpression\",\n callee,\n arguments: _arguments,\n });\n}\nexport function program(\n body: Array,\n directives: Array = [],\n sourceType: \"script\" | \"module\" = \"script\",\n interpreter: t.InterpreterDirective | null = null,\n): t.Program {\n return validateNode({\n type: \"Program\",\n body,\n directives,\n sourceType,\n interpreter,\n });\n}\nexport function objectExpression(\n properties: Array,\n): t.ObjectExpression {\n return validateNode({\n type: \"ObjectExpression\",\n properties,\n });\n}\nexport function objectMethod(\n kind: \"method\" | \"get\" | \"set\" | undefined = \"method\",\n key:\n | t.Expression\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral,\n params: Array,\n body: t.BlockStatement,\n computed: boolean = false,\n generator: boolean = false,\n async: boolean = false,\n): t.ObjectMethod {\n return validateNode({\n type: \"ObjectMethod\",\n kind,\n key,\n params,\n body,\n computed,\n generator,\n async,\n });\n}\nexport function objectProperty(\n key:\n | t.Expression\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.DecimalLiteral\n | t.PrivateName,\n value: t.Expression | t.PatternLike,\n computed: boolean = false,\n shorthand: boolean = false,\n decorators: Array | null = null,\n): t.ObjectProperty {\n return validateNode({\n type: \"ObjectProperty\",\n key,\n value,\n computed,\n shorthand,\n decorators,\n });\n}\nexport function restElement(argument: t.LVal): t.RestElement {\n return validateNode({\n type: \"RestElement\",\n argument,\n });\n}\nexport function returnStatement(\n argument: t.Expression | null = null,\n): t.ReturnStatement {\n return validateNode({\n type: \"ReturnStatement\",\n argument,\n });\n}\nexport function sequenceExpression(\n expressions: Array,\n): t.SequenceExpression {\n return validateNode({\n type: \"SequenceExpression\",\n expressions,\n });\n}\nexport function parenthesizedExpression(\n expression: t.Expression,\n): t.ParenthesizedExpression {\n return validateNode({\n type: \"ParenthesizedExpression\",\n expression,\n });\n}\nexport function switchCase(\n test: t.Expression | null | undefined = null,\n consequent: Array,\n): t.SwitchCase {\n return validateNode({\n type: \"SwitchCase\",\n test,\n consequent,\n });\n}\nexport function switchStatement(\n discriminant: t.Expression,\n cases: Array,\n): t.SwitchStatement {\n return validateNode({\n type: \"SwitchStatement\",\n discriminant,\n cases,\n });\n}\nexport function thisExpression(): t.ThisExpression {\n return {\n type: \"ThisExpression\",\n };\n}\nexport function throwStatement(argument: t.Expression): t.ThrowStatement {\n return validateNode({\n type: \"ThrowStatement\",\n argument,\n });\n}\nexport function tryStatement(\n block: t.BlockStatement,\n handler: t.CatchClause | null = null,\n finalizer: t.BlockStatement | null = null,\n): t.TryStatement {\n return validateNode({\n type: \"TryStatement\",\n block,\n handler,\n finalizer,\n });\n}\nexport function unaryExpression(\n operator: \"void\" | \"throw\" | \"delete\" | \"!\" | \"+\" | \"-\" | \"~\" | \"typeof\",\n argument: t.Expression,\n prefix: boolean = true,\n): t.UnaryExpression {\n return validateNode({\n type: \"UnaryExpression\",\n operator,\n argument,\n prefix,\n });\n}\nexport function updateExpression(\n operator: \"++\" | \"--\",\n argument: t.Expression,\n prefix: boolean = false,\n): t.UpdateExpression {\n return validateNode({\n type: \"UpdateExpression\",\n operator,\n argument,\n prefix,\n });\n}\nexport function variableDeclaration(\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n declarations: Array,\n): t.VariableDeclaration {\n return validateNode({\n type: \"VariableDeclaration\",\n kind,\n declarations,\n });\n}\nexport function variableDeclarator(\n id: t.LVal,\n init: t.Expression | null = null,\n): t.VariableDeclarator {\n return validateNode({\n type: \"VariableDeclarator\",\n id,\n init,\n });\n}\nexport function whileStatement(\n test: t.Expression,\n body: t.Statement,\n): t.WhileStatement {\n return validateNode({\n type: \"WhileStatement\",\n test,\n body,\n });\n}\nexport function withStatement(\n object: t.Expression,\n body: t.Statement,\n): t.WithStatement {\n return validateNode({\n type: \"WithStatement\",\n object,\n body,\n });\n}\nexport function assignmentPattern(\n left:\n | t.Identifier\n | t.ObjectPattern\n | t.ArrayPattern\n | t.MemberExpression\n | t.TSAsExpression\n | t.TSSatisfiesExpression\n | t.TSTypeAssertion\n | t.TSNonNullExpression,\n right: t.Expression,\n): t.AssignmentPattern {\n return validateNode({\n type: \"AssignmentPattern\",\n left,\n right,\n });\n}\nexport function arrayPattern(\n elements: Array,\n): t.ArrayPattern {\n return validateNode({\n type: \"ArrayPattern\",\n elements,\n });\n}\nexport function arrowFunctionExpression(\n params: Array,\n body: t.BlockStatement | t.Expression,\n async: boolean = false,\n): t.ArrowFunctionExpression {\n return validateNode({\n type: \"ArrowFunctionExpression\",\n params,\n body,\n async,\n expression: null,\n });\n}\nexport function classBody(\n body: Array<\n | t.ClassMethod\n | t.ClassPrivateMethod\n | t.ClassProperty\n | t.ClassPrivateProperty\n | t.ClassAccessorProperty\n | t.TSDeclareMethod\n | t.TSIndexSignature\n | t.StaticBlock\n >,\n): t.ClassBody {\n return validateNode({\n type: \"ClassBody\",\n body,\n });\n}\nexport function classExpression(\n id: t.Identifier | null | undefined = null,\n superClass: t.Expression | null | undefined = null,\n body: t.ClassBody,\n decorators: Array | null = null,\n): t.ClassExpression {\n return validateNode({\n type: \"ClassExpression\",\n id,\n superClass,\n body,\n decorators,\n });\n}\nexport function classDeclaration(\n id: t.Identifier | null | undefined = null,\n superClass: t.Expression | null | undefined = null,\n body: t.ClassBody,\n decorators: Array | null = null,\n): t.ClassDeclaration {\n return validateNode({\n type: \"ClassDeclaration\",\n id,\n superClass,\n body,\n decorators,\n });\n}\nexport function exportAllDeclaration(\n source: t.StringLiteral,\n): t.ExportAllDeclaration {\n return validateNode({\n type: \"ExportAllDeclaration\",\n source,\n });\n}\nexport function exportDefaultDeclaration(\n declaration:\n | t.TSDeclareFunction\n | t.FunctionDeclaration\n | t.ClassDeclaration\n | t.Expression,\n): t.ExportDefaultDeclaration {\n return validateNode({\n type: \"ExportDefaultDeclaration\",\n declaration,\n });\n}\nexport function exportNamedDeclaration(\n declaration: t.Declaration | null = null,\n specifiers: Array<\n t.ExportSpecifier | t.ExportDefaultSpecifier | t.ExportNamespaceSpecifier\n > = [],\n source: t.StringLiteral | null = null,\n): t.ExportNamedDeclaration {\n return validateNode({\n type: \"ExportNamedDeclaration\",\n declaration,\n specifiers,\n source,\n });\n}\nexport function exportSpecifier(\n local: t.Identifier,\n exported: t.Identifier | t.StringLiteral,\n): t.ExportSpecifier {\n return validateNode({\n type: \"ExportSpecifier\",\n local,\n exported,\n });\n}\nexport function forOfStatement(\n left: t.VariableDeclaration | t.LVal,\n right: t.Expression,\n body: t.Statement,\n _await: boolean = false,\n): t.ForOfStatement {\n return validateNode({\n type: \"ForOfStatement\",\n left,\n right,\n body,\n await: _await,\n });\n}\nexport function importDeclaration(\n specifiers: Array<\n t.ImportSpecifier | t.ImportDefaultSpecifier | t.ImportNamespaceSpecifier\n >,\n source: t.StringLiteral,\n): t.ImportDeclaration {\n return validateNode({\n type: \"ImportDeclaration\",\n specifiers,\n source,\n });\n}\nexport function importDefaultSpecifier(\n local: t.Identifier,\n): t.ImportDefaultSpecifier {\n return validateNode({\n type: \"ImportDefaultSpecifier\",\n local,\n });\n}\nexport function importNamespaceSpecifier(\n local: t.Identifier,\n): t.ImportNamespaceSpecifier {\n return validateNode({\n type: \"ImportNamespaceSpecifier\",\n local,\n });\n}\nexport function importSpecifier(\n local: t.Identifier,\n imported: t.Identifier | t.StringLiteral,\n): t.ImportSpecifier {\n return validateNode({\n type: \"ImportSpecifier\",\n local,\n imported,\n });\n}\nexport function importExpression(\n source: t.Expression,\n options: t.Expression | null = null,\n): t.ImportExpression {\n return validateNode({\n type: \"ImportExpression\",\n source,\n options,\n });\n}\nexport function metaProperty(\n meta: t.Identifier,\n property: t.Identifier,\n): t.MetaProperty {\n return validateNode({\n type: \"MetaProperty\",\n meta,\n property,\n });\n}\nexport function classMethod(\n kind: \"get\" | \"set\" | \"method\" | \"constructor\" | undefined = \"method\",\n key:\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.Expression,\n params: Array<\n t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty\n >,\n body: t.BlockStatement,\n computed: boolean = false,\n _static: boolean = false,\n generator: boolean = false,\n async: boolean = false,\n): t.ClassMethod {\n return validateNode({\n type: \"ClassMethod\",\n kind,\n key,\n params,\n body,\n computed,\n static: _static,\n generator,\n async,\n });\n}\nexport function objectPattern(\n properties: Array,\n): t.ObjectPattern {\n return validateNode({\n type: \"ObjectPattern\",\n properties,\n });\n}\nexport function spreadElement(argument: t.Expression): t.SpreadElement {\n return validateNode({\n type: \"SpreadElement\",\n argument,\n });\n}\nfunction _super(): t.Super {\n return {\n type: \"Super\",\n };\n}\nexport { _super as super };\nexport function taggedTemplateExpression(\n tag: t.Expression,\n quasi: t.TemplateLiteral,\n): t.TaggedTemplateExpression {\n return validateNode({\n type: \"TaggedTemplateExpression\",\n tag,\n quasi,\n });\n}\nexport function templateElement(\n value: { raw: string; cooked?: string },\n tail: boolean = false,\n): t.TemplateElement {\n return validateNode({\n type: \"TemplateElement\",\n value,\n tail,\n });\n}\nexport function templateLiteral(\n quasis: Array,\n expressions: Array,\n): t.TemplateLiteral {\n return validateNode({\n type: \"TemplateLiteral\",\n quasis,\n expressions,\n });\n}\nexport function yieldExpression(\n argument: t.Expression | null = null,\n delegate: boolean = false,\n): t.YieldExpression {\n return validateNode({\n type: \"YieldExpression\",\n argument,\n delegate,\n });\n}\nexport function awaitExpression(argument: t.Expression): t.AwaitExpression {\n return validateNode({\n type: \"AwaitExpression\",\n argument,\n });\n}\nfunction _import(): t.Import {\n return {\n type: \"Import\",\n };\n}\nexport { _import as import };\nexport function bigIntLiteral(value: string): t.BigIntLiteral {\n return validateNode({\n type: \"BigIntLiteral\",\n value,\n });\n}\nexport function exportNamespaceSpecifier(\n exported: t.Identifier,\n): t.ExportNamespaceSpecifier {\n return validateNode({\n type: \"ExportNamespaceSpecifier\",\n exported,\n });\n}\nexport function optionalMemberExpression(\n object: t.Expression,\n property: t.Expression | t.Identifier,\n computed: boolean | undefined = false,\n optional: boolean,\n): t.OptionalMemberExpression {\n return validateNode({\n type: \"OptionalMemberExpression\",\n object,\n property,\n computed,\n optional,\n });\n}\nexport function optionalCallExpression(\n callee: t.Expression,\n _arguments: Array<\n t.Expression | t.SpreadElement | t.JSXNamespacedName | t.ArgumentPlaceholder\n >,\n optional: boolean,\n): t.OptionalCallExpression {\n return validateNode({\n type: \"OptionalCallExpression\",\n callee,\n arguments: _arguments,\n optional,\n });\n}\nexport function classProperty(\n key:\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.Expression,\n value: t.Expression | null = null,\n typeAnnotation: t.TypeAnnotation | t.TSTypeAnnotation | t.Noop | null = null,\n decorators: Array | null = null,\n computed: boolean = false,\n _static: boolean = false,\n): t.ClassProperty {\n return validateNode({\n type: \"ClassProperty\",\n key,\n value,\n typeAnnotation,\n decorators,\n computed,\n static: _static,\n });\n}\nexport function classAccessorProperty(\n key:\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.Expression\n | t.PrivateName,\n value: t.Expression | null = null,\n typeAnnotation: t.TypeAnnotation | t.TSTypeAnnotation | t.Noop | null = null,\n decorators: Array | null = null,\n computed: boolean = false,\n _static: boolean = false,\n): t.ClassAccessorProperty {\n return validateNode({\n type: \"ClassAccessorProperty\",\n key,\n value,\n typeAnnotation,\n decorators,\n computed,\n static: _static,\n });\n}\nexport function classPrivateProperty(\n key: t.PrivateName,\n value: t.Expression | null = null,\n decorators: Array | null = null,\n _static: boolean = false,\n): t.ClassPrivateProperty {\n return validateNode({\n type: \"ClassPrivateProperty\",\n key,\n value,\n decorators,\n static: _static,\n });\n}\nexport function classPrivateMethod(\n kind: \"get\" | \"set\" | \"method\" | undefined = \"method\",\n key: t.PrivateName,\n params: Array<\n t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty\n >,\n body: t.BlockStatement,\n _static: boolean = false,\n): t.ClassPrivateMethod {\n return validateNode({\n type: \"ClassPrivateMethod\",\n kind,\n key,\n params,\n body,\n static: _static,\n });\n}\nexport function privateName(id: t.Identifier): t.PrivateName {\n return validateNode({\n type: \"PrivateName\",\n id,\n });\n}\nexport function staticBlock(body: Array): t.StaticBlock {\n return validateNode({\n type: \"StaticBlock\",\n body,\n });\n}\nexport function anyTypeAnnotation(): t.AnyTypeAnnotation {\n return {\n type: \"AnyTypeAnnotation\",\n };\n}\nexport function arrayTypeAnnotation(\n elementType: t.FlowType,\n): t.ArrayTypeAnnotation {\n return validateNode({\n type: \"ArrayTypeAnnotation\",\n elementType,\n });\n}\nexport function booleanTypeAnnotation(): t.BooleanTypeAnnotation {\n return {\n type: \"BooleanTypeAnnotation\",\n };\n}\nexport function booleanLiteralTypeAnnotation(\n value: boolean,\n): t.BooleanLiteralTypeAnnotation {\n return validateNode({\n type: \"BooleanLiteralTypeAnnotation\",\n value,\n });\n}\nexport function nullLiteralTypeAnnotation(): t.NullLiteralTypeAnnotation {\n return {\n type: \"NullLiteralTypeAnnotation\",\n };\n}\nexport function classImplements(\n id: t.Identifier,\n typeParameters: t.TypeParameterInstantiation | null = null,\n): t.ClassImplements {\n return validateNode({\n type: \"ClassImplements\",\n id,\n typeParameters,\n });\n}\nexport function declareClass(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n _extends: Array | null | undefined = null,\n body: t.ObjectTypeAnnotation,\n): t.DeclareClass {\n return validateNode({\n type: \"DeclareClass\",\n id,\n typeParameters,\n extends: _extends,\n body,\n });\n}\nexport function declareFunction(id: t.Identifier): t.DeclareFunction {\n return validateNode({\n type: \"DeclareFunction\",\n id,\n });\n}\nexport function declareInterface(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n _extends: Array | null | undefined = null,\n body: t.ObjectTypeAnnotation,\n): t.DeclareInterface {\n return validateNode({\n type: \"DeclareInterface\",\n id,\n typeParameters,\n extends: _extends,\n body,\n });\n}\nexport function declareModule(\n id: t.Identifier | t.StringLiteral,\n body: t.BlockStatement,\n kind: \"CommonJS\" | \"ES\" | null = null,\n): t.DeclareModule {\n return validateNode({\n type: \"DeclareModule\",\n id,\n body,\n kind,\n });\n}\nexport function declareModuleExports(\n typeAnnotation: t.TypeAnnotation,\n): t.DeclareModuleExports {\n return validateNode({\n type: \"DeclareModuleExports\",\n typeAnnotation,\n });\n}\nexport function declareTypeAlias(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n right: t.FlowType,\n): t.DeclareTypeAlias {\n return validateNode({\n type: \"DeclareTypeAlias\",\n id,\n typeParameters,\n right,\n });\n}\nexport function declareOpaqueType(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null = null,\n supertype: t.FlowType | null = null,\n): t.DeclareOpaqueType {\n return validateNode({\n type: \"DeclareOpaqueType\",\n id,\n typeParameters,\n supertype,\n });\n}\nexport function declareVariable(id: t.Identifier): t.DeclareVariable {\n return validateNode({\n type: \"DeclareVariable\",\n id,\n });\n}\nexport function declareExportDeclaration(\n declaration: t.Flow | null = null,\n specifiers: Array<\n t.ExportSpecifier | t.ExportNamespaceSpecifier\n > | null = null,\n source: t.StringLiteral | null = null,\n): t.DeclareExportDeclaration {\n return validateNode({\n type: \"DeclareExportDeclaration\",\n declaration,\n specifiers,\n source,\n });\n}\nexport function declareExportAllDeclaration(\n source: t.StringLiteral,\n): t.DeclareExportAllDeclaration {\n return validateNode({\n type: \"DeclareExportAllDeclaration\",\n source,\n });\n}\nexport function declaredPredicate(value: t.Flow): t.DeclaredPredicate {\n return validateNode({\n type: \"DeclaredPredicate\",\n value,\n });\n}\nexport function existsTypeAnnotation(): t.ExistsTypeAnnotation {\n return {\n type: \"ExistsTypeAnnotation\",\n };\n}\nexport function functionTypeAnnotation(\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n params: Array,\n rest: t.FunctionTypeParam | null | undefined = null,\n returnType: t.FlowType,\n): t.FunctionTypeAnnotation {\n return validateNode({\n type: \"FunctionTypeAnnotation\",\n typeParameters,\n params,\n rest,\n returnType,\n });\n}\nexport function functionTypeParam(\n name: t.Identifier | null | undefined = null,\n typeAnnotation: t.FlowType,\n): t.FunctionTypeParam {\n return validateNode({\n type: \"FunctionTypeParam\",\n name,\n typeAnnotation,\n });\n}\nexport function genericTypeAnnotation(\n id: t.Identifier | t.QualifiedTypeIdentifier,\n typeParameters: t.TypeParameterInstantiation | null = null,\n): t.GenericTypeAnnotation {\n return validateNode({\n type: \"GenericTypeAnnotation\",\n id,\n typeParameters,\n });\n}\nexport function inferredPredicate(): t.InferredPredicate {\n return {\n type: \"InferredPredicate\",\n };\n}\nexport function interfaceExtends(\n id: t.Identifier | t.QualifiedTypeIdentifier,\n typeParameters: t.TypeParameterInstantiation | null = null,\n): t.InterfaceExtends {\n return validateNode({\n type: \"InterfaceExtends\",\n id,\n typeParameters,\n });\n}\nexport function interfaceDeclaration(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n _extends: Array | null | undefined = null,\n body: t.ObjectTypeAnnotation,\n): t.InterfaceDeclaration {\n return validateNode({\n type: \"InterfaceDeclaration\",\n id,\n typeParameters,\n extends: _extends,\n body,\n });\n}\nexport function interfaceTypeAnnotation(\n _extends: Array | null | undefined = null,\n body: t.ObjectTypeAnnotation,\n): t.InterfaceTypeAnnotation {\n return validateNode({\n type: \"InterfaceTypeAnnotation\",\n extends: _extends,\n body,\n });\n}\nexport function intersectionTypeAnnotation(\n types: Array,\n): t.IntersectionTypeAnnotation {\n return validateNode({\n type: \"IntersectionTypeAnnotation\",\n types,\n });\n}\nexport function mixedTypeAnnotation(): t.MixedTypeAnnotation {\n return {\n type: \"MixedTypeAnnotation\",\n };\n}\nexport function emptyTypeAnnotation(): t.EmptyTypeAnnotation {\n return {\n type: \"EmptyTypeAnnotation\",\n };\n}\nexport function nullableTypeAnnotation(\n typeAnnotation: t.FlowType,\n): t.NullableTypeAnnotation {\n return validateNode({\n type: \"NullableTypeAnnotation\",\n typeAnnotation,\n });\n}\nexport function numberLiteralTypeAnnotation(\n value: number,\n): t.NumberLiteralTypeAnnotation {\n return validateNode({\n type: \"NumberLiteralTypeAnnotation\",\n value,\n });\n}\nexport function numberTypeAnnotation(): t.NumberTypeAnnotation {\n return {\n type: \"NumberTypeAnnotation\",\n };\n}\nexport function objectTypeAnnotation(\n properties: Array,\n indexers: Array = [],\n callProperties: Array = [],\n internalSlots: Array = [],\n exact: boolean = false,\n): t.ObjectTypeAnnotation {\n return validateNode({\n type: \"ObjectTypeAnnotation\",\n properties,\n indexers,\n callProperties,\n internalSlots,\n exact,\n });\n}\nexport function objectTypeInternalSlot(\n id: t.Identifier,\n value: t.FlowType,\n optional: boolean,\n _static: boolean,\n method: boolean,\n): t.ObjectTypeInternalSlot {\n return validateNode({\n type: \"ObjectTypeInternalSlot\",\n id,\n value,\n optional,\n static: _static,\n method,\n });\n}\nexport function objectTypeCallProperty(\n value: t.FlowType,\n): t.ObjectTypeCallProperty {\n return validateNode({\n type: \"ObjectTypeCallProperty\",\n value,\n static: null,\n });\n}\nexport function objectTypeIndexer(\n id: t.Identifier | null | undefined = null,\n key: t.FlowType,\n value: t.FlowType,\n variance: t.Variance | null = null,\n): t.ObjectTypeIndexer {\n return validateNode({\n type: \"ObjectTypeIndexer\",\n id,\n key,\n value,\n variance,\n static: null,\n });\n}\nexport function objectTypeProperty(\n key: t.Identifier | t.StringLiteral,\n value: t.FlowType,\n variance: t.Variance | null = null,\n): t.ObjectTypeProperty {\n return validateNode({\n type: \"ObjectTypeProperty\",\n key,\n value,\n variance,\n kind: null,\n method: null,\n optional: null,\n proto: null,\n static: null,\n });\n}\nexport function objectTypeSpreadProperty(\n argument: t.FlowType,\n): t.ObjectTypeSpreadProperty {\n return validateNode({\n type: \"ObjectTypeSpreadProperty\",\n argument,\n });\n}\nexport function opaqueType(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n supertype: t.FlowType | null | undefined = null,\n impltype: t.FlowType,\n): t.OpaqueType {\n return validateNode({\n type: \"OpaqueType\",\n id,\n typeParameters,\n supertype,\n impltype,\n });\n}\nexport function qualifiedTypeIdentifier(\n id: t.Identifier,\n qualification: t.Identifier | t.QualifiedTypeIdentifier,\n): t.QualifiedTypeIdentifier {\n return validateNode({\n type: \"QualifiedTypeIdentifier\",\n id,\n qualification,\n });\n}\nexport function stringLiteralTypeAnnotation(\n value: string,\n): t.StringLiteralTypeAnnotation {\n return validateNode({\n type: \"StringLiteralTypeAnnotation\",\n value,\n });\n}\nexport function stringTypeAnnotation(): t.StringTypeAnnotation {\n return {\n type: \"StringTypeAnnotation\",\n };\n}\nexport function symbolTypeAnnotation(): t.SymbolTypeAnnotation {\n return {\n type: \"SymbolTypeAnnotation\",\n };\n}\nexport function thisTypeAnnotation(): t.ThisTypeAnnotation {\n return {\n type: \"ThisTypeAnnotation\",\n };\n}\nexport function tupleTypeAnnotation(\n types: Array,\n): t.TupleTypeAnnotation {\n return validateNode({\n type: \"TupleTypeAnnotation\",\n types,\n });\n}\nexport function typeofTypeAnnotation(\n argument: t.FlowType,\n): t.TypeofTypeAnnotation {\n return validateNode({\n type: \"TypeofTypeAnnotation\",\n argument,\n });\n}\nexport function typeAlias(\n id: t.Identifier,\n typeParameters: t.TypeParameterDeclaration | null | undefined = null,\n right: t.FlowType,\n): t.TypeAlias {\n return validateNode({\n type: \"TypeAlias\",\n id,\n typeParameters,\n right,\n });\n}\nexport function typeAnnotation(typeAnnotation: t.FlowType): t.TypeAnnotation {\n return validateNode({\n type: \"TypeAnnotation\",\n typeAnnotation,\n });\n}\nexport function typeCastExpression(\n expression: t.Expression,\n typeAnnotation: t.TypeAnnotation,\n): t.TypeCastExpression {\n return validateNode({\n type: \"TypeCastExpression\",\n expression,\n typeAnnotation,\n });\n}\nexport function typeParameter(\n bound: t.TypeAnnotation | null = null,\n _default: t.FlowType | null = null,\n variance: t.Variance | null = null,\n): t.TypeParameter {\n return validateNode({\n type: \"TypeParameter\",\n bound,\n default: _default,\n variance,\n name: null,\n });\n}\nexport function typeParameterDeclaration(\n params: Array,\n): t.TypeParameterDeclaration {\n return validateNode({\n type: \"TypeParameterDeclaration\",\n params,\n });\n}\nexport function typeParameterInstantiation(\n params: Array,\n): t.TypeParameterInstantiation {\n return validateNode({\n type: \"TypeParameterInstantiation\",\n params,\n });\n}\nexport function unionTypeAnnotation(\n types: Array,\n): t.UnionTypeAnnotation {\n return validateNode({\n type: \"UnionTypeAnnotation\",\n types,\n });\n}\nexport function variance(kind: \"minus\" | \"plus\"): t.Variance {\n return validateNode({\n type: \"Variance\",\n kind,\n });\n}\nexport function voidTypeAnnotation(): t.VoidTypeAnnotation {\n return {\n type: \"VoidTypeAnnotation\",\n };\n}\nexport function enumDeclaration(\n id: t.Identifier,\n body:\n | t.EnumBooleanBody\n | t.EnumNumberBody\n | t.EnumStringBody\n | t.EnumSymbolBody,\n): t.EnumDeclaration {\n return validateNode({\n type: \"EnumDeclaration\",\n id,\n body,\n });\n}\nexport function enumBooleanBody(\n members: Array,\n): t.EnumBooleanBody {\n return validateNode({\n type: \"EnumBooleanBody\",\n members,\n explicitType: null,\n hasUnknownMembers: null,\n });\n}\nexport function enumNumberBody(\n members: Array,\n): t.EnumNumberBody {\n return validateNode({\n type: \"EnumNumberBody\",\n members,\n explicitType: null,\n hasUnknownMembers: null,\n });\n}\nexport function enumStringBody(\n members: Array,\n): t.EnumStringBody {\n return validateNode({\n type: \"EnumStringBody\",\n members,\n explicitType: null,\n hasUnknownMembers: null,\n });\n}\nexport function enumSymbolBody(\n members: Array,\n): t.EnumSymbolBody {\n return validateNode({\n type: \"EnumSymbolBody\",\n members,\n hasUnknownMembers: null,\n });\n}\nexport function enumBooleanMember(id: t.Identifier): t.EnumBooleanMember {\n return validateNode({\n type: \"EnumBooleanMember\",\n id,\n init: null,\n });\n}\nexport function enumNumberMember(\n id: t.Identifier,\n init: t.NumericLiteral,\n): t.EnumNumberMember {\n return validateNode({\n type: \"EnumNumberMember\",\n id,\n init,\n });\n}\nexport function enumStringMember(\n id: t.Identifier,\n init: t.StringLiteral,\n): t.EnumStringMember {\n return validateNode({\n type: \"EnumStringMember\",\n id,\n init,\n });\n}\nexport function enumDefaultedMember(id: t.Identifier): t.EnumDefaultedMember {\n return validateNode({\n type: \"EnumDefaultedMember\",\n id,\n });\n}\nexport function indexedAccessType(\n objectType: t.FlowType,\n indexType: t.FlowType,\n): t.IndexedAccessType {\n return validateNode({\n type: \"IndexedAccessType\",\n objectType,\n indexType,\n });\n}\nexport function optionalIndexedAccessType(\n objectType: t.FlowType,\n indexType: t.FlowType,\n): t.OptionalIndexedAccessType {\n return validateNode({\n type: \"OptionalIndexedAccessType\",\n objectType,\n indexType,\n optional: null,\n });\n}\nexport function jsxAttribute(\n name: t.JSXIdentifier | t.JSXNamespacedName,\n value:\n | t.JSXElement\n | t.JSXFragment\n | t.StringLiteral\n | t.JSXExpressionContainer\n | null = null,\n): t.JSXAttribute {\n return validateNode({\n type: \"JSXAttribute\",\n name,\n value,\n });\n}\nexport { jsxAttribute as jSXAttribute };\nexport function jsxClosingElement(\n name: t.JSXIdentifier | t.JSXMemberExpression | t.JSXNamespacedName,\n): t.JSXClosingElement {\n return validateNode({\n type: \"JSXClosingElement\",\n name,\n });\n}\nexport { jsxClosingElement as jSXClosingElement };\nexport function jsxElement(\n openingElement: t.JSXOpeningElement,\n closingElement: t.JSXClosingElement | null | undefined = null,\n children: Array<\n | t.JSXText\n | t.JSXExpressionContainer\n | t.JSXSpreadChild\n | t.JSXElement\n | t.JSXFragment\n >,\n selfClosing: boolean | null = null,\n): t.JSXElement {\n return validateNode({\n type: \"JSXElement\",\n openingElement,\n closingElement,\n children,\n selfClosing,\n });\n}\nexport { jsxElement as jSXElement };\nexport function jsxEmptyExpression(): t.JSXEmptyExpression {\n return {\n type: \"JSXEmptyExpression\",\n };\n}\nexport { jsxEmptyExpression as jSXEmptyExpression };\nexport function jsxExpressionContainer(\n expression: t.Expression | t.JSXEmptyExpression,\n): t.JSXExpressionContainer {\n return validateNode({\n type: \"JSXExpressionContainer\",\n expression,\n });\n}\nexport { jsxExpressionContainer as jSXExpressionContainer };\nexport function jsxSpreadChild(expression: t.Expression): t.JSXSpreadChild {\n return validateNode({\n type: \"JSXSpreadChild\",\n expression,\n });\n}\nexport { jsxSpreadChild as jSXSpreadChild };\nexport function jsxIdentifier(name: string): t.JSXIdentifier {\n return validateNode({\n type: \"JSXIdentifier\",\n name,\n });\n}\nexport { jsxIdentifier as jSXIdentifier };\nexport function jsxMemberExpression(\n object: t.JSXMemberExpression | t.JSXIdentifier,\n property: t.JSXIdentifier,\n): t.JSXMemberExpression {\n return validateNode({\n type: \"JSXMemberExpression\",\n object,\n property,\n });\n}\nexport { jsxMemberExpression as jSXMemberExpression };\nexport function jsxNamespacedName(\n namespace: t.JSXIdentifier,\n name: t.JSXIdentifier,\n): t.JSXNamespacedName {\n return validateNode({\n type: \"JSXNamespacedName\",\n namespace,\n name,\n });\n}\nexport { jsxNamespacedName as jSXNamespacedName };\nexport function jsxOpeningElement(\n name: t.JSXIdentifier | t.JSXMemberExpression | t.JSXNamespacedName,\n attributes: Array,\n selfClosing: boolean = false,\n): t.JSXOpeningElement {\n return validateNode({\n type: \"JSXOpeningElement\",\n name,\n attributes,\n selfClosing,\n });\n}\nexport { jsxOpeningElement as jSXOpeningElement };\nexport function jsxSpreadAttribute(\n argument: t.Expression,\n): t.JSXSpreadAttribute {\n return validateNode({\n type: \"JSXSpreadAttribute\",\n argument,\n });\n}\nexport { jsxSpreadAttribute as jSXSpreadAttribute };\nexport function jsxText(value: string): t.JSXText {\n return validateNode({\n type: \"JSXText\",\n value,\n });\n}\nexport { jsxText as jSXText };\nexport function jsxFragment(\n openingFragment: t.JSXOpeningFragment,\n closingFragment: t.JSXClosingFragment,\n children: Array<\n | t.JSXText\n | t.JSXExpressionContainer\n | t.JSXSpreadChild\n | t.JSXElement\n | t.JSXFragment\n >,\n): t.JSXFragment {\n return validateNode({\n type: \"JSXFragment\",\n openingFragment,\n closingFragment,\n children,\n });\n}\nexport { jsxFragment as jSXFragment };\nexport function jsxOpeningFragment(): t.JSXOpeningFragment {\n return {\n type: \"JSXOpeningFragment\",\n };\n}\nexport { jsxOpeningFragment as jSXOpeningFragment };\nexport function jsxClosingFragment(): t.JSXClosingFragment {\n return {\n type: \"JSXClosingFragment\",\n };\n}\nexport { jsxClosingFragment as jSXClosingFragment };\nexport function noop(): t.Noop {\n return {\n type: \"Noop\",\n };\n}\nexport function placeholder(\n expectedNode:\n | \"Identifier\"\n | \"StringLiteral\"\n | \"Expression\"\n | \"Statement\"\n | \"Declaration\"\n | \"BlockStatement\"\n | \"ClassBody\"\n | \"Pattern\",\n name: t.Identifier,\n): t.Placeholder {\n return validateNode({\n type: \"Placeholder\",\n expectedNode,\n name,\n });\n}\nexport function v8IntrinsicIdentifier(name: string): t.V8IntrinsicIdentifier {\n return validateNode({\n type: \"V8IntrinsicIdentifier\",\n name,\n });\n}\nexport function argumentPlaceholder(): t.ArgumentPlaceholder {\n return {\n type: \"ArgumentPlaceholder\",\n };\n}\nexport function bindExpression(\n object: t.Expression,\n callee: t.Expression,\n): t.BindExpression {\n return validateNode({\n type: \"BindExpression\",\n object,\n callee,\n });\n}\nexport function importAttribute(\n key: t.Identifier | t.StringLiteral,\n value: t.StringLiteral,\n): t.ImportAttribute {\n return validateNode({\n type: \"ImportAttribute\",\n key,\n value,\n });\n}\nexport function decorator(expression: t.Expression): t.Decorator {\n return validateNode({\n type: \"Decorator\",\n expression,\n });\n}\nexport function doExpression(\n body: t.BlockStatement,\n async: boolean = false,\n): t.DoExpression {\n return validateNode({\n type: \"DoExpression\",\n body,\n async,\n });\n}\nexport function exportDefaultSpecifier(\n exported: t.Identifier,\n): t.ExportDefaultSpecifier {\n return validateNode({\n type: \"ExportDefaultSpecifier\",\n exported,\n });\n}\nexport function recordExpression(\n properties: Array,\n): t.RecordExpression {\n return validateNode({\n type: \"RecordExpression\",\n properties,\n });\n}\nexport function tupleExpression(\n elements: Array = [],\n): t.TupleExpression {\n return validateNode({\n type: \"TupleExpression\",\n elements,\n });\n}\nexport function decimalLiteral(value: string): t.DecimalLiteral {\n return validateNode({\n type: \"DecimalLiteral\",\n value,\n });\n}\nexport function moduleExpression(body: t.Program): t.ModuleExpression {\n return validateNode({\n type: \"ModuleExpression\",\n body,\n });\n}\nexport function topicReference(): t.TopicReference {\n return {\n type: \"TopicReference\",\n };\n}\nexport function pipelineTopicExpression(\n expression: t.Expression,\n): t.PipelineTopicExpression {\n return validateNode({\n type: \"PipelineTopicExpression\",\n expression,\n });\n}\nexport function pipelineBareFunction(\n callee: t.Expression,\n): t.PipelineBareFunction {\n return validateNode({\n type: \"PipelineBareFunction\",\n callee,\n });\n}\nexport function pipelinePrimaryTopicReference(): t.PipelinePrimaryTopicReference {\n return {\n type: \"PipelinePrimaryTopicReference\",\n };\n}\nexport function tsParameterProperty(\n parameter: t.Identifier | t.AssignmentPattern,\n): t.TSParameterProperty {\n return validateNode({\n type: \"TSParameterProperty\",\n parameter,\n });\n}\nexport { tsParameterProperty as tSParameterProperty };\nexport function tsDeclareFunction(\n id: t.Identifier | null | undefined = null,\n typeParameters:\n | t.TSTypeParameterDeclaration\n | t.Noop\n | null\n | undefined = null,\n params: Array,\n returnType: t.TSTypeAnnotation | t.Noop | null = null,\n): t.TSDeclareFunction {\n return validateNode({\n type: \"TSDeclareFunction\",\n id,\n typeParameters,\n params,\n returnType,\n });\n}\nexport { tsDeclareFunction as tSDeclareFunction };\nexport function tsDeclareMethod(\n decorators: Array | null | undefined = null,\n key:\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.Expression,\n typeParameters:\n | t.TSTypeParameterDeclaration\n | t.Noop\n | null\n | undefined = null,\n params: Array<\n t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty\n >,\n returnType: t.TSTypeAnnotation | t.Noop | null = null,\n): t.TSDeclareMethod {\n return validateNode({\n type: \"TSDeclareMethod\",\n decorators,\n key,\n typeParameters,\n params,\n returnType,\n });\n}\nexport { tsDeclareMethod as tSDeclareMethod };\nexport function tsQualifiedName(\n left: t.TSEntityName,\n right: t.Identifier,\n): t.TSQualifiedName {\n return validateNode({\n type: \"TSQualifiedName\",\n left,\n right,\n });\n}\nexport { tsQualifiedName as tSQualifiedName };\nexport function tsCallSignatureDeclaration(\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array<\n t.ArrayPattern | t.Identifier | t.ObjectPattern | t.RestElement\n >,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSCallSignatureDeclaration {\n return validateNode({\n type: \"TSCallSignatureDeclaration\",\n typeParameters,\n parameters,\n typeAnnotation,\n });\n}\nexport { tsCallSignatureDeclaration as tSCallSignatureDeclaration };\nexport function tsConstructSignatureDeclaration(\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array<\n t.ArrayPattern | t.Identifier | t.ObjectPattern | t.RestElement\n >,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSConstructSignatureDeclaration {\n return validateNode({\n type: \"TSConstructSignatureDeclaration\",\n typeParameters,\n parameters,\n typeAnnotation,\n });\n}\nexport { tsConstructSignatureDeclaration as tSConstructSignatureDeclaration };\nexport function tsPropertySignature(\n key: t.Expression,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSPropertySignature {\n return validateNode({\n type: \"TSPropertySignature\",\n key,\n typeAnnotation,\n kind: null,\n });\n}\nexport { tsPropertySignature as tSPropertySignature };\nexport function tsMethodSignature(\n key: t.Expression,\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array<\n t.ArrayPattern | t.Identifier | t.ObjectPattern | t.RestElement\n >,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSMethodSignature {\n return validateNode({\n type: \"TSMethodSignature\",\n key,\n typeParameters,\n parameters,\n typeAnnotation,\n kind: null,\n });\n}\nexport { tsMethodSignature as tSMethodSignature };\nexport function tsIndexSignature(\n parameters: Array,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSIndexSignature {\n return validateNode({\n type: \"TSIndexSignature\",\n parameters,\n typeAnnotation,\n });\n}\nexport { tsIndexSignature as tSIndexSignature };\nexport function tsAnyKeyword(): t.TSAnyKeyword {\n return {\n type: \"TSAnyKeyword\",\n };\n}\nexport { tsAnyKeyword as tSAnyKeyword };\nexport function tsBooleanKeyword(): t.TSBooleanKeyword {\n return {\n type: \"TSBooleanKeyword\",\n };\n}\nexport { tsBooleanKeyword as tSBooleanKeyword };\nexport function tsBigIntKeyword(): t.TSBigIntKeyword {\n return {\n type: \"TSBigIntKeyword\",\n };\n}\nexport { tsBigIntKeyword as tSBigIntKeyword };\nexport function tsIntrinsicKeyword(): t.TSIntrinsicKeyword {\n return {\n type: \"TSIntrinsicKeyword\",\n };\n}\nexport { tsIntrinsicKeyword as tSIntrinsicKeyword };\nexport function tsNeverKeyword(): t.TSNeverKeyword {\n return {\n type: \"TSNeverKeyword\",\n };\n}\nexport { tsNeverKeyword as tSNeverKeyword };\nexport function tsNullKeyword(): t.TSNullKeyword {\n return {\n type: \"TSNullKeyword\",\n };\n}\nexport { tsNullKeyword as tSNullKeyword };\nexport function tsNumberKeyword(): t.TSNumberKeyword {\n return {\n type: \"TSNumberKeyword\",\n };\n}\nexport { tsNumberKeyword as tSNumberKeyword };\nexport function tsObjectKeyword(): t.TSObjectKeyword {\n return {\n type: \"TSObjectKeyword\",\n };\n}\nexport { tsObjectKeyword as tSObjectKeyword };\nexport function tsStringKeyword(): t.TSStringKeyword {\n return {\n type: \"TSStringKeyword\",\n };\n}\nexport { tsStringKeyword as tSStringKeyword };\nexport function tsSymbolKeyword(): t.TSSymbolKeyword {\n return {\n type: \"TSSymbolKeyword\",\n };\n}\nexport { tsSymbolKeyword as tSSymbolKeyword };\nexport function tsUndefinedKeyword(): t.TSUndefinedKeyword {\n return {\n type: \"TSUndefinedKeyword\",\n };\n}\nexport { tsUndefinedKeyword as tSUndefinedKeyword };\nexport function tsUnknownKeyword(): t.TSUnknownKeyword {\n return {\n type: \"TSUnknownKeyword\",\n };\n}\nexport { tsUnknownKeyword as tSUnknownKeyword };\nexport function tsVoidKeyword(): t.TSVoidKeyword {\n return {\n type: \"TSVoidKeyword\",\n };\n}\nexport { tsVoidKeyword as tSVoidKeyword };\nexport function tsThisType(): t.TSThisType {\n return {\n type: \"TSThisType\",\n };\n}\nexport { tsThisType as tSThisType };\nexport function tsFunctionType(\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array<\n t.ArrayPattern | t.Identifier | t.ObjectPattern | t.RestElement\n >,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSFunctionType {\n return validateNode({\n type: \"TSFunctionType\",\n typeParameters,\n parameters,\n typeAnnotation,\n });\n}\nexport { tsFunctionType as tSFunctionType };\nexport function tsConstructorType(\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n parameters: Array<\n t.ArrayPattern | t.Identifier | t.ObjectPattern | t.RestElement\n >,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n): t.TSConstructorType {\n return validateNode({\n type: \"TSConstructorType\",\n typeParameters,\n parameters,\n typeAnnotation,\n });\n}\nexport { tsConstructorType as tSConstructorType };\nexport function tsTypeReference(\n typeName: t.TSEntityName,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSTypeReference {\n return validateNode({\n type: \"TSTypeReference\",\n typeName,\n typeParameters,\n });\n}\nexport { tsTypeReference as tSTypeReference };\nexport function tsTypePredicate(\n parameterName: t.Identifier | t.TSThisType,\n typeAnnotation: t.TSTypeAnnotation | null = null,\n asserts: boolean | null = null,\n): t.TSTypePredicate {\n return validateNode({\n type: \"TSTypePredicate\",\n parameterName,\n typeAnnotation,\n asserts,\n });\n}\nexport { tsTypePredicate as tSTypePredicate };\nexport function tsTypeQuery(\n exprName: t.TSEntityName | t.TSImportType,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSTypeQuery {\n return validateNode({\n type: \"TSTypeQuery\",\n exprName,\n typeParameters,\n });\n}\nexport { tsTypeQuery as tSTypeQuery };\nexport function tsTypeLiteral(\n members: Array,\n): t.TSTypeLiteral {\n return validateNode({\n type: \"TSTypeLiteral\",\n members,\n });\n}\nexport { tsTypeLiteral as tSTypeLiteral };\nexport function tsArrayType(elementType: t.TSType): t.TSArrayType {\n return validateNode({\n type: \"TSArrayType\",\n elementType,\n });\n}\nexport { tsArrayType as tSArrayType };\nexport function tsTupleType(\n elementTypes: Array,\n): t.TSTupleType {\n return validateNode({\n type: \"TSTupleType\",\n elementTypes,\n });\n}\nexport { tsTupleType as tSTupleType };\nexport function tsOptionalType(typeAnnotation: t.TSType): t.TSOptionalType {\n return validateNode({\n type: \"TSOptionalType\",\n typeAnnotation,\n });\n}\nexport { tsOptionalType as tSOptionalType };\nexport function tsRestType(typeAnnotation: t.TSType): t.TSRestType {\n return validateNode({\n type: \"TSRestType\",\n typeAnnotation,\n });\n}\nexport { tsRestType as tSRestType };\nexport function tsNamedTupleMember(\n label: t.Identifier,\n elementType: t.TSType,\n optional: boolean = false,\n): t.TSNamedTupleMember {\n return validateNode({\n type: \"TSNamedTupleMember\",\n label,\n elementType,\n optional,\n });\n}\nexport { tsNamedTupleMember as tSNamedTupleMember };\nexport function tsUnionType(types: Array): t.TSUnionType {\n return validateNode({\n type: \"TSUnionType\",\n types,\n });\n}\nexport { tsUnionType as tSUnionType };\nexport function tsIntersectionType(\n types: Array,\n): t.TSIntersectionType {\n return validateNode({\n type: \"TSIntersectionType\",\n types,\n });\n}\nexport { tsIntersectionType as tSIntersectionType };\nexport function tsConditionalType(\n checkType: t.TSType,\n extendsType: t.TSType,\n trueType: t.TSType,\n falseType: t.TSType,\n): t.TSConditionalType {\n return validateNode({\n type: \"TSConditionalType\",\n checkType,\n extendsType,\n trueType,\n falseType,\n });\n}\nexport { tsConditionalType as tSConditionalType };\nexport function tsInferType(typeParameter: t.TSTypeParameter): t.TSInferType {\n return validateNode({\n type: \"TSInferType\",\n typeParameter,\n });\n}\nexport { tsInferType as tSInferType };\nexport function tsParenthesizedType(\n typeAnnotation: t.TSType,\n): t.TSParenthesizedType {\n return validateNode({\n type: \"TSParenthesizedType\",\n typeAnnotation,\n });\n}\nexport { tsParenthesizedType as tSParenthesizedType };\nexport function tsTypeOperator(typeAnnotation: t.TSType): t.TSTypeOperator {\n return validateNode({\n type: \"TSTypeOperator\",\n typeAnnotation,\n operator: null,\n });\n}\nexport { tsTypeOperator as tSTypeOperator };\nexport function tsIndexedAccessType(\n objectType: t.TSType,\n indexType: t.TSType,\n): t.TSIndexedAccessType {\n return validateNode({\n type: \"TSIndexedAccessType\",\n objectType,\n indexType,\n });\n}\nexport { tsIndexedAccessType as tSIndexedAccessType };\nexport function tsMappedType(\n typeParameter: t.TSTypeParameter,\n typeAnnotation: t.TSType | null = null,\n nameType: t.TSType | null = null,\n): t.TSMappedType {\n return validateNode({\n type: \"TSMappedType\",\n typeParameter,\n typeAnnotation,\n nameType,\n });\n}\nexport { tsMappedType as tSMappedType };\nexport function tsLiteralType(\n literal:\n | t.NumericLiteral\n | t.StringLiteral\n | t.BooleanLiteral\n | t.BigIntLiteral\n | t.TemplateLiteral\n | t.UnaryExpression,\n): t.TSLiteralType {\n return validateNode({\n type: \"TSLiteralType\",\n literal,\n });\n}\nexport { tsLiteralType as tSLiteralType };\nexport function tsExpressionWithTypeArguments(\n expression: t.TSEntityName,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSExpressionWithTypeArguments {\n return validateNode({\n type: \"TSExpressionWithTypeArguments\",\n expression,\n typeParameters,\n });\n}\nexport { tsExpressionWithTypeArguments as tSExpressionWithTypeArguments };\nexport function tsInterfaceDeclaration(\n id: t.Identifier,\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n _extends: Array | null | undefined = null,\n body: t.TSInterfaceBody,\n): t.TSInterfaceDeclaration {\n return validateNode({\n type: \"TSInterfaceDeclaration\",\n id,\n typeParameters,\n extends: _extends,\n body,\n });\n}\nexport { tsInterfaceDeclaration as tSInterfaceDeclaration };\nexport function tsInterfaceBody(\n body: Array,\n): t.TSInterfaceBody {\n return validateNode({\n type: \"TSInterfaceBody\",\n body,\n });\n}\nexport { tsInterfaceBody as tSInterfaceBody };\nexport function tsTypeAliasDeclaration(\n id: t.Identifier,\n typeParameters: t.TSTypeParameterDeclaration | null | undefined = null,\n typeAnnotation: t.TSType,\n): t.TSTypeAliasDeclaration {\n return validateNode({\n type: \"TSTypeAliasDeclaration\",\n id,\n typeParameters,\n typeAnnotation,\n });\n}\nexport { tsTypeAliasDeclaration as tSTypeAliasDeclaration };\nexport function tsInstantiationExpression(\n expression: t.Expression,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSInstantiationExpression {\n return validateNode({\n type: \"TSInstantiationExpression\",\n expression,\n typeParameters,\n });\n}\nexport { tsInstantiationExpression as tSInstantiationExpression };\nexport function tsAsExpression(\n expression: t.Expression,\n typeAnnotation: t.TSType,\n): t.TSAsExpression {\n return validateNode({\n type: \"TSAsExpression\",\n expression,\n typeAnnotation,\n });\n}\nexport { tsAsExpression as tSAsExpression };\nexport function tsSatisfiesExpression(\n expression: t.Expression,\n typeAnnotation: t.TSType,\n): t.TSSatisfiesExpression {\n return validateNode({\n type: \"TSSatisfiesExpression\",\n expression,\n typeAnnotation,\n });\n}\nexport { tsSatisfiesExpression as tSSatisfiesExpression };\nexport function tsTypeAssertion(\n typeAnnotation: t.TSType,\n expression: t.Expression,\n): t.TSTypeAssertion {\n return validateNode({\n type: \"TSTypeAssertion\",\n typeAnnotation,\n expression,\n });\n}\nexport { tsTypeAssertion as tSTypeAssertion };\nexport function tsEnumDeclaration(\n id: t.Identifier,\n members: Array,\n): t.TSEnumDeclaration {\n return validateNode({\n type: \"TSEnumDeclaration\",\n id,\n members,\n });\n}\nexport { tsEnumDeclaration as tSEnumDeclaration };\nexport function tsEnumMember(\n id: t.Identifier | t.StringLiteral,\n initializer: t.Expression | null = null,\n): t.TSEnumMember {\n return validateNode({\n type: \"TSEnumMember\",\n id,\n initializer,\n });\n}\nexport { tsEnumMember as tSEnumMember };\nexport function tsModuleDeclaration(\n id: t.Identifier | t.StringLiteral,\n body: t.TSModuleBlock | t.TSModuleDeclaration,\n): t.TSModuleDeclaration {\n return validateNode({\n type: \"TSModuleDeclaration\",\n id,\n body,\n });\n}\nexport { tsModuleDeclaration as tSModuleDeclaration };\nexport function tsModuleBlock(body: Array): t.TSModuleBlock {\n return validateNode({\n type: \"TSModuleBlock\",\n body,\n });\n}\nexport { tsModuleBlock as tSModuleBlock };\nexport function tsImportType(\n argument: t.StringLiteral,\n qualifier: t.TSEntityName | null = null,\n typeParameters: t.TSTypeParameterInstantiation | null = null,\n): t.TSImportType {\n return validateNode({\n type: \"TSImportType\",\n argument,\n qualifier,\n typeParameters,\n });\n}\nexport { tsImportType as tSImportType };\nexport function tsImportEqualsDeclaration(\n id: t.Identifier,\n moduleReference: t.TSEntityName | t.TSExternalModuleReference,\n): t.TSImportEqualsDeclaration {\n return validateNode({\n type: \"TSImportEqualsDeclaration\",\n id,\n moduleReference,\n isExport: null,\n });\n}\nexport { tsImportEqualsDeclaration as tSImportEqualsDeclaration };\nexport function tsExternalModuleReference(\n expression: t.StringLiteral,\n): t.TSExternalModuleReference {\n return validateNode({\n type: \"TSExternalModuleReference\",\n expression,\n });\n}\nexport { tsExternalModuleReference as tSExternalModuleReference };\nexport function tsNonNullExpression(\n expression: t.Expression,\n): t.TSNonNullExpression {\n return validateNode({\n type: \"TSNonNullExpression\",\n expression,\n });\n}\nexport { tsNonNullExpression as tSNonNullExpression };\nexport function tsExportAssignment(\n expression: t.Expression,\n): t.TSExportAssignment {\n return validateNode({\n type: \"TSExportAssignment\",\n expression,\n });\n}\nexport { tsExportAssignment as tSExportAssignment };\nexport function tsNamespaceExportDeclaration(\n id: t.Identifier,\n): t.TSNamespaceExportDeclaration {\n return validateNode({\n type: \"TSNamespaceExportDeclaration\",\n id,\n });\n}\nexport { tsNamespaceExportDeclaration as tSNamespaceExportDeclaration };\nexport function tsTypeAnnotation(typeAnnotation: t.TSType): t.TSTypeAnnotation {\n return validateNode({\n type: \"TSTypeAnnotation\",\n typeAnnotation,\n });\n}\nexport { tsTypeAnnotation as tSTypeAnnotation };\nexport function tsTypeParameterInstantiation(\n params: Array,\n): t.TSTypeParameterInstantiation {\n return validateNode({\n type: \"TSTypeParameterInstantiation\",\n params,\n });\n}\nexport { tsTypeParameterInstantiation as tSTypeParameterInstantiation };\nexport function tsTypeParameterDeclaration(\n params: Array,\n): t.TSTypeParameterDeclaration {\n return validateNode({\n type: \"TSTypeParameterDeclaration\",\n params,\n });\n}\nexport { tsTypeParameterDeclaration as tSTypeParameterDeclaration };\nexport function tsTypeParameter(\n constraint: t.TSType | null | undefined = null,\n _default: t.TSType | null | undefined = null,\n name: string,\n): t.TSTypeParameter {\n return validateNode({\n type: \"TSTypeParameter\",\n constraint,\n default: _default,\n name,\n });\n}\nexport { tsTypeParameter as tSTypeParameter };\n/** @deprecated */\nfunction NumberLiteral(value: number) {\n deprecationWarning(\"NumberLiteral\", \"NumericLiteral\", \"The node type \");\n return numericLiteral(value);\n}\nexport { NumberLiteral as numberLiteral };\n/** @deprecated */\nfunction RegexLiteral(pattern: string, flags: string = \"\") {\n deprecationWarning(\"RegexLiteral\", \"RegExpLiteral\", \"The node type \");\n return regExpLiteral(pattern, flags);\n}\nexport { RegexLiteral as regexLiteral };\n/** @deprecated */\nfunction RestProperty(argument: t.LVal) {\n deprecationWarning(\"RestProperty\", \"RestElement\", \"The node type \");\n return restElement(argument);\n}\nexport { RestProperty as restProperty };\n/** @deprecated */\nfunction SpreadProperty(argument: t.Expression) {\n deprecationWarning(\"SpreadProperty\", \"SpreadElement\", \"The node type \");\n return spreadElement(argument);\n}\nexport { SpreadProperty as spreadProperty };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,aAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AACO,SAASE,eAAeA,CAC7BC,QAAsD,GAAG,EAAE,EACxC;EACnB,OAAO,IAAAC,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBF;EACF,CAAC,CAAC;AACJ;AACO,SAASG,oBAAoBA,CAClCC,QAAgB,EAChBC,IAAyC,EACzCC,KAAmB,EACK;EACxB,OAAO,IAAAL,qBAAY,EAAyB;IAC1CC,IAAI,EAAE,sBAAsB;IAC5BE,QAAQ;IACRC,IAAI;IACJC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,gBAAgBA,CAC9BH,QAuBQ,EACRC,IAAkC,EAClCC,KAAmB,EACC;EACpB,OAAO,IAAAL,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBE,QAAQ;IACRC,IAAI;IACJC;EACF,CAAC,CAAC;AACJ;AACO,SAASE,oBAAoBA,CAACC,KAAa,EAA0B;EAC1E,OAAO,IAAAR,qBAAY,EAAyB;IAC1CC,IAAI,EAAE,sBAAsB;IAC5BO;EACF,CAAC,CAAC;AACJ;AACO,SAASC,SAASA,CAACD,KAAyB,EAAe;EAChE,OAAO,IAAAR,qBAAY,EAAc;IAC/BC,IAAI,EAAE,WAAW;IACjBO;EACF,CAAC,CAAC;AACJ;AACO,SAASE,gBAAgBA,CAACF,KAAa,EAAsB;EAClE,OAAO,IAAAR,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBO;EACF,CAAC,CAAC;AACJ;AACO,SAASG,cAAcA,CAC5BC,IAAwB,EACxBC,UAA8B,GAAG,EAAE,EACjB;EAClB,OAAO,IAAAb,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBW,IAAI;IACJC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,cAAcA,CAC5BC,KAA0B,GAAG,IAAI,EACf;EAClB,OAAO,IAAAf,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBc;EACF,CAAC,CAAC;AACJ;AACO,SAASC,cAAcA,CAC5BC,MAAwD,EACxDC,UAEC,EACiB;EAClB,OAAO,IAAAlB,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBgB,MAAM;IACNE,SAAS,EAAED;EACb,CAAC,CAAC;AACJ;AACO,SAASE,WAAWA,CACzBC,KAKa,GAAG,IAAI,EACpBT,IAAsB,EACP;EACf,OAAO,IAAAZ,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnBoB,KAAK;IACLT;EACF,CAAC,CAAC;AACJ;AACO,SAASU,qBAAqBA,CACnCC,IAAkB,EAClBC,UAAwB,EACxBC,SAAuB,EACE;EACzB,OAAO,IAAAzB,qBAAY,EAA0B;IAC3CC,IAAI,EAAE,uBAAuB;IAC7BsB,IAAI;IACJC,UAAU;IACVC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,iBAAiBA,CAC/BX,KAA0B,GAAG,IAAI,EACZ;EACrB,OAAO,IAAAf,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBc;EACF,CAAC,CAAC;AACJ;AACO,SAASY,iBAAiBA,CAAA,EAAwB;EACvD,OAAO;IACL1B,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAAS2B,gBAAgBA,CAC9BL,IAAkB,EAClBX,IAAiB,EACG;EACpB,OAAO,IAAAZ,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBsB,IAAI;IACJX;EACF,CAAC,CAAC;AACJ;AACO,SAASiB,cAAcA,CAAA,EAAqB;EACjD,OAAO;IACL5B,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAAS6B,mBAAmBA,CACjCC,UAAwB,EACD;EACvB,OAAO,IAAA/B,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3B8B;EACF,CAAC,CAAC;AACJ;AACO,SAASC,IAAIA,CAClBC,OAAkB,EAClBC,QAAsD,GAAG,IAAI,EAC7DC,MAAyB,GAAG,IAAI,EACxB;EACR,OAAO,IAAAnC,qBAAY,EAAS;IAC1BC,IAAI,EAAE,MAAM;IACZgC,OAAO;IACPC,QAAQ;IACRC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,cAAcA,CAC5BhC,IAAoC,EACpCC,KAAmB,EACnBO,IAAiB,EACC;EAClB,OAAO,IAAAZ,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBG,IAAI;IACJC,KAAK;IACLO;EACF,CAAC,CAAC;AACJ;AACO,SAASyB,YAAYA,CAC1BC,IAA6D,GAAG,IAAI,EACpEf,IAAqC,GAAG,IAAI,EAC5CgB,MAAuC,GAAG,IAAI,EAC9C3B,IAAiB,EACD;EAChB,OAAO,IAAAZ,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpBqC,IAAI;IACJf,IAAI;IACJgB,MAAM;IACN3B;EACF,CAAC,CAAC;AACJ;AACO,SAAS4B,mBAAmBA,CACjCC,EAAmC,GAAG,IAAI,EAC1CC,MAAuD,EACvD9B,IAAsB,EACtB+B,SAAkB,GAAG,KAAK,EAC1BC,KAAc,GAAG,KAAK,EACC;EACvB,OAAO,IAAA5C,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3BwC,EAAE;IACFC,MAAM;IACN9B,IAAI;IACJ+B,SAAS;IACTC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,kBAAkBA,CAChCJ,EAAmC,GAAG,IAAI,EAC1CC,MAAuD,EACvD9B,IAAsB,EACtB+B,SAAkB,GAAG,KAAK,EAC1BC,KAAc,GAAG,KAAK,EACA;EACtB,OAAO,IAAA5C,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1BwC,EAAE;IACFC,MAAM;IACN9B,IAAI;IACJ+B,SAAS;IACTC;EACF,CAAC,CAAC;AACJ;AACO,SAASE,UAAUA,CAACC,IAAY,EAAgB;EACrD,OAAO,IAAA/C,qBAAY,EAAe;IAChCC,IAAI,EAAE,YAAY;IAClB8C;EACF,CAAC,CAAC;AACJ;AACO,SAASC,WAAWA,CACzBzB,IAAkB,EAClBC,UAAuB,EACvBC,SAA6B,GAAG,IAAI,EACrB;EACf,OAAO,IAAAzB,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnBsB,IAAI;IACJC,UAAU;IACVC;EACF,CAAC,CAAC;AACJ;AACO,SAASwB,gBAAgBA,CAC9BlC,KAAmB,EACnBH,IAAiB,EACG;EACpB,OAAO,IAAAZ,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBc,KAAK;IACLH;EACF,CAAC,CAAC;AACJ;AACO,SAASsC,aAAaA,CAAC1C,KAAa,EAAmB;EAC5D,OAAO,IAAAR,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBO;EACF,CAAC,CAAC;AACJ;AACO,SAAS2C,cAAcA,CAAC3C,KAAa,EAAoB;EAC9D,OAAO,IAAAR,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBO;EACF,CAAC,CAAC;AACJ;AACO,SAAS4C,WAAWA,CAAA,EAAkB;EAC3C,OAAO;IACLnD,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASoD,cAAcA,CAAC7C,KAAc,EAAoB;EAC/D,OAAO,IAAAR,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBO;EACF,CAAC,CAAC;AACJ;AACO,SAAS8C,aAAaA,CAC3BC,OAAe,EACfC,KAAa,GAAG,EAAE,EACD;EACjB,OAAO,IAAAxD,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBsD,OAAO;IACPC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,iBAAiBA,CAC/BtD,QAA4B,EAC5BC,IAAkB,EAClBC,KAAmB,EACE;EACrB,OAAO,IAAAL,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBE,QAAQ;IACRC,IAAI;IACJC;EACF,CAAC,CAAC;AACJ;AACO,SAASqD,gBAAgBA,CAC9BC,MAA8B,EAC9BC,QAAqD,EACrDC,QAAiB,GAAG,KAAK,EACzBC,QAA6B,GAAG,IAAI,EAChB;EACpB,OAAO,IAAA9D,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxB0D,MAAM;IACNC,QAAQ;IACRC,QAAQ;IACRC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,aAAaA,CAC3B9C,MAAwD,EACxDC,UAEC,EACgB;EACjB,OAAO,IAAAlB,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBgB,MAAM;IACNE,SAAS,EAAED;EACb,CAAC,CAAC;AACJ;AACO,SAASe,OAAOA,CACrBrB,IAAwB,EACxBC,UAA8B,GAAG,EAAE,EACnCmD,UAA+B,GAAG,QAAQ,EAC1CC,WAA0C,GAAG,IAAI,EACtC;EACX,OAAO,IAAAjE,qBAAY,EAAY;IAC7BC,IAAI,EAAE,SAAS;IACfW,IAAI;IACJC,UAAU;IACVmD,UAAU;IACVC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,gBAAgBA,CAC9BC,UAAsE,EAClD;EACpB,OAAO,IAAAnE,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBkE;EACF,CAAC,CAAC;AACJ;AACO,SAASC,YAAYA,CAC1BC,IAA0C,GAAG,QAAQ,EACrDC,GAKmB,EACnB5B,MAAuD,EACvD9B,IAAsB,EACtBiD,QAAiB,GAAG,KAAK,EACzBlB,SAAkB,GAAG,KAAK,EAC1BC,KAAc,GAAG,KAAK,EACN;EAChB,OAAO,IAAA5C,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpBoE,IAAI;IACJC,GAAG;IACH5B,MAAM;IACN9B,IAAI;IACJiD,QAAQ;IACRlB,SAAS;IACTC;EACF,CAAC,CAAC;AACJ;AACO,SAAS2B,cAAcA,CAC5BD,GAOiB,EACjB9D,KAAmC,EACnCqD,QAAiB,GAAG,KAAK,EACzBW,SAAkB,GAAG,KAAK,EAC1BC,UAAqC,GAAG,IAAI,EAC1B;EAClB,OAAO,IAAAzE,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBqE,GAAG;IACH9D,KAAK;IACLqD,QAAQ;IACRW,SAAS;IACTC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,WAAWA,CAACC,QAAgB,EAAiB;EAC3D,OAAO,IAAA3E,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnB0E;EACF,CAAC,CAAC;AACJ;AACO,SAASC,eAAeA,CAC7BD,QAA6B,GAAG,IAAI,EACjB;EACnB,OAAO,IAAA3E,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvB0E;EACF,CAAC,CAAC;AACJ;AACO,SAASE,kBAAkBA,CAChCC,WAAgC,EACV;EACtB,OAAO,IAAA9E,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1B6E;EACF,CAAC,CAAC;AACJ;AACO,SAASC,uBAAuBA,CACrChD,UAAwB,EACG;EAC3B,OAAO,IAAA/B,qBAAY,EAA4B;IAC7CC,IAAI,EAAE,yBAAyB;IAC/B8B;EACF,CAAC,CAAC;AACJ;AACO,SAASiD,UAAUA,CACxBzD,IAAqC,GAAG,IAAI,EAC5CC,UAA8B,EAChB;EACd,OAAO,IAAAxB,qBAAY,EAAe;IAChCC,IAAI,EAAE,YAAY;IAClBsB,IAAI;IACJC;EACF,CAAC,CAAC;AACJ;AACO,SAASyD,eAAeA,CAC7BC,YAA0B,EAC1BC,KAA0B,EACP;EACnB,OAAO,IAAAnF,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBiF,YAAY;IACZC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,cAAcA,CAAA,EAAqB;EACjD,OAAO;IACLnF,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASoF,cAAcA,CAACV,QAAsB,EAAoB;EACvE,OAAO,IAAA3E,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtB0E;EACF,CAAC,CAAC;AACJ;AACO,SAASW,YAAYA,CAC1BC,KAAuB,EACvBC,OAA6B,GAAG,IAAI,EACpCC,SAAkC,GAAG,IAAI,EACzB;EAChB,OAAO,IAAAzF,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpBsF,KAAK;IACLC,OAAO;IACPC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,eAAeA,CAC7BvF,QAAwE,EACxEwE,QAAsB,EACtBgB,MAAe,GAAG,IAAI,EACH;EACnB,OAAO,IAAA3F,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBE,QAAQ;IACRwE,QAAQ;IACRgB;EACF,CAAC,CAAC;AACJ;AACO,SAASC,gBAAgBA,CAC9BzF,QAAqB,EACrBwE,QAAsB,EACtBgB,MAAe,GAAG,KAAK,EACH;EACpB,OAAO,IAAA3F,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBE,QAAQ;IACRwE,QAAQ;IACRgB;EACF,CAAC,CAAC;AACJ;AACO,SAASE,mBAAmBA,CACjCxB,IAAuD,EACvDyB,YAAyC,EAClB;EACvB,OAAO,IAAA9F,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3BoE,IAAI;IACJyB;EACF,CAAC,CAAC;AACJ;AACO,SAASC,kBAAkBA,CAChCtD,EAAU,EACVH,IAAyB,GAAG,IAAI,EACV;EACtB,OAAO,IAAAtC,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1BwC,EAAE;IACFH;EACF,CAAC,CAAC;AACJ;AACO,SAAS0D,cAAcA,CAC5BzE,IAAkB,EAClBX,IAAiB,EACC;EAClB,OAAO,IAAAZ,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBsB,IAAI;IACJX;EACF,CAAC,CAAC;AACJ;AACO,SAASqF,aAAaA,CAC3BtC,MAAoB,EACpB/C,IAAiB,EACA;EACjB,OAAO,IAAAZ,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrB0D,MAAM;IACN/C;EACF,CAAC,CAAC;AACJ;AACO,SAASsF,iBAAiBA,CAC/B9F,IAQyB,EACzBC,KAAmB,EACE;EACrB,OAAO,IAAAL,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBG,IAAI;IACJC;EACF,CAAC,CAAC;AACJ;AACO,SAAS8F,YAAYA,CAC1BpG,QAA8C,EAC9B;EAChB,OAAO,IAAAC,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpBF;EACF,CAAC,CAAC;AACJ;AACO,SAASqG,uBAAuBA,CACrC1D,MAAuD,EACvD9B,IAAqC,EACrCgC,KAAc,GAAG,KAAK,EACK;EAC3B,OAAO,IAAA5C,qBAAY,EAA4B;IAC7CC,IAAI,EAAE,yBAAyB;IAC/ByC,MAAM;IACN9B,IAAI;IACJgC,KAAK;IACLb,UAAU,EAAE;EACd,CAAC,CAAC;AACJ;AACO,SAASsE,SAASA,CACvBzF,IASC,EACY;EACb,OAAO,IAAAZ,qBAAY,EAAc;IAC/BC,IAAI,EAAE,WAAW;IACjBW;EACF,CAAC,CAAC;AACJ;AACO,SAAS0F,eAAeA,CAC7B7D,EAAmC,GAAG,IAAI,EAC1C8D,UAA2C,GAAG,IAAI,EAClD3F,IAAiB,EACjB6D,UAAqC,GAAG,IAAI,EACzB;EACnB,OAAO,IAAAzE,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBwC,EAAE;IACF8D,UAAU;IACV3F,IAAI;IACJ6D;EACF,CAAC,CAAC;AACJ;AACO,SAAS+B,gBAAgBA,CAC9B/D,EAAmC,GAAG,IAAI,EAC1C8D,UAA2C,GAAG,IAAI,EAClD3F,IAAiB,EACjB6D,UAAqC,GAAG,IAAI,EACxB;EACpB,OAAO,IAAAzE,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBwC,EAAE;IACF8D,UAAU;IACV3F,IAAI;IACJ6D;EACF,CAAC,CAAC;AACJ;AACO,SAASgC,oBAAoBA,CAClCC,MAAuB,EACC;EACxB,OAAO,IAAA1G,qBAAY,EAAyB;IAC1CC,IAAI,EAAE,sBAAsB;IAC5ByG;EACF,CAAC,CAAC;AACJ;AACO,SAASC,wBAAwBA,CACtCC,WAIgB,EACY;EAC5B,OAAO,IAAA5G,qBAAY,EAA6B;IAC9CC,IAAI,EAAE,0BAA0B;IAChC2G;EACF,CAAC,CAAC;AACJ;AACO,SAASC,sBAAsBA,CACpCD,WAAiC,GAAG,IAAI,EACxCE,UAEC,GAAG,EAAE,EACNJ,MAA8B,GAAG,IAAI,EACX;EAC1B,OAAO,IAAA1G,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9B2G,WAAW;IACXE,UAAU;IACVJ;EACF,CAAC,CAAC;AACJ;AACO,SAASK,eAAeA,CAC7BC,KAAmB,EACnBC,QAAwC,EACrB;EACnB,OAAO,IAAAjH,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvB+G,KAAK;IACLC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,cAAcA,CAC5B9G,IAAoC,EACpCC,KAAmB,EACnBO,IAAiB,EACjBuG,MAAe,GAAG,KAAK,EACL;EAClB,OAAO,IAAAnH,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBG,IAAI;IACJC,KAAK;IACLO,IAAI;IACJwG,KAAK,EAAED;EACT,CAAC,CAAC;AACJ;AACO,SAASE,iBAAiBA,CAC/BP,UAEC,EACDJ,MAAuB,EACF;EACrB,OAAO,IAAA1G,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzB6G,UAAU;IACVJ;EACF,CAAC,CAAC;AACJ;AACO,SAASY,sBAAsBA,CACpCN,KAAmB,EACO;EAC1B,OAAO,IAAAhH,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9B+G;EACF,CAAC,CAAC;AACJ;AACO,SAASO,wBAAwBA,CACtCP,KAAmB,EACS;EAC5B,OAAO,IAAAhH,qBAAY,EAA6B;IAC9CC,IAAI,EAAE,0BAA0B;IAChC+G;EACF,CAAC,CAAC;AACJ;AACO,SAASQ,eAAeA,CAC7BR,KAAmB,EACnBS,QAAwC,EACrB;EACnB,OAAO,IAAAzH,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvB+G,KAAK;IACLS;EACF,CAAC,CAAC;AACJ;AACO,SAASC,gBAAgBA,CAC9BhB,MAAoB,EACpBiB,OAA4B,GAAG,IAAI,EACf;EACpB,OAAO,IAAA3H,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxByG,MAAM;IACNiB;EACF,CAAC,CAAC;AACJ;AACO,SAASC,YAAYA,CAC1BC,IAAkB,EAClBjE,QAAsB,EACN;EAChB,OAAO,IAAA5D,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpB4H,IAAI;IACJjE;EACF,CAAC,CAAC;AACJ;AACO,SAASkE,WAAWA,CACzBzD,IAA0D,GAAG,QAAQ,EACrEC,GAKgB,EAChB5B,MAEC,EACD9B,IAAsB,EACtBiD,QAAiB,GAAG,KAAK,EACzBkE,OAAgB,GAAG,KAAK,EACxBpF,SAAkB,GAAG,KAAK,EAC1BC,KAAc,GAAG,KAAK,EACP;EACf,OAAO,IAAA5C,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnBoE,IAAI;IACJC,GAAG;IACH5B,MAAM;IACN9B,IAAI;IACJiD,QAAQ;IACRmE,MAAM,EAAED,OAAO;IACfpF,SAAS;IACTC;EACF,CAAC,CAAC;AACJ;AACO,SAASqF,aAAaA,CAC3B9D,UAAmD,EAClC;EACjB,OAAO,IAAAnE,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBkE;EACF,CAAC,CAAC;AACJ;AACO,SAAS+D,aAAaA,CAACvD,QAAsB,EAAmB;EACrE,OAAO,IAAA3E,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrB0E;EACF,CAAC,CAAC;AACJ;AACA,SAASwD,MAAMA,CAAA,EAAY;EACzB,OAAO;IACLlI,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASmI,wBAAwBA,CACtCC,GAAiB,EACjBC,KAAwB,EACI;EAC5B,OAAO,IAAAtI,qBAAY,EAA6B;IAC9CC,IAAI,EAAE,0BAA0B;IAChCoI,GAAG;IACHC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,eAAeA,CAC7B/H,KAAuC,EACvCgI,IAAa,GAAG,KAAK,EACF;EACnB,OAAO,IAAAxI,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBO,KAAK;IACLgI;EACF,CAAC,CAAC;AACJ;AACO,SAASC,eAAeA,CAC7BC,MAAgC,EAChC5D,WAA2C,EACxB;EACnB,OAAO,IAAA9E,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvByI,MAAM;IACN5D;EACF,CAAC,CAAC;AACJ;AACO,SAAS6D,eAAeA,CAC7BhE,QAA6B,GAAG,IAAI,EACpCiE,QAAiB,GAAG,KAAK,EACN;EACnB,OAAO,IAAA5I,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvB0E,QAAQ;IACRiE;EACF,CAAC,CAAC;AACJ;AACO,SAASC,eAAeA,CAAClE,QAAsB,EAAqB;EACzE,OAAO,IAAA3E,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvB0E;EACF,CAAC,CAAC;AACJ;AACA,SAASmE,OAAOA,CAAA,EAAa;EAC3B,OAAO;IACL7I,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAAS8I,aAAaA,CAACvI,KAAa,EAAmB;EAC5D,OAAO,IAAAR,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBO;EACF,CAAC,CAAC;AACJ;AACO,SAASwI,wBAAwBA,CACtC/B,QAAsB,EACM;EAC5B,OAAO,IAAAjH,qBAAY,EAA6B;IAC9CC,IAAI,EAAE,0BAA0B;IAChCgH;EACF,CAAC,CAAC;AACJ;AACO,SAASgC,wBAAwBA,CACtCtF,MAAoB,EACpBC,QAAqC,EACrCC,QAA6B,GAAG,KAAK,EACrCC,QAAiB,EACW;EAC5B,OAAO,IAAA9D,qBAAY,EAA6B;IAC9CC,IAAI,EAAE,0BAA0B;IAChC0D,MAAM;IACNC,QAAQ;IACRC,QAAQ;IACRC;EACF,CAAC,CAAC;AACJ;AACO,SAASoF,sBAAsBA,CACpCjI,MAAoB,EACpBC,UAEC,EACD4C,QAAiB,EACS;EAC1B,OAAO,IAAA9D,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9BgB,MAAM;IACNE,SAAS,EAAED,UAAU;IACrB4C;EACF,CAAC,CAAC;AACJ;AACO,SAASqF,aAAaA,CAC3B7E,GAKgB,EAChB9D,KAA0B,GAAG,IAAI,EACjC4I,cAAqE,GAAG,IAAI,EAC5E3E,UAAqC,GAAG,IAAI,EAC5CZ,QAAiB,GAAG,KAAK,EACzBkE,OAAgB,GAAG,KAAK,EACP;EACjB,OAAO,IAAA/H,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBqE,GAAG;IACH9D,KAAK;IACL4I,cAAc;IACd3E,UAAU;IACVZ,QAAQ;IACRmE,MAAM,EAAED;EACV,CAAC,CAAC;AACJ;AACO,SAASsB,qBAAqBA,CACnC/E,GAMiB,EACjB9D,KAA0B,GAAG,IAAI,EACjC4I,cAAqE,GAAG,IAAI,EAC5E3E,UAAqC,GAAG,IAAI,EAC5CZ,QAAiB,GAAG,KAAK,EACzBkE,OAAgB,GAAG,KAAK,EACC;EACzB,OAAO,IAAA/H,qBAAY,EAA0B;IAC3CC,IAAI,EAAE,uBAAuB;IAC7BqE,GAAG;IACH9D,KAAK;IACL4I,cAAc;IACd3E,UAAU;IACVZ,QAAQ;IACRmE,MAAM,EAAED;EACV,CAAC,CAAC;AACJ;AACO,SAASuB,oBAAoBA,CAClChF,GAAkB,EAClB9D,KAA0B,GAAG,IAAI,EACjCiE,UAAqC,GAAG,IAAI,EAC5CsD,OAAgB,GAAG,KAAK,EACA;EACxB,OAAO,IAAA/H,qBAAY,EAAyB;IAC1CC,IAAI,EAAE,sBAAsB;IAC5BqE,GAAG;IACH9D,KAAK;IACLiE,UAAU;IACVuD,MAAM,EAAED;EACV,CAAC,CAAC;AACJ;AACO,SAASwB,kBAAkBA,CAChClF,IAA0C,GAAG,QAAQ,EACrDC,GAAkB,EAClB5B,MAEC,EACD9B,IAAsB,EACtBmH,OAAgB,GAAG,KAAK,EACF;EACtB,OAAO,IAAA/H,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1BoE,IAAI;IACJC,GAAG;IACH5B,MAAM;IACN9B,IAAI;IACJoH,MAAM,EAAED;EACV,CAAC,CAAC;AACJ;AACO,SAASyB,WAAWA,CAAC/G,EAAgB,EAAiB;EAC3D,OAAO,IAAAzC,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnBwC;EACF,CAAC,CAAC;AACJ;AACO,SAASgH,WAAWA,CAAC7I,IAAwB,EAAiB;EACnE,OAAO,IAAAZ,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnBW;EACF,CAAC,CAAC;AACJ;AACO,SAAS8I,iBAAiBA,CAAA,EAAwB;EACvD,OAAO;IACLzJ,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAAS0J,mBAAmBA,CACjCC,WAAuB,EACA;EACvB,OAAO,IAAA5J,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3B2J;EACF,CAAC,CAAC;AACJ;AACO,SAASC,qBAAqBA,CAAA,EAA4B;EAC/D,OAAO;IACL5J,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAAS6J,4BAA4BA,CAC1CtJ,KAAc,EACkB;EAChC,OAAO,IAAAR,qBAAY,EAAiC;IAClDC,IAAI,EAAE,8BAA8B;IACpCO;EACF,CAAC,CAAC;AACJ;AACO,SAASuJ,yBAAyBA,CAAA,EAAgC;EACvE,OAAO;IACL9J,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAAS+J,eAAeA,CAC7BvH,EAAgB,EAChBwH,cAAmD,GAAG,IAAI,EACvC;EACnB,OAAO,IAAAjK,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBwC,EAAE;IACFwH;EACF,CAAC,CAAC;AACJ;AACO,SAASC,YAAYA,CAC1BzH,EAAgB,EAChBwH,cAA6D,GAAG,IAAI,EACpEE,QAAsD,GAAG,IAAI,EAC7DvJ,IAA4B,EACZ;EAChB,OAAO,IAAAZ,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpBwC,EAAE;IACFwH,cAAc;IACdG,OAAO,EAAED,QAAQ;IACjBvJ;EACF,CAAC,CAAC;AACJ;AACO,SAASyJ,eAAeA,CAAC5H,EAAgB,EAAqB;EACnE,OAAO,IAAAzC,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBwC;EACF,CAAC,CAAC;AACJ;AACO,SAAS6H,gBAAgBA,CAC9B7H,EAAgB,EAChBwH,cAA6D,GAAG,IAAI,EACpEE,QAAsD,GAAG,IAAI,EAC7DvJ,IAA4B,EACR;EACpB,OAAO,IAAAZ,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBwC,EAAE;IACFwH,cAAc;IACdG,OAAO,EAAED,QAAQ;IACjBvJ;EACF,CAAC,CAAC;AACJ;AACO,SAAS2J,aAAaA,CAC3B9H,EAAkC,EAClC7B,IAAsB,EACtByD,IAA8B,GAAG,IAAI,EACpB;EACjB,OAAO,IAAArE,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBwC,EAAE;IACF7B,IAAI;IACJyD;EACF,CAAC,CAAC;AACJ;AACO,SAASmG,oBAAoBA,CAClCpB,cAAgC,EACR;EACxB,OAAO,IAAApJ,qBAAY,EAAyB;IAC1CC,IAAI,EAAE,sBAAsB;IAC5BmJ;EACF,CAAC,CAAC;AACJ;AACO,SAASqB,gBAAgBA,CAC9BhI,EAAgB,EAChBwH,cAA6D,GAAG,IAAI,EACpE5J,KAAiB,EACG;EACpB,OAAO,IAAAL,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBwC,EAAE;IACFwH,cAAc;IACd5J;EACF,CAAC,CAAC;AACJ;AACO,SAASqK,iBAAiBA,CAC/BjI,EAAgB,EAChBwH,cAAiD,GAAG,IAAI,EACxDU,SAA4B,GAAG,IAAI,EACd;EACrB,OAAO,IAAA3K,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBwC,EAAE;IACFwH,cAAc;IACdU;EACF,CAAC,CAAC;AACJ;AACO,SAASC,eAAeA,CAACnI,EAAgB,EAAqB;EACnE,OAAO,IAAAzC,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBwC;EACF,CAAC,CAAC;AACJ;AACO,SAASoI,wBAAwBA,CACtCjE,WAA0B,GAAG,IAAI,EACjCE,UAEQ,GAAG,IAAI,EACfJ,MAA8B,GAAG,IAAI,EACT;EAC5B,OAAO,IAAA1G,qBAAY,EAA6B;IAC9CC,IAAI,EAAE,0BAA0B;IAChC2G,WAAW;IACXE,UAAU;IACVJ;EACF,CAAC,CAAC;AACJ;AACO,SAASoE,2BAA2BA,CACzCpE,MAAuB,EACQ;EAC/B,OAAO,IAAA1G,qBAAY,EAAgC;IACjDC,IAAI,EAAE,6BAA6B;IACnCyG;EACF,CAAC,CAAC;AACJ;AACO,SAASqE,iBAAiBA,CAACvK,KAAa,EAAuB;EACpE,OAAO,IAAAR,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBO;EACF,CAAC,CAAC;AACJ;AACO,SAASwK,oBAAoBA,CAAA,EAA2B;EAC7D,OAAO;IACL/K,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASgL,sBAAsBA,CACpChB,cAA6D,GAAG,IAAI,EACpEvH,MAAkC,EAClCwI,IAA4C,GAAG,IAAI,EACnDC,UAAsB,EACI;EAC1B,OAAO,IAAAnL,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9BgK,cAAc;IACdvH,MAAM;IACNwI,IAAI;IACJC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,iBAAiBA,CAC/BrI,IAAqC,GAAG,IAAI,EAC5CqG,cAA0B,EACL;EACrB,OAAO,IAAApJ,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzB8C,IAAI;IACJqG;EACF,CAAC,CAAC;AACJ;AACO,SAASiC,qBAAqBA,CACnC5I,EAA4C,EAC5CwH,cAAmD,GAAG,IAAI,EACjC;EACzB,OAAO,IAAAjK,qBAAY,EAA0B;IAC3CC,IAAI,EAAE,uBAAuB;IAC7BwC,EAAE;IACFwH;EACF,CAAC,CAAC;AACJ;AACO,SAASqB,iBAAiBA,CAAA,EAAwB;EACvD,OAAO;IACLrL,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASsL,gBAAgBA,CAC9B9I,EAA4C,EAC5CwH,cAAmD,GAAG,IAAI,EACtC;EACpB,OAAO,IAAAjK,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBwC,EAAE;IACFwH;EACF,CAAC,CAAC;AACJ;AACO,SAASuB,oBAAoBA,CAClC/I,EAAgB,EAChBwH,cAA6D,GAAG,IAAI,EACpEE,QAAsD,GAAG,IAAI,EAC7DvJ,IAA4B,EACJ;EACxB,OAAO,IAAAZ,qBAAY,EAAyB;IAC1CC,IAAI,EAAE,sBAAsB;IAC5BwC,EAAE;IACFwH,cAAc;IACdG,OAAO,EAAED,QAAQ;IACjBvJ;EACF,CAAC,CAAC;AACJ;AACO,SAAS6K,uBAAuBA,CACrCtB,QAAsD,GAAG,IAAI,EAC7DvJ,IAA4B,EACD;EAC3B,OAAO,IAAAZ,qBAAY,EAA4B;IAC7CC,IAAI,EAAE,yBAAyB;IAC/BmK,OAAO,EAAED,QAAQ;IACjBvJ;EACF,CAAC,CAAC;AACJ;AACO,SAAS8K,0BAA0BA,CACxCC,KAAwB,EACM;EAC9B,OAAO,IAAA3L,qBAAY,EAA+B;IAChDC,IAAI,EAAE,4BAA4B;IAClC0L;EACF,CAAC,CAAC;AACJ;AACO,SAASC,mBAAmBA,CAAA,EAA0B;EAC3D,OAAO;IACL3L,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAAS4L,mBAAmBA,CAAA,EAA0B;EAC3D,OAAO;IACL5L,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAAS6L,sBAAsBA,CACpC1C,cAA0B,EACA;EAC1B,OAAO,IAAApJ,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9BmJ;EACF,CAAC,CAAC;AACJ;AACO,SAAS2C,2BAA2BA,CACzCvL,KAAa,EACkB;EAC/B,OAAO,IAAAR,qBAAY,EAAgC;IACjDC,IAAI,EAAE,6BAA6B;IACnCO;EACF,CAAC,CAAC;AACJ;AACO,SAASwL,oBAAoBA,CAAA,EAA2B;EAC7D,OAAO;IACL/L,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASgM,oBAAoBA,CAClC9H,UAAoE,EACpE+H,QAAoC,GAAG,EAAE,EACzCC,cAA+C,GAAG,EAAE,EACpDC,aAA8C,GAAG,EAAE,EACnDC,KAAc,GAAG,KAAK,EACE;EACxB,OAAO,IAAArM,qBAAY,EAAyB;IAC1CC,IAAI,EAAE,sBAAsB;IAC5BkE,UAAU;IACV+H,QAAQ;IACRC,cAAc;IACdC,aAAa;IACbC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,sBAAsBA,CACpC7J,EAAgB,EAChBjC,KAAiB,EACjBsD,QAAiB,EACjBiE,OAAgB,EAChBwE,MAAe,EACW;EAC1B,OAAO,IAAAvM,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9BwC,EAAE;IACFjC,KAAK;IACLsD,QAAQ;IACRkE,MAAM,EAAED,OAAO;IACfwE;EACF,CAAC,CAAC;AACJ;AACO,SAASC,sBAAsBA,CACpChM,KAAiB,EACS;EAC1B,OAAO,IAAAR,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9BO,KAAK;IACLwH,MAAM,EAAE;EACV,CAAC,CAAC;AACJ;AACO,SAASyE,iBAAiBA,CAC/BhK,EAAmC,GAAG,IAAI,EAC1C6B,GAAe,EACf9D,KAAiB,EACjBkM,QAA2B,GAAG,IAAI,EACb;EACrB,OAAO,IAAA1M,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBwC,EAAE;IACF6B,GAAG;IACH9D,KAAK;IACLkM,QAAQ;IACR1E,MAAM,EAAE;EACV,CAAC,CAAC;AACJ;AACO,SAAS2E,kBAAkBA,CAChCrI,GAAmC,EACnC9D,KAAiB,EACjBkM,QAA2B,GAAG,IAAI,EACZ;EACtB,OAAO,IAAA1M,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1BqE,GAAG;IACH9D,KAAK;IACLkM,QAAQ;IACRrI,IAAI,EAAE,IAAI;IACVkI,MAAM,EAAE,IAAI;IACZzI,QAAQ,EAAE,IAAI;IACd8I,KAAK,EAAE,IAAI;IACX5E,MAAM,EAAE;EACV,CAAC,CAAC;AACJ;AACO,SAAS6E,wBAAwBA,CACtClI,QAAoB,EACQ;EAC5B,OAAO,IAAA3E,qBAAY,EAA6B;IAC9CC,IAAI,EAAE,0BAA0B;IAChC0E;EACF,CAAC,CAAC;AACJ;AACO,SAASmI,UAAUA,CACxBrK,EAAgB,EAChBwH,cAA6D,GAAG,IAAI,EACpEU,SAAwC,GAAG,IAAI,EAC/CoC,QAAoB,EACN;EACd,OAAO,IAAA/M,qBAAY,EAAe;IAChCC,IAAI,EAAE,YAAY;IAClBwC,EAAE;IACFwH,cAAc;IACdU,SAAS;IACToC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,uBAAuBA,CACrCvK,EAAgB,EAChBwK,aAAuD,EAC5B;EAC3B,OAAO,IAAAjN,qBAAY,EAA4B;IAC7CC,IAAI,EAAE,yBAAyB;IAC/BwC,EAAE;IACFwK;EACF,CAAC,CAAC;AACJ;AACO,SAASC,2BAA2BA,CACzC1M,KAAa,EACkB;EAC/B,OAAO,IAAAR,qBAAY,EAAgC;IACjDC,IAAI,EAAE,6BAA6B;IACnCO;EACF,CAAC,CAAC;AACJ;AACO,SAAS2M,oBAAoBA,CAAA,EAA2B;EAC7D,OAAO;IACLlN,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASmN,oBAAoBA,CAAA,EAA2B;EAC7D,OAAO;IACLnN,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASoN,kBAAkBA,CAAA,EAAyB;EACzD,OAAO;IACLpN,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASqN,mBAAmBA,CACjC3B,KAAwB,EACD;EACvB,OAAO,IAAA3L,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3B0L;EACF,CAAC,CAAC;AACJ;AACO,SAAS4B,oBAAoBA,CAClC5I,QAAoB,EACI;EACxB,OAAO,IAAA3E,qBAAY,EAAyB;IAC1CC,IAAI,EAAE,sBAAsB;IAC5B0E;EACF,CAAC,CAAC;AACJ;AACO,SAAS6I,SAASA,CACvB/K,EAAgB,EAChBwH,cAA6D,GAAG,IAAI,EACpE5J,KAAiB,EACJ;EACb,OAAO,IAAAL,qBAAY,EAAc;IAC/BC,IAAI,EAAE,WAAW;IACjBwC,EAAE;IACFwH,cAAc;IACd5J;EACF,CAAC,CAAC;AACJ;AACO,SAAS+I,cAAcA,CAACA,cAA0B,EAAoB;EAC3E,OAAO,IAAApJ,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBmJ;EACF,CAAC,CAAC;AACJ;AACO,SAASqE,kBAAkBA,CAChC1L,UAAwB,EACxBqH,cAAgC,EACV;EACtB,OAAO,IAAApJ,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1B8B,UAAU;IACVqH;EACF,CAAC,CAAC;AACJ;AACO,SAASsE,aAAaA,CAC3BC,KAA8B,GAAG,IAAI,EACrCC,QAA2B,GAAG,IAAI,EAClClB,QAA2B,GAAG,IAAI,EACjB;EACjB,OAAO,IAAA1M,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrB0N,KAAK;IACLE,OAAO,EAAED,QAAQ;IACjBlB,QAAQ;IACR3J,IAAI,EAAE;EACR,CAAC,CAAC;AACJ;AACO,SAAS+K,wBAAwBA,CACtCpL,MAA8B,EACF;EAC5B,OAAO,IAAA1C,qBAAY,EAA6B;IAC9CC,IAAI,EAAE,0BAA0B;IAChCyC;EACF,CAAC,CAAC;AACJ;AACO,SAASqL,0BAA0BA,CACxCrL,MAAyB,EACK;EAC9B,OAAO,IAAA1C,qBAAY,EAA+B;IAChDC,IAAI,EAAE,4BAA4B;IAClCyC;EACF,CAAC,CAAC;AACJ;AACO,SAASsL,mBAAmBA,CACjCrC,KAAwB,EACD;EACvB,OAAO,IAAA3L,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3B0L;EACF,CAAC,CAAC;AACJ;AACO,SAASe,QAAQA,CAACrI,IAAsB,EAAc;EAC3D,OAAO,IAAArE,qBAAY,EAAa;IAC9BC,IAAI,EAAE,UAAU;IAChBoE;EACF,CAAC,CAAC;AACJ;AACO,SAAS4J,kBAAkBA,CAAA,EAAyB;EACzD,OAAO;IACLhO,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASiO,eAAeA,CAC7BzL,EAAgB,EAChB7B,IAIoB,EACD;EACnB,OAAO,IAAAZ,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBwC,EAAE;IACF7B;EACF,CAAC,CAAC;AACJ;AACO,SAASuN,eAAeA,CAC7BC,OAAmC,EAChB;EACnB,OAAO,IAAApO,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBmO,OAAO;IACPC,YAAY,EAAE,IAAI;IAClBC,iBAAiB,EAAE;EACrB,CAAC,CAAC;AACJ;AACO,SAASC,cAAcA,CAC5BH,OAAkC,EAChB;EAClB,OAAO,IAAApO,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBmO,OAAO;IACPC,YAAY,EAAE,IAAI;IAClBC,iBAAiB,EAAE;EACrB,CAAC,CAAC;AACJ;AACO,SAASE,cAAcA,CAC5BJ,OAA0D,EACxC;EAClB,OAAO,IAAApO,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBmO,OAAO;IACPC,YAAY,EAAE,IAAI;IAClBC,iBAAiB,EAAE;EACrB,CAAC,CAAC;AACJ;AACO,SAASG,cAAcA,CAC5BL,OAAqC,EACnB;EAClB,OAAO,IAAApO,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBmO,OAAO;IACPE,iBAAiB,EAAE;EACrB,CAAC,CAAC;AACJ;AACO,SAASI,iBAAiBA,CAACjM,EAAgB,EAAuB;EACvE,OAAO,IAAAzC,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBwC,EAAE;IACFH,IAAI,EAAE;EACR,CAAC,CAAC;AACJ;AACO,SAASqM,gBAAgBA,CAC9BlM,EAAgB,EAChBH,IAAsB,EACF;EACpB,OAAO,IAAAtC,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBwC,EAAE;IACFH;EACF,CAAC,CAAC;AACJ;AACO,SAASsM,gBAAgBA,CAC9BnM,EAAgB,EAChBH,IAAqB,EACD;EACpB,OAAO,IAAAtC,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBwC,EAAE;IACFH;EACF,CAAC,CAAC;AACJ;AACO,SAASuM,mBAAmBA,CAACpM,EAAgB,EAAyB;EAC3E,OAAO,IAAAzC,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3BwC;EACF,CAAC,CAAC;AACJ;AACO,SAASqM,iBAAiBA,CAC/BC,UAAsB,EACtBC,SAAqB,EACA;EACrB,OAAO,IAAAhP,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzB8O,UAAU;IACVC;EACF,CAAC,CAAC;AACJ;AACO,SAASC,yBAAyBA,CACvCF,UAAsB,EACtBC,SAAqB,EACQ;EAC7B,OAAO,IAAAhP,qBAAY,EAA8B;IAC/CC,IAAI,EAAE,2BAA2B;IACjC8O,UAAU;IACVC,SAAS;IACTlL,QAAQ,EAAE;EACZ,CAAC,CAAC;AACJ;AACO,SAASoL,YAAYA,CAC1BnM,IAA2C,EAC3CvC,KAKQ,GAAG,IAAI,EACC;EAChB,OAAO,IAAAR,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpB8C,IAAI;IACJvC;EACF,CAAC,CAAC;AACJ;AAEO,SAAS2O,iBAAiBA,CAC/BpM,IAAmE,EAC9C;EACrB,OAAO,IAAA/C,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzB8C;EACF,CAAC,CAAC;AACJ;AAEO,SAASqM,UAAUA,CACxBC,cAAmC,EACnCC,cAAsD,GAAG,IAAI,EAC7DC,QAMC,EACDC,WAA2B,GAAG,IAAI,EACpB;EACd,OAAO,IAAAxP,qBAAY,EAAe;IAChCC,IAAI,EAAE,YAAY;IAClBoP,cAAc;IACdC,cAAc;IACdC,QAAQ;IACRC;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,kBAAkBA,CAAA,EAAyB;EACzD,OAAO;IACLxP,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASyP,sBAAsBA,CACpC3N,UAA+C,EACrB;EAC1B,OAAO,IAAA/B,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9B8B;EACF,CAAC,CAAC;AACJ;AAEO,SAAS4N,cAAcA,CAAC5N,UAAwB,EAAoB;EACzE,OAAO,IAAA/B,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtB8B;EACF,CAAC,CAAC;AACJ;AAEO,SAAS6N,aAAaA,CAAC7M,IAAY,EAAmB;EAC3D,OAAO,IAAA/C,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrB8C;EACF,CAAC,CAAC;AACJ;AAEO,SAAS8M,mBAAmBA,CACjClM,MAA+C,EAC/CC,QAAyB,EACF;EACvB,OAAO,IAAA5D,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3B0D,MAAM;IACNC;EACF,CAAC,CAAC;AACJ;AAEO,SAASkM,iBAAiBA,CAC/BC,SAA0B,EAC1BhN,IAAqB,EACA;EACrB,OAAO,IAAA/C,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzB8P,SAAS;IACThN;EACF,CAAC,CAAC;AACJ;AAEO,SAASiN,iBAAiBA,CAC/BjN,IAAmE,EACnEkN,UAAwD,EACxDT,WAAoB,GAAG,KAAK,EACP;EACrB,OAAO,IAAAxP,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzB8C,IAAI;IACJkN,UAAU;IACVT;EACF,CAAC,CAAC;AACJ;AAEO,SAASU,kBAAkBA,CAChCvL,QAAsB,EACA;EACtB,OAAO,IAAA3E,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1B0E;EACF,CAAC,CAAC;AACJ;AAEO,SAASwL,OAAOA,CAAC3P,KAAa,EAAa;EAChD,OAAO,IAAAR,qBAAY,EAAY;IAC7BC,IAAI,EAAE,SAAS;IACfO;EACF,CAAC,CAAC;AACJ;AAEO,SAAS4P,WAAWA,CACzBC,eAAqC,EACrCC,eAAqC,EACrCf,QAMC,EACc;EACf,OAAO,IAAAvP,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnBoQ,eAAe;IACfC,eAAe;IACff;EACF,CAAC,CAAC;AACJ;AAEO,SAASgB,kBAAkBA,CAAA,EAAyB;EACzD,OAAO;IACLtQ,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASuQ,kBAAkBA,CAAA,EAAyB;EACzD,OAAO;IACLvQ,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASwQ,IAAIA,CAAA,EAAW;EAC7B,OAAO;IACLxQ,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASyQ,WAAWA,CACzBC,YAQa,EACb5N,IAAkB,EACH;EACf,OAAO,IAAA/C,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnB0Q,YAAY;IACZ5N;EACF,CAAC,CAAC;AACJ;AACO,SAAS6N,qBAAqBA,CAAC7N,IAAY,EAA2B;EAC3E,OAAO,IAAA/C,qBAAY,EAA0B;IAC3CC,IAAI,EAAE,uBAAuB;IAC7B8C;EACF,CAAC,CAAC;AACJ;AACO,SAAS8N,mBAAmBA,CAAA,EAA0B;EAC3D,OAAO;IACL5Q,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAAS6Q,cAAcA,CAC5BnN,MAAoB,EACpB1C,MAAoB,EACF;EAClB,OAAO,IAAAjB,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtB0D,MAAM;IACN1C;EACF,CAAC,CAAC;AACJ;AACO,SAAS8P,eAAeA,CAC7BzM,GAAmC,EACnC9D,KAAsB,EACH;EACnB,OAAO,IAAAR,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBqE,GAAG;IACH9D;EACF,CAAC,CAAC;AACJ;AACO,SAASwQ,SAASA,CAACjP,UAAwB,EAAe;EAC/D,OAAO,IAAA/B,qBAAY,EAAc;IAC/BC,IAAI,EAAE,WAAW;IACjB8B;EACF,CAAC,CAAC;AACJ;AACO,SAASkP,YAAYA,CAC1BrQ,IAAsB,EACtBgC,KAAc,GAAG,KAAK,EACN;EAChB,OAAO,IAAA5C,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpBW,IAAI;IACJgC;EACF,CAAC,CAAC;AACJ;AACO,SAASsO,sBAAsBA,CACpCjK,QAAsB,EACI;EAC1B,OAAO,IAAAjH,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9BgH;EACF,CAAC,CAAC;AACJ;AACO,SAASkK,gBAAgBA,CAC9BhN,UAAqD,EACjC;EACpB,OAAO,IAAAnE,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBkE;EACF,CAAC,CAAC;AACJ;AACO,SAASiN,eAAeA,CAC7BrR,QAA+C,GAAG,EAAE,EACjC;EACnB,OAAO,IAAAC,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBF;EACF,CAAC,CAAC;AACJ;AACO,SAASsR,cAAcA,CAAC7Q,KAAa,EAAoB;EAC9D,OAAO,IAAAR,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBO;EACF,CAAC,CAAC;AACJ;AACO,SAAS8Q,gBAAgBA,CAAC1Q,IAAe,EAAsB;EACpE,OAAO,IAAAZ,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBW;EACF,CAAC,CAAC;AACJ;AACO,SAAS2Q,cAAcA,CAAA,EAAqB;EACjD,OAAO;IACLtR,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAASuR,uBAAuBA,CACrCzP,UAAwB,EACG;EAC3B,OAAO,IAAA/B,qBAAY,EAA4B;IAC7CC,IAAI,EAAE,yBAAyB;IAC/B8B;EACF,CAAC,CAAC;AACJ;AACO,SAAS0P,oBAAoBA,CAClCxQ,MAAoB,EACI;EACxB,OAAO,IAAAjB,qBAAY,EAAyB;IAC1CC,IAAI,EAAE,sBAAsB;IAC5BgB;EACF,CAAC,CAAC;AACJ;AACO,SAASyQ,6BAA6BA,CAAA,EAAoC;EAC/E,OAAO;IACLzR,IAAI,EAAE;EACR,CAAC;AACH;AACO,SAAS0R,mBAAmBA,CACjCC,SAA6C,EACtB;EACvB,OAAO,IAAA5R,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3B2R;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,iBAAiBA,CAC/BpP,EAAmC,GAAG,IAAI,EAC1CwH,cAIa,GAAG,IAAI,EACpBvH,MAAuD,EACvDyI,UAA8C,GAAG,IAAI,EAChC;EACrB,OAAO,IAAAnL,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBwC,EAAE;IACFwH,cAAc;IACdvH,MAAM;IACNyI;EACF,CAAC,CAAC;AACJ;AAEO,SAAS2G,eAAeA,CAC7BrN,UAAiD,GAAG,IAAI,EACxDH,GAKgB,EAChB2F,cAIa,GAAG,IAAI,EACpBvH,MAEC,EACDyI,UAA8C,GAAG,IAAI,EAClC;EACnB,OAAO,IAAAnL,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBwE,UAAU;IACVH,GAAG;IACH2F,cAAc;IACdvH,MAAM;IACNyI;EACF,CAAC,CAAC;AACJ;AAEO,SAAS4G,eAAeA,CAC7B3R,IAAoB,EACpBC,KAAmB,EACA;EACnB,OAAO,IAAAL,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBG,IAAI;IACJC;EACF,CAAC,CAAC;AACJ;AAEO,SAAS2R,0BAA0BA,CACxC/H,cAA+D,GAAG,IAAI,EACtEgI,UAEC,EACD7I,cAAyC,GAAG,IAAI,EAClB;EAC9B,OAAO,IAAApJ,qBAAY,EAA+B;IAChDC,IAAI,EAAE,4BAA4B;IAClCgK,cAAc;IACdgI,UAAU;IACV7I;EACF,CAAC,CAAC;AACJ;AAEO,SAAS8I,+BAA+BA,CAC7CjI,cAA+D,GAAG,IAAI,EACtEgI,UAEC,EACD7I,cAAyC,GAAG,IAAI,EACb;EACnC,OAAO,IAAApJ,qBAAY,EAAoC;IACrDC,IAAI,EAAE,iCAAiC;IACvCgK,cAAc;IACdgI,UAAU;IACV7I;EACF,CAAC,CAAC;AACJ;AAEO,SAAS+I,mBAAmBA,CACjC7N,GAAiB,EACjB8E,cAAyC,GAAG,IAAI,EACzB;EACvB,OAAO,IAAApJ,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3BqE,GAAG;IACH8E,cAAc;IACd/E,IAAI,EAAE;EACR,CAAC,CAAC;AACJ;AAEO,SAAS+N,iBAAiBA,CAC/B9N,GAAiB,EACjB2F,cAA+D,GAAG,IAAI,EACtEgI,UAEC,EACD7I,cAAyC,GAAG,IAAI,EAC3B;EACrB,OAAO,IAAApJ,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBqE,GAAG;IACH2F,cAAc;IACdgI,UAAU;IACV7I,cAAc;IACd/E,IAAI,EAAE;EACR,CAAC,CAAC;AACJ;AAEO,SAASgO,gBAAgBA,CAC9BJ,UAA+B,EAC/B7I,cAAyC,GAAG,IAAI,EAC5B;EACpB,OAAO,IAAApJ,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBgS,UAAU;IACV7I;EACF,CAAC,CAAC;AACJ;AAEO,SAASkJ,YAAYA,CAAA,EAAmB;EAC7C,OAAO;IACLrS,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASsS,gBAAgBA,CAAA,EAAuB;EACrD,OAAO;IACLtS,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASuS,eAAeA,CAAA,EAAsB;EACnD,OAAO;IACLvS,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASwS,kBAAkBA,CAAA,EAAyB;EACzD,OAAO;IACLxS,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASyS,cAAcA,CAAA,EAAqB;EACjD,OAAO;IACLzS,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAAS0S,aAAaA,CAAA,EAAoB;EAC/C,OAAO;IACL1S,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAAS2S,eAAeA,CAAA,EAAsB;EACnD,OAAO;IACL3S,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAAS4S,eAAeA,CAAA,EAAsB;EACnD,OAAO;IACL5S,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAAS6S,eAAeA,CAAA,EAAsB;EACnD,OAAO;IACL7S,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAAS8S,eAAeA,CAAA,EAAsB;EACnD,OAAO;IACL9S,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAAS+S,kBAAkBA,CAAA,EAAyB;EACzD,OAAO;IACL/S,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASgT,gBAAgBA,CAAA,EAAuB;EACrD,OAAO;IACLhT,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASiT,aAAaA,CAAA,EAAoB;EAC/C,OAAO;IACLjT,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASkT,UAAUA,CAAA,EAAiB;EACzC,OAAO;IACLlT,IAAI,EAAE;EACR,CAAC;AACH;AAEO,SAASmT,cAAcA,CAC5BnJ,cAA+D,GAAG,IAAI,EACtEgI,UAEC,EACD7I,cAAyC,GAAG,IAAI,EAC9B;EAClB,OAAO,IAAApJ,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBgK,cAAc;IACdgI,UAAU;IACV7I;EACF,CAAC,CAAC;AACJ;AAEO,SAASiK,iBAAiBA,CAC/BpJ,cAA+D,GAAG,IAAI,EACtEgI,UAEC,EACD7I,cAAyC,GAAG,IAAI,EAC3B;EACrB,OAAO,IAAApJ,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBgK,cAAc;IACdgI,UAAU;IACV7I;EACF,CAAC,CAAC;AACJ;AAEO,SAASkK,eAAeA,CAC7BC,QAAwB,EACxBtJ,cAAqD,GAAG,IAAI,EACzC;EACnB,OAAO,IAAAjK,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBsT,QAAQ;IACRtJ;EACF,CAAC,CAAC;AACJ;AAEO,SAASuJ,eAAeA,CAC7BC,aAA0C,EAC1CrK,cAAyC,GAAG,IAAI,EAChDsK,OAAuB,GAAG,IAAI,EACX;EACnB,OAAO,IAAA1T,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBwT,aAAa;IACbrK,cAAc;IACdsK;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,WAAWA,CACzBC,QAAyC,EACzC3J,cAAqD,GAAG,IAAI,EAC7C;EACf,OAAO,IAAAjK,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnB2T,QAAQ;IACR3J;EACF,CAAC,CAAC;AACJ;AAEO,SAAS4J,aAAaA,CAC3BzF,OAA+B,EACd;EACjB,OAAO,IAAApO,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBmO;EACF,CAAC,CAAC;AACJ;AAEO,SAAS0F,WAAWA,CAAClK,WAAqB,EAAiB;EAChE,OAAO,IAAA5J,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnB2J;EACF,CAAC,CAAC;AACJ;AAEO,SAASmK,WAAWA,CACzBC,YAAoD,EACrC;EACf,OAAO,IAAAhU,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnB+T;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,cAAcA,CAAC7K,cAAwB,EAAoB;EACzE,OAAO,IAAApJ,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBmJ;EACF,CAAC,CAAC;AACJ;AAEO,SAAS8K,UAAUA,CAAC9K,cAAwB,EAAgB;EACjE,OAAO,IAAApJ,qBAAY,EAAe;IAChCC,IAAI,EAAE,YAAY;IAClBmJ;EACF,CAAC,CAAC;AACJ;AAEO,SAAS+K,kBAAkBA,CAChCpT,KAAmB,EACnB6I,WAAqB,EACrB9F,QAAiB,GAAG,KAAK,EACH;EACtB,OAAO,IAAA9D,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1Bc,KAAK;IACL6I,WAAW;IACX9F;EACF,CAAC,CAAC;AACJ;AAEO,SAASsQ,WAAWA,CAACzI,KAAsB,EAAiB;EACjE,OAAO,IAAA3L,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnB0L;EACF,CAAC,CAAC;AACJ;AAEO,SAAS0I,kBAAkBA,CAChC1I,KAAsB,EACA;EACtB,OAAO,IAAA3L,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1B0L;EACF,CAAC,CAAC;AACJ;AAEO,SAAS2I,iBAAiBA,CAC/BC,SAAmB,EACnBC,WAAqB,EACrBC,QAAkB,EAClBC,SAAmB,EACE;EACrB,OAAO,IAAA1U,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBsU,SAAS;IACTC,WAAW;IACXC,QAAQ;IACRC;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,WAAWA,CAACjH,aAAgC,EAAiB;EAC3E,OAAO,IAAA1N,qBAAY,EAAgB;IACjCC,IAAI,EAAE,aAAa;IACnByN;EACF,CAAC,CAAC;AACJ;AAEO,SAASkH,mBAAmBA,CACjCxL,cAAwB,EACD;EACvB,OAAO,IAAApJ,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3BmJ;EACF,CAAC,CAAC;AACJ;AAEO,SAASyL,cAAcA,CAACzL,cAAwB,EAAoB;EACzE,OAAO,IAAApJ,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtBmJ,cAAc;IACdjJ,QAAQ,EAAE;EACZ,CAAC,CAAC;AACJ;AAEO,SAAS2U,mBAAmBA,CACjC/F,UAAoB,EACpBC,SAAmB,EACI;EACvB,OAAO,IAAAhP,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3B8O,UAAU;IACVC;EACF,CAAC,CAAC;AACJ;AAEO,SAAS+F,YAAYA,CAC1BrH,aAAgC,EAChCtE,cAA+B,GAAG,IAAI,EACtC4L,QAAyB,GAAG,IAAI,EAChB;EAChB,OAAO,IAAAhV,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpByN,aAAa;IACbtE,cAAc;IACd4L;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,aAAaA,CAC3BC,OAMqB,EACJ;EACjB,OAAO,IAAAlV,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBiV;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,6BAA6BA,CAC3CpT,UAA0B,EAC1BkI,cAAqD,GAAG,IAAI,EAC3B;EACjC,OAAO,IAAAjK,qBAAY,EAAkC;IACnDC,IAAI,EAAE,+BAA+B;IACrC8B,UAAU;IACVkI;EACF,CAAC,CAAC;AACJ;AAEO,SAASmL,sBAAsBA,CACpC3S,EAAgB,EAChBwH,cAA+D,GAAG,IAAI,EACtEE,QAAmE,GAAG,IAAI,EAC1EvJ,IAAuB,EACG;EAC1B,OAAO,IAAAZ,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9BwC,EAAE;IACFwH,cAAc;IACdG,OAAO,EAAED,QAAQ;IACjBvJ;EACF,CAAC,CAAC;AACJ;AAEO,SAASyU,eAAeA,CAC7BzU,IAA4B,EACT;EACnB,OAAO,IAAAZ,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBW;EACF,CAAC,CAAC;AACJ;AAEO,SAAS0U,sBAAsBA,CACpC7S,EAAgB,EAChBwH,cAA+D,GAAG,IAAI,EACtEb,cAAwB,EACE;EAC1B,OAAO,IAAApJ,qBAAY,EAA2B;IAC5CC,IAAI,EAAE,wBAAwB;IAC9BwC,EAAE;IACFwH,cAAc;IACdb;EACF,CAAC,CAAC;AACJ;AAEO,SAASmM,yBAAyBA,CACvCxT,UAAwB,EACxBkI,cAAqD,GAAG,IAAI,EAC/B;EAC7B,OAAO,IAAAjK,qBAAY,EAA8B;IAC/CC,IAAI,EAAE,2BAA2B;IACjC8B,UAAU;IACVkI;EACF,CAAC,CAAC;AACJ;AAEO,SAASuL,cAAcA,CAC5BzT,UAAwB,EACxBqH,cAAwB,EACN;EAClB,OAAO,IAAApJ,qBAAY,EAAmB;IACpCC,IAAI,EAAE,gBAAgB;IACtB8B,UAAU;IACVqH;EACF,CAAC,CAAC;AACJ;AAEO,SAASqM,qBAAqBA,CACnC1T,UAAwB,EACxBqH,cAAwB,EACC;EACzB,OAAO,IAAApJ,qBAAY,EAA0B;IAC3CC,IAAI,EAAE,uBAAuB;IAC7B8B,UAAU;IACVqH;EACF,CAAC,CAAC;AACJ;AAEO,SAASsM,eAAeA,CAC7BtM,cAAwB,EACxBrH,UAAwB,EACL;EACnB,OAAO,IAAA/B,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvBmJ,cAAc;IACdrH;EACF,CAAC,CAAC;AACJ;AAEO,SAAS4T,iBAAiBA,CAC/BlT,EAAgB,EAChB2L,OAA8B,EACT;EACrB,OAAO,IAAApO,qBAAY,EAAsB;IACvCC,IAAI,EAAE,mBAAmB;IACzBwC,EAAE;IACF2L;EACF,CAAC,CAAC;AACJ;AAEO,SAASwH,YAAYA,CAC1BnT,EAAkC,EAClCoT,WAAgC,GAAG,IAAI,EACvB;EAChB,OAAO,IAAA7V,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpBwC,EAAE;IACFoT;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,mBAAmBA,CACjCrT,EAAkC,EAClC7B,IAA6C,EACtB;EACvB,OAAO,IAAAZ,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3BwC,EAAE;IACF7B;EACF,CAAC,CAAC;AACJ;AAEO,SAASmV,aAAaA,CAACnV,IAAwB,EAAmB;EACvE,OAAO,IAAAZ,qBAAY,EAAkB;IACnCC,IAAI,EAAE,eAAe;IACrBW;EACF,CAAC,CAAC;AACJ;AAEO,SAASoV,YAAYA,CAC1BrR,QAAyB,EACzBsR,SAAgC,GAAG,IAAI,EACvChM,cAAqD,GAAG,IAAI,EAC5C;EAChB,OAAO,IAAAjK,qBAAY,EAAiB;IAClCC,IAAI,EAAE,cAAc;IACpB0E,QAAQ;IACRsR,SAAS;IACThM;EACF,CAAC,CAAC;AACJ;AAEO,SAASiM,yBAAyBA,CACvCzT,EAAgB,EAChB0T,eAA6D,EAChC;EAC7B,OAAO,IAAAnW,qBAAY,EAA8B;IAC/CC,IAAI,EAAE,2BAA2B;IACjCwC,EAAE;IACF0T,eAAe;IACfC,QAAQ,EAAE;EACZ,CAAC,CAAC;AACJ;AAEO,SAASC,yBAAyBA,CACvCtU,UAA2B,EACE;EAC7B,OAAO,IAAA/B,qBAAY,EAA8B;IAC/CC,IAAI,EAAE,2BAA2B;IACjC8B;EACF,CAAC,CAAC;AACJ;AAEO,SAASuU,mBAAmBA,CACjCvU,UAAwB,EACD;EACvB,OAAO,IAAA/B,qBAAY,EAAwB;IACzCC,IAAI,EAAE,qBAAqB;IAC3B8B;EACF,CAAC,CAAC;AACJ;AAEO,SAASwU,kBAAkBA,CAChCxU,UAAwB,EACF;EACtB,OAAO,IAAA/B,qBAAY,EAAuB;IACxCC,IAAI,EAAE,oBAAoB;IAC1B8B;EACF,CAAC,CAAC;AACJ;AAEO,SAASyU,4BAA4BA,CAC1C/T,EAAgB,EACgB;EAChC,OAAO,IAAAzC,qBAAY,EAAiC;IAClDC,IAAI,EAAE,8BAA8B;IACpCwC;EACF,CAAC,CAAC;AACJ;AAEO,SAASgU,gBAAgBA,CAACrN,cAAwB,EAAsB;EAC7E,OAAO,IAAApJ,qBAAY,EAAqB;IACtCC,IAAI,EAAE,kBAAkB;IACxBmJ;EACF,CAAC,CAAC;AACJ;AAEO,SAASsN,4BAA4BA,CAC1ChU,MAAuB,EACS;EAChC,OAAO,IAAA1C,qBAAY,EAAiC;IAClDC,IAAI,EAAE,8BAA8B;IACpCyC;EACF,CAAC,CAAC;AACJ;AAEO,SAASiU,0BAA0BA,CACxCjU,MAAgC,EACF;EAC9B,OAAO,IAAA1C,qBAAY,EAA+B;IAChDC,IAAI,EAAE,4BAA4B;IAClCyC;EACF,CAAC,CAAC;AACJ;AAEO,SAASkU,eAAeA,CAC7BC,UAAuC,GAAG,IAAI,EAC9CjJ,QAAqC,GAAG,IAAI,EAC5C7K,IAAY,EACO;EACnB,OAAO,IAAA/C,qBAAY,EAAoB;IACrCC,IAAI,EAAE,iBAAiB;IACvB4W,UAAU;IACVhJ,OAAO,EAAED,QAAQ;IACjB7K;EACF,CAAC,CAAC;AACJ;AAGA,SAAS+T,aAAaA,CAACtW,KAAa,EAAE;EACpC,IAAAuW,2BAAkB,EAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;EACvE,OAAO5T,cAAc,CAAC3C,KAAK,CAAC;AAC9B;AAGA,SAASwW,YAAYA,CAACzT,OAAe,EAAEC,KAAa,GAAG,EAAE,EAAE;EACzD,IAAAuT,2BAAkB,EAAC,cAAc,EAAE,eAAe,EAAE,gBAAgB,CAAC;EACrE,OAAOzT,aAAa,CAACC,OAAO,EAAEC,KAAK,CAAC;AACtC;AAGA,SAASyT,YAAYA,CAACtS,QAAgB,EAAE;EACtC,IAAAoS,2BAAkB,EAAC,cAAc,EAAE,aAAa,EAAE,gBAAgB,CAAC;EACnE,OAAOrS,WAAW,CAACC,QAAQ,CAAC;AAC9B;AAGA,SAASuS,cAAcA,CAACvS,QAAsB,EAAE;EAC9C,IAAAoS,2BAAkB,EAAC,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,CAAC;EACvE,OAAO7O,aAAa,CAACvD,QAAQ,CAAC;AAChC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/69/4d4a612a3b4dd9d24c17a7c805ae445074ee55547b4ffabbd725b42d990b1d1081c7c2f873fb7bcece926be82a1f9166e692b1580b1b8cc2388f0b67a9d2fd-index.json b/.pnpm-store/v3/files/69/4d4a612a3b4dd9d24c17a7c805ae445074ee55547b4ffabbd725b42d990b1d1081c7c2f873fb7bcece926be82a1f9166e692b1580b1b8cc2388f0b67a9d2fd-index.json new file mode 100644 index 00000000..e5162e77 --- /dev/null +++ b/.pnpm-store/v3/files/69/4d4a612a3b4dd9d24c17a7c805ae445074ee55547b4ffabbd725b42d990b1d1081c7c2f873fb7bcece926be82a1f9166e692b1580b1b8cc2388f0b67a9d2fd-index.json @@ -0,0 +1 @@ +{"files":{"LICENSE":{"checkedAt":1707939899493,"integrity":"sha512-e6Azp98T3IIh9uy4NT357Iu8c0dWTrVyQAKq389D3dnKyCEDwFK6e48wfzxsS4H7m3M2HK9BEAXSnmzdHmCNWQ==","mode":420,"size":1067},"lib/configs/all.js":{"checkedAt":1707939899493,"integrity":"sha512-+NRJtyhJxH2NCGkaFarD1R6kmEOmSHmyJ4dQRMB5GnEbrHf2htaWNIk0GkPorBb3ERsuH5IUwilVp+s508PuuQ==","mode":420,"size":572},"lib/utils/ast-utils.js":{"checkedAt":1707939899493,"integrity":"sha512-+P5eSZbv7HLISOrx4Kbl8HR47KKvbkZx3bm4PIiP0Yq+lIl2NfpEC9LnEwMl6TqDxjk+T8NYMnCPSr/WQA0nAw==","mode":420,"size":10147},"lib/configs/base.js":{"checkedAt":1707939899493,"integrity":"sha512-j0mD6iESXKMs5i2IGq3/Rr7RtKh3913iqEtTDGCjFav9l4WLUgSElPBF5/i3gpf1YfAq0etD+hWilNqJltzEVg==","mode":420,"size":1609},"lib/utils/compat.js":{"checkedAt":1707939899493,"integrity":"sha512-YvGnUUEsPW1POkuKdGaj9lpAGen16PbeapnL95GiIUlg+GQge8yGmkEIyHSwoahgPFrYlv7pxD7ISMALllpNkw==","mode":420,"size":776},"lib/a11y/configs.js":{"checkedAt":1707939899493,"integrity":"sha512-PwdoNr86vGr08uLOgTz4+PVEJgJBQmnuKFuZ8VdfhbKE9d6J7dM8eKgoZ4HDceEul7OEoPkYVvULid+ixVKRkg==","mode":420,"size":1551},"lib/utils/resolve-parser/espree.js":{"checkedAt":1707939899493,"integrity":"sha512-Q4mI7qy0rECjIuQsLIFnrN0Mg1UrI7S3JE4YdGfAyOygaqA2wJzzMmq2amRGYDqe5+YTc1cpcr7wCKpnYjYC4Q==","mode":420,"size":1095},"lib/utils/fix-tracker.js":{"checkedAt":1707939899493,"integrity":"sha512-NEPSZGg1CrY+V1gaH8LYOCojrSi3NupzGrrKsvFs6wwU2UiYxNR2puaoCGxrQE81wMY4ehZqBByuBlQM9UAC+Q==","mode":420,"size":1533},"lib/configs/has-typescript-eslint-parser.js":{"checkedAt":1707939899494,"integrity":"sha512-hBBlsi6YlSsIp+tib+igwTD+B9sNkCZqf7P3hXHDx0mKYSPBgEiyOX0qRj0TXtnAcaDnvCXrjv+iv1PrW/pNiA==","mode":420,"size":641},"lib/a11y/index.js":{"checkedAt":1707939899494,"integrity":"sha512-vH40BBO8sTE2FuVBtF7rwPPevlG/XAEmMG8Kxjby9VWmeyU6pdUJXCzykMDW63t9PLPzW7rqiIEXWhuXtfHmsw==","mode":420,"size":441},"lib/environments/index.js":{"checkedAt":1707939899494,"integrity":"sha512-aU12cb3+5H4x4oUIv8lE9tbjQaBcd/a0RIKjKd4QGZV5gMJl6zLtz7VMKLr2E9YbMFJeXniMxuO1TC2M/AySwA==","mode":420,"size":241},"lib/index.js":{"checkedAt":1707939899494,"integrity":"sha512-K/FIfwUY+r5j2WxV9Wk8iEwSeQsgDFhM3fob44tkPGfRwqj/ZCYp+SUSe2GfS5F5emqVyet5yHaEsoTavMKoqg==","mode":420,"size":2395},"lib/processor/index.js":{"checkedAt":1707939899494,"integrity":"sha512-axbD0IKzsmKOMrMRxwn16KqsUrUVzxABLdDqt6hVIaWrxNuoe0ghn4vU9qUHMHRtKzx5Bypic7sRWyTflwXF4Q==","mode":420,"size":2861},"lib/shared/client-script/index.js":{"checkedAt":1707939899494,"integrity":"sha512-+Tt4h4O0HPJkui0+JvztvY9tlUC6FrPwZSRDyUDe73fP1/VdQBg3MSSFkd+NctcuKIKwZhofC1p6H1zUkGYh5w==","mode":420,"size":9032},"lib/shared/index.js":{"checkedAt":1707939899494,"integrity":"sha512-8zRzOh4rrfRM3UygcDAEvPPAawCi9Vs75iptXW2gBAZZKmSWvRGvPJcD82kLdODCMNKTgjgvjcJJD1HiePgmZw==","mode":420,"size":1098},"lib/utils/index.js":{"checkedAt":1707939899494,"integrity":"sha512-WJAyJGjsyWSYoT5lOr2mW2Om4uBPxTJy7A0EuuP2Oa+qv2mJhufL6NUq2+DEGWpo1YO8jyXaf7va2FZ3RKcRHg==","mode":420,"size":488},"lib/utils/resolve-parser/index.js":{"checkedAt":1707939899494,"integrity":"sha512-Up5tz4Vsn7E0L9FnUMReAaO40F7Jk8YbrcWzpLdw9vIX/AiQKmLxKuGOvwCcwWNVOeko82fJpRujld4HfrXohA==","mode":420,"size":1497},"lib/utils/string-literal-parser/index.js":{"checkedAt":1707939899494,"integrity":"sha512-F5q/MQR4a6ubYsGn1u3iHdZq7EBxPVvYMWqNQx8VPmeorfP5vCYv71ekSY27szo+hM2/0Tth4b5cYqVjj6uvKA==","mode":420,"size":845},"lib/utils/style/index.js":{"checkedAt":1707939899494,"integrity":"sha512-5QcTogDKM0UxaQYYRvQ3LeW7ID+oQpO1ZxQk57OJTpJR1kcv0donMmPx3MJ7vRtAVLS2Sba0BoKvLZMQQvbNMw==","mode":420,"size":819},"lib/utils/transform/index.js":{"checkedAt":1707939899494,"integrity":"sha512-iZKUAWtqYhpRGQAHABdtNnYhHk7UE6J21A2AXAtAfE8KDGqwXWYlB3xk4CEoVM+zoQoNakG7GH70Ff9KtudWlg==","mode":420,"size":4208},"lib/a11y/keys.js":{"checkedAt":1707939899494,"integrity":"sha512-8kxU7d9/+8EKqSGLuUK6aY8ZQhG1gA/mqkjRp+UQEe43pe0Mdn2kHcRS9kh27pedo5IGjPSu4vPM9BJwjr9ong==","mode":420,"size":1973},"lib/utils/transform/less.js":{"checkedAt":1707939899494,"integrity":"sha512-zWNO1Y6goyM9AMMQoTpQe9fvzzIp/8lf95GNNRXTiH5crQeTl5S7cA1Yxm+7zs1aJzvYeUIIXZSIFV2FOPUxoA==","mode":420,"size":1138},"lib/utils/transform/lines-and-columns.js":{"checkedAt":1707939899494,"integrity":"sha512-xJct/oZ/w+vTzdAw4BA3mLsrbBusSuzU5GhmASVzBGwn9CtdVrLyNUhDbF/rbBWmFKj3rDu5VB/KC7+pRvYTaA==","mode":420,"size":1923},"lib/a11y/load.js":{"checkedAt":1707939899494,"integrity":"sha512-/hIgS7zlqu4pPR3YpcUaNWUS5dflDPp5BG+bRoOlNvK7fDp4rmw+qL+P55UNbETrDRvhdUTakn78cUjXjxOZZA==","mode":420,"size":807},"lib/meta.js":{"checkedAt":1707939899495,"integrity":"sha512-ysr/L2Rm3gyQomzXz+A8e0Z1QnyDLhmMQ1stT4th3gWMlu09EQL+1ejFo6f17SivbNrgIE4Yxg9Ua/CIjmZzyQ==","mode":420,"size":184},"lib/rules/no-conflict-set-directives.js":{"checkedAt":1707939899495,"integrity":"sha512-K/ltD9rqxPl6KFrXhcA151D7aCy+d3LYUQGAe5MW4wWJnGM7S+nGlU2zvX3WKvoDxBAkm4EW5C5w0BXEycVOkg==","mode":420,"size":3976},"lib/rules/no-deprecated-astro-canonicalurl.js":{"checkedAt":1707939899495,"integrity":"sha512-NGNbqsYm3POr1iQWXaBLeanYV5K0w3R7qBZ+/YvwCobN0FNL8BJoDkUHNz7UHeiYpSI+zD86QwC6PQ5SB9MzNw==","mode":420,"size":1462},"lib/rules/no-deprecated-astro-fetchcontent.js":{"checkedAt":1707939899495,"integrity":"sha512-aH9vfbjV/xRwFJIJyhXH26UdcGk9JBU8Ak544ZwlDsFsPrFv5gHJiIf7ESxGj2yUUh6MU6MgCS5hVUgiS/qCRw==","mode":420,"size":1788},"lib/rules/no-deprecated-astro-resolve.js":{"checkedAt":1707939899495,"integrity":"sha512-2N/t9nZOrj4d6T/VKiBAxyzGbNCW9iadv3xOl73QCvYsmSdGJnhsBE2HWZsRoSq3VigmhOcXG0VMmVjJYxxptQ==","mode":420,"size":1414},"lib/rules/no-deprecated-getentrybyslug.js":{"checkedAt":1707939899495,"integrity":"sha512-i8YTxGmGI0aS57TgSw8bHrlepqTFBF/DZW7z1JI63vysg2vziqt3VSFlvEpVxhIYttPfwTRckGDQk4r4QbYT5g==","mode":420,"size":1275},"lib/rules/no-set-html-directive.js":{"checkedAt":1707939899495,"integrity":"sha512-Y7EIF/gRjl9sL9+ERe7f7X+tfuwTInPxo42r6TdXBw84PEaLG24pXylkeREGxr2Pd6thLwPjwtND5VRLvYFUpA==","mode":420,"size":1202},"lib/rules/no-set-text-directive.js":{"checkedAt":1707939899495,"integrity":"sha512-/5dfmI3iU2KzoaCJs7IK19m4gyfRCTQ/6PQfiF92NDdJY/Mjkg7IWECtZTK+k7IcvgoO3MBQyjIOUkNOFirlIg==","mode":420,"size":2745},"lib/rules/no-unused-css-selector.js":{"checkedAt":1707939899495,"integrity":"sha512-hZyMMqEDgpEplueEcR6teG0iZqN6roXDQNu5/Mv9SQ9RE+09PyKda6y0upOayIhIJr20JZyh3DCwc/77rH1UVg==","mode":420,"size":22959},"lib/rules/no-unused-define-vars-in-style.js":{"checkedAt":1707939899495,"integrity":"sha512-hpyNK/IbfKxpFuoYMoI+GrTH/k+FtBIkGlLAA0nv78VPjsGHgI/k5BhpbnkWyXc0X2VABpEivAy8KOeNeB876g==","mode":420,"size":3409},"lib/shared/client-script/parse-expression.js":{"checkedAt":1707939899495,"integrity":"sha512-P2wckNdMeoHG7p8NZG8gxCYVPnIV1PMjiLU0tf75kbhnGfg08renu6XSe31vdPSQlETMZdDtmsIDcH5pm60MFA==","mode":420,"size":1006},"lib/utils/string-literal-parser/parser.js":{"checkedAt":1707939899495,"integrity":"sha512-pFfiFqwTOJ4H+EC0xWgVjj1i32OAVNAINxHrkOZOCrVRSYy/OdjWPFJsaLzi6oofUIMGu8YtwE8gYc4y/oGOig==","mode":420,"size":1777},"lib/utils/transform/postcss.js":{"checkedAt":1707939899495,"integrity":"sha512-IiZRpYmQaohFi/o56O50b5ZAQAm8TafRPlMV4e29aYl3PwsF0PrPGJ1oNyp+O4+GbXEF84vHt40/WdWPj+4X2Q==","mode":420,"size":1501},"lib/rules/prefer-class-list-directive.js":{"checkedAt":1707939899495,"integrity":"sha512-oy22YnWMthOjrqhaPLZoQ0cbOPyUdKKgmKLIzcAD9VWW1IYHTrXbENXcsnIHv+2nrKejROrqsf+7KHKZtWuvlQ==","mode":420,"size":1758},"lib/rules/prefer-object-class-list.js":{"checkedAt":1707939899495,"integrity":"sha512-2fJFn2C8eXWklryB1YnFQzOrvkxxdLys1mP1ldnxYTkQKRAj5v4WB92OlwnTgYUTkf8G8gy+PqFZB6Z9KNawfw==","mode":420,"size":29197},"lib/rules/prefer-split-class-list.js":{"checkedAt":1707939899496,"integrity":"sha512-LNn+nQdi0FBXafrKsvqVhi9/9UN0XPdnsn3LdR0AqDt8n7Wd/dEfUKiblTIoY8C9Fobx7f5gQGM6mXv8KVJMxQ==","mode":420,"size":12767},"lib/configs/recommended.js":{"checkedAt":1707939899496,"integrity":"sha512-8PfKQHMy1lDzIbtAtjPu2WI0V/SO1k7PaSVFvLj/af7Quxw4dN4VkDAqXdJ5ETGbDQQYFzqIizGYr8ImFTgeFg==","mode":420,"size":781},"lib/utils/resolve-parser/require-user.js":{"checkedAt":1707939899496,"integrity":"sha512-8PuEeDPlLFOxDBGFhW7/sBzCiAEVNZwxJdYNoU3ybH8S94WwAzZQ93FG7sX2r2D9NKVEwu98LzAe5uoU0FDglg==","mode":420,"size":645},"lib/a11y/rules.js":{"checkedAt":1707939899496,"integrity":"sha512-7e8GDBPdhTe2PruyEFptKE02ikTZnbh3cAkqFdTIFvVITIJdux90d9Hl5bvqGbvP2pT9bOHyCcZg2ryaFo5yDw==","mode":420,"size":5719},"lib/utils/rules.js":{"checkedAt":1707939899496,"integrity":"sha512-8RKHCpC5d98zfx/7R+434ivfnIDdWhKQW+PFnUofDntyQcmx0wng3j2Ndh5e+zxyHbxgH8jkLMphrCgZJn3nWw==","mode":420,"size":2247},"lib/utils/transform/sass.js":{"checkedAt":1707939899496,"integrity":"sha512-W6nqYH/tL1i4Cqi8AA3JsEu3yeOCDkFKHUqvB09CgX6W5RSeSy5gHv92dH8RMpLIgp84MiWnu6V2iYsgKU1fhA==","mode":420,"size":998},"lib/rules/semi.js":{"checkedAt":1707939899496,"integrity":"sha512-vj0eFcpQ/Pq9wreLUUS3vB2GLgJtjyhmATpyAlWSBQUudXx2kJV3kQaN2inLqT6TlVXwWaBaS21Hsk2uGKoFzA==","mode":420,"size":11705},"lib/utils/transform/stylus.js":{"checkedAt":1707939899496,"integrity":"sha512-iB7K4h923vkDONi4XXgq8bnQpONaT+VPeqf3SpHGuhsqSmChti7Xipnu///wR4KuRJCgWCMUNQAHhkGCKADtDw==","mode":420,"size":1121},"lib/utils/string-literal-parser/tokenizer.js":{"checkedAt":1707939899496,"integrity":"sha512-dJUk7Wwep12IKNF2C7ue+nVm8RC2InixUmR5c7u6NcXzpHLHsvXg68j1Vl+6aXhMHC2gcNYqvzME533zndSyeA==","mode":420,"size":6890},"lib/utils/style/tokenizer.js":{"checkedAt":1707939899496,"integrity":"sha512-42/JEGegqqJOmv0jJNtUqXhNs4e908L/GF2B2OkGd79nK0wWUlOPFKoZ38b/8EycNCULVrrQanuCUV0aPpF8Uw==","mode":420,"size":7131},"lib/utils/string-literal-parser/tokens.js":{"checkedAt":1707939899496,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"lib/types-for-node.js":{"checkedAt":1707939899496,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"lib/types.js":{"checkedAt":1707939899496,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"lib/utils/transform/types.js":{"checkedAt":1707939899496,"integrity":"sha512-f2XGQDoj2T+xSOglmwEtZVKrO/8Xj0p9ap2c7A9gQp/BiZ45tLyozAivx12afHv9sT/DcspjyF6yKwNV601gAA==","mode":420,"size":77},"lib/utils/transform/utils.js":{"checkedAt":1707939899496,"integrity":"sha512-F8bniumup2LhYj/SkV0ne4JrZQikf3A7/1NrNNCYUm7ZkAmgMT95L03Fl0vE94YTBtd4z85Mn606S/Pcer/BnA==","mode":420,"size":1304},"lib/rules/valid-compile.js":{"checkedAt":1707939899496,"integrity":"sha512-SfJFtJEdLA7jkTTaIadxB2wAD7AgT8C8RJnYXUHMsOt+liNJArqOMLsLcwKCC/5yGfbql4Swttuvj1pViQiDfA==","mode":420,"size":1250},"package.json":{"checkedAt":1707939899496,"integrity":"sha512-qG4HV+LmZaY6KBeY3U4HMRUwqnjwlk3Y7jwxGmPAaWom/0jXI1p3d7OQloLcCketYf0Mx0xjPOFguM2+cOo1qQ==","mode":420,"size":4126},"README.md":{"checkedAt":1707939899497,"integrity":"sha512-gR4C8p3ucwvBOddcGTiXnkhzhMQOIiVx898/v+78d5eu2mKuxPnH7kgPVrQehI3DGQ0lqe1QBNb1ZqHIax8/pQ==","mode":420,"size":22441},"lib/configs/all.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-wgqjL8EGLzrVIkzVmKX7dFB6z2TKZKuVwSu/0NEE3PWu6m2Ovt03sXDlZ/jVnCXAlfBY4JJiyln7myC0GZxsrQ==","mode":420,"size":461},"lib/utils/ast-utils.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-YFGAaaBCP+Kn7KMfcDVaMw25h4QYcEysDcAEcCaPqeuB3C6hx6+U7yyw9a9ho7z3ivzg9HsajbHTm2bjN9+xXA==","mode":420,"size":2608},"lib/configs/base.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-8S3orxeIKkDgzEwVze/Xxd6Pap/LvBctE8zMddLbdWWGe0+WPXmvPQ9aPCA8dPW/i+xls/ROGv1Iz7GsYIzshQ==","mode":420,"size":1571},"lib/utils/compat.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-hVU40iapm9HFeBBzTn9d3eMCSgGdu7K12piPlD/lGCjkwLNxbp+hzwxkAJHgo6TvPtG2VdKtbBR6oj+Co99DAw==","mode":420,"size":334},"lib/a11y/configs.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-tDcIc1m5gqzLshL+ReiKd5gRBUkgYVNG1Bj7cbmu5RPBm1mtulI1c8bjahnOYjNn7/pPU/TP83cvGgI6Cz0G2g==","mode":420,"size":65},"lib/utils/resolve-parser/espree.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-QVx/HhPDqbgP++fMEf5cTQquCP+jbKsDUrqmZtgKOOiqjsu/fYkoOxGx/ueO3FjmgVP4HrSgO3Z8DgHpLy8G5g==","mode":420,"size":223},"lib/utils/fix-tracker.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-ONQqmv30axjRCP5GO53YaZ3lor6GSekTZil3+V5H/aoPqV7nkfCgkoTdOBM1UXQZoE94sqzNAzYGy4l0yN+pWw==","mode":420,"size":628},"lib/configs/has-typescript-eslint-parser.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-C4auR1FikRa9inc/8fgT/tdvQmjqKdzs1tEkCfnFLciyVZ8/7pUALZ0EH7WKm1Q6muJl2SJIfta6FXpdSrJpIQ==","mode":420,"size":55},"lib/a11y/index.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-rhA5zCnQjgqSF4pRR6UJhieeEJFFVRiMUTn7Y2rifxW9lC36kLDlLQqeRJTbrus1ebEIaxozYUHZT8LQChAmGg==","mode":420,"size":169},"lib/environments/index.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-p6uLooGsFncnD6PRkW4gqXnGjyOKCRVGhjRBw1i0OcVn2c6SEUuXpwiptZ5tve/5LCvNHnIXhok/viQmRx2Z3A==","mode":420,"size":149},"lib/index.d.ts":{"checkedAt":1707939899497,"integrity":"sha512-6bpjameYSb4hwKpr8xgPx7GkAevdm7nUEkIwh0U0YSpfUIVM7Qu+sgs+BtOwSHQ0hfuzPlaq3Z6PuqNnnHjatg==","mode":420,"size":3784},"lib/processor/index.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-Be7drX9yuWxasIK7yber/jo3ZqDGmHjB0R4hOIMjlxFM2ufU1eMhCCLZDjyB+SIF4OF4c4yjb3w3lQMwEKRAXw==","mode":420,"size":155},"lib/shared/client-script/index.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-RyX04LGIXdfQNQlSljBiAhQ/jZq/fTJiizrPYodqGeWYHxQfqKjrsnYn7PIjKjQBOaXurWPeC72O+qYYs04osQ==","mode":420,"size":632},"lib/shared/index.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-WYA/O7GKUZw2y8xlilrkEs7icrd34vyldjpQNym3rbCr7c5BzwqNvwZTugmzkJ0tkEDNWs9OGd8i2InvrZAEFw==","mode":420,"size":550},"lib/utils/index.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-K+AjPaMwlEtAf9X0BsU8WPzTdH/Mbjc43jC21k6A5eaUHaTdFT5+etvLJsF15XtUMn/xTTETCZOkH5olzpDqqA==","mode":420,"size":154},"lib/utils/resolve-parser/index.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-KK0SADGDGFIxPJM8wqigaU5Sr9Y5diC++9laHtEB52oohBwQYE3G3f9OtDYpmXsvQ4w3nqL4lQLVKfDWFjDYMw==","mode":420,"size":268},"lib/utils/string-literal-parser/index.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-ctHyCtBR53UctjNS8fVnv/VNQRzNLbflVMVsA+tId7Ge5ZFBtatVO9JeiHezrXFas8267BJVpahPfQwSPKuhaA==","mode":420,"size":52},"lib/utils/style/index.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-m11q19zqHi6DmZWzOkghMQ7NtgjOQTWnokRjBWmyPd5KDEJGW7XqL9XVjLD9w3NLm22p4xz/wSmXJatfYk4bvw==","mode":420,"size":165},"lib/utils/transform/index.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-LkBHnAsAls+hYvVW75wg4ilpS3qPGXGsKnYNXqWBcLR77VCscRIlWf2Tp8zKR3x2eSIUiNfCf+iqNdfkGM0vWw==","mode":420,"size":298},"lib/a11y/keys.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-uZz8/BgQxIGksZjkthiUjqYOQ5TEoc55B6SPiBYy2gicpQDKIeDWYwfzb647E6tkznJaAksaiAstv3kX0q5GPw==","mode":420,"size":1055},"lib/utils/transform/less.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-2XAGGR0EX7ZQeQSjRffIwDWDxProxqU35QROECKWkL7tA8Wta+b5qd0ehRHp8PGajI7NI5+pTxDdmL1WWCK9Ng==","mode":420,"size":247},"lib/utils/transform/lines-and-columns.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-VkW/Dx4ARGRQN/LAkjwe7GumigtsyLIoK9DodsBAgrBMXgJDC7LzRKLO4WmBv76oSGqQDydb7w4PZutc5fNjbg==","mode":420,"size":318},"lib/a11y/load.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-0Mt8FQ9SVjj6ZzOsQhJ7IseBZoRT11PorIdJlL1OHELyM3o7MZTz0zJJAbtxGOXHnkNunQBv2QzIDpaDXw6L4Q==","mode":420,"size":707},"lib/meta.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-kMlVoO62VzUCKZWuTf3XOE8n4H2+KNDKBNnk96sGvuqFbkoglBhCPwQ2VVcCQROuLQkBbLhgUE61oCNadkN6DA==","mode":420,"size":90},"lib/rules/no-conflict-set-directives.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/no-deprecated-astro-canonicalurl.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/no-deprecated-astro-fetchcontent.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/no-deprecated-astro-resolve.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/no-deprecated-getentrybyslug.d.ts":{"checkedAt":1707939899498,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/no-set-html-directive.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/no-set-text-directive.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/no-unused-css-selector.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/no-unused-define-vars-in-style.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/shared/client-script/parse-expression.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-6si1e5qFLbAzVZE+Nx07qkxGUaGROMMwpSrDtMfWtgkzJGd5PcGT221IimhUD/LW3KjE3oBiQa4AtAUeHgIKKQ==","mode":420,"size":134},"lib/utils/string-literal-parser/parser.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-W2JvTPYcvNfuvetRwqDt10VkzTF5WUQ8Bb4NwGN+EbRQ614mT0KjDemwJEagOHCPgn/30J6QohYikLGeQUUXOw==","mode":420,"size":572},"lib/utils/transform/postcss.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-7gDWuhmiIf7H+yREwRjkw/S8ayMT/d47pB3dZ5FIOSbID7zHHr0pWE5NAOevmjh6N005hUYZ5fhtfRZ/3C/S9Q==","mode":420,"size":247},"lib/rules/prefer-class-list-directive.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/prefer-object-class-list.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/rules/prefer-split-class-list.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/configs/recommended.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-wgqjL8EGLzrVIkzVmKX7dFB6z2TKZKuVwSu/0NEE3PWu6m2Ovt03sXDlZ/jVnCXAlfBY4JJiyln7myC0GZxsrQ==","mode":420,"size":461},"lib/utils/resolve-parser/require-user.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-3MR4NttRCIi1rJl3Hcf5QFgpYqneMRpS4a88BkLCDU3TL0V396wdByFkxfyGwpJUQ1jiC4e8c9cDaki3dtdeyA==","mode":420,"size":67},"lib/a11y/rules.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-uXMYIrzUSRvnSjzdrGFRIEww9yQroDmRmSmFuxbiSHMeTOipPfLoyuGp7Nt6NQKmjRcMt2yEI+utRMeAuGVElg==","mode":420,"size":96},"lib/utils/rules.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-yHhxuO2k/fsPEoGc4TSCy2PqK0wyPNzjR9xKqTwAefKgedM8pvmclnk0/C6NBl1p068Mn1bK5tMt6kbArn7gdA==","mode":420,"size":86},"lib/utils/transform/sass.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-5ydK9OIFTxVuN2/RxizB0z51KbGMBf0f3anFL5sEyy2THMo9NkR+/lg3NFQfC0mVxOXuge4LJqFIzyXmXZLJ1Q==","mode":420,"size":270},"lib/rules/semi.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80},"lib/utils/transform/stylus.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-2XAGGR0EX7ZQeQSjRffIwDWDxProxqU35QROECKWkL7tA8Wta+b5qd0ehRHp8PGajI7NI5+pTxDdmL1WWCK9Ng==","mode":420,"size":247},"lib/utils/string-literal-parser/tokenizer.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-nMrtAjuvajGmpRpwa+C5W2ncStk8wDza1VXWgpHOM66w82qsyupkniD/kE3RO2fymaO3BdS+r8UGfqvhpZ+bjw==","mode":420,"size":426},"lib/utils/style/tokenizer.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-MCDVOIYGalQuJ2vW2SMHH02lgbiJSTzP2FZ/d2NqqY8QkpDGovcUJx7Pg8TsxSg/gBCAKjcA0vlMPSmXmz8xnA==","mode":420,"size":1434},"lib/utils/string-literal-parser/tokens.d.ts":{"checkedAt":1707939899499,"integrity":"sha512-FDs/udplymak24rLAglGBRNuVdhIzv5v/2300+3lNyhzU9sW9x+L0OuE3SVuHvHTP+XDSeMyFlwj3Mfrr2vnHA==","mode":420,"size":373},"lib/types-for-node.d.ts":{"checkedAt":1707939899500,"integrity":"sha512-oYHbdocpBW6d5Mt0bL1CUpbg8pUlZ5AN2wfMjiujLxjLIwsnF2+lYjO96uNwIlFcGNAligwrjhi02DGQLL7gyA==","mode":420,"size":49998},"lib/types.d.ts":{"checkedAt":1707939899500,"integrity":"sha512-XKdM7QEAlhgspid3Gh4wFOhFNVvXiw5thyhQJHkaqe7yGauvzcMtwCiknpxC0oWvNdapK+CgJv7TGwA0GmFCBQ==","mode":420,"size":8589},"lib/utils/transform/types.d.ts":{"checkedAt":1707939899500,"integrity":"sha512-EgT0/LievR7MDymB5kbfU5gA54rEByRAcTLU8mqcxXMgULt6bd9Uf2zqpQzTLDh7oUDGfUFJbVHhsXjEIltxvA==","mode":420,"size":152},"lib/utils/transform/utils.d.ts":{"checkedAt":1707939899500,"integrity":"sha512-uB0cFwW01EfN1byh+bXcRgktEV3n9LkAT2C72kj4TKB7yGsZwsAT1CMa7NeOTlMqOBGZW5crW8d0LpQDGXamew==","mode":420,"size":255},"lib/rules/valid-compile.d.ts":{"checkedAt":1707939899500,"integrity":"sha512-1EqnOeBgVhcrU22EAHQ+i8Aa2VOrLdo1OCtxclCdh9pK5wCtnLu8Atg9zgARcTR/EyAWhP7nZvOr1asH7f7jIw==","mode":420,"size":80}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/69/7ebb3eb43143ed793eb8eadf2537b17fa913e53b61223612a6214dc5042b71b402e70833f9626af10270fe9542fa00af5ac221e412a16f9effa174f8dd2d57 b/.pnpm-store/v3/files/69/7ebb3eb43143ed793eb8eadf2537b17fa913e53b61223612a6214dc5042b71b402e70833f9626af10270fe9542fa00af5ac221e412a16f9effa174f8dd2d57 new file mode 100644 index 00000000..6042bfd4 --- /dev/null +++ b/.pnpm-store/v3/files/69/7ebb3eb43143ed793eb8eadf2537b17fa913e53b61223612a6214dc5042b71b402e70833f9626af10270fe9542fa00af5ac221e412a16f9effa174f8dd2d57 @@ -0,0 +1,135 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $RangeError = require('es-errors/range'); +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); +var $ArrayBuffer = GetIntrinsic('%ArrayBuffer%', true); + +var typedArrayBuffer = require('typed-array-buffer'); +var typedArrayByteLength = require('typed-array-byte-length'); +var typedArrayByteOffset = require('typed-array-byte-offset'); +var typedArrayLength = require('typed-array-length'); +var whichTypedArray = require('which-typed-array'); + +var isInteger = require('../helpers/isInteger'); + +var CloneArrayBuffer = require('./CloneArrayBuffer'); +var GetValueFromBuffer = require('./GetValueFromBuffer'); +var IsDetachedBuffer = require('./IsDetachedBuffer'); +var IsSharedArrayBuffer = require('./IsSharedArrayBuffer'); +var SameValue = require('./SameValue'); +var SetValueInBuffer = require('./SetValueInBuffer'); +var TypedArrayElementSize = require('./TypedArrayElementSize'); +var TypedArrayElementType = require('./TypedArrayElementType'); + +// https://262.ecma-international.org/13.0/#sec-settypedarrayfromtypedarray + +module.exports = function SetTypedArrayFromTypedArray(target, targetOffset, source) { + var whichTarget = whichTypedArray(target); + if (!whichTarget) { + throw new $TypeError('Assertion failed: target must be a TypedArray instance'); + } + + if (targetOffset !== Infinity && (!isInteger(targetOffset) || targetOffset < 0)) { + throw new $TypeError('Assertion failed: targetOffset must be a non-negative integer or +Infinity'); + } + + var whichSource = whichTypedArray(source); + if (!whichSource) { + throw new $TypeError('Assertion failed: source must be a TypedArray instance'); + } + + var targetBuffer = typedArrayBuffer(target); // step 1 + + if (IsDetachedBuffer(targetBuffer)) { + throw new $TypeError('target’s buffer is detached'); // step 2 + } + + var targetLength = typedArrayLength(target); // step 3 + + var srcBuffer = typedArrayBuffer(source); // step 4 + + if (IsDetachedBuffer(srcBuffer)) { + throw new $TypeError('source’s buffer is detached'); // step 5 + } + + var targetType = TypedArrayElementType(target); // step 6 + + var targetElementSize = TypedArrayElementSize(target); // step 7 + + var targetByteOffset = typedArrayByteOffset(target); // step 8 + + var srcType = TypedArrayElementType(source); // step 9 + + var srcElementSize = TypedArrayElementSize(source); // step 10 + + var srcLength = typedArrayLength(source); // step 11 + + var srcByteOffset = typedArrayByteOffset(source); // step 12 + + if (targetOffset === Infinity) { + throw new $RangeError('targetOffset must be a non-negative integer or +Infinity'); // step 13 + } + + if (srcLength + targetOffset > targetLength) { + throw new $RangeError('targetOffset + source.length must not be greater than target.length'); // step 14 + } + + var targetContentType = whichTarget === 'BigInt64Array' || whichTarget === 'BigUint64Array' ? 'BigInt' : 'Number'; + var sourceContentType = whichSource === 'BigInt64Array' || whichSource === 'BigUint64Array' ? 'BigInt' : 'Number'; + if (targetContentType !== sourceContentType) { + throw new $TypeError('source and target must have the same content type'); // step 15 + } + + var same; + if (IsSharedArrayBuffer(srcBuffer) && IsSharedArrayBuffer(targetBuffer)) { // step 16 + // a. If srcBuffer.[[ArrayBufferData]] and targetBuffer.[[ArrayBufferData]] are the same Shared Data Block values, let same be true; else let same be false. + throw new $SyntaxError('SharedArrayBuffer is not supported by this implementation'); + } else { + same = SameValue(srcBuffer, targetBuffer); // step 17 + } + + var srcByteIndex; + if (same) { // step 18 + var srcByteLength = typedArrayByteLength(source); // step 18.a + + srcBuffer = CloneArrayBuffer(srcBuffer, srcByteOffset, srcByteLength, $ArrayBuffer); // step 18.b + + // c. NOTE: %ArrayBuffer% is used to clone srcBuffer because is it known to not have any observable side-effects. + + srcByteIndex = 0; // step 18.d + } else { + srcByteIndex = srcByteOffset; // step 19 + } + + var targetByteIndex = (targetOffset * targetElementSize) + targetByteOffset; // step 20 + + var limit = targetByteIndex + (targetElementSize * srcLength); // step 21 + + var value; + if (srcType === targetType) { // step 22 + // a. NOTE: If srcType and targetType are the same, the transfer must be performed in a manner that preserves the bit-level encoding of the source data. + + while (targetByteIndex < limit) { // step 22.b + value = GetValueFromBuffer(srcBuffer, srcByteIndex, 'Uint8', true, 'Unordered'); // step 22.b.i + + SetValueInBuffer(targetBuffer, targetByteIndex, 'Uint8', value, true, 'Unordered'); // step 22.b.ii + + srcByteIndex += 1; // step 22.b.iii + + targetByteIndex += 1; // step 22.b.iv + } + } else { // step 23 + while (targetByteIndex < limit) { // step 23.a + value = GetValueFromBuffer(srcBuffer, srcByteIndex, srcType, true, 'Unordered'); // step 23.a.i + + SetValueInBuffer(targetBuffer, targetByteIndex, targetType, value, true, 'Unordered'); // step 23.a.ii + + srcByteIndex += srcElementSize; // step 23.a.iii + + targetByteIndex += targetElementSize; // step 23.a.iv + } + } +}; diff --git a/.pnpm-store/v3/files/69/9030ea691059f3b420052bd8bd8849af43b4d1321f262720ec206cbe337419118b9ad0e781088281a745a2219fa057be5a68fe2a268abfa6fefb3cd5178fbe b/.pnpm-store/v3/files/69/9030ea691059f3b420052bd8bd8849af43b4d1321f262720ec206cbe337419118b9ad0e781088281a745a2219fa057be5a68fe2a268abfa6fefb3cd5178fbe new file mode 100644 index 00000000..fee90256 --- /dev/null +++ b/.pnpm-store/v3/files/69/9030ea691059f3b420052bd8bd8849af43b4d1321f262720ec206cbe337419118b9ad0e781088281a745a2219fa057be5a68fe2a268abfa6fefb3cd5178fbe @@ -0,0 +1,2 @@ +import type { ServicePlugin } from '@volar/language-server'; +export declare const create: () => ServicePlugin; diff --git a/.pnpm-store/v3/files/69/c1880a14907fd2aed869cdad463309c8f650fc71c652ab0987e099ceedc6cd0b2f5b29fc9eb649e0ea874a8ddec648f2c1d5d032697a626e054dc01c9f9f4d b/.pnpm-store/v3/files/69/c1880a14907fd2aed869cdad463309c8f650fc71c652ab0987e099ceedc6cd0b2f5b29fc9eb649e0ea874a8ddec648f2c1d5d032697a626e054dc01c9f9f4d new file mode 100644 index 00000000..3ed08256 --- /dev/null +++ b/.pnpm-store/v3/files/69/c1880a14907fd2aed869cdad463309c8f650fc71c652ab0987e099ceedc6cd0b2f5b29fc9eb649e0ea874a8ddec648f2c1d5d032697a626e054dc01c9f9f4d @@ -0,0 +1,226 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +var Group; +(function (Group) { + Group["conditional"] = "conditional"; + Group["function"] = "function"; + Group["import"] = "import"; + Group["intersection"] = "intersection"; + Group["keyword"] = "keyword"; + Group["nullish"] = "nullish"; + Group["literal"] = "literal"; + Group["named"] = "named"; + Group["object"] = "object"; + Group["operator"] = "operator"; + Group["tuple"] = "tuple"; + Group["union"] = "union"; +})(Group || (Group = {})); +function getGroup(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSConditionalType: + return Group.conditional; + case utils_1.AST_NODE_TYPES.TSConstructorType: + case utils_1.AST_NODE_TYPES.TSFunctionType: + return Group.function; + case utils_1.AST_NODE_TYPES.TSImportType: + return Group.import; + case utils_1.AST_NODE_TYPES.TSIntersectionType: + return Group.intersection; + case utils_1.AST_NODE_TYPES.TSAnyKeyword: + case utils_1.AST_NODE_TYPES.TSBigIntKeyword: + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + case utils_1.AST_NODE_TYPES.TSNeverKeyword: + case utils_1.AST_NODE_TYPES.TSNumberKeyword: + case utils_1.AST_NODE_TYPES.TSObjectKeyword: + case utils_1.AST_NODE_TYPES.TSStringKeyword: + case utils_1.AST_NODE_TYPES.TSSymbolKeyword: + case utils_1.AST_NODE_TYPES.TSThisType: + case utils_1.AST_NODE_TYPES.TSUnknownKeyword: + case utils_1.AST_NODE_TYPES.TSIntrinsicKeyword: + return Group.keyword; + case utils_1.AST_NODE_TYPES.TSNullKeyword: + case utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + case utils_1.AST_NODE_TYPES.TSVoidKeyword: + return Group.nullish; + case utils_1.AST_NODE_TYPES.TSLiteralType: + case utils_1.AST_NODE_TYPES.TSTemplateLiteralType: + return Group.literal; + case utils_1.AST_NODE_TYPES.TSArrayType: + case utils_1.AST_NODE_TYPES.TSIndexedAccessType: + case utils_1.AST_NODE_TYPES.TSInferType: + case utils_1.AST_NODE_TYPES.TSTypeReference: + case utils_1.AST_NODE_TYPES.TSQualifiedName: + return Group.named; + case utils_1.AST_NODE_TYPES.TSMappedType: + case utils_1.AST_NODE_TYPES.TSTypeLiteral: + return Group.object; + case utils_1.AST_NODE_TYPES.TSTypeOperator: + case utils_1.AST_NODE_TYPES.TSTypeQuery: + return Group.operator; + case utils_1.AST_NODE_TYPES.TSTupleType: + return Group.tuple; + case utils_1.AST_NODE_TYPES.TSUnionType: + return Group.union; + // These types should never occur as part of a union/intersection + case utils_1.AST_NODE_TYPES.TSAbstractKeyword: + case utils_1.AST_NODE_TYPES.TSAsyncKeyword: + case utils_1.AST_NODE_TYPES.TSDeclareKeyword: + case utils_1.AST_NODE_TYPES.TSExportKeyword: + case utils_1.AST_NODE_TYPES.TSNamedTupleMember: + case utils_1.AST_NODE_TYPES.TSOptionalType: + case utils_1.AST_NODE_TYPES.TSPrivateKeyword: + case utils_1.AST_NODE_TYPES.TSProtectedKeyword: + case utils_1.AST_NODE_TYPES.TSPublicKeyword: + case utils_1.AST_NODE_TYPES.TSReadonlyKeyword: + case utils_1.AST_NODE_TYPES.TSRestType: + case utils_1.AST_NODE_TYPES.TSStaticKeyword: + case utils_1.AST_NODE_TYPES.TSTypePredicate: + /* istanbul ignore next */ + throw new Error(`Unexpected Type ${node.type}`); + } +} +exports.default = (0, util_1.createRule)({ + name: 'sort-type-constituents', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce constituents of a type union/intersection to be sorted alphabetically', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + notSorted: '{{type}} type constituents must be sorted.', + notSortedNamed: '{{type}} type {{name}} constituents must be sorted.', + suggestFix: 'Sort constituents of type (removes all comments).', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + checkIntersections: { + description: 'Whether to check intersection types.', + type: 'boolean', + }, + checkUnions: { + description: 'Whether to check union types.', + type: 'boolean', + }, + groupOrder: { + description: 'Ordering of the groups.', + type: 'array', + items: { + type: 'string', + enum: (0, util_1.getEnumNames)(Group), + }, + }, + }, + }, + ], + }, + defaultOptions: [ + { + checkIntersections: true, + checkUnions: true, + groupOrder: [ + Group.named, + Group.keyword, + Group.operator, + Group.literal, + Group.function, + Group.import, + Group.conditional, + Group.object, + Group.tuple, + Group.intersection, + Group.union, + Group.nullish, + ], + }, + ], + create(context, [{ checkIntersections, checkUnions, groupOrder }]) { + const collator = new Intl.Collator('en', { + sensitivity: 'base', + numeric: true, + }); + function checkSorting(node) { + const sourceOrder = node.types.map(type => { + const group = groupOrder?.indexOf(getGroup(type)) ?? -1; + return { + group: group === -1 ? Number.MAX_SAFE_INTEGER : group, + node: type, + text: context.sourceCode.getText(type), + }; + }); + const expectedOrder = [...sourceOrder].sort((a, b) => { + if (a.group !== b.group) { + return a.group - b.group; + } + return (collator.compare(a.text, b.text) || + (a.text < b.text ? -1 : a.text > b.text ? 1 : 0)); + }); + const hasComments = node.types.some(type => { + const count = context.sourceCode.getCommentsBefore(type).length + + context.sourceCode.getCommentsAfter(type).length; + return count > 0; + }); + for (let i = 0; i < expectedOrder.length; i += 1) { + if (expectedOrder[i].node !== sourceOrder[i].node) { + let messageId = 'notSorted'; + const data = { + name: '', + type: node.type === utils_1.AST_NODE_TYPES.TSIntersectionType + ? 'Intersection' + : 'Union', + }; + if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration) { + messageId = 'notSortedNamed'; + data.name = node.parent.id.name; + } + const fix = fixer => { + const sorted = expectedOrder + .map(t => (0, util_1.typeNodeRequiresParentheses)(t.node, t.text) || + (node.type === utils_1.AST_NODE_TYPES.TSIntersectionType && + t.node.type === utils_1.AST_NODE_TYPES.TSUnionType) + ? `(${t.text})` + : t.text) + .join(node.type === utils_1.AST_NODE_TYPES.TSIntersectionType ? ' & ' : ' | '); + return fixer.replaceText(node, sorted); + }; + return context.report({ + node, + messageId, + data, + // don't autofix if any of the types have leading/trailing comments + // the logic for preserving them correctly is a pain - we may implement this later + ...(hasComments + ? { + suggest: [ + { + messageId: 'suggestFix', + fix, + }, + ], + } + : { fix }), + }); + } + } + } + return { + ...(checkIntersections && { + TSIntersectionType(node) { + checkSorting(node); + }, + }), + ...(checkUnions && { + TSUnionType(node) { + checkSorting(node); + }, + }), + }; + }, +}); +//# sourceMappingURL=sort-type-constituents.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/69/d36ff5f54a1ddfc584ea83b7169e178e9d2458215b1975c3632847b34bb32d5fee3aff006ff731742f0eb6fa62c67a5abdcc0708bef83fa9e2e2a65819c788 b/.pnpm-store/v3/files/69/d36ff5f54a1ddfc584ea83b7169e178e9d2458215b1975c3632847b34bb32d5fee3aff006ff731742f0eb6fa62c67a5abdcc0708bef83fa9e2e2a65819c788 new file mode 100644 index 00000000..a6eddae4 --- /dev/null +++ b/.pnpm-store/v3/files/69/d36ff5f54a1ddfc584ea83b7169e178e9d2458215b1975c3632847b34bb32d5fee3aff006ff731742f0eb6fa62c67a5abdcc0708bef83fa9e2e2a65819c788 @@ -0,0 +1,77 @@ +import { escapeRegExp, expandVariantGroup } from '@unocss/core'; + +function transformerCompileClass(options = {}) { + const { + trigger = /(["'`]):uno(?:-)?(?[^\s\1]+)?:\s([^\1]*?)\1/g, + classPrefix = "uno-", + hashFn = hash, + keepUnknown = true, + alwaysHash = false + } = options; + const compiledClass = /* @__PURE__ */ new Set(); + const regexp = typeof trigger === "string" ? RegExp(`(["'\`])${escapeRegExp(trigger)}\\s([^\\1]*?)\\1`, "g") : trigger; + return { + name: "@unocss/transformer-compile-class", + enforce: "pre", + async transform(s, _, { uno, tokens, invalidate }) { + const matches = [...s.original.matchAll(regexp)]; + if (!matches.length) + return; + const size = compiledClass.size; + for (const match of matches) { + let body = match.length === 4 && match.groups ? expandVariantGroup(match[3].trim()) : expandVariantGroup(match[2].trim()); + const start = match.index; + const replacements = []; + if (keepUnknown) { + const result = await Promise.all(body.split(/\s+/).filter(Boolean).map(async (i) => [i, !!await uno.parseToken(i)])); + const known = result.filter(([, matched]) => matched).map(([i]) => i); + const unknown = result.filter(([, matched]) => !matched).map(([i]) => i); + replacements.push(...unknown); + body = known.join(" "); + } + if (body) { + body = body.split(/\s+/).sort().join(" "); + let hash2; + let explicitName = false; + if (match.groups && match.groups.name) { + hash2 = match.groups.name; + if (alwaysHash) + hash2 += `-${hashFn(body)}`; + explicitName = true; + } else { + hash2 = hashFn(body); + } + const className = `${classPrefix}${hash2}`; + if (tokens && tokens.has(className) && explicitName) { + const existing = uno.config.shortcuts.find((i) => i[0] === className); + if (existing && existing[1] !== body) + throw new Error(`Duplicated compile class name "${className}". One is "${body}" and the other is "${existing[1]}". Please choose different class name or set 'alwaysHash' to 'true'.`); + } + compiledClass.add(className); + replacements.unshift(className); + if (options.layer) + uno.config.shortcuts.push([className, body, { layer: options.layer }]); + else + uno.config.shortcuts.push([className, body]); + if (tokens) + tokens.add(className); + } + s.overwrite(start + 1, start + match[0].length - 1, replacements.join(" ")); + } + if (compiledClass.size > size) + invalidate(); + } + }; +} +function hash(str) { + let i; + let l; + let hval = 2166136261; + for (i = 0, l = str.length; i < l; i++) { + hval ^= str.charCodeAt(i); + hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24); + } + return `00000${(hval >>> 0).toString(36)}`.slice(-6); +} + +export { transformerCompileClass as default }; diff --git a/.pnpm-store/v3/files/69/d95985c0b8c0fdba5b9d10052a40639da98f4db3b74576e60d9473370443da2b45c5262cf6f63d51e0761a1f30181bbebf97fa7bae2cc392af27bb59f7289c b/.pnpm-store/v3/files/69/d95985c0b8c0fdba5b9d10052a40639da98f4db3b74576e60d9473370443da2b45c5262cf6f63d51e0761a1f30181bbebf97fa7bae2cc392af27bb59f7289c new file mode 100644 index 00000000..027fff9b --- /dev/null +++ b/.pnpm-store/v3/files/69/d95985c0b8c0fdba5b9d10052a40639da98f4db3b74576e60d9473370443da2b45c5262cf6f63d51e0761a1f30181bbebf97fa7bae2cc392af27bb59f7289c @@ -0,0 +1,55 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var Call = require('./Call'); +var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow'); +var Get = require('./Get'); +var HasProperty = require('./HasProperty'); +var IsArray = require('./IsArray'); +var LengthOfArrayLike = require('./LengthOfArrayLike'); +var ToString = require('./ToString'); + +// https://262.ecma-international.org/11.0/#sec-flattenintoarray + +module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { + var mapperFunction; + if (arguments.length > 5) { + mapperFunction = arguments[5]; + } + + var targetIndex = start; + var sourceIndex = 0; + while (sourceIndex < sourceLen) { + var P = ToString(sourceIndex); + var exists = HasProperty(source, P); + if (exists === true) { + var element = Get(source, P); + if (typeof mapperFunction !== 'undefined') { + if (arguments.length <= 6) { + throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); + } + element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); + } + var shouldFlatten = false; + if (depth > 0) { + shouldFlatten = IsArray(element); + } + if (shouldFlatten) { + var elementLen = LengthOfArrayLike(element); + targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); + } else { + if (targetIndex >= MAX_SAFE_INTEGER) { + throw new $TypeError('index too large'); + } + CreateDataPropertyOrThrow(target, ToString(targetIndex), element); + targetIndex += 1; + } + } + sourceIndex += 1; + } + + return targetIndex; +}; diff --git a/.pnpm-store/v3/files/6a/10b95b5c60a2ef8a4d78b1e2c00ef0a8b5d90fa37f88b4fad9a4dec0bece07329ec8641f1ce95dd22605e86251828a283c2f7c5889975b59b7a7b0b1c4b532-index.json b/.pnpm-store/v3/files/6a/10b95b5c60a2ef8a4d78b1e2c00ef0a8b5d90fa37f88b4fad9a4dec0bece07329ec8641f1ce95dd22605e86251828a283c2f7c5889975b59b7a7b0b1c4b532-index.json new file mode 100644 index 00000000..5d89b6ad --- /dev/null +++ b/.pnpm-store/v3/files/6a/10b95b5c60a2ef8a4d78b1e2c00ef0a8b5d90fa37f88b4fad9a4dec0bece07329ec8641f1ce95dd22605e86251828a283c2f7c5889975b59b7a7b0b1c4b532-index.json @@ -0,0 +1 @@ +{"files":{".eslintrc":{"checkedAt":1707939899727,"integrity":"sha512-65sGQaNVSNtfwNeKuco6m7Yb6f1cQALCGufke1qiInbq1AStVjYsa2/3/+ygoJSrmKQSYSxdmkF8aUyyWY1pvQ==","mode":420,"size":83},".nycrc":{"checkedAt":1707939899727,"integrity":"sha512-42sgwWzusJB1Dzhl78jX/Zg65Oi0HDDMOGXS/Uklv1kCYn4fHtRsD/JFPwdu+d40vome9XdUspzRWEQAcTGEeQ==","mode":420,"size":216},"LICENSE":{"checkedAt":1707939899727,"integrity":"sha512-NHFoVSGLgGbMEiVOo9qIXE1oZrVi3RO6KVB9XeEDen516TDX3VcytN7NubUc2qVrYB/KeYV+mqz6PbQYju2odg==","mode":420,"size":1067},"index.js":{"checkedAt":1707939899727,"integrity":"sha512-maQcZy2NQPlP7/Lg+0uU87ijCRHxXUmcX7rbO0gVKYfHEN0m7Avo8plqUNtdzStMOr2yJ+EQTGvq8Ci0TnEoVw==","mode":420,"size":421},"test/index.js":{"checkedAt":1707939899727,"integrity":"sha512-XTCrW8qYddZ5Vxa4k6OrwZeZub0nGelqN7MnM2gc+r/qQCJ7mnAsRbHiu34v58r8GUZPPmTnJVUEt+W19eRXDg==","mode":420,"size":842},"package.json":{"checkedAt":1707939899728,"integrity":"sha512-AvCbGX9zxbzGjlWdOGs94y4/KY2vA562Q206YH6qnqp4SAe0b9j1D1nE1Rcq2xKRYP6OreO+gioExWi+QrZVXg==","mode":420,"size":2473},"tsconfig.json":{"checkedAt":1707939899728,"integrity":"sha512-fhkjfkbPLnfq20TKZOoXOkjIPPuE+hzfq9Hcppm/qudNdJs5twWkreSvBf0M/I1lY+fB0LhtqxHQG2A40N1UHA==","mode":420,"size":3611},"CHANGELOG.md":{"checkedAt":1707939899728,"integrity":"sha512-ed5f9kDXIfgmLFn6Cuck1yAOVBXVz5Acw8eJET9BFHOSgbXyKMrEc1kp3aadJ5LeeLtmfaJoOyYJnp6x2Jyepw==","mode":420,"size":2069},"README.md":{"checkedAt":1707939899728,"integrity":"sha512-ESTIpNdIMmSWkWCnHyksqqGqCvqA0kYzmg7yWlWqaIpXJzZVDoBodvMEDd+x1E9UVLpC2a6X28nu0KmZg09SEA==","mode":420,"size":1977},"index.d.ts":{"checkedAt":1707939899728,"integrity":"sha512-KUEj0AkkX/M+QVBLjiWN5xx84yOyV5T1x02Gqux+uetsfEUO2u6k8Q8X6k9vIde3Sgy1sap+yThYJwNJjF33sw==","mode":420,"size":170},".github/FUNDING.yml":{"checkedAt":1707939899728,"integrity":"sha512-cfg22BwuXqYcWfS6geIX0JX6paiz4nv8GAe6717DtAY6alextJPHltKPfMhLBzoYWi9OvDrXlvMEqXGNNkIthQ==","mode":420,"size":595}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6a/173dbe0c7d3b0303156e23b0498a6ebe1fc67d10b2427d2f766755f00e649e5723e21e5ab9c3a35efb9f92a4b31b01399472cb7b48c4092a0ff8b57bd3be6e b/.pnpm-store/v3/files/6a/173dbe0c7d3b0303156e23b0498a6ebe1fc67d10b2427d2f766755f00e649e5723e21e5ab9c3a35efb9f92a4b31b01399472cb7b48c4092a0ff8b57bd3be6e new file mode 100644 index 00000000..291188c7 --- /dev/null +++ b/.pnpm-store/v3/files/6a/173dbe0c7d3b0303156e23b0498a6ebe1fc67d10b2427d2f766755f00e649e5723e21e5ab9c3a35efb9f92a4b31b01399472cb7b48c4092a0ff8b57bd3be6e @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-dupe-class-members'); +exports.default = (0, util_1.createRule)({ + name: 'no-dupe-class-members', + meta: { + type: 'problem', + docs: { + description: 'Disallow duplicate class members', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + schema: baseRule.meta.schema, + messages: baseRule.meta.messages, + }, + defaultOptions: [], + create(context) { + const rules = baseRule.create(context); + function wrapMemberDefinitionListener(coreListener) { + return (node) => { + if (node.computed) { + return; + } + if (node.value && + node.value.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + return; + } + return coreListener(node); + }; + } + return { + ...rules, + 'MethodDefinition, PropertyDefinition': wrapMemberDefinitionListener(rules['MethodDefinition, PropertyDefinition']), + }; + }, +}); +//# sourceMappingURL=no-dupe-class-members.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6a/e33af0f4f87f90c4824824566944ef3753360cce74979d532bbcc98d995aeaf270ae7e79d6b3a59d6cae6f2989250c7a3d84a333b52b6ca4cc762401d6c046 b/.pnpm-store/v3/files/6a/e33af0f4f87f90c4824824566944ef3753360cce74979d532bbcc98d995aeaf270ae7e79d6b3a59d6cae6f2989250c7a3d84a333b52b6ca4cc762401d6c046 new file mode 100644 index 00000000..7e70218b --- /dev/null +++ b/.pnpm-store/v3/files/6a/e33af0f4f87f90c4824824566944ef3753360cce74979d532bbcc98d995aeaf270ae7e79d6b3a59d6cae6f2989250c7a3d84a333b52b6ca4cc762401d6c046 @@ -0,0 +1,77 @@ +{ + "name": "has-property-descriptors", + "version": "1.0.2", + "description": "Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/has-property-descriptors.git" + }, + "keywords": [ + "property", + "descriptors", + "has", + "environment", + "env", + "defineProperty", + "getOwnPropertyDescriptor" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/has-property-descriptors/issues" + }, + "homepage": "https://github.com/inspect-js/has-property-descriptors#readme", + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4" + }, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/.pnpm-store/v3/files/6b/501dc03823208fbee2f20a00cf4adfd1dea1adf865a93c1d30bfc635a6e26742ac1bc39a093619a2164253f24618429f68e2f6a2a16cc5fa1e27a448923b52 b/.pnpm-store/v3/files/6b/501dc03823208fbee2f20a00cf4adfd1dea1adf865a93c1d30bfc635a6e26742ac1bc39a093619a2164253f24618429f68e2f6a2a16cc5fa1e27a448923b52 new file mode 100644 index 00000000..07588c50 --- /dev/null +++ b/.pnpm-store/v3/files/6b/501dc03823208fbee2f20a00cf4adfd1dea1adf865a93c1d30bfc635a6e26742ac1bc39a093619a2164253f24618429f68e2f6a2a16cc5fa1e27a448923b52 @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Set = exports.Map = exports.version = exports.versionMajorMinor = void 0; +// WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values. +// If changing the text in this section, be sure to test `configurePrerelease` too. +exports.versionMajorMinor = "4.9"; +// The following is baselined as a literal template type without intervention +/** The version of the TypeScript compiler release */ +// eslint-disable-next-line @typescript-eslint/no-inferrable-types +exports.version = `${exports.versionMajorMinor}.0-dev`; +/* @internal */ +var NativeCollections; +(function (NativeCollections) { + const globals = typeof globalThis !== "undefined" ? globalThis : + // @ts-ignore node global + typeof global !== "undefined" ? global : + typeof self !== "undefined" ? self : + undefined; + /** + * Returns the native Map implementation if it is available and compatible (i.e. supports iteration). + */ + function tryGetNativeMap() { + // Internet Explorer's Map doesn't support iteration, so don't use it. + const gMap = globals?.Map; + // eslint-disable-next-line local/no-in-operator + const constructor = typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined; + if (!constructor) { + throw new Error("No compatible Map implementation found."); + } + return constructor; + } + NativeCollections.tryGetNativeMap = tryGetNativeMap; + /** + * Returns the native Set implementation if it is available and compatible (i.e. supports iteration). + */ + function tryGetNativeSet() { + // Internet Explorer's Set doesn't support iteration, so don't use it. + const gSet = globals?.Set; + // eslint-disable-next-line local/no-in-operator + const constructor = typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined; + if (!constructor) { + throw new Error("No compatible Set implementation found."); + } + return constructor; + } + NativeCollections.tryGetNativeSet = tryGetNativeSet; +})(NativeCollections || (NativeCollections = {})); +/* @internal */ +exports.Map = NativeCollections.tryGetNativeMap(); +/* @internal */ +exports.Set = NativeCollections.tryGetNativeSet(); +//# sourceMappingURL=corePublic.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6b/7af5e5cfd04b996f01eabef141ae9f8344c08a04436f28fcbccb22ac89e1c1454929272df3112797746f96d629e8a1467030d019c35b498bbb9901e8485adf b/.pnpm-store/v3/files/6b/7af5e5cfd04b996f01eabef141ae9f8344c08a04436f28fcbccb22ac89e1c1454929272df3112797746f96d629e8a1467030d019c35b498bbb9901e8485adf new file mode 100644 index 00000000..9639d92e --- /dev/null +++ b/.pnpm-store/v3/files/6b/7af5e5cfd04b996f01eabef141ae9f8344c08a04436f28fcbccb22ac89e1c1454929272df3112797746f96d629e8a1467030d019c35b498bbb9901e8485adf @@ -0,0 +1,41 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var callBound = require('call-bind/callBound'); + +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); + +var $strSlice = callBound('String.prototype.slice'); + +// https://262.ecma-international.org/11.0/#sec-stringpad + +module.exports = function StringPad(O, maxLength, fillString, placement) { + if (placement !== 'start' && placement !== 'end') { + throw new $TypeError('Assertion failed: `placement` must be "start" or "end"'); + } + var S = ToString(O); + var intMaxLength = ToLength(maxLength); + var stringLength = S.length; + if (intMaxLength <= stringLength) { + return S; + } + var filler = typeof fillString === 'undefined' ? ' ' : ToString(fillString); + if (filler === '') { + return S; + } + var fillLen = intMaxLength - stringLength; + + // the String value consisting of repeated concatenations of filler truncated to length fillLen. + var truncatedStringFiller = ''; + while (truncatedStringFiller.length < fillLen) { + truncatedStringFiller += filler; + } + truncatedStringFiller = $strSlice(truncatedStringFiller, 0, fillLen); + + if (placement === 'start') { + return truncatedStringFiller + S; + } + return S + truncatedStringFiller; +}; diff --git a/.pnpm-store/v3/files/6b/7bcd8018330a3bb9a194f00ab36d217ab13e7675c52866f758b8abcefd1df026922174b368f40349f1bd0fef1d3b8d9bd343dd2485ca06e76b8cfc53e319ef b/.pnpm-store/v3/files/6b/7bcd8018330a3bb9a194f00ab36d217ab13e7675c52866f758b8abcefd1df026922174b368f40349f1bd0fef1d3b8d9bd343dd2485ca06e76b8cfc53e319ef new file mode 100644 index 00000000..64f506a9 --- /dev/null +++ b/.pnpm-store/v3/files/6b/7bcd8018330a3bb9a194f00ab36d217ab13e7675c52866f758b8abcefd1df026922174b368f40349f1bd0fef1d3b8d9bd343dd2485ca06e76b8cfc53e319ef @@ -0,0 +1,925 @@ +import path from 'node:path'; +import fs from 'node:fs'; +import { performance } from 'node:perf_hooks'; +import { EventEmitter } from 'events'; +import { c as colors, a as createLogger, r as resolveConfig } from './chunks/dep-Glf1enhJ.js'; +import { VERSION } from './constants.js'; +import 'node:fs/promises'; +import 'node:url'; +import 'node:util'; +import 'node:module'; +import 'tty'; +import 'path'; +import 'esbuild'; +import 'fs'; +import 'assert'; +import 'node:http'; +import 'node:https'; +import 'util'; +import 'net'; +import 'url'; +import 'http'; +import 'stream'; +import 'os'; +import 'child_process'; +import 'node:os'; +import 'node:child_process'; +import 'node:crypto'; +import 'node:dns'; +import 'crypto'; +import 'module'; +import 'node:assert'; +import 'node:v8'; +import 'node:worker_threads'; +import 'node:buffer'; +import 'node:events'; +import 'rollup/parseAst'; +import 'querystring'; +import 'node:readline'; +import 'zlib'; +import 'buffer'; +import 'https'; +import 'tls'; +import 'node:zlib'; + +function toArr(any) { + return any == null ? [] : Array.isArray(any) ? any : [any]; +} + +function toVal(out, key, val, opts) { + var x, old=out[key], nxt=( + !!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val)) + : typeof val === 'boolean' ? val + : !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val)) + : (x = +val,x * 0 === 0) ? x : val + ); + out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]); +} + +function mri2 (args, opts) { + args = args || []; + opts = opts || {}; + + var k, arr, arg, name, val, out={ _:[] }; + var i=0, j=0, idx=0, len=args.length; + + const alibi = opts.alias !== void 0; + const strict = opts.unknown !== void 0; + const defaults = opts.default !== void 0; + + opts.alias = opts.alias || {}; + opts.string = toArr(opts.string); + opts.boolean = toArr(opts.boolean); + + if (alibi) { + for (k in opts.alias) { + arr = opts.alias[k] = toArr(opts.alias[k]); + for (i=0; i < arr.length; i++) { + (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1); + } + } + } + + for (i=opts.boolean.length; i-- > 0;) { + arr = opts.alias[opts.boolean[i]] || []; + for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]); + } + + for (i=opts.string.length; i-- > 0;) { + arr = opts.alias[opts.string[i]] || []; + for (j=arr.length; j-- > 0;) opts.string.push(arr[j]); + } + + if (defaults) { + for (k in opts.default) { + name = typeof opts.default[k]; + arr = opts.alias[k] = opts.alias[k] || []; + if (opts[name] !== void 0) { + opts[name].push(k); + for (i=0; i < arr.length; i++) { + opts[name].push(arr[i]); + } + } + } + } + + const keys = strict ? Object.keys(opts.alias) : []; + + for (i=0; i < len; i++) { + arg = args[i]; + + if (arg === '--') { + out._ = out._.concat(args.slice(++i)); + break; + } + + for (j=0; j < arg.length; j++) { + if (arg.charCodeAt(j) !== 45) break; // "-" + } + + if (j === 0) { + out._.push(arg); + } else if (arg.substring(j, j + 3) === 'no-') { + name = arg.substring(j + 3); + if (strict && !~keys.indexOf(name)) { + return opts.unknown(arg); + } + out[name] = false; + } else { + for (idx=j+1; idx < arg.length; idx++) { + if (arg.charCodeAt(idx) === 61) break; // "=" + } + + name = arg.substring(j, idx); + val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]); + arr = (j === 2 ? [name] : name); + + for (idx=0; idx < arr.length; idx++) { + name = arr[idx]; + if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name); + toVal(out, name, (idx + 1 < arr.length) || val, opts); + } + } + } + + if (defaults) { + for (k in opts.default) { + if (out[k] === void 0) { + out[k] = opts.default[k]; + } + } + } + + if (alibi) { + for (k in out) { + arr = opts.alias[k] || []; + while (arr.length > 0) { + out[arr.shift()] = out[k]; + } + } + } + + return out; +} + +const removeBrackets = (v) => v.replace(/[<[].+/, "").trim(); +const findAllBrackets = (v) => { + const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g; + const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g; + const res = []; + const parse = (match) => { + let variadic = false; + let value = match[1]; + if (value.startsWith("...")) { + value = value.slice(3); + variadic = true; + } + return { + required: match[0].startsWith("<"), + value, + variadic + }; + }; + let angledMatch; + while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) { + res.push(parse(angledMatch)); + } + let squareMatch; + while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) { + res.push(parse(squareMatch)); + } + return res; +}; +const getMriOptions = (options) => { + const result = {alias: {}, boolean: []}; + for (const [index, option] of options.entries()) { + if (option.names.length > 1) { + result.alias[option.names[0]] = option.names.slice(1); + } + if (option.isBoolean) { + if (option.negated) { + const hasStringTypeOption = options.some((o, i) => { + return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean"; + }); + if (!hasStringTypeOption) { + result.boolean.push(option.names[0]); + } + } else { + result.boolean.push(option.names[0]); + } + } + } + return result; +}; +const findLongest = (arr) => { + return arr.sort((a, b) => { + return a.length > b.length ? -1 : 1; + })[0]; +}; +const padRight = (str, length) => { + return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`; +}; +const camelcase = (input) => { + return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => { + return p1 + p2.toUpperCase(); + }); +}; +const setDotProp = (obj, keys, val) => { + let i = 0; + let length = keys.length; + let t = obj; + let x; + for (; i < length; ++i) { + x = t[keys[i]]; + t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : []; + } +}; +const setByType = (obj, transforms) => { + for (const key of Object.keys(transforms)) { + const transform = transforms[key]; + if (transform.shouldTransform) { + obj[key] = Array.prototype.concat.call([], obj[key]); + if (typeof transform.transformFunction === "function") { + obj[key] = obj[key].map(transform.transformFunction); + } + } + } +}; +const getFileName = (input) => { + const m = /([^\\\/]+)$/.exec(input); + return m ? m[1] : ""; +}; +const camelcaseOptionName = (name) => { + return name.split(".").map((v, i) => { + return i === 0 ? camelcase(v) : v; + }).join("."); +}; +class CACError extends Error { + constructor(message) { + super(message); + this.name = this.constructor.name; + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error(message).stack; + } + } +} + +class Option { + constructor(rawName, description, config) { + this.rawName = rawName; + this.description = description; + this.config = Object.assign({}, config); + rawName = rawName.replace(/\.\*/g, ""); + this.negated = false; + this.names = removeBrackets(rawName).split(",").map((v) => { + let name = v.trim().replace(/^-{1,2}/, ""); + if (name.startsWith("no-")) { + this.negated = true; + name = name.replace(/^no-/, ""); + } + return camelcaseOptionName(name); + }).sort((a, b) => a.length > b.length ? 1 : -1); + this.name = this.names[this.names.length - 1]; + if (this.negated && this.config.default == null) { + this.config.default = true; + } + if (rawName.includes("<")) { + this.required = true; + } else if (rawName.includes("[")) { + this.required = false; + } else { + this.isBoolean = true; + } + } +} + +const processArgs = process.argv; +const platformInfo = `${process.platform}-${process.arch} node-${process.version}`; + +class Command { + constructor(rawName, description, config = {}, cli) { + this.rawName = rawName; + this.description = description; + this.config = config; + this.cli = cli; + this.options = []; + this.aliasNames = []; + this.name = removeBrackets(rawName); + this.args = findAllBrackets(rawName); + this.examples = []; + } + usage(text) { + this.usageText = text; + return this; + } + allowUnknownOptions() { + this.config.allowUnknownOptions = true; + return this; + } + ignoreOptionDefaultValue() { + this.config.ignoreOptionDefaultValue = true; + return this; + } + version(version, customFlags = "-v, --version") { + this.versionNumber = version; + this.option(customFlags, "Display version number"); + return this; + } + example(example) { + this.examples.push(example); + return this; + } + option(rawName, description, config) { + const option = new Option(rawName, description, config); + this.options.push(option); + return this; + } + alias(name) { + this.aliasNames.push(name); + return this; + } + action(callback) { + this.commandAction = callback; + return this; + } + isMatched(name) { + return this.name === name || this.aliasNames.includes(name); + } + get isDefaultCommand() { + return this.name === "" || this.aliasNames.includes("!"); + } + get isGlobalCommand() { + return this instanceof GlobalCommand; + } + hasOption(name) { + name = name.split(".")[0]; + return this.options.find((option) => { + return option.names.includes(name); + }); + } + outputHelp() { + const {name, commands} = this.cli; + const { + versionNumber, + options: globalOptions, + helpCallback + } = this.cli.globalCommand; + let sections = [ + { + body: `${name}${versionNumber ? `/${versionNumber}` : ""}` + } + ]; + sections.push({ + title: "Usage", + body: ` $ ${name} ${this.usageText || this.rawName}` + }); + const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0; + if (showCommands) { + const longestCommandName = findLongest(commands.map((command) => command.rawName)); + sections.push({ + title: "Commands", + body: commands.map((command) => { + return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`; + }).join("\n") + }); + sections.push({ + title: `For more info, run any command with the \`--help\` flag`, + body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n") + }); + } + let options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []]; + if (!this.isGlobalCommand && !this.isDefaultCommand) { + options = options.filter((option) => option.name !== "version"); + } + if (options.length > 0) { + const longestOptionName = findLongest(options.map((option) => option.rawName)); + sections.push({ + title: "Options", + body: options.map((option) => { + return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`; + }).join("\n") + }); + } + if (this.examples.length > 0) { + sections.push({ + title: "Examples", + body: this.examples.map((example) => { + if (typeof example === "function") { + return example(name); + } + return example; + }).join("\n") + }); + } + if (helpCallback) { + sections = helpCallback(sections) || sections; + } + console.log(sections.map((section) => { + return section.title ? `${section.title}: +${section.body}` : section.body; + }).join("\n\n")); + } + outputVersion() { + const {name} = this.cli; + const {versionNumber} = this.cli.globalCommand; + if (versionNumber) { + console.log(`${name}/${versionNumber} ${platformInfo}`); + } + } + checkRequiredArgs() { + const minimalArgsCount = this.args.filter((arg) => arg.required).length; + if (this.cli.args.length < minimalArgsCount) { + throw new CACError(`missing required args for command \`${this.rawName}\``); + } + } + checkUnknownOptions() { + const {options, globalCommand} = this.cli; + if (!this.config.allowUnknownOptions) { + for (const name of Object.keys(options)) { + if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) { + throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``); + } + } + } + } + checkOptionValue() { + const {options: parsedOptions, globalCommand} = this.cli; + const options = [...globalCommand.options, ...this.options]; + for (const option of options) { + const value = parsedOptions[option.name.split(".")[0]]; + if (option.required) { + const hasNegated = options.some((o) => o.negated && o.names.includes(option.name)); + if (value === true || value === false && !hasNegated) { + throw new CACError(`option \`${option.rawName}\` value is missing`); + } + } + } + } +} +class GlobalCommand extends Command { + constructor(cli) { + super("@@global@@", "", {}, cli); + } +} + +var __assign = Object.assign; +class CAC extends EventEmitter { + constructor(name = "") { + super(); + this.name = name; + this.commands = []; + this.rawArgs = []; + this.args = []; + this.options = {}; + this.globalCommand = new GlobalCommand(this); + this.globalCommand.usage(" [options]"); + } + usage(text) { + this.globalCommand.usage(text); + return this; + } + command(rawName, description, config) { + const command = new Command(rawName, description || "", config, this); + command.globalCommand = this.globalCommand; + this.commands.push(command); + return command; + } + option(rawName, description, config) { + this.globalCommand.option(rawName, description, config); + return this; + } + help(callback) { + this.globalCommand.option("-h, --help", "Display this message"); + this.globalCommand.helpCallback = callback; + this.showHelpOnExit = true; + return this; + } + version(version, customFlags = "-v, --version") { + this.globalCommand.version(version, customFlags); + this.showVersionOnExit = true; + return this; + } + example(example) { + this.globalCommand.example(example); + return this; + } + outputHelp() { + if (this.matchedCommand) { + this.matchedCommand.outputHelp(); + } else { + this.globalCommand.outputHelp(); + } + } + outputVersion() { + this.globalCommand.outputVersion(); + } + setParsedInfo({args, options}, matchedCommand, matchedCommandName) { + this.args = args; + this.options = options; + if (matchedCommand) { + this.matchedCommand = matchedCommand; + } + if (matchedCommandName) { + this.matchedCommandName = matchedCommandName; + } + return this; + } + unsetMatchedCommand() { + this.matchedCommand = void 0; + this.matchedCommandName = void 0; + } + parse(argv = processArgs, { + run = true + } = {}) { + this.rawArgs = argv; + if (!this.name) { + this.name = argv[1] ? getFileName(argv[1]) : "cli"; + } + let shouldParse = true; + for (const command of this.commands) { + const parsed = this.mri(argv.slice(2), command); + const commandName = parsed.args[0]; + if (command.isMatched(commandName)) { + shouldParse = false; + const parsedInfo = __assign(__assign({}, parsed), { + args: parsed.args.slice(1) + }); + this.setParsedInfo(parsedInfo, command, commandName); + this.emit(`command:${commandName}`, command); + } + } + if (shouldParse) { + for (const command of this.commands) { + if (command.name === "") { + shouldParse = false; + const parsed = this.mri(argv.slice(2), command); + this.setParsedInfo(parsed, command); + this.emit(`command:!`, command); + } + } + } + if (shouldParse) { + const parsed = this.mri(argv.slice(2)); + this.setParsedInfo(parsed); + } + if (this.options.help && this.showHelpOnExit) { + this.outputHelp(); + run = false; + this.unsetMatchedCommand(); + } + if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) { + this.outputVersion(); + run = false; + this.unsetMatchedCommand(); + } + const parsedArgv = {args: this.args, options: this.options}; + if (run) { + this.runMatchedCommand(); + } + if (!this.matchedCommand && this.args[0]) { + this.emit("command:*"); + } + return parsedArgv; + } + mri(argv, command) { + const cliOptions = [ + ...this.globalCommand.options, + ...command ? command.options : [] + ]; + const mriOptions = getMriOptions(cliOptions); + let argsAfterDoubleDashes = []; + const doubleDashesIndex = argv.indexOf("--"); + if (doubleDashesIndex > -1) { + argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1); + argv = argv.slice(0, doubleDashesIndex); + } + let parsed = mri2(argv, mriOptions); + parsed = Object.keys(parsed).reduce((res, name) => { + return __assign(__assign({}, res), { + [camelcaseOptionName(name)]: parsed[name] + }); + }, {_: []}); + const args = parsed._; + const options = { + "--": argsAfterDoubleDashes + }; + const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue; + let transforms = Object.create(null); + for (const cliOption of cliOptions) { + if (!ignoreDefault && cliOption.config.default !== void 0) { + for (const name of cliOption.names) { + options[name] = cliOption.config.default; + } + } + if (Array.isArray(cliOption.config.type)) { + if (transforms[cliOption.name] === void 0) { + transforms[cliOption.name] = Object.create(null); + transforms[cliOption.name]["shouldTransform"] = true; + transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0]; + } + } + } + for (const key of Object.keys(parsed)) { + if (key !== "_") { + const keys = key.split("."); + setDotProp(options, keys, parsed[key]); + setByType(options, transforms); + } + } + return { + args, + options + }; + } + runMatchedCommand() { + const {args, options, matchedCommand: command} = this; + if (!command || !command.commandAction) + return; + command.checkUnknownOptions(); + command.checkOptionValue(); + command.checkRequiredArgs(); + const actionArgs = []; + command.args.forEach((arg, index) => { + if (arg.variadic) { + actionArgs.push(args.slice(index)); + } else { + actionArgs.push(args[index]); + } + }); + actionArgs.push(options); + return command.commandAction.apply(this, actionArgs); + } +} + +const cac = (name = "") => new CAC(name); + +const cli = cac('vite'); +let profileSession = global.__vite_profile_session; +let profileCount = 0; +const stopProfiler = (log) => { + if (!profileSession) + return; + return new Promise((res, rej) => { + profileSession.post('Profiler.stop', (err, { profile }) => { + // Write profile to disk, upload, etc. + if (!err) { + const outPath = path.resolve(`./vite-profile-${profileCount++}.cpuprofile`); + fs.writeFileSync(outPath, JSON.stringify(profile)); + log(colors.yellow(`CPU profile written to ${colors.white(colors.dim(outPath))}`)); + profileSession = undefined; + res(); + } + else { + rej(err); + } + }); + }); +}; +const filterDuplicateOptions = (options) => { + for (const [key, value] of Object.entries(options)) { + if (Array.isArray(value)) { + options[key] = value[value.length - 1]; + } + } +}; +/** + * removing global flags before passing as command specific sub-configs + */ +function cleanOptions(options) { + const ret = { ...options }; + delete ret['--']; + delete ret.c; + delete ret.config; + delete ret.base; + delete ret.l; + delete ret.logLevel; + delete ret.clearScreen; + delete ret.d; + delete ret.debug; + delete ret.f; + delete ret.filter; + delete ret.m; + delete ret.mode; + // convert the sourcemap option to a boolean if necessary + if ('sourcemap' in ret) { + const sourcemap = ret.sourcemap; + ret.sourcemap = + sourcemap === 'true' + ? true + : sourcemap === 'false' + ? false + : ret.sourcemap; + } + return ret; +} +/** + * host may be a number (like 0), should convert to string + */ +const convertHost = (v) => { + if (typeof v === 'number') { + return String(v); + } + return v; +}; +/** + * base may be a number (like 0), should convert to empty string + */ +const convertBase = (v) => { + if (v === 0) { + return ''; + } + return v; +}; +cli + .option('-c, --config ', `[string] use specified config file`) + .option('--base ', `[string] public base path (default: /)`, { + type: [convertBase], +}) + .option('-l, --logLevel ', `[string] info | warn | error | silent`) + .option('--clearScreen', `[boolean] allow/disable clear screen when logging`) + .option('-d, --debug [feat]', `[string | boolean] show debug logs`) + .option('-f, --filter ', `[string] filter debug logs`) + .option('-m, --mode ', `[string] set env mode`); +// dev +cli + .command('[root]', 'start dev server') // default command + .alias('serve') // the command is called 'serve' in Vite's API + .alias('dev') // alias to align with the script name + .option('--host [host]', `[string] specify hostname`, { type: [convertHost] }) + .option('--port ', `[number] specify port`) + .option('--open [path]', `[boolean | string] open browser on startup`) + .option('--cors', `[boolean] enable CORS`) + .option('--strictPort', `[boolean] exit if specified port is already in use`) + .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`) + .action(async (root, options) => { + filterDuplicateOptions(options); + // output structure is preserved even after bundling so require() + // is ok here + const { createServer } = await import('./chunks/dep-Glf1enhJ.js').then(function (n) { return n.E; }); + try { + const server = await createServer({ + root, + base: options.base, + mode: options.mode, + configFile: options.config, + logLevel: options.logLevel, + clearScreen: options.clearScreen, + optimizeDeps: { force: options.force }, + server: cleanOptions(options), + }); + if (!server.httpServer) { + throw new Error('HTTP server not available'); + } + await server.listen(); + const info = server.config.logger.info; + const viteStartTime = global.__vite_start_time ?? false; + const startupDurationString = viteStartTime + ? colors.dim(`ready in ${colors.reset(colors.bold(Math.ceil(performance.now() - viteStartTime)))} ms`) + : ''; + const hasExistingLogs = process.stdout.bytesWritten > 0 || process.stderr.bytesWritten > 0; + info(`\n ${colors.green(`${colors.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, { + clear: !hasExistingLogs, + }); + server.printUrls(); + const customShortcuts = []; + if (profileSession) { + customShortcuts.push({ + key: 'p', + description: 'start/stop the profiler', + async action(server) { + if (profileSession) { + await stopProfiler(server.config.logger.info); + } + else { + const inspector = await import('node:inspector').then((r) => r.default); + await new Promise((res) => { + profileSession = new inspector.Session(); + profileSession.connect(); + profileSession.post('Profiler.enable', () => { + profileSession.post('Profiler.start', () => { + server.config.logger.info('Profiler started'); + res(); + }); + }); + }); + } + }, + }); + } + server.bindCLIShortcuts({ print: true, customShortcuts }); + } + catch (e) { + const logger = createLogger(options.logLevel); + logger.error(colors.red(`error when starting dev server:\n${e.stack}`), { + error: e, + }); + stopProfiler(logger.info); + process.exit(1); + } +}); +// build +cli + .command('build [root]', 'build for production') + .option('--target ', `[string] transpile target (default: 'modules')`) + .option('--outDir ', `[string] output directory (default: dist)`) + .option('--assetsDir ', `[string] directory under outDir to place assets in (default: assets)`) + .option('--assetsInlineLimit ', `[number] static asset base64 inline threshold in bytes (default: 4096)`) + .option('--ssr [entry]', `[string] build specified entry for server-side rendering`) + .option('--sourcemap [output]', `[boolean | "inline" | "hidden"] output source maps for build (default: false)`) + .option('--minify [minifier]', `[boolean | "terser" | "esbuild"] enable/disable minification, ` + + `or specify minifier to use (default: esbuild)`) + .option('--manifest [name]', `[boolean | string] emit build manifest json`) + .option('--ssrManifest [name]', `[boolean | string] emit ssr manifest json`) + .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`) + .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`) + .action(async (root, options) => { + filterDuplicateOptions(options); + const { build } = await import('./chunks/dep-Glf1enhJ.js').then(function (n) { return n.F; }); + const buildOptions = cleanOptions(options); + try { + await build({ + root, + base: options.base, + mode: options.mode, + configFile: options.config, + logLevel: options.logLevel, + clearScreen: options.clearScreen, + build: buildOptions, + }); + } + catch (e) { + createLogger(options.logLevel).error(colors.red(`error during build:\n${e.stack}`), { error: e }); + process.exit(1); + } + finally { + stopProfiler((message) => createLogger(options.logLevel).info(message)); + } +}); +// optimize +cli + .command('optimize [root]', 'pre-bundle dependencies') + .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`) + .action(async (root, options) => { + filterDuplicateOptions(options); + const { optimizeDeps } = await import('./chunks/dep-Glf1enhJ.js').then(function (n) { return n.D; }); + try { + const config = await resolveConfig({ + root, + base: options.base, + configFile: options.config, + logLevel: options.logLevel, + mode: options.mode, + }, 'serve'); + await optimizeDeps(config, options.force, true); + } + catch (e) { + createLogger(options.logLevel).error(colors.red(`error when optimizing deps:\n${e.stack}`), { error: e }); + process.exit(1); + } +}); +// preview +cli + .command('preview [root]', 'locally preview production build') + .option('--host [host]', `[string] specify hostname`, { type: [convertHost] }) + .option('--port ', `[number] specify port`) + .option('--strictPort', `[boolean] exit if specified port is already in use`) + .option('--open [path]', `[boolean | string] open browser on startup`) + .option('--outDir ', `[string] output directory (default: dist)`) + .action(async (root, options) => { + filterDuplicateOptions(options); + const { preview } = await import('./chunks/dep-Glf1enhJ.js').then(function (n) { return n.G; }); + try { + const server = await preview({ + root, + base: options.base, + configFile: options.config, + logLevel: options.logLevel, + mode: options.mode, + build: { + outDir: options.outDir, + }, + preview: { + port: options.port, + strictPort: options.strictPort, + host: options.host, + open: options.open, + }, + }); + server.printUrls(); + server.bindCLIShortcuts({ print: true }); + } + catch (e) { + createLogger(options.logLevel).error(colors.red(`error when starting preview server:\n${e.stack}`), { error: e }); + process.exit(1); + } + finally { + stopProfiler((message) => createLogger(options.logLevel).info(message)); + } +}); +cli.help(); +cli.version(VERSION); +cli.parse(); + +export { stopProfiler }; diff --git a/.pnpm-store/v3/files/6b/bca64f3c672158c2ce0769816df82df6f331cb21bf32c51ff7afbc073e8fc04ebf8a51eda5ca820d4d4e5e0a3692c7b76a0dcc7c81611d12adf22a3762a92b b/.pnpm-store/v3/files/6b/bca64f3c672158c2ce0769816df82df6f331cb21bf32c51ff7afbc073e8fc04ebf8a51eda5ca820d4d4e5e0a3692c7b76a0dcc7c81611d12adf22a3762a92b new file mode 100644 index 00000000..e32e372f --- /dev/null +++ b/.pnpm-store/v3/files/6b/bca64f3c672158c2ce0769816df82df6f331cb21bf32c51ff7afbc073e8fc04ebf8a51eda5ca820d4d4e5e0a3692c7b76a0dcc7c81611d12adf22a3762a92b @@ -0,0 +1,537 @@ +import { escapeSelector, toArray } from '@unocss/core'; +import { createValueHandler, getStringComponent, parseCssColor, colorToString, colorOpacityToString, getStringComponents } from '@unocss/rule-utils'; + +const directionMap = { + "l": ["-left"], + "r": ["-right"], + "t": ["-top"], + "b": ["-bottom"], + "s": ["-inline-start"], + "e": ["-inline-end"], + "x": ["-left", "-right"], + "y": ["-top", "-bottom"], + "": [""], + "bs": ["-block-start"], + "be": ["-block-end"], + "is": ["-inline-start"], + "ie": ["-inline-end"], + "block": ["-block-start", "-block-end"], + "inline": ["-inline-start", "-inline-end"] +}; +const insetMap = { + ...directionMap, + s: ["-inset-inline-start"], + start: ["-inset-inline-start"], + e: ["-inset-inline-end"], + end: ["-inset-inline-end"], + bs: ["-inset-block-start"], + be: ["-inset-block-end"], + is: ["-inset-inline-start"], + ie: ["-inset-inline-end"], + block: ["-inset-block-start", "-inset-block-end"], + inline: ["-inset-inline-start", "-inset-inline-end"] +}; +const cornerMap = { + "l": ["-top-left", "-bottom-left"], + "r": ["-top-right", "-bottom-right"], + "t": ["-top-left", "-top-right"], + "b": ["-bottom-left", "-bottom-right"], + "tl": ["-top-left"], + "lt": ["-top-left"], + "tr": ["-top-right"], + "rt": ["-top-right"], + "bl": ["-bottom-left"], + "lb": ["-bottom-left"], + "br": ["-bottom-right"], + "rb": ["-bottom-right"], + "": [""], + "bs": ["-start-start", "-start-end"], + "be": ["-end-start", "-end-end"], + "s": ["-end-start", "-start-start"], + "is": ["-end-start", "-start-start"], + "e": ["-start-end", "-end-end"], + "ie": ["-start-end", "-end-end"], + "ss": ["-start-start"], + "bs-is": ["-start-start"], + "is-bs": ["-start-start"], + "se": ["-start-end"], + "bs-ie": ["-start-end"], + "ie-bs": ["-start-end"], + "es": ["-end-start"], + "be-is": ["-end-start"], + "is-be": ["-end-start"], + "ee": ["-end-end"], + "be-ie": ["-end-end"], + "ie-be": ["-end-end"] +}; +const xyzMap = { + "x": ["-x"], + "y": ["-y"], + "z": ["-z"], + "": ["-x", "-y"] +}; +const basePositionMap = [ + "top", + "top center", + "top left", + "top right", + "bottom", + "bottom center", + "bottom left", + "bottom right", + "left", + "left center", + "left top", + "left bottom", + "right", + "right center", + "right top", + "right bottom", + "center", + "center top", + "center bottom", + "center left", + "center right", + "center center" +]; +const positionMap = Object.assign( + {}, + ...basePositionMap.map((p) => ({ [p.replace(/ /, "-")]: p })), + ...basePositionMap.map((p) => ({ [p.replace(/\b(\w)\w+/g, "$1").replace(/ /, "")]: p })) +); +const globalKeywords = [ + "inherit", + "initial", + "revert", + "revert-layer", + "unset" +]; +const cssMathFnRE = /^(calc|clamp|min|max)\s*\((.+)\)(.*)/; + +const numberWithUnitRE = /^(-?\d*(?:\.\d+)?)(px|pt|pc|%|r?(?:em|ex|lh|cap|ch|ic)|(?:[sld]?v|cq)(?:[whib]|min|max)|in|cm|mm|rpx)?$/i; +const numberRE = /^(-?\d*(?:\.\d+)?)$/i; +const unitOnlyRE = /^(px)$/i; +const bracketTypeRe = /^\[(color|length|position|quoted|string):/i; + +const cssProps = [ + // basic props + "color", + "border-color", + "background-color", + "flex-grow", + "flex", + "flex-shrink", + "caret-color", + "font", + "gap", + "opacity", + "visibility", + "z-index", + "font-weight", + "zoom", + "text-shadow", + "transform", + "box-shadow", + // positions + "background-position", + "left", + "right", + "top", + "bottom", + "object-position", + // sizes + "max-height", + "min-height", + "max-width", + "min-width", + "height", + "width", + "border-width", + "margin", + "padding", + "outline-width", + "outline-offset", + "font-size", + "line-height", + "text-indent", + "vertical-align", + "border-spacing", + "letter-spacing", + "word-spacing", + // enhances + "stroke", + "filter", + "backdrop-filter", + "fill", + "mask", + "mask-size", + "mask-border", + "clip-path", + "clip", + "border-radius" +]; +function round(n) { + return n.toFixed(10).replace(/\.0+$/, "").replace(/(\.\d+?)0+$/, "$1"); +} +function numberWithUnit(str) { + const match = str.match(numberWithUnitRE); + if (!match) + return; + const [, n, unit] = match; + const num = Number.parseFloat(n); + if (unit && !Number.isNaN(num)) + return `${round(num)}${unit}`; +} +function auto(str) { + if (str === "auto" || str === "a") + return "auto"; +} +function rem(str) { + if (unitOnlyRE.test(str)) + return `1${str}`; + const match = str.match(numberWithUnitRE); + if (!match) + return; + const [, n, unit] = match; + const num = Number.parseFloat(n); + if (!Number.isNaN(num)) { + if (num === 0) + return "0"; + return unit ? `${round(num)}${unit}` : `${round(num / 4)}rem`; + } +} +function px(str) { + if (unitOnlyRE.test(str)) + return `1${str}`; + const match = str.match(numberWithUnitRE); + if (!match) + return; + const [, n, unit] = match; + const num = Number.parseFloat(n); + if (!Number.isNaN(num)) + return unit ? `${round(num)}${unit}` : `${round(num)}px`; +} +function number(str) { + if (!numberRE.test(str)) + return; + const num = Number.parseFloat(str); + if (!Number.isNaN(num)) + return round(num); +} +function percent(str) { + if (str.endsWith("%")) + str = str.slice(0, -1); + if (!numberRE.test(str)) + return; + const num = Number.parseFloat(str); + if (!Number.isNaN(num)) + return `${round(num / 100)}`; +} +function fraction(str) { + if (str === "full") + return "100%"; + const [left, right] = str.split("/"); + const num = Number.parseFloat(left) / Number.parseFloat(right); + if (!Number.isNaN(num)) { + if (num === 0) + return "0"; + return `${round(num * 100)}%`; + } +} +function bracketWithType(str, requiredType) { + if (str && str.startsWith("[") && str.endsWith("]")) { + let base; + let hintedType; + const match = str.match(bracketTypeRe); + if (!match) { + base = str.slice(1, -1); + } else { + if (!requiredType) + hintedType = match[1]; + base = str.slice(match[0].length, -1); + } + if (!base) + return; + if (base === '=""') + return; + if (base.startsWith("--")) + base = `var(${base})`; + let curly = 0; + for (const i of base) { + if (i === "[") { + curly += 1; + } else if (i === "]") { + curly -= 1; + if (curly < 0) + return; + } + } + if (curly) + return; + switch (hintedType) { + case "string": + return base.replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_"); + case "quoted": + return base.replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(["\\])/g, "\\$1").replace(/^(.+)$/, '"$1"'); + } + return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(?:calc|clamp|max|min)\((.*)/g, (match2) => { + const vars = []; + return match2.replace(/var\((--.+?)[,)]/g, (match3, g1) => { + vars.push(g1); + return match3.replace(g1, "--un-calc"); + }).replace(/(-?\d*\.?\d(?!\b-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ").replace(/--un-calc/g, () => vars.shift()); + }); + } +} +function bracket(str) { + return bracketWithType(str); +} +function bracketOfColor(str) { + return bracketWithType(str, "color"); +} +function bracketOfLength(str) { + return bracketWithType(str, "length"); +} +function bracketOfPosition(str) { + return bracketWithType(str, "position"); +} +function cssvar(str) { + if (/^\$[^\s'"`;{}]/.test(str)) { + const [name, defaultValue] = str.slice(1).split(","); + return `var(--${escapeSelector(name)}${defaultValue ? `, ${defaultValue}` : ""})`; + } +} +function time(str) { + const match = str.match(/^(-?[0-9.]+)(s|ms)?$/i); + if (!match) + return; + const [, n, unit] = match; + const num = Number.parseFloat(n); + if (!Number.isNaN(num)) { + if (num === 0 && !unit) + return "0s"; + return unit ? `${round(num)}${unit}` : `${round(num)}ms`; + } +} +function degree(str) { + const match = str.match(/^(-?[0-9.]+)(deg|rad|grad|turn)?$/i); + if (!match) + return; + const [, n, unit] = match; + const num = Number.parseFloat(n); + if (!Number.isNaN(num)) { + if (num === 0) + return "0"; + return unit ? `${round(num)}${unit}` : `${round(num)}deg`; + } +} +function global(str) { + if (globalKeywords.includes(str)) + return str; +} +function properties(str) { + if (str.split(",").every((prop) => cssProps.includes(prop))) + return str; +} +function position(str) { + if (["top", "left", "right", "bottom", "center"].includes(str)) + return str; +} + +const valueHandlers = { + __proto__: null, + auto: auto, + bracket: bracket, + bracketOfColor: bracketOfColor, + bracketOfLength: bracketOfLength, + bracketOfPosition: bracketOfPosition, + cssvar: cssvar, + degree: degree, + fraction: fraction, + global: global, + number: number, + numberWithUnit: numberWithUnit, + percent: percent, + position: position, + properties: properties, + px: px, + rem: rem, + time: time +}; + +const handler = createValueHandler(valueHandlers); +const h = handler; + +const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative"; +function directionSize(propertyPrefix) { + return ([_, direction, size], { theme }) => { + const v = theme.spacing?.[size || "DEFAULT"] ?? h.bracket.cssvar.global.auto.fraction.rem(size); + if (v != null) + return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]); + }; +} +function getThemeColorForKey(theme, colors, key = "colors") { + let obj = theme[key]; + let index = -1; + for (const c of colors) { + index += 1; + if (obj && typeof obj !== "string") { + const camel = colors.slice(index).join("-").replace(/(-[a-z])/g, (n) => n.slice(1).toUpperCase()); + if (obj[camel]) + return obj[camel]; + if (obj[c]) { + obj = obj[c]; + continue; + } + } + return void 0; + } + return obj; +} +function getThemeColor(theme, colors, key) { + return getThemeColorForKey(theme, colors, key) || getThemeColorForKey(theme, colors, "colors"); +} +function splitShorthand(body, type) { + const [front, rest] = getStringComponent(body, "[", "]", ["/", ":"]) ?? []; + if (front != null) { + const match = (front.match(bracketTypeRe) ?? [])[1]; + if (match == null || match === type) + return [front, rest]; + } +} +function parseColor(body, theme, key) { + const split = splitShorthand(body, "color"); + if (!split) + return; + const [main, opacity] = split; + const colors = main.replace(/([a-z])([0-9])/g, "$1-$2").split(/-/g); + const [name] = colors; + if (!name) + return; + let color; + const bracket = h.bracketOfColor(main); + const bracketOrMain = bracket || main; + if (h.numberWithUnit(bracketOrMain)) + return; + if (/^#[\da-fA-F]+/.test(bracketOrMain)) + color = bracketOrMain; + else if (/^hex-[\da-fA-F]+/.test(bracketOrMain)) + color = `#${bracketOrMain.slice(4)}`; + else if (main.startsWith("$")) + color = h.cssvar(main); + color = color || bracket; + if (!color) { + const colorData = getThemeColor(theme, [main], key); + if (typeof colorData === "string") + color = colorData; + } + let no = "DEFAULT"; + if (!color) { + let colorData; + const [scale] = colors.slice(-1); + if (/^\d+$/.test(scale)) { + no = scale; + colorData = getThemeColor(theme, colors.slice(0, -1), key); + if (!colorData || typeof colorData === "string") + color = void 0; + else + color = colorData[no]; + } else { + colorData = getThemeColor(theme, colors, key); + if (!colorData && colors.length <= 2) { + [, no = no] = colors; + colorData = getThemeColor(theme, [name], key); + } + if (typeof colorData === "string") + color = colorData; + else if (no && colorData) + color = colorData[no]; + } + } + return { + opacity, + name, + no, + color, + cssColor: parseCssColor(color), + alpha: h.bracket.cssvar.percent(opacity ?? "") + }; +} +function colorResolver(property, varName, key, shouldPass) { + return ([, body], { theme }) => { + const data = parseColor(body, theme, key); + if (!data) + return; + const { alpha, color, cssColor } = data; + const css = {}; + if (cssColor) { + if (alpha != null) { + css[property] = colorToString(cssColor, alpha); + } else { + const opacityVar = `--un-${varName}-opacity`; + const result = colorToString(cssColor, `var(${opacityVar})`); + if (result.includes(opacityVar)) + css[opacityVar] = colorOpacityToString(cssColor); + css[property] = result; + } + } else if (color) { + if (alpha != null) { + css[property] = colorToString(color, alpha); + } else { + const opacityVar = `--un-${varName}-opacity`; + const result = colorToString(color, `var(${opacityVar})`); + if (result.includes(opacityVar)) + css[opacityVar] = 1; + css[property] = result; + } + } + if (shouldPass?.(css) !== false) + return css; + }; +} +function colorableShadows(shadows, colorVar) { + const colored = []; + shadows = toArray(shadows); + for (let i = 0; i < shadows.length; i++) { + const components = getStringComponents(shadows[i], " ", 6); + if (!components || components.length < 3) + return shadows; + if (parseCssColor(components.at(0))) + return shadows; + let colorVarValue = ""; + if (parseCssColor(components.at(-1))) { + const color = parseCssColor(components.pop()); + if (color) + colorVarValue = `, ${colorToString(color)}`; + } + colored.push(`${components.join(" ")} var(${colorVar}${colorVarValue})`); + } + return colored; +} +function hasParseableColor(color, theme, key) { + return color != null && !!parseColor(color, theme, key)?.color; +} +function resolveBreakpoints({ theme, generator }, key = "breakpoints") { + let breakpoints; + if (generator.userConfig && generator.userConfig.theme) + breakpoints = generator.userConfig.theme[key]; + if (!breakpoints) + breakpoints = theme[key]; + return breakpoints ? Object.entries(breakpoints).sort((a, b) => Number.parseInt(a[1].replace(/[a-z]+/gi, "")) - Number.parseInt(b[1].replace(/[a-z]+/gi, ""))).map(([point, size]) => ({ point, size })) : void 0; +} +function resolveVerticalBreakpoints(context) { + return resolveBreakpoints(context, "verticalBreakpoints"); +} +function makeGlobalStaticRules(prefix, property) { + return globalKeywords.map((keyword) => [`${prefix}-${keyword}`, { [property ?? prefix]: keyword }]); +} +function isCSSMathFn(value) { + return value != null && cssMathFnRE.test(value); +} +function isSize(str) { + if (str[0] === "[" && str.slice(-1) === "]") + str = str.slice(1, -1); + return cssMathFnRE.test(str) || numberWithUnitRE.test(str); +} + +export { CONTROL_MINI_NO_NEGATIVE as C, cssMathFnRE as a, h as b, cornerMap as c, directionMap as d, directionSize as e, parseColor as f, globalKeywords as g, handler as h, insetMap as i, colorResolver as j, colorableShadows as k, hasParseableColor as l, resolveVerticalBreakpoints as m, makeGlobalStaticRules as n, isCSSMathFn as o, positionMap as p, isSize as q, resolveBreakpoints as r, splitShorthand as s, valueHandlers as v, xyzMap as x }; diff --git a/.pnpm-store/v3/files/6b/d9622021a7347151c4a3bf5db514e6bc72e80c417d3881660aba9b0ec290c00053474e5a51bb969d2b41189b9665b1bebbcc370a076327c2d7957aedcbcf21 b/.pnpm-store/v3/files/6b/d9622021a7347151c4a3bf5db514e6bc72e80c417d3881660aba9b0ec290c00053474e5a51bb969d2b41189b9665b1bebbcc370a076327c2d7957aedcbcf21 new file mode 100644 index 00000000..f814179e --- /dev/null +++ b/.pnpm-store/v3/files/6b/d9622021a7347151c4a3bf5db514e6bc72e80c417d3881660aba9b0ec290c00053474e5a51bb969d2b41189b9665b1bebbcc370a076327c2d7957aedcbcf21 @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +const cdn = require('./shared/preset-icons.MWpPOK0g.cjs'); +const core = require('./shared/preset-icons.NrmmzneW.cjs'); +require('ofetch'); +require('@unocss/core'); + +async function createNodeLoader() { + try { + return await import('@iconify/utils/lib/loader/node-loader').then((i) => i?.loadNodeIcon); + } catch { + } + try { + return require("@iconify/utils/lib/loader/node-loader.cjs").loadNodeIcon; + } catch { + } +} +const presetIcons = /* @__PURE__ */ core.createPresetIcons(async (options) => { + const { + cdn: cdn$1 + } = options; + const loaders = []; + const { + isNode, + isVSCode, + isESLint + } = core.getEnvFlags(); + if (isNode && !isVSCode && !isESLint) { + const nodeLoader = await createNodeLoader(); + if (nodeLoader !== void 0) + loaders.push(nodeLoader); + } + if (cdn$1) + loaders.push(cdn.createCDNLoader(cdn$1)); + loaders.push(core.loadIcon); + return core.combineLoaders(loaders); +}); + +exports.combineLoaders = core.combineLoaders; +exports.createCDNFetchLoader = core.createCDNFetchLoader; +exports.createPresetIcons = core.createPresetIcons; +exports.getEnvFlags = core.getEnvFlags; +exports.icons = core.icons; +exports.default = presetIcons; +exports.presetIcons = presetIcons; diff --git a/.pnpm-store/v3/files/6b/e062d6e25fa442aba7a25a86aa22a204dca90e67c8d76be258c10dd3e94772194423c8aac2f71b4a28ccafb37e7af00bec862ab6108f4274d89ef6cf505f6d-exec b/.pnpm-store/v3/files/6b/e062d6e25fa442aba7a25a86aa22a204dca90e67c8d76be258c10dd3e94772194423c8aac2f71b4a28ccafb37e7af00bec862ab6108f4274d89ef6cf505f6d-exec new file mode 100755 index 00000000..68e1036d --- /dev/null +++ b/.pnpm-store/v3/files/6b/e062d6e25fa442aba7a25a86aa22a204dca90e67c8d76be258c10dd3e94772194423c8aac2f71b4a28ccafb37e7af00bec862ab6108f4274d89ef6cf505f6d-exec @@ -0,0 +1,88 @@ +{ + "name": "postcss", + "version": "8.4.35", + "description": "Tool for transforming styles with JS plugins", + "engines": { + "node": "^10 || ^12 || >=14" + }, + "exports": { + ".": { + "require": "./lib/postcss.js", + "import": "./lib/postcss.mjs" + }, + "./lib/at-rule": "./lib/at-rule.js", + "./lib/comment": "./lib/comment.js", + "./lib/container": "./lib/container.js", + "./lib/css-syntax-error": "./lib/css-syntax-error.js", + "./lib/declaration": "./lib/declaration.js", + "./lib/fromJSON": "./lib/fromJSON.js", + "./lib/input": "./lib/input.js", + "./lib/lazy-result": "./lib/lazy-result.js", + "./lib/no-work-result": "./lib/no-work-result.js", + "./lib/list": "./lib/list.js", + "./lib/map-generator": "./lib/map-generator.js", + "./lib/node": "./lib/node.js", + "./lib/parse": "./lib/parse.js", + "./lib/parser": "./lib/parser.js", + "./lib/postcss": "./lib/postcss.js", + "./lib/previous-map": "./lib/previous-map.js", + "./lib/processor": "./lib/processor.js", + "./lib/result": "./lib/result.js", + "./lib/root": "./lib/root.js", + "./lib/rule": "./lib/rule.js", + "./lib/stringifier": "./lib/stringifier.js", + "./lib/stringify": "./lib/stringify.js", + "./lib/symbols": "./lib/symbols.js", + "./lib/terminal-highlight": "./lib/terminal-highlight.js", + "./lib/tokenize": "./lib/tokenize.js", + "./lib/warn-once": "./lib/warn-once.js", + "./lib/warning": "./lib/warning.js", + "./package.json": "./package.json" + }, + "main": "./lib/postcss.js", + "types": "./lib/postcss.d.ts", + "keywords": [ + "css", + "postcss", + "rework", + "preprocessor", + "parser", + "source map", + "transform", + "manipulation", + "transpiler" + ], + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "homepage": "https://postcss.org/", + "repository": "postcss/postcss", + "bugs": { + "url": "https://github.com/postcss/postcss/issues" + }, + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "browser": { + "./lib/terminal-highlight": false, + "source-map-js": false, + "path": false, + "url": false, + "fs": false + } +} diff --git a/.pnpm-store/v3/files/6c/33c221ba05eab5e7c22a2976074dc52b601dc692e2cbea455ccbc2368c2039b54bca4e6b5509ab909437ff754b54fa7e1839d132451fc9668f3e826be33ab7 b/.pnpm-store/v3/files/6c/33c221ba05eab5e7c22a2976074dc52b601dc692e2cbea455ccbc2368c2039b54bca4e6b5509ab909437ff754b54fa7e1839d132451fc9668f3e826be33ab7 new file mode 100644 index 00000000..52d3fda1 --- /dev/null +++ b/.pnpm-store/v3/files/6c/33c221ba05eab5e7c22a2976074dc52b601dc692e2cbea455ccbc2368c2039b54bca4e6b5509ab909437ff754b54fa7e1839d132451fc9668f3e826be33ab7 @@ -0,0 +1,45 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var callBound = require('call-bind/callBound'); +var forEach = require('../helpers/forEach'); + +var $charCodeAt = callBound('String.prototype.charCodeAt'); +var $strSplit = callBound('String.prototype.split'); + +var UnicodeEscape = require('./UnicodeEscape'); + +var hasOwn = require('hasown'); + +// https://262.ecma-international.org/9.0/#sec-quotejsonstring + +var escapes = { + '\u0008': '\\b', + '\u0009': '\\t', + '\u000A': '\\n', + '\u000C': '\\f', + '\u000D': '\\r', + '\u0022': '\\"', + '\u005c': '\\\\' +}; + +module.exports = function QuoteJSONString(value) { + if (typeof value !== 'string') { + throw new $TypeError('Assertion failed: `value` must be a String'); + } + var product = '"'; + if (value) { + forEach($strSplit(value), function (C) { + if (hasOwn(escapes, C)) { + product += escapes[C]; + } else if ($charCodeAt(C, 0) < 0x20) { + product += UnicodeEscape(C); + } else { + product += C; + } + }); + } + product += '"'; + return product; +}; diff --git a/.pnpm-store/v3/files/6c/3eddb4364ec004baa8ea1cae5281586caee19762d66f53ba7695b2be4928234a815085b8985cfcb3f9d1c24b24c37f0e88f6242700f6acb351f201064e18bb b/.pnpm-store/v3/files/6c/3eddb4364ec004baa8ea1cae5281586caee19762d66f53ba7695b2be4928234a815085b8985cfcb3f9d1c24b24c37f0e88f6242700f6acb351f201064e18bb new file mode 100644 index 00000000..2f022fbe --- /dev/null +++ b/.pnpm-store/v3/files/6c/3eddb4364ec004baa8ea1cae5281586caee19762d66f53ba7695b2be4928234a815085b8985cfcb3f9d1c24b24c37f0e88f6242700f6acb351f201064e18bb @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSourceCode = exports.getScope = exports.getFilename = exports.getDeclaredVariables = exports.getCwd = exports.getAncestors = void 0; +/** @deprecated use `context.sourceCode.getAncestors(node)` */ +function getAncestors(context) { + return context.getAncestors(); +} +exports.getAncestors = getAncestors; +/** @deprecated use `context.sourceCode.getCwd()` */ +function getCwd(context) { + return context.getCwd(); +} +exports.getCwd = getCwd; +/** @deprecated use `context.sourceCode.getDeclaredVariables(node)` */ +function getDeclaredVariables(context, node) { + return context.sourceCode.getDeclaredVariables(node); +} +exports.getDeclaredVariables = getDeclaredVariables; +/** @deprecated use `context.filename` */ +function getFilename(context) { + return context.filename; +} +exports.getFilename = getFilename; +/** @deprecated use `context.sourceCode.getScope(node) */ +function getScope(context) { + return context.getScope(); +} +exports.getScope = getScope; +/** @deprecated use `context.sourceCode` */ +function getSourceCode(context) { + return context.sourceCode; +} +exports.getSourceCode = getSourceCode; +//# sourceMappingURL=context.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6c/42aff0bdea7c540961b29f528417122df2915b449d7ef8998a6d837354dfb929ce2bd19c9f7656df6b6e52aecf7de6bfa6d2ddc5e6e8b1373d844f283acb04 b/.pnpm-store/v3/files/6c/42aff0bdea7c540961b29f528417122df2915b449d7ef8998a6d837354dfb929ce2bd19c9f7656df6b6e52aecf7de6bfa6d2ddc5e6e8b1373d844f283acb04 new file mode 100644 index 00000000..ab09ee27 --- /dev/null +++ b/.pnpm-store/v3/files/6c/42aff0bdea7c540961b29f528417122df2915b449d7ef8998a6d837354dfb929ce2bd19c9f7656df6b6e52aecf7de6bfa6d2ddc5e6e8b1373d844f283acb04 @@ -0,0 +1,30 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +const VitePlugin = require('@unocss/vite'); +const presetUno = require('@unocss/preset-uno'); + +function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } + +const VitePlugin__default = /*#__PURE__*/_interopDefaultCompat(VitePlugin); +const presetUno__default = /*#__PURE__*/_interopDefaultCompat(presetUno); + +function UnocssVitePlugin(configOrPath) { + return VitePlugin__default( + configOrPath, + { + presets: [ + presetUno__default() + ] + } + ); +} + +exports.default = UnocssVitePlugin; +Object.keys(VitePlugin).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) k === '__proto__' ? Object.defineProperty(exports, k, { + enumerable: true, + value: VitePlugin[k] + }) : exports[k] = VitePlugin[k]; +}); diff --git a/.pnpm-store/v3/files/6c/5cec4a8e2625f5b2bd697dc820eb0f83a5d18484184a5c5153657344d9e64190fe5857be634f107ff9211b2f5c3fe61ae6275ca3e96427e538ad4988285ded b/.pnpm-store/v3/files/6c/5cec4a8e2625f5b2bd697dc820eb0f83a5d18484184a5c5153657344d9e64190fe5857be634f107ff9211b2f5c3fe61ae6275ca3e96427e538ad4988285ded new file mode 100644 index 00000000..21dfaacb --- /dev/null +++ b/.pnpm-store/v3/files/6c/5cec4a8e2625f5b2bd697dc820eb0f83a5d18484184a5c5153657344d9e64190fe5857be634f107ff9211b2f5c3fe61ae6275ca3e96427e538ad4988285ded @@ -0,0 +1 @@ +{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":";AAEA,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;IACvC,OAAO,EAAE,CAAC,oBAAoB,CAAC;CACD,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6c/8a17da3e4c4bcf89d1b1a4bef82029185b956dc7938ad1e1c312e8b22dff9411691279909e9ca7bfe7815693657a38cc5348c989515f531a855779627e235d b/.pnpm-store/v3/files/6c/8a17da3e4c4bcf89d1b1a4bef82029185b956dc7938ad1e1c312e8b22dff9411691279909e9ca7bfe7815693657a38cc5348c989515f531a855779627e235d new file mode 100644 index 00000000..58c209bf --- /dev/null +++ b/.pnpm-store/v3/files/6c/8a17da3e4c4bcf89d1b1a4bef82029185b956dc7938ad1e1c312e8b22dff9411691279909e9ca7bfe7815693657a38cc5348c989515f531a855779627e235d @@ -0,0 +1,12 @@ +import type { ServicePlugin } from '@volar/language-service'; +import type * as ts from 'typescript'; +export * from '@volar/typescript'; +export interface Provide { + 'typescript/typescript': () => typeof import('typescript'); + 'typescript/languageService': () => ts.LanguageService; + 'typescript/languageServiceHost': () => ts.LanguageServiceHost; + 'typescript/syntacticLanguageService': () => ts.LanguageService; + 'typescript/syntacticLanguageServiceHost': () => ts.LanguageServiceHost; +} +export declare function create(ts: typeof import('typescript')): ServicePlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6c/a67d0cee58de091d597a4aa37c275f89520516e67723df5ea4207f96726c9678c741dbe34df71dfb4e819f0bb7fe291e7837dca807432dada2e7840846f2f1 b/.pnpm-store/v3/files/6c/a67d0cee58de091d597a4aa37c275f89520516e67723df5ea4207f96726c9678c741dbe34df71dfb4e819f0bb7fe291e7837dca807432dada2e7840846f2f1 new file mode 100644 index 00000000..0fee6f2b --- /dev/null +++ b/.pnpm-store/v3/files/6c/a67d0cee58de091d597a4aa37c275f89520516e67723df5ea4207f96726c9678c741dbe34df71dfb4e819f0bb7fe291e7837dca807432dada2e7840846f2f1 @@ -0,0 +1,51 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var callBound = require('call-bind/callBound'); +var hasOwn = require('hasown'); + +var $charCodeAt = callBound('String.prototype.charCodeAt'); +var $toUpperCase = callBound('String.prototype.toUpperCase'); + +var caseFolding = require('../helpers/caseFolding.json'); + +// https://262.ecma-international.org/6.0/#sec-runtime-semantics-canonicalize-ch + +module.exports = function Canonicalize(ch, IgnoreCase, Unicode) { + if (typeof ch !== 'string') { + throw new $TypeError('Assertion failed: `ch` must be a character'); + } + + if (typeof IgnoreCase !== 'boolean' || typeof Unicode !== 'boolean') { + throw new $TypeError('Assertion failed: `IgnoreCase` and `Unicode` must be Booleans'); + } + + if (!IgnoreCase) { + return ch; // step 1 + } + + if (Unicode) { // step 2 + if (hasOwn(caseFolding.C, ch)) { + return caseFolding.C[ch]; + } + if (hasOwn(caseFolding.S, ch)) { + return caseFolding.S[ch]; + } + return ch; // step 2.b + } + + var u = $toUpperCase(ch); // step 2 + + if (u.length !== 1) { + return ch; // step 3 + } + + var cu = u; // step 4 + + if ($charCodeAt(ch, 0) >= 128 && $charCodeAt(cu, 0) < 128) { + return ch; // step 5 + } + + return cu; +}; diff --git a/.pnpm-store/v3/files/6c/acd3298f93176dfe2cf9a051e746e7591581821f1580a6e082f15a6f097a198434ce1948d881e85cbe5b53c8c74699de0a268602cd0c6ea36db2ec39675374 b/.pnpm-store/v3/files/6c/acd3298f93176dfe2cf9a051e746e7591581821f1580a6e082f15a6f097a198434ce1948d881e85cbe5b53c8c74699de0a268602cd0c6ea36db2ec39675374 new file mode 100644 index 00000000..98997b53 --- /dev/null +++ b/.pnpm-store/v3/files/6c/acd3298f93176dfe2cf9a051e746e7591581821f1580a6e082f15a6f097a198434ce1948d881e85cbe5b53c8c74699de0a268602cd0c6ea36db2ec39675374 @@ -0,0 +1 @@ +{"version":3,"file":"no-loss-of-precision.js","sourceRoot":"","sources":["../../src/rules/no-loss-of-precision.ts"],"names":[],"mappings":";;AAMA,kCAAqC;AACrC,iEAA8D;AAE9D,MAAM,QAAQ,GAAG,IAAA,qCAAiB,EAAC,sBAAsB,CAAC,CAAC;AAK3D,kBAAe,IAAA,iBAAU,EAAsB;IAC7C,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,8CAA8C;YAC3D,WAAW,EAAE,aAAa;YAC1B,eAAe,EAAE,IAAI;SACtB;QACD,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,cAAc;QAC5C,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ;KACjC;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEvC,SAAS,kBAAkB,CAAC,IAAsB;YAChD,OAAO,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAClE,CAAC;QACD,OAAO;YACL,OAAO,CAAC,IAAsB;gBAC5B,KAAK,CAAC,OAAO,CAAC;oBACZ,GAAG,IAAI;oBACP,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG;iBAC7D,CAAC,CAAC;YACd,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6c/cc4c2808e0d77101495b1cc53698038991739b755005dada45e219335f674efd1c85971242a692016b87f9c9a9a99a2d2ad73b91f85851643c468b2566ecdc-index.json b/.pnpm-store/v3/files/6c/cc4c2808e0d77101495b1cc53698038991739b755005dada45e219335f674efd1c85971242a692016b87f9c9a9a99a2d2ad73b91f85851643c468b2566ecdc-index.json new file mode 100644 index 00000000..417709fd --- /dev/null +++ b/.pnpm-store/v3/files/6c/cc4c2808e0d77101495b1cc53698038991739b755005dada45e219335f674efd1c85971242a692016b87f9c9a9a99a2d2ad73b91f85851643c468b2566ecdc-index.json @@ -0,0 +1 @@ +{"files":{".editorconfig":{"checkedAt":1707939899731,"integrity":"sha512-p35O0lNr5b8Aha4N1dns/Zy3+rV1ZLx6ffSVcrlURzE+W3zbryu0BkQ6tiGeSgp248nP94ZxUa8iBmtp1ocZng==","mode":420,"size":276},".eslintrc":{"checkedAt":1707939899731,"integrity":"sha512-4fwqrIxQ8IRSCWyspgFN9rrstjhwvyf2R4xpZETWTZ/qdak2fm4yS8aVGqZAsLbUo3PuCVH0+lNGrDcaUlJDqw==","mode":420,"size":513},".nycrc":{"checkedAt":1707939899731,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1707939899731,"integrity":"sha512-YD/mx3rViEeU8K3dGxbnUG/FEexfAHNZySxWlXZd5fxB7gC1XFjt5VHPEDKxRey+bRbtajLYsWea3+YtaaviVg==","mode":420,"size":1073},"auto.js":{"checkedAt":1707939899731,"integrity":"sha512-8Q3Im5cACiIFrMmxvLnJnA8SXOjAd1kh/R0UIDVnErDD1WUlJIDrNfaOcIB6rtjAXNhq/OdL1374JM/QcAJ1VQ==","mode":420,"size":36},"implementation.js":{"checkedAt":1707939899731,"integrity":"sha512-vYxb9azw9UDpGuSy7PYWAcXHHin82wJlNQBeS5Vkdc4Wss+qIDTspDCjIFnXhq8QUBvYS6TvPxqO2wIRVsZ+gA==","mode":420,"size":2667},"test/implementation.js":{"checkedAt":1707939899731,"integrity":"sha512-bAkZb4Jr6rSnMqJKkpNd3jta05MiTddds6oB30cdap59z8bKjSSyO3wQSvktyKMZJG0v/fEBgVL/T6+D7kQgZg==","mode":420,"size":978},"index.js":{"checkedAt":1707939899731,"integrity":"sha512-Tpt8yR4aUiXTCjb/dnNDScDRO4yfTGzSUI8Pty3sTcubEJs7lH/z68M7fahv/G7wr3UCHCEKKgOI9+x4kFLZBQ==","mode":420,"size":373},"test/index.js":{"checkedAt":1707939899731,"integrity":"sha512-AjYEiEqDPkQ3CPh56nyE8x4QFcAqKvs4x0foThkUYWlUtpunallnLSVFBMUlh44+nRwmOoIOFdZ1qzRiJiQm0g==","mode":420,"size":747},"polyfill.js":{"checkedAt":1707939899731,"integrity":"sha512-m4HgrRs+iolo7LfIe01VWchG5cCjeMO/lALQ54bppkT0sOKE7cLitydRyLg53Vw9guObo37SsUyeh3t81lK9cg==","mode":420,"size":638},"shim.js":{"checkedAt":1707939899731,"integrity":"sha512-WwD7o1N+30XhYF33ABFsW96lpJcANbFHITq8gB3/809skb07pqWkQnUNVWcamd4tbqORV7z2SCyp7zqsAgY4Yw==","mode":420,"size":395},"test/shimmed.js":{"checkedAt":1707939899731,"integrity":"sha512-nHwvWCHxLbOWL0k2A8kXSuC4OEO/CsFoVbcurWIJFvBXyymMUrWJWsSmPfZhj2WmBKijfG5MLLhL3gj9NXvHow==","mode":420,"size":1779},"test/tests.js":{"checkedAt":1707939899732,"integrity":"sha512-r0pCTYt/cjiRvBc3+f9Igztlwjqs5MqS21t2Rmp499KeHuxNW2Avl/dRi4jf1R2EXAG3U2nWv+Sh1q0wGbWDIw==","mode":420,"size":2271},"package.json":{"checkedAt":1707939899732,"integrity":"sha512-/MyMtBKI6XLg7LSyPoa0i4LQMoc8R5/yFdGMHhWBKv2rYi/DclSigzR1srjCFh5fWN/RNpUggWpPFFjTecn8Gg==","mode":420,"size":2842},"CHANGELOG.md":{"checkedAt":1707939899732,"integrity":"sha512-Wz3fk5ZpmW5Vj8HbAnoWHZTTic9jAxOCaJr0t0kbiRaLFubls6hH6Qp6KciwTekkcmruo5LT3Ii+hyP/z1LAzQ==","mode":420,"size":2891},"README.md":{"checkedAt":1707939899732,"integrity":"sha512-0UBKoQQmPjN4V76T8QaS+bAHaMGluEktk37m14Ry8+OwymcdIhEGWsBomYYzQY8j0IT9gu4Y5tbUOyYGZSdbQA==","mode":420,"size":2561}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6d/088d1a03bba7203eefc2c05e37ef99424c3d0eccdd86c70ce6b1b55137214f2f13c4207c3c722d4c3c5ef4b4f575ab3cfb61a64c45dda2edddfd2e0a7b8702 b/.pnpm-store/v3/files/6d/088d1a03bba7203eefc2c05e37ef99424c3d0eccdd86c70ce6b1b55137214f2f13c4207c3c722d4c3c5ef4b4f575ab3cfb61a64c45dda2edddfd2e0a7b8702 new file mode 100644 index 00000000..9423ca96 --- /dev/null +++ b/.pnpm-store/v3/files/6d/088d1a03bba7203eefc2c05e37ef99424c3d0eccdd86c70ce6b1b55137214f2f13c4207c3c722d4c3c5ef4b4f575ab3cfb61a64c45dda2edddfd2e0a7b8702 @@ -0,0 +1,3 @@ +declare const typescriptVersionIsAtLeast: Record<"4.7" | "4.8" | "4.9" | "5.0" | "5.1" | "5.2" | "5.3" | "5.4", boolean>; +export { typescriptVersionIsAtLeast }; +//# sourceMappingURL=version-check.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6d/17c975c2c08a067fcae030d28df41aa0e6afc48b4ff81d09bfdbb68df4df504b232a3401fda53049300f1e73df2d1a0d7186b528066c11358b2a06515e10f3 b/.pnpm-store/v3/files/6d/17c975c2c08a067fcae030d28df41aa0e6afc48b4ff81d09bfdbb68df4df504b232a3401fda53049300f1e73df2d1a0d7186b528066c11358b2a06515e10f3 new file mode 100644 index 00000000..828b7141 --- /dev/null +++ b/.pnpm-store/v3/files/6d/17c975c2c08a067fcae030d28df41aa0e6afc48b4ff81d09bfdbb68df4df504b232a3401fda53049300f1e73df2d1a0d7186b528066c11358b2a06515e10f3 @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getInferredCompilerOptions = void 0; +async function getInferredCompilerOptions(configurationHost) { + let [implicitProjectConfig_1, implicitProjectConfig_2] = await Promise.all([ + configurationHost?.getConfiguration?.('js/ts.implicitProjectConfig'), + configurationHost?.getConfiguration?.('javascript.implicitProjectConfig'), + ]); + implicitProjectConfig_1 = implicitProjectConfig_1 ?? {}; + implicitProjectConfig_2 = implicitProjectConfig_2 ?? {}; + const checkJs = readCheckJs(); + const experimentalDecorators = readExperimentalDecorators(); + const strictNullChecks = readImplicitStrictNullChecks(); + const strictFunctionTypes = readImplicitStrictFunctionTypes(); + const options = { + ...inferredProjectCompilerOptions('typescript'), + allowJs: true, + allowSyntheticDefaultImports: true, + allowNonTsExtensions: true, + resolveJsonModule: true, + jsx: 1 /* ts.JsxEmit.Preserve */, + }; + return options; + function readCheckJs() { + return implicitProjectConfig_1['checkJs'] + ?? implicitProjectConfig_2['checkJs'] + ?? false; + } + function readExperimentalDecorators() { + return implicitProjectConfig_1['experimentalDecorators'] + ?? implicitProjectConfig_2['experimentalDecorators'] + ?? false; + } + function readImplicitStrictNullChecks() { + return implicitProjectConfig_1['strictNullChecks'] ?? false; + } + function readImplicitStrictFunctionTypes() { + return implicitProjectConfig_1['strictFunctionTypes'] ?? true; + } + function inferredProjectCompilerOptions(projectType) { + const projectConfig = { + module: 1 /* ts.ModuleKind.CommonJS */, + target: 7 /* ts.ScriptTarget.ES2020 */, + jsx: 1 /* ts.JsxEmit.Preserve */, + }; + if (checkJs) { + projectConfig.checkJs = true; + if (projectType === 'typescript') { + projectConfig.allowJs = true; + } + } + if (experimentalDecorators) { + projectConfig.experimentalDecorators = true; + } + if (strictNullChecks) { + projectConfig.strictNullChecks = true; + } + if (strictFunctionTypes) { + projectConfig.strictFunctionTypes = true; + } + if (projectType === 'typescript') { + projectConfig.sourceMap = true; + } + return projectConfig; + } +} +exports.getInferredCompilerOptions = getInferredCompilerOptions; +//# sourceMappingURL=inferredCompilerOptions.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6d/9a07a3afb800eae672e8e4eb0f8f764662ad29b481d9ef39d7de733543901408a3d4f74b700c83042f9f21a6875a0fdf94f4ba94d39bbd878259d235e1d2de b/.pnpm-store/v3/files/6d/9a07a3afb800eae672e8e4eb0f8f764662ad29b481d9ef39d7de733543901408a3d4f74b700c83042f9f21a6875a0fdf94f4ba94d39bbd878259d235e1d2de new file mode 100644 index 00000000..cc1ea67b --- /dev/null +++ b/.pnpm-store/v3/files/6d/9a07a3afb800eae672e8e4eb0f8f764662ad29b481d9ef39d7de733543901408a3d4f74b700c83042f9f21a6875a0fdf94f4ba94d39bbd878259d235e1d2de @@ -0,0 +1,48 @@ +{ + "name": "@unocss/transformer-attributify-jsx-babel", + "version": "0.58.5", + "description": "Support valueless attributify in JSX/TSX.", + "author": "Anthony Fu ", + "license": "MIT", + "funding": "https://github.com/sponsors/antfu", + "homepage": "https://github.com/unocss/unocss/tree/main/packages/transformer-attributify-jsx-babel#readme", + "repository": { + "type": "git", + "url": "https://github.com/unocss/unocss", + "directory": "packages/transformer-attributify-jsx-babel" + }, + "bugs": { + "url": "https://github.com/unocss/unocss/issues" + }, + "keywords": [ + "unocss", + "unocss-transformer" + ], + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + } + }, + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/plugin-syntax-jsx": "^7.23.3", + "@babel/preset-typescript": "^7.23.3", + "@unocss/core": "0.58.5" + }, + "devDependencies": { + "magic-string": "^0.30.6" + }, + "scripts": { + "build": "unbuild", + "stub": "unbuild --stub" + } +} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6d/9c30883ca047717a4ee24d8ba7e9eb706f77a7c68f019b4a329a880c89f44d83ebead0f6b82ce6449645915058661504b9bd4db167cf95c45a239397f25178 b/.pnpm-store/v3/files/6d/9c30883ca047717a4ee24d8ba7e9eb706f77a7c68f019b4a329a880c89f44d83ebead0f6b82ce6449645915058661504b9bd4db167cf95c45a239397f25178 new file mode 100644 index 00000000..654e5fcb --- /dev/null +++ b/.pnpm-store/v3/files/6d/9c30883ca047717a4ee24d8ba7e9eb706f77a7c68f019b4a329a880c89f44d83ebead0f6b82ce6449645915058661504b9bd4db167cf95c45a239397f25178 @@ -0,0 +1,6166 @@ +'use strict'; + +var path$3 = require('node:path'); +var node_url = require('node:url'); +var fs$1 = require('node:fs'); +var esbuild = require('esbuild'); +var os$1 = require('node:os'); +var node_module = require('node:module'); +var require$$0 = require('tty'); +var require$$1 = require('util'); +var require$$0$1 = require('path'); +var require$$0$2 = require('crypto'); +var fs$2 = require('fs'); +var readline = require('node:readline'); +var require$$2 = require('os'); + +var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; +const { version: version$2 } = JSON.parse(fs$1.readFileSync(new URL('../../package.json', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))).toString()); +const VERSION = version$2; +/** + * Prefix for resolved fs paths, since windows paths may not be valid as URLs. + */ +const FS_PREFIX = `/@fs/`; +const VITE_PACKAGE_DIR = path$3.resolve( +// import.meta.url is `dist/node/constants.js` after bundle +node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))), '../../..'); +const CLIENT_ENTRY = path$3.resolve(VITE_PACKAGE_DIR, 'dist/client/client.mjs'); +path$3.resolve(VITE_PACKAGE_DIR, 'dist/client/env.mjs'); +path$3.dirname(CLIENT_ENTRY); + +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +function encode(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ''; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // genColumn + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex + } + } + return out + td.decode(buf.subarray(0, pos)); +} +function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? (-num << 1) | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) + clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; +} + +// Matches the scheme of a URL, eg "http://" +var UrlType; +(function (UrlType) { + UrlType[UrlType["Empty"] = 1] = "Empty"; + UrlType[UrlType["Hash"] = 2] = "Hash"; + UrlType[UrlType["Query"] = 3] = "Query"; + UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; + UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; + UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; + UrlType[UrlType["Absolute"] = 7] = "Absolute"; +})(UrlType || (UrlType = {})); + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +var picocolors = {exports: {}}; + +let tty = require$$0; + +let isColorSupported = + !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && + ("FORCE_COLOR" in process.env || + process.argv.includes("--color") || + process.platform === "win32" || + (tty.isatty(1) && process.env.TERM !== "dumb") || + "CI" in process.env); + +let formatter = + (open, close, replace = open) => + input => { + let string = "" + input; + let index = string.indexOf(close, open.length); + return ~index + ? open + replaceClose(string, close, replace, index) + close + : open + string + close + }; + +let replaceClose = (string, close, replace, index) => { + let start = string.substring(0, index) + replace; + let end = string.substring(index + close.length); + let nextIndex = end.indexOf(close); + return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end +}; + +let createColors = (enabled = isColorSupported) => ({ + isColorSupported: enabled, + reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String, + bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String, + dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String, + italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String, + underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String, + inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String, + hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String, + strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String, + black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String, + red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String, + green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String, + yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String, + blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String, + magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String, + cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String, + white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String, + gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String, + bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String, + bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String, + bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String, + bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String, + bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String, + bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String, + bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String, + bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String, +}); + +picocolors.exports = createColors(); +picocolors.exports.createColors = createColors; + +var picocolorsExports = picocolors.exports; +var colors = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports); + +var src = {exports: {}}; + +var node = {exports: {}}; + +/** + * Helpers. + */ + +var ms; +var hasRequiredMs; + +function requireMs () { + if (hasRequiredMs) return ms; + hasRequiredMs = 1; + var s = 1000; + var m = s * 60; + var h = m * 60; + var d = h * 24; + var w = d * 7; + var y = d * 365.25; + + /** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + + ms = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); + }; + + /** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } + } + + /** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; + } + + /** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; + } + + /** + * Pluralization helper. + */ + + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); + } + return ms; +} + +var common; +var hasRequiredCommon; + +function requireCommon () { + if (hasRequiredCommon) return common; + hasRequiredCommon = 1; + /** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + + function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = requireMs(); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + let i; + let len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; + } + + common = setup; + return common; +} + +/** + * Module dependencies. + */ + +var hasRequiredNode; + +function requireNode () { + if (hasRequiredNode) return node.exports; + hasRequiredNode = 1; + (function (module, exports) { + const tty = require$$0; + const util = require$$1; + + /** + * This is the Node.js implementation of `debug()`. + */ + + exports.init = init; + exports.log = log; + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' + ); + + /** + * Colors. + */ + + exports.colors = [6, 2, 3, 4, 5, 1]; + + try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } + } catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. + } + + /** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + + exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; + }, {}); + + /** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + + function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); + } + + /** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + + function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } + } + + function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; + } + + /** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + + function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); + } + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + function load() { + return process.env.DEBUG; + } + + /** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + + function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } + } + + module.exports = requireCommon()(exports); + + const {formatters} = module.exports; + + /** + * Map %o to `util.inspect()`, all on a single line. + */ + + formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); + }; + + /** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + + formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; + } (node, node.exports)); + return node.exports; +} + +var browser$1 = {exports: {}}; + +/* eslint-env browser */ + +var hasRequiredBrowser; + +function requireBrowser () { + if (hasRequiredBrowser) return browser$1.exports; + hasRequiredBrowser = 1; + (function (module, exports) { + /** + * This is the web browser implementation of `debug()`. + */ + + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.storage = localstorage(); + exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; + })(); + + /** + * Colors. + */ + + exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' + ]; + + /** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + + // eslint-disable-next-line complexity + function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + } + + /** + * Colorize log arguments if enabled. + * + * @api public + */ + + function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + } + + /** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ + exports.log = console.debug || console.log || (() => {}); + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; + } + + /** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + } + + module.exports = requireCommon()(exports); + + const {formatters} = module.exports; + + /** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } + }; + } (browser$1, browser$1.exports)); + return browser$1.exports; +} + +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + src.exports = requireBrowser(); +} else { + src.exports = requireNode(); +} + +var srcExports = src.exports; +var debug$2 = /*@__PURE__*/getDefaultExportFromCjs(srcExports); + +var utils$3 = {}; + +const path$2 = require$$0$1; +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE$1 = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +var constants$2 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path$2.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; + +(function (exports) { + + const path = require$$0$1; + const win32 = process.platform === 'win32'; + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = constants$2; + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; + }; + + exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; +} (utils$3)); + +const utils$2 = utils$3; +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = constants$2; + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan$1 = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils$2.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils$2.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +var scan_1 = scan$1; + +const constants$1 = constants$2; +const utils$1 = utils$3; + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants$1; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse$2 = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils$1.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants$1.globChars(win32); + const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils$1.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse$2(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils$1.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils$1.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils$1.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils$1.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils$1.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils$1.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils$1.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils$1.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse$2.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils$1.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants$1.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils$1.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +var parse_1$1 = parse$2; + +const path$1 = require$$0$1; +const scan = scan_1; +const parse$1 = parse_1$1; +const utils = utils$3; +const constants = constants$2; +const isObject$2 = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch$1 = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch$1(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject$2(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch$1.compileRe(glob, options) + : picomatch$1.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch$1.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch$1.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch$1.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch$1.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options); + return regex.test(path$1.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch$1.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch$1.parse(p, options)); + return parse$1(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch$1.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch$1.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch$1.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse$1.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse$1(input, options); + } + + return picomatch$1.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch$1.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch$1.constants = constants; + +/** + * Expose "picomatch" + */ + +var picomatch_1 = picomatch$1; + +var picomatch = picomatch_1; + +var pm = /*@__PURE__*/getDefaultExportFromCjs(picomatch); + +// Helper since Typescript can't detect readonly arrays with Array.isArray +function isArray(arg) { + return Array.isArray(arg); +} +function ensureArray(thing) { + if (isArray(thing)) + return thing; + if (thing == null) + return []; + return [thing]; +} + +const normalizePath$1 = function normalizePath(filename) { + return filename.split(require$$0$1.win32.sep).join(require$$0$1.posix.sep); +}; + +function getMatcherString(id, resolutionBase) { + if (resolutionBase === false || require$$0$1.isAbsolute(id) || id.startsWith('**')) { + return normalizePath$1(id); + } + // resolve('') is valid and will default to process.cwd() + const basePath = normalizePath$1(require$$0$1.resolve(resolutionBase || '')) + // escape all possible (posix + win) path characters that might interfere with regex + .replace(/[-^$*+?.()|[\]{}]/g, '\\$&'); + // Note that we use posix.join because: + // 1. the basePath has been normalized to use / + // 2. the incoming glob (id) matcher, also uses / + // otherwise Node will force backslash (\) on windows + return require$$0$1.posix.join(basePath, normalizePath$1(id)); +} +const createFilter$1 = function createFilter(include, exclude, options) { + const resolutionBase = options && options.resolve; + const getMatcher = (id) => id instanceof RegExp + ? id + : { + test: (what) => { + // this refactor is a tad overly verbose but makes for easy debugging + const pattern = getMatcherString(id, resolutionBase); + const fn = pm(pattern, { dot: true }); + const result = fn(what); + return result; + } + }; + const includeMatchers = ensureArray(include).map(getMatcher); + const excludeMatchers = ensureArray(exclude).map(getMatcher); + return function result(id) { + if (typeof id !== 'string') + return false; + if (/\0/.test(id)) + return false; + const pathId = normalizePath$1(id); + for (let i = 0; i < excludeMatchers.length; ++i) { + const matcher = excludeMatchers[i]; + if (matcher.test(pathId)) + return false; + } + for (let i = 0; i < includeMatchers.length; ++i) { + const matcher = includeMatchers[i]; + if (matcher.test(pathId)) + return true; + } + return !includeMatchers.length; + }; +}; + +const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'; +const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'; +const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' ')); +forbiddenIdentifiers.add(''); + +if (process.versions.pnp) { + try { + node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))('pnpapi'); + } + catch { } +} + +const createFilter = createFilter$1; +const windowsSlashRE = /\\/g; +function slash(p) { + return p.replace(windowsSlashRE, '/'); +} +// Some runtimes like Bun injects namespaced modules here, which is not a node builtin +node_module.builtinModules.filter((id) => !id.includes(':')); +function isInNodeModules(id) { + return id.includes('node_modules'); +} +// TODO: use import() +const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))); +function resolveDependencyVersion(dep, pkgRelativePath = '../../package.json') { + const pkgPath = path$3.resolve(_require.resolve(dep), pkgRelativePath); + return JSON.parse(fs$1.readFileSync(pkgPath, 'utf-8')).version; +} +const rollupVersion = resolveDependencyVersion('rollup'); +// set in bin/vite.js +const filter = process.env.VITE_DEBUG_FILTER; +const DEBUG = process.env.DEBUG; +function createDebugger(namespace, options = {}) { + const log = debug$2(namespace); + const { onlyWhenFocused } = options; + let enabled = log.enabled; + if (enabled && onlyWhenFocused) { + const ns = typeof onlyWhenFocused === 'string' ? onlyWhenFocused : namespace; + enabled = !!DEBUG?.includes(ns); + } + if (enabled) { + return (...args) => { + if (!filter || args.some((a) => a?.includes?.(filter))) { + log(...args); + } + }; + } +} +function testCaseInsensitiveFS() { + if (!CLIENT_ENTRY.endsWith('client.mjs')) { + throw new Error(`cannot test case insensitive FS, CLIENT_ENTRY const doesn't contain client.mjs`); + } + if (!fs$1.existsSync(CLIENT_ENTRY)) { + throw new Error('cannot test case insensitive FS, CLIENT_ENTRY does not point to an existing file: ' + + CLIENT_ENTRY); + } + return fs$1.existsSync(CLIENT_ENTRY.replace('client.mjs', 'cLiEnT.mjs')); +} +const isCaseInsensitiveFS = testCaseInsensitiveFS(); +const isWindows = os$1.platform() === 'win32'; +const VOLUME_RE = /^[A-Z]:/i; +function normalizePath(id) { + return path$3.posix.normalize(isWindows ? slash(id) : id); +} +function fsPathFromId(id) { + const fsPath = normalizePath(id.startsWith(FS_PREFIX) ? id.slice(FS_PREFIX.length) : id); + return fsPath[0] === '/' || VOLUME_RE.test(fsPath) ? fsPath : `/${fsPath}`; +} +function fsPathFromUrl(url) { + return fsPathFromId(cleanUrl(url)); +} +function withTrailingSlash(path) { + if (path[path.length - 1] !== '/') { + return `${path}/`; + } + return path; +} +/** + * Check if dir is a parent of file + * + * Warning: parameters are not validated, only works with normalized absolute paths + * + * @param dir - normalized absolute path + * @param file - normalized absolute path + * @returns true if dir is a parent of file + */ +function isParentDirectory(dir, file) { + dir = withTrailingSlash(dir); + return (file.startsWith(dir) || + (isCaseInsensitiveFS && file.toLowerCase().startsWith(dir.toLowerCase()))); +} +/** + * Check if 2 file name are identical + * + * Warning: parameters are not validated, only works with normalized absolute paths + * + * @param file1 - normalized absolute path + * @param file2 - normalized absolute path + * @returns true if both files url are identical + */ +function isSameFileUri(file1, file2) { + return (file1 === file2 || + (isCaseInsensitiveFS && file1.toLowerCase() === file2.toLowerCase())); +} +const postfixRE = /[?#].*$/s; +function cleanUrl(url) { + return url.replace(postfixRE, ''); +} +const trailingSeparatorRE = /[?&]$/; +const timestampRE = /\bt=\d{13}&?\b/; +function removeTimestampQuery(url) { + return url.replace(timestampRE, '').replace(trailingSeparatorRE, ''); +} +function isObject$1(value) { + return Object.prototype.toString.call(value) === '[object Object]'; +} +function tryStatSync(file) { + try { + // The "throwIfNoEntry" is a performance optimization for cases where the file does not exist + return fs$1.statSync(file, { throwIfNoEntry: false }); + } + catch { + // Ignore errors + } +} +function isFileReadable(filename) { + if (!tryStatSync(filename)) { + return false; + } + try { + // Check if current process has read permission to the file + fs$1.accessSync(filename, fs$1.constants.R_OK); + return true; + } + catch { + return false; + } +} +function arraify(target) { + return Array.isArray(target) ? target : [target]; +} +path$3.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))); +function backwardCompatibleWorkerPlugins(plugins) { + if (Array.isArray(plugins)) { + return plugins; + } + if (typeof plugins === 'function') { + return plugins(); + } + return []; +} +function mergeConfigRecursively(defaults, overrides, rootPath) { + const merged = { ...defaults }; + for (const key in overrides) { + const value = overrides[key]; + if (value == null) { + continue; + } + const existing = merged[key]; + if (existing == null) { + merged[key] = value; + continue; + } + // fields that require special handling + if (key === 'alias' && (rootPath === 'resolve' || rootPath === '')) { + merged[key] = mergeAlias(existing, value); + continue; + } + else if (key === 'assetsInclude' && rootPath === '') { + merged[key] = [].concat(existing, value); + continue; + } + else if (key === 'noExternal' && + rootPath === 'ssr' && + (existing === true || value === true)) { + merged[key] = true; + continue; + } + else if (key === 'plugins' && rootPath === 'worker') { + merged[key] = () => [ + ...backwardCompatibleWorkerPlugins(existing), + ...backwardCompatibleWorkerPlugins(value), + ]; + continue; + } + if (Array.isArray(existing) || Array.isArray(value)) { + merged[key] = [...arraify(existing ?? []), ...arraify(value ?? [])]; + continue; + } + if (isObject$1(existing) && isObject$1(value)) { + merged[key] = mergeConfigRecursively(existing, value, rootPath ? `${rootPath}.${key}` : key); + continue; + } + merged[key] = value; + } + return merged; +} +function mergeConfig(defaults, overrides, isRoot = true) { + if (typeof defaults === 'function' || typeof overrides === 'function') { + throw new Error(`Cannot merge config in form of callback`); + } + return mergeConfigRecursively(defaults, overrides, isRoot ? '' : '.'); +} +function mergeAlias(a, b) { + if (!a) + return b; + if (!b) + return a; + if (isObject$1(a) && isObject$1(b)) { + return { ...a, ...b }; + } + // the order is flipped because the alias is resolved from top-down, + // where the later should have higher priority + return [...normalizeAlias(b), ...normalizeAlias(a)]; +} +function normalizeAlias(o = []) { + return Array.isArray(o) + ? o.map(normalizeSingleAlias) + : Object.keys(o).map((find) => normalizeSingleAlias({ + find, + replacement: o[find], + })); +} +// https://github.com/vitejs/vite/issues/1363 +// work around https://github.com/rollup/plugins/issues/759 +function normalizeSingleAlias({ find, replacement, customResolver, }) { + if (typeof find === 'string' && + find[find.length - 1] === '/' && + replacement[replacement.length - 1] === '/') { + find = find.slice(0, find.length - 1); + replacement = replacement.slice(0, replacement.length - 1); + } + const alias = { + find, + replacement, + }; + if (customResolver) { + alias.customResolver = customResolver; + } + return alias; +} + +// This file will be built for both ESM and CJS. Avoid relying on other modules as possible. +// copy from constants.ts +const CSS_LANGS_RE = +// eslint-disable-next-line regexp/no-unused-capturing-group +/\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/; +const isCSSRequest = (request) => CSS_LANGS_RE.test(request); +// Use splitVendorChunkPlugin() to get the same manualChunks strategy as Vite 2.7 +// We don't recommend using this strategy as a general solution moving forward +// splitVendorChunk is a simple index/vendor strategy that was used in Vite +// until v2.8. It is exposed to let people continue to use it in case it was +// working well for their setups. +// The cache needs to be reset on buildStart for watch mode to work correctly +// Don't use this manualChunks strategy for ssr, lib mode, and 'umd' or 'iife' +class SplitVendorChunkCache { + cache; + constructor() { + this.cache = new Map(); + } + reset() { + this.cache = new Map(); + } +} +function splitVendorChunk(options = {}) { + const cache = options.cache ?? new SplitVendorChunkCache(); + return (id, { getModuleInfo }) => { + if (isInNodeModules(id) && + !isCSSRequest(id) && + staticImportedByEntry(id, getModuleInfo, cache.cache)) { + return 'vendor'; + } + }; +} +function staticImportedByEntry(id, getModuleInfo, cache, importStack = []) { + if (cache.has(id)) { + return cache.get(id); + } + if (importStack.includes(id)) { + // circular deps! + cache.set(id, false); + return false; + } + const mod = getModuleInfo(id); + if (!mod) { + cache.set(id, false); + return false; + } + if (mod.isEntry) { + cache.set(id, true); + return true; + } + const someImporterIs = mod.importers.some((importer) => staticImportedByEntry(importer, getModuleInfo, cache, importStack.concat(id))); + cache.set(id, someImporterIs); + return someImporterIs; +} +function splitVendorChunkPlugin() { + const caches = []; + function createSplitVendorChunk(output, config) { + const cache = new SplitVendorChunkCache(); + caches.push(cache); + const build = config.build ?? {}; + const format = output?.format; + if (!build.ssr && !build.lib && format !== 'umd' && format !== 'iife') { + return splitVendorChunk({ cache }); + } + } + return { + name: 'vite:split-vendor-chunk', + config(config) { + let outputs = config?.build?.rollupOptions?.output; + if (outputs) { + outputs = arraify(outputs); + for (const output of outputs) { + const viteManualChunks = createSplitVendorChunk(output, config); + if (viteManualChunks) { + if (output.manualChunks) { + if (typeof output.manualChunks === 'function') { + const userManualChunks = output.manualChunks; + output.manualChunks = (id, api) => { + return userManualChunks(id, api) ?? viteManualChunks(id, api); + }; + } + else { + // else, leave the object form of manualChunks untouched, as + // we can't safely replicate rollup handling. + // eslint-disable-next-line no-console + console.warn("(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.output.manualChunks`. Consider using the function form instead."); + } + } + else { + output.manualChunks = viteManualChunks; + } + } + } + } + else { + return { + build: { + rollupOptions: { + output: { + manualChunks: createSplitVendorChunk({}, config), + }, + }, + }, + }; + } + }, + buildStart() { + caches.forEach((cache) => cache.reset()); + }, + }; +} + +var convertSourceMap$1 = {}; + +(function (exports) { + + Object.defineProperty(exports, 'commentRegex', { + get: function getCommentRegex () { + // Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data. + return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg; + } + }); + + + Object.defineProperty(exports, 'mapFileCommentRegex', { + get: function getMapFileCommentRegex () { + // Matches sourceMappingURL in either // or /* comment styles. + return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg; + } + }); + + var decodeBase64; + if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + decodeBase64 = decodeBase64WithBufferFrom; + } else { + decodeBase64 = decodeBase64WithNewBuffer; + } + } else { + decodeBase64 = decodeBase64WithAtob; + } + + function decodeBase64WithBufferFrom(base64) { + return Buffer.from(base64, 'base64').toString(); + } + + function decodeBase64WithNewBuffer(base64) { + if (typeof value === 'number') { + throw new TypeError('The value to decode must not be of type number.'); + } + return new Buffer(base64, 'base64').toString(); + } + + function decodeBase64WithAtob(base64) { + return decodeURIComponent(escape(atob(base64))); + } + + function stripComment(sm) { + return sm.split(',').pop(); + } + + function readFromFileMap(sm, read) { + var r = exports.mapFileCommentRegex.exec(sm); + // for some odd reason //# .. captures in 1 and /* .. */ in 2 + var filename = r[1] || r[2]; + + try { + var sm = read(filename); + if (sm != null && typeof sm.catch === 'function') { + return sm.catch(throwError); + } else { + return sm; + } + } catch (e) { + throwError(e); + } + + function throwError(e) { + throw new Error('An error occurred while trying to read the map file at ' + filename + '\n' + e.stack); + } + } + + function Converter (sm, opts) { + opts = opts || {}; + + if (opts.hasComment) { + sm = stripComment(sm); + } + + if (opts.encoding === 'base64') { + sm = decodeBase64(sm); + } else if (opts.encoding === 'uri') { + sm = decodeURIComponent(sm); + } + + if (opts.isJSON || opts.encoding) { + sm = JSON.parse(sm); + } + + this.sourcemap = sm; + } + + Converter.prototype.toJSON = function (space) { + return JSON.stringify(this.sourcemap, null, space); + }; + + if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + Converter.prototype.toBase64 = encodeBase64WithBufferFrom; + } else { + Converter.prototype.toBase64 = encodeBase64WithNewBuffer; + } + } else { + Converter.prototype.toBase64 = encodeBase64WithBtoa; + } + + function encodeBase64WithBufferFrom() { + var json = this.toJSON(); + return Buffer.from(json, 'utf8').toString('base64'); + } + + function encodeBase64WithNewBuffer() { + var json = this.toJSON(); + if (typeof json === 'number') { + throw new TypeError('The json to encode must not be of type number.'); + } + return new Buffer(json, 'utf8').toString('base64'); + } + + function encodeBase64WithBtoa() { + var json = this.toJSON(); + return btoa(unescape(encodeURIComponent(json))); + } + + Converter.prototype.toURI = function () { + var json = this.toJSON(); + return encodeURIComponent(json); + }; + + Converter.prototype.toComment = function (options) { + var encoding, content, data; + if (options != null && options.encoding === 'uri') { + encoding = ''; + content = this.toURI(); + } else { + encoding = ';base64'; + content = this.toBase64(); + } + data = 'sourceMappingURL=data:application/json;charset=utf-8' + encoding + ',' + content; + return options != null && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; + }; + + // returns copy instead of original + Converter.prototype.toObject = function () { + return JSON.parse(this.toJSON()); + }; + + Converter.prototype.addProperty = function (key, value) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead'); + return this.setProperty(key, value); + }; + + Converter.prototype.setProperty = function (key, value) { + this.sourcemap[key] = value; + return this; + }; + + Converter.prototype.getProperty = function (key) { + return this.sourcemap[key]; + }; + + exports.fromObject = function (obj) { + return new Converter(obj); + }; + + exports.fromJSON = function (json) { + return new Converter(json, { isJSON: true }); + }; + + exports.fromURI = function (uri) { + return new Converter(uri, { encoding: 'uri' }); + }; + + exports.fromBase64 = function (base64) { + return new Converter(base64, { encoding: 'base64' }); + }; + + exports.fromComment = function (comment) { + var m, encoding; + comment = comment + .replace(/^\/\*/g, '//') + .replace(/\*\/$/g, ''); + m = exports.commentRegex.exec(comment); + encoding = m && m[4] || 'uri'; + return new Converter(comment, { encoding: encoding, hasComment: true }); + }; + + function makeConverter(sm) { + return new Converter(sm, { isJSON: true }); + } + + exports.fromMapFileComment = function (comment, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileComment`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + + var sm = readFromFileMap(comment, read); + if (sm != null && typeof sm.then === 'function') { + return sm.then(makeConverter); + } else { + return makeConverter(sm); + } + }; + + // Finds last sourcemap comment in file or returns null if none was found + exports.fromSource = function (content) { + var m = content.match(exports.commentRegex); + return m ? exports.fromComment(m.pop()) : null; + }; + + // Finds last sourcemap comment in file or returns null if none was found + exports.fromMapFileSource = function (content, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileSource`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + var m = content.match(exports.mapFileCommentRegex); + return m ? exports.fromMapFileComment(m.pop(), read) : null; + }; + + exports.removeComments = function (src) { + return src.replace(exports.commentRegex, ''); + }; + + exports.removeMapFileComments = function (src) { + return src.replace(exports.mapFileCommentRegex, ''); + }; + + exports.generateMapFileComment = function (file, options) { + var data = 'sourceMappingURL=' + file; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; + }; +} (convertSourceMap$1)); + +var convertSourceMap = /*@__PURE__*/getDefaultExportFromCjs(convertSourceMap$1); + +/*! + * etag + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + * @public + */ + +var etag_1 = etag; + +/** + * Module dependencies. + * @private + */ + +var crypto$1 = require$$0$2; +var Stats = fs$2.Stats; + +/** + * Module variables. + * @private + */ + +var toString$1 = Object.prototype.toString; + +/** + * Generate an entity tag. + * + * @param {Buffer|string} entity + * @return {string} + * @private + */ + +function entitytag (entity) { + if (entity.length === 0) { + // fast-path empty + return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"' + } + + // compute hash of entity + var hash = crypto$1 + .createHash('sha1') + .update(entity, 'utf8') + .digest('base64') + .substring(0, 27); + + // compute length of entity + var len = typeof entity === 'string' + ? Buffer.byteLength(entity, 'utf8') + : entity.length; + + return '"' + len.toString(16) + '-' + hash + '"' +} + +/** + * Create a simple ETag. + * + * @param {string|Buffer|Stats} entity + * @param {object} [options] + * @param {boolean} [options.weak] + * @return {String} + * @public + */ + +function etag (entity, options) { + if (entity == null) { + throw new TypeError('argument entity is required') + } + + // support fs.Stats object + var isStats = isstats(entity); + var weak = options && typeof options.weak === 'boolean' + ? options.weak + : isStats; + + // validate argument + if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) { + throw new TypeError('argument entity must be string, Buffer, or fs.Stats') + } + + // generate entity tag + var tag = isStats + ? stattag(entity) + : entitytag(entity); + + return weak + ? 'W/' + tag + : tag +} + +/** + * Determine if object is a Stats object. + * + * @param {object} obj + * @return {boolean} + * @api private + */ + +function isstats (obj) { + // genuine fs.Stats + if (typeof Stats === 'function' && obj instanceof Stats) { + return true + } + + // quack quack + return obj && typeof obj === 'object' && + 'ctime' in obj && toString$1.call(obj.ctime) === '[object Date]' && + 'mtime' in obj && toString$1.call(obj.mtime) === '[object Date]' && + 'ino' in obj && typeof obj.ino === 'number' && + 'size' in obj && typeof obj.size === 'number' +} + +/** + * Generate a tag for a stat. + * + * @param {object} stat + * @return {string} + * @private + */ + +function stattag (stat) { + var mtime = stat.mtime.getTime().toString(16); + var size = stat.size.toString(16); + + return '"' + size + '-' + mtime + '"' +} + +var getEtag = /*@__PURE__*/getDefaultExportFromCjs(etag_1); + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa$1 = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa$1(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + while (contentLineEnd >= 0) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) + this.overwrite( + match.index, + match.index + match[0].length, + getReplacement(match, this.original), + ); + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) + this.overwrite( + match.index, + match.index + match[0].length, + getReplacement(match, this.original), + ); + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +const debug$1 = createDebugger('vite:sourcemap', { + onlyWhenFocused: true, +}); +function genSourceMapUrl(map) { + if (typeof map !== 'string') { + map = JSON.stringify(map); + } + return `data:application/json;base64,${Buffer.from(map).toString('base64')}`; +} +function getCodeWithSourcemap(type, code, map) { + if (debug$1) { + code += `\n/*${JSON.stringify(map, null, 2).replace(/\*\//g, '*\\/')}*/\n`; + } + if (type === 'js') { + code += `\n//# sourceMappingURL=${genSourceMapUrl(map)}`; + } + else if (type === 'css') { + code += `\n/*# sourceMappingURL=${genSourceMapUrl(map)} */`; + } + return code; +} + +const debug = createDebugger('vite:send', { + onlyWhenFocused: true, +}); +const alias = { + js: 'text/javascript', + css: 'text/css', + html: 'text/html', + json: 'application/json', +}; +function send(req, res, content, type, options) { + const { etag = getEtag(content, { weak: true }), cacheControl = 'no-cache', headers, map, } = options; + if (res.writableEnded) { + return; + } + if (req.headers['if-none-match'] === etag) { + res.statusCode = 304; + res.end(); + return; + } + res.setHeader('Content-Type', alias[type] || type); + res.setHeader('Cache-Control', cacheControl); + res.setHeader('Etag', etag); + if (headers) { + for (const name in headers) { + res.setHeader(name, headers[name]); + } + } + // inject source map reference + if (map && 'version' in map && map.mappings) { + if (type === 'js' || type === 'css') { + content = getCodeWithSourcemap(type, content.toString(), map); + } + } + // inject fallback sourcemap for js for improved debugging + // https://github.com/vitejs/vite/pull/13514#issuecomment-1592431496 + else if (type === 'js' && (!map || map.mappings !== '')) { + const code = content.toString(); + // if the code has existing inline sourcemap, assume it's correct and skip + if (convertSourceMap.mapFileCommentRegex.test(code)) { + debug?.(`Skipped injecting fallback sourcemap for ${req.url}`); + } + else { + const urlWithoutTimestamp = removeTimestampQuery(req.url); + const ms = new MagicString(code); + content = getCodeWithSourcemap(type, code, ms.generateMap({ + source: path$3.basename(urlWithoutTimestamp), + hires: 'boundary', + includeContent: true, + })); + } + } + res.statusCode = 200; + res.end(content); + return; +} + +/* eslint no-console: 0 */ +const LogLevels = { + silent: 0, + error: 1, + warn: 2, + info: 3, +}; +let lastType; +let lastMsg; +let sameCount = 0; +function clearScreen() { + const repeatCount = process.stdout.rows - 2; + const blank = repeatCount > 0 ? '\n'.repeat(repeatCount) : ''; + console.log(blank); + readline.cursorTo(process.stdout, 0, 0); + readline.clearScreenDown(process.stdout); +} +// Only initialize the timeFormatter when the timestamp option is used, and +// reuse it across all loggers +let timeFormatter; +function getTimeFormatter() { + timeFormatter ??= new Intl.DateTimeFormat(undefined, { + hour: 'numeric', + minute: 'numeric', + second: 'numeric', + }); + return timeFormatter; +} +function createLogger(level = 'info', options = {}) { + if (options.customLogger) { + return options.customLogger; + } + const loggedErrors = new WeakSet(); + const { prefix = '[vite]', allowClearScreen = true } = options; + const thresh = LogLevels[level]; + const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI; + const clear = canClearScreen ? clearScreen : () => { }; + function format(type, msg, options = {}) { + if (options.timestamp) { + const tag = type === 'info' + ? colors.cyan(colors.bold(prefix)) + : type === 'warn' + ? colors.yellow(colors.bold(prefix)) + : colors.red(colors.bold(prefix)); + return `${colors.dim(getTimeFormatter().format(new Date()))} ${tag} ${msg}`; + } + else { + return msg; + } + } + function output(type, msg, options = {}) { + if (thresh >= LogLevels[type]) { + const method = type === 'info' ? 'log' : type; + if (options.error) { + loggedErrors.add(options.error); + } + if (canClearScreen) { + if (type === lastType && msg === lastMsg) { + sameCount++; + clear(); + console[method](format(type, msg, options), colors.yellow(`(x${sameCount + 1})`)); + } + else { + sameCount = 0; + lastMsg = msg; + lastType = type; + if (options.clear) { + clear(); + } + console[method](format(type, msg, options)); + } + } + else { + console[method](format(type, msg, options)); + } + } + } + const warnedMessages = new Set(); + const logger = { + hasWarned: false, + info(msg, opts) { + output('info', msg, opts); + }, + warn(msg, opts) { + logger.hasWarned = true; + output('warn', msg, opts); + }, + warnOnce(msg, opts) { + if (warnedMessages.has(msg)) + return; + logger.hasWarned = true; + output('warn', msg, opts); + warnedMessages.add(msg); + }, + error(msg, opts) { + logger.hasWarned = true; + output('error', msg, opts); + }, + clearScreen(type) { + if (thresh >= LogLevels[type]) { + clear(); + } + }, + hasErrorLogged(error) { + return loggedErrors.has(error); + }, + }; + return logger; +} + +// https://github.com/vitejs/vite/issues/2820#issuecomment-812495079 +const ROOT_FILES = [ + // '.git', + // https://pnpm.io/workspaces/ + 'pnpm-workspace.yaml', + // https://rushjs.io/pages/advanced/config_files/ + // 'rush.json', + // https://nx.dev/latest/react/getting-started/nx-setup + // 'workspace.json', + // 'nx.json', + // https://github.com/lerna/lerna#lernajson + 'lerna.json', +]; +// npm: https://docs.npmjs.com/cli/v7/using-npm/workspaces#installing-workspaces +// yarn: https://classic.yarnpkg.com/en/docs/workspaces/#toc-how-to-use-it +function hasWorkspacePackageJSON(root) { + const path = path$3.join(root, 'package.json'); + if (!isFileReadable(path)) { + return false; + } + try { + const content = JSON.parse(fs$1.readFileSync(path, 'utf-8')) || {}; + return !!content.workspaces; + } + catch { + return false; + } +} +function hasRootFile(root) { + return ROOT_FILES.some((file) => fs$1.existsSync(path$3.join(root, file))); +} +function hasPackageJSON(root) { + const path = path$3.join(root, 'package.json'); + return fs$1.existsSync(path); +} +/** + * Search up for the nearest `package.json` + */ +function searchForPackageRoot(current, root = current) { + if (hasPackageJSON(current)) + return current; + const dir = path$3.dirname(current); + // reach the fs root + if (!dir || dir === current) + return root; + return searchForPackageRoot(dir, root); +} +/** + * Search up for the nearest workspace root + */ +function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) { + if (hasRootFile(current)) + return current; + if (hasWorkspacePackageJSON(current)) + return current; + const dir = path$3.dirname(current); + // reach the fs root + if (!dir || dir === current) + return root; + return searchForWorkspaceRoot(dir, root); +} + +/** + * Check if the url is allowed to be served, via the `server.fs` config. + */ +function isFileServingAllowed(url, server) { + if (!server.config.server.fs.strict) + return true; + const file = fsPathFromUrl(url); + if (server._fsDenyGlob(file)) + return false; + if (server.moduleGraph.safeModulesPath.has(file)) + return true; + if (server.config.server.fs.allow.some((uri) => isSameFileUri(uri, file) || isParentDirectory(uri, file))) + return true; + return false; +} + +var main$1 = {exports: {}}; + +var name = "dotenv"; +var version$1 = "16.4.2"; +var description = "Loads environment variables from .env file"; +var main = "lib/main.js"; +var types = "lib/main.d.ts"; +var exports$1 = { + ".": { + types: "./lib/main.d.ts", + require: "./lib/main.js", + "default": "./lib/main.js" + }, + "./config": "./config.js", + "./config.js": "./config.js", + "./lib/env-options": "./lib/env-options.js", + "./lib/env-options.js": "./lib/env-options.js", + "./lib/cli-options": "./lib/cli-options.js", + "./lib/cli-options.js": "./lib/cli-options.js", + "./package.json": "./package.json" +}; +var scripts = { + "dts-check": "tsc --project tests/types/tsconfig.json", + lint: "standard", + "lint-readme": "standard-markdown", + pretest: "npm run lint && npm run dts-check", + test: "tap tests/*.js --100 -Rspec", + prerelease: "npm test", + release: "standard-version" +}; +var repository = { + type: "git", + url: "git://github.com/motdotla/dotenv.git" +}; +var funding = "https://dotenvx.com"; +var keywords = [ + "dotenv", + "env", + ".env", + "environment", + "variables", + "config", + "settings" +]; +var readmeFilename = "README.md"; +var license = "BSD-2-Clause"; +var devDependencies = { + "@definitelytyped/dtslint": "^0.0.133", + "@types/node": "^18.11.3", + decache: "^4.6.1", + sinon: "^14.0.1", + standard: "^17.0.0", + "standard-markdown": "^7.1.0", + "standard-version": "^9.5.0", + tap: "^16.3.0", + tar: "^6.1.11", + typescript: "^4.8.4" +}; +var engines = { + node: ">=12" +}; +var browser = { + fs: false +}; +var require$$4 = { + name: name, + version: version$1, + description: description, + main: main, + types: types, + exports: exports$1, + scripts: scripts, + repository: repository, + funding: funding, + keywords: keywords, + readmeFilename: readmeFilename, + license: license, + devDependencies: devDependencies, + engines: engines, + browser: browser +}; + +const fs = fs$2; +const path = require$$0$1; +const os = require$$2; +const crypto = require$$0$2; +const packageJson = require$$4; + +const version = packageJson.version; + +const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg; + +// Parse src into an Object +function parse (src) { + const obj = {}; + + // Convert buffer to string + let lines = src.toString(); + + // Convert line breaks to same format + lines = lines.replace(/\r\n?/mg, '\n'); + + let match; + while ((match = LINE.exec(lines)) != null) { + const key = match[1]; + + // Default undefined or null to empty string + let value = (match[2] || ''); + + // Remove whitespace + value = value.trim(); + + // Check if double quoted + const maybeQuote = value[0]; + + // Remove surrounding quotes + value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2'); + + // Expand newlines if double quoted + if (maybeQuote === '"') { + value = value.replace(/\\n/g, '\n'); + value = value.replace(/\\r/g, '\r'); + } + + // Add to object + obj[key] = value; + } + + return obj +} + +function _parseVault (options) { + const vaultPath = _vaultPath(options); + + // Parse .env.vault + const result = DotenvModule.configDotenv({ path: vaultPath }); + if (!result.parsed) { + const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`); + err.code = 'MISSING_DATA'; + throw err + } + + // handle scenario for comma separated keys - for use with key rotation + // example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod" + const keys = _dotenvKey(options).split(','); + const length = keys.length; + + let decrypted; + for (let i = 0; i < length; i++) { + try { + // Get full key + const key = keys[i].trim(); + + // Get instructions for decrypt + const attrs = _instructions(result, key); + + // Decrypt + decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key); + + break + } catch (error) { + // last key + if (i + 1 >= length) { + throw error + } + // try next key + } + } + + // Parse decrypted .env string + return DotenvModule.parse(decrypted) +} + +function _log (message) { + console.log(`[dotenv@${version}][INFO] ${message}`); +} + +function _warn (message) { + console.log(`[dotenv@${version}][WARN] ${message}`); +} + +function _debug (message) { + console.log(`[dotenv@${version}][DEBUG] ${message}`); +} + +function _dotenvKey (options) { + // prioritize developer directly setting options.DOTENV_KEY + if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) { + return options.DOTENV_KEY + } + + // secondary infra already contains a DOTENV_KEY environment variable + if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) { + return process.env.DOTENV_KEY + } + + // fallback to empty string + return '' +} + +function _instructions (result, dotenvKey) { + // Parse DOTENV_KEY. Format is a URI + let uri; + try { + uri = new URL(dotenvKey); + } catch (error) { + if (error.code === 'ERR_INVALID_URL') { + const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + throw error + } + + // Get decrypt key + const key = uri.password; + if (!key) { + const err = new Error('INVALID_DOTENV_KEY: Missing key part'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + // Get environment + const environment = uri.searchParams.get('environment'); + if (!environment) { + const err = new Error('INVALID_DOTENV_KEY: Missing environment part'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + // Get ciphertext payload + const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`; + const ciphertext = result.parsed[environmentKey]; // DOTENV_VAULT_PRODUCTION + if (!ciphertext) { + const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`); + err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'; + throw err + } + + return { ciphertext, key } +} + +function _vaultPath (options) { + let possibleVaultPath = null; + + if (options && options.path && options.path.length > 0) { + if (Array.isArray(options.path)) { + for (const filepath of options.path) { + if (fs.existsSync(filepath)) { + possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`; + } + } + } else { + possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`; + } + } else { + possibleVaultPath = path.resolve(process.cwd(), '.env.vault'); + } + + if (fs.existsSync(possibleVaultPath)) { + return possibleVaultPath + } + + return null +} + +function _resolveHome (envPath) { + return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath +} + +function _configVault (options) { + _log('Loading env from encrypted .env.vault'); + + const parsed = DotenvModule._parseVault(options); + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + DotenvModule.populate(processEnv, parsed, options); + + return { parsed } +} + +function configDotenv (options) { + let dotenvPath = path.resolve(process.cwd(), '.env'); + let encoding = 'utf8'; + const debug = Boolean(options && options.debug); + + if (options) { + if (options.path != null) { + let envPath = options.path; + + if (Array.isArray(envPath)) { + for (const filepath of options.path) { + if (fs.existsSync(filepath)) { + envPath = filepath; + break + } + } + } + + dotenvPath = _resolveHome(envPath); + } + if (options.encoding != null) { + encoding = options.encoding; + } else { + if (debug) { + _debug('No encoding is specified. UTF-8 is used by default'); + } + } + } + + try { + // Specifying an encoding returns a string instead of a buffer + const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding })); + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + DotenvModule.populate(processEnv, parsed, options); + + return { parsed } + } catch (e) { + if (debug) { + _debug(`Failed to load ${dotenvPath} ${e.message}`); + } + + return { error: e } + } +} + +// Populates process.env from .env file +function config (options) { + // fallback to original dotenv if DOTENV_KEY is not set + if (_dotenvKey(options).length === 0) { + return DotenvModule.configDotenv(options) + } + + const vaultPath = _vaultPath(options); + + // dotenvKey exists but .env.vault file does not exist + if (!vaultPath) { + _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`); + + return DotenvModule.configDotenv(options) + } + + return DotenvModule._configVault(options) +} + +function decrypt (encrypted, keyStr) { + const key = Buffer.from(keyStr.slice(-64), 'hex'); + let ciphertext = Buffer.from(encrypted, 'base64'); + + const nonce = ciphertext.subarray(0, 12); + const authTag = ciphertext.subarray(-16); + ciphertext = ciphertext.subarray(12, -16); + + try { + const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce); + aesgcm.setAuthTag(authTag); + return `${aesgcm.update(ciphertext)}${aesgcm.final()}` + } catch (error) { + const isRange = error instanceof RangeError; + const invalidKeyLength = error.message === 'Invalid key length'; + const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'; + + if (isRange || invalidKeyLength) { + const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } else if (decryptionFailed) { + const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY'); + err.code = 'DECRYPTION_FAILED'; + throw err + } else { + throw error + } + } +} + +// Populate process.env with parsed values +function populate (processEnv, parsed, options = {}) { + const debug = Boolean(options && options.debug); + const override = Boolean(options && options.override); + + if (typeof parsed !== 'object') { + const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate'); + err.code = 'OBJECT_REQUIRED'; + throw err + } + + // Set process.env + for (const key of Object.keys(parsed)) { + if (Object.prototype.hasOwnProperty.call(processEnv, key)) { + if (override === true) { + processEnv[key] = parsed[key]; + } + + if (debug) { + if (override === true) { + _debug(`"${key}" is already defined and WAS overwritten`); + } else { + _debug(`"${key}" is already defined and was NOT overwritten`); + } + } + } else { + processEnv[key] = parsed[key]; + } + } +} + +const DotenvModule = { + configDotenv, + _configVault, + _parseVault, + config, + decrypt, + parse, + populate +}; + +main$1.exports.configDotenv = DotenvModule.configDotenv; +main$1.exports._configVault = DotenvModule._configVault; +main$1.exports._parseVault = DotenvModule._parseVault; +main$1.exports.config = DotenvModule.config; +main$1.exports.decrypt = DotenvModule.decrypt; +var parse_1 = main$1.exports.parse = DotenvModule.parse; +main$1.exports.populate = DotenvModule.populate; + +main$1.exports = DotenvModule; + +// * / +// * (\\)? # is it escaped with a backslash? +// * (\$) # literal $ +// * (?!\() # shouldnt be followed by parenthesis +// * (\{?) # first brace wrap opening +// * ([\w.]+) # key +// * (?::-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))? # optional default nested 3 times +// * (\}?) # last brace warp closing +// * /xi + +const DOTENV_SUBSTITUTION_REGEX = /(\\)?(\$)(?!\()(\{?)([\w.]+)(?::?-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))?(\}?)/gi; + +function _resolveEscapeSequences (value) { + return value.replace(/\\\$/g, '$') +} + +function interpolate (value, processEnv, parsed) { + return value.replace(DOTENV_SUBSTITUTION_REGEX, (match, escaped, dollarSign, openBrace, key, defaultValue, closeBrace) => { + if (escaped === '\\') { + return match.slice(1) + } else { + if (processEnv[key]) { + return processEnv[key] + } + + if (parsed[key]) { + return parsed[key] + } + + if (defaultValue) { + if (defaultValue.startsWith('$')) { + return interpolate(defaultValue, processEnv, parsed) + } else { + return defaultValue + } + } + + return '' + } + }) +} + +function expand (options) { + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + for (const key in options.parsed) { + let value = options.parsed[key]; + + const inProcessEnv = Object.prototype.hasOwnProperty.call(processEnv, key); + + if (inProcessEnv) { + if (processEnv[key] === options.parsed[key]) { + // assume was set to processEnv from the .env file if the values match and therefore interpolate + value = interpolate(value, processEnv, options.parsed); + } else { + // do not interpolate - assume processEnv had the intended value even if containing a $. + value = processEnv[key]; + } + } else { + // not inProcessEnv so assume interpolation for this .env key + value = interpolate(value, processEnv, options.parsed); + } + + options.parsed[key] = _resolveEscapeSequences(value); + } + + for (const processKey in options.parsed) { + processEnv[processKey] = options.parsed[processKey]; + } + + return options +} + +var expand_1 = expand; + +function getEnvFilesForMode(mode, envDir) { + return [ + /** default file */ `.env`, + /** local file */ `.env.local`, + /** mode file */ `.env.${mode}`, + /** mode local file */ `.env.${mode}.local`, + ].map((file) => normalizePath(path$3.join(envDir, file))); +} +function loadEnv(mode, envDir, prefixes = 'VITE_') { + if (mode === 'local') { + throw new Error(`"local" cannot be used as a mode name because it conflicts with ` + + `the .local postfix for .env files.`); + } + prefixes = arraify(prefixes); + const env = {}; + const envFiles = getEnvFilesForMode(mode, envDir); + const parsed = Object.fromEntries(envFiles.flatMap((filePath) => { + if (!tryStatSync(filePath)?.isFile()) + return []; + return Object.entries(parse_1(fs$1.readFileSync(filePath))); + })); + // test NODE_ENV override before expand as otherwise process.env.NODE_ENV would override this + if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) { + process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV; + } + // support BROWSER and BROWSER_ARGS env variables + if (parsed.BROWSER && process.env.BROWSER === undefined) { + process.env.BROWSER = parsed.BROWSER; + } + if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === undefined) { + process.env.BROWSER_ARGS = parsed.BROWSER_ARGS; + } + // let environment variables use each other. make a copy of `process.env` so that `dotenv-expand` + // doesn't re-assign the expanded values to the global `process.env`. + const processEnv = { ...process.env }; + expand_1({ parsed, processEnv }); + // only keys that start with prefix are exposed to client + for (const [key, value] of Object.entries(parsed)) { + if (prefixes.some((prefix) => key.startsWith(prefix))) { + env[key] = value; + } + } + // check if there are actual env variables starting with VITE_* + // these are typically provided inline and should be prioritized + for (const key in process.env) { + if (prefixes.some((prefix) => key.startsWith(prefix))) { + env[key] = process.env[key]; + } + } + return env; +} +function resolveEnvPrefix({ envPrefix = 'VITE_', }) { + envPrefix = arraify(envPrefix); + if (envPrefix.includes('')) { + throw new Error(`envPrefix option contains value '', which could lead unexpected exposure of sensitive information.`); + } + return envPrefix; +} + +exports.esbuildVersion = esbuild.version; +exports.createFilter = createFilter; +exports.createLogger = createLogger; +exports.isCSSRequest = isCSSRequest; +exports.isFileServingAllowed = isFileServingAllowed; +exports.loadEnv = loadEnv; +exports.mergeAlias = mergeAlias; +exports.mergeConfig = mergeConfig; +exports.normalizePath = normalizePath; +exports.resolveEnvPrefix = resolveEnvPrefix; +exports.rollupVersion = rollupVersion; +exports.searchForWorkspaceRoot = searchForWorkspaceRoot; +exports.send = send; +exports.splitVendorChunk = splitVendorChunk; +exports.splitVendorChunkPlugin = splitVendorChunkPlugin; +exports.version = VERSION; diff --git a/.pnpm-store/v3/files/6d/a363cf35082f5d97b40cddf7ee393c951eb3427c0002074310e33eaa2293976daa826b47332f1b6e1d82223e362b3b277fb98a714004ec29055225a49f91e5 b/.pnpm-store/v3/files/6d/a363cf35082f5d97b40cddf7ee393c951eb3427c0002074310e33eaa2293976daa826b47332f1b6e1d82223e362b3b277fb98a714004ec29055225a49f91e5 new file mode 100644 index 00000000..3d52cc53 --- /dev/null +++ b/.pnpm-store/v3/files/6d/a363cf35082f5d97b40cddf7ee393c951eb3427c0002074310e33eaa2293976daa826b47332f1b6e1d82223e362b3b277fb98a714004ec29055225a49f91e5 @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $TypeError = require('es-errors/type'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://262.ecma-international.org/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/.pnpm-store/v3/files/6d/a7e1639915f42422b7cea902c4e5d5d888d4d2c3d4e24f447d08a8c4d00a8d29e6ce35afb2eab5d3d0dcbf6ad7eb7ace77dc292865880cf3e65fb5542aea69 b/.pnpm-store/v3/files/6d/a7e1639915f42422b7cea902c4e5d5d888d4d2c3d4e24f447d08a8c4d00a8d29e6ce35afb2eab5d3d0dcbf6ad7eb7ace77dc292865880cf3e65fb5542aea69 new file mode 100644 index 00000000..9ca81cdf --- /dev/null +++ b/.pnpm-store/v3/files/6d/a7e1639915f42422b7cea902c4e5d5d888d4d2c3d4e24f447d08a8c4d00a8d29e6ce35afb2eab5d3d0dcbf6ad7eb7ace77dc292865880cf3e65fb5542aea69 @@ -0,0 +1,19 @@ +'use strict'; + +var isNegativeZero = require('is-negative-zero'); + +var $TypeError = require('es-errors/type'); + +var NumberSameValueZero = require('./sameValueZero'); + +// https://262.ecma-international.org/11.0/#sec-numeric-types-number-sameValue + +module.exports = function NumberSameValue(x, y) { + if (typeof x !== 'number' || typeof y !== 'number') { + throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers'); + } + if (x === 0 && y === 0) { + return !(isNegativeZero(x) ^ isNegativeZero(y)); + } + return NumberSameValueZero(x, y); +}; diff --git a/.pnpm-store/v3/files/6d/b3440d4103440c9c5db48786be3d17d6fd3729f1b32338f1059fd66534a3ee72c82a4449e3832fe6ed4c7f4e078422605cea9f4adc6315952ca5e2898145fe b/.pnpm-store/v3/files/6d/b3440d4103440c9c5db48786be3d17d6fd3729f1b32338f1059fd66534a3ee72c82a4449e3832fe6ed4c7f4e078422605cea9f4adc6315952ca5e2898145fe new file mode 100644 index 00000000..833040e3 --- /dev/null +++ b/.pnpm-store/v3/files/6d/b3440d4103440c9c5db48786be3d17d6fd3729f1b32338f1059fd66534a3ee72c82a4449e3832fe6ed4c7f4e078422605cea9f4adc6315952ca5e2898145fe @@ -0,0 +1,19 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var isFinite = require('../../helpers/isFinite'); +var isNaN = require('../../helpers/isNaN'); + +// https://262.ecma-international.org/11.0/#sec-numeric-types-number-divide + +module.exports = function NumberDivide(x, y) { + if (typeof x !== 'number' || typeof y !== 'number') { + throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers'); + } + if (isNaN(x) || isNaN(y) || (!isFinite(x) && !isFinite(y))) { + return NaN; + } + // shortcut for the actual spec mechanics + return x / y; +}; diff --git a/.pnpm-store/v3/files/6e/1565de65f3e81a6815c5e85835ef08fa45b242ef4cd6d3234d5aab98de4315c90bd930f5dd299eebdae14abf11db0a2fb1eb2cf828be449d067668f8d809bf b/.pnpm-store/v3/files/6e/1565de65f3e81a6815c5e85835ef08fa45b242ef4cd6d3234d5aab98de4315c90bd930f5dd299eebdae14abf11db0a2fb1eb2cf828be449d067668f8d809bf new file mode 100644 index 00000000..9abb5666 --- /dev/null +++ b/.pnpm-store/v3/files/6e/1565de65f3e81a6815c5e85835ef08fa45b242ef4cd6d3234d5aab98de4315c90bd930f5dd299eebdae14abf11db0a2fb1eb2cf828be449d067668f8d809bf @@ -0,0 +1 @@ +{"version":3,"file":"prefer-function-type.js","sourceRoot":"","sources":["../../src/rules/prefer-function-type.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6e/382ba40ad1a895b56585006f12fff122df8422e9f2462dda9e91a436ad27c4aa337cfd0b36e9b1f02b5065459a493c0c641cb964287d2999cc7c38af695fe8 b/.pnpm-store/v3/files/6e/382ba40ad1a895b56585006f12fff122df8422e9f2462dda9e91a436ad27c4aa337cfd0b36e9b1f02b5065459a493c0c641cb964287d2999cc7c38af695fe8 new file mode 100644 index 00000000..78eb3cb8 --- /dev/null +++ b/.pnpm-store/v3/files/6e/382ba40ad1a895b56585006f12fff122df8422e9f2462dda9e91a436ad27c4aa337cfd0b36e9b1f02b5065459a493c0c641cb964287d2999cc7c38af695fe8 @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-condition.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-condition.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6e/536803893a218fce94c5c5abcca73995d1a1edbf00c777a0ce9b706903964a7efcd45314712e2f416b5647c3c72a5b364f0c8d75b180e42be77383be06d1d6 b/.pnpm-store/v3/files/6e/536803893a218fce94c5c5abcca73995d1a1edbf00c777a0ce9b706903964a7efcd45314712e2f416b5647c3c72a5b364f0c8d75b180e42be77383be06d1d6 new file mode 100644 index 00000000..f1cd8a68 --- /dev/null +++ b/.pnpm-store/v3/files/6e/536803893a218fce94c5c5abcca73995d1a1edbf00c777a0ce9b706903964a7efcd45314712e2f416b5647c3c72a5b364f0c8d75b180e42be77383be06d1d6 @@ -0,0 +1,3 @@ +import type * as vscode from 'vscode-languageserver-protocol'; +import type { ServiceContext } from '../types'; +export declare function register(context: ServiceContext): (uri: string, token?: vscode.CancellationToken) => Promise; diff --git a/.pnpm-store/v3/files/6e/5d7cea1e9b9f3cbc81ac012a92742f194605434fbbfddb888d342bbe449ab406824a87ae4275a58ce203995b38bfe5f31cc1a36293d8a986bc8c38f1b4a531 b/.pnpm-store/v3/files/6e/5d7cea1e9b9f3cbc81ac012a92742f194605434fbbfddb888d342bbe449ab406824a87ae4275a58ce203995b38bfe5f31cc1a36293d8a986bc8c38f1b4a531 new file mode 100644 index 00000000..204a33a8 --- /dev/null +++ b/.pnpm-store/v3/files/6e/5d7cea1e9b9f3cbc81ac012a92742f194605434fbbfddb888d342bbe449ab406824a87ae4275a58ce203995b38bfe5f31cc1a36293d8a986bc8c38f1b4a531 @@ -0,0 +1 @@ +{"version":3,"file":"adjacent-overload-signatures.js","sourceRoot":"","sources":["../../src/rules/adjacent-overload-signatures.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6e/716e5da4cdb1294967a19b1bd4d56818433e0d6ed0250cade03cea2b7d8882a51d3bd0b52c465dd22f1253e60b09f271bbcd21274ef67f0e25a94c16fa1ce1 b/.pnpm-store/v3/files/6e/716e5da4cdb1294967a19b1bd4d56818433e0d6ed0250cade03cea2b7d8882a51d3bd0b52c465dd22f1253e60b09f271bbcd21274ef67f0e25a94c16fa1ce1 new file mode 100644 index 00000000..5cb8b620 --- /dev/null +++ b/.pnpm-store/v3/files/6e/716e5da4cdb1294967a19b1bd4d56818433e0d6ed0250cade03cea2b7d8882a51d3bd0b52c465dd22f1253e60b09f271bbcd21274ef67f0e25a94c16fa1ce1 @@ -0,0 +1,20126 @@ +/* + @license + Rollup.js v4.10.0 + Sat, 10 Feb 2024 05:58:12 GMT - commit 762420860765e8e46e24d48b38f5b98ca31735fa + + https://github.com/rollup/rollup + + Released under the MIT License. +*/ +import { normalize, getImportPath, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, logInvalidAnnotation, logRedeclarationError, logDuplicateArgumentNameError, logIllegalImportReassignment, logModuleLevelDirective, logMissingExport, logCannotCallNamespace, logEval, LOGLEVEL_INFO, logFirstSideEffect, locate, logThisIsUndefined, logImportAttributeIsInvalid, logImportOptionsAreInvalid, error, logSyntheticNamedExportsNeedNamespaceExport, logMissingEntryExport, logInvalidFormatForTopLevelAwait, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, logModuleParseError, parseAstAsync, logCircularReexport, logMissingNodeBuiltins, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logAddonNotGenerated, logIncompatibleExportOptionValue, logMixedExport, logFailedValidation, isPathFragment, logCyclicCrossChunkReexport, getAliasName, logUnexpectedNamedImport, isAbsolute as isAbsolute$1, relative as relative$1, logUnexpectedNamespaceReexport, logEmptyChunk, logMissingGlobalName, logOptimizeChunkStatus, logSourcemapBroken, logConflictingSourcemapSources, logChunkInvalid, logInvalidOption, URL_OUTPUT_FORMAT, URL_OUTPUT_DIR, URL_OUTPUT_SOURCEMAPFILE, URL_OUTPUT_AMD_ID, logCannotAssignModuleToChunk, logAnonymousPluginCache, logDuplicatePluginName, LOGLEVEL_ERROR, logLevelPriority, relativeId, LOGLEVEL_DEBUG, logUnknownOption, printQuotedStringList, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, logBadLoader, logExternalModulesCannotBeTransformedToModules, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, logFileNameConflict, logAssetNotFinalisedForFileName, logChunkNotGeneratedForFileName, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidFunctionPluginHook, logInvalidAddonPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, URL_TREESHAKE_MODULESIDEEFFECTS, URL_TREESHAKE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_AMD_BASEPATH, logInvalidExportOptionValue, warnDeprecation, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, logAlreadyClosed, logMissingFileOrDirOption, logCannotEmitFromOptionsHook, URL_WATCH } from './parseAst.js'; +import { relative, dirname, basename, extname, resolve as resolve$1 } from 'node:path'; +import require$$0$1, { win32, posix, isAbsolute, resolve } from 'path'; +import process$1, { env as env$1 } from 'node:process'; +import { performance } from 'node:perf_hooks'; +import { xxhashBase64Url, xxhashBase36, xxhashBase16 } from '../../native.js'; +import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises'; +import * as tty from 'tty'; + +var version = "4.10.0"; + +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars$1.length; i++) { + const c = chars$1.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +function decode(mappings) { + const state = new Int32Array(5); + const decoded = []; + let index = 0; + do { + const semi = indexOf(mappings, index); + const line = []; + let sorted = true; + let lastCol = 0; + state[0] = 0; + for (let i = index; i < semi; i++) { + let seg; + i = decodeInteger(mappings, i, state, 0); // genColumn + const col = state[0]; + if (col < lastCol) + sorted = false; + lastCol = col; + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 1); // sourcesIndex + i = decodeInteger(mappings, i, state, 2); // sourceLine + i = decodeInteger(mappings, i, state, 3); // sourceColumn + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 4); // namesIndex + seg = [col, state[1], state[2], state[3], state[4]]; + } + else { + seg = [col, state[1], state[2], state[3]]; + } + } + else { + seg = [col]; + } + line.push(seg); + } + if (!sorted) + sort(line); + decoded.push(line); + index = semi + 1; + } while (index <= mappings.length); + return decoded; +} +function indexOf(mappings, index) { + const idx = mappings.indexOf(';', index); + return idx === -1 ? mappings.length : idx; +} +function decodeInteger(mappings, pos, state, j) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = mappings.charCodeAt(pos++); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + state[j] += value; + return pos; +} +function hasMoreVlq(mappings, i, length) { + if (i >= length) + return false; + return mappings.charCodeAt(i) !== comma; +} +function sort(line) { + line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ''; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // genColumn + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex + } + } + return out + td.decode(buf.subarray(0, pos)); +} +function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? (-num << 1) | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) + clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; +} + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +let Chunk$1 = class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +}; + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject$1(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + while (contentLineEnd >= 0) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk$1(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject$1(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk$1(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) + this.overwrite( + match.index, + match.index + match[0].length, + getReplacement(match, this.original), + ); + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) + this.overwrite( + match.index, + match.index + match[0].length, + getReplacement(match, this.original), + ); + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +const hasOwnProp = Object.prototype.hasOwnProperty; + +let Bundle$1 = class Bundle { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } + + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } + + if (!isObject$1(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', + ); + } + + ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; + }); + + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } + + this.sources.push(source); + return this; + } + + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', + }); + + return this; + } + + clone() { + const bundle = new Bundle({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); + + return bundle; + } + + generateDecodedMap(options = {}) { + const names = []; + let x_google_ignoreList = undefined; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); + + const mappings = new Mappings(options.hires); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator(magicString.original); + + if (magicString.intro) { + mappings.advance(magicString.intro); + } + + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations, + ); + } + } else { + mappings.advance(chunk.content); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (magicString.outro) { + mappings.advance(magicString.outro); + } + + if (source.ignoreList && sourceIndex !== -1) { + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + x_google_ignoreList.push(sourceIndex); + } + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + x_google_ignoreList, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + getIndentString() { + const indentStringCounts = {}; + + this.sources.forEach((source) => { + const indentStr = source.content._getRawIndentString(); + + if (indentStr === null) return; + + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); + + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } + + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } + + if (indentStr === '') return this; // noop + + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); + + trailingNewline = source.content.lastChar() === '\n'; + }); + + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } + + return this; + } + + prepend(str) { + this.intro = str + this.intro; + return this; + } + + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); + + return str; + }) + .join(''); + + return this.intro + body; + } + + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } + + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length, + ); + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } + + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + let source; + let i = this.sources.length - 1; + + do { + source = this.sources[i--]; + if (!source) { + this.intro = this.intro.replace(rx, ''); + break; + } + } while (!source.content.trimEndAborted(charType)); + + return this; + } +}; + +const needsEscapeRegEx = /[\n\r'\\\u2028\u2029]/; +const quoteNewlineRegEx = /([\n\r'\u2028\u2029])/g; +const backSlashRegEx = /\\/g; +function escapeId(id) { + if (!needsEscapeRegEx.test(id)) + return id; + return id.replace(backSlashRegEx, '\\\\').replace(quoteNewlineRegEx, '\\$1'); +} + +class ExternalChunk { + constructor(module, options, inputBase) { + this.options = options; + this.inputBase = inputBase; + this.defaultVariableName = ''; + this.namespaceVariableName = ''; + this.variableName = ''; + this.fileName = null; + this.importAttributes = null; + this.id = module.id; + this.moduleInfo = module.info; + this.renormalizeRenderPath = module.renormalizeRenderPath; + this.suggestedVariableName = module.suggestedVariableName; + } + getFileName() { + if (this.fileName) { + return this.fileName; + } + const { paths } = this.options; + return (this.fileName = + (typeof paths === 'function' ? paths(this.id) : paths[this.id]) || + (this.renormalizeRenderPath ? normalize(relative(this.inputBase, this.id)) : this.id)); + } + getImportAttributes(snippets) { + return (this.importAttributes ||= formatAttributes(this.options.format === 'es' && + this.options.externalImportAttributes && + this.moduleInfo.attributes, snippets)); + } + getImportPath(importer) { + return escapeId(this.renormalizeRenderPath + ? getImportPath(importer, this.getFileName(), this.options.format === 'amd', false) + : this.getFileName()); + } +} +function formatAttributes(attributes, { getObject }) { + if (!attributes) { + return null; + } + const assertionEntries = Object.entries(attributes).map(([key, value]) => [key, `'${value}'`]); + if (assertionEntries.length > 0) { + return getObject(assertionEntries, { lineBreakIndent: null }); + } + return null; +} + +function getOrCreate(map, key, init) { + const existing = map.get(key); + if (existing !== undefined) { + return existing; + } + const value = init(); + map.set(key, value); + return value; +} +function getNewSet() { + return new Set(); +} +function getNewArray() { + return []; +} + +const UnknownKey = Symbol('Unknown Key'); +const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key'); +const UnknownInteger = Symbol('Unknown Integer'); +const SymbolToStringTag = Symbol('Symbol.toStringTag'); +const EMPTY_PATH = []; +const UNKNOWN_PATH = [UnknownKey]; +// For deoptimizations, this means we are modifying an unknown property but did +// not lose track of the object or are creating a setter/getter; +// For assignment effects it means we do not check for setter/getter effects +// but only if something is mutated that is included, which is relevant for +// Object.defineProperty +const UNKNOWN_NON_ACCESSOR_PATH = [UnknownNonAccessorKey]; +const UNKNOWN_INTEGER_PATH = [UnknownInteger]; +const EntitiesKey = Symbol('Entities'); +class PathTracker { + constructor() { + this.entityPaths = Object.create(null, { + [EntitiesKey]: { value: new Set() } + }); + } + trackEntityAtPathAndGetIfTracked(path, entity) { + const trackedEntities = this.getEntities(path); + if (trackedEntities.has(entity)) + return true; + trackedEntities.add(entity); + return false; + } + withTrackedEntityAtPath(path, entity, onUntracked, returnIfTracked) { + const trackedEntities = this.getEntities(path); + if (trackedEntities.has(entity)) + return returnIfTracked; + trackedEntities.add(entity); + const result = onUntracked(); + trackedEntities.delete(entity); + return result; + } + getEntities(path) { + let currentPaths = this.entityPaths; + for (const pathSegment of path) { + currentPaths = currentPaths[pathSegment] = + currentPaths[pathSegment] || + Object.create(null, { [EntitiesKey]: { value: new Set() } }); + } + return currentPaths[EntitiesKey]; + } +} +const SHARED_RECURSION_TRACKER = new PathTracker(); +class DiscriminatedPathTracker { + constructor() { + this.entityPaths = Object.create(null, { + [EntitiesKey]: { value: new Map() } + }); + } + trackEntityAtPathAndGetIfTracked(path, discriminator, entity) { + let currentPaths = this.entityPaths; + for (const pathSegment of path) { + currentPaths = currentPaths[pathSegment] = + currentPaths[pathSegment] || + Object.create(null, { [EntitiesKey]: { value: new Map() } }); + } + const trackedEntities = getOrCreate(currentPaths[EntitiesKey], discriminator, (getNewSet)); + if (trackedEntities.has(entity)) + return true; + trackedEntities.add(entity); + return false; + } +} + +function isFlagSet(flags, flag) { + return (flags & flag) !== 0; +} +function setFlag(flags, flag, value) { + return (flags & ~flag) | (-value & flag); +} + +const UnknownValue = Symbol('Unknown Value'); +const UnknownTruthyValue = Symbol('Unknown Truthy Value'); +class ExpressionEntity { + constructor() { + this.flags = 0; + } + get included() { + return isFlagSet(this.flags, 1 /* Flag.included */); + } + set included(value) { + this.flags = setFlag(this.flags, 1 /* Flag.included */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, _path, _recursionTracker) { + deoptimizeInteraction(interaction); + } + deoptimizePath(_path) { } + /** + * If possible it returns a stringifyable literal value for this node that + * can be used for inlining or comparing values. Otherwise, it should return + * UnknownValue. + */ + getLiteralValueAtPath(_path, _recursionTracker, _origin) { + return UnknownValue; + } + getReturnExpressionWhenCalledAtPath(_path, _interaction, _recursionTracker, _origin) { + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(_path, _interaction, _context) { + return true; + } + include(_context, _includeChildrenRecursively, _options) { + this.included = true; + } + includeCallArguments(context, parameters) { + for (const argument of parameters) { + argument.include(context, false); + } + } + shouldBeIncluded(_context) { + return true; + } +} +const UNKNOWN_EXPRESSION = new (class UnknownExpression extends ExpressionEntity { +})(); +const UNKNOWN_RETURN_EXPRESSION = [ + UNKNOWN_EXPRESSION, + false +]; +const deoptimizeInteraction = (interaction) => { + for (const argument of interaction.args) { + argument?.deoptimizePath(UNKNOWN_PATH); + } +}; + +const INTERACTION_ACCESSED = 0; +const INTERACTION_ASSIGNED = 1; +const INTERACTION_CALLED = 2; +const NODE_INTERACTION_UNKNOWN_ACCESS = { + args: [null], + type: INTERACTION_ACCESSED +}; +const NODE_INTERACTION_UNKNOWN_ASSIGNMENT = { + args: [null, UNKNOWN_EXPRESSION], + type: INTERACTION_ASSIGNED +}; +// While this is technically a call without arguments, we can compare against +// this reference in places where precise values or this argument would make a +// difference +const NODE_INTERACTION_UNKNOWN_CALL = { + args: [null], + type: INTERACTION_CALLED, + withNew: false +}; + +class Variable extends ExpressionEntity { + constructor(name) { + super(); + this.name = name; + this.alwaysRendered = false; + this.forbiddenNames = null; + this.initReached = false; + this.isId = false; + this.isReassigned = false; + this.kind = null; + this.renderBaseName = null; + this.renderName = null; + } + /** + * Binds identifiers that reference this variable to this variable. + * Necessary to be able to change variable names. + */ + addReference(_identifier) { } + /** + * Prevent this variable from being renamed to this name to avoid name + * collisions + */ + forbidName(name) { + (this.forbiddenNames ||= new Set()).add(name); + } + getBaseVariableName() { + return (this.renderedLikeHoisted?.getBaseVariableName() || + this.renderBaseName || + this.renderName || + this.name); + } + getName(getPropertyAccess, useOriginalName) { + if (useOriginalName?.(this)) { + return this.name; + } + if (this.renderedLikeHoisted) { + return this.renderedLikeHoisted.getName(getPropertyAccess, useOriginalName); + } + const name = this.renderName || this.name; + return this.renderBaseName ? `${this.renderBaseName}${getPropertyAccess(name)}` : name; + } + hasEffectsOnInteractionAtPath(path, { type }, _context) { + return type !== INTERACTION_ACCESSED || path.length > 0; + } + /** + * Marks this variable as being part of the bundle, which is usually the case when one of + * its identifiers becomes part of the bundle. Returns true if it has not been included + * previously. + * Once a variable is included, it should take care all its declarations are included. + */ + include() { + this.included = true; + this.renderedLikeHoisted?.include(); + } + /** + * Links the rendered name of this variable to another variable and includes + * this variable if the other variable is included. + */ + renderLikeHoisted(variable) { + this.renderedLikeHoisted = variable; + } + markCalledFromTryStatement() { } + setRenderNames(baseName, name) { + this.renderBaseName = baseName; + this.renderName = name; + } +} + +class ExternalVariable extends Variable { + constructor(module, name) { + super(name); + this.referenced = false; + this.module = module; + this.isNamespace = name === '*'; + } + addReference(identifier) { + this.referenced = true; + if (this.name === 'default' || this.name === '*') { + this.module.suggestName(identifier.name); + } + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > (this.isNamespace ? 1 : 0); + } + include() { + super.include(); + this.module.used = true; + } +} + +const BLANK = Object.freeze(Object.create(null)); +const EMPTY_OBJECT = Object.freeze({}); +const EMPTY_ARRAY = Object.freeze([]); +const EMPTY_SET = Object.freeze(new (class extends Set { + add() { + throw new Error('Cannot add to empty set'); + } +})()); + +const RESERVED_NAMES = new Set([ + 'await', + 'break', + 'case', + 'catch', + 'class', + 'const', + 'continue', + 'debugger', + 'default', + 'delete', + 'do', + 'else', + 'enum', + 'eval', + 'export', + 'extends', + 'false', + 'finally', + 'for', + 'function', + 'if', + 'implements', + 'import', + 'in', + 'instanceof', + 'interface', + 'let', + 'NaN', + 'new', + 'null', + 'package', + 'private', + 'protected', + 'public', + 'return', + 'static', + 'super', + 'switch', + 'this', + 'throw', + 'true', + 'try', + 'typeof', + 'undefined', + 'var', + 'void', + 'while', + 'with', + 'yield' +]); + +const illegalCharacters = /[^\w$]/g; +const startsWithDigit = (value) => /\d/.test(value[0]); +const needsEscape = (value) => startsWithDigit(value) || RESERVED_NAMES.has(value) || value === 'arguments'; +function isLegal(value) { + if (needsEscape(value)) { + return false; + } + return !illegalCharacters.test(value); +} +function makeLegal(value) { + value = value + .replace(/-(\w)/g, (_, letter) => letter.toUpperCase()) + .replace(illegalCharacters, '_'); + if (needsEscape(value)) + value = `_${value}`; + return value || '_'; +} +const VALID_IDENTIFIER_REGEXP = /^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]*$/u; +const NUMBER_REGEXP = /^(?:0|[1-9]\d*)$/; +function stringifyObjectKeyIfNeeded(key) { + if (VALID_IDENTIFIER_REGEXP.test(key)) { + return key === '__proto__' ? '["__proto__"]' : key; + } + if (NUMBER_REGEXP.test(key) && +key <= Number.MAX_SAFE_INTEGER) { + return key; + } + return JSON.stringify(key); +} +function stringifyIdentifierIfNeeded(key) { + if (VALID_IDENTIFIER_REGEXP.test(key)) { + return key; + } + return JSON.stringify(key); +} + +class ExternalModule { + constructor(options, id, moduleSideEffects, meta, renormalizeRenderPath, attributes) { + this.options = options; + this.id = id; + this.renormalizeRenderPath = renormalizeRenderPath; + this.dynamicImporters = []; + this.execIndex = Infinity; + this.exportedVariables = new Map(); + this.importers = []; + this.reexported = false; + this.used = false; + this.declarations = new Map(); + this.mostCommonSuggestion = 0; + this.nameSuggestions = new Map(); + this.suggestedVariableName = makeLegal(id.split(/[/\\]/).pop()); + const { importers, dynamicImporters } = this; + this.info = { + ast: null, + attributes, + code: null, + dynamicallyImportedIdResolutions: EMPTY_ARRAY, + dynamicallyImportedIds: EMPTY_ARRAY, + get dynamicImporters() { + return dynamicImporters.sort(); + }, + exportedBindings: null, + exports: null, + hasDefaultExport: null, + id, + implicitlyLoadedAfterOneOf: EMPTY_ARRAY, + implicitlyLoadedBefore: EMPTY_ARRAY, + importedIdResolutions: EMPTY_ARRAY, + importedIds: EMPTY_ARRAY, + get importers() { + return importers.sort(); + }, + isEntry: false, + isExternal: true, + isIncluded: null, + meta, + moduleSideEffects, + syntheticNamedExports: false + }; + } + getVariableForExportName(name) { + const declaration = this.declarations.get(name); + if (declaration) + return [declaration]; + const externalVariable = new ExternalVariable(this, name); + this.declarations.set(name, externalVariable); + this.exportedVariables.set(externalVariable, name); + return [externalVariable]; + } + suggestName(name) { + const value = (this.nameSuggestions.get(name) ?? 0) + 1; + this.nameSuggestions.set(name, value); + if (value > this.mostCommonSuggestion) { + this.mostCommonSuggestion = value; + this.suggestedVariableName = name; + } + } + warnUnusedImports() { + const unused = [...this.declarations] + .filter(([name, declaration]) => name !== '*' && !declaration.included && !this.reexported && !declaration.referenced) + .map(([name]) => name); + if (unused.length === 0) + return; + const importersSet = new Set(); + for (const name of unused) { + for (const importer of this.declarations.get(name).module.importers) { + importersSet.add(importer); + } + } + const importersArray = [...importersSet]; + this.options.onLog(LOGLEVEL_WARN, logUnusedExternalImports(this.id, unused, importersArray)); + } +} + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + if (this instanceof a) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} + +var utils$3 = {}; + +const path$1 = require$$0$1; +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE$1 = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +var constants$2 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path$1.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; + +(function (exports) { + + const path = require$$0$1; + const win32 = process.platform === 'win32'; + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = constants$2; + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; + }; + + exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; +} (utils$3)); + +const utils$2 = utils$3; +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = constants$2; + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan$1 = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils$2.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils$2.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +var scan_1 = scan$1; + +const constants$1 = constants$2; +const utils$1 = utils$3; + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants$1; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse$1 = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils$1.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants$1.globChars(win32); + const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils$1.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse$1(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils$1.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils$1.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils$1.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils$1.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils$1.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils$1.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils$1.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils$1.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse$1.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils$1.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants$1.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils$1.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +var parse_1 = parse$1; + +const path = require$$0$1; +const scan = scan_1; +const parse = parse_1; +const utils = utils$3; +const constants = constants$2; +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch$1 = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch$1(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch$1.compileRe(glob, options) + : picomatch$1.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch$1.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch$1.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch$1.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch$1.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options); + return regex.test(path.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch$1.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch$1.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch$1.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch$1.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch$1.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch$1.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch$1.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch$1.constants = constants; + +/** + * Expose "picomatch" + */ + +var picomatch_1 = picomatch$1; + +var picomatch = picomatch_1; + +const pm = /*@__PURE__*/getDefaultExportFromCjs(picomatch); + +const extractors = { + ArrayPattern(names, param) { + for (const element of param.elements) { + if (element) + extractors[element.type](names, element); + } + }, + AssignmentPattern(names, param) { + extractors[param.left.type](names, param.left); + }, + Identifier(names, param) { + names.push(param.name); + }, + MemberExpression() { }, + ObjectPattern(names, param) { + for (const prop of param.properties) { + // @ts-ignore Typescript reports that this is not a valid type + if (prop.type === 'RestElement') { + extractors.RestElement(names, prop); + } + else { + extractors[prop.value.type](names, prop.value); + } + } + }, + RestElement(names, param) { + extractors[param.argument.type](names, param.argument); + } +}; +const extractAssignedNames = function extractAssignedNames(param) { + const names = []; + extractors[param.type](names, param); + return names; +}; + +// Helper since Typescript can't detect readonly arrays with Array.isArray +function isArray(arg) { + return Array.isArray(arg); +} +function ensureArray$1(thing) { + if (isArray(thing)) + return thing; + if (thing == null) + return []; + return [thing]; +} + +const normalizePath = function normalizePath(filename) { + return filename.split(win32.sep).join(posix.sep); +}; + +function getMatcherString(id, resolutionBase) { + if (resolutionBase === false || isAbsolute(id) || id.startsWith('**')) { + return normalizePath(id); + } + // resolve('') is valid and will default to process.cwd() + const basePath = normalizePath(resolve(resolutionBase || '')) + // escape all possible (posix + win) path characters that might interfere with regex + .replace(/[-^$*+?.()|[\]{}]/g, '\\$&'); + // Note that we use posix.join because: + // 1. the basePath has been normalized to use / + // 2. the incoming glob (id) matcher, also uses / + // otherwise Node will force backslash (\) on windows + return posix.join(basePath, normalizePath(id)); +} +const createFilter = function createFilter(include, exclude, options) { + const resolutionBase = options && options.resolve; + const getMatcher = (id) => id instanceof RegExp + ? id + : { + test: (what) => { + // this refactor is a tad overly verbose but makes for easy debugging + const pattern = getMatcherString(id, resolutionBase); + const fn = pm(pattern, { dot: true }); + const result = fn(what); + return result; + } + }; + const includeMatchers = ensureArray$1(include).map(getMatcher); + const excludeMatchers = ensureArray$1(exclude).map(getMatcher); + return function result(id) { + if (typeof id !== 'string') + return false; + if (/\0/.test(id)) + return false; + const pathId = normalizePath(id); + for (let i = 0; i < excludeMatchers.length; ++i) { + const matcher = excludeMatchers[i]; + if (matcher.test(pathId)) + return false; + } + for (let i = 0; i < includeMatchers.length; ++i) { + const matcher = includeMatchers[i]; + if (matcher.test(pathId)) + return true; + } + return !includeMatchers.length; + }; +}; + +const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'; +const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'; +const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' ')); +forbiddenIdentifiers.add(''); + +function createInclusionContext() { + return { + brokenFlow: false, + hasBreak: false, + hasContinue: false, + includedCallArguments: new Set(), + includedLabels: new Set() + }; +} +function createHasEffectsContext() { + return { + accessed: new PathTracker(), + assigned: new PathTracker(), + brokenFlow: false, + called: new DiscriminatedPathTracker(), + hasBreak: false, + hasContinue: false, + ignore: { + breaks: false, + continues: false, + labels: new Set(), + returnYield: false, + this: false + }, + includedLabels: new Set(), + instantiated: new DiscriminatedPathTracker(), + replacedVariableInits: new Map() + }; +} + +function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) { + return Object.create(inheritedDescriptions, memberDescriptions); +} +const UNDEFINED_EXPRESSION = new (class UndefinedExpression extends ExpressionEntity { + getLiteralValueAtPath() { + return undefined; + } +})(); +const returnsUnknown = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_EXPRESSION + } +}; +const UNKNOWN_LITERAL_BOOLEAN = new (class UnknownBoolean extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalBooleanMembers, path[0], interaction, context); + } + return true; + } +})(); +const returnsBoolean = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_BOOLEAN + } +}; +const UNKNOWN_LITERAL_NUMBER = new (class UnknownNumber extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalNumberMembers, path[0], interaction, context); + } + return true; + } +})(); +const returnsNumber = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_NUMBER + } +}; +const UNKNOWN_LITERAL_STRING = new (class UnknownString extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); + } + return true; + } +})(); +const returnsString = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_STRING + } +}; +const stringReplace = { + value: { + hasEffectsWhenCalled({ args }, context) { + const argument1 = args[2]; + return (args.length < 3 || + (typeof argument1.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, { + deoptimizeCache() { } + }) === 'symbol' && + argument1.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context))); + }, + returns: UNKNOWN_LITERAL_STRING + } +}; +const objectMembers = assembleMemberDescriptions({ + hasOwnProperty: returnsBoolean, + isPrototypeOf: returnsBoolean, + propertyIsEnumerable: returnsBoolean, + toLocaleString: returnsString, + toString: returnsString, + valueOf: returnsUnknown +}); +const literalBooleanMembers = assembleMemberDescriptions({ + valueOf: returnsBoolean +}, objectMembers); +const literalNumberMembers = assembleMemberDescriptions({ + toExponential: returnsString, + toFixed: returnsString, + toLocaleString: returnsString, + toPrecision: returnsString, + valueOf: returnsNumber +}, objectMembers); +/** + * RegExp are stateful when they have the global or sticky flags set. + * But if we actually don't use them, the side effect does not matter. + * the check logic in `hasEffectsOnInteractionAtPath`. + */ +const literalRegExpMembers = assembleMemberDescriptions({ + exec: returnsUnknown, + test: returnsBoolean +}, objectMembers); +const literalStringMembers = assembleMemberDescriptions({ + anchor: returnsString, + at: returnsUnknown, + big: returnsString, + blink: returnsString, + bold: returnsString, + charAt: returnsString, + charCodeAt: returnsNumber, + codePointAt: returnsUnknown, + concat: returnsString, + endsWith: returnsBoolean, + fixed: returnsString, + fontcolor: returnsString, + fontsize: returnsString, + includes: returnsBoolean, + indexOf: returnsNumber, + italics: returnsString, + lastIndexOf: returnsNumber, + link: returnsString, + localeCompare: returnsNumber, + match: returnsUnknown, + matchAll: returnsUnknown, + normalize: returnsString, + padEnd: returnsString, + padStart: returnsString, + repeat: returnsString, + replace: stringReplace, + replaceAll: stringReplace, + search: returnsNumber, + slice: returnsString, + small: returnsString, + split: returnsUnknown, + startsWith: returnsBoolean, + strike: returnsString, + sub: returnsString, + substr: returnsString, + substring: returnsString, + sup: returnsString, + toLocaleLowerCase: returnsString, + toLocaleUpperCase: returnsString, + toLowerCase: returnsString, + toString: returnsString, // overrides the toString() method of the Object object; it does not inherit Object.prototype.toString() + toUpperCase: returnsString, + trim: returnsString, + trimEnd: returnsString, + trimLeft: returnsString, + trimRight: returnsString, + trimStart: returnsString, + valueOf: returnsString +}, objectMembers); +function getLiteralMembersForValue(value) { + if (value instanceof RegExp) { + return literalRegExpMembers; + } + switch (typeof value) { + case 'boolean': { + return literalBooleanMembers; + } + case 'number': { + return literalNumberMembers; + } + case 'string': { + return literalStringMembers; + } + } + return Object.create(null); +} +function hasMemberEffectWhenCalled(members, memberName, interaction, context) { + if (typeof memberName !== 'string' || !members[memberName]) { + return true; + } + return members[memberName].hasEffectsWhenCalled?.(interaction, context) || false; +} +function getMemberReturnExpressionWhenCalled(members, memberName) { + if (typeof memberName !== 'string' || !members[memberName]) + return UNKNOWN_RETURN_EXPRESSION; + return [members[memberName].returns, false]; +} + +const keys = { + Literal: [], + Program: ['body'] +}; +function createKeysForNode(esTreeNode) { + return Object.keys(esTreeNode).filter(key => typeof esTreeNode[key] === 'object' && key.charCodeAt(0) !== 95 /* _ */); +} + +const INCLUDE_PARAMETERS = 'variables'; +class NodeBase extends ExpressionEntity { + /** + * Nodes can apply custom deoptimizations once they become part of the + * executed code. To do this, they must initialize this as false, implement + * applyDeoptimizations and call this from include and hasEffects if they have + * custom handlers + */ + get deoptimized() { + return isFlagSet(this.flags, 2 /* Flag.deoptimized */); + } + set deoptimized(value) { + this.flags = setFlag(this.flags, 2 /* Flag.deoptimized */, value); + } + constructor(esTreeNode, parent, parentScope, keepEsTreeNode = false) { + super(); + // Nodes can opt-in to keep the AST if needed during the build pipeline. + // Avoid true when possible as large AST takes up memory. + if (keepEsTreeNode) { + this.esTreeNode = esTreeNode; + } + const { type } = esTreeNode; + keys[type] ||= createKeysForNode(esTreeNode); + this.parent = parent; + this.scope = parentScope; + this.createScope(parentScope); + this.parseNode(esTreeNode); + this.initialise(); + this.scope.context.magicString.addSourcemapLocation(this.start); + this.scope.context.magicString.addSourcemapLocation(this.end); + } + addExportedVariables(_variables, _exportNamesByVariable) { } + /** + * Override this to bind assignments to variables and do any initialisations + * that require the scopes to be populated with variables. + */ + bind() { + for (const key of keys[this.type]) { + const value = this[key]; + if (Array.isArray(value)) { + for (const child of value) { + child?.bind(); + } + } + else if (value) { + value.bind(); + } + } + } + /** + * Override if this node should receive a different scope than the parent + * scope. + */ + createScope(parentScope) { + this.scope = parentScope; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const key of keys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + if (child?.hasEffects(context)) + return true; + } + } + else if (value.hasEffects(context)) + return true; + } + return false; + } + hasEffectsAsAssignmentTarget(context, _checkAccess) { + return (this.hasEffects(context) || + this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)); + } + include(context, includeChildrenRecursively, _options) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + for (const key of keys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child?.include(context, includeChildrenRecursively); + } + } + else { + value.include(context, includeChildrenRecursively); + } + } + } + includeAsAssignmentTarget(context, includeChildrenRecursively, _deoptimizeAccess) { + this.include(context, includeChildrenRecursively); + } + /** + * Override to perform special initialisation steps after the scope is + * initialised + */ + initialise() { } + parseNode(esTreeNode, keepEsTreeNodeKeys) { + for (const [key, value] of Object.entries(esTreeNode)) { + // Skip properties defined on the class already. + // This way, we can override this function to add custom initialisation and then call super.parseNode + // Note: this doesn't skip properties with defined getters/setters which we use to pack wrap booleans + // in bitfields. Those are still assigned from the value in the esTreeNode. + if (this.hasOwnProperty(key)) + continue; + if (key.charCodeAt(0) === 95 /* _ */) { + if (key === ANNOTATION_KEY) { + const annotations = value; + this.annotations = annotations; + if (this.scope.context.options.treeshake.annotations) { + this.annotationNoSideEffects = annotations.some(comment => comment.type === 'noSideEffects'); + this.annotationPure = annotations.some(comment => comment.type === 'pure'); + } + } + else if (key === INVALID_ANNOTATION_KEY) { + for (const { start, end, type } of value) { + this.scope.context.magicString.remove(start, end); + if (type === 'pure' || type === 'noSideEffects') { + this.scope.context.log(LOGLEVEL_WARN, logInvalidAnnotation(this.scope.context.code.slice(start, end), this.scope.context.module.id, type), start); + } + } + } + } + else if (typeof value !== 'object' || value === null) { + this[key] = value; + } + else if (Array.isArray(value)) { + this[key] = []; + for (const child of value) { + this[key].push(child === null + ? null + : new (this.scope.context.getNodeConstructor(child.type))(child, this, this.scope, keepEsTreeNodeKeys?.includes(key))); + } + } + else { + this[key] = new (this.scope.context.getNodeConstructor(value.type))(value, this, this.scope, keepEsTreeNodeKeys?.includes(key)); + } + } + } + removeAnnotations(code) { + if (this.annotations) { + for (const annotation of this.annotations) { + code.remove(annotation.start, annotation.end); + } + } + } + render(code, options) { + for (const key of keys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child?.render(code, options); + } + } + else { + value.render(code, options); + } + } + } + setAssignedValue(value) { + this.assignmentInteraction = { args: [null, value], type: INTERACTION_ASSIGNED }; + } + shouldBeIncluded(context) { + return this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext())); + } + /** + * Just deoptimize everything by default so that when e.g. we do not track + * something properly, it is deoptimized. + * @protected + */ + applyDeoptimizations() { + this.deoptimized = true; + for (const key of keys[this.type]) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child?.deoptimizePath(UNKNOWN_PATH); + } + } + else { + value.deoptimizePath(UNKNOWN_PATH); + } + } + this.scope.context.requestTreeshakingPass(); + } +} + +class SpreadElement extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (path.length > 0) { + this.argument.deoptimizeArgumentsOnInteractionAtPath(interaction, [UnknownKey, ...path], recursionTracker); + } + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + return (this.argument.hasEffects(context) || + (propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + this.argument.hasEffectsOnInteractionAtPath(UNKNOWN_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)))); + } + applyDeoptimizations() { + this.deoptimized = true; + // Only properties of properties of the argument could become subject to reassignment + // This will also reassign the return values of iterators + this.argument.deoptimizePath([UnknownKey, UnknownKey]); + this.scope.context.requestTreeshakingPass(); + } +} + +class Method extends ExpressionEntity { + constructor(description) { + super(); + this.description = description; + } + deoptimizeArgumentsOnInteractionAtPath({ args, type }, path) { + if (type === INTERACTION_CALLED && path.length === 0) { + if (this.description.mutatesSelfAsArray) { + args[0]?.deoptimizePath(UNKNOWN_INTEGER_PATH); + } + if (this.description.mutatesArgs) { + for (let index = 1; index < args.length; index++) { + args[index].deoptimizePath(UNKNOWN_PATH); + } + } + } + } + getReturnExpressionWhenCalledAtPath(path, { args }) { + if (path.length > 0) { + return UNKNOWN_RETURN_EXPRESSION; + } + return [ + this.description.returnsPrimitive || + (this.description.returns === 'self' + ? args[0] || UNKNOWN_EXPRESSION + : this.description.returns()), + false + ]; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (path.length > (type === INTERACTION_ACCESSED ? 1 : 0)) { + return true; + } + if (type === INTERACTION_CALLED) { + const { args } = interaction; + if (this.description.mutatesSelfAsArray === true && + args[0]?.hasEffectsOnInteractionAtPath(UNKNOWN_INTEGER_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context)) { + return true; + } + if (this.description.callsArgs) { + for (const argumentIndex of this.description.callsArgs) { + if (args[argumentIndex + 1]?.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context)) { + return true; + } + } + } + } + return false; + } +} +const METHOD_RETURNS_BOOLEAN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN + }) +]; +const METHOD_RETURNS_STRING = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_STRING + }) +]; +const METHOD_RETURNS_NUMBER = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; + +const INTEGER_REG_EXP = /^\d+$/; +class ObjectEntity extends ExpressionEntity { + get hasLostTrack() { + return isFlagSet(this.flags, 2048 /* Flag.hasLostTrack */); + } + set hasLostTrack(value) { + this.flags = setFlag(this.flags, 2048 /* Flag.hasLostTrack */, value); + } + get hasUnknownDeoptimizedInteger() { + return isFlagSet(this.flags, 4096 /* Flag.hasUnknownDeoptimizedInteger */); + } + set hasUnknownDeoptimizedInteger(value) { + this.flags = setFlag(this.flags, 4096 /* Flag.hasUnknownDeoptimizedInteger */, value); + } + get hasUnknownDeoptimizedProperty() { + return isFlagSet(this.flags, 8192 /* Flag.hasUnknownDeoptimizedProperty */); + } + set hasUnknownDeoptimizedProperty(value) { + this.flags = setFlag(this.flags, 8192 /* Flag.hasUnknownDeoptimizedProperty */, value); + } + // If a PropertyMap is used, this will be taken as propertiesAndGettersByKey + // and we assume there are no setters or getters + constructor(properties, prototypeExpression, immutable = false) { + super(); + this.prototypeExpression = prototypeExpression; + this.immutable = immutable; + this.additionalExpressionsToBeDeoptimized = new Set(); + this.allProperties = []; + this.deoptimizedPaths = Object.create(null); + this.expressionsToBeDeoptimizedByKey = Object.create(null); + this.gettersByKey = Object.create(null); + this.propertiesAndGettersByKey = Object.create(null); + this.propertiesAndSettersByKey = Object.create(null); + this.settersByKey = Object.create(null); + this.unknownIntegerProps = []; + this.unmatchableGetters = []; + this.unmatchablePropertiesAndGetters = []; + this.unmatchableSetters = []; + if (Array.isArray(properties)) { + this.buildPropertyMaps(properties); + } + else { + this.propertiesAndGettersByKey = this.propertiesAndSettersByKey = properties; + for (const propertiesForKey of Object.values(properties)) { + this.allProperties.push(...propertiesForKey); + } + } + } + deoptimizeAllProperties(noAccessors) { + const isDeoptimized = this.hasLostTrack || this.hasUnknownDeoptimizedProperty; + if (noAccessors) { + this.hasUnknownDeoptimizedProperty = true; + } + else { + this.hasLostTrack = true; + } + if (isDeoptimized) { + return; + } + for (const properties of [ + ...Object.values(this.propertiesAndGettersByKey), + ...Object.values(this.settersByKey) + ]) { + for (const property of properties) { + property.deoptimizePath(UNKNOWN_PATH); + } + } + // While the prototype itself cannot be mutated, each property can + this.prototypeExpression?.deoptimizePath([UnknownKey, UnknownKey]); + this.deoptimizeCachedEntities(); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + const [key, ...subPath] = path; + const { args, type } = interaction; + if (this.hasLostTrack || + // single paths that are deoptimized will not become getters or setters + ((type === INTERACTION_CALLED || path.length > 1) && + (this.hasUnknownDeoptimizedProperty || + (typeof key === 'string' && this.deoptimizedPaths[key])))) { + deoptimizeInteraction(interaction); + return; + } + const [propertiesForExactMatchByKey, relevantPropertiesByKey, relevantUnmatchableProperties] = type === INTERACTION_CALLED || path.length > 1 + ? [ + this.propertiesAndGettersByKey, + this.propertiesAndGettersByKey, + this.unmatchablePropertiesAndGetters + ] + : type === INTERACTION_ACCESSED + ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] + : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; + if (typeof key === 'string') { + if (propertiesForExactMatchByKey[key]) { + const properties = relevantPropertiesByKey[key]; + if (properties) { + for (const property of properties) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + if (!this.immutable) { + for (const argument of args) { + if (argument) { + this.additionalExpressionsToBeDeoptimized.add(argument); + } + } + } + return; + } + for (const property of relevantUnmatchableProperties) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + if (INTEGER_REG_EXP.test(key)) { + for (const property of this.unknownIntegerProps) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + } + else { + for (const properties of [ + ...Object.values(relevantPropertiesByKey), + relevantUnmatchableProperties + ]) { + for (const property of properties) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + for (const property of this.unknownIntegerProps) { + property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); + } + } + if (!this.immutable) { + for (const argument of args) { + if (argument) { + this.additionalExpressionsToBeDeoptimized.add(argument); + } + } + } + this.prototypeExpression?.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeIntegerProperties() { + if (this.hasLostTrack || + this.hasUnknownDeoptimizedProperty || + this.hasUnknownDeoptimizedInteger) { + return; + } + this.hasUnknownDeoptimizedInteger = true; + for (const [key, propertiesAndGetters] of Object.entries(this.propertiesAndGettersByKey)) { + if (INTEGER_REG_EXP.test(key)) { + for (const property of propertiesAndGetters) { + property.deoptimizePath(UNKNOWN_PATH); + } + } + } + this.deoptimizeCachedIntegerEntities(); + } + // Assumption: If only a specific path is deoptimized, no accessors are created + deoptimizePath(path) { + if (this.hasLostTrack || this.immutable) { + return; + } + const key = path[0]; + if (path.length === 1) { + if (typeof key !== 'string') { + if (key === UnknownInteger) { + return this.deoptimizeIntegerProperties(); + } + return this.deoptimizeAllProperties(key === UnknownNonAccessorKey); + } + if (!this.deoptimizedPaths[key]) { + this.deoptimizedPaths[key] = true; + // we only deoptimizeCache exact matches as in all other cases, + // we do not return a literal value or return expression + const expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey[key]; + if (expressionsToBeDeoptimized) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + } + const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1); + for (const property of typeof key === 'string' + ? [ + ...(this.propertiesAndGettersByKey[key] || this.unmatchablePropertiesAndGetters), + ...(this.settersByKey[key] || this.unmatchableSetters) + ] + : this.allProperties) { + property.deoptimizePath(subPath); + } + this.prototypeExpression?.deoptimizePath(path.length === 1 ? [...path, UnknownKey] : path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length === 0) { + return UnknownTruthyValue; + } + const key = path[0]; + const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); + if (expressionAtPath) { + return expressionAtPath.getLiteralValueAtPath(path.slice(1), recursionTracker, origin); + } + if (this.prototypeExpression) { + return this.prototypeExpression.getLiteralValueAtPath(path, recursionTracker, origin); + } + if (path.length === 1) { + return undefined; + } + return UnknownValue; + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (path.length === 0) { + return UNKNOWN_RETURN_EXPRESSION; + } + const [key, ...subPath] = path; + const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); + if (expressionAtPath) { + return expressionAtPath.getReturnExpressionWhenCalledAtPath(subPath, interaction, recursionTracker, origin); + } + if (this.prototypeExpression) { + return this.prototypeExpression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const [key, ...subPath] = path; + if (subPath.length > 0 || interaction.type === INTERACTION_CALLED) { + const expressionAtPath = this.getMemberExpression(key); + if (expressionAtPath) { + return expressionAtPath.hasEffectsOnInteractionAtPath(subPath, interaction, context); + } + if (this.prototypeExpression) { + return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); + } + return true; + } + if (key === UnknownNonAccessorKey) + return false; + if (this.hasLostTrack) + return true; + const [propertiesAndAccessorsByKey, accessorsByKey, unmatchableAccessors] = interaction.type === INTERACTION_ACCESSED + ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] + : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; + if (typeof key === 'string') { + if (propertiesAndAccessorsByKey[key]) { + const accessors = accessorsByKey[key]; + if (accessors) { + for (const accessor of accessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) + return true; + } + } + return false; + } + for (const accessor of unmatchableAccessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) { + return true; + } + } + } + else { + for (const accessors of [...Object.values(accessorsByKey), unmatchableAccessors]) { + for (const accessor of accessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) + return true; + } + } + } + if (this.prototypeExpression) { + return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); + } + return false; + } + buildPropertyMaps(properties) { + const { allProperties, propertiesAndGettersByKey, propertiesAndSettersByKey, settersByKey, gettersByKey, unknownIntegerProps, unmatchablePropertiesAndGetters, unmatchableGetters, unmatchableSetters } = this; + const unmatchablePropertiesAndSetters = []; + for (let index = properties.length - 1; index >= 0; index--) { + const { key, kind, property } = properties[index]; + allProperties.push(property); + if (typeof key === 'string') { + if (kind === 'set') { + if (!propertiesAndSettersByKey[key]) { + propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; + settersByKey[key] = [property, ...unmatchableSetters]; + } + } + else if (kind === 'get') { + if (!propertiesAndGettersByKey[key]) { + propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; + gettersByKey[key] = [property, ...unmatchableGetters]; + } + } + else { + if (!propertiesAndSettersByKey[key]) { + propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; + } + if (!propertiesAndGettersByKey[key]) { + propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; + } + } + } + else { + if (key === UnknownInteger) { + unknownIntegerProps.push(property); + continue; + } + if (kind === 'set') + unmatchableSetters.push(property); + if (kind === 'get') + unmatchableGetters.push(property); + if (kind !== 'get') + unmatchablePropertiesAndSetters.push(property); + if (kind !== 'set') + unmatchablePropertiesAndGetters.push(property); + } + } + } + deoptimizeCachedEntities() { + for (const expressionsToBeDeoptimized of Object.values(this.expressionsToBeDeoptimizedByKey)) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + for (const expression of this.additionalExpressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + deoptimizeCachedIntegerEntities() { + for (const [key, expressionsToBeDeoptimized] of Object.entries(this.expressionsToBeDeoptimizedByKey)) { + if (INTEGER_REG_EXP.test(key)) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + for (const expression of this.additionalExpressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_INTEGER_PATH); + } + } + getMemberExpression(key) { + if (this.hasLostTrack || + this.hasUnknownDeoptimizedProperty || + typeof key !== 'string' || + (this.hasUnknownDeoptimizedInteger && INTEGER_REG_EXP.test(key)) || + this.deoptimizedPaths[key]) { + return UNKNOWN_EXPRESSION; + } + const properties = this.propertiesAndGettersByKey[key]; + if (properties?.length === 1) { + return properties[0]; + } + if (properties || + this.unmatchablePropertiesAndGetters.length > 0 || + (this.unknownIntegerProps.length > 0 && INTEGER_REG_EXP.test(key))) { + return UNKNOWN_EXPRESSION; + } + return null; + } + getMemberExpressionAndTrackDeopt(key, origin) { + if (typeof key !== 'string') { + return UNKNOWN_EXPRESSION; + } + const expression = this.getMemberExpression(key); + if (!(expression === UNKNOWN_EXPRESSION || this.immutable)) { + const expressionsToBeDeoptimized = (this.expressionsToBeDeoptimizedByKey[key] = + this.expressionsToBeDeoptimizedByKey[key] || []); + expressionsToBeDeoptimized.push(origin); + } + return expression; + } +} + +const isInteger = (property) => typeof property === 'string' && /^\d+$/.test(property); +// This makes sure unknown properties are not handled as "undefined" but as +// "unknown" but without access side effects. An exception is done for numeric +// properties as we do not expect new builtin properties to be numbers, this +// will improve tree-shaking for out-of-bounds array properties +const OBJECT_PROTOTYPE_FALLBACK = new (class ObjectPrototypeFallbackExpression extends ExpressionEntity { + deoptimizeArgumentsOnInteractionAtPath(interaction, path) { + if (interaction.type === INTERACTION_CALLED && path.length === 1 && !isInteger(path[0])) { + deoptimizeInteraction(interaction); + } + } + getLiteralValueAtPath(path) { + // We ignore number properties as we do not expect new properties to be + // numbers and also want to keep handling out-of-bound array elements as + // "undefined" + return path.length === 1 && isInteger(path[0]) ? undefined : UnknownValue; + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type === INTERACTION_CALLED; + } +})(); +const OBJECT_PROTOTYPE = new ObjectEntity({ + __proto__: null, + hasOwnProperty: METHOD_RETURNS_BOOLEAN, + isPrototypeOf: METHOD_RETURNS_BOOLEAN, + propertyIsEnumerable: METHOD_RETURNS_BOOLEAN, + toLocaleString: METHOD_RETURNS_STRING, + toString: METHOD_RETURNS_STRING, + valueOf: METHOD_RETURNS_UNKNOWN +}, OBJECT_PROTOTYPE_FALLBACK, true); + +const NEW_ARRAY_PROPERTIES = [ + { key: UnknownInteger, kind: 'init', property: UNKNOWN_EXPRESSION }, + { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER = [ + new Method({ + callsArgs: null, + mutatesArgs: true, + mutatesSelfAsArray: true, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_MUTATES_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_DEOPTS_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_MUTATES_SELF_RETURNS_SELF = [ + new Method({ + callsArgs: null, + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: 'self', + returnsPrimitive: null + }) +]; +const METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF = [ + new Method({ + callsArgs: [0], + mutatesArgs: false, + mutatesSelfAsArray: true, + returns: 'self', + returnsPrimitive: null + }) +]; +const ARRAY_PROTOTYPE = new ObjectEntity({ + __proto__: null, + // We assume that accessors have effects as we do not track the accessed value afterwards + at: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN, + concat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + copyWithin: METHOD_MUTATES_SELF_RETURNS_SELF, + entries: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + every: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, + fill: METHOD_MUTATES_SELF_RETURNS_SELF, + filter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + find: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + findIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, + findLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + findLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, + flat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + flatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + forEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + includes: METHOD_RETURNS_BOOLEAN, + indexOf: METHOD_RETURNS_NUMBER, + join: METHOD_RETURNS_STRING, + keys: METHOD_RETURNS_UNKNOWN, + lastIndexOf: METHOD_RETURNS_NUMBER, + map: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + pop: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, + push: METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER, + reduce: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + reduceRight: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + reverse: METHOD_MUTATES_SELF_RETURNS_SELF, + shift: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, + slice: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + some: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, + sort: METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF, + splice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY, + toLocaleString: METHOD_RETURNS_STRING, + toString: METHOD_RETURNS_STRING, + unshift: METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER, + values: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN +}, OBJECT_PROTOTYPE, true); + +class ArrayExpression extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { + this.deoptimized = true; + let hasSpread = false; + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + if (element && (hasSpread || element instanceof SpreadElement)) { + hasSpread = true; + element.deoptimizePath(UNKNOWN_PATH); + } + } + this.scope.context.requestTreeshakingPass(); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + const properties = [ + { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } + ]; + let hasSpread = false; + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + if (hasSpread || element instanceof SpreadElement) { + if (element) { + hasSpread = true; + properties.unshift({ key: UnknownInteger, kind: 'init', property: element }); + } + } + else if (element) { + properties.push({ key: String(index), kind: 'init', property: element }); + } + else { + properties.push({ key: String(index), kind: 'init', property: UNDEFINED_EXPRESSION }); + } + } + return (this.objectEntity = new ObjectEntity(properties, ARRAY_PROTOTYPE)); + } +} + +class ArrayPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + for (const element of this.elements) { + element?.addExportedVariables(variables, exportNamesByVariable); + } + } + declare(kind) { + const variables = []; + for (const element of this.elements) { + if (element !== null) { + variables.push(...element.declare(kind, UNKNOWN_EXPRESSION)); + } + } + return variables; + } + // Patterns can only be deoptimized at the empty path at the moment + deoptimizePath() { + for (const element of this.elements) { + element?.deoptimizePath(EMPTY_PATH); + } + } + // Patterns are only checked at the emtpy path at the moment + hasEffectsOnInteractionAtPath(_path, interaction, context) { + for (const element of this.elements) { + if (element?.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) + return true; + } + return false; + } + markDeclarationReached() { + for (const element of this.elements) { + element?.markDeclarationReached(); + } + } +} + +const ArrowFunctionExpression$1 = 'ArrowFunctionExpression'; +const BlockStatement$1 = 'BlockStatement'; +const CallExpression$1 = 'CallExpression'; +const CatchClause$1 = 'CatchClause'; +const ExpressionStatement$1 = 'ExpressionStatement'; +const Identifier$1 = 'Identifier'; +const Program$1 = 'Program'; +const Property$1 = 'Property'; +const ReturnStatement$1 = 'ReturnStatement'; + +class LocalVariable extends Variable { + constructor(name, declarator, init, context, kind) { + super(name); + this.init = init; + this.calledFromTryStatement = false; + this.additionalInitializers = null; + this.expressionsToBeDeoptimized = []; + this.declarations = declarator ? [declarator] : []; + this.deoptimizationTracker = context.deoptimizationTracker; + this.module = context.module; + this.kind = kind; + } + addDeclaration(identifier, init) { + this.declarations.push(identifier); + this.markInitializersForDeoptimization().push(init); + } + consolidateInitializers() { + if (this.additionalInitializers) { + for (const initializer of this.additionalInitializers) { + initializer.deoptimizePath(UNKNOWN_PATH); + } + this.additionalInitializers = null; + } + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (this.isReassigned) { + deoptimizeInteraction(interaction); + return; + } + recursionTracker.withTrackedEntityAtPath(path, this.init, () => this.init.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker), undefined); + } + deoptimizePath(path) { + if (this.isReassigned || + this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)) { + return; + } + if (path.length === 0) { + this.isReassigned = true; + const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; + this.expressionsToBeDeoptimized = EMPTY_ARRAY; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + this.init.deoptimizePath(UNKNOWN_PATH); + } + else { + this.init.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.isReassigned) { + return UnknownValue; + } + return recursionTracker.withTrackedEntityAtPath(path, this.init, () => { + this.expressionsToBeDeoptimized.push(origin); + return this.init.getLiteralValueAtPath(path, recursionTracker, origin); + }, UnknownValue); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (this.isReassigned) { + return UNKNOWN_RETURN_EXPRESSION; + } + return recursionTracker.withTrackedEntityAtPath(path, this.init, () => { + this.expressionsToBeDeoptimized.push(origin); + return this.init.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + }, UNKNOWN_RETURN_EXPRESSION); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + if (this.isReassigned) + return true; + return (!context.accessed.trackEntityAtPathAndGetIfTracked(path, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + case INTERACTION_ASSIGNED: { + if (this.included) + return true; + if (path.length === 0) + return false; + if (this.isReassigned) + return true; + return (!context.assigned.trackEntityAtPathAndGetIfTracked(path, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + case INTERACTION_CALLED: { + if (this.isReassigned) + return true; + return (!(interaction.withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + } + } + include() { + if (!this.included) { + super.include(); + for (const declaration of this.declarations) { + // If node is a default export, it can save a tree-shaking run to include the full declaration now + if (!declaration.included) + declaration.include(createInclusionContext(), false); + let node = declaration.parent; + while (!node.included) { + // We do not want to properly include parents in case they are part of a dead branch + // in which case .include() might pull in more dead code + node.included = true; + if (node.type === Program$1) + break; + node = node.parent; + } + } + } + } + includeCallArguments(context, parameters) { + if (this.isReassigned || context.includedCallArguments.has(this.init)) { + for (const argument of parameters) { + argument.include(context, false); + } + } + else { + context.includedCallArguments.add(this.init); + this.init.includeCallArguments(context, parameters); + context.includedCallArguments.delete(this.init); + } + } + markCalledFromTryStatement() { + this.calledFromTryStatement = true; + } + markInitializersForDeoptimization() { + if (this.additionalInitializers === null) { + this.additionalInitializers = [this.init]; + this.init = UNKNOWN_EXPRESSION; + this.isReassigned = true; + } + return this.additionalInitializers; + } +} + +const MAX_TRACKED_INTERACTIONS = 20; +const NO_INTERACTIONS = EMPTY_ARRAY; +const UNKNOWN_DEOPTIMIZED_FIELD = new Set([UnknownKey]); +const EMPTY_PATH_TRACKER = new PathTracker(); +const UNKNOWN_DEOPTIMIZED_ENTITY = new Set([UNKNOWN_EXPRESSION]); +class ParameterVariable extends LocalVariable { + constructor(name, declarator, context) { + super(name, declarator, UNKNOWN_EXPRESSION, context, "parameter" /* VariableKind.parameter */); + this.deoptimizationInteractions = []; + this.deoptimizations = new PathTracker(); + this.deoptimizedFields = new Set(); + this.entitiesToBeDeoptimized = new Set(); + } + addEntityToBeDeoptimized(entity) { + if (entity === UNKNOWN_EXPRESSION) { + // As unknown expressions fully deoptimize all interactions, we can clear + // the interaction cache at this point provided we keep this optimization + // in mind when adding new interactions + if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { + this.entitiesToBeDeoptimized.add(UNKNOWN_EXPRESSION); + for (const { interaction } of this.deoptimizationInteractions) { + deoptimizeInteraction(interaction); + } + this.deoptimizationInteractions = NO_INTERACTIONS; + } + } + else if (this.deoptimizedFields.has(UnknownKey)) { + // This means that we already deoptimized all interactions and no longer + // track them + entity.deoptimizePath(UNKNOWN_PATH); + } + else if (!this.entitiesToBeDeoptimized.has(entity)) { + this.entitiesToBeDeoptimized.add(entity); + for (const field of this.deoptimizedFields) { + entity.deoptimizePath([field]); + } + for (const { interaction, path } of this.deoptimizationInteractions) { + entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + } + } + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path) { + // For performance reasons, we fully deoptimize all deeper interactions + if (path.length >= 2 || + this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION) || + this.deoptimizationInteractions.length >= MAX_TRACKED_INTERACTIONS || + (path.length === 1 && + (this.deoptimizedFields.has(UnknownKey) || + (interaction.type === INTERACTION_CALLED && this.deoptimizedFields.has(path[0]))))) { + deoptimizeInteraction(interaction); + return; + } + if (!this.deoptimizations.trackEntityAtPathAndGetIfTracked(path, interaction.args)) { + for (const entity of this.entitiesToBeDeoptimized) { + entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + } + if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { + this.deoptimizationInteractions.push({ + interaction, + path + }); + } + } + } + deoptimizePath(path) { + if (path.length === 0 || this.deoptimizedFields.has(UnknownKey)) { + return; + } + const key = path[0]; + if (this.deoptimizedFields.has(key)) { + return; + } + this.deoptimizedFields.add(key); + for (const entity of this.entitiesToBeDeoptimized) { + // We do not need a recursion tracker here as we already track whether + // this field is deoptimized + entity.deoptimizePath([key]); + } + if (key === UnknownKey) { + // save some memory + this.deoptimizationInteractions = NO_INTERACTIONS; + this.deoptimizations = EMPTY_PATH_TRACKER; + this.deoptimizedFields = UNKNOWN_DEOPTIMIZED_FIELD; + this.entitiesToBeDeoptimized = UNKNOWN_DEOPTIMIZED_ENTITY; + } + } + getReturnExpressionWhenCalledAtPath(path) { + // We deoptimize everything that is called as that will trivially deoptimize + // the corresponding return expressions as well and avoid badly performing + // and complicated alternatives + if (path.length === 0) { + this.deoptimizePath(UNKNOWN_PATH); + } + else if (!this.deoptimizedFields.has(path[0])) { + this.deoptimizePath([path[0]]); + } + return UNKNOWN_RETURN_EXPRESSION; + } +} + +const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$'; +const base = 64; +function toBase64(value) { + let outString = ''; + do { + const currentDigit = value % base; + value = (value / base) | 0; + outString = chars[currentDigit] + outString; + } while (value !== 0); + return outString; +} + +function getSafeName(baseName, usedNames, forbiddenNames) { + let safeName = baseName; + let count = 1; + while (usedNames.has(safeName) || RESERVED_NAMES.has(safeName) || forbiddenNames?.has(safeName)) { + safeName = `${baseName}$${toBase64(count++)}`; + } + usedNames.add(safeName); + return safeName; +} + +class Scope { + constructor() { + this.children = []; + this.variables = new Map(); + } + /* + Redeclaration rules: + - var can redeclare var + - in function scopes, function and var can redeclare function and var + - var is hoisted across scopes, function remains in the scope it is declared + - var and function can redeclare function parameters, but parameters cannot redeclare parameters + - function cannot redeclare catch scope parameters + - var can redeclare catch scope parameters in a way + - if the parameter is an identifier and not a pattern + - then the variable is still declared in the hoisted outer scope, but the initializer is assigned to the parameter + - const, let, class, and function except in the cases above cannot redeclare anything + */ + addDeclaration(identifier, context, init, kind) { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + const existingKind = existingVariable.kind; + if (kind === "var" /* VariableKind.var */ && existingKind === "var" /* VariableKind.var */) { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + context.error(logRedeclarationError(name), identifier.start); + } + const newVariable = new LocalVariable(identifier.name, identifier, init, context, kind); + this.variables.set(name, newVariable); + return newVariable; + } + addHoistedVariable(name, variable) { + (this.hoistedVariables ||= new Map()).set(name, variable); + } + contains(name) { + return this.variables.has(name); + } + findVariable(_name) { + /* istanbul ignore next */ + throw new Error('Internal Error: findVariable needs to be implemented by a subclass'); + } +} + +class ChildScope extends Scope { + constructor(parent, context) { + super(); + this.parent = parent; + this.context = context; + this.accessedOutsideVariables = new Map(); + parent.children.push(this); + } + addAccessedDynamicImport(importExpression) { + (this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(importExpression); + if (this.parent instanceof ChildScope) { + this.parent.addAccessedDynamicImport(importExpression); + } + } + addAccessedGlobals(globals, accessedGlobalsByScope) { + const accessedGlobals = accessedGlobalsByScope.get(this) || new Set(); + for (const name of globals) { + accessedGlobals.add(name); + } + accessedGlobalsByScope.set(this, accessedGlobals); + if (this.parent instanceof ChildScope) { + this.parent.addAccessedGlobals(globals, accessedGlobalsByScope); + } + } + addNamespaceMemberAccess(name, variable) { + this.accessedOutsideVariables.set(name, variable); + this.parent.addNamespaceMemberAccess(name, variable); + } + addReturnExpression(expression) { + this.parent instanceof ChildScope && this.parent.addReturnExpression(expression); + } + addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) { + for (const variable of this.accessedOutsideVariables.values()) { + if (variable.included) { + usedNames.add(variable.getBaseVariableName()); + if (format === 'system' && exportNamesByVariable.has(variable)) { + usedNames.add('exports'); + } + } + } + const accessedGlobals = accessedGlobalsByScope.get(this); + if (accessedGlobals) { + for (const name of accessedGlobals) { + usedNames.add(name); + } + } + } + contains(name) { + return this.variables.has(name) || this.parent.contains(name); + } + deconflict(format, exportNamesByVariable, accessedGlobalsByScope) { + const usedNames = new Set(); + this.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope); + if (this.accessedDynamicImports) { + for (const importExpression of this.accessedDynamicImports) { + if (importExpression.inlineNamespace) { + usedNames.add(importExpression.inlineNamespace.getBaseVariableName()); + } + } + } + for (const [name, variable] of this.variables) { + if (variable.included || variable.alwaysRendered) { + variable.setRenderNames(null, getSafeName(name, usedNames, variable.forbiddenNames)); + } + } + for (const scope of this.children) { + scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } + } + findLexicalBoundary() { + return this.parent.findLexicalBoundary(); + } + findVariable(name) { + const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); + if (knownVariable) { + return knownVariable; + } + const variable = this.parent.findVariable(name); + this.accessedOutsideVariables.set(name, variable); + return variable; + } +} + +class CatchBodyScope extends ChildScope { + constructor(parent) { + super(parent, parent.context); + this.parent = parent; + } + addDeclaration(identifier, context, init, kind) { + if (kind === "var" /* VariableKind.var */) { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + const existingKind = existingVariable.kind; + if (existingKind === "parameter" /* VariableKind.parameter */ && + // If this is a destructured parameter, it is forbidden to redeclare + existingVariable.declarations[0].parent.type === CatchClause$1) { + // If this is a var with the same name as the catch scope parameter, + // the assignment actually goes to the parameter and the var is + // hoisted without assignment. Locally, it is shadowed by the + // parameter + const declaredVariable = this.parent.parent.addDeclaration(identifier, context, UNDEFINED_EXPRESSION, kind); + // To avoid the need to rewrite the declaration, we link the variable + // names. If we ever implement a logic that splits initialization and + // assignment for hoisted vars, the "renderLikeHoisted" logic can be + // removed again. + // We do not need to check whether there already is a linked + // variable because then declaredVariable would be that linked + // variable. + existingVariable.renderLikeHoisted(declaredVariable); + this.addHoistedVariable(name, declaredVariable); + return declaredVariable; + } + if (existingKind === "var" /* VariableKind.var */) { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + return context.error(logRedeclarationError(name), identifier.start); + } + // We only add parameters to parameter scopes + const declaredVariable = this.parent.parent.addDeclaration(identifier, context, init, kind); + // Necessary to make sure the init is deoptimized for conditional declarations. + // We cannot call deoptimizePath here. + declaredVariable.markInitializersForDeoptimization(); + // We add the variable to this and all parent scopes to reliably detect conflicts + this.addHoistedVariable(name, declaredVariable); + return declaredVariable; + } + return super.addDeclaration(identifier, context, init, kind); + } +} + +class FunctionBodyScope extends ChildScope { + constructor(parent) { + super(parent, parent.context); + } + // There is stuff that is only allowed in function scopes, i.e. functions can + // be redeclared, functions and var can redeclare each other + addDeclaration(identifier, context, init, kind) { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + const existingKind = existingVariable.kind; + if ((kind === "var" /* VariableKind.var */ || kind === "function" /* VariableKind.function */) && + (existingKind === "var" /* VariableKind.var */ || + existingKind === "function" /* VariableKind.function */ || + existingKind === "parameter" /* VariableKind.parameter */)) { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + context.error(logRedeclarationError(name), identifier.start); + } + const newVariable = new LocalVariable(identifier.name, identifier, init, context, kind); + this.variables.set(name, newVariable); + return newVariable; + } +} + +class ParameterScope extends ChildScope { + constructor(parent, isCatchScope) { + super(parent, parent.context); + this.parameters = []; + this.hasRest = false; + this.bodyScope = isCatchScope ? new CatchBodyScope(this) : new FunctionBodyScope(this); + } + /** + * Adds a parameter to this scope. Parameters must be added in the correct + * order, i.e. from left to right. + */ + addParameterDeclaration(identifier) { + const { name, start } = identifier; + const existingParameter = this.variables.get(name); + if (existingParameter) { + return this.context.error(logDuplicateArgumentNameError(name), start); + } + const variable = new ParameterVariable(name, identifier, this.context); + this.variables.set(name, variable); + // We also add it to the body scope to detect name conflicts with local + // variables. We still need the intermediate scope, though, as parameter + // defaults are NOT taken from the body scope but from the parameters or + // outside scope. + this.bodyScope.addHoistedVariable(name, variable); + return variable; + } + addParameterVariables(parameters, hasRest) { + this.parameters = parameters; + for (const parameterList of parameters) { + for (const parameter of parameterList) { + parameter.alwaysRendered = true; + } + } + this.hasRest = hasRest; + } + includeCallArguments(context, parameters) { + let calledFromTryStatement = false; + let argumentIncluded = false; + const restParameter = this.hasRest && this.parameters[this.parameters.length - 1]; + for (const checkedArgument of parameters) { + if (checkedArgument instanceof SpreadElement) { + for (const argument of parameters) { + argument.include(context, false); + } + break; + } + } + for (let index = parameters.length - 1; index >= 0; index--) { + const parameterVariables = this.parameters[index] || restParameter; + const argument = parameters[index]; + if (parameterVariables) { + calledFromTryStatement = false; + if (parameterVariables.length === 0) { + // handle empty destructuring + argumentIncluded = true; + } + else { + for (const variable of parameterVariables) { + if (variable.included) { + argumentIncluded = true; + } + if (variable.calledFromTryStatement) { + calledFromTryStatement = true; + } + } + } + } + if (!argumentIncluded && argument.shouldBeIncluded(context)) { + argumentIncluded = true; + } + if (argumentIncluded) { + argument.include(context, calledFromTryStatement); + } + } + } +} + +class ReturnValueScope extends ParameterScope { + constructor() { + super(...arguments); + this.returnExpression = null; + this.returnExpressions = []; + } + addReturnExpression(expression) { + this.returnExpressions.push(expression); + } + getReturnExpression() { + if (this.returnExpression === null) + this.updateReturnExpression(); + return this.returnExpression; + } + updateReturnExpression() { + if (this.returnExpressions.length === 1) { + this.returnExpression = this.returnExpressions[0]; + } + else { + this.returnExpression = UNKNOWN_EXPRESSION; + for (const expression of this.returnExpressions) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + } +} + +/** @typedef { import('estree').Node} Node */ +/** @typedef {Node | { + * type: 'PropertyDefinition'; + * computed: boolean; + * value: Node + * }} NodeWithPropertyDefinition */ + +/** + * + * @param {NodeWithPropertyDefinition} node + * @param {NodeWithPropertyDefinition} parent + * @returns {boolean} + */ +function is_reference (node, parent) { + if (node.type === 'MemberExpression') { + return !node.computed && is_reference(node.object, node); + } + + if (node.type === 'Identifier') { + if (!parent) return true; + + switch (parent.type) { + // disregard `bar` in `foo.bar` + case 'MemberExpression': return parent.computed || node === parent.object; + + // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}` + case 'MethodDefinition': return parent.computed; + + // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}` + case 'PropertyDefinition': return parent.computed || node === parent.value; + + // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }` + case 'Property': return parent.computed || node === parent.value; + + // disregard the `bar` in `export { foo as bar }` or + // the foo in `import { foo as bar }` + case 'ExportSpecifier': + case 'ImportSpecifier': return node === parent.local; + + // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}` + case 'LabeledStatement': + case 'BreakStatement': + case 'ContinueStatement': return false; + default: return true; + } + } + + return false; +} + +const PureFunctionKey = Symbol('PureFunction'); +const getPureFunctions = ({ treeshake }) => { + const pureFunctions = Object.create(null); + for (const functionName of treeshake ? treeshake.manualPureFunctions : []) { + let currentFunctions = pureFunctions; + for (const pathSegment of functionName.split('.')) { + currentFunctions = currentFunctions[pathSegment] ||= Object.create(null); + } + currentFunctions[PureFunctionKey] = true; + } + return pureFunctions; +}; + +const doNothing = () => { }; + +/* eslint sort-keys: "off" */ +const ValueProperties = Symbol('Value Properties'); +const getTruthyLiteralValue = () => UnknownTruthyValue; +const returnFalse = () => false; +const returnTrue = () => true; +const PURE = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnFalse +}; +const IMPURE = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnTrue +}; +const PURE_WITH_ARRAY = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled({ args }) { + return args.length > 1 && !(args[1] instanceof ArrayExpression); + } +}; +const GETTER_ACCESS = { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled({ args }, context) { + const [_thisArgument, firstArgument] = args; + return (!(firstArgument instanceof ExpressionEntity) || + firstArgument.hasEffectsOnInteractionAtPath(UNKNOWN_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)); + } +}; +// We use shortened variables to reduce file size here +/* OBJECT */ +const O = { + __proto__: null, + [ValueProperties]: IMPURE +}; +/* PURE FUNCTION */ +const PF = { + __proto__: null, + [ValueProperties]: PURE +}; +/* PURE FUNCTION IF FIRST ARG DOES NOT CONTAIN A GETTER */ +const PF_NO_GETTER = { + __proto__: null, + [ValueProperties]: GETTER_ACCESS +}; +/* FUNCTION THAT MUTATES FIRST ARG WITHOUT TRIGGERING ACCESSORS */ +const MUTATES_ARG_WITHOUT_ACCESSOR = { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall({ args: [, firstArgument] }) { + firstArgument?.deoptimizePath(UNKNOWN_PATH); + }, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled({ args }, context) { + return (args.length <= 1 || + args[1].hasEffectsOnInteractionAtPath(UNKNOWN_NON_ACCESSOR_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context)); + } + } +}; +/* CONSTRUCTOR */ +const C = { + __proto__: null, + [ValueProperties]: IMPURE, + prototype: O +}; +/* PURE CONSTRUCTOR */ +const PC = { + __proto__: null, + [ValueProperties]: PURE, + prototype: O +}; +const PC_WITH_ARRAY = { + __proto__: null, + [ValueProperties]: PURE_WITH_ARRAY, + prototype: O +}; +const ARRAY_TYPE = { + __proto__: null, + [ValueProperties]: PURE, + from: O, + of: PF, + prototype: O +}; +const INTL_MEMBER = { + __proto__: null, + [ValueProperties]: PURE, + supportedLocalesOf: PC +}; +const knownGlobals = { + // Placeholders for global objects to avoid shape mutations + global: O, + globalThis: O, + self: O, + window: O, + // Common globals + __proto__: null, + [ValueProperties]: IMPURE, + Array: { + __proto__: null, + [ValueProperties]: IMPURE, + from: O, + isArray: PF, + of: PF, + prototype: O + }, + ArrayBuffer: { + __proto__: null, + [ValueProperties]: PURE, + isView: PF, + prototype: O + }, + Atomics: O, + BigInt: C, + BigInt64Array: C, + BigUint64Array: C, + Boolean: PC, + constructor: C, + DataView: PC, + Date: { + __proto__: null, + [ValueProperties]: PURE, + now: PF, + parse: PF, + prototype: O, + UTC: PF + }, + decodeURI: PF, + decodeURIComponent: PF, + encodeURI: PF, + encodeURIComponent: PF, + Error: PC, + escape: PF, + eval: O, + EvalError: PC, + Float32Array: ARRAY_TYPE, + Float64Array: ARRAY_TYPE, + Function: C, + hasOwnProperty: O, + Infinity: O, + Int16Array: ARRAY_TYPE, + Int32Array: ARRAY_TYPE, + Int8Array: ARRAY_TYPE, + isFinite: PF, + isNaN: PF, + isPrototypeOf: O, + JSON: O, + Map: PC_WITH_ARRAY, + Math: { + __proto__: null, + [ValueProperties]: IMPURE, + abs: PF, + acos: PF, + acosh: PF, + asin: PF, + asinh: PF, + atan: PF, + atan2: PF, + atanh: PF, + cbrt: PF, + ceil: PF, + clz32: PF, + cos: PF, + cosh: PF, + exp: PF, + expm1: PF, + floor: PF, + fround: PF, + hypot: PF, + imul: PF, + log: PF, + log10: PF, + log1p: PF, + log2: PF, + max: PF, + min: PF, + pow: PF, + random: PF, + round: PF, + sign: PF, + sin: PF, + sinh: PF, + sqrt: PF, + tan: PF, + tanh: PF, + trunc: PF + }, + NaN: O, + Number: { + __proto__: null, + [ValueProperties]: PURE, + isFinite: PF, + isInteger: PF, + isNaN: PF, + isSafeInteger: PF, + parseFloat: PF, + parseInt: PF, + prototype: O + }, + Object: { + __proto__: null, + [ValueProperties]: PURE, + create: PF, + // Technically those can throw in certain situations, but we ignore this as + // code that relies on this will hopefully wrap this in a try-catch, which + // deoptimizes everything anyway + defineProperty: MUTATES_ARG_WITHOUT_ACCESSOR, + defineProperties: MUTATES_ARG_WITHOUT_ACCESSOR, + freeze: MUTATES_ARG_WITHOUT_ACCESSOR, + getOwnPropertyDescriptor: PF, + getOwnPropertyDescriptors: PF, + getOwnPropertyNames: PF, + getOwnPropertySymbols: PF, + getPrototypeOf: PF, + hasOwn: PF, + is: PF, + isExtensible: PF, + isFrozen: PF, + isSealed: PF, + keys: PF, + fromEntries: O, + entries: PF_NO_GETTER, + values: PF_NO_GETTER, + prototype: O + }, + parseFloat: PF, + parseInt: PF, + Promise: { + __proto__: null, + [ValueProperties]: IMPURE, + all: O, + allSettled: O, + any: O, + prototype: O, + race: O, + reject: O, + resolve: O + }, + propertyIsEnumerable: O, + Proxy: O, + RangeError: PC, + ReferenceError: PC, + Reflect: O, + RegExp: PC, + Set: PC_WITH_ARRAY, + SharedArrayBuffer: C, + String: { + __proto__: null, + [ValueProperties]: PURE, + fromCharCode: PF, + fromCodePoint: PF, + prototype: O, + raw: PF + }, + Symbol: { + __proto__: null, + [ValueProperties]: PURE, + for: PF, + keyFor: PF, + prototype: O, + toStringTag: { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall: doNothing, + getLiteralValue() { + return SymbolToStringTag; + }, + hasEffectsWhenCalled: returnTrue + } + } + }, + SyntaxError: PC, + toLocaleString: O, + toString: O, + TypeError: PC, + Uint16Array: ARRAY_TYPE, + Uint32Array: ARRAY_TYPE, + Uint8Array: ARRAY_TYPE, + Uint8ClampedArray: ARRAY_TYPE, + // Technically, this is a global, but it needs special handling + // undefined: ?, + unescape: PF, + URIError: PC, + valueOf: O, + WeakMap: PC_WITH_ARRAY, + WeakSet: PC_WITH_ARRAY, + // Additional globals shared by Node and Browser that are not strictly part of the language + clearInterval: C, + clearTimeout: C, + console: { + __proto__: null, + [ValueProperties]: IMPURE, + assert: C, + clear: C, + count: C, + countReset: C, + debug: C, + dir: C, + dirxml: C, + error: C, + exception: C, + group: C, + groupCollapsed: C, + groupEnd: C, + info: C, + log: C, + table: C, + time: C, + timeEnd: C, + timeLog: C, + trace: C, + warn: C + }, + Intl: { + __proto__: null, + [ValueProperties]: IMPURE, + Collator: INTL_MEMBER, + DateTimeFormat: INTL_MEMBER, + DisplayNames: INTL_MEMBER, + ListFormat: INTL_MEMBER, + Locale: INTL_MEMBER, + NumberFormat: INTL_MEMBER, + PluralRules: INTL_MEMBER, + RelativeTimeFormat: INTL_MEMBER, + Segmenter: INTL_MEMBER + }, + setInterval: C, + setTimeout: C, + TextDecoder: C, + TextEncoder: C, + URL: { + __proto__: null, + [ValueProperties]: IMPURE, + prototype: O, + canParse: PF + }, + URLSearchParams: C, + // Browser specific globals + AbortController: C, + AbortSignal: C, + addEventListener: O, + alert: O, + AnalyserNode: C, + Animation: C, + AnimationEvent: C, + applicationCache: O, + ApplicationCache: C, + ApplicationCacheErrorEvent: C, + atob: O, + Attr: C, + Audio: C, + AudioBuffer: C, + AudioBufferSourceNode: C, + AudioContext: C, + AudioDestinationNode: C, + AudioListener: C, + AudioNode: C, + AudioParam: C, + AudioProcessingEvent: C, + AudioScheduledSourceNode: C, + AudioWorkletNode: C, + BarProp: C, + BaseAudioContext: C, + BatteryManager: C, + BeforeUnloadEvent: C, + BiquadFilterNode: C, + Blob: C, + BlobEvent: C, + blur: O, + BroadcastChannel: C, + btoa: O, + ByteLengthQueuingStrategy: C, + Cache: C, + caches: O, + CacheStorage: C, + cancelAnimationFrame: O, + cancelIdleCallback: O, + CanvasCaptureMediaStreamTrack: C, + CanvasGradient: C, + CanvasPattern: C, + CanvasRenderingContext2D: C, + ChannelMergerNode: C, + ChannelSplitterNode: C, + CharacterData: C, + clientInformation: O, + ClipboardEvent: C, + close: O, + closed: O, + CloseEvent: C, + Comment: C, + CompositionEvent: C, + confirm: O, + ConstantSourceNode: C, + ConvolverNode: C, + CountQueuingStrategy: C, + createImageBitmap: O, + Credential: C, + CredentialsContainer: C, + crypto: O, + Crypto: C, + CryptoKey: C, + CSS: C, + CSSConditionRule: C, + CSSFontFaceRule: C, + CSSGroupingRule: C, + CSSImportRule: C, + CSSKeyframeRule: C, + CSSKeyframesRule: C, + CSSMediaRule: C, + CSSNamespaceRule: C, + CSSPageRule: C, + CSSRule: C, + CSSRuleList: C, + CSSStyleDeclaration: C, + CSSStyleRule: C, + CSSStyleSheet: C, + CSSSupportsRule: C, + CustomElementRegistry: C, + customElements: O, + CustomEvent: { + __proto__: null, + [ValueProperties]: { + deoptimizeArgumentsOnCall({ args }) { + args[2]?.deoptimizePath(['detail']); + }, + getLiteralValue: getTruthyLiteralValue, + hasEffectsWhenCalled: returnFalse + }, + prototype: O + }, + DataTransfer: C, + DataTransferItem: C, + DataTransferItemList: C, + defaultstatus: O, + defaultStatus: O, + DelayNode: C, + DeviceMotionEvent: C, + DeviceOrientationEvent: C, + devicePixelRatio: O, + dispatchEvent: O, + document: O, + Document: C, + DocumentFragment: C, + DocumentType: C, + DOMError: C, + DOMException: C, + DOMImplementation: C, + DOMMatrix: C, + DOMMatrixReadOnly: C, + DOMParser: C, + DOMPoint: C, + DOMPointReadOnly: C, + DOMQuad: C, + DOMRect: C, + DOMRectReadOnly: C, + DOMStringList: C, + DOMStringMap: C, + DOMTokenList: C, + DragEvent: C, + DynamicsCompressorNode: C, + Element: C, + ErrorEvent: C, + Event: C, + EventSource: C, + EventTarget: C, + external: O, + fetch: O, + File: C, + FileList: C, + FileReader: C, + find: O, + focus: O, + FocusEvent: C, + FontFace: C, + FontFaceSetLoadEvent: C, + FormData: C, + frames: O, + GainNode: C, + Gamepad: C, + GamepadButton: C, + GamepadEvent: C, + getComputedStyle: O, + getSelection: O, + HashChangeEvent: C, + Headers: C, + history: O, + History: C, + HTMLAllCollection: C, + HTMLAnchorElement: C, + HTMLAreaElement: C, + HTMLAudioElement: C, + HTMLBaseElement: C, + HTMLBodyElement: C, + HTMLBRElement: C, + HTMLButtonElement: C, + HTMLCanvasElement: C, + HTMLCollection: C, + HTMLContentElement: C, + HTMLDataElement: C, + HTMLDataListElement: C, + HTMLDetailsElement: C, + HTMLDialogElement: C, + HTMLDirectoryElement: C, + HTMLDivElement: C, + HTMLDListElement: C, + HTMLDocument: C, + HTMLElement: C, + HTMLEmbedElement: C, + HTMLFieldSetElement: C, + HTMLFontElement: C, + HTMLFormControlsCollection: C, + HTMLFormElement: C, + HTMLFrameElement: C, + HTMLFrameSetElement: C, + HTMLHeadElement: C, + HTMLHeadingElement: C, + HTMLHRElement: C, + HTMLHtmlElement: C, + HTMLIFrameElement: C, + HTMLImageElement: C, + HTMLInputElement: C, + HTMLLabelElement: C, + HTMLLegendElement: C, + HTMLLIElement: C, + HTMLLinkElement: C, + HTMLMapElement: C, + HTMLMarqueeElement: C, + HTMLMediaElement: C, + HTMLMenuElement: C, + HTMLMetaElement: C, + HTMLMeterElement: C, + HTMLModElement: C, + HTMLObjectElement: C, + HTMLOListElement: C, + HTMLOptGroupElement: C, + HTMLOptionElement: C, + HTMLOptionsCollection: C, + HTMLOutputElement: C, + HTMLParagraphElement: C, + HTMLParamElement: C, + HTMLPictureElement: C, + HTMLPreElement: C, + HTMLProgressElement: C, + HTMLQuoteElement: C, + HTMLScriptElement: C, + HTMLSelectElement: C, + HTMLShadowElement: C, + HTMLSlotElement: C, + HTMLSourceElement: C, + HTMLSpanElement: C, + HTMLStyleElement: C, + HTMLTableCaptionElement: C, + HTMLTableCellElement: C, + HTMLTableColElement: C, + HTMLTableElement: C, + HTMLTableRowElement: C, + HTMLTableSectionElement: C, + HTMLTemplateElement: C, + HTMLTextAreaElement: C, + HTMLTimeElement: C, + HTMLTitleElement: C, + HTMLTrackElement: C, + HTMLUListElement: C, + HTMLUnknownElement: C, + HTMLVideoElement: C, + IDBCursor: C, + IDBCursorWithValue: C, + IDBDatabase: C, + IDBFactory: C, + IDBIndex: C, + IDBKeyRange: C, + IDBObjectStore: C, + IDBOpenDBRequest: C, + IDBRequest: C, + IDBTransaction: C, + IDBVersionChangeEvent: C, + IdleDeadline: C, + IIRFilterNode: C, + Image: C, + ImageBitmap: C, + ImageBitmapRenderingContext: C, + ImageCapture: C, + ImageData: C, + indexedDB: O, + innerHeight: O, + innerWidth: O, + InputEvent: C, + IntersectionObserver: C, + IntersectionObserverEntry: C, + isSecureContext: O, + KeyboardEvent: C, + KeyframeEffect: C, + length: O, + localStorage: O, + location: O, + Location: C, + locationbar: O, + matchMedia: O, + MediaDeviceInfo: C, + MediaDevices: C, + MediaElementAudioSourceNode: C, + MediaEncryptedEvent: C, + MediaError: C, + MediaKeyMessageEvent: C, + MediaKeySession: C, + MediaKeyStatusMap: C, + MediaKeySystemAccess: C, + MediaList: C, + MediaQueryList: C, + MediaQueryListEvent: C, + MediaRecorder: C, + MediaSettingsRange: C, + MediaSource: C, + MediaStream: C, + MediaStreamAudioDestinationNode: C, + MediaStreamAudioSourceNode: C, + MediaStreamEvent: C, + MediaStreamTrack: C, + MediaStreamTrackEvent: C, + menubar: O, + MessageChannel: C, + MessageEvent: C, + MessagePort: C, + MIDIAccess: C, + MIDIConnectionEvent: C, + MIDIInput: C, + MIDIInputMap: C, + MIDIMessageEvent: C, + MIDIOutput: C, + MIDIOutputMap: C, + MIDIPort: C, + MimeType: C, + MimeTypeArray: C, + MouseEvent: C, + moveBy: O, + moveTo: O, + MutationEvent: C, + MutationObserver: C, + MutationRecord: C, + name: O, + NamedNodeMap: C, + NavigationPreloadManager: C, + navigator: O, + Navigator: C, + NetworkInformation: C, + Node: C, + NodeFilter: O, + NodeIterator: C, + NodeList: C, + Notification: C, + OfflineAudioCompletionEvent: C, + OfflineAudioContext: C, + offscreenBuffering: O, + OffscreenCanvas: C, + open: O, + openDatabase: O, + Option: C, + origin: O, + OscillatorNode: C, + outerHeight: O, + outerWidth: O, + PageTransitionEvent: C, + pageXOffset: O, + pageYOffset: O, + PannerNode: C, + parent: O, + Path2D: C, + PaymentAddress: C, + PaymentRequest: C, + PaymentRequestUpdateEvent: C, + PaymentResponse: C, + performance: O, + Performance: C, + PerformanceEntry: C, + PerformanceLongTaskTiming: C, + PerformanceMark: C, + PerformanceMeasure: C, + PerformanceNavigation: C, + PerformanceNavigationTiming: C, + PerformanceObserver: C, + PerformanceObserverEntryList: C, + PerformancePaintTiming: C, + PerformanceResourceTiming: C, + PerformanceTiming: C, + PeriodicWave: C, + Permissions: C, + PermissionStatus: C, + personalbar: O, + PhotoCapabilities: C, + Plugin: C, + PluginArray: C, + PointerEvent: C, + PopStateEvent: C, + postMessage: O, + Presentation: C, + PresentationAvailability: C, + PresentationConnection: C, + PresentationConnectionAvailableEvent: C, + PresentationConnectionCloseEvent: C, + PresentationConnectionList: C, + PresentationReceiver: C, + PresentationRequest: C, + print: O, + ProcessingInstruction: C, + ProgressEvent: C, + PromiseRejectionEvent: C, + prompt: O, + PushManager: C, + PushSubscription: C, + PushSubscriptionOptions: C, + queueMicrotask: O, + RadioNodeList: C, + Range: C, + ReadableStream: C, + RemotePlayback: C, + removeEventListener: O, + Request: C, + requestAnimationFrame: O, + requestIdleCallback: O, + resizeBy: O, + ResizeObserver: C, + ResizeObserverEntry: C, + resizeTo: O, + Response: C, + RTCCertificate: C, + RTCDataChannel: C, + RTCDataChannelEvent: C, + RTCDtlsTransport: C, + RTCIceCandidate: C, + RTCIceTransport: C, + RTCPeerConnection: C, + RTCPeerConnectionIceEvent: C, + RTCRtpReceiver: C, + RTCRtpSender: C, + RTCSctpTransport: C, + RTCSessionDescription: C, + RTCStatsReport: C, + RTCTrackEvent: C, + screen: O, + Screen: C, + screenLeft: O, + ScreenOrientation: C, + screenTop: O, + screenX: O, + screenY: O, + ScriptProcessorNode: C, + scroll: O, + scrollbars: O, + scrollBy: O, + scrollTo: O, + scrollX: O, + scrollY: O, + SecurityPolicyViolationEvent: C, + Selection: C, + ServiceWorker: C, + ServiceWorkerContainer: C, + ServiceWorkerRegistration: C, + sessionStorage: O, + ShadowRoot: C, + SharedWorker: C, + SourceBuffer: C, + SourceBufferList: C, + speechSynthesis: O, + SpeechSynthesisEvent: C, + SpeechSynthesisUtterance: C, + StaticRange: C, + status: O, + statusbar: O, + StereoPannerNode: C, + stop: O, + Storage: C, + StorageEvent: C, + StorageManager: C, + styleMedia: O, + StyleSheet: C, + StyleSheetList: C, + SubtleCrypto: C, + SVGAElement: C, + SVGAngle: C, + SVGAnimatedAngle: C, + SVGAnimatedBoolean: C, + SVGAnimatedEnumeration: C, + SVGAnimatedInteger: C, + SVGAnimatedLength: C, + SVGAnimatedLengthList: C, + SVGAnimatedNumber: C, + SVGAnimatedNumberList: C, + SVGAnimatedPreserveAspectRatio: C, + SVGAnimatedRect: C, + SVGAnimatedString: C, + SVGAnimatedTransformList: C, + SVGAnimateElement: C, + SVGAnimateMotionElement: C, + SVGAnimateTransformElement: C, + SVGAnimationElement: C, + SVGCircleElement: C, + SVGClipPathElement: C, + SVGComponentTransferFunctionElement: C, + SVGDefsElement: C, + SVGDescElement: C, + SVGDiscardElement: C, + SVGElement: C, + SVGEllipseElement: C, + SVGFEBlendElement: C, + SVGFEColorMatrixElement: C, + SVGFEComponentTransferElement: C, + SVGFECompositeElement: C, + SVGFEConvolveMatrixElement: C, + SVGFEDiffuseLightingElement: C, + SVGFEDisplacementMapElement: C, + SVGFEDistantLightElement: C, + SVGFEDropShadowElement: C, + SVGFEFloodElement: C, + SVGFEFuncAElement: C, + SVGFEFuncBElement: C, + SVGFEFuncGElement: C, + SVGFEFuncRElement: C, + SVGFEGaussianBlurElement: C, + SVGFEImageElement: C, + SVGFEMergeElement: C, + SVGFEMergeNodeElement: C, + SVGFEMorphologyElement: C, + SVGFEOffsetElement: C, + SVGFEPointLightElement: C, + SVGFESpecularLightingElement: C, + SVGFESpotLightElement: C, + SVGFETileElement: C, + SVGFETurbulenceElement: C, + SVGFilterElement: C, + SVGForeignObjectElement: C, + SVGGElement: C, + SVGGeometryElement: C, + SVGGradientElement: C, + SVGGraphicsElement: C, + SVGImageElement: C, + SVGLength: C, + SVGLengthList: C, + SVGLinearGradientElement: C, + SVGLineElement: C, + SVGMarkerElement: C, + SVGMaskElement: C, + SVGMatrix: C, + SVGMetadataElement: C, + SVGMPathElement: C, + SVGNumber: C, + SVGNumberList: C, + SVGPathElement: C, + SVGPatternElement: C, + SVGPoint: C, + SVGPointList: C, + SVGPolygonElement: C, + SVGPolylineElement: C, + SVGPreserveAspectRatio: C, + SVGRadialGradientElement: C, + SVGRect: C, + SVGRectElement: C, + SVGScriptElement: C, + SVGSetElement: C, + SVGStopElement: C, + SVGStringList: C, + SVGStyleElement: C, + SVGSVGElement: C, + SVGSwitchElement: C, + SVGSymbolElement: C, + SVGTextContentElement: C, + SVGTextElement: C, + SVGTextPathElement: C, + SVGTextPositioningElement: C, + SVGTitleElement: C, + SVGTransform: C, + SVGTransformList: C, + SVGTSpanElement: C, + SVGUnitTypes: C, + SVGUseElement: C, + SVGViewElement: C, + TaskAttributionTiming: C, + Text: C, + TextEvent: C, + TextMetrics: C, + TextTrack: C, + TextTrackCue: C, + TextTrackCueList: C, + TextTrackList: C, + TimeRanges: C, + toolbar: O, + top: O, + Touch: C, + TouchEvent: C, + TouchList: C, + TrackEvent: C, + TransitionEvent: C, + TreeWalker: C, + UIEvent: C, + ValidityState: C, + visualViewport: O, + VisualViewport: C, + VTTCue: C, + WaveShaperNode: C, + WebAssembly: O, + WebGL2RenderingContext: C, + WebGLActiveInfo: C, + WebGLBuffer: C, + WebGLContextEvent: C, + WebGLFramebuffer: C, + WebGLProgram: C, + WebGLQuery: C, + WebGLRenderbuffer: C, + WebGLRenderingContext: C, + WebGLSampler: C, + WebGLShader: C, + WebGLShaderPrecisionFormat: C, + WebGLSync: C, + WebGLTexture: C, + WebGLTransformFeedback: C, + WebGLUniformLocation: C, + WebGLVertexArrayObject: C, + WebSocket: C, + WheelEvent: C, + Window: C, + Worker: C, + WritableStream: C, + XMLDocument: C, + XMLHttpRequest: C, + XMLHttpRequestEventTarget: C, + XMLHttpRequestUpload: C, + XMLSerializer: C, + XPathEvaluator: C, + XPathExpression: C, + XPathResult: C, + XSLTProcessor: C +}; +for (const global of ['window', 'global', 'self', 'globalThis']) { + knownGlobals[global] = knownGlobals; +} +function getGlobalAtPath(path) { + let currentGlobal = knownGlobals; + for (const pathSegment of path) { + if (typeof pathSegment !== 'string') { + return null; + } + currentGlobal = currentGlobal[pathSegment]; + if (!currentGlobal) { + return null; + } + } + return currentGlobal[ValueProperties]; +} + +class GlobalVariable extends Variable { + constructor() { + super(...arguments); + // Ensure we use live-bindings for globals as we do not know if they have + // been reassigned + this.isReassigned = true; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + switch (interaction.type) { + // While there is no point in testing these cases as at the moment, they + // are also covered via other means, we keep them for completeness + case INTERACTION_ACCESSED: + case INTERACTION_ASSIGNED: { + if (!getGlobalAtPath([this.name, ...path].slice(0, -1))) { + super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + return; + } + case INTERACTION_CALLED: { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + if (globalAtPath) { + globalAtPath.deoptimizeArgumentsOnCall(interaction); + } + else { + super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + return; + } + } + } + getLiteralValueAtPath(path, _recursionTracker, _origin) { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + return globalAtPath ? globalAtPath.getLiteralValue() : UnknownValue; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + if (path.length === 0) { + // Technically, "undefined" is a global variable of sorts + return this.name !== 'undefined' && !getGlobalAtPath([this.name]); + } + return !getGlobalAtPath([this.name, ...path].slice(0, -1)); + } + case INTERACTION_ASSIGNED: { + return true; + } + case INTERACTION_CALLED: { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + return !globalAtPath || globalAtPath.hasEffectsWhenCalled(interaction, context); + } + } + } +} + +const tdzVariableKinds = { + __proto__: null, + class: true, + const: true, + let: true, + var: true +}; +class Identifier extends NodeBase { + constructor() { + super(...arguments); + this.variable = null; + } + get isTDZAccess() { + if (!isFlagSet(this.flags, 4 /* Flag.tdzAccessDefined */)) { + return null; + } + return isFlagSet(this.flags, 8 /* Flag.tdzAccess */); + } + set isTDZAccess(value) { + this.flags = setFlag(this.flags, 4 /* Flag.tdzAccessDefined */, true); + this.flags = setFlag(this.flags, 8 /* Flag.tdzAccess */, value); + } + addExportedVariables(variables, exportNamesByVariable) { + if (exportNamesByVariable.has(this.variable)) { + variables.push(this.variable); + } + } + bind() { + if (!this.variable && is_reference(this, this.parent)) { + this.variable = this.scope.findVariable(this.name); + this.variable.addReference(this); + } + } + declare(kind, init) { + let variable; + const { treeshake } = this.scope.context.options; + switch (kind) { + case "var" /* VariableKind.var */: { + variable = this.scope.addDeclaration(this, this.scope.context, init, kind); + if (treeshake && treeshake.correctVarValueBeforeDeclaration) { + // Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here. + variable.markInitializersForDeoptimization(); + } + break; + } + case "function" /* VariableKind.function */: { + // in strict mode, functions are only hoisted within a scope but not across block scopes + variable = this.scope.addDeclaration(this, this.scope.context, init, kind); + break; + } + case "let" /* VariableKind.let */: + case "const" /* VariableKind.const */: + case "class" /* VariableKind.class */: { + variable = this.scope.addDeclaration(this, this.scope.context, init, kind); + break; + } + case "parameter" /* VariableKind.parameter */: { + variable = this.scope.addParameterDeclaration(this); + break; + } + /* istanbul ignore next */ + default: { + /* istanbul ignore next */ + throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`); + } + } + return [(this.variable = variable)]; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + if (path.length === 0 && !this.scope.contains(this.name)) { + this.disallowImportReassignment(); + } + // We keep conditional chaining because an unknown Node could have an + // Identifier as property that might be deoptimized by default + this.variable?.deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getVariableRespectingTDZ().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const [expression, isPure] = this.getVariableRespectingTDZ().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + return [expression, isPure || this.isPureFunction(path)]; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.isPossibleTDZ() && this.variable.kind !== "var" /* VariableKind.var */) { + return true; + } + return (this.scope.context.options.treeshake + .unknownGlobalSideEffects && + this.variable instanceof GlobalVariable && + !this.isPureFunction(EMPTY_PATH) && + this.variable.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + return (this.variable !== null && + !this.isPureFunction(path) && + this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context)); + } + case INTERACTION_ASSIGNED: { + return (path.length > 0 ? this.getVariableRespectingTDZ() : this.variable).hasEffectsOnInteractionAtPath(path, interaction, context); + } + case INTERACTION_CALLED: { + return (!this.isPureFunction(path) && + this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context)); + } + } + } + include() { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (!this.included) { + this.included = true; + if (this.variable !== null) { + this.scope.context.includeVariableInModule(this.variable); + } + } + } + includeCallArguments(context, parameters) { + this.variable.includeCallArguments(context, parameters); + } + isPossibleTDZ() { + // return cached value to avoid issues with the next tree-shaking pass + const cachedTdzAccess = this.isTDZAccess; + if (cachedTdzAccess !== null) + return cachedTdzAccess; + if (!(this.variable instanceof LocalVariable && + this.variable.kind && + this.variable.kind in tdzVariableKinds && + // we ignore possible TDZs due to circular module dependencies as + // otherwise we get many false positives + this.variable.module === this.scope.context.module)) { + return (this.isTDZAccess = false); + } + let decl_id; + if (this.variable.declarations && + this.variable.declarations.length === 1 && + (decl_id = this.variable.declarations[0]) && + this.start < decl_id.start && + closestParentFunctionOrProgram(this) === closestParentFunctionOrProgram(decl_id)) { + // a variable accessed before its declaration + // in the same function or at top level of module + return (this.isTDZAccess = true); + } + // We ignore the case where the module is not yet executed because + // moduleSideEffects are false. + if (!this.variable.initReached && this.scope.context.module.isExecuted) { + // Either a const/let TDZ violation or + // var use before declaration was encountered. + return (this.isTDZAccess = true); + } + return (this.isTDZAccess = false); + } + markDeclarationReached() { + this.variable.initReached = true; + } + render(code, { snippets: { getPropertyAccess }, useOriginalName }, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) { + if (this.variable) { + const name = this.variable.getName(getPropertyAccess, useOriginalName); + if (name !== this.name) { + code.overwrite(this.start, this.end, name, { + contentOnly: true, + storeName: true + }); + if (isShorthandProperty) { + code.prependRight(this.start, `${this.name}: `); + } + } + // In strict mode, any variable named "eval" must be the actual "eval" function + if (name === 'eval' && + renderedParentType === CallExpression$1 && + isCalleeOfRenderedParent) { + code.appendRight(this.start, '0, '); + } + } + } + disallowImportReassignment() { + return this.scope.context.error(logIllegalImportReassignment(this.name, this.scope.context.module.id), this.start); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.variable instanceof LocalVariable) { + this.variable.consolidateInitializers(); + this.scope.context.requestTreeshakingPass(); + } + } + getVariableRespectingTDZ() { + if (this.isPossibleTDZ()) { + return UNKNOWN_EXPRESSION; + } + return this.variable; + } + isPureFunction(path) { + let currentPureFunction = this.scope.context.manualPureFunctions[this.name]; + for (const segment of path) { + if (currentPureFunction) { + if (currentPureFunction[PureFunctionKey]) { + return true; + } + currentPureFunction = currentPureFunction[segment]; + } + else { + return false; + } + } + return currentPureFunction?.[PureFunctionKey]; + } +} +function closestParentFunctionOrProgram(node) { + while (node && !/^Program|Function/.test(node.type)) { + node = node.parent; + } + // one of: ArrowFunctionExpression, FunctionDeclaration, FunctionExpression or Program + return node; +} + +function treeshakeNode(node, code, start, end) { + code.remove(start, end); + node.removeAnnotations(code); +} + +const NO_SEMICOLON = { isNoStatement: true }; +// This assumes there are only white-space and comments between start and the string we are looking for +function findFirstOccurrenceOutsideComment(code, searchString, start = 0) { + let searchPos, charCodeAfterSlash; + searchPos = code.indexOf(searchString, start); + while (true) { + start = code.indexOf('/', start); + if (start === -1 || start >= searchPos) + return searchPos; + charCodeAfterSlash = code.charCodeAt(++start); + ++start; + // With our assumption, '/' always starts a comment. Determine comment type: + start = + charCodeAfterSlash === 47 /*"/"*/ + ? code.indexOf('\n', start) + 1 + : code.indexOf('*/', start) + 2; + if (start > searchPos) { + searchPos = code.indexOf(searchString, start); + } + } +} +const NON_WHITESPACE = /\S/g; +function findNonWhiteSpace(code, index) { + NON_WHITESPACE.lastIndex = index; + const result = NON_WHITESPACE.exec(code); + return result.index; +} +// This assumes "code" only contains white-space and comments +// Returns position of line-comment if applicable +function findFirstLineBreakOutsideComment(code) { + let lineBreakPos, charCodeAfterSlash, start = 0; + lineBreakPos = code.indexOf('\n', start); + while (true) { + start = code.indexOf('/', start); + if (start === -1 || start > lineBreakPos) + return [lineBreakPos, lineBreakPos + 1]; + // With our assumption, '/' always starts a comment. Determine comment type: + charCodeAfterSlash = code.charCodeAt(start + 1); + if (charCodeAfterSlash === 47 /*"/"*/) + return [start, lineBreakPos + 1]; + start = code.indexOf('*/', start + 2) + 2; + if (start > lineBreakPos) { + lineBreakPos = code.indexOf('\n', start); + } + } +} +function renderStatementList(statements, code, start, end, options) { + let currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart; + let nextNode = statements[0]; + let nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries; + if (nextNodeNeedsBoundaries) { + nextNodeStart = + start + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1]; + } + for (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) { + currentNode = nextNode; + currentNodeStart = nextNodeStart; + currentNodeNeedsBoundaries = nextNodeNeedsBoundaries; + nextNode = statements[nextIndex]; + nextNodeNeedsBoundaries = + nextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries; + if (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) { + nextNodeStart = + currentNode.end + + findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1]; + if (currentNode.included) { + currentNodeNeedsBoundaries + ? currentNode.render(code, options, { + end: nextNodeStart, + start: currentNodeStart + }) + : currentNode.render(code, options); + } + else { + treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart); + } + } + else { + currentNode.render(code, options); + } + } +} +// This assumes that the first character is not part of the first node +function getCommaSeparatedNodesWithBoundaries(nodes, code, start, end) { + const splitUpNodes = []; + let node, nextNodeStart, contentEnd, char; + let separator = start - 1; + for (const nextNode of nodes) { + if (node !== undefined) { + separator = + node.end + + findFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ','); + } + nextNodeStart = contentEnd = + separator + + 1 + + findFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1]; + while (((char = code.original.charCodeAt(nextNodeStart)), + char === 32 /*" "*/ || char === 9 /*"\t"*/ || char === 10 /*"\n"*/ || char === 13) /*"\r"*/) + nextNodeStart++; + if (node !== undefined) { + splitUpNodes.push({ + contentEnd, + end: nextNodeStart, + node, + separator, + start + }); + } + node = nextNode; + start = nextNodeStart; + } + splitUpNodes.push({ + contentEnd: end, + end, + node: node, + separator: null, + start + }); + return splitUpNodes; +} +// This assumes there are only white-space and comments between start and end +function removeLineBreaks(code, start, end) { + while (true) { + const [removeStart, removeEnd] = findFirstLineBreakOutsideComment(code.original.slice(start, end)); + if (removeStart === -1) { + break; + } + code.remove(start + removeStart, (start += removeEnd)); + } +} + +class BlockScope extends ChildScope { + constructor(parent) { + super(parent, parent.context); + } + addDeclaration(identifier, context, init, kind) { + if (kind === "var" /* VariableKind.var */) { + const name = identifier.name; + const existingVariable = this.hoistedVariables?.get(name) || this.variables.get(name); + if (existingVariable) { + if (existingVariable.kind === "var" /* VariableKind.var */ || + (kind === "var" /* VariableKind.var */ && existingVariable.kind === "parameter" /* VariableKind.parameter */)) { + existingVariable.addDeclaration(identifier, init); + return existingVariable; + } + return context.error(logRedeclarationError(name), identifier.start); + } + const declaredVariable = this.parent.addDeclaration(identifier, context, init, kind); + // Necessary to make sure the init is deoptimized for conditional declarations. + // We cannot call deoptimizePath here. + declaredVariable.markInitializersForDeoptimization(); + // We add the variable to this and all parent scopes to reliably detect conflicts + this.addHoistedVariable(name, declaredVariable); + return declaredVariable; + } + return super.addDeclaration(identifier, context, init, kind); + } +} + +class ExpressionStatement extends NodeBase { + initialise() { + if (this.directive && + this.directive !== 'use strict' && + this.parent.type === Program$1) { + this.scope.context.log(LOGLEVEL_WARN, + // This is necessary, because either way (deleting or not) can lead to errors. + logModuleLevelDirective(this.directive, this.scope.context.module.id), this.start); + } + } + removeAnnotations(code) { + this.expression.removeAnnotations(code); + } + render(code, options) { + super.render(code, options); + if (code.original[this.end - 1] !== ';') { + code.appendLeft(this.end, ';'); + } + } + shouldBeIncluded(context) { + if (this.directive && this.directive !== 'use strict') + return this.parent.type !== Program$1; + return super.shouldBeIncluded(context); + } + applyDeoptimizations() { } +} + +class BlockStatement extends NodeBase { + get deoptimizeBody() { + return isFlagSet(this.flags, 32768 /* Flag.deoptimizeBody */); + } + set deoptimizeBody(value) { + this.flags = setFlag(this.flags, 32768 /* Flag.deoptimizeBody */, value); + } + get directlyIncluded() { + return isFlagSet(this.flags, 16384 /* Flag.directlyIncluded */); + } + set directlyIncluded(value) { + this.flags = setFlag(this.flags, 16384 /* Flag.directlyIncluded */, value); + } + addImplicitReturnExpressionToScope() { + const lastStatement = this.body[this.body.length - 1]; + if (!lastStatement || lastStatement.type !== ReturnStatement$1) { + this.scope.addReturnExpression(UNKNOWN_EXPRESSION); + } + } + createScope(parentScope) { + this.scope = this.parent.preventChildBlockScope + ? parentScope + : new BlockScope(parentScope); + } + hasEffects(context) { + if (this.deoptimizeBody) + return true; + for (const node of this.body) { + if (context.brokenFlow) + break; + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + if (!(this.deoptimizeBody && this.directlyIncluded)) { + this.included = true; + this.directlyIncluded = true; + if (this.deoptimizeBody) + includeChildrenRecursively = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + } + initialise() { + const firstBodyStatement = this.body[0]; + this.deoptimizeBody = + firstBodyStatement instanceof ExpressionStatement && + firstBodyStatement.directive === 'use asm'; + } + render(code, options) { + if (this.body.length > 0) { + renderStatementList(this.body, code, this.start + 1, this.end - 1, options); + } + else { + super.render(code, options); + } + } +} + +class RestElement extends NodeBase { + constructor() { + super(...arguments); + this.declarationInit = null; + } + addExportedVariables(variables, exportNamesByVariable) { + this.argument.addExportedVariables(variables, exportNamesByVariable); + } + declare(kind, init) { + this.declarationInit = init; + return this.argument.declare(kind, UNKNOWN_EXPRESSION); + } + deoptimizePath(path) { + path.length === 0 && this.argument.deoptimizePath(EMPTY_PATH); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (path.length > 0 || + this.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)); + } + markDeclarationReached() { + this.argument.markDeclarationReached(); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.declarationInit !== null) { + this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); + this.scope.context.requestTreeshakingPass(); + } + } +} + +class FunctionBase extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + get async() { + return isFlagSet(this.flags, 256 /* Flag.async */); + } + set async(value) { + this.flags = setFlag(this.flags, 256 /* Flag.async */, value); + } + get deoptimizedReturn() { + return isFlagSet(this.flags, 512 /* Flag.deoptimizedReturn */); + } + set deoptimizedReturn(value) { + this.flags = setFlag(this.flags, 512 /* Flag.deoptimizedReturn */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (interaction.type === INTERACTION_CALLED) { + const { parameters } = this.scope; + const { args } = interaction; + let hasRest = false; + for (let position = 0; position < args.length - 1; position++) { + const parameter = this.params[position]; + // Only the "this" argument arg[0] can be null + const argument = args[position + 1]; + if (hasRest || parameter instanceof RestElement) { + hasRest = true; + argument.deoptimizePath(UNKNOWN_PATH); + } + else if (parameter instanceof Identifier) { + parameters[position][0].addEntityToBeDeoptimized(argument); + this.addArgumentToBeDeoptimized(argument); + } + else if (parameter) { + argument.deoptimizePath(UNKNOWN_PATH); + } + else { + this.addArgumentToBeDeoptimized(argument); + } + } + } + else { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + if (path.length === 1 && path[0] === UnknownKey) { + // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track + // which means the return expression and parameters need to be reassigned + this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); + for (const parameterList of this.scope.parameters) { + for (const parameter of parameterList) { + parameter.deoptimizePath(UNKNOWN_PATH); + } + } + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (path.length > 0) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + if (this.async) { + if (!this.deoptimizedReturn) { + this.deoptimizedReturn = true; + this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } + return UNKNOWN_RETURN_EXPRESSION; + } + return [this.scope.getReturnExpression(), false]; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (path.length > 0 || interaction.type !== INTERACTION_CALLED) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + if (this.annotationNoSideEffects) { + return false; + } + if (this.async) { + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + const returnExpression = this.scope.getReturnExpression(); + if (returnExpression.hasEffectsOnInteractionAtPath(['then'], NODE_INTERACTION_UNKNOWN_CALL, context) || + (propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + returnExpression.hasEffectsOnInteractionAtPath(['then'], NODE_INTERACTION_UNKNOWN_ACCESS, context)))) { + return true; + } + } + for (const parameter of this.params) { + if (parameter.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + const { brokenFlow } = context; + context.brokenFlow = false; + this.body.include(context, includeChildrenRecursively); + context.brokenFlow = brokenFlow; + } + includeCallArguments(context, parameters) { + this.scope.includeCallArguments(context, parameters); + } + initialise() { + if (this.body instanceof BlockStatement) { + this.body.addImplicitReturnExpressionToScope(); + } + else { + this.scope.addReturnExpression(this.body); + } + } + parseNode(esTreeNode) { + const { body, params } = esTreeNode; + const parameters = (this.params = []); + const { scope } = this; + const { bodyScope, context } = scope; + // We need to ensure that parameters are declared before the body is parsed + // so that the scope already knows all parameters and can detect conflicts + // when parsing the body. + for (const parameter of params) { + parameters.push(new (context.getNodeConstructor(parameter.type))(parameter, this, scope, false)); + } + scope.addParameterVariables(parameters.map(parameter => parameter.declare("parameter" /* VariableKind.parameter */, UNKNOWN_EXPRESSION)), parameters[parameters.length - 1] instanceof RestElement); + this.body = new (context.getNodeConstructor(body.type))(body, this, bodyScope); + super.parseNode(esTreeNode); + } + addArgumentToBeDeoptimized(_argument) { } + applyDeoptimizations() { } +} +FunctionBase.prototype.preventChildBlockScope = true; + +class ArrowFunctionExpression extends FunctionBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + createScope(parentScope) { + this.scope = new ReturnValueScope(parentScope, false); + } + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) { + return true; + } + if (this.annotationNoSideEffects) { + return false; + } + if (interaction.type === INTERACTION_CALLED) { + const { ignore, brokenFlow } = context; + context.ignore = { + breaks: false, + continues: false, + labels: new Set(), + returnYield: true, + this: false + }; + if (this.body.hasEffects(context)) + return true; + context.ignore = ignore; + context.brokenFlow = brokenFlow; + } + return false; + } + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + for (const parameter of this.params) { + if (!(parameter instanceof Identifier)) { + parameter.include(context, includeChildrenRecursively); + } + } + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + return (this.objectEntity = new ObjectEntity([], OBJECT_PROTOTYPE)); + } +} + +function getSystemExportStatement(exportedVariables, { exportNamesByVariable, snippets: { _, getObject, getPropertyAccess } }, modifier = '') { + if (exportedVariables.length === 1 && + exportNamesByVariable.get(exportedVariables[0]).length === 1) { + const variable = exportedVariables[0]; + return `exports(${JSON.stringify(exportNamesByVariable.get(variable)[0])},${_}${variable.getName(getPropertyAccess)}${modifier})`; + } + else { + const fields = []; + for (const variable of exportedVariables) { + for (const exportName of exportNamesByVariable.get(variable)) { + fields.push([exportName, variable.getName(getPropertyAccess) + modifier]); + } + } + return `exports(${getObject(fields, { lineBreakIndent: null })})`; + } +} +// This is only invoked if there is exactly one export name +function renderSystemExportExpression(exportedVariable, expressionStart, expressionEnd, code, { exportNamesByVariable, snippets: { _ } }) { + code.prependRight(expressionStart, `exports(${JSON.stringify(exportNamesByVariable.get(exportedVariable)[0])},${_}`); + code.appendLeft(expressionEnd, ')'); +} +function renderSystemExportFunction(exportedVariables, expressionStart, expressionEnd, needsParens, code, options) { + const { _, getDirectReturnIifeLeft } = options.snippets; + code.prependRight(expressionStart, getDirectReturnIifeLeft(['v'], `${getSystemExportStatement(exportedVariables, options)},${_}v`, { needsArrowReturnParens: true, needsWrappedFunction: needsParens })); + code.appendLeft(expressionEnd, ')'); +} +function renderSystemExportSequenceAfterExpression(exportedVariable, expressionStart, expressionEnd, needsParens, code, options) { + const { _, getPropertyAccess } = options.snippets; + code.appendLeft(expressionEnd, `,${_}${getSystemExportStatement([exportedVariable], options)},${_}${exportedVariable.getName(getPropertyAccess)}`); + if (needsParens) { + code.prependRight(expressionStart, '('); + code.appendLeft(expressionEnd, ')'); + } +} +function renderSystemExportSequenceBeforeExpression(exportedVariable, expressionStart, expressionEnd, needsParens, code, options, modifier) { + const { _ } = options.snippets; + code.prependRight(expressionStart, `${getSystemExportStatement([exportedVariable], options, modifier)},${_}`); + if (needsParens) { + code.prependRight(expressionStart, '('); + code.appendLeft(expressionEnd, ')'); + } +} + +class ObjectPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + for (const property of this.properties) { + if (property.type === Property$1) { + property.value.addExportedVariables(variables, exportNamesByVariable); + } + else { + property.argument.addExportedVariables(variables, exportNamesByVariable); + } + } + } + declare(kind, init) { + const variables = []; + for (const property of this.properties) { + variables.push(...property.declare(kind, init)); + } + return variables; + } + deoptimizePath(path) { + if (path.length === 0) { + for (const property of this.properties) { + property.deoptimizePath(path); + } + } + } + hasEffectsOnInteractionAtPath( + // At the moment, this is only triggered for assignment left-hand sides, + // where the path is empty + _path, interaction, context) { + for (const property of this.properties) { + if (property.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) + return true; + } + return false; + } + markDeclarationReached() { + for (const property of this.properties) { + property.markDeclarationReached(); + } + } +} + +class AssignmentExpression extends NodeBase { + hasEffects(context) { + const { deoptimized, left, operator, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + // MemberExpressions do not access the property before assignments if the + // operator is '='. + return (right.hasEffects(context) || left.hasEffectsAsAssignmentTarget(context, operator !== '=')); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.right.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + const { deoptimized, left, right, operator } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + if (includeChildrenRecursively || + operator !== '=' || + left.included || + left.hasEffectsAsAssignmentTarget(createHasEffectsContext(), false)) { + left.includeAsAssignmentTarget(context, includeChildrenRecursively, operator !== '='); + } + right.include(context, includeChildrenRecursively); + } + initialise() { + this.left.setAssignedValue(this.right); + } + render(code, options, { preventASI, renderedParentType, renderedSurroundingElement } = BLANK) { + const { left, right, start, end, parent } = this; + if (left.included) { + left.render(code, options); + right.render(code, options); + } + else { + const inclusionStart = findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, '=', left.end) + 1); + code.remove(start, inclusionStart); + if (preventASI) { + removeLineBreaks(code, inclusionStart, right.start); + } + right.render(code, options, { + renderedParentType: renderedParentType || parent.type, + renderedSurroundingElement: renderedSurroundingElement || parent.type + }); + } + if (options.format === 'system') { + if (left instanceof Identifier) { + const variable = left.variable; + const exportNames = options.exportNamesByVariable.get(variable); + if (exportNames) { + if (exportNames.length === 1) { + renderSystemExportExpression(variable, start, end, code, options); + } + else { + renderSystemExportSequenceAfterExpression(variable, start, end, parent.type !== ExpressionStatement$1, code, options); + } + return; + } + } + else { + const systemPatternExports = []; + left.addExportedVariables(systemPatternExports, options.exportNamesByVariable); + if (systemPatternExports.length > 0) { + renderSystemExportFunction(systemPatternExports, start, end, renderedSurroundingElement === ExpressionStatement$1, code, options); + return; + } + } + } + if (left.included && + left instanceof ObjectPattern && + (renderedSurroundingElement === ExpressionStatement$1 || + renderedSurroundingElement === ArrowFunctionExpression$1)) { + code.appendRight(start, '('); + code.prependLeft(end, ')'); + } + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class AssignmentPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + this.left.addExportedVariables(variables, exportNamesByVariable); + } + declare(kind, init) { + return this.left.declare(kind, init); + } + deoptimizePath(path) { + path.length === 0 && this.left.deoptimizePath(path); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (path.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)); + } + markDeclarationReached() { + this.left.markDeclarationReached(); + } + render(code, options, { isShorthandProperty } = BLANK) { + this.left.render(code, options, { isShorthandProperty }); + this.right.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class ArgumentsVariable extends LocalVariable { + constructor(context) { + super('arguments', null, UNKNOWN_EXPRESSION, context, "other" /* VariableKind.other */); + this.deoptimizedArguments = []; + } + addArgumentToBeDeoptimized(argument) { + if (this.included) { + argument.deoptimizePath(UNKNOWN_PATH); + } + else { + this.deoptimizedArguments.push(argument); + } + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > 1; + } + include() { + super.include(); + for (const argument of this.deoptimizedArguments) { + argument.deoptimizePath(UNKNOWN_PATH); + } + this.deoptimizedArguments.length = 0; + } +} + +class ThisVariable extends ParameterVariable { + constructor(context) { + super('this', null, context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION).hasEffectsOnInteractionAtPath(path, interaction, context); + } +} + +class FunctionScope extends ReturnValueScope { + constructor(parent) { + const { context } = parent; + super(parent, false); + this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context))); + this.variables.set('this', (this.thisVariable = new ThisVariable(context))); + } + findLexicalBoundary() { + return this; + } + includeCallArguments(context, parameters) { + super.includeCallArguments(context, parameters); + if (this.argumentsVariable.included) { + for (const argument of parameters) { + if (!argument.included) { + argument.include(context, false); + } + } + } + } +} + +class FunctionNode extends FunctionBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + createScope(parentScope) { + this.scope = new FunctionScope(parentScope); + this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE); + // This makes sure that all deoptimizations of "this" are applied to the + // constructed entity. + this.scope.thisVariable.addEntityToBeDeoptimized(this.constructedEntity); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + if (interaction.type === INTERACTION_CALLED && path.length === 0 && interaction.args[0]) { + // args[0] is the "this" argument + this.scope.thisVariable.addEntityToBeDeoptimized(interaction.args[0]); + } + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.annotationNoSideEffects) { + return false; + } + return !!this.id?.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) + return true; + if (this.annotationNoSideEffects) { + return false; + } + if (interaction.type === INTERACTION_CALLED) { + const thisInit = context.replacedVariableInits.get(this.scope.thisVariable); + context.replacedVariableInits.set(this.scope.thisVariable, interaction.withNew ? this.constructedEntity : UNKNOWN_EXPRESSION); + const { brokenFlow, ignore, replacedVariableInits } = context; + context.ignore = { + breaks: false, + continues: false, + labels: new Set(), + returnYield: true, + this: interaction.withNew + }; + if (this.body.hasEffects(context)) + return true; + context.brokenFlow = brokenFlow; + if (thisInit) { + replacedVariableInits.set(this.scope.thisVariable, thisInit); + } + else { + replacedVariableInits.delete(this.scope.thisVariable); + } + context.ignore = ignore; + } + return false; + } + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + this.id?.include(); + const hasArguments = this.scope.argumentsVariable.included; + for (const parameter of this.params) { + if (!(parameter instanceof Identifier) || hasArguments) { + parameter.include(context, includeChildrenRecursively); + } + } + } + initialise() { + super.initialise(); + this.id?.declare("function" /* VariableKind.function */, this); + } + addArgumentToBeDeoptimized(argument) { + this.scope.argumentsVariable.addArgumentToBeDeoptimized(argument); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + return (this.objectEntity = new ObjectEntity([ + { + key: 'prototype', + kind: 'init', + property: new ObjectEntity([], OBJECT_PROTOTYPE) + } + ], OBJECT_PROTOTYPE)); + } +} + +class AwaitExpression extends NodeBase { + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + return true; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (!this.included) { + this.included = true; + checkTopLevelAwait: if (!this.scope.context.usesTopLevelAwait) { + let parent = this.parent; + do { + if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression) + break checkTopLevelAwait; + } while ((parent = parent.parent)); + this.scope.context.usesTopLevelAwait = true; + } + } + this.argument.include(context, includeChildrenRecursively); + } +} + +const binaryOperators = { + '!=': (left, right) => left != right, + '!==': (left, right) => left !== right, + '%': (left, right) => left % right, + '&': (left, right) => left & right, + '*': (left, right) => left * right, + // At the moment, "**" will be transpiled to Math.pow + '**': (left, right) => left ** right, + '+': (left, right) => left + right, + '-': (left, right) => left - right, + '/': (left, right) => left / right, + '<': (left, right) => left < right, + '<<': (left, right) => left << right, + '<=': (left, right) => left <= right, + '==': (left, right) => left == right, + '===': (left, right) => left === right, + '>': (left, right) => left > right, + '>=': (left, right) => left >= right, + '>>': (left, right) => left >> right, + '>>>': (left, right) => left >>> right, + '^': (left, right) => left ^ right, + '|': (left, right) => left | right + // We use the fallback for cases where we return something unknown + // in: () => UnknownValue, + // instanceof: () => UnknownValue, +}; +class BinaryExpression extends NodeBase { + deoptimizeCache() { } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length > 0) + return UnknownValue; + const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); + if (typeof leftValue === 'symbol') + return UnknownValue; + const rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); + if (typeof rightValue === 'symbol') + return UnknownValue; + const operatorFunction = binaryOperators[this.operator]; + if (!operatorFunction) + return UnknownValue; + return operatorFunction(leftValue, rightValue); + } + hasEffects(context) { + // support some implicit type coercion runtime errors + if (this.operator === '+' && + this.parent instanceof ExpressionStatement && + this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '') { + return true; + } + return super.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > 1; + } + removeAnnotations(code) { + this.left.removeAnnotations(code); + } + render(code, options, { renderedSurroundingElement } = BLANK) { + this.left.render(code, options, { renderedSurroundingElement }); + this.right.render(code, options); + } +} + +class BreakStatement extends NodeBase { + hasEffects(context) { + if (this.label) { + if (!context.ignore.labels.has(this.label.name)) + return true; + context.includedLabels.add(this.label.name); + } + else { + if (!context.ignore.breaks) + return true; + context.hasBreak = true; + } + context.brokenFlow = true; + return false; + } + include(context) { + this.included = true; + if (this.label) { + this.label.include(); + context.includedLabels.add(this.label.name); + } + else { + context.hasBreak = true; + } + context.brokenFlow = true; + } +} + +function renderCallArguments(code, options, node) { + if (node.arguments.length > 0) { + if (node.arguments[node.arguments.length - 1].included) { + for (const argument of node.arguments) { + argument.render(code, options); + } + } + else { + let lastIncludedIndex = node.arguments.length - 2; + while (lastIncludedIndex >= 0 && !node.arguments[lastIncludedIndex].included) { + lastIncludedIndex--; + } + if (lastIncludedIndex >= 0) { + for (let index = 0; index <= lastIncludedIndex; index++) { + node.arguments[index].render(code, options); + } + code.remove(findFirstOccurrenceOutsideComment(code.original, ',', node.arguments[lastIncludedIndex].end), node.end - 1); + } + else { + code.remove(findFirstOccurrenceOutsideComment(code.original, '(', node.callee.end) + 1, node.end - 1); + } + } + } +} + +class Literal extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath() { } + getLiteralValueAtPath(path) { + if (path.length > 0 || + // unknown literals can also be null but do not start with an "n" + (this.value === null && this.scope.context.code.charCodeAt(this.start) !== 110) || + typeof this.value === 'bigint' || + // to support shims for regular expressions + this.scope.context.code.charCodeAt(this.start) === 47) { + return UnknownValue; + } + return this.value; + } + getReturnExpressionWhenCalledAtPath(path) { + if (path.length !== 1) + return UNKNOWN_RETURN_EXPRESSION; + return getMemberReturnExpressionWhenCalled(this.members, path[0]); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: { + return path.length > (this.value === null ? 0 : 1); + } + case INTERACTION_ASSIGNED: { + return true; + } + case INTERACTION_CALLED: { + if (this.included && + this.value instanceof RegExp && + (this.value.global || this.value.sticky)) { + return true; + } + return (path.length !== 1 || + hasMemberEffectWhenCalled(this.members, path[0], interaction, context)); + } + } + } + initialise() { + this.members = getLiteralMembersForValue(this.value); + } + parseNode(esTreeNode) { + this.value = esTreeNode.value; + this.regex = esTreeNode.regex; + super.parseNode(esTreeNode); + } + render(code) { + if (typeof this.value === 'string') { + code.indentExclusionRanges.push([this.start + 1, this.end - 1]); + } + } +} + +// To avoid infinite recursions +const MAX_PATH_DEPTH = 7; +function getResolvablePropertyKey(memberExpression) { + return memberExpression.computed + ? getResolvableComputedPropertyKey(memberExpression.property) + : memberExpression.property.name; +} +function getResolvableComputedPropertyKey(propertyKey) { + if (propertyKey instanceof Literal) { + return String(propertyKey.value); + } + return null; +} +function getPathIfNotComputed(memberExpression) { + const nextPathKey = memberExpression.propertyKey; + const object = memberExpression.object; + if (typeof nextPathKey === 'string') { + if (object instanceof Identifier) { + return [ + { key: object.name, pos: object.start }, + { key: nextPathKey, pos: memberExpression.property.start } + ]; + } + if (object instanceof MemberExpression) { + const parentPath = getPathIfNotComputed(object); + return (parentPath && [...parentPath, { key: nextPathKey, pos: memberExpression.property.start }]); + } + } + return null; +} +function getStringFromPath(path) { + let pathString = path[0].key; + for (let index = 1; index < path.length; index++) { + pathString += '.' + path[index].key; + } + return pathString; +} +class MemberExpression extends NodeBase { + constructor() { + super(...arguments); + this.variable = null; + this.expressionsToBeDeoptimized = []; + } + get computed() { + return isFlagSet(this.flags, 1024 /* Flag.computed */); + } + set computed(value) { + this.flags = setFlag(this.flags, 1024 /* Flag.computed */, value); + } + get optional() { + return isFlagSet(this.flags, 128 /* Flag.optional */); + } + set optional(value) { + this.flags = setFlag(this.flags, 128 /* Flag.optional */, value); + } + get assignmentDeoptimized() { + return isFlagSet(this.flags, 16 /* Flag.assignmentDeoptimized */); + } + set assignmentDeoptimized(value) { + this.flags = setFlag(this.flags, 16 /* Flag.assignmentDeoptimized */, value); + } + get bound() { + return isFlagSet(this.flags, 32 /* Flag.bound */); + } + set bound(value) { + this.flags = setFlag(this.flags, 32 /* Flag.bound */, value); + } + get isUndefined() { + return isFlagSet(this.flags, 64 /* Flag.isUndefined */); + } + set isUndefined(value) { + this.flags = setFlag(this.flags, 64 /* Flag.isUndefined */, value); + } + bind() { + this.bound = true; + const path = getPathIfNotComputed(this); + const baseVariable = path && this.scope.findVariable(path[0].key); + if (baseVariable?.isNamespace) { + const resolvedVariable = resolveNamespaceVariables(baseVariable, path.slice(1), this.scope.context); + if (!resolvedVariable) { + super.bind(); + } + else if (resolvedVariable === 'undefined') { + this.isUndefined = true; + } + else { + this.variable = resolvedVariable; + this.scope.addNamespaceMemberAccess(getStringFromPath(path), resolvedVariable); + } + } + else { + super.bind(); + } + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (this.variable) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + else if (!this.isUndefined) { + if (path.length < MAX_PATH_DEPTH) { + this.object.deoptimizeArgumentsOnInteractionAtPath(interaction, [this.getPropertyKey(), ...path], recursionTracker); + } + else { + deoptimizeInteraction(interaction); + } + } + } + deoptimizeCache() { + const { expressionsToBeDeoptimized, object } = this; + this.expressionsToBeDeoptimized = EMPTY_ARRAY; + this.propertyKey = UnknownKey; + object.deoptimizePath(UNKNOWN_PATH); + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + deoptimizePath(path) { + if (path.length === 0) + this.disallowNamespaceReassignment(); + if (this.variable) { + this.variable.deoptimizePath(path); + } + else if (!this.isUndefined && path.length < MAX_PATH_DEPTH) { + const propertyKey = this.getPropertyKey(); + this.object.deoptimizePath([ + propertyKey === UnknownKey ? UnknownNonAccessorKey : propertyKey, + ...path + ]); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.variable) { + return this.variable.getLiteralValueAtPath(path, recursionTracker, origin); + } + if (this.isUndefined) { + return undefined; + } + if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { + this.expressionsToBeDeoptimized.push(origin); + return this.object.getLiteralValueAtPath([this.getPropertyKey(), ...path], recursionTracker, origin); + } + return UnknownValue; + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (this.variable) { + return this.variable.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + if (this.isUndefined) { + return [UNDEFINED_EXPRESSION, false]; + } + if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { + this.expressionsToBeDeoptimized.push(origin); + return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(), ...path], interaction, recursionTracker, origin); + } + return UNKNOWN_RETURN_EXPRESSION; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + return (this.property.hasEffects(context) || + this.object.hasEffects(context) || + this.hasAccessEffect(context)); + } + hasEffectsAsAssignmentTarget(context, checkAccess) { + if (checkAccess && !this.deoptimized) + this.applyDeoptimizations(); + if (!this.assignmentDeoptimized) + this.applyAssignmentDeoptimization(); + return (this.property.hasEffects(context) || + this.object.hasEffects(context) || + (checkAccess && this.hasAccessEffect(context)) || + this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.variable) { + return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); + } + if (this.isUndefined) { + return true; + } + if (path.length < MAX_PATH_DEPTH) { + return this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey(), ...path], interaction, context); + } + return true; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.includeProperties(context, includeChildrenRecursively); + } + includeAsAssignmentTarget(context, includeChildrenRecursively, deoptimizeAccess) { + if (!this.assignmentDeoptimized) + this.applyAssignmentDeoptimization(); + if (deoptimizeAccess) { + this.include(context, includeChildrenRecursively); + } + else { + this.includeProperties(context, includeChildrenRecursively); + } + } + includeCallArguments(context, parameters) { + if (this.variable) { + this.variable.includeCallArguments(context, parameters); + } + else { + super.includeCallArguments(context, parameters); + } + } + initialise() { + this.propertyKey = getResolvablePropertyKey(this); + this.accessInteraction = { args: [this.object], type: INTERACTION_ACCESSED }; + } + isSkippedAsOptional(origin) { + return (!this.variable && + !this.isUndefined && + (this.object.isSkippedAsOptional?.(origin) || + (this.optional && + this.object.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, origin) == null))); + } + render(code, options, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement } = BLANK) { + if (this.variable || this.isUndefined) { + const { snippets: { getPropertyAccess } } = options; + let replacement = this.variable ? this.variable.getName(getPropertyAccess) : 'undefined'; + if (renderedParentType && isCalleeOfRenderedParent) + replacement = '0, ' + replacement; + code.overwrite(this.start, this.end, replacement, { + contentOnly: true, + storeName: true + }); + } + else { + if (renderedParentType && isCalleeOfRenderedParent) { + code.appendRight(this.start, '0, '); + } + this.object.render(code, options, { renderedSurroundingElement }); + this.property.render(code, options); + } + } + setAssignedValue(value) { + this.assignmentInteraction = { + args: [this.object, value], + type: INTERACTION_ASSIGNED + }; + } + applyDeoptimizations() { + this.deoptimized = true; + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + if ( + // Namespaces are not bound and should not be deoptimized + this.bound && + propertyReadSideEffects && + !(this.variable || this.isUndefined)) { + const propertyKey = this.getPropertyKey(); + this.object.deoptimizeArgumentsOnInteractionAtPath(this.accessInteraction, [propertyKey], SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + } + applyAssignmentDeoptimization() { + this.assignmentDeoptimized = true; + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + if ( + // Namespaces are not bound and should not be deoptimized + this.bound && + propertyReadSideEffects && + !(this.variable || this.isUndefined)) { + this.object.deoptimizeArgumentsOnInteractionAtPath(this.assignmentInteraction, [this.getPropertyKey()], SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + } + disallowNamespaceReassignment() { + if (this.object instanceof Identifier) { + const variable = this.scope.findVariable(this.object.name); + if (variable.isNamespace) { + if (this.variable) { + this.scope.context.includeVariableInModule(this.variable); + } + this.scope.context.log(LOGLEVEL_WARN, logIllegalImportReassignment(this.object.name, this.scope.context.module.id), this.start); + } + } + } + getPropertyKey() { + if (this.propertyKey === null) { + this.propertyKey = UnknownKey; + const value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + return (this.propertyKey = + value === SymbolToStringTag + ? value + : typeof value === 'symbol' + ? UnknownKey + : String(value)); + } + return this.propertyKey; + } + hasAccessEffect(context) { + const { propertyReadSideEffects } = this.scope.context.options + .treeshake; + return (!(this.variable || this.isUndefined) && + propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey()], this.accessInteraction, context))); + } + includeProperties(context, includeChildrenRecursively) { + if (!this.included) { + this.included = true; + if (this.variable) { + this.scope.context.includeVariableInModule(this.variable); + } + } + this.object.include(context, includeChildrenRecursively); + this.property.include(context, includeChildrenRecursively); + } +} +function resolveNamespaceVariables(baseVariable, path, astContext) { + if (path.length === 0) + return baseVariable; + if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable) + return null; + const exportName = path[0].key; + const variable = baseVariable.context.traceExport(exportName); + if (!variable) { + if (path.length === 1) { + const fileName = baseVariable.context.fileName; + astContext.log(LOGLEVEL_WARN, logMissingExport(exportName, astContext.module.id, fileName), path[0].pos); + return 'undefined'; + } + return null; + } + return resolveNamespaceVariables(variable, path.slice(1), astContext); +} + +class CallExpressionBase extends NodeBase { + constructor() { + super(...arguments); + this.returnExpression = null; + this.deoptimizableDependentExpressions = []; + this.expressionsToBeDeoptimized = new Set(); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + const { args } = interaction; + const [returnExpression, isPure] = this.getReturnExpression(recursionTracker); + if (isPure) + return; + const deoptimizedExpressions = args.filter(expression => !!expression && expression !== UNKNOWN_EXPRESSION); + if (deoptimizedExpressions.length === 0) + return; + if (returnExpression === UNKNOWN_EXPRESSION) { + for (const expression of deoptimizedExpressions) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + else { + recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + for (const expression of deoptimizedExpressions) { + this.expressionsToBeDeoptimized.add(expression); + } + returnExpression.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + }, null); + } + } + deoptimizeCache() { + if (this.returnExpression?.[0] !== UNKNOWN_EXPRESSION) { + this.returnExpression = UNKNOWN_RETURN_EXPRESSION; + const { deoptimizableDependentExpressions, expressionsToBeDeoptimized } = this; + this.expressionsToBeDeoptimized = EMPTY_SET; + this.deoptimizableDependentExpressions = EMPTY_ARRAY; + for (const expression of deoptimizableDependentExpressions) { + expression.deoptimizeCache(); + } + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + } + deoptimizePath(path) { + if (path.length === 0 || + this.scope.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)) { + return; + } + const [returnExpression] = this.getReturnExpression(); + if (returnExpression !== UNKNOWN_EXPRESSION) { + returnExpression.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const [returnExpression] = this.getReturnExpression(recursionTracker); + if (returnExpression === UNKNOWN_EXPRESSION) { + return UnknownValue; + } + return recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + this.deoptimizableDependentExpressions.push(origin); + return returnExpression.getLiteralValueAtPath(path, recursionTracker, origin); + }, UnknownValue); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const returnExpression = this.getReturnExpression(recursionTracker); + if (returnExpression[0] === UNKNOWN_EXPRESSION) { + return returnExpression; + } + return recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + this.deoptimizableDependentExpressions.push(origin); + const [expression, isPure] = returnExpression[0].getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + return [expression, isPure || returnExpression[1]]; + }, UNKNOWN_RETURN_EXPRESSION); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (type === INTERACTION_CALLED) { + const { args, withNew } = interaction; + if ((withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked(path, args, this)) { + return false; + } + } + else if ((type === INTERACTION_ASSIGNED + ? context.assigned + : context.accessed).trackEntityAtPathAndGetIfTracked(path, this)) { + return false; + } + const [returnExpression, isPure] = this.getReturnExpression(); + return ((type === INTERACTION_ASSIGNED || !isPure) && + returnExpression.hasEffectsOnInteractionAtPath(path, interaction, context)); + } +} + +class CallExpression extends CallExpressionBase { + get optional() { + return isFlagSet(this.flags, 128 /* Flag.optional */); + } + set optional(value) { + this.flags = setFlag(this.flags, 128 /* Flag.optional */, value); + } + bind() { + super.bind(); + if (this.callee instanceof Identifier) { + const variable = this.scope.findVariable(this.callee.name); + if (variable.isNamespace) { + this.scope.context.log(LOGLEVEL_WARN, logCannotCallNamespace(this.callee.name), this.start); + } + if (this.callee.name === 'eval') { + this.scope.context.log(LOGLEVEL_WARN, logEval(this.scope.context.module.id), this.start); + } + } + this.interaction = { + args: [ + this.callee instanceof MemberExpression && !this.callee.variable + ? this.callee.object + : null, + ...this.arguments + ], + type: INTERACTION_CALLED, + withNew: false + }; + } + hasEffects(context) { + try { + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + if (this.annotationPure) { + return false; + } + return (this.callee.hasEffects(context) || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + finally { + if (!this.deoptimized) + this.applyDeoptimizations(); + } + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + if (includeChildrenRecursively === INCLUDE_PARAMETERS && + this.callee instanceof Identifier && + this.callee.variable) { + this.callee.variable.markCalledFromTryStatement(); + } + } + else { + this.included = true; + this.callee.include(context, false); + } + this.callee.includeCallArguments(context, this.arguments); + } + isSkippedAsOptional(origin) { + return (this.callee.isSkippedAsOptional?.(origin) || + (this.optional && + this.callee.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, origin) == null)); + } + render(code, options, { renderedSurroundingElement } = BLANK) { + this.callee.render(code, options, { + isCalleeOfRenderedParent: true, + renderedSurroundingElement + }); + renderCallArguments(code, options, this); + } + applyDeoptimizations() { + this.deoptimized = true; + this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + getReturnExpression(recursionTracker = SHARED_RECURSION_TRACKER) { + if (this.returnExpression === null) { + this.returnExpression = UNKNOWN_RETURN_EXPRESSION; + return (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, this.interaction, recursionTracker, this)); + } + return this.returnExpression; + } +} + +class CatchClause extends NodeBase { + createScope(parentScope) { + this.scope = new ParameterScope(parentScope, true); + } + parseNode(esTreeNode) { + const { body, param, type } = esTreeNode; + this.type = type; + if (param) { + this.param = new (this.scope.context.getNodeConstructor(param.type))(param, this, this.scope); + this.param.declare("parameter" /* VariableKind.parameter */, UNKNOWN_EXPRESSION); + } + this.body = new BlockStatement(body, this, this.scope.bodyScope); + super.parseNode(esTreeNode); + } +} +CatchClause.prototype.preventChildBlockScope = true; + +class ChainExpression extends NodeBase { + // deoptimizations are not relevant as we are not caching values + deoptimizeCache() { } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.expression.isSkippedAsOptional(origin)) + return undefined; + return this.expression.getLiteralValueAtPath(path, recursionTracker, origin); + } + hasEffects(context) { + if (this.expression.isSkippedAsOptional(this)) + return false; + return this.expression.hasEffects(context); + } + removeAnnotations(code) { + this.expression.removeAnnotations(code); + } +} + +class ClassBodyScope extends ChildScope { + constructor(parent, classNode) { + const { context } = parent; + super(parent, context); + this.variables.set('this', (this.thisVariable = new LocalVariable('this', null, classNode, context, "other" /* VariableKind.other */))); + this.instanceScope = new ChildScope(this, context); + this.instanceScope.variables.set('this', new ThisVariable(context)); + } + findLexicalBoundary() { + return this; + } +} + +class ClassBody extends NodeBase { + createScope(parentScope) { + this.scope = new ClassBodyScope(parentScope, this.parent); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.scope.context.includeVariableInModule(this.scope.thisVariable); + for (const definition of this.body) { + definition.include(context, includeChildrenRecursively); + } + } + parseNode(esTreeNode) { + const body = (this.body = []); + for (const definition of esTreeNode.body) { + body.push(new (this.scope.context.getNodeConstructor(definition.type))(definition, this, definition.static ? this.scope : this.scope.instanceScope)); + } + super.parseNode(esTreeNode); + } + applyDeoptimizations() { } +} + +class MethodBase extends NodeBase { + constructor() { + super(...arguments); + this.accessedValue = null; + } + get computed() { + return isFlagSet(this.flags, 1024 /* Flag.computed */); + } + set computed(value) { + this.flags = setFlag(this.flags, 1024 /* Flag.computed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (interaction.type === INTERACTION_ACCESSED && this.kind === 'get' && path.length === 0) { + return this.value.deoptimizeArgumentsOnInteractionAtPath({ + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, recursionTracker); + } + if (interaction.type === INTERACTION_ASSIGNED && this.kind === 'set' && path.length === 0) { + return this.value.deoptimizeArgumentsOnInteractionAtPath({ + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, recursionTracker); + } + this.getAccessedValue()[0].deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + // As getter properties directly receive their values from fixed function + // expressions, there is no known situation where a getter is deoptimized. + deoptimizeCache() { } + deoptimizePath(path) { + this.getAccessedValue()[0].deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getAccessedValue()[0].getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getAccessedValue()[0].getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + return this.key.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.kind === 'get' && interaction.type === INTERACTION_ACCESSED && path.length === 0) { + return this.value.hasEffectsOnInteractionAtPath(EMPTY_PATH, { + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, context); + } + // setters are only called for empty paths + if (this.kind === 'set' && interaction.type === INTERACTION_ASSIGNED) { + return this.value.hasEffectsOnInteractionAtPath(EMPTY_PATH, { + args: interaction.args, + type: INTERACTION_CALLED, + withNew: false + }, context); + } + return this.getAccessedValue()[0].hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { } + getAccessedValue() { + if (this.accessedValue === null) { + if (this.kind === 'get') { + this.accessedValue = UNKNOWN_RETURN_EXPRESSION; + return (this.accessedValue = this.value.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, SHARED_RECURSION_TRACKER, this)); + } + else { + return (this.accessedValue = [this.value, false]); + } + } + return this.accessedValue; + } +} + +class MethodDefinition extends MethodBase { + applyDeoptimizations() { } +} + +class ObjectMember extends ExpressionEntity { + constructor(object, key) { + super(); + this.object = object; + this.key = key; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.object.deoptimizeArgumentsOnInteractionAtPath(interaction, [this.key, ...path], recursionTracker); + } + deoptimizePath(path) { + this.object.deoptimizePath([this.key, ...path]); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.object.getLiteralValueAtPath([this.key, ...path], recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.object.getReturnExpressionWhenCalledAtPath([this.key, ...path], interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.object.hasEffectsOnInteractionAtPath([this.key, ...path], interaction, context); + } +} + +class ClassNode extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + createScope(parentScope) { + this.scope = new ChildScope(parentScope, parentScope.context); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + this.getObjectEntity().deoptimizeAllProperties(); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const initEffect = this.superClass?.hasEffects(context) || this.body.hasEffects(context); + this.id?.markDeclarationReached(); + return initEffect || super.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return interaction.type === INTERACTION_CALLED && path.length === 0 + ? !interaction.withNew || + (this.classConstructor === null + ? this.superClass?.hasEffectsOnInteractionAtPath(path, interaction, context) + : this.classConstructor.hasEffectsOnInteractionAtPath(path, interaction, context)) || + false + : this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + this.superClass?.include(context, includeChildrenRecursively); + this.body.include(context, includeChildrenRecursively); + if (this.id) { + this.id.markDeclarationReached(); + this.id.include(); + } + } + initialise() { + this.id?.declare("class" /* VariableKind.class */, this); + for (const method of this.body.body) { + if (method instanceof MethodDefinition && method.kind === 'constructor') { + this.classConstructor = method; + return; + } + } + this.classConstructor = null; + } + applyDeoptimizations() { + this.deoptimized = true; + for (const definition of this.body.body) { + if (!(definition.static || + (definition instanceof MethodDefinition && definition.kind === 'constructor'))) { + // Calls to methods are not tracked, ensure that the return value is deoptimized + definition.deoptimizePath(UNKNOWN_PATH); + } + } + this.scope.context.requestTreeshakingPass(); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + const staticProperties = []; + const dynamicMethods = []; + for (const definition of this.body.body) { + const properties = definition.static ? staticProperties : dynamicMethods; + const definitionKind = definition.kind; + // Note that class fields do not end up on the prototype + if (properties === dynamicMethods && !definitionKind) + continue; + const kind = definitionKind === 'set' || definitionKind === 'get' ? definitionKind : 'init'; + let key; + if (definition.computed) { + const keyValue = definition.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof keyValue === 'symbol') { + properties.push({ key: UnknownKey, kind, property: definition }); + continue; + } + else { + key = String(keyValue); + } + } + else { + key = + definition.key instanceof Identifier + ? definition.key.name + : String(definition.key.value); + } + properties.push({ key, kind, property: definition }); + } + staticProperties.unshift({ + key: 'prototype', + kind: 'init', + property: new ObjectEntity(dynamicMethods, this.superClass ? new ObjectMember(this.superClass, 'prototype') : OBJECT_PROTOTYPE) + }); + return (this.objectEntity = new ObjectEntity(staticProperties, this.superClass || OBJECT_PROTOTYPE)); + } +} + +class ClassDeclaration extends ClassNode { + initialise() { + super.initialise(); + if (this.id !== null) { + this.id.variable.isId = true; + } + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(esTreeNode.id, this, this.scope.parent); + } + super.parseNode(esTreeNode); + } + render(code, options) { + const { exportNamesByVariable, format, snippets: { _, getPropertyAccess } } = options; + if (this.id) { + const { variable, name } = this.id; + if (format === 'system' && exportNamesByVariable.has(variable)) { + code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`); + } + const renderedVariable = variable.getName(getPropertyAccess); + if (renderedVariable !== name) { + this.superClass?.render(code, options); + this.body.render(code, { + ...options, + useOriginalName: (_variable) => _variable === variable + }); + code.prependRight(this.start, `let ${renderedVariable}${_}=${_}`); + code.prependLeft(this.end, ';'); + return; + } + } + super.render(code, options); + } + applyDeoptimizations() { + super.applyDeoptimizations(); + const { id, scope } = this; + if (id) { + const { name, variable } = id; + for (const accessedVariable of scope.accessedOutsideVariables.values()) { + if (accessedVariable !== variable) { + accessedVariable.forbidName(name); + } + } + } + } +} + +class ClassExpression extends ClassNode { + render(code, options, { renderedSurroundingElement } = BLANK) { + super.render(code, options); + if (renderedSurroundingElement === ExpressionStatement$1) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } +} + +class MultiExpression extends ExpressionEntity { + constructor(expressions) { + super(); + this.expressions = expressions; + } + deoptimizePath(path) { + for (const expression of this.expressions) { + expression.deoptimizePath(path); + } + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return [ + new MultiExpression(this.expressions.map(expression => expression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0])), + false + ]; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + for (const expression of this.expressions) { + if (expression.hasEffectsOnInteractionAtPath(path, interaction, context)) + return true; + } + return false; + } +} + +class ConditionalExpression extends NodeBase { + constructor() { + super(...arguments); + this.expressionsToBeDeoptimized = []; + this.usedBranch = null; + } + get isBranchResolutionAnalysed() { + return isFlagSet(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */); + } + set isBranchResolutionAnalysed(value) { + this.flags = setFlag(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.consequent.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + this.alternate.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + if (this.usedBranch !== null) { + const unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent; + this.usedBranch = null; + unusedBranch.deoptimizePath(UNKNOWN_PATH); + const { expressionsToBeDeoptimized } = this; + this.expressionsToBeDeoptimized = EMPTY_ARRAY; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + deoptimizePath(path) { + const usedBranch = this.getUsedBranch(); + if (usedBranch) { + usedBranch.deoptimizePath(path); + } + else { + this.consequent.deoptimizePath(path); + this.alternate.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return UnknownValue; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return [ + new MultiExpression([ + this.consequent.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0], + this.alternate.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0] + ]), + false + ]; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + if (this.test.hasEffects(context)) + return true; + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return this.consequent.hasEffects(context) || this.alternate.hasEffects(context); + } + return usedBranch.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return (this.consequent.hasEffectsOnInteractionAtPath(path, interaction, context) || + this.alternate.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + this.included = true; + const usedBranch = this.getUsedBranch(); + if (includeChildrenRecursively || this.test.shouldBeIncluded(context) || usedBranch === null) { + this.test.include(context, includeChildrenRecursively); + this.consequent.include(context, includeChildrenRecursively); + this.alternate.include(context, includeChildrenRecursively); + } + else { + usedBranch.include(context, includeChildrenRecursively); + } + } + includeCallArguments(context, parameters) { + const usedBranch = this.getUsedBranch(); + if (usedBranch) { + usedBranch.includeCallArguments(context, parameters); + } + else { + this.consequent.includeCallArguments(context, parameters); + this.alternate.includeCallArguments(context, parameters); + } + } + removeAnnotations(code) { + this.test.removeAnnotations(code); + } + render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = BLANK) { + const usedBranch = this.getUsedBranch(); + if (this.test.included) { + this.test.render(code, options, { renderedSurroundingElement }); + this.consequent.render(code, options); + this.alternate.render(code, options); + } + else { + const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end); + const inclusionStart = findNonWhiteSpace(code.original, (this.consequent.included + ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end) + : colonPos) + 1); + if (preventASI) { + removeLineBreaks(code, inclusionStart, usedBranch.start); + } + code.remove(this.start, inclusionStart); + if (this.consequent.included) { + code.remove(colonPos, this.end); + } + this.test.removeAnnotations(code); + usedBranch.render(code, options, { + isCalleeOfRenderedParent, + preventASI: true, + renderedParentType: renderedParentType || this.parent.type, + renderedSurroundingElement: renderedSurroundingElement || this.parent.type + }); + } + } + getUsedBranch() { + if (this.isBranchResolutionAnalysed) { + return this.usedBranch; + } + this.isBranchResolutionAnalysed = true; + const testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + return typeof testValue === 'symbol' + ? null + : (this.usedBranch = testValue ? this.consequent : this.alternate); + } +} + +class ContinueStatement extends NodeBase { + hasEffects(context) { + if (this.label) { + if (!context.ignore.labels.has(this.label.name)) + return true; + context.includedLabels.add(this.label.name); + } + else { + if (!context.ignore.continues) + return true; + context.hasContinue = true; + } + context.brokenFlow = true; + return false; + } + include(context) { + this.included = true; + if (this.label) { + this.label.include(); + context.includedLabels.add(this.label.name); + } + else { + context.hasContinue = true; + } + context.brokenFlow = true; + } +} + +function hasLoopBodyEffects(context, body) { + const { brokenFlow, hasBreak, hasContinue, ignore } = context; + const { breaks, continues } = ignore; + ignore.breaks = true; + ignore.continues = true; + context.hasBreak = false; + context.hasContinue = false; + if (body.hasEffects(context)) + return true; + ignore.breaks = breaks; + ignore.continues = continues; + context.hasBreak = hasBreak; + context.hasContinue = hasContinue; + context.brokenFlow = brokenFlow; + return false; +} +function includeLoopBody(context, body, includeChildrenRecursively) { + const { brokenFlow, hasBreak, hasContinue } = context; + context.hasBreak = false; + context.hasContinue = false; + body.include(context, includeChildrenRecursively, { asSingleStatement: true }); + context.hasBreak = hasBreak; + context.hasContinue = hasContinue; + context.brokenFlow = brokenFlow; +} + +class DoWhileStatement extends NodeBase { + hasEffects(context) { + if (this.test.hasEffects(context)) + return true; + return hasLoopBodyEffects(context, this.body); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.test.include(context, includeChildrenRecursively); + includeLoopBody(context, this.body, includeChildrenRecursively); + } +} + +class EmptyStatement extends NodeBase { + hasEffects() { + return false; + } +} + +class ExportAllDeclaration extends NodeBase { + hasEffects() { + return false; + } + initialise() { + this.scope.context.addExport(this); + } + render(code, _options, nodeRenderOptions) { + code.remove(nodeRenderOptions.start, nodeRenderOptions.end); + } + applyDeoptimizations() { } +} +ExportAllDeclaration.prototype.needsBoundaries = true; + +class FunctionDeclaration extends FunctionNode { + initialise() { + super.initialise(); + if (this.id !== null) { + this.id.variable.isId = true; + } + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(esTreeNode.id, this, this.scope.parent); + } + super.parseNode(esTreeNode); + } +} + +// The header ends at the first non-white-space after "default" +function getDeclarationStart(code, start) { + return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7); +} +function getFunctionIdInsertPosition(code, start) { + const declarationEnd = findFirstOccurrenceOutsideComment(code, 'function', start) + 'function'.length; + code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, '(', declarationEnd)); + const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*'); + if (generatorStarPos === -1) { + return declarationEnd; + } + return declarationEnd + generatorStarPos + 1; +} +class ExportDefaultDeclaration extends NodeBase { + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + if (includeChildrenRecursively) { + this.scope.context.includeVariableInModule(this.variable); + } + } + initialise() { + const declaration = this.declaration; + this.declarationName = + (declaration.id && declaration.id.name) || this.declaration.name; + this.variable = this.scope.addExportDefaultDeclaration(this.declarationName || this.scope.context.getModuleName(), this, this.scope.context); + this.scope.context.addExport(this); + } + removeAnnotations(code) { + this.declaration.removeAnnotations(code); + } + render(code, options, nodeRenderOptions) { + const { start, end } = nodeRenderOptions; + const declarationStart = getDeclarationStart(code.original, this.start); + if (this.declaration instanceof FunctionDeclaration) { + this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null + ? getFunctionIdInsertPosition(code.original, declarationStart) + : null, options); + } + else if (this.declaration instanceof ClassDeclaration) { + this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null + ? findFirstOccurrenceOutsideComment(code.original, 'class', start) + 'class'.length + : null, options); + } + else if (this.variable.getOriginalVariable() !== this.variable) { + // Remove altogether to prevent re-declaring the same variable + treeshakeNode(this, code, start, end); + return; + } + else if (this.variable.included) { + this.renderVariableDeclaration(code, declarationStart, options); + } + else { + code.remove(this.start, declarationStart); + this.declaration.render(code, options, { + renderedSurroundingElement: ExpressionStatement$1 + }); + if (code.original[this.end - 1] !== ';') { + code.appendLeft(this.end, ';'); + } + return; + } + this.declaration.render(code, options); + } + applyDeoptimizations() { } + renderNamedDeclaration(code, declarationStart, idInsertPosition, options) { + const { exportNamesByVariable, format, snippets: { getPropertyAccess } } = options; + const name = this.variable.getName(getPropertyAccess); + // Remove `export default` + code.remove(this.start, declarationStart); + if (idInsertPosition !== null) { + code.appendLeft(idInsertPosition, ` ${name}`); + } + if (format === 'system' && + this.declaration instanceof ClassDeclaration && + exportNamesByVariable.has(this.variable)) { + code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`); + } + } + renderVariableDeclaration(code, declarationStart, { format, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) { + const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/ + const systemExportNames = format === 'system' && exportNamesByVariable.get(this.variable); + if (systemExportNames) { + code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports(${JSON.stringify(systemExportNames[0])}, `); + code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';')); + } + else { + code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = `); + if (!hasTrailingSemicolon) { + code.appendLeft(this.end, ';'); + } + } + } +} +ExportDefaultDeclaration.prototype.needsBoundaries = true; + +class ExportNamedDeclaration extends NodeBase { + bind() { + // Do not bind specifiers + this.declaration?.bind(); + } + hasEffects(context) { + return !!this.declaration?.hasEffects(context); + } + initialise() { + this.scope.context.addExport(this); + } + removeAnnotations(code) { + this.declaration?.removeAnnotations(code); + } + render(code, options, nodeRenderOptions) { + const { start, end } = nodeRenderOptions; + if (this.declaration === null) { + code.remove(start, end); + } + else { + code.remove(this.start, this.declaration.start); + this.declaration.render(code, options, { end, start }); + } + } + applyDeoptimizations() { } +} +ExportNamedDeclaration.prototype.needsBoundaries = true; + +class ExportSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +class ForInStatement extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + if (left.hasEffectsAsAssignmentTarget(context, false) || right.hasEffects(context)) + return true; + return hasLoopBodyEffects(context, body); + } + include(context, includeChildrenRecursively) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); + right.include(context, includeChildrenRecursively); + includeLoopBody(context, body, includeChildrenRecursively); + } + initialise() { + this.left.setAssignedValue(UNKNOWN_EXPRESSION); + } + render(code, options) { + this.left.render(code, options, NO_SEMICOLON); + this.right.render(code, options, NO_SEMICOLON); + // handle no space between "in" and the right side + if (code.original.charCodeAt(this.right.start - 1) === 110 /* n */) { + code.prependLeft(this.right.start, ' '); + } + this.body.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class ForOfStatement extends NodeBase { + get await() { + return isFlagSet(this.flags, 131072 /* Flag.await */); + } + set await(value) { + this.flags = setFlag(this.flags, 131072 /* Flag.await */, value); + } + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + // Placeholder until proper Symbol.Iterator support + return true; + } + include(context, includeChildrenRecursively) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); + right.include(context, includeChildrenRecursively); + includeLoopBody(context, body, includeChildrenRecursively); + } + initialise() { + this.left.setAssignedValue(UNKNOWN_EXPRESSION); + } + render(code, options) { + this.left.render(code, options, NO_SEMICOLON); + this.right.render(code, options, NO_SEMICOLON); + // handle no space between "of" and the right side + if (code.original.charCodeAt(this.right.start - 1) === 102 /* f */) { + code.prependLeft(this.right.start, ' '); + } + this.body.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.scope.context.requestTreeshakingPass(); + } +} + +class ForStatement extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + if (this.init?.hasEffects(context) || + this.test?.hasEffects(context) || + this.update?.hasEffects(context)) { + return true; + } + return hasLoopBodyEffects(context, this.body); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.init?.include(context, includeChildrenRecursively, { asSingleStatement: true }); + this.test?.include(context, includeChildrenRecursively); + this.update?.include(context, includeChildrenRecursively); + includeLoopBody(context, this.body, includeChildrenRecursively); + } + render(code, options) { + this.init?.render(code, options, NO_SEMICOLON); + this.test?.render(code, options, NO_SEMICOLON); + this.update?.render(code, options, NO_SEMICOLON); + this.body.render(code, options); + } +} + +class FunctionExpression extends FunctionNode { + createScope(parentScope) { + super.createScope((this.idScope = new ChildScope(parentScope, parentScope.context))); + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(esTreeNode.id, this, this.idScope); + } + super.parseNode(esTreeNode); + } + render(code, options, { renderedSurroundingElement } = BLANK) { + super.render(code, options); + if (renderedSurroundingElement === ExpressionStatement$1) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } +} + +class TrackingScope extends BlockScope { + constructor() { + super(...arguments); + this.hoistedDeclarations = []; + } + addDeclaration(identifier, context, init, kind) { + this.hoistedDeclarations.push(identifier); + return super.addDeclaration(identifier, context, init, kind); + } +} + +const unset = Symbol('unset'); +class IfStatement extends NodeBase { + constructor() { + super(...arguments); + this.testValue = unset; + } + deoptimizeCache() { + this.testValue = UnknownValue; + } + hasEffects(context) { + if (this.test.hasEffects(context)) { + return true; + } + const testValue = this.getTestValue(); + if (typeof testValue === 'symbol') { + const { brokenFlow } = context; + if (this.consequent.hasEffects(context)) + return true; + const consequentBrokenFlow = context.brokenFlow; + context.brokenFlow = brokenFlow; + if (this.alternate === null) + return false; + if (this.alternate.hasEffects(context)) + return true; + context.brokenFlow = context.brokenFlow && consequentBrokenFlow; + return false; + } + return testValue ? this.consequent.hasEffects(context) : !!this.alternate?.hasEffects(context); + } + include(context, includeChildrenRecursively) { + this.included = true; + if (includeChildrenRecursively) { + this.includeRecursively(includeChildrenRecursively, context); + } + else { + const testValue = this.getTestValue(); + if (typeof testValue === 'symbol') { + this.includeUnknownTest(context); + } + else { + this.includeKnownTest(context, testValue); + } + } + } + parseNode(esTreeNode) { + this.consequentScope = new TrackingScope(this.scope); + this.consequent = new (this.scope.context.getNodeConstructor(esTreeNode.consequent.type))(esTreeNode.consequent, this, this.consequentScope); + if (esTreeNode.alternate) { + this.alternateScope = new TrackingScope(this.scope); + this.alternate = new (this.scope.context.getNodeConstructor(esTreeNode.alternate.type))(esTreeNode.alternate, this, this.alternateScope); + } + super.parseNode(esTreeNode); + } + render(code, options) { + const { snippets: { getPropertyAccess } } = options; + // Note that unknown test values are always included + const testValue = this.getTestValue(); + const hoistedDeclarations = []; + const includesIfElse = this.test.included; + const noTreeshake = !this.scope.context.options.treeshake; + if (includesIfElse) { + this.test.render(code, options); + } + else { + code.remove(this.start, this.consequent.start); + } + if (this.consequent.included && (noTreeshake || typeof testValue === 'symbol' || testValue)) { + this.consequent.render(code, options); + } + else { + code.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : ''); + hoistedDeclarations.push(...this.consequentScope.hoistedDeclarations); + } + if (this.alternate) { + if (this.alternate.included && (noTreeshake || typeof testValue === 'symbol' || !testValue)) { + if (includesIfElse) { + if (code.original.charCodeAt(this.alternate.start - 1) === 101) { + code.prependLeft(this.alternate.start, ' '); + } + } + else { + code.remove(this.consequent.end, this.alternate.start); + } + this.alternate.render(code, options); + } + else { + if (includesIfElse && this.shouldKeepAlternateBranch()) { + code.overwrite(this.alternate.start, this.end, ';'); + } + else { + code.remove(this.consequent.end, this.end); + } + hoistedDeclarations.push(...this.alternateScope.hoistedDeclarations); + } + } + this.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess); + } + applyDeoptimizations() { } + getTestValue() { + if (this.testValue === unset) { + return (this.testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this)); + } + return this.testValue; + } + includeKnownTest(context, testValue) { + if (this.test.shouldBeIncluded(context)) { + this.test.include(context, false); + } + if (testValue && this.consequent.shouldBeIncluded(context)) { + this.consequent.include(context, false, { asSingleStatement: true }); + } + if (!testValue && this.alternate?.shouldBeIncluded(context)) { + this.alternate.include(context, false, { asSingleStatement: true }); + } + } + includeRecursively(includeChildrenRecursively, context) { + this.test.include(context, includeChildrenRecursively); + this.consequent.include(context, includeChildrenRecursively); + this.alternate?.include(context, includeChildrenRecursively); + } + includeUnknownTest(context) { + this.test.include(context, false); + const { brokenFlow } = context; + let consequentBrokenFlow = false; + if (this.consequent.shouldBeIncluded(context)) { + this.consequent.include(context, false, { asSingleStatement: true }); + consequentBrokenFlow = context.brokenFlow; + context.brokenFlow = brokenFlow; + } + if (this.alternate?.shouldBeIncluded(context)) { + this.alternate.include(context, false, { asSingleStatement: true }); + context.brokenFlow = context.brokenFlow && consequentBrokenFlow; + } + } + renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess) { + const hoistedVariables = [ + ...new Set(hoistedDeclarations.map(identifier => { + const variable = identifier.variable; + return variable.included ? variable.getName(getPropertyAccess) : ''; + })) + ] + .filter(Boolean) + .join(', '); + if (hoistedVariables) { + const parentType = this.parent.type; + const needsBraces = parentType !== Program$1 && parentType !== BlockStatement$1; + code.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVariables}; `); + if (needsBraces) { + code.appendLeft(this.end, ` }`); + } + } + } + shouldKeepAlternateBranch() { + let currentParent = this.parent; + do { + if (currentParent instanceof IfStatement && currentParent.alternate) { + return true; + } + if (currentParent instanceof BlockStatement) { + return false; + } + currentParent = currentParent.parent; + } while (currentParent); + return false; + } +} + +class ImportAttribute extends NodeBase { +} + +class ImportDeclaration extends NodeBase { + // Do not bind specifiers or attributes + bind() { } + hasEffects() { + return false; + } + initialise() { + this.scope.context.addImport(this); + } + render(code, _options, nodeRenderOptions) { + code.remove(nodeRenderOptions.start, nodeRenderOptions.end); + } + applyDeoptimizations() { } +} +ImportDeclaration.prototype.needsBoundaries = true; + +class ImportDefaultSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +const INTEROP_DEFAULT_VARIABLE = '_interopDefault'; +const INTEROP_DEFAULT_COMPAT_VARIABLE = '_interopDefaultCompat'; +const INTEROP_NAMESPACE_VARIABLE = '_interopNamespace'; +const INTEROP_NAMESPACE_COMPAT_VARIABLE = '_interopNamespaceCompat'; +const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault'; +const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly'; +const MERGE_NAMESPACES_VARIABLE = '_mergeNamespaces'; +const DOCUMENT_CURRENT_SCRIPT = '_documentCurrentScript'; +const defaultInteropHelpersByInteropType = { + auto: INTEROP_DEFAULT_VARIABLE, + compat: INTEROP_DEFAULT_COMPAT_VARIABLE, + default: null, + defaultOnly: null, + esModule: null +}; +const isDefaultAProperty = (interopType, externalLiveBindings) => interopType === 'esModule' || + (externalLiveBindings && (interopType === 'auto' || interopType === 'compat')); +const namespaceInteropHelpersByInteropType = { + auto: INTEROP_NAMESPACE_VARIABLE, + compat: INTEROP_NAMESPACE_COMPAT_VARIABLE, + default: INTEROP_NAMESPACE_DEFAULT_VARIABLE, + defaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, + esModule: null +}; +const canDefaultBeTakenFromNamespace = (interopType, externalLiveBindings) => interopType !== 'esModule' && isDefaultAProperty(interopType, externalLiveBindings); +const getHelpersBlock = (additionalHelpers, accessedGlobals, indent, snippets, liveBindings, freeze, symbols) => { + const usedHelpers = new Set(additionalHelpers); + for (const variable of HELPER_NAMES) { + if (accessedGlobals.has(variable)) { + usedHelpers.add(variable); + } + } + return HELPER_NAMES.map(variable => usedHelpers.has(variable) + ? HELPER_GENERATORS[variable](indent, snippets, liveBindings, freeze, symbols, usedHelpers) + : '').join(''); +}; +const HELPER_GENERATORS = { + [DOCUMENT_CURRENT_SCRIPT](_t, { _, n }) { + return `var${_}${DOCUMENT_CURRENT_SCRIPT}${_}=${_}typeof${_}document${_}!==${_}'undefined'${_}?${_}document.currentScript${_}:${_}null;${n}`; + }, + [INTEROP_DEFAULT_COMPAT_VARIABLE](_t, snippets, liveBindings) { + const { _, getDirectReturnFunction, n } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_DEFAULT_COMPAT_VARIABLE + }); + return (`${left}${getIsCompatNamespace(snippets)}${_}?${_}` + + `${liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)}${right}${n}${n}`); + }, + [INTEROP_DEFAULT_VARIABLE](_t, snippets, liveBindings) { + const { _, getDirectReturnFunction, n } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_DEFAULT_VARIABLE + }); + return (`${left}e${_}&&${_}e.__esModule${_}?${_}` + + `${liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)}${right}${n}${n}`); + }, + [INTEROP_NAMESPACE_COMPAT_VARIABLE](t, snippets, liveBindings, freeze, symbols, usedHelpers) { + const { _, getDirectReturnFunction, n } = snippets; + if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_COMPAT_VARIABLE + }); + return `${left}${getIsCompatNamespace(snippets)}${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`; + } + return (`function ${INTEROP_NAMESPACE_COMPAT_VARIABLE}(e)${_}{${n}` + + `${t}if${_}(${getIsCompatNamespace(snippets)})${_}return e;${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + + `}${n}${n}`); + }, + [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE](_t, snippets, _liveBindings, freeze, symbols) { + const { getDirectReturnFunction, getObject, n, _ } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE + }); + return `${left}${getFrozen(freeze, getWithToStringTag(symbols, getObject([ + [null, `__proto__:${_}null`], + ['default', 'e'] + ], { lineBreakIndent: null }), snippets))}${right}${n}${n}`; + }, + [INTEROP_NAMESPACE_DEFAULT_VARIABLE](t, snippets, liveBindings, freeze, symbols) { + const { _, n } = snippets; + return (`function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + + `}${n}${n}`); + }, + [INTEROP_NAMESPACE_VARIABLE](t, snippets, liveBindings, freeze, symbols, usedHelpers) { + const { _, getDirectReturnFunction, n } = snippets; + if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_VARIABLE + }); + return `${left}e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`; + } + return (`function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` + + `${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + + `}${n}${n}`); + }, + [MERGE_NAMESPACES_VARIABLE](t, snippets, liveBindings, freeze, symbols) { + const { _, cnst, n } = snippets; + const useForEach = cnst === 'var' && liveBindings; + return (`function ${MERGE_NAMESPACES_VARIABLE}(n, m)${_}{${n}` + + `${t}${loopOverNamespaces(`{${n}` + + `${t}${t}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!(k in n))${_}{${n}` + + (liveBindings + ? useForEach + ? copyOwnPropertyLiveBinding + : copyPropertyLiveBinding + : copyPropertyStatic)(t, t + t + t + t, snippets) + + `${t}${t}${t}}${n}` + + `${t}${t}}`, useForEach, t, snippets)}${n}` + + `${t}return ${getFrozen(freeze, getWithToStringTag(symbols, 'n', snippets))};${n}` + + `}${n}${n}`); + } +}; +const getDefaultLiveBinding = ({ _, getObject }) => `e${_}:${_}${getObject([['default', 'e']], { lineBreakIndent: null })}`; +const getDefaultStatic = ({ _, getPropertyAccess }) => `e${getPropertyAccess('default')}${_}:${_}e`; +const getIsCompatNamespace = ({ _ }) => `e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e`; +const createNamespaceObject = (t, index, snippets, liveBindings, freeze, symbols) => { + const { _, cnst, getObject, getPropertyAccess, n, s } = snippets; + const copyProperty = `{${n}` + + (liveBindings ? copyNonDefaultOwnPropertyLiveBinding : copyPropertyStatic)(t, index + t + t, snippets) + + `${index}${t}}`; + return (`${index}${cnst} n${_}=${_}Object.create(null${symbols ? `,${_}{${_}[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}${_}}` : ''});${n}` + + `${index}if${_}(e)${_}{${n}` + + `${index}${t}${loopOverKeys(copyProperty, !liveBindings, snippets)}${n}` + + `${index}}${n}` + + `${index}n${getPropertyAccess('default')}${_}=${_}e;${n}` + + `${index}return ${getFrozen(freeze, 'n')}${s}${n}`); +}; +const loopOverKeys = (body, allowVariableLoopVariable, { _, cnst, getFunctionIntro, s }) => cnst !== 'var' || allowVariableLoopVariable + ? `for${_}(${cnst} k in e)${_}${body}` + : `Object.keys(e).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${body})${s}`; +const loopOverNamespaces = (body, useForEach, t, { _, cnst, getDirectReturnFunction, getFunctionIntro, n }) => { + if (useForEach) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: false, + lineBreakIndent: { base: t, t }, + name: null + }); + return (`m.forEach(${left}` + + `e${_}&&${_}typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e)${_}&&${_}Object.keys(e).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${body})${right});`); + } + return (`for${_}(var i${_}=${_}0;${_}i${_}<${_}m.length;${_}i++)${_}{${n}` + + `${t}${t}${cnst} e${_}=${_}m[i];${n}` + + `${t}${t}if${_}(typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e))${_}{${_}for${_}(${cnst} k in e)${_}${body}${_}}${n}${t}}`); +}; +const copyNonDefaultOwnPropertyLiveBinding = (t, index, snippets) => { + const { _, n } = snippets; + return (`${index}if${_}(k${_}!==${_}'default')${_}{${n}` + + copyOwnPropertyLiveBinding(t, index + t, snippets) + + `${index}}${n}`); +}; +const copyOwnPropertyLiveBinding = (t, index, { _, cnst, getDirectReturnFunction, n }) => { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`${index}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + + `${index}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + + `${index}${t}enumerable:${_}true,${n}` + + `${index}${t}get:${_}${left}e[k]${right}${n}` + + `${index}});${n}`); +}; +const copyPropertyLiveBinding = (t, index, { _, cnst, getDirectReturnFunction, n }) => { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`${index}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + + `${index}if${_}(d)${_}{${n}` + + `${index}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + + `${index}${t}${t}enumerable:${_}true,${n}` + + `${index}${t}${t}get:${_}${left}e[k]${right}${n}` + + `${index}${t}});${n}` + + `${index}}${n}`); +}; +const copyPropertyStatic = (_t, index, { _, n }) => `${index}n[k]${_}=${_}e[k];${n}`; +const getFrozen = (freeze, fragment) => freeze ? `Object.freeze(${fragment})` : fragment; +const getWithToStringTag = (symbols, fragment, { _, getObject }) => symbols + ? `Object.defineProperty(${fragment},${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)})` + : fragment; +const HELPER_NAMES = Object.keys(HELPER_GENERATORS); +function getToStringTagValue(getObject) { + return getObject([['value', "'Module'"]], { + lineBreakIndent: null + }); +} + +function isReassignedExportsMember(variable, exportNamesByVariable) { + return (variable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned); +} + +class VariableDeclarator extends NodeBase { + declareDeclarator(kind) { + this.id.declare(kind, this.init || UNDEFINED_EXPRESSION); + } + deoptimizePath(path) { + this.id.deoptimizePath(path); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const initEffect = this.init?.hasEffects(context); + this.id.markDeclarationReached(); + return initEffect || this.id.hasEffects(context); + } + include(context, includeChildrenRecursively) { + const { deoptimized, id, init } = this; + if (!deoptimized) + this.applyDeoptimizations(); + this.included = true; + init?.include(context, includeChildrenRecursively); + id.markDeclarationReached(); + if (includeChildrenRecursively || id.shouldBeIncluded(context)) { + id.include(context, includeChildrenRecursively); + } + } + removeAnnotations(code) { + this.init?.removeAnnotations(code); + } + render(code, options) { + const { exportNamesByVariable, snippets: { _, getPropertyAccess } } = options; + const { end, id, init, start } = this; + const renderId = id.included; + if (renderId) { + id.render(code, options); + } + else { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', id.end); + code.remove(start, findNonWhiteSpace(code.original, operatorPos + 1)); + } + if (init) { + if (id instanceof Identifier && init instanceof ClassExpression && !init.id) { + const renderedVariable = id.variable.getName(getPropertyAccess); + if (renderedVariable !== id.name) { + code.appendLeft(init.start + 5, ` ${id.name}`); + } + } + init.render(code, options, renderId ? BLANK : { renderedSurroundingElement: ExpressionStatement$1 }); + } + else if (id instanceof Identifier && + isReassignedExportsMember(id.variable, exportNamesByVariable)) { + code.appendLeft(end, `${_}=${_}void 0`); + } + } + applyDeoptimizations() { + this.deoptimized = true; + const { id, init } = this; + if (init && id instanceof Identifier && init instanceof ClassExpression && !init.id) { + const { name, variable } = id; + for (const accessedVariable of init.scope.accessedOutsideVariables.values()) { + if (accessedVariable !== variable) { + accessedVariable.forbidName(name); + } + } + } + } +} + +class ImportExpression extends NodeBase { + constructor() { + super(...arguments); + this.inlineNamespace = null; + this.attributes = null; + this.mechanism = null; + this.namespaceExportName = undefined; + this.resolution = null; + this.resolutionString = null; + } + // Do not bind attributes + bind() { + this.source.bind(); + } + /** + * Get imported variables for deterministic usage, valid cases are: + * + * - `const { foo } = await import('bar')`. + * - `(await import('bar')).foo` + * - `import('bar').then(({ foo }) => {})` + * + * Returns empty array if it's side-effect only import. + * Returns undefined if it's not fully deterministic. + */ + getDeterministicImportedNames() { + const parent1 = this.parent; + // Side-effect only: import('bar') + if (parent1 instanceof ExpressionStatement) { + return EMPTY_ARRAY; + } + if (parent1 instanceof AwaitExpression) { + const parent2 = parent1.parent; + // Side-effect only: await import('bar') + if (parent2 instanceof ExpressionStatement) { + return EMPTY_ARRAY; + } + // Case 1: const { foo } = await import('bar') + if (parent2 instanceof VariableDeclarator) { + const declaration = parent2.id; + return declaration instanceof ObjectPattern + ? getDeterministicObjectDestructure(declaration) + : undefined; + } + // Case 2: (await import('bar')).foo + if (parent2 instanceof MemberExpression) { + const id = parent2.property; + if (!parent2.computed && id instanceof Identifier) { + return [id.name]; + } + } + return; + } + // Case 3: import('bar').then(({ foo }) => {}) + if (parent1 instanceof MemberExpression) { + const callExpression = parent1.parent; + const property = parent1.property; + if (!(callExpression instanceof CallExpression) || !(property instanceof Identifier)) { + return; + } + const memberName = property.name; + // side-effect only, when only chaining .catch or .finally + if (callExpression.parent instanceof ExpressionStatement && + ['catch', 'finally'].includes(memberName)) { + return EMPTY_ARRAY; + } + if (memberName !== 'then') + return; + // Side-effect only: import('bar').then() + if (callExpression.arguments.length === 0) { + return EMPTY_ARRAY; + } + const argument = callExpression.arguments[0]; + if (callExpression.arguments.length !== 1 || + !(argument instanceof ArrowFunctionExpression || argument instanceof FunctionExpression)) { + return; + } + // Side-effect only: import('bar').then(() => {}) + if (argument.params.length === 0) { + return EMPTY_ARRAY; + } + const declaration = argument.params[0]; + if (argument.params.length === 1 && declaration instanceof ObjectPattern) { + return getDeterministicObjectDestructure(declaration); + } + return; + } + } + hasEffects() { + return true; + } + include(context, includeChildrenRecursively) { + if (!this.included) { + this.included = true; + this.scope.context.includeDynamicImport(this); + this.scope.addAccessedDynamicImport(this); + } + this.source.include(context, includeChildrenRecursively); + } + initialise() { + this.scope.context.addDynamicImport(this); + } + parseNode(esTreeNode) { + // Keep the source AST to be used by renderDynamicImport + super.parseNode(esTreeNode, ['source']); + } + render(code, options) { + const { snippets: { _, getDirectReturnFunction, getObject, getPropertyAccess } } = options; + if (this.inlineNamespace) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + code.overwrite(this.start, this.end, `Promise.resolve().then(${left}${this.inlineNamespace.getName(getPropertyAccess)}${right})`); + return; + } + if (this.mechanism) { + code.overwrite(this.start, findFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1, this.mechanism.left); + code.overwrite(this.end - 1, this.end, this.mechanism.right); + } + if (this.resolutionString) { + code.overwrite(this.source.start, this.source.end, this.resolutionString); + if (this.namespaceExportName) { + const [left, right] = getDirectReturnFunction(['n'], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + code.prependLeft(this.end, `.then(${left}n.${this.namespaceExportName}${right})`); + } + } + else { + this.source.render(code, options); + } + if (this.attributes !== true) { + if (this.options) { + code.overwrite(this.source.end, this.end - 1, '', { contentOnly: true }); + } + if (this.attributes) { + code.appendLeft(this.end - 1, `,${_}${getObject([['assert', this.attributes]], { + lineBreakIndent: null + })}`); + } + } + } + setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, namespaceExportName, attributes) { + const { format } = options; + this.inlineNamespace = null; + this.resolution = resolution; + this.resolutionString = resolutionString; + this.namespaceExportName = namespaceExportName; + this.attributes = attributes; + const accessedGlobals = [...(accessedImportGlobals[format] || [])]; + let helper; + ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver)); + if (helper) { + accessedGlobals.push(helper); + } + if (accessedGlobals.length > 0) { + this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); + } + } + setInternalResolution(inlineNamespace) { + this.inlineNamespace = inlineNamespace; + } + applyDeoptimizations() { } + getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) { + const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [ + { + customResolution: typeof this.resolution === 'string' ? this.resolution : null, + format, + moduleId: this.scope.context.module.id, + targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null + } + ]); + if (mechanism) { + return { helper: null, mechanism }; + } + const hasDynamicTarget = !this.resolution || typeof this.resolution === 'string'; + switch (format) { + case 'cjs': { + if (dynamicImportInCjs && + (!resolution || typeof resolution === 'string' || resolution instanceof ExternalModule)) { + return { helper: null, mechanism: null }; + } + const helper = getInteropHelper(resolution, exportMode, interop); + let left = `require(`; + let right = `)`; + if (helper) { + left = `/*#__PURE__*/${helper}(${left}`; + right += ')'; + } + const [functionLeft, functionRight] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + left = `Promise.resolve().then(${functionLeft}${left}`; + right += `${functionRight})`; + if (!arrowFunctions && hasDynamicTarget) { + left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { + needsArrowReturnParens: false, + needsWrappedFunction: true + }); + right = ')'; + } + return { + helper, + mechanism: { left, right } + }; + } + case 'amd': { + const resolve = compact ? 'c' : 'resolve'; + const reject = compact ? 'e' : 'reject'; + const helper = getInteropHelper(resolution, exportMode, interop); + const [resolveLeft, resolveRight] = getDirectReturnFunction(['m'], { + functionReturn: false, + lineBreakIndent: null, + name: null + }); + const resolveNamespace = helper + ? `${resolveLeft}${resolve}(/*#__PURE__*/${helper}(m))${resolveRight}` + : resolve; + const [handlerLeft, handlerRight] = getDirectReturnFunction([resolve, reject], { + functionReturn: false, + lineBreakIndent: null, + name: null + }); + let left = `new Promise(${handlerLeft}require([`; + let right = `],${_}${resolveNamespace},${_}${reject})${handlerRight})`; + if (!arrowFunctions && hasDynamicTarget) { + left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { + needsArrowReturnParens: false, + needsWrappedFunction: true + }); + right = ')'; + } + return { + helper, + mechanism: { left, right } + }; + } + case 'system': { + return { + helper: null, + mechanism: { + left: 'module.import(', + right: ')' + } + }; + } + } + return { helper: null, mechanism: null }; + } +} +function getInteropHelper(resolution, exportMode, interop) { + return exportMode === 'external' + ? namespaceInteropHelpersByInteropType[interop(resolution instanceof ExternalModule ? resolution.id : null)] + : exportMode === 'default' + ? INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE + : null; +} +const accessedImportGlobals = { + amd: ['require'], + cjs: ['require'], + system: ['module'] +}; +function getDeterministicObjectDestructure(objectPattern) { + const variables = []; + for (const property of objectPattern.properties) { + if (property.type === 'RestElement' || property.computed || property.key.type !== 'Identifier') + return; + variables.push(property.key.name); + } + return variables; +} + +class ImportNamespaceSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +class ImportSpecifier extends NodeBase { + applyDeoptimizations() { } +} + +class LabeledStatement extends NodeBase { + hasEffects(context) { + const { brokenFlow, includedLabels } = context; + context.ignore.labels.add(this.label.name); + context.includedLabels = new Set(); + let bodyHasEffects = false; + if (this.body.hasEffects(context)) { + bodyHasEffects = true; + } + else { + context.ignore.labels.delete(this.label.name); + if (context.includedLabels.has(this.label.name)) { + context.includedLabels.delete(this.label.name); + context.brokenFlow = brokenFlow; + } + } + context.includedLabels = new Set([...includedLabels, ...context.includedLabels]); + return bodyHasEffects; + } + include(context, includeChildrenRecursively) { + this.included = true; + const { brokenFlow, includedLabels } = context; + context.includedLabels = new Set(); + this.body.include(context, includeChildrenRecursively); + if (includeChildrenRecursively || context.includedLabels.has(this.label.name)) { + this.label.include(); + context.includedLabels.delete(this.label.name); + context.brokenFlow = brokenFlow; + } + context.includedLabels = new Set([...includedLabels, ...context.includedLabels]); + } + render(code, options) { + if (this.label.included) { + this.label.render(code, options); + } + else { + code.remove(this.start, findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1)); + } + this.body.render(code, options); + } +} + +class LogicalExpression extends NodeBase { + constructor() { + super(...arguments); + // We collect deoptimization information if usedBranch !== null + this.expressionsToBeDeoptimized = []; + this.usedBranch = null; + } + //private isBranchResolutionAnalysed = false; + get isBranchResolutionAnalysed() { + return isFlagSet(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */); + } + set isBranchResolutionAnalysed(value) { + this.flags = setFlag(this.flags, 65536 /* Flag.isBranchResolutionAnalysed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.left.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + this.right.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + if (this.usedBranch) { + const unusedBranch = this.usedBranch === this.left ? this.right : this.left; + this.usedBranch = null; + unusedBranch.deoptimizePath(UNKNOWN_PATH); + const { scope: { context }, expressionsToBeDeoptimized } = this; + this.expressionsToBeDeoptimized = EMPTY_ARRAY; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + // Request another pass because we need to ensure "include" runs again if + // it is rendered + context.requestTreeshakingPass(); + } + } + deoptimizePath(path) { + const usedBranch = this.getUsedBranch(); + if (usedBranch) { + usedBranch.deoptimizePath(path); + } + else { + this.left.deoptimizePath(path); + this.right.deoptimizePath(path); + } + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return UnknownValue; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) + return [ + new MultiExpression([ + this.left.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0], + this.right.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)[0] + ]), + false + ]; + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + if (this.left.hasEffects(context)) { + return true; + } + if (this.getUsedBranch() !== this.left) { + return this.right.hasEffects(context); + } + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return (this.left.hasEffectsOnInteractionAtPath(path, interaction, context) || + this.right.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + this.included = true; + const usedBranch = this.getUsedBranch(); + if (includeChildrenRecursively || + (usedBranch === this.right && this.left.shouldBeIncluded(context)) || + !usedBranch) { + this.left.include(context, includeChildrenRecursively); + this.right.include(context, includeChildrenRecursively); + } + else { + usedBranch.include(context, includeChildrenRecursively); + } + } + removeAnnotations(code) { + this.left.removeAnnotations(code); + } + render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = BLANK) { + if (!this.left.included || !this.right.included) { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end); + if (this.right.included) { + const removePos = findNonWhiteSpace(code.original, operatorPos + 2); + code.remove(this.start, removePos); + if (preventASI) { + removeLineBreaks(code, removePos, this.right.start); + } + this.left.removeAnnotations(code); + } + else { + code.remove(operatorPos, this.end); + } + this.getUsedBranch().render(code, options, { + isCalleeOfRenderedParent, + preventASI, + renderedParentType: renderedParentType || this.parent.type, + renderedSurroundingElement: renderedSurroundingElement || this.parent.type + }); + } + else { + this.left.render(code, options, { + preventASI, + renderedSurroundingElement + }); + this.right.render(code, options); + } + } + getUsedBranch() { + if (!this.isBranchResolutionAnalysed) { + this.isBranchResolutionAnalysed = true; + const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof leftValue === 'symbol') { + return null; + } + else { + this.usedBranch = + (this.operator === '||' && leftValue) || + (this.operator === '&&' && !leftValue) || + (this.operator === '??' && leftValue != null) + ? this.left + : this.right; + } + } + return this.usedBranch; + } +} + +const FILE_PREFIX = 'ROLLUP_FILE_URL_'; +const IMPORT = 'import'; +class MetaProperty extends NodeBase { + constructor() { + super(...arguments); + this.metaProperty = null; + this.preliminaryChunkId = null; + this.referenceId = null; + } + getReferencedFileName(outputPluginDriver) { + const { meta: { name }, metaProperty } = this; + if (name === IMPORT && metaProperty?.startsWith(FILE_PREFIX)) { + return outputPluginDriver.getFileName(metaProperty.slice(FILE_PREFIX.length)); + } + return null; + } + hasEffects() { + return false; + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type !== INTERACTION_ACCESSED; + } + include() { + if (!this.included) { + this.included = true; + if (this.meta.name === IMPORT) { + this.scope.context.addImportMeta(this); + const parent = this.parent; + const metaProperty = (this.metaProperty = + parent instanceof MemberExpression && typeof parent.propertyKey === 'string' + ? parent.propertyKey + : null); + if (metaProperty?.startsWith(FILE_PREFIX)) { + this.referenceId = metaProperty.slice(FILE_PREFIX.length); + } + } + } + } + render(code, renderOptions) { + const { format, pluginDriver, snippets } = renderOptions; + const { scope: { context: { module } }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this; + const { id: moduleId } = module; + if (name !== IMPORT) + return; + const chunkId = preliminaryChunkId; + if (referenceId) { + const fileName = pluginDriver.getFileName(referenceId); + const relativePath = normalize(relative(dirname(chunkId), fileName)); + const replacement = pluginDriver.hookFirstSync('resolveFileUrl', [ + { chunkId, fileName, format, moduleId, referenceId, relativePath } + ]) || relativeUrlMechanisms[format](relativePath); + code.overwrite(parent.start, parent.end, replacement, { contentOnly: true }); + return; + } + let replacement = pluginDriver.hookFirstSync('resolveImportMeta', [ + metaProperty, + { chunkId, format, moduleId } + ]); + if (!replacement) { + replacement = importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets }); + renderOptions.accessedDocumentCurrentScript ||= + formatsMaybeAccessDocumentCurrentScript.includes(format) && replacement !== 'undefined'; + } + if (typeof replacement === 'string') { + if (parent instanceof MemberExpression) { + code.overwrite(parent.start, parent.end, replacement, { contentOnly: true }); + } + else { + code.overwrite(start, end, replacement, { contentOnly: true }); + } + } + } + setResolution(format, accessedGlobalsByScope, preliminaryChunkId) { + this.preliminaryChunkId = preliminaryChunkId; + const accessedGlobals = (this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals)[format]; + if (accessedGlobals.length > 0) { + this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); + } + } +} +const formatsMaybeAccessDocumentCurrentScript = ['cjs', 'iife', 'umd']; +const accessedMetaUrlGlobals = { + amd: ['document', 'module', 'URL'], + cjs: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT], + es: [], + iife: ['document', 'URL', DOCUMENT_CURRENT_SCRIPT], + system: ['module'], + umd: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT] +}; +const accessedFileUrlGlobals = { + amd: ['document', 'require', 'URL'], + cjs: ['document', 'require', 'URL'], + es: [], + iife: ['document', 'URL'], + system: ['module', 'URL'], + umd: ['document', 'require', 'URL'] +}; +const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`; +const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${escapeId(relativePath)}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.src || document.baseURI`); +const getGenericImportMetaMechanism = (getUrl) => (property, { chunkId }) => { + const urlMechanism = getUrl(chunkId); + return property === null + ? `({ url: ${urlMechanism} })` + : property === 'url' + ? urlMechanism + : 'undefined'; +}; +const getFileUrlFromFullPath = (path) => `require('u' + 'rl').pathToFileURL(${path}).href`; +const getFileUrlFromRelativePath = (path) => getFileUrlFromFullPath(`__dirname + '/${path}'`); +const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(chunkId)}', document.baseURI).href)`; +const relativeUrlMechanisms = { + amd: relativePath => { + if (relativePath[0] !== '.') + relativePath = './' + relativePath; + return getResolveUrl(`require.toUrl('${relativePath}'), document.baseURI`); + }, + cjs: relativePath => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath)})`, + es: relativePath => getResolveUrl(`'${relativePath}', import.meta.url`), + iife: relativePath => getRelativeUrlFromDocument(relativePath), + system: relativePath => getResolveUrl(`'${relativePath}', module.meta.url`), + umd: relativePath => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath, true)})` +}; +const importMetaMechanisms = { + amd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)), + cjs: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getFileUrlFromFullPath('__filename')} : ${getUrlFromDocument(chunkId)})`), + iife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)), + system: (property, { snippets: { getPropertyAccess } }) => property === null ? `module.meta` : `module.meta${getPropertyAccess(property)}`, + umd: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromFullPath('__filename')} : ${getUrlFromDocument(chunkId, true)})`) +}; + +class NewExpression extends NodeBase { + hasEffects(context) { + try { + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + if (this.annotationPure) { + return false; + } + return (this.callee.hasEffects(context) || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + finally { + if (!this.deoptimized) + this.applyDeoptimizations(); + } + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 0 || type !== INTERACTION_ACCESSED; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + } + else { + this.included = true; + this.callee.include(context, false); + } + this.callee.includeCallArguments(context, this.arguments); + } + initialise() { + this.interaction = { + args: [null, ...this.arguments], + type: INTERACTION_CALLED, + withNew: true + }; + } + render(code, options) { + this.callee.render(code, options); + renderCallArguments(code, options, this); + } + applyDeoptimizations() { + this.deoptimized = true; + this.callee.deoptimizeArgumentsOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } +} + +class ObjectExpression extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizeCache() { + this.getObjectEntity().deoptimizeAllProperties(); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + render(code, options, { renderedSurroundingElement } = BLANK) { + super.render(code, options); + if (renderedSurroundingElement === ExpressionStatement$1 || + renderedSurroundingElement === ArrowFunctionExpression$1) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } + applyDeoptimizations() { } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + let prototype = OBJECT_PROTOTYPE; + const properties = []; + for (const property of this.properties) { + if (property instanceof SpreadElement) { + properties.push({ key: UnknownKey, kind: 'init', property }); + continue; + } + let key; + if (property.computed) { + const keyValue = property.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof keyValue === 'symbol') { + properties.push({ key: UnknownKey, kind: property.kind, property }); + continue; + } + else { + key = String(keyValue); + } + } + else { + key = + property.key instanceof Identifier + ? property.key.name + : String(property.key.value); + if (key === '__proto__' && property.kind === 'init') { + prototype = + property.value instanceof Literal && property.value.value === null + ? null + : property.value; + continue; + } + } + properties.push({ key, kind: property.kind, property }); + } + return (this.objectEntity = new ObjectEntity(properties, prototype)); + } +} + +class PrivateIdentifier extends NodeBase { +} + +class Program extends NodeBase { + constructor() { + super(...arguments); + this.hasCachedEffect = null; + this.hasLoggedEffect = false; + } + hasCachedEffects() { + if (!this.included) { + return false; + } + return this.hasCachedEffect === null + ? (this.hasCachedEffect = this.hasEffects(createHasEffectsContext())) + : this.hasCachedEffect; + } + hasEffects(context) { + for (const node of this.body) { + if (node.hasEffects(context)) { + if (this.scope.context.options.experimentalLogSideEffects && !this.hasLoggedEffect) { + this.hasLoggedEffect = true; + const { code, log, module } = this.scope.context; + log(LOGLEVEL_INFO, logFirstSideEffect(code, module.id, locate(code, node.start, { offsetLine: 1 })), node.start); + } + return (this.hasCachedEffect = true); + } + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) { + node.include(context, includeChildrenRecursively); + } + } + } + render(code, options) { + let start = this.start; + if (code.original.startsWith('#!')) { + start = Math.min(code.original.indexOf('\n') + 1, this.end); + code.remove(0, start); + } + if (this.body.length > 0) { + // Keep all consecutive lines that start with a comment + while (code.original[start] === '/' && /[*/]/.test(code.original[start + 1])) { + const firstLineBreak = findFirstLineBreakOutsideComment(code.original.slice(start, this.body[0].start)); + if (firstLineBreak[0] === -1) { + break; + } + start += firstLineBreak[1]; + } + renderStatementList(this.body, code, start, this.end, options); + } + else { + super.render(code, options); + } + } + applyDeoptimizations() { } +} + +class Property extends MethodBase { + constructor() { + super(...arguments); + this.declarationInit = null; + } + //declare method: boolean; + get method() { + return isFlagSet(this.flags, 262144 /* Flag.method */); + } + set method(value) { + this.flags = setFlag(this.flags, 262144 /* Flag.method */, value); + } + //declare shorthand: boolean; + get shorthand() { + return isFlagSet(this.flags, 524288 /* Flag.shorthand */); + } + set shorthand(value) { + this.flags = setFlag(this.flags, 524288 /* Flag.shorthand */, value); + } + declare(kind, init) { + this.declarationInit = init; + return this.value.declare(kind, UNKNOWN_EXPRESSION); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const propertyReadSideEffects = this.scope.context.options.treeshake.propertyReadSideEffects; + return ((this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') || + this.key.hasEffects(context) || + this.value.hasEffects(context)); + } + markDeclarationReached() { + this.value.markDeclarationReached(); + } + render(code, options) { + if (!this.shorthand) { + this.key.render(code, options); + } + this.value.render(code, options, { isShorthandProperty: this.shorthand }); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.declarationInit !== null) { + this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); + this.scope.context.requestTreeshakingPass(); + } + } +} + +class PropertyDefinition extends NodeBase { + get computed() { + return isFlagSet(this.flags, 1024 /* Flag.computed */); + } + set computed(value) { + this.flags = setFlag(this.flags, 1024 /* Flag.computed */, value); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.value?.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.value?.deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.value + ? this.value.getLiteralValueAtPath(path, recursionTracker, origin) + : UnknownValue; + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.value + ? this.value.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) + : UNKNOWN_RETURN_EXPRESSION; + } + hasEffects(context) { + return this.key.hasEffects(context) || (this.static && !!this.value?.hasEffects(context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return !this.value || this.value.hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { } +} + +class ReturnStatement extends NodeBase { + hasEffects(context) { + if (!context.ignore.returnYield || this.argument?.hasEffects(context)) + return true; + context.brokenFlow = true; + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.argument?.include(context, includeChildrenRecursively); + context.brokenFlow = true; + } + initialise() { + this.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION); + } + render(code, options) { + if (this.argument) { + this.argument.render(code, options, { preventASI: true }); + if (this.argument.start === this.start + 6 /* 'return'.length */) { + code.prependLeft(this.start + 6, ' '); + } + } + } +} + +class SequenceExpression extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.expressions[this.expressions.length - 1].deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.expressions[this.expressions.length - 1].deoptimizePath(path); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.expressions[this.expressions.length - 1].getLiteralValueAtPath(path, recursionTracker, origin); + } + hasEffects(context) { + for (const expression of this.expressions) { + if (expression.hasEffects(context)) + return true; + } + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.expressions[this.expressions.length - 1].hasEffectsOnInteractionAtPath(path, interaction, context); + } + include(context, includeChildrenRecursively) { + this.included = true; + const lastExpression = this.expressions[this.expressions.length - 1]; + for (const expression of this.expressions) { + if (includeChildrenRecursively || + (expression === lastExpression && !(this.parent instanceof ExpressionStatement)) || + expression.shouldBeIncluded(context)) + expression.include(context, includeChildrenRecursively); + } + } + removeAnnotations(code) { + this.expressions[0].removeAnnotations(code); + } + render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) { + let includedNodes = 0; + let lastSeparatorPos = null; + const lastNode = this.expressions[this.expressions.length - 1]; + for (const { node, separator, start, end } of getCommaSeparatedNodesWithBoundaries(this.expressions, code, this.start, this.end)) { + if (!node.included) { + treeshakeNode(node, code, start, end); + continue; + } + includedNodes++; + lastSeparatorPos = separator; + if (includedNodes === 1 && preventASI) { + removeLineBreaks(code, start, node.start); + } + if (includedNodes === 1) { + const parentType = renderedParentType || this.parent.type; + node.render(code, options, { + isCalleeOfRenderedParent: isCalleeOfRenderedParent && node === lastNode, + renderedParentType: parentType, + renderedSurroundingElement: parentType + }); + } + else { + node.render(code, options); + } + } + if (lastSeparatorPos) { + code.remove(lastSeparatorPos, this.end); + } + } +} + +class StaticBlock extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + for (const node of this.body) { + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + render(code, options) { + if (this.body.length > 0) { + const bodyStartPos = findFirstOccurrenceOutsideComment(code.original.slice(this.start, this.end), '{') + 1; + renderStatementList(this.body, code, this.start + bodyStartPos, this.end - 1, options); + } + else { + super.render(code, options); + } + } +} + +class Super extends NodeBase { + bind() { + this.variable = this.scope.findVariable('this'); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.variable.deoptimizePath(path); + } + include() { + if (!this.included) { + this.included = true; + this.scope.context.includeVariableInModule(this.variable); + } + } +} + +class SwitchCase extends NodeBase { + hasEffects(context) { + if (this.test?.hasEffects(context)) + return true; + for (const node of this.consequent) { + if (context.brokenFlow) + break; + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.test?.include(context, includeChildrenRecursively); + for (const node of this.consequent) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + render(code, options, nodeRenderOptions) { + if (this.consequent.length > 0) { + this.test && this.test.render(code, options); + const testEnd = this.test + ? this.test.end + : findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7; + const consequentStart = findFirstOccurrenceOutsideComment(code.original, ':', testEnd) + 1; + renderStatementList(this.consequent, code, consequentStart, nodeRenderOptions.end, options); + } + else { + super.render(code, options); + } + } +} +SwitchCase.prototype.needsBoundaries = true; + +class SwitchStatement extends NodeBase { + createScope(parentScope) { + this.parentScope = parentScope; + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + if (this.discriminant.hasEffects(context)) + return true; + const { brokenFlow, hasBreak, ignore } = context; + const { breaks } = ignore; + ignore.breaks = true; + context.hasBreak = false; + let onlyHasBrokenFlow = true; + for (const switchCase of this.cases) { + if (switchCase.hasEffects(context)) + return true; + onlyHasBrokenFlow &&= context.brokenFlow && !context.hasBreak; + context.hasBreak = false; + context.brokenFlow = brokenFlow; + } + if (this.defaultCase !== null) { + context.brokenFlow = onlyHasBrokenFlow; + } + ignore.breaks = breaks; + context.hasBreak = hasBreak; + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.discriminant.include(context, includeChildrenRecursively); + const { brokenFlow, hasBreak } = context; + context.hasBreak = false; + let onlyHasBrokenFlow = true; + let isCaseIncluded = includeChildrenRecursively || + (this.defaultCase !== null && this.defaultCase < this.cases.length - 1); + for (let caseIndex = this.cases.length - 1; caseIndex >= 0; caseIndex--) { + const switchCase = this.cases[caseIndex]; + if (switchCase.included) { + isCaseIncluded = true; + } + if (!isCaseIncluded) { + const hasEffectsContext = createHasEffectsContext(); + hasEffectsContext.ignore.breaks = true; + isCaseIncluded = switchCase.hasEffects(hasEffectsContext); + } + if (isCaseIncluded) { + switchCase.include(context, includeChildrenRecursively); + onlyHasBrokenFlow &&= context.brokenFlow && !context.hasBreak; + context.hasBreak = false; + context.brokenFlow = brokenFlow; + } + else { + onlyHasBrokenFlow = brokenFlow; + } + } + if (isCaseIncluded && this.defaultCase !== null) { + context.brokenFlow = onlyHasBrokenFlow; + } + context.hasBreak = hasBreak; + } + initialise() { + for (let caseIndex = 0; caseIndex < this.cases.length; caseIndex++) { + if (this.cases[caseIndex].test === null) { + this.defaultCase = caseIndex; + return; + } + } + this.defaultCase = null; + } + parseNode(esTreeNode) { + this.discriminant = new (this.scope.context.getNodeConstructor(esTreeNode.discriminant.type))(esTreeNode.discriminant, this, this.parentScope); + super.parseNode(esTreeNode); + } + render(code, options) { + this.discriminant.render(code, options); + if (this.cases.length > 0) { + renderStatementList(this.cases, code, this.cases[0].start, this.end - 1, options); + } + } +} + +class TaggedTemplateExpression extends CallExpressionBase { + bind() { + super.bind(); + if (this.tag.type === Identifier$1) { + const name = this.tag.name; + const variable = this.scope.findVariable(name); + if (variable.isNamespace) { + this.scope.context.log(LOGLEVEL_WARN, logCannotCallNamespace(name), this.start); + } + } + } + hasEffects(context) { + try { + for (const argument of this.quasi.expressions) { + if (argument.hasEffects(context)) + return true; + } + return (this.tag.hasEffects(context) || + this.tag.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + finally { + if (!this.deoptimized) + this.applyDeoptimizations(); + } + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + } + else { + this.included = true; + this.tag.include(context, includeChildrenRecursively); + this.quasi.include(context, includeChildrenRecursively); + } + this.tag.includeCallArguments(context, this.args); + const [returnExpression] = this.getReturnExpression(); + if (!returnExpression.included) { + returnExpression.include(context, false); + } + } + initialise() { + this.args = [UNKNOWN_EXPRESSION, ...this.quasi.expressions]; + this.interaction = { + args: [ + this.tag instanceof MemberExpression && !this.tag.variable ? this.tag.object : null, + ...this.args + ], + type: INTERACTION_CALLED, + withNew: false + }; + } + render(code, options) { + this.tag.render(code, options, { isCalleeOfRenderedParent: true }); + this.quasi.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + this.tag.deoptimizeArgumentsOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + this.scope.context.requestTreeshakingPass(); + } + getReturnExpression(recursionTracker = SHARED_RECURSION_TRACKER) { + if (this.returnExpression === null) { + this.returnExpression = UNKNOWN_RETURN_EXPRESSION; + return (this.returnExpression = this.tag.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, this.interaction, recursionTracker, this)); + } + return this.returnExpression; + } +} + +class TemplateElement extends NodeBase { + get tail() { + return isFlagSet(this.flags, 1048576 /* Flag.tail */); + } + set tail(value) { + this.flags = setFlag(this.flags, 1048576 /* Flag.tail */, value); + } + // Do not try to bind value + bind() { } + hasEffects() { + return false; + } + include() { + this.included = true; + } + parseNode(esTreeNode) { + this.value = esTreeNode.value; + super.parseNode(esTreeNode); + } + render() { } +} + +class TemplateLiteral extends NodeBase { + deoptimizeArgumentsOnInteractionAtPath() { } + getLiteralValueAtPath(path) { + if (path.length > 0 || this.quasis.length !== 1) { + return UnknownValue; + } + return this.quasis[0].value.cooked; + } + getReturnExpressionWhenCalledAtPath(path) { + if (path.length !== 1) { + return UNKNOWN_RETURN_EXPRESSION; + } + return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); + } + return true; + } + render(code, options) { + code.indentExclusionRanges.push([this.start, this.end]); + super.render(code, options); + } +} + +class UndefinedVariable extends Variable { + constructor() { + super('undefined'); + } + getLiteralValueAtPath() { + return undefined; + } +} + +class ExportDefaultVariable extends LocalVariable { + constructor(name, exportDefaultDeclaration, context) { + super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context, "other" /* VariableKind.other */); + this.hasId = false; + this.originalId = null; + this.originalVariable = null; + const declaration = exportDefaultDeclaration.declaration; + if ((declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) && + declaration.id) { + this.hasId = true; + this.originalId = declaration.id; + } + else if (declaration instanceof Identifier) { + this.originalId = declaration; + } + } + addReference(identifier) { + if (!this.hasId) { + this.name = identifier.name; + } + } + forbidName(name) { + const original = this.getOriginalVariable(); + if (original === this) { + super.forbidName(name); + } + else { + original.forbidName(name); + } + } + getAssignedVariableName() { + return (this.originalId && this.originalId.name) || null; + } + getBaseVariableName() { + const original = this.getOriginalVariable(); + return original === this ? super.getBaseVariableName() : original.getBaseVariableName(); + } + getDirectOriginalVariable() { + return this.originalId && + (this.hasId || + !(this.originalId.isPossibleTDZ() || + this.originalId.variable.isReassigned || + this.originalId.variable instanceof UndefinedVariable || + // this avoids a circular dependency + 'syntheticNamespace' in this.originalId.variable)) + ? this.originalId.variable + : null; + } + getName(getPropertyAccess) { + const original = this.getOriginalVariable(); + return original === this + ? super.getName(getPropertyAccess) + : original.getName(getPropertyAccess); + } + getOriginalVariable() { + if (this.originalVariable) + return this.originalVariable; + // eslint-disable-next-line @typescript-eslint/no-this-alias + let original = this; + let currentVariable; + const checkedVariables = new Set(); + do { + checkedVariables.add(original); + currentVariable = original; + original = currentVariable.getDirectOriginalVariable(); + } while (original instanceof ExportDefaultVariable && !checkedVariables.has(original)); + return (this.originalVariable = original || currentVariable); + } +} + +class ModuleScope extends ChildScope { + constructor(parent, context) { + super(parent, context); + this.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context, "other" /* VariableKind.other */)); + } + addDeclaration(identifier, context, init, kind) { + if (this.context.module.importDescriptions.has(identifier.name)) { + context.error(logRedeclarationError(identifier.name), identifier.start); + } + return super.addDeclaration(identifier, context, init, kind); + } + addExportDefaultDeclaration(name, exportDefaultDeclaration, context) { + const variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context); + this.variables.set('default', variable); + return variable; + } + addNamespaceMemberAccess() { } + deconflict(format, exportNamesByVariable, accessedGlobalsByScope) { + // all module level variables are already deconflicted when deconflicting the chunk + for (const scope of this.children) + scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } + findLexicalBoundary() { + return this; + } + findVariable(name) { + const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); + if (knownVariable) { + return knownVariable; + } + const variable = this.context.traceVariable(name) || this.parent.findVariable(name); + if (variable instanceof GlobalVariable) { + this.accessedOutsideVariables.set(name, variable); + } + return variable; + } +} + +class ThisExpression extends NodeBase { + bind() { + this.variable = this.scope.findVariable('this'); + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); + } + deoptimizePath(path) { + this.variable.deoptimizePath(path); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (path.length === 0) { + return interaction.type !== INTERACTION_ACCESSED; + } + return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); + } + include() { + if (!this.included) { + this.included = true; + this.scope.context.includeVariableInModule(this.variable); + } + } + initialise() { + this.alias = + this.scope.findLexicalBoundary() instanceof ModuleScope + ? this.scope.context.moduleContext + : null; + if (this.alias === 'undefined') { + this.scope.context.log(LOGLEVEL_WARN, logThisIsUndefined(), this.start); + } + } + render(code) { + if (this.alias !== null) { + code.overwrite(this.start, this.end, this.alias, { + contentOnly: false, + storeName: true + }); + } + } +} + +class ThrowStatement extends NodeBase { + hasEffects() { + return true; + } + include(context, includeChildrenRecursively) { + this.included = true; + this.argument.include(context, includeChildrenRecursively); + context.brokenFlow = true; + } + render(code, options) { + this.argument.render(code, options, { preventASI: true }); + if (this.argument.start === this.start + 5 /* 'throw'.length */) { + code.prependLeft(this.start + 5, ' '); + } + } +} + +class TryStatement extends NodeBase { + constructor() { + super(...arguments); + this.directlyIncluded = false; + this.includedLabelsAfterBlock = null; + } + hasEffects(context) { + return ((this.scope.context.options.treeshake.tryCatchDeoptimization + ? this.block.body.length > 0 + : this.block.hasEffects(context)) || !!this.finalizer?.hasEffects(context)); + } + include(context, includeChildrenRecursively) { + const tryCatchDeoptimization = this.scope.context.options.treeshake?.tryCatchDeoptimization; + const { brokenFlow, includedLabels } = context; + if (!this.directlyIncluded || !tryCatchDeoptimization) { + this.included = true; + this.directlyIncluded = true; + this.block.include(context, tryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively); + if (includedLabels.size > 0) { + this.includedLabelsAfterBlock = [...includedLabels]; + } + context.brokenFlow = brokenFlow; + } + else if (this.includedLabelsAfterBlock) { + for (const label of this.includedLabelsAfterBlock) { + includedLabels.add(label); + } + } + if (this.handler !== null) { + this.handler.include(context, includeChildrenRecursively); + context.brokenFlow = brokenFlow; + } + this.finalizer?.include(context, includeChildrenRecursively); + } +} + +const unaryOperators = { + '!': value => !value, + '+': value => +value, + '-': value => -value, + delete: () => UnknownValue, + typeof: value => typeof value, + void: () => undefined, + '~': value => ~value +}; +class UnaryExpression extends NodeBase { + get prefix() { + return isFlagSet(this.flags, 2097152 /* Flag.prefix */); + } + set prefix(value) { + this.flags = setFlag(this.flags, 2097152 /* Flag.prefix */, value); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length > 0) + return UnknownValue; + const argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); + if (typeof argumentValue === 'symbol') + return UnknownValue; + return unaryOperators[this.operator](argumentValue); + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.operator === 'typeof' && this.argument instanceof Identifier) + return false; + return (this.argument.hasEffects(context) || + (this.operator === 'delete' && + this.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context))); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > (this.operator === 'void' ? 0 : 1); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.operator === 'delete') { + this.argument.deoptimizePath(EMPTY_PATH); + this.scope.context.requestTreeshakingPass(); + } + } +} + +class UnknownNode extends NodeBase { + hasEffects() { + return true; + } + include(context) { + super.include(context, true); + } +} + +class UpdateExpression extends NodeBase { + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + return this.argument.hasEffectsAsAssignmentTarget(context, true); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type !== INTERACTION_ACCESSED; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + this.argument.includeAsAssignmentTarget(context, includeChildrenRecursively, true); + } + initialise() { + this.argument.setAssignedValue(UNKNOWN_EXPRESSION); + } + render(code, options) { + const { exportNamesByVariable, format, snippets: { _ } } = options; + this.argument.render(code, options); + if (format === 'system') { + const variable = this.argument.variable; + const exportNames = exportNamesByVariable.get(variable); + if (exportNames) { + if (this.prefix) { + if (exportNames.length === 1) { + renderSystemExportExpression(variable, this.start, this.end, code, options); + } + else { + renderSystemExportSequenceAfterExpression(variable, this.start, this.end, this.parent.type !== ExpressionStatement$1, code, options); + } + } + else { + const operator = this.operator[0]; + renderSystemExportSequenceBeforeExpression(variable, this.start, this.end, this.parent.type !== ExpressionStatement$1, code, options, `${_}${operator}${_}1`); + } + } + } + } + applyDeoptimizations() { + this.deoptimized = true; + this.argument.deoptimizePath(EMPTY_PATH); + if (this.argument instanceof Identifier) { + const variable = this.scope.findVariable(this.argument.name); + variable.isReassigned = true; + } + this.scope.context.requestTreeshakingPass(); + } +} + +function areAllDeclarationsIncludedAndNotExported(declarations, exportNamesByVariable) { + for (const declarator of declarations) { + if (!declarator.id.included) + return false; + if (declarator.id.type === Identifier$1) { + if (exportNamesByVariable.has(declarator.id.variable)) + return false; + } + else { + const exportedVariables = []; + declarator.id.addExportedVariables(exportedVariables, exportNamesByVariable); + if (exportedVariables.length > 0) + return false; + } + } + return true; +} +class VariableDeclaration extends NodeBase { + deoptimizePath() { + for (const declarator of this.declarations) { + declarator.deoptimizePath(EMPTY_PATH); + } + } + hasEffectsOnInteractionAtPath() { + return false; + } + include(context, includeChildrenRecursively, { asSingleStatement } = BLANK) { + this.included = true; + for (const declarator of this.declarations) { + if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) + declarator.include(context, includeChildrenRecursively); + const { id, init } = declarator; + if (asSingleStatement) { + id.include(context, includeChildrenRecursively); + } + if (init && + id.included && + !init.included && + (id instanceof ObjectPattern || id instanceof ArrayPattern)) { + init.include(context, includeChildrenRecursively); + } + } + } + initialise() { + for (const declarator of this.declarations) { + declarator.declareDeclarator(this.kind); + } + } + removeAnnotations(code) { + this.declarations[0].removeAnnotations(code); + } + render(code, options, nodeRenderOptions = BLANK) { + if (areAllDeclarationsIncludedAndNotExported(this.declarations, options.exportNamesByVariable)) { + for (const declarator of this.declarations) { + declarator.render(code, options); + } + if (!nodeRenderOptions.isNoStatement && + code.original.charCodeAt(this.end - 1) !== 59 /*";"*/) { + code.appendLeft(this.end, ';'); + } + } + else { + this.renderReplacedDeclarations(code, options); + } + } + applyDeoptimizations() { } + renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options) { + if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) { + code.remove(this.end - 1, this.end); + } + separatorString += ';'; + if (lastSeparatorPos === null) { + code.appendLeft(renderedContentEnd, separatorString); + } + else { + if (code.original.charCodeAt(actualContentEnd - 1) === 10 /*"\n"*/ && + (code.original.charCodeAt(this.end) === 10 /*"\n"*/ || + code.original.charCodeAt(this.end) === 13) /*"\r"*/) { + actualContentEnd--; + if (code.original.charCodeAt(actualContentEnd) === 13 /*"\r"*/) { + actualContentEnd--; + } + } + if (actualContentEnd === lastSeparatorPos + 1) { + code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString); + } + else { + code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString); + code.remove(actualContentEnd, renderedContentEnd); + } + } + if (systemPatternExports.length > 0) { + code.appendLeft(renderedContentEnd, ` ${getSystemExportStatement(systemPatternExports, options)};`); + } + } + renderReplacedDeclarations(code, options) { + const separatedNodes = getCommaSeparatedNodesWithBoundaries(this.declarations, code, this.start + this.kind.length, this.end - (code.original.charCodeAt(this.end - 1) === 59 /*";"*/ ? 1 : 0)); + let actualContentEnd, renderedContentEnd; + renderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length); + let lastSeparatorPos = renderedContentEnd - 1; + code.remove(this.start, lastSeparatorPos); + let isInDeclaration = false; + let hasRenderedContent = false; + let separatorString = '', leadingString, nextSeparatorString; + const aggregatedSystemExports = []; + const singleSystemExport = gatherSystemExportsAndGetSingleExport(separatedNodes, options, aggregatedSystemExports); + for (const { node, start, separator, contentEnd, end } of separatedNodes) { + if (!node.included) { + code.remove(start, end); + node.removeAnnotations(code); + continue; + } + node.render(code, options); + leadingString = ''; + nextSeparatorString = ''; + if (!node.id.included || + (node.id instanceof Identifier && + isReassignedExportsMember(node.id.variable, options.exportNamesByVariable))) { + if (hasRenderedContent) { + separatorString += ';'; + } + isInDeclaration = false; + } + else { + if (singleSystemExport && singleSystemExport === node.id.variable) { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end); + renderSystemExportExpression(singleSystemExport, findNonWhiteSpace(code.original, operatorPos + 1), separator === null ? contentEnd : separator, code, options); + } + if (isInDeclaration) { + separatorString += ','; + } + else { + if (hasRenderedContent) { + separatorString += ';'; + } + leadingString += `${this.kind} `; + isInDeclaration = true; + } + } + if (renderedContentEnd === lastSeparatorPos + 1) { + code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString + leadingString); + } + else { + code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString); + code.appendLeft(renderedContentEnd, leadingString); + } + actualContentEnd = contentEnd; + renderedContentEnd = end; + hasRenderedContent = true; + lastSeparatorPos = separator; + separatorString = nextSeparatorString; + } + this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, aggregatedSystemExports, options); + } +} +function gatherSystemExportsAndGetSingleExport(separatedNodes, options, aggregatedSystemExports) { + let singleSystemExport = null; + if (options.format === 'system') { + for (const { node } of separatedNodes) { + if (node.id instanceof Identifier && + node.init && + aggregatedSystemExports.length === 0 && + options.exportNamesByVariable.get(node.id.variable)?.length === 1) { + singleSystemExport = node.id.variable; + aggregatedSystemExports.push(singleSystemExport); + } + else { + node.id.addExportedVariables(aggregatedSystemExports, options.exportNamesByVariable); + } + } + if (aggregatedSystemExports.length > 1) { + singleSystemExport = null; + } + else if (singleSystemExport) { + aggregatedSystemExports.length = 0; + } + } + return singleSystemExport; +} + +class WhileStatement extends NodeBase { + hasEffects(context) { + if (this.test.hasEffects(context)) + return true; + return hasLoopBodyEffects(context, this.body); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.test.include(context, includeChildrenRecursively); + includeLoopBody(context, this.body, includeChildrenRecursively); + } +} + +class YieldExpression extends NodeBase { + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + return !(context.ignore.returnYield && !this.argument?.hasEffects(context)); + } + render(code, options) { + if (this.argument) { + this.argument.render(code, options, { preventASI: true }); + if (this.argument.start === this.start + 5 /* 'yield'.length */) { + code.prependLeft(this.start + 5, ' '); + } + } + } +} + +const nodeConstructors = { + ArrayExpression, + ArrayPattern, + ArrowFunctionExpression, + AssignmentExpression, + AssignmentPattern, + AwaitExpression, + BinaryExpression, + BlockStatement, + BreakStatement, + CallExpression, + CatchClause, + ChainExpression, + ClassBody, + ClassDeclaration, + ClassExpression, + ConditionalExpression, + ContinueStatement, + DoWhileStatement, + EmptyStatement, + ExportAllDeclaration, + ExportDefaultDeclaration, + ExportNamedDeclaration, + ExportSpecifier, + ExpressionStatement, + ForInStatement, + ForOfStatement, + ForStatement, + FunctionDeclaration, + FunctionExpression, + Identifier, + IfStatement, + ImportAttribute, + ImportDeclaration, + ImportDefaultSpecifier, + ImportExpression, + ImportNamespaceSpecifier, + ImportSpecifier, + LabeledStatement, + Literal, + LogicalExpression, + MemberExpression, + MetaProperty, + MethodDefinition, + NewExpression, + ObjectExpression, + ObjectPattern, + PrivateIdentifier, + Program, + Property, + PropertyDefinition, + RestElement, + ReturnStatement, + SequenceExpression, + SpreadElement, + StaticBlock, + Super, + SwitchCase, + SwitchStatement, + TaggedTemplateExpression, + TemplateElement, + TemplateLiteral, + ThisExpression, + ThrowStatement, + TryStatement, + UnaryExpression, + UnknownNode, + UpdateExpression, + VariableDeclaration, + VariableDeclarator, + WhileStatement, + YieldExpression +}; + +const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim'; + +class ExportShimVariable extends Variable { + constructor(module) { + super(MISSING_EXPORT_SHIM_VARIABLE); + this.module = module; + } + include() { + super.include(); + this.module.needsExportShim = true; + } +} + +class NamespaceVariable extends Variable { + constructor(context) { + super(context.getModuleName()); + this.memberVariables = null; + this.mergedNamespaces = []; + this.referencedEarly = false; + this.references = []; + this.context = context; + this.module = context.module; + } + addReference(identifier) { + this.references.push(identifier); + this.name = identifier.name; + } + deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) { + if (path.length > 1 || (path.length === 1 && interaction.type === INTERACTION_CALLED)) { + const key = path[0]; + if (typeof key === 'string') { + this.getMemberVariables()[key]?.deoptimizeArgumentsOnInteractionAtPath(interaction, path.slice(1), recursionTracker); + } + else { + deoptimizeInteraction(interaction); + } + } + } + deoptimizePath(path) { + if (path.length > 1) { + const key = path[0]; + if (typeof key === 'string') { + this.getMemberVariables()[key]?.deoptimizePath(path.slice(1)); + } + } + } + getLiteralValueAtPath(path) { + if (path[0] === SymbolToStringTag) { + return 'Module'; + } + return UnknownValue; + } + getMemberVariables() { + if (this.memberVariables) { + return this.memberVariables; + } + const memberVariables = Object.create(null); + const sortedExports = [...this.context.getExports(), ...this.context.getReexports()].sort(); + for (const name of sortedExports) { + if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) { + const exportedVariable = this.context.traceExport(name); + if (exportedVariable) { + memberVariables[name] = exportedVariable; + } + } + } + return (this.memberVariables = memberVariables); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (path.length === 0) { + // This can only be a call anyway + return true; + } + if (path.length === 1 && type !== INTERACTION_CALLED) { + return type === INTERACTION_ASSIGNED; + } + const key = path[0]; + if (typeof key !== 'string') { + return true; + } + const memberVariable = this.getMemberVariables()[key]; + return (!memberVariable || + memberVariable.hasEffectsOnInteractionAtPath(path.slice(1), interaction, context)); + } + include() { + super.include(); + this.context.includeAllExports(); + } + prepare(accessedGlobalsByScope) { + if (this.mergedNamespaces.length > 0) { + this.module.scope.addAccessedGlobals([MERGE_NAMESPACES_VARIABLE], accessedGlobalsByScope); + } + } + renderBlock(options) { + const { exportNamesByVariable, format, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n, s } } = options; + const memberVariables = this.getMemberVariables(); + const members = Object.entries(memberVariables) + .filter(([_, variable]) => variable.included) + .map(([name, variable]) => { + if (this.referencedEarly || variable.isReassigned || variable === this) { + return [ + null, + `get ${stringifyObjectKeyIfNeeded(name)}${_}()${_}{${_}return ${variable.getName(getPropertyAccess)}${s}${_}}` + ]; + } + return [name, variable.getName(getPropertyAccess)]; + }); + members.unshift([null, `__proto__:${_}null`]); + let output = getObject(members, { lineBreakIndent: { base: '', t } }); + if (this.mergedNamespaces.length > 0) { + const assignmentArguments = this.mergedNamespaces.map(variable => variable.getName(getPropertyAccess)); + output = `/*#__PURE__*/${MERGE_NAMESPACES_VARIABLE}(${output},${_}[${assignmentArguments.join(`,${_}`)}])`; + } + else { + // The helper to merge namespaces will also take care of freezing and toStringTag + if (symbols) { + output = `/*#__PURE__*/Object.defineProperty(${output},${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)})`; + } + if (freeze) { + output = `/*#__PURE__*/Object.freeze(${output})`; + } + } + const name = this.getName(getPropertyAccess); + output = `${cnst} ${name}${_}=${_}${output};`; + if (format === 'system' && exportNamesByVariable.has(this)) { + output += `${n}${getSystemExportStatement([this], options)};`; + } + return output; + } + renderFirst() { + return this.referencedEarly; + } + setMergedNamespaces(mergedNamespaces) { + this.mergedNamespaces = mergedNamespaces; + const moduleExecIndex = this.context.getModuleExecIndex(); + for (const identifier of this.references) { + const { context } = identifier.scope; + if (context.getModuleExecIndex() <= moduleExecIndex) { + this.referencedEarly = true; + break; + } + } + } +} +NamespaceVariable.prototype.isNamespace = true; + +class SyntheticNamedExportVariable extends Variable { + constructor(context, name, syntheticNamespace) { + super(name); + this.baseVariable = null; + this.context = context; + this.module = context.module; + this.syntheticNamespace = syntheticNamespace; + } + getBaseVariable() { + if (this.baseVariable) + return this.baseVariable; + let baseVariable = this.syntheticNamespace; + while (baseVariable instanceof ExportDefaultVariable || + baseVariable instanceof SyntheticNamedExportVariable) { + if (baseVariable instanceof ExportDefaultVariable) { + const original = baseVariable.getOriginalVariable(); + if (original === baseVariable) + break; + baseVariable = original; + } + if (baseVariable instanceof SyntheticNamedExportVariable) { + baseVariable = baseVariable.syntheticNamespace; + } + } + return (this.baseVariable = baseVariable); + } + getBaseVariableName() { + return this.syntheticNamespace.getBaseVariableName(); + } + getName(getPropertyAccess) { + return `${this.syntheticNamespace.getName(getPropertyAccess)}${getPropertyAccess(this.name)}`; + } + include() { + super.include(); + this.context.includeVariableInModule(this.syntheticNamespace); + } + setRenderNames(baseName, name) { + super.setRenderNames(baseName, name); + } +} + +var BuildPhase; +(function (BuildPhase) { + BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE"; + BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE"; + BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE"; +})(BuildPhase || (BuildPhase = {})); + +const sourceMapCache = new WeakMap(); +/** + * This clears the decoded array and falls back to the encoded string form. + * Sourcemap mappings arrays can be very large and holding on to them for longer + * than is necessary leads to poor heap utilization. + */ +function resetCacheToEncoded(cache) { + if (cache.encodedMappings === undefined && cache.decodedMappings) { + cache.encodedMappings = encode(cache.decodedMappings); + } + cache.decodedMappings = undefined; +} +function resetSourcemapCache(map, sourcemapChain) { + if (map) { + const cache = sourceMapCache.get(map); + if (cache) { + resetCacheToEncoded(cache); + } + } + if (!sourcemapChain) { + return; + } + for (const map of sourcemapChain) { + if (map.missing) + continue; + resetSourcemapCache(map); + } +} +function decodedSourcemap(map) { + if (!map) + return null; + if (typeof map === 'string') { + map = JSON.parse(map); + } + if (!map.mappings) { + return { + mappings: [], + names: [], + sources: [], + version: 3 + }; + } + const originalMappings = map.mappings; + const isAlreadyDecoded = Array.isArray(originalMappings); + const cache = { + decodedMappings: isAlreadyDecoded ? originalMappings : undefined, + encodedMappings: isAlreadyDecoded ? undefined : originalMappings + }; + const decodedMap = { + ...map, + // By moving mappings behind an accessor, we can avoid unneeded computation for cases + // where the mappings field is never actually accessed. This appears to greatly reduce + // the overhead of sourcemap decoding in terms of both compute time and memory usage. + get mappings() { + if (cache.decodedMappings) { + return cache.decodedMappings; + } + // If decodedMappings doesn't exist then encodedMappings should. + // The only scenario where cache.encodedMappings should be undefined is if the map + // this was constructed from was already decoded, or if mappings was set to a new + // decoded string. In either case, this line shouldn't get hit. + cache.decodedMappings = cache.encodedMappings ? decode(cache.encodedMappings) : []; + cache.encodedMappings = undefined; + return cache.decodedMappings; + } + }; + sourceMapCache.set(decodedMap, cache); + return decodedMap; +} + +function getId(m) { + return m.id; +} + +function getOriginalLocation(sourcemapChain, location) { + const filteredSourcemapChain = sourcemapChain.filter((sourcemap) => !sourcemap.missing); + traceSourcemap: while (filteredSourcemapChain.length > 0) { + const sourcemap = filteredSourcemapChain.pop(); + const line = sourcemap.mappings[location.line - 1]; + if (line) { + const filteredLine = line.filter((segment) => segment.length > 1); + const lastSegment = filteredLine[filteredLine.length - 1]; + for (const segment of filteredLine) { + if (segment[0] >= location.column || segment === lastSegment) { + location = { + column: segment[3], + line: segment[2] + 1 + }; + continue traceSourcemap; + } + } + } + throw new Error("Can't resolve original location of error."); + } + return location; +} + +const ATTRIBUTE_KEYWORDS = new Set(['assert', 'with']); +function getAttributesFromImportExpression(node) { + const { scope: { context }, options, start } = node; + if (!(options instanceof ObjectExpression)) { + if (options) { + context.module.log(LOGLEVEL_WARN, logImportAttributeIsInvalid(context.module.id), start); + } + return EMPTY_OBJECT; + } + const assertProperty = options.properties.find((property) => ATTRIBUTE_KEYWORDS.has(getPropertyKey(property)))?.value; + if (!assertProperty) { + return EMPTY_OBJECT; + } + if (!(assertProperty instanceof ObjectExpression)) { + context.module.log(LOGLEVEL_WARN, logImportOptionsAreInvalid(context.module.id), start); + return EMPTY_OBJECT; + } + const assertFields = assertProperty.properties + .map(property => { + const key = getPropertyKey(property); + if (typeof key === 'string' && + typeof property.value.value === 'string') { + return [key, property.value.value]; + } + context.module.log(LOGLEVEL_WARN, logImportAttributeIsInvalid(context.module.id), property.start); + return null; + }) + .filter((property) => !!property); + if (assertFields.length > 0) { + return Object.fromEntries(assertFields); + } + return EMPTY_OBJECT; +} +const getPropertyKey = (property) => { + const key = property.key; + return (key && !property.computed && (key.name || key.value)); +}; +function getAttributesFromImportExportDeclaration(attributes) { + return attributes?.length + ? Object.fromEntries(attributes.map(assertion => [getPropertyKey(assertion), assertion.value.value])) + : EMPTY_OBJECT; +} +function doAttributesDiffer(assertionA, assertionB) { + const keysA = Object.keys(assertionA); + return (keysA.length !== Object.keys(assertionB).length || + keysA.some(key => assertionA[key] !== assertionB[key])); +} + +let timers = new Map(); +function getPersistedLabel(label, level) { + switch (level) { + case 1: { + return `# ${label}`; + } + case 2: { + return `## ${label}`; + } + case 3: { + return label; + } + default: { + return `${' '.repeat(level - 4)}- ${label}`; + } + } +} +function timeStartImpl(label, level = 3) { + label = getPersistedLabel(label, level); + const startMemory = process$1.memoryUsage().heapUsed; + const startTime = performance.now(); + const timer = timers.get(label); + if (timer === undefined) { + timers.set(label, { + memory: 0, + startMemory, + startTime, + time: 0, + totalMemory: 0 + }); + } + else { + timer.startMemory = startMemory; + timer.startTime = startTime; + } +} +function timeEndImpl(label, level = 3) { + label = getPersistedLabel(label, level); + const timer = timers.get(label); + if (timer !== undefined) { + const currentMemory = process$1.memoryUsage().heapUsed; + timer.memory += currentMemory - timer.startMemory; + timer.time += performance.now() - timer.startTime; + timer.totalMemory = Math.max(timer.totalMemory, currentMemory); + } +} +function getTimings() { + const newTimings = {}; + for (const [label, { memory, time, totalMemory }] of timers) { + newTimings[label] = [time, memory, totalMemory]; + } + return newTimings; +} +let timeStart = doNothing; +let timeEnd = doNothing; +const TIMED_PLUGIN_HOOKS = [ + 'augmentChunkHash', + 'buildEnd', + 'buildStart', + 'generateBundle', + 'load', + 'moduleParsed', + 'options', + 'outputOptions', + 'renderChunk', + 'renderDynamicImport', + 'renderStart', + 'resolveDynamicImport', + 'resolveFileUrl', + 'resolveId', + 'resolveImportMeta', + 'shouldTransformCachedModule', + 'transform', + 'writeBundle' +]; +function getPluginWithTimers(plugin, index) { + if (plugin._hasTimer) + return plugin; + plugin._hasTimer = true; + for (const hook of TIMED_PLUGIN_HOOKS) { + if (hook in plugin) { + let timerLabel = `plugin ${index}`; + if (plugin.name) { + timerLabel += ` (${plugin.name})`; + } + timerLabel += ` - ${hook}`; + const handler = function (...parameters) { + timeStart(timerLabel, 4); + const result = hookFunction.apply(this, parameters); + timeEnd(timerLabel, 4); + return result; + }; + let hookFunction; + if (typeof plugin[hook].handler === 'function') { + hookFunction = plugin[hook].handler; + plugin[hook].handler = handler; + } + else { + hookFunction = plugin[hook]; + plugin[hook] = handler; + } + } + } + return plugin; +} +function initialiseTimers(inputOptions) { + if (inputOptions.perf) { + timers = new Map(); + timeStart = timeStartImpl; + timeEnd = timeEndImpl; + inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers); + } + else { + timeStart = doNothing; + timeEnd = doNothing; + } +} + +function markModuleAndImpureDependenciesAsExecuted(baseModule) { + baseModule.isExecuted = true; + const modules = [baseModule]; + const visitedModules = new Set(); + for (const module of modules) { + for (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) { + if (!(dependency instanceof ExternalModule) && + !dependency.isExecuted && + (dependency.info.moduleSideEffects || module.implicitlyLoadedBefore.has(dependency)) && + !visitedModules.has(dependency.id)) { + dependency.isExecuted = true; + visitedModules.add(dependency.id); + modules.push(dependency); + } + } + } +} + +const MISSING_EXPORT_SHIM_DESCRIPTION = { + identifier: null, + localName: MISSING_EXPORT_SHIM_VARIABLE +}; +function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) { + const searchedModules = searchedNamesAndModules.get(name); + if (searchedModules) { + if (searchedModules.has(target)) { + return isExportAllSearch ? [null] : error(logCircularReexport(name, target.id)); + } + searchedModules.add(target); + } + else { + searchedNamesAndModules.set(name, new Set([target])); + } + return target.getVariableForExportName(name, { + importerForSideEffects, + isExportAllSearch, + searchedNamesAndModules + }); +} +function getAndExtendSideEffectModules(variable, module) { + const sideEffectModules = getOrCreate(module.sideEffectDependenciesByVariable, variable, (getNewSet)); + let currentVariable = variable; + const referencedVariables = new Set([currentVariable]); + while (true) { + const importingModule = currentVariable.module; + currentVariable = + currentVariable instanceof ExportDefaultVariable + ? currentVariable.getDirectOriginalVariable() + : currentVariable instanceof SyntheticNamedExportVariable + ? currentVariable.syntheticNamespace + : null; + if (!currentVariable || referencedVariables.has(currentVariable)) { + break; + } + referencedVariables.add(currentVariable); + sideEffectModules.add(importingModule); + const originalSideEffects = importingModule.sideEffectDependenciesByVariable.get(currentVariable); + if (originalSideEffects) { + for (const module of originalSideEffects) { + sideEffectModules.add(module); + } + } + } + return sideEffectModules; +} +class Module { + constructor(graph, id, options, isEntry, moduleSideEffects, syntheticNamedExports, meta, attributes) { + this.graph = graph; + this.id = id; + this.options = options; + this.alternativeReexportModules = new Map(); + this.chunkFileNames = new Set(); + this.chunkNames = []; + this.cycles = new Set(); + this.dependencies = new Set(); + this.dynamicDependencies = new Set(); + this.dynamicImporters = []; + this.dynamicImports = []; + this.execIndex = Infinity; + this.implicitlyLoadedAfter = new Set(); + this.implicitlyLoadedBefore = new Set(); + this.importDescriptions = new Map(); + this.importMetas = []; + this.importedFromNotTreeshaken = false; + this.importers = []; + this.includedDynamicImporters = []; + this.includedImports = new Set(); + this.isExecuted = false; + this.isUserDefinedEntryPoint = false; + this.needsExportShim = false; + this.sideEffectDependenciesByVariable = new Map(); + this.sourcesWithAttributes = new Map(); + this.allExportNames = null; + this.ast = null; + this.exportAllModules = []; + this.exportAllSources = new Set(); + this.exportNamesByVariable = null; + this.exportShimVariable = new ExportShimVariable(this); + this.exports = new Map(); + this.namespaceReexportsByName = new Map(); + this.reexportDescriptions = new Map(); + this.relevantDependencies = null; + this.syntheticExports = new Map(); + this.syntheticNamespace = null; + this.transformDependencies = []; + this.transitiveReexports = null; + this.excludeFromSourcemap = /\0/.test(id); + this.context = options.moduleContext(id); + this.preserveSignature = this.options.preserveEntrySignatures; + // eslint-disable-next-line @typescript-eslint/no-this-alias + const module = this; + const { dynamicImports, dynamicImporters, exportAllSources, exports, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAttributes } = this; + this.info = { + ast: null, + attributes, + code: null, + get dynamicallyImportedIdResolutions() { + return dynamicImports + .map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument]) + .filter(Boolean); + }, + get dynamicallyImportedIds() { + // We cannot use this.dynamicDependencies because this is needed before + // dynamicDependencies are populated + return dynamicImports.map(({ id }) => id).filter((id) => id != null); + }, + get dynamicImporters() { + return dynamicImporters.sort(); + }, + get exportedBindings() { + const exportBindings = { '.': [...exports.keys()] }; + for (const [name, { source }] of reexportDescriptions) { + (exportBindings[source] ??= []).push(name); + } + for (const source of exportAllSources) { + (exportBindings[source] ??= []).push('*'); + } + return exportBindings; + }, + get exports() { + return [ + ...exports.keys(), + ...reexportDescriptions.keys(), + ...[...exportAllSources].map(() => '*') + ]; + }, + get hasDefaultExport() { + // This information is only valid after parsing + if (!module.ast) { + return null; + } + return module.exports.has('default') || reexportDescriptions.has('default'); + }, + id, + get implicitlyLoadedAfterOneOf() { + // eslint-disable-next-line unicorn/prefer-spread + return Array.from(implicitlyLoadedAfter, getId).sort(); + }, + get implicitlyLoadedBefore() { + // eslint-disable-next-line unicorn/prefer-spread + return Array.from(implicitlyLoadedBefore, getId).sort(); + }, + get importedIdResolutions() { + // eslint-disable-next-line unicorn/prefer-spread + return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]).filter(Boolean); + }, + get importedIds() { + // We cannot use this.dependencies because this is needed before + // dependencies are populated + // eslint-disable-next-line unicorn/prefer-spread + return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]?.id).filter(Boolean); + }, + get importers() { + return importers.sort(); + }, + isEntry, + isExternal: false, + get isIncluded() { + if (graph.phase !== BuildPhase.GENERATE) { + return null; + } + return module.isIncluded(); + }, + meta: { ...meta }, + moduleSideEffects, + syntheticNamedExports + }; + } + basename() { + const base = basename(this.id); + const extension = extname(this.id); + return makeLegal(extension ? base.slice(0, -extension.length) : base); + } + bindReferences() { + this.ast.bind(); + } + error(properties, pos) { + pos !== undefined && this.addLocationToLogProps(properties, pos); + return error(properties); + } + // sum up the length of all ast nodes that are included + estimateSize() { + let size = 0; + for (const node of this.ast.body) { + if (node.included) { + size += node.end - node.start; + } + } + return size; + } + getAllExportNames() { + if (this.allExportNames) { + return this.allExportNames; + } + this.allExportNames = new Set([...this.exports.keys(), ...this.reexportDescriptions.keys()]); + for (const module of this.exportAllModules) { + if (module instanceof ExternalModule) { + this.allExportNames.add(`*${module.id}`); + continue; + } + for (const name of module.getAllExportNames()) { + if (name !== 'default') + this.allExportNames.add(name); + } + } + // We do not count the synthetic namespace as a regular export to hide it + // from entry signatures and namespace objects + if (typeof this.info.syntheticNamedExports === 'string') { + this.allExportNames.delete(this.info.syntheticNamedExports); + } + return this.allExportNames; + } + getDependenciesToBeIncluded() { + if (this.relevantDependencies) + return this.relevantDependencies; + this.relevantDependencies = new Set(); + const necessaryDependencies = new Set(); + const alwaysCheckedDependencies = new Set(); + const dependencyVariables = new Set(this.includedImports); + if (this.info.isEntry || + this.includedDynamicImporters.length > 0 || + this.namespace.included || + this.implicitlyLoadedAfter.size > 0) { + for (const exportName of [...this.getReexports(), ...this.getExports()]) { + const [exportedVariable] = this.getVariableForExportName(exportName); + if (exportedVariable?.included) { + dependencyVariables.add(exportedVariable); + } + } + } + for (let variable of dependencyVariables) { + const sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable); + if (sideEffectDependencies) { + for (const module of sideEffectDependencies) { + alwaysCheckedDependencies.add(module); + } + } + if (variable instanceof SyntheticNamedExportVariable) { + variable = variable.getBaseVariable(); + } + else if (variable instanceof ExportDefaultVariable) { + variable = variable.getOriginalVariable(); + } + necessaryDependencies.add(variable.module); + } + if (!this.options.treeshake || this.info.moduleSideEffects === 'no-treeshake') { + for (const dependency of this.dependencies) { + this.relevantDependencies.add(dependency); + } + } + else { + this.addRelevantSideEffectDependencies(this.relevantDependencies, necessaryDependencies, alwaysCheckedDependencies); + } + for (const dependency of necessaryDependencies) { + this.relevantDependencies.add(dependency); + } + return this.relevantDependencies; + } + getExportNamesByVariable() { + if (this.exportNamesByVariable) { + return this.exportNamesByVariable; + } + const exportNamesByVariable = new Map(); + for (const exportName of this.getAllExportNames()) { + let [tracedVariable] = this.getVariableForExportName(exportName); + if (tracedVariable instanceof ExportDefaultVariable) { + tracedVariable = tracedVariable.getOriginalVariable(); + } + if (!tracedVariable || + !(tracedVariable.included || tracedVariable instanceof ExternalVariable)) { + continue; + } + const existingExportNames = exportNamesByVariable.get(tracedVariable); + if (existingExportNames) { + existingExportNames.push(exportName); + } + else { + exportNamesByVariable.set(tracedVariable, [exportName]); + } + } + return (this.exportNamesByVariable = exportNamesByVariable); + } + getExports() { + return [...this.exports.keys()]; + } + getReexports() { + if (this.transitiveReexports) { + return this.transitiveReexports; + } + // to avoid infinite recursion when using circular `export * from X` + this.transitiveReexports = []; + const reexports = new Set(this.reexportDescriptions.keys()); + for (const module of this.exportAllModules) { + if (module instanceof ExternalModule) { + reexports.add(`*${module.id}`); + } + else { + for (const name of [...module.getReexports(), ...module.getExports()]) { + if (name !== 'default') + reexports.add(name); + } + } + } + return (this.transitiveReexports = [...reexports]); + } + getRenderedExports() { + // only direct exports are counted here, not reexports at all + const renderedExports = []; + const removedExports = []; + for (const exportName of this.exports.keys()) { + const [variable] = this.getVariableForExportName(exportName); + (variable?.included ? renderedExports : removedExports).push(exportName); + } + return { removedExports, renderedExports }; + } + getSyntheticNamespace() { + if (this.syntheticNamespace === null) { + this.syntheticNamespace = undefined; + [this.syntheticNamespace] = this.getVariableForExportName(typeof this.info.syntheticNamedExports === 'string' + ? this.info.syntheticNamedExports + : 'default', { onlyExplicit: true }); + } + if (!this.syntheticNamespace) { + return error(logSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports)); + } + return this.syntheticNamespace; + } + getVariableForExportName(name, { importerForSideEffects, isExportAllSearch, onlyExplicit, searchedNamesAndModules } = EMPTY_OBJECT) { + if (name[0] === '*') { + if (name.length === 1) { + // export * from './other' + return [this.namespace]; + } + // export * from 'external' + const module = this.graph.modulesById.get(name.slice(1)); + return module.getVariableForExportName('*'); + } + // export { foo } from './other' + const reexportDeclaration = this.reexportDescriptions.get(name); + if (reexportDeclaration) { + const [variable] = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules); + if (!variable) { + return this.error(logMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start); + } + if (importerForSideEffects) { + setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); + if (this.info.moduleSideEffects) { + getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this); + } + } + return [variable]; + } + const exportDeclaration = this.exports.get(name); + if (exportDeclaration) { + if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) { + return [this.exportShimVariable]; + } + const name = exportDeclaration.localName; + const variable = this.traceVariable(name, { + importerForSideEffects, + searchedNamesAndModules + }); + if (importerForSideEffects) { + setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); + getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this); + } + return [variable]; + } + if (onlyExplicit) { + return [null]; + } + if (name !== 'default') { + const foundNamespaceReexport = this.namespaceReexportsByName.get(name) ?? + this.getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules); + this.namespaceReexportsByName.set(name, foundNamespaceReexport); + if (foundNamespaceReexport[0]) { + return foundNamespaceReexport; + } + } + if (this.info.syntheticNamedExports) { + return [ + getOrCreate(this.syntheticExports, name, () => new SyntheticNamedExportVariable(this.astContext, name, this.getSyntheticNamespace())) + ]; + } + // we don't want to create shims when we are just + // probing export * modules for exports + if (!isExportAllSearch && this.options.shimMissingExports) { + this.shimMissingExport(name); + return [this.exportShimVariable]; + } + return [null]; + } + hasEffects() { + return this.info.moduleSideEffects === 'no-treeshake' || this.ast.hasCachedEffects(); + } + include() { + const context = createInclusionContext(); + if (this.ast.shouldBeIncluded(context)) + this.ast.include(context, false); + } + includeAllExports(includeNamespaceMembers) { + if (!this.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(this); + this.graph.needsTreeshakingPass = true; + } + for (const exportName of this.exports.keys()) { + if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) { + const variable = this.getVariableForExportName(exportName)[0]; + if (!variable) { + return error(logMissingEntryExport(exportName, this.id)); + } + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } + } + } + for (const name of this.getReexports()) { + const [variable] = this.getVariableForExportName(name); + if (variable) { + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } + if (variable instanceof ExternalVariable) { + variable.module.reexported = true; + } + } + } + if (includeNamespaceMembers) { + this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces()); + } + } + includeAllInBundle() { + this.ast.include(createInclusionContext(), true); + this.includeAllExports(false); + } + includeExportsByNames(names) { + if (!this.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(this); + this.graph.needsTreeshakingPass = true; + } + let includeNamespaceMembers = false; + for (const name of names) { + const variable = this.getVariableForExportName(name)[0]; + if (variable) { + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } + } + if (!this.exports.has(name) && !this.reexportDescriptions.has(name)) { + includeNamespaceMembers = true; + } + } + if (includeNamespaceMembers) { + this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces()); + } + } + isIncluded() { + // Modules where this.ast is missing have been loaded via this.load and are + // not yet fully processed, hence they cannot be included. + return (this.ast && + (this.ast.included || + this.namespace.included || + this.importedFromNotTreeshaken || + this.exportShimVariable.included)); + } + linkImports() { + this.addModulesToImportDescriptions(this.importDescriptions); + this.addModulesToImportDescriptions(this.reexportDescriptions); + const externalExportAllModules = []; + for (const source of this.exportAllSources) { + const module = this.graph.modulesById.get(this.resolvedIds[source].id); + if (module instanceof ExternalModule) { + externalExportAllModules.push(module); + continue; + } + this.exportAllModules.push(module); + } + this.exportAllModules.push(...externalExportAllModules); + } + log(level, properties, pos) { + this.addLocationToLogProps(properties, pos); + this.options.onLog(level, properties); + } + render(options) { + const source = this.magicString.clone(); + this.ast.render(source, options); + source.trim(); + const { usesTopLevelAwait } = this.astContext; + if (usesTopLevelAwait && options.format !== 'es' && options.format !== 'system') { + return error(logInvalidFormatForTopLevelAwait(this.id, options.format)); + } + return { source, usesTopLevelAwait }; + } + async setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }) { + if (code.startsWith('#!')) { + const shebangEndPosition = code.indexOf('\n'); + this.shebang = code.slice(2, shebangEndPosition); + } + timeStart('generate ast', 3); + this.info.code = code; + this.originalCode = originalCode; + // We need to call decodedSourcemap on the input in case they were hydrated from json in the cache and don't + // have the lazy evaluation cache configured. Right now this isn't enforced by the type system because the + // RollupCache stores `ExistingDecodedSourcemap` instead of `ExistingRawSourcemap` + this.originalSourcemap = decodedSourcemap(originalSourcemap); + this.sourcemapChain = sourcemapChain.map(mapOrMissing => mapOrMissing.missing ? mapOrMissing : decodedSourcemap(mapOrMissing)); + // If coming from cache and this value is already fully decoded, we want to re-encode here to save memory. + resetSourcemapCache(this.originalSourcemap, this.sourcemapChain); + if (transformFiles) { + this.transformFiles = transformFiles; + } + this.transformDependencies = transformDependencies; + this.customTransformCache = customTransformCache; + this.updateOptions(moduleOptions); + const moduleAst = ast ?? (await this.tryParseAsync()); + timeEnd('generate ast', 3); + timeStart('analyze ast', 3); + this.resolvedIds = resolvedIds ?? Object.create(null); + // By default, `id` is the file name. Custom resolvers and loaders + // can change that, but it makes sense to use it for the source file name + const fileName = this.id; + this.magicString = new MagicString(code, { + filename: (this.excludeFromSourcemap ? null : fileName), // don't include plugin helpers in sourcemap + indentExclusionRanges: [] + }); + this.astContext = { + addDynamicImport: this.addDynamicImport.bind(this), + addExport: this.addExport.bind(this), + addImport: this.addImport.bind(this), + addImportMeta: this.addImportMeta.bind(this), + code, // Only needed for debugging + deoptimizationTracker: this.graph.deoptimizationTracker, + error: this.error.bind(this), + fileName, // Needed for warnings + getExports: this.getExports.bind(this), + getModuleExecIndex: () => this.execIndex, + getModuleName: this.basename.bind(this), + getNodeConstructor: (name) => nodeConstructors[name] || nodeConstructors.UnknownNode, + getReexports: this.getReexports.bind(this), + importDescriptions: this.importDescriptions, + includeAllExports: () => this.includeAllExports(true), + includeDynamicImport: this.includeDynamicImport.bind(this), + includeVariableInModule: this.includeVariableInModule.bind(this), + log: this.log.bind(this), + magicString: this.magicString, + manualPureFunctions: this.graph.pureFunctions, + module: this, + moduleContext: this.context, + options: this.options, + requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true), + traceExport: (name) => this.getVariableForExportName(name)[0], + traceVariable: this.traceVariable.bind(this), + usesTopLevelAwait: false + }; + this.scope = new ModuleScope(this.graph.scope, this.astContext); + this.namespace = new NamespaceVariable(this.astContext); + this.ast = new Program(moduleAst, { context: this.astContext, type: 'Module' }, this.scope); + // Assign AST directly if has existing one as there's no way to drop it from memory. + // If cache is enabled, also assign directly as otherwise it takes more CPU and memory to re-compute. + if (ast || this.options.cache !== false) { + this.info.ast = moduleAst; + } + else { + // Make lazy and apply LRU cache to not hog the memory + Object.defineProperty(this.info, 'ast', { + get: () => { + if (this.graph.astLru.has(fileName)) { + return this.graph.astLru.get(fileName); + } + else { + const parsedAst = this.tryParse(); + this.graph.astLru.set(fileName, parsedAst); + return parsedAst; + } + } + }); + } + timeEnd('analyze ast', 3); + } + toJSON() { + return { + ast: this.info.ast, + attributes: this.info.attributes, + code: this.info.code, + customTransformCache: this.customTransformCache, + // eslint-disable-next-line unicorn/prefer-spread + dependencies: Array.from(this.dependencies, getId), + id: this.id, + meta: this.info.meta, + moduleSideEffects: this.info.moduleSideEffects, + originalCode: this.originalCode, + originalSourcemap: this.originalSourcemap, + resolvedIds: this.resolvedIds, + sourcemapChain: this.sourcemapChain, + syntheticNamedExports: this.info.syntheticNamedExports, + transformDependencies: this.transformDependencies, + transformFiles: this.transformFiles + }; + } + traceVariable(name, { importerForSideEffects, isExportAllSearch, searchedNamesAndModules } = EMPTY_OBJECT) { + const localVariable = this.scope.variables.get(name); + if (localVariable) { + return localVariable; + } + const importDescription = this.importDescriptions.get(name); + if (importDescription) { + const otherModule = importDescription.module; + if (otherModule instanceof Module && importDescription.name === '*') { + return otherModule.namespace; + } + const [declaration] = getVariableForExportNameRecursive(otherModule, importDescription.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules); + if (!declaration) { + return this.error(logMissingExport(importDescription.name, this.id, otherModule.id), importDescription.start); + } + return declaration; + } + return null; + } + updateOptions({ meta, moduleSideEffects, syntheticNamedExports }) { + if (moduleSideEffects != null) { + this.info.moduleSideEffects = moduleSideEffects; + } + if (syntheticNamedExports != null) { + this.info.syntheticNamedExports = syntheticNamedExports; + } + if (meta != null) { + Object.assign(this.info.meta, meta); + } + } + addDynamicImport(node) { + let argument = node.source; + if (argument instanceof TemplateLiteral) { + if (argument.quasis.length === 1 && argument.quasis[0].value.cooked) { + argument = argument.quasis[0].value.cooked; + } + } + else if (argument instanceof Literal && typeof argument.value === 'string') { + argument = argument.value; + } + this.dynamicImports.push({ argument, id: null, node, resolution: null }); + } + assertUniqueExportName(name, nodeStart) { + if (this.exports.has(name) || this.reexportDescriptions.has(name)) { + this.error(logDuplicateExportError(name), nodeStart); + } + } + addExport(node) { + if (node instanceof ExportDefaultDeclaration) { + // export default foo; + this.assertUniqueExportName('default', node.start); + this.exports.set('default', { + identifier: node.variable.getAssignedVariableName(), + localName: 'default' + }); + } + else if (node instanceof ExportAllDeclaration) { + const source = node.source.value; + this.addSource(source, node); + if (node.exported) { + // export * as name from './other' + const name = node.exported instanceof Literal ? node.exported.value : node.exported.name; + this.assertUniqueExportName(name, node.exported.start); + this.reexportDescriptions.set(name, { + localName: '*', + module: null, // filled in later, + source, + start: node.start + }); + } + else { + // export * from './other' + this.exportAllSources.add(source); + } + } + else if (node.source instanceof Literal) { + // export { name } from './other' + const source = node.source.value; + this.addSource(source, node); + for (const { exported, local, start } of node.specifiers) { + const name = exported instanceof Literal ? exported.value : exported.name; + this.assertUniqueExportName(name, start); + this.reexportDescriptions.set(name, { + localName: local instanceof Literal ? local.value : local.name, + module: null, // filled in later, + source, + start + }); + } + } + else if (node.declaration) { + const declaration = node.declaration; + if (declaration instanceof VariableDeclaration) { + // export var { foo, bar } = ... + // export var foo = 1, bar = 2; + for (const declarator of declaration.declarations) { + for (const localName of extractAssignedNames(declarator.id)) { + this.assertUniqueExportName(localName, declarator.id.start); + this.exports.set(localName, { identifier: null, localName }); + } + } + } + else { + // export function foo () {} + const localName = declaration.id.name; + this.assertUniqueExportName(localName, declaration.id.start); + this.exports.set(localName, { identifier: null, localName }); + } + } + else { + // export { foo, bar, baz } + for (const { local, exported } of node.specifiers) { + // except for reexports, local must be an Identifier + const localName = local.name; + const exportedName = exported instanceof Identifier ? exported.name : exported.value; + this.assertUniqueExportName(exportedName, exported.start); + this.exports.set(exportedName, { identifier: null, localName }); + } + } + } + addImport(node) { + const source = node.source.value; + this.addSource(source, node); + for (const specifier of node.specifiers) { + const localName = specifier.local.name; + if (this.scope.variables.has(localName) || this.importDescriptions.has(localName)) { + this.error(logRedeclarationError(localName), specifier.local.start); + } + const name = specifier instanceof ImportDefaultSpecifier + ? 'default' + : specifier instanceof ImportNamespaceSpecifier + ? '*' + : specifier.imported instanceof Identifier + ? specifier.imported.name + : specifier.imported.value; + this.importDescriptions.set(localName, { + module: null, // filled in later + name, + source, + start: specifier.start + }); + } + } + addImportMeta(node) { + this.importMetas.push(node); + } + addLocationToLogProps(properties, pos) { + properties.id = this.id; + properties.pos = pos; + let code = this.info.code; + const location = locate(code, pos, { offsetLine: 1 }); + if (location) { + let { column, line } = location; + try { + ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line })); + code = this.originalCode; + } + catch (error_) { + this.options.onLog(LOGLEVEL_WARN, logInvalidSourcemapForError(error_, this.id, column, line, pos)); + } + augmentCodeLocation(properties, { column, line }, code, this.id); + } + } + addModulesToImportDescriptions(importDescription) { + for (const specifier of importDescription.values()) { + const { id } = this.resolvedIds[specifier.source]; + specifier.module = this.graph.modulesById.get(id); + } + } + addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies) { + const handledDependencies = new Set(); + const addSideEffectDependencies = (possibleDependencies) => { + for (const dependency of possibleDependencies) { + if (handledDependencies.has(dependency)) { + continue; + } + handledDependencies.add(dependency); + if (necessaryDependencies.has(dependency)) { + relevantDependencies.add(dependency); + continue; + } + if (!(dependency.info.moduleSideEffects || alwaysCheckedDependencies.has(dependency))) { + continue; + } + if (dependency instanceof ExternalModule || dependency.hasEffects()) { + relevantDependencies.add(dependency); + continue; + } + addSideEffectDependencies(dependency.dependencies); + } + }; + addSideEffectDependencies(this.dependencies); + addSideEffectDependencies(alwaysCheckedDependencies); + } + addSource(source, declaration) { + const parsedAttributes = getAttributesFromImportExportDeclaration(declaration.attributes); + const existingAttributes = this.sourcesWithAttributes.get(source); + if (existingAttributes) { + if (doAttributesDiffer(existingAttributes, parsedAttributes)) { + this.log(LOGLEVEL_WARN, logInconsistentImportAttributes(existingAttributes, parsedAttributes, source, this.id), declaration.start); + } + } + else { + this.sourcesWithAttributes.set(source, parsedAttributes); + } + } + getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules) { + let foundSyntheticDeclaration = null; + const foundInternalDeclarations = new Map(); + const foundExternalDeclarations = new Set(); + for (const module of this.exportAllModules) { + // Synthetic namespaces should not hide "regular" exports of the same name + if (module.info.syntheticNamedExports === name) { + continue; + } + const [variable, indirectExternal] = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, + // We are creating a copy to handle the case where the same binding is + // imported through different namespace reexports gracefully + copyNameToModulesMap(searchedNamesAndModules)); + if (module instanceof ExternalModule || indirectExternal) { + foundExternalDeclarations.add(variable); + } + else if (variable instanceof SyntheticNamedExportVariable) { + if (!foundSyntheticDeclaration) { + foundSyntheticDeclaration = variable; + } + } + else if (variable) { + foundInternalDeclarations.set(variable, module); + } + } + if (foundInternalDeclarations.size > 0) { + const foundDeclarationList = [...foundInternalDeclarations]; + const usedDeclaration = foundDeclarationList[0][0]; + if (foundDeclarationList.length === 1) { + return [usedDeclaration]; + } + this.options.onLog(LOGLEVEL_WARN, logNamespaceConflict(name, this.id, foundDeclarationList.map(([, module]) => module.id))); + // TODO we are pretending it was not found while it should behave like "undefined" + return [null]; + } + if (foundExternalDeclarations.size > 0) { + const foundDeclarationList = [...foundExternalDeclarations]; + const usedDeclaration = foundDeclarationList[0]; + if (foundDeclarationList.length > 1) { + this.options.onLog(LOGLEVEL_WARN, logAmbiguousExternalNamespaces(name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id))); + } + return [usedDeclaration, true]; + } + if (foundSyntheticDeclaration) { + return [foundSyntheticDeclaration]; + } + return [null]; + } + includeAndGetAdditionalMergedNamespaces() { + const externalNamespaces = new Set(); + const syntheticNamespaces = new Set(); + for (const module of [this, ...this.exportAllModules]) { + if (module instanceof ExternalModule) { + const [externalVariable] = module.getVariableForExportName('*'); + externalVariable.include(); + this.includedImports.add(externalVariable); + externalNamespaces.add(externalVariable); + } + else if (module.info.syntheticNamedExports) { + const syntheticNamespace = module.getSyntheticNamespace(); + syntheticNamespace.include(); + this.includedImports.add(syntheticNamespace); + syntheticNamespaces.add(syntheticNamespace); + } + } + return [...syntheticNamespaces, ...externalNamespaces]; + } + includeDynamicImport(node) { + const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution; + if (resolution instanceof Module) { + resolution.includedDynamicImporters.push(this); + const importedNames = this.options.treeshake + ? node.getDeterministicImportedNames() + : undefined; + if (importedNames) { + resolution.includeExportsByNames(importedNames); + } + else { + resolution.includeAllExports(true); + } + } + } + includeVariable(variable) { + const variableModule = variable.module; + if (variable.included) { + if (variableModule instanceof Module && variableModule !== this) { + getAndExtendSideEffectModules(variable, this); + } + } + else { + variable.include(); + this.graph.needsTreeshakingPass = true; + if (variableModule instanceof Module) { + if (!variableModule.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(variableModule); + } + if (variableModule !== this) { + const sideEffectModules = getAndExtendSideEffectModules(variable, this); + for (const module of sideEffectModules) { + if (!module.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(module); + } + } + } + } + } + } + includeVariableInModule(variable) { + this.includeVariable(variable); + const variableModule = variable.module; + if (variableModule && variableModule !== this) { + this.includedImports.add(variable); + } + } + shimMissingExport(name) { + this.options.onLog(LOGLEVEL_WARN, logShimmedExport(this.id, name)); + this.exports.set(name, MISSING_EXPORT_SHIM_DESCRIPTION); + } + tryParse() { + try { + return parseAst(this.info.code); + } + catch (error_) { + return this.error(logModuleParseError(error_, this.id), error_.pos); + } + } + async tryParseAsync() { + try { + return await parseAstAsync(this.info.code); + } + catch (error_) { + return this.error(logModuleParseError(error_, this.id), error_.pos); + } + } +} +// if there is a cyclic import in the reexport chain, we should not +// import from the original module but from the cyclic module to not +// mess up execution order. +function setAlternativeExporterIfCyclic(variable, importer, reexporter) { + if (variable.module instanceof Module && variable.module !== reexporter) { + const exporterCycles = variable.module.cycles; + if (exporterCycles.size > 0) { + const importerCycles = reexporter.cycles; + for (const cycleSymbol of importerCycles) { + if (exporterCycles.has(cycleSymbol)) { + importer.alternativeReexportModules.set(variable, reexporter); + break; + } + } + } + } +} +const copyNameToModulesMap = (searchedNamesAndModules) => searchedNamesAndModules && + // eslint-disable-next-line unicorn/prefer-spread + new Map(Array.from(searchedNamesAndModules, ([name, modules]) => [name, new Set(modules)])); + +function removeJsExtension(name) { + return name.endsWith('.js') ? name.slice(0, -3) : name; +} + +function getCompleteAmdId(options, chunkId) { + if (options.autoId) { + return `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`; + } + return options.id ?? ''; +} + +function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, mechanism = 'return ') { + const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets; + if (!namedExportsMode) { + return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`; + } + let exportBlock = ''; + for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (reexports && namedExportsMode) { + for (const specifier of reexports) { + if (specifier.reexported !== '*') { + const importName = getReexportedImportName(name, specifier.imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, importPath, externalLiveBindings, getPropertyAccess); + if (exportBlock) + exportBlock += n; + if (specifier.imported !== '*' && specifier.needsLiveBinding) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + exportBlock += + `Object.defineProperty(exports,${_}${JSON.stringify(specifier.reexported)},${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}get:${_}${left}${importName}${right}${n}});`; + } + else if (specifier.reexported === '__proto__') { + exportBlock += + `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}value:${_}${importName}${n}});`; + } + else { + exportBlock += `exports${getPropertyAccess(specifier.reexported)}${_}=${_}${importName};`; + } + } + } + } + } + for (const { exported, local } of exports) { + const lhs = `exports${getPropertyAccess(exported)}`; + const rhs = local; + if (lhs !== rhs) { + if (exportBlock) + exportBlock += n; + exportBlock += + exported === '__proto__' + ? `Object.defineProperty(exports,${_}"__proto__",${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}value:${_}${rhs}${n}});` + : `${lhs}${_}=${_}${rhs};`; + } + } + for (const { name, reexports } of dependencies) { + if (reexports && namedExportsMode) { + for (const specifier of reexports) { + if (specifier.reexported === '*') { + if (exportBlock) + exportBlock += n; + const copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!Object.prototype.hasOwnProperty.call(exports,${_}k))${_}${getDefineProperty(name, specifier.needsLiveBinding, t, snippets)}${s}${n}}`; + exportBlock += `Object.keys(${name}).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${copyPropertyIfNecessary});`; + } + } + } + } + if (exportBlock) { + return `${n}${n}${exportBlock}`; + } + return ''; +} +function getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess) { + if (exports.length > 0) { + return exports[0].local; + } + else { + for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (reexports) { + return getReexportedImportName(name, reexports[0].imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, importPath, externalLiveBindings, getPropertyAccess); + } + } + } +} +function getReexportedImportName(moduleVariableName, imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, moduleId, externalLiveBindings, getPropertyAccess) { + if (imported === 'default') { + if (!isChunk) { + const moduleInterop = interop(moduleId); + const variableName = defaultInteropHelpersByInteropType[moduleInterop] + ? defaultVariableName + : moduleVariableName; + return isDefaultAProperty(moduleInterop, externalLiveBindings) + ? `${variableName}${getPropertyAccess('default')}` + : variableName; + } + return depNamedExportsMode + ? `${moduleVariableName}${getPropertyAccess('default')}` + : moduleVariableName; + } + if (imported === '*') { + return (isChunk ? !depNamedExportsMode : namespaceInteropHelpersByInteropType[interop(moduleId)]) + ? namespaceVariableName + : moduleVariableName; + } + return `${moduleVariableName}${getPropertyAccess(imported)}`; +} +function getEsModuleValue(getObject) { + return getObject([['value', 'true']], { + lineBreakIndent: null + }); +} +function getNamespaceMarkers(hasNamedExports, addEsModule, addNamespaceToStringTag, { _, getObject }) { + if (hasNamedExports) { + if (addEsModule) { + if (addNamespaceToStringTag) { + return `Object.defineProperties(exports,${_}${getObject([ + ['__esModule', getEsModuleValue(getObject)], + [null, `[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}`] + ], { + lineBreakIndent: null + })});`; + } + return `Object.defineProperty(exports,${_}'__esModule',${_}${getEsModuleValue(getObject)});`; + } + if (addNamespaceToStringTag) { + return `Object.defineProperty(exports,${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)});`; + } + } + return ''; +} +const getDefineProperty = (name, needsLiveBinding, t, { _, getDirectReturnFunction, n }) => { + if (needsLiveBinding) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`Object.defineProperty(exports,${_}k,${_}{${n}` + + `${t}${t}enumerable:${_}true,${n}` + + `${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})`); + } + return (`k${_}===${_}'__proto__'${_}?${_}Object.defineProperty(exports,${_}k,${_}{${n}` + + `${t}${t}enumerable:${_}true,${n}` + + `${t}${t}value:${_}${name}[k]${n}${t}})${_}:${_}exports[k]${_}=${_}${name}[k]`); +}; + +function getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, indent, snippets) { + const { _, cnst, n } = snippets; + const neededInteropHelpers = new Set(); + const interopStatements = []; + const addInteropStatement = (helperVariableName, helper, dependencyVariableName) => { + neededInteropHelpers.add(helper); + interopStatements.push(`${cnst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`); + }; + for (const { defaultVariableName, imports, importPath, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (isChunk) { + for (const { imported, reexported } of [ + ...(imports || []), + ...(reexports || []) + ]) { + if (imported === '*' && reexported !== '*') { + if (!namedExportsMode) { + addInteropStatement(namespaceVariableName, INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, name); + } + break; + } + } + } + else { + const moduleInterop = interop(importPath); + let hasDefault = false; + let hasNamespace = false; + for (const { imported, reexported } of [ + ...(imports || []), + ...(reexports || []) + ]) { + let helper; + let variableName; + if (imported === 'default') { + if (!hasDefault) { + hasDefault = true; + if (defaultVariableName !== namespaceVariableName) { + variableName = defaultVariableName; + helper = defaultInteropHelpersByInteropType[moduleInterop]; + } + } + } + else if (imported === '*' && reexported !== '*' && !hasNamespace) { + hasNamespace = true; + helper = namespaceInteropHelpersByInteropType[moduleInterop]; + variableName = namespaceVariableName; + } + if (helper) { + addInteropStatement(variableName, helper, name); + } + } + } + } + return `${getHelpersBlock(neededInteropHelpers, accessedGlobals, indent, snippets, externalLiveBindings, freeze, symbols)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`; +} + +function addJsExtension(name) { + return name.endsWith('.js') ? name : name + '.js'; +} + +// AMD resolution will only respect the AMD baseUrl if the .js extension is omitted. +// The assumption is that this makes sense for all relative ids: +// https://requirejs.org/docs/api.html#jsfiles +function updateExtensionForRelativeAmdId(id, forceJsExtensionForImports) { + if (id[0] !== '.') { + return id; + } + return forceJsExtensionForImports ? addJsExtension(id) : removeJsExtension(id); +} + +const require$$0 = [ + "assert", + "async_hooks", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "diagnostics_channel", + "dns", + "domain", + "events", + "fs", + "http", + "http2", + "https", + "inspector", + "module", + "net", + "os", + "path", + "perf_hooks", + "process", + "punycode", + "querystring", + "readline", + "repl", + "stream", + "string_decoder", + "timers", + "tls", + "trace_events", + "tty", + "url", + "util", + "v8", + "vm", + "wasi", + "worker_threads", + "zlib" +]; + +var _static = require$$0; + +const builtinModules = /*@__PURE__*/getDefaultExportFromCjs(_static); + +const nodeBuiltins = new Set([ + ...builtinModules, + // TODO + // remove once builtin-modules includes PR: https://github.com/sindresorhus/builtin-modules/pull/17 + 'assert/strict', + 'dns/promises', + 'fs/promises', + 'path/posix', + 'path/win32', + 'readline/promises', + 'stream/consumers', + 'stream/promises', + 'stream/web', + 'timers/promises', + 'util/types' +]); +function warnOnBuiltins(log, dependencies) { + const externalBuiltins = dependencies + .map(({ importPath }) => importPath) + .filter(importPath => nodeBuiltins.has(importPath) || importPath.startsWith('node:')); + if (externalBuiltins.length === 0) + return; + log(LOGLEVEL_WARN, logMissingNodeBuiltins(externalBuiltins)); +} + +function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, log, outro, snippets }, { amd, esModule, externalLiveBindings, freeze, generatedCode: { symbols }, interop, strict }) { + warnOnBuiltins(log, dependencies); + const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`); + const parameters = dependencies.map(m => m.name); + const { n, getNonArrowFunctionIntro, _ } = snippets; + if (namedExportsMode && hasExports) { + parameters.unshift(`exports`); + deps.unshift(`'exports'`); + } + if (accessedGlobals.has('require')) { + parameters.unshift('require'); + deps.unshift(`'require'`); + } + if (accessedGlobals.has('module')) { + parameters.unshift('module'); + deps.unshift(`'module'`); + } + const completeAmdId = getCompleteAmdId(amd, id); + const defineParameters = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + + (deps.length > 0 ? `[${deps.join(`,${_}`)}],${_}` : ``); + const useStrict = strict ? `${_}'use strict';` : ''; + magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString + .append(`${exportBlock}${namespaceMarkers}${outro}`) + .indent(t) + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + .prepend(`${amd.define}(${defineParameters}(${getNonArrowFunctionIntro(parameters, { + isAsync: false, + name: null + })}{${useStrict}${n}${n}`) + .append(`${n}${n}}));`); +} + +function cjs(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }, { compact, esModule, externalLiveBindings, freeze, interop, generatedCode: { symbols }, strict }) { + const { _, n } = snippets; + const useStrict = strict ? `'use strict';${n}${n}` : ''; + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers += n + n; + } + const importBlock = getImportBlock$1(dependencies, snippets, compact); + const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets); + magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, `module.exports${_}=${_}`); + magicString.append(`${exportBlock}${outro}`); +} +function getImportBlock$1(dependencies, { _, cnst, n }, compact) { + let importBlock = ''; + let definingVariable = false; + for (const { importPath, name, reexports, imports } of dependencies) { + if (!reexports && !imports) { + if (importBlock) { + importBlock += compact && !definingVariable ? ',' : `;${n}`; + } + definingVariable = false; + importBlock += `require('${importPath}')`; + } + else { + importBlock += compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${cnst} `; + definingVariable = true; + importBlock += `${name}${_}=${_}require('${importPath}')`; + } + } + if (importBlock) { + return `${importBlock};${n}${n}`; + } + return ''; +} + +function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, generatedCode: { symbols } }) { + const { n } = snippets; + const importBlock = getImportBlock(dependencies, snippets); + if (importBlock.length > 0) + intro += importBlock.join(n) + n + n; + intro += getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols); + if (intro) + magicString.prepend(intro); + const exportBlock = getExportBlock(exports, snippets); + if (exportBlock.length > 0) + magicString.append(n + n + exportBlock.join(n).trim()); + if (outro) + magicString.append(outro); + magicString.trim(); +} +function getImportBlock(dependencies, { _ }) { + const importBlock = []; + for (const { importPath, reexports, imports, name, attributes } of dependencies) { + const assertion = attributes ? `${_}assert${_}${attributes}` : ''; + const pathWithAssertion = `'${importPath}'${assertion};`; + if (!reexports && !imports) { + importBlock.push(`import${_}${pathWithAssertion}`); + continue; + } + if (imports) { + let defaultImport = null; + let starImport = null; + const importedNames = []; + for (const specifier of imports) { + if (specifier.imported === 'default') { + defaultImport = specifier; + } + else if (specifier.imported === '*') { + starImport = specifier; + } + else { + importedNames.push(specifier); + } + } + if (starImport) { + importBlock.push(`import${_}*${_}as ${starImport.local} from${_}${pathWithAssertion}`); + } + if (defaultImport && importedNames.length === 0) { + importBlock.push(`import ${defaultImport.local} from${_}${pathWithAssertion}`); + } + else if (importedNames.length > 0) { + importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames + .map(specifier => specifier.imported === specifier.local + ? specifier.imported + : `${stringifyIdentifierIfNeeded(specifier.imported)} as ${specifier.local}`) + .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`); + } + } + if (reexports) { + let starExport = null; + const namespaceReexports = []; + const namedReexports = []; + for (const specifier of reexports) { + if (specifier.reexported === '*') { + starExport = specifier; + } + else if (specifier.imported === '*') { + namespaceReexports.push(specifier); + } + else { + namedReexports.push(specifier); + } + } + if (starExport) { + importBlock.push(`export${_}*${_}from${_}${pathWithAssertion}`); + } + if (namespaceReexports.length > 0) { + if (!imports || + !imports.some(specifier => specifier.imported === '*' && specifier.local === name)) { + importBlock.push(`import${_}*${_}as ${name} from${_}${pathWithAssertion}`); + } + for (const specifier of namespaceReexports) { + importBlock.push(`export${_}{${_}${name === specifier.reexported + ? name + : `${name} as ${stringifyIdentifierIfNeeded(specifier.reexported)}`} };`); + } + } + if (namedReexports.length > 0) { + importBlock.push(`export${_}{${_}${namedReexports + .map(specifier => specifier.imported === specifier.reexported + ? stringifyIdentifierIfNeeded(specifier.imported) + : `${stringifyIdentifierIfNeeded(specifier.imported)} as ${stringifyIdentifierIfNeeded(specifier.reexported)}`) + .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`); + } + } + } + return importBlock; +} +function getExportBlock(exports, { _, cnst }) { + const exportBlock = []; + const exportDeclaration = []; + for (const specifier of exports) { + if (specifier.expression) { + exportBlock.push(`${cnst} ${specifier.local}${_}=${_}${specifier.expression};`); + } + exportDeclaration.push(specifier.exported === specifier.local + ? specifier.local + : `${specifier.local} as ${stringifyIdentifierIfNeeded(specifier.exported)}`); + } + if (exportDeclaration.length > 0) { + exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`); + } + return exportBlock; +} + +const keypath = (keypath, getPropertyAccess) => keypath.split('.').map(getPropertyAccess).join(''); + +function setupNamespace(name, root, globals, { _, getPropertyAccess, s }, compact) { + const parts = name.split('.'); + parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0]; + parts.pop(); + let propertyPath = root; + return (parts + .map(part => { + propertyPath += getPropertyAccess(part); + return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}${s}`; + }) + .join(compact ? ',' : '\n') + (compact && parts.length > 0 ? ';' : '\n')); +} +function assignToDeepVariable(deepName, root, globals, assignment, { _, getPropertyAccess }) { + const parts = deepName.split('.'); + parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0]; + const last = parts.pop(); + let propertyPath = root; + let deepAssignment = [ + ...parts.map(part => { + propertyPath += getPropertyAccess(part); + return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}`; + }), + `${propertyPath}${getPropertyAccess(last)}` + ].join(`,${_}`) + `${_}=${_}${assignment}`; + if (parts.length > 0) { + deepAssignment = `(${deepAssignment})`; + } + return deepAssignment; +} + +function trimEmptyImports(dependencies) { + let index = dependencies.length; + while (index--) { + const { imports, reexports } = dependencies[index]; + if (imports || reexports) { + return dependencies.slice(0, index + 1); + } + } + return []; +} + +function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, namedExportsMode, log, outro, snippets }, { compact, esModule, extend, freeze, externalLiveBindings, globals, interop, name, generatedCode: { symbols }, strict }) { + const { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets; + const isNamespaced = name && name.includes('.'); + const useVariableAssignment = !extend && !isNamespaced; + if (name && useVariableAssignment && !isLegal(name)) { + return error(logIllegalIdentifierAsName(name)); + } + warnOnBuiltins(log, dependencies); + const external = trimEmptyImports(dependencies); + const deps = external.map(dep => dep.globalName || 'null'); + const parameters = external.map(m => m.name); + if (hasExports && !name) { + log(LOGLEVEL_WARN, logMissingNameOptionForIifeExport()); + } + if (namedExportsMode && hasExports) { + if (extend) { + deps.unshift(`this${keypath(name, getPropertyAccess)}${_}=${_}this${keypath(name, getPropertyAccess)}${_}||${_}{}`); + parameters.unshift('exports'); + } + else { + deps.unshift('{}'); + parameters.unshift('exports'); + } + } + const useStrict = strict ? `${t}'use strict';${n}` : ''; + const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets); + magicString.prepend(`${intro}${interopBlock}`); + let wrapperIntro = `(${getNonArrowFunctionIntro(parameters, { + isAsync: false, + name: null + })}{${n}${useStrict}${n}`; + if (hasExports) { + if (name && !(extend && namedExportsMode)) { + wrapperIntro = + (useVariableAssignment ? `var ${name}` : `this${keypath(name, getPropertyAccess)}`) + + `${_}=${_}${wrapperIntro}`; + } + if (isNamespaced) { + wrapperIntro = setupNamespace(name, 'this', globals, snippets, compact) + wrapperIntro; + } + } + let wrapperOutro = `${n}${n}})(${deps.join(`,${_}`)});`; + if (hasExports && !extend && namedExportsMode) { + wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`; + } + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString + .append(`${exportBlock}${namespaceMarkers}${outro}`) + .indent(t) + .prepend(wrapperIntro) + .append(wrapperOutro); +} + +function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, snippets, outro, usesTopLevelAwait }, { externalLiveBindings, freeze, name, generatedCode: { symbols }, strict, systemNullSetters }) { + const { _, getFunctionIntro, getNonArrowFunctionIntro, n, s } = snippets; + const { importBindings, setters, starExcludes } = analyzeDependencies(dependencies, exports, t, snippets); + const registeredName = name ? `'${name}',${_}` : ''; + const wrapperParameters = accessedGlobals.has('module') + ? ['exports', 'module'] + : hasExports + ? ['exports'] + : []; + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + let wrapperStart = `System.register(${registeredName}[` + + dependencies.map(({ importPath }) => `'${importPath}'`).join(`,${_}`) + + `],${_}(${getNonArrowFunctionIntro(wrapperParameters, { + isAsync: false, + name: null + })}{${n}${t}${strict ? "'use strict';" : ''}` + + getStarExcludesBlock(starExcludes, t, snippets) + + getImportBindingsBlock(importBindings, t, snippets) + + `${n}${t}return${_}{${setters.length > 0 + ? `${n}${t}${t}setters:${_}[${setters + .map(setter => setter + ? `${getFunctionIntro(['module'], { + isAsync: false, + name: null + })}{${n}${t}${t}${t}${setter}${n}${t}${t}}` + : systemNullSetters + ? `null` + : `${getFunctionIntro([], { isAsync: false, name: null })}{}`) + .join(`,${_}`)}],` + : ''}${n}`; + wrapperStart += `${t}${t}execute:${_}(${getNonArrowFunctionIntro([], { + isAsync: usesTopLevelAwait, + name: null + })}{${n}${n}`; + const wrapperEnd = `${t}${t}})${n}${t}}${s}${n}}));`; + magicString + .prepend(intro + + getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols) + + getHoistedExportsBlock(exports, t, snippets)) + .append(`${outro}${n}${n}` + + getSyntheticExportsBlock(exports, t, snippets) + + getMissingExportsBlock(exports, t, snippets)) + .indent(`${t}${t}${t}`) + .append(wrapperEnd) + .prepend(wrapperStart); +} +function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, getPropertyAccess, n }) { + const importBindings = []; + const setters = []; + let starExcludes = null; + for (const { imports, reexports } of dependencies) { + const setter = []; + if (imports) { + for (const specifier of imports) { + importBindings.push(specifier.local); + if (specifier.imported === '*') { + setter.push(`${specifier.local}${_}=${_}module;`); + } + else { + setter.push(`${specifier.local}${_}=${_}module${getPropertyAccess(specifier.imported)};`); + } + } + } + if (reexports) { + const reexportedNames = []; + let hasStarReexport = false; + for (const { imported, reexported } of reexports) { + if (reexported === '*') { + hasStarReexport = true; + } + else { + reexportedNames.push([ + reexported, + imported === '*' ? 'module' : `module${getPropertyAccess(imported)}` + ]); + } + } + if (reexportedNames.length > 1 || hasStarReexport) { + if (hasStarReexport) { + if (!starExcludes) { + starExcludes = getStarExcludes({ dependencies, exports }); + } + reexportedNames.unshift([null, `__proto__:${_}null`]); + const exportMapping = getObject(reexportedNames, { lineBreakIndent: null }); + setter.push(`${cnst} setter${_}=${_}${exportMapping};`, `for${_}(${cnst} name in module)${_}{`, `${t}if${_}(!_starExcludes[name])${_}setter[name]${_}=${_}module[name];`, '}', 'exports(setter);'); + } + else { + const exportMapping = getObject(reexportedNames, { lineBreakIndent: null }); + setter.push(`exports(${exportMapping});`); + } + } + else { + const [key, value] = reexportedNames[0]; + setter.push(`exports(${JSON.stringify(key)},${_}${value});`); + } + } + setters.push(setter.join(`${n}${t}${t}${t}`)); + } + return { importBindings, setters, starExcludes }; +} +const getStarExcludes = ({ dependencies, exports }) => { + const starExcludes = new Set(exports.map(expt => expt.exported)); + starExcludes.add('default'); + for (const { reexports } of dependencies) { + if (reexports) { + for (const reexport of reexports) { + if (reexport.reexported !== '*') + starExcludes.add(reexport.reexported); + } + } + } + return starExcludes; +}; +const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => { + if (starExcludes) { + const fields = [...starExcludes].map(property => [ + property, + '1' + ]); + fields.unshift([null, `__proto__:${_}null`]); + return `${n}${t}${cnst} _starExcludes${_}=${_}${getObject(fields, { + lineBreakIndent: { base: t, t } + })};`; + } + return ''; +}; +const getImportBindingsBlock = (importBindings, t, { _, n }) => (importBindings.length > 0 ? `${n}${t}var ${importBindings.join(`,${_}`)};` : ''); +const getHoistedExportsBlock = (exports, t, snippets) => getExportsBlock(exports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets); +function getExportsBlock(exports, t, { _, n }) { + if (exports.length === 0) { + return ''; + } + if (exports.length === 1) { + return `exports(${JSON.stringify(exports[0].name)},${_}${exports[0].value});${n}${n}`; + } + return (`exports({${n}` + + exports + .map(({ name, value }) => `${t}${stringifyObjectKeyIfNeeded(name)}:${_}${value}`) + .join(`,${n}`) + + `${n}});${n}${n}`); +} +const getSyntheticExportsBlock = (exports, t, snippets) => getExportsBlock(exports + .filter(expt => expt.expression) + .map(expt => ({ name: expt.exported, value: expt.local })), t, snippets); +const getMissingExportsBlock = (exports, t, snippets) => getExportsBlock(exports + .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE) + .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), t, snippets); + +function globalProperty(name, globalVariable, getPropertyAccess) { + if (!name) + return 'null'; + return `${globalVariable}${keypath(name, getPropertyAccess)}`; +} +function safeAccess(name, globalVariable, { _, getPropertyAccess }) { + let propertyPath = globalVariable; + return name + .split('.') + .map(part => (propertyPath += getPropertyAccess(part))) + .join(`${_}&&${_}`); +} +function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, namedExportsMode, log, outro, snippets }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, generatedCode: { symbols }, globals, noConflict, strict }) { + const { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets; + const factoryVariable = compact ? 'f' : 'factory'; + const globalVariable = compact ? 'g' : 'global'; + if (hasExports && !name) { + return error(logMissingNameOptionForUmdExport()); + } + warnOnBuiltins(log, dependencies); + const amdDeps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`); + const cjsDeps = dependencies.map(m => `require('${m.importPath}')`); + const trimmedImports = trimEmptyImports(dependencies); + const globalDeps = trimmedImports.map(module => globalProperty(module.globalName, globalVariable, getPropertyAccess)); + const factoryParameters = trimmedImports.map(m => m.name); + if (namedExportsMode && (hasExports || noConflict)) { + amdDeps.unshift(`'exports'`); + cjsDeps.unshift(`exports`); + globalDeps.unshift(assignToDeepVariable(name, globalVariable, globals, `${extend ? `${globalProperty(name, globalVariable, getPropertyAccess)}${_}||${_}` : ''}{}`, snippets)); + factoryParameters.unshift('exports'); + } + const completeAmdId = getCompleteAmdId(amd, id); + const amdParameters = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + + (amdDeps.length > 0 ? `[${amdDeps.join(`,${_}`)}],${_}` : ``); + const define = amd.define; + const cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``; + const useStrict = strict ? `${_}'use strict';${n}` : ``; + let iifeExport; + if (noConflict) { + const noConflictExportsVariable = compact ? 'e' : 'exports'; + let factory; + if (!namedExportsMode && hasExports) { + factory = `${cnst} ${noConflictExportsVariable}${_}=${_}${assignToDeepVariable(name, globalVariable, globals, `${factoryVariable}(${globalDeps.join(`,${_}`)})`, snippets)};`; + } + else { + const module = globalDeps.shift(); + factory = + `${cnst} ${noConflictExportsVariable}${_}=${_}${module};${n}` + + `${t}${t}${factoryVariable}(${[noConflictExportsVariable, ...globalDeps].join(`,${_}`)});`; + } + iifeExport = + `(${getFunctionIntro([], { isAsync: false, name: null })}{${n}` + + `${t}${t}${cnst} current${_}=${_}${safeAccess(name, globalVariable, snippets)};${n}` + + `${t}${t}${factory}${n}` + + `${t}${t}${noConflictExportsVariable}.noConflict${_}=${_}${getFunctionIntro([], { + isAsync: false, + name: null + })}{${_}` + + `${globalProperty(name, globalVariable, getPropertyAccess)}${_}=${_}current;${_}return ${noConflictExportsVariable}${s}${_}};${n}` + + `${t}})()`; + } + else { + iifeExport = `${factoryVariable}(${globalDeps.join(`,${_}`)})`; + if (!namedExportsMode && hasExports) { + iifeExport = assignToDeepVariable(name, globalVariable, globals, iifeExport, snippets); + } + } + const iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0; + const wrapperParameters = [factoryVariable]; + if (iifeNeedsGlobal) { + wrapperParameters.unshift(globalVariable); + } + const globalArgument = iifeNeedsGlobal ? `this,${_}` : ''; + const iifeStart = iifeNeedsGlobal + ? `(${globalVariable}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVariable}${_}||${_}self,${_}` + : ''; + const iifeEnd = iifeNeedsGlobal ? ')' : ''; + const cjsIntro = iifeNeedsGlobal + ? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` + + `${_}${cjsExport}${factoryVariable}(${cjsDeps.join(`,${_}`)})${_}:${n}` + : ''; + const wrapperIntro = `(${getNonArrowFunctionIntro(wrapperParameters, { isAsync: false, name: null })}{${n}` + + cjsIntro + + `${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParameters}${factoryVariable})${_}:${n}` + + `${t}${iifeStart}${iifeExport}${iifeEnd};${n}` + + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + `})(${globalArgument}(${getNonArrowFunctionIntro(factoryParameters, { + isAsync: false, + name: null + })}{${useStrict}${n}`; + const wrapperOutro = n + n + '}));'; + magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString + .append(`${exportBlock}${namespaceMarkers}${outro}`) + .trim() + .indent(t) + .append(wrapperOutro) + .prepend(wrapperIntro); +} + +const finalisers = { amd, cjs, es, iife, system, umd }; + +const concatSeparator = (out, next) => (next ? `${out}\n${next}` : out); +const concatDblSeparator = (out, next) => (next ? `${out}\n\n${next}` : out); +async function createAddons(options, outputPluginDriver, chunk) { + try { + let [banner, footer, intro, outro] = await Promise.all([ + outputPluginDriver.hookReduceValue('banner', options.banner(chunk), [chunk], concatSeparator), + outputPluginDriver.hookReduceValue('footer', options.footer(chunk), [chunk], concatSeparator), + outputPluginDriver.hookReduceValue('intro', options.intro(chunk), [chunk], concatDblSeparator), + outputPluginDriver.hookReduceValue('outro', options.outro(chunk), [chunk], concatDblSeparator) + ]); + if (intro) + intro += '\n\n'; + if (outro) + outro = `\n\n${outro}`; + if (banner) + banner += '\n'; + if (footer) + footer = '\n' + footer; + return { banner, footer, intro, outro }; + } + catch (error_) { + return error(logAddonNotGenerated(error_.message, error_.hook, error_.plugin)); + } +} + +const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = { + amd: deconflictImportsOther, + cjs: deconflictImportsOther, + es: deconflictImportsEsmOrSystem, + iife: deconflictImportsOther, + system: deconflictImportsEsmOrSystem, + umd: deconflictImportsOther +}; +function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) { + const reversedModules = [...modules].reverse(); + for (const module of reversedModules) { + module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope); + } + deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces); + DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports); + for (const module of reversedModules) { + module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } +} +function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports) { + // This is needed for namespace reexports + for (const dependency of dependenciesToBeDeconflicted.dependencies) { + if (preserveModules || dependency instanceof ExternalChunk) { + dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames, null); + } + } + for (const variable of imports) { + const module = variable.module; + const name = variable.name; + if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) { + variable.setRenderNames(null, (module instanceof ExternalModule + ? externalChunkByModule.get(module) + : chunkByModule.get(module)).variableName); + } + else if (module instanceof ExternalModule && name === 'default') { + variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included) + ? module.suggestedVariableName + '__default' + : module.suggestedVariableName, usedNames, variable.forbiddenNames)); + } + else { + variable.setRenderNames(null, getSafeName(makeLegal(name), usedNames, variable.forbiddenNames)); + } + } + for (const variable of syntheticExports) { + variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames)); + } +} +function deconflictImportsOther(usedNames, imports, { deconflictedDefault, deconflictedNamespace, dependencies }, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule) { + for (const chunk of dependencies) { + chunk.variableName = getSafeName(chunk.suggestedVariableName, usedNames, null); + } + for (const chunk of deconflictedNamespace) { + chunk.namespaceVariableName = getSafeName(`${chunk.suggestedVariableName}__namespace`, usedNames, null); + } + for (const externalModule of deconflictedDefault) { + externalModule.defaultVariableName = + deconflictedNamespace.has(externalModule) && + canDefaultBeTakenFromNamespace(interop(externalModule.id), externalLiveBindings) + ? externalModule.namespaceVariableName + : getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames, null); + } + for (const variable of imports) { + const module = variable.module; + if (module instanceof ExternalModule) { + const chunk = externalChunkByModule.get(module); + const name = variable.name; + if (name === 'default') { + const moduleInterop = interop(module.id); + const variableName = defaultInteropHelpersByInteropType[moduleInterop] + ? chunk.defaultVariableName + : chunk.variableName; + if (isDefaultAProperty(moduleInterop, externalLiveBindings)) { + variable.setRenderNames(variableName, 'default'); + } + else { + variable.setRenderNames(null, variableName); + } + } + else if (name === '*') { + variable.setRenderNames(null, namespaceInteropHelpersByInteropType[interop(module.id)] + ? chunk.namespaceVariableName + : chunk.variableName); + } + else { + // if the second parameter is `null`, it uses its "name" for the property name + variable.setRenderNames(chunk.variableName, null); + } + } + else { + const chunk = chunkByModule.get(module); + if (preserveModules && variable.isNamespace) { + variable.setRenderNames(null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName); + } + else if (chunk.exportMode === 'default') { + variable.setRenderNames(null, chunk.variableName); + } + else { + variable.setRenderNames(chunk.variableName, chunk.getVariableExportName(variable)); + } + } + } +} +function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) { + for (const module of modules) { + for (const variable of module.scope.variables.values()) { + if (variable.included && + // this will only happen for exports in some formats + !(variable.renderBaseName || + (variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) { + variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames)); + } + } + if (includedNamespaces.has(module)) { + const namespace = module.namespace; + namespace.setRenderNames(null, getSafeName(namespace.name, usedNames, namespace.forbiddenNames)); + } + } +} + +function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) { + let nameIndex = 0; + for (const variable of exports) { + let [exportName] = variable.name; + if (exportsByName.has(exportName)) { + do { + exportName = toBase64(++nameIndex); + // skip past leading number identifiers + if (exportName.charCodeAt(0) === 49 /* '1' */) { + nameIndex += 9 * 64 ** (exportName.length - 1); + exportName = toBase64(nameIndex); + } + } while (RESERVED_NAMES.has(exportName) || exportsByName.has(exportName)); + } + exportsByName.set(exportName, variable); + exportNamesByVariable.set(variable, [exportName]); + } +} +function assignExportsToNames(exports, exportsByName, exportNamesByVariable) { + for (const variable of exports) { + let nameIndex = 0; + let exportName = variable.name; + while (exportsByName.has(exportName)) { + exportName = variable.name + '$' + ++nameIndex; + } + exportsByName.set(exportName, variable); + exportNamesByVariable.set(variable, [exportName]); + } +} + +function getExportMode(chunk, { exports: exportMode, name, format }, facadeModuleId, log) { + const exportKeys = chunk.getExportNames(); + if (exportMode === 'default') { + if (exportKeys.length !== 1 || exportKeys[0] !== 'default') { + return error(logIncompatibleExportOptionValue('default', exportKeys, facadeModuleId)); + } + } + else if (exportMode === 'none' && exportKeys.length > 0) { + return error(logIncompatibleExportOptionValue('none', exportKeys, facadeModuleId)); + } + if (exportMode === 'auto') { + if (exportKeys.length === 0) { + exportMode = 'none'; + } + else if (exportKeys.length === 1 && exportKeys[0] === 'default') { + exportMode = 'default'; + } + else { + if (format !== 'es' && format !== 'system' && exportKeys.includes('default')) { + log(LOGLEVEL_WARN, logMixedExport(facadeModuleId, name)); + } + exportMode = 'named'; + } + } + return exportMode; +} + +function guessIndentString(code) { + const lines = code.split('\n'); + const tabbed = lines.filter(line => /^\t+/.test(line)); + const spaced = lines.filter(line => /^ {2,}/.test(line)); + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numberSpaces = /^ +/.exec(current)[0].length; + return Math.min(numberSpaces, previous); + }, Infinity); + return ' '.repeat(min); +} +function getIndentString(modules, options) { + if (options.indent !== true) + return options.indent; + for (const module of modules) { + const indent = guessIndentString(module.originalCode); + if (indent !== null) + return indent; + } + return '\t'; +} + +function getStaticDependencies(chunk, orderedModules, chunkByModule, externalChunkByModule) { + const staticDependencyBlocks = []; + const handledDependencies = new Set(); + for (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) { + const module = orderedModules[modulePos]; + if (!handledDependencies.has(module)) { + const staticDependencies = []; + addStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule, externalChunkByModule); + staticDependencyBlocks.unshift(staticDependencies); + } + } + const dependencies = new Set(); + for (const block of staticDependencyBlocks) { + for (const dependency of block) { + dependencies.add(dependency); + } + } + return dependencies; +} +function addStaticDependencies(module, staticDependencies, handledModules, chunk, chunkByModule, externalChunkByModule) { + const dependencies = module.getDependenciesToBeIncluded(); + for (const dependency of dependencies) { + if (dependency instanceof ExternalModule) { + staticDependencies.push(externalChunkByModule.get(dependency)); + continue; + } + const dependencyChunk = chunkByModule.get(dependency); + if (dependencyChunk !== chunk) { + staticDependencies.push(dependencyChunk); + continue; + } + if (!handledModules.has(dependency)) { + handledModules.add(dependency); + addStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule, externalChunkByModule); + } + } +} + +// Four random characters from the private use area to minimize risk of +// conflicts +const hashPlaceholderLeft = '!~{'; +const hashPlaceholderRight = '}~'; +const hashPlaceholderOverhead = hashPlaceholderLeft.length + hashPlaceholderRight.length; +// This is the size of a 128-bits xxhash with base64url encoding +const MAX_HASH_SIZE = 22; +const DEFAULT_HASH_SIZE = 8; +const getHashPlaceholderGenerator = () => { + let nextIndex = 0; + return (optionName, hashSize) => { + if (hashSize > MAX_HASH_SIZE) { + return error(logFailedValidation(`Hashes cannot be longer than ${MAX_HASH_SIZE} characters, received ${hashSize}. Check the "${optionName}" option.`)); + } + const placeholder = `${hashPlaceholderLeft}${toBase64(++nextIndex).padStart(hashSize - hashPlaceholderOverhead, '0')}${hashPlaceholderRight}`; + if (placeholder.length > hashSize) { + return error(logFailedValidation(`To generate hashes for this number of chunks (currently ${nextIndex}), you need a minimum hash size of ${placeholder.length}, received ${hashSize}. Check the "${optionName}" option.`)); + } + return placeholder; + }; +}; +const REPLACER_REGEX = new RegExp(`${hashPlaceholderLeft}[0-9a-zA-Z_$]{1,${MAX_HASH_SIZE - hashPlaceholderOverhead}}${hashPlaceholderRight}`, 'g'); +const replacePlaceholders = (code, hashesByPlaceholder) => code.replace(REPLACER_REGEX, placeholder => hashesByPlaceholder.get(placeholder) || placeholder); +const replaceSinglePlaceholder = (code, placeholder, value) => code.replace(REPLACER_REGEX, match => (match === placeholder ? value : match)); +const replacePlaceholdersWithDefaultAndGetContainedPlaceholders = (code, placeholders) => { + const containedPlaceholders = new Set(); + const transformedCode = code.replace(REPLACER_REGEX, placeholder => { + if (placeholders.has(placeholder)) { + containedPlaceholders.add(placeholder); + return `${hashPlaceholderLeft}${'0'.repeat(placeholder.length - hashPlaceholderOverhead)}${hashPlaceholderRight}`; + } + return placeholder; + }); + return { containedPlaceholders, transformedCode }; +}; + +const lowercaseBundleKeys = Symbol('bundleKeys'); +const FILE_PLACEHOLDER = { + type: 'placeholder' +}; +const getOutputBundle = (outputBundleBase) => { + const reservedLowercaseBundleKeys = new Set(); + return new Proxy(outputBundleBase, { + deleteProperty(target, key) { + if (typeof key === 'string') { + reservedLowercaseBundleKeys.delete(key.toLowerCase()); + } + return Reflect.deleteProperty(target, key); + }, + get(target, key) { + if (key === lowercaseBundleKeys) { + return reservedLowercaseBundleKeys; + } + return Reflect.get(target, key); + }, + set(target, key, value) { + if (typeof key === 'string') { + reservedLowercaseBundleKeys.add(key.toLowerCase()); + } + return Reflect.set(target, key, value); + } + }); +}; +const removeUnreferencedAssets = (outputBundle) => { + const unreferencedAssets = new Set(); + const bundleEntries = Object.values(outputBundle); + for (const asset of bundleEntries) { + asset.type === 'asset' && asset.needsCodeReference && unreferencedAssets.add(asset.fileName); + } + for (const chunk of bundleEntries) { + if (chunk.type === 'chunk') { + for (const referencedFile of chunk.referencedFiles) { + unreferencedAssets.has(referencedFile) && unreferencedAssets.delete(referencedFile); + } + } + } + for (const file of unreferencedAssets) { + delete outputBundle[file]; + } +}; + +function renderNamePattern(pattern, patternName, replacements) { + if (isPathFragment(pattern)) + return error(logFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`)); + return pattern.replace(/\[(\w+)(:\d+)?]/g, (_match, type, size) => { + if (!replacements.hasOwnProperty(type) || (size && type !== 'hash')) { + return error(logFailedValidation(`"[${type}${size || ''}]" is not a valid placeholder in the "${patternName}" pattern.`)); + } + const replacement = replacements[type](size && Number.parseInt(size.slice(1))); + if (isPathFragment(replacement)) + return error(logFailedValidation(`Invalid substitution "${replacement}" for placeholder "[${type}]" in "${patternName}" pattern, can be neither absolute nor relative path.`)); + return replacement; + }); +} +function makeUnique(name, { [lowercaseBundleKeys]: reservedLowercaseBundleKeys }) { + if (!reservedLowercaseBundleKeys.has(name.toLowerCase())) + return name; + const extension = extname(name); + name = name.slice(0, Math.max(0, name.length - extension.length)); + let uniqueName, uniqueIndex = 1; + while (reservedLowercaseBundleKeys.has((uniqueName = name + ++uniqueIndex + extension).toLowerCase())) + ; + return uniqueName; +} + +const NON_ASSET_EXTENSIONS = new Set([ + '.js', + '.jsx', + '.ts', + '.tsx', + '.mjs', + '.mts', + '.cjs', + '.cts' +]); +function getGlobalName(chunk, globals, hasExports, log) { + const globalName = typeof globals === 'function' ? globals(chunk.id) : globals[chunk.id]; + if (globalName) { + return globalName; + } + if (hasExports) { + log(LOGLEVEL_WARN, logMissingGlobalName(chunk.id, chunk.variableName)); + return chunk.variableName; + } +} +class Chunk { + constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias, getPlaceholder, bundle, inputBase, snippets) { + this.orderedModules = orderedModules; + this.inputOptions = inputOptions; + this.outputOptions = outputOptions; + this.unsetOptions = unsetOptions; + this.pluginDriver = pluginDriver; + this.modulesById = modulesById; + this.chunkByModule = chunkByModule; + this.externalChunkByModule = externalChunkByModule; + this.facadeChunkByModule = facadeChunkByModule; + this.includedNamespaces = includedNamespaces; + this.manualChunkAlias = manualChunkAlias; + this.getPlaceholder = getPlaceholder; + this.bundle = bundle; + this.inputBase = inputBase; + this.snippets = snippets; + this.entryModules = []; + this.exportMode = 'named'; + this.facadeModule = null; + this.namespaceVariableName = ''; + this.variableName = ''; + this.accessedGlobalsByScope = new Map(); + this.dependencies = new Set(); + this.dynamicEntryModules = []; + this.dynamicName = null; + this.exportNamesByVariable = new Map(); + this.exports = new Set(); + this.exportsByName = new Map(); + this.fileName = null; + this.implicitEntryModules = []; + this.implicitlyLoadedBefore = new Set(); + this.imports = new Set(); + this.includedDynamicImports = null; + this.includedReexportsByModule = new Map(); + // This may be updated in the constructor + this.isEmpty = true; + this.name = null; + this.needsExportsShim = false; + this.preRenderedChunkInfo = null; + this.preliminaryFileName = null; + this.preliminarySourcemapFileName = null; + this.renderedChunkInfo = null; + this.renderedDependencies = null; + this.renderedModules = Object.create(null); + this.sortedExportNames = null; + this.strictFacade = false; + this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity; + const chunkModules = new Set(orderedModules); + for (const module of orderedModules) { + chunkByModule.set(module, this); + if (module.namespace.included && !outputOptions.preserveModules) { + includedNamespaces.add(module); + } + if (this.isEmpty && module.isIncluded()) { + this.isEmpty = false; + } + if (module.info.isEntry || outputOptions.preserveModules) { + this.entryModules.push(module); + } + for (const importer of module.includedDynamicImporters) { + if (!chunkModules.has(importer)) { + this.dynamicEntryModules.push(module); + // Modules with synthetic exports need an artificial namespace for dynamic imports + if (module.info.syntheticNamedExports) { + includedNamespaces.add(module); + this.exports.add(module.namespace); + } + } + } + if (module.implicitlyLoadedAfter.size > 0) { + this.implicitEntryModules.push(module); + } + } + this.suggestedVariableName = makeLegal(this.generateVariableName()); + } + static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName, getPlaceholder, bundle, inputBase, snippets) { + const chunk = new Chunk([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, null, getPlaceholder, bundle, inputBase, snippets); + chunk.assignFacadeName(facadeName, facadedModule); + if (!facadeChunkByModule.has(facadedModule)) { + facadeChunkByModule.set(facadedModule, chunk); + } + for (const dependency of facadedModule.getDependenciesToBeIncluded()) { + chunk.dependencies.add(dependency instanceof Module + ? chunkByModule.get(dependency) + : externalChunkByModule.get(dependency)); + } + if (!chunk.dependencies.has(chunkByModule.get(facadedModule)) && + facadedModule.info.moduleSideEffects && + facadedModule.hasEffects()) { + chunk.dependencies.add(chunkByModule.get(facadedModule)); + } + chunk.ensureReexportsAreAvailableForModule(facadedModule); + chunk.facadeModule = facadedModule; + chunk.strictFacade = true; + return chunk; + } + canModuleBeFacade(module, exposedVariables) { + const moduleExportNamesByVariable = module.getExportNamesByVariable(); + // All exports of this chunk need to be exposed by the candidate module + for (const exposedVariable of this.exports) { + if (!moduleExportNamesByVariable.has(exposedVariable)) { + return false; + } + } + // Additionally, we need to expose namespaces of dynamic entries that are not the facade module and exports from other entry modules + for (const exposedVariable of exposedVariables) { + if (!(exposedVariable.module === module || + moduleExportNamesByVariable.has(exposedVariable) || + (exposedVariable instanceof SyntheticNamedExportVariable && + moduleExportNamesByVariable.has(exposedVariable.getBaseVariable())))) { + return false; + } + } + return true; + } + finalizeChunk(code, map, sourcemapFileName, hashesByPlaceholder) { + const renderedChunkInfo = this.getRenderedChunkInfo(); + const finalize = (code) => replacePlaceholders(code, hashesByPlaceholder); + const preliminaryFileName = renderedChunkInfo.fileName; + const fileName = (this.fileName = finalize(preliminaryFileName)); + return { + ...renderedChunkInfo, + code, + dynamicImports: renderedChunkInfo.dynamicImports.map(finalize), + fileName, + implicitlyLoadedBefore: renderedChunkInfo.implicitlyLoadedBefore.map(finalize), + importedBindings: Object.fromEntries(Object.entries(renderedChunkInfo.importedBindings).map(([fileName, bindings]) => [ + finalize(fileName), + bindings + ])), + imports: renderedChunkInfo.imports.map(finalize), + map, + preliminaryFileName, + referencedFiles: renderedChunkInfo.referencedFiles.map(finalize), + sourcemapFileName + }; + } + generateExports() { + this.sortedExportNames = null; + const remainingExports = new Set(this.exports); + if (this.facadeModule !== null && + (this.facadeModule.preserveSignature !== false || this.strictFacade)) { + const exportNamesByVariable = this.facadeModule.getExportNamesByVariable(); + for (const [variable, exportNames] of exportNamesByVariable) { + this.exportNamesByVariable.set(variable, [...exportNames]); + for (const exportName of exportNames) { + this.exportsByName.set(exportName, variable); + } + remainingExports.delete(variable); + } + } + if (this.outputOptions.minifyInternalExports) { + assignExportsToMangledNames(remainingExports, this.exportsByName, this.exportNamesByVariable); + } + else { + assignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable); + } + if (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry)) + this.exportMode = getExportMode(this, this.outputOptions, this.facadeModule.id, this.inputOptions.onLog); + } + generateFacades() { + const facades = []; + const entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]); + const exposedVariables = new Set(this.dynamicEntryModules.map(({ namespace }) => namespace)); + for (const module of entryModules) { + if (module.preserveSignature) { + for (const exportedVariable of module.getExportNamesByVariable().keys()) { + // We need to expose all entry exports from this chunk + if (this.chunkByModule.get(exportedVariable.module) === this) { + exposedVariables.add(exportedVariable); + } + } + } + } + for (const module of entryModules) { + // eslint-disable-next-line unicorn/prefer-spread + const requiredFacades = Array.from(new Set(module.chunkNames.filter(({ isUserDefined }) => isUserDefined).map(({ name }) => name)), + // mapping must run after Set 'name' dedupe + name => ({ + name + })); + if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) { + requiredFacades.push({}); + } + // eslint-disable-next-line unicorn/prefer-spread + requiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName }))); + if (requiredFacades.length === 0) { + requiredFacades.push({}); + } + if (!this.facadeModule) { + const needsStrictFacade = !this.outputOptions.preserveModules && + (module.preserveSignature === 'strict' || + (module.preserveSignature === 'exports-only' && + module.getExportNamesByVariable().size > 0)); + if (!needsStrictFacade || this.canModuleBeFacade(module, exposedVariables)) { + this.facadeModule = module; + this.facadeChunkByModule.set(module, this); + if (module.preserveSignature) { + this.strictFacade = needsStrictFacade; + } + this.assignFacadeName(requiredFacades.shift(), module, this.outputOptions.preserveModules); + } + } + for (const facadeName of requiredFacades) { + facades.push(Chunk.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName, this.getPlaceholder, this.bundle, this.inputBase, this.snippets)); + } + } + for (const module of this.dynamicEntryModules) { + if (module.info.syntheticNamedExports) + continue; + if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) { + this.facadeModule = module; + this.facadeChunkByModule.set(module, this); + this.strictFacade = true; + this.dynamicName = getChunkNameFromModule(module); + } + else if (this.facadeModule === module && + !this.strictFacade && + this.canModuleBeFacade(module, exposedVariables)) { + this.strictFacade = true; + } + else if (!this.facadeChunkByModule.get(module)?.strictFacade) { + this.includedNamespaces.add(module); + this.exports.add(module.namespace); + } + } + if (!this.outputOptions.preserveModules) { + this.addNecessaryImportsForFacades(); + } + return facades; + } + getChunkName() { + return (this.name ??= this.outputOptions.sanitizeFileName(this.getFallbackChunkName())); + } + getExportNames() { + return (this.sortedExportNames ??= [...this.exportsByName.keys()].sort()); + } + getFileName() { + return this.fileName || this.getPreliminaryFileName().fileName; + } + getImportPath(importer) { + return escapeId(getImportPath(importer, this.getFileName(), this.outputOptions.format === 'amd' && !this.outputOptions.amd.forceJsExtensionForImports, true)); + } + getPreliminaryFileName() { + if (this.preliminaryFileName) { + return this.preliminaryFileName; + } + let fileName; + let hashPlaceholder = null; + const { chunkFileNames, entryFileNames, file, format, preserveModules } = this.outputOptions; + if (file) { + fileName = basename(file); + } + else if (this.fileName === null) { + const [pattern, patternName] = preserveModules || this.facadeModule?.isUserDefinedEntryPoint + ? [entryFileNames, 'output.entryFileNames'] + : [chunkFileNames, 'output.chunkFileNames']; + fileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, { + format: () => format, + hash: size => hashPlaceholder || + (hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)), + name: () => this.getChunkName() + }); + if (!hashPlaceholder) { + fileName = makeUnique(fileName, this.bundle); + } + } + else { + fileName = this.fileName; + } + if (!hashPlaceholder) { + this.bundle[fileName] = FILE_PLACEHOLDER; + } + // Caching is essential to not conflict with the file name reservation above + return (this.preliminaryFileName = { fileName, hashPlaceholder }); + } + getPreliminarySourcemapFileName() { + if (this.preliminarySourcemapFileName) { + return this.preliminarySourcemapFileName; + } + let sourcemapFileName = null; + let hashPlaceholder = null; + const { sourcemapFileNames, format } = this.outputOptions; + if (sourcemapFileNames) { + const [pattern, patternName] = [sourcemapFileNames, 'output.sourcemapFileNames']; + sourcemapFileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, { + chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || '', + format: () => format, + hash: size => hashPlaceholder || + (hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)), + name: () => this.getChunkName() + }); + if (!hashPlaceholder) { + sourcemapFileName = makeUnique(sourcemapFileName, this.bundle); + } + } + else { + return null; + } + return (this.preliminarySourcemapFileName = { fileName: sourcemapFileName, hashPlaceholder }); + } + getRenderedChunkInfo() { + if (this.renderedChunkInfo) { + return this.renderedChunkInfo; + } + return (this.renderedChunkInfo = { + ...this.getPreRenderedChunkInfo(), + dynamicImports: this.getDynamicDependencies().map(resolveFileName), + fileName: this.getFileName(), + // eslint-disable-next-line unicorn/prefer-spread + implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, resolveFileName), + importedBindings: getImportedBindingsPerDependency(this.getRenderedDependencies(), resolveFileName), + // eslint-disable-next-line unicorn/prefer-spread + imports: Array.from(this.dependencies, resolveFileName), + modules: this.renderedModules, + referencedFiles: this.getReferencedFiles() + }); + } + getVariableExportName(variable) { + if (this.outputOptions.preserveModules && variable instanceof NamespaceVariable) { + return '*'; + } + return this.exportNamesByVariable.get(variable)[0]; + } + link() { + this.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule, this.externalChunkByModule); + for (const module of this.orderedModules) { + this.addImplicitlyLoadedBeforeFromModule(module); + this.setUpChunkImportsAndExportsForModule(module); + } + } + async render() { + const { dependencies, exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this; + const { format, hoistTransitiveImports, preserveModules } = outputOptions; + // for static and dynamic entry points, add transitive dependencies to this + // chunk's dependencies to avoid loading latency + if (hoistTransitiveImports && !preserveModules && facadeModule !== null) { + for (const dep of dependencies) { + if (dep instanceof Chunk) + this.inlineChunkDependencies(dep); + } + } + const preliminaryFileName = this.getPreliminaryFileName(); + const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName(); + const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName); + const renderedDependencies = [...this.getRenderedDependencies().values()]; + const renderedExports = exportMode === 'none' ? [] : this.getChunkExportDeclarations(format); + let hasExports = renderedExports.length > 0; + let hasDefaultExport = false; + for (const renderedDependence of renderedDependencies) { + const { reexports } = renderedDependence; + if (reexports?.length) { + hasExports = true; + if (!hasDefaultExport && reexports.some(reexport => reexport.reexported === 'default')) { + hasDefaultExport = true; + } + if (format === 'es') { + renderedDependence.reexports = reexports.filter( + // eslint-disable-next-line unicorn/prefer-array-some + ({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported)); + } + } + } + if (!hasDefaultExport) { + for (const { exported } of renderedExports) { + if (exported === 'default') { + hasDefaultExport = true; + break; + } + } + } + const { intro, outro, banner, footer } = await createAddons(outputOptions, pluginDriver, this.getRenderedChunkInfo()); + finalisers[format](renderedSource, { + accessedGlobals, + dependencies: renderedDependencies, + exports: renderedExports, + hasDefaultExport, + hasExports, + id: preliminaryFileName.fileName, + indent, + intro, + isEntryFacade: preserveModules || (facadeModule !== null && facadeModule.info.isEntry), + isModuleFacade: facadeModule !== null, + log: onLog, + namedExportsMode: exportMode !== 'default', + outro, + snippets, + usesTopLevelAwait + }, outputOptions); + if (banner) + magicString.prepend(banner); + if (format === 'es' || format === 'cjs') { + const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang; + shebang && magicString.prepend(`#!${shebang}\n`); + } + if (footer) + magicString.append(footer); + return { + chunk: this, + magicString, + preliminaryFileName, + preliminarySourcemapFileName, + usedModules + }; + } + addImplicitlyLoadedBeforeFromModule(baseModule) { + const { chunkByModule, implicitlyLoadedBefore } = this; + for (const module of baseModule.implicitlyLoadedBefore) { + const chunk = chunkByModule.get(module); + if (chunk && chunk !== this) { + implicitlyLoadedBefore.add(chunk); + } + } + } + addNecessaryImportsForFacades() { + for (const [module, variables] of this.includedReexportsByModule) { + if (this.includedNamespaces.has(module)) { + for (const variable of variables) { + this.imports.add(variable); + } + } + } + } + assignFacadeName({ fileName, name }, facadedModule, preservePath) { + if (fileName) { + this.fileName = fileName; + } + else { + this.name = this.outputOptions.sanitizeFileName(name || + (preservePath + ? this.getPreserveModulesChunkNameFromModule(facadedModule) + : getChunkNameFromModule(facadedModule))); + } + } + checkCircularDependencyImport(variable, importingModule) { + const variableModule = variable.module; + if (variableModule instanceof Module) { + const exportChunk = this.chunkByModule.get(variableModule); + let alternativeReexportModule; + do { + alternativeReexportModule = importingModule.alternativeReexportModules.get(variable); + if (alternativeReexportModule) { + const exportingChunk = this.chunkByModule.get(alternativeReexportModule); + if (exportingChunk !== exportChunk) { + this.inputOptions.onLog(LOGLEVEL_WARN, logCyclicCrossChunkReexport( + // Namespaces do not have an export name + variableModule.getExportNamesByVariable().get(variable)?.[0] || '*', variableModule.id, alternativeReexportModule.id, importingModule.id, this.outputOptions.preserveModules)); + } + importingModule = alternativeReexportModule; + } + } while (alternativeReexportModule); + } + } + ensureReexportsAreAvailableForModule(module) { + const includedReexports = []; + const map = module.getExportNamesByVariable(); + for (const exportedVariable of map.keys()) { + const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable; + const importedVariable = isSynthetic ? exportedVariable.getBaseVariable() : exportedVariable; + this.checkCircularDependencyImport(importedVariable, module); + // When preserving modules, we do not create namespace objects but directly + // use the actual namespaces, which would be broken by this logic. + if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) { + const exportingModule = importedVariable.module; + if (exportingModule instanceof Module) { + const chunk = this.chunkByModule.get(exportingModule); + if (chunk && chunk !== this) { + chunk.exports.add(importedVariable); + includedReexports.push(importedVariable); + if (isSynthetic) { + this.imports.add(importedVariable); + } + } + } + } + } + if (includedReexports.length > 0) { + this.includedReexportsByModule.set(module, includedReexports); + } + } + generateVariableName() { + if (this.manualChunkAlias) { + return this.manualChunkAlias; + } + const moduleForNaming = this.entryModules[0] || + this.implicitEntryModules[0] || + this.dynamicEntryModules[0] || + this.orderedModules[this.orderedModules.length - 1]; + if (moduleForNaming) { + return getChunkNameFromModule(moduleForNaming); + } + return 'chunk'; + } + getChunkExportDeclarations(format) { + const exports = []; + for (const exportName of this.getExportNames()) { + if (exportName[0] === '*') + continue; + const variable = this.exportsByName.get(exportName); + if (!(variable instanceof SyntheticNamedExportVariable)) { + const module = variable.module; + if (module) { + const chunk = this.chunkByModule.get(module); + if (chunk !== this) { + if (!chunk || format !== 'es') { + continue; + } + const chunkDep = this.renderedDependencies.get(chunk); + if (!chunkDep) { + continue; + } + const { imports, reexports } = chunkDep; + const importedByReexported = reexports?.find(({ reexported }) => reexported === exportName); + const isImported = imports?.find(({ imported }) => imported === importedByReexported?.imported); + if (!isImported) { + continue; + } + } + } + } + let expression = null; + let hoisted = false; + let local = variable.getName(this.snippets.getPropertyAccess); + if (variable instanceof LocalVariable) { + for (const declaration of variable.declarations) { + if (declaration.parent instanceof FunctionDeclaration || + (declaration instanceof ExportDefaultDeclaration && + declaration.declaration instanceof FunctionDeclaration)) { + hoisted = true; + break; + } + } + } + else if (variable instanceof SyntheticNamedExportVariable) { + expression = local; + if (format === 'es') { + local = variable.renderName; + } + } + exports.push({ + exported: exportName, + expression, + hoisted, + local + }); + } + return exports; + } + getDependenciesToBeDeconflicted(addNonNamespacesAndInteropHelpers, addDependenciesWithoutBindings, interop) { + const dependencies = new Set(); + const deconflictedDefault = new Set(); + const deconflictedNamespace = new Set(); + for (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) { + if (addNonNamespacesAndInteropHelpers || variable.isNamespace) { + const module = variable.module; + if (module instanceof ExternalModule) { + const chunk = this.externalChunkByModule.get(module); + dependencies.add(chunk); + if (addNonNamespacesAndInteropHelpers) { + if (variable.name === 'default') { + if (defaultInteropHelpersByInteropType[interop(module.id)]) { + deconflictedDefault.add(chunk); + } + } + else if (variable.name === '*' && + namespaceInteropHelpersByInteropType[interop(module.id)]) { + deconflictedNamespace.add(chunk); + } + } + } + else { + const chunk = this.chunkByModule.get(module); + if (chunk !== this) { + dependencies.add(chunk); + if (addNonNamespacesAndInteropHelpers && + chunk.exportMode === 'default' && + variable.isNamespace) { + deconflictedNamespace.add(chunk); + } + } + } + } + } + if (addDependenciesWithoutBindings) { + for (const dependency of this.dependencies) { + dependencies.add(dependency); + } + } + return { deconflictedDefault, deconflictedNamespace, dependencies }; + } + getDynamicDependencies() { + return this.getIncludedDynamicImports() + .map(resolvedDynamicImport => resolvedDynamicImport.facadeChunk || + resolvedDynamicImport.chunk || + resolvedDynamicImport.externalChunk || + resolvedDynamicImport.resolution) + .filter((resolution) => resolution !== this && + (resolution instanceof Chunk || resolution instanceof ExternalChunk)); + } + getDynamicImportStringAndAttributes(resolution, fileName) { + if (resolution instanceof ExternalModule) { + const chunk = this.externalChunkByModule.get(resolution); + return [`'${chunk.getImportPath(fileName)}'`, chunk.getImportAttributes(this.snippets)]; + } + return [ + resolution || '', + (this.outputOptions.format === 'es' && this.outputOptions.externalImportAttributes) || null + ]; + } + getFallbackChunkName() { + if (this.manualChunkAlias) { + return this.manualChunkAlias; + } + if (this.dynamicName) { + return this.dynamicName; + } + if (this.fileName) { + return getAliasName(this.fileName); + } + return getAliasName(this.orderedModules[this.orderedModules.length - 1].id); + } + getImportSpecifiers() { + const { interop } = this.outputOptions; + const importsByDependency = new Map(); + for (const variable of this.imports) { + const module = variable.module; + let dependency; + let imported; + if (module instanceof ExternalModule) { + dependency = this.externalChunkByModule.get(module); + imported = variable.name; + if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { + return error(logUnexpectedNamedImport(module.id, imported, false)); + } + } + else { + dependency = this.chunkByModule.get(module); + imported = dependency.getVariableExportName(variable); + } + getOrCreate(importsByDependency, dependency, getNewArray).push({ + imported, + local: variable.getName(this.snippets.getPropertyAccess) + }); + } + return importsByDependency; + } + getIncludedDynamicImports() { + if (this.includedDynamicImports) { + return this.includedDynamicImports; + } + const includedDynamicImports = []; + for (const module of this.orderedModules) { + for (const { node, resolution } of module.dynamicImports) { + if (!node.included) { + continue; + } + includedDynamicImports.push(resolution instanceof Module + ? { + chunk: this.chunkByModule.get(resolution), + externalChunk: null, + facadeChunk: this.facadeChunkByModule.get(resolution), + node, + resolution + } + : resolution instanceof ExternalModule + ? { + chunk: null, + externalChunk: this.externalChunkByModule.get(resolution), + facadeChunk: null, + node, + resolution + } + : { chunk: null, externalChunk: null, facadeChunk: null, node, resolution }); + } + } + return (this.includedDynamicImports = includedDynamicImports); + } + getPreRenderedChunkInfo() { + if (this.preRenderedChunkInfo) { + return this.preRenderedChunkInfo; + } + const { dynamicEntryModules, facadeModule, implicitEntryModules, orderedModules } = this; + return (this.preRenderedChunkInfo = { + exports: this.getExportNames(), + facadeModuleId: facadeModule && facadeModule.id, + isDynamicEntry: dynamicEntryModules.length > 0, + isEntry: !!facadeModule?.info.isEntry, + isImplicitEntry: implicitEntryModules.length > 0, + moduleIds: orderedModules.map(({ id }) => id), + name: this.getChunkName(), + type: 'chunk' + }); + } + getPreserveModulesChunkNameFromModule(module) { + const predefinedChunkName = getPredefinedChunkNameFromModule(module); + if (predefinedChunkName) + return predefinedChunkName; + const { preserveModulesRoot, sanitizeFileName } = this.outputOptions; + const sanitizedId = sanitizeFileName(normalize(module.id.split(QUERY_HASH_REGEX, 1)[0])); + const extensionName = extname(sanitizedId); + const idWithoutExtension = NON_ASSET_EXTENSIONS.has(extensionName) + ? sanitizedId.slice(0, -extensionName.length) + : sanitizedId; + if (isAbsolute$1(idWithoutExtension)) { + return preserveModulesRoot && resolve$1(idWithoutExtension).startsWith(preserveModulesRoot) + ? idWithoutExtension.slice(preserveModulesRoot.length).replace(/^[/\\]/, '') + : relative$1(this.inputBase, idWithoutExtension); + } + else { + return `_virtual/${basename(idWithoutExtension)}`; + } + } + getReexportSpecifiers() { + const { externalLiveBindings, interop } = this.outputOptions; + const reexportSpecifiers = new Map(); + for (let exportName of this.getExportNames()) { + let dependency; + let imported; + let needsLiveBinding = false; + if (exportName[0] === '*') { + const id = exportName.slice(1); + if (interop(id) === 'defaultOnly') { + this.inputOptions.onLog(LOGLEVEL_WARN, logUnexpectedNamespaceReexport(id)); + } + needsLiveBinding = externalLiveBindings; + dependency = this.externalChunkByModule.get(this.modulesById.get(id)); + imported = exportName = '*'; + } + else { + const variable = this.exportsByName.get(exportName); + if (variable instanceof SyntheticNamedExportVariable) + continue; + const module = variable.module; + if (module instanceof Module) { + dependency = this.chunkByModule.get(module); + if (dependency === this) + continue; + imported = dependency.getVariableExportName(variable); + needsLiveBinding = variable.isReassigned; + } + else { + dependency = this.externalChunkByModule.get(module); + imported = variable.name; + if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { + return error(logUnexpectedNamedImport(module.id, imported, true)); + } + needsLiveBinding = + externalLiveBindings && + (imported !== 'default' || isDefaultAProperty(interop(module.id), true)); + } + } + getOrCreate(reexportSpecifiers, dependency, getNewArray).push({ + imported, + needsLiveBinding, + reexported: exportName + }); + } + return reexportSpecifiers; + } + getReferencedFiles() { + const referencedFiles = new Set(); + for (const module of this.orderedModules) { + for (const meta of module.importMetas) { + const fileName = meta.getReferencedFileName(this.pluginDriver); + if (fileName) { + referencedFiles.add(fileName); + } + } + } + return [...referencedFiles]; + } + getRenderedDependencies() { + if (this.renderedDependencies) { + return this.renderedDependencies; + } + const importSpecifiers = this.getImportSpecifiers(); + const reexportSpecifiers = this.getReexportSpecifiers(); + const renderedDependencies = new Map(); + const fileName = this.getFileName(); + for (const dep of this.dependencies) { + const imports = importSpecifiers.get(dep) || null; + const reexports = reexportSpecifiers.get(dep) || null; + const namedExportsMode = dep instanceof ExternalChunk || dep.exportMode !== 'default'; + const importPath = dep.getImportPath(fileName); + renderedDependencies.set(dep, { + attributes: dep instanceof ExternalChunk ? dep.getImportAttributes(this.snippets) : null, + defaultVariableName: dep.defaultVariableName, + globalName: dep instanceof ExternalChunk && + (this.outputOptions.format === 'umd' || this.outputOptions.format === 'iife') && + getGlobalName(dep, this.outputOptions.globals, (imports || reexports) !== null, this.inputOptions.onLog), + importPath, + imports, + isChunk: dep instanceof Chunk, + name: dep.variableName, + namedExportsMode, + namespaceVariableName: dep.namespaceVariableName, + reexports + }); + } + return (this.renderedDependencies = renderedDependencies); + } + inlineChunkDependencies(chunk) { + for (const dep of chunk.dependencies) { + if (this.dependencies.has(dep)) + continue; + this.dependencies.add(dep); + if (dep instanceof Chunk) { + this.inlineChunkDependencies(dep); + } + } + } + // This method changes properties on the AST before rendering and must not be async + renderModules(fileName) { + const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this; + const { compact, format, freeze, generatedCode: { symbols } } = outputOptions; + const { _, cnst, n } = snippets; + this.setDynamicImportResolutions(fileName); + this.setImportMetaResolutions(fileName); + this.setIdentifierRenderResolutions(); + const magicString = new Bundle$1({ separator: `${n}${n}` }); + const indent = getIndentString(orderedModules, outputOptions); + const usedModules = []; + let hoistedSource = ''; + const accessedGlobals = new Set(); + const renderedModuleSources = new Map(); + const renderOptions = { + accessedDocumentCurrentScript: false, + exportNamesByVariable, + format, + freeze, + indent, + pluginDriver, + snippets, + symbols, + useOriginalName: null + }; + let usesTopLevelAwait = false; + for (const module of orderedModules) { + let renderedLength = 0; + let source; + if (module.isIncluded() || includedNamespaces.has(module)) { + const rendered = module.render(renderOptions); + if (!renderOptions.accessedDocumentCurrentScript && + formatsMaybeAccessDocumentCurrentScript.includes(format)) { + // eslint-disable-next-line unicorn/consistent-destructuring + this.accessedGlobalsByScope.get(module.scope)?.delete(DOCUMENT_CURRENT_SCRIPT); + } + renderOptions.accessedDocumentCurrentScript = false; + ({ source } = rendered); + usesTopLevelAwait ||= rendered.usesTopLevelAwait; + renderedLength = source.length(); + if (renderedLength) { + if (compact && source.lastLine().includes('//')) + source.append('\n'); + renderedModuleSources.set(module, source); + magicString.addSource(source); + usedModules.push(module); + } + const namespace = module.namespace; + if (includedNamespaces.has(module)) { + const rendered = namespace.renderBlock(renderOptions); + if (namespace.renderFirst()) + hoistedSource += n + rendered; + else + magicString.addSource(new MagicString(rendered)); + } + const accessedGlobalVariables = accessedGlobalsByScope.get(module.scope); + if (accessedGlobalVariables) { + for (const name of accessedGlobalVariables) { + accessedGlobals.add(name); + } + } + } + const { renderedExports, removedExports } = module.getRenderedExports(); + renderedModules[module.id] = { + get code() { + return source?.toString() ?? null; + }, + originalLength: module.originalCode.length, + removedExports, + renderedExports, + renderedLength + }; + } + if (hoistedSource) + magicString.prepend(hoistedSource + n + n); + // eslint-disable-next-line unicorn/consistent-destructuring + if (this.needsExportsShim) { + magicString.prepend(`${n}${cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`); + } + const renderedSource = compact ? magicString : magicString.trim(); + if (isEmpty && this.getExportNames().length === 0 && dependencies.size === 0) { + onLog(LOGLEVEL_WARN, logEmptyChunk(this.getChunkName())); + } + return { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait }; + } + setDynamicImportResolutions(fileName) { + const { accessedGlobalsByScope, outputOptions, pluginDriver, snippets } = this; + for (const resolvedDynamicImport of this.getIncludedDynamicImports()) { + if (resolvedDynamicImport.chunk) { + const { chunk, facadeChunk, node, resolution } = resolvedDynamicImport; + if (chunk === this) { + node.setInternalResolution(resolution.namespace); + } + else { + node.setExternalResolution((facadeChunk || chunk).exportMode, resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, `'${(facadeChunk || chunk).getImportPath(fileName)}'`, !facadeChunk?.strictFacade && chunk.exportNamesByVariable.get(resolution.namespace)[0], null); + } + } + else { + const { node, resolution } = resolvedDynamicImport; + const [resolutionString, attributes] = this.getDynamicImportStringAndAttributes(resolution, fileName); + node.setExternalResolution('external', resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, false, attributes); + } + } + } + setIdentifierRenderResolutions() { + const { format, generatedCode: { symbols }, interop, preserveModules, externalLiveBindings } = this.outputOptions; + const syntheticExports = new Set(); + for (const exportName of this.getExportNames()) { + const exportVariable = this.exportsByName.get(exportName); + if (format !== 'es' && + format !== 'system' && + exportVariable.isReassigned && + !exportVariable.isId) { + exportVariable.setRenderNames('exports', exportName); + } + else if (exportVariable instanceof SyntheticNamedExportVariable) { + syntheticExports.add(exportVariable); + } + else { + exportVariable.setRenderNames(null, null); + } + } + for (const module of this.orderedModules) { + if (module.needsExportShim) { + this.needsExportsShim = true; + break; + } + } + const usedNames = new Set(['Object', 'Promise']); + if (this.needsExportsShim) { + usedNames.add(MISSING_EXPORT_SHIM_VARIABLE); + } + if (symbols) { + usedNames.add('Symbol'); + } + switch (format) { + case 'system': { + usedNames.add('module').add('exports'); + break; + } + case 'es': { + break; + } + case 'cjs': { + usedNames.add('module').add('require').add('__filename').add('__dirname'); + } + // fallthrough + default: { + usedNames.add('exports'); + for (const helper of HELPER_NAMES) { + usedNames.add(helper); + } + } + } + deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, preserveModules, externalLiveBindings, this.chunkByModule, this.externalChunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces); + } + setImportMetaResolutions(fileName) { + const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format } } = this; + for (const module of orderedModules) { + for (const importMeta of module.importMetas) { + importMeta.setResolution(format, accessedGlobalsByScope, fileName); + } + if (includedNamespaces.has(module)) { + module.namespace.prepare(accessedGlobalsByScope); + } + } + } + setUpChunkImportsAndExportsForModule(module) { + const moduleImports = new Set(module.includedImports); + // when we are not preserving modules, we need to make all namespace variables available for + // rendering the namespace object + if (!this.outputOptions.preserveModules && this.includedNamespaces.has(module)) { + const memberVariables = module.namespace.getMemberVariables(); + for (const variable of Object.values(memberVariables)) { + if (variable.included) { + moduleImports.add(variable); + } + } + } + for (let variable of moduleImports) { + if (variable instanceof ExportDefaultVariable) { + variable = variable.getOriginalVariable(); + } + if (variable instanceof SyntheticNamedExportVariable) { + variable = variable.getBaseVariable(); + } + const chunk = this.chunkByModule.get(variable.module); + if (chunk !== this) { + this.imports.add(variable); + if (variable.module instanceof Module) { + this.checkCircularDependencyImport(variable, module); + // When preserving modules, we do not create namespace objects but directly + // use the actual namespaces, which would be broken by this logic. + if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules)) { + chunk.exports.add(variable); + } + } + } + } + if (this.includedNamespaces.has(module) || + (module.info.isEntry && module.preserveSignature !== false) || + module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)) { + this.ensureReexportsAreAvailableForModule(module); + } + for (const { node, resolution } of module.dynamicImports) { + if (node.included && + resolution instanceof Module && + this.chunkByModule.get(resolution) === this && + !this.includedNamespaces.has(resolution)) { + this.includedNamespaces.add(resolution); + this.ensureReexportsAreAvailableForModule(resolution); + } + } + } +} +function getChunkNameFromModule(module) { + return getPredefinedChunkNameFromModule(module) ?? getAliasName(module.id); +} +function getPredefinedChunkNameFromModule(module) { + return (module.chunkNames.find(({ isUserDefined }) => isUserDefined)?.name ?? module.chunkNames[0]?.name); +} +function getImportedBindingsPerDependency(renderedDependencies, resolveFileName) { + const importedBindingsPerDependency = {}; + for (const [dependency, declaration] of renderedDependencies) { + const specifiers = new Set(); + if (declaration.imports) { + for (const { imported } of declaration.imports) { + specifiers.add(imported); + } + } + if (declaration.reexports) { + for (const { imported } of declaration.reexports) { + specifiers.add(imported); + } + } + importedBindingsPerDependency[resolveFileName(dependency)] = [...specifiers]; + } + return importedBindingsPerDependency; +} +const QUERY_HASH_REGEX = /[#?]/; +const resolveFileName = (dependency) => dependency.getFileName(); + +/** + * Concatenate a number of iterables to a new iterable without fully evaluating + * their iterators. Useful when e.g. working with large sets or lists and when + * there is a chance that the iterators will not be fully exhausted. + */ +function* concatLazy(iterables) { + for (const iterable of iterables) { + yield* iterable; + } +} + +/** + * At its core, the algorithm first starts from each static or dynamic entry + * point and then assigns that entry point to all modules than can be reached + * via static imports. We call this the *dependent entry points* of that + * module. + * + * Then we group all modules with the same dependent entry points into chunks + * as those modules will always be loaded together. + * + * One non-trivial optimization we can apply is that dynamic entries are + * different from static entries in so far as when a dynamic import occurs, + * some + * modules are already in memory. If some of these modules are also + * dependencies + * of the dynamic entry, then it does not make sense to create a separate chunk + * for them. Instead, the dynamic import target can load them from the + * importing + * chunk. + * + * With regard to chunking, if B is implicitly loaded after A, then this can be + * handled the same way as if there was a dynamic import A => B. + * + * Example: + * Assume A -> B (A imports B), A => C (A dynamically imports C) and C -> B. + * Then the initial algorithm would assign A into the A chunk, C into the C + * chunk and B into the AC chunk, i.e. the chunk with the dependent entry + * points + * A and C. + * However we know that C can only be loaded from A, so A and its dependency B + * must already be in memory when C is loaded. So it is enough to create only + * two chunks A containing [AB] and C containing [C]. + * + * So we do not assign the dynamic entry C as dependent entry point to modules + * that are already loaded. + * + * In a more complex example, let us assume that we have entry points X and Y. + * Further, let us assume + * X -> A, X -> B, X -> C, + * Y -> A, Y -> B, + * A => D, + * D -> B, D -> C + * So without dynamic import optimization, the dependent entry points are + * A: XY, B: DXY, C: DX, D: D, X: X, Y: Y, + * so we would for now create six chunks. + * + * Now D is loaded only after A is loaded. But A is loaded if either X is + * loaded + * or Y is loaded. So the modules that are already in memory when D is loaded + * are the intersection of all modules that X depends on with all modules that + * Y + * depends on, which in this case are the modules A and B. + * We could also say they are all modules that have both X and Y as dependent + * entry points. + * + * So we can remove D as dependent entry point from A and B, which means they + * both now have only XY as dependent entry points and can be merged into the + * same chunk. + * + * Now let us extend this to the most general case where we have several + * dynamic + * importers for one dynamic entry point. + * + * In the most general form, it works like this: + * For each dynamic entry point, we have a number of dynamic importers, which + * are the modules importing it. Using the previous ideas, we can determine + * the modules already in memory for each dynamic importer by looking for all + * modules that have all the dependent entry points of the dynamic importer as + * dependent entry points. + * So the modules that are guaranteed to be in memory when the dynamic entry + * point is loaded are the intersection of the modules already in memory for + * each dynamic importer. + * + * Assuming that A => D and B => D and A has dependent entry points XY and B + * has + * dependent entry points YZ, then the modules guaranteed to be in memory are + * all modules that have at least XYZ as dependent entry points. + * We call XYZ the *dynamically dependent entry points* of D. + * + * Now there is one last case to consider: If one of the dynamically dependent + * entries is itself a dynamic entry, then any module is in memory that either + * is a dependency of that dynamic entry or again has the dynamic dependent + * entries of that dynamic entry as dependent entry points. + * + * A naive algorithm for this proved to be costly as it contained an O(n^3) + * complexity with regard to dynamic entries that blew up for very large + * projects. + * + * If we have an efficient way to do Set operations, an alternative approach + * would be to instead collect already loaded modules per dynamic entry. And as + * all chunks from the initial grouping would behave the same, we can instead + * collect already loaded chunks for a performance improvement. + * + * To do that efficiently, need + * - a Map of dynamic imports per dynamic entry, which contains all dynamic + * imports that can be triggered by a dynamic entry + * - a Map of static dependencies per entry + * - a Map of already loaded chunks per entry that we initially populate with + * empty Sets for static entries and Sets containing all entries for dynamic + * entries + * + * For efficient operations, we assign each entry a numerical index and + * represent Sets of Chunks as BigInt values where each chunk corresponds to a + * bit index. Then thw last two maps can be represented as arrays of BigInt + * values. + * + * Then we iterate through each dynamic entry. We set the already loaded modules + * to the intersection of the previously already loaded modules with the union + * of the already loaded modules of that chunk with its static dependencies. + * + * If the already loaded modules changed, then we use the Map of dynamic imports + * per dynamic entry to marks all dynamic entry dependencies as "dirty" and put + * them back into the iteration. As an additional optimization, we note for + * each dynamic entry which dynamic dependent entries have changed and only + * intersect those entries again on subsequent interations. + * + * Then we remove the dynamic entries from the list of dependent entries for + * those chunks that are already loaded for that dynamic entry and create + * another round of chunks. + */ +function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log) { + const { chunkDefinitions, modulesInManualChunks } = getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry); + const { allEntries, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry } = analyzeModuleGraph(entries); + // Each chunk is identified by its position in this array + const chunkAtoms = getChunksWithSameDependentEntries(getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks)); + const staticDependencyAtomsByEntry = getStaticDependencyAtomsByEntry(allEntries, chunkAtoms); + // Warning: This will consume dynamicallyDependentEntriesByDynamicEntry. + // If we no longer want this, we should make a copy here. + const alreadyLoadedAtomsByEntry = getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, allEntries); + // This mutates the dependentEntries in chunkAtoms + removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry); + const { chunks, sideEffectAtoms, sizeByAtom } = getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize); + chunkDefinitions.push(...getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, log).map(({ modules }) => ({ + alias: null, + modules + }))); + return chunkDefinitions; +} +function getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry) { + const chunkDefinitions = []; + const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys()); + const manualChunkModulesByAlias = Object.create(null); + for (const [entry, alias] of manualChunkAliasByEntry) { + addStaticDependenciesToManualChunk(entry, (manualChunkModulesByAlias[alias] ||= []), modulesInManualChunks); + } + for (const [alias, modules] of Object.entries(manualChunkModulesByAlias)) { + chunkDefinitions.push({ alias, modules }); + } + return { chunkDefinitions, modulesInManualChunks }; +} +function addStaticDependenciesToManualChunk(entry, manualChunkModules, modulesInManualChunks) { + const modulesToHandle = new Set([entry]); + for (const module of modulesToHandle) { + modulesInManualChunks.add(module); + manualChunkModules.push(module); + for (const dependency of module.dependencies) { + if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) { + modulesToHandle.add(dependency); + } + } + } +} +function analyzeModuleGraph(entries) { + const dynamicEntryModules = new Set(); + const dependentEntriesByModule = new Map(); + const dynamicImportModulesByEntry = []; + const allEntriesSet = new Set(entries); + let entryIndex = 0; + for (const currentEntry of allEntriesSet) { + const dynamicImportsForCurrentEntry = new Set(); + dynamicImportModulesByEntry.push(dynamicImportsForCurrentEntry); + const modulesToHandle = new Set([currentEntry]); + for (const module of modulesToHandle) { + getOrCreate(dependentEntriesByModule, module, (getNewSet)).add(entryIndex); + for (const dependency of module.getDependenciesToBeIncluded()) { + if (!(dependency instanceof ExternalModule)) { + modulesToHandle.add(dependency); + } + } + for (const { resolution } of module.dynamicImports) { + if (resolution instanceof Module && + resolution.includedDynamicImporters.length > 0 && + !allEntriesSet.has(resolution)) { + dynamicEntryModules.add(resolution); + allEntriesSet.add(resolution); + dynamicImportsForCurrentEntry.add(resolution); + } + } + for (const dependency of module.implicitlyLoadedBefore) { + if (!allEntriesSet.has(dependency)) { + dynamicEntryModules.add(dependency); + allEntriesSet.add(dependency); + } + } + } + entryIndex++; + } + const allEntries = [...allEntriesSet]; + const { dynamicEntries, dynamicImportsByEntry } = getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry); + return { + allEntries, + dependentEntriesByModule, + dynamicallyDependentEntriesByDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries), + dynamicImportsByEntry + }; +} +function getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry) { + const entryIndexByModule = new Map(); + const dynamicEntries = new Set(); + for (const [entryIndex, entry] of allEntries.entries()) { + entryIndexByModule.set(entry, entryIndex); + if (dynamicEntryModules.has(entry)) { + dynamicEntries.add(entryIndex); + } + } + const dynamicImportsByEntry = []; + for (const dynamicImportModules of dynamicImportModulesByEntry) { + const dynamicImports = new Set(); + for (const dynamicEntry of dynamicImportModules) { + dynamicImports.add(entryIndexByModule.get(dynamicEntry)); + } + dynamicImportsByEntry.push(dynamicImports); + } + return { dynamicEntries, dynamicImportsByEntry }; +} +function getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries) { + const dynamicallyDependentEntriesByDynamicEntry = new Map(); + for (const dynamicEntryIndex of dynamicEntries) { + const dynamicallyDependentEntries = getOrCreate(dynamicallyDependentEntriesByDynamicEntry, dynamicEntryIndex, (getNewSet)); + const dynamicEntry = allEntries[dynamicEntryIndex]; + for (const importer of concatLazy([ + dynamicEntry.includedDynamicImporters, + dynamicEntry.implicitlyLoadedAfter + ])) { + for (const entry of dependentEntriesByModule.get(importer)) { + dynamicallyDependentEntries.add(entry); + } + } + } + return dynamicallyDependentEntriesByDynamicEntry; +} +function getChunksWithSameDependentEntries(modulesWithDependentEntries) { + const chunkModules = Object.create(null); + for (const { dependentEntries, modules } of modulesWithDependentEntries) { + let chunkSignature = 0n; + for (const entryIndex of dependentEntries) { + chunkSignature |= 1n << BigInt(entryIndex); + } + (chunkModules[String(chunkSignature)] ||= { + dependentEntries: new Set(dependentEntries), + modules: [] + }).modules.push(...modules); + } + return Object.values(chunkModules); +} +function* getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks) { + for (const [module, dependentEntries] of dependentEntriesByModule) { + if (!modulesInManualChunks.has(module)) { + yield { dependentEntries, modules: [module] }; + } + } +} +function getStaticDependencyAtomsByEntry(allEntries, chunkAtoms) { + // The indices correspond to the indices in allEntries. The atoms correspond + // to bits in the bigint values where chunk 0 is the lowest bit. + const staticDependencyAtomsByEntry = allEntries.map(() => 0n); + // This toggles the bits for each atom that is a dependency of an entry + let atomMask = 1n; + for (const { dependentEntries } of chunkAtoms) { + for (const entryIndex of dependentEntries) { + staticDependencyAtomsByEntry[entryIndex] |= atomMask; + } + atomMask <<= 1n; + } + return staticDependencyAtomsByEntry; +} +// Warning: This will consume dynamicallyDependentEntriesByDynamicEntry. +function getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, allEntries) { + // Dynamic entries have all atoms as already loaded initially because we then + // intersect with the static dependency atoms of all dynamic importers. + // Static entries cannot have already loaded atoms. + const alreadyLoadedAtomsByEntry = allEntries.map((_entry, entryIndex) => dynamicallyDependentEntriesByDynamicEntry.has(entryIndex) ? -1n : 0n); + for (const [dynamicEntryIndex, dynamicallyDependentEntries] of dynamicallyDependentEntriesByDynamicEntry) { + // We delete here so that they can be added again if necessary to be handled + // again by the loop + dynamicallyDependentEntriesByDynamicEntry.delete(dynamicEntryIndex); + const knownLoadedAtoms = alreadyLoadedAtomsByEntry[dynamicEntryIndex]; + let updatedLoadedAtoms = knownLoadedAtoms; + for (const entryIndex of dynamicallyDependentEntries) { + updatedLoadedAtoms &= + staticDependencyAtomsByEntry[entryIndex] | alreadyLoadedAtomsByEntry[entryIndex]; + } + // If the knownLoadedAtoms changed, all dependent dynamic entries need to be + // updated again + if (updatedLoadedAtoms !== knownLoadedAtoms) { + alreadyLoadedAtomsByEntry[dynamicEntryIndex] = updatedLoadedAtoms; + for (const dynamicImport of dynamicImportsByEntry[dynamicEntryIndex]) { + // If this adds an entry that was deleted before, it will be handled + // again. This is the reason why we delete every entry from this map + // that we processed. + getOrCreate(dynamicallyDependentEntriesByDynamicEntry, dynamicImport, (getNewSet)).add(dynamicEntryIndex); + } + } + } + return alreadyLoadedAtomsByEntry; +} +/** + * This removes all unnecessary dynamic entries from the dependentEntries in its + * first argument if a chunk is already loaded without that entry. + */ +function removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry) { + // Remove entries from dependent entries if a chunk is already loaded without + // that entry. + let chunkMask = 1n; + for (const { dependentEntries } of chunkAtoms) { + for (const entryIndex of dependentEntries) { + if ((alreadyLoadedAtomsByEntry[entryIndex] & chunkMask) === chunkMask) { + dependentEntries.delete(entryIndex); + } + } + chunkMask <<= 1n; + } +} +function getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize) { + const chunksBySignature = Object.create(null); + const chunkByModule = new Map(); + const sizeByAtom = []; + let sideEffectAtoms = 0n; + let atomMask = 1n; + for (const { dependentEntries, modules } of chunkAtoms) { + let chunkSignature = 0n; + let correlatedAtoms = -1n; + for (const entryIndex of dependentEntries) { + chunkSignature |= 1n << BigInt(entryIndex); + // Correlated atoms are the atoms that are guaranteed to be loaded as + // well when a given atom is loaded. It is the intersection of the already + // loaded modules of each chunk merged with its static dependencies. + correlatedAtoms &= + staticDependencyAtomsByEntry[entryIndex] | alreadyLoadedAtomsByEntry[entryIndex]; + } + const chunk = (chunksBySignature[String(chunkSignature)] ||= { + containedAtoms: 0n, + correlatedAtoms, + dependencies: new Set(), + dependentChunks: new Set(), + dependentEntries: new Set(dependentEntries), + modules: [], + pure: true, + size: 0 + }); + let atomSize = 0; + let pure = true; + for (const module of modules) { + chunkByModule.set(module, chunk); + // Unfortunately, we cannot take tree-shaking into account here because + // rendering did not happen yet, but we can detect empty modules + if (module.isIncluded()) { + pure &&= !module.hasEffects(); + // we use a trivial size for the default minChunkSize to improve + // performance + atomSize += minChunkSize > 1 ? module.estimateSize() : 1; + } + } + if (!pure) { + sideEffectAtoms |= atomMask; + } + sizeByAtom.push(atomSize); + chunk.containedAtoms |= atomMask; + chunk.modules.push(...modules); + chunk.pure &&= pure; + chunk.size += atomSize; + atomMask <<= 1n; + } + const chunks = Object.values(chunksBySignature); + sideEffectAtoms |= addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, atomMask); + return { chunks, sideEffectAtoms, sizeByAtom }; +} +function addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, nextAvailableAtomMask) { + const signatureByExternalModule = new Map(); + let externalSideEffectAtoms = 0n; + for (const chunk of chunks) { + const { dependencies, modules } = chunk; + for (const module of modules) { + for (const dependency of module.getDependenciesToBeIncluded()) { + if (dependency instanceof ExternalModule) { + if (dependency.info.moduleSideEffects) { + const signature = getOrCreate(signatureByExternalModule, dependency, () => { + const signature = nextAvailableAtomMask; + nextAvailableAtomMask <<= 1n; + externalSideEffectAtoms |= signature; + return signature; + }); + chunk.containedAtoms |= signature; + chunk.correlatedAtoms |= signature; + } + } + else { + const dependencyChunk = chunkByModule.get(dependency); + if (dependencyChunk && dependencyChunk !== chunk) { + dependencies.add(dependencyChunk); + dependencyChunk.dependentChunks.add(chunk); + } + } + } + } + } + return externalSideEffectAtoms; +} +/** + * This function tries to get rid of small chunks by merging them with other + * chunks. + * + * We can only merge chunks safely if after the merge, loading any entry point + * in any allowed order will not trigger side effects that should not have been + * triggered. While side effects are usually things like global function calls, + * global variable mutations or potentially thrown errors, details do not + * matter here, and we just discern chunks without side effects (pure chunks) + * from other chunks. + * + * As a first step, we assign each pre-generated chunk with side effects a + * label. I.e. we have side effect "A" if the non-pure chunk "A" is loaded. + * + * Now to determine the side effects of loading a chunk, one also has to take + * the side effects of its dependencies into account. So if A depends on B + * (A -> B) and both have side effects, loading A triggers effects AB. + * + * Now from the previous step we know that each chunk is uniquely determine by + * the entry points that depend on it and cause it to load, which we will call + * its dependent entry points. + * + * E.g. if X -> A and Y -> A, then the dependent entry points of A are XY. + * Starting from that idea, we can determine a set of chunks—and thus a set + * of side effects—that must have been triggered if a certain chunk has been + * loaded. Basically, it is the intersection of all chunks loaded by the + * dependent entry points of a given chunk. We call the corresponding side + * effects the correlated side effects of that chunk. + * + * Example: + * X -> ABC, Y -> ADE, A-> F, B -> D + * Then taking dependencies into account, X -> ABCDF, Y -> ADEF + * The intersection is ADF. So we know that when A is loaded, D and F must also + * be in memory even though neither D nor A is a dependency of the other. + * If all have side effects, we call ADF the correlated side effects of A. The + * correlated side effects need to remain constant when merging chunks. + * + * In contrast, we have the dependency side effects of A, which represents + * the side effects we trigger if we directly load A. In this example, the + * dependency side effects are AF. + * For entry chunks, dependency and correlated side effects are the same. + * + * With these concepts, merging chunks is allowed if the correlated side + * effects of each entry do not change. Thus, we are allowed to merge two + * chunks if + * + * a) the dependency side effects of each chunk are a subset of the correlated + * side effects of the other chunk, so no additional side effects are + * triggered for any entry, or + * b) The dependent entry points of chunk A are a subset of the dependent entry + * points of chunk B while the dependency side effects of A are a subset of + * the correlated side effects of B. Because in that scenario, whenever A is + * loaded, B is loaded as well. But there are cases when B is loaded where A + * is not loaded. So if we merge the chunks, all dependency side effects of + * A will be added to the correlated side effects of B, and as the latter is + * not allowed to change, the former need to be a subset of the latter. + * + * Another consideration when merging small chunks into other chunks is to + * avoid + * that too much additional code is loaded. This is achieved when the dependent + * entries of the small chunk are a subset of the dependent entries of the + * other + * chunk. Because then when the small chunk is loaded, the other chunk was + * loaded/in memory anyway, so at most when the other chunk is loaded, the + * additional size of the small chunk is loaded unnecessarily. + * + * So the algorithm performs merges in two passes: + * + * 1. First we try to merge small chunks A only into other chunks B if the + * dependent entries of A are a subset of the dependent entries of B and the + * dependency side effects of A are a subset of the correlated side effects + * of B. + * 2. Only then for all remaining small chunks, we look for arbitrary merges + * following the rule (a), starting with the smallest chunks to look for + * possible merge targets. + */ +function getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, log) { + timeStart('optimize chunks', 3); + const chunkPartition = getPartitionedChunks(chunks, minChunkSize); + if (!chunkPartition) { + timeEnd('optimize chunks', 3); + return chunks; // the actual modules + } + minChunkSize > 1 && + log('info', logOptimizeChunkStatus(chunks.length, chunkPartition.small.size, 'Initially')); + mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom); + minChunkSize > 1 && + log('info', logOptimizeChunkStatus(chunkPartition.small.size + chunkPartition.big.size, chunkPartition.small.size, 'After merging chunks')); + timeEnd('optimize chunks', 3); + return [...chunkPartition.small, ...chunkPartition.big]; +} +function getPartitionedChunks(chunks, minChunkSize) { + const smallChunks = []; + const bigChunks = []; + for (const chunk of chunks) { + (chunk.size < minChunkSize ? smallChunks : bigChunks).push(chunk); + } + if (smallChunks.length === 0) { + return null; + } + smallChunks.sort(compareChunkSize); + bigChunks.sort(compareChunkSize); + return { + big: new Set(bigChunks), + small: new Set(smallChunks) + }; +} +function compareChunkSize({ size: sizeA }, { size: sizeB }) { + return sizeA - sizeB; +} +function mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom) { + const { small } = chunkPartition; + for (const mergedChunk of small) { + const bestTargetChunk = findBestMergeTarget(mergedChunk, chunkPartition, sideEffectAtoms, sizeByAtom, + // In the default case, we do not accept size increases + minChunkSize <= 1 ? 1 : Infinity); + if (bestTargetChunk) { + const { containedAtoms, correlatedAtoms, modules, pure, size } = mergedChunk; + small.delete(mergedChunk); + getChunksInPartition(bestTargetChunk, minChunkSize, chunkPartition).delete(bestTargetChunk); + bestTargetChunk.modules.push(...modules); + bestTargetChunk.size += size; + bestTargetChunk.pure &&= pure; + const { dependencies, dependentChunks, dependentEntries } = bestTargetChunk; + bestTargetChunk.correlatedAtoms &= correlatedAtoms; + bestTargetChunk.containedAtoms |= containedAtoms; + for (const entry of mergedChunk.dependentEntries) { + dependentEntries.add(entry); + } + for (const dependency of mergedChunk.dependencies) { + dependencies.add(dependency); + dependency.dependentChunks.delete(mergedChunk); + dependency.dependentChunks.add(bestTargetChunk); + } + for (const dependentChunk of mergedChunk.dependentChunks) { + dependentChunks.add(dependentChunk); + dependentChunk.dependencies.delete(mergedChunk); + dependentChunk.dependencies.add(bestTargetChunk); + } + dependencies.delete(bestTargetChunk); + dependentChunks.delete(bestTargetChunk); + getChunksInPartition(bestTargetChunk, minChunkSize, chunkPartition).add(bestTargetChunk); + } + } +} +function findBestMergeTarget(mergedChunk, { big, small }, sideEffectAtoms, sizeByAtom, smallestAdditionalSize) { + let bestTargetChunk = null; + // In the default case, we do not accept size increases + for (const targetChunk of concatLazy([small, big])) { + if (mergedChunk === targetChunk) + continue; + const additionalSizeAfterMerge = getAdditionalSizeAfterMerge(mergedChunk, targetChunk, smallestAdditionalSize, sideEffectAtoms, sizeByAtom); + if (additionalSizeAfterMerge < smallestAdditionalSize) { + bestTargetChunk = targetChunk; + if (additionalSizeAfterMerge === 0) + break; + smallestAdditionalSize = additionalSizeAfterMerge; + } + } + return bestTargetChunk; +} +/** + * Determine the additional unused code size that would be added by merging the + * two chunks. This is not an exact measurement but rather an upper bound. If + * the merge produces cycles or adds non-correlated side effects, `Infinity` + * is returned. + * Merging will not produce cycles if none of the direct non-merged + * dependencies of a chunk have the other chunk as a transitive dependency. + */ +function getAdditionalSizeAfterMerge(mergedChunk, targetChunk, +// The maximum additional unused code size allowed to be added by the merge, +// taking dependencies into account, needs to be below this number +currentAdditionalSize, sideEffectAtoms, sizeByAtom) { + const firstSize = getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(mergedChunk, targetChunk, currentAdditionalSize, sideEffectAtoms, sizeByAtom); + return firstSize < currentAdditionalSize + ? firstSize + + getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(targetChunk, mergedChunk, currentAdditionalSize - firstSize, sideEffectAtoms, sizeByAtom) + : Infinity; +} +function getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect(dependentChunk, dependencyChunk, currentAdditionalSize, sideEffectAtoms, sizeByAtom) { + const { correlatedAtoms } = dependencyChunk; + let dependencyAtoms = dependentChunk.containedAtoms; + const dependentContainedSideEffects = dependencyAtoms & sideEffectAtoms; + if ((correlatedAtoms & dependentContainedSideEffects) !== dependentContainedSideEffects) { + return Infinity; + } + const chunksToCheck = new Set(dependentChunk.dependencies); + for (const { dependencies, containedAtoms } of chunksToCheck) { + dependencyAtoms |= containedAtoms; + const containedSideEffects = containedAtoms & sideEffectAtoms; + if ((correlatedAtoms & containedSideEffects) !== containedSideEffects) { + return Infinity; + } + for (const dependency of dependencies) { + if (dependency === dependencyChunk) { + return Infinity; + } + chunksToCheck.add(dependency); + } + } + return getAtomsSizeIfBelowLimit(dependencyAtoms & ~correlatedAtoms, currentAdditionalSize, sizeByAtom); +} +function getAtomsSizeIfBelowLimit(atoms, currentAdditionalSize, sizeByAtom) { + let size = 0; + let atomIndex = 0; + let atomSignature = 1n; + const { length } = sizeByAtom; + for (; atomIndex < length; atomIndex++) { + if ((atoms & atomSignature) === atomSignature) { + size += sizeByAtom[atomIndex]; + } + atomSignature <<= 1n; + if (size >= currentAdditionalSize) { + return Infinity; + } + } + return size; +} +function getChunksInPartition(chunk, minChunkSize, chunkPartition) { + return chunk.size < minChunkSize ? chunkPartition.small : chunkPartition.big; +} + +// ported from https://github.com/substack/node-commondir +function commondir(files) { + if (files.length === 0) + return '/'; + if (files.length === 1) + return dirname(files[0]); + const commonSegments = files.slice(1).reduce((commonSegments, file) => { + const pathSegments = file.split(/\/+|\\+/); + let index; + for (index = 0; commonSegments[index] === pathSegments[index] && + index < Math.min(commonSegments.length, pathSegments.length); index++) + ; + return commonSegments.slice(0, index); + }, files[0].split(/\/+|\\+/)); + // Windows correctly handles paths with forward-slashes + return commonSegments.length > 1 ? commonSegments.join('/') : '/'; +} + +const compareExecIndex = (unitA, unitB) => unitA.execIndex > unitB.execIndex ? 1 : -1; +function sortByExecutionOrder(units) { + units.sort(compareExecIndex); +} +function analyseModuleExecution(entryModules) { + let nextExecIndex = 0; + const cyclePaths = []; + const analysedModules = new Set(); + const dynamicImports = new Set(); + const parents = new Map(); + const orderedModules = []; + const analyseModule = (module) => { + if (module instanceof Module) { + for (const dependency of module.dependencies) { + if (parents.has(dependency)) { + if (!analysedModules.has(dependency)) { + cyclePaths.push(getCyclePath(dependency, module, parents)); + } + continue; + } + parents.set(dependency, module); + analyseModule(dependency); + } + for (const dependency of module.implicitlyLoadedBefore) { + dynamicImports.add(dependency); + } + for (const { resolution } of module.dynamicImports) { + if (resolution instanceof Module) { + dynamicImports.add(resolution); + } + } + orderedModules.push(module); + } + module.execIndex = nextExecIndex++; + analysedModules.add(module); + }; + for (const currentEntry of entryModules) { + if (!parents.has(currentEntry)) { + parents.set(currentEntry, null); + analyseModule(currentEntry); + } + } + for (const currentEntry of dynamicImports) { + if (!parents.has(currentEntry)) { + parents.set(currentEntry, null); + analyseModule(currentEntry); + } + } + return { cyclePaths, orderedModules }; +} +function getCyclePath(module, parent, parents) { + const cycleSymbol = Symbol(module.id); + const path = [module.id]; + let nextModule = parent; + module.cycles.add(cycleSymbol); + while (nextModule !== module) { + nextModule.cycles.add(cycleSymbol); + path.push(nextModule.id); + nextModule = parents.get(nextModule); + } + path.push(path[0]); + path.reverse(); + return path; +} + +function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, constBindings, objectShorthand, reservedNamesAsProps } }) { + const { _, n, s } = compact ? { _: '', n: '', s: '' } : { _: ' ', n: '\n', s: ';' }; + const cnst = constBindings ? 'const' : 'var'; + const getNonArrowFunctionIntro = (parameters, { isAsync, name }) => `${isAsync ? `async ` : ''}function${name ? ` ${name}` : ''}${_}(${parameters.join(`,${_}`)})${_}`; + const getFunctionIntro = arrowFunctions + ? (parameters, { isAsync, name }) => { + const singleParameter = parameters.length === 1; + const asyncString = isAsync ? `async${singleParameter ? ' ' : _}` : ''; + return `${name ? `${cnst} ${name}${_}=${_}` : ''}${asyncString}${singleParameter ? parameters[0] : `(${parameters.join(`,${_}`)})`}${_}=>${_}`; + } + : getNonArrowFunctionIntro; + const getDirectReturnFunction = (parameters, { functionReturn, lineBreakIndent, name }) => [ + `${getFunctionIntro(parameters, { + isAsync: false, + name + })}${arrowFunctions + ? lineBreakIndent + ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` + : '' + : `{${lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _}${functionReturn ? 'return ' : ''}`}`, + arrowFunctions + ? `${name ? ';' : ''}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : ''}` + : `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}` + ]; + const isValidPropertyName = reservedNamesAsProps + ? (name) => VALID_IDENTIFIER_REGEXP.test(name) + : (name) => !RESERVED_NAMES.has(name) && VALID_IDENTIFIER_REGEXP.test(name); + return { + _, + cnst, + getDirectReturnFunction, + getDirectReturnIifeLeft: (parameters, returned, { needsArrowReturnParens, needsWrappedFunction }) => { + const [left, right] = getDirectReturnFunction(parameters, { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return `${wrapIfNeeded(`${left}${wrapIfNeeded(returned, arrowFunctions && needsArrowReturnParens)}${right}`, arrowFunctions || needsWrappedFunction)}(`; + }, + getFunctionIntro, + getNonArrowFunctionIntro, + getObject(fields, { lineBreakIndent }) { + const prefix = lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _; + return `{${fields + .map(([key, value]) => { + if (key === null) + return `${prefix}${value}`; + const keyInObject = stringifyObjectKeyIfNeeded(key); + return key === value && objectShorthand && key === keyInObject + ? prefix + key + : `${prefix}${keyInObject}:${_}${value}`; + }) + .join(`,`)}${fields.length === 0 ? '' : lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`; + }, + getPropertyAccess: (name) => isValidPropertyName(name) ? `.${name}` : `[${JSON.stringify(name)}]`, + n, + s + }; +} +const wrapIfNeeded = (code, needsParens) => needsParens ? `(${code})` : code; + +class Source { + constructor(filename, content) { + this.isOriginal = true; + this.filename = filename; + this.content = content; + } + traceSegment(line, column, name) { + return { column, line, name, source: this }; + } +} +class Link { + constructor(map, sources) { + this.sources = sources; + this.names = map.names; + this.mappings = map.mappings; + } + traceMappings() { + const sources = []; + const sourceIndexMap = new Map(); + const sourcesContent = []; + const names = []; + const nameIndexMap = new Map(); + const mappings = []; + for (const line of this.mappings) { + const tracedLine = []; + for (const segment of line) { + if (segment.length === 1) + continue; + const source = this.sources[segment[1]]; + if (!source) + continue; + const traced = source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : ''); + if (traced) { + const { column, line, name, source: { content, filename } } = traced; + let sourceIndex = sourceIndexMap.get(filename); + if (sourceIndex === undefined) { + sourceIndex = sources.length; + sources.push(filename); + sourceIndexMap.set(filename, sourceIndex); + sourcesContent[sourceIndex] = content; + } + else if (sourcesContent[sourceIndex] == null) { + sourcesContent[sourceIndex] = content; + } + else if (content != null && sourcesContent[sourceIndex] !== content) { + return error(logConflictingSourcemapSources(filename)); + } + const tracedSegment = [segment[0], sourceIndex, line, column]; + if (name) { + let nameIndex = nameIndexMap.get(name); + if (nameIndex === undefined) { + nameIndex = names.length; + names.push(name); + nameIndexMap.set(name, nameIndex); + } + tracedSegment[4] = nameIndex; + } + tracedLine.push(tracedSegment); + } + } + mappings.push(tracedLine); + } + return { mappings, names, sources, sourcesContent }; + } + traceSegment(line, column, name) { + const segments = this.mappings[line]; + if (!segments) + return null; + // binary search through segments for the given column + let searchStart = 0; + let searchEnd = segments.length - 1; + while (searchStart <= searchEnd) { + const m = (searchStart + searchEnd) >> 1; + const segment = segments[m]; + // If a sourcemap does not have sufficient resolution to contain a + // necessary mapping, e.g. because it only contains line information, we + // use the best approximation we could find + if (segment[0] === column || searchStart === searchEnd) { + if (segment.length == 1) + return null; + const source = this.sources[segment[1]]; + if (!source) + return null; + return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name); + } + if (segment[0] > column) { + searchEnd = m - 1; + } + else { + searchStart = m + 1; + } + } + return null; + } +} +function getLinkMap(log) { + return function linkMap(source, map) { + if (!map.missing) { + return new Link(map, [source]); + } + log(LOGLEVEL_WARN, logSourcemapBroken(map.plugin)); + return new Link({ + mappings: [], + names: [] + }, [source]); + }; +} +function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, linkMap) { + let source; + if (originalSourcemap) { + const sources = originalSourcemap.sources; + const sourcesContent = originalSourcemap.sourcesContent || []; + const directory = dirname(id) || '.'; + const sourceRoot = originalSourcemap.sourceRoot || '.'; + const baseSources = sources.map((source, index) => new Source(resolve$1(directory, sourceRoot, source), sourcesContent[index])); + source = new Link(originalSourcemap, baseSources); + } + else { + source = new Source(id, originalCode); + } + return sourcemapChain.reduce(linkMap, source); +} +function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeContent, log) { + const linkMap = getLinkMap(log); + const moduleSources = modules + .filter(module => !module.excludeFromSourcemap) + .map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap)); + const link = new Link(map, moduleSources); + const source = bundleSourcemapChain.reduce(linkMap, link); + let { sources, sourcesContent, names, mappings } = source.traceMappings(); + if (file) { + const directory = dirname(file); + sources = sources.map((source) => relative(directory, source)); + file = basename(file); + } + sourcesContent = (excludeContent ? null : sourcesContent); + for (const module of modules) { + resetSourcemapCache(module.originalSourcemap, module.sourcemapChain); + } + return new SourceMap({ file, mappings, names, sources, sourcesContent }); +} +function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log) { + if (sourcemapChain.length === 0) { + return originalSourcemap; + } + const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(log)); + const map = source.traceMappings(); + return decodedSourcemap({ version: 3, ...map }); +} + +let textEncoder; +const getHash64 = input => xxhashBase64Url(ensureBuffer(input)); +const getHash36 = input => xxhashBase36(ensureBuffer(input)); +const getHash16 = input => xxhashBase16(ensureBuffer(input)); +const hasherByType = { + base36: getHash36, + base64: getHash64, + hex: getHash16 +}; +function ensureBuffer(input) { + if (typeof input === 'string') { + if (typeof Buffer === 'undefined') { + textEncoder ??= new TextEncoder(); + return textEncoder.encode(input); + } + return Buffer.from(input); + } + return input; +} + +// this looks ridiculous, but it prevents sourcemap tooling from mistaking +// this for an actual sourceMappingURL +let SOURCEMAPPING_URL = 'sourceMa'; +SOURCEMAPPING_URL += 'ppingURL'; + +async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) { + timeStart('render chunks', 2); + reserveEntryChunksInBundle(chunks); + const renderedChunks = await Promise.all(chunks.map(chunk => chunk.render())); + timeEnd('render chunks', 2); + timeStart('transform chunks', 2); + const getHash = hasherByType[outputOptions.hashCharacters]; + const chunkGraph = getChunkGraph(chunks); + const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log); + const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash); + addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions); + timeEnd('transform chunks', 2); +} +function reserveEntryChunksInBundle(chunks) { + for (const chunk of chunks) { + if (chunk.facadeModule && chunk.facadeModule.isUserDefinedEntryPoint) { + // reserves name in bundle as side effect if it does not contain a hash + chunk.getPreliminaryFileName(); + } + } +} +function getChunkGraph(chunks) { + return Object.fromEntries(chunks.map(chunk => { + const renderedChunkInfo = chunk.getRenderedChunkInfo(); + return [renderedChunkInfo.fileName, renderedChunkInfo]; + })); +} +async function transformChunk(magicString, fileName, usedModules, chunkGraph, options, outputPluginDriver, log) { + let map = null; + const sourcemapChain = []; + let code = await outputPluginDriver.hookReduceArg0('renderChunk', [magicString.toString(), chunkGraph[fileName], options, { chunks: chunkGraph }], (code, result, plugin) => { + if (result == null) + return code; + if (typeof result === 'string') + result = { + code: result, + map: undefined + }; + // strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning + if (result.map !== null) { + const map = decodedSourcemap(result.map); + sourcemapChain.push(map || { missing: true, plugin: plugin.name }); + } + return result.code; + }); + const { compact, dir, file, sourcemap, sourcemapExcludeSources, sourcemapFile, sourcemapPathTransform, sourcemapIgnoreList } = options; + if (!compact && code[code.length - 1] !== '\n') + code += '\n'; + if (sourcemap) { + timeStart('sourcemaps', 3); + let resultingFile; + if (file) + resultingFile = resolve$1(sourcemapFile || file); + else if (dir) + resultingFile = resolve$1(dir, fileName); + else + resultingFile = resolve$1(fileName); + const decodedMap = magicString.generateDecodedMap({}); + map = collapseSourcemaps(resultingFile, decodedMap, usedModules, sourcemapChain, sourcemapExcludeSources, log); + for (let sourcesIndex = 0; sourcesIndex < map.sources.length; ++sourcesIndex) { + let sourcePath = map.sources[sourcesIndex]; + const sourcemapPath = `${resultingFile}.map`; + const ignoreList = sourcemapIgnoreList(sourcePath, sourcemapPath); + if (typeof ignoreList !== 'boolean') { + error(logFailedValidation('sourcemapIgnoreList function must return a boolean.')); + } + if (ignoreList) { + if (map.x_google_ignoreList === undefined) { + map.x_google_ignoreList = []; + } + if (!map.x_google_ignoreList.includes(sourcesIndex)) { + map.x_google_ignoreList.push(sourcesIndex); + } + } + if (sourcemapPathTransform) { + sourcePath = sourcemapPathTransform(sourcePath, sourcemapPath); + if (typeof sourcePath !== 'string') { + error(logFailedValidation(`sourcemapPathTransform function must return a string.`)); + } + } + map.sources[sourcesIndex] = normalize(sourcePath); + } + timeEnd('sourcemaps', 3); + } + return { + code, + map + }; +} +async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log) { + const nonHashedChunksWithPlaceholders = []; + const renderedChunksByPlaceholder = new Map(); + const hashDependenciesByPlaceholder = new Map(); + const initialHashesByPlaceholder = new Map(); + const placeholders = new Set(); + for (const { preliminaryFileName: { hashPlaceholder } } of renderedChunks) { + if (hashPlaceholder) + placeholders.add(hashPlaceholder); + } + await Promise.all(renderedChunks.map(async ({ chunk, preliminaryFileName: { fileName, hashPlaceholder }, preliminarySourcemapFileName, magicString, usedModules }) => { + const transformedChunk = { + chunk, + fileName, + sourcemapFileName: preliminarySourcemapFileName?.fileName ?? null, + ...(await transformChunk(magicString, fileName, usedModules, chunkGraph, outputOptions, pluginDriver, log)) + }; + const { code, map } = transformedChunk; + if (hashPlaceholder) { + // To create a reproducible content-only hash, all placeholders are + // replaced with the same value before hashing + const { containedPlaceholders, transformedCode } = replacePlaceholdersWithDefaultAndGetContainedPlaceholders(code, placeholders); + let contentToHash = transformedCode; + const hashAugmentation = pluginDriver.hookReduceValueSync('augmentChunkHash', '', [chunk.getRenderedChunkInfo()], (augmentation, pluginHash) => { + if (pluginHash) { + augmentation += pluginHash; + } + return augmentation; + }); + if (hashAugmentation) { + contentToHash += hashAugmentation; + } + renderedChunksByPlaceholder.set(hashPlaceholder, transformedChunk); + hashDependenciesByPlaceholder.set(hashPlaceholder, { + containedPlaceholders, + contentHash: getHash(contentToHash) + }); + } + else { + nonHashedChunksWithPlaceholders.push(transformedChunk); + } + const sourcemapHashPlaceholder = preliminarySourcemapFileName?.hashPlaceholder; + if (map && sourcemapHashPlaceholder) { + initialHashesByPlaceholder.set(preliminarySourcemapFileName.hashPlaceholder, getHash(map.toString()).slice(0, preliminarySourcemapFileName.hashPlaceholder.length)); + } + })); + return { + hashDependenciesByPlaceholder, + initialHashesByPlaceholder, + nonHashedChunksWithPlaceholders, + renderedChunksByPlaceholder + }; +} +function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash) { + const hashesByPlaceholder = new Map(initialHashesByPlaceholder); + for (const [placeholder, { fileName }] of renderedChunksByPlaceholder) { + let contentToHash = ''; + const hashDependencyPlaceholders = new Set([placeholder]); + for (const dependencyPlaceholder of hashDependencyPlaceholders) { + const { containedPlaceholders, contentHash } = hashDependenciesByPlaceholder.get(dependencyPlaceholder); + contentToHash += contentHash; + for (const containedPlaceholder of containedPlaceholders) { + // When looping over a map, setting an entry only causes a new iteration if the key is new + hashDependencyPlaceholders.add(containedPlaceholder); + } + } + let finalFileName; + let finalHash; + do { + // In case of a hash collision, create a hash of the hash + if (finalHash) { + contentToHash = finalHash; + } + finalHash = getHash(contentToHash).slice(0, placeholder.length); + finalFileName = replaceSinglePlaceholder(fileName, placeholder, finalHash); + } while (bundle[lowercaseBundleKeys].has(finalFileName.toLowerCase())); + bundle[finalFileName] = FILE_PLACEHOLDER; + hashesByPlaceholder.set(placeholder, finalHash); + } + return hashesByPlaceholder; +} +function addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, options) { + for (const { chunk, code, fileName, sourcemapFileName, map } of renderedChunksByPlaceholder.values()) { + let updatedCode = replacePlaceholders(code, hashesByPlaceholder); + const finalFileName = replacePlaceholders(fileName, hashesByPlaceholder); + let finalSourcemapFileName = null; + if (map) { + finalSourcemapFileName = sourcemapFileName + ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder) + : `${finalFileName}.map`; + map.file = replacePlaceholders(map.file, hashesByPlaceholder); + updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options); + } + bundle[finalFileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder); + } + for (const { chunk, code, fileName, sourcemapFileName, map } of nonHashedChunksWithPlaceholders) { + let updatedCode = hashesByPlaceholder.size > 0 ? replacePlaceholders(code, hashesByPlaceholder) : code; + let finalSourcemapFileName = null; + if (map) { + finalSourcemapFileName = sourcemapFileName + ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder) + : `${fileName}.map`; + updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options); + } + bundle[fileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder); + } +} +function emitSourceMapAndGetComment(fileName, map, pluginDriver, { sourcemap, sourcemapBaseUrl }) { + let url; + if (sourcemap === 'inline') { + url = map.toUrl(); + } + else { + const sourcemapFileName = basename(fileName); + url = sourcemapBaseUrl + ? new URL(sourcemapFileName, sourcemapBaseUrl).toString() + : sourcemapFileName; + pluginDriver.emitFile({ fileName, source: map.toString(), type: 'asset' }); + } + return sourcemap === 'hidden' ? '' : `//# ${SOURCEMAPPING_URL}=${url}\n`; +} + +class Bundle { + constructor(outputOptions, unsetOptions, inputOptions, pluginDriver, graph) { + this.outputOptions = outputOptions; + this.unsetOptions = unsetOptions; + this.inputOptions = inputOptions; + this.pluginDriver = pluginDriver; + this.graph = graph; + this.facadeChunkByModule = new Map(); + this.includedNamespaces = new Set(); + } + async generate(isWrite) { + timeStart('GENERATE', 1); + const outputBundleBase = Object.create(null); + const outputBundle = getOutputBundle(outputBundleBase); + this.pluginDriver.setOutputBundle(outputBundle, this.outputOptions); + try { + timeStart('initialize render', 2); + await this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]); + timeEnd('initialize render', 2); + timeStart('generate chunks', 2); + const getHashPlaceholder = getHashPlaceholderGenerator(); + const chunks = await this.generateChunks(outputBundle, getHashPlaceholder); + if (chunks.length > 1) { + validateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onLog); + } + this.pluginDriver.setChunkInformation(this.facadeChunkByModule); + for (const chunk of chunks) { + chunk.generateExports(); + } + timeEnd('generate chunks', 2); + await renderChunks(chunks, outputBundle, this.pluginDriver, this.outputOptions, this.inputOptions.onLog); + } + catch (error_) { + await this.pluginDriver.hookParallel('renderError', [error_]); + throw error_; + } + removeUnreferencedAssets(outputBundle); + timeStart('generate bundle', 2); + await this.pluginDriver.hookSeq('generateBundle', [ + this.outputOptions, + outputBundle, + isWrite + ]); + this.finaliseAssets(outputBundle); + timeEnd('generate bundle', 2); + timeEnd('GENERATE', 1); + return outputBundleBase; + } + async addManualChunks(manualChunks) { + const manualChunkAliasByEntry = new Map(); + const chunkEntries = await Promise.all(Object.entries(manualChunks).map(async ([alias, files]) => ({ + alias, + entries: await this.graph.moduleLoader.addAdditionalModules(files, true) + }))); + for (const { alias, entries } of chunkEntries) { + for (const entry of entries) { + addModuleToManualChunk(alias, entry, manualChunkAliasByEntry); + } + } + return manualChunkAliasByEntry; + } + assignManualChunks(getManualChunk) { + // eslint-disable-next-line unicorn/prefer-module + const manualChunkAliasesWithEntry = []; + const manualChunksApi = { + getModuleIds: () => this.graph.modulesById.keys(), + getModuleInfo: this.graph.getModuleInfo + }; + for (const module of this.graph.modulesById.values()) { + if (module instanceof Module) { + const manualChunkAlias = getManualChunk(module.id, manualChunksApi); + if (typeof manualChunkAlias === 'string') { + manualChunkAliasesWithEntry.push([manualChunkAlias, module]); + } + } + } + manualChunkAliasesWithEntry.sort(([aliasA], [aliasB]) => aliasA > aliasB ? 1 : aliasA < aliasB ? -1 : 0); + const manualChunkAliasByEntry = new Map(); + for (const [alias, module] of manualChunkAliasesWithEntry) { + addModuleToManualChunk(alias, module, manualChunkAliasByEntry); + } + return manualChunkAliasByEntry; + } + finaliseAssets(bundle) { + if (this.outputOptions.validate) { + for (const file of Object.values(bundle)) { + if ('code' in file) { + try { + parseAst(file.code); + } + catch (error_) { + this.inputOptions.onLog(LOGLEVEL_WARN, logChunkInvalid(file, error_)); + } + } + } + } + this.pluginDriver.finaliseAssets(); + } + async generateChunks(bundle, getHashPlaceholder) { + const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions; + const manualChunkAliasByEntry = typeof manualChunks === 'object' + ? await this.addManualChunks(manualChunks) + : this.assignManualChunks(manualChunks); + const snippets = getGenerateCodeSnippets(this.outputOptions); + const includedModules = getIncludedModules(this.graph.modulesById); + const inputBase = commondir(getAbsoluteEntryModulePaths(includedModules, preserveModules)); + const externalChunkByModule = getExternalChunkByModule(this.graph.modulesById, this.outputOptions, inputBase); + const chunks = []; + const chunkByModule = new Map(); + for (const { alias, modules } of inlineDynamicImports + ? [{ alias: null, modules: includedModules }] + : preserveModules + ? includedModules.map(module => ({ alias: null, modules: [module] })) + : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, this.inputOptions.onLog)) { + sortByExecutionOrder(modules); + const chunk = new Chunk(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias, getHashPlaceholder, bundle, inputBase, snippets); + chunks.push(chunk); + } + for (const chunk of chunks) { + chunk.link(); + } + const facades = []; + for (const chunk of chunks) { + facades.push(...chunk.generateFacades()); + } + return [...chunks, ...facades]; + } +} +function validateOptionsForMultiChunkOutput(outputOptions, log) { + if (outputOptions.format === 'umd' || outputOptions.format === 'iife') + return error(logInvalidOption('output.format', URL_OUTPUT_FORMAT, 'UMD and IIFE output formats are not supported for code-splitting builds', outputOptions.format)); + if (typeof outputOptions.file === 'string') + return error(logInvalidOption('output.file', URL_OUTPUT_DIR, 'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option')); + if (outputOptions.sourcemapFile) + return error(logInvalidOption('output.sourcemapFile', URL_OUTPUT_SOURCEMAPFILE, '"output.sourcemapFile" is only supported for single-file builds')); + if (!outputOptions.amd.autoId && outputOptions.amd.id) + log(LOGLEVEL_WARN, logInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead')); +} +function getIncludedModules(modulesById) { + const includedModules = []; + for (const module of modulesById.values()) { + if (module instanceof Module && + (module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0)) { + includedModules.push(module); + } + } + return includedModules; +} +function getAbsoluteEntryModulePaths(includedModules, preserveModules) { + const absoluteEntryModulePaths = []; + for (const module of includedModules) { + if ((module.info.isEntry || preserveModules) && isAbsolute$1(module.id)) { + absoluteEntryModulePaths.push(module.id); + } + } + return absoluteEntryModulePaths; +} +function getExternalChunkByModule(modulesById, outputOptions, inputBase) { + const externalChunkByModule = new Map(); + for (const module of modulesById.values()) { + if (module instanceof ExternalModule) { + externalChunkByModule.set(module, new ExternalChunk(module, outputOptions, inputBase)); + } + } + return externalChunkByModule; +} +function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) { + const existingAlias = manualChunkAliasByEntry.get(module); + if (typeof existingAlias === 'string' && existingAlias !== alias) { + return error(logCannotAssignModuleToChunk(module.id, alias, existingAlias)); + } + manualChunkAliasByEntry.set(module, alias); +} + +function flru (max) { + var num, curr, prev; + var limit = max || 1; + + function keep(key, value) { + if (++num > limit) { + prev = curr; + reset(1); + ++num; + } + curr[key] = value; + } + + function reset(isPartial) { + num = 0; + curr = Object.create(null); + isPartial || (prev=Object.create(null)); + } + + reset(); + + return { + clear: reset, + has: function (key) { + return curr[key] !== void 0 || prev[key] !== void 0; + }, + get: function (key) { + var val = curr[key]; + if (val !== void 0) return val; + if ((val=prev[key]) !== void 0) { + keep(key, val); + return val; + } + }, + set: function (key, value) { + if (curr[key] !== void 0) { + curr[key] = value; + } else { + keep(key, value); + } + } + }; +} + +function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) { + let skipped = null; + let replaceContext = null; + if (skip) { + skipped = new Set(); + for (const skippedCall of skip) { + if (source === skippedCall.source && importer === skippedCall.importer) { + skipped.add(skippedCall.plugin); + } + } + replaceContext = (pluginContext, plugin) => ({ + ...pluginContext, + resolve: (source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) => { + skipSelf ??= true; + return moduleLoaderResolveId(source, importer, custom, isEntry, attributes || EMPTY_OBJECT, skipSelf ? [...skip, { importer, plugin, source }] : skip); + } + }); + } + return pluginDriver.hookFirstAndGetPlugin('resolveId', [source, importer, { attributes, custom: customOptions, isEntry }], replaceContext, skipped); +} + +async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) { + const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes); + if (pluginResult != null) { + const [resolveIdResult, plugin] = pluginResult; + if (typeof resolveIdResult === 'object' && !resolveIdResult.resolvedBy) { + return { + ...resolveIdResult, + resolvedBy: plugin.name + }; + } + if (typeof resolveIdResult === 'string') { + return { + id: resolveIdResult, + resolvedBy: plugin.name + }; + } + return resolveIdResult; + } + // external modules (non-entry modules that start with neither '.' or '/') + // are skipped at this stage. + if (importer !== undefined && !isAbsolute$1(source) && source[0] !== '.') + return null; + // `resolve` processes paths from right to left, prepending them until an + // absolute path is created. Absolute importees therefore shortcircuit the + // resolve call and require no special handing on our part. + // See https://nodejs.org/api/path.html#path_path_resolve_paths + return addJsExtensionIfNecessary(importer ? resolve$1(dirname(importer), source) : resolve$1(source), preserveSymlinks); +} +async function addJsExtensionIfNecessary(file, preserveSymlinks) { + return ((await findFile(file, preserveSymlinks)) ?? + (await findFile(file + '.mjs', preserveSymlinks)) ?? + (await findFile(file + '.js', preserveSymlinks))); +} +async function findFile(file, preserveSymlinks) { + try { + const stats = await lstat(file); + if (!preserveSymlinks && stats.isSymbolicLink()) + return await findFile(await realpath(file), preserveSymlinks); + if ((preserveSymlinks && stats.isSymbolicLink()) || stats.isFile()) { + // check case + const name = basename(file); + const files = await readdir(dirname(file)); + if (files.includes(name)) + return file; + } + } + catch { + // suppress + } +} + +const ANONYMOUS_PLUGIN_PREFIX = 'at position '; +const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position '; + +function createPluginCache(cache) { + return { + delete(id) { + return delete cache[id]; + }, + get(id) { + const item = cache[id]; + if (!item) + return; + item[0] = 0; + return item[1]; + }, + has(id) { + const item = cache[id]; + if (!item) + return false; + item[0] = 0; + return true; + }, + set(id, value) { + cache[id] = [0, value]; + } + }; +} +function getTrackedPluginCache(pluginCache, onUse) { + return { + delete(id) { + onUse(); + return pluginCache.delete(id); + }, + get(id) { + onUse(); + return pluginCache.get(id); + }, + has(id) { + onUse(); + return pluginCache.has(id); + }, + set(id, value) { + onUse(); + return pluginCache.set(id, value); + } + }; +} +const NO_CACHE = { + delete() { + return false; + }, + get() { + return undefined; + }, + has() { + return false; + }, + set() { } +}; +function uncacheablePluginError(pluginName) { + if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) || + pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) { + return error(logAnonymousPluginCache()); + } + return error(logDuplicatePluginName(pluginName)); +} +function getCacheForUncacheablePlugin(pluginName) { + return { + delete() { + return uncacheablePluginError(pluginName); + }, + get() { + return uncacheablePluginError(pluginName); + }, + has() { + return uncacheablePluginError(pluginName); + }, + set() { + return uncacheablePluginError(pluginName); + } + }; +} + +async function asyncFlatten(array) { + do { + array = (await Promise.all(array)).flat(Infinity); + } while (array.some((v) => v?.then)); + return array; +} + +const getOnLog = (config, logLevel, printLog = defaultPrintLog) => { + const { onwarn, onLog } = config; + const defaultOnLog = getDefaultOnLog(printLog, onwarn); + if (onLog) { + const minimalPriority = logLevelPriority[logLevel]; + return (level, log) => onLog(level, addLogToString(log), (level, handledLog) => { + if (level === LOGLEVEL_ERROR) { + return error(normalizeLog(handledLog)); + } + if (logLevelPriority[level] >= minimalPriority) { + defaultOnLog(level, normalizeLog(handledLog)); + } + }); + } + return defaultOnLog; +}; +const getDefaultOnLog = (printLog, onwarn) => onwarn + ? (level, log) => { + if (level === LOGLEVEL_WARN) { + onwarn(addLogToString(log), warning => printLog(LOGLEVEL_WARN, normalizeLog(warning))); + } + else { + printLog(level, log); + } + } + : printLog; +const addLogToString = (log) => { + Object.defineProperty(log, 'toString', { + value: () => getExtendedLogMessage(log), + writable: true + }); + return log; +}; +const normalizeLog = (log) => typeof log === 'string' + ? { message: log } + : typeof log === 'function' + ? normalizeLog(log()) + : log; +const getExtendedLogMessage = (log) => { + let prefix = ''; + if (log.plugin) { + prefix += `(${log.plugin} plugin) `; + } + if (log.loc) { + prefix += `${relativeId(log.loc.file)} (${log.loc.line}:${log.loc.column}) `; + } + return prefix + log.message; +}; +const defaultPrintLog = (level, log) => { + const message = getExtendedLogMessage(log); + switch (level) { + case LOGLEVEL_WARN: { + return console.warn(message); + } + case LOGLEVEL_DEBUG: { + return console.debug(message); + } + default: { + return console.info(message); + } + } +}; +function warnUnknownOptions(passedOptions, validOptions, optionType, log, ignoredKeys = /$./) { + const validOptionSet = new Set(validOptions); + const unknownOptions = Object.keys(passedOptions).filter(key => !(validOptionSet.has(key) || ignoredKeys.test(key))); + if (unknownOptions.length > 0) { + log(LOGLEVEL_WARN, logUnknownOption(optionType, unknownOptions, [...validOptionSet].sort())); + } +} +const treeshakePresets = { + recommended: { + annotations: true, + correctVarValueBeforeDeclaration: false, + manualPureFunctions: EMPTY_ARRAY, + moduleSideEffects: () => true, + propertyReadSideEffects: true, + tryCatchDeoptimization: true, + unknownGlobalSideEffects: false + }, + safest: { + annotations: true, + correctVarValueBeforeDeclaration: true, + manualPureFunctions: EMPTY_ARRAY, + moduleSideEffects: () => true, + propertyReadSideEffects: true, + tryCatchDeoptimization: true, + unknownGlobalSideEffects: true + }, + smallest: { + annotations: true, + correctVarValueBeforeDeclaration: false, + manualPureFunctions: EMPTY_ARRAY, + moduleSideEffects: () => false, + propertyReadSideEffects: false, + tryCatchDeoptimization: false, + unknownGlobalSideEffects: false + } +}; +const generatedCodePresets = { + es2015: { + arrowFunctions: true, + constBindings: true, + objectShorthand: true, + reservedNamesAsProps: true, + symbols: true + }, + es5: { + arrowFunctions: false, + constBindings: false, + objectShorthand: false, + reservedNamesAsProps: true, + symbols: false + } +}; +const objectifyOption = (value) => value && typeof value === 'object' ? value : {}; +const objectifyOptionWithPresets = (presets, optionName, urlSnippet, additionalValues) => (value) => { + if (typeof value === 'string') { + const preset = presets[value]; + if (preset) { + return preset; + } + error(logInvalidOption(optionName, urlSnippet, `valid values are ${additionalValues}${printQuotedStringList(Object.keys(presets))}. You can also supply an object for more fine-grained control`, value)); + } + return objectifyOption(value); +}; +const getOptionWithPreset = (value, presets, optionName, urlSnippet, additionalValues) => { + const presetName = value?.preset; + if (presetName) { + const preset = presets[presetName]; + if (preset) { + return { ...preset, ...value }; + } + else { + error(logInvalidOption(`${optionName}.preset`, urlSnippet, `valid values are ${printQuotedStringList(Object.keys(presets))}`, presetName)); + } + } + return objectifyOptionWithPresets(presets, optionName, urlSnippet, additionalValues)(value); +}; +const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean); + +async function transform(source, module, pluginDriver, log) { + const id = module.id; + const sourcemapChain = []; + let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map); + const originalCode = source.code; + let ast = source.ast; + const transformDependencies = []; + const emittedFiles = []; + let customTransformCache = false; + const useCustomTransformCache = () => (customTransformCache = true); + let pluginName = ''; + let currentSource = source.code; + function transformReducer(previousCode, result, plugin) { + let code; + let map; + if (typeof result === 'string') { + code = result; + } + else if (result && typeof result === 'object') { + module.updateOptions(result); + if (result.code == null) { + if (result.map || result.ast) { + log(LOGLEVEL_WARN, logNoTransformMapOrAstWithoutCode(plugin.name)); + } + return previousCode; + } + ({ code, map, ast } = result); + } + else { + return previousCode; + } + // strict null check allows 'null' maps to not be pushed to the chain, + // while 'undefined' gets the missing map warning + if (map !== null) { + sourcemapChain.push(decodedSourcemap(typeof map === 'string' ? JSON.parse(map) : map) || { + missing: true, + plugin: plugin.name + }); + } + currentSource = code; + return code; + } + const getLogHandler = (handler) => (log, pos) => { + log = normalizeLog(log); + if (pos) + augmentCodeLocation(log, pos, currentSource, id); + log.id = id; + log.hook = 'transform'; + handler(log); + }; + let code; + try { + code = await pluginDriver.hookReduceArg0('transform', [currentSource, id], transformReducer, (pluginContext, plugin) => { + pluginName = plugin.name; + return { + ...pluginContext, + addWatchFile(id) { + transformDependencies.push(id); + pluginContext.addWatchFile(id); + }, + cache: customTransformCache + ? pluginContext.cache + : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache), + debug: getLogHandler(pluginContext.debug), + emitFile(emittedFile) { + emittedFiles.push(emittedFile); + return pluginDriver.emitFile(emittedFile); + }, + error(error_, pos) { + if (typeof error_ === 'string') + error_ = { message: error_ }; + if (pos) + augmentCodeLocation(error_, pos, currentSource, id); + error_.id = id; + error_.hook = 'transform'; + return pluginContext.error(error_); + }, + getCombinedSourcemap() { + const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log); + if (!combinedMap) { + const magicString = new MagicString(originalCode); + return magicString.generateMap({ hires: true, includeContent: true, source: id }); + } + if (originalSourcemap !== combinedMap) { + originalSourcemap = combinedMap; + sourcemapChain.length = 0; + } + return new SourceMap({ + ...combinedMap, + file: null, + sourcesContent: combinedMap.sourcesContent + }); + }, + info: getLogHandler(pluginContext.info), + setAssetSource() { + return this.error(logInvalidSetAssetSourceCall()); + }, + warn: getLogHandler(pluginContext.warn) + }; + }); + } + catch (error_) { + return error(logPluginError(error_, pluginName, { hook: 'transform', id })); + } + if (!customTransformCache && // files emitted by a transform hook need to be emitted again if the hook is skipped + emittedFiles.length > 0) + module.transformFiles = emittedFiles; + return { + ast, + code, + customTransformCache, + originalCode, + originalSourcemap, + sourcemapChain, + transformDependencies + }; +} + +const RESOLVE_DEPENDENCIES = 'resolveDependencies'; +class ModuleLoader { + constructor(graph, modulesById, options, pluginDriver) { + this.graph = graph; + this.modulesById = modulesById; + this.options = options; + this.pluginDriver = pluginDriver; + this.implicitEntryModules = new Set(); + this.indexedEntryModules = []; + this.latestLoadModulesPromise = Promise.resolve(); + this.moduleLoadPromises = new Map(); + this.modulesWithLoadedDependencies = new Set(); + this.nextChunkNamePriority = 0; + this.nextEntryModuleIndex = 0; + this.resolveId = async (source, importer, customOptions, isEntry, attributes, skip = null) => this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false) + ? false + : await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer, attributes), importer, source), attributes); + this.hasModuleSideEffects = options.treeshake + ? options.treeshake.moduleSideEffects + : () => true; + } + async addAdditionalModules(unresolvedModules, isAddForManualChunks) { + const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null, isAddForManualChunks)))); + await this.awaitLoadModulesPromise(); + return result; + } + async addEntryModules(unresolvedEntryModules, isUserDefined) { + const firstEntryModuleIndex = this.nextEntryModuleIndex; + this.nextEntryModuleIndex += unresolvedEntryModules.length; + const firstChunkNamePriority = this.nextChunkNamePriority; + this.nextChunkNamePriority += unresolvedEntryModules.length; + const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null))).then(entryModules => { + for (const [index, entryModule] of entryModules.entries()) { + entryModule.isUserDefinedEntryPoint = + entryModule.isUserDefinedEntryPoint || isUserDefined; + addChunkNamesToModule(entryModule, unresolvedEntryModules[index], isUserDefined, firstChunkNamePriority + index); + const existingIndexedModule = this.indexedEntryModules.find(indexedModule => indexedModule.module === entryModule); + if (existingIndexedModule) { + existingIndexedModule.index = Math.min(existingIndexedModule.index, firstEntryModuleIndex + index); + } + else { + this.indexedEntryModules.push({ + index: firstEntryModuleIndex + index, + module: entryModule + }); + } + } + this.indexedEntryModules.sort(({ index: indexA }, { index: indexB }) => indexA > indexB ? 1 : -1); + return entryModules; + })); + await this.awaitLoadModulesPromise(); + return { + entryModules: this.indexedEntryModules.map(({ module }) => module), + implicitEntryModules: [...this.implicitEntryModules], + newEntryModules + }; + } + async emitChunk({ fileName, id, importer, name, implicitlyLoadedAfterOneOf, preserveSignature }) { + const unresolvedModule = { + fileName: fileName || null, + id, + importer, + name: name || null + }; + const module = implicitlyLoadedAfterOneOf + ? await this.addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfterOneOf) + : (await this.addEntryModules([unresolvedModule], false)).newEntryModules[0]; + if (preserveSignature != null) { + module.preserveSignature = preserveSignature; + } + return module; + } + async preloadModule(resolvedId) { + const module = await this.fetchModule(this.getResolvedIdWithDefaults(resolvedId, EMPTY_OBJECT), undefined, false, resolvedId.resolveDependencies ? RESOLVE_DEPENDENCIES : true); + return module.info; + } + addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) { + const chunkNamePriority = this.nextChunkNamePriority++; + return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => { + addChunkNamesToModule(entryModule, unresolvedModule, false, chunkNamePriority); + if (!entryModule.info.isEntry) { + const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id))); + // We need to check again if this is still an entry module as these + // changes need to be performed atomically to avoid race conditions + // if the same module is re-emitted as an entry module. + // The inverse changes happen in "handleExistingModule" + if (!entryModule.info.isEntry) { + this.implicitEntryModules.add(entryModule); + for (const module of implicitlyLoadedAfterModules) { + entryModule.implicitlyLoadedAfter.add(module); + } + for (const dependant of entryModule.implicitlyLoadedAfter) { + dependant.implicitlyLoadedBefore.add(entryModule); + } + } + } + return entryModule; + })); + } + async addModuleSource(id, importer, module) { + let source; + try { + source = await this.graph.fileOperationQueue.run(async () => { + const content = await this.pluginDriver.hookFirst('load', [id]); + if (content !== null) + return content; + this.graph.watchFiles[id] = true; + return await readFile(id, 'utf8'); + }); + } + catch (error_) { + let message = `Could not load ${id}`; + if (importer) + message += ` (imported by ${relativeId(importer)})`; + message += `: ${error_.message}`; + error_.message = message; + throw error_; + } + const sourceDescription = typeof source === 'string' + ? { code: source } + : source != null && typeof source === 'object' && typeof source.code === 'string' + ? source + : error(logBadLoader(id)); + const code = sourceDescription.code; + /* eslint-disable-next-line unicorn/number-literal-case */ + if (code.charCodeAt(0) === 65279) { + sourceDescription.code = code.slice(1); + } + const cachedModule = this.graph.cachedModules.get(id); + if (cachedModule && + !cachedModule.customTransformCache && + cachedModule.originalCode === sourceDescription.code && + !(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [ + { + ast: cachedModule.ast, + code: cachedModule.code, + id: cachedModule.id, + meta: cachedModule.meta, + moduleSideEffects: cachedModule.moduleSideEffects, + resolvedSources: cachedModule.resolvedIds, + syntheticNamedExports: cachedModule.syntheticNamedExports + } + ]))) { + if (cachedModule.transformFiles) { + for (const emittedFile of cachedModule.transformFiles) + this.pluginDriver.emitFile(emittedFile); + } + await module.setSource(cachedModule); + } + else { + module.updateOptions(sourceDescription); + await module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options.onLog)); + } + } + async awaitLoadModulesPromise() { + let startingPromise; + do { + startingPromise = this.latestLoadModulesPromise; + await startingPromise; + } while (startingPromise !== this.latestLoadModulesPromise); + } + extendLoadModulesPromise(loadNewModulesPromise) { + this.latestLoadModulesPromise = Promise.all([ + loadNewModulesPromise, + this.latestLoadModulesPromise + ]); + this.latestLoadModulesPromise.catch(() => { + /* Avoid unhandled Promise rejections */ + }); + return loadNewModulesPromise; + } + async fetchDynamicDependencies(module, resolveDynamicImportPromises) { + const dependencies = await Promise.all(resolveDynamicImportPromises.map(resolveDynamicImportPromise => resolveDynamicImportPromise.then(async ([dynamicImport, resolvedId]) => { + if (resolvedId === null) + return null; + if (typeof resolvedId === 'string') { + dynamicImport.resolution = resolvedId; + return null; + } + return (dynamicImport.resolution = await this.fetchResolvedDependency(relativeId(resolvedId.id), module.id, resolvedId)); + }))); + for (const dependency of dependencies) { + if (dependency) { + module.dynamicDependencies.add(dependency); + dependency.dynamicImporters.push(module.id); + } + } + } + // If this is a preload, then this method always waits for the dependencies of + // the module to be resolved. + // Otherwise, if the module does not exist, it waits for the module and all + // its dependencies to be loaded. + // Otherwise, it returns immediately. + async fetchModule({ attributes, id, meta, moduleSideEffects, syntheticNamedExports }, importer, isEntry, isPreload) { + const existingModule = this.modulesById.get(id); + if (existingModule instanceof Module) { + if (importer && doAttributesDiffer(attributes, existingModule.info.attributes)) { + this.options.onLog(LOGLEVEL_WARN, logInconsistentImportAttributes(existingModule.info.attributes, attributes, id, importer)); + } + await this.handleExistingModule(existingModule, isEntry, isPreload); + return existingModule; + } + if (existingModule instanceof ExternalModule) { + return error(logExternalModulesCannotBeTransformedToModules(existingModule.id)); + } + const module = new Module(this.graph, id, this.options, isEntry, moduleSideEffects, syntheticNamedExports, meta, attributes); + this.modulesById.set(id, module); + const loadPromise = this.addModuleSource(id, importer, module).then(() => [ + this.getResolveStaticDependencyPromises(module), + this.getResolveDynamicImportPromises(module), + loadAndResolveDependenciesPromise + ]); + const loadAndResolveDependenciesPromise = waitForDependencyResolution(loadPromise).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info])); + loadAndResolveDependenciesPromise.catch(() => { + /* avoid unhandled promise rejections */ + }); + this.moduleLoadPromises.set(module, loadPromise); + const resolveDependencyPromises = await loadPromise; + if (!isPreload) { + await this.fetchModuleDependencies(module, ...resolveDependencyPromises); + } + else if (isPreload === RESOLVE_DEPENDENCIES) { + await loadAndResolveDependenciesPromise; + } + return module; + } + async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises, loadAndResolveDependenciesPromise) { + if (this.modulesWithLoadedDependencies.has(module)) { + return; + } + this.modulesWithLoadedDependencies.add(module); + await Promise.all([ + this.fetchStaticDependencies(module, resolveStaticDependencyPromises), + this.fetchDynamicDependencies(module, resolveDynamicDependencyPromises) + ]); + module.linkImports(); + // To handle errors when resolving dependencies or in moduleParsed + await loadAndResolveDependenciesPromise; + } + fetchResolvedDependency(source, importer, resolvedId) { + if (resolvedId.external) { + const { attributes, external, id, moduleSideEffects, meta } = resolvedId; + let externalModule = this.modulesById.get(id); + if (!externalModule) { + externalModule = new ExternalModule(this.options, id, moduleSideEffects, meta, external !== 'absolute' && isAbsolute$1(id), attributes); + this.modulesById.set(id, externalModule); + } + else if (!(externalModule instanceof ExternalModule)) { + return error(logInternalIdCannotBeExternal(source, importer)); + } + else if (doAttributesDiffer(externalModule.info.attributes, attributes)) { + this.options.onLog(LOGLEVEL_WARN, logInconsistentImportAttributes(externalModule.info.attributes, attributes, source, importer)); + } + return Promise.resolve(externalModule); + } + return this.fetchModule(resolvedId, importer, false, false); + } + async fetchStaticDependencies(module, resolveStaticDependencyPromises) { + for (const dependency of await Promise.all(resolveStaticDependencyPromises.map(resolveStaticDependencyPromise => resolveStaticDependencyPromise.then(([source, resolvedId]) => this.fetchResolvedDependency(source, module.id, resolvedId))))) { + module.dependencies.add(dependency); + dependency.importers.push(module.id); + } + if (!this.options.treeshake || module.info.moduleSideEffects === 'no-treeshake') { + for (const dependency of module.dependencies) { + if (dependency instanceof Module) { + dependency.importedFromNotTreeshaken = true; + } + } + } + } + getNormalizedResolvedIdWithoutDefaults(resolveIdResult, importer, source) { + const { makeAbsoluteExternalsRelative } = this.options; + if (resolveIdResult) { + if (typeof resolveIdResult === 'object') { + const external = resolveIdResult.external || this.options.external(resolveIdResult.id, importer, true); + return { + ...resolveIdResult, + external: external && + (external === 'relative' || + !isAbsolute$1(resolveIdResult.id) || + (external === true && + isNotAbsoluteExternal(resolveIdResult.id, source, makeAbsoluteExternalsRelative)) || + 'absolute') + }; + } + const external = this.options.external(resolveIdResult, importer, true); + return { + external: external && + (isNotAbsoluteExternal(resolveIdResult, source, makeAbsoluteExternalsRelative) || + 'absolute'), + id: external && makeAbsoluteExternalsRelative + ? normalizeRelativeExternalId(resolveIdResult, importer) + : resolveIdResult + }; + } + const id = makeAbsoluteExternalsRelative + ? normalizeRelativeExternalId(source, importer) + : source; + if (resolveIdResult !== false && !this.options.external(id, importer, true)) { + return null; + } + return { + external: isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) || 'absolute', + id + }; + } + getResolveDynamicImportPromises(module) { + return module.dynamicImports.map(async (dynamicImport) => { + const resolvedId = await this.resolveDynamicImport(module, typeof dynamicImport.argument === 'string' + ? dynamicImport.argument + : dynamicImport.argument.esTreeNode, module.id, getAttributesFromImportExpression(dynamicImport.node)); + if (resolvedId && typeof resolvedId === 'object') { + dynamicImport.id = resolvedId.id; + } + return [dynamicImport, resolvedId]; + }); + } + getResolveStaticDependencyPromises(module) { + // eslint-disable-next-line unicorn/prefer-spread + return Array.from(module.sourcesWithAttributes, async ([source, attributes]) => [ + source, + (module.resolvedIds[source] = + module.resolvedIds[source] || + this.handleInvalidResolvedId(await this.resolveId(source, module.id, EMPTY_OBJECT, false, attributes), source, module.id, attributes)) + ]); + } + getResolvedIdWithDefaults(resolvedId, attributes) { + if (!resolvedId) { + return null; + } + const external = resolvedId.external || false; + return { + attributes: resolvedId.attributes || attributes, + external, + id: resolvedId.id, + meta: resolvedId.meta || {}, + moduleSideEffects: resolvedId.moduleSideEffects ?? this.hasModuleSideEffects(resolvedId.id, !!external), + resolvedBy: resolvedId.resolvedBy ?? 'rollup', + syntheticNamedExports: resolvedId.syntheticNamedExports ?? false + }; + } + async handleExistingModule(module, isEntry, isPreload) { + const loadPromise = this.moduleLoadPromises.get(module); + if (isPreload) { + return isPreload === RESOLVE_DEPENDENCIES + ? waitForDependencyResolution(loadPromise) + : loadPromise; + } + if (isEntry) { + // This reverts the changes in addEntryWithImplicitDependants and needs to + // be performed atomically + module.info.isEntry = true; + this.implicitEntryModules.delete(module); + for (const dependant of module.implicitlyLoadedAfter) { + dependant.implicitlyLoadedBefore.delete(module); + } + module.implicitlyLoadedAfter.clear(); + } + return this.fetchModuleDependencies(module, ...(await loadPromise)); + } + handleInvalidResolvedId(resolvedId, source, importer, attributes) { + if (resolvedId === null) { + if (isRelative(source)) { + return error(logUnresolvedImport(source, importer)); + } + this.options.onLog(LOGLEVEL_WARN, logUnresolvedImportTreatedAsExternal(source, importer)); + return { + attributes, + external: true, + id: source, + meta: {}, + moduleSideEffects: this.hasModuleSideEffects(source, true), + resolvedBy: 'rollup', + syntheticNamedExports: false + }; + } + else if (resolvedId.external && resolvedId.syntheticNamedExports) { + this.options.onLog(LOGLEVEL_WARN, logExternalSyntheticExports(source, importer)); + } + return resolvedId; + } + async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore, isLoadForManualChunks = false) { + const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT, true, EMPTY_OBJECT); + if (resolveIdResult == null) { + return error(implicitlyLoadedBefore === null + ? logUnresolvedEntry(unresolvedId) + : logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore)); + } + const isExternalModules = typeof resolveIdResult === 'object' && resolveIdResult.external; + if (resolveIdResult === false || isExternalModules) { + return error(implicitlyLoadedBefore === null + ? isExternalModules && isLoadForManualChunks + ? logExternalModulesCannotBeIncludedInManualChunks(unresolvedId) + : logEntryCannotBeExternal(unresolvedId) + : logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore)); + } + return this.fetchModule(this.getResolvedIdWithDefaults(typeof resolveIdResult === 'object' + ? resolveIdResult + : { id: resolveIdResult }, EMPTY_OBJECT), undefined, isEntry, false); + } + async resolveDynamicImport(module, specifier, importer, attributes) { + const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [ + specifier, + importer, + { attributes } + ]); + if (typeof specifier !== 'string') { + if (typeof resolution === 'string') { + return resolution; + } + if (!resolution) { + return null; + } + return this.getResolvedIdWithDefaults(resolution, attributes); + } + if (resolution == null) { + const existingResolution = module.resolvedIds[specifier]; + if (existingResolution) { + if (doAttributesDiffer(existingResolution.attributes, attributes)) { + this.options.onLog(LOGLEVEL_WARN, logInconsistentImportAttributes(existingResolution.attributes, attributes, specifier, importer)); + } + return existingResolution; + } + return (module.resolvedIds[specifier] = this.handleInvalidResolvedId(await this.resolveId(specifier, module.id, EMPTY_OBJECT, false, attributes), specifier, module.id, attributes)); + } + return this.handleInvalidResolvedId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier), attributes), specifier, importer, attributes); + } +} +function normalizeRelativeExternalId(source, importer) { + return isRelative(source) + ? importer + ? resolve$1(importer, '..', source) + : resolve$1(source) + : source; +} +function addChunkNamesToModule(module, { fileName, name }, isUserDefined, priority) { + if (fileName !== null) { + module.chunkFileNames.add(fileName); + } + else if (name !== null) { + // Always keep chunkNames sorted by priority + let namePosition = 0; + while (module.chunkNames[namePosition]?.priority < priority) + namePosition++; + module.chunkNames.splice(namePosition, 0, { isUserDefined, name, priority }); + } +} +function isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) { + return (makeAbsoluteExternalsRelative === true || + (makeAbsoluteExternalsRelative === 'ifRelativeSource' && isRelative(source)) || + !isAbsolute$1(id)); +} +async function waitForDependencyResolution(loadPromise) { + const [resolveStaticDependencyPromises, resolveDynamicImportPromises] = await loadPromise; + return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]); +} + +class GlobalScope extends Scope { + constructor() { + super(); + this.parent = null; + this.variables.set('undefined', new UndefinedVariable()); + } + findVariable(name) { + let variable = this.variables.get(name); + if (!variable) { + variable = new GlobalVariable(name); + this.variables.set(name, variable); + } + return variable; + } +} + +function generateAssetFileName(name, source, sourceHash, outputOptions, bundle) { + const emittedName = outputOptions.sanitizeFileName(name || 'asset'); + return makeUnique(renderNamePattern(typeof outputOptions.assetFileNames === 'function' + ? outputOptions.assetFileNames({ name, source, type: 'asset' }) + : outputOptions.assetFileNames, 'output.assetFileNames', { + ext: () => extname(emittedName).slice(1), + extname: () => extname(emittedName), + hash: size => sourceHash.slice(0, Math.max(0, size || DEFAULT_HASH_SIZE)), + name: () => emittedName.slice(0, Math.max(0, emittedName.length - extname(emittedName).length)) + }), bundle); +} +function reserveFileNameInBundle(fileName, { bundle }, log) { + if (bundle[lowercaseBundleKeys].has(fileName.toLowerCase())) { + log(LOGLEVEL_WARN, logFileNameConflict(fileName)); + } + else { + bundle[fileName] = FILE_PLACEHOLDER; + } +} +const emittedFileTypes = new Set(['chunk', 'asset', 'prebuilt-chunk']); +function hasValidType(emittedFile) { + return Boolean(emittedFile && + emittedFileTypes.has(emittedFile.type)); +} +function hasValidName(emittedFile) { + const validatedName = emittedFile.fileName || emittedFile.name; + return !validatedName || (typeof validatedName === 'string' && !isPathFragment(validatedName)); +} +function getValidSource(source, emittedFile, fileReferenceId) { + if (!(typeof source === 'string' || source instanceof Uint8Array)) { + const assetName = emittedFile.fileName || emittedFile.name || fileReferenceId; + return error(logFailedValidation(`Could not set source for ${typeof assetName === 'string' ? `asset "${assetName}"` : 'unnamed asset'}, asset source needs to be a string, Uint8Array or Buffer.`)); + } + return source; +} +function getAssetFileName(file, referenceId) { + if (typeof file.fileName !== 'string') { + return error(logAssetNotFinalisedForFileName(file.name || referenceId)); + } + return file.fileName; +} +function getChunkFileName(file, facadeChunkByModule) { + if (file.fileName) { + return file.fileName; + } + if (facadeChunkByModule) { + return facadeChunkByModule.get(file.module).getFileName(); + } + return error(logChunkNotGeneratedForFileName(file.fileName || file.name)); +} +class FileEmitter { + constructor(graph, options, baseFileEmitter) { + this.graph = graph; + this.options = options; + this.facadeChunkByModule = null; + this.nextIdBase = 1; + this.output = null; + this.outputFileEmitters = []; + this.emitFile = (emittedFile) => { + if (!hasValidType(emittedFile)) { + return error(logFailedValidation(`Emitted files must be of type "asset", "chunk" or "prebuilt-chunk", received "${emittedFile && emittedFile.type}".`)); + } + if (emittedFile.type === 'prebuilt-chunk') { + return this.emitPrebuiltChunk(emittedFile); + } + if (!hasValidName(emittedFile)) { + return error(logFailedValidation(`The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${emittedFile.fileName || emittedFile.name}".`)); + } + if (emittedFile.type === 'chunk') { + return this.emitChunk(emittedFile); + } + return this.emitAsset(emittedFile); + }; + this.finaliseAssets = () => { + for (const [referenceId, emittedFile] of this.filesByReferenceId) { + if (emittedFile.type === 'asset' && typeof emittedFile.fileName !== 'string') + return error(logNoAssetSourceSet(emittedFile.name || referenceId)); + } + }; + this.getFileName = (fileReferenceId) => { + const emittedFile = this.filesByReferenceId.get(fileReferenceId); + if (!emittedFile) + return error(logFileReferenceIdNotFoundForFilename(fileReferenceId)); + if (emittedFile.type === 'chunk') { + return getChunkFileName(emittedFile, this.facadeChunkByModule); + } + if (emittedFile.type === 'prebuilt-chunk') { + return emittedFile.fileName; + } + return getAssetFileName(emittedFile, fileReferenceId); + }; + this.setAssetSource = (referenceId, requestedSource) => { + const consumedFile = this.filesByReferenceId.get(referenceId); + if (!consumedFile) + return error(logAssetReferenceIdNotFoundForSetSource(referenceId)); + if (consumedFile.type !== 'asset') { + return error(logFailedValidation(`Asset sources can only be set for emitted assets but "${referenceId}" is an emitted chunk.`)); + } + if (consumedFile.source !== undefined) { + return error(logAssetSourceAlreadySet(consumedFile.name || referenceId)); + } + const source = getValidSource(requestedSource, consumedFile, referenceId); + if (this.output) { + this.finalizeAdditionalAsset(consumedFile, source, this.output); + } + else { + consumedFile.source = source; + for (const emitter of this.outputFileEmitters) { + emitter.finalizeAdditionalAsset(consumedFile, source, emitter.output); + } + } + }; + this.setChunkInformation = (facadeChunkByModule) => { + this.facadeChunkByModule = facadeChunkByModule; + }; + this.setOutputBundle = (bundle, outputOptions) => { + const getHash = hasherByType[outputOptions.hashCharacters]; + const output = (this.output = { + bundle, + fileNamesBySource: new Map(), + getHash, + outputOptions + }); + for (const emittedFile of this.filesByReferenceId.values()) { + if (emittedFile.fileName) { + reserveFileNameInBundle(emittedFile.fileName, output, this.options.onLog); + } + } + const consumedAssetsByHash = new Map(); + for (const consumedFile of this.filesByReferenceId.values()) { + if (consumedFile.type === 'asset' && consumedFile.source !== undefined) { + if (consumedFile.fileName) { + this.finalizeAdditionalAsset(consumedFile, consumedFile.source, output); + } + else { + const sourceHash = getHash(consumedFile.source); + getOrCreate(consumedAssetsByHash, sourceHash, () => []).push(consumedFile); + } + } + else if (consumedFile.type === 'prebuilt-chunk') { + this.output.bundle[consumedFile.fileName] = this.createPrebuiltChunk(consumedFile); + } + } + for (const [sourceHash, consumedFiles] of consumedAssetsByHash) { + this.finalizeAssetsWithSameSource(consumedFiles, sourceHash, output); + } + }; + this.filesByReferenceId = baseFileEmitter + ? new Map(baseFileEmitter.filesByReferenceId) + : new Map(); + baseFileEmitter?.addOutputFileEmitter(this); + } + addOutputFileEmitter(outputFileEmitter) { + this.outputFileEmitters.push(outputFileEmitter); + } + assignReferenceId(file, idBase) { + let referenceId = idBase; + do { + referenceId = getHash64(referenceId).slice(0, 8).replaceAll('-', '$'); + } while (this.filesByReferenceId.has(referenceId) || + this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId))); + file.referenceId = referenceId; + this.filesByReferenceId.set(referenceId, file); + for (const { filesByReferenceId } of this.outputFileEmitters) { + filesByReferenceId.set(referenceId, file); + } + return referenceId; + } + createPrebuiltChunk(prebuiltChunk) { + return { + code: prebuiltChunk.code, + dynamicImports: [], + exports: prebuiltChunk.exports || [], + facadeModuleId: null, + fileName: prebuiltChunk.fileName, + implicitlyLoadedBefore: [], + importedBindings: {}, + imports: [], + isDynamicEntry: false, + isEntry: false, + isImplicitEntry: false, + map: prebuiltChunk.map || null, + moduleIds: [], + modules: {}, + name: prebuiltChunk.fileName, + preliminaryFileName: prebuiltChunk.fileName, + referencedFiles: [], + sourcemapFileName: prebuiltChunk.sourcemapFileName || null, + type: 'chunk' + }; + } + emitAsset(emittedAsset) { + const source = emittedAsset.source === undefined + ? undefined + : getValidSource(emittedAsset.source, emittedAsset, null); + const consumedAsset = { + fileName: emittedAsset.fileName, + name: emittedAsset.name, + needsCodeReference: !!emittedAsset.needsCodeReference, + referenceId: '', + source, + type: 'asset' + }; + const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || String(this.nextIdBase++)); + if (this.output) { + this.emitAssetWithReferenceId(consumedAsset, this.output); + } + else { + for (const fileEmitter of this.outputFileEmitters) { + fileEmitter.emitAssetWithReferenceId(consumedAsset, fileEmitter.output); + } + } + return referenceId; + } + emitAssetWithReferenceId(consumedAsset, output) { + const { fileName, source } = consumedAsset; + if (fileName) { + reserveFileNameInBundle(fileName, output, this.options.onLog); + } + if (source !== undefined) { + this.finalizeAdditionalAsset(consumedAsset, source, output); + } + } + emitChunk(emittedChunk) { + if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) { + return error(logInvalidRollupPhaseForChunkEmission()); + } + if (typeof emittedChunk.id !== 'string') { + return error(logFailedValidation(`Emitted chunks need to have a valid string id, received "${emittedChunk.id}"`)); + } + const consumedChunk = { + fileName: emittedChunk.fileName, + module: null, + name: emittedChunk.name || emittedChunk.id, + referenceId: '', + type: 'chunk' + }; + this.graph.moduleLoader + .emitChunk(emittedChunk) + .then(module => (consumedChunk.module = module)) + .catch(() => { + // Avoid unhandled Promise rejection as the error will be thrown later + // once module loading has finished + }); + return this.assignReferenceId(consumedChunk, emittedChunk.id); + } + emitPrebuiltChunk(emitPrebuiltChunk) { + if (typeof emitPrebuiltChunk.code !== 'string') { + return error(logFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${emitPrebuiltChunk.code}".`)); + } + if (typeof emitPrebuiltChunk.fileName !== 'string' || + isPathFragment(emitPrebuiltChunk.fileName)) { + return error(logFailedValidation(`The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${emitPrebuiltChunk.fileName}".`)); + } + const consumedPrebuiltChunk = { + code: emitPrebuiltChunk.code, + exports: emitPrebuiltChunk.exports, + fileName: emitPrebuiltChunk.fileName, + map: emitPrebuiltChunk.map, + referenceId: '', + type: 'prebuilt-chunk' + }; + const referenceId = this.assignReferenceId(consumedPrebuiltChunk, consumedPrebuiltChunk.fileName); + if (this.output) { + this.output.bundle[consumedPrebuiltChunk.fileName] = + this.createPrebuiltChunk(consumedPrebuiltChunk); + } + return referenceId; + } + finalizeAdditionalAsset(consumedFile, source, { bundle, fileNamesBySource, getHash, outputOptions }) { + let { fileName, needsCodeReference, referenceId } = consumedFile; + // Deduplicate assets if an explicit fileName is not provided + if (!fileName) { + const sourceHash = getHash(source); + fileName = fileNamesBySource.get(sourceHash); + if (!fileName) { + fileName = generateAssetFileName(consumedFile.name, source, sourceHash, outputOptions, bundle); + fileNamesBySource.set(sourceHash, fileName); + } + } + // We must not modify the original assets to avoid interaction between outputs + const assetWithFileName = { ...consumedFile, fileName, source }; + this.filesByReferenceId.set(referenceId, assetWithFileName); + const existingAsset = bundle[fileName]; + if (existingAsset?.type === 'asset') { + existingAsset.needsCodeReference &&= needsCodeReference; + } + else { + bundle[fileName] = { + fileName, + name: consumedFile.name, + needsCodeReference, + source, + type: 'asset' + }; + } + } + finalizeAssetsWithSameSource(consumedFiles, sourceHash, { bundle, fileNamesBySource, outputOptions }) { + let fileName = ''; + let usedConsumedFile; + let needsCodeReference = true; + for (const consumedFile of consumedFiles) { + needsCodeReference &&= consumedFile.needsCodeReference; + const assetFileName = generateAssetFileName(consumedFile.name, consumedFile.source, sourceHash, outputOptions, bundle); + if (!fileName || + assetFileName.length < fileName.length || + (assetFileName.length === fileName.length && assetFileName < fileName)) { + fileName = assetFileName; + usedConsumedFile = consumedFile; + } + } + fileNamesBySource.set(sourceHash, fileName); + for (const consumedFile of consumedFiles) { + // We must not modify the original assets to avoid interaction between outputs + const assetWithFileName = { ...consumedFile, fileName }; + this.filesByReferenceId.set(consumedFile.referenceId, assetWithFileName); + } + bundle[fileName] = { + fileName, + name: usedConsumedFile.name, + needsCodeReference, + source: usedConsumedFile.source, + type: 'asset' + }; + } +} + +function getLogHandler(level, code, logger, pluginName, logLevel) { + if (logLevelPriority[level] < logLevelPriority[logLevel]) { + return doNothing; + } + return (log, pos) => { + if (pos != null) { + logger(LOGLEVEL_WARN, logInvalidLogPosition(pluginName)); + } + log = normalizeLog(log); + if (log.code && !log.pluginCode) { + log.pluginCode = log.code; + } + log.code = code; + log.plugin = pluginName; + logger(level, log); + }; +} + +function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, existingPluginNames) { + const { logLevel, onLog } = options; + let cacheable = true; + if (typeof plugin.cacheKey !== 'string') { + if (plugin.name.startsWith(ANONYMOUS_PLUGIN_PREFIX) || + plugin.name.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) || + existingPluginNames.has(plugin.name)) { + cacheable = false; + } + else { + existingPluginNames.add(plugin.name); + } + } + let cacheInstance; + if (!pluginCache) { + cacheInstance = NO_CACHE; + } + else if (cacheable) { + const cacheKey = plugin.cacheKey || plugin.name; + cacheInstance = createPluginCache(pluginCache[cacheKey] || (pluginCache[cacheKey] = Object.create(null))); + } + else { + cacheInstance = getCacheForUncacheablePlugin(plugin.name); + } + return { + addWatchFile(id) { + graph.watchFiles[id] = true; + }, + cache: cacheInstance, + debug: getLogHandler(LOGLEVEL_DEBUG, 'PLUGIN_LOG', onLog, plugin.name, logLevel), + emitFile: fileEmitter.emitFile.bind(fileEmitter), + error(error_) { + return error(logPluginError(normalizeLog(error_), plugin.name)); + }, + getFileName: fileEmitter.getFileName, + getModuleIds: () => graph.modulesById.keys(), + getModuleInfo: graph.getModuleInfo, + getWatchFiles: () => Object.keys(graph.watchFiles), + info: getLogHandler(LOGLEVEL_INFO, 'PLUGIN_LOG', onLog, plugin.name, logLevel), + load(resolvedId) { + return graph.moduleLoader.preloadModule(resolvedId); + }, + meta: { + rollupVersion: version, + watchMode: graph.watchMode + }, + parse: parseAst, + resolve(source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) { + skipSelf ??= true; + return graph.moduleLoader.resolveId(source, importer, custom, isEntry, attributes || EMPTY_OBJECT, skipSelf ? [{ importer, plugin, source }] : null); + }, + setAssetSource: fileEmitter.setAssetSource, + warn: getLogHandler(LOGLEVEL_WARN, 'PLUGIN_WARNING', onLog, plugin.name, logLevel) + }; +} + +// This will make sure no input hook is omitted +const inputHookNames = { + buildEnd: 1, + buildStart: 1, + closeBundle: 1, + closeWatcher: 1, + load: 1, + moduleParsed: 1, + onLog: 1, + options: 1, + resolveDynamicImport: 1, + resolveId: 1, + shouldTransformCachedModule: 1, + transform: 1, + watchChange: 1 +}; +const inputHooks = Object.keys(inputHookNames); +class PluginDriver { + constructor(graph, options, userPlugins, pluginCache, basePluginDriver) { + this.graph = graph; + this.options = options; + this.pluginCache = pluginCache; + this.sortedPlugins = new Map(); + this.unfulfilledActions = new Set(); + this.fileEmitter = new FileEmitter(graph, options, basePluginDriver && basePluginDriver.fileEmitter); + this.emitFile = this.fileEmitter.emitFile.bind(this.fileEmitter); + this.getFileName = this.fileEmitter.getFileName.bind(this.fileEmitter); + this.finaliseAssets = this.fileEmitter.finaliseAssets.bind(this.fileEmitter); + this.setChunkInformation = this.fileEmitter.setChunkInformation.bind(this.fileEmitter); + this.setOutputBundle = this.fileEmitter.setOutputBundle.bind(this.fileEmitter); + this.plugins = [...(basePluginDriver ? basePluginDriver.plugins : []), ...userPlugins]; + const existingPluginNames = new Set(); + this.pluginContexts = new Map(this.plugins.map(plugin => [ + plugin, + getPluginContext(plugin, pluginCache, graph, options, this.fileEmitter, existingPluginNames) + ])); + if (basePluginDriver) { + for (const plugin of userPlugins) { + for (const hook of inputHooks) { + if (hook in plugin) { + options.onLog(LOGLEVEL_WARN, logInputHookInOutputPlugin(plugin.name, hook)); + } + } + } + } + } + createOutputPluginDriver(plugins) { + return new PluginDriver(this.graph, this.options, plugins, this.pluginCache, this); + } + getUnfulfilledHookActions() { + return this.unfulfilledActions; + } + // chains, first non-null result stops and returns + hookFirst(hookName, parameters, replaceContext, skipped) { + return this.hookFirstAndGetPlugin(hookName, parameters, replaceContext, skipped).then(result => result && result[0]); + } + // chains, first non-null result stops and returns result and last plugin + async hookFirstAndGetPlugin(hookName, parameters, replaceContext, skipped) { + for (const plugin of this.getSortedPlugins(hookName)) { + if (skipped?.has(plugin)) + continue; + const result = await this.runHook(hookName, parameters, plugin, replaceContext); + if (result != null) + return [result, plugin]; + } + return null; + } + // chains synchronously, first non-null result stops and returns + hookFirstSync(hookName, parameters, replaceContext) { + for (const plugin of this.getSortedPlugins(hookName)) { + const result = this.runHookSync(hookName, parameters, plugin, replaceContext); + if (result != null) + return result; + } + return null; + } + // parallel, ignores returns + async hookParallel(hookName, parameters, replaceContext) { + const parallelPromises = []; + for (const plugin of this.getSortedPlugins(hookName)) { + if (plugin[hookName].sequential) { + await Promise.all(parallelPromises); + parallelPromises.length = 0; + await this.runHook(hookName, parameters, plugin, replaceContext); + } + else { + parallelPromises.push(this.runHook(hookName, parameters, plugin, replaceContext)); + } + } + await Promise.all(parallelPromises); + } + // chains, reduces returned value, handling the reduced value as the first hook argument + hookReduceArg0(hookName, [argument0, ...rest], reduce, replaceContext) { + let promise = Promise.resolve(argument0); + for (const plugin of this.getSortedPlugins(hookName)) { + promise = promise.then(argument0 => this.runHook(hookName, [argument0, ...rest], plugin, replaceContext).then(result => reduce.call(this.pluginContexts.get(plugin), argument0, result, plugin))); + } + return promise; + } + // chains synchronously, reduces returned value, handling the reduced value as the first hook argument + hookReduceArg0Sync(hookName, [argument0, ...rest], reduce, replaceContext) { + for (const plugin of this.getSortedPlugins(hookName)) { + const parameters = [argument0, ...rest]; + const result = this.runHookSync(hookName, parameters, plugin, replaceContext); + argument0 = reduce.call(this.pluginContexts.get(plugin), argument0, result, plugin); + } + return argument0; + } + // chains, reduces returned value to type string, handling the reduced value separately. permits hooks as values. + async hookReduceValue(hookName, initialValue, parameters, reducer) { + const results = []; + const parallelResults = []; + for (const plugin of this.getSortedPlugins(hookName, validateAddonPluginHandler)) { + if (plugin[hookName].sequential) { + results.push(...(await Promise.all(parallelResults))); + parallelResults.length = 0; + results.push(await this.runHook(hookName, parameters, plugin)); + } + else { + parallelResults.push(this.runHook(hookName, parameters, plugin)); + } + } + results.push(...(await Promise.all(parallelResults))); + return results.reduce(reducer, await initialValue); + } + // chains synchronously, reduces returned value to type T, handling the reduced value separately. permits hooks as values. + hookReduceValueSync(hookName, initialValue, parameters, reduce, replaceContext) { + let accumulator = initialValue; + for (const plugin of this.getSortedPlugins(hookName)) { + const result = this.runHookSync(hookName, parameters, plugin, replaceContext); + accumulator = reduce.call(this.pluginContexts.get(plugin), accumulator, result, plugin); + } + return accumulator; + } + // chains, ignores returns + hookSeq(hookName, parameters, replaceContext) { + let promise = Promise.resolve(); + for (const plugin of this.getSortedPlugins(hookName)) { + promise = promise.then(() => this.runHook(hookName, parameters, plugin, replaceContext)); + } + return promise.then(noReturn); + } + getSortedPlugins(hookName, validateHandler) { + return getOrCreate(this.sortedPlugins, hookName, () => getSortedValidatedPlugins(hookName, this.plugins, validateHandler)); + } + // Implementation signature + runHook(hookName, parameters, plugin, replaceContext) { + // We always filter for plugins that support the hook before running it + const hook = plugin[hookName]; + const handler = typeof hook === 'object' ? hook.handler : hook; + let context = this.pluginContexts.get(plugin); + if (replaceContext) { + context = replaceContext(context, plugin); + } + let action = null; + return Promise.resolve() + .then(() => { + if (typeof handler !== 'function') { + return handler; + } + // eslint-disable-next-line @typescript-eslint/ban-types + const hookResult = handler.apply(context, parameters); + if (!hookResult?.then) { + // short circuit for non-thenables and non-Promises + return hookResult; + } + // Track pending hook actions to properly error out when + // unfulfilled promises cause rollup to abruptly and confusingly + // exit with a successful 0 return code but without producing any + // output, errors or warnings. + action = [plugin.name, hookName, parameters]; + this.unfulfilledActions.add(action); + // Although it would be more elegant to just return hookResult here + // and put the .then() handler just above the .catch() handler below, + // doing so would subtly change the defacto async event dispatch order + // which at least one test and some plugins in the wild may depend on. + return Promise.resolve(hookResult).then(result => { + // action was fulfilled + this.unfulfilledActions.delete(action); + return result; + }); + }) + .catch(error_ => { + if (action !== null) { + // action considered to be fulfilled since error being handled + this.unfulfilledActions.delete(action); + } + return error(logPluginError(error_, plugin.name, { hook: hookName })); + }); + } + /** + * Run a sync plugin hook and return the result. + * @param hookName Name of the plugin hook. Must be in `PluginHooks`. + * @param args Arguments passed to the plugin hook. + * @param plugin The acutal plugin + * @param replaceContext When passed, the plugin context can be overridden. + */ + runHookSync(hookName, parameters, plugin, replaceContext) { + const hook = plugin[hookName]; + const handler = typeof hook === 'object' ? hook.handler : hook; + let context = this.pluginContexts.get(plugin); + if (replaceContext) { + context = replaceContext(context, plugin); + } + try { + // eslint-disable-next-line @typescript-eslint/ban-types + return handler.apply(context, parameters); + } + catch (error_) { + return error(logPluginError(error_, plugin.name, { hook: hookName })); + } + } +} +function getSortedValidatedPlugins(hookName, plugins, validateHandler = validateFunctionPluginHandler) { + const pre = []; + const normal = []; + const post = []; + for (const plugin of plugins) { + const hook = plugin[hookName]; + if (hook) { + if (typeof hook === 'object') { + validateHandler(hook.handler, hookName, plugin); + if (hook.order === 'pre') { + pre.push(plugin); + continue; + } + if (hook.order === 'post') { + post.push(plugin); + continue; + } + } + else { + validateHandler(hook, hookName, plugin); + } + normal.push(plugin); + } + } + return [...pre, ...normal, ...post]; +} +function validateFunctionPluginHandler(handler, hookName, plugin) { + if (typeof handler !== 'function') { + error(logInvalidFunctionPluginHook(hookName, plugin.name)); + } +} +function validateAddonPluginHandler(handler, hookName, plugin) { + if (typeof handler !== 'string' && typeof handler !== 'function') { + return error(logInvalidAddonPluginHook(hookName, plugin.name)); + } +} +function noReturn() { } + +class Queue { + constructor(maxParallel) { + this.maxParallel = maxParallel; + this.queue = []; + this.workerCount = 0; + } + run(task) { + return new Promise((resolve, reject) => { + this.queue.push({ reject, resolve, task }); + this.work(); + }); + } + async work() { + if (this.workerCount >= this.maxParallel) + return; + this.workerCount++; + let entry; + while ((entry = this.queue.shift())) { + const { reject, resolve, task } = entry; + try { + const result = await task(); + resolve(result); + } + catch (error) { + reject(error); + } + } + this.workerCount--; + } +} + +function normalizeEntryModules(entryModules) { + if (Array.isArray(entryModules)) { + return entryModules.map(id => ({ + fileName: null, + id, + implicitlyLoadedAfter: [], + importer: undefined, + name: null + })); + } + return Object.entries(entryModules).map(([name, id]) => ({ + fileName: null, + id, + implicitlyLoadedAfter: [], + importer: undefined, + name + })); +} +class Graph { + constructor(options, watcher) { + this.options = options; + this.astLru = flru(5); + this.cachedModules = new Map(); + this.deoptimizationTracker = new PathTracker(); + this.entryModules = []; + this.modulesById = new Map(); + this.needsTreeshakingPass = false; + this.phase = BuildPhase.LOAD_AND_PARSE; + this.scope = new GlobalScope(); + this.watchFiles = Object.create(null); + this.watchMode = false; + this.externalModules = []; + this.implicitEntryModules = []; + this.modules = []; + this.getModuleInfo = (moduleId) => { + const foundModule = this.modulesById.get(moduleId); + if (!foundModule) + return null; + return foundModule.info; + }; + if (options.cache !== false) { + if (options.cache?.modules) { + for (const module of options.cache.modules) + this.cachedModules.set(module.id, module); + } + this.pluginCache = options.cache?.plugins || Object.create(null); + // increment access counter + for (const name in this.pluginCache) { + const cache = this.pluginCache[name]; + for (const value of Object.values(cache)) + value[0]++; + } + } + if (watcher) { + this.watchMode = true; + const handleChange = (...parameters) => this.pluginDriver.hookParallel('watchChange', parameters); + const handleClose = () => this.pluginDriver.hookParallel('closeWatcher', []); + watcher.onCurrentRun('change', handleChange); + watcher.onCurrentRun('close', handleClose); + } + this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache); + this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver); + this.fileOperationQueue = new Queue(options.maxParallelFileOps); + this.pureFunctions = getPureFunctions(options); + } + async build() { + timeStart('generate module graph', 2); + await this.generateModuleGraph(); + timeEnd('generate module graph', 2); + timeStart('sort and bind modules', 2); + this.phase = BuildPhase.ANALYSE; + this.sortModules(); + timeEnd('sort and bind modules', 2); + timeStart('mark included statements', 2); + this.includeStatements(); + timeEnd('mark included statements', 2); + this.phase = BuildPhase.GENERATE; + } + getCache() { + // handle plugin cache eviction + for (const name in this.pluginCache) { + const cache = this.pluginCache[name]; + let allDeleted = true; + for (const [key, value] of Object.entries(cache)) { + if (value[0] >= this.options.experimentalCacheExpiry) + delete cache[key]; + else + allDeleted = false; + } + if (allDeleted) + delete this.pluginCache[name]; + } + return { + modules: this.modules.map(module => module.toJSON()), + plugins: this.pluginCache + }; + } + async generateModuleGraph() { + ({ entryModules: this.entryModules, implicitEntryModules: this.implicitEntryModules } = + await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input), true)); + if (this.entryModules.length === 0) { + throw new Error('You must supply options.input to rollup'); + } + for (const module of this.modulesById.values()) { + if (module instanceof Module) { + this.modules.push(module); + } + else { + this.externalModules.push(module); + } + } + } + includeStatements() { + const entryModules = [...this.entryModules, ...this.implicitEntryModules]; + for (const module of entryModules) { + markModuleAndImpureDependenciesAsExecuted(module); + } + if (this.options.treeshake) { + let treeshakingPass = 1; + do { + timeStart(`treeshaking pass ${treeshakingPass}`, 3); + this.needsTreeshakingPass = false; + for (const module of this.modules) { + if (module.isExecuted) { + if (module.info.moduleSideEffects === 'no-treeshake') { + module.includeAllInBundle(); + } + else { + module.include(); + } + } + } + if (treeshakingPass === 1) { + // We only include exports after the first pass to avoid issues with + // the TDZ detection logic + for (const module of entryModules) { + if (module.preserveSignature !== false) { + module.includeAllExports(false); + this.needsTreeshakingPass = true; + } + } + } + timeEnd(`treeshaking pass ${treeshakingPass++}`, 3); + } while (this.needsTreeshakingPass); + } + else { + for (const module of this.modules) + module.includeAllInBundle(); + } + for (const externalModule of this.externalModules) + externalModule.warnUnusedImports(); + for (const module of this.implicitEntryModules) { + for (const dependant of module.implicitlyLoadedAfter) { + if (!(dependant.info.isEntry || dependant.isIncluded())) { + error(logImplicitDependantIsNotIncluded(dependant)); + } + } + } + } + sortModules() { + const { orderedModules, cyclePaths } = analyseModuleExecution(this.entryModules); + for (const cyclePath of cyclePaths) { + this.options.onLog(LOGLEVEL_WARN, logCircularDependency(cyclePath)); + } + this.modules = orderedModules; + for (const module of this.modules) { + module.bindReferences(); + } + this.warnForMissingExports(); + } + warnForMissingExports() { + for (const module of this.modules) { + for (const importDescription of module.importDescriptions.values()) { + if (importDescription.name !== '*' && + !importDescription.module.getVariableForExportName(importDescription.name)[0]) { + module.log(LOGLEVEL_WARN, logMissingExport(importDescription.name, module.id, importDescription.module.id), importDescription.start); + } + } + } + } +} + +function formatAction([pluginName, hookName, parameters]) { + const action = `(${pluginName}) ${hookName}`; + const s = JSON.stringify; + switch (hookName) { + case 'resolveId': { + return `${action} ${s(parameters[0])} ${s(parameters[1])}`; + } + case 'load': { + return `${action} ${s(parameters[0])}`; + } + case 'transform': { + return `${action} ${s(parameters[1])}`; + } + case 'shouldTransformCachedModule': { + return `${action} ${s(parameters[0].id)}`; + } + case 'moduleParsed': { + return `${action} ${s(parameters[0].id)}`; + } + } + return action; +} +let handleBeforeExit = null; +const rejectByPluginDriver = new Map(); +async function catchUnfinishedHookActions(pluginDriver, callback) { + const emptyEventLoopPromise = new Promise((_, reject) => { + rejectByPluginDriver.set(pluginDriver, reject); + if (!handleBeforeExit) { + // We only ever create a single event listener to avoid max listener and + // other issues + handleBeforeExit = () => { + for (const [pluginDriver, reject] of rejectByPluginDriver) { + const unfulfilledActions = pluginDriver.getUnfulfilledHookActions(); + reject(new Error(`Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:\n` + + [...unfulfilledActions].map(formatAction).join('\n'))); + } + }; + process$1.once('beforeExit', handleBeforeExit); + } + }); + try { + return await Promise.race([callback(), emptyEventLoopPromise]); + } + finally { + rejectByPluginDriver.delete(pluginDriver); + if (rejectByPluginDriver.size === 0) { + process$1.off('beforeExit', handleBeforeExit); + handleBeforeExit = null; + } + } +} + +async function initWasm() { } + +function getLogger(plugins, onLog, watchMode, logLevel) { + plugins = getSortedValidatedPlugins('onLog', plugins); + const minimalPriority = logLevelPriority[logLevel]; + const logger = (level, log, skipped = EMPTY_SET) => { + const logPriority = logLevelPriority[level]; + if (logPriority < minimalPriority) { + return; + } + for (const plugin of plugins) { + if (skipped.has(plugin)) + continue; + const { onLog: pluginOnLog } = plugin; + const getLogHandler = (level) => { + if (logLevelPriority[level] < minimalPriority) { + return doNothing; + } + return log => logger(level, normalizeLog(log), new Set(skipped).add(plugin)); + }; + const handler = 'handler' in pluginOnLog ? pluginOnLog.handler : pluginOnLog; + if (handler.call({ + debug: getLogHandler(LOGLEVEL_DEBUG), + error: (log) => error(normalizeLog(log)), + info: getLogHandler(LOGLEVEL_INFO), + meta: { rollupVersion: version, watchMode }, + warn: getLogHandler(LOGLEVEL_WARN) + }, level, log) === false) { + return; + } + } + onLog(level, log); + }; + return logger; +} + +function ensureArray(items) { + if (Array.isArray(items)) { + return items.filter(Boolean); + } + if (items) { + return [items]; + } + return []; +} + +async function normalizeInputOptions(config, watchMode) { + // These are options that may trigger special warnings or behaviour later + // if the user did not select an explicit value + const unsetOptions = new Set(); + const context = config.context ?? 'undefined'; + const plugins = await normalizePluginOption(config.plugins); + const logLevel = config.logLevel || LOGLEVEL_INFO; + const onLog = getLogger(plugins, getOnLog(config, logLevel), watchMode, logLevel); + const strictDeprecations = config.strictDeprecations || false; + const maxParallelFileOps = getMaxParallelFileOps(config); + const options = { + cache: getCache(config), + context, + experimentalCacheExpiry: config.experimentalCacheExpiry ?? 10, + experimentalLogSideEffects: config.experimentalLogSideEffects || false, + external: getIdMatcher(config.external), + input: getInput(config), + logLevel, + makeAbsoluteExternalsRelative: config.makeAbsoluteExternalsRelative ?? 'ifRelativeSource', + maxParallelFileOps, + moduleContext: getModuleContext(config, context), + onLog, + perf: config.perf || false, + plugins, + preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only', + preserveSymlinks: config.preserveSymlinks || false, + shimMissingExports: config.shimMissingExports || false, + strictDeprecations, + treeshake: getTreeshake(config) + }; + warnUnknownOptions(config, [...Object.keys(options), 'onwarn', 'watch'], 'input options', onLog, /^(output)$/); + return { options, unsetOptions }; +} +const getCache = (config) => config.cache === true // `true` is the default + ? undefined + : config.cache?.cache || config.cache; +const getIdMatcher = (option) => { + if (option === true) { + return () => true; + } + if (typeof option === 'function') { + return (id, ...parameters) => (!id.startsWith('\0') && option(id, ...parameters)) || false; + } + if (option) { + const ids = new Set(); + const matchers = []; + for (const value of ensureArray(option)) { + if (value instanceof RegExp) { + matchers.push(value); + } + else { + ids.add(value); + } + } + return (id, ..._arguments) => ids.has(id) || matchers.some(matcher => matcher.test(id)); + } + return () => false; +}; +const getInput = (config) => { + const configInput = config.input; + return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput; +}; +const getMaxParallelFileOps = (config) => { + const maxParallelFileOps = config.maxParallelFileOps; + if (typeof maxParallelFileOps === 'number') { + if (maxParallelFileOps <= 0) + return Infinity; + return maxParallelFileOps; + } + return 20; +}; +const getModuleContext = (config, context) => { + const configModuleContext = config.moduleContext; + if (typeof configModuleContext === 'function') { + return id => configModuleContext(id) ?? context; + } + if (configModuleContext) { + const contextByModuleId = Object.create(null); + for (const [key, moduleContext] of Object.entries(configModuleContext)) { + contextByModuleId[resolve$1(key)] = moduleContext; + } + return id => contextByModuleId[id] ?? context; + } + return () => context; +}; +const getTreeshake = (config) => { + const configTreeshake = config.treeshake; + if (configTreeshake === false) { + return false; + } + const configWithPreset = getOptionWithPreset(config.treeshake, treeshakePresets, 'treeshake', URL_TREESHAKE, 'false, true, '); + return { + annotations: configWithPreset.annotations !== false, + correctVarValueBeforeDeclaration: configWithPreset.correctVarValueBeforeDeclaration === true, + manualPureFunctions: configWithPreset.manualPureFunctions ?? EMPTY_ARRAY, + moduleSideEffects: getHasModuleSideEffects(configWithPreset.moduleSideEffects), + propertyReadSideEffects: configWithPreset.propertyReadSideEffects === 'always' + ? 'always' + : configWithPreset.propertyReadSideEffects !== false, + tryCatchDeoptimization: configWithPreset.tryCatchDeoptimization !== false, + unknownGlobalSideEffects: configWithPreset.unknownGlobalSideEffects !== false + }; +}; +const getHasModuleSideEffects = (moduleSideEffectsOption) => { + if (typeof moduleSideEffectsOption === 'boolean') { + return () => moduleSideEffectsOption; + } + if (moduleSideEffectsOption === 'no-external') { + return (_id, external) => !external; + } + if (typeof moduleSideEffectsOption === 'function') { + return (id, external) => id.startsWith('\0') ? true : moduleSideEffectsOption(id, external) !== false; + } + if (Array.isArray(moduleSideEffectsOption)) { + const ids = new Set(moduleSideEffectsOption); + return id => ids.has(id); + } + if (moduleSideEffectsOption) { + error(logInvalidOption('treeshake.moduleSideEffects', URL_TREESHAKE_MODULESIDEEFFECTS, 'please use one of false, "no-external", a function or an array')); + } + return () => true; +}; + +// https://datatracker.ietf.org/doc/html/rfc2396 +// eslint-disable-next-line no-control-regex +const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g; +const DRIVE_LETTER_REGEX = /^[a-z]:/i; +function sanitizeFileName(name) { + const match = DRIVE_LETTER_REGEX.exec(name); + const driveLetter = match ? match[0] : ''; + // A `:` is only allowed as part of a windows drive letter (ex: C:\foo) + // Otherwise, avoid them because they can refer to NTFS alternate data streams. + return driveLetter + name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, '_'); +} + +async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) { + // These are options that may trigger special warnings or behaviour later + // if the user did not select an explicit value + const unsetOptions = new Set(unsetInputOptions); + const compact = config.compact || false; + const format = getFormat(config); + const inlineDynamicImports = getInlineDynamicImports(config, inputOptions); + const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions); + const file = getFile(config, preserveModules, inputOptions); + const generatedCode = getGeneratedCode(config); + const externalImportAttributes = getExternalImportAttributes(config, inputOptions); + const outputOptions = { + amd: getAmd(config), + assetFileNames: config.assetFileNames ?? 'assets/[name]-[hash][extname]', + banner: getAddon(config, 'banner'), + chunkFileNames: config.chunkFileNames ?? '[name]-[hash].js', + compact, + dir: getDir(config, file), + dynamicImportInCjs: config.dynamicImportInCjs ?? true, + entryFileNames: getEntryFileNames(config, unsetOptions), + esModule: config.esModule ?? 'if-default-prop', + experimentalMinChunkSize: config.experimentalMinChunkSize ?? 1, + exports: getExports(config, unsetOptions), + extend: config.extend || false, + externalImportAssertions: externalImportAttributes, + externalImportAttributes, + externalLiveBindings: config.externalLiveBindings ?? true, + file, + footer: getAddon(config, 'footer'), + format, + freeze: config.freeze ?? true, + generatedCode, + globals: config.globals || {}, + hashCharacters: config.hashCharacters ?? 'base64', + hoistTransitiveImports: config.hoistTransitiveImports ?? true, + indent: getIndent(config, compact), + inlineDynamicImports, + interop: getInterop(config), + intro: getAddon(config, 'intro'), + manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules), + minifyInternalExports: getMinifyInternalExports(config, format, compact), + name: config.name, + noConflict: config.noConflict || false, + outro: getAddon(config, 'outro'), + paths: config.paths || {}, + plugins: await normalizePluginOption(config.plugins), + preserveModules, + preserveModulesRoot: getPreserveModulesRoot(config), + sanitizeFileName: typeof config.sanitizeFileName === 'function' + ? config.sanitizeFileName + : config.sanitizeFileName === false + ? id => id + : sanitizeFileName, + sourcemap: config.sourcemap || false, + sourcemapBaseUrl: getSourcemapBaseUrl(config), + sourcemapExcludeSources: config.sourcemapExcludeSources || false, + sourcemapFile: config.sourcemapFile, + sourcemapFileNames: getSourcemapFileNames(config, unsetOptions), + sourcemapIgnoreList: typeof config.sourcemapIgnoreList === 'function' + ? config.sourcemapIgnoreList + : config.sourcemapIgnoreList === false + ? () => false + : relativeSourcePath => relativeSourcePath.includes('node_modules'), + sourcemapPathTransform: config.sourcemapPathTransform, + strict: config.strict ?? true, + systemNullSetters: config.systemNullSetters ?? true, + validate: config.validate || false + }; + warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onLog); + return { options: outputOptions, unsetOptions }; +} +const getFile = (config, preserveModules, inputOptions) => { + const { file } = config; + if (typeof file === 'string') { + if (preserveModules) { + return error(logInvalidOption('output.file', URL_OUTPUT_DIR, 'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option')); + } + if (!Array.isArray(inputOptions.input)) + return error(logInvalidOption('output.file', URL_OUTPUT_DIR, 'you must set "output.dir" instead of "output.file" when providing named inputs')); + } + return file; +}; +const getFormat = (config) => { + const configFormat = config.format; + switch (configFormat) { + case undefined: + case 'es': + case 'esm': + case 'module': { + return 'es'; + } + case 'cjs': + case 'commonjs': { + return 'cjs'; + } + case 'system': + case 'systemjs': { + return 'system'; + } + case 'amd': + case 'iife': + case 'umd': { + return configFormat; + } + default: { + return error(logInvalidOption('output.format', URL_OUTPUT_FORMAT, `Valid values are "amd", "cjs", "system", "es", "iife" or "umd"`, configFormat)); + } + } +}; +const getInlineDynamicImports = (config, inputOptions) => { + const inlineDynamicImports = config.inlineDynamicImports || false; + const { input } = inputOptions; + if (inlineDynamicImports && (Array.isArray(input) ? input : Object.keys(input)).length > 1) { + return error(logInvalidOption('output.inlineDynamicImports', URL_OUTPUT_INLINEDYNAMICIMPORTS, 'multiple inputs are not supported when "output.inlineDynamicImports" is true')); + } + return inlineDynamicImports; +}; +const getPreserveModules = (config, inlineDynamicImports, inputOptions) => { + const preserveModules = config.preserveModules || false; + if (preserveModules) { + if (inlineDynamicImports) { + return error(logInvalidOption('output.inlineDynamicImports', URL_OUTPUT_INLINEDYNAMICIMPORTS, `this option is not supported for "output.preserveModules"`)); + } + if (inputOptions.preserveEntrySignatures === false) { + return error(logInvalidOption('preserveEntrySignatures', URL_PRESERVEENTRYSIGNATURES, 'setting this option to false is not supported for "output.preserveModules"')); + } + } + return preserveModules; +}; +const getPreserveModulesRoot = (config) => { + const { preserveModulesRoot } = config; + if (preserveModulesRoot === null || preserveModulesRoot === undefined) { + return undefined; + } + return resolve$1(preserveModulesRoot); +}; +const getAmd = (config) => { + const mergedOption = { + autoId: false, + basePath: '', + define: 'define', + forceJsExtensionForImports: false, + ...config.amd + }; + if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) { + return error(logInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"')); + } + if (mergedOption.basePath && !mergedOption.autoId) { + return error(logInvalidOption('output.amd.basePath', URL_OUTPUT_AMD_BASEPATH, 'this option only works with "output.amd.autoId"')); + } + return mergedOption.autoId + ? { + autoId: true, + basePath: mergedOption.basePath, + define: mergedOption.define, + forceJsExtensionForImports: mergedOption.forceJsExtensionForImports + } + : { + autoId: false, + define: mergedOption.define, + forceJsExtensionForImports: mergedOption.forceJsExtensionForImports, + id: mergedOption.id + }; +}; +const getAddon = (config, name) => { + const configAddon = config[name]; + if (typeof configAddon === 'function') { + return configAddon; + } + return () => configAddon || ''; +}; +// eslint-disable-next-line unicorn/prevent-abbreviations +const getDir = (config, file) => { + const { dir } = config; + if (typeof dir === 'string' && typeof file === 'string') { + return error(logInvalidOption('output.dir', URL_OUTPUT_DIR, 'you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks')); + } + return dir; +}; +const getEntryFileNames = (config, unsetOptions) => { + const configEntryFileNames = config.entryFileNames; + if (configEntryFileNames == null) { + unsetOptions.add('entryFileNames'); + } + return configEntryFileNames ?? '[name].js'; +}; +function getExports(config, unsetOptions) { + const configExports = config.exports; + if (configExports == null) { + unsetOptions.add('exports'); + } + else if (!['default', 'named', 'none', 'auto'].includes(configExports)) { + return error(logInvalidExportOptionValue(configExports)); + } + return configExports || 'auto'; +} +const getExternalImportAttributes = (config, inputOptions) => { + if (config.externalImportAssertions != undefined) { + warnDeprecation(`The "output.externalImportAssertions" option is deprecated. Use the "output.externalImportAttributes" option instead.`, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, true, inputOptions); + } + return config.externalImportAttributes ?? config.externalImportAssertions ?? true; +}; +const getGeneratedCode = (config) => { + const configWithPreset = getOptionWithPreset(config.generatedCode, generatedCodePresets, 'output.generatedCode', URL_OUTPUT_GENERATEDCODE, ''); + return { + arrowFunctions: configWithPreset.arrowFunctions === true, + constBindings: configWithPreset.constBindings === true, + objectShorthand: configWithPreset.objectShorthand === true, + reservedNamesAsProps: configWithPreset.reservedNamesAsProps !== false, + symbols: configWithPreset.symbols === true + }; +}; +const getIndent = (config, compact) => { + if (compact) { + return ''; + } + const configIndent = config.indent; + return configIndent === false ? '' : configIndent ?? true; +}; +const ALLOWED_INTEROP_TYPES = new Set([ + 'compat', + 'auto', + 'esModule', + 'default', + 'defaultOnly' +]); +const getInterop = (config) => { + const configInterop = config.interop; + if (typeof configInterop === 'function') { + const interopPerId = Object.create(null); + let defaultInterop = null; + return id => id === null + ? defaultInterop || validateInterop((defaultInterop = configInterop(id))) + : id in interopPerId + ? interopPerId[id] + : validateInterop((interopPerId[id] = configInterop(id))); + } + return configInterop === undefined ? () => 'default' : () => validateInterop(configInterop); +}; +const validateInterop = (interop) => { + if (!ALLOWED_INTEROP_TYPES.has(interop)) { + return error(logInvalidOption('output.interop', URL_OUTPUT_INTEROP, + // eslint-disable-next-line unicorn/prefer-spread + `use one of ${Array.from(ALLOWED_INTEROP_TYPES, value => JSON.stringify(value)).join(', ')}`, interop)); + } + return interop; +}; +const getManualChunks = (config, inlineDynamicImports, preserveModules) => { + const configManualChunks = config.manualChunks; + if (configManualChunks) { + if (inlineDynamicImports) { + return error(logInvalidOption('output.manualChunks', URL_OUTPUT_MANUALCHUNKS, 'this option is not supported for "output.inlineDynamicImports"')); + } + if (preserveModules) { + return error(logInvalidOption('output.manualChunks', URL_OUTPUT_MANUALCHUNKS, 'this option is not supported for "output.preserveModules"')); + } + } + return configManualChunks || {}; +}; +const getMinifyInternalExports = (config, format, compact) => config.minifyInternalExports ?? (compact || format === 'es' || format === 'system'); +const getSourcemapFileNames = (config, unsetOptions) => { + const configSourcemapFileNames = config.sourcemapFileNames; + if (configSourcemapFileNames == null) { + unsetOptions.add('sourcemapFileNames'); + } + return configSourcemapFileNames; +}; +const getSourcemapBaseUrl = (config) => { + const { sourcemapBaseUrl } = config; + if (sourcemapBaseUrl) { + if (isValidUrl(sourcemapBaseUrl)) { + return addTrailingSlashIfMissed(sourcemapBaseUrl); + } + return error(logInvalidOption('output.sourcemapBaseUrl', URL_OUTPUT_SOURCEMAPBASEURL, `must be a valid URL, received ${JSON.stringify(sourcemapBaseUrl)}`)); + } +}; + +function rollup(rawInputOptions) { + return rollupInternal(rawInputOptions, null); +} +async function rollupInternal(rawInputOptions, watcher) { + const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, watcher !== null); + initialiseTimers(inputOptions); + await initWasm(); + const graph = new Graph(inputOptions, watcher); + // remove the cache object from the memory after graph creation (cache is not used anymore) + const useCache = rawInputOptions.cache !== false; + if (rawInputOptions.cache) { + inputOptions.cache = undefined; + rawInputOptions.cache = undefined; + } + timeStart('BUILD', 1); + await catchUnfinishedHookActions(graph.pluginDriver, async () => { + try { + timeStart('initialize', 2); + await graph.pluginDriver.hookParallel('buildStart', [inputOptions]); + timeEnd('initialize', 2); + await graph.build(); + } + catch (error_) { + const watchFiles = Object.keys(graph.watchFiles); + if (watchFiles.length > 0) { + error_.watchFiles = watchFiles; + } + await graph.pluginDriver.hookParallel('buildEnd', [error_]); + await graph.pluginDriver.hookParallel('closeBundle', []); + throw error_; + } + await graph.pluginDriver.hookParallel('buildEnd', []); + }); + timeEnd('BUILD', 1); + const result = { + cache: useCache ? graph.getCache() : undefined, + async close() { + if (result.closed) + return; + result.closed = true; + await graph.pluginDriver.hookParallel('closeBundle', []); + }, + closed: false, + async generate(rawOutputOptions) { + if (result.closed) + return error(logAlreadyClosed()); + return handleGenerateWrite(false, inputOptions, unsetInputOptions, rawOutputOptions, graph); + }, + get watchFiles() { + return Object.keys(graph.watchFiles); + }, + async write(rawOutputOptions) { + if (result.closed) + return error(logAlreadyClosed()); + return handleGenerateWrite(true, inputOptions, unsetInputOptions, rawOutputOptions, graph); + } + }; + if (inputOptions.perf) + result.getTimings = getTimings; + return result; +} +async function getInputOptions(initialInputOptions, watchMode) { + if (!initialInputOptions) { + throw new Error('You must supply an options object to rollup'); + } + const processedInputOptions = await getProcessedInputOptions(initialInputOptions, watchMode); + const { options, unsetOptions } = await normalizeInputOptions(processedInputOptions, watchMode); + normalizePlugins(options.plugins, ANONYMOUS_PLUGIN_PREFIX); + return { options, unsetOptions }; +} +async function getProcessedInputOptions(inputOptions, watchMode) { + const plugins = getSortedValidatedPlugins('options', await normalizePluginOption(inputOptions.plugins)); + const logLevel = inputOptions.logLevel || LOGLEVEL_INFO; + const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), watchMode, logLevel); + for (const plugin of plugins) { + const { name, options } = plugin; + const handler = 'handler' in options ? options.handler : options; + const processedOptions = await handler.call({ + debug: getLogHandler(LOGLEVEL_DEBUG, 'PLUGIN_LOG', logger, name, logLevel), + error: (error_) => error(logPluginError(normalizeLog(error_), name, { hook: 'onLog' })), + info: getLogHandler(LOGLEVEL_INFO, 'PLUGIN_LOG', logger, name, logLevel), + meta: { rollupVersion: version, watchMode }, + warn: getLogHandler(LOGLEVEL_WARN, 'PLUGIN_WARNING', logger, name, logLevel) + }, inputOptions); + if (processedOptions) { + inputOptions = processedOptions; + } + } + return inputOptions; +} +function normalizePlugins(plugins, anonymousPrefix) { + for (const [index, plugin] of plugins.entries()) { + if (!plugin.name) { + plugin.name = `${anonymousPrefix}${index + 1}`; + } + } +} +async function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutputOptions, graph) { + const { options: outputOptions, outputPluginDriver, unsetOptions } = await getOutputOptionsAndPluginDriver(rawOutputOptions, graph.pluginDriver, inputOptions, unsetInputOptions); + return catchUnfinishedHookActions(outputPluginDriver, async () => { + const bundle = new Bundle(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph); + const generated = await bundle.generate(isWrite); + if (isWrite) { + timeStart('WRITE', 1); + if (!outputOptions.dir && !outputOptions.file) { + return error(logMissingFileOrDirOption()); + } + await Promise.all(Object.values(generated).map(chunk => graph.fileOperationQueue.run(() => writeOutputFile(chunk, outputOptions)))); + await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]); + timeEnd('WRITE', 1); + } + return createOutput(generated); + }); +} +async function getOutputOptionsAndPluginDriver(rawOutputOptions, inputPluginDriver, inputOptions, unsetInputOptions) { + if (!rawOutputOptions) { + throw new Error('You must supply an options object'); + } + const rawPlugins = await normalizePluginOption(rawOutputOptions.plugins); + normalizePlugins(rawPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX); + const outputPluginDriver = inputPluginDriver.createOutputPluginDriver(rawPlugins); + return { + ...(await getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver)), + outputPluginDriver + }; +} +function getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver) { + return normalizeOutputOptions(outputPluginDriver.hookReduceArg0Sync('outputOptions', [rawOutputOptions], (outputOptions, result) => result || outputOptions, pluginContext => { + const emitError = () => pluginContext.error(logCannotEmitFromOptionsHook()); + return { + ...pluginContext, + emitFile: emitError, + setAssetSource: emitError + }; + }), inputOptions, unsetInputOptions); +} +function createOutput(outputBundle) { + return { + output: Object.values(outputBundle).filter(outputFile => Object.keys(outputFile).length > 0).sort((outputFileA, outputFileB) => getSortingFileType(outputFileA) - getSortingFileType(outputFileB)) + }; +} +var SortingFileType; +(function (SortingFileType) { + SortingFileType[SortingFileType["ENTRY_CHUNK"] = 0] = "ENTRY_CHUNK"; + SortingFileType[SortingFileType["SECONDARY_CHUNK"] = 1] = "SECONDARY_CHUNK"; + SortingFileType[SortingFileType["ASSET"] = 2] = "ASSET"; +})(SortingFileType || (SortingFileType = {})); +function getSortingFileType(file) { + if (file.type === 'asset') { + return SortingFileType.ASSET; + } + if (file.isEntry) { + return SortingFileType.ENTRY_CHUNK; + } + return SortingFileType.SECONDARY_CHUNK; +} +async function writeOutputFile(outputFile, outputOptions) { + const fileName = resolve$1(outputOptions.dir || dirname(outputOptions.file), outputFile.fileName); + // 'recursive: true' does not throw if the folder structure, or parts of it, already exist + await mkdir(dirname(fileName), { recursive: true }); + return writeFile(fileName, outputFile.type === 'asset' ? outputFile.source : outputFile.code); +} +/** + * Auxiliary function for defining rollup configuration + * Mainly to facilitate IDE code prompts, after all, export default does not + * prompt, even if you add @type annotations, it is not accurate + * @param options + */ +function defineConfig(options) { + return options; +} + +const { + env = {}, + argv = [], + platform = "", +} = typeof process === "undefined" ? {} : process; + +const isDisabled = "NO_COLOR" in env || argv.includes("--no-color"); +const isForced = "FORCE_COLOR" in env || argv.includes("--color"); +const isWindows = platform === "win32"; +const isDumbTerminal = env.TERM === "dumb"; + +const isCompatibleTerminal = + tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal; + +const isCI = + "CI" in env && + ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env); + +const isColorSupported = + !isDisabled && + (isForced || (isWindows && !isDumbTerminal) || isCompatibleTerminal || isCI); + +const replaceClose = ( + index, + string, + close, + replace, + head = string.substring(0, index) + replace, + tail = string.substring(index + close.length), + next = tail.indexOf(close) +) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace)); + +const clearBleed = (index, string, open, close, replace) => + index < 0 + ? open + string + close + : open + replaceClose(index, string, close, replace) + close; + +const filterEmpty = + (open, close, replace = open, at = open.length + 1) => + (string) => + string || !(string === "" || string === undefined) + ? clearBleed( + ("" + string).indexOf(close, at), + string, + open, + close, + replace + ) + : ""; + +const init = (open, close, replace) => + filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace); + +const colors = { + reset: init(0, 0), + bold: init(1, 22, "\x1b[22m\x1b[1m"), + dim: init(2, 22, "\x1b[22m\x1b[2m"), + italic: init(3, 23), + underline: init(4, 24), + inverse: init(7, 27), + hidden: init(8, 28), + strikethrough: init(9, 29), + black: init(30, 39), + red: init(31, 39), + green: init(32, 39), + yellow: init(33, 39), + blue: init(34, 39), + magenta: init(35, 39), + cyan: init(36, 39), + white: init(37, 39), + gray: init(90, 39), + bgBlack: init(40, 49), + bgRed: init(41, 49), + bgGreen: init(42, 49), + bgYellow: init(43, 49), + bgBlue: init(44, 49), + bgMagenta: init(45, 49), + bgCyan: init(46, 49), + bgWhite: init(47, 49), + blackBright: init(90, 39), + redBright: init(91, 39), + greenBright: init(92, 39), + yellowBright: init(93, 39), + blueBright: init(94, 39), + magentaBright: init(95, 39), + cyanBright: init(96, 39), + whiteBright: init(97, 39), + bgBlackBright: init(100, 49), + bgRedBright: init(101, 49), + bgGreenBright: init(102, 49), + bgYellowBright: init(103, 49), + bgBlueBright: init(104, 49), + bgMagentaBright: init(105, 49), + bgCyanBright: init(106, 49), + bgWhiteBright: init(107, 49), +}; + +const createColors = ({ useColor = isColorSupported } = {}) => + useColor + ? colors + : Object.keys(colors).reduce( + (colors, key) => ({ ...colors, [key]: String }), + {} + ); + +createColors(); + +// @see https://no-color.org +// @see https://www.npmjs.com/package/chalk +const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ + useColor: env$1.FORCE_COLOR !== '0' && !env$1.NO_COLOR +}); + +// log to stderr to keep `rollup main.js > bundle.js` from breaking +const stderr = (...parameters) => process$1.stderr.write(`${parameters.join('')}\n`); +function handleError(error, recover = false) { + const name = error.name || error.cause?.name; + const nameSection = name ? `${name}: ` : ''; + const pluginSection = error.plugin ? `(plugin ${error.plugin}) ` : ''; + const message = `${pluginSection}${nameSection}${error.message}`; + const outputLines = [bold(red(`[!] ${bold(message.toString())}`))]; + if (error.url) { + outputLines.push(cyan(error.url)); + } + if (error.loc) { + outputLines.push(`${relativeId((error.loc.file || error.id))} (${error.loc.line}:${error.loc.column})`); + } + else if (error.id) { + outputLines.push(relativeId(error.id)); + } + if (error.frame) { + outputLines.push(dim(error.frame)); + } + if (error.stack) { + outputLines.push(dim(error.stack?.replace(`${nameSection}${error.message}\n`, ''))); + } + outputLines.push('', ''); + stderr(outputLines.join('\n')); + if (!recover) + process$1.exit(1); +} + +const commandAliases = { + c: 'config', + d: 'dir', + e: 'external', + f: 'format', + g: 'globals', + h: 'help', + i: 'input', + m: 'sourcemap', + n: 'name', + o: 'file', + p: 'plugin', + v: 'version', + w: 'watch' +}; +const EMPTY_COMMAND_OPTIONS = { external: [], globals: undefined }; +async function mergeOptions(config, watchMode, rawCommandOptions = EMPTY_COMMAND_OPTIONS, printLog) { + const command = getCommandOptions(rawCommandOptions); + const plugins = await normalizePluginOption(config.plugins); + const logLevel = config.logLevel || LOGLEVEL_INFO; + const onLog = getOnLog(config, logLevel, printLog); + const log = getLogger(plugins, onLog, watchMode, logLevel); + const inputOptions = mergeInputOptions(config, command, plugins, log, onLog); + if (command.output) { + Object.assign(command, command.output); + } + const outputOptionsArray = ensureArray(config.output); + if (outputOptionsArray.length === 0) + outputOptionsArray.push({}); + const outputOptions = await Promise.all(outputOptionsArray.map(singleOutputOptions => mergeOutputOptions(singleOutputOptions, command, log))); + warnUnknownOptions(command, [ + ...Object.keys(inputOptions), + ...Object.keys(outputOptions[0]).filter(option => option !== 'sourcemapIgnoreList' && option !== 'sourcemapPathTransform'), + ...Object.keys(commandAliases), + 'bundleConfigAsCjs', + 'config', + 'configPlugin', + 'environment', + 'failAfterWarnings', + 'filterLogs', + 'forceExit', + 'plugin', + 'silent', + 'stdin', + 'waitForBundleInput' + ], 'CLI flags', log, /^_$|output$|config/); + inputOptions.output = outputOptions; + return inputOptions; +} +function getCommandOptions(rawCommandOptions) { + const external = rawCommandOptions.external && typeof rawCommandOptions.external === 'string' + ? rawCommandOptions.external.split(',') + : []; + return { + ...rawCommandOptions, + external, + globals: typeof rawCommandOptions.globals === 'string' + ? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => { + const [id, variableName] = globalDefinition.split(':'); + globals[id] = variableName; + if (!external.includes(id)) { + external.push(id); + } + return globals; + }, Object.create(null)) + : undefined + }; +} +function mergeInputOptions(config, overrides, plugins, log, onLog) { + const getOption = (name) => overrides[name] ?? config[name]; + const inputOptions = { + cache: config.cache, + context: getOption('context'), + experimentalCacheExpiry: getOption('experimentalCacheExpiry'), + experimentalLogSideEffects: getOption('experimentalLogSideEffects'), + external: getExternal(config, overrides), + input: getOption('input') || [], + logLevel: getOption('logLevel'), + makeAbsoluteExternalsRelative: getOption('makeAbsoluteExternalsRelative'), + maxParallelFileOps: getOption('maxParallelFileOps'), + moduleContext: getOption('moduleContext'), + onLog, + onwarn: undefined, + perf: getOption('perf'), + plugins, + preserveEntrySignatures: getOption('preserveEntrySignatures'), + preserveSymlinks: getOption('preserveSymlinks'), + shimMissingExports: getOption('shimMissingExports'), + strictDeprecations: getOption('strictDeprecations'), + treeshake: getObjectOption(config, overrides, 'treeshake', objectifyOptionWithPresets(treeshakePresets, 'treeshake', URL_TREESHAKE, 'false, true, ')), + watch: getWatch(config, overrides) + }; + warnUnknownOptions(config, Object.keys(inputOptions), 'input options', log, /^output$/); + return inputOptions; +} +const getExternal = (config, overrides) => { + const configExternal = config.external; + return typeof configExternal === 'function' + ? (source, importer, isResolved) => configExternal(source, importer, isResolved) || overrides.external.includes(source) + : [...ensureArray(configExternal), ...overrides.external]; +}; +const getObjectOption = (config, overrides, name, objectifyValue = objectifyOption) => { + const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue); + const configOption = normalizeObjectOptionValue(config[name], objectifyValue); + if (commandOption !== undefined) { + return commandOption && { ...configOption, ...commandOption }; + } + return configOption; +}; +const getWatch = (config, overrides) => config.watch !== false && getObjectOption(config, overrides, 'watch'); +const normalizeObjectOptionValue = (optionValue, objectifyValue) => { + if (!optionValue) { + return optionValue; + } + if (Array.isArray(optionValue)) { + return optionValue.reduce((result, value) => value && result && { ...result, ...objectifyValue(value) }, {}); + } + return objectifyValue(optionValue); +}; +async function mergeOutputOptions(config, overrides, log) { + const getOption = (name) => overrides[name] ?? config[name]; + const outputOptions = { + amd: getObjectOption(config, overrides, 'amd'), + assetFileNames: getOption('assetFileNames'), + banner: getOption('banner'), + chunkFileNames: getOption('chunkFileNames'), + compact: getOption('compact'), + dir: getOption('dir'), + dynamicImportInCjs: getOption('dynamicImportInCjs'), + entryFileNames: getOption('entryFileNames'), + esModule: getOption('esModule'), + experimentalMinChunkSize: getOption('experimentalMinChunkSize'), + exports: getOption('exports'), + extend: getOption('extend'), + externalImportAssertions: getOption('externalImportAssertions'), + externalImportAttributes: getOption('externalImportAttributes'), + externalLiveBindings: getOption('externalLiveBindings'), + file: getOption('file'), + footer: getOption('footer'), + format: getOption('format'), + freeze: getOption('freeze'), + generatedCode: getObjectOption(config, overrides, 'generatedCode', objectifyOptionWithPresets(generatedCodePresets, 'output.generatedCode', URL_OUTPUT_GENERATEDCODE, '')), + globals: getOption('globals'), + hashCharacters: getOption('hashCharacters'), + hoistTransitiveImports: getOption('hoistTransitiveImports'), + indent: getOption('indent'), + inlineDynamicImports: getOption('inlineDynamicImports'), + interop: getOption('interop'), + intro: getOption('intro'), + manualChunks: getOption('manualChunks'), + minifyInternalExports: getOption('minifyInternalExports'), + name: getOption('name'), + noConflict: getOption('noConflict'), + outro: getOption('outro'), + paths: getOption('paths'), + plugins: await normalizePluginOption(config.plugins), + preserveModules: getOption('preserveModules'), + preserveModulesRoot: getOption('preserveModulesRoot'), + sanitizeFileName: getOption('sanitizeFileName'), + sourcemap: getOption('sourcemap'), + sourcemapBaseUrl: getOption('sourcemapBaseUrl'), + sourcemapExcludeSources: getOption('sourcemapExcludeSources'), + sourcemapFile: getOption('sourcemapFile'), + sourcemapFileNames: getOption('sourcemapFileNames'), + sourcemapIgnoreList: getOption('sourcemapIgnoreList'), + sourcemapPathTransform: getOption('sourcemapPathTransform'), + strict: getOption('strict'), + systemNullSetters: getOption('systemNullSetters'), + validate: getOption('validate') + }; + warnUnknownOptions(config, Object.keys(outputOptions), 'output options', log); + return outputOptions; +} + +class WatchEmitter { + constructor() { + this.currentHandlers = Object.create(null); + this.persistentHandlers = Object.create(null); + } + // Will be overwritten by Rollup + async close() { } + emit(event, ...parameters) { + return Promise.all([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters))); + } + off(event, listener) { + const listeners = this.persistentHandlers[event]; + if (listeners) { + // A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1 + // (which would remove the last array element if used unchanged) is turned + // into max_int, which is outside the array and does not change anything. + listeners.splice(listeners.indexOf(listener) >>> 0, 1); + } + return this; + } + on(event, listener) { + this.getPersistentHandlers(event).push(listener); + return this; + } + onCurrentRun(event, listener) { + this.getCurrentHandlers(event).push(listener); + return this; + } + once(event, listener) { + const selfRemovingListener = (...parameters) => { + this.off(event, selfRemovingListener); + return listener(...parameters); + }; + this.on(event, selfRemovingListener); + return this; + } + removeAllListeners() { + this.removeListenersForCurrentRun(); + this.persistentHandlers = Object.create(null); + return this; + } + removeListenersForCurrentRun() { + this.currentHandlers = Object.create(null); + return this; + } + getCurrentHandlers(event) { + return this.currentHandlers[event] || (this.currentHandlers[event] = []); + } + getPersistentHandlers(event) { + return this.persistentHandlers[event] || (this.persistentHandlers[event] = []); + } +} + +let fsEvents; +let fsEventsImportError; +async function loadFsEvents() { + try { + ({ default: fsEvents } = await import('fsevents')); + } + catch (error) { + fsEventsImportError = error; + } +} +// A call to this function will be injected into the chokidar code +function getFsEvents() { + if (fsEventsImportError) + throw fsEventsImportError; + return fsEvents; +} + +const fseventsImporter = /*#__PURE__*/Object.defineProperty({ + __proto__: null, + getFsEvents, + loadFsEvents +}, Symbol.toStringTag, { value: 'Module' }); + +function watch(configs) { + const emitter = new WatchEmitter(); + watchInternal(configs, emitter).catch(error => { + handleError(error); + }); + return emitter; +} +async function watchInternal(configs, emitter) { + const optionsList = await Promise.all(ensureArray(configs).map(config => mergeOptions(config, true))); + const watchOptionsList = optionsList.filter(config => config.watch !== false); + if (watchOptionsList.length === 0) { + return error(logInvalidOption('watch', URL_WATCH, 'there must be at least one config where "watch" is not set to "false"')); + } + await loadFsEvents(); + const { Watcher } = await import('./watch.js'); + new Watcher(watchOptionsList, emitter); +} + +export { createFilter, defineConfig, fseventsImporter, getAugmentedNamespace, picomatch, rollup, rollupInternal, version, watch }; diff --git a/.pnpm-store/v3/files/6e/720e9a7e80f9d5987bdbd7ef52599d5f6c87ae98335f97c46e333bf4b4a39f5819e69941ac4612791fcb84c1183b1861ad639668c3d819c07b2c54c5f9d44d b/.pnpm-store/v3/files/6e/720e9a7e80f9d5987bdbd7ef52599d5f6c87ae98335f97c46e333bf4b4a39f5819e69941ac4612791fcb84c1183b1861ad639668c3d819c07b2c54c5f9d44d new file mode 100644 index 00000000..5fcf6c91 --- /dev/null +++ b/.pnpm-store/v3/files/6e/720e9a7e80f9d5987bdbd7ef52599d5f6c87ae98335f97c46e333bf4b4a39f5819e69941ac4612791fcb84c1183b1861ad639668c3d819c07b2c54c5f9d44d @@ -0,0 +1,32 @@ +'use strict'; + +// TODO, semver-major: delete this + +var $TypeError = require('es-errors/type'); +var $SyntaxError = require('es-errors/syntax'); + +var isMatchRecord = require('./records/match-record'); +var isPropertyDescriptor = require('./records/property-descriptor'); +var isIteratorRecord = require('./records/iterator-record'); +var isPromiseCapabilityRecord = require('./records/promise-capability-record'); +var isAsyncGeneratorRequestRecord = require('./records/async-generator-request-record'); +var isRegExpRecord = require('./records/regexp-record'); + +var predicates = { + 'Property Descriptor': isPropertyDescriptor, + 'Match Record': isMatchRecord, + 'Iterator Record': isIteratorRecord, + 'PromiseCapability Record': isPromiseCapabilityRecord, + 'AsyncGeneratorRequest Record': isAsyncGeneratorRequestRecord, + 'RegExp Record': isRegExpRecord +}; + +module.exports = function assertRecord(recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; diff --git a/.pnpm-store/v3/files/6e/7f8aa176de976b78b263565f256c30c6e2d5f1d0f6c2b57692eaba18fdb1d840187c78c4c74b7a6229f04c6ffab669ce7fe5456f57d819efcfd0847b88011f b/.pnpm-store/v3/files/6e/7f8aa176de976b78b263565f256c30c6e2d5f1d0f6c2b57692eaba18fdb1d840187c78c4c74b7a6229f04c6ffab669ce7fe5456f57d819efcfd0847b88011f new file mode 100644 index 00000000..0a45622e --- /dev/null +++ b/.pnpm-store/v3/files/6e/7f8aa176de976b78b263565f256c30c6e2d5f1d0f6c2b57692eaba18fdb1d840187c78c4c74b7a6229f04c6ffab669ce7fe5456f57d819efcfd0847b88011f @@ -0,0 +1,17 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var callBound = require('call-bind/callBound'); + +var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true); + +var isTypedArray = require('is-typed-array'); + +// node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter +module.exports = $typedArrayBuffer || function typedArrayBuffer(x) { + if (!isTypedArray(x)) { + throw new $TypeError('Not a Typed Array'); + } + return x.buffer; +}; diff --git a/.pnpm-store/v3/files/6e/b7ee17c3345b171a32225bbed204416bc3c7141c9ec306de0f54d734c6688ebfbb96de017b98427ed25971bc6c629f0d227375efce9f1c98ad21fc033f84c6 b/.pnpm-store/v3/files/6e/b7ee17c3345b171a32225bbed204416bc3c7141c9ec306de0f54d734c6688ebfbb96de017b98427ed25971bc6c629f0d227375efce9f1c98ad21fc033f84c6 new file mode 100644 index 00000000..ad471c5b --- /dev/null +++ b/.pnpm-store/v3/files/6e/b7ee17c3345b171a32225bbed204416bc3c7141c9ec306de0f54d734c6688ebfbb96de017b98427ed25971bc6c629f0d227375efce9f1c98ad21fc033f84c6 @@ -0,0 +1,3 @@ +import type { NullableResult, ServiceContext } from '../types'; +import type * as vscode from 'vscode-languageserver-protocol'; +export declare function register(context: ServiceContext): (uri: string, token?: vscode.CancellationToken) => NullableResult; diff --git a/.pnpm-store/v3/files/6e/db0199442c6c15ece0420dbf7d3a7446bf2b7daa2196897914e64030173721aec9652bf7ba8a87bcad3a225fe24a1e708c805b554f1c68889696d5a1f119c7 b/.pnpm-store/v3/files/6e/db0199442c6c15ece0420dbf7d3a7446bf2b7daa2196897914e64030173721aec9652bf7ba8a87bcad3a225fe24a1e708c805b554f1c68889696d5a1f119c7 new file mode 100644 index 00000000..aaca7aa1 --- /dev/null +++ b/.pnpm-store/v3/files/6e/db0199442c6c15ece0420dbf7d3a7446bf2b7daa2196897914e64030173721aec9652bf7ba8a87bcad3a225fe24a1e708c805b554f1c68889696d5a1f119c7 @@ -0,0 +1,69 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.warnAboutTSVersion = void 0; +const semver_1 = __importDefault(require("semver")); +const ts = __importStar(require("typescript")); +/** + * This needs to be kept in sync with package.json in the typescript-eslint monorepo + */ +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.7.4 <5.4.0'; +/* + * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one + * List them all separately here, so we can automatically create the full string + */ +const SUPPORTED_PRERELEASE_RANGES = []; +const ACTIVE_TYPESCRIPT_VERSION = ts.version; +const isRunningSupportedTypeScriptVersion = semver_1.default.satisfies(ACTIVE_TYPESCRIPT_VERSION, [SUPPORTED_TYPESCRIPT_VERSIONS] + .concat(SUPPORTED_PRERELEASE_RANGES) + .join(' || ')); +let warnedAboutTSVersion = false; +function warnAboutTSVersion(parseSettings, passedLoggerFn) { + if (isRunningSupportedTypeScriptVersion || warnedAboutTSVersion) { + return; + } + if (passedLoggerFn || + // See https://github.com/typescript-eslint/typescript-eslint/issues/7896 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + (typeof process === 'undefined' ? false : process.stdout?.isTTY)) { + const border = '============='; + const versionWarning = [ + border, + 'WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.', + 'You may find that it works just fine, or you may not.', + `SUPPORTED TYPESCRIPT VERSIONS: ${SUPPORTED_TYPESCRIPT_VERSIONS}`, + `YOUR TYPESCRIPT VERSION: ${ACTIVE_TYPESCRIPT_VERSION}`, + 'Please only submit bug reports when using the officially supported version.', + border, + ].join('\n\n'); + parseSettings.log(versionWarning); + } + warnedAboutTSVersion = true; +} +exports.warnAboutTSVersion = warnAboutTSVersion; +//# sourceMappingURL=warnAboutTSVersion.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6f/0b2b94295ddffcaafa470f9a7d2f1a187c3ec4e63ef6f5a84d7fc9a35ea3a0474c7a8e99427b3187abb055219a3f6ab153f81725fbe12cb525e6338566f5a0 b/.pnpm-store/v3/files/6f/0b2b94295ddffcaafa470f9a7d2f1a187c3ec4e63ef6f5a84d7fc9a35ea3a0474c7a8e99427b3187abb055219a3f6ab153f81725fbe12cb525e6338566f5a0 new file mode 100644 index 00000000..e9644b42 --- /dev/null +++ b/.pnpm-store/v3/files/6f/0b2b94295ddffcaafa470f9a7d2f1a187c3ec4e63ef6f5a84d7fc9a35ea3a0474c7a8e99427b3187abb055219a3f6ab153f81725fbe12cb525e6338566f5a0 @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LinkedCodeMap = void 0; +const source_map_1 = require("@volar/source-map"); +class LinkedCodeMap extends source_map_1.SourceMap { + *getLinkedOffsets(start) { + for (const mapped of this.getGeneratedOffsets(start)) { + yield mapped[0]; + } + for (const mapped of this.getSourceOffsets(start)) { + yield mapped[0]; + } + } +} +exports.LinkedCodeMap = LinkedCodeMap; +//# sourceMappingURL=linkedCodeMap.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6f/1b6252844f2eaaae20c83760c4f266cd4b94112372c1ea267fc1f324ee92a7040dd38c29d922d17c2e0c8a2b1786e33a0d58ae23aeaf10d1d0a3969426ce41 b/.pnpm-store/v3/files/6f/1b6252844f2eaaae20c83760c4f266cd4b94112372c1ea267fc1f324ee92a7040dd38c29d922d17c2e0c8a2b1786e33a0d58ae23aeaf10d1d0a3969426ce41 new file mode 100644 index 00000000..7678f4fa --- /dev/null +++ b/.pnpm-store/v3/files/6f/1b6252844f2eaaae20c83760c4f266cd4b94112372c1ea267fc1f324ee92a7040dd38c29d922d17c2e0c8a2b1786e33a0d58ae23aeaf10d1d0a3969426ce41 @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.register = void 0; +const featureWorkers_1 = require("../utils/featureWorkers"); +const cancellation_1 = require("../utils/cancellation"); +const language_core_1 = require("@volar/language-core"); +function register(context) { + return (uri, position, signatureHelpContext = { + triggerKind: 1, + isRetrigger: false, + }, token = cancellation_1.NoneCancellationToken) => { + return (0, featureWorkers_1.languageFeatureWorker)(context, uri, () => position, map => map.getGeneratedPositions(position, language_core_1.isSignatureHelpEnabled), (service, document, position) => { + if (token.isCancellationRequested) { + return; + } + if (signatureHelpContext?.triggerKind === 2 + && signatureHelpContext.triggerCharacter + && !(signatureHelpContext.isRetrigger + ? service[0].signatureHelpRetriggerCharacters + : service[0].signatureHelpTriggerCharacters)?.includes(signatureHelpContext.triggerCharacter)) { + return; + } + return service[1].provideSignatureHelp?.(document, position, signatureHelpContext, token); + }, data => data); + }; +} +exports.register = register; +//# sourceMappingURL=provideSignatureHelp.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6f/306ae7c4bec7eba8d158eeac54f4524b692873999afe3fc5e3e2380d676c1f6932aa462bbad43cd81ffb5602fbb984fb41f385332a354b82aaf2a18fa16707-index.json b/.pnpm-store/v3/files/6f/306ae7c4bec7eba8d158eeac54f4524b692873999afe3fc5e3e2380d676c1f6932aa462bbad43cd81ffb5602fbb984fb41f385332a354b82aaf2a18fa16707-index.json new file mode 100644 index 00000000..d4f39029 --- /dev/null +++ b/.pnpm-store/v3/files/6f/306ae7c4bec7eba8d158eeac54f4524b692873999afe3fc5e3e2380d676c1f6932aa462bbad43cd81ffb5602fbb984fb41f385332a354b82aaf2a18fa16707-index.json @@ -0,0 +1 @@ +{"files":{".eslintrc":{"checkedAt":1707939899765,"integrity":"sha512-uo8n41+FPnQWGmQgLm/iCSeZ056ofjg+NfJyxhRiZZleVQAUKeJWFKddfVRJzVfqthH4YgHMmqFG9RBNOTQwFg==","mode":420,"size":811},".nycrc":{"checkedAt":1707939899765,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1707939899765,"integrity":"sha512-YD/mx3rViEeU8K3dGxbnUG/FEexfAHNZySxWlXZd5fxB7gC1XFjt5VHPEDKxRey+bRbtajLYsWea3+YtaaviVg==","mode":420,"size":1073},"aos/AddValueToKeyedGroup.js":{"checkedAt":1707939899765,"integrity":"sha512-70zcbi4FY0O8A5Sr3YLXjntPQg7a5mlPZhmGbiRrKHZrU1sCekAOw6jTdm0OrUNiYlSHvN80ij5rDjYB0PGQ0w==","mode":420,"size":850},"auto.js":{"checkedAt":1707939899765,"integrity":"sha512-8Q3Im5cACiIFrMmxvLnJnA8SXOjAd1kh/R0UIDVnErDD1WUlJIDrNfaOcIB6rtjAXNhq/OdL1374JM/QcAJ1VQ==","mode":420,"size":36},"aos/GroupBy.js":{"checkedAt":1707939899765,"integrity":"sha512-QlTPMdWr0XlZqhM7YO2eXOrz9HcNkEtCLxsyTFFwoWrFL+kR8nywaQyyZXrsvDw06xFJWDAGsO0nw5V/yfB92g==","mode":420,"size":2359},"implementation.js":{"checkedAt":1707939899766,"integrity":"sha512-+psvmL+b4d+7WSyR4aDxGpIOx7NOpA6YlEzrvsI436dy0q3RHC8HVpYT28u4thuulaC+Va29v428yfn6GyKMSQ==","mode":420,"size":660},"test/implementation.js":{"checkedAt":1707939899766,"integrity":"sha512-W+7Bh9KkqO/vkD5CIdD8a/ZBgezFC44aa/Y0FD+M9oczXWpBKZNPpKmH6eXi+cDYfkyBBUAheobiGln7fxD6Xw==","mode":420,"size":268},"index.js":{"checkedAt":1707939899766,"integrity":"sha512-7lXG8wpZS/jzpxJIB0HlSIE+QZ8J20yDHTdOvFgwsF9GQZ3Q0/eVrysd0lA+KbWPD07kCsoMM0SR7YDQ6uX1cg==","mode":420,"size":406},"test/index.js":{"checkedAt":1707939899766,"integrity":"sha512-4FkKKy9aVh5fJ0MEFeAgUU09segzrHxiPbsPYYnE4OErv5JZDJaNdGOWF8/rD1gsvqyTqd2cGNEBws/hgalzeg==","mode":420,"size":181},"polyfill.js":{"checkedAt":1707939899766,"integrity":"sha512-xG7iIc9SDXoMJ97Oh7kj1nEnm+bzyn6VEXLlajoZFFLfj7BpHLG1GhGDv/BzyTHUXWsXrVKvk3KDF8LEbazEfQ==","mode":420,"size":153},"shim.js":{"checkedAt":1707939899766,"integrity":"sha512-7iVzOWKMsddj9nMiw9GuIExDAJy+pJNxQGSBELf4oXbD/fP++AB6vHIf5PpmACqPwGYRsJPY9n9X2PasaGVuqA==","mode":420,"size":305},"test/shimmed.js":{"checkedAt":1707939899767,"integrity":"sha512-4Y5HzX6iqoZtMfY2CfMWaQUqoqLgge/Qo+AZKftPCyfQ0gHebPIouppZF8dZd7FqvOuUAI4CaqcPjOzxnnzvgw==","mode":420,"size":880},"test/tests.js":{"checkedAt":1707939899767,"integrity":"sha512-ClcPVB5y4ar2hMqYsPUxS+6qcdWoexVzkHozKunqEPgXMHFrH4u32J5x8SBaFB6gZjVyT9hArxr1oLUFWX6kVw==","mode":420,"size":1451},"package.json":{"checkedAt":1707939899767,"integrity":"sha512-UcET+rexkCeaMpYXMr7BcrpreDvyo5tYJVK07k9TK4eRVKMd4A1LnAHk2A3/ROch17NicD5V5/LGdkPHwOHMDQ==","mode":420,"size":2309},"CHANGELOG.md":{"checkedAt":1707939899767,"integrity":"sha512-0+Bm59CVYbcUq6hVZ+5bXmLyM0hYuOWJRbB83qgBUQwCC/YKUZ2VHP4J8URONh15Lv0qMEF4oSVF+t/yYYFaUQ==","mode":420,"size":2337},"README.md":{"checkedAt":1707939899767,"integrity":"sha512-0UUZC5JXXkaBadAQh0pQyNGzA9k7TOllACV+MQlIXRruJQavFf4A/MeuSPgjG5La82M+FnKoBtkVc5/n5xPL1A==","mode":420,"size":2765},".github/FUNDING.yml":{"checkedAt":1707939899768,"integrity":"sha512-PtzJNjdu4RJ+6qrtNZYNGvMzn9gvUV7aaY9u0tNlb4MmMw33uFjcXtRVKlGwf6Ntirw4gHooeb00cnTyNbm9ww==","mode":420,"size":585}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6f/650f25f01f47810d7efbbcb47165668b6d2349f2957b54640f9fc0b895f0becb31ac14a5444f3f3401e5a9ff95c9ff6c7211229621e3767cdc9d13cf0f7393 b/.pnpm-store/v3/files/6f/650f25f01f47810d7efbbcb47165668b6d2349f2957b54640f9fc0b895f0becb31ac14a5444f3f3401e5a9ff95c9ff6c7211229621e3767cdc9d13cf0f7393 new file mode 100644 index 00000000..a06b8b56 --- /dev/null +++ b/.pnpm-store/v3/files/6f/650f25f01f47810d7efbbcb47165668b6d2349f2957b54640f9fc0b895f0becb31ac14a5444f3f3401e5a9ff95c9ff6c7211229621e3767cdc9d13cf0f7393 @@ -0,0 +1 @@ +{"version":3,"file":"padding-line-between-statements.js","sourceRoot":"","sources":["../../src/rules/padding-line-between-statements.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/6f/c1078215dff94fdbc3bdb6d8055734e4f26342657de277023735bea6d2b91c1d3c45b6f1d0e4b528848a4f1eea5b42dfed2bde9a77e80622faa1a4b1ca0b13 b/.pnpm-store/v3/files/6f/c1078215dff94fdbc3bdb6d8055734e4f26342657de277023735bea6d2b91c1d3c45b6f1d0e4b528848a4f1eea5b42dfed2bde9a77e80622faa1a4b1ca0b13 new file mode 100644 index 00000000..8cca37ab --- /dev/null +++ b/.pnpm-store/v3/files/6f/c1078215dff94fdbc3bdb6d8055734e4f26342657de277023735bea6d2b91c1d3c45b6f1d0e4b528848a4f1eea5b42dfed2bde9a77e80622faa1a4b1ca0b13 @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.replaceAll = exports.replace = void 0; +function replace(segments, pattern, ...replacers) { + const str = toString(segments); + const match = str.match(pattern); + if (match && match.index !== undefined) { + const start = match.index; + const end = start + match[0].length; + offsetStack(); + overwrite(segments, [start, end], ...replacers.map(replacer => typeof replacer === 'function' ? replacer(match[0]) : replacer)); + resetOffsetStack(); + } +} +exports.replace = replace; +function replaceAll(segments, pattern, ...replacers) { + const str = toString(segments); + const allMatch = str.matchAll(pattern); + let length = str.length; + let lengthDiff = 0; + for (const match of allMatch) { + if (match.index !== undefined) { + const start = match.index + lengthDiff; + const end = start + match[0].length; + offsetStack(); + overwrite(segments, [start, end], ...replacers.map(replacer => typeof replacer === 'function' ? replacer(match[0]) : replacer)); + resetOffsetStack(); + const newLength = getLength(segments); + lengthDiff += newLength - length; + length = newLength; + } + } +} +exports.replaceAll = replaceAll; +//# sourceMappingURL=replace.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/6f/d9ee31171d26e31661e15d8008851e2201f2e1396b2acf494763538b4e5b2f3e8c1158132bf9a1fda976378b279296741f3c8e184909c661c19b6cda271a38 b/.pnpm-store/v3/files/6f/d9ee31171d26e31661e15d8008851e2201f2e1396b2acf494763538b4e5b2f3e8c1158132bf9a1fda976378b279296741f3c8e184909c661c19b6cda271a38 new file mode 100644 index 00000000..64c44ca5 --- /dev/null +++ b/.pnpm-store/v3/files/6f/d9ee31171d26e31661e15d8008851e2201f2e1396b2acf494763538b4e5b2f3e8c1158132bf9a1fda976378b279296741f3c8e184909c661c19b6cda271a38 @@ -0,0 +1,263 @@ +export { parseAst, parseAstAsync } from 'rollup/parseAst'; +import { i as isInNodeModules, b as arraify } from './chunks/dep-Glf1enhJ.js'; +export { f as build, j as buildErrorMessage, u as createFilter, a as createLogger, e as createServer, d as defineConfig, k as fetchModule, g as formatPostcssSourceMap, y as isFileServingAllowed, l as loadConfigFromFile, z as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, A as resolveEnvPrefix, v as rollupVersion, x as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-Glf1enhJ.js'; +export { VERSION as version } from './constants.js'; +export { version as esbuildVersion } from 'esbuild'; +import { existsSync, readFileSync } from 'node:fs'; +import { ViteRuntime, ESModulesRunner } from './runtime.js'; +import 'node:fs/promises'; +import 'node:path'; +import 'node:url'; +import 'node:util'; +import 'node:perf_hooks'; +import 'node:module'; +import 'tty'; +import 'path'; +import 'fs'; +import 'events'; +import 'assert'; +import 'node:http'; +import 'node:https'; +import 'util'; +import 'net'; +import 'url'; +import 'http'; +import 'stream'; +import 'os'; +import 'child_process'; +import 'node:os'; +import 'node:child_process'; +import 'node:crypto'; +import 'node:dns'; +import 'crypto'; +import 'module'; +import 'node:assert'; +import 'node:v8'; +import 'node:worker_threads'; +import 'node:buffer'; +import 'node:events'; +import 'querystring'; +import 'node:readline'; +import 'zlib'; +import 'buffer'; +import 'https'; +import 'tls'; +import 'node:zlib'; + +// This file will be built for both ESM and CJS. Avoid relying on other modules as possible. +// copy from constants.ts +const CSS_LANGS_RE = +// eslint-disable-next-line regexp/no-unused-capturing-group +/\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/; +const isCSSRequest = (request) => CSS_LANGS_RE.test(request); +// Use splitVendorChunkPlugin() to get the same manualChunks strategy as Vite 2.7 +// We don't recommend using this strategy as a general solution moving forward +// splitVendorChunk is a simple index/vendor strategy that was used in Vite +// until v2.8. It is exposed to let people continue to use it in case it was +// working well for their setups. +// The cache needs to be reset on buildStart for watch mode to work correctly +// Don't use this manualChunks strategy for ssr, lib mode, and 'umd' or 'iife' +class SplitVendorChunkCache { + cache; + constructor() { + this.cache = new Map(); + } + reset() { + this.cache = new Map(); + } +} +function splitVendorChunk(options = {}) { + const cache = options.cache ?? new SplitVendorChunkCache(); + return (id, { getModuleInfo }) => { + if (isInNodeModules(id) && + !isCSSRequest(id) && + staticImportedByEntry(id, getModuleInfo, cache.cache)) { + return 'vendor'; + } + }; +} +function staticImportedByEntry(id, getModuleInfo, cache, importStack = []) { + if (cache.has(id)) { + return cache.get(id); + } + if (importStack.includes(id)) { + // circular deps! + cache.set(id, false); + return false; + } + const mod = getModuleInfo(id); + if (!mod) { + cache.set(id, false); + return false; + } + if (mod.isEntry) { + cache.set(id, true); + return true; + } + const someImporterIs = mod.importers.some((importer) => staticImportedByEntry(importer, getModuleInfo, cache, importStack.concat(id))); + cache.set(id, someImporterIs); + return someImporterIs; +} +function splitVendorChunkPlugin() { + const caches = []; + function createSplitVendorChunk(output, config) { + const cache = new SplitVendorChunkCache(); + caches.push(cache); + const build = config.build ?? {}; + const format = output?.format; + if (!build.ssr && !build.lib && format !== 'umd' && format !== 'iife') { + return splitVendorChunk({ cache }); + } + } + return { + name: 'vite:split-vendor-chunk', + config(config) { + let outputs = config?.build?.rollupOptions?.output; + if (outputs) { + outputs = arraify(outputs); + for (const output of outputs) { + const viteManualChunks = createSplitVendorChunk(output, config); + if (viteManualChunks) { + if (output.manualChunks) { + if (typeof output.manualChunks === 'function') { + const userManualChunks = output.manualChunks; + output.manualChunks = (id, api) => { + return userManualChunks(id, api) ?? viteManualChunks(id, api); + }; + } + else { + // else, leave the object form of manualChunks untouched, as + // we can't safely replicate rollup handling. + // eslint-disable-next-line no-console + console.warn("(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.output.manualChunks`. Consider using the function form instead."); + } + } + else { + output.manualChunks = viteManualChunks; + } + } + } + } + else { + return { + build: { + rollupOptions: { + output: { + manualChunks: createSplitVendorChunk({}, config), + }, + }, + }, + }; + } + }, + buildStart() { + caches.forEach((cache) => cache.reset()); + }, + }; +} + +class ServerHMRBroadcasterClient { + hmrChannel; + constructor(hmrChannel) { + this.hmrChannel = hmrChannel; + } + send(...args) { + let payload; + if (typeof args[0] === 'string') { + payload = { + type: 'custom', + event: args[0], + data: args[1], + }; + } + else { + payload = args[0]; + } + if (payload.type !== 'custom') { + throw new Error('Cannot send non-custom events from the client to the server.'); + } + this.hmrChannel.send(payload); + } +} +/** + * The connector class to establish HMR communication between the server and the Vite runtime. + * @experimental + */ +class ServerHMRConnector { + handlers = []; + hmrChannel; + hmrClient; + connected = false; + constructor(server) { + const hmrChannel = server.hot?.channels.find((c) => c.name === 'ssr'); + if (!hmrChannel) { + throw new Error("Your version of Vite doesn't support HMR during SSR. Please, use Vite 5.1 or higher."); + } + this.hmrClient = new ServerHMRBroadcasterClient(hmrChannel); + hmrChannel.api.outsideEmitter.on('send', (payload) => { + this.handlers.forEach((listener) => listener(payload)); + }); + this.hmrChannel = hmrChannel; + } + isReady() { + return this.connected; + } + send(message) { + const payload = JSON.parse(message); + this.hmrChannel.api.innerEmitter.emit(payload.event, payload.data, this.hmrClient); + } + onUpdate(handler) { + this.handlers.push(handler); + handler({ type: 'connected' }); + this.connected = true; + } +} + +function createHMROptions(server, options) { + if (server.config.server.hmr === false || options.hmr === false) { + return false; + } + const connection = new ServerHMRConnector(server); + return { + connection, + logger: options.hmr?.logger, + }; +} +const prepareStackTrace = { + retrieveFile(id) { + if (existsSync(id)) { + return readFileSync(id, 'utf-8'); + } + }, +}; +function resolveSourceMapOptions(options) { + if (options.sourcemapInterceptor != null) { + if (options.sourcemapInterceptor === 'prepareStackTrace') { + return prepareStackTrace; + } + if (typeof options.sourcemapInterceptor === 'object') { + return { ...prepareStackTrace, ...options.sourcemapInterceptor }; + } + return options.sourcemapInterceptor; + } + if (typeof process !== 'undefined' && 'setSourceMapsEnabled' in process) { + return 'node'; + } + return prepareStackTrace; +} +/** + * Create an instance of the Vite SSR runtime that support HMR. + * @experimental + */ +async function createViteRuntime(server, options = {}) { + const hmr = createHMROptions(server, options); + return new ViteRuntime({ + ...options, + root: server.config.root, + fetchModule: server.ssrFetchModule, + hmr, + sourcemapInterceptor: resolveSourceMapOptions(options), + }, options.runner || new ESModulesRunner()); +} + +export { ServerHMRConnector, createViteRuntime, isCSSRequest, splitVendorChunk, splitVendorChunkPlugin }; diff --git a/.pnpm-store/v3/files/6f/ef994b042e9ce331a792a0eb3ccb589cc22b520acc116e2461419b2db424c5586cd975d1e1bc89e8aa2a789d237b3c19d19b0bf927236b25213b0e6715ba7e b/.pnpm-store/v3/files/6f/ef994b042e9ce331a792a0eb3ccb589cc22b520acc116e2461419b2db424c5586cd975d1e1bc89e8aa2a789d237b3c19d19b0bf927236b25213b0e6715ba7e new file mode 100644 index 00000000..940769b1 --- /dev/null +++ b/.pnpm-store/v3/files/6f/ef994b042e9ce331a792a0eb3ccb589cc22b520acc116e2461419b2db424c5586cd975d1e1bc89e8aa2a789d237b3c19d19b0bf927236b25213b0e6715ba7e @@ -0,0 +1,3 @@ +import type * as vscode from 'vscode-languageserver'; +import type { ServerProjectProvider, ServerRuntimeEnvironment } from '../types'; +export declare function registerEditorFeatures(connection: vscode.Connection, projects: ServerProjectProvider, env: ServerRuntimeEnvironment): void; diff --git a/.pnpm-store/v3/files/70/0fb2f17147c4372f45df49d5695d6a5c60c77f9b766e63bc8b2bb0d4b853c8043c64d01ba6cbbfbc613830f5d5b586c5a35bba390b94ae43576cbead97fea6 b/.pnpm-store/v3/files/70/0fb2f17147c4372f45df49d5695d6a5c60c77f9b766e63bc8b2bb0d4b853c8043c64d01ba6cbbfbc613830f5d5b586c5a35bba390b94ae43576cbead97fea6 new file mode 100644 index 00000000..7089c9d0 --- /dev/null +++ b/.pnpm-store/v3/files/70/0fb2f17147c4372f45df49d5695d6a5c60c77f9b766e63bc8b2bb0d4b853c8043c64d01ba6cbbfbc613830f5d5b586c5a35bba390b94ae43576cbead97fea6 @@ -0,0 +1,43 @@ +'use strict'; + +var callBound = require('call-bind/callBound'); + +var $TypeError = require('es-errors/type'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var defaultElementTypes = ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + +// https://262.ecma-international.org/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : defaultElementTypes; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/.pnpm-store/v3/files/70/6bc45f1b016672954bab2d7cf8a1cee93b134093042fc2abcfe7eea38ea2c932af6a1d354332c9a48835fc46a4cec44a8446952fbc88a47dd4bb1432621a6e b/.pnpm-store/v3/files/70/6bc45f1b016672954bab2d7cf8a1cee93b134093042fc2abcfe7eea38ea2c932af6a1d354332c9a48835fc46a4cec44a8446952fbc88a47dd4bb1432621a6e new file mode 100644 index 00000000..0fe9fe70 --- /dev/null +++ b/.pnpm-store/v3/files/70/6bc45f1b016672954bab2d7cf8a1cee93b134093042fc2abcfe7eea38ea2c932af6a1d354332c9a48835fc46a4cec44a8446952fbc88a47dd4bb1432621a6e @@ -0,0 +1,2 @@ +import type { Segment } from './types'; +export declare function toString>(segments: T[]): string; diff --git a/.pnpm-store/v3/files/70/72168d4efd01e4cda4f65df9a6f8eb84327ae3e255db63676075a9b28461504e0cf097b2fff407d648d5a87302ead6de70b729946700a26fa4b60aa3b0b307 b/.pnpm-store/v3/files/70/72168d4efd01e4cda4f65df9a6f8eb84327ae3e255db63676075a9b28461504e0cf097b2fff407d648d5a87302ead6de70b729946700a26fa4b60aa3b0b307 new file mode 100644 index 00000000..82d0f811 --- /dev/null +++ b/.pnpm-store/v3/files/70/72168d4efd01e4cda4f65df9a6f8eb84327ae3e255db63676075a9b28461504e0cf097b2fff407d648d5a87302ead6de70b729946700a26fa4b60aa3b0b307 @@ -0,0 +1,172 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isFullyPopulatedPropertyDescriptor = require('../helpers/isFullyPopulatedPropertyDescriptor'); +var isPropertyDescriptor = require('../helpers/records/property-descriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://262.ecma-international.org/13.0/#sec-validateandapplypropertydescriptor + +// see https://github.com/tc39/ecma262/pull/2468 for ES2022 changes + +// eslint-disable-next-line max-lines-per-function, max-statements +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (typeof extensible !== 'boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (typeof current !== 'undefined' && !isPropertyDescriptor(current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + + if (typeof current === 'undefined') { // step 2 + if (!extensible) { + return false; // step 2.a + } + if (oType === 'Undefined') { + return true; // step 2.b + } + if (IsAccessorDescriptor(Desc)) { // step 2.c + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + // step 2.d + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': !!Desc['[[Configurable]]'], + '[[Enumerable]]': !!Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': !!Desc['[[Writable]]'] + } + ); + } + + // 3. Assert: current is a fully populated Property Descriptor. + if ( + !isFullyPopulatedPropertyDescriptor( + { + IsAccessorDescriptor: IsAccessorDescriptor, + IsDataDescriptor: IsDataDescriptor + }, + current + ) + ) { + throw new $TypeError('`current`, when present, must be a fully populated and valid Property Descriptor'); + } + + // 4. If every field in Desc is absent, return true. + // this can't really match the assertion that it's a Property Descriptor in our JS implementation + + // 5. If current.[[Configurable]] is false, then + if (!current['[[Configurable]]']) { + if ('[[Configurable]]' in Desc && Desc['[[Configurable]]']) { + // step 5.a + return false; + } + if ('[[Enumerable]]' in Desc && !SameValue(Desc['[[Enumerable]]'], current['[[Enumerable]]'])) { + // step 5.b + return false; + } + if (!IsGenericDescriptor(Desc) && !SameValue(IsAccessorDescriptor(Desc), IsAccessorDescriptor(current))) { + // step 5.c + return false; + } + if (IsAccessorDescriptor(current)) { // step 5.d + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + } else if (!current['[[Writable]]']) { // step 5.e + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + } + } + + // 6. If O is not undefined, then + if (oType !== 'Undefined') { + var configurable; + var enumerable; + if (IsDataDescriptor(current) && IsAccessorDescriptor(Desc)) { // step 6.a + configurable = ('[[Configurable]]' in Desc ? Desc : current)['[[Configurable]]']; + enumerable = ('[[Enumerable]]' in Desc ? Desc : current)['[[Enumerable]]']; + // Replace the property named P of object O with an accessor property having [[Configurable]] and [[Enumerable]] attributes as described by current and each other attribute set to its default value. + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': !!configurable, + '[[Enumerable]]': !!enumerable, + '[[Get]]': ('[[Get]]' in Desc ? Desc : current)['[[Get]]'], + '[[Set]]': ('[[Set]]' in Desc ? Desc : current)['[[Set]]'] + } + ); + } else if (IsAccessorDescriptor(current) && IsDataDescriptor(Desc)) { + configurable = ('[[Configurable]]' in Desc ? Desc : current)['[[Configurable]]']; + enumerable = ('[[Enumerable]]' in Desc ? Desc : current)['[[Enumerable]]']; + // i. Replace the property named P of object O with a data property having [[Configurable]] and [[Enumerable]] attributes as described by current and each other attribute set to its default value. + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': !!configurable, + '[[Enumerable]]': !!enumerable, + '[[Value]]': ('[[Value]]' in Desc ? Desc : current)['[[Value]]'], + '[[Writable]]': !!('[[Writable]]' in Desc ? Desc : current)['[[Writable]]'] + } + ); + } + + // For each field of Desc that is present, set the corresponding attribute of the property named P of object O to the value of the field. + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + + return true; // step 7 +}; diff --git a/.pnpm-store/v3/files/70/729bb11fc87a9e322aa7268938c1ffe4d0b3fdaa355520e9a071b98c9fa607c0a5286f881c830bbb69398c057f908cefa3fc1c791cbeec1c017cc5bb9159c6 b/.pnpm-store/v3/files/70/729bb11fc87a9e322aa7268938c1ffe4d0b3fdaa355520e9a071b98c9fa607c0a5286f881c830bbb69398c057f908cefa3fc1c791cbeec1c017cc5bb9159c6 new file mode 100644 index 00000000..87e17eb3 --- /dev/null +++ b/.pnpm-store/v3/files/70/729bb11fc87a9e322aa7268938c1ffe4d0b3fdaa355520e9a071b98c9fa607c0a5286f881c830bbb69398c057f908cefa3fc1c791cbeec1c017cc5bb9159c6 @@ -0,0 +1,288 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const adjacent_overload_signatures_1 = __importDefault(require("./adjacent-overload-signatures")); +const array_type_1 = __importDefault(require("./array-type")); +const await_thenable_1 = __importDefault(require("./await-thenable")); +const ban_ts_comment_1 = __importDefault(require("./ban-ts-comment")); +const ban_tslint_comment_1 = __importDefault(require("./ban-tslint-comment")); +const ban_types_1 = __importDefault(require("./ban-types")); +const block_spacing_1 = __importDefault(require("./block-spacing")); +const brace_style_1 = __importDefault(require("./brace-style")); +const class_literal_property_style_1 = __importDefault(require("./class-literal-property-style")); +const class_methods_use_this_1 = __importDefault(require("./class-methods-use-this")); +const comma_dangle_1 = __importDefault(require("./comma-dangle")); +const comma_spacing_1 = __importDefault(require("./comma-spacing")); +const consistent_generic_constructors_1 = __importDefault(require("./consistent-generic-constructors")); +const consistent_indexed_object_style_1 = __importDefault(require("./consistent-indexed-object-style")); +const consistent_type_assertions_1 = __importDefault(require("./consistent-type-assertions")); +const consistent_type_definitions_1 = __importDefault(require("./consistent-type-definitions")); +const consistent_type_exports_1 = __importDefault(require("./consistent-type-exports")); +const consistent_type_imports_1 = __importDefault(require("./consistent-type-imports")); +const default_param_last_1 = __importDefault(require("./default-param-last")); +const dot_notation_1 = __importDefault(require("./dot-notation")); +const explicit_function_return_type_1 = __importDefault(require("./explicit-function-return-type")); +const explicit_member_accessibility_1 = __importDefault(require("./explicit-member-accessibility")); +const explicit_module_boundary_types_1 = __importDefault(require("./explicit-module-boundary-types")); +const func_call_spacing_1 = __importDefault(require("./func-call-spacing")); +const indent_1 = __importDefault(require("./indent")); +const init_declarations_1 = __importDefault(require("./init-declarations")); +const key_spacing_1 = __importDefault(require("./key-spacing")); +const keyword_spacing_1 = __importDefault(require("./keyword-spacing")); +const lines_around_comment_1 = __importDefault(require("./lines-around-comment")); +const lines_between_class_members_1 = __importDefault(require("./lines-between-class-members")); +const max_params_1 = __importDefault(require("./max-params")); +const member_delimiter_style_1 = __importDefault(require("./member-delimiter-style")); +const member_ordering_1 = __importDefault(require("./member-ordering")); +const method_signature_style_1 = __importDefault(require("./method-signature-style")); +const naming_convention_1 = __importDefault(require("./naming-convention")); +const no_array_constructor_1 = __importDefault(require("./no-array-constructor")); +const no_array_delete_1 = __importDefault(require("./no-array-delete")); +const no_base_to_string_1 = __importDefault(require("./no-base-to-string")); +const no_confusing_non_null_assertion_1 = __importDefault(require("./no-confusing-non-null-assertion")); +const no_confusing_void_expression_1 = __importDefault(require("./no-confusing-void-expression")); +const no_dupe_class_members_1 = __importDefault(require("./no-dupe-class-members")); +const no_duplicate_enum_values_1 = __importDefault(require("./no-duplicate-enum-values")); +const no_duplicate_type_constituents_1 = __importDefault(require("./no-duplicate-type-constituents")); +const no_dynamic_delete_1 = __importDefault(require("./no-dynamic-delete")); +const no_empty_function_1 = __importDefault(require("./no-empty-function")); +const no_empty_interface_1 = __importDefault(require("./no-empty-interface")); +const no_explicit_any_1 = __importDefault(require("./no-explicit-any")); +const no_extra_non_null_assertion_1 = __importDefault(require("./no-extra-non-null-assertion")); +const no_extra_parens_1 = __importDefault(require("./no-extra-parens")); +const no_extra_semi_1 = __importDefault(require("./no-extra-semi")); +const no_extraneous_class_1 = __importDefault(require("./no-extraneous-class")); +const no_floating_promises_1 = __importDefault(require("./no-floating-promises")); +const no_for_in_array_1 = __importDefault(require("./no-for-in-array")); +const no_implied_eval_1 = __importDefault(require("./no-implied-eval")); +const no_import_type_side_effects_1 = __importDefault(require("./no-import-type-side-effects")); +const no_inferrable_types_1 = __importDefault(require("./no-inferrable-types")); +const no_invalid_this_1 = __importDefault(require("./no-invalid-this")); +const no_invalid_void_type_1 = __importDefault(require("./no-invalid-void-type")); +const no_loop_func_1 = __importDefault(require("./no-loop-func")); +const no_loss_of_precision_1 = __importDefault(require("./no-loss-of-precision")); +const no_magic_numbers_1 = __importDefault(require("./no-magic-numbers")); +const no_meaningless_void_operator_1 = __importDefault(require("./no-meaningless-void-operator")); +const no_misused_new_1 = __importDefault(require("./no-misused-new")); +const no_misused_promises_1 = __importDefault(require("./no-misused-promises")); +const no_mixed_enums_1 = __importDefault(require("./no-mixed-enums")); +const no_namespace_1 = __importDefault(require("./no-namespace")); +const no_non_null_asserted_nullish_coalescing_1 = __importDefault(require("./no-non-null-asserted-nullish-coalescing")); +const no_non_null_asserted_optional_chain_1 = __importDefault(require("./no-non-null-asserted-optional-chain")); +const no_non_null_assertion_1 = __importDefault(require("./no-non-null-assertion")); +const no_redeclare_1 = __importDefault(require("./no-redeclare")); +const no_redundant_type_constituents_1 = __importDefault(require("./no-redundant-type-constituents")); +const no_require_imports_1 = __importDefault(require("./no-require-imports")); +const no_restricted_imports_1 = __importDefault(require("./no-restricted-imports")); +const no_shadow_1 = __importDefault(require("./no-shadow")); +const no_this_alias_1 = __importDefault(require("./no-this-alias")); +const no_throw_literal_1 = __importDefault(require("./no-throw-literal")); +const no_type_alias_1 = __importDefault(require("./no-type-alias")); +const no_unnecessary_boolean_literal_compare_1 = __importDefault(require("./no-unnecessary-boolean-literal-compare")); +const no_unnecessary_condition_1 = __importDefault(require("./no-unnecessary-condition")); +const no_unnecessary_qualifier_1 = __importDefault(require("./no-unnecessary-qualifier")); +const no_unnecessary_type_arguments_1 = __importDefault(require("./no-unnecessary-type-arguments")); +const no_unnecessary_type_assertion_1 = __importDefault(require("./no-unnecessary-type-assertion")); +const no_unnecessary_type_constraint_1 = __importDefault(require("./no-unnecessary-type-constraint")); +const no_unsafe_argument_1 = __importDefault(require("./no-unsafe-argument")); +const no_unsafe_assignment_1 = __importDefault(require("./no-unsafe-assignment")); +const no_unsafe_call_1 = __importDefault(require("./no-unsafe-call")); +const no_unsafe_declaration_merging_1 = __importDefault(require("./no-unsafe-declaration-merging")); +const no_unsafe_enum_comparison_1 = __importDefault(require("./no-unsafe-enum-comparison")); +const no_unsafe_member_access_1 = __importDefault(require("./no-unsafe-member-access")); +const no_unsafe_return_1 = __importDefault(require("./no-unsafe-return")); +const no_unsafe_unary_minus_1 = __importDefault(require("./no-unsafe-unary-minus")); +const no_unused_expressions_1 = __importDefault(require("./no-unused-expressions")); +const no_unused_vars_1 = __importDefault(require("./no-unused-vars")); +const no_use_before_define_1 = __importDefault(require("./no-use-before-define")); +const no_useless_constructor_1 = __importDefault(require("./no-useless-constructor")); +const no_useless_empty_export_1 = __importDefault(require("./no-useless-empty-export")); +const no_useless_template_literals_1 = __importDefault(require("./no-useless-template-literals")); +const no_var_requires_1 = __importDefault(require("./no-var-requires")); +const non_nullable_type_assertion_style_1 = __importDefault(require("./non-nullable-type-assertion-style")); +const object_curly_spacing_1 = __importDefault(require("./object-curly-spacing")); +const padding_line_between_statements_1 = __importDefault(require("./padding-line-between-statements")); +const parameter_properties_1 = __importDefault(require("./parameter-properties")); +const prefer_as_const_1 = __importDefault(require("./prefer-as-const")); +const prefer_destructuring_1 = __importDefault(require("./prefer-destructuring")); +const prefer_enum_initializers_1 = __importDefault(require("./prefer-enum-initializers")); +const prefer_find_1 = __importDefault(require("./prefer-find")); +const prefer_for_of_1 = __importDefault(require("./prefer-for-of")); +const prefer_function_type_1 = __importDefault(require("./prefer-function-type")); +const prefer_includes_1 = __importDefault(require("./prefer-includes")); +const prefer_literal_enum_member_1 = __importDefault(require("./prefer-literal-enum-member")); +const prefer_namespace_keyword_1 = __importDefault(require("./prefer-namespace-keyword")); +const prefer_nullish_coalescing_1 = __importDefault(require("./prefer-nullish-coalescing")); +const prefer_optional_chain_1 = __importDefault(require("./prefer-optional-chain")); +const prefer_promise_reject_errors_1 = __importDefault(require("./prefer-promise-reject-errors")); +const prefer_readonly_1 = __importDefault(require("./prefer-readonly")); +const prefer_readonly_parameter_types_1 = __importDefault(require("./prefer-readonly-parameter-types")); +const prefer_reduce_type_parameter_1 = __importDefault(require("./prefer-reduce-type-parameter")); +const prefer_regexp_exec_1 = __importDefault(require("./prefer-regexp-exec")); +const prefer_return_this_type_1 = __importDefault(require("./prefer-return-this-type")); +const prefer_string_starts_ends_with_1 = __importDefault(require("./prefer-string-starts-ends-with")); +const prefer_ts_expect_error_1 = __importDefault(require("./prefer-ts-expect-error")); +const promise_function_async_1 = __importDefault(require("./promise-function-async")); +const quotes_1 = __importDefault(require("./quotes")); +const require_array_sort_compare_1 = __importDefault(require("./require-array-sort-compare")); +const require_await_1 = __importDefault(require("./require-await")); +const restrict_plus_operands_1 = __importDefault(require("./restrict-plus-operands")); +const restrict_template_expressions_1 = __importDefault(require("./restrict-template-expressions")); +const return_await_1 = __importDefault(require("./return-await")); +const semi_1 = __importDefault(require("./semi")); +const sort_type_constituents_1 = __importDefault(require("./sort-type-constituents")); +const space_before_blocks_1 = __importDefault(require("./space-before-blocks")); +const space_before_function_paren_1 = __importDefault(require("./space-before-function-paren")); +const space_infix_ops_1 = __importDefault(require("./space-infix-ops")); +const strict_boolean_expressions_1 = __importDefault(require("./strict-boolean-expressions")); +const switch_exhaustiveness_check_1 = __importDefault(require("./switch-exhaustiveness-check")); +const triple_slash_reference_1 = __importDefault(require("./triple-slash-reference")); +const type_annotation_spacing_1 = __importDefault(require("./type-annotation-spacing")); +const typedef_1 = __importDefault(require("./typedef")); +const unbound_method_1 = __importDefault(require("./unbound-method")); +const unified_signatures_1 = __importDefault(require("./unified-signatures")); +exports.default = { + 'adjacent-overload-signatures': adjacent_overload_signatures_1.default, + 'array-type': array_type_1.default, + 'await-thenable': await_thenable_1.default, + 'ban-ts-comment': ban_ts_comment_1.default, + 'ban-tslint-comment': ban_tslint_comment_1.default, + 'ban-types': ban_types_1.default, + 'block-spacing': block_spacing_1.default, + 'brace-style': brace_style_1.default, + 'class-literal-property-style': class_literal_property_style_1.default, + 'class-methods-use-this': class_methods_use_this_1.default, + 'comma-dangle': comma_dangle_1.default, + 'comma-spacing': comma_spacing_1.default, + 'consistent-generic-constructors': consistent_generic_constructors_1.default, + 'consistent-indexed-object-style': consistent_indexed_object_style_1.default, + 'consistent-type-assertions': consistent_type_assertions_1.default, + 'consistent-type-definitions': consistent_type_definitions_1.default, + 'consistent-type-exports': consistent_type_exports_1.default, + 'consistent-type-imports': consistent_type_imports_1.default, + 'default-param-last': default_param_last_1.default, + 'dot-notation': dot_notation_1.default, + 'explicit-function-return-type': explicit_function_return_type_1.default, + 'explicit-member-accessibility': explicit_member_accessibility_1.default, + 'explicit-module-boundary-types': explicit_module_boundary_types_1.default, + 'func-call-spacing': func_call_spacing_1.default, + indent: indent_1.default, + 'init-declarations': init_declarations_1.default, + 'key-spacing': key_spacing_1.default, + 'keyword-spacing': keyword_spacing_1.default, + 'lines-around-comment': lines_around_comment_1.default, + 'lines-between-class-members': lines_between_class_members_1.default, + 'max-params': max_params_1.default, + 'member-delimiter-style': member_delimiter_style_1.default, + 'member-ordering': member_ordering_1.default, + 'method-signature-style': method_signature_style_1.default, + 'naming-convention': naming_convention_1.default, + 'no-array-constructor': no_array_constructor_1.default, + 'no-array-delete': no_array_delete_1.default, + 'no-base-to-string': no_base_to_string_1.default, + 'no-confusing-non-null-assertion': no_confusing_non_null_assertion_1.default, + 'no-confusing-void-expression': no_confusing_void_expression_1.default, + 'no-dupe-class-members': no_dupe_class_members_1.default, + 'no-duplicate-enum-values': no_duplicate_enum_values_1.default, + 'no-duplicate-type-constituents': no_duplicate_type_constituents_1.default, + 'no-dynamic-delete': no_dynamic_delete_1.default, + 'no-empty-function': no_empty_function_1.default, + 'no-empty-interface': no_empty_interface_1.default, + 'no-explicit-any': no_explicit_any_1.default, + 'no-extra-non-null-assertion': no_extra_non_null_assertion_1.default, + 'no-extra-parens': no_extra_parens_1.default, + 'no-extra-semi': no_extra_semi_1.default, + 'no-extraneous-class': no_extraneous_class_1.default, + 'no-floating-promises': no_floating_promises_1.default, + 'no-for-in-array': no_for_in_array_1.default, + 'no-implied-eval': no_implied_eval_1.default, + 'no-import-type-side-effects': no_import_type_side_effects_1.default, + 'no-inferrable-types': no_inferrable_types_1.default, + 'no-invalid-this': no_invalid_this_1.default, + 'no-invalid-void-type': no_invalid_void_type_1.default, + 'no-loop-func': no_loop_func_1.default, + 'no-loss-of-precision': no_loss_of_precision_1.default, + 'no-magic-numbers': no_magic_numbers_1.default, + 'no-meaningless-void-operator': no_meaningless_void_operator_1.default, + 'no-misused-new': no_misused_new_1.default, + 'no-misused-promises': no_misused_promises_1.default, + 'no-mixed-enums': no_mixed_enums_1.default, + 'no-namespace': no_namespace_1.default, + 'no-non-null-asserted-nullish-coalescing': no_non_null_asserted_nullish_coalescing_1.default, + 'no-non-null-asserted-optional-chain': no_non_null_asserted_optional_chain_1.default, + 'no-non-null-assertion': no_non_null_assertion_1.default, + 'no-redeclare': no_redeclare_1.default, + 'no-redundant-type-constituents': no_redundant_type_constituents_1.default, + 'no-require-imports': no_require_imports_1.default, + 'no-restricted-imports': no_restricted_imports_1.default, + 'no-shadow': no_shadow_1.default, + 'no-this-alias': no_this_alias_1.default, + 'no-throw-literal': no_throw_literal_1.default, + 'no-type-alias': no_type_alias_1.default, + 'no-unnecessary-boolean-literal-compare': no_unnecessary_boolean_literal_compare_1.default, + 'no-unnecessary-condition': no_unnecessary_condition_1.default, + 'no-unnecessary-qualifier': no_unnecessary_qualifier_1.default, + 'no-unnecessary-type-arguments': no_unnecessary_type_arguments_1.default, + 'no-unnecessary-type-assertion': no_unnecessary_type_assertion_1.default, + 'no-unnecessary-type-constraint': no_unnecessary_type_constraint_1.default, + 'no-unsafe-argument': no_unsafe_argument_1.default, + 'no-unsafe-assignment': no_unsafe_assignment_1.default, + 'no-unsafe-call': no_unsafe_call_1.default, + 'no-unsafe-declaration-merging': no_unsafe_declaration_merging_1.default, + 'no-unsafe-enum-comparison': no_unsafe_enum_comparison_1.default, + 'no-unsafe-member-access': no_unsafe_member_access_1.default, + 'no-unsafe-return': no_unsafe_return_1.default, + 'no-unsafe-unary-minus': no_unsafe_unary_minus_1.default, + 'no-unused-expressions': no_unused_expressions_1.default, + 'no-unused-vars': no_unused_vars_1.default, + 'no-use-before-define': no_use_before_define_1.default, + 'no-useless-constructor': no_useless_constructor_1.default, + 'no-useless-empty-export': no_useless_empty_export_1.default, + 'no-useless-template-literals': no_useless_template_literals_1.default, + 'no-var-requires': no_var_requires_1.default, + 'non-nullable-type-assertion-style': non_nullable_type_assertion_style_1.default, + 'object-curly-spacing': object_curly_spacing_1.default, + 'padding-line-between-statements': padding_line_between_statements_1.default, + 'parameter-properties': parameter_properties_1.default, + 'prefer-as-const': prefer_as_const_1.default, + 'prefer-destructuring': prefer_destructuring_1.default, + 'prefer-enum-initializers': prefer_enum_initializers_1.default, + 'prefer-find': prefer_find_1.default, + 'prefer-for-of': prefer_for_of_1.default, + 'prefer-function-type': prefer_function_type_1.default, + 'prefer-includes': prefer_includes_1.default, + 'prefer-literal-enum-member': prefer_literal_enum_member_1.default, + 'prefer-namespace-keyword': prefer_namespace_keyword_1.default, + 'prefer-nullish-coalescing': prefer_nullish_coalescing_1.default, + 'prefer-optional-chain': prefer_optional_chain_1.default, + 'prefer-promise-reject-errors': prefer_promise_reject_errors_1.default, + 'prefer-readonly': prefer_readonly_1.default, + 'prefer-readonly-parameter-types': prefer_readonly_parameter_types_1.default, + 'prefer-reduce-type-parameter': prefer_reduce_type_parameter_1.default, + 'prefer-regexp-exec': prefer_regexp_exec_1.default, + 'prefer-return-this-type': prefer_return_this_type_1.default, + 'prefer-string-starts-ends-with': prefer_string_starts_ends_with_1.default, + 'prefer-ts-expect-error': prefer_ts_expect_error_1.default, + 'promise-function-async': promise_function_async_1.default, + quotes: quotes_1.default, + 'require-array-sort-compare': require_array_sort_compare_1.default, + 'require-await': require_await_1.default, + 'restrict-plus-operands': restrict_plus_operands_1.default, + 'restrict-template-expressions': restrict_template_expressions_1.default, + 'return-await': return_await_1.default, + semi: semi_1.default, + 'sort-type-constituents': sort_type_constituents_1.default, + 'space-before-blocks': space_before_blocks_1.default, + 'space-before-function-paren': space_before_function_paren_1.default, + 'space-infix-ops': space_infix_ops_1.default, + 'strict-boolean-expressions': strict_boolean_expressions_1.default, + 'switch-exhaustiveness-check': switch_exhaustiveness_check_1.default, + 'triple-slash-reference': triple_slash_reference_1.default, + 'type-annotation-spacing': type_annotation_spacing_1.default, + typedef: typedef_1.default, + 'unbound-method': unbound_method_1.default, + 'unified-signatures': unified_signatures_1.default, +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/70/99558c15ba390305fddcd58c0b37da353af62a59f85b78684772eb1008408fbfbc0200d3732f498cdfdc496230e1649a96ed5a6e9a2fbfdc11b79fe542f2ae b/.pnpm-store/v3/files/70/99558c15ba390305fddcd58c0b37da353af62a59f85b78684772eb1008408fbfbc0200d3732f498cdfdc496230e1649a96ed5a6e9a2fbfdc11b79fe542f2ae new file mode 100644 index 00000000..5015f8c6 --- /dev/null +++ b/.pnpm-store/v3/files/70/99558c15ba390305fddcd58c0b37da353af62a59f85b78684772eb1008408fbfbc0200d3732f498cdfdc496230e1649a96ed5a6e9a2fbfdc11b79fe542f2ae @@ -0,0 +1,85 @@ +{ + "name": "@typescript-eslint/parser", + "version": "7.0.1", + "description": "An ESLint custom parser which leverages TypeScript ESTree", + "files": [ + "dist", + "_ts4.3", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/parser" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "BSD-2-Clause", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "typescript", + "parser", + "syntax", + "eslint" + ], + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "lint": "npx nx lint", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "dependencies": { + "@typescript-eslint/scope-manager": "7.0.1", + "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/typescript-estree": "7.0.1", + "@typescript-eslint/visitor-keys": "7.0.1", + "debug": "^4.3.4" + }, + "devDependencies": { + "@types/glob": "*", + "downlevel-dts": "*", + "glob": "*", + "jest": "29.7.0", + "prettier": "^3.0.3", + "rimraf": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<4.7": { + "*": [ + "_ts4.3/*" + ] + } + } +} diff --git a/.pnpm-store/v3/files/71/1776bd7649d9c987b7cbcd63ebe09c19f5af1f1b561e479d59f371b6a6f70045233a3f4c100b239bba1a3307c26881de9cc9d0b675b9140a1b6c2537604d80 b/.pnpm-store/v3/files/71/1776bd7649d9c987b7cbcd63ebe09c19f5af1f1b561e479d59f371b6a6f70045233a3f4c100b239bba1a3307c26881de9cc9d0b675b9140a1b6c2537604d80 new file mode 100644 index 00000000..e0a25e2b --- /dev/null +++ b/.pnpm-store/v3/files/71/1776bd7649d9c987b7cbcd63ebe09c19f5af1f1b561e479d59f371b6a6f70045233a3f4c100b239bba1a3307c26881de9cc9d0b675b9140a1b6c2537604d80 @@ -0,0 +1,9 @@ +import type * as ts from 'typescript'; +export declare function snippetForFunctionCall(item: { + insertText?: string; + label: string; +}, displayParts: ReadonlyArray): { + snippet: string; + parameterCount: number; +}; +//# sourceMappingURL=snippetForFunctionCall.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/71/34ee9cc0bbb943fae60871a682af3304f1036d271735708350ecde402116539b8d3fd83dbeed1aba22690f78d03c40c871e3d950fcb0978c4f8120225046f5 b/.pnpm-store/v3/files/71/34ee9cc0bbb943fae60871a682af3304f1036d271735708350ecde402116539b8d3fd83dbeed1aba22690f78d03c40c871e3d950fcb0978c4f8120225046f5 new file mode 100644 index 00000000..9e8511fd --- /dev/null +++ b/.pnpm-store/v3/files/71/34ee9cc0bbb943fae60871a682af3304f1036d271735708350ecde402116539b8d3fd83dbeed1aba22690f78d03c40c871e3d950fcb0978c4f8120225046f5 @@ -0,0 +1,40 @@ +'use strict'; + +var hasOwn = require('hasown'); + +var $TypeError = require('es-errors/type'); + +var getSymbolDescription = require('get-symbol-description'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); + +// https://262.ecma-international.org/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || hasOwn(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + if (typeof name !== 'symbol' && typeof name !== 'string') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (typeof name === 'symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/.pnpm-store/v3/files/71/36853e25c96d20617b64f4ee555b174b7855b5130bcebdefda153d290a950445445439ffff5b4464b988883056d34cdc22ec6072a6c7b67db65ec5ffcec59d b/.pnpm-store/v3/files/71/36853e25c96d20617b64f4ee555b174b7855b5130bcebdefda153d290a950445445439ffff5b4464b988883056d34cdc22ec6072a6c7b67db65ec5ffcec59d new file mode 100644 index 00000000..7f7a4339 --- /dev/null +++ b/.pnpm-store/v3/files/71/36853e25c96d20617b64f4ee555b174b7855b5130bcebdefda153d290a950445445439ffff5b4464b988883056d34cdc22ec6072a6c7b67db65ec5ffcec59d @@ -0,0 +1,77 @@ +'use strict'; + +var $RangeError = require('es-errors/range'); +var $TypeError = require('es-errors/type'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/records/property-descriptor'); + +var IsArray = require('./IsArray'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); + +// https://262.ecma-international.org/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/.pnpm-store/v3/files/71/4459c8233c7038f7e8770270a27524569ad108cf1b48f9d25d236d450db7702e070220ca7c98b4342a4246101a7c58729597a77f554b42d2d39bf9a0481f99 b/.pnpm-store/v3/files/71/4459c8233c7038f7e8770270a27524569ad108cf1b48f9d25d236d450db7702e070220ca7c98b4342a4246101a7c58729597a77f554b42d2d39bf9a0481f99 new file mode 100644 index 00000000..4805b672 --- /dev/null +++ b/.pnpm-store/v3/files/71/4459c8233c7038f7e8770270a27524569ad108cf1b48f9d25d236d450db7702e070220ca7c98b4342a4246101a7c58729597a77f554b42d2d39bf9a0481f99 @@ -0,0 +1,256 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const isLastTokenEndOfLine = (token, line) => { + const positionInLine = token.loc.start.column; + return positionInLine === line.length - 1; +}; +const isCommentsEndOfLine = (token, comments, line) => { + if (!comments) { + return false; + } + if (comments.loc.end.line > token.loc.end.line) { + return true; + } + const positionInLine = comments.loc.end.column; + return positionInLine === line.length; +}; +const makeFixFunction = ({ optsNone, optsSemi, lastToken, commentsAfterLastToken, missingDelimiter, lastTokenLine, isSingleLine, }) => { + // if removing is the action but last token is not the end of the line + if (optsNone && + !isLastTokenEndOfLine(lastToken, lastTokenLine) && + !isCommentsEndOfLine(lastToken, commentsAfterLastToken, lastTokenLine) && + !isSingleLine) { + return null; + } + return (fixer) => { + if (optsNone) { + // remove the unneeded token + return fixer.remove(lastToken); + } + const token = optsSemi ? ';' : ','; + if (missingDelimiter) { + // add the missing delimiter + return fixer.insertTextAfter(lastToken, token); + } + // correct the current delimiter + return fixer.replaceText(lastToken, token); + }; +}; +const BASE_SCHEMA = { + type: 'object', + properties: { + multiline: { + type: 'object', + properties: { + delimiter: { $ref: '#/items/0/$defs/multiLineOption' }, + requireLast: { type: 'boolean' }, + }, + additionalProperties: false, + }, + singleline: { + type: 'object', + properties: { + delimiter: { $ref: '#/items/0/$defs/singleLineOption' }, + requireLast: { type: 'boolean' }, + }, + additionalProperties: false, + }, + }, + additionalProperties: false, +}; +exports.default = (0, util_1.createRule)({ + name: 'member-delimiter-style', + meta: { + deprecated: true, + replacedBy: ['@stylistic/ts/member-delimiter-style'], + type: 'layout', + docs: { + description: 'Require a specific member delimiter style for interfaces and type literals', + }, + fixable: 'whitespace', + messages: { + unexpectedComma: 'Unexpected separator (,).', + unexpectedSemi: 'Unexpected separator (;).', + expectedComma: 'Expected a comma.', + expectedSemi: 'Expected a semicolon.', + }, + schema: [ + { + $defs: { + multiLineOption: { + type: 'string', + enum: ['none', 'semi', 'comma'], + }, + // note can't have "none" for single line delimiter as it's invalid syntax + singleLineOption: { + type: 'string', + enum: ['semi', 'comma'], + }, + // note - need to define this last as it references the enums + delimiterConfig: BASE_SCHEMA, + }, + type: 'object', + properties: { + ...BASE_SCHEMA.properties, + overrides: { + type: 'object', + properties: { + interface: { + $ref: '#/items/0/$defs/delimiterConfig', + }, + typeLiteral: { + $ref: '#/items/0/$defs/delimiterConfig', + }, + }, + additionalProperties: false, + }, + multilineDetection: { + type: 'string', + enum: ['brackets', 'last-member'], + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + multiline: { + delimiter: 'semi', + requireLast: true, + }, + singleline: { + delimiter: 'semi', + requireLast: false, + }, + multilineDetection: 'brackets', + }, + ], + create(context, [options]) { + // use the base options as the defaults for the cases + const baseOptions = options; + const overrides = baseOptions.overrides ?? {}; + const interfaceOptions = (0, util_1.deepMerge)(baseOptions, overrides.interface); + const typeLiteralOptions = (0, util_1.deepMerge)(baseOptions, overrides.typeLiteral); + /** + * Check the last token in the given member. + * @param member the member to be evaluated. + * @param opts the options to be validated. + * @param isLast a flag indicating `member` is the last in the interface or type literal. + */ + function checkLastToken(member, opts, isLast) { + /** + * Resolves the boolean value for the given setting enum value + * @param type the option name + */ + function getOption(type) { + if (isLast && !opts.requireLast) { + // only turn the option on if its expecting no delimiter for the last member + return type === 'none'; + } + return opts.delimiter === type; + } + let messageId = null; + let missingDelimiter = false; + const lastToken = context.sourceCode.getLastToken(member, { + includeComments: false, + }); + if (!lastToken) { + return; + } + const commentsAfterLastToken = context.sourceCode + .getCommentsAfter(lastToken) + .pop(); + const sourceCodeLines = context.sourceCode.getLines(); + const lastTokenLine = sourceCodeLines[lastToken.loc.start.line - 1]; + const optsSemi = getOption('semi'); + const optsComma = getOption('comma'); + const optsNone = getOption('none'); + if (lastToken.value === ';') { + if (optsComma) { + messageId = 'expectedComma'; + } + else if (optsNone) { + missingDelimiter = true; + messageId = 'unexpectedSemi'; + } + } + else if (lastToken.value === ',') { + if (optsSemi) { + messageId = 'expectedSemi'; + } + else if (optsNone) { + missingDelimiter = true; + messageId = 'unexpectedComma'; + } + } + else { + if (optsSemi) { + missingDelimiter = true; + messageId = 'expectedSemi'; + } + else if (optsComma) { + missingDelimiter = true; + messageId = 'expectedComma'; + } + } + if (messageId) { + context.report({ + node: lastToken, + loc: { + start: { + line: lastToken.loc.end.line, + column: lastToken.loc.end.column, + }, + end: { + line: lastToken.loc.end.line, + column: lastToken.loc.end.column, + }, + }, + messageId, + fix: makeFixFunction({ + optsNone, + optsSemi, + lastToken, + commentsAfterLastToken, + missingDelimiter, + lastTokenLine, + isSingleLine: opts.type === 'single-line', + }), + }); + } + } + /** + * Check the member separator being used matches the delimiter. + * @param node the node to be evaluated. + */ + function checkMemberSeparatorStyle(node) { + const members = node.type === utils_1.AST_NODE_TYPES.TSInterfaceBody ? node.body : node.members; + let isSingleLine = node.loc.start.line === node.loc.end.line; + if (options.multilineDetection === 'last-member' && + !isSingleLine && + members.length > 0) { + const lastMember = members[members.length - 1]; + if (lastMember.loc.end.line === node.loc.end.line) { + isSingleLine = true; + } + } + const typeOpts = node.type === utils_1.AST_NODE_TYPES.TSInterfaceBody + ? interfaceOptions + : typeLiteralOptions; + const opts = isSingleLine + ? { ...typeOpts.singleline, type: 'single-line' } + : { ...typeOpts.multiline, type: 'multi-line' }; + members.forEach((member, index) => { + checkLastToken(member, opts, index === members.length - 1); + }); + } + return { + TSInterfaceBody: checkMemberSeparatorStyle, + TSTypeLiteral: checkMemberSeparatorStyle, + }; + }, +}); +//# sourceMappingURL=member-delimiter-style.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/71/4ab7e9af0058bcdb110b08692db7962db80869449183accec8c5144e6e82f907d028f2cb3c013f8659730e4f1a701014d0443703e62c658519322b91df2086 b/.pnpm-store/v3/files/71/4ab7e9af0058bcdb110b08692db7962db80869449183accec8c5144e6e82f907d028f2cb3c013f8659730e4f1a701014d0443703e62c658519322b91df2086 new file mode 100644 index 00000000..6c2426ff --- /dev/null +++ b/.pnpm-store/v3/files/71/4ab7e9af0058bcdb110b08692db7962db80869449183accec8c5144e6e82f907d028f2cb3c013f8659730e4f1a701014d0443703e62c658519322b91df2086 @@ -0,0 +1,22 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var Call = require('./Call'); +var IsArray = require('./IsArray'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://262.ecma-international.org/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + var argumentsList = arguments.length > 2 ? arguments[2] : []; + if (!IsArray(argumentsList)) { + throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List'); + } + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/.pnpm-store/v3/files/71/5efbd57ecb047ea4b48896eab490a9b6c0649f20c6b8b73d00e26a1d67fc7bcb48f0bef09e2d0ffc259e0fc90f07be99f961449c617b69076813144bda815e b/.pnpm-store/v3/files/71/5efbd57ecb047ea4b48896eab490a9b6c0649f20c6b8b73d00e26a1d67fc7bcb48f0bef09e2d0ffc259e0fc90f07be99f961449c617b69076813144bda815e new file mode 100644 index 00000000..9fe67405 --- /dev/null +++ b/.pnpm-store/v3/files/71/5efbd57ecb047ea4b48896eab490a9b6c0649f20c6b8b73d00e26a1d67fc7bcb48f0bef09e2d0ffc259e0fc90f07be99f961449c617b69076813144bda815e @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $BigInt = GetIntrinsic('%BigInt%', true); +var $TypeError = require('es-errors/type'); + +// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-bitwiseNOT + +module.exports = function BigIntBitwiseNOT(x) { + if (typeof x !== 'bigint') { + throw new $TypeError('Assertion failed: `x` argument must be a BigInt'); + } + return -x - $BigInt(1); +}; diff --git a/.pnpm-store/v3/files/71/ba6117fe262be0eacd4ad28cd39729b74a0cb64e4903a49182dc3f81ac9eb07b90cefdba51bbdb6554471662e0d9cbb8d21d5fefc2cfe3db3f32de109e29da b/.pnpm-store/v3/files/71/ba6117fe262be0eacd4ad28cd39729b74a0cb64e4903a49182dc3f81ac9eb07b90cefdba51bbdb6554471662e0d9cbb8d21d5fefc2cfe3db3f32de109e29da new file mode 100644 index 00000000..3f553141 --- /dev/null +++ b/.pnpm-store/v3/files/71/ba6117fe262be0eacd4ad28cd39729b74a0cb64e4903a49182dc3f81ac9eb07b90cefdba51bbdb6554471662e0d9cbb8d21d5fefc2cfe3db3f32de109e29da @@ -0,0 +1,352 @@ +'use strict'; + +const utilities = require('./preset-mini.UhMMbd34.cjs'); + +const cursorValues = ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"]; +const containValues = ["none", "strict", "content", "size", "inline-size", "layout", "style", "paint"]; +const varEmpty = " "; +const displays = [ + ["inline", { display: "inline" }], + ["block", { display: "block" }], + ["inline-block", { display: "inline-block" }], + ["contents", { display: "contents" }], + ["flow-root", { display: "flow-root" }], + ["list-item", { display: "list-item" }], + ["hidden", { display: "none" }], + [/^display-(.+)$/, ([, c]) => ({ display: utilities.h.bracket.cssvar.global(c) })] +]; +const appearances = [ + ["visible", { visibility: "visible" }], + ["invisible", { visibility: "hidden" }], + ["backface-visible", { "backface-visibility": "visible" }], + ["backface-hidden", { "backface-visibility": "hidden" }], + ...utilities.makeGlobalStaticRules("backface", "backface-visibility") +]; +const cursors = [ + [/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.h.bracket.cssvar.global(c) })], + ...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }]) +]; +const contains = [ + [/^contain-(.*)$/, ([, d]) => { + if (utilities.h.bracket(d) != null) { + return { + contain: utilities.h.bracket(d).split(" ").map((e) => utilities.h.cssvar.fraction(e) ?? e).join(" ") + }; + } + return containValues.includes(d) ? { contain: d } : void 0; + }] +]; +const pointerEvents = [ + ["pointer-events-auto", { "pointer-events": "auto" }], + ["pointer-events-none", { "pointer-events": "none" }], + ...utilities.makeGlobalStaticRules("pointer-events") +]; +const resizes = [ + ["resize-x", { resize: "horizontal" }], + ["resize-y", { resize: "vertical" }], + ["resize", { resize: "both" }], + ["resize-none", { resize: "none" }], + ...utilities.makeGlobalStaticRules("resize") +]; +const userSelects = [ + ["select-auto", { "-webkit-user-select": "auto", "user-select": "auto" }], + ["select-all", { "-webkit-user-select": "all", "user-select": "all" }], + ["select-text", { "-webkit-user-select": "text", "user-select": "text" }], + ["select-none", { "-webkit-user-select": "none", "user-select": "none" }], + ...utilities.makeGlobalStaticRules("select", "user-select") +]; +const whitespaces = [ + [ + /^(?:whitespace-|ws-)([-\w]+)$/, + ([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...utilities.globalKeywords].includes(v) ? { "white-space": v } : void 0, + { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" } + ] +]; +const contentVisibility = [ + [/^intrinsic-size-(.+)$/, ([, d]) => ({ "contain-intrinsic-size": utilities.h.bracket.cssvar.global.fraction.rem(d) }), { autocomplete: "intrinsic-size-" }], + ["content-visibility-visible", { "content-visibility": "visible" }], + ["content-visibility-hidden", { "content-visibility": "hidden" }], + ["content-visibility-auto", { "content-visibility": "auto" }], + ...utilities.makeGlobalStaticRules("content-visibility") +]; +const contents = [ + [/^content-(.+)$/, ([, v]) => ({ content: utilities.h.bracket.cssvar(v) })], + ["content-empty", { content: '""' }], + ["content-none", { content: "none" }] +]; +const breaks = [ + ["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }], + ["break-words", { "overflow-wrap": "break-word" }], + ["break-all", { "word-break": "break-all" }], + ["break-keep", { "word-break": "keep-all" }], + ["break-anywhere", { "overflow-wrap": "anywhere" }] +]; +const textWraps = [ + ["text-wrap", { "text-wrap": "wrap" }], + ["text-nowrap", { "text-wrap": "nowrap" }], + ["text-balance", { "text-wrap": "balance" }], + ["text-pretty", { "text-wrap": "pretty" }] +]; +const textOverflows = [ + ["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }], + ["text-truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }], + ["text-ellipsis", { "text-overflow": "ellipsis" }], + ["text-clip", { "text-overflow": "clip" }] +]; +const textTransforms = [ + ["case-upper", { "text-transform": "uppercase" }], + ["case-lower", { "text-transform": "lowercase" }], + ["case-capital", { "text-transform": "capitalize" }], + ["case-normal", { "text-transform": "none" }], + ...utilities.makeGlobalStaticRules("case", "text-transform") +]; +const fontStyles = [ + ["italic", { "font-style": "italic" }], + ["not-italic", { "font-style": "normal" }], + ["font-italic", { "font-style": "italic" }], + ["font-not-italic", { "font-style": "normal" }], + ["oblique", { "font-style": "oblique" }], + ["not-oblique", { "font-style": "normal" }], + ["font-oblique", { "font-style": "oblique" }], + ["font-not-oblique", { "font-style": "normal" }] +]; +const fontSmoothings = [ + ["antialiased", { + "-webkit-font-smoothing": "antialiased", + "-moz-osx-font-smoothing": "grayscale" + }], + ["subpixel-antialiased", { + "-webkit-font-smoothing": "auto", + "-moz-osx-font-smoothing": "auto" + }] +]; + +const ringBase = { + "--un-ring-inset": varEmpty, + "--un-ring-offset-width": "0px", + "--un-ring-offset-color": "#fff", + "--un-ring-width": "0px", + "--un-ring-color": "rgb(147 197 253 / 0.5)", + "--un-shadow": "0 0 rgb(0 0 0 / 0)" +}; +const rings = [ + // ring + [/^ring(?:-(.+))?$/, ([, d], { theme }) => { + const value = theme.ringWidth?.[d || "DEFAULT"] ?? utilities.h.px(d || "1"); + if (value) { + return { + "--un-ring-width": value, + "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)", + "--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)", + "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)" + }; + } + }, { autocomplete: "ring-$ringWidth" }], + // size + [/^ring-(?:width-|size-)(.+)$/, handleWidth, { autocomplete: "ring-(width|size)-$lineWidth" }], + // offset size + ["ring-offset", { "--un-ring-offset-width": "1px" }], + [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? utilities.h.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }], + // colors + [/^ring-(.+)$/, handleColorOrWidth, { autocomplete: "ring-$colors" }], + [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-(op|opacity)-" }], + // offset color + [/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset", "borderColor"), { autocomplete: "ring-offset-$colors" }], + [/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": utilities.h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-offset-(op|opacity)-" }], + // style + ["ring-inset", { "--un-ring-inset": "inset" }] +]; +function handleWidth([, b], { theme }) { + return { "--un-ring-width": theme.ringWidth?.[b] ?? utilities.h.bracket.cssvar.px(b) }; +} +function handleColorOrWidth(match, ctx) { + if (utilities.isCSSMathFn(utilities.h.bracket(match[1]))) + return handleWidth(match, ctx); + return utilities.colorResolver("--un-ring-color", "ring", "borderColor")(match, ctx); +} + +const boxShadowsBase = { + "--un-ring-offset-shadow": "0 0 rgb(0 0 0 / 0)", + "--un-ring-shadow": "0 0 rgb(0 0 0 / 0)", + "--un-shadow-inset": varEmpty, + "--un-shadow": "0 0 rgb(0 0 0 / 0)" +}; +const boxShadows = [ + // color + [/^shadow(?:-(.+))?$/, (match, context) => { + const [, d] = match; + const { theme } = context; + const v = theme.boxShadow?.[d || "DEFAULT"]; + const c = d ? utilities.h.bracket.cssvar(d) : void 0; + if ((v != null || c != null) && !utilities.hasParseableColor(c, theme, "shadowColor")) { + return { + "--un-shadow": utilities.colorableShadows(v || c, "--un-shadow-color").join(","), + "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)" + }; + } + return utilities.colorResolver("--un-shadow-color", "shadow", "shadowColor")(match, context); + }, { autocomplete: ["shadow-$colors", "shadow-$boxShadow"] }], + [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.h.bracket.percent.cssvar(opacity) }), { autocomplete: "shadow-(op|opacity)-" }], + // inset + ["shadow-inset", { "--un-shadow-inset": "inset" }] +]; + +const transformValues = [ + "translate", + "rotate", + "scale" +]; +const transformCpu = [ + "translateX(var(--un-translate-x))", + "translateY(var(--un-translate-y))", + "translateZ(var(--un-translate-z))", + "rotate(var(--un-rotate))", + "rotateX(var(--un-rotate-x))", + "rotateY(var(--un-rotate-y))", + "rotateZ(var(--un-rotate-z))", + "skewX(var(--un-skew-x))", + "skewY(var(--un-skew-y))", + "scaleX(var(--un-scale-x))", + "scaleY(var(--un-scale-y))", + "scaleZ(var(--un-scale-z))" +].join(" "); +const transformGpu = [ + "translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))", + "rotate(var(--un-rotate))", + "rotateX(var(--un-rotate-x))", + "rotateY(var(--un-rotate-y))", + "rotateZ(var(--un-rotate-z))", + "skewX(var(--un-skew-x))", + "skewY(var(--un-skew-y))", + "scaleX(var(--un-scale-x))", + "scaleY(var(--un-scale-y))", + "scaleZ(var(--un-scale-z))" +].join(" "); +const transformBase = { + // transform + "--un-rotate": 0, + "--un-rotate-x": 0, + "--un-rotate-y": 0, + "--un-rotate-z": 0, + "--un-scale-x": 1, + "--un-scale-y": 1, + "--un-scale-z": 1, + "--un-skew-x": 0, + "--un-skew-y": 0, + "--un-translate-x": 0, + "--un-translate-y": 0, + "--un-translate-z": 0 +}; +const transforms = [ + // origins + [/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": utilities.positionMap[s] ?? utilities.h.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(utilities.positionMap).join("|")})`, `origin-(${Object.keys(utilities.positionMap).join("|")})`] }], + // perspectives + [/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => { + const v = utilities.h.bracket.cssvar.px.numberWithUnit(s); + if (v != null) { + return { + "-webkit-perspective": v, + "perspective": v + }; + } + }], + // skip 1 & 2 letters shortcut + [/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => { + const v = utilities.h.bracket.cssvar(s) ?? (s.length >= 3 ? utilities.positionMap[s] : void 0); + if (v != null) { + return { + "-webkit-perspective-origin": v, + "perspective-origin": v + }; + } + }], + // modifiers + [/^(?:transform-)?translate-()(.+)$/, handleTranslate], + [/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate], + [/^(?:transform-)?rotate-()(.+)$/, handleRotate], + [/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate], + [/^(?:transform-)?skew-()(.+)$/, handleSkew], + [/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew, { autocomplete: ["transform-skew-(x|y)-", "skew-(x|y)-"] }], + [/^(?:transform-)?scale-()(.+)$/, handleScale], + [/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale, { autocomplete: [`transform-(${transformValues.join("|")})-`, `transform-(${transformValues.join("|")})-(x|y|z)-`, `(${transformValues.join("|")})-`, `(${transformValues.join("|")})-(x|y|z)-`] }], + // style + [/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })], + [/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })], + // base + ["transform", { transform: transformCpu }], + ["transform-cpu", { transform: transformCpu }], + ["transform-gpu", { transform: transformGpu }], + ["transform-none", { transform: "none" }], + ...utilities.makeGlobalStaticRules("transform") +]; +function handleTranslate([, d, b], { theme }) { + const v = theme.spacing?.[b] ?? utilities.h.bracket.cssvar.fraction.rem(b); + if (v != null) { + return [ + ...utilities.xyzMap[d].map((i) => [`--un-translate${i}`, v]), + ["transform", transformCpu] + ]; + } +} +function handleScale([, d, b]) { + const v = utilities.h.bracket.cssvar.fraction.percent(b); + if (v != null) { + return [ + ...utilities.xyzMap[d].map((i) => [`--un-scale${i}`, v]), + ["transform", transformCpu] + ]; + } +} +function handleRotate([, d = "", b]) { + const v = utilities.h.bracket.cssvar.degree(b); + if (v != null) { + if (d) { + return { + "--un-rotate": 0, + [`--un-rotate-${d}`]: v, + "transform": transformCpu + }; + } else { + return { + "--un-rotate-x": 0, + "--un-rotate-y": 0, + "--un-rotate-z": 0, + "--un-rotate": v, + "transform": transformCpu + }; + } + } +} +function handleSkew([, d, b]) { + const v = utilities.h.bracket.cssvar.degree(b); + if (v != null) { + return [ + ...utilities.xyzMap[d].map((i) => [`--un-skew${i}`, v]), + ["transform", transformCpu] + ]; + } +} + +exports.appearances = appearances; +exports.boxShadows = boxShadows; +exports.boxShadowsBase = boxShadowsBase; +exports.breaks = breaks; +exports.contains = contains; +exports.contentVisibility = contentVisibility; +exports.contents = contents; +exports.cursors = cursors; +exports.displays = displays; +exports.fontSmoothings = fontSmoothings; +exports.fontStyles = fontStyles; +exports.pointerEvents = pointerEvents; +exports.resizes = resizes; +exports.ringBase = ringBase; +exports.rings = rings; +exports.textOverflows = textOverflows; +exports.textTransforms = textTransforms; +exports.textWraps = textWraps; +exports.transformBase = transformBase; +exports.transforms = transforms; +exports.userSelects = userSelects; +exports.varEmpty = varEmpty; +exports.whitespaces = whitespaces; diff --git a/.pnpm-store/v3/files/71/fc4528f329f030a664bc1988e541484bf9cfd05d80df13f98b22eb052301eb1719310be4bbfb87fa8ee92e6502810512b4a6283996829d8387fe2303699e8c b/.pnpm-store/v3/files/71/fc4528f329f030a664bc1988e541484bf9cfd05d80df13f98b22eb052301eb1719310be4bbfb87fa8ee92e6502810512b4a6283996829d8387fe2303699e8c new file mode 100644 index 00000000..866a534c --- /dev/null +++ b/.pnpm-store/v3/files/71/fc4528f329f030a664bc1988e541484bf9cfd05d80df13f98b22eb052301eb1719310be4bbfb87fa8ee92e6502810512b4a6283996829d8387fe2303699e8c @@ -0,0 +1,291 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-confusing-void-expression', + meta: { + docs: { + description: 'Require expressions of type void to appear in statement position', + recommended: 'strict', + requiresTypeChecking: true, + }, + messages: { + invalidVoidExpr: 'Placing a void expression inside another expression is forbidden. ' + + 'Move it to its own statement instead.', + invalidVoidExprWrapVoid: 'Void expressions used inside another expression ' + + 'must be moved to its own statement ' + + 'or marked explicitly with the `void` operator.', + invalidVoidExprArrow: 'Returning a void expression from an arrow function shorthand is forbidden. ' + + 'Please add braces to the arrow function.', + invalidVoidExprArrowWrapVoid: 'Void expressions returned from an arrow function shorthand ' + + 'must be marked explicitly with the `void` operator.', + invalidVoidExprReturn: 'Returning a void expression from a function is forbidden. ' + + 'Please move it before the `return` statement.', + invalidVoidExprReturnLast: 'Returning a void expression from a function is forbidden. ' + + 'Please remove the `return` statement.', + invalidVoidExprReturnWrapVoid: 'Void expressions returned from a function ' + + 'must be marked explicitly with the `void` operator.', + voidExprWrapVoid: 'Mark with an explicit `void` operator.', + }, + schema: [ + { + type: 'object', + properties: { + ignoreArrowShorthand: { type: 'boolean' }, + ignoreVoidOperator: { type: 'boolean' }, + }, + additionalProperties: false, + }, + ], + type: 'problem', + fixable: 'code', + hasSuggestions: true, + }, + defaultOptions: [{ ignoreArrowShorthand: false, ignoreVoidOperator: false }], + create(context, [options]) { + return { + 'AwaitExpression, CallExpression, TaggedTemplateExpression'(node) { + const services = (0, util_1.getParserServices)(context); + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + if (!tsutils.isTypeFlagSet(type, ts.TypeFlags.VoidLike)) { + // not a void expression + return; + } + const invalidAncestor = findInvalidAncestor(node); + if (invalidAncestor == null) { + // void expression is in valid position + return; + } + const wrapVoidFix = (fixer) => { + const nodeText = context.sourceCode.getText(node); + const newNodeText = `void ${nodeText}`; + return fixer.replaceText(node, newNodeText); + }; + if (invalidAncestor.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + // handle arrow function shorthand + if (options.ignoreVoidOperator) { + // handle wrapping with `void` + return context.report({ + node, + messageId: 'invalidVoidExprArrowWrapVoid', + fix: wrapVoidFix, + }); + } + // handle wrapping with braces + const arrowFunction = invalidAncestor; + return context.report({ + node, + messageId: 'invalidVoidExprArrow', + fix(fixer) { + if (!canFix(arrowFunction)) { + return null; + } + const arrowBody = arrowFunction.body; + const arrowBodyText = context.sourceCode.getText(arrowBody); + const newArrowBodyText = `{ ${arrowBodyText}; }`; + if ((0, util_1.isParenthesized)(arrowBody, context.sourceCode)) { + const bodyOpeningParen = context.sourceCode.getTokenBefore(arrowBody, util_1.isOpeningParenToken); + const bodyClosingParen = context.sourceCode.getTokenAfter(arrowBody, util_1.isClosingParenToken); + return fixer.replaceTextRange([bodyOpeningParen.range[0], bodyClosingParen.range[1]], newArrowBodyText); + } + return fixer.replaceText(arrowBody, newArrowBodyText); + }, + }); + } + if (invalidAncestor.type === utils_1.AST_NODE_TYPES.ReturnStatement) { + // handle return statement + if (options.ignoreVoidOperator) { + // handle wrapping with `void` + return context.report({ + node, + messageId: 'invalidVoidExprReturnWrapVoid', + fix: wrapVoidFix, + }); + } + const returnStmt = invalidAncestor; + if (isFinalReturn(returnStmt)) { + // remove the `return` keyword + return context.report({ + node, + messageId: 'invalidVoidExprReturnLast', + fix(fixer) { + if (!canFix(returnStmt)) { + return null; + } + const returnValue = returnStmt.argument; + const returnValueText = context.sourceCode.getText(returnValue); + let newReturnStmtText = `${returnValueText};`; + if (isPreventingASI(returnValue)) { + // put a semicolon at the beginning of the line + newReturnStmtText = `;${newReturnStmtText}`; + } + return fixer.replaceText(returnStmt, newReturnStmtText); + }, + }); + } + // move before the `return` keyword + return context.report({ + node, + messageId: 'invalidVoidExprReturn', + fix(fixer) { + const returnValue = returnStmt.argument; + const returnValueText = context.sourceCode.getText(returnValue); + let newReturnStmtText = `${returnValueText}; return;`; + if (isPreventingASI(returnValue)) { + // put a semicolon at the beginning of the line + newReturnStmtText = `;${newReturnStmtText}`; + } + if (returnStmt.parent.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + // e.g. `if (cond) return console.error();` + // add braces if not inside a block + newReturnStmtText = `{ ${newReturnStmtText} }`; + } + return fixer.replaceText(returnStmt, newReturnStmtText); + }, + }); + } + // handle generic case + if (options.ignoreVoidOperator) { + // this would be reported by this rule btw. such irony + return context.report({ + node, + messageId: 'invalidVoidExprWrapVoid', + suggest: [{ messageId: 'voidExprWrapVoid', fix: wrapVoidFix }], + }); + } + context.report({ + node, + messageId: 'invalidVoidExpr', + }); + }, + }; + /** + * Inspects the void expression's ancestors and finds closest invalid one. + * By default anything other than an ExpressionStatement is invalid. + * Parent expressions which can be used for their short-circuiting behavior + * are ignored and their parents are checked instead. + * @param node The void expression node to check. + * @returns Invalid ancestor node if it was found. `null` otherwise. + */ + function findInvalidAncestor(node) { + const parent = (0, util_1.nullThrows)(node.parent, util_1.NullThrowsReasons.MissingParent); + if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression) { + if (node !== parent.expressions[parent.expressions.length - 1]) { + return null; + } + } + if (parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + // e.g. `{ console.log("foo"); }` + // this is always valid + return null; + } + if (parent.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + if (parent.right === node) { + // e.g. `x && console.log(x)` + // this is valid only if the next ancestor is valid + return findInvalidAncestor(parent); + } + } + if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression) { + if (parent.consequent === node || parent.alternate === node) { + // e.g. `cond ? console.log(true) : console.log(false)` + // this is valid only if the next ancestor is valid + return findInvalidAncestor(parent); + } + } + if (parent.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + // e.g. `() => console.log("foo")` + // this is valid with an appropriate option + if (options.ignoreArrowShorthand) { + return null; + } + } + if (parent.type === utils_1.AST_NODE_TYPES.UnaryExpression) { + if (parent.operator === 'void') { + // e.g. `void console.log("foo")` + // this is valid with an appropriate option + if (options.ignoreVoidOperator) { + return null; + } + } + } + if (parent.type === utils_1.AST_NODE_TYPES.ChainExpression) { + // e.g. `console?.log('foo')` + return findInvalidAncestor(parent); + } + // any other parent is invalid + return parent; + } + /** Checks whether the return statement is the last statement in a function body. */ + function isFinalReturn(node) { + // the parent must be a block + const block = (0, util_1.nullThrows)(node.parent, util_1.NullThrowsReasons.MissingParent); + if (block.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + // e.g. `if (cond) return;` (not in a block) + return false; + } + // the block's parent must be a function + const blockParent = (0, util_1.nullThrows)(block.parent, util_1.NullThrowsReasons.MissingParent); + if (![ + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.FunctionExpression, + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + ].includes(blockParent.type)) { + // e.g. `if (cond) { return; }` + // not in a top-level function block + return false; + } + // must be the last child of the block + if (block.body.indexOf(node) < block.body.length - 1) { + // not the last statement in the block + return false; + } + return true; + } + /** + * Checks whether the given node, if placed on its own line, + * would prevent automatic semicolon insertion on the line before. + * + * This happens if the line begins with `(`, `[` or `` ` `` + */ + function isPreventingASI(node) { + const startToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node), util_1.NullThrowsReasons.MissingToken('first token', node.type)); + return ['(', '[', '`'].includes(startToken.value); + } + function canFix(node) { + const services = (0, util_1.getParserServices)(context); + const targetNode = node.type === utils_1.AST_NODE_TYPES.ReturnStatement + ? node.argument + : node.body; + const type = (0, util_1.getConstrainedTypeAtLocation)(services, targetNode); + return tsutils.isTypeFlagSet(type, ts.TypeFlags.VoidLike); + } + }, +}); +//# sourceMappingURL=no-confusing-void-expression.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/72/14451d3dfdd3464aa4adbc9ff3f37e69c3a87395a80b9faa19eb2b92f0485f8aa0afc5bf00829620565704a82cf95ea59bffde41070e490ad635312f3b5830 b/.pnpm-store/v3/files/72/14451d3dfdd3464aa4adbc9ff3f37e69c3a87395a80b9faa19eb2b92f0485f8aa0afc5bf00829620565704a82cf95ea59bffde41070e490ad635312f3b5830 new file mode 100644 index 00000000..77056633 --- /dev/null +++ b/.pnpm-store/v3/files/72/14451d3dfdd3464aa4adbc9ff3f37e69c3a87395a80b9faa19eb2b92f0485f8aa0afc5bf00829620565704a82cf95ea59bffde41070e490ad635312f3b5830 @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.register = void 0; +const shared_1 = require("../shared"); +function register(ctx) { + const { ts } = ctx; + return (uri) => { + const document = ctx.getTextDocument(uri); + if (!document) + return []; + const fileName = ctx.uriToFileName(document.uri); + const outliningSpans = (0, shared_1.safeCall)(() => ctx.languageService.getOutliningSpans(fileName)); + if (!outliningSpans) + return []; + const foldingRanges = []; + for (const outliningSpan of outliningSpans) { + const start = document.positionAt(outliningSpan.textSpan.start); + const end = adjustFoldingEnd(start, document.positionAt(outliningSpan.textSpan.start + outliningSpan.textSpan.length), document); + const foldingRange = { + startLine: start.line, + endLine: end.line, + startCharacter: start.character, + endCharacter: end.character, + kind: transformFoldingRangeKind(outliningSpan.kind), + }; + foldingRanges.push(foldingRange); + } + return foldingRanges; + }; + function transformFoldingRangeKind(tsKind) { + switch (tsKind) { + case ts.OutliningSpanKind.Comment: return 'comment'; + case ts.OutliningSpanKind.Imports: return 'imports'; + case ts.OutliningSpanKind.Region: return 'region'; + } + } +} +exports.register = register; +const foldEndPairCharacters = ['}', ']', ')', '`']; +// https://github.com/microsoft/vscode/blob/bed61166fb604e519e82e4d1d1ed839bc45d65f8/extensions/typescript-language-features/src/languageFeatures/folding.ts#L61-L73 +function adjustFoldingEnd(start, end, document) { + // workaround for #47240 + if (end.character > 0) { + const foldEndCharacter = document.getText({ + start: { line: end.line, character: end.character - 1 }, + end, + }); + if (foldEndPairCharacters.includes(foldEndCharacter)) { + const endOffset = Math.max(document.offsetAt({ line: end.line, character: 0 }) - 1, document.offsetAt(start)); + return document.positionAt(endOffset); + } + } + return end; +} +//# sourceMappingURL=foldingRanges.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/72/452cf46cec1537c8ba84ff02e06fa8bfc245681024b5cbc9f9fa04f4ef26a6f6ad178ef8d4285dc7f5c9678f5697dd3ddb50466b3228667ba1d78b7fd3a391 b/.pnpm-store/v3/files/72/452cf46cec1537c8ba84ff02e06fa8bfc245681024b5cbc9f9fa04f4ef26a6f6ad178ef8d4285dc7f5c9678f5697dd3ddb50466b3228667ba1d78b7fd3a391 new file mode 100644 index 00000000..f082663f --- /dev/null +++ b/.pnpm-store/v3/files/72/452cf46cec1537c8ba84ff02e06fa8bfc245681024b5cbc9f9fa04f4ef26a6f6ad178ef8d4285dc7f5c9678f5697dd3ddb50466b3228667ba1d78b7fd3a391 @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-boolean-literal-compare.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-boolean-literal-compare.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/72/61d1a6e92fc26e08c847cc6fe16b881b89d274ad2f107858f24f26ae8ec017aedd849c791f8bd6c873787786ea6394f43b89b816fe46836438bb8cd2954a1c b/.pnpm-store/v3/files/72/61d1a6e92fc26e08c847cc6fe16b881b89d274ad2f107858f24f26ae8ec017aedd849c791f8bd6c873787786ea6394f43b89b816fe46836438bb8cd2954a1c new file mode 100644 index 00000000..bc0ed508 --- /dev/null +++ b/.pnpm-store/v3/files/72/61d1a6e92fc26e08c847cc6fe16b881b89d274ad2f107858f24f26ae8ec017aedd849c791f8bd6c873787786ea6394f43b89b816fe46836438bb8cd2954a1c @@ -0,0 +1,3 @@ +import type * as ts from 'typescript'; +import { LanguagePlugin } from '@volar/language-core'; +export declare function createAsyncLanguageServicePlugin(extensions: string[], scriptKind: ts.ScriptKind, loadLanguagePlugins: (ts: typeof import('typescript'), info: ts.server.PluginCreateInfo) => Promise): ts.server.PluginModuleFactory; diff --git a/.pnpm-store/v3/files/72/6a66b37176261cc53aef4679430dda7791b6d63e238876f6cc1cb07f1f71126d9176823b8cd463d8f77ebd179e217196a10dc1a5c63867c429c85455ca0607 b/.pnpm-store/v3/files/72/6a66b37176261cc53aef4679430dda7791b6d63e238876f6cc1cb07f1f71126d9176823b8cd463d8f77ebd179e217196a10dc1a5c63867c429c85455ca0607 new file mode 100644 index 00000000..319b8799 --- /dev/null +++ b/.pnpm-store/v3/files/72/6a66b37176261cc53aef4679430dda7791b6d63e238876f6cc1cb07f1f71126d9176823b8cd463d8f77ebd179e217196a10dc1a5c63867c429c85455ca0607 @@ -0,0 +1 @@ +{"version":3,"file":"unified-signatures.js","sourceRoot":"","sources":["../../src/rules/unified-signatures.ts"],"names":[],"mappings":";;AACA,oDAA0D;AAG1D,kCAAqD;AA4DrD,kBAAe,IAAA,iBAAU,EAAsB;IAC7C,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EACT,kGAAkG;YACpG,oCAAoC;YACpC,WAAW,EAAE,QAAQ;SACtB;QACD,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE;YACR,qBAAqB,EAAE,+CAA+C;YACtE,uBAAuB,EACrB,oDAAoD;YACtD,yBAAyB,EACvB,wDAAwD;SAC3D;QACD,MAAM,EAAE;YACN;gBACE,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,gCAAgC,EAAE;wBAChC,WAAW,EACT,gIAAgI;wBAClI,IAAI,EAAE,SAAS;qBAChB;iBACF;gBACD,IAAI,EAAE,QAAQ;aACf;SACF;KACF;IACD,cAAc,EAAE;QACd;YACE,gCAAgC,EAAE,KAAK;SACxC;KACF;IACD,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,gCAAgC,EAAE,CAAC;QACpD,wEAAwE;QACxE,UAAU;QACV,wEAAwE;QAExE,SAAS,kBAAkB,CAAC,SAAkB;YAC5C,wEAAwE;YACxE,MAAM,SAAS,GACb,SAAS,KAAK,SAAS;gBACrB,CAAC,CAAC,iBAAiB;gBACnB,CAAC,CAAC,qCAAqC,SAAS,EAAE,CAAC;YACvD,OAAO,GAAG,SAAS,qCAAqC,CAAC;QAC3D,CAAC;QAED,SAAS,WAAW,CAAC,QAAmB;YACtC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAC/B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;gBACjC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;oBACnB,KAAK,6BAA6B,CAAC,CAAC,CAAC;wBACnC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;wBACzB,MAAM,mBAAmB,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;wBAElE,MAAM,eAAe,GAAG,qBAAqB,CAAC,EAAE,CAAC;4BAC/C,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc;4BAC7B,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC;wBACtB,MAAM,eAAe,GAAG,qBAAqB,CAAC,EAAE,CAAC;4BAC/C,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc;4BAC7B,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC;wBAEtB,OAAO,CAAC,MAAM,CAAC;4BACb,GAAG,EAAE,EAAE,CAAC,GAAG;4BACX,SAAS,EAAE,2BAA2B;4BACtC,IAAI,EAAE;gCACJ,kBAAkB,EAAE,kBAAkB,CAAC,mBAAmB,CAAC;gCAC3D,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAC/B,eAAe,EAAE,cAAc,CAChC;gCACD,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAC/B,eAAe,EAAE,cAAc,CAChC;6BACF;4BACD,IAAI,EAAE,EAAE;yBACT,CAAC,CAAC;wBACH,MAAM;oBACR,CAAC;oBACD,KAAK,iBAAiB,CAAC,CAAC,CAAC;wBACvB,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;wBACjD,MAAM,mBAAmB,GAAG,KAAK;4BAC/B,CAAC,CAAC,SAAS;4BACX,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;wBAElC,OAAO,CAAC,MAAM,CAAC;4BACb,GAAG,EAAE,cAAc,CAAC,GAAG;4BACvB,SAAS,EACP,cAAc,CAAC,IAAI,KAAK,sBAAc,CAAC,WAAW;gCAChD,CAAC,CAAC,uBAAuB;gCACzB,CAAC,CAAC,yBAAyB;4BAC/B,IAAI,EAAE;gCACJ,kBAAkB,EAAE,kBAAkB,CAAC,mBAAmB,CAAC;6BAC5D;4BACD,IAAI,EAAE,cAAc;yBACrB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,SAAS,cAAc,CACrB,UAAqC,EACrC,cAAoD;YAEpD,MAAM,MAAM,GAAc,EAAE,CAAC;YAC7B,MAAM,eAAe,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;YAC3D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;gBACnC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;oBAC9B,MAAM,UAAU,GAAI,CAA+B,CAAC,KAAK,IAAI,CAAC,CAAC;oBAC/D,MAAM,UAAU,GAAI,CAA+B,CAAC,KAAK,IAAI,CAAC,CAAC;oBAE/D,MAAM,KAAK,GAAG,iBAAiB,CAC7B,UAAiC,EACjC,UAAiC,EACjC,eAAe,CAChB,CAAC;oBACF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;wBACxB,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC;oBACxD,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,SAAS,iBAAiB,CACxB,CAAsB,EACtB,CAAsB,EACtB,eAAgC;YAEhC,IAAI,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,CAAC;gBACnD,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,OAAO,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM;gBACxC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;gBACvD,CAAC,CAAC,yCAAyC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtD,CAAC;QAED,SAAS,sBAAsB,CAC7B,CAAsB,EACtB,CAAsB,EACtB,eAAgC;YAEhC,6BAA6B;YAE7B,MAAM,WAAW,GACf,CAAC,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YACvE,MAAM,WAAW,GACf,CAAC,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAEvE,IAAI,gCAAgC,EAAE,CAAC;gBACrC,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC/C,IACE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrC,sBAAsB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;4BACjC,sBAAsB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EACrC,CAAC;wBACD,OAAO,KAAK,CAAC;oBACf,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,CACL,aAAa,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;gBACzC,sCAAsC;gBACtC,+FAA+F;gBAC/F,IAAA,qBAAc,EAAC,WAAW,EAAE,WAAW,EAAE,sBAAsB,CAAC;gBAChE,0BAA0B,CAAC,CAAC,EAAE,eAAe,CAAC;oBAC5C,0BAA0B,CAAC,CAAC,EAAE,eAAe,CAAC,CACjD,CAAC;QACJ,CAAC;QAED,4FAA4F;QAC5F,SAAS,iCAAiC,CACxC,MAAqC,EACrC,MAAqC;YAErC,MAAM,KAAK,GAAG,yBAAyB,CACrC,MAAM,EACN,MAAM,EACN,kBAAkB,CACnB,CAAC;YACF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,kFAAkF;YAClF,IACE,CAAC,IAAA,qBAAc,EACb,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EACvB,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EACvB,kBAAkB,CACnB,EACD,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YACxB,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YACxB,oGAAoG;YACpG,0DAA0D;YAC1D,OAAO,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;gBACpC,CAAC,CAAC,IAAI,KAAK,sBAAc,CAAC,WAAW;gBACrC,CAAC,CAAC,EAAE,IAAI,EAAE,6BAA6B,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE;gBACvD,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC;QAED;;;WAGG;QACH,SAAS,yCAAyC,CAChD,CAAsB,EACtB,CAAsB;YAEtB,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;YACtB,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;YAEtB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACrD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACvD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACxD,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAErD,mFAAmF;YACnF,sEAAsE;YACtE,+BAA+B;YAC/B,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACnD,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACtC,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;YAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;gBACnC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACtB,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACtB,MAAM,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC;oBAClD,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc;oBAChC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;gBACzB,MAAM,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC;oBAClD,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc;oBAChC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;gBAEzB,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,eAAe,CAAC,EAAE,CAAC;oBACrD,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;YAED,IACE,SAAS,GAAG,CAAC;gBACb,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,sBAAc,CAAC,WAAW,EAC1D,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,OAAO;gBACL,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;gBACzC,IAAI,EAAE,iBAAiB;gBACvB,cAAc,EAAE,UAAU;aAC3B,CAAC;QACJ,CAAC;QAED,mGAAmG;QACnG,SAAS,kBAAkB,CACzB,cAAoD;YAEpD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;gBACjC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAoB,CAAC;YAC1C,CAAC;YAED,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;YAC9B,KAAK,MAAM,CAAC,IAAI,cAAc,CAAC,MAAM,EAAE,CAAC;gBACtC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC;YACD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAoB,CAAC;QAC5D,CAAC;QAED,wEAAwE;QACxE,SAAS,0BAA0B,CACjC,GAAwB,EACxB,eAAgC;YAEhC,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAqB,EAAE,EAAE,CAC/C,yBAAyB,CACvB,qBAAqB,CAAC,CAAC,CAAC;gBACtB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc;gBAC5B,CAAC,CAAC,CAAC,CAAC,cAAc,CACrB,CACF,CAAC;YAEF,SAAS,yBAAyB,CAChC,IAAoD;gBAEpD,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO,KAAK,CAAC;gBACf,CAAC;gBAED,IAAI,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,eAAe,EAAE,CAAC;oBACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;oBAC/B,IAAI,YAAY,CAAC,QAAQ,CAAC,IAAI,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;wBAC7D,OAAO,IAAI,CAAC;oBACd,CAAC;gBACH,CAAC;gBAED,OAAO,yBAAyB,CAC7B,IAA2C,CAAC,cAAc;oBACxD,IAA6B,CAAC,WAAW,CAC7C,CAAC;YACJ,CAAC;QACH,CAAC;QAED,SAAS,qBAAqB,CAC5B,IAAmB;YAEnB,OAAO,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,mBAAmB,CAAC;QAC1D,CAAC;QAED,SAAS,kBAAkB,CACzB,CAAqB,EACrB,CAAqB;YAErB,MAAM,eAAe,GAAG,qBAAqB,CAAC,CAAC,CAAC;gBAC9C,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc;gBAC5B,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;YACrB,MAAM,eAAe,GAAG,qBAAqB,CAAC,CAAC,CAAC;gBAC9C,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc;gBAC5B,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;YAErB,OAAO,CACL,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC/B,aAAa,CAAC,eAAe,EAAE,eAAe,CAAC,CAChD,CAAC;QACJ,CAAC;QAED,yCAAyC;QACzC,SAAS,qBAAqB,CAAC,CAAqB;YAClD,MAAM,QAAQ,GAAG,qBAAqB,CAAC,CAAC,CAAC;gBACvC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ;gBACtB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YAEf,OAAO,CAAC,CAAC,IAAI,KAAK,sBAAc,CAAC,WAAW,IAAI,QAAQ,CAAC;QAC3D,CAAC;QAED,oGAAoG;QACpG,SAAS,yBAAyB,CAChC,CAAqB,EACrB,CAAqB;YAErB,MAAM,SAAS,GAAG,qBAAqB,CAAC,CAAC,CAAC;gBACxC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ;gBACtB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YACf,MAAM,SAAS,GAAG,qBAAqB,CAAC,CAAC,CAAC;gBACxC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ;gBACtB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YAEf,OAAO,CACL,CAAC,CAAC,CAAC,IAAI,KAAK,sBAAc,CAAC,WAAW,CAAC;gBACrC,CAAC,CAAC,CAAC,IAAI,KAAK,sBAAc,CAAC,WAAW,CAAC,IAAI,SAAS,KAAK,SAAS,CACrE,CAAC;QACJ,CAAC;QAED,SAAS,sBAAsB,CAC7B,CAA2B,EAC3B,CAA2B;YAE3B,OAAO,CACL,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI;gBAC3B,mBAAmB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,CAChD,CAAC;QACJ,CAAC;QAED,SAAS,aAAa,CACpB,CAAwC,EACxC,CAAwC;YAExC,OAAO,CACL,CAAC,KAAK,CAAC;gBACP,CAAC,CAAC,KAAK,SAAS;oBACd,CAAC,KAAK,SAAS;oBACf,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;wBAC1C,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAClD,CAAC;QACJ,CAAC;QAED,SAAS,mBAAmB,CAC1B,CAAgC,EAChC,CAAgC;YAEhC,OAAO,CACL,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CACrE,CAAC;QACJ,CAAC;QAED,uDAAuD;QACvD,SAAS,yBAAyB,CAChC,CAAe,EACf,CAAe,EACf,KAAe;YAEf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClD,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACvB,OAAO,CAAC,CAAC;gBACX,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,2DAA2D;QAC3D,SAAS,WAAW,CAClB,MAAoB,EACpB,MAA4B;YAE5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACvC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC3C,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC/B,CAAC;YACH,CAAC;QACH,CAAC;QAQD,MAAM,MAAM,GAAY,EAAE,CAAC;QAC3B,IAAI,YAAY,GAAsB;YACpC,SAAS,EAAE,IAAI,GAAG,EAA0B;SAC7C,CAAC;QAEF,SAAS,WAAW,CAClB,MAAiB,EACjB,cAAoD;YAEpD,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC1C,YAAY,GAAG;gBACb,SAAS,EAAE,IAAI,GAAG,EAA0B;gBAC5C,MAAM;gBACN,cAAc;aACf,CAAC;QACJ,CAAC;QAED,SAAS,UAAU;YACjB,MAAM,QAAQ,GAAG,cAAc,CAC7B,KAAK,CAAC,IAAI,CAAC,YAAa,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAC5C,YAAa,CAAC,cAAc,CAC7B,CAAC;YACF,WAAW,CAAC,QAAQ,CAAC,CAAC;YACtB,YAAY,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;QAC9B,CAAC;QAED,SAAS,WAAW,CAClB,SAAuB,EACvB,GAAY,EACZ,cAA+B;YAE/B,GAAG,KAAK,cAAc,CAAC,SAAS,CAAC,CAAC;YAClC,IACE,YAAY;gBACZ,CAAC,cAAc,IAAI,SAAS,CAAC,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM,EAC5D,CAAC;gBACD,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAClD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;oBAC5B,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAC5B,CAAC;qBAAM,CAAC;oBACN,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;gBAC/C,CAAC;YACH,CAAC;QACH,CAAC;QAED,wEAAwE;QACxE,SAAS;QACT,wEAAwE;QAExE,OAAO;YACL,OAAO,EAAE,WAAW;YACpB,aAAa,EAAE,WAAW;YAC1B,sBAAsB,CAAC,IAAI;gBACzB,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YAC9C,CAAC;YACD,gBAAgB,CAAC,IAAI;gBACnB,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YAC9C,CAAC;YACD,aAAa,EAAE,WAAW;YAE1B,oBAAoB;YACpB,iBAAiB,CAAC,IAAI;gBACpB,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBAC7C,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,IAAI,aAAa,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;YACzE,CAAC;YACD,0BAA0B,EAAE,WAAW;YACvC,+BAA+B,EAAE,WAAW;YAC5C,iBAAiB,EAAE,WAAW;YAC9B,0BAA0B,CAAC,IAAI;gBAC7B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;oBACrB,WAAW,CAAC,IAAI,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;YACD,gBAAgB,CAAC,IAAI;gBACnB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;oBACrB,WAAW,CAAC,IAAI,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;YAED,kBAAkB;YAClB,cAAc,EAAE,UAAU;YAC1B,oBAAoB,EAAE,UAAU;YAChC,6BAA6B,EAAE,UAAU;YACzC,uBAAuB,EAAE,UAAU;YACnC,oBAAoB,EAAE,UAAU;SACjC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,gBAAgB,CACvB,IAAgC;IAKhC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,sBAAc,CAAC,sBAAsB;QAC/D,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,sBAAc,CAAC,wBAAwB;QAC5D,CAAC,CAAC,IAAI,CAAC,MAAM;QACb,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,IAAkB;IACxC,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEnC,OAAO,CACL,CAAE,IAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QACjD,CAAE,IAAyB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAC/C,IAAI,CACL,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,IAAkB;IACzC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,sBAAc,CAAC,+BAA+B;YACjD,OAAO,aAAa,CAAC;QACvB,KAAK,sBAAc,CAAC,0BAA0B;YAC5C,OAAO,IAAI,CAAC;QACd,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,EAAE,GAAG,EAAE,GAAG,IAAwB,CAAC;YAEzC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAE,GAAwB,CAAC,GAAG,CAAC;QACtE,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAoB;IAClD,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,sBAAc,CAAC,UAAU;YAC5B,OAAO,KAAK,CAAC,IAAI,CAAC;QACpB,KAAK,sBAAc,CAAC,WAAW;YAC7B,OAAO,sBAAsB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChD;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AACD,SAAS,YAAY,CAAC,IAAmB;IACvC,OAAO,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/72/90101cfb19d2b4af7f6935ee5949d2e55d2bfe9a5bd7b70abfa572a885d126c501d2abce7a482eca5412732b0ecc07457a131adbfc3544b46f281e6f668e4a b/.pnpm-store/v3/files/72/90101cfb19d2b4af7f6935ee5949d2e55d2bfe9a5bd7b70abfa572a885d126c501d2abce7a482eca5412732b0ecc07457a131adbfc3544b46f281e6f668e4a new file mode 100644 index 00000000..55257490 --- /dev/null +++ b/.pnpm-store/v3/files/72/90101cfb19d2b4af7f6935ee5949d2e55d2bfe9a5bd7b70abfa572a885d126c501d2abce7a482eca5412732b0ecc07457a131adbfc3544b46f281e6f668e4a @@ -0,0 +1 @@ +{"version":3,"file":"type-annotation-spacing.js","sourceRoot":"","sources":["../../src/rules/type-annotation-spacing.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/72/a111a3f2554ee76f23428d805e94fb894b96e9dae2a87574001f4d01233fd52ee1894a19489c6a0351261e9d36ed48f024724c11c4cc5d2e7509c77e879ee8 b/.pnpm-store/v3/files/72/a111a3f2554ee76f23428d805e94fb894b96e9dae2a87574001f4d01233fd52ee1894a19489c6a0351261e9d36ed48f024724c11c4cc5d2e7509c77e879ee8 new file mode 100644 index 00000000..77bfa007 --- /dev/null +++ b/.pnpm-store/v3/files/72/a111a3f2554ee76f23428d805e94fb894b96e9dae2a87574001f4d01233fd52ee1894a19489c6a0351261e9d36ed48f024724c11c4cc5d2e7509c77e879ee8 @@ -0,0 +1,8 @@ +'use strict'; + +var hasSymbols = require('has-symbols'); + +/** @type {import('.')} */ +module.exports = function hasToStringTag() { + return hasSymbols() && typeof Symbol.toStringTag === 'symbol'; +}; diff --git a/.pnpm-store/v3/files/72/c1ebcea980d504e2e98165404f85964793c7cffba46eeda8b2b8f29e96dbd1b17ecee11134346239e4c6059ad93e119fd5d8712a15428974c98cf2742a6495 b/.pnpm-store/v3/files/72/c1ebcea980d504e2e98165404f85964793c7cffba46eeda8b2b8f29e96dbd1b17ecee11134346239e4c6059ad93e119fd5d8712a15428974c98cf2742a6495 new file mode 100644 index 00000000..3ba0a2e4 --- /dev/null +++ b/.pnpm-store/v3/files/72/c1ebcea980d504e2e98165404f85964793c7cffba46eeda8b2b8f29e96dbd1b17ecee11134346239e4c6059ad93e119fd5d8712a15428974c98cf2742a6495 @@ -0,0 +1,91 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +const core = require('@unocss/core'); +const extractorArbitraryVariants = require('@unocss/extractor-arbitrary-variants'); +const utilities = require('./shared/preset-mini.UhMMbd34.cjs'); +const _default = require('./shared/preset-mini.fgwIVvur.cjs'); +const _default$1 = require('./shared/preset-mini.qKuB9vcd.cjs'); +const _default$2 = require('./shared/preset-mini.e29ECnbA.cjs'); +const colors = require('./colors.cjs'); +require('@unocss/rule-utils'); +require('./shared/preset-mini.-3Qybdh5.cjs'); + +const preflights = [ + { + layer: "preflights", + getCSS(ctx) { + if (ctx.theme.preflightBase) { + const css = core.entriesToCss(Object.entries(ctx.theme.preflightBase)); + const roots = core.toArray(ctx.theme.preflightRoot ?? ["*,::before,::after", "::backdrop"]); + return roots.map((root) => `${root}{${css}}`).join(""); + } + } + } +]; + +const shorthands = { + position: [ + "relative", + "absolute", + "fixed", + "sticky", + "static" + ], + globalKeyword: utilities.globalKeywords +}; + +const presetMini = core.definePreset((options = {}) => { + options.dark = options.dark ?? "class"; + options.attributifyPseudo = options.attributifyPseudo ?? false; + options.preflight = options.preflight ?? true; + options.variablePrefix = options.variablePrefix ?? "un-"; + return { + name: "@unocss/preset-mini", + theme: _default.theme, + rules: _default$1.rules, + variants: _default$2.variants(options), + options, + prefix: options.prefix, + postprocess: VarPrefixPostprocessor(options.variablePrefix), + preflights: options.preflight ? normalizePreflights(preflights, options.variablePrefix) : [], + extractorDefault: options.arbitraryVariants === false ? void 0 : extractorArbitraryVariants.extractorArbitraryVariants, + autocomplete: { + shorthands + } + }; +}); +function VarPrefixPostprocessor(prefix) { + if (prefix !== "un-") { + return (obj) => { + obj.entries.forEach((i) => { + i[0] = i[0].replace(/^--un-/, `--${prefix}`); + if (typeof i[1] === "string") + i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`); + }); + }; + } +} +function normalizePreflights(preflights3, variablePrefix) { + if (variablePrefix !== "un-") { + return preflights3.map((p) => ({ + ...p, + getCSS: /* @__PURE__ */ (() => async (ctx) => { + const css = await p.getCSS(ctx); + if (css) + return css.replace(/--un-/g, `--${variablePrefix}`); + })() + })); + } + return preflights3; +} + +exports.parseColor = utilities.parseColor; +exports.theme = _default.theme; +exports.colors = colors.colors; +exports.VarPrefixPostprocessor = VarPrefixPostprocessor; +exports.default = presetMini; +exports.normalizePreflights = normalizePreflights; +exports.preflights = preflights; +exports.presetMini = presetMini; diff --git a/.pnpm-store/v3/files/72/d4d2538e8a08bc5c691e77980a1ddb005648421719d5dd7a3a871033d25f7dc7e6b0365fcf73c98129ba4f41395cc81c6f06f2b8205570869c6697c6662b0b-index.json b/.pnpm-store/v3/files/72/d4d2538e8a08bc5c691e77980a1ddb005648421719d5dd7a3a871033d25f7dc7e6b0365fcf73c98129ba4f41395cc81c6f06f2b8205570869c6697c6662b0b-index.json new file mode 100644 index 00000000..0d4f4692 --- /dev/null +++ b/.pnpm-store/v3/files/72/d4d2538e8a08bc5c691e77980a1ddb005648421719d5dd7a3a871033d25f7dc7e6b0365fcf73c98129ba4f41395cc81c6f06f2b8205570869c6697c6662b0b-index.json @@ -0,0 +1 @@ +{"files":{"LICENSE":{"checkedAt":1707939899420,"integrity":"sha512-HpDE4180xLuSZP0lK4Hauoo2709Yc8/sJgc4VsEepTAFy+0HyauHrbOAng5fCAGuWH2MLBfNa9oo85DpERB9+g==","mode":420,"size":1076},"index.js":{"checkedAt":1707939899421,"integrity":"sha512-npkqJB3UhNwugyu0MzXYqLQTpOUq6df+4KFJJwkoeXWRNg8r3r66Nw9PPzjUJjpVhRtiCdjop3ZuMWstmlXx/Q==","mode":420,"size":14400},"package.json":{"checkedAt":1707939899421,"integrity":"sha512-9ocOkVZ2KL9lDKEW2Iyi8rqJBGyJQu9dPvef/wHw9GXkv7u2wGSHQHPdf1RhRPRisJYlgK5roH2iOJInNxnSYg==","mode":420,"size":1025},"README.md":{"checkedAt":1707939899421,"integrity":"sha512-0ga5YyYYaAi+4TOe4V8bvx9e18vWybzcP7p6O43EnFtENRFVcAB3mibKFOwF6khLLq3ys7MASC1NuwVyk5Py2A==","mode":420,"size":389},"index.d.ts":{"checkedAt":1707939899421,"integrity":"sha512-st/2O8x7BdJqc8eIc29Q/T80Sp1e6IKlO6vYgVDG+T9eKOiHdG1DmwdYFrhm8EA+uvsBstkk82R8F+eBYYlh+w==","mode":420,"size":826}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/72/f3659fd5b642cf1e5d9bbf38965727a5259676736c561cd47978b6e50fccec87f6f36b40651ee892749fd0122f28b4ba27b03bab38ba0e691efa8cd0588579 b/.pnpm-store/v3/files/72/f3659fd5b642cf1e5d9bbf38965727a5259676736c561cd47978b6e50fccec87f6f36b40651ee892749fd0122f28b4ba27b03bab38ba0e691efa8cd0588579 new file mode 100644 index 00000000..161f02fb --- /dev/null +++ b/.pnpm-store/v3/files/72/f3659fd5b642cf1e5d9bbf38965727a5259676736c561cd47978b6e50fccec87f6f36b40651ee892749fd0122f28b4ba27b03bab38ba0e691efa8cd0588579 @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $BigInt = GetIntrinsic('%BigInt%', true); +var $TypeError = require('es-errors/type'); + +var zero = $BigInt && $BigInt(0); + +// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-unaryMinus + +module.exports = function BigIntUnaryMinus(x) { + if (typeof x !== 'bigint') { + throw new $TypeError('Assertion failed: `x` argument must be a BigInt'); + } + + if (x === zero) { + return zero; + } + + return -x; +}; diff --git a/.pnpm-store/v3/files/73/1e766b743a05cb7aec90dcd690d7ae4f0c15104734e2811aa1e0b552ef2fcc0f0e59485c975a00f2c9f24412ef3bd2632ea2d9f4fbd600ec82bcbdfa538e88 b/.pnpm-store/v3/files/73/1e766b743a05cb7aec90dcd690d7ae4f0c15104734e2811aa1e0b552ef2fcc0f0e59485c975a00f2c9f24412ef3bd2632ea2d9f4fbd600ec82bcbdfa538e88 new file mode 100644 index 00000000..85469f85 --- /dev/null +++ b/.pnpm-store/v3/files/73/1e766b743a05cb7aec90dcd690d7ae4f0c15104734e2811aa1e0b552ef2fcc0f0e59485c975a00f2c9f24412ef3bd2632ea2d9f4fbd600ec82bcbdfa538e88 @@ -0,0 +1,4 @@ +import type * as vscode from '@volar/language-service'; +import type { SharedContext } from '../types'; +export declare function register(ctx: SharedContext): (uri: string, position: vscode.Position) => vscode.LocationLink[]; +//# sourceMappingURL=definition.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/73/2ddd4a9d38b691447ecde6299eed158ea5bf4d9e2d3d144594c25b996ac69327fd65d12b8de0c3ac6702d28e56e3983783a638ef54778cf66192ebf9162940 b/.pnpm-store/v3/files/73/2ddd4a9d38b691447ecde6299eed158ea5bf4d9e2d3d144594c25b996ac69327fd65d12b8de0c3ac6702d28e56e3983783a638ef54778cf66192ebf9162940 new file mode 100644 index 00000000..b1b5fa5a --- /dev/null +++ b/.pnpm-store/v3/files/73/2ddd4a9d38b691447ecde6299eed158ea5bf4d9e2d3d144594c25b996ac69327fd65d12b8de0c3ac6702d28e56e3983783a638ef54778cf66192ebf9162940 @@ -0,0 +1,14 @@ +export interface AstroInstall { + path: string; + version: { + full: string; + major: number; + minor: number; + patch: number; + }; +} +export declare function getLanguageServerTypesDir(ts: typeof import('typescript')): string; +export declare function getAstroInstall(basePaths: string[], checkForAstro?: { + nearestPackageJson: string | undefined; + readDirectory: typeof import('typescript').sys.readDirectory; +}): AstroInstall | 'not-an-astro-project' | 'not-found'; diff --git a/.pnpm-store/v3/files/73/73c55d8af519e59d1a0dd176d7d653cc687a6d6701ded477010d3cc5c69fa992f6280b254e1af675c5693029a2199c80bb2fd81f0d1c0143f7f2b61e033d28 b/.pnpm-store/v3/files/73/73c55d8af519e59d1a0dd176d7d653cc687a6d6701ded477010d3cc5c69fa992f6280b254e1af675c5693029a2199c80bb2fd81f0d1c0143f7f2b61e033d28 new file mode 100644 index 00000000..5780020f --- /dev/null +++ b/.pnpm-store/v3/files/73/73c55d8af519e59d1a0dd176d7d653cc687a6d6701ded477010d3cc5c69fa992f6280b254e1af675c5693029a2199c80bb2fd81f0d1c0143f7f2b61e033d28 @@ -0,0 +1,32 @@ +{ + "name": "@babel/helpers", + "version": "7.23.9", + "description": "Collection of helper functions used by Babel transforms.", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-helpers", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helpers" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9" + }, + "devDependencies": { + "@babel/generator": "^7.23.6", + "@babel/helper-plugin-test-runner": "^7.22.5", + "@babel/parser": "^7.23.9", + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/.pnpm-store/v3/files/73/b7f867fb282eaf9a847597e408741c7fefbc96812499b71f7cc1e0994bceb3b5aa153dd1ce0a429cc70a560b0345371f56f2beb51e2d1840adebccb32e5841 b/.pnpm-store/v3/files/73/b7f867fb282eaf9a847597e408741c7fefbc96812499b71f7cc1e0994bceb3b5aa153dd1ce0a429cc70a560b0345371f56f2beb51e2d1840adebccb32e5841 new file mode 100644 index 00000000..dbc054ef --- /dev/null +++ b/.pnpm-store/v3/files/73/b7f867fb282eaf9a847597e408741c7fefbc96812499b71f7cc1e0994bceb3b5aa153dd1ce0a429cc70a560b0345371f56f2beb51e2d1840adebccb32e5841 @@ -0,0 +1,55 @@ +'use strict'; + +var $defineProperty = require('../'); + +var test = require('tape'); +var gOPD = require('gopd'); + +test('defineProperty: supported', { skip: !$defineProperty }, function (t) { + t.plan(4); + + t.equal(typeof $defineProperty, 'function', 'defineProperty is supported'); + if ($defineProperty && gOPD) { // this `if` check is just to shut TS up + var o = { a: 1 }; + + $defineProperty(o, 'b', { enumerable: true, value: 2 }); + t.deepEqual( + gOPD(o, 'b'), + { + configurable: false, + enumerable: true, + value: 2, + writable: false + }, + 'property descriptor is as expected' + ); + + $defineProperty(o, 'c', { enumerable: false, value: 3, writable: true }); + t.deepEqual( + gOPD(o, 'c'), + { + configurable: false, + enumerable: false, + value: 3, + writable: true + }, + 'property descriptor is as expected' + ); + } + + t.equal($defineProperty, Object.defineProperty, 'defineProperty is Object.defineProperty'); + + t.end(); +}); + +test('defineProperty: not supported', { skip: !!$defineProperty }, function (t) { + t.notOk($defineProperty, 'defineProperty is not supported'); + + t.match( + typeof $defineProperty, + /^(?:undefined|boolean)$/, + '`typeof defineProperty` is `undefined` or `boolean`' + ); + + t.end(); +}); diff --git a/.pnpm-store/v3/files/73/e18399718a197931530acabf98a25226a3463a65c1e59ba0cc52f6bd3781600d725953623c2f544f6eb3485d6d2da1be2055484a1de44229dfc1bcbbdaa1a8 b/.pnpm-store/v3/files/73/e18399718a197931530acabf98a25226a3463a65c1e59ba0cc52f6bd3781600d725953623c2f544f6eb3485d6d2da1be2055484a1de44229dfc1bcbbdaa1a8 new file mode 100644 index 00000000..bd89d134 --- /dev/null +++ b/.pnpm-store/v3/files/73/e18399718a197931530acabf98a25226a3463a65c1e59ba0cc52f6bd3781600d725953623c2f544f6eb3485d6d2da1be2055484a1de44229dfc1bcbbdaa1a8 @@ -0,0 +1 @@ +{"version":3,"file":"array-type.js","sourceRoot":"","sources":["../../src/rules/array-type.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/73/eee1a37fc6fc8cefad5cac990cb80d1693869e980a536886a2a88638897505beb45dfb5113d8db4e1ffcf218885fcdfe2b618ab1c1c386548e2932a14fb2f2 b/.pnpm-store/v3/files/73/eee1a37fc6fc8cefad5cac990cb80d1693869e980a536886a2a88638897505beb45dfb5113d8db4e1ffcf218885fcdfe2b618ab1c1c386548e2932a14fb2f2 new file mode 100644 index 00000000..9c78d642 --- /dev/null +++ b/.pnpm-store/v3/files/73/eee1a37fc6fc8cefad5cac990cb80d1693869e980a536886a2a88638897505beb45dfb5113d8db4e1ffcf218885fcdfe2b618ab1c1c386548e2932a14fb2f2 @@ -0,0 +1,81 @@ +{ + "name": "@typescript-eslint/type-utils", + "version": "7.0.1", + "description": "Type utilities for working with TypeScript + ESLint together", + "files": [ + "dist", + "_ts4.3", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/type-utils" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage", + "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", + "lint": "npx nx lint", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.0.1", + "@typescript-eslint/utils": "7.0.1", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "devDependencies": { + "@typescript-eslint/parser": "7.0.1", + "ajv": "^6.10.0", + "downlevel-dts": "*", + "jest": "29.7.0", + "prettier": "^3.0.3", + "rimraf": "*", + "typescript": "*" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<4.7": { + "*": [ + "_ts4.3/*" + ] + } + } +} diff --git a/.pnpm-store/v3/files/74/391a89ec2d3383f1386a792c952c6dbbb291b659e23df5767c54ff87297769b01ebd08a8b653c079570be38053868a0b57c986651e219e7b8df9fa1d8023ce b/.pnpm-store/v3/files/74/391a89ec2d3383f1386a792c952c6dbbb291b659e23df5767c54ff87297769b01ebd08a8b653c079570be38053868a0b57c986651e219e7b8df9fa1d8023ce new file mode 100644 index 00000000..0ffde477 --- /dev/null +++ b/.pnpm-store/v3/files/74/391a89ec2d3383f1386a792c952c6dbbb291b659e23df5767c54ff87297769b01ebd08a8b653c079570be38053868a0b57c986651e219e7b8df9fa1d8023ce @@ -0,0 +1,4 @@ +import type * as vscode from 'vscode-languageserver-protocol'; +import type { SharedContext } from '../types'; +export declare function register(ctx: SharedContext): (uri: string, position: vscode.Position) => vscode.LocationLink[]; +//# sourceMappingURL=implementation.d.ts.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/74/4fa82aebcd31bb634bb36efcfa9138be40a12e96cf3329726663323cfd8e5df93636cec9c941a720e873f35f605c302909b8904b8d2dac26cc65a8afab7d79 b/.pnpm-store/v3/files/74/4fa82aebcd31bb634bb36efcfa9138be40a12e96cf3329726663323cfd8e5df93636cec9c941a720e873f35f605c302909b8904b8d2dac26cc65a8afab7d79 new file mode 100644 index 00000000..c6611444 --- /dev/null +++ b/.pnpm-store/v3/files/74/4fa82aebcd31bb634bb36efcfa9138be40a12e96cf3329726663323cfd8e5df93636cec9c941a720e873f35f605c302909b8904b8d2dac26cc65a8afab7d79 @@ -0,0 +1,22 @@ +{ + "name": "@rollup/rollup-linux-x64-musl", + "version": "4.10.0", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "files": [ + "rollup.linux-x64-musl.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "libc": [ + "musl" + ], + "main": "./rollup.linux-x64-musl.node" +} \ No newline at end of file diff --git a/.pnpm-store/v3/files/74/5932a89b386c3f5696c0908cbc8be6ab69e16461cc4678c1d39739bac8bb90981e005bd93f97a43c8ddffaaea30d3b81e9d642338e6a82223960b83dead9a8 b/.pnpm-store/v3/files/74/5932a89b386c3f5696c0908cbc8be6ab69e16461cc4678c1d39739bac8bb90981e005bd93f97a43c8ddffaaea30d3b81e9d642338e6a82223960b83dead9a8 new file mode 100644 index 00000000..a368f166 --- /dev/null +++ b/.pnpm-store/v3/files/74/5932a89b386c3f5696c0908cbc8be6ab69e16461cc4678c1d39739bac8bb90981e005bd93f97a43c8ddffaaea30d3b81e9d642338e6a82223960b83dead9a8 @@ -0,0 +1,69 @@ +import Container, { ContainerProps } from './container.js' +import { ProcessOptions } from './postcss.js' +import Result from './result.js' +import Root from './root.js' + +declare namespace Document { + export interface DocumentProps extends ContainerProps { + nodes?: Root[] + + /** + * Information to generate byte-to-byte equal node string as it was + * in the origin input. + * + * Every parser saves its own properties. + */ + raws?: Record + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Document_ as default } +} + +/** + * Represents a file and contains all its parsed nodes. + * + * **Experimental:** some aspects of this node could change within minor + * or patch version releases. + * + * ```js + * const document = htmlParser( + * '' + * ) + * document.type //=> 'document' + * document.nodes.length //=> 2 + * ``` + */ +declare class Document_ extends Container { + nodes: Root[] + parent: undefined + type: 'document' + + constructor(defaults?: Document.DocumentProps) + + assign(overrides: Document.DocumentProps | object): this + clone(overrides?: Partial): Document + cloneAfter(overrides?: Partial): Document + cloneBefore(overrides?: Partial): Document + + /** + * Returns a `Result` instance representing the document’s CSS roots. + * + * ```js + * const root1 = postcss.parse(css1, { from: 'a.css' }) + * const root2 = postcss.parse(css2, { from: 'b.css' }) + * const document = postcss.document() + * document.append(root1) + * document.append(root2) + * const result = document.toResult({ to: 'all.css', map: true }) + * ``` + * + * @param opts Options. + * @return Result with current document’s CSS. + */ + toResult(options?: ProcessOptions): Result +} + +declare class Document extends Document_ {} + +export = Document diff --git a/.pnpm-store/v3/files/74/60ea954a0eae018022aa8bda1d9ccae9737dee637b753427a9eb72a8671d7161901f530f105d3d8890bb875259ce8fd364f14d1f71377fa027eda1cd41ba05 b/.pnpm-store/v3/files/74/60ea954a0eae018022aa8bda1d9ccae9737dee637b753427a9eb72a8671d7161901f530f105d3d8890bb875259ce8fd364f14d1f71377fa027eda1cd41ba05 new file mode 100644 index 00000000..e752610d --- /dev/null +++ b/.pnpm-store/v3/files/74/60ea954a0eae018022aa8bda1d9ccae9737dee637b753427a9eb72a8671d7161901f530f105d3d8890bb875259ce8fd364f14d1f71377fa027eda1cd41ba05 @@ -0,0 +1,413 @@ +"use strict"; +/** + * Note this file is rather type-unsafe in its current state. + * This is due to some really funky type conversions between different node types. + * This is done intentionally based on the internal implementation of the base indent rule. + */ +/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */ +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('indent'); +const KNOWN_NODES = new Set([ + // Class properties aren't yet supported by eslint... + utils_1.AST_NODE_TYPES.PropertyDefinition, + // ts keywords + utils_1.AST_NODE_TYPES.TSAbstractKeyword, + utils_1.AST_NODE_TYPES.TSAnyKeyword, + utils_1.AST_NODE_TYPES.TSBooleanKeyword, + utils_1.AST_NODE_TYPES.TSNeverKeyword, + utils_1.AST_NODE_TYPES.TSNumberKeyword, + utils_1.AST_NODE_TYPES.TSStringKeyword, + utils_1.AST_NODE_TYPES.TSSymbolKeyword, + utils_1.AST_NODE_TYPES.TSUndefinedKeyword, + utils_1.AST_NODE_TYPES.TSUnknownKeyword, + utils_1.AST_NODE_TYPES.TSVoidKeyword, + utils_1.AST_NODE_TYPES.TSNullKeyword, + // ts specific nodes we want to support + utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition, + utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition, + utils_1.AST_NODE_TYPES.TSArrayType, + utils_1.AST_NODE_TYPES.TSAsExpression, + utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSConditionalType, + utils_1.AST_NODE_TYPES.TSConstructorType, + utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSDeclareFunction, + utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + utils_1.AST_NODE_TYPES.TSEnumDeclaration, + utils_1.AST_NODE_TYPES.TSEnumMember, + utils_1.AST_NODE_TYPES.TSExportAssignment, + utils_1.AST_NODE_TYPES.TSExternalModuleReference, + utils_1.AST_NODE_TYPES.TSFunctionType, + utils_1.AST_NODE_TYPES.TSImportType, + utils_1.AST_NODE_TYPES.TSIndexedAccessType, + utils_1.AST_NODE_TYPES.TSIndexSignature, + utils_1.AST_NODE_TYPES.TSInferType, + utils_1.AST_NODE_TYPES.TSInterfaceBody, + utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + utils_1.AST_NODE_TYPES.TSInterfaceHeritage, + utils_1.AST_NODE_TYPES.TSIntersectionType, + utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration, + utils_1.AST_NODE_TYPES.TSLiteralType, + utils_1.AST_NODE_TYPES.TSMappedType, + utils_1.AST_NODE_TYPES.TSMethodSignature, + 'TSMinusToken', + utils_1.AST_NODE_TYPES.TSModuleBlock, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + utils_1.AST_NODE_TYPES.TSNonNullExpression, + utils_1.AST_NODE_TYPES.TSParameterProperty, + 'TSPlusToken', + utils_1.AST_NODE_TYPES.TSPropertySignature, + utils_1.AST_NODE_TYPES.TSQualifiedName, + 'TSQuestionToken', + utils_1.AST_NODE_TYPES.TSRestType, + utils_1.AST_NODE_TYPES.TSThisType, + utils_1.AST_NODE_TYPES.TSTupleType, + utils_1.AST_NODE_TYPES.TSTypeAnnotation, + utils_1.AST_NODE_TYPES.TSTypeLiteral, + utils_1.AST_NODE_TYPES.TSTypeOperator, + utils_1.AST_NODE_TYPES.TSTypeParameter, + utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration, + utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation, + utils_1.AST_NODE_TYPES.TSTypeReference, + utils_1.AST_NODE_TYPES.TSUnionType, + utils_1.AST_NODE_TYPES.Decorator, +]); +exports.default = (0, util_1.createRule)({ + name: 'indent', + meta: { + deprecated: true, + replacedBy: ['@stylistic/ts/indent'], + type: 'layout', + docs: { + description: 'Enforce consistent indentation', + // too opinionated to be recommended + extendsBaseRule: true, + }, + fixable: 'whitespace', + hasSuggestions: baseRule.meta.hasSuggestions, + schema: baseRule.meta.schema, + messages: baseRule.meta.messages, + }, + defaultOptions: [ + // typescript docs and playground use 4 space indent + 4, + { + // typescript docs indent the case from the switch + // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#example-4 + SwitchCase: 1, + flatTernaryExpressions: false, + ignoredNodes: [], + }, + ], + create(context, optionsWithDefaults) { + // because we extend the base rule, have to update opts on the context + // the context defines options as readonly though... + const contextWithDefaults = Object.create(context, { + options: { + writable: false, + configurable: false, + value: optionsWithDefaults, + }, + }); + const rules = baseRule.create(contextWithDefaults); + /** + * Converts from a TSPropertySignature to a Property + * @param node a TSPropertySignature node + * @param [type] the type to give the new node + * @returns a Property node + */ + function TSPropertySignatureToProperty(node, type = utils_1.AST_NODE_TYPES.Property) { + const base = { + // indent doesn't actually use these + key: null, + value: null, + // Property flags + computed: false, + method: false, + kind: 'init', + // this will stop eslint from interrogating the type literal + shorthand: true, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }; + if (type === utils_1.AST_NODE_TYPES.Property) { + return { + type, + ...base, + }; + } + return { + type, + accessibility: undefined, + declare: false, + decorators: [], + definite: false, + optional: false, + override: false, + readonly: false, + static: false, + typeAnnotation: undefined, + ...base, + }; + } + return Object.assign({}, rules, { + // overwrite the base rule here so we can use our KNOWN_NODES list instead + '*:exit'(node) { + // For nodes we care about, skip the default handling, because it just marks the node as ignored... + if (!KNOWN_NODES.has(node.type)) { + rules['*:exit'](node); + } + }, + VariableDeclaration(node) { + // https://github.com/typescript-eslint/typescript-eslint/issues/441 + if (node.declarations.length === 0) { + return; + } + return rules.VariableDeclaration(node); + }, + TSAsExpression(node) { + // transform it to a BinaryExpression + return rules['BinaryExpression, LogicalExpression']({ + type: utils_1.AST_NODE_TYPES.BinaryExpression, + operator: 'as', + left: node.expression, + // the first typeAnnotation includes the as token + right: node.typeAnnotation, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSConditionalType(node) { + // transform it to a ConditionalExpression + return rules.ConditionalExpression({ + type: utils_1.AST_NODE_TYPES.ConditionalExpression, + test: { + parent: node, + type: utils_1.AST_NODE_TYPES.BinaryExpression, + operator: 'extends', + left: node.checkType, + right: node.extendsType, + // location data + range: [node.checkType.range[0], node.extendsType.range[1]], + loc: { + start: node.checkType.loc.start, + end: node.extendsType.loc.end, + }, + }, + consequent: node.trueType, + alternate: node.falseType, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + 'TSEnumDeclaration, TSTypeLiteral'(node) { + // transform it to an ObjectExpression + return rules['ObjectExpression, ObjectPattern']({ + type: utils_1.AST_NODE_TYPES.ObjectExpression, + properties: node.members.map(member => TSPropertySignatureToProperty(member)), + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSImportEqualsDeclaration(node) { + // transform it to an VariableDeclaration + // use VariableDeclaration instead of ImportDeclaration because it's essentially the same thing + const { id, moduleReference } = node; + return rules.VariableDeclaration({ + type: utils_1.AST_NODE_TYPES.VariableDeclaration, + kind: 'const', + declarations: [ + { + type: utils_1.AST_NODE_TYPES.VariableDeclarator, + range: [id.range[0], moduleReference.range[1]], + loc: { + start: id.loc.start, + end: moduleReference.loc.end, + }, + id: id, + init: { + type: utils_1.AST_NODE_TYPES.CallExpression, + callee: { + type: utils_1.AST_NODE_TYPES.Identifier, + name: 'require', + range: [ + moduleReference.range[0], + moduleReference.range[0] + 'require'.length, + ], + loc: { + start: moduleReference.loc.start, + end: { + line: moduleReference.loc.end.line, + column: moduleReference.loc.start.line + 'require'.length, + }, + }, + }, + arguments: 'expression' in moduleReference + ? [moduleReference.expression] + : [], + // location data + range: moduleReference.range, + loc: moduleReference.loc, + }, + }, + ], + declare: false, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSIndexedAccessType(node) { + // convert to a MemberExpression + return rules['MemberExpression, JSXMemberExpression, MetaProperty']({ + type: utils_1.AST_NODE_TYPES.MemberExpression, + object: node.objectType, + property: node.indexType, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + optional: false, + computed: true, + }); + }, + TSInterfaceBody(node) { + // transform it to an ClassBody + return rules['BlockStatement, ClassBody']({ + type: utils_1.AST_NODE_TYPES.ClassBody, + body: node.body.map(p => TSPropertySignatureToProperty(p, utils_1.AST_NODE_TYPES.PropertyDefinition)), + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + 'TSInterfaceDeclaration[extends.length > 0]'(node) { + // transform it to a ClassDeclaration + return rules['ClassDeclaration[superClass], ClassExpression[superClass]']({ + type: utils_1.AST_NODE_TYPES.ClassDeclaration, + body: node.body, + id: null, + // TODO: This is invalid, there can be more than one extends in interface + superClass: node.extends[0].expression, + abstract: false, + declare: false, + decorators: [], + implements: [], + superTypeArguments: undefined, + superTypeParameters: undefined, + typeParameters: undefined, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSMappedType(node) { + const squareBracketStart = context.sourceCode.getTokenBefore(node.typeParameter); + // transform it to an ObjectExpression + return rules['ObjectExpression, ObjectPattern']({ + type: utils_1.AST_NODE_TYPES.ObjectExpression, + properties: [ + { + parent: node, + type: utils_1.AST_NODE_TYPES.Property, + key: node.typeParameter, + value: node.typeAnnotation, + // location data + range: [ + squareBracketStart.range[0], + node.typeAnnotation + ? node.typeAnnotation.range[1] + : squareBracketStart.range[0], + ], + loc: { + start: squareBracketStart.loc.start, + end: node.typeAnnotation + ? node.typeAnnotation.loc.end + : squareBracketStart.loc.end, + }, + kind: 'init', + computed: false, + method: false, + optional: false, + shorthand: false, + }, + ], + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSModuleBlock(node) { + // transform it to a BlockStatement + return rules['BlockStatement, ClassBody']({ + type: utils_1.AST_NODE_TYPES.BlockStatement, + body: node.body, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSQualifiedName(node) { + return rules['MemberExpression, JSXMemberExpression, MetaProperty']({ + type: utils_1.AST_NODE_TYPES.MemberExpression, + object: node.left, + property: node.right, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + optional: false, + computed: false, + }); + }, + TSTupleType(node) { + // transform it to an ArrayExpression + return rules['ArrayExpression, ArrayPattern']({ + type: utils_1.AST_NODE_TYPES.ArrayExpression, + elements: node.elementTypes, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSTypeParameterDeclaration(node) { + if (!node.params.length) { + return; + } + const [name, ...attributes] = node.params; + // JSX is about the closest we can get because the angle brackets + // it's not perfect but it works! + return rules.JSXOpeningElement({ + type: utils_1.AST_NODE_TYPES.JSXOpeningElement, + selfClosing: false, + name: name, + attributes: attributes, + typeArguments: undefined, + typeParameters: undefined, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + }); + }, +}); +//# sourceMappingURL=indent.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/74/610dba895a5a0c2155ab531437e710d7445b9c0be864496995b11c53ca1e0da054e55fc6980ee9a8809663432a970ff7fad1089cd4037aa027c84a184609f1 b/.pnpm-store/v3/files/74/610dba895a5a0c2155ab531437e710d7445b9c0be864496995b11c53ca1e0da054e55fc6980ee9a8809663432a970ff7fad1089cd4037aa027c84a184609f1 new file mode 100644 index 00000000..45b6379f --- /dev/null +++ b/.pnpm-store/v3/files/74/610dba895a5a0c2155ab531437e710d7445b9c0be864496995b11c53ca1e0da054e55fc6980ee9a8809663432a970ff7fad1089cd4037aa027c84a184609f1 @@ -0,0 +1,16 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var isPropertyDescriptor = require('../helpers/records/property-descriptor'); +var fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor'); + +// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc !== 'undefined' && !isPropertyDescriptor(Desc)) { + throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor'); + } + + return fromPropertyDescriptor(Desc); +}; diff --git a/.pnpm-store/v3/files/74/784befb35cdb43d49a79668eeab69653fd6bb437086fce1d6b135c8cac75151f9abe165cbf409b08f936e4c7c2a3b53ea30751cf5e81c828c775eceeb836e1 b/.pnpm-store/v3/files/74/784befb35cdb43d49a79668eeab69653fd6bb437086fce1d6b135c8cac75151f9abe165cbf409b08f936e4c7c2a3b53ea30751cf5e81c828c775eceeb836e1 new file mode 100644 index 00000000..c368253c --- /dev/null +++ b/.pnpm-store/v3/files/74/784befb35cdb43d49a79668eeab69653fd6bb437086fce1d6b135c8cac75151f9abe165cbf409b08f936e4c7c2a3b53ea30751cf5e81c828c775eceeb836e1 @@ -0,0 +1,29 @@ +'use strict'; + +var callBound = require('call-bind/callBound'); + +var $TypeError = require('es-errors/type'); + +var StringToCodePoints = require('./StringToCodePoints'); + +var isInteger = require('../helpers/isInteger'); + +var $indexOf = callBound('String.prototype.indexOf'); + +// https://262.ecma-international.org/13.0/#sec-getstringindex + +module.exports = function GetStringIndex(S, e) { + if (typeof S !== 'string') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!isInteger(e) || e < 0) { + throw new $TypeError('Assertion failed: `e` must be a non-negative integer'); + } + + if (S === '') { + return 0; + } + var codepoints = StringToCodePoints(S); + var eUTF = e >= codepoints.length ? S.length : $indexOf(S, codepoints[e]); + return eUTF; +}; diff --git a/.pnpm-store/v3/files/74/817219a451cb33e9616419b1147f8e74f46f9f1eb8fc01e16c777ef2007e18e7c7cf3d22e4f8f591bad995c394e293cb79a9fb383123c95255c0d0d91767fc b/.pnpm-store/v3/files/74/817219a451cb33e9616419b1147f8e74f46f9f1eb8fc01e16c777ef2007e18e7c7cf3d22e4f8f591bad995c394e293cb79a9fb383123c95255c0d0d91767fc new file mode 100644 index 00000000..512f92e3 --- /dev/null +++ b/.pnpm-store/v3/files/74/817219a451cb33e9616419b1147f8e74f46f9f1eb8fc01e16c777ef2007e18e7c7cf3d22e4f8f591bad995c394e293cb79a9fb383123c95255c0d0d91767fc @@ -0,0 +1,44 @@ +'use strict'; + +var callBound = require('call-bind/callBound'); + +var $TypeError = require('es-errors/type'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var LengthOfArrayLike = require('./LengthOfArrayLike'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var defaultElementTypes = ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'BigInt', 'Object']; + +// https://262.ecma-international.org/11.0/#sec-createlistfromarraylike + +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : defaultElementTypes; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = LengthOfArrayLike(obj); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/.pnpm-store/v3/files/74/8bd1d298ddf671a2844e8ebb7266045459546cc4a36ee34c8b18155279087d7a47fb7287d2765cc239933c0388af450f1a059518890c7bc727a498f8fa66d1 b/.pnpm-store/v3/files/74/8bd1d298ddf671a2844e8ebb7266045459546cc4a36ee34c8b18155279087d7a47fb7287d2765cc239933c0388af450f1a059518890c7bc727a498f8fa66d1 new file mode 100644 index 00000000..51098ed4 --- /dev/null +++ b/.pnpm-store/v3/files/74/8bd1d298ddf671a2844e8ebb7266045459546cc4a36ee34c8b18155279087d7a47fb7287d2765cc239933c0388af450f1a059518890c7bc727a498f8fa66d1 @@ -0,0 +1 @@ +{"version":3,"file":"SourceCode.js","sourceRoot":"","sources":["../../src/ts-eslint/SourceCode.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,mCAAwD;AAqcxD,MAAM,UAAW,SAAS,mBAA0C;CAAG;AAE9D,gCAAU"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/74/a47cca82dcc3e1094168aa7ef5c9d145be803f492b3576cfa1916a03b1764db5c0295b3d478fff5b4ae52a25a2368e928d50224603029302333c2723752f69 b/.pnpm-store/v3/files/74/a47cca82dcc3e1094168aa7ef5c9d145be803f492b3576cfa1916a03b1764db5c0295b3d478fff5b4ae52a25a2368e928d50224603029302333c2723752f69 new file mode 100644 index 00000000..384a81aa --- /dev/null +++ b/.pnpm-store/v3/files/74/a47cca82dcc3e1094168aa7ef5c9d145be803f492b3576cfa1916a03b1764db5c0295b3d478fff5b4ae52a25a2368e928d50224603029302333c2723752f69 @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); +var $Promise = GetIntrinsic('%Promise%', true); + +var callBound = require('call-bind/callBound'); + +var CreateIterResultObject = require('./CreateIterResultObject'); +var IteratorComplete = require('./IteratorComplete'); +var IteratorValue = require('./IteratorValue'); +var PromiseResolve = require('./PromiseResolve'); +var Type = require('./Type'); + +var $then = callBound('Promise.prototype.then', true); + +// https://262.ecma-international.org/10.0/#sec-asyncfromsynciteratorcontinuation + +module.exports = function AsyncFromSyncIteratorContinuation(result) { + if (Type(result) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (arguments.length > 1) { + throw new $SyntaxError('although AsyncFromSyncIteratorContinuation should take a second argument, it is not used in this implementation'); + } + + if (!$Promise) { + throw new $SyntaxError('This environment does not support Promises.'); + } + + return new Promise(function (resolve) { + var done = IteratorComplete(result); // step 2 + var value = IteratorValue(result); // step 4 + var valueWrapper = PromiseResolve($Promise, value); // step 6 + + // eslint-disable-next-line no-shadow + var onFulfilled = function (value) { // steps 8-9 + return CreateIterResultObject(value, done); // step 8.a + }; + resolve($then(valueWrapper, onFulfilled)); // step 11 + }); // step 12 +}; diff --git a/.pnpm-store/v3/files/74/ef690de530ff1406cf771bb587f2bc4fcbda956f0387eea6098472346c9c9ed18411d90a9d933bb88cc8680bccd1fa1ccaa3925f958e3bf33cb31862a45c1a b/.pnpm-store/v3/files/74/ef690de530ff1406cf771bb587f2bc4fcbda956f0387eea6098472346c9c9ed18411d90a9d933bb88cc8680bccd1fa1ccaa3925f958e3bf33cb31862a45c1a new file mode 100644 index 00000000..dae0aea2 --- /dev/null +++ b/.pnpm-store/v3/files/74/ef690de530ff1406cf771bb587f2bc4fcbda956f0387eea6098472346c9c9ed18411d90a9d933bb88cc8680bccd1fa1ccaa3925f958e3bf33cb31862a45c1a @@ -0,0 +1,2675 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name2 in all) + __defProp(target, name2, { get: all[name2], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + AST: () => ast_exports, + ParseError: () => ParseError, + VisitorKeys: () => VisitorKeys, + meta: () => meta_exports, + name: () => name, + parseForESLint: () => parseForESLint2, + parseTemplate: () => parseTemplate2, + traverseNodes: () => traverseNodes +}); +module.exports = __toCommonJS(src_exports); + +// src/visitor-keys.ts +var import_eslint_visitor_keys = require("eslint-visitor-keys"); +var astroKeys = { + Program: ["body"], + AstroFragment: ["children"], + AstroHTMLComment: [], + AstroDoctype: [], + AstroShorthandAttribute: ["name", "value"], + AstroTemplateLiteralAttribute: ["name", "value"], + AstroRawText: [] +}; +var KEYS = (0, import_eslint_visitor_keys.unionWith)( + astroKeys +); + +// src/parser/index.ts +var import_types2 = require("@typescript-eslint/types"); + +// src/debug.ts +var import_debug = __toESM(require("debug")); +var debug = (0, import_debug.default)("astro-eslint-parser"); + +// src/parser/ts-patch.ts +var import_module = require("module"); +var import_path3 = __toESM(require("path")); +var import_fs2 = __toESM(require("fs")); +var import_semver = require("semver"); + +// src/parser/ts-for-v5/get-project-config-files.ts +var import_fs = __toESM(require("fs")); +var import_path = __toESM(require("path")); +function getProjectConfigFiles(options) { + const tsconfigRootDir = typeof options.tsconfigRootDir === "string" ? options.tsconfigRootDir : process.cwd(); + if (options.project !== true) { + return Array.isArray(options.project) ? options.project : [options.project]; + } + let directory = import_path.default.dirname(options.filePath); + const checkedDirectories = [directory]; + do { + const tsconfigPath = import_path.default.join(directory, "tsconfig.json"); + if (import_fs.default.existsSync(tsconfigPath)) { + return [tsconfigPath]; + } + directory = import_path.default.dirname(directory); + checkedDirectories.push(directory); + } while (directory.length > 1 && directory.length >= tsconfigRootDir.length); + throw new Error( + `project was set to \`true\` but couldn't find any tsconfig.json relative to '${options.filePath}' within '${tsconfigRootDir}'.` + ); +} + +// src/parser/ts-for-v5/programs.ts +var import_path2 = __toESM(require("path")); +var tsServices = /* @__PURE__ */ new Map(); +function getTSProgram(code, options, ts) { + const tsconfigPath = options.project; + let service2 = tsServices.get(tsconfigPath); + if (!service2) { + service2 = new TSService(tsconfigPath, ts); + tsServices.set(tsconfigPath, service2); + } + return service2.getProgram(code, options.filePath); +} +var TSService = class { + constructor(tsconfigPath, ts) { + this.patchedHostSet = /* @__PURE__ */ new WeakSet(); + this.currTarget = { + code: "", + filePath: "" + }; + this.fileWatchCallbacks = /* @__PURE__ */ new Map(); + this.ts = ts; + this.watch = this.createWatch(tsconfigPath); + } + getProgram(code, filePath) { + const normalized = normalizeFileName(this.ts, filePath); + const lastTarget = this.currTarget; + this.currTarget = { + code, + filePath: normalized + }; + for (const { filePath: targetPath } of [this.currTarget, lastTarget]) { + if (!targetPath) + continue; + this.fileWatchCallbacks.get(targetPath)?.update(); + } + const program = this.watch.getProgram().getProgram(); + program.getTypeChecker(); + return program; + } + createWatch(tsconfigPath) { + const { ts } = this; + const createAbstractBuilder = (...args) => { + const [ + rootNames, + options, + argHost, + oldProgram, + configFileParsingDiagnostics, + projectReferences + ] = args; + const host = argHost; + if (!this.patchedHostSet.has(host)) { + this.patchedHostSet.add(host); + const getTargetSourceFile = (fileName, languageVersionOrOptions) => { + var _a; + if (this.currTarget.filePath === normalizeFileName(ts, fileName)) { + return (_a = this.currTarget).sourceFile ?? (_a.sourceFile = ts.createSourceFile( + this.currTarget.filePath, + this.currTarget.code, + languageVersionOrOptions, + true, + ts.ScriptKind.TSX + )); + } + return null; + }; + const original2 = { + getSourceFile: host.getSourceFile, + getSourceFileByPath: host.getSourceFileByPath + }; + host.getSourceFile = (fileName, languageVersionOrOptions, ...args2) => { + const originalSourceFile = original2.getSourceFile.call( + host, + fileName, + languageVersionOrOptions, + ...args2 + ); + return getTargetSourceFile(fileName, languageVersionOrOptions) ?? originalSourceFile; + }; + host.getSourceFileByPath = (fileName, path6, languageVersionOrOptions, ...args2) => { + const originalSourceFile = original2.getSourceFileByPath.call( + host, + fileName, + path6, + languageVersionOrOptions, + ...args2 + ); + return getTargetSourceFile(fileName, languageVersionOrOptions) ?? originalSourceFile; + }; + } + return ts.createAbstractBuilder( + rootNames, + options, + host, + oldProgram, + configFileParsingDiagnostics, + projectReferences + ); + }; + const watchCompilerHost = ts.createWatchCompilerHost( + tsconfigPath, + { + noEmit: true, + jsx: ts.JsxEmit.Preserve, + // This option is required if `includes` only includes `*.astro` files. + // However, the option is not in the documentation. + // https://github.com/microsoft/TypeScript/issues/28447 + allowNonTsExtensions: true + }, + ts.sys, + createAbstractBuilder, + (diagnostic) => { + throw new Error(formatDiagnostics(ts, [diagnostic])); + }, + () => { + }, + void 0, + [ + { + extension: ".astro", + isMixedContent: true, + scriptKind: ts.ScriptKind.Deferred + } + ] + ); + const original = { + readFile: watchCompilerHost.readFile + }; + watchCompilerHost.readFile = (fileName, ...args) => { + const normalized = normalizeFileName(ts, fileName); + if (this.currTarget.filePath === normalized) { + return this.currTarget.code; + } + return original.readFile.call(watchCompilerHost, fileName, ...args); + }; + watchCompilerHost.watchFile = (fileName, callback) => { + const normalized = normalizeFileName(ts, fileName); + this.fileWatchCallbacks.set(normalized, { + update: () => callback(fileName, ts.FileWatcherEventKind.Changed) + }); + return { + close: () => { + this.fileWatchCallbacks.delete(normalized); + } + }; + }; + watchCompilerHost.watchDirectory = () => { + return { + close: () => { + } + }; + }; + watchCompilerHost.afterProgramCreate = (program) => { + const originalDiagnostics = program.getConfigFileParsingDiagnostics(); + const configFileDiagnostics = originalDiagnostics.filter( + (diag) => diag.category === ts.DiagnosticCategory.Error && diag.code !== 18003 + ); + if (configFileDiagnostics.length > 0) { + throw new Error(formatDiagnostics(ts, configFileDiagnostics)); + } + }; + const watch = ts.createWatchProgram(watchCompilerHost); + return watch; + } +}; +function formatDiagnostics(ts, diagnostics) { + return ts.formatDiagnostics(diagnostics, { + getCanonicalFileName: (f) => f, + getCurrentDirectory: () => process.cwd(), + getNewLine: () => "\n" + }); +} +function normalizeFileName(ts, fileName) { + let normalized = import_path2.default.normalize(fileName); + if (normalized.endsWith(import_path2.default.sep)) { + normalized = normalized.slice(0, -1); + } + if (ts.sys.useCaseSensitiveFileNames) { + return toAbsolutePath(normalized, null); + } + return toAbsolutePath(normalized.toLowerCase(), null); +} +function toAbsolutePath(filePath, baseDir) { + return import_path2.default.isAbsolute(filePath) ? filePath : import_path2.default.join(baseDir || process.cwd(), filePath); +} + +// src/parser/ts-for-v5/parse-tsx-for-typescript.ts +var DEFAULT_EXTRA_FILE_EXTENSIONS = [".vue", ".svelte", ".astro"]; +function parseTsxForTypeScript(code, options, tsEslintParser, ts) { + const programs = []; + for (const option of iterateOptions(options)) { + programs.push(getTSProgram(code, option, ts)); + } + const parserOptions = { + ...options, + programs + }; + return tsEslintParser.parseForESLint(code, parserOptions); +} +function* iterateOptions(options) { + if (!options) { + throw new Error("`parserOptions` is required."); + } + if (!options.filePath) { + throw new Error("`filePath` is required."); + } + if (!options.project) { + throw new Error( + "Specify `parserOptions.project`. Otherwise there is no point in using this parser." + ); + } + for (const project of getProjectConfigFiles(options)) { + yield { + project, + filePath: options.filePath, + extraFileExtensions: options.extraFileExtensions || DEFAULT_EXTRA_FILE_EXTENSIONS + }; + } +} + +// src/parser/ts-patch.ts +function tsPatch(scriptParserOptions, tsParserName) { + if (tsParserName === "typescript-eslint-parser-for-extra-files") { + return { + terminate() { + } + }; + } + let targetExt = ".astro"; + if (scriptParserOptions.filePath) { + const ext = import_path3.default.extname(scriptParserOptions.filePath); + if (ext) { + targetExt = ext; + } + } + try { + const cwd = process.cwd(); + const relativeTo = import_path3.default.join(cwd, "__placeholder__.js"); + const ts = (0, import_module.createRequire)(relativeTo)("typescript"); + if ((0, import_semver.satisfies)(ts.version, ">=5")) { + const result = tsPatchForV5(ts, scriptParserOptions); + if (result) { + return result; + } + } else { + const result = tsPatchForV4(ts, targetExt); + if (result) { + return result; + } + } + } catch { + } + const tsxFilePath = `${scriptParserOptions.filePath}.tsx`; + scriptParserOptions.filePath = tsxFilePath; + if (!import_fs2.default.existsSync(tsxFilePath)) { + import_fs2.default.writeFileSync(tsxFilePath, "/* temp for astro-eslint-parser */"); + return { + terminate() { + import_fs2.default.unlinkSync(tsxFilePath); + } + }; + } + return null; +} +function tsPatchForV5(ts, scriptParserOptions) { + return { + terminate() { + }, + parse(code, parser) { + return parseTsxForTypeScript( + code, + scriptParserOptions, + parser, + ts + ); + } + }; +} +function tsPatchForV4(ts, targetExt) { + const { ensureScriptKind, getScriptKindFromFileName } = ts; + if (typeof ensureScriptKind !== "function" || typeof getScriptKindFromFileName !== "function") { + return null; + } + ts.ensureScriptKind = function(fileName, ...args) { + if (fileName.endsWith(targetExt)) { + return ts.ScriptKind.TSX; + } + return ensureScriptKind.call(this, fileName, ...args); + }; + ts.getScriptKindFromFileName = function(fileName, ...args) { + if (fileName.endsWith(targetExt)) { + return ts.ScriptKind.TSX; + } + return getScriptKindFromFileName.call(this, fileName, ...args); + }; + if (ts.ensureScriptKind === ensureScriptKind || ts.getScriptKindFromFileName === getScriptKindFromFileName) { + return null; + } + return { + terminate() { + ts.ensureScriptKind = ensureScriptKind; + ts.getScriptKindFromFileName = getScriptKindFromFileName; + } + }; +} + +// src/context/resolve-parser/parser-object.ts +function isParserObject(value) { + return isEnhancedParserObject(value) || isBasicParserObject(value); +} +function isEnhancedParserObject(value) { + return Boolean(value && typeof value.parseForESLint === "function"); +} +function isBasicParserObject(value) { + return Boolean(value && typeof value.parse === "function"); +} +function maybeTSESLintParserObject(value) { + return isEnhancedParserObject(value) && isBasicParserObject(value) && typeof value.createProgram === "function" && typeof value.clearCaches === "function" && typeof value.version === "string"; +} +function getTSParserNameFromObject(value) { + if (!isEnhancedParserObject(value)) { + return null; + } + if (value.name === "typescript-eslint-parser-for-extra-files") + return "typescript-eslint-parser-for-extra-files"; + if (value.meta?.name === "typescript-eslint/parser") + return "@typescript-eslint/parser"; + return null; +} +function isTSESLintParserObject(value) { + if (!isEnhancedParserObject(value)) + return false; + if (value.name === "typescript-eslint-parser-for-extra-files") + return true; + if (value.meta?.name === "typescript-eslint/parser") + return true; + try { + const result = value.parseForESLint("", {}); + const services = result.services; + return Boolean( + services && services.esTreeNodeToTSNodeMap && services.tsNodeToESTreeNodeMap && services.program + ); + } catch { + return false; + } +} + +// src/parser/script.ts +var import_scope_manager = require("@typescript-eslint/scope-manager"); +function parseScript(code, ctx, parserOptionsCtx) { + const result = parseScriptInternal(code, ctx, parserOptionsCtx); + const parserOptions = parserOptionsCtx.parserOptions; + if (!result.scopeManager && parserOptions.eslintScopeManager) { + result.scopeManager = (0, import_scope_manager.analyze)(result.ast, { + ecmaVersion: 1e8, + globalReturn: parserOptions.ecmaFeatures?.globalReturn, + jsxPragma: parserOptions.jsxPragma, + jsxFragmentName: parserOptions.jsxFragmentName, + lib: parserOptions.lib, + sourceType: parserOptions.sourceType + }); + } + return result; +} +function parseScriptInternal(code, _ctx, parserOptionsCtx) { + const parser = parserOptionsCtx.getParser(); + let patchResult; + try { + const parserOptions = parserOptionsCtx.parserOptions; + if (parserOptionsCtx.isTypeScript() && parserOptions.filePath && parserOptions.project) { + patchResult = tsPatch(parserOptions, parserOptionsCtx.getTSParserName()); + } + const result = isEnhancedParserObject(parser) ? patchResult?.parse ? patchResult.parse(code, parser) : parser.parseForESLint(code, parserOptions) : parser.parse(code, parserOptions); + if ("ast" in result && result.ast != null) { + return result; + } + return { ast: result }; + } catch (e) { + debug( + "[script] parsing error:", + e.message, + `@ ${JSON.stringify(code)} + +${code}` + ); + throw e; + } finally { + patchResult?.terminate(); + } +} + +// src/parser/sort.ts +function sort(tokens) { + return tokens.sort((a, b) => { + if (a.range[0] !== b.range[0]) { + return a.range[0] - b.range[0]; + } + return a.range[1] - b.range[1]; + }); +} + +// src/parser/process-template.ts +var import_types = require("@typescript-eslint/types"); + +// src/astro/index.ts +var import_decode = require("entities/lib/decode.js"); + +// src/errors.ts +var ParseError = class extends SyntaxError { + /** + * Initialize this ParseError instance. + */ + constructor(message, offset, ctx) { + super(message); + if (typeof offset === "number") { + this.index = offset; + const loc = ctx.getLocFromIndex(offset); + this.lineNumber = loc.line; + this.column = loc.column; + } else { + this.index = ctx.getIndexFromLoc(offset); + this.lineNumber = offset.line; + this.column = offset.column; + } + this.originalAST = ctx.originalAST; + } +}; + +// src/astro/index.ts +function isTag(node) { + return node.type === "element" || node.type === "custom-element" || node.type === "component" || node.type === "fragment"; +} +function isParent(node) { + return Array.isArray(node.children); +} +function walkElements(parent, code, enter, leave, parents = []) { + const children = getSortedChildren(parent, code); + const currParents = [parent, ...parents]; + for (const node of children) { + enter(node, currParents); + if (isParent(node)) { + walkElements(node, code, enter, leave, currParents); + } + leave(node, currParents); + } +} +function walk(parent, code, enter, leave) { + walkElements( + parent, + code, + (node, parents) => { + enter(node, parents); + if (isTag(node)) { + const attrParents = [node, ...parents]; + for (const attr of node.attributes) { + enter(attr, attrParents); + leave(attr, attrParents); + } + } + }, + leave + ); +} +function calcStartTagEndOffset(node, ctx) { + const lastAttr = node.attributes[node.attributes.length - 1]; + let beforeCloseIndex; + if (lastAttr) { + beforeCloseIndex = calcAttributeEndOffset(lastAttr, ctx); + } else { + const info2 = getTokenInfo( + ctx, + [`<${node.name}`], + node.position.start.offset + ); + beforeCloseIndex = info2.index + info2.match.length; + } + const info = getTokenInfo(ctx, [[">", "/>"]], beforeCloseIndex); + return info.index + info.match.length; +} +function calcAttributeEndOffset(node, ctx) { + let info; + if (node.kind === "empty") { + info = getTokenInfo(ctx, [node.name], node.position.start.offset); + } else if (node.kind === "quoted") { + info = getTokenInfo( + ctx, + [ + [ + { + token: `"${node.value}"`, + htmlEntityDecode: true + }, + { + token: `'${node.value}'`, + htmlEntityDecode: true + }, + { + token: node.value, + htmlEntityDecode: true + } + ] + ], + calcAttributeValueStartOffset(node, ctx) + ); + } else if (node.kind === "expression") { + info = getTokenInfo( + ctx, + ["{", node.value, "}"], + calcAttributeValueStartOffset(node, ctx) + ); + } else if (node.kind === "shorthand") { + info = getTokenInfo( + ctx, + ["{", node.name, "}"], + node.position.start.offset + ); + } else if (node.kind === "spread") { + info = getTokenInfo( + ctx, + ["{", "...", node.name, "}"], + node.position.start.offset + ); + } else if (node.kind === "template-literal") { + info = getTokenInfo( + ctx, + [`\`${node.value}\``], + calcAttributeValueStartOffset(node, ctx) + ); + } else { + throw new ParseError( + `Unknown attr kind: ${node.kind}`, + node.position.start.offset, + ctx + ); + } + return info.index + info.match.length; +} +function calcAttributeValueStartOffset(node, ctx) { + let info; + if (node.kind === "quoted") { + info = getTokenInfo( + ctx, + [ + node.name, + "=", + [`"`, `'`, { token: node.value, htmlEntityDecode: true }] + ], + node.position.start.offset + ); + } else if (node.kind === "expression") { + info = getTokenInfo( + ctx, + [node.name, "=", "{"], + node.position.start.offset + ); + } else if (node.kind === "template-literal") { + info = getTokenInfo( + ctx, + [node.name, "=", "`"], + node.position.start.offset + ); + } else { + throw new ParseError( + `Unknown attr kind: ${node.kind}`, + node.position.start.offset, + ctx + ); + } + return info.index; +} +function getEndOffset(node, ctx) { + if (node.position.end?.offset != null) { + return node.position.end.offset; + } + if (isTag(node)) + return calcTagEndOffset(node, ctx); + if (node.type === "expression") + return calcExpressionEndOffset(node, ctx); + if (node.type === "comment") + return calcCommentEndOffset(node, ctx); + if (node.type === "frontmatter") { + const start = node.position.start.offset; + return ctx.code.indexOf("---", start + 3) + 3; + } + if (node.type === "doctype") { + const start = node.position.start.offset; + return ctx.code.indexOf(">", start) + 1; + } + if (node.type === "text") { + const start = node.position.start.offset; + return start + node.value.length; + } + if (node.type === "root") { + return ctx.code.length; + } + throw new Error(`unknown type: ${node.type}`); +} +function calcContentEndOffset(parent, ctx) { + const code = ctx.code; + if (isTag(parent)) { + const end = getEndOffset(parent, ctx); + if (code[end - 1] !== ">") { + return end; + } + const index = code.lastIndexOf("= 0 && code.slice(index + 2, end - 1).trim() === parent.name) { + return index; + } + return end; + } else if (parent.type === "expression") { + const end = getEndOffset(parent, ctx); + return code.lastIndexOf("}", end); + } else if (parent.type === "root") { + return code.length; + } + throw new Error(`unknown type: ${parent.type}`); +} +function getSelfClosingTag(node, ctx) { + if (node.children.length > 0) { + return null; + } + const code = ctx.code; + const startTagEndOffset = calcStartTagEndOffset(node, ctx); + if (code.startsWith("/>", startTagEndOffset - 2)) { + return { + offset: startTagEndOffset, + end: "/>" + }; + } + if (code.startsWith(`" + }; +} +function getEndTag(node, ctx) { + let beforeIndex; + if (node.children.length) { + const lastChild = node.children[node.children.length - 1]; + beforeIndex = getEndOffset(lastChild, ctx); + } else { + beforeIndex = calcStartTagEndOffset(node, ctx); + } + beforeIndex = skipSpaces(ctx.code, beforeIndex); + if (ctx.code.startsWith(`"], beforeIndex); + const end = info.index + info.match.length; + return { + offset, + tag: ctx.code.slice(offset, end) + }; + } + return null; +} +function calcCommentEndOffset(node, ctx) { + const info = getTokenInfo( + ctx, + [""], + node.position.start.offset + ); + return info.index + info.match.length; +} +function calcTagEndOffset(node, ctx) { + let beforeIndex; + if (node.children.length) { + const lastChild = node.children[node.children.length - 1]; + beforeIndex = getEndOffset(lastChild, ctx); + } else { + beforeIndex = calcStartTagEndOffset(node, ctx); + } + beforeIndex = skipSpaces(ctx.code, beforeIndex); + if (ctx.code.startsWith(`"], beforeIndex); + return info.index + info.match.length; + } + return beforeIndex; +} +function calcExpressionEndOffset(node, ctx) { + if (node.children.length) { + const lastChild = node.children[node.children.length - 1]; + const beforeIndex = getEndOffset(lastChild, ctx); + const info2 = getTokenInfo(ctx, ["}"], beforeIndex); + return info2.index + info2.match.length; + } + const info = getTokenInfo(ctx, ["{", "}"], node.position.start.offset); + return info.index + info.match.length; +} +function getTokenInfo(ctx, tokens, position) { + let lastMatch; + for (const t of tokens) { + const index = lastMatch ? lastMatch.index + lastMatch.match.length : position; + const m = Array.isArray(t) ? matchOfForMulti(t, index) : match(t, index); + if (m == null) { + throw new ParseError( + `Unknown token at ${index}, expected: ${JSON.stringify( + t + )}, actual: ${JSON.stringify(ctx.code.slice(index, index + 10))}`, + index, + ctx + ); + } + lastMatch = m; + } + return lastMatch; + function match(token, position2) { + const search = typeof token === "string" ? token : token.token; + const index = search.trim() === search ? skipSpaces(ctx.code, position2) : position2; + if (ctx.code.startsWith(search, index)) { + return { + match: search, + index + }; + } + if (typeof token !== "string") { + return matchWithHTMLEntity(token, index); + } + return null; + } + function matchOfForMulti(search, position2) { + for (const s of search) { + const m = match(s, position2); + if (m) { + return m; + } + } + return null; + } + function matchWithHTMLEntity(token, position2) { + const search = token.token; + let codeOffset = position2; + let searchOffset = 0; + while (searchOffset < search.length) { + const searchChar = search[searchOffset]; + if (ctx.code[codeOffset] === searchChar) { + codeOffset++; + searchOffset++; + continue; + } + const entity = getHTMLEntity(codeOffset); + if (entity?.entity === searchChar) { + codeOffset += entity.length; + searchOffset++; + continue; + } + return null; + } + return { + match: ctx.code.slice(position2, codeOffset), + index: position2 + }; + function getHTMLEntity(position3) { + let codeOffset2 = position3; + if (ctx.code[codeOffset2++] !== "&") + return null; + let entity = ""; + const entityDecoder = new import_decode.EntityDecoder( + import_decode.htmlDecodeTree, + (cp) => entity += String.fromCodePoint(cp) + ); + entityDecoder.startEntity(import_decode.DecodingMode.Attribute); + const length = entityDecoder.write(ctx.code, codeOffset2); + if (length < 0) { + return null; + } + if (length === 0) { + return null; + } + return { + entity, + length + }; + } + } +} +function skipSpaces(string, position) { + const re = /\s*/g; + re.lastIndex = position; + const match = re.exec(string); + if (match) { + return match.index + match[0].length; + } + return position; +} +function getSortedChildren(parent, code) { + if (parent.type === "root" && parent.children[0]?.type === "frontmatter") { + const children = [...parent.children]; + if (children.every((n) => n.position)) { + return children.sort( + (a, b) => a.position.start.offset - b.position.start.offset + ); + } + let start = skipSpaces(code, 0); + if (code.startsWith("", start + 4) + 3; + before.push(first); + } else if (first.type === "doctype" && code.startsWith("", start + 2) + 1; + before.push(first); + } else { + children.unshift(first); + break; + } + } + return [...before, frontmatter, ...children]; + } + } + return parent.children; +} + +// src/traverse.ts +function fallbackKeysFilter(key) { + let value = null; + return key !== "comments" && key !== "leadingComments" && key !== "loc" && key !== "parent" && key !== "range" && key !== "tokens" && key !== "trailingComments" && (value = this[key]) !== null && typeof value === "object" && (typeof value.type === "string" || Array.isArray(value)); +} +function getFallbackKeys(node) { + return Object.keys(node).filter(fallbackKeysFilter, node); +} +function getKeys(node, visitorKeys) { + const keys = (visitorKeys || KEYS)[node.type] || getFallbackKeys(node); + return keys.filter((key) => !getNodes(node, key).next().done); +} +function* getNodes(node, key) { + const child = node[key]; + if (Array.isArray(child)) { + for (const c of child) { + if (isNode(c)) { + yield c; + } + } + } else if (isNode(child)) { + yield child; + } +} +function isNode(x) { + return x !== null && typeof x === "object" && typeof x.type === "string"; +} +function traverse(node, parent, visitor) { + visitor.enterNode(node, parent); + const keys = getKeys(node, visitor.visitorKeys); + for (const key of keys) { + for (const child of getNodes(node, key)) { + traverse(child, node, visitor); + } + } + visitor.leaveNode(node, parent); +} +function traverseNodes(node, visitor) { + traverse(node, null, visitor); +} + +// src/context/restore.ts +var RestoreNodeProcessContext = class { + constructor(result, nodeMap) { + this.removeTokens = /* @__PURE__ */ new Set(); + this.result = result; + this.nodeMap = nodeMap; + } + addRemoveToken(test) { + this.removeTokens.add(test); + } + getParent(node) { + return this.nodeMap.get(node) || null; + } + findToken(startIndex) { + const tokens = this.result.ast.tokens || []; + return tokens.find((t) => t.range[0] === startIndex) || null; + } +}; +var RestoreContext = class { + constructor(ctx) { + this.offsets = []; + this.virtualFragments = []; + this.restoreNodeProcesses = []; + this.tokens = []; + this.ctx = ctx; + } + addRestoreNodeProcess(process2) { + this.restoreNodeProcesses.push(process2); + } + addOffset(offset) { + this.offsets.push(offset); + } + addVirtualFragmentRange(start, end) { + const peek = this.virtualFragments[this.virtualFragments.length - 1]; + if (peek && peek.end === start) { + peek.end = end; + return; + } + this.virtualFragments.push({ start, end }); + } + addToken(type, range) { + if (range[0] >= range[1]) { + return; + } + this.tokens.push(this.ctx.buildToken(type, range)); + } + /** + * Restore AST nodes + */ + restore(result) { + const nodeMap = remapLocationsAndGetNodeMap(result, this.tokens, { + remapLocation: (n) => this.remapLocation(n), + removeToken: (token) => this.virtualFragments.some( + (f) => f.start <= token.range[0] && token.range[1] <= f.end + ) + }); + restoreNodes(result, nodeMap, this.restoreNodeProcesses); + const firstOffset = Math.min( + ...[result.ast.body[0], result.ast.tokens?.[0], result.ast.comments?.[0]].filter((t) => Boolean(t)).map((t) => t.range[0]) + ); + if (firstOffset < result.ast.range[0]) { + result.ast.range[0] = firstOffset; + result.ast.loc.start = this.ctx.getLocFromIndex(firstOffset); + } + } + remapLocation(node) { + let [start, end] = node.range; + const startFragment = this.virtualFragments.find( + (f) => f.start <= start && start < f.end + ); + if (startFragment) { + start = startFragment.end; + } + const endFragment = this.virtualFragments.find( + (f) => f.start < end && end <= f.end + ); + if (endFragment) { + end = endFragment.start; + if (startFragment === endFragment) { + start = startFragment.start; + } + } + if (end < start) { + const w = start; + start = end; + end = w; + } + const locs = this.ctx.getLocations(...this.getRemapRange(start, end)); + node.loc = locs.loc; + node.range = locs.range; + if (node.start != null) { + delete node.start; + } + if (node.end != null) { + delete node.end; + } + } + getRemapRange(start, end) { + if (!this.offsets.length) { + return [start, end]; + } + let lastStart = this.offsets[0]; + let lastEnd = this.offsets[0]; + for (const offset of this.offsets) { + if (offset.dist <= start) { + lastStart = offset; + } + if (offset.dist < end) { + lastEnd = offset; + } else { + if (offset.dist === end && start === end) { + lastEnd = offset; + } + break; + } + } + const remapStart = lastStart.original + (start - lastStart.dist); + const remapEnd = lastEnd.original + (end - lastEnd.dist); + if (remapEnd < remapStart) { + return [remapEnd, remapStart]; + } + return [remapStart, remapEnd]; + } +}; +function remapLocationsAndGetNodeMap(result, restoreTokens, { + remapLocation, + removeToken +}) { + const traversed = /* @__PURE__ */ new Map(); + traverseNodes(result.ast, { + visitorKeys: result.visitorKeys, + enterNode: (node, p) => { + if (!traversed.has(node)) { + traversed.set(node, p); + remapLocation(node); + } + }, + leaveNode: (_node) => { + } + }); + const tokens = [...restoreTokens]; + for (const token of result.ast.tokens || []) { + if (removeToken(token)) { + continue; + } + remapLocation(token); + tokens.push(token); + } + result.ast.tokens = tokens; + for (const token of result.ast.comments || []) { + remapLocation(token); + } + return traversed; +} +function restoreNodes(result, nodeMap, restoreNodeProcesses) { + const context = new RestoreNodeProcessContext(result, nodeMap); + const restoreNodeProcessesSet = new Set(restoreNodeProcesses); + for (const [node] of nodeMap) { + if (!restoreNodeProcessesSet.size) { + break; + } + for (const proc of [...restoreNodeProcessesSet]) { + if (proc(node, context)) { + restoreNodeProcessesSet.delete(proc); + } + } + } + if (context.removeTokens.size) { + const tokens = result.ast.tokens || []; + for (let index = tokens.length - 1; index >= 0; index--) { + const token = tokens[index]; + for (const rt of context.removeTokens) { + if (rt(token)) { + tokens.splice(index, 1); + context.removeTokens.delete(rt); + if (!context.removeTokens.size) { + break; + } + } + } + } + } +} + +// src/context/script.ts +var VirtualScriptContext = class { + constructor(ctx) { + this.script = ""; + this.consumedIndex = 0; + this.originalCode = ctx.code; + this.restoreContext = new RestoreContext(ctx); + } + skipOriginalOffset(offset) { + this.consumedIndex += offset; + } + skipUntilOriginalOffset(offset) { + this.consumedIndex = Math.max(offset, this.consumedIndex); + } + appendOriginal(index) { + if (this.consumedIndex >= index) { + return; + } + this.restoreContext.addOffset({ + original: this.consumedIndex, + dist: this.script.length + }); + this.script += this.originalCode.slice(this.consumedIndex, index); + this.consumedIndex = index; + } + appendVirtualScript(virtualFragment) { + const start = this.script.length; + this.script += virtualFragment; + this.restoreContext.addVirtualFragmentRange(start, this.script.length); + } +}; + +// src/parser/process-template.ts +function processTemplate(ctx, resultTemplate) { + let uniqueIdSeq = 0; + const usedUniqueIds = /* @__PURE__ */ new Set(); + const script = new VirtualScriptContext(ctx); + let fragmentOpened = false; + function openRootFragment(startOffset) { + script.appendVirtualScript("<>"); + fragmentOpened = true; + script.restoreContext.addRestoreNodeProcess((scriptNode, { result }) => { + if (scriptNode.type === import_types.AST_NODE_TYPES.ExpressionStatement && scriptNode.expression.type === import_types.AST_NODE_TYPES.JSXFragment && scriptNode.range[0] === startOffset && result.ast.body.includes(scriptNode)) { + const index = result.ast.body.indexOf(scriptNode); + const rootFragment = result.ast.body[index] = scriptNode.expression; + delete rootFragment.closingFragment; + delete rootFragment.openingFragment; + rootFragment.type = "AstroFragment"; + return true; + } + return false; + }); + } + walkElements( + resultTemplate.ast, + ctx.code, + // eslint-disable-next-line complexity -- X( + (node, [parent]) => { + if (node.type === "frontmatter") { + const start = node.position.start.offset; + if (fragmentOpened) { + script.appendVirtualScript(";"); + fragmentOpened = false; + } + script.appendOriginal(start); + script.skipOriginalOffset(3); + const end = getEndOffset(node, ctx); + const scriptStart = start + 3; + let scriptEnd = end - 3; + let endChar; + while (scriptStart < scriptEnd - 1 && (endChar = ctx.code[scriptEnd - 1]) && !endChar.trim()) { + scriptEnd--; + } + script.appendOriginal(scriptEnd); + script.appendVirtualScript("\n;"); + script.skipOriginalOffset(end - scriptEnd); + script.restoreContext.addRestoreNodeProcess( + (_scriptNode, { result }) => { + for (let index = 0; index < result.ast.body.length; index++) { + const st = result.ast.body[index]; + if (st.type === import_types.AST_NODE_TYPES.EmptyStatement) { + if (st.range[0] === scriptEnd && st.range[1] === scriptEnd) { + result.ast.body.splice(index, 1); + break; + } + } + } + return true; + } + ); + script.restoreContext.addToken(import_types.AST_TOKEN_TYPES.Punctuator, [ + node.position.start.offset, + node.position.start.offset + 3 + ]); + script.restoreContext.addToken(import_types.AST_TOKEN_TYPES.Punctuator, [ + end - 3, + end + ]); + } else if (isTag(node)) { + if (parent.type === "expression") { + const siblings = parent.children.filter( + (n) => n.type !== "text" || n.value.trim() + ); + const index = siblings.indexOf(node); + const before = siblings[index - 1]; + if (!before || !isTag(before)) { + const after = siblings[index + 1]; + if (after && (isTag(after) || after.type === "comment")) { + const start2 = node.position.start.offset; + script.appendOriginal(start2); + script.appendVirtualScript("<>"); + script.restoreContext.addRestoreNodeProcess((scriptNode) => { + if (scriptNode.range[0] === start2 && scriptNode.type === import_types.AST_NODE_TYPES.JSXFragment) { + delete scriptNode.openingFragment; + delete scriptNode.closingFragment; + const fragmentNode = scriptNode; + fragmentNode.type = "AstroFragment"; + const last = fragmentNode.children[fragmentNode.children.length - 1]; + if (fragmentNode.range[1] < last.range[1]) { + fragmentNode.range[1] = last.range[1]; + fragmentNode.loc.end = ctx.getLocFromIndex( + fragmentNode.range[1] + ); + } + return true; + } + return false; + }); + } + } + } + const start = node.position.start.offset; + script.appendOriginal(start); + if (!fragmentOpened) { + openRootFragment(start); + } + for (const attr of node.attributes) { + if (attr.kind === "quoted" || attr.kind === "empty" || attr.kind === "expression" || attr.kind === "template-literal") { + const needPunctuatorsProcess = node.type === "component" || node.type === "fragment" ? /[.:@]/u.test(attr.name) : /[.@]/u.test(attr.name) || attr.name.startsWith(":"); + if (needPunctuatorsProcess) { + processAttributePunctuators(attr); + } + } + if (attr.kind === "quoted") { + if (attr.raw && !attr.raw.startsWith('"') && !attr.raw.startsWith("'")) { + const attrStart = attr.position.start.offset; + const start2 = calcAttributeValueStartOffset(attr, ctx); + const end = calcAttributeEndOffset(attr, ctx); + script.appendOriginal(start2); + script.appendVirtualScript('"'); + script.appendOriginal(end); + script.appendVirtualScript('"'); + script.restoreContext.addRestoreNodeProcess( + (scriptNode, context) => { + if (scriptNode.type === import_types.AST_NODE_TYPES.JSXAttribute && scriptNode.range[0] === attrStart) { + const attrNode = scriptNode; + if (attrNode.value?.type === "Literal" && typeof attrNode.value.value === "string") { + const raw = ctx.code.slice(start2, end); + attrNode.value.raw = raw; + context.findToken(start2).value = raw; + return true; + } + } + return false; + } + ); + } + } else if (attr.kind === "shorthand") { + const start2 = attr.position.start.offset; + script.appendOriginal(start2); + const jsxName = /[\s"'[\]{}]/u.test(attr.name) ? generateUniqueId(attr.name) : attr.name; + script.appendVirtualScript(`${jsxName}=`); + script.restoreContext.addRestoreNodeProcess((scriptNode) => { + if (scriptNode.type === import_types.AST_NODE_TYPES.JSXAttribute && scriptNode.range[0] === start2) { + const attrNode = scriptNode; + attrNode.type = "AstroShorthandAttribute"; + const locs = ctx.getLocations( + ...attrNode.value.expression.range + ); + if (jsxName !== attr.name) { + attrNode.name.name = attr.name; + } + attrNode.name.range = locs.range; + attrNode.name.loc = locs.loc; + return true; + } + return false; + }); + } else if (attr.kind === "template-literal") { + const attrStart = attr.position.start.offset; + const start2 = calcAttributeValueStartOffset(attr, ctx); + const end = calcAttributeEndOffset(attr, ctx); + script.appendOriginal(start2); + script.appendVirtualScript("{"); + script.appendOriginal(end); + script.appendVirtualScript("}"); + script.restoreContext.addRestoreNodeProcess((scriptNode) => { + if (scriptNode.type === import_types.AST_NODE_TYPES.JSXAttribute && scriptNode.range[0] === attrStart) { + const attrNode = scriptNode; + attrNode.type = "AstroTemplateLiteralAttribute"; + return true; + } + return false; + }); + } + } + const closing = getSelfClosingTag(node, ctx); + if (closing && closing.end === ">") { + script.appendOriginal(closing.offset - 1); + script.appendVirtualScript("/"); + } + if (node.name === "script" || node.name === "style" || node.attributes.some((attr) => attr.name === "is:raw")) { + const text = node.children[0]; + if (text && text.type === "text") { + const styleNodeStart = node.position.start.offset; + const start2 = text.position.start.offset; + script.appendOriginal(start2); + script.skipOriginalOffset(text.value.length); + script.restoreContext.addRestoreNodeProcess((scriptNode) => { + if (scriptNode.type === import_types.AST_NODE_TYPES.JSXElement && scriptNode.range[0] === styleNodeStart) { + const textNode = { + type: "AstroRawText", + value: text.value, + raw: text.value, + parent: scriptNode, + ...ctx.getLocations(start2, start2 + text.value.length) + }; + scriptNode.children = [textNode]; + return true; + } + return false; + }); + script.restoreContext.addToken(import_types.AST_TOKEN_TYPES.JSXText, [ + start2, + start2 + text.value.length + ]); + } + } + } else if (node.type === "comment") { + const start = node.position.start.offset; + const end = getEndOffset(node, ctx); + const length = end - start; + script.appendOriginal(start); + if (!fragmentOpened) { + openRootFragment(start); + } + script.appendOriginal(start + 1); + script.appendVirtualScript(`> { + if (scriptNode.range[0] === start && scriptNode.type === import_types.AST_NODE_TYPES.JSXFragment) { + delete scriptNode.children; + delete scriptNode.openingFragment; + delete scriptNode.closingFragment; + delete scriptNode.expression; + const commentNode = scriptNode; + commentNode.type = "AstroHTMLComment"; + commentNode.value = node.value; + context.addRemoveToken( + (token) => token.value === "<" && token.range[0] === scriptNode.range[0] + ); + context.addRemoveToken( + (token) => token.value === ">" && token.range[1] === scriptNode.range[1] + ); + return true; + } + return false; + }); + script.restoreContext.addToken("HTMLComment", [ + start, + start + length + ]); + } else if (node.type === "doctype") { + const start = node.position.start.offset; + const end = getEndOffset(node, ctx); + const length = end - start; + script.appendOriginal(start); + if (!fragmentOpened) { + openRootFragment(start); + } + script.appendOriginal(start + 1); + script.appendVirtualScript(`> { + if (scriptNode.range[0] === start && scriptNode.type === import_types.AST_NODE_TYPES.JSXFragment) { + delete scriptNode.children; + delete scriptNode.openingFragment; + delete scriptNode.closingFragment; + delete scriptNode.expression; + const doctypeNode = scriptNode; + doctypeNode.type = "AstroDoctype"; + context.addRemoveToken( + (token) => token.value === "<" && token.range[0] === scriptNode.range[0] + ); + context.addRemoveToken( + (token) => token.value === ">" && token.range[1] === scriptNode.range[1] + ); + return true; + } + return false; + }); + script.restoreContext.addToken("HTMLDocType", [ + start, + end + ]); + } else { + const start = node.position.start.offset; + script.appendOriginal(start); + if (!fragmentOpened) { + openRootFragment(start); + } + } + }, + (node, [parent]) => { + if (isTag(node)) { + const closing = getSelfClosingTag(node, ctx); + if (!closing) { + const end = getEndTag(node, ctx); + if (!end) { + const offset = calcContentEndOffset(node, ctx); + script.appendOriginal(offset); + script.appendVirtualScript(``); + script.restoreContext.addRestoreNodeProcess( + (scriptNode, context) => { + const parent2 = context.getParent(scriptNode); + if (scriptNode.range[0] === offset && scriptNode.type === import_types.AST_NODE_TYPES.JSXClosingElement && parent2.type === import_types.AST_NODE_TYPES.JSXElement) { + parent2.closingElement = null; + return true; + } + return false; + } + ); + } + } + } + if ((isTag(node) || node.type === "comment") && parent.type === "expression") { + const siblings = parent.children.filter( + (n) => n.type !== "text" || n.value.trim() + ); + const index = siblings.indexOf(node); + const after = siblings[index + 1]; + if (!after || !isTag(after) && after.type !== "comment") { + const before = siblings[index - 1]; + if (before && (isTag(before) || before.type === "comment")) { + const end = getEndOffset(node, ctx); + script.appendOriginal(end); + script.appendVirtualScript(""); + } + } + } + } + ); + if (fragmentOpened) { + const last = resultTemplate.ast.children[resultTemplate.ast.children.length - 1]; + const end = getEndOffset(last, ctx); + script.appendOriginal(end); + script.appendVirtualScript(";"); + } + script.appendOriginal(ctx.code.length); + return script; + function processAttributePunctuators(attr) { + const start = attr.position.start.offset; + let targetIndex = start; + let colonOffset; + for (let index = 0; index < attr.name.length; index++) { + const char = attr.name[index]; + if (char !== ":" && char !== "." && char !== "@") { + continue; + } + if (index === 0) { + targetIndex++; + } + const punctuatorIndex = start + index; + script.appendOriginal(punctuatorIndex); + script.skipOriginalOffset(1); + script.appendVirtualScript(`_`); + if (char === ":" && index !== 0 && colonOffset == null) { + colonOffset = index; + } + } + if (colonOffset != null) { + const punctuatorIndex = start + colonOffset; + script.restoreContext.addToken(import_types.AST_TOKEN_TYPES.JSXIdentifier, [ + start, + punctuatorIndex + ]); + script.restoreContext.addToken(import_types.AST_TOKEN_TYPES.Punctuator, [ + punctuatorIndex, + punctuatorIndex + 1 + ]); + script.restoreContext.addToken(import_types.AST_TOKEN_TYPES.JSXIdentifier, [ + punctuatorIndex + 1, + start + attr.name.length + ]); + } else { + script.restoreContext.addToken(import_types.AST_TOKEN_TYPES.JSXIdentifier, [ + start, + start + attr.name.length + ]); + } + script.restoreContext.addRestoreNodeProcess((scriptNode, context) => { + if (scriptNode.type === import_types.AST_NODE_TYPES.JSXAttribute && scriptNode.range[0] === targetIndex) { + const baseNameNode = scriptNode.name; + if (colonOffset != null) { + const nameNode = baseNameNode; + nameNode.type = import_types.AST_NODE_TYPES.JSXNamespacedName; + nameNode.namespace = { + type: import_types.AST_NODE_TYPES.JSXIdentifier, + name: attr.name.slice(0, colonOffset), + ...ctx.getLocations( + baseNameNode.range[0], + baseNameNode.range[0] + colonOffset + ) + }; + nameNode.name = { + type: import_types.AST_NODE_TYPES.JSXIdentifier, + name: attr.name.slice(colonOffset + 1), + ...ctx.getLocations( + baseNameNode.range[0] + colonOffset + 1, + baseNameNode.range[1] + ) + }; + scriptNode.name = nameNode; + nameNode.namespace.parent = nameNode; + nameNode.name.parent = nameNode; + } else { + if (baseNameNode.type === import_types.AST_NODE_TYPES.JSXIdentifier) { + const nameNode = baseNameNode; + nameNode.name = attr.name; + scriptNode.name = nameNode; + } else { + const nameNode = baseNameNode; + nameNode.namespace.name = attr.name.slice( + baseNameNode.namespace.range[0] - start, + baseNameNode.namespace.range[1] - start + ); + nameNode.name.name = attr.name.slice( + baseNameNode.name.range[0] - start, + baseNameNode.name.range[1] - start + ); + scriptNode.name = nameNode; + nameNode.namespace.parent = nameNode; + nameNode.name.parent = nameNode; + } + } + context.addRemoveToken( + (token) => token.range[0] === baseNameNode.range[0] && token.range[1] === baseNameNode.range[1] + ); + return true; + } + return false; + }); + } + function generateUniqueId(base) { + let candidate = `$_${base.replace(/\W/g, "_")}${uniqueIdSeq++}`; + while (usedUniqueIds.has(candidate) || ctx.code.includes(candidate)) { + candidate = `$_${base.replace(/\W/g, "_")}${uniqueIdSeq++}`; + } + usedUniqueIds.add(candidate); + return candidate; + } +} + +// src/util/index.ts +function sortedLastIndex(array, compare) { + let lower = 0; + let upper = array.length; + while (lower < upper) { + const mid = Math.floor(lower + (upper - lower) / 2); + const target = compare(array[mid]); + if (target < 0) { + lower = mid + 1; + } else if (target > 0) { + upper = mid; + } else { + return mid + 1; + } + } + return upper; +} +function addElementToSortedArray(array, element, compare) { + const index = sortedLastIndex(array, (target) => compare(target, element)); + array.splice(index, 0, element); +} +function addElementsToSortedArray(array, elements, compare) { + if (!elements.length) { + return; + } + let last = elements[0]; + let index = sortedLastIndex(array, (target) => compare(target, last)); + for (const element of elements) { + if (compare(last, element) > 0) { + index = sortedLastIndex(array, (target) => compare(target, element)); + } + let e = array[index]; + while (e && compare(e, element) <= 0) { + e = array[++index]; + } + array.splice(index, 0, element); + last = element; + } +} + +// src/context/index.ts +var Context = class { + constructor(code, filePath) { + this.locsMap = /* @__PURE__ */ new Map(); + this.state = {}; + this.locs = new LinesAndColumns(code); + this.code = code; + this.filePath = filePath; + } + getLocFromIndex(index) { + let loc = this.locsMap.get(index); + if (!loc) { + loc = this.locs.getLocFromIndex(index); + this.locsMap.set(index, loc); + } + return { + line: loc.line, + column: loc.column + }; + } + getIndexFromLoc(loc) { + return this.locs.getIndexFromLoc(loc); + } + /** + * Get the location information of the given indexes. + */ + getLocations(start, end) { + return { + range: [start, end], + loc: { + start: this.getLocFromIndex(start), + end: this.getLocFromIndex(end) + } + }; + } + /** + * Build token + */ + buildToken(type, range) { + return { + type, + value: this.getText(range), + ...this.getLocations(...range) + }; + } + /** + * get text + */ + getText(range) { + return this.code.slice(range[0], range[1]); + } + get originalAST() { + return this.state.originalAST; + } + set originalAST(originalAST) { + this.state.originalAST = originalAST; + } +}; +var LinesAndColumns = class { + constructor(origCode) { + const len = origCode.length; + const lineStartIndices = [0]; + const crs = []; + let normalizedCode = ""; + for (let index = 0; index < len; ) { + const c = origCode[index++]; + if (c === "\r") { + const next = origCode[index++] || ""; + if (next === "\n") { + normalizedCode += next; + crs.push(index - 2); + lineStartIndices.push(index); + } else { + normalizedCode += ` +${next}`; + lineStartIndices.push(index - 1); + } + } else { + normalizedCode += c; + if (c === "\n") { + lineStartIndices.push(index); + } + } + } + this.lineStartIndices = lineStartIndices; + this.code = origCode; + this.normalizedLineFeed = new NormalizedLineFeed(normalizedCode, crs); + } + getLocFromIndex(index) { + const lineNumber = sortedLastIndex( + this.lineStartIndices, + (target) => target - index + ); + return { + line: lineNumber, + column: index - this.lineStartIndices[lineNumber - 1] + }; + } + getIndexFromLoc(loc) { + const lineIndex = loc.line - 1; + if (this.lineStartIndices.length > lineIndex) { + const lineStartIndex = this.lineStartIndices[lineIndex]; + const positionIndex = lineStartIndex + loc.column; + return positionIndex; + } else if (this.lineStartIndices.length === lineIndex) { + return this.code.length + loc.column; + } + return this.code.length + loc.column; + } + getNormalizedLineFeed() { + return this.normalizedLineFeed; + } +}; +var NormalizedLineFeed = class { + get needRemap() { + return this.offsets.length > 0; + } + constructor(code, offsets) { + this.code = code; + this.offsets = offsets; + if (offsets.length) { + const cache = {}; + this.remapIndex = (index) => { + let result = cache[index]; + if (result != null) { + return result; + } + result = index; + for (const offset of offsets) { + if (offset < result) { + result++; + } else { + break; + } + } + return cache[index] = result; + }; + } else { + this.remapIndex = (i) => i; + } + } +}; + +// src/parser/astro-parser/parse.ts +var service = __toESM(require("astrojs-compiler-sync")); +function parse2(code, ctx) { + const result = service.parse(code, { position: true }); + for (const { code: code2, text, location, severity } of result.diagnostics || []) { + if (severity === 1) { + ctx.originalAST = result.ast; + throw new ParseError(`${text} [${code2}]`, location, ctx); + } + } + if (!result.ast.children) { + result.ast.children = []; + } + const htmlElement = result.ast.children.find( + (n) => n.type === "element" && n.name === "html" + ); + if (!result._adjusted) { + if (htmlElement) { + adjustHTML(result.ast, htmlElement, ctx); + } + fixLocations(result.ast, ctx); + result._adjusted = true; + } + return result; +} +function adjustHTML(ast, htmlElement, ctx) { + const htmlEnd = ctx.code.indexOf(" { + if (node2.type === "frontmatter") { + start = node2.position.start.offset = tokenIndex(ctx, "---", start); + if (!node2.position.end) { + node2.position.end = {}; + } + start = node2.position.end.offset = tokenIndex(ctx, "---", start + 3 + node2.value.length) + 3; + } else if (node2.type === "fragment" || node2.type === "element" || node2.type === "component" || node2.type === "custom-element") { + if (!node2.position) { + node2.position = { start: {}, end: {} }; + } + start = node2.position.start.offset = tokenIndex(ctx, "<", start); + start += 1; + start += node2.name.length; + if (!node2.attributes.length) { + start = calcStartTagEndOffset(node2, ctx); + } + } else if (node2.type === "attribute") { + fixLocationForAttr(node2, ctx, start); + start = calcAttributeEndOffset(node2, ctx); + if (node2.position.end) { + node2.position.end.offset = start; + } + } else if (node2.type === "comment") { + node2.position.start.offset = tokenIndex(ctx, " + +### ❌ Incorrect + +```ts +let foo = 1n + 1; +let fn = (a: string, b: never) => a + b; +``` + +### ✅ Correct + +```ts +let foo = 1n + 1n; +let fn = (a: string, b: string) => a + b; +``` + +## Options + +:::caution +We generally recommend against using these options, as they limit which varieties of incorrect `+` usage can be checked. +This in turn severely limits the validation that the rule can do to ensure that resulting strings and numbers are correct. + +Safer alternatives to using the `allow*` options include: + +- Using variadic forms of logging APIs to avoid needing to `+` values. + ```ts + // Remove this line + console.log('The result is ' + true); + // Add this line + console.log('The result is', true); + ``` +- Using `.toFixed()` to coerce numbers to well-formed string representations: + ```ts + const number = 1.123456789; + const result = 'The number is ' + number.toFixed(2); + // result === 'The number is 1.12' + ``` +- Calling `.toString()` on other types to mark explicit and intentional string coercion: + ```ts + const arg = '11'; + const regex = /[0-9]/; + const result = + 'The result of ' + + regex.toString() + + '.test("' + + arg + + '") is ' + + regex.test(arg).toString(); + // result === 'The result of /[0-9]/.test("11") is true' + ``` + +::: + +### `allowAny` + +Examples of code for this rule with `{ allowAny: true }`: + + + +#### ❌ Incorrect + +```ts option='{ "allowAny": true }' +let fn = (a: number, b: []) => a + b; +let fn = (a: string, b: []) => a + b; +``` + +#### ✅ Correct + +```ts option='{ "allowAny": true }' +let fn = (a: number, b: any) => a + b; +let fn = (a: string, b: any) => a + b; +``` + +### `allowBoolean` + +Examples of code for this rule with `{ allowBoolean: true }`: + + + +#### ❌ Incorrect + +```ts option='{ "allowBoolean": true }' +let fn = (a: number, b: unknown) => a + b; +let fn = (a: string, b: unknown) => a + b; +``` + +#### ✅ Correct + +```ts option='{ "allowBoolean": true }' +let fn = (a: number, b: boolean) => a + b; +let fn = (a: string, b: boolean) => a + b; +``` + +### `allowNullish` + +Examples of code for this rule with `{ allowNullish: true }`: + + + +#### ❌ Incorrect + +```ts option='{ "allowNullish": true }' +let fn = (a: number, b: unknown) => a + b; +let fn = (a: number, b: never) => a + b; +let fn = (a: string, b: unknown) => a + b; +let fn = (a: string, b: never) => a + b; +``` + +#### ✅ Correct + +```ts option='{ "allowNullish": true }' +let fn = (a: number, b: undefined) => a + b; +let fn = (a: number, b: null) => a + b; +let fn = (a: string, b: undefined) => a + b; +let fn = (a: string, b: null) => a + b; +``` + +### `allowNumberAndString` + +Examples of code for this rule with `{ allowNumberAndString: true }`: + + + +#### ❌ Incorrect + +```ts option='{ "allowNumberAndString": true }' +let fn = (a: number, b: unknown) => a + b; +let fn = (a: number, b: never) => a + b; +``` + +#### ✅ Correct + +```ts option='{ "allowNumberAndString": true }' +let fn = (a: number, b: string) => a + b; +let fn = (a: number, b: number | string) => a + b; +``` + +### `allowRegExp` + +Examples of code for this rule with `{ allowRegExp: true }`: + + + +#### ❌ Incorrect + +```ts option='{ "allowRegExp": true }' +let fn = (a: number, b: RegExp) => a + b; +``` + +#### ✅ Correct + +```ts option='{ "allowRegExp": true }' +let fn = (a: string, b: RegExp) => a + b; +``` + +### `skipCompoundAssignments` + +Examples of code for this rule with `{ skipCompoundAssignments: false }`: + + + +#### ❌ Incorrect + +```ts option='{ "skipCompoundAssignments": true }' +let foo: string | undefined; +foo += 'some data'; + +let bar: string = ''; +bar += 0; +``` + +#### ✅ Correct + +```ts option='{ "skipCompoundAssignments": true }' +let foo: number = 0; +foo += 1; + +let bar = ''; +bar += 'test'; +``` + +## When Not To Use It + +If you don't mind a risk of `"[object Object]"` or incorrect type coercions in your values, then you will not need this rule. + +## Related To + +- [`no-base-to-string`](./no-base-to-string.md) +- [`restrict-template-expressions`](./restrict-template-expressions.md) + +## Further Reading + +- [`Object.prototype.toString()` MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString) diff --git a/.pnpm-store/v3/files/77/1b9c32b977835f9845ade8409275494f2e707357d9af36be7cce7d105232d3a1901d7b96798be9335fa8093df8370f67e2fc042fcde3b592ec282212502399 b/.pnpm-store/v3/files/77/1b9c32b977835f9845ade8409275494f2e707357d9af36be7cce7d105232d3a1901d7b96798be9335fa8093df8370f67e2fc042fcde3b592ec282212502399 new file mode 100644 index 00000000..00b6cc4f --- /dev/null +++ b/.pnpm-store/v3/files/77/1b9c32b977835f9845ade8409275494f2e707357d9af36be7cce7d105232d3a1901d7b96798be9335fa8093df8370f67e2fc042fcde3b592ec282212502399 @@ -0,0 +1,2 @@ +import type { Segment } from './types'; +export declare function getLength(segments: Segment[]): number; diff --git a/.pnpm-store/v3/files/77/78da7564cef88d2336ebb71fd7608ab03f4b9d7de618b0b10e9ff29ed0b82d237586a26db445bc84638468c8aca40f69276a433171bc42a813b270db413811 b/.pnpm-store/v3/files/77/78da7564cef88d2336ebb71fd7608ab03f4b9d7de618b0b10e9ff29ed0b82d237586a26db445bc84638468c8aca40f69276a433171bc42a813b270db413811 new file mode 100644 index 00000000..2e27fcf9 --- /dev/null +++ b/.pnpm-store/v3/files/77/78da7564cef88d2336ebb71fd7608ab03f4b9d7de618b0b10e9ff29ed0b82d237586a26db445bc84638468c8aca40f69276a433171bc42a813b270db413811 @@ -0,0 +1,21 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var ToInt32 = require('../ToInt32'); +var ToUint32 = require('../ToUint32'); + +// https://262.ecma-international.org/11.0/#sec-numeric-types-number-signedRightShift + +module.exports = function NumberSignedRightShift(x, y) { + if (typeof x !== 'number' || typeof y !== 'number') { + throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers'); + } + + var lnum = ToInt32(x); + var rnum = ToUint32(y); + + var shiftCount = rnum & 0x1F; + + return lnum >> shiftCount; +}; diff --git a/.pnpm-store/v3/files/77/90d88a272d7a90056170e4b9aa30e0ff4277f40fb84559d30f9c407adc644fe9b170aa0519ec2b9dceb330e732858af0081fa9937b5999c03eca45d0f1a25f b/.pnpm-store/v3/files/77/90d88a272d7a90056170e4b9aa30e0ff4277f40fb84559d30f9c407adc644fe9b170aa0519ec2b9dceb330e732858af0081fa9937b5999c03eca45d0f1a25f new file mode 100644 index 00000000..0393412f --- /dev/null +++ b/.pnpm-store/v3/files/77/90d88a272d7a90056170e4b9aa30e0ff4277f40fb84559d30f9c407adc644fe9b170aa0519ec2b9dceb330e732858af0081fa9937b5999c03eca45d0f1a25f @@ -0,0 +1,94 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "es6": true, + }, + + "rules": { + "array-bracket-newline": 0, + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 40 }], + "max-params": [2, 5], + "max-lines-per-function": 1, + "max-statements": 1, + "max-statements-per-line": [2, { "max": 2 }], + "multiline-comment-style": 0, + "no-magic-numbers": 0, + "new-cap": 0, + "no-extra-parens": 1, + "sort-keys": 0, + }, + + "overrides": [ + { + "files": "GetIntrinsic.js", + "rules": { + "max-statements": 0, + } + }, + { + "files": "operations/*", + "rules": { + "max-lines": 0, + }, + }, + { + "files": [ + "operations/deltas.js", + "operations/getOps.js", + "operations/spackle.js", + "operations/years.js", + ], + "extends": "@ljharb/eslint-config/node/latest", + "rules": { + "complexity": 0, + "func-style": 0, + "max-lines-per-function": 0, + "max-nested-callbacks": 0, + "max-statements": 0, + "no-magic-numbers": 0, + "no-throw-literal": 0, + }, + }, + { + "files": "test/**", + "extends": "@ljharb/eslint-config/tests", + "rules": { + "max-len": 0, + "max-lines-per-function": 0, + "no-implicit-coercion": 0, + "no-invalid-this": 1, + "prefer-promise-reject-errors": 0, + }, + }, + { + "files": [ + "*/Num*ToRawBytes.js", + "*/RawBytesToNum*.js", + "helpers/bytesAs*.js", + "helpers/valueToFloat*.js", + ], + "rules": { + "max-lines-per-function": "off", + "max-statements": "off", + "no-redeclare": "warn", + "operator-linebreak": [2, "before", { + "overrides": { + "=": "none" + } + }], + }, + }, + { + "files": "./*/GetSubstitution.js", + "rules": { + "max-depth": "off", + }, + }, + ], +} diff --git a/.pnpm-store/v3/files/77/93aebeb9e6b37183f544882b7e8a1bc399e5b12f2849084c5b671afe7a1c569295b22d26e62bee1bf62e49fdd37f80bd10204a2c626a6a335157ce4547a48f-index.json b/.pnpm-store/v3/files/77/93aebeb9e6b37183f544882b7e8a1bc399e5b12f2849084c5b671afe7a1c569295b22d26e62bee1bf62e49fdd37f80bd10204a2c626a6a335157ce4547a48f-index.json new file mode 100644 index 00000000..b4ffbaa0 --- /dev/null +++ b/.pnpm-store/v3/files/77/93aebeb9e6b37183f544882b7e8a1bc399e5b12f2849084c5b671afe7a1c569295b22d26e62bee1bf62e49fdd37f80bd10204a2c626a6a335157ce4547a48f-index.json @@ -0,0 +1 @@ +{"files":{"dist/config.cjs":{"checkedAt":1707939899507,"integrity":"sha512-bI5HbM5PP3JcegKHOpmouv3bGEBX9B0igRaqFxXrmNwkH4+xZBFwSoaZlqocdms6Y7kAKicQkP7zYQZMoh/Hnw==","mode":420,"size":3640},"index.cjs":{"checkedAt":1707939899507,"integrity":"sha512-c6iCX6Wz7ZxzQRL76FM2Vh/Opcapd3ojVTZRsXINqZWwf9bKzcAJ6TEw1kZtLEJYsysMiGZ7IKbo1/9TDxHUPw==","mode":420,"size":412},"suppress-warnings.cjs":{"checkedAt":1707939899507,"integrity":"sha512-9vISXVfxvDkPGKlMyincYRFoiAquHfi0iRiHUDgBHRxlMChw+J8MBT0yStVoU5DywhojmFAaPNB2gvyAP3jH+g==","mode":420,"size":786},"index.d.cts":{"checkedAt":1707939899507,"integrity":"sha512-oNAszGxOg1F9LzKbGzfE75pTdTxTZBL4+N3rBF4vSljaaS19M6LRyjPbYAoyrW4oa0Zfk/PZMSxGUL7FyTP1NQ==","mode":420,"size":32},"dist/vendor/_commonjsHelpers.jjO7Zipk.js":{"checkedAt":1707939899507,"integrity":"sha512-Ykq5GGMt8M1Ax0h1gBGy7Dcgjl6fbzQXfl8MtiD98qelPO+c9HH8IQhpP5W30IUuhSwBi2Kttpx/tudlavKpGA==","mode":420,"size":398},"dist/chunks/api-setup.srzH0bDf.js":{"checkedAt":1707939899508,"integrity":"sha512-CAPXroQ2toZXT7QZtRnLh0gv0eDlLnQMOm1ZFO1xMSZGDNAdQuhj8ewXFPxyjSUnOAJqR5Yu/bpV92EkZ9ChvQ==","mode":420,"size":128242},"dist/vendor/base.QYERqzkH.js":{"checkedAt":1707939899508,"integrity":"sha512-oBD856Js4zQtNAFEOiMIUlAIa+tB/soIuzCjV+ut8CEcHjsXkN33YjFsBFAdZG/wRD8R2SVzqcOinENe63mARw==","mode":420,"size":3100},"dist/vendor/base.Rmxiv35Y.js":{"checkedAt":1707939899508,"integrity":"sha512-MUhTitwknN9SMvC0RSRcae4gJjbdJzSp7RZ1f+61RSfdbf1DzjeslAfQ5lHWq9/JsWiPt04jEA+E8d7ZuXm0gw==","mode":420,"size":1193},"dist/vendor/benchmark.IlKmJkUU.js":{"checkedAt":1707939899508,"integrity":"sha512-b+XuEIRxqSvKB3/afhpZy/N/5rMj81ZlmDndBvPfDMuy/HrWLuuIMoNfp4KWz9PH39kahxRxADSld5GHmV0fdw==","mode":420,"size":1304},"dist/browser.js":{"checkedAt":1707939899508,"integrity":"sha512-S2osFDL6Q2Av1lga23xQAvuWBjv5EVF4Td4kgXCNh6XclaVWH1NlUAqQX4jIOCQ6r8IbGeuV4e3L7JEtpy9c7Q==","mode":420,"size":423},"dist/cli-wrapper.js":{"checkedAt":1707939899509,"integrity":"sha512-3sd/z68T7XKHzwi2LIYIETCV8SAcYeomTWgWipaVJEtfBDmlYqQyCFkjki65P4jc43vZXBHSXDMAIbpeHSp5yQ==","mode":420,"size":3510},"dist/cli.js":{"checkedAt":1707939899509,"integrity":"sha512-1qDKJ++4VM8TVSfRC4M6YRSp8cvLEhMSafu/xLq+WP9NlP8IaXk27Ln+fJUMIqjOFIummWv4+Tz3NdmPhMP4Hw==","mode":420,"size":9259},"dist/config.js":{"checkedAt":1707939899509,"integrity":"sha512-BAF5bj/RQtzmuvh57ZsOs7GXpuaq3glMZ7oOrVsar617TlIyzO2Ghvx6coFiTePJ6mUxi0/iA3HHjItyW36PKA==","mode":420,"size":3292},"dist/vendor/constants.i1PoEnhr.js":{"checkedAt":1707939899509,"integrity":"sha512-/mHAefEutzsVV5Q5FrAlsoaev0nRWCGVruAY3DkbWteUIam5HoB1IN3jpuwdXnDQOTJtP7Ljekfi0nYI9QGEqQ==","mode":420,"size":1284},"dist/vendor/coverage.E7sG1b3r.js":{"checkedAt":1707939899509,"integrity":"sha512-y8LW6cZx9fJ9+3kNWccBJbvpW3ohAyeih3rVc86f1SSqJztANqQRRbCmcbJpzEJDPXT29CoTh3x5wRc7PN9J+Q==","mode":420,"size":2280},"dist/coverage.js":{"checkedAt":1707939899509,"integrity":"sha512-tN69Q2P5Qosq9QjpxX4PfIEBs/KrGVZeHR4PoAgaWPPoYC5mLte7C9AN+K817lWLKZzcimdPZ65tFMglvinY4Q==","mode":420,"size":6433},"dist/vendor/date.Ns1pGd_X.js":{"checkedAt":1707939899509,"integrity":"sha512-akMdmUzf1iVre4AXsOqKnR0P6mcrJ+fRyYMFN3cP4HS1SCbD5I70ZGSV4OW5hM9YIVaVzg6JBzZzYL8IwI1BLw==","mode":420,"size":1274},"dist/environments.js":{"checkedAt":1707939899509,"integrity":"sha512-daw2B17KfQgjB7C6PN9b5TZvuSTQfkIrDeoe2QDWH+Bj85IBQODRzKYyGzeivRnUHnhwaksGKKs6FgHOHKbHeg==","mode":420,"size":122},"dist/vendor/environments.sU0TD7wX.js":{"checkedAt":1707939899509,"integrity":"sha512-BjHSfh9q3h2gH2Jep5u5PYPxw1CS64ZRh5AhGFchM7qk8WCYEjXz81DDkd+tKByTMYPw5cOAHgU3A4BdaZwKlQ==","mode":420,"size":16332},"dist/execute.js":{"checkedAt":1707939899510,"integrity":"sha512-6ARpEukWVk4Ygn21oI6XChoviSeMHiD25efvBCvTL9kHFyAaCGwGIvDujpmQQ8CgKigQTqK9kO7FPduvqZ5Fww==","mode":420,"size":302},"dist/vendor/execute.TxmaEFIQ.js":{"checkedAt":1707939899510,"integrity":"sha512-6GUdqzRZOv/58y7fiIeQn25E3hf8aBSXow3ZmCm8Or0m0jgauDkwOdwCfqovUPLro/eQ6/DSBpIwlc3z2i2EXg==","mode":420,"size":21010},"dist/workers/forks.js":{"checkedAt":1707939899510,"integrity":"sha512-tzIhPCpptEjPCHw6Pv/cZg+J7NyQa5Hs+rhfXpbkitlVrRWQyPRaQOVZk3eXEMGWxvpA1CBI40SbFchMpcWctA==","mode":420,"size":870},"dist/vendor/global.CkGT_TMy.js":{"checkedAt":1707939899510,"integrity":"sha512-YGLSjbOtMdRJwFiiHci+Sk6MH1ulieQl5fN0oKmk+NczhE7zwbzL6KvfXkS+6IWXRHicJ+7Ns+HWOAbUIPc9PA==","mode":420,"size":999},"dist/vendor/index.cAUulNDf.js":{"checkedAt":1707939899510,"integrity":"sha512-w7Wq/Nvj80q4EnCk6QkKCC1L3r+mPTuma1i6pM6jKipzybNYp8nDikM6pUsy8TslwkdDItPdLNamcwG7Xi/l0Q==","mode":420,"size":2719},"dist/index.js":{"checkedAt":1707939899510,"integrity":"sha512-qNlFORmrpK9qZBKngRvGzsG1gqETuPZ7lLxoDqif8G7rdF3NOnSAn6ox6XersGjQcoGlqOQExCitFqwSmwI+fA==","mode":420,"size":1136},"dist/vendor/index.LgG0iblq.js":{"checkedAt":1707939899511,"integrity":"sha512-KqIJi+3eYMwCCBEW8Oxu2TI11QCf8jO7bO4viNp3qa4gfbJwz176YftBA0IbASWlZ85yWPImksYIDCAydfmN3g==","mode":420,"size":3804},"dist/vendor/index.RDKo8czB.js":{"checkedAt":1707939899511,"integrity":"sha512-3IBoKcpkFn3MIhIdsKXlW3o7VRfa+By2YSSXieX9/eaoirRyMJfO19K4zbSkF3uNjd9mXoamV/uHtHquzrMfZg==","mode":420,"size":3875},"dist/vendor/index.rJjbcrrp.js":{"checkedAt":1707939899511,"integrity":"sha512-g2E2mUBT6rFDVBIhmjAj1TIN6+gaLd+Zj6TQWZiHPb3tT0ScfAVucPOZi0YejcYNrSHb4uzFxdW6guBqUoE8gQ==","mode":420,"size":818},"dist/vendor/index.xL8XjTLv.js":{"checkedAt":1707939899511,"integrity":"sha512-60R2V68HCs9Hyio3YwmKWbxf6iIkHuO5w580aufGcRfJ1V2UUcm4U17At7LqtCkqkcVPgmA29WIbuXXCYbJAhA==","mode":420,"size":100749},"dist/chunks/install-pkg.LE8oaA1t.js":{"checkedAt":1707939899511,"integrity":"sha512-qe1b9oZ2FJ3ndI9wETIcLfrotZv1o0JK11ACjHP3K55F2/rIJYfkBTQuaINZRaodkdhIMV1Ehynf5gp629UGsA==","mode":420,"size":9262},"dist/chunks/integrations-globals.J_6tnlri.js":{"checkedAt":1707939899512,"integrity":"sha512-TimNc5kovFu8O82bjtMGEGblcSsvVv55+74m4E2hPZbVI3q1qkbAUlupRAQGs2LgXtdHq2BN31UFjfN0WMJkPw==","mode":420,"size":902},"dist/chunks/node-git.Hw101KjS.js":{"checkedAt":1707939899512,"integrity":"sha512-8yr7Ly3hDSgMApPdDXqgO4Lrmy3e7nX00RBD6dESWFy4FIIdCFOL4KWHbkpVvbm/p5sfDQP9jEUUzwMB0/PfKQ==","mode":420,"size":1765},"dist/node.js":{"checkedAt":1707939899513,"integrity":"sha512-Bcbx8gYlvXn4B4gUxuq7U92lX6KDF+Y2p/Rz0ml5Egk0OOvuibhqvi47YdiLN/NzxRZktUHpi7tIlxU3ppkhcQ==","mode":420,"size":1645},"dist/vendor/node.Zme77R4t.js":{"checkedAt":1707939899515,"integrity":"sha512-ou6rwoPtdC/hAsIb7BDgAyGT6mnAKCJ4pQHbOAa41XDQAuYUUGz6QIyq6bRgcFOc1m/GWd3qLLQ5ckaxzMd0Ww==","mode":420,"size":518168},"dist/path.js":{"checkedAt":1707939899515,"integrity":"sha512-EqcHShk81J4TRtpM+3uHFKQUAcoWwAyjiJ9RU7h5MtKJQ7uxP2WWsssJohDSrPhSIaiCdOWI4BvEkP2aq9y/lw==","mode":420,"size":238},"dist/vendor/reporters.cA9x-5v-.js":{"checkedAt":1707939899515,"integrity":"sha512-UK6R30PAD0FrUqgxHcKEGXVlJ6gJq+EwkOX93vE0L8bJGyIN9KfJbZQXLCzPUqGaEKewmjkK/+SjDz6zgx/FSg==","mode":420,"size":98967},"dist/reporters.js":{"checkedAt":1707939899515,"integrity":"sha512-RS0cCeafJKxR0ebpPjAfsl7SM23HEBx01AUBcFlUkmSZeuo+fkNNUgpxe0XASqaiihaurzo8GBkXT50ZrL7Q4A==","mode":420,"size":809},"dist/vendor/rpc.w4v8oCkK.js":{"checkedAt":1707939899515,"integrity":"sha512-U/Ax6RYCpKjD7U7aReI6DL/6GYQPkF1aH7kBdUyP7roQZDCJQ/CqrkR9oSGgJxK4E/7Bciu5KUUr9KBjvtofoQ==","mode":420,"size":2476},"dist/vendor/run-once.Olz_Zkd8.js":{"checkedAt":1707939899515,"integrity":"sha512-3M9doV6hk5cPP1x99MIOSVnfeM3CO/3+kfegsPh/L9YzbgHeEN4lfHgfKT3M2i+MylahLoTVv449XajXWIgs6A==","mode":420,"size":746},"dist/runners.js":{"checkedAt":1707939899515,"integrity":"sha512-7OmS0z17XnY73G6C+w40tr5LAo2lLclFYHgSz3MxZW/e4iYrbulE1tN/Zb4DjvbYNrTJktua+cNNi6y+PvW//Q==","mode":420,"size":7975},"dist/chunks/runtime-console.Iloo9fIt.js":{"checkedAt":1707939899515,"integrity":"sha512-exgAsANasve7hwHX2U1QmS8IAXlKtcBpTaNCXUUTwg5Esq4vepdBB1MruZQbqClQlGXC/cd8RoSEu3DvFOcthg==","mode":420,"size":3891},"dist/chunks/runtime-runBaseTests.QReNMrJA.js":{"checkedAt":1707939899516,"integrity":"sha512-ZRHupCoFZLfqoUFUQdrzR1pMX1/QEiHCjXCoxpbSoKZRSuCvABp4kY0Udth7tIpXPuC99wVm4fthiiGjXsovYA==","mode":420,"size":4864},"dist/workers/runVmTests.js":{"checkedAt":1707939899516,"integrity":"sha512-eYSGXI9GN5riEklalxdhU+dByWxVNXcNKa3chwWUZ/aftlBZTbCwxqGSnZN1tSwc1k+NM74G0gX1cvD4V01svA==","mode":420,"size":2689},"dist/vendor/setup-common.C2iBd0K0.js":{"checkedAt":1707939899516,"integrity":"sha512-z++yAyJWgvc87vZUsoTLagmsKA5GYH2WJZkm3IaMMWj773UmTYQgWUby6C0lXVku0S/RC9nXmikBeeIXiJalvw==","mode":420,"size":977},"dist/spy.js":{"checkedAt":1707939899516,"integrity":"sha512-e9UfKOtAXff9HsnnOf0V64dEXCbbtExeeOFlaBLWgv43j8cnJl6dmJVbZ9cl/HttZDQY4fEBg0ZAzOWTfT0yhQ==","mode":420,"size":29},"dist/suite.js":{"checkedAt":1707939899516,"integrity":"sha512-YtEVzjjB1qlnzT/1g8rPBwWSeQQyZ0/aBI61qS+fwh+qzjp5aJIPaPIjoogGLH/n/TLCY/F6l/eQO1mhYE+GzA==","mode":420,"size":382},"dist/vendor/tasks.IknbGB2n.js":{"checkedAt":1707939899516,"integrity":"sha512-b24HS60bP73RI+PnWQ1HZx85bUrQuvc+1ohcf5Tmd7uyQ+hISvnMeCnN7Re9mO/s6wSJyGwATaeKVAJ15+shSg==","mode":420,"size":525},"dist/workers/threads.js":{"checkedAt":1707939899516,"integrity":"sha512-eOemp7z1gh8juXwG3ks1VCuTn4RIEQ+V3W5Pkg8VZvjKBwoCOd91rv71isWjAinQX+zt4CeAoedCplNWPi1BVw==","mode":420,"size":679},"dist/vendor/utils.GbToHGHI.js":{"checkedAt":1707939899516,"integrity":"sha512-lQv0d3lencBu6lTe6jvhcHaXkMxULtk7qPIZQ5E96vLWyEpXd/oQHFM7jOAbxXjyfIOaNfLFauzg1UzRRhXvdg==","mode":420,"size":1080},"dist/utils.js":{"checkedAt":1707939899517,"integrity":"sha512-UPGyGAIHIriVbMjSStB7uPlz16QRt01w4INTu2llEUVhNQOw6AewFnUSAXYk8abWKf+hdjEs8Xm6JigBijpxug==","mode":420,"size":31},"dist/vendor/vi.PPwhENHF.js":{"checkedAt":1707939899517,"integrity":"sha512-O8B3AYlB+MRNWGrmePs9mwow0wru8iKldvJSgrM9OXXZko4yWSh3o0817RdV92Jgdw7CB+8XhnfTmv+fPvi4WA==","mode":420,"size":113353},"dist/vendor/vm.jVxKtN5R.js":{"checkedAt":1707939899517,"integrity":"sha512-w81WOtrTM2pgfAF7cZnmcl9XI3qbKArTmGPWPAcIXwvHaaD9psbBF0LDv7SXmCOlRBvAhJdXl2jg75RuqzQraw==","mode":420,"size":24046},"dist/workers/vmForks.js":{"checkedAt":1707939899518,"integrity":"sha512-AjVnbT5c4/Gi6gp9d8QuEMaRNRvY1ep4MRJJK8u8vDfQovhMHJJlkJSL7pqQ8OBqf4WdDOv73bB4jBufqBAgpQ==","mode":420,"size":1153},"dist/workers/vmThreads.js":{"checkedAt":1707939899518,"integrity":"sha512-MkC5n9oe4q0O2SLHOgu/3JDXGH4az4WS8ImVseU0xYImHLkqP9zySq9L8lbHJkvAPIVW/IbFd6emGrWMnjMDEQ==","mode":420,"size":962},"dist/worker.js":{"checkedAt":1707939899518,"integrity":"sha512-Y4klXyY92xXHqu/2p2+3aKWMOPWvUAj+p4B1pbtuVe31qtjks409GuXRxsfmuexNBmbmeEqYKmdP7yZ2kcYs1w==","mode":420,"size":5513},"dist/workers.js":{"checkedAt":1707939899518,"integrity":"sha512-v092SjeHh90Dh8MTTBPihnqqbOnZbKpjtyAdcSbv23P30uGA+ZCPWC6ouzlafshKzqNrYW6RoJfPZ/+vcBmsHw==","mode":420,"size":1068},"LICENSE.md":{"checkedAt":1707939899518,"integrity":"sha512-1EFZWT7DCraxWfwrj5arWMaHiJmy+jbji3q5IAdsc0IYyjKv1lmmZgH8mCPZmLfxCi/9GbFmUZhikBhuiqCBYA==","mode":420,"size":80228},"README.md":{"checkedAt":1707939899518,"integrity":"sha512-0vXcalDYOk+DYbS9HAyalHFnz7r85nOwAoyqsfeD5eiBcpfnTrb24j1TIDskBUi7KCf2yqBsUjlyi43dequbaA==","mode":420,"size":261},"vitest.mjs":{"checkedAt":1707939899519,"integrity":"sha512-HuDMWUyEfmOiaW3z0BvSJw7lCqAfsMbbN03KL27swM/P/gqfk9JKmQhrkLPf89gYJVwuHhqOp79OPe/9jPc1rw==","mode":493,"size":51},"browser.d.ts":{"checkedAt":1707939899519,"integrity":"sha512-C0MIZAMTm9a749MoWCl4WtnhQT+mTeBYlhhuccNfyk7S/LqPYbAfIF05T6DEkEWw3W6c22fIWMQxE3NIP0+TlQ==","mode":420,"size":34},"dist/browser.d.ts":{"checkedAt":1707939899519,"integrity":"sha512-ogXAHJsDVX+ItbYFoyogEP4n/ngZLIeaQx4xTcRxPmZm/6YDEAKtyztP/y5puosRs7uWfUHoQb2eMfRC7phTvg==","mode":420,"size":2139},"config.d.ts":{"checkedAt":1707939899519,"integrity":"sha512-sxOZ+ReLdUafyLMspTZheziYmUUjTD1yTxO+6tjvpBl3pA/jhB1sHOJPE+naaA1+YjI6RewCJYwxqqzkY4O1Og==","mode":420,"size":33},"dist/config.d.ts":{"checkedAt":1707939899519,"integrity":"sha512-Wz5Ox1Bl7bogiqt3TRWTDZYaexGtHB6G6ICDyyW2HwK6ioScU/fOxo+xcF3yOPYeN+vDz4cJm6ygKMqbRdRu1A==","mode":420,"size":790},"coverage.d.ts":{"checkedAt":1707939899519,"integrity":"sha512-kjjMdVkH8HMPgdeemgth5oMI3kYEIbDlpTVN61ycxspiCp/74s1ymL1I7wOMM7Yf7cNAbhiJcMD8QdBWZdb4FA==","mode":420,"size":35},"dist/coverage.d.ts":{"checkedAt":1707939899519,"integrity":"sha512-EKPGvYAStmsRyRxy5mDZROWw2FLEl3no26xQxrrt/crUnHV8SEMmqimAcZ22waoGjdOTAh1Uyy+wppmxWGQJxA==","mode":420,"size":4631},"dist/environments.d.ts":{"checkedAt":1707939899520,"integrity":"sha512-HbNEplpL0sMdmJ1wzy6eGcB7ddDG59x+xLqjhk5/lESwfp0yYhB+QnIsSUiMbzyHdJ1+o8kc1Wg/tvnLfFFZ1A==","mode":420,"size":876},"environments.d.ts":{"checkedAt":1707939899520,"integrity":"sha512-u0jlB80oWVIMonEeVbqPSyh99QQiBowyQHZs+7e+AJ/a7WPAfC4i1asUGBPB+HVnZcO4hMMXxNaMx9Z8/6GmpA==","mode":420,"size":36},"dist/execute.d.ts":{"checkedAt":1707939899520,"integrity":"sha512-3MI5xgKEhNIDoGUDV0kvUYTQzdGfVnCRPxTutLCodY5AcetxrR4fH8FTSxmdKhbqTS17gQ/yUTHSiviX0NEw6w==","mode":420,"size":5450},"execute.d.ts":{"checkedAt":1707939899520,"integrity":"sha512-58HWiPr4XRRnwhlPsukrORkPLAKmVQvZJ2J7/ttevC3u0AQcgmqCKCh8aaA7dyhaVmmiPiCnUDUDo7kR1sHFKQ==","mode":420,"size":34},"globals.d.ts":{"checkedAt":1707939899520,"integrity":"sha512-P2UV8DLdDKDblkqenT8vBXjK4VHRWmUm4NSv0Y5WTpGz1JHI+F1pGu+WX6DjgRwKT/zdAb7rv3R7a+VeXvDsZQ==","mode":420,"size":759},"import-meta.d.ts":{"checkedAt":1707939899520,"integrity":"sha512-lAUMokOOTs3fyckoVaBiqwftILe+2addC38BpKFgNIfrp6e5j5YTVd8eugIbL2cR6tgL+eiii4TRPpfmEAAofQ==","mode":420,"size":249},"importMeta.d.ts":{"checkedAt":1707939899520,"integrity":"sha512-7rCrpLZfLBpYulyYKLTlnxNxmdjRFXFGDiPoMj5gHiOp/FLV45QBIPmO0ewp8RiBBT2/0Nd6eTD+sV3br4nnog==","mode":420,"size":83},"dist/index.d.ts":{"checkedAt":1707939899520,"integrity":"sha512-ga7kTCx2RZtUFrATKd6OL+4Dn3ICQ94yw3WIknpQGR+mChtb7yHxVIJt+WXFetzwx5FfG0Per8PGuyZq+iXLZw==","mode":420,"size":36432},"dist/node.d.ts":{"checkedAt":1707939899521,"integrity":"sha512-EcZba53lsNEjVbW4QIABG1T/R3uJ+nNMGyqfsFGD/eX9ce0J2EKOKRnFeqfG/73RxZtLu3JInFYQUwEuQKoACg==","mode":420,"size":1798},"node.d.ts":{"checkedAt":1707939899521,"integrity":"sha512-K9D64yYb2Qt2qhTO6N9e2BR+HwQKpQSDzBsy6GezCcQMFwwuI+wX2KcZtoYQ3EkUFA1h0R6NFbsqIqH7utgUHg==","mode":420,"size":31},"dist/reporters-1evA5lom.d.ts":{"checkedAt":1707939899521,"integrity":"sha512-wZCoA2t1RCyDU/3aOr2x/aeTqZRywMkGMdcLGuyrfKo9gQJdunbi5zZ6CJrMKKaW0/aZ/08al8s3U97unRP8Pw==","mode":420,"size":85192},"dist/reporters.d.ts":{"checkedAt":1707939899521,"integrity":"sha512-uhQhmKO6p/hSExfNsIEZ4S95LtxuXspER5mX9uFGESBxmI1oyjvb1dy35qnR370b5QZfMVQ2Q9s58KTg4+nwiQ==","mode":420,"size":719},"reporters.d.ts":{"checkedAt":1707939899521,"integrity":"sha512-ROu4imjJZzs/NDPuxbFk9Lzz+Q6D9heCuljPQjGkKXBWtcV2OsI6eOE5XAsk5afGOyLqJtdof2GbZgMQ0xzZVA==","mode":420,"size":36},"dist/runners.d.ts":{"checkedAt":1707939899522,"integrity":"sha512-vIFqVIUs4Z947zv/Iy7cxxNSV7vEDo2/munJZ+QXazEt6ZFf3IBOycDXWV8B73pF2EkPtax0ZKVJnJDX3CdNcA==","mode":420,"size":1692},"runners.d.ts":{"checkedAt":1707939899522,"integrity":"sha512-NuCLyLT5uZQ2+cSfpCSV+KYXnOYpye2LtG9rGMsIl/RNhZe9QAjLuvcWKVnqy2pjKL8vx57Ur+wpiVs7Rcj/Qw==","mode":420,"size":34},"dist/suite-ghspeorC.d.ts":{"checkedAt":1707939899522,"integrity":"sha512-i0w9TEUyKxGOJWus2NG0HZR/7HgJEMbkMCt1ZvVVsBd65fDa24+lhmVel64BdbdGByH5gSm86pOQyexychXyZw==","mode":420,"size":404},"dist/suite.d.ts":{"checkedAt":1707939899522,"integrity":"sha512-VhraO+5dLdppEIrZEp4HonRaCJtEuveFM6FX3m/JD8HPgwwqUZv8c5SrtBuY24rpKRhc+E05vu0VqxtlEBIE6w==","mode":420,"size":555},"suite.d.ts":{"checkedAt":1707939899522,"integrity":"sha512-GYHhlrdTHhSz23UC9dixNUv6bZcDD0TDRg7/MQE4vEM6ko/vR7anAg4mbz90w9WhqT5S1AVjqr4DIjBB+KTpVw==","mode":420,"size":32},"dist/utils.d.ts":{"checkedAt":1707939899522,"integrity":"sha512-UPGyGAIHIriVbMjSStB7uPlz16QRt01w4INTu2llEUVhNQOw6AewFnUSAXYk8abWKf+hdjEs8Xm6JigBijpxug==","mode":420,"size":31},"utils.d.ts":{"checkedAt":1707939899522,"integrity":"sha512-axCOarte2rMC9hFtFUUGn8ImqgUjccgFxq4TZaNTZiUNTE0ROH10GQW+ueZ46JT+/h9Ujbqxn9osOLQjjYYckQ==","mode":420,"size":32},"dist/workers.d.ts":{"checkedAt":1707939899523,"integrity":"sha512-+hNqDtqpn9tQnplPsBItEIVOok0l2yzxsLsWltq9EvKzWRGfcukeGukZzs0ggyrvNaR+MEB8tJnvA1ErjUY8qQ==","mode":420,"size":1513},"workers.d.ts":{"checkedAt":1707939899523,"integrity":"sha512-vvuen7darLqiY9vDPocjVxAke6iYPrSRRNJTBiDybolLU4IWRDrkB6qCbiEaVLKw8VZ4c1l6pCSP4BCoSs58OQ==","mode":420,"size":34},"package.json":{"checkedAt":1707939899523,"integrity":"sha512-esRCHwJUzz/1jdwQb0i6zIIXZubub7gydw/X+hGDP7KA4VnzX0sUokSxpl7pGDki4QNqJjqRzJDKolyc9CRcsw==","mode":420,"size":4709}}} \ No newline at end of file diff --git a/.pnpm-store/v3/files/77/be2d51d22ade209f77d6d3654318ddb88befb0f75ac78561b6ae2a5792d1b8dba9ff10a3a8816429c17566895ec053fac40c76e8cd0b443ef819829c5651b5 b/.pnpm-store/v3/files/77/be2d51d22ade209f77d6d3654318ddb88befb0f75ac78561b6ae2a5792d1b8dba9ff10a3a8816429c17566895ec053fac40c76e8cd0b443ef819829c5651b5 new file mode 100644 index 00000000..55ffcc14 --- /dev/null +++ b/.pnpm-store/v3/files/77/be2d51d22ade209f77d6d3654318ddb88befb0f75ac78561b6ae2a5792d1b8dba9ff10a3a8816429c17566895ec053fac40c76e8cd0b443ef819829c5651b5 @@ -0,0 +1,131 @@ +import path, { resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { readFileSync } from 'node:fs'; + +const { version } = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)).toString()); +const VERSION = version; +const DEFAULT_MAIN_FIELDS = [ + 'browser', + 'module', + 'jsnext:main', + 'jsnext', +]; +// Baseline support browserslist +// "defaults and supports es6-module and supports es6-module-dynamic-import" +// Higher browser versions may be needed for extra features. +const ESBUILD_MODULES_TARGET = [ + 'es2020', + 'edge88', + 'firefox78', + 'chrome87', + 'safari14', +]; +const DEFAULT_EXTENSIONS = [ + '.mjs', + '.js', + '.mts', + '.ts', + '.jsx', + '.tsx', + '.json', +]; +const DEFAULT_CONFIG_FILES = [ + 'vite.config.js', + 'vite.config.mjs', + 'vite.config.ts', + 'vite.config.cjs', + 'vite.config.mts', + 'vite.config.cts', +]; +const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/; +const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/; +const OPTIMIZABLE_ENTRY_RE = /\.[cm]?[jt]s$/; +const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/; +/** + * Prefix for resolved fs paths, since windows paths may not be valid as URLs. + */ +const FS_PREFIX = `/@fs/`; +/** + * Prefix for resolved Ids that are not valid browser import specifiers + */ +const VALID_ID_PREFIX = `/@id/`; +/** + * Plugins that use 'virtual modules' (e.g. for helper functions), prefix the + * module ID with `\0`, a convention from the rollup ecosystem. + * This prevents other plugins from trying to process the id (like node resolution), + * and core features like sourcemaps can use this info to differentiate between + * virtual modules and regular files. + * `\0` is not a permitted char in import URLs so we have to replace them during + * import analysis. The id will be decoded back before entering the plugins pipeline. + * These encoded virtual ids are also prefixed by the VALID_ID_PREFIX, so virtual + * modules in the browser end up encoded as `/@id/__x00__{id}` + */ +const NULL_BYTE_PLACEHOLDER = `__x00__`; +const CLIENT_PUBLIC_PATH = `/@vite/client`; +const ENV_PUBLIC_PATH = `/@vite/env`; +const VITE_PACKAGE_DIR = resolve( +// import.meta.url is `dist/node/constants.js` after bundle +fileURLToPath(import.meta.url), '../../..'); +const CLIENT_ENTRY = resolve(VITE_PACKAGE_DIR, 'dist/client/client.mjs'); +const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, 'dist/client/env.mjs'); +const CLIENT_DIR = path.dirname(CLIENT_ENTRY); +// ** READ THIS ** before editing `KNOWN_ASSET_TYPES`. +// If you add an asset to `KNOWN_ASSET_TYPES`, make sure to also add it +// to the TypeScript declaration file `packages/vite/client.d.ts` and +// add a mime type to the `registerCustomMime` in +// `packages/vite/src/node/plugin/assets.ts` if mime type cannot be +// looked up by mrmime. +const KNOWN_ASSET_TYPES = [ + // images + 'apng', + 'png', + 'jpe?g', + 'jfif', + 'pjpeg', + 'pjp', + 'gif', + 'svg', + 'ico', + 'webp', + 'avif', + // media + 'mp4', + 'webm', + 'ogg', + 'mp3', + 'wav', + 'flac', + 'aac', + 'opus', + 'mov', + 'm4a', + 'vtt', + // fonts + 'woff2?', + 'eot', + 'ttf', + 'otf', + // other + 'webmanifest', + 'pdf', + 'txt', +]; +const DEFAULT_ASSETS_RE = new RegExp(`\\.(` + KNOWN_ASSET_TYPES.join('|') + `)(\\?.*)?$`); +const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/; +const loopbackHosts = new Set([ + 'localhost', + '127.0.0.1', + '::1', + '0000:0000:0000:0000:0000:0000:0000:0001', +]); +const wildcardHosts = new Set([ + '0.0.0.0', + '::', + '0000:0000:0000:0000:0000:0000:0000:0000', +]); +const DEFAULT_DEV_PORT = 5173; +const DEFAULT_PREVIEW_PORT = 4173; +const DEFAULT_ASSETS_INLINE_LIMIT = 4096; +const METADATA_FILENAME = '_metadata.json'; + +export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEFAULT_PREVIEW_PORT, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VALID_ID_PREFIX, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts }; diff --git a/.pnpm-store/v3/files/77/e758c6b26ad6c2f75ccc410e76f0a450040848d3af673e42276833574693ff853f8d5dbde41f2baa3d7718913a2f0af2b312e8f2c9f2feae856ba88aede8a6 b/.pnpm-store/v3/files/77/e758c6b26ad6c2f75ccc410e76f0a450040848d3af673e42276833574693ff853f8d5dbde41f2baa3d7718913a2f0af2b312e8f2c9f2feae856ba88aede8a6 new file mode 100644 index 00000000..7a23f10d --- /dev/null +++ b/.pnpm-store/v3/files/77/e758c6b26ad6c2f75ccc410e76f0a450040848d3af673e42276833574693ff853f8d5dbde41f2baa3d7718913a2f0af2b312e8f2c9f2feae856ba88aede8a6 @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.register = void 0; +const shared_1 = require("../shared"); +const transforms_1 = require("../utils/transforms"); +function register(ctx) { + return (uri, position, referenceContext) => { + const document = ctx.getTextDocument(uri); + if (!document) + return []; + const fileName = ctx.uriToFileName(document.uri); + const offset = document.offsetAt(position); + const references = (0, shared_1.safeCall)(() => ctx.languageService.findReferences(fileName, offset)); + if (!references) + return []; + const result = []; + for (const reference of references) { + if (referenceContext.includeDeclaration) { + const definition = (0, transforms_1.entryToLocation)(reference.definition, ctx); + if (definition) { + result.push(definition); + } + } + for (const referenceEntry of reference.references) { + const reference = (0, transforms_1.entryToLocation)(referenceEntry, ctx); + if (reference) { + result.push(reference); + } + } + } + return result; + }; +} +exports.register = register; +//# sourceMappingURL=references.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/78/8fec10279e78bc91d5ff626ceb484592b0dd7511923b84fc73861c41154a38c266031a21b6fb7e37327c8d4b43915f79f41e7eac62afb754691649d5ecacb5 b/.pnpm-store/v3/files/78/8fec10279e78bc91d5ff626ceb484592b0dd7511923b84fc73861c41154a38c266031a21b6fb7e37327c8d4b43915f79f41e7eac62afb754691649d5ecacb5 new file mode 100644 index 00000000..99efc31c --- /dev/null +++ b/.pnpm-store/v3/files/78/8fec10279e78bc91d5ff626ceb484592b0dd7511923b84fc73861c41154a38c266031a21b6fb7e37327c8d4b43915f79f41e7eac62afb754691649d5ecacb5 @@ -0,0 +1 @@ +{"version":3,"names":["_template","require","helper","minVersion","source","Object","freeze","ast","template","program","preserveComments","_default","exports","default","AsyncGenerator","OverloadYield","applyDecs","applyDecs2203","applyDecs2203R","applyDecs2301","applyDecs2305","asyncGeneratorDelegate","asyncIterator","awaitAsyncGenerator","callSuper","checkInRHS","construct","defineAccessor","dispose","importDeferProxy","interopRequireWildcard","isNativeReflectConstruct","iterableToArrayLimit","iterableToArrayLimitLoose","jsx","objectSpread2","regeneratorRuntime","setFunctionName","toPrimitive","toPropertyKey","typeof","using","usingCtx","wrapRegExp"],"sources":["../src/helpers-generated.ts"],"sourcesContent":["/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'yarn gulp generate-runtime-helpers'\n */\n\nimport template from \"@babel/template\";\n\nfunction helper(minVersion: string, source: string) {\n return Object.freeze({\n minVersion,\n ast: () => template.program.ast(source, { preserveComments: true }),\n });\n}\n\nexport default Object.freeze({\n // size: 1126, gzip size: 512\n AsyncGenerator: helper(\n \"7.0.0-beta.0\",\n 'import OverloadYield from\"OverloadYield\";export default function AsyncGenerator(e){var r,t;function resume(r,t){try{var n=e[r](t),o=n.value,u=o instanceof OverloadYield;Promise.resolve(u?o.v:o).then((function(t){if(u){var i=\"return\"===r?\"return\":\"next\";if(!o.k||t.done)return resume(i,t);t=e[i](t).value}settle(n.done?\"return\":\"normal\",t)}),(function(e){resume(\"throw\",e)}))}catch(e){settle(\"throw\",e)}}function settle(e,n){switch(e){case\"return\":r.resolve({value:n,done:!0});break;case\"throw\":r.reject(n);break;default:r.resolve({value:n,done:!1})}(r=r.next)?resume(r.key,r.arg):t=null}this._invoke=function(e,n){return new Promise((function(o,u){var i={key:e,arg:n,resolve:o,reject:u,next:null};t?t=t.next=i:(r=t=i,resume(e,n))}))},\"function\"!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype[\"function\"==typeof Symbol&&Symbol.asyncIterator||\"@@asyncIterator\"]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke(\"next\",e)},AsyncGenerator.prototype.throw=function(e){return this._invoke(\"throw\",e)},AsyncGenerator.prototype.return=function(e){return this._invoke(\"return\",e)};',\n ),\n // size: 62, gzip size: 78\n OverloadYield: helper(\n \"7.18.14\",\n \"export default function _OverloadYield(t,e){this.v=t,this.k=e}\",\n ),\n // size: 5887, gzip size: 2222\n applyDecs: helper(\n \"7.17.8\",\n 'import setFunctionName from\"setFunctionName\";import toPropertyKey from\"toPropertyKey\";function old_createMetadataMethodsForProperty(e,t,a,r){return{getMetadata:function(o){old_assertNotFinished(r,\"getMetadata\"),old_assertMetadataKey(o);var i=e[o];if(void 0!==i)if(1===t){var n=i.public;if(void 0!==n)return n[a]}else if(2===t){var l=i.private;if(void 0!==l)return l.get(a)}else if(Object.hasOwnProperty.call(i,\"constructor\"))return i.constructor},setMetadata:function(o,i){old_assertNotFinished(r,\"setMetadata\"),old_assertMetadataKey(o);var n=e[o];if(void 0===n&&(n=e[o]={}),1===t){var l=n.public;void 0===l&&(l=n.public={}),l[a]=i}else if(2===t){var s=n.priv;void 0===s&&(s=n.private=new Map),s.set(a,i)}else n.constructor=i}}}function old_convertMetadataMapToFinal(e,t){var a=e[Symbol.metadata||Symbol.for(\"Symbol.metadata\")],r=Object.getOwnPropertySymbols(t);if(0!==r.length){for(var o=0;o=0;m--){var b;void 0!==(p=old_memberDec(h[m],r,c,l,s,o,i,n,f))&&(old_assertValidReturnValue(o,p),0===o?b=p:1===o?(b=old_getInit(p),v=p.get||f.get,y=p.set||f.set,f={get:v,set:y}):f=p,void 0!==b&&(void 0===d?d=b:\"function\"==typeof d?d=[d,b]:d.push(b)))}if(0===o||1===o){if(void 0===d)d=function(e,t){return t};else if(\"function\"!=typeof d){var g=d;d=function(e,t){for(var a=t,r=0;r3,m=v>=5;if(m?(u=t,f=r,0!=(v-=5)&&(p=n=n||[])):(u=t.prototype,f=a,0!==v&&(p=i=i||[])),0!==v&&!h){var b=m?s:l,g=b.get(y)||0;if(!0===g||3===g&&4!==v||4===g&&3!==v)throw new Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+y);!g&&v>2?b.set(y,v):b.set(y,!0)}old_applyMemberDec(e,u,d,y,v,m,h,f,p)}}old_pushInitializers(e,i),old_pushInitializers(e,n)}function old_pushInitializers(e,t){t&&e.push((function(e){for(var a=0;a0){for(var o=[],i=t,n=t.name,l=r.length-1;l>=0;l--){var s={v:!1};try{var c=Object.assign({kind:\"class\",name:n,addInitializer:old_createAddInitializerMethod(o,s)},old_createMetadataMethodsForProperty(a,0,n,s)),d=r[l](i,c)}finally{s.v=!0}void 0!==d&&(old_assertValidReturnValue(10,d),i=d)}e.push(i,(function(){for(var e=0;e=0;v--){var g;void 0!==(f=memberDec(h[v],a,c,o,n,i,s,u))&&(assertValidReturnValue(n,f),0===n?g=f:1===n?(g=f.init,p=f.get||u.get,d=f.set||u.set,u={get:p,set:d}):u=f,void 0!==g&&(void 0===l?l=g:\"function\"==typeof l?l=[l,g]:l.push(g)))}if(0===n||1===n){if(void 0===l)l=function(e,t){return t};else if(\"function\"!=typeof l){var y=l;l=function(e,t){for(var r=t,a=0;a3,h=f>=5;if(h?(l=t,0!=(f-=5)&&(u=n=n||[])):(l=t.prototype,0!==f&&(u=a=a||[])),0!==f&&!d){var v=h?s:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw new Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(e,l,c,p,f,h,d,u)}}pushInitializers(e,a),pushInitializers(e,n)}(a,e,t),function(e,t,r){if(r.length>0){for(var a=[],n=t,i=t.name,s=r.length-1;s>=0;s--){var o={v:!1};try{var c=r[s](n,{kind:\"class\",name:i,addInitializer:createAddInitializerMethod(a,o)})}finally{o.v=!0}void 0!==c&&(assertValidReturnValue(10,c),n=c)}e.push(n,(function(){for(var e=0;e=0;g--){var y;void 0!==(p=memberDec(v[g],n,c,s,a,i,o,f))&&(assertValidReturnValue(a,p),0===a?y=p:1===a?(y=p.init,d=p.get||f.get,h=p.set||f.set,f={get:d,set:h}):f=p,void 0!==y&&(void 0===l?l=y:\"function\"==typeof l?l=[l,y]:l.push(y)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if(\"function\"!=typeof l){var m=l;l=function(e,t){for(var r=t,n=0;n3,h=f>=5;if(h?(l=e,0!=(f-=5)&&(u=n=n||[])):(l=e.prototype,0!==f&&(u=r=r||[])),0!==f&&!d){var v=h?o:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw new Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(a,l,c,p,f,h,d,u)}}return pushInitializers(a,r),pushInitializers(a,n),a}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var o={v:!1};try{var s=t[i](n,{kind:\"class\",name:a,addInitializer:createAddInitializerMethod(r,o)})}finally{o.v=!0}void 0!==s&&(assertValidReturnValue(10,s),n=s)}return[n,function(){for(var e=0;e=0;m--){var b;void 0!==(h=memberDec(g[m],n,u,o,a,i,s,p,c))&&(assertValidReturnValue(a,h),0===a?b=h:1===a?(b=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h,void 0!==b&&(void 0===l?l=b:\"function\"==typeof l?l=[l,b]:l.push(b)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if(\"function\"!=typeof l){var I=l;l=function(e,t){for(var r=t,n=0;n3,y=d>=5,g=r;if(y?(f=e,0!=(d-=5)&&(p=a=a||[]),v&&!i&&(i=function(t){return checkInRHS(t)===e}),g=i):(f=e.prototype,0!==d&&(p=n=n||[])),0!==d&&!v){var m=y?c:o,b=m.get(h)||0;if(!0===b||3===b&&4!==d||4===b&&3!==d)throw new Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+h);!b&&d>2?m.set(h,d):m.set(h,!0)}applyMemberDec(s,f,l,h,d,y,v,p,g)}}return pushInitializers(s,n),pushInitializers(s,a),s}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var s={v:!1};try{var o=t[i](n,{kind:\"class\",name:a,addInitializer:createAddInitializerMethod(r,s)})}finally{s.v=!0}void 0!==o&&(assertValidReturnValue(10,o),n=o)}return[n,function(){for(var e=0;e=0;j-=r?2:1){var D=v[j],E=r?v[j-1]:void 0,I={},O={kind:[\"field\",\"accessor\",\"method\",\"getter\",\"setter\",\"class\"][o],name:n,metadata:a,addInitializer:function(e,t){if(e.v)throw new Error(\"attempted to call addInitializer after decoration was finished\");s(t,\"An initializer\",\"be\",!0),c.push(t)}.bind(null,I)};try{if(b)(y=s(D.call(E,P,O),\"class decorators\",\"return\"))&&(P=y);else{var k,F;O.static=l,O.private=f,f?2===o?k=function(e){return m(e),w.value}:(o<4&&(k=i(w,\"get\",m)),3!==o&&(F=i(w,\"set\",m))):(k=function(e){return e[n]},(o<2||4===o)&&(F=function(e,t){e[n]=t}));var N=O.access={has:f?h.bind():function(e){return n in e}};if(k&&(N.get=k),F&&(N.set=F),P=D.call(E,d?{get:w.get,set:w.set}:w[A],O),d){if(\"object\"==typeof P&&P)(y=s(P.get,\"accessor.get\"))&&(w.get=y),(y=s(P.set,\"accessor.set\"))&&(w.set=y),(y=s(P.init,\"accessor.init\"))&&S.push(y);else if(void 0!==P)throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or void 0\")}else s(P,(p?\"field\":\"method\")+\" decorators\",\"return\")&&(p?S.push(P):w[A]=P)}}finally{I.v=!0}}return(p||d)&&u.push((function(e,t){for(var r=S.length-1;r>=0;r--)t=S[r].call(e,t);return t})),p||b||(f?d?u.push(i(w,\"get\"),i(w,\"set\")):u.push(2===o?w[A]:i.call.bind(w[A])):Object.defineProperty(e,n,w)),P}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(\"Symbol.metadata\"),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var l=a[Symbol.metadata||Symbol.for(\"Symbol.metadata\")];var f=Object.create(null==l?null:l),p=function(e,t,r,n){var o,a,i=[],s=function(t){return checkInRHS(t)===e},u=new Map;function l(e){e&&i.push(c.bind(null,e))}for(var f=0;f3,y=16&d,v=!!(8&d),g=0==(d&=7),b=h+\"/\"+v;if(!g&&!m){var w=u.get(b);if(!0===w||3===w&&4!==d||4===w&&3!==d)throw new Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+h);u.set(b,!(d>2)||d)}applyDec(v?e:e.prototype,p,y,m?\"#\"+h:toPropertyKey(h),d,n,v?a=a||[]:o=o||[],i,v,m,g,1===d,v&&m?s:r)}}return l(o),l(a),i}(e,t,o,f);return r.length||u(e,f),{e:p,get c(){var t=[];return r.length&&[u(applyDec(e,[r],n,e.name,5,f,t),f),c.bind(null,t,e)]}}}',\n ),\n // size: 544, gzip size: 300\n asyncGeneratorDelegate: helper(\n \"7.0.0-beta.0\",\n 'import OverloadYield from\"OverloadYield\";export default function _asyncGeneratorDelegate(t){var e={},n=!1;function pump(e,r){return n=!0,r=new Promise((function(n){n(t[e](r))})),{done:!1,value:new OverloadYield(r,1)}}return e[\"undefined\"!=typeof Symbol&&Symbol.iterator||\"@@iterator\"]=function(){return this},e.next=function(t){return n?(n=!1,t):pump(\"next\",t)},\"function\"==typeof t.throw&&(e.throw=function(t){if(n)throw n=!1,t;return pump(\"throw\",t)}),\"function\"==typeof t.return&&(e.return=function(t){return n?(n=!1,t):pump(\"return\",t)}),e}',\n ),\n // size: 1096, gzip size: 439\n asyncIterator: helper(\n \"7.15.9\",\n 'export default function _asyncIterator(r){var n,t,o,e=2;for(\"undefined\"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t=\"@@asyncIterator\",o=\"@@iterator\"}throw new TypeError(\"Object is not async iterable\")}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+\" is not an object.\"));var n=r.done;return Promise.resolve(r.value).then((function(r){return{value:r,done:n}}))}return AsyncFromSyncIterator=function(r){this.s=r,this.n=r.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},return:function(r){var n=this.s.return;return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))},throw:function(r){var n=this.s.return;return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))}},new AsyncFromSyncIterator(r)}',\n ),\n // size: 119, gzip size: 113\n awaitAsyncGenerator: helper(\n \"7.0.0-beta.0\",\n 'import OverloadYield from\"OverloadYield\";export default function _awaitAsyncGenerator(e){return new OverloadYield(e,0)}',\n ),\n // size: 366, gzip size: 187\n callSuper: helper(\n \"7.23.8\",\n 'import getPrototypeOf from\"getPrototypeOf\";import isNativeReflectConstruct from\"isNativeReflectConstruct\";import possibleConstructorReturn from\"possibleConstructorReturn\";export default function _callSuper(t,o,e){return o=getPrototypeOf(o),possibleConstructorReturn(t,isNativeReflectConstruct()?Reflect.construct(o,e||[],getPrototypeOf(t).constructor):o.apply(t,e))}',\n ),\n // size: 161, gzip size: 154\n checkInRHS: helper(\n \"7.20.5\",\n 'export default function _checkInRHS(e){if(Object(e)!==e)throw TypeError(\"right-hand side of \\'in\\' should be an object, got \"+(null!==e?typeof e:\"null\"));return e}',\n ),\n // size: 327, gzip size: 200\n construct: helper(\n \"7.0.0-beta.0\",\n 'import setPrototypeOf from\"setPrototypeOf\";import isNativeReflectConstruct from\"isNativeReflectConstruct\";export default function _construct(t,e,r){if(isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&setPrototypeOf(p,r.prototype),p}',\n ),\n // size: 130, gzip size: 130\n defineAccessor: helper(\n \"7.20.7\",\n \"export default function _defineAccessor(e,r,n,t){var c={configurable:!0,enumerable:!0};return c[e]=t,Object.defineProperty(r,n,c)}\",\n ),\n // size: 672, gzip size: 333\n dispose: helper(\n \"7.22.0\",\n 'function dispose_SuppressedError(r,e){return\"undefined\"!=typeof SuppressedError?dispose_SuppressedError=SuppressedError:(dispose_SuppressedError=function(r,e){this.suppressed=e,this.error=r,this.stack=(new Error).stack},dispose_SuppressedError.prototype=Object.create(Error.prototype,{constructor:{value:dispose_SuppressedError,writable:!0,configurable:!0}})),new dispose_SuppressedError(r,e)}export default function _dispose(r,e,s){function next(){for(;r.length>0;)try{var o=r.pop(),p=o.d.call(o.v);if(o.a)return Promise.resolve(p).then(next,err)}catch(r){return err(r)}if(s)throw e}function err(r){return e=s?new dispose_SuppressedError(e,r):r,s=!0,next()}return next()}',\n ),\n // size: 552, gzip size: 267\n importDeferProxy: helper(\n \"7.23.0\",\n \"export default function _importDeferProxy(e){var t=null,constValue=function(e){return function(){return e}},proxy=function(r){return function(n,o,f){return null===t&&(t=e()),r(t,o,f)}};return new Proxy({},{defineProperty:constValue(!1),deleteProperty:constValue(!1),get:proxy(Reflect.get),getOwnPropertyDescriptor:proxy(Reflect.getOwnPropertyDescriptor),getPrototypeOf:constValue(null),isExtensible:constValue(!1),has:proxy(Reflect.has),ownKeys:proxy(Reflect.ownKeys),preventExtensions:constValue(!0),set:constValue(!1),setPrototypeOf:constValue(!1)})}\",\n ),\n // size: 693, gzip size: 361\n interopRequireWildcard: helper(\n \"7.14.0\",\n 'function _getRequireWildcardCache(e){if(\"function\"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:r})(e)}export default function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||\"object\"!=typeof e&&\"function\"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(\"default\"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}',\n ),\n // size: 208, gzip size: 154\n isNativeReflectConstruct: helper(\n \"7.9.0\",\n \"export default function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}\",\n ),\n // size: 431, gzip size: 303\n iterableToArrayLimit: helper(\n \"7.0.0-beta.0\",\n 'export default function _iterableToArrayLimit(r,l){var t=null==r?null:\"undefined\"!=typeof Symbol&&r[Symbol.iterator]||r[\"@@iterator\"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}',\n ),\n // size: 228, gzip size: 196\n iterableToArrayLimitLoose: helper(\n \"7.0.0-beta.0\",\n 'export default function _iterableToArrayLimitLoose(e,r){var t=e&&(\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"]);if(null!=t){var o,l=[];for(t=t.call(e);e.length1){for(var t=new Array(n),f=0;f=0;--o){var i=this.tryEntries[o],a=i.completion;if(\"root\"===i.tryLoc)return handle(\"end\");if(i.tryLoc<=this.prev){var c=n.call(i,\"catchLoc\"),u=n.call(i,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),y}},e}',\n ),\n // size: 193, gzip size: 179\n setFunctionName: helper(\n \"7.23.6\",\n 'export default function setFunctionName(e,t,n){\"symbol\"==typeof t&&(t=(t=t.description)?\"[\"+t+\"]\":\"\");try{Object.defineProperty(e,\"name\",{configurable:!0,value:n?n+\" \"+t:t})}catch(e){}return e}',\n ),\n // size: 285, gzip size: 210\n toPrimitive: helper(\n \"7.1.5\",\n 'export default function toPrimitive(t,r){if(\"object\"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||\"default\");if(\"object\"!=typeof i)return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===r?String:Number)(t)}',\n ),\n // size: 145, gzip size: 129\n toPropertyKey: helper(\n \"7.1.5\",\n 'import toPrimitive from\"toPrimitive\";export default function toPropertyKey(t){var i=toPrimitive(t,\"string\");return\"symbol\"==typeof i?i:String(i)}',\n ),\n // size: 289, gzip size: 165\n typeof: helper(\n \"7.0.0-beta.0\",\n 'export default function _typeof(o){\"@babel/helpers - typeof\";return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},_typeof(o)}',\n ),\n // size: 432, gzip size: 261\n using: helper(\n \"7.22.0\",\n 'export default function _using(o,n,e){if(null==n)return n;if(Object(n)!==n)throw new TypeError(\"using declarations can only be used with objects, functions, null, or undefined.\");if(e)var r=n[Symbol.asyncDispose||Symbol.for(\"Symbol.asyncDispose\")];if(null==r&&(r=n[Symbol.dispose||Symbol.for(\"Symbol.dispose\")]),\"function\"!=typeof r)throw new TypeError(\"Property [Symbol.dispose] is not a function.\");return o.push({v:n,d:r,a:e}),n}',\n ),\n // size: 893, gzip size: 467\n usingCtx: helper(\n \"7.23.9\",\n 'export default function _usingCtx(){var r=\"function\"==typeof SuppressedError?SuppressedError:function(r,n){var e=new Error;return e.name=\"SuppressedError\",e.suppressed=n,e.error=r,e},n={},e=[];function using(r,n){if(null!=n){if(Object(n)!==n)throw new TypeError(\"using declarations can only be used with objects, functions, null, or undefined.\");if(r)var o=n[Symbol.asyncDispose||Symbol.for(\"Symbol.asyncDispose\")];if(null==o&&(o=n[Symbol.dispose||Symbol.for(\"Symbol.dispose\")]),\"function\"!=typeof o)throw new TypeError(\"Property [Symbol.dispose] is not a function.\");e.push({v:n,d:o,a:r})}return n}return{e:n,u:using.bind(null,!1),a:using.bind(null,!0),d:function(){var o=this.e;function next(){for(;r=e.pop();)try{var r,t=r.d.call(r.v);if(r.a)return Promise.resolve(t).then(next,err)}catch(r){return err(r)}if(o!==n)throw o}function err(e){return o=o!==n?new r(o,e):e,next()}return next()}}}',\n ),\n // size: 1256, gzip size: 573\n wrapRegExp: helper(\n \"7.19.0\",\n 'import setPrototypeOf from\"setPrototypeOf\";import inherits from\"inherits\";export default function _wrapRegExp(){_wrapRegExp=function(e,r){return new BabelRegExp(e,void 0,r)};var e=RegExp.prototype,r=new WeakMap;function BabelRegExp(e,t,p){var o=new RegExp(e,t);return r.set(o,p||r.get(e)),setPrototypeOf(o,BabelRegExp.prototype)}function buildGroups(e,t){var p=r.get(t);return Object.keys(p).reduce((function(r,t){var o=p[t];if(\"number\"==typeof o)r[t]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1]+)>/g,(function(e,r){var t=o[r];return\"$\"+(Array.isArray(t)?t.join(\"$\"):t)})))}if(\"function\"==typeof p){var i=this;return e[Symbol.replace].call(this,t,(function(){var e=arguments;return\"object\"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(buildGroups(e,i)),p.apply(this,e)}))}return e[Symbol.replace].call(this,t,p)},_wrapRegExp.apply(this,arguments)}',\n ),\n});\n"],"mappings":";;;;;;AAKA,IAAAA,SAAA,GAAAC,OAAA;AAEA,SAASC,MAAMA,CAACC,UAAkB,EAAEC,MAAc,EAAE;EAClD,OAAOC,MAAM,CAACC,MAAM,CAAC;IACnBH,UAAU;IACVI,GAAG,EAAEA,CAAA,KAAMC,iBAAQ,CAACC,OAAO,CAACF,GAAG,CAACH,MAAM,EAAE;MAAEM,gBAAgB,EAAE;IAAK,CAAC;EACpE,CAAC,CAAC;AACJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcR,MAAM,CAACC,MAAM,CAAC;EAE3BQ,cAAc,EAAEZ,MAAM,CACpB,cAAc,EACd,wmCACF,CAAC;EAEDa,aAAa,EAAEb,MAAM,CACnB,SAAS,EACT,gEACF,CAAC;EAEDc,SAAS,EAAEd,MAAM,CACf,QAAQ,EACR,iwLACF,CAAC;EAEDe,aAAa,EAAEf,MAAM,CACnB,QAAQ,EACR,8xHACF,CAAC;EAEDgB,cAAc,EAAEhB,MAAM,CACpB,QAAQ,EACR,6/HACF,CAAC;EAEDiB,aAAa,EAAEjB,MAAM,CACnB,QAAQ,EACR,gkJACF,CAAC;EAEDkB,aAAa,EAAElB,MAAM,CACnB,QAAQ,EACR,urGACF,CAAC;EAEDmB,sBAAsB,EAAEnB,MAAM,CAC5B,cAAc,EACd,kiBACF,CAAC;EAEDoB,aAAa,EAAEpB,MAAM,CACnB,QAAQ,EACR,0kCACF,CAAC;EAEDqB,mBAAmB,EAAErB,MAAM,CACzB,cAAc,EACd,yHACF,CAAC;EAEDsB,SAAS,EAAEtB,MAAM,CACf,QAAQ,EACR,gXACF,CAAC;EAEDuB,UAAU,EAAEvB,MAAM,CAChB,QAAQ,EACR,qKACF,CAAC;EAEDwB,SAAS,EAAExB,MAAM,CACf,cAAc,EACd,yUACF,CAAC;EAEDyB,cAAc,EAAEzB,MAAM,CACpB,QAAQ,EACR,oIACF,CAAC;EAED0B,OAAO,EAAE1B,MAAM,CACb,QAAQ,EACR,kqBACF,CAAC;EAED2B,gBAAgB,EAAE3B,MAAM,CACtB,QAAQ,EACR,0iBACF,CAAC;EAED4B,sBAAsB,EAAE5B,MAAM,CAC5B,QAAQ,EACR,urBACF,CAAC;EAED6B,wBAAwB,EAAE7B,MAAM,CAC9B,OAAO,EACP,kNACF,CAAC;EAED8B,oBAAoB,EAAE9B,MAAM,CAC1B,cAAc,EACd,ibACF,CAAC;EAED+B,yBAAyB,EAAE/B,MAAM,CAC/B,cAAc,EACd,sOACF,CAAC;EAEDgC,GAAG,EAAEhC,MAAM,CACT,cAAc,EACd,6hBACF,CAAC;EAEDiC,aAAa,EAAEjC,MAAM,CACnB,OAAO,EACP,uqBACF,CAAC;EAEDkC,kBAAkB,EAAElC,MAAM,CACxB,QAAQ,EACR,g+OACF,CAAC;EAEDmC,eAAe,EAAEnC,MAAM,CACrB,QAAQ,EACR,mMACF,CAAC;EAEDoC,WAAW,EAAEpC,MAAM,CACjB,OAAO,EACP,+RACF,CAAC;EAEDqC,aAAa,EAAErC,MAAM,CACnB,OAAO,EACP,mJACF,CAAC;EAEDsC,MAAM,EAAEtC,MAAM,CACZ,cAAc,EACd,mSACF,CAAC;EAEDuC,KAAK,EAAEvC,MAAM,CACX,QAAQ,EACR,kbACF,CAAC;EAEDwC,QAAQ,EAAExC,MAAM,CACd,QAAQ,EACR,+3BACF,CAAC;EAEDyC,UAAU,EAAEzC,MAAM,CAChB,QAAQ,EACR,2uCACF;AACF,CAAC,CAAC"} \ No newline at end of file diff --git a/.pnpm-store/v3/files/78/c3749f6901fb9f76e263809bf8cbfcedc44b767c1733a8a01dc9099ab7198ea9fad22ef392d27633a27cee2dd833a57dcd0410c963de6573af9bebf3d5d502 b/.pnpm-store/v3/files/78/c3749f6901fb9f76e263809bf8cbfcedc44b767c1733a8a01dc9099ab7198ea9fad22ef392d27633a27cee2dd833a57dcd0410c963de6573af9bebf3d5d502 new file mode 100644 index 00000000..9a048561 --- /dev/null +++ b/.pnpm-store/v3/files/78/c3749f6901fb9f76e263809bf8cbfcedc44b767c1733a8a01dc9099ab7198ea9fad22ef392d27633a27cee2dd833a57dcd0410c963de6573af9bebf3d5d502 @@ -0,0 +1,162 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const explicitReturnTypeUtils_1 = require("../util/explicitReturnTypeUtils"); +exports.default = (0, util_1.createRule)({ + name: 'explicit-function-return-type', + meta: { + type: 'problem', + docs: { + description: 'Require explicit return types on functions and class methods', + }, + messages: { + missingReturnType: 'Missing return type on function.', + }, + schema: [ + { + type: 'object', + properties: { + allowConciseArrowFunctionExpressionsStartingWithVoid: { + description: 'Whether to allow arrow functions that start with the `void` keyword.', + type: 'boolean', + }, + allowExpressions: { + description: 'Whether to ignore function expressions (functions which are not part of a declaration).', + type: 'boolean', + }, + allowHigherOrderFunctions: { + description: 'Whether to ignore functions immediately returning another function expression.', + type: 'boolean', + }, + allowTypedFunctionExpressions: { + description: 'Whether to ignore type annotations on the variable of function expressions.', + type: 'boolean', + }, + allowDirectConstAssertionInArrowFunctions: { + description: 'Whether to ignore arrow functions immediately returning a `as const` value.', + type: 'boolean', + }, + allowFunctionsWithoutTypeParameters: { + description: "Whether to ignore functions that don't have generic type parameters.", + type: 'boolean', + }, + allowedNames: { + description: 'An array of function/method names that will not have their arguments or return values checked.', + items: { + type: 'string', + }, + type: 'array', + }, + allowIIFEs: { + description: 'Whether to ignore immediately invoked function expressions (IIFEs).', + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + allowExpressions: false, + allowTypedFunctionExpressions: true, + allowHigherOrderFunctions: true, + allowDirectConstAssertionInArrowFunctions: true, + allowConciseArrowFunctionExpressionsStartingWithVoid: false, + allowFunctionsWithoutTypeParameters: false, + allowedNames: [], + allowIIFEs: false, + }, + ], + create(context, [options]) { + function isAllowedFunction(node) { + if (options.allowFunctionsWithoutTypeParameters && !node.typeParameters) { + return true; + } + if (options.allowIIFEs && isIIFE(node)) { + return true; + } + if (!options.allowedNames?.length) { + return false; + } + if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + node.type === utils_1.AST_NODE_TYPES.FunctionExpression) { + const parent = node.parent; + let funcName; + if (node.id?.name) { + funcName = node.id.name; + } + else { + switch (parent.type) { + case utils_1.AST_NODE_TYPES.VariableDeclarator: { + if (parent.id.type === utils_1.AST_NODE_TYPES.Identifier) { + funcName = parent.id.name; + } + break; + } + case utils_1.AST_NODE_TYPES.MethodDefinition: + case utils_1.AST_NODE_TYPES.PropertyDefinition: + case utils_1.AST_NODE_TYPES.Property: { + if (parent.key.type === utils_1.AST_NODE_TYPES.Identifier && + !parent.computed) { + funcName = parent.key.name; + } + break; + } + } + } + if (!!funcName && !!options.allowedNames.includes(funcName)) { + return true; + } + } + if (node.type === utils_1.AST_NODE_TYPES.FunctionDeclaration && + node.id && + !!options.allowedNames.includes(node.id.name)) { + return true; + } + return false; + } + function isIIFE(node) { + return node.parent.type === utils_1.AST_NODE_TYPES.CallExpression; + } + return { + 'ArrowFunctionExpression, FunctionExpression'(node) { + if (options.allowConciseArrowFunctionExpressionsStartingWithVoid && + node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.expression && + node.body.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.body.operator === 'void') { + return; + } + if (isAllowedFunction(node)) { + return; + } + if (options.allowTypedFunctionExpressions && + ((0, explicitReturnTypeUtils_1.isValidFunctionExpressionReturnType)(node, options) || + (0, explicitReturnTypeUtils_1.ancestorHasReturnType)(node))) { + return; + } + (0, explicitReturnTypeUtils_1.checkFunctionReturnType)(node, options, context.sourceCode, loc => context.report({ + node, + loc, + messageId: 'missingReturnType', + })); + }, + FunctionDeclaration(node) { + if (isAllowedFunction(node)) { + return; + } + if (options.allowTypedFunctionExpressions && node.returnType) { + return; + } + (0, explicitReturnTypeUtils_1.checkFunctionReturnType)(node, options, context.sourceCode, loc => context.report({ + node, + loc, + messageId: 'missingReturnType', + })); + }, + }; + }, +}); +//# sourceMappingURL=explicit-function-return-type.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/78/d7722df42fa19cacc19be39dafac1950c1a2a474985af6a67df833a11d69ae5ab23a48e35932c8fa3b6007a40abad79aafa099b27cc01b087f90eae4faaffb b/.pnpm-store/v3/files/78/d7722df42fa19cacc19be39dafac1950c1a2a474985af6a67df833a11d69ae5ab23a48e35932c8fa3b6007a40abad79aafa099b27cc01b087f90eae4faaffb new file mode 100644 index 00000000..1d796213 --- /dev/null +++ b/.pnpm-store/v3/files/78/d7722df42fa19cacc19be39dafac1950c1a2a474985af6a67df833a11d69ae5ab23a48e35932c8fa3b6007a40abad79aafa099b27cc01b087f90eae4faaffb @@ -0,0 +1,254 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.matchFiles = void 0; +const core_1 = require("./core"); +const path_1 = require("./path"); +require("./types"); +// KLUDGE: Don't assume one 'node_modules' links to another. More likely a single directory inside the node_modules is the symlink. +// ALso, don't assume that an `@foo` directory is linked. More likely the contents of that are linked. +// Reserved characters, forces escaping of any non-word (or digit), non-whitespace character. +// It may be inefficient (we could just match (/[-[\]{}()*+?.,\\^$|#\s]/g), but this is future +// proof. +const reservedCharacterPattern = /[^\w\s\/]/g; +const wildcardCharCodes = [42 /* CharacterCodes.asterisk */, 63 /* CharacterCodes.question */]; +const commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; +const implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`; +const filesMatcher = { + /** + * Matches any single directory segment unless it is the last segment and a .min.js file + * Breakdown: + * [^./] # matches everything up to the first . character (excluding directory separators) + * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension + */ + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + replaceWildcardCharacter: match => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment) +}; +const directoriesMatcher = { + singleAsteriskRegexFragment: "[^/]*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + replaceWildcardCharacter: match => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment) +}; +const excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: match => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment) +}; +const wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher +}; +function getRegularExpressionForWildcard(specs, basePath, usage) { + const patterns = getRegularExpressionsForWildcards(specs, basePath, usage); + if (!patterns || !patterns.length) { + return undefined; + } + const pattern = patterns.map(pattern => `(${pattern})`).join("|"); + // If excluding, match "foo/bar/baz...", but if including, only allow "foo". + const terminator = usage === "exclude" ? "($|/)" : "$"; + return `^(${pattern})${terminator}`; +} +function getRegularExpressionsForWildcards(specs, basePath, usage) { + if (specs === undefined || specs.length === 0) { + return undefined; + } + return (0, core_1.flatMap)(specs, spec => spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage])); +} +/** + * An "includes" path "foo" is implicitly a glob "foo/** /*" (without the space) if its last component has no extension, + * and does not contain any glob characters itself. + */ +function isImplicitGlob(lastPathComponent) { + return !/[.*?]/.test(lastPathComponent); +} +function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter }) { + let subpattern = ""; + let hasWrittenComponent = false; + const components = (0, path_1.getNormalizedPathComponents)(spec, basePath); + const lastComponent = (0, core_1.last)(components); + if (usage !== "exclude" && lastComponent === "**") { + return undefined; + } + // getNormalizedPathComponents includes the separator for the root component. + // We need to remove to create our regex correctly. + components[0] = (0, path_1.removeTrailingDirectorySeparator)(components[0]); + if (isImplicitGlob(lastComponent)) { + components.push("**", "*"); + } + let optionalCount = 0; + for (let component of components) { + if (component === "**") { + subpattern += doubleAsteriskRegexFragment; + } + else { + if (usage === "directories") { + subpattern += "("; + optionalCount++; + } + if (hasWrittenComponent) { + subpattern += path_1.directorySeparator; + } + if (usage !== "exclude") { + let componentPattern = ""; + // The * and ? wildcards should not match directories or files that start with . if they + // appear first in a component. Dotted directories and files can be included explicitly + // like so: **/.*/.* + if (component.charCodeAt(0) === 42 /* CharacterCodes.asterisk */) { + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + component = component.substr(1); + } + else if (component.charCodeAt(0) === 63 /* CharacterCodes.question */) { + componentPattern += "[^./]"; + component = component.substr(1); + } + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + // Patterns should not include subfolders like node_modules unless they are + // explicitly included as part of the path. + // + // As an optimization, if the component pattern is the same as the component, + // then there definitely were no wildcard characters and we do not need to + // add the exclusion pattern. + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + subpattern += componentPattern; + } + else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter); + } + } + hasWrittenComponent = true; + } + while (optionalCount > 0) { + subpattern += ")?"; + optionalCount--; + } + return subpattern; +} +function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { + return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; +} +/** @param path directory of the tsconfig.json */ +function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) { + path = (0, path_1.normalizePath)(path); + currentDirectory = (0, path_1.normalizePath)(currentDirectory); + const absolutePath = (0, path_1.combinePaths)(currentDirectory, path); + return { + includeFilePatterns: (0, core_1.map)(getRegularExpressionsForWildcards(includes, absolutePath, "files"), pattern => `^${pattern}$`), + includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), + includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), + excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), + basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames) + }; +} +function getRegexFromPattern(pattern, useCaseSensitiveFileNames) { + return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i"); +} +/** @param path directory of the tsconfig.json */ +function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) { + path = (0, path_1.normalizePath)(path); + currentDirectory = (0, path_1.normalizePath)(currentDirectory); + const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); + const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(pattern => getRegexFromPattern(pattern, useCaseSensitiveFileNames)); + const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames); + const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames); + // Associate an array of results with each include regex. This keeps results in order of the "include" order. + // If there are no "includes", then just put everything in results[0]. + const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]]; + const visited = new Map(); + const toCanonical = (0, core_1.createGetCanonicalFileName)(useCaseSensitiveFileNames); + for (const basePath of patterns.basePaths) { + visitDirectory(basePath, (0, path_1.combinePaths)(currentDirectory, basePath), depth); + } + return (0, core_1.flatten)(results); + function visitDirectory(path, absolutePath, depth) { + const canonicalPath = toCanonical(realpath(absolutePath)); + if (visited.has(canonicalPath)) { + return; + } + visited.set(canonicalPath, true); + const { files, directories } = getFileSystemEntries(path); + for (const current of (0, core_1.sort)(files, core_1.compareStringsCaseSensitive)) { + const name = (0, path_1.combinePaths)(path, current); + const absoluteName = (0, path_1.combinePaths)(absolutePath, current); + if (extensions && !(0, path_1.fileExtensionIsOneOf)(name, extensions)) { + continue; + } + if (excludeRegex && excludeRegex.test(absoluteName)) { + continue; + } + if (!includeFileRegexes) { + results[0].push(name); + } + else { + const includeIndex = (0, core_1.findIndex)(includeFileRegexes, re => re.test(absoluteName)); + if (includeIndex !== -1) { + results[includeIndex].push(name); + } + } + } + if (depth !== undefined) { + depth--; + if (depth === 0) { + return; + } + } + for (const current of (0, core_1.sort)(directories, core_1.compareStringsCaseSensitive)) { + const name = (0, path_1.combinePaths)(path, current); + const absoluteName = (0, path_1.combinePaths)(absolutePath, current); + if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && + (!excludeRegex || !excludeRegex.test(absoluteName))) { + visitDirectory(name, absoluteName, depth); + } + } + } +} +exports.matchFiles = matchFiles; +/** + * Computes the unique non-wildcard base paths amongst the provided include patterns. + */ +function getBasePaths(path, includes, useCaseSensitiveFileNames) { + // Storage for our results in the form of literal paths (e.g. the paths as written by the user). + const basePaths = [path]; + if (includes) { + // Storage for literal base paths amongst the include patterns. + const includeBasePaths = []; + for (const include of includes) { + // We also need to check the relative paths by converting them to absolute and normalizing + // in case they escape the base path (e.g "..\somedirectory") + const absolute = (0, path_1.isRootedDiskPath)(include) ? include : (0, path_1.normalizePath)((0, path_1.combinePaths)(path, include)); + // Append the literal and canonical candidate base paths. + includeBasePaths.push(getIncludeBasePath(absolute)); + } + // Sort the offsets array using either the literal or canonical path representations. + includeBasePaths.sort((0, core_1.getStringComparer)(!useCaseSensitiveFileNames)); + // Iterate over each include base path and include unique base paths that are not a + // subpath of an existing base path + for (const includeBasePath of includeBasePaths) { + if ((0, core_1.every)(basePaths, basePath => !(0, path_1.containsPath)(basePath, includeBasePath, path, !useCaseSensitiveFileNames))) { + basePaths.push(includeBasePath); + } + } + } + return basePaths; +} +function getIncludeBasePath(absolute) { + const wildcardOffset = (0, core_1.indexOfAnyCharCode)(absolute, wildcardCharCodes); + if (wildcardOffset < 0) { + // No "*" or "?" in the path + return !(0, path_1.hasExtension)(absolute) + ? absolute + : (0, path_1.removeTrailingDirectorySeparator)((0, path_1.getDirectoryPath)(absolute)); + } + return absolute.substring(0, absolute.lastIndexOf(path_1.directorySeparator, wildcardOffset)); +} +//# sourceMappingURL=utilities.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/78/ddfd9503f01728337a5408a98e55eeaf693731d162ac39b59803994b9c3a31649048ff3b970d1450238f0a2796213073fe6a0168c4746e1581aa1acd4e373e b/.pnpm-store/v3/files/78/ddfd9503f01728337a5408a98e55eeaf693731d162ac39b59803994b9c3a31649048ff3b970d1450238f0a2796213073fe6a0168c4746e1581aa1acd4e373e new file mode 100644 index 00000000..781e63bc --- /dev/null +++ b/.pnpm-store/v3/files/78/ddfd9503f01728337a5408a98e55eeaf693731d162ac39b59803994b9c3a31649048ff3b970d1450238f0a2796213073fe6a0168c4746e1581aa1acd4e373e @@ -0,0 +1,241 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.register = exports.errorMarkups = exports.updateRange = void 0; +const language_core_1 = require("@volar/language-core"); +const cancellation_1 = require("../utils/cancellation"); +const common_1 = require("../utils/common"); +const dedupe = require("../utils/dedupe"); +const featureWorkers_1 = require("../utils/featureWorkers"); +function updateRange(range, change) { + if (!updatePosition(range.start, change, false)) { + return; + } + if (!updatePosition(range.end, change, true)) { + return; + } + if (range.end.line === range.start.line && range.end.character <= range.start.character) { + range.end.character++; + } + return range; +} +exports.updateRange = updateRange; +function updatePosition(position, change, isEnd) { + if (change.range.end.line > position.line) { + if (change.newEnd.line > position.line) { + // No change + return true; + } + else if (change.newEnd.line === position.line) { + position.character = Math.min(position.character, change.newEnd.character); + return true; + } + else if (change.newEnd.line < position.line) { + position.line = change.newEnd.line; + position.character = change.newEnd.character; + return true; + } + } + else if (change.range.end.line === position.line) { + const characterDiff = change.newEnd.character - change.range.end.character; + if (position.character >= change.range.end.character) { + if (change.newEnd.line !== change.range.end.line) { + position.line = change.newEnd.line; + position.character = change.newEnd.character + position.character - change.range.end.character; + } + else { + if (isEnd ? change.range.end.character < position.character : change.range.end.character <= position.character) { + position.character += characterDiff; + } + else { + const offset = change.range.end.character - position.character; + if (-characterDiff > offset) { + position.character += characterDiff + offset; + } + } + } + return true; + } + else { + if (change.newEnd.line === change.range.end.line) { + const offset = change.range.end.character - position.character; + if (-characterDiff > offset) { + position.character += characterDiff + offset; + } + } + else if (change.newEnd.line < change.range.end.line) { + position.line = change.newEnd.line; + position.character = change.newEnd.character; + } + else { + // No change + } + return true; + } + } + else if (change.range.end.line < position.line) { + position.line += change.newEnd.line - change.range.end.line; + return true; + } + return false; +} +exports.errorMarkups = {}; +function register(context) { + const lastResponses = new Map(); + const cacheMaps = { + semantic: new Map(), + syntactic: new Map(), + }; + context.env.onDidChangeConfiguration?.(() => { + lastResponses.clear(); + cacheMaps.semantic.clear(); + cacheMaps.syntactic.clear(); + }); + return async (uri, token = cancellation_1.NoneCancellationToken, response) => { + const sourceFile = context.language.files.get(uri); + if (!sourceFile) { + return []; + } + const document = context.documents.get(uri, sourceFile.languageId, sourceFile.snapshot); + const lastResponse = lastResponses.get(uri) ?? lastResponses.set(uri, { + semantic: { errors: [] }, + syntactic: { errors: [] }, + }).get(uri); + let updateCacheRangeFailed = false; + let errorsUpdated = false; + let lastCheckCancelAt = 0; + for (const cache of Object.values(lastResponse)) { + const oldSnapshot = cache.snapshot; + const oldDocument = cache.document; + const change = oldSnapshot ? sourceFile.snapshot.getChangeRange(oldSnapshot) : undefined; + cache.snapshot = sourceFile.snapshot; + cache.document = document; + if (!updateCacheRangeFailed && oldDocument && change) { + const changeRange = { + range: { + start: oldDocument.positionAt(change.span.start), + end: oldDocument.positionAt(change.span.start + change.span.length), + }, + newEnd: document.positionAt(change.span.start + change.newLength), + }; + for (const error of cache.errors) { + if (!updateRange(error.range, changeRange)) { + updateCacheRangeFailed = true; + break; + } + } + } + } + await worker('provideDiagnostics', cacheMaps.syntactic, lastResponse.syntactic); + await doResponse(); + await worker('provideSemanticDiagnostics', cacheMaps.semantic, lastResponse.semantic); + return await collectErrors(); + async function doResponse() { + if (errorsUpdated && !updateCacheRangeFailed) { + response?.(await collectErrors()); + errorsUpdated = false; + } + } + async function collectErrors() { + const errors = Object.values(lastResponse).flatMap(({ errors }) => errors); + exports.errorMarkups[uri] = []; + for (const error of errors) { + for (const service of context.services) { + if (context.disabledServicePlugins.has(service[1])) { + continue; + } + const markup = await service[1].provideDiagnosticMarkupContent?.(error, token); + if (markup) { + exports.errorMarkups[uri].push({ error, markup }); + } + } + } + return errors; + } + async function worker(api, cacheMap, cache) { + const result = await (0, featureWorkers_1.documentFeatureWorker)(context, uri, map => map.map.mappings.some(mapping => (0, language_core_1.isDiagnosticsEnabled)(mapping.data)), async (service, document) => { + if (token) { + if (Date.now() - lastCheckCancelAt >= 5) { + await (0, common_1.sleep)(5); // waiting LSP event polling + lastCheckCancelAt = Date.now(); + } + if (token.isCancellationRequested) { + return; + } + } + const serviceIndex = context.services.indexOf(service); + const serviceCache = cacheMap.get(serviceIndex) ?? cacheMap.set(serviceIndex, new Map()).get(serviceIndex); + const cache = serviceCache.get(document.uri); + if (api !== 'provideSemanticDiagnostics' && cache && cache.documentVersion === document.version) { + return cache.errors; + } + const errors = await service[1][api]?.(document, token); + errors?.forEach(error => { + error.data = { + uri, + version: document.version, + serviceIndex, + isFormat: false, + original: { + data: error.data, + }, + documentUri: document.uri, + }; + }); + errorsUpdated = true; + serviceCache.set(document.uri, { + documentVersion: document.version, + errors, + }); + return errors; + }, (errors, map) => { + return transformErrorRangeBase(errors, map, language_core_1.shouldReportDiagnostics); + }, arr => dedupe.withDiagnostics(arr.flat())); + if (result) { + cache.errors = result; + cache.snapshot = sourceFile?.snapshot; + } + } + }; + function transformErrorRangeBase(errors, map, filter) { + const result = []; + for (const error of errors) { + // clone it to avoid modify cache + let _error = { ...error }; + if (map) { + const range = map.getSourceRange(error.range, filter); + if (!range) { + continue; + } + _error.range = range; + } + if (_error.relatedInformation) { + const relatedInfos = []; + for (const info of _error.relatedInformation) { + const [virtualCode] = context.documents.getVirtualCodeByUri(info.location.uri); + if (virtualCode) { + for (const map of context.documents.getMaps(virtualCode)) { + const range = map.getSourceRange(info.location.range, filter); + if (range) { + relatedInfos.push({ + location: { + uri: map.sourceFileDocument.uri, + range, + }, + message: info.message, + }); + } + } + } + else { + relatedInfos.push(info); + } + } + _error.relatedInformation = relatedInfos; + } + result.push(_error); + } + return result; + } +} +exports.register = register; +//# sourceMappingURL=provideDiagnostics.js.map \ No newline at end of file diff --git a/.pnpm-store/v3/files/78/e7a6a7bcf5821f23b97c06de4b35542b939f8448110f95dd6e4f920f1566f8ca070a0239df75aefef58ac5a30229d05fecede02780a1e742a653563e2d4157 b/.pnpm-store/v3/files/78/e7a6a7bcf5821f23b97c06de4b35542b939f8448110f95dd6e4f920f1566f8ca070a0239df75aefef58ac5a30229d05fecede02780a1e742a653563e2d4157 new file mode 100644 index 00000000..a26aa346 --- /dev/null +++ b/.pnpm-store/v3/files/78/e7a6a7bcf5821f23b97c06de4b35542b939f8448110f95dd6e4f920f1566f8ca070a0239df75aefef58ac5a30229d05fecede02780a1e742a653563e2d4157 @@ -0,0 +1,26 @@ +import { r as runBaseTests } from '../vendor/base.Rmxiv35Y.js'; +import { a as createThreadsRpcOptions } from '../vendor/utils.GbToHGHI.js'; +import 'vite-node/client'; +import '../vendor/global.CkGT_TMy.js'; +import '../vendor/execute.TxmaEFIQ.js'; +import 'node:vm'; +import 'node:url'; +import 'vite-node/utils'; +import 'pathe'; +import '@vitest/utils/error'; +import '../path.js'; +import 'node:fs'; +import '@vitest/utils'; +import '../vendor/base.QYERqzkH.js'; + +class ThreadsBaseWorker { + getRpcOptions(ctx) { + return createThreadsRpcOptions(ctx); + } + runTests(state) { + return runBaseTests(state); + } +} +var threads = new ThreadsBaseWorker(); + +export { threads as default }; diff --git a/.pnpm-store/v3/files/79/684b82ae1d5878a84b22517bf8f37a4eeee570265580d6d76ab6839e3f4f6ce3e9a743eb3c108f1c1d3ec02c840b29164d0b76520b77adc18e20905ba5b072 b/.pnpm-store/v3/files/79/684b82ae1d5878a84b22517bf8f37a4eeee570265580d6d76ab6839e3f4f6ce3e9a743eb3c108f1c1d3ec02c840b29164d0b76520b77adc18e20905ba5b072 new file mode 100644 index 00000000..92e79c4f --- /dev/null +++ b/.pnpm-store/v3/files/79/684b82ae1d5878a84b22517bf8f37a4eeee570265580d6d76ab6839e3f4f6ce3e9a743eb3c108f1c1d3ec02c840b29164d0b76520b77adc18e20905ba5b072 @@ -0,0 +1,68191 @@ +import fs$l, { promises as promises$1 } from 'node:fs'; +import fsp from 'node:fs/promises'; +import path$o, { posix as posix$1, isAbsolute as isAbsolute$2, dirname as dirname$2, join as join$2, extname as extname$1, relative as relative$2, basename as basename$2 } from 'node:path'; +import { fileURLToPath, URL as URL$3, parse as parse$i, pathToFileURL } from 'node:url'; +import { promisify as promisify$4, format as format$2, inspect } from 'node:util'; +import { performance } from 'node:perf_hooks'; +import { createRequire as createRequire$1, builtinModules } from 'node:module'; +import require$$0$3 from 'tty'; +import require$$0$4, { win32, posix, isAbsolute as isAbsolute$1, resolve as resolve$3, relative as relative$1, basename as basename$1, extname, dirname as dirname$1, join as join$1, sep, normalize } from 'path'; +import esbuild, { transform as transform$1, formatMessages, build as build$3 } from 'esbuild'; +import * as require$$0$2 from 'fs'; +import require$$0__default, { existsSync, readFileSync, statSync as statSync$1, readdirSync } from 'fs'; +import require$$0$5 from 'events'; +import require$$5 from 'assert'; +import { createServer as createServer$3, STATUS_CODES, get as get$2 } from 'node:http'; +import { createServer as createServer$2, get as get$1 } from 'node:https'; +import require$$0$6 from 'util'; +import require$$4$1 from 'net'; +import require$$0$9 from 'url'; +import require$$1 from 'http'; +import require$$0$7 from 'stream'; +import require$$2 from 'os'; +import require$$2$1 from 'child_process'; +import os$4 from 'node:os'; +import { exec } from 'node:child_process'; +import { createHash as createHash$2 } from 'node:crypto'; +import { promises } from 'node:dns'; +import { CLIENT_ENTRY, VALID_ID_PREFIX, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, wildcardHosts, loopbackHosts, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, DEFAULT_ASSETS_INLINE_LIMIT, CSS_LANGS_RE, ESBUILD_MODULES_TARGET, SPECIAL_QUERY_RE, ENV_ENTRY, DEP_VERSION_RE, DEFAULT_MAIN_FIELDS, DEFAULT_EXTENSIONS, KNOWN_ASSET_TYPES, JS_TYPES_RE, METADATA_FILENAME, VITE_PACKAGE_DIR, DEFAULT_DEV_PORT, CLIENT_DIR, VERSION, DEFAULT_PREVIEW_PORT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES } from '../constants.js'; +import require$$0$a from 'crypto'; +import require$$0$8, { createRequire as createRequire$2 } from 'module'; +import assert$1 from 'node:assert'; +import v8 from 'node:v8'; +import { Worker as Worker$1 } from 'node:worker_threads'; +import { Buffer as Buffer$1 } from 'node:buffer'; +import { EventEmitter as EventEmitter$4 } from 'node:events'; +import { parseAst, parseAstAsync } from 'rollup/parseAst'; +import * as qs from 'querystring'; +import readline from 'node:readline'; +import require$$0$b from 'zlib'; +import require$$0$c from 'buffer'; +import require$$1$1 from 'https'; +import require$$4$2 from 'tls'; +import zlib$1, { gzip } from 'node:zlib'; + +import { fileURLToPath as __cjs_fileURLToPath } from 'node:url'; +import { dirname as __cjs_dirname } from 'node:path'; +import { createRequire as __cjs_createRequire } from 'node:module'; + +const __filename = __cjs_fileURLToPath(import.meta.url); +const __dirname = __cjs_dirname(__filename); +const require = __cjs_createRequire(import.meta.url); +const __require = require; +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + if (this instanceof a) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} + +var picocolors = {exports: {}}; + +let tty = require$$0$3; + +let isColorSupported = + !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && + ("FORCE_COLOR" in process.env || + process.argv.includes("--color") || + process.platform === "win32" || + (tty.isatty(1) && process.env.TERM !== "dumb") || + "CI" in process.env); + +let formatter = + (open, close, replace = open) => + input => { + let string = "" + input; + let index = string.indexOf(close, open.length); + return ~index + ? open + replaceClose(string, close, replace, index) + close + : open + string + close + }; + +let replaceClose = (string, close, replace, index) => { + let start = string.substring(0, index) + replace; + let end = string.substring(index + close.length); + let nextIndex = end.indexOf(close); + return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end +}; + +let createColors = (enabled = isColorSupported) => ({ + isColorSupported: enabled, + reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String, + bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String, + dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String, + italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String, + underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String, + inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String, + hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String, + strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String, + black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String, + red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String, + green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String, + yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String, + blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String, + magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String, + cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String, + white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String, + gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String, + bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String, + bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String, + bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String, + bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String, + bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String, + bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String, + bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String, + bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String, +}); + +picocolors.exports = createColors(); +picocolors.exports.createColors = createColors; + +var picocolorsExports = picocolors.exports; +var colors$1 = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports); + +function matches$1(pattern, importee) { + if (pattern instanceof RegExp) { + return pattern.test(importee); + } + if (importee.length < pattern.length) { + return false; + } + if (importee === pattern) { + return true; + } + // eslint-disable-next-line prefer-template + return importee.startsWith(pattern + '/'); +} +function getEntries({ entries, customResolver }) { + if (!entries) { + return []; + } + const resolverFunctionFromOptions = resolveCustomResolver(customResolver); + if (Array.isArray(entries)) { + return entries.map((entry) => { + return { + find: entry.find, + replacement: entry.replacement, + resolverFunction: resolveCustomResolver(entry.customResolver) || resolverFunctionFromOptions + }; + }); + } + return Object.entries(entries).map(([key, value]) => { + return { find: key, replacement: value, resolverFunction: resolverFunctionFromOptions }; + }); +} +function getHookFunction(hook) { + if (typeof hook === 'function') { + return hook; + } + if (hook && 'handler' in hook && typeof hook.handler === 'function') { + return hook.handler; + } + return null; +} +function resolveCustomResolver(customResolver) { + if (typeof customResolver === 'function') { + return customResolver; + } + if (customResolver) { + return getHookFunction(customResolver.resolveId); + } + return null; +} +function alias$1(options = {}) { + const entries = getEntries(options); + if (entries.length === 0) { + return { + name: 'alias', + resolveId: () => null + }; + } + return { + name: 'alias', + async buildStart(inputOptions) { + await Promise.all([...(Array.isArray(options.entries) ? options.entries : []), options].map(({ customResolver }) => { var _a; return customResolver && ((_a = getHookFunction(customResolver.buildStart)) === null || _a === void 0 ? void 0 : _a.call(this, inputOptions)); })); + }, + resolveId(importee, importer, resolveOptions) { + // First match is supposed to be the correct one + const matchedEntry = entries.find((entry) => matches$1(entry.find, importee)); + if (!matchedEntry) { + return null; + } + const updatedId = importee.replace(matchedEntry.find, matchedEntry.replacement); + if (matchedEntry.resolverFunction) { + return matchedEntry.resolverFunction.call(this, updatedId, importer, resolveOptions); + } + return this.resolve(updatedId, importer, Object.assign({ skipSelf: true }, resolveOptions)).then((resolved) => { + if (resolved) + return resolved; + if (!require$$0$4.isAbsolute(updatedId)) { + this.warn(`rewrote ${importee} to ${updatedId} but was not an abolute path and was not handled by other plugins. ` + + `This will lead to duplicated modules for the same path. ` + + `To avoid duplicating modules, you should resolve to an absolute path.`); + } + return { id: updatedId }; + }); + } + }; +} + +// @ts-check +/** @typedef { import('estree').BaseNode} BaseNode */ + +/** @typedef {{ + skip: () => void; + remove: () => void; + replace: (node: BaseNode) => void; +}} WalkerContext */ + +let WalkerBase$1 = class WalkerBase { + constructor() { + /** @type {boolean} */ + this.should_skip = false; + + /** @type {boolean} */ + this.should_remove = false; + + /** @type {BaseNode | null} */ + this.replacement = null; + + /** @type {WalkerContext} */ + this.context = { + skip: () => (this.should_skip = true), + remove: () => (this.should_remove = true), + replace: (node) => (this.replacement = node) + }; + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + * @param {BaseNode} node + */ + replace(parent, prop, index, node) { + if (parent) { + if (index !== null) { + parent[prop][index] = node; + } else { + parent[prop] = node; + } + } + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + */ + remove(parent, prop, index) { + if (parent) { + if (index !== null) { + parent[prop].splice(index, 1); + } else { + delete parent[prop]; + } + } + } +}; + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker.js').WalkerContext} WalkerContext */ + +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => void} SyncHandler */ + +let SyncWalker$1 = class SyncWalker extends WalkerBase$1 { + /** + * + * @param {SyncHandler} enter + * @param {SyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {SyncHandler} */ + this.enter = enter; + + /** @type {SyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {BaseNode} + */ + visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!this.visit(value[i], node, key, i)) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } +}; + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./sync.js').SyncHandler} SyncHandler */ +/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ + +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: SyncHandler + * leave?: SyncHandler + * }} walker + * @returns {BaseNode} + */ +function walk$3(ast, { enter, leave }) { + const instance = new SyncWalker$1(enter, leave); + return instance.visit(ast, null); +} + +var utils$k = {}; + +const path$n = require$$0$4; +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR$1 = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR: STAR$1, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE$1 = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +var constants$6 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path$n.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; + +(function (exports) { + + const path = require$$0$4; + const win32 = process.platform === 'win32'; + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = constants$6; + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; + }; + + exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; +} (utils$k)); + +const utils$j = utils$k; +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA: CHAR_COMMA$1, /* , */ + CHAR_DOT: CHAR_DOT$1, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$1, /* { */ + CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$1, /* ( */ + CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$1, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$1, /* } */ + CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$1, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$1 /* ] */ +} = constants$6; + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan$2 = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE$1) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE$1) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE$1) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT$1 && (code = advance()) === CHAR_DOT$1) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA$1) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE$1) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT$1 && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES$1) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES$1) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET$1) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET$1) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES$1) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES$1) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES$1) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils$j.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils$j.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +var scan_1 = scan$2; + +const constants$5 = constants$6; +const utils$i = utils$k; + +/** + * Constants + */ + +const { + MAX_LENGTH: MAX_LENGTH$1, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants$5; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse$h = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils$i.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants$5.globChars(win32); + const EXTGLOB_CHARS = constants$5.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils$i.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse$h(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils$i.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils$i.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils$i.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils$i.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils$i.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils$i.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils$i.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils$i.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse$h.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils$i.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants$5.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils$i.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +var parse_1$3 = parse$h; + +const path$m = require$$0$4; +const scan$1 = scan_1; +const parse$g = parse_1$3; +const utils$h = utils$k; +const constants$4 = constants$6; +const isObject$3 = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch$5 = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch$5(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject$3(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils$h.isWindows(options); + const regex = isState + ? picomatch$5.compileRe(glob, options) + : picomatch$5.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch$5(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch$5.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch$5.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils$h.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch$5.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch$5.matchBase = (input, glob, options, posix = utils$h.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch$5.makeRe(glob, options); + return regex.test(path$m.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch$5.isMatch = (str, patterns, options) => picomatch$5(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch$5.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch$5.parse(p, options)); + return parse$g(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch$5.scan = (input, options) => scan$1(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch$5.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch$5.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch$5.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse$g.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse$g(input, options); + } + + return picomatch$5.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch$5.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch$5.constants = constants$4; + +/** + * Expose "picomatch" + */ + +var picomatch_1 = picomatch$5; + +var picomatch$3 = picomatch_1; + +var picomatch$4 = /*@__PURE__*/getDefaultExportFromCjs(picomatch$3); + +const extractors = { + ArrayPattern(names, param) { + for (const element of param.elements) { + if (element) + extractors[element.type](names, element); + } + }, + AssignmentPattern(names, param) { + extractors[param.left.type](names, param.left); + }, + Identifier(names, param) { + names.push(param.name); + }, + MemberExpression() { }, + ObjectPattern(names, param) { + for (const prop of param.properties) { + // @ts-ignore Typescript reports that this is not a valid type + if (prop.type === 'RestElement') { + extractors.RestElement(names, prop); + } + else { + extractors[prop.value.type](names, prop.value); + } + } + }, + RestElement(names, param) { + extractors[param.argument.type](names, param.argument); + } +}; +const extractAssignedNames = function extractAssignedNames(param) { + const names = []; + extractors[param.type](names, param); + return names; +}; + +const blockDeclarations = { + const: true, + let: true +}; +let Scope$1 = class Scope { + constructor(options = {}) { + this.parent = options.parent; + this.isBlockScope = !!options.block; + this.declarations = Object.create(null); + if (options.params) { + options.params.forEach((param) => { + extractAssignedNames(param).forEach((name) => { + this.declarations[name] = true; + }); + }); + } + } + addDeclaration(node, isBlockDeclaration, isVar) { + if (!isBlockDeclaration && this.isBlockScope) { + // it's a `var` or function node, and this + // is a block scope, so we need to go up + this.parent.addDeclaration(node, isBlockDeclaration, isVar); + } + else if (node.id) { + extractAssignedNames(node.id).forEach((name) => { + this.declarations[name] = true; + }); + } + } + contains(name) { + return this.declarations[name] || (this.parent ? this.parent.contains(name) : false); + } +}; +const attachScopes = function attachScopes(ast, propertyName = 'scope') { + let scope = new Scope$1(); + walk$3(ast, { + enter(n, parent) { + const node = n; + // function foo () {...} + // class Foo {...} + if (/(Function|Class)Declaration/.test(node.type)) { + scope.addDeclaration(node, false, false); + } + // var foo = 1 + if (node.type === 'VariableDeclaration') { + const { kind } = node; + const isBlockDeclaration = blockDeclarations[kind]; + node.declarations.forEach((declaration) => { + scope.addDeclaration(declaration, isBlockDeclaration, true); + }); + } + let newScope; + // create new function scope + if (/Function/.test(node.type)) { + const func = node; + newScope = new Scope$1({ + parent: scope, + block: false, + params: func.params + }); + // named function expressions - the name is considered + // part of the function's scope + if (func.type === 'FunctionExpression' && func.id) { + newScope.addDeclaration(func, false, false); + } + } + // create new for scope + if (/For(In|Of)?Statement/.test(node.type)) { + newScope = new Scope$1({ + parent: scope, + block: true + }); + } + // create new block scope + if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) { + newScope = new Scope$1({ + parent: scope, + block: true + }); + } + // catch clause has its own block scope + if (node.type === 'CatchClause') { + newScope = new Scope$1({ + parent: scope, + params: node.param ? [node.param] : [], + block: true + }); + } + if (newScope) { + Object.defineProperty(node, propertyName, { + value: newScope, + configurable: true + }); + scope = newScope; + } + }, + leave(n) { + const node = n; + if (node[propertyName]) + scope = scope.parent; + } + }); + return scope; +}; + +// Helper since Typescript can't detect readonly arrays with Array.isArray +function isArray$1(arg) { + return Array.isArray(arg); +} +function ensureArray(thing) { + if (isArray$1(thing)) + return thing; + if (thing == null) + return []; + return [thing]; +} + +const normalizePath$5 = function normalizePath(filename) { + return filename.split(win32.sep).join(posix.sep); +}; + +function getMatcherString(id, resolutionBase) { + if (resolutionBase === false || isAbsolute$1(id) || id.startsWith('**')) { + return normalizePath$5(id); + } + // resolve('') is valid and will default to process.cwd() + const basePath = normalizePath$5(resolve$3(resolutionBase || '')) + // escape all possible (posix + win) path characters that might interfere with regex + .replace(/[-^$*+?.()|[\]{}]/g, '\\$&'); + // Note that we use posix.join because: + // 1. the basePath has been normalized to use / + // 2. the incoming glob (id) matcher, also uses / + // otherwise Node will force backslash (\) on windows + return posix.join(basePath, normalizePath$5(id)); +} +const createFilter$1 = function createFilter(include, exclude, options) { + const resolutionBase = options && options.resolve; + const getMatcher = (id) => id instanceof RegExp + ? id + : { + test: (what) => { + // this refactor is a tad overly verbose but makes for easy debugging + const pattern = getMatcherString(id, resolutionBase); + const fn = picomatch$4(pattern, { dot: true }); + const result = fn(what); + return result; + } + }; + const includeMatchers = ensureArray(include).map(getMatcher); + const excludeMatchers = ensureArray(exclude).map(getMatcher); + return function result(id) { + if (typeof id !== 'string') + return false; + if (/\0/.test(id)) + return false; + const pathId = normalizePath$5(id); + for (let i = 0; i < excludeMatchers.length; ++i) { + const matcher = excludeMatchers[i]; + if (matcher.test(pathId)) + return false; + } + for (let i = 0; i < includeMatchers.length; ++i) { + const matcher = includeMatchers[i]; + if (matcher.test(pathId)) + return true; + } + return !includeMatchers.length; + }; +}; + +const reservedWords$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'; +const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'; +const forbiddenIdentifiers = new Set(`${reservedWords$1} ${builtins}`.split(' ')); +forbiddenIdentifiers.add(''); +const makeLegalIdentifier = function makeLegalIdentifier(str) { + let identifier = str + .replace(/-(\w)/g, (_, letter) => letter.toUpperCase()) + .replace(/[^$_a-zA-Z0-9]/g, '_'); + if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) { + identifier = `_${identifier}`; + } + return identifier || '_'; +}; + +function stringify$8(obj) { + return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`); +} +function serializeArray(arr, indent, baseIndent) { + let output = '['; + const separator = indent ? `\n${baseIndent}${indent}` : ''; + for (let i = 0; i < arr.length; i++) { + const key = arr[i]; + output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`; + } + return `${output}${indent ? `\n${baseIndent}` : ''}]`; +} +function serializeObject(obj, indent, baseIndent) { + let output = '{'; + const separator = indent ? `\n${baseIndent}${indent}` : ''; + const entries = Object.entries(obj); + for (let i = 0; i < entries.length; i++) { + const [key, value] = entries[i]; + const stringKey = makeLegalIdentifier(key) === key ? key : stringify$8(key); + output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`; + } + return `${output}${indent ? `\n${baseIndent}` : ''}}`; +} +function serialize(obj, indent, baseIndent) { + if (typeof obj === 'object' && obj !== null) { + if (Array.isArray(obj)) + return serializeArray(obj, indent, baseIndent); + if (obj instanceof Date) + return `new Date(${obj.getTime()})`; + if (obj instanceof RegExp) + return obj.toString(); + return serializeObject(obj, indent, baseIndent); + } + if (typeof obj === 'number') { + if (obj === Infinity) + return 'Infinity'; + if (obj === -Infinity) + return '-Infinity'; + if (obj === 0) + return 1 / obj === Infinity ? '0' : '-0'; + if (obj !== obj) + return 'NaN'; // eslint-disable-line no-self-compare + } + if (typeof obj === 'symbol') { + const key = Symbol.keyFor(obj); + // eslint-disable-next-line no-undefined + if (key !== undefined) + return `Symbol.for(${stringify$8(key)})`; + } + if (typeof obj === 'bigint') + return `${obj}n`; + return stringify$8(obj); +} +// isWellFormed exists from Node.js 20 +const hasStringIsWellFormed = 'isWellFormed' in String.prototype; +function isWellFormedString(input) { + // @ts-expect-error String::isWellFormed exists from ES2024. tsconfig lib is set to ES6 + if (hasStringIsWellFormed) + return input.isWellFormed(); + // https://github.com/tc39/proposal-is-usv-string/blob/main/README.md#algorithm + return !/\p{Surrogate}/u.test(input); +} +const dataToEsm = function dataToEsm(data, options = {}) { + var _a, _b; + const t = options.compact ? '' : 'indent' in options ? options.indent : '\t'; + const _ = options.compact ? '' : ' '; + const n = options.compact ? '' : '\n'; + const declarationType = options.preferConst ? 'const' : 'var'; + if (options.namedExports === false || + typeof data !== 'object' || + Array.isArray(data) || + data instanceof Date || + data instanceof RegExp || + data === null) { + const code = serialize(data, options.compact ? null : t, ''); + const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape + return `export default${magic}${code};`; + } + let maxUnderbarPrefixLength = 0; + for (const key of Object.keys(data)) { + const underbarPrefixLength = (_b = (_a = key.match(/^(_+)/)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0; + if (underbarPrefixLength > maxUnderbarPrefixLength) { + maxUnderbarPrefixLength = underbarPrefixLength; + } + } + const arbitraryNamePrefix = `${'_'.repeat(maxUnderbarPrefixLength + 1)}arbitrary`; + let namedExportCode = ''; + const defaultExportRows = []; + const arbitraryNameExportRows = []; + for (const [key, value] of Object.entries(data)) { + if (key === makeLegalIdentifier(key)) { + if (options.objectShorthand) + defaultExportRows.push(key); + else + defaultExportRows.push(`${key}:${_}${key}`); + namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`; + } + else { + defaultExportRows.push(`${stringify$8(key)}:${_}${serialize(value, options.compact ? null : t, '')}`); + if (options.includeArbitraryNames && isWellFormedString(key)) { + const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`; + namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`; + arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`); + } + } + } + const arbitraryExportCode = arbitraryNameExportRows.length > 0 + ? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}` + : ''; + const defaultExportCode = `export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`; + return `${namedExportCode}${arbitraryExportCode}${defaultExportCode}`; +}; + +var path$l = require$$0$4; + +var commondir = function (basedir, relfiles) { + if (relfiles) { + var files = relfiles.map(function (r) { + return path$l.resolve(basedir, r); + }); + } + else { + var files = basedir; + } + + var res = files.slice(1).reduce(function (ps, file) { + if (!file.match(/^([A-Za-z]:)?\/|\\/)) { + throw new Error('relative path without a basedir'); + } + + var xs = file.split(/\/+|\\+/); + for ( + var i = 0; + ps[i] === xs[i] && i < Math.min(ps.length, xs.length); + i++ + ); + return ps.slice(0, i); + }, files[0].split(/\/+|\\+/)); + + // Windows correctly handles paths with forward-slashes + return res.length > 1 ? res.join('/') : '/' +}; + +var getCommonDir = /*@__PURE__*/getDefaultExportFromCjs(commondir); + +var old$1 = {}; + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var pathModule = require$$0$4; +var isWindows$5 = process.platform === 'win32'; +var fs$k = require$$0__default; + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG$1 = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG$1) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows$5) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows$5) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +old$1.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows$5 && !knownHard[base]) { + fs$k.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs$k.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows$5) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs$k.statSync(base); + linkTarget = fs$k.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows$5) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +old$1.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows$5 && !knownHard[base]) { + fs$k.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs$k.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows$5) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs$k.stat(base, function(err) { + if (err) return cb(err); + + fs$k.readlink(base, function(err, target) { + if (!isWindows$5) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; + +var fs_realpath = realpath$2; +realpath$2.realpath = realpath$2; +realpath$2.sync = realpathSync; +realpath$2.realpathSync = realpathSync; +realpath$2.monkeypatch = monkeypatch; +realpath$2.unmonkeypatch = unmonkeypatch; + +var fs$j = require$$0__default; +var origRealpath = fs$j.realpath; +var origRealpathSync = fs$j.realpathSync; + +var version$4 = process.version; +var ok = /^v[0-5]\./.test(version$4); +var old = old$1; + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath$2 (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache; + cache = null; + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb); + } else { + cb(er, result); + } + }); +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs$j.realpath = realpath$2; + fs$j.realpathSync = realpathSync; +} + +function unmonkeypatch () { + fs$j.realpath = origRealpath; + fs$j.realpathSync = origRealpathSync; +} + +const isWindows$4 = typeof process === 'object' && + process && + process.platform === 'win32'; +var path$k = isWindows$4 ? { sep: '\\' } : { sep: '/' }; + +var balancedMatch = balanced$1; +function balanced$1(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range$1(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced$1.range = range$1; +function range$1(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} + +var balanced = balancedMatch; + +var braceExpansion = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand$4(escapeBraces(str), true).map(unescapeBraces); +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand$4(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m) return [str]; + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand$4(m.post, false) + : ['']; + + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length; k++) { + var expansion = pre+ '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand$4(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand$4(n[0], false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = []; + + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand$4(n[j], false)); + } + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + } + + return expansions; +} + +const minimatch$1 = minimatch_1 = (p, pattern, options = {}) => { + assertValidPattern(pattern); + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + return new Minimatch$1(pattern, options).match(p) +}; + +var minimatch_1 = minimatch$1; + +const path$j = path$k; +minimatch$1.sep = path$j.sep; + +const GLOBSTAR$2 = Symbol('globstar **'); +minimatch$1.GLOBSTAR = GLOBSTAR$2; +const expand$3 = braceExpansion; + +const plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +}; + +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; + +// * => any number of characters +const star = qmark + '*?'; + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'; + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'; + +// "abc" -> { a:true, b:true, c:true } +const charSet = s => s.split('').reduce((set, c) => { + set[c] = true; + return set +}, {}); + +// characters that need to be escaped in RegExp. +const reSpecials = charSet('().*{}+?[]^$\\!'); + +// characters that indicate we have to add the pattern start +const addPatternStartSet = charSet('[.('); + +// normalizes slashes. +const slashSplit = /\/+/; + +minimatch$1.filter = (pattern, options = {}) => + (p, i, list) => minimatch$1(p, pattern, options); + +const ext = (a, b = {}) => { + const t = {}; + Object.keys(a).forEach(k => t[k] = a[k]); + Object.keys(b).forEach(k => t[k] = b[k]); + return t +}; + +minimatch$1.defaults = def => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch$1 + } + + const orig = minimatch$1; + + const m = (p, pattern, options) => orig(p, pattern, ext(def, options)); + m.Minimatch = class Minimatch extends orig.Minimatch { + constructor (pattern, options) { + super(pattern, ext(def, options)); + } + }; + m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch; + m.filter = (pattern, options) => orig.filter(pattern, ext(def, options)); + m.defaults = options => orig.defaults(ext(def, options)); + m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options)); + m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options)); + m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options)); + + return m +}; + + + + + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch$1.braceExpand = (pattern, options) => braceExpand(pattern, options); + +const braceExpand = (pattern, options = {}) => { + assertValidPattern(pattern); + + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand$3(pattern) +}; + +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = pattern => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +}; + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const SUBPARSE = Symbol('subparse'); + +minimatch$1.makeRe = (pattern, options) => + new Minimatch$1(pattern, options || {}).makeRe(); + +minimatch$1.match = (list, pattern, options = {}) => { + const mm = new Minimatch$1(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list +}; + +// replace stuff like \* with * +const globUnescape = s => s.replace(/\\(.)/g, '$1'); +const charUnescape = s => s.replace(/\\([^-\]])/g, '$1'); +const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +const braExpEscape = s => s.replace(/[[\]\\]/g, '\\$&'); + +let Minimatch$1 = class Minimatch { + constructor (pattern, options) { + assertValidPattern(pattern); + + if (!options) options = {}; + + this.options = options; + this.set = []; + this.pattern = pattern; + this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || + options.allowWindowsEscape === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + + // make the set of regexps etc. + this.make(); + } + + debug () {} + + make () { + const pattern = this.pattern; + const options = this.options; + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return + } + if (!pattern) { + this.empty = true; + return + } + + // step 1: figure out negation, etc. + this.parseNegate(); + + // step 2: expand braces + let set = this.globSet = this.braceExpand(); + + if (options.debug) this.debug = (...args) => console.error(...args); + + this.debug(this.pattern, set); + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(s => s.split(slashSplit)); + + this.debug(this.pattern, set); + + // glob --> regexps + set = set.map((s, si, set) => s.map(this.parse, this)); + + this.debug(this.pattern, set); + + // filter out everything that didn't compile properly. + set = set.filter(s => s.indexOf(false) === -1); + + this.debug(this.pattern, set); + + this.set = set; + } + + parseNegate () { + if (this.options.nonegate) return + + const pattern = this.pattern; + let negate = false; + let negateOffset = 0; + + for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) { + negate = !negate; + negateOffset++; + } + + if (negateOffset) this.pattern = pattern.slice(negateOffset); + this.negate = negate; + } + + // set partial to true to test if, for example, + // "/a/b" matches the start of "/*/b/*/d" + // Partial means, if you run out of file before you run + // out of pattern, then that's fine, as long as all + // the parts match. + matchOne (file, pattern, partial) { + var options = this.options; + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }); + + this.debug('matchOne', file.length, pattern.length); + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop'); + var p = pattern[pi]; + var f = file[fi]; + + this.debug(pattern, p, f); + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR$2) { + this.debug('GLOBSTAR', [pattern, p, f]); + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug('** at the end'); + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr]; + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee); + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr); + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue'); + fr++; + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr); + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit; + if (typeof p === 'string') { + hit = f === p; + this.debug('string match', p, f, hit); + } else { + hit = f.match(p); + this.debug('pattern match', p, f, hit); + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') + } + + braceExpand () { + return braceExpand(this.pattern, this.options) + } + + parse (pattern, isSub) { + assertValidPattern(pattern); + + const options = this.options; + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR$2 + else + pattern = '*'; + } + if (pattern === '') return '' + + let re = ''; + let hasMagic = false; + let escaping = false; + // ? => one single character + const patternListStack = []; + const negativeLists = []; + let stateChar; + let inClass = false; + let reClassStart = -1; + let classStart = -1; + let cs; + let pl; + let sp; + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. However, if the pattern + // starts with ., then traversal patterns can match. + let dotTravAllowed = pattern.charAt(0) === '.'; + let dotFileAllowed = options.dot || dotTravAllowed; + const patternStart = () => + dotTravAllowed + ? '' + : dotFileAllowed + ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' + : '(?!\\.)'; + const subPatternStart = (p) => + p.charAt(0) === '.' + ? '' + : options.dot + ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' + : '(?!\\.)'; + + + const clearStateChar = () => { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star; + hasMagic = true; + break + case '?': + re += qmark; + hasMagic = true; + break + default: + re += '\\' + stateChar; + break + } + this.debug('clearStateChar %j %j', stateChar, re); + stateChar = false; + } + }; + + for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c); + + // skip over any that are escaped. + if (escaping) { + /* istanbul ignore next - completely not allowed, even escaped. */ + if (c === '/') { + return false + } + + if (reSpecials[c]) { + re += '\\'; + } + re += c; + escaping = false; + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // Should already be path-split by now. + return false + } + + case '\\': + if (inClass && pattern.charAt(i + 1) === '-') { + re += c; + continue + } + + clearStateChar(); + escaping = true; + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c); + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class'); + if (c === '!' && i === classStart + 1) c = '^'; + re += c; + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + this.debug('call clearStateChar %j', stateChar); + clearStateChar(); + stateChar = c; + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar(); + continue + + case '(': { + if (inClass) { + re += '('; + continue + } + + if (!stateChar) { + re += '\\('; + continue + } + + const plEntry = { + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close, + }; + this.debug(this.pattern, '\t', plEntry); + patternListStack.push(plEntry); + // negation is (?:(?!(?:js)(?:))[^/]*) + re += plEntry.open; + // next entry starts with a dot maybe? + if (plEntry.start === 0 && plEntry.type !== '!') { + dotTravAllowed = true; + re += subPatternStart(pattern.slice(i + 1)); + } + this.debug('plType %j %j', stateChar, re); + stateChar = false; + continue + } + + case ')': { + const plEntry = patternListStack[patternListStack.length - 1]; + if (inClass || !plEntry) { + re += '\\)'; + continue + } + patternListStack.pop(); + + // closing an extglob + clearStateChar(); + hasMagic = true; + pl = plEntry; + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close; + if (pl.type === '!') { + negativeLists.push(Object.assign(pl, { reEnd: re.length })); + } + continue + } + + case '|': { + const plEntry = patternListStack[patternListStack.length - 1]; + if (inClass || !plEntry) { + re += '\\|'; + continue + } + + clearStateChar(); + re += '|'; + // next subpattern can start with a dot? + if (plEntry.start === 0 && plEntry.type !== '!') { + dotTravAllowed = true; + re += subPatternStart(pattern.slice(i + 1)); + } + continue + } + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar(); + + if (inClass) { + re += '\\' + c; + continue + } + + inClass = true; + classStart = i; + reClassStart = re.length; + re += c; + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c; + continue + } + + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + cs = pattern.substring(classStart + 1, i); + try { + RegExp('[' + braExpEscape(charUnescape(cs)) + ']'); + // looks good, finish up the class. + re += c; + } catch (er) { + // out of order ranges in JS are errors, but in glob syntax, + // they're just a range that matches nothing. + re = re.substring(0, reClassStart) + '(?:$.)'; // match nothing ever + } + hasMagic = true; + inClass = false; + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar(); + + if (reSpecials[c] && !(c === '^' && inClass)) { + re += '\\'; + } + + re += c; + break + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.slice(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substring(0, reClassStart) + '\\[' + sp[0]; + hasMagic = hasMagic || sp[1]; + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + let tail; + tail = re.slice(pl.reStart + pl.open.length); + this.debug('setting tail', re, pl); + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { + /* istanbul ignore else - should already be done */ + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\'; + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }); + + this.debug('tail=%j\n %s', tail, tail, pl, re); + const t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type; + + hasMagic = true; + re = re.slice(0, pl.reStart) + t + '\\(' + tail; + } + + // handle trailing things that only matter at the very end. + clearStateChar(); + if (escaping) { + // trailing \\ + re += '\\\\'; + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + const addPatternStart = addPatternStartSet[re.charAt(0)]; + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (let n = negativeLists.length - 1; n > -1; n--) { + const nl = negativeLists[n]; + + const nlBefore = re.slice(0, nl.reStart); + const nlFirst = re.slice(nl.reStart, nl.reEnd - 8); + let nlAfter = re.slice(nl.reEnd); + const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter; + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + const closeParensBefore = nlBefore.split(')').length; + const openParensBefore = nlBefore.split('(').length - closeParensBefore; + let cleanAfter = nlAfter; + for (let i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ''); + } + nlAfter = cleanAfter; + + const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\/)' : ''; + + re = nlBefore + nlFirst + nlAfter + dollar + nlLast; + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re; + } + + if (addPatternStart) { + re = patternStart() + re; + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // if it's nocase, and the lcase/uppercase don't match, it's magic + if (options.nocase && !hasMagic) { + hasMagic = pattern.toUpperCase() !== pattern.toLowerCase(); + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + const flags = options.nocase ? 'i' : ''; + try { + return Object.assign(new RegExp('^' + re + '$', flags), { + _glob: pattern, + _src: re, + }) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + } + + makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + const set = this.set; + + if (!set.length) { + this.regexp = false; + return this.regexp + } + const options = this.options; + + const twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot; + const flags = options.nocase ? 'i' : ''; + + // coalesce globstars and regexpify non-globstar patterns + // if it's the only item, then we just do one twoStar + // if it's the first, and there are more, prepend (\/|twoStar\/)? to next + // if it's the last, append (\/twoStar|) to previous + // if it's in the middle, append (\/|\/twoStar\/) to previous + // then filter out GLOBSTAR symbols + let re = set.map(pattern => { + pattern = pattern.map(p => + typeof p === 'string' ? regExpEscape(p) + : p === GLOBSTAR$2 ? GLOBSTAR$2 + : p._src + ).reduce((set, p) => { + if (!(set[set.length - 1] === GLOBSTAR$2 && p === GLOBSTAR$2)) { + set.push(p); + } + return set + }, []); + pattern.forEach((p, i) => { + if (p !== GLOBSTAR$2 || pattern[i-1] === GLOBSTAR$2) { + return + } + if (i === 0) { + if (pattern.length > 1) { + pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1]; + } else { + pattern[i] = twoStar; + } + } else if (i === pattern.length - 1) { + pattern[i-1] += '(?:\\\/|' + twoStar + ')?'; + } else { + pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1]; + pattern[i+1] = GLOBSTAR$2; + } + }); + return pattern.filter(p => p !== GLOBSTAR$2).join('/') + }).join('|'); + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$'; + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$'; + + try { + this.regexp = new RegExp(re, flags); + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false; + } + return this.regexp + } + + match (f, partial = this.partial) { + this.debug('match', f, this.pattern); + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + const options = this.options; + + // windows: need to use /, not \ + if (path$j.sep !== '/') { + f = f.split(path$j.sep).join('/'); + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit); + this.debug(this.pattern, 'split', f); + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + const set = this.set; + this.debug(this.pattern, 'set', set); + + // Find the basename of the path by looking for the last non-empty segment + let filename; + for (let i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break + } + + for (let i = 0; i < set.length; i++) { + const pattern = set[i]; + let file = f; + if (options.matchBase && pattern.length === 1) { + file = [filename]; + } + const hit = this.matchOne(file, pattern, partial); + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate + } + + static defaults (def) { + return minimatch$1.defaults(def).Minimatch + } +}; + +minimatch$1.Minimatch = Minimatch$1; + +var inherits = {exports: {}}; + +var inherits_browser = {exports: {}}; + +var hasRequiredInherits_browser; + +function requireInherits_browser () { + if (hasRequiredInherits_browser) return inherits_browser.exports; + hasRequiredInherits_browser = 1; + if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + inherits_browser.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + // old school shim for old browsers + inherits_browser.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + return inherits_browser.exports; +} + +try { + var util$2 = require('util'); + /* istanbul ignore next */ + if (typeof util$2.inherits !== 'function') throw ''; + inherits.exports = util$2.inherits; +} catch (e) { + /* istanbul ignore next */ + inherits.exports = requireInherits_browser(); +} + +var inheritsExports = inherits.exports; + +var common$c = {}; + +common$c.setopts = setopts; +common$c.ownProp = ownProp; +common$c.makeAbs = makeAbs; +common$c.finish = finish; +common$c.mark = mark; +common$c.isIgnored = isIgnored; +common$c.childrenIgnored = childrenIgnored; + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var fs$i = require$$0__default; +var path$i = require$$0$4; +var minimatch = minimatch_1; +var isAbsolute = require$$0$4.isAbsolute; +var Minimatch = minimatch.Minimatch; + +function alphasort (a, b) { + return a.localeCompare(b, 'en') +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || []; + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore]; + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap); + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null; + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, ''); + gmatcher = new Minimatch(gpattern, { dot: true }); + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {}; + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern; + } + + self.windowsPathsNoEscape = !!options.windowsPathsNoEscape || + options.allowWindowsEscape === false; + if (self.windowsPathsNoEscape) { + pattern = pattern.replace(/\\/g, '/'); + } + + self.silent = !!options.silent; + self.pattern = pattern; + self.strict = options.strict !== false; + self.realpath = !!options.realpath; + self.realpathCache = options.realpathCache || Object.create(null); + self.follow = !!options.follow; + self.dot = !!options.dot; + self.mark = !!options.mark; + self.nodir = !!options.nodir; + if (self.nodir) + self.mark = true; + self.sync = !!options.sync; + self.nounique = !!options.nounique; + self.nonull = !!options.nonull; + self.nosort = !!options.nosort; + self.nocase = !!options.nocase; + self.stat = !!options.stat; + self.noprocess = !!options.noprocess; + self.absolute = !!options.absolute; + self.fs = options.fs || fs$i; + + self.maxLength = options.maxLength || Infinity; + self.cache = options.cache || Object.create(null); + self.statCache = options.statCache || Object.create(null); + self.symlinks = options.symlinks || Object.create(null); + + setupIgnores(self, options); + + self.changedCwd = false; + var cwd = process.cwd(); + if (!ownProp(options, "cwd")) + self.cwd = path$i.resolve(cwd); + else { + self.cwd = path$i.resolve(options.cwd); + self.changedCwd = self.cwd !== cwd; + } + + self.root = options.root || path$i.resolve(self.cwd, "/"); + self.root = path$i.resolve(self.root); + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd); + self.nomount = !!options.nomount; + + if (process.platform === "win32") { + self.root = self.root.replace(/\\/g, "/"); + self.cwd = self.cwd.replace(/\\/g, "/"); + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/"); + } + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true; + options.nocomment = true; + + self.minimatch = new Minimatch(pattern, options); + self.options = self.minimatch.options; +} + +function finish (self) { + var nou = self.nounique; + var all = nou ? [] : Object.create(null); + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i]; + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i]; + if (nou) + all.push(literal); + else + all[literal] = true; + } + } else { + // had matches + var m = Object.keys(matches); + if (nou) + all.push.apply(all, m); + else + m.forEach(function (m) { + all[m] = true; + }); + } + } + + if (!nou) + all = Object.keys(all); + + if (!self.nosort) + all = all.sort(alphasort); + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]); + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)); + var c = self.cache[e] || self.cache[makeAbs(self, e)]; + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c); + return notDir + }); + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }); + + self.found = all; +} + +function mark (self, p) { + var abs = makeAbs(self, p); + var c = self.cache[abs]; + var m = p; + if (c) { + var isDir = c === 'DIR' || Array.isArray(c); + var slash = p.slice(-1) === '/'; + + if (isDir && !slash) + m += '/'; + else if (!isDir && slash) + m = m.slice(0, -1); + + if (m !== p) { + var mabs = makeAbs(self, m); + self.statCache[mabs] = self.statCache[abs]; + self.cache[mabs] = self.cache[abs]; + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f; + if (f.charAt(0) === '/') { + abs = path$i.join(self.root, f); + } else if (isAbsolute(f) || f === '') { + abs = f; + } else if (self.changedCwd) { + abs = path$i.resolve(self.cwd, f); + } else { + abs = path$i.resolve(f); + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/'); + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +var sync$9; +var hasRequiredSync; + +function requireSync () { + if (hasRequiredSync) return sync$9; + hasRequiredSync = 1; + sync$9 = globSync; + globSync.GlobSync = GlobSync; + + var rp = fs_realpath; + var minimatch = minimatch_1; + requireGlob().Glob; + var path = require$$0$4; + var assert = require$$5; + var isAbsolute = require$$0$4.isAbsolute; + var common = common$c; + var setopts = common.setopts; + var ownProp = common.ownProp; + var childrenIgnored = common.childrenIgnored; + var isIgnored = common.isIgnored; + + function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found + } + + function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options); + + if (this.noprocess) + return this + + var n = this.minimatch.set.length; + this.matches = new Array(n); + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false); + } + this._finish(); + } + + GlobSync.prototype._finish = function () { + assert.ok(this instanceof GlobSync); + if (this.realpath) { + var self = this; + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null); + for (var p in matchset) { + try { + p = self._makeAbs(p); + var real = rp.realpathSync(p, self.realpathCache); + set[real] = true; + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true; + else + throw er + } + } + }); + } + common.finish(this); + }; + + + GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert.ok(this instanceof GlobSync); + + // Get the first [n] parts of pattern that are all strings. + var n = 0; + while (typeof pattern[n] === 'string') { + n ++; + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix; + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index); + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null; + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/'); + break + } + + var remain = pattern.slice(n); + + // get the list of entries. + var read; + if (prefix === null) + read = '.'; + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix; + read = prefix; + } else + read = prefix; + + var abs = this._makeAbs(read); + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR; + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar); + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar); + }; + + + GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar); + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0]; + var negate = !!this.minimatch.negate; + var rawGlob = pn._glob; + var dotOk = this.dot || rawGlob.charAt(0) === '.'; + + var matchedEntries = []; + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (e.charAt(0) !== '.' || dotOk) { + var m; + if (negate && !prefix) { + m = !e.match(pn); + } else { + m = e.match(pn); + } + if (m) + matchedEntries.push(e); + } + } + + var len = matchedEntries.length; + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null); + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i]; + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e; + else + e = prefix + e; + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e); + } + this._emitMatch(index, e); + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift(); + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i]; + var newPattern; + if (prefix) + newPattern = [prefix, e]; + else + newPattern = [e]; + this._process(newPattern.concat(remain), index, inGlobStar); + } + }; + + + GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e); + + if (this.mark) + e = this._mark(e); + + if (this.absolute) { + e = abs; + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs]; + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true; + + if (this.stat) + this._stat(e); + }; + + + GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries; + var lstat; + try { + lstat = this.fs.lstatSync(abs); + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink(); + this.symlinks[abs] = isSym; + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE'; + else + entries = this._readdir(abs, false); + + return entries + }; + + GlobSync.prototype._readdir = function (abs, inGlobStar) { + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er); + return null + } + }; + + GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i]; + if (abs === '/') + e = abs + e; + else + e = abs + '/' + e; + this.cache[e] = true; + } + } + + this.cache[abs] = entries; + + // mark and cache dir-ness + return entries + }; + + GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f); + this.cache[abs] = 'FILE'; + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd); + error.path = this.cwd; + error.code = er.code; + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false; + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false; + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er); + break + } + }; + + GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar); + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1); + var gspref = prefix ? [ prefix ] : []; + var noGlobStar = gspref.concat(remainWithoutGlobStar); + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false); + + var len = entries.length; + var isSym = this.symlinks[abs]; + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i]; + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar); + this._process(instead, index, true); + + var below = gspref.concat(entries[i], remain); + this._process(below, index, true); + } + }; + + GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix); + + if (!this.matches[index]) + this.matches[index] = Object.create(null); + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix); + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix); + } else { + prefix = path.resolve(this.root, prefix); + if (trail) + prefix += '/'; + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/'); + + // Mark this as a match + this._emitMatch(index, prefix); + }; + + // Returns either 'DIR', 'FILE', or false + GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f); + var needDir = f.slice(-1) === '/'; + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs]; + + if (Array.isArray(c)) + c = 'DIR'; + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + var stat = this.statCache[abs]; + if (!stat) { + var lstat; + try { + lstat = this.fs.lstatSync(abs); + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false; + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = this.fs.statSync(abs); + } catch (er) { + stat = lstat; + } + } else { + stat = lstat; + } + } + + this.statCache[abs] = stat; + + var c = true; + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE'; + + this.cache[abs] = this.cache[abs] || c; + + if (needDir && c === 'FILE') + return false + + return c + }; + + GlobSync.prototype._mark = function (p) { + return common.mark(this, p) + }; + + GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) + }; + return sync$9; +} + +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +var wrappy_1 = wrappy$2; +function wrappy$2 (fn, cb) { + if (fn && cb) return wrappy$2(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k]; + }); + + return wrapper + + function wrapper() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var ret = fn.apply(this, args); + var cb = args[args.length-1]; + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k]; + }); + } + return ret + } +} + +var once$2 = {exports: {}}; + +var wrappy$1 = wrappy_1; +once$2.exports = wrappy$1(once$1); +once$2.exports.strict = wrappy$1(onceStrict); + +once$1.proto = once$1(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once$1(this) + }, + configurable: true + }); + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }); +}); + +function once$1 (fn) { + var f = function () { + if (f.called) return f.value + f.called = true; + return f.value = fn.apply(this, arguments) + }; + f.called = false; + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true; + return f.value = fn.apply(this, arguments) + }; + var name = fn.name || 'Function wrapped with `once`'; + f.onceError = name + " shouldn't be called more than once"; + f.called = false; + return f +} + +var onceExports = once$2.exports; + +var wrappy = wrappy_1; +var reqs = Object.create(null); +var once = onceExports; + +var inflight_1 = wrappy(inflight); + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb); + return null + } else { + reqs[key] = [cb]; + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key]; + var len = cbs.length; + var args = slice$1(arguments); + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args); + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len); + process.nextTick(function () { + RES.apply(null, args); + }); + } else { + delete reqs[key]; + } + } + }) +} + +function slice$1 (args) { + var length = args.length; + var array = []; + + for (var i = 0; i < length; i++) array[i] = args[i]; + return array +} + +var glob_1; +var hasRequiredGlob; + +function requireGlob () { + if (hasRequiredGlob) return glob_1; + hasRequiredGlob = 1; + // Approach: + // + // 1. Get the minimatch set + // 2. For each pattern in the set, PROCESS(pattern, false) + // 3. Store matches per-set, then uniq them + // + // PROCESS(pattern, inGlobStar) + // Get the first [n] items from pattern that are all strings + // Join these together. This is PREFIX. + // If there is no more remaining, then stat(PREFIX) and + // add to matches if it succeeds. END. + // + // If inGlobStar and PREFIX is symlink and points to dir + // set ENTRIES = [] + // else readdir(PREFIX) as ENTRIES + // If fail, END + // + // with ENTRIES + // If pattern[n] is GLOBSTAR + // // handle the case where the globstar match is empty + // // by pruning it out, and testing the resulting pattern + // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) + // // handle other cases. + // for ENTRY in ENTRIES (not dotfiles) + // // attach globstar + tail onto the entry + // // Mark that this entry is a globstar match + // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) + // + // else // not globstar + // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) + // Test ENTRY against pattern[n] + // If fails, continue + // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) + // + // Caveat: + // Cache all stats and readdirs results to minimize syscall. Since all + // we ever care about is existence and directory-ness, we can just keep + // `true` for files, and [children,...] for directories, or `false` for + // things that don't exist. + + glob_1 = glob; + + var rp = fs_realpath; + var minimatch = minimatch_1; + var inherits = inheritsExports; + var EE = require$$0$5.EventEmitter; + var path = require$$0$4; + var assert = require$$5; + var isAbsolute = require$$0$4.isAbsolute; + var globSync = requireSync(); + var common = common$c; + var setopts = common.setopts; + var ownProp = common.ownProp; + var inflight = inflight_1; + var childrenIgnored = common.childrenIgnored; + var isIgnored = common.isIgnored; + + var once = onceExports; + + function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {}; + if (!options) options = {}; + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) + } + + glob.sync = globSync; + var GlobSync = glob.GlobSync = globSync.GlobSync; + + // old api surface + glob.glob = glob; + + function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin + } + + glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_); + options.noprocess = true; + + var g = new Glob(pattern, options); + var set = g.minimatch.set; + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false + }; + + glob.Glob = Glob; + inherits(Glob, EE); + function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options; + options = null; + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options); + this._didRealPath = false; + + // process each pattern in the minimatch set + var n = this.minimatch.set.length; + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n); + + if (typeof cb === 'function') { + cb = once(cb); + this.on('error', cb); + this.on('end', function (matches) { + cb(null, matches); + }); + } + + var self = this; + this._processing = 0; + + this._emitQueue = []; + this._processQueue = []; + this.paused = false; + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true; + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done); + } + sync = false; + + function done () { + --self._processing; + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish(); + }); + } else { + self._finish(); + } + } + } + } + + Glob.prototype._finish = function () { + assert(this instanceof Glob); + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this); + this.emit('end', this.found); + }; + + Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true; + + var n = this.matches.length; + if (n === 0) + return this._finish() + + var self = this; + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next); + + function next () { + if (--n === 0) + self._finish(); + } + }; + + Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index]; + if (!matchset) + return cb() + + var found = Object.keys(matchset); + var self = this; + var n = found.length; + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null); + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p); + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true; + else if (er.syscall === 'stat') + set[p] = true; + else + self.emit('error', er); // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set; + cb(); + } + }); + }); + }; + + Glob.prototype._mark = function (p) { + return common.mark(this, p) + }; + + Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) + }; + + Glob.prototype.abort = function () { + this.aborted = true; + this.emit('abort'); + }; + + Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true; + this.emit('pause'); + } + }; + + Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume'); + this.paused = false; + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0); + this._emitQueue.length = 0; + for (var i = 0; i < eq.length; i ++) { + var e = eq[i]; + this._emitMatch(e[0], e[1]); + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0); + this._processQueue.length = 0; + for (var i = 0; i < pq.length; i ++) { + var p = pq[i]; + this._processing--; + this._process(p[0], p[1], p[2], p[3]); + } + } + } + }; + + Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob); + assert(typeof cb === 'function'); + + if (this.aborted) + return + + this._processing++; + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]); + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0; + while (typeof pattern[n] === 'string') { + n ++; + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix; + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb); + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null; + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/'); + break + } + + var remain = pattern.slice(n); + + // get the list of entries. + var read; + if (prefix === null) + read = '.'; + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix; + read = prefix; + } else + read = prefix; + + var abs = this._makeAbs(read); + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR; + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb); + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb); + }; + + Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this; + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }); + }; + + Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0]; + var negate = !!this.minimatch.negate; + var rawGlob = pn._glob; + var dotOk = this.dot || rawGlob.charAt(0) === '.'; + + var matchedEntries = []; + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (e.charAt(0) !== '.' || dotOk) { + var m; + if (negate && !prefix) { + m = !e.match(pn); + } else { + m = e.match(pn); + } + if (m) + matchedEntries.push(e); + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length; + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null); + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i]; + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e; + else + e = prefix + e; + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e); + } + this._emitMatch(index, e); + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift(); + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i]; + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e; + else + e = prefix + e; + } + this._process([e].concat(remain), index, inGlobStar, cb); + } + cb(); + }; + + Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]); + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e); + + if (this.mark) + e = this._mark(e); + + if (this.absolute) + e = abs; + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs]; + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true; + + var st = this.statCache[abs]; + if (st) + this.emit('stat', e, st); + + this.emit('match', e); + }; + + Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs; + var self = this; + var lstatcb = inflight(lstatkey, lstatcb_); + + if (lstatcb) + self.fs.lstat(abs, lstatcb); + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink(); + self.symlinks[abs] = isSym; + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE'; + cb(); + } else + self._readdir(abs, false, cb); + } + }; + + Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb); + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this; + self.fs.readdir(abs, readdirCb(this, abs, cb)); + }; + + function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb); + else + self._readdirEntries(abs, entries, cb); + } + } + + Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i]; + if (abs === '/') + e = abs + e; + else + e = abs + '/' + e; + this.cache[e] = true; + } + } + + this.cache[abs] = entries; + return cb(null, entries) + }; + + Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f); + this.cache[abs] = 'FILE'; + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd); + error.path = this.cwd; + error.code = er.code; + this.emit('error', error); + this.abort(); + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false; + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false; + if (this.strict) { + this.emit('error', er); + // If the error is handled, then we abort + // if not, we threw out of here + this.abort(); + } + if (!this.silent) + console.error('glob error', er); + break + } + + return cb() + }; + + Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this; + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb); + }); + }; + + + Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1); + var gspref = prefix ? [ prefix ] : []; + var noGlobStar = gspref.concat(remainWithoutGlobStar); + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb); + + var isSym = this.symlinks[abs]; + var len = entries.length; + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i]; + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar); + this._process(instead, index, true, cb); + + var below = gspref.concat(entries[i], remain); + this._process(below, index, true, cb); + } + + cb(); + }; + + Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this; + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb); + }); + }; + Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null); + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix); + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix); + } else { + prefix = path.resolve(this.root, prefix); + if (trail) + prefix += '/'; + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/'); + + // Mark this as a match + this._emitMatch(index, prefix); + cb(); + }; + + // Returns either 'DIR', 'FILE', or false + Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f); + var needDir = f.slice(-1) === '/'; + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs]; + + if (Array.isArray(c)) + c = 'DIR'; + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + var stat = this.statCache[abs]; + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE'; + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this; + var statcb = inflight('stat\0' + abs, lstatcb_); + if (statcb) + self.fs.lstat(abs, statcb); + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return self.fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb); + else + self._stat2(f, abs, er, stat, cb); + }) + } else { + self._stat2(f, abs, er, lstat, cb); + } + } + }; + + Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false; + return cb() + } + + var needDir = f.slice(-1) === '/'; + this.statCache[abs] = stat; + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true; + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE'; + this.cache[abs] = this.cache[abs] || c; + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) + }; + return glob_1; +} + +var globExports = requireGlob(); +var glob$1 = /*@__PURE__*/getDefaultExportFromCjs(globExports); + +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars$1.length; i++) { + const c = chars$1.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +function decode(mappings) { + const state = new Int32Array(5); + const decoded = []; + let index = 0; + do { + const semi = indexOf(mappings, index); + const line = []; + let sorted = true; + let lastCol = 0; + state[0] = 0; + for (let i = index; i < semi; i++) { + let seg; + i = decodeInteger(mappings, i, state, 0); // genColumn + const col = state[0]; + if (col < lastCol) + sorted = false; + lastCol = col; + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 1); // sourcesIndex + i = decodeInteger(mappings, i, state, 2); // sourceLine + i = decodeInteger(mappings, i, state, 3); // sourceColumn + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 4); // namesIndex + seg = [col, state[1], state[2], state[3], state[4]]; + } + else { + seg = [col, state[1], state[2], state[3]]; + } + } + else { + seg = [col]; + } + line.push(seg); + } + if (!sorted) + sort(line); + decoded.push(line); + index = semi + 1; + } while (index <= mappings.length); + return decoded; +} +function indexOf(mappings, index) { + const idx = mappings.indexOf(';', index); + return idx === -1 ? mappings.length : idx; +} +function decodeInteger(mappings, pos, state, j) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = mappings.charCodeAt(pos++); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + state[j] += value; + return pos; +} +function hasMoreVlq(mappings, i, length) { + if (i >= length) + return false; + return mappings.charCodeAt(i) !== comma; +} +function sort(line) { + line.sort(sortComparator$1); +} +function sortComparator$1(a, b) { + return a[0] - b[0]; +} +function encode$1(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ''; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // genColumn + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex + } + } + return out + td.decode(buf.subarray(0, pos)); +} +function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? (-num << 1) | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) + clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; +} + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa$1 = /*#__PURE__*/ getBtoa(); + +let SourceMap$1 = class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode$1(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa$1(this.toString()); + } +}; + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString$2 = Object.prototype.toString; + +function isObject$2(thing) { + return toString$2.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + while (contentLineEnd >= 0) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n$1 = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap$1(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject$2(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); // eslint-disable-line no-console + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); // eslint-disable-line no-console + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); // eslint-disable-line no-console + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n$1); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n$1); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n$1); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n$1); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n$1); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) + this.overwrite( + match.index, + match.index + match[0].length, + getReplacement(match, this.original), + ); + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) + this.overwrite( + match.index, + match.index + match[0].length, + getReplacement(match, this.original), + ); + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + this.overwrite(index, index + stringLength, replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +function isReference(node, parent) { + if (node.type === 'MemberExpression') { + return !node.computed && isReference(node.object, node); + } + if (node.type === 'Identifier') { + if (!parent) + return true; + switch (parent.type) { + // disregard `bar` in `foo.bar` + case 'MemberExpression': return parent.computed || node === parent.object; + // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}` + case 'MethodDefinition': return parent.computed; + // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}` + case 'FieldDefinition': return parent.computed || node === parent.value; + // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }` + case 'Property': return parent.computed || node === parent.value; + // disregard the `bar` in `export { foo as bar }` or + // the foo in `import { foo as bar }` + case 'ExportSpecifier': + case 'ImportSpecifier': return node === parent.local; + // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}` + case 'LabeledStatement': + case 'BreakStatement': + case 'ContinueStatement': return false; + default: return true; + } + } + return false; +} + +var version$3 = "25.0.7"; +var peerDependencies = { + rollup: "^2.68.0||^3.0.0||^4.0.0" +}; + +function tryParse(parse, code, id) { + try { + return parse(code, { allowReturnOutsideFunction: true }); + } catch (err) { + err.message += ` in ${id}`; + throw err; + } +} + +const firstpassGlobal = /\b(?:require|module|exports|global)\b/; + +const firstpassNoGlobal = /\b(?:require|module|exports)\b/; + +function hasCjsKeywords(code, ignoreGlobal) { + const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal; + return firstpass.test(code); +} + +/* eslint-disable no-underscore-dangle */ + + +function analyzeTopLevelStatements(parse, code, id) { + const ast = tryParse(parse, code, id); + + let isEsModule = false; + let hasDefaultExport = false; + let hasNamedExports = false; + + for (const node of ast.body) { + switch (node.type) { + case 'ExportDefaultDeclaration': + isEsModule = true; + hasDefaultExport = true; + break; + case 'ExportNamedDeclaration': + isEsModule = true; + if (node.declaration) { + hasNamedExports = true; + } else { + for (const specifier of node.specifiers) { + if (specifier.exported.name === 'default') { + hasDefaultExport = true; + } else { + hasNamedExports = true; + } + } + } + break; + case 'ExportAllDeclaration': + isEsModule = true; + if (node.exported && node.exported.name === 'default') { + hasDefaultExport = true; + } else { + hasNamedExports = true; + } + break; + case 'ImportDeclaration': + isEsModule = true; + break; + } + } + + return { isEsModule, hasDefaultExport, hasNamedExports, ast }; +} + +/* eslint-disable import/prefer-default-export */ + + +function deconflict(scopes, globals, identifier) { + let i = 1; + let deconflicted = makeLegalIdentifier(identifier); + const hasConflicts = () => + scopes.some((scope) => scope.contains(deconflicted)) || globals.has(deconflicted); + + while (hasConflicts()) { + deconflicted = makeLegalIdentifier(`${identifier}_${i}`); + i += 1; + } + + for (const scope of scopes) { + scope.declarations[deconflicted] = true; + } + + return deconflicted; +} + +function getName(id) { + const name = makeLegalIdentifier(basename$1(id, extname(id))); + if (name !== 'index') { + return name; + } + return makeLegalIdentifier(basename$1(dirname$1(id))); +} + +function normalizePathSlashes(path) { + return path.replace(/\\/g, '/'); +} + +const getVirtualPathForDynamicRequirePath = (path, commonDir) => + `/${normalizePathSlashes(relative$1(commonDir, path))}`; + +function capitalize(name) { + return name[0].toUpperCase() + name.slice(1); +} + +function getStrictRequiresFilter({ strictRequires }) { + switch (strictRequires) { + case true: + return { strictRequiresFilter: () => true, detectCyclesAndConditional: false }; + // eslint-disable-next-line no-undefined + case undefined: + case 'auto': + case 'debug': + case null: + return { strictRequiresFilter: () => false, detectCyclesAndConditional: true }; + case false: + return { strictRequiresFilter: () => false, detectCyclesAndConditional: false }; + default: + if (typeof strictRequires === 'string' || Array.isArray(strictRequires)) { + return { + strictRequiresFilter: createFilter$1(strictRequires), + detectCyclesAndConditional: false + }; + } + throw new Error('Unexpected value for "strictRequires" option.'); + } +} + +function getPackageEntryPoint(dirPath) { + let entryPoint = 'index.js'; + + try { + if (existsSync(join$1(dirPath, 'package.json'))) { + entryPoint = + JSON.parse(readFileSync(join$1(dirPath, 'package.json'), { encoding: 'utf8' })).main || + entryPoint; + } + } catch (ignored) { + // ignored + } + + return entryPoint; +} + +function isDirectory$1(path) { + try { + if (statSync$1(path).isDirectory()) return true; + } catch (ignored) { + // Nothing to do here + } + return false; +} + +function getDynamicRequireModules(patterns, dynamicRequireRoot) { + const dynamicRequireModules = new Map(); + const dirNames = new Set(); + for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) { + const isNegated = pattern.startsWith('!'); + const modifyMap = (targetPath, resolvedPath) => + isNegated + ? dynamicRequireModules.delete(targetPath) + : dynamicRequireModules.set(targetPath, resolvedPath); + for (const path of glob$1.sync(isNegated ? pattern.substr(1) : pattern)) { + const resolvedPath = resolve$3(path); + const requirePath = normalizePathSlashes(resolvedPath); + if (isDirectory$1(resolvedPath)) { + dirNames.add(resolvedPath); + const modulePath = resolve$3(join$1(resolvedPath, getPackageEntryPoint(path))); + modifyMap(requirePath, modulePath); + modifyMap(normalizePathSlashes(modulePath), modulePath); + } else { + dirNames.add(dirname$1(resolvedPath)); + modifyMap(requirePath, resolvedPath); + } + } + } + return { + commonDir: dirNames.size ? getCommonDir([...dirNames, dynamicRequireRoot]) : null, + dynamicRequireModules + }; +} + +const FAILED_REQUIRE_ERROR = `throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');`; + +const COMMONJS_REQUIRE_EXPORT = 'commonjsRequire'; +const CREATE_COMMONJS_REQUIRE_EXPORT = 'createCommonjsRequire'; + +function getDynamicModuleRegistry( + isDynamicRequireModulesEnabled, + dynamicRequireModules, + commonDir, + ignoreDynamicRequires +) { + if (!isDynamicRequireModulesEnabled) { + return `export function ${COMMONJS_REQUIRE_EXPORT}(path) { + ${FAILED_REQUIRE_ERROR} +}`; + } + const dynamicModuleImports = [...dynamicRequireModules.values()] + .map( + (id, index) => + `import ${ + id.endsWith('.json') ? `json${index}` : `{ __require as require${index} }` + } from ${JSON.stringify(id)};` + ) + .join('\n'); + const dynamicModuleProps = [...dynamicRequireModules.keys()] + .map( + (id, index) => + `\t\t${JSON.stringify(getVirtualPathForDynamicRequirePath(id, commonDir))}: ${ + id.endsWith('.json') ? `function () { return json${index}; }` : `require${index}` + }` + ) + .join(',\n'); + return `${dynamicModuleImports} + +var dynamicModules; + +function getDynamicModules() { + return dynamicModules || (dynamicModules = { +${dynamicModuleProps} + }); +} + +export function ${CREATE_COMMONJS_REQUIRE_EXPORT}(originalModuleDir) { + function handleRequire(path) { + var resolvedPath = commonjsResolve(path, originalModuleDir); + if (resolvedPath !== null) { + return getDynamicModules()[resolvedPath](); + } + ${ignoreDynamicRequires ? 'return require(path);' : FAILED_REQUIRE_ERROR} + } + handleRequire.resolve = function (path) { + var resolvedPath = commonjsResolve(path, originalModuleDir); + if (resolvedPath !== null) { + return resolvedPath; + } + return require.resolve(path); + } + return handleRequire; +} + +function commonjsResolve (path, originalModuleDir) { + var shouldTryNodeModules = isPossibleNodeModulesPath(path); + path = normalize(path); + var relPath; + if (path[0] === '/') { + originalModuleDir = ''; + } + var modules = getDynamicModules(); + var checkedExtensions = ['', '.js', '.json']; + while (true) { + if (!shouldTryNodeModules) { + relPath = normalize(originalModuleDir + '/' + path); + } else { + relPath = normalize(originalModuleDir + '/node_modules/' + path); + } + + if (relPath.endsWith('/..')) { + break; // Travelled too far up, avoid infinite loop + } + + for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) { + var resolvedPath = relPath + checkedExtensions[extensionIndex]; + if (modules[resolvedPath]) { + return resolvedPath; + } + } + if (!shouldTryNodeModules) break; + var nextDir = normalize(originalModuleDir + '/..'); + if (nextDir === originalModuleDir) break; + originalModuleDir = nextDir; + } + return null; +} + +function isPossibleNodeModulesPath (modulePath) { + var c0 = modulePath[0]; + if (c0 === '/' || c0 === '\\\\') return false; + var c1 = modulePath[1], c2 = modulePath[2]; + if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) || + (c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false; + if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false; + return true; +} + +function normalize (path) { + path = path.replace(/\\\\/g, '/'); + var parts = path.split('/'); + var slashed = parts[0] === ''; + for (var i = 1; i < parts.length; i++) { + if (parts[i] === '.' || parts[i] === '') { + parts.splice(i--, 1); + } + } + for (var i = 1; i < parts.length; i++) { + if (parts[i] !== '..') continue; + if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') { + parts.splice(--i, 2); + i--; + } + } + path = parts.join('/'); + if (slashed && path[0] !== '/') path = '/' + path; + else if (path.length === 0) path = '.'; + return path; +}`; +} + +const isWrappedId = (id, suffix) => id.endsWith(suffix); +const wrapId$1 = (id, suffix) => `\0${id}${suffix}`; +const unwrapId$1 = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length); + +const PROXY_SUFFIX = '?commonjs-proxy'; +const WRAPPED_SUFFIX = '?commonjs-wrapped'; +const EXTERNAL_SUFFIX = '?commonjs-external'; +const EXPORTS_SUFFIX = '?commonjs-exports'; +const MODULE_SUFFIX = '?commonjs-module'; +const ENTRY_SUFFIX = '?commonjs-entry'; +const ES_IMPORT_SUFFIX = '?commonjs-es-import'; + +const DYNAMIC_MODULES_ID = '\0commonjs-dynamic-modules'; +const HELPERS_ID = '\0commonjsHelpers.js'; + +const IS_WRAPPED_COMMONJS = 'withRequireFunction'; + +// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers. +// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled. +// This could be improved by inspecting Rollup's "generatedCode" option + +const HELPERS = ` +export var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +export function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +export function getDefaultExportFromNamespaceIfPresent (n) { + return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n; +} + +export function getDefaultExportFromNamespaceIfNotNamed (n) { + return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n; +} + +export function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + if (this instanceof a) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} +`; + +function getHelpersModule() { + return HELPERS; +} + +function getUnknownRequireProxy(id, requireReturnsDefault) { + if (requireReturnsDefault === true || id.endsWith('.json')) { + return `export { default } from ${JSON.stringify(id)};`; + } + const name = getName(id); + const exported = + requireReturnsDefault === 'auto' + ? `import { getDefaultExportFromNamespaceIfNotNamed } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});` + : requireReturnsDefault === 'preferred' + ? `import { getDefaultExportFromNamespaceIfPresent } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});` + : !requireReturnsDefault + ? `import { getAugmentedNamespace } from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});` + : `export default ${name};`; + return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`; +} + +async function getStaticRequireProxy(id, requireReturnsDefault, loadModule) { + const name = getName(id); + const { + meta: { commonjs: commonjsMeta } + } = await loadModule({ id }); + if (!commonjsMeta) { + return getUnknownRequireProxy(id, requireReturnsDefault); + } + if (commonjsMeta.isCommonJS) { + return `export { __moduleExports as default } from ${JSON.stringify(id)};`; + } + if (!requireReturnsDefault) { + return `import { getAugmentedNamespace } from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify( + id + )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`; + } + if ( + requireReturnsDefault !== true && + (requireReturnsDefault === 'namespace' || + !commonjsMeta.hasDefaultExport || + (requireReturnsDefault === 'auto' && commonjsMeta.hasNamedExports)) + ) { + return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`; + } + return `export { default } from ${JSON.stringify(id)};`; +} + +function getEntryProxy(id, defaultIsModuleExports, getModuleInfo, shebang) { + const { + meta: { commonjs: commonjsMeta }, + hasDefaultExport + } = getModuleInfo(id); + if (!commonjsMeta || commonjsMeta.isCommonJS !== IS_WRAPPED_COMMONJS) { + const stringifiedId = JSON.stringify(id); + let code = `export * from ${stringifiedId};`; + if (hasDefaultExport) { + code += `export { default } from ${stringifiedId};`; + } + return shebang + code; + } + const result = getEsImportProxy(id, defaultIsModuleExports); + return { + ...result, + code: shebang + result.code + }; +} + +function getEsImportProxy(id, defaultIsModuleExports) { + const name = getName(id); + const exportsName = `${name}Exports`; + const requireModule = `require${capitalize(name)}`; + let code = + `import { getDefaultExportFromCjs } from "${HELPERS_ID}";\n` + + `import { __require as ${requireModule} } from ${JSON.stringify(id)};\n` + + `var ${exportsName} = ${requireModule}();\n` + + `export { ${exportsName} as __moduleExports };`; + if (defaultIsModuleExports === true) { + code += `\nexport { ${exportsName} as default };`; + } else { + code += `export default /*@__PURE__*/getDefaultExportFromCjs(${exportsName});`; + } + return { + code, + syntheticNamedExports: '__moduleExports' + }; +} + +/* eslint-disable no-param-reassign, no-undefined */ + + +function getCandidatesForExtension(resolved, extension) { + return [resolved + extension, `${resolved}${sep}index${extension}`]; +} + +function getCandidates(resolved, extensions) { + return extensions.reduce( + (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)), + [resolved] + ); +} + +function resolveExtensions(importee, importer, extensions) { + // not our problem + if (importee[0] !== '.' || !importer) return undefined; + + const resolved = resolve$3(dirname$1(importer), importee); + const candidates = getCandidates(resolved, extensions); + + for (let i = 0; i < candidates.length; i += 1) { + try { + const stats = statSync$1(candidates[i]); + if (stats.isFile()) return { id: candidates[i] }; + } catch (err) { + /* noop */ + } + } + + return undefined; +} + +function getResolveId(extensions, isPossibleCjsId) { + const currentlyResolving = new Map(); + + return { + /** + * This is a Maps of importers to Sets of require sources being resolved at + * the moment by resolveRequireSourcesAndUpdateMeta + */ + currentlyResolving, + async resolveId(importee, importer, resolveOptions) { + const customOptions = resolveOptions.custom; + // All logic below is specific to ES imports. + // Also, if we do not skip this logic for requires that are resolved while + // transforming a commonjs file, it can easily lead to deadlocks. + if ( + customOptions && + customOptions['node-resolve'] && + customOptions['node-resolve'].isRequire + ) { + return null; + } + const currentlyResolvingForParent = currentlyResolving.get(importer); + if (currentlyResolvingForParent && currentlyResolvingForParent.has(importee)) { + this.warn({ + code: 'THIS_RESOLVE_WITHOUT_OPTIONS', + message: + 'It appears a plugin has implemented a "resolveId" hook that uses "this.resolve" without forwarding the third "options" parameter of "resolveId". This is problematic as it can lead to wrong module resolutions especially for the node-resolve plugin and in certain cases cause early exit errors for the commonjs plugin.\nIn rare cases, this warning can appear if the same file is both imported and required from the same mixed ES/CommonJS module, in which case it can be ignored.', + url: 'https://rollupjs.org/guide/en/#resolveid' + }); + return null; + } + + if (isWrappedId(importee, WRAPPED_SUFFIX)) { + return unwrapId$1(importee, WRAPPED_SUFFIX); + } + + if ( + importee.endsWith(ENTRY_SUFFIX) || + isWrappedId(importee, MODULE_SUFFIX) || + isWrappedId(importee, EXPORTS_SUFFIX) || + isWrappedId(importee, PROXY_SUFFIX) || + isWrappedId(importee, ES_IMPORT_SUFFIX) || + isWrappedId(importee, EXTERNAL_SUFFIX) || + importee.startsWith(HELPERS_ID) || + importee === DYNAMIC_MODULES_ID + ) { + return importee; + } + + if (importer) { + if ( + importer === DYNAMIC_MODULES_ID || + // Proxies are only importing resolved ids, no need to resolve again + isWrappedId(importer, PROXY_SUFFIX) || + isWrappedId(importer, ES_IMPORT_SUFFIX) || + importer.endsWith(ENTRY_SUFFIX) + ) { + return importee; + } + if (isWrappedId(importer, EXTERNAL_SUFFIX)) { + // We need to return null for unresolved imports so that the proper warning is shown + if ( + !(await this.resolve( + importee, + importer, + Object.assign({ skipSelf: true }, resolveOptions) + )) + ) { + return null; + } + // For other external imports, we need to make sure they are handled as external + return { id: importee, external: true }; + } + } + + if (importee.startsWith('\0')) { + return null; + } + + // If this is an entry point or ESM import, we need to figure out if the importee is wrapped and + // if that is the case, we need to add a proxy. + const resolved = + (await this.resolve( + importee, + importer, + Object.assign({ skipSelf: true }, resolveOptions) + )) || resolveExtensions(importee, importer, extensions); + // Make sure that even if other plugins resolve again, we ignore our own proxies + if ( + !resolved || + resolved.external || + resolved.id.endsWith(ENTRY_SUFFIX) || + isWrappedId(resolved.id, ES_IMPORT_SUFFIX) || + !isPossibleCjsId(resolved.id) + ) { + return resolved; + } + const moduleInfo = await this.load(resolved); + const { + meta: { commonjs: commonjsMeta } + } = moduleInfo; + if (commonjsMeta) { + const { isCommonJS } = commonjsMeta; + if (isCommonJS) { + if (resolveOptions.isEntry) { + moduleInfo.moduleSideEffects = true; + // We must not precede entry proxies with a `\0` as that will mess up relative external resolution + return resolved.id + ENTRY_SUFFIX; + } + if (isCommonJS === IS_WRAPPED_COMMONJS) { + return { id: wrapId$1(resolved.id, ES_IMPORT_SUFFIX), meta: { commonjs: { resolved } } }; + } + } + } + return resolved; + } + }; +} + +function getRequireResolver(extensions, detectCyclesAndConditional, currentlyResolving) { + const knownCjsModuleTypes = Object.create(null); + const requiredIds = Object.create(null); + const unconditionallyRequiredIds = Object.create(null); + const dependencies = Object.create(null); + const getDependencies = (id) => dependencies[id] || (dependencies[id] = new Set()); + + const isCyclic = (id) => { + const dependenciesToCheck = new Set(getDependencies(id)); + for (const dependency of dependenciesToCheck) { + if (dependency === id) { + return true; + } + for (const childDependency of getDependencies(dependency)) { + dependenciesToCheck.add(childDependency); + } + } + return false; + }; + + // Once a module is listed here, its type (wrapped or not) is fixed and may + // not change for the rest of the current build, to not break already + // transformed modules. + const fullyAnalyzedModules = Object.create(null); + + const getTypeForFullyAnalyzedModule = (id) => { + const knownType = knownCjsModuleTypes[id]; + if (knownType !== true || !detectCyclesAndConditional || fullyAnalyzedModules[id]) { + return knownType; + } + if (isCyclic(id)) { + return (knownCjsModuleTypes[id] = IS_WRAPPED_COMMONJS); + } + return knownType; + }; + + const setInitialParentType = (id, initialCommonJSType) => { + // Fully analyzed modules may never change type + if (fullyAnalyzedModules[id]) { + return; + } + knownCjsModuleTypes[id] = initialCommonJSType; + if ( + detectCyclesAndConditional && + knownCjsModuleTypes[id] === true && + requiredIds[id] && + !unconditionallyRequiredIds[id] + ) { + knownCjsModuleTypes[id] = IS_WRAPPED_COMMONJS; + } + }; + + const analyzeRequiredModule = async (parentId, resolved, isConditional, loadModule) => { + const childId = resolved.id; + requiredIds[childId] = true; + if (!(isConditional || knownCjsModuleTypes[parentId] === IS_WRAPPED_COMMONJS)) { + unconditionallyRequiredIds[childId] = true; + } + + getDependencies(parentId).add(childId); + if (!isCyclic(childId)) { + // This makes sure the current transform handler waits for all direct + // dependencies to be loaded and transformed and therefore for all + // transitive CommonJS dependencies to be loaded as well so that all + // cycles have been found and knownCjsModuleTypes is reliable. + await loadModule(resolved); + } + }; + + const getTypeForImportedModule = async (resolved, loadModule) => { + if (resolved.id in knownCjsModuleTypes) { + // This handles cyclic ES dependencies + return knownCjsModuleTypes[resolved.id]; + } + const { + meta: { commonjs } + } = await loadModule(resolved); + return (commonjs && commonjs.isCommonJS) || false; + }; + + return { + getWrappedIds: () => + Object.keys(knownCjsModuleTypes).filter( + (id) => knownCjsModuleTypes[id] === IS_WRAPPED_COMMONJS + ), + isRequiredId: (id) => requiredIds[id], + async shouldTransformCachedModule({ + id: parentId, + resolvedSources, + meta: { commonjs: parentMeta } + }) { + // We explicitly track ES modules to handle circular imports + if (!(parentMeta && parentMeta.isCommonJS)) knownCjsModuleTypes[parentId] = false; + if (isWrappedId(parentId, ES_IMPORT_SUFFIX)) return false; + const parentRequires = parentMeta && parentMeta.requires; + if (parentRequires) { + setInitialParentType(parentId, parentMeta.initialCommonJSType); + await Promise.all( + parentRequires.map(({ resolved, isConditional }) => + analyzeRequiredModule(parentId, resolved, isConditional, this.load) + ) + ); + if (getTypeForFullyAnalyzedModule(parentId) !== parentMeta.isCommonJS) { + return true; + } + for (const { + resolved: { id } + } of parentRequires) { + if (getTypeForFullyAnalyzedModule(id) !== parentMeta.isRequiredCommonJS[id]) { + return true; + } + } + // Now that we decided to go with the cached copy, neither the parent + // module nor any of its children may change types anymore + fullyAnalyzedModules[parentId] = true; + for (const { + resolved: { id } + } of parentRequires) { + fullyAnalyzedModules[id] = true; + } + } + const parentRequireSet = new Set((parentRequires || []).map(({ resolved: { id } }) => id)); + return ( + await Promise.all( + Object.keys(resolvedSources) + .map((source) => resolvedSources[source]) + .filter(({ id, external }) => !(external || parentRequireSet.has(id))) + .map(async (resolved) => { + if (isWrappedId(resolved.id, ES_IMPORT_SUFFIX)) { + return ( + (await getTypeForImportedModule( + ( + await this.load({ id: resolved.id }) + ).meta.commonjs.resolved, + this.load + )) !== IS_WRAPPED_COMMONJS + ); + } + return (await getTypeForImportedModule(resolved, this.load)) === IS_WRAPPED_COMMONJS; + }) + ) + ).some((shouldTransform) => shouldTransform); + }, + /* eslint-disable no-param-reassign */ + resolveRequireSourcesAndUpdateMeta: + (rollupContext) => async (parentId, isParentCommonJS, parentMeta, sources) => { + parentMeta.initialCommonJSType = isParentCommonJS; + parentMeta.requires = []; + parentMeta.isRequiredCommonJS = Object.create(null); + setInitialParentType(parentId, isParentCommonJS); + const currentlyResolvingForParent = currentlyResolving.get(parentId) || new Set(); + currentlyResolving.set(parentId, currentlyResolvingForParent); + const requireTargets = await Promise.all( + sources.map(async ({ source, isConditional }) => { + // Never analyze or proxy internal modules + if (source.startsWith('\0')) { + return { id: source, allowProxy: false }; + } + currentlyResolvingForParent.add(source); + const resolved = + (await rollupContext.resolve(source, parentId, { + skipSelf: false, + custom: { 'node-resolve': { isRequire: true } } + })) || resolveExtensions(source, parentId, extensions); + currentlyResolvingForParent.delete(source); + if (!resolved) { + return { id: wrapId$1(source, EXTERNAL_SUFFIX), allowProxy: false }; + } + const childId = resolved.id; + if (resolved.external) { + return { id: wrapId$1(childId, EXTERNAL_SUFFIX), allowProxy: false }; + } + parentMeta.requires.push({ resolved, isConditional }); + await analyzeRequiredModule(parentId, resolved, isConditional, rollupContext.load); + return { id: childId, allowProxy: true }; + }) + ); + parentMeta.isCommonJS = getTypeForFullyAnalyzedModule(parentId); + fullyAnalyzedModules[parentId] = true; + return requireTargets.map(({ id: dependencyId, allowProxy }, index) => { + // eslint-disable-next-line no-multi-assign + const isCommonJS = (parentMeta.isRequiredCommonJS[dependencyId] = + getTypeForFullyAnalyzedModule(dependencyId)); + fullyAnalyzedModules[dependencyId] = true; + return { + source: sources[index].source, + id: allowProxy + ? isCommonJS === IS_WRAPPED_COMMONJS + ? wrapId$1(dependencyId, WRAPPED_SUFFIX) + : wrapId$1(dependencyId, PROXY_SUFFIX) + : dependencyId, + isCommonJS + }; + }); + }, + isCurrentlyResolving(source, parentId) { + const currentlyResolvingForParent = currentlyResolving.get(parentId); + return currentlyResolvingForParent && currentlyResolvingForParent.has(source); + } + }; +} + +function validateVersion(actualVersion, peerDependencyVersion, name) { + const versionRegexp = /\^(\d+\.\d+\.\d+)/g; + let minMajor = Infinity; + let minMinor = Infinity; + let minPatch = Infinity; + let foundVersion; + // eslint-disable-next-line no-cond-assign + while ((foundVersion = versionRegexp.exec(peerDependencyVersion))) { + const [foundMajor, foundMinor, foundPatch] = foundVersion[1].split('.').map(Number); + if (foundMajor < minMajor) { + minMajor = foundMajor; + minMinor = foundMinor; + minPatch = foundPatch; + } + } + if (!actualVersion) { + throw new Error( + `Insufficient ${name} version: "@rollup/plugin-commonjs" requires at least ${name}@${minMajor}.${minMinor}.${minPatch}.` + ); + } + const [major, minor, patch] = actualVersion.split('.').map(Number); + if ( + major < minMajor || + (major === minMajor && (minor < minMinor || (minor === minMinor && patch < minPatch))) + ) { + throw new Error( + `Insufficient ${name} version: "@rollup/plugin-commonjs" requires at least ${name}@${minMajor}.${minMinor}.${minPatch} but found ${name}@${actualVersion}.` + ); + } +} + +const operators = { + '==': (x) => equals(x.left, x.right, false), + + '!=': (x) => not(operators['=='](x)), + + '===': (x) => equals(x.left, x.right, true), + + '!==': (x) => not(operators['==='](x)), + + '!': (x) => isFalsy(x.argument), + + '&&': (x) => isTruthy(x.left) && isTruthy(x.right), + + '||': (x) => isTruthy(x.left) || isTruthy(x.right) +}; + +function not(value) { + return value === null ? value : !value; +} + +function equals(a, b, strict) { + if (a.type !== b.type) return null; + // eslint-disable-next-line eqeqeq + if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value; + return null; +} + +function isTruthy(node) { + if (!node) return false; + if (node.type === 'Literal') return !!node.value; + if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression); + if (node.operator in operators) return operators[node.operator](node); + return null; +} + +function isFalsy(node) { + return not(isTruthy(node)); +} + +function getKeypath(node) { + const parts = []; + + while (node.type === 'MemberExpression') { + if (node.computed) return null; + + parts.unshift(node.property.name); + // eslint-disable-next-line no-param-reassign + node = node.object; + } + + if (node.type !== 'Identifier') return null; + + const { name } = node; + parts.unshift(name); + + return { name, keypath: parts.join('.') }; +} + +const KEY_COMPILED_ESM = '__esModule'; + +function getDefineCompiledEsmType(node) { + const definedPropertyWithExports = getDefinePropertyCallName(node, 'exports'); + const definedProperty = + definedPropertyWithExports || getDefinePropertyCallName(node, 'module.exports'); + if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) { + return isTruthy(definedProperty.value) + ? definedPropertyWithExports + ? 'exports' + : 'module' + : false; + } + return false; +} + +function getDefinePropertyCallName(node, targetName) { + const { + callee: { object, property } + } = node; + if (!object || object.type !== 'Identifier' || object.name !== 'Object') return; + if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return; + if (node.arguments.length !== 3) return; + + const targetNames = targetName.split('.'); + const [target, key, value] = node.arguments; + if (targetNames.length === 1) { + if (target.type !== 'Identifier' || target.name !== targetNames[0]) { + return; + } + } + + if (targetNames.length === 2) { + if ( + target.type !== 'MemberExpression' || + target.object.name !== targetNames[0] || + target.property.name !== targetNames[1] + ) { + return; + } + } + + if (value.type !== 'ObjectExpression' || !value.properties) return; + + const valueProperty = value.properties.find((p) => p.key && p.key.name === 'value'); + if (!valueProperty || !valueProperty.value) return; + + // eslint-disable-next-line consistent-return + return { key: key.value, value: valueProperty.value }; +} + +function isShorthandProperty(parent) { + return parent && parent.type === 'Property' && parent.shorthand; +} + +function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges) { + const args = []; + const passedArgs = []; + if (uses.module) { + args.push('module'); + passedArgs.push(moduleName); + } + if (uses.exports) { + args.push('exports'); + passedArgs.push(uses.module ? `${moduleName}.exports` : exportsName); + } + magicString + .trim() + .indent('\t', { exclude: indentExclusionRanges }) + .prepend(`(function (${args.join(', ')}) {\n`) + // For some reason, this line is only indented correctly when using a + // require-wrapper if we have this leading space + .append(` \n} (${passedArgs.join(', ')}));`); +} + +function rewriteExportsAndGetExportsBlock( + magicString, + moduleName, + exportsName, + exportedExportsName, + wrapped, + moduleExportsAssignments, + firstTopLevelModuleExportsAssignment, + exportsAssignmentsByName, + topLevelAssignments, + defineCompiledEsmExpressions, + deconflictedExportNames, + code, + HELPERS_NAME, + exportMode, + defaultIsModuleExports, + usesRequireWrapper, + requireName +) { + const exports = []; + const exportDeclarations = []; + + if (usesRequireWrapper) { + getExportsWhenUsingRequireWrapper( + magicString, + wrapped, + exportMode, + exports, + moduleExportsAssignments, + exportsAssignmentsByName, + moduleName, + exportsName, + requireName, + defineCompiledEsmExpressions + ); + } else if (exportMode === 'replace') { + getExportsForReplacedModuleExports( + magicString, + exports, + exportDeclarations, + moduleExportsAssignments, + firstTopLevelModuleExportsAssignment, + exportsName, + defaultIsModuleExports, + HELPERS_NAME + ); + } else { + if (exportMode === 'module') { + exportDeclarations.push(`var ${exportedExportsName} = ${moduleName}.exports`); + exports.push(`${exportedExportsName} as __moduleExports`); + } else { + exports.push(`${exportsName} as __moduleExports`); + } + if (wrapped) { + exportDeclarations.push( + getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) + ); + } else { + getExports( + magicString, + exports, + exportDeclarations, + moduleExportsAssignments, + exportsAssignmentsByName, + deconflictedExportNames, + topLevelAssignments, + moduleName, + exportsName, + exportedExportsName, + defineCompiledEsmExpressions, + HELPERS_NAME, + defaultIsModuleExports, + exportMode + ); + } + } + if (exports.length) { + exportDeclarations.push(`export { ${exports.join(', ')} }`); + } + + return `\n\n${exportDeclarations.join(';\n')};`; +} + +function getExportsWhenUsingRequireWrapper( + magicString, + wrapped, + exportMode, + exports, + moduleExportsAssignments, + exportsAssignmentsByName, + moduleName, + exportsName, + requireName, + defineCompiledEsmExpressions +) { + exports.push(`${requireName} as __require`); + if (wrapped) return; + if (exportMode === 'replace') { + rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName); + } else { + rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, `${moduleName}.exports`); + // Collect and rewrite named exports + for (const [exportName, { nodes }] of exportsAssignmentsByName) { + for (const { node, type } of nodes) { + magicString.overwrite( + node.start, + node.left.end, + `${ + exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName + }.${exportName}` + ); + } + } + replaceDefineCompiledEsmExpressionsAndGetIfRestorable( + defineCompiledEsmExpressions, + magicString, + exportMode, + moduleName, + exportsName + ); + } +} + +function getExportsForReplacedModuleExports( + magicString, + exports, + exportDeclarations, + moduleExportsAssignments, + firstTopLevelModuleExportsAssignment, + exportsName, + defaultIsModuleExports, + HELPERS_NAME +) { + for (const { left } of moduleExportsAssignments) { + magicString.overwrite(left.start, left.end, exportsName); + } + magicString.prependRight(firstTopLevelModuleExportsAssignment.left.start, 'var '); + exports.push(`${exportsName} as __moduleExports`); + exportDeclarations.push( + getDefaultExportDeclaration(exportsName, defaultIsModuleExports, HELPERS_NAME) + ); +} + +function getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) { + return `export default ${ + defaultIsModuleExports === true + ? exportedExportsName + : defaultIsModuleExports === false + ? `${exportedExportsName}.default` + : `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportedExportsName})` + }`; +} + +function getExports( + magicString, + exports, + exportDeclarations, + moduleExportsAssignments, + exportsAssignmentsByName, + deconflictedExportNames, + topLevelAssignments, + moduleName, + exportsName, + exportedExportsName, + defineCompiledEsmExpressions, + HELPERS_NAME, + defaultIsModuleExports, + exportMode +) { + let deconflictedDefaultExportName; + // Collect and rewrite module.exports assignments + for (const { left } of moduleExportsAssignments) { + magicString.overwrite(left.start, left.end, `${moduleName}.exports`); + } + + // Collect and rewrite named exports + for (const [exportName, { nodes }] of exportsAssignmentsByName) { + const deconflicted = deconflictedExportNames[exportName]; + let needsDeclaration = true; + for (const { node, type } of nodes) { + let replacement = `${deconflicted} = ${ + exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName + }.${exportName}`; + if (needsDeclaration && topLevelAssignments.has(node)) { + replacement = `var ${replacement}`; + needsDeclaration = false; + } + magicString.overwrite(node.start, node.left.end, replacement); + } + if (needsDeclaration) { + magicString.prepend(`var ${deconflicted};\n`); + } + + if (exportName === 'default') { + deconflictedDefaultExportName = deconflicted; + } else { + exports.push(exportName === deconflicted ? exportName : `${deconflicted} as ${exportName}`); + } + } + + const isRestorableCompiledEsm = replaceDefineCompiledEsmExpressionsAndGetIfRestorable( + defineCompiledEsmExpressions, + magicString, + exportMode, + moduleName, + exportsName + ); + + if ( + defaultIsModuleExports === false || + (defaultIsModuleExports === 'auto' && + isRestorableCompiledEsm && + moduleExportsAssignments.length === 0) + ) { + // If there is no deconflictedDefaultExportName, then we use the namespace as + // fallback because there can be no "default" property on the namespace + exports.push(`${deconflictedDefaultExportName || exportedExportsName} as default`); + } else if ( + defaultIsModuleExports === true || + (!isRestorableCompiledEsm && moduleExportsAssignments.length === 0) + ) { + exports.push(`${exportedExportsName} as default`); + } else { + exportDeclarations.push( + getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) + ); + } +} + +function rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName) { + for (const { left } of moduleExportsAssignments) { + magicString.overwrite(left.start, left.end, exportsName); + } +} + +function replaceDefineCompiledEsmExpressionsAndGetIfRestorable( + defineCompiledEsmExpressions, + magicString, + exportMode, + moduleName, + exportsName +) { + let isRestorableCompiledEsm = false; + for (const { node, type } of defineCompiledEsmExpressions) { + isRestorableCompiledEsm = true; + const moduleExportsExpression = + node.type === 'CallExpression' ? node.arguments[0] : node.left.object; + magicString.overwrite( + moduleExportsExpression.start, + moduleExportsExpression.end, + exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName + ); + } + return isRestorableCompiledEsm; +} + +function isRequireExpression(node, scope) { + if (!node) return false; + if (node.type !== 'CallExpression') return false; + + // Weird case of `require()` or `module.require()` without arguments + if (node.arguments.length === 0) return false; + + return isRequire(node.callee, scope); +} + +function isRequire(node, scope) { + return ( + (node.type === 'Identifier' && node.name === 'require' && !scope.contains('require')) || + (node.type === 'MemberExpression' && isModuleRequire(node, scope)) + ); +} + +function isModuleRequire({ object, property }, scope) { + return ( + object.type === 'Identifier' && + object.name === 'module' && + property.type === 'Identifier' && + property.name === 'require' && + !scope.contains('module') + ); +} + +function hasDynamicArguments(node) { + return ( + node.arguments.length > 1 || + (node.arguments[0].type !== 'Literal' && + (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0)) + ); +} + +const reservedMethod = { resolve: true, cache: true, main: true }; + +function isNodeRequirePropertyAccess(parent) { + return parent && parent.property && reservedMethod[parent.property.name]; +} + +function getRequireStringArg(node) { + return node.arguments[0].type === 'Literal' + ? node.arguments[0].value + : node.arguments[0].quasis[0].value.cooked; +} + +function getRequireHandlers() { + const requireExpressions = []; + + function addRequireExpression( + sourceId, + node, + scope, + usesReturnValue, + isInsideTryBlock, + isInsideConditional, + toBeRemoved + ) { + requireExpressions.push({ + sourceId, + node, + scope, + usesReturnValue, + isInsideTryBlock, + isInsideConditional, + toBeRemoved + }); + } + + async function rewriteRequireExpressionsAndGetImportBlock( + magicString, + topLevelDeclarations, + reassignedNames, + helpersName, + dynamicRequireName, + moduleName, + exportsName, + id, + exportMode, + resolveRequireSourcesAndUpdateMeta, + needsRequireWrapper, + isEsModule, + isDynamicRequireModulesEnabled, + getIgnoreTryCatchRequireStatementMode, + commonjsMeta + ) { + const imports = []; + imports.push(`import * as ${helpersName} from "${HELPERS_ID}"`); + if (dynamicRequireName) { + imports.push( + `import { ${ + isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT + } as ${dynamicRequireName} } from "${DYNAMIC_MODULES_ID}"` + ); + } + if (exportMode === 'module') { + imports.push( + `import { __module as ${moduleName} } from ${JSON.stringify(wrapId$1(id, MODULE_SUFFIX))}`, + `var ${exportsName} = ${moduleName}.exports` + ); + } else if (exportMode === 'exports') { + imports.push( + `import { __exports as ${exportsName} } from ${JSON.stringify(wrapId$1(id, EXPORTS_SUFFIX))}` + ); + } + const requiresBySource = collectSources(requireExpressions); + const requireTargets = await resolveRequireSourcesAndUpdateMeta( + id, + needsRequireWrapper ? IS_WRAPPED_COMMONJS : !isEsModule, + commonjsMeta, + Object.keys(requiresBySource).map((source) => { + return { + source, + isConditional: requiresBySource[source].every((require) => require.isInsideConditional) + }; + }) + ); + processRequireExpressions( + imports, + requireTargets, + requiresBySource, + getIgnoreTryCatchRequireStatementMode, + magicString + ); + return imports.length ? `${imports.join(';\n')};\n\n` : ''; + } + + return { + addRequireExpression, + rewriteRequireExpressionsAndGetImportBlock + }; +} + +function collectSources(requireExpressions) { + const requiresBySource = Object.create(null); + for (const requireExpression of requireExpressions) { + const { sourceId } = requireExpression; + if (!requiresBySource[sourceId]) { + requiresBySource[sourceId] = []; + } + const requires = requiresBySource[sourceId]; + requires.push(requireExpression); + } + return requiresBySource; +} + +function processRequireExpressions( + imports, + requireTargets, + requiresBySource, + getIgnoreTryCatchRequireStatementMode, + magicString +) { + const generateRequireName = getGenerateRequireName(); + for (const { source, id: resolvedId, isCommonJS } of requireTargets) { + const requires = requiresBySource[source]; + const name = generateRequireName(requires); + let usesRequired = false; + let needsImport = false; + for (const { node, usesReturnValue, toBeRemoved, isInsideTryBlock } of requires) { + const { canConvertRequire, shouldRemoveRequire } = + isInsideTryBlock && isWrappedId(resolvedId, EXTERNAL_SUFFIX) + ? getIgnoreTryCatchRequireStatementMode(source) + : { canConvertRequire: true, shouldRemoveRequire: false }; + if (shouldRemoveRequire) { + if (usesReturnValue) { + magicString.overwrite(node.start, node.end, 'undefined'); + } else { + magicString.remove(toBeRemoved.start, toBeRemoved.end); + } + } else if (canConvertRequire) { + needsImport = true; + if (isCommonJS === IS_WRAPPED_COMMONJS) { + magicString.overwrite(node.start, node.end, `${name}()`); + } else if (usesReturnValue) { + usesRequired = true; + magicString.overwrite(node.start, node.end, name); + } else { + magicString.remove(toBeRemoved.start, toBeRemoved.end); + } + } + } + if (needsImport) { + if (isCommonJS === IS_WRAPPED_COMMONJS) { + imports.push(`import { __require as ${name} } from ${JSON.stringify(resolvedId)}`); + } else { + imports.push(`import ${usesRequired ? `${name} from ` : ''}${JSON.stringify(resolvedId)}`); + } + } + } +} + +function getGenerateRequireName() { + let uid = 0; + return (requires) => { + let name; + const hasNameConflict = ({ scope }) => scope.contains(name); + do { + name = `require$$${uid}`; + uid += 1; + } while (requires.some(hasNameConflict)); + return name; + }; +} + +/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */ + + +const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/; + +const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/; + +// There are three different types of CommonJS modules, described by their +// "exportMode": +// - exports: Only assignments to (module.)exports properties +// - replace: A single assignment to module.exports itself +// - module: Anything else +// Special cases: +// - usesRequireWrapper +// - isWrapped +async function transformCommonjs( + parse, + code, + id, + isEsModule, + ignoreGlobal, + ignoreRequire, + ignoreDynamicRequires, + getIgnoreTryCatchRequireStatementMode, + sourceMap, + isDynamicRequireModulesEnabled, + dynamicRequireModules, + commonDir, + astCache, + defaultIsModuleExports, + needsRequireWrapper, + resolveRequireSourcesAndUpdateMeta, + isRequired, + checkDynamicRequire, + commonjsMeta +) { + const ast = astCache || tryParse(parse, code, id); + const magicString = new MagicString(code); + const uses = { + module: false, + exports: false, + global: false, + require: false + }; + const virtualDynamicRequirePath = + isDynamicRequireModulesEnabled && getVirtualPathForDynamicRequirePath(dirname$1(id), commonDir); + let scope = attachScopes(ast, 'scope'); + let lexicalDepth = 0; + let programDepth = 0; + let classBodyDepth = 0; + let currentTryBlockEnd = null; + let shouldWrap = false; + + const globals = new Set(); + // A conditionalNode is a node for which execution is not guaranteed. If such a node is a require + // or contains nested requires, those should be handled as function calls unless there is an + // unconditional require elsewhere. + let currentConditionalNodeEnd = null; + const conditionalNodes = new Set(); + const { addRequireExpression, rewriteRequireExpressionsAndGetImportBlock } = getRequireHandlers(); + + // See which names are assigned to. This is necessary to prevent + // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`, + // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh) + const reassignedNames = new Set(); + const topLevelDeclarations = []; + const skippedNodes = new Set(); + const moduleAccessScopes = new Set([scope]); + const exportsAccessScopes = new Set([scope]); + const moduleExportsAssignments = []; + let firstTopLevelModuleExportsAssignment = null; + const exportsAssignmentsByName = new Map(); + const topLevelAssignments = new Set(); + const topLevelDefineCompiledEsmExpressions = []; + const replacedGlobal = []; + const replacedDynamicRequires = []; + const importedVariables = new Set(); + const indentExclusionRanges = []; + + walk$3(ast, { + enter(node, parent) { + if (skippedNodes.has(node)) { + this.skip(); + return; + } + + if (currentTryBlockEnd !== null && node.start > currentTryBlockEnd) { + currentTryBlockEnd = null; + } + if (currentConditionalNodeEnd !== null && node.start > currentConditionalNodeEnd) { + currentConditionalNodeEnd = null; + } + if (currentConditionalNodeEnd === null && conditionalNodes.has(node)) { + currentConditionalNodeEnd = node.end; + } + + programDepth += 1; + if (node.scope) ({ scope } = node); + if (functionType.test(node.type)) lexicalDepth += 1; + if (sourceMap) { + magicString.addSourcemapLocation(node.start); + magicString.addSourcemapLocation(node.end); + } + + // eslint-disable-next-line default-case + switch (node.type) { + case 'AssignmentExpression': + if (node.left.type === 'MemberExpression') { + const flattened = getKeypath(node.left); + if (!flattened || scope.contains(flattened.name)) return; + + const exportsPatternMatch = exportsPattern.exec(flattened.keypath); + if (!exportsPatternMatch || flattened.keypath === 'exports') return; + + const [, exportName] = exportsPatternMatch; + uses[flattened.name] = true; + + // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` – + if (flattened.keypath === 'module.exports') { + moduleExportsAssignments.push(node); + if (programDepth > 3) { + moduleAccessScopes.add(scope); + } else if (!firstTopLevelModuleExportsAssignment) { + firstTopLevelModuleExportsAssignment = node; + } + } else if (exportName === KEY_COMPILED_ESM) { + if (programDepth > 3) { + shouldWrap = true; + } else { + // The "type" is either "module" or "exports" to discern + // assignments to module.exports vs exports if needed + topLevelDefineCompiledEsmExpressions.push({ node, type: flattened.name }); + } + } else { + const exportsAssignments = exportsAssignmentsByName.get(exportName) || { + nodes: [], + scopes: new Set() + }; + exportsAssignments.nodes.push({ node, type: flattened.name }); + exportsAssignments.scopes.add(scope); + exportsAccessScopes.add(scope); + exportsAssignmentsByName.set(exportName, exportsAssignments); + if (programDepth <= 3) { + topLevelAssignments.add(node); + } + } + + skippedNodes.add(node.left); + } else { + for (const name of extractAssignedNames(node.left)) { + reassignedNames.add(name); + } + } + return; + case 'CallExpression': { + const defineCompiledEsmType = getDefineCompiledEsmType(node); + if (defineCompiledEsmType) { + if (programDepth === 3 && parent.type === 'ExpressionStatement') { + // skip special handling for [module.]exports until we know we render this + skippedNodes.add(node.arguments[0]); + topLevelDefineCompiledEsmExpressions.push({ node, type: defineCompiledEsmType }); + } else { + shouldWrap = true; + } + return; + } + + // Transform require.resolve + if ( + isDynamicRequireModulesEnabled && + node.callee.object && + isRequire(node.callee.object, scope) && + node.callee.property.name === 'resolve' + ) { + checkDynamicRequire(node.start); + uses.require = true; + const requireNode = node.callee.object; + replacedDynamicRequires.push(requireNode); + skippedNodes.add(node.callee); + return; + } + + if (!isRequireExpression(node, scope)) { + const keypath = getKeypath(node.callee); + if (keypath && importedVariables.has(keypath.name)) { + // Heuristic to deoptimize requires after a required function has been called + currentConditionalNodeEnd = Infinity; + } + return; + } + + skippedNodes.add(node.callee); + uses.require = true; + + if (hasDynamicArguments(node)) { + if (isDynamicRequireModulesEnabled) { + checkDynamicRequire(node.start); + } + if (!ignoreDynamicRequires) { + replacedDynamicRequires.push(node.callee); + } + return; + } + + const requireStringArg = getRequireStringArg(node); + if (!ignoreRequire(requireStringArg)) { + const usesReturnValue = parent.type !== 'ExpressionStatement'; + const toBeRemoved = + parent.type === 'ExpressionStatement' && + (!currentConditionalNodeEnd || + // We should completely remove requires directly in a try-catch + // so that Rollup can remove up the try-catch + (currentTryBlockEnd !== null && currentTryBlockEnd < currentConditionalNodeEnd)) + ? parent + : node; + addRequireExpression( + requireStringArg, + node, + scope, + usesReturnValue, + currentTryBlockEnd !== null, + currentConditionalNodeEnd !== null, + toBeRemoved + ); + if (parent.type === 'VariableDeclarator' && parent.id.type === 'Identifier') { + for (const name of extractAssignedNames(parent.id)) { + importedVariables.add(name); + } + } + } + return; + } + case 'ClassBody': + classBodyDepth += 1; + return; + case 'ConditionalExpression': + case 'IfStatement': + // skip dead branches + if (isFalsy(node.test)) { + skippedNodes.add(node.consequent); + } else if (isTruthy(node.test)) { + if (node.alternate) { + skippedNodes.add(node.alternate); + } + } else { + conditionalNodes.add(node.consequent); + if (node.alternate) { + conditionalNodes.add(node.alternate); + } + } + return; + case 'ArrowFunctionExpression': + case 'FunctionDeclaration': + case 'FunctionExpression': + // requires in functions should be conditional unless it is an IIFE + if ( + currentConditionalNodeEnd === null && + !(parent.type === 'CallExpression' && parent.callee === node) + ) { + currentConditionalNodeEnd = node.end; + } + return; + case 'Identifier': { + const { name } = node; + if (!isReference(node, parent) || scope.contains(name)) return; + switch (name) { + case 'require': + uses.require = true; + if (isNodeRequirePropertyAccess(parent)) { + return; + } + if (!ignoreDynamicRequires) { + if (isShorthandProperty(parent)) { + // as key and value are the same object, isReference regards + // both as references, so we need to skip now + skippedNodes.add(parent.value); + magicString.prependRight(node.start, 'require: '); + } + replacedDynamicRequires.push(node); + } + return; + case 'module': + case 'exports': + shouldWrap = true; + uses[name] = true; + return; + case 'global': + uses.global = true; + if (!ignoreGlobal) { + replacedGlobal.push(node); + } + return; + case 'define': + magicString.overwrite(node.start, node.end, 'undefined', { + storeName: true + }); + return; + default: + globals.add(name); + return; + } + } + case 'LogicalExpression': + // skip dead branches + if (node.operator === '&&') { + if (isFalsy(node.left)) { + skippedNodes.add(node.right); + } else if (!isTruthy(node.left)) { + conditionalNodes.add(node.right); + } + } else if (node.operator === '||') { + if (isTruthy(node.left)) { + skippedNodes.add(node.right); + } else if (!isFalsy(node.left)) { + conditionalNodes.add(node.right); + } + } + return; + case 'MemberExpression': + if (!isDynamicRequireModulesEnabled && isModuleRequire(node, scope)) { + uses.require = true; + replacedDynamicRequires.push(node); + skippedNodes.add(node.object); + skippedNodes.add(node.property); + } + return; + case 'ReturnStatement': + // if top-level return, we need to wrap it + if (lexicalDepth === 0) { + shouldWrap = true; + } + return; + case 'ThisExpression': + // rewrite top-level `this` as `commonjsHelpers.commonjsGlobal` + if (lexicalDepth === 0 && !classBodyDepth) { + uses.global = true; + if (!ignoreGlobal) { + replacedGlobal.push(node); + } + } + return; + case 'TryStatement': + if (currentTryBlockEnd === null) { + currentTryBlockEnd = node.block.end; + } + if (currentConditionalNodeEnd === null) { + currentConditionalNodeEnd = node.end; + } + return; + case 'UnaryExpression': + // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151) + if (node.operator === 'typeof') { + const flattened = getKeypath(node.argument); + if (!flattened) return; + + if (scope.contains(flattened.name)) return; + + if ( + !isEsModule && + (flattened.keypath === 'module.exports' || + flattened.keypath === 'module' || + flattened.keypath === 'exports') + ) { + magicString.overwrite(node.start, node.end, `'object'`, { + storeName: false + }); + } + } + return; + case 'VariableDeclaration': + if (!scope.parent) { + topLevelDeclarations.push(node); + } + return; + case 'TemplateElement': + if (node.value.raw.includes('\n')) { + indentExclusionRanges.push([node.start, node.end]); + } + } + }, + + leave(node) { + programDepth -= 1; + if (node.scope) scope = scope.parent; + if (functionType.test(node.type)) lexicalDepth -= 1; + if (node.type === 'ClassBody') classBodyDepth -= 1; + } + }); + + const nameBase = getName(id); + const exportsName = deconflict([...exportsAccessScopes], globals, nameBase); + const moduleName = deconflict([...moduleAccessScopes], globals, `${nameBase}Module`); + const requireName = deconflict([scope], globals, `require${capitalize(nameBase)}`); + const isRequiredName = deconflict([scope], globals, `hasRequired${capitalize(nameBase)}`); + const helpersName = deconflict([scope], globals, 'commonjsHelpers'); + const dynamicRequireName = + replacedDynamicRequires.length > 0 && + deconflict( + [scope], + globals, + isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT + ); + const deconflictedExportNames = Object.create(null); + for (const [exportName, { scopes }] of exportsAssignmentsByName) { + deconflictedExportNames[exportName] = deconflict([...scopes], globals, exportName); + } + + for (const node of replacedGlobal) { + magicString.overwrite(node.start, node.end, `${helpersName}.commonjsGlobal`, { + storeName: true + }); + } + for (const node of replacedDynamicRequires) { + magicString.overwrite( + node.start, + node.end, + isDynamicRequireModulesEnabled + ? `${dynamicRequireName}(${JSON.stringify(virtualDynamicRequirePath)})` + : dynamicRequireName, + { + contentOnly: true, + storeName: true + } + ); + } + + // We cannot wrap ES/mixed modules + shouldWrap = !isEsModule && (shouldWrap || (uses.exports && moduleExportsAssignments.length > 0)); + + if ( + !( + shouldWrap || + isRequired || + needsRequireWrapper || + uses.module || + uses.exports || + uses.require || + topLevelDefineCompiledEsmExpressions.length > 0 + ) && + (ignoreGlobal || !uses.global) + ) { + return { meta: { commonjs: { isCommonJS: false } } }; + } + + let leadingComment = ''; + if (code.startsWith('/*')) { + const commentEnd = code.indexOf('*/', 2) + 2; + leadingComment = `${code.slice(0, commentEnd)}\n`; + magicString.remove(0, commentEnd).trim(); + } + + let shebang = ''; + if (code.startsWith('#!')) { + const shebangEndPosition = code.indexOf('\n') + 1; + shebang = code.slice(0, shebangEndPosition); + magicString.remove(0, shebangEndPosition).trim(); + } + + const exportMode = isEsModule + ? 'none' + : shouldWrap + ? uses.module + ? 'module' + : 'exports' + : firstTopLevelModuleExportsAssignment + ? exportsAssignmentsByName.size === 0 && topLevelDefineCompiledEsmExpressions.length === 0 + ? 'replace' + : 'module' + : moduleExportsAssignments.length === 0 + ? 'exports' + : 'module'; + + const exportedExportsName = + exportMode === 'module' ? deconflict([], globals, `${nameBase}Exports`) : exportsName; + + const importBlock = await rewriteRequireExpressionsAndGetImportBlock( + magicString, + topLevelDeclarations, + reassignedNames, + helpersName, + dynamicRequireName, + moduleName, + exportsName, + id, + exportMode, + resolveRequireSourcesAndUpdateMeta, + needsRequireWrapper, + isEsModule, + isDynamicRequireModulesEnabled, + getIgnoreTryCatchRequireStatementMode, + commonjsMeta + ); + const usesRequireWrapper = commonjsMeta.isCommonJS === IS_WRAPPED_COMMONJS; + const exportBlock = isEsModule + ? '' + : rewriteExportsAndGetExportsBlock( + magicString, + moduleName, + exportsName, + exportedExportsName, + shouldWrap, + moduleExportsAssignments, + firstTopLevelModuleExportsAssignment, + exportsAssignmentsByName, + topLevelAssignments, + topLevelDefineCompiledEsmExpressions, + deconflictedExportNames, + code, + helpersName, + exportMode, + defaultIsModuleExports, + usesRequireWrapper, + requireName + ); + + if (shouldWrap) { + wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges); + } + + if (usesRequireWrapper) { + magicString.trim().indent('\t', { + exclude: indentExclusionRanges + }); + const exported = exportMode === 'module' ? `${moduleName}.exports` : exportsName; + magicString.prepend( + `var ${isRequiredName}; + +function ${requireName} () { +\tif (${isRequiredName}) return ${exported}; +\t${isRequiredName} = 1; +` + ).append(` +\treturn ${exported}; +}`); + if (exportMode === 'replace') { + magicString.prepend(`var ${exportsName};\n`); + } + } + + magicString + .trim() + .prepend(shebang + leadingComment + importBlock) + .append(exportBlock); + + return { + code: magicString.toString(), + map: sourceMap ? magicString.generateMap() : null, + syntheticNamedExports: isEsModule || usesRequireWrapper ? false : '__moduleExports', + meta: { commonjs: { ...commonjsMeta, shebang } } + }; +} + +const PLUGIN_NAME = 'commonjs'; + +function commonjs(options = {}) { + const { + ignoreGlobal, + ignoreDynamicRequires, + requireReturnsDefault: requireReturnsDefaultOption, + defaultIsModuleExports: defaultIsModuleExportsOption, + esmExternals + } = options; + const extensions = options.extensions || ['.js']; + const filter = createFilter$1(options.include, options.exclude); + const isPossibleCjsId = (id) => { + const extName = extname(id); + return extName === '.cjs' || (extensions.includes(extName) && filter(id)); + }; + + const { strictRequiresFilter, detectCyclesAndConditional } = getStrictRequiresFilter(options); + + const getRequireReturnsDefault = + typeof requireReturnsDefaultOption === 'function' + ? requireReturnsDefaultOption + : () => requireReturnsDefaultOption; + + let esmExternalIds; + const isEsmExternal = + typeof esmExternals === 'function' + ? esmExternals + : Array.isArray(esmExternals) + ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id)) + : () => esmExternals; + + const getDefaultIsModuleExports = + typeof defaultIsModuleExportsOption === 'function' + ? defaultIsModuleExportsOption + : () => + typeof defaultIsModuleExportsOption === 'boolean' ? defaultIsModuleExportsOption : 'auto'; + + const dynamicRequireRoot = + typeof options.dynamicRequireRoot === 'string' + ? resolve$3(options.dynamicRequireRoot) + : process.cwd(); + const { commonDir, dynamicRequireModules } = getDynamicRequireModules( + options.dynamicRequireTargets, + dynamicRequireRoot + ); + const isDynamicRequireModulesEnabled = dynamicRequireModules.size > 0; + + const ignoreRequire = + typeof options.ignore === 'function' + ? options.ignore + : Array.isArray(options.ignore) + ? (id) => options.ignore.includes(id) + : () => false; + + const getIgnoreTryCatchRequireStatementMode = (id) => { + const mode = + typeof options.ignoreTryCatch === 'function' + ? options.ignoreTryCatch(id) + : Array.isArray(options.ignoreTryCatch) + ? options.ignoreTryCatch.includes(id) + : typeof options.ignoreTryCatch !== 'undefined' + ? options.ignoreTryCatch + : true; + + return { + canConvertRequire: mode !== 'remove' && mode !== true, + shouldRemoveRequire: mode === 'remove' + }; + }; + + const { currentlyResolving, resolveId } = getResolveId(extensions, isPossibleCjsId); + + const sourceMap = options.sourceMap !== false; + + // Initialized in buildStart + let requireResolver; + + function transformAndCheckExports(code, id) { + const normalizedId = normalizePathSlashes(id); + const { isEsModule, hasDefaultExport, hasNamedExports, ast } = analyzeTopLevelStatements( + this.parse, + code, + id + ); + + const commonjsMeta = this.getModuleInfo(id).meta.commonjs || {}; + if (hasDefaultExport) { + commonjsMeta.hasDefaultExport = true; + } + if (hasNamedExports) { + commonjsMeta.hasNamedExports = true; + } + + if ( + !dynamicRequireModules.has(normalizedId) && + (!(hasCjsKeywords(code, ignoreGlobal) || requireResolver.isRequiredId(id)) || + (isEsModule && !options.transformMixedEsModules)) + ) { + commonjsMeta.isCommonJS = false; + return { meta: { commonjs: commonjsMeta } }; + } + + const needsRequireWrapper = + !isEsModule && (dynamicRequireModules.has(normalizedId) || strictRequiresFilter(id)); + + const checkDynamicRequire = (position) => { + const normalizedDynamicRequireRoot = normalizePathSlashes(dynamicRequireRoot); + + if (normalizedId.indexOf(normalizedDynamicRequireRoot) !== 0) { + this.error( + { + code: 'DYNAMIC_REQUIRE_OUTSIDE_ROOT', + normalizedId, + normalizedDynamicRequireRoot, + message: `"${normalizedId}" contains dynamic require statements but it is not within the current dynamicRequireRoot "${normalizedDynamicRequireRoot}". You should set dynamicRequireRoot to "${dirname$1( + normalizedId + )}" or one of its parent directories.` + }, + position + ); + } + }; + + return transformCommonjs( + this.parse, + code, + id, + isEsModule, + ignoreGlobal || isEsModule, + ignoreRequire, + ignoreDynamicRequires && !isDynamicRequireModulesEnabled, + getIgnoreTryCatchRequireStatementMode, + sourceMap, + isDynamicRequireModulesEnabled, + dynamicRequireModules, + commonDir, + ast, + getDefaultIsModuleExports(id), + needsRequireWrapper, + requireResolver.resolveRequireSourcesAndUpdateMeta(this), + requireResolver.isRequiredId(id), + checkDynamicRequire, + commonjsMeta + ); + } + + return { + name: PLUGIN_NAME, + + version: version$3, + + options(rawOptions) { + // We inject the resolver in the beginning so that "catch-all-resolver" like node-resolver + // do not prevent our plugin from resolving entry points ot proxies. + const plugins = Array.isArray(rawOptions.plugins) + ? [...rawOptions.plugins] + : rawOptions.plugins + ? [rawOptions.plugins] + : []; + plugins.unshift({ + name: 'commonjs--resolver', + resolveId + }); + return { ...rawOptions, plugins }; + }, + + buildStart({ plugins }) { + validateVersion(this.meta.rollupVersion, peerDependencies.rollup, 'rollup'); + const nodeResolve = plugins.find(({ name }) => name === 'node-resolve'); + if (nodeResolve) { + validateVersion(nodeResolve.version, '^13.0.6', '@rollup/plugin-node-resolve'); + } + if (options.namedExports != null) { + this.warn( + 'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.' + ); + } + requireResolver = getRequireResolver( + extensions, + detectCyclesAndConditional, + currentlyResolving + ); + }, + + buildEnd() { + if (options.strictRequires === 'debug') { + const wrappedIds = requireResolver.getWrappedIds(); + if (wrappedIds.length) { + this.warn({ + code: 'WRAPPED_IDS', + ids: wrappedIds, + message: `The commonjs plugin automatically wrapped the following files:\n[\n${wrappedIds + .map((id) => `\t${JSON.stringify(relative$1(process.cwd(), id))}`) + .join(',\n')}\n]` + }); + } else { + this.warn({ + code: 'WRAPPED_IDS', + ids: wrappedIds, + message: 'The commonjs plugin did not wrap any files.' + }); + } + } + }, + + load(id) { + if (id === HELPERS_ID) { + return getHelpersModule(); + } + + if (isWrappedId(id, MODULE_SUFFIX)) { + const name = getName(unwrapId$1(id, MODULE_SUFFIX)); + return { + code: `var ${name} = {exports: {}}; export {${name} as __module}`, + meta: { commonjs: { isCommonJS: false } } + }; + } + + if (isWrappedId(id, EXPORTS_SUFFIX)) { + const name = getName(unwrapId$1(id, EXPORTS_SUFFIX)); + return { + code: `var ${name} = {}; export {${name} as __exports}`, + meta: { commonjs: { isCommonJS: false } } + }; + } + + if (isWrappedId(id, EXTERNAL_SUFFIX)) { + const actualId = unwrapId$1(id, EXTERNAL_SUFFIX); + return getUnknownRequireProxy( + actualId, + isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true + ); + } + + // entry suffix is just appended to not mess up relative external resolution + if (id.endsWith(ENTRY_SUFFIX)) { + const acutalId = id.slice(0, -ENTRY_SUFFIX.length); + const { + meta: { commonjs: commonjsMeta } + } = this.getModuleInfo(acutalId); + const shebang = commonjsMeta?.shebang ?? ''; + return getEntryProxy( + acutalId, + getDefaultIsModuleExports(acutalId), + this.getModuleInfo, + shebang + ); + } + + if (isWrappedId(id, ES_IMPORT_SUFFIX)) { + const actualId = unwrapId$1(id, ES_IMPORT_SUFFIX); + return getEsImportProxy(actualId, getDefaultIsModuleExports(actualId)); + } + + if (id === DYNAMIC_MODULES_ID) { + return getDynamicModuleRegistry( + isDynamicRequireModulesEnabled, + dynamicRequireModules, + commonDir, + ignoreDynamicRequires + ); + } + + if (isWrappedId(id, PROXY_SUFFIX)) { + const actualId = unwrapId$1(id, PROXY_SUFFIX); + return getStaticRequireProxy(actualId, getRequireReturnsDefault(actualId), this.load); + } + + return null; + }, + + shouldTransformCachedModule(...args) { + return requireResolver.shouldTransformCachedModule.call(this, ...args); + }, + + transform(code, id) { + if (!isPossibleCjsId(id)) return null; + + try { + return transformAndCheckExports.call(this, code, id); + } catch (err) { + return this.error(err, err.pos); + } + } + }; +} + +// Matches the scheme of a URL, eg "http://" +const schemeRegex = /^[\w+.-]+:\/\//; +/** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ +const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; +/** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ +const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; +var UrlType; +(function (UrlType) { + UrlType[UrlType["Empty"] = 1] = "Empty"; + UrlType[UrlType["Hash"] = 2] = "Hash"; + UrlType[UrlType["Query"] = 3] = "Query"; + UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; + UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; + UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; + UrlType[UrlType["Absolute"] = 7] = "Absolute"; +})(UrlType || (UrlType = {})); +function isAbsoluteUrl(input) { + return schemeRegex.test(input); +} +function isSchemeRelativeUrl(input) { + return input.startsWith('//'); +} +function isAbsolutePath(input) { + return input.startsWith('/'); +} +function isFileUrl(input) { + return input.startsWith('file:'); +} +function isRelative(input) { + return /^[.?#]/.test(input); +} +function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); +} +function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); +} +function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: UrlType.Absolute, + }; +} +function parseUrl$2(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = UrlType.SchemeRelative; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = UrlType.AbsolutePath; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? UrlType.Query + : input.startsWith('#') + ? UrlType.Hash + : UrlType.RelativePath + : UrlType.Empty; + return url; +} +function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} +function mergePaths(url, base) { + normalizePath$4(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } +} +/** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ +function normalizePath$4(url, type) { + const rel = type <= UrlType.RelativePath; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; +} +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +function resolve$2(input, base) { + if (!input && !base) + return ''; + const url = parseUrl$2(input); + let inputType = url.type; + if (base && inputType !== UrlType.Absolute) { + const baseUrl = parseUrl$2(base); + const baseType = baseUrl.type; + switch (inputType) { + case UrlType.Empty: + url.hash = baseUrl.hash; + // fall through + case UrlType.Hash: + url.query = baseUrl.query; + // fall through + case UrlType.Query: + case UrlType.RelativePath: + mergePaths(url, baseUrl); + // fall through + case UrlType.AbsolutePath: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case UrlType.SchemeRelative: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath$4(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case UrlType.Hash: + case UrlType.Query: + return queryHash; + case UrlType.RelativePath: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case UrlType.AbsolutePath: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } +} + +function resolve$1(input, base) { + // The base is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + if (base && !base.endsWith('/')) + base += '/'; + return resolve$2(input, base); +} + +/** + * Removes everything after the last "/", but leaves the slash. + */ +function stripFilename(path) { + if (!path) + return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} + +const COLUMN$1 = 0; +const SOURCES_INDEX$1 = 1; +const SOURCE_LINE$1 = 2; +const SOURCE_COLUMN$1 = 3; +const NAMES_INDEX$1 = 4; + +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) + return mappings; + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) + mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) + return i; + } + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) { + return false; + } + } + return true; +} +function sortSegments(line, owned) { + if (!owned) + line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN$1] - b[COLUMN$1]; +} + +let found = false; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN$1] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } + else { + high = mid - 1; + } + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN$1] !== needle) + break; + } + return index; +} +function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN$1] !== needle) + break; + } + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; +} +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } + else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return (state.lastIndex = binarySearch(haystack, needle, low, high)); +} + +const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; +const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; +const LEAST_UPPER_BOUND = -1; +const GREATEST_LOWER_BOUND = 1; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +let decodedMappings; +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +let traceSegment; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +let originalPositionFor$1; +class TraceMap { + constructor(map, mapUrl) { + const isString = typeof map === 'string'; + if (!isString && map._decodedMemo) + return map; + const parsed = (isString ? JSON.parse(map) : map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names || []; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + const from = resolve$1(sourceRoot || '', stripFilename(mapUrl)); + this.resolvedSources = sources.map((s) => resolve$1(s || '', from)); + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } + else { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + } +} +(() => { + decodedMappings = (map) => { + return (map._decoded || (map._decoded = decode(map._encoded))); + }; + traceSegment = (map, line, column) => { + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return null; + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, GREATEST_LOWER_BOUND); + return index === -1 ? null : segments[index]; + }; + originalPositionFor$1 = (map, { line, column, bias }) => { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (index === -1) + return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) + return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping(resolvedSources[segment[SOURCES_INDEX$1]], segment[SOURCE_LINE$1] + 1, segment[SOURCE_COLUMN$1], segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null); + }; +})(); +function OMapping(source, line, column, name) { + return { source, line, column, name }; +} +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } + else if (bias === LEAST_UPPER_BOUND) + index++; + if (index === -1 || index === segments.length) + return -1; + return index; +} + +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +let get; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +let put; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +class SetArray { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +} +(() => { + get = (strarr, key) => strarr._indexes[key]; + put = (strarr, key) => { + // The key may or may not be present. If it is present, it's a number. + const index = get(strarr, key); + if (index !== undefined) + return index; + const { array, _indexes: indexes } = strarr; + return (indexes[key] = array.push(key) - 1); + }; +})(); + +const COLUMN = 0; +const SOURCES_INDEX = 1; +const SOURCE_LINE = 2; +const SOURCE_COLUMN = 3; +const NAMES_INDEX = 4; + +const NO_NAME = -1; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +let maybeAddSegment; +/** + * Adds/removes the content of the source file to the source map. + */ +let setSourceContent; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let toDecodedMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let toEncodedMap; +// This split declaration is only so that terser can elminiate the static initialization block. +let addSegmentInternal; +/** + * Provides the state to generate a sourcemap. + */ +class GenMapping { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + } +} +(() => { + maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); + }; + setSourceContent = (map, source, content) => { + const { _sources: sources, _sourcesContent: sourcesContent } = map; + sourcesContent[put(sources, source)] = content; + }; + toDecodedMap = (map) => { + const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + removeEmptyFinalLines(mappings); + return { + version: 3, + file: file || undefined, + names: names.array, + sourceRoot: sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + }; + }; + toEncodedMap = (map) => { + const decoded = toDecodedMap(map); + return Object.assign(Object.assign({}, decoded), { mappings: encode$1(decoded.mappings) }); + }; + // Internal helpers + addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + const line = getLine(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) + return; + return insert(line, index, [genColumn]); + } + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) + sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert(line, index, name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn]); + }; +})(); +function getLine(mappings, index) { + for (let i = mappings.length; i <= index; i++) { + mappings[i] = []; + } + return mappings[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) + break; + } + return index; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) + break; + } + if (len < length) + mappings.length = len; +} +function skipSourceless(line, index) { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) + return true; + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) + return false; + const prev = line[index - 1]; + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) + return false; + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return (sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); +} + +const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null); +const EMPTY_SOURCES = []; +function SegmentObject(source, line, column, name, content) { + return { source, line, column, name, content }; +} +function Source(map, sources, source, content) { + return { + map, + sources, + source, + content, + }; +} +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +function MapSource(map, sources) { + return Source(map, sources, '', null); +} +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +function OriginalSource(source, content) { + return Source(null, EMPTY_SOURCES, source, content); +} +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +function traceMappings(tree) { + // TODO: Eventually support sourceRoot, which has to be removed because the sources are already + // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. + const gen = new GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = decodedMappings(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length !== 1) { + const source = rootSources[segment[1]]; + traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ''); + // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a + // respective segment into an original source. + if (traced == null) + continue; + } + const { column, line, name, content, source } = traced; + maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) + setSourceContent(gen, source, content); + } + } + return gen; +} +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content); + } + const segment = traceSegment(source.map, line, column); + // If we couldn't find a segment, then this doesn't exist in the sourcemap. + if (segment == null) + return null; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length === 1) + return SOURCELESS_MAPPING; + return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name); +} + +function asArray(value) { + if (Array.isArray(value)) + return value; + return [value]; +} +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new TraceMap(m, '')); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error(`Transformation map ${i} must have exactly one source file.\n` + + 'Did you specify these with the most recent transformation maps first?'); + } + } + let tree = build$2(map, loader, '', 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; +} +function build$2(map, loader, importer, importerDepth) { + const { resolvedSources, sourcesContent } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + // The loading context gives the loader more information about why this file is being loaded + // (eg, from which importer). It also allows the loader to override the location of the loaded + // sourcemap/original source, or to override the content in the sourcesContent field if it's + // an unmodified source file. + const ctx = { + importer, + depth, + source: sourceFile || '', + content: undefined, + }; + // Use the provided loader callback to retrieve the file's sourcemap. + // TODO: We should eventually support async loading of sourcemap files. + const sourceMap = loader(ctx.source, ctx); + const { source, content } = ctx; + // If there is a sourcemap, then we need to recurse into it to load its source files. + if (sourceMap) + return build$2(new TraceMap(sourceMap, source), loader, source, depth); + // Else, it's an an unmodified source file. + // The contents of this unmodified source file can be overridden via the loader context, + // allowing it to be explicitly null or a string. If it remains undefined, we fall back to + // the importing sourcemap's `sourcesContent` field. + const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; + return OriginalSource(source, sourceContent); + }); + return MapSource(map, children); +} + +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +class SourceMap { + constructor(map, options) { + const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); + this.version = out.version; // SourceMap spec says this should be first. + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } +} + +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +function remapping(input, loader, options) { + const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} + +var src$2 = {exports: {}}; + +var node$1 = {exports: {}}; + +/** + * Helpers. + */ + +var ms$1; +var hasRequiredMs$1; + +function requireMs$1 () { + if (hasRequiredMs$1) return ms$1; + hasRequiredMs$1 = 1; + var s = 1000; + var m = s * 60; + var h = m * 60; + var d = h * 24; + var w = d * 7; + var y = d * 365.25; + + /** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + + ms$1 = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); + }; + + /** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } + } + + /** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; + } + + /** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; + } + + /** + * Pluralization helper. + */ + + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); + } + return ms$1; +} + +var common$b; +var hasRequiredCommon; + +function requireCommon () { + if (hasRequiredCommon) return common$b; + hasRequiredCommon = 1; + /** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + + function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = requireMs$1(); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + let i; + let len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; + } + + common$b = setup; + return common$b; +} + +/** + * Module dependencies. + */ + +var hasRequiredNode$1; + +function requireNode$1 () { + if (hasRequiredNode$1) return node$1.exports; + hasRequiredNode$1 = 1; + (function (module, exports) { + const tty = require$$0$3; + const util = require$$0$6; + + /** + * This is the Node.js implementation of `debug()`. + */ + + exports.init = init; + exports.log = log; + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' + ); + + /** + * Colors. + */ + + exports.colors = [6, 2, 3, 4, 5, 1]; + + try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } + } catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. + } + + /** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + + exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; + }, {}); + + /** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + + function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); + } + + /** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + + function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } + } + + function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; + } + + /** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + + function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); + } + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + function load() { + return process.env.DEBUG; + } + + /** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + + function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } + } + + module.exports = requireCommon()(exports); + + const {formatters} = module.exports; + + /** + * Map %o to `util.inspect()`, all on a single line. + */ + + formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); + }; + + /** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + + formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; + } (node$1, node$1.exports)); + return node$1.exports; +} + +var browser$3 = {exports: {}}; + +/* eslint-env browser */ + +var hasRequiredBrowser$1; + +function requireBrowser$1 () { + if (hasRequiredBrowser$1) return browser$3.exports; + hasRequiredBrowser$1 = 1; + (function (module, exports) { + /** + * This is the web browser implementation of `debug()`. + */ + + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.storage = localstorage(); + exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; + })(); + + /** + * Colors. + */ + + exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' + ]; + + /** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + + // eslint-disable-next-line complexity + function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + } + + /** + * Colorize log arguments if enabled. + * + * @api public + */ + + function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + } + + /** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ + exports.log = console.debug || console.log || (() => {}); + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; + } + + /** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + } + + module.exports = requireCommon()(exports); + + const {formatters} = module.exports; + + /** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } + }; + } (browser$3, browser$3.exports)); + return browser$3.exports; +} + +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + src$2.exports = requireBrowser$1(); +} else { + src$2.exports = requireNode$1(); +} + +var srcExports$1 = src$2.exports; +var debug$i = /*@__PURE__*/getDefaultExportFromCjs(srcExports$1); + +let pnp; +if (process.versions.pnp) { + try { + pnp = createRequire$1(import.meta.url)('pnpapi'); + } + catch { } +} +function invalidatePackageData(packageCache, pkgPath) { + const pkgDir = path$o.dirname(pkgPath); + packageCache.forEach((pkg, cacheKey) => { + if (pkg.dir === pkgDir) { + packageCache.delete(cacheKey); + } + }); +} +function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageCache) { + if (pnp) { + const cacheKey = getRpdCacheKey(pkgName, basedir, preserveSymlinks); + if (packageCache?.has(cacheKey)) + return packageCache.get(cacheKey); + try { + const pkg = pnp.resolveToUnqualified(pkgName, basedir, { + considerBuiltins: false, + }); + if (!pkg) + return null; + const pkgData = loadPackageData(path$o.join(pkg, 'package.json')); + packageCache?.set(cacheKey, pkgData); + return pkgData; + } + catch { + return null; + } + } + const originalBasedir = basedir; + while (basedir) { + if (packageCache) { + const cached = getRpdCache(packageCache, pkgName, basedir, originalBasedir, preserveSymlinks); + if (cached) + return cached; + } + const pkg = path$o.join(basedir, 'node_modules', pkgName, 'package.json'); + try { + if (fs$l.existsSync(pkg)) { + const pkgPath = preserveSymlinks ? pkg : safeRealpathSync(pkg); + const pkgData = loadPackageData(pkgPath); + if (packageCache) { + setRpdCache(packageCache, pkgData, pkgName, basedir, originalBasedir, preserveSymlinks); + } + return pkgData; + } + } + catch { } + const nextBasedir = path$o.dirname(basedir); + if (nextBasedir === basedir) + break; + basedir = nextBasedir; + } + return null; +} +function findNearestPackageData(basedir, packageCache) { + const originalBasedir = basedir; + while (basedir) { + if (packageCache) { + const cached = getFnpdCache(packageCache, basedir, originalBasedir); + if (cached) + return cached; + } + const pkgPath = path$o.join(basedir, 'package.json'); + if (tryStatSync(pkgPath)?.isFile()) { + try { + const pkgData = loadPackageData(pkgPath); + if (packageCache) { + setFnpdCache(packageCache, pkgData, basedir, originalBasedir); + } + return pkgData; + } + catch { } + } + const nextBasedir = path$o.dirname(basedir); + if (nextBasedir === basedir) + break; + basedir = nextBasedir; + } + return null; +} +// Finds the nearest package.json with a `name` field +function findNearestMainPackageData(basedir, packageCache) { + const nearestPackage = findNearestPackageData(basedir, packageCache); + return (nearestPackage && + (nearestPackage.data.name + ? nearestPackage + : findNearestMainPackageData(path$o.dirname(nearestPackage.dir), packageCache))); +} +function loadPackageData(pkgPath) { + const data = JSON.parse(fs$l.readFileSync(pkgPath, 'utf-8')); + const pkgDir = path$o.dirname(pkgPath); + const { sideEffects } = data; + let hasSideEffects; + if (typeof sideEffects === 'boolean') { + hasSideEffects = () => sideEffects; + } + else if (Array.isArray(sideEffects)) { + const finalPackageSideEffects = sideEffects.map((sideEffect) => { + /* + * The array accepts simple glob patterns to the relevant files... Patterns like *.css, which do not include a /, will be treated like **\/*.css. + * https://webpack.js.org/guides/tree-shaking/ + * https://github.com/vitejs/vite/pull/11807 + */ + if (sideEffect.includes('/')) { + return sideEffect; + } + return `**/${sideEffect}`; + }); + hasSideEffects = createFilter(finalPackageSideEffects, null, { + resolve: pkgDir, + }); + } + else { + hasSideEffects = () => null; + } + const pkg = { + dir: pkgDir, + data, + hasSideEffects, + webResolvedImports: {}, + nodeResolvedImports: {}, + setResolvedCache(key, entry, targetWeb) { + if (targetWeb) { + pkg.webResolvedImports[key] = entry; + } + else { + pkg.nodeResolvedImports[key] = entry; + } + }, + getResolvedCache(key, targetWeb) { + if (targetWeb) { + return pkg.webResolvedImports[key]; + } + else { + return pkg.nodeResolvedImports[key]; + } + }, + }; + return pkg; +} +function watchPackageDataPlugin(packageCache) { + // a list of files to watch before the plugin is ready + const watchQueue = new Set(); + const watchedDirs = new Set(); + const watchFileStub = (id) => { + watchQueue.add(id); + }; + let watchFile = watchFileStub; + const setPackageData = packageCache.set.bind(packageCache); + packageCache.set = (id, pkg) => { + if (!isInNodeModules$1(pkg.dir) && !watchedDirs.has(pkg.dir)) { + watchedDirs.add(pkg.dir); + watchFile(path$o.join(pkg.dir, 'package.json')); + } + return setPackageData(id, pkg); + }; + return { + name: 'vite:watch-package-data', + buildStart() { + watchFile = this.addWatchFile.bind(this); + watchQueue.forEach(watchFile); + watchQueue.clear(); + }, + buildEnd() { + watchFile = watchFileStub; + }, + watchChange(id) { + if (id.endsWith('/package.json')) { + invalidatePackageData(packageCache, path$o.normalize(id)); + } + }, + handleHotUpdate({ file }) { + if (file.endsWith('/package.json')) { + invalidatePackageData(packageCache, path$o.normalize(file)); + } + }, + }; +} +/** + * Get cached `resolvePackageData` value based on `basedir`. When one is found, + * and we've already traversed some directories between `basedir` and `originalBasedir`, + * we cache the value for those in-between directories as well. + * + * This makes it so the fs is only read once for a shared `basedir`. + */ +function getRpdCache(packageCache, pkgName, basedir, originalBasedir, preserveSymlinks) { + const cacheKey = getRpdCacheKey(pkgName, basedir, preserveSymlinks); + const pkgData = packageCache.get(cacheKey); + if (pkgData) { + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getRpdCacheKey(pkgName, dir, preserveSymlinks), pkgData); + }); + return pkgData; + } +} +function setRpdCache(packageCache, pkgData, pkgName, basedir, originalBasedir, preserveSymlinks) { + packageCache.set(getRpdCacheKey(pkgName, basedir, preserveSymlinks), pkgData); + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getRpdCacheKey(pkgName, dir, preserveSymlinks), pkgData); + }); +} +// package cache key for `resolvePackageData` +function getRpdCacheKey(pkgName, basedir, preserveSymlinks) { + return `rpd_${pkgName}_${basedir}_${preserveSymlinks}`; +} +/** + * Get cached `findNearestPackageData` value based on `basedir`. When one is found, + * and we've already traversed some directories between `basedir` and `originalBasedir`, + * we cache the value for those in-between directories as well. + * + * This makes it so the fs is only read once for a shared `basedir`. + */ +function getFnpdCache(packageCache, basedir, originalBasedir) { + const cacheKey = getFnpdCacheKey(basedir); + const pkgData = packageCache.get(cacheKey); + if (pkgData) { + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getFnpdCacheKey(dir), pkgData); + }); + return pkgData; + } +} +function setFnpdCache(packageCache, pkgData, basedir, originalBasedir) { + packageCache.set(getFnpdCacheKey(basedir), pkgData); + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getFnpdCacheKey(dir), pkgData); + }); +} +// package cache key for `findNearestPackageData` +function getFnpdCacheKey(basedir) { + return `fnpd_${basedir}`; +} +/** + * Traverse between `longerDir` (inclusive) and `shorterDir` (exclusive) and call `cb` for each dir. + * @param longerDir Longer dir path, e.g. `/User/foo/bar/baz` + * @param shorterDir Shorter dir path, e.g. `/User/foo` + */ +function traverseBetweenDirs(longerDir, shorterDir, cb) { + while (longerDir !== shorterDir) { + cb(longerDir); + longerDir = path$o.dirname(longerDir); + } +} + +const createFilter = createFilter$1; +const windowsSlashRE = /\\/g; +function slash$1(p) { + return p.replace(windowsSlashRE, '/'); +} +/** + * Prepend `/@id/` and replace null byte so the id is URL-safe. + * This is prepended to resolved ids that are not valid browser + * import specifiers by the importAnalysis plugin. + */ +function wrapId(id) { + return id.startsWith(VALID_ID_PREFIX) + ? id + : VALID_ID_PREFIX + id.replace('\0', NULL_BYTE_PLACEHOLDER); +} +/** + * Undo {@link wrapId}'s `/@id/` and null byte replacements. + */ +function unwrapId(id) { + return id.startsWith(VALID_ID_PREFIX) + ? id.slice(VALID_ID_PREFIX.length).replace(NULL_BYTE_PLACEHOLDER, '\0') + : id; +} +const replaceSlashOrColonRE = /[/:]/g; +const replaceDotRE = /\./g; +const replaceNestedIdRE = /(\s*>\s*)/g; +const replaceHashRE = /#/g; +const flattenId = (id) => { + const flatId = limitFlattenIdLength(id + .replace(replaceSlashOrColonRE, '_') + .replace(replaceDotRE, '__') + .replace(replaceNestedIdRE, '___') + .replace(replaceHashRE, '____')); + return flatId; +}; +const FLATTEN_ID_HASH_LENGTH = 8; +const FLATTEN_ID_MAX_FILE_LENGTH = 170; +const limitFlattenIdLength = (id, limit = FLATTEN_ID_MAX_FILE_LENGTH) => { + if (id.length <= limit) { + return id; + } + return id.slice(0, limit - (FLATTEN_ID_HASH_LENGTH + 1)) + '_' + getHash(id); +}; +const normalizeId = (id) => id.replace(replaceNestedIdRE, ' > '); +// Supported by Node, Deno, Bun +const NODE_BUILTIN_NAMESPACE = 'node:'; +// Supported by Deno +const NPM_BUILTIN_NAMESPACE = 'npm:'; +// Supported by Bun +const BUN_BUILTIN_NAMESPACE = 'bun:'; +// Some runtimes like Bun injects namespaced modules here, which is not a node builtin +const nodeBuiltins = builtinModules.filter((id) => !id.includes(':')); +// TODO: Use `isBuiltin` from `node:module`, but Deno doesn't support it +function isBuiltin(id) { + if (process.versions.deno && id.startsWith(NPM_BUILTIN_NAMESPACE)) + return true; + if (process.versions.bun && id.startsWith(BUN_BUILTIN_NAMESPACE)) + return true; + return isNodeBuiltin(id); +} +function isNodeBuiltin(id) { + if (id.startsWith(NODE_BUILTIN_NAMESPACE)) + return true; + return nodeBuiltins.includes(id); +} +function isInNodeModules$1(id) { + return id.includes('node_modules'); +} +function moduleListContains(moduleList, id) { + return moduleList?.some((m) => m === id || id.startsWith(withTrailingSlash(m))); +} +function isOptimizable(id, optimizeDeps) { + const { extensions } = optimizeDeps; + return (OPTIMIZABLE_ENTRY_RE.test(id) || + (extensions?.some((ext) => id.endsWith(ext)) ?? false)); +} +const bareImportRE = /^(?![a-zA-Z]:)[\w@](?!.*:\/\/)/; +const deepImportRE = /^([^@][^/]*)\/|^(@[^/]+\/[^/]+)\//; +// TODO: use import() +const _require$1 = createRequire$1(import.meta.url); +function resolveDependencyVersion(dep, pkgRelativePath = '../../package.json') { + const pkgPath = path$o.resolve(_require$1.resolve(dep), pkgRelativePath); + return JSON.parse(fs$l.readFileSync(pkgPath, 'utf-8')).version; +} +const rollupVersion = resolveDependencyVersion('rollup'); +// set in bin/vite.js +const filter = process.env.VITE_DEBUG_FILTER; +const DEBUG = process.env.DEBUG; +function createDebugger(namespace, options = {}) { + const log = debug$i(namespace); + const { onlyWhenFocused } = options; + let enabled = log.enabled; + if (enabled && onlyWhenFocused) { + const ns = typeof onlyWhenFocused === 'string' ? onlyWhenFocused : namespace; + enabled = !!DEBUG?.includes(ns); + } + if (enabled) { + return (...args) => { + if (!filter || args.some((a) => a?.includes?.(filter))) { + log(...args); + } + }; + } +} +function testCaseInsensitiveFS() { + if (!CLIENT_ENTRY.endsWith('client.mjs')) { + throw new Error(`cannot test case insensitive FS, CLIENT_ENTRY const doesn't contain client.mjs`); + } + if (!fs$l.existsSync(CLIENT_ENTRY)) { + throw new Error('cannot test case insensitive FS, CLIENT_ENTRY does not point to an existing file: ' + + CLIENT_ENTRY); + } + return fs$l.existsSync(CLIENT_ENTRY.replace('client.mjs', 'cLiEnT.mjs')); +} +const urlCanParse = URL$3.canParse ?? + // URL.canParse is supported from Node.js 18.17.0+, 20.0.0+ + ((path, base) => { + try { + new URL$3(path, base); + return true; + } + catch { + return false; + } + }); +const isCaseInsensitiveFS = testCaseInsensitiveFS(); +const isWindows$3 = os$4.platform() === 'win32'; +const VOLUME_RE = /^[A-Z]:/i; +function normalizePath$3(id) { + return path$o.posix.normalize(isWindows$3 ? slash$1(id) : id); +} +function fsPathFromId(id) { + const fsPath = normalizePath$3(id.startsWith(FS_PREFIX) ? id.slice(FS_PREFIX.length) : id); + return fsPath[0] === '/' || VOLUME_RE.test(fsPath) ? fsPath : `/${fsPath}`; +} +function fsPathFromUrl(url) { + return fsPathFromId(cleanUrl(url)); +} +function withTrailingSlash(path) { + if (path[path.length - 1] !== '/') { + return `${path}/`; + } + return path; +} +/** + * Check if dir is a parent of file + * + * Warning: parameters are not validated, only works with normalized absolute paths + * + * @param dir - normalized absolute path + * @param file - normalized absolute path + * @returns true if dir is a parent of file + */ +function isParentDirectory(dir, file) { + dir = withTrailingSlash(dir); + return (file.startsWith(dir) || + (isCaseInsensitiveFS && file.toLowerCase().startsWith(dir.toLowerCase()))); +} +/** + * Check if 2 file name are identical + * + * Warning: parameters are not validated, only works with normalized absolute paths + * + * @param file1 - normalized absolute path + * @param file2 - normalized absolute path + * @returns true if both files url are identical + */ +function isSameFileUri(file1, file2) { + return (file1 === file2 || + (isCaseInsensitiveFS && file1.toLowerCase() === file2.toLowerCase())); +} +const postfixRE = /[?#].*$/s; +function cleanUrl(url) { + return url.replace(postfixRE, ''); +} +const externalRE = /^(https?:)?\/\//; +const isExternalUrl = (url) => externalRE.test(url); +const dataUrlRE = /^\s*data:/i; +const isDataUrl = (url) => dataUrlRE.test(url); +const virtualModuleRE = /^virtual-module:.*/; +const virtualModulePrefix = 'virtual-module:'; +const knownJsSrcRE = /\.(?:[jt]sx?|m[jt]s|vue|marko|svelte|astro|imba|mdx)(?:$|\?)/; +const isJSRequest = (url) => { + url = cleanUrl(url); + if (knownJsSrcRE.test(url)) { + return true; + } + if (!path$o.extname(url) && url[url.length - 1] !== '/') { + return true; + } + return false; +}; +const knownTsRE = /\.(?:ts|mts|cts|tsx)(?:$|\?)/; +const isTsRequest = (url) => knownTsRE.test(url); +const importQueryRE = /(\?|&)import=?(?:&|$)/; +const directRequestRE$1 = /(\?|&)direct=?(?:&|$)/; +const internalPrefixes = [ + FS_PREFIX, + VALID_ID_PREFIX, + CLIENT_PUBLIC_PATH, + ENV_PUBLIC_PATH, +]; +const InternalPrefixRE = new RegExp(`^(?:${internalPrefixes.join('|')})`); +const trailingSeparatorRE = /[?&]$/; +const isImportRequest = (url) => importQueryRE.test(url); +const isInternalRequest = (url) => InternalPrefixRE.test(url); +function removeImportQuery(url) { + return url.replace(importQueryRE, '$1').replace(trailingSeparatorRE, ''); +} +function removeDirectQuery(url) { + return url.replace(directRequestRE$1, '$1').replace(trailingSeparatorRE, ''); +} +const urlRE = /(\?|&)url(?:&|$)/; +const rawRE = /(\?|&)raw(?:&|$)/; +function removeUrlQuery(url) { + return url.replace(urlRE, '$1').replace(trailingSeparatorRE, ''); +} +const replacePercentageRE = /%/g; +function injectQuery(url, queryToInject) { + // encode percents for consistent behavior with pathToFileURL + // see #2614 for details + const resolvedUrl = new URL$3(url.replace(replacePercentageRE, '%25'), 'relative:///'); + const { search, hash } = resolvedUrl; + let pathname = cleanUrl(url); + pathname = isWindows$3 ? slash$1(pathname) : pathname; + return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${hash ?? ''}`; +} +const timestampRE = /\bt=\d{13}&?\b/; +function removeTimestampQuery(url) { + return url.replace(timestampRE, '').replace(trailingSeparatorRE, ''); +} +async function asyncReplace(input, re, replacer) { + let match; + let remaining = input; + let rewritten = ''; + while ((match = re.exec(remaining))) { + rewritten += remaining.slice(0, match.index); + rewritten += await replacer(match); + remaining = remaining.slice(match.index + match[0].length); + } + rewritten += remaining; + return rewritten; +} +function timeFrom(start, subtract = 0) { + const time = performance.now() - start - subtract; + const timeString = (time.toFixed(2) + `ms`).padEnd(5, ' '); + if (time < 10) { + return colors$1.green(timeString); + } + else if (time < 50) { + return colors$1.yellow(timeString); + } + else { + return colors$1.red(timeString); + } +} +/** + * pretty url for logging. + */ +function prettifyUrl(url, root) { + url = removeTimestampQuery(url); + const isAbsoluteFile = url.startsWith(root); + if (isAbsoluteFile || url.startsWith(FS_PREFIX)) { + const file = path$o.posix.relative(root, isAbsoluteFile ? url : fsPathFromId(url)); + return colors$1.dim(file); + } + else { + return colors$1.dim(url); + } +} +function isObject$1(value) { + return Object.prototype.toString.call(value) === '[object Object]'; +} +function isDefined(value) { + return value != null; +} +function tryStatSync(file) { + try { + // The "throwIfNoEntry" is a performance optimization for cases where the file does not exist + return fs$l.statSync(file, { throwIfNoEntry: false }); + } + catch { + // Ignore errors + } +} +function lookupFile(dir, fileNames) { + while (dir) { + for (const fileName of fileNames) { + const fullPath = path$o.join(dir, fileName); + if (tryStatSync(fullPath)?.isFile()) + return fullPath; + } + const parentDir = path$o.dirname(dir); + if (parentDir === dir) + return; + dir = parentDir; + } +} +function isFilePathESM(filePath, packageCache) { + if (/\.m[jt]s$/.test(filePath)) { + return true; + } + else if (/\.c[jt]s$/.test(filePath)) { + return false; + } + else { + // check package.json for type: "module" + try { + const pkg = findNearestPackageData(path$o.dirname(filePath), packageCache); + return pkg?.data.type === 'module'; + } + catch { + return false; + } + } +} +const splitRE = /\r?\n/; +const range = 2; +function pad$1(source, n = 2) { + const lines = source.split(splitRE); + return lines.map((l) => ` `.repeat(n) + l).join(`\n`); +} +function posToNumber(source, pos) { + if (typeof pos === 'number') + return pos; + const lines = source.split(splitRE); + const { line, column } = pos; + let start = 0; + for (let i = 0; i < line - 1 && i < lines.length; i++) { + start += lines[i].length + 1; + } + return start + column; +} +function numberToPos(source, offset) { + if (typeof offset !== 'number') + return offset; + if (offset > source.length) { + throw new Error(`offset is longer than source length! offset ${offset} > length ${source.length}`); + } + const lines = source.split(splitRE); + let counted = 0; + let line = 0; + let column = 0; + for (; line < lines.length; line++) { + const lineLength = lines[line].length + 1; + if (counted + lineLength >= offset) { + column = offset - counted + 1; + break; + } + counted += lineLength; + } + return { line: line + 1, column }; +} +function generateCodeFrame(source, start = 0, end) { + start = Math.max(posToNumber(source, start), 0); + end = Math.min(end !== undefined ? posToNumber(source, end) : start, source.length); + const lines = source.split(splitRE); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length; + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) + continue; + const line = j + 1; + res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`); + const lineLength = lines[j].length; + if (j === i) { + // push underline + const pad = Math.max(start - (count - lineLength), 0); + const length = Math.max(1, end > count ? lineLength - pad : end - start); + res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length)); + } + else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + '^'.repeat(length)); + } + count += lineLength + 1; + } + } + break; + } + count++; + } + return res.join('\n'); +} +function isFileReadable(filename) { + if (!tryStatSync(filename)) { + return false; + } + try { + // Check if current process has read permission to the file + fs$l.accessSync(filename, fs$l.constants.R_OK); + return true; + } + catch { + return false; + } +} +const splitFirstDirRE = /(.+?)[\\/](.+)/; +/** + * Delete every file and subdirectory. **The given directory must exist.** + * Pass an optional `skip` array to preserve files under the root directory. + */ +function emptyDir(dir, skip) { + const skipInDir = []; + let nested = null; + if (skip?.length) { + for (const file of skip) { + if (path$o.dirname(file) !== '.') { + const matched = file.match(splitFirstDirRE); + if (matched) { + nested ??= new Map(); + const [, nestedDir, skipPath] = matched; + let nestedSkip = nested.get(nestedDir); + if (!nestedSkip) { + nestedSkip = []; + nested.set(nestedDir, nestedSkip); + } + if (!nestedSkip.includes(skipPath)) { + nestedSkip.push(skipPath); + } + } + } + else { + skipInDir.push(file); + } + } + } + for (const file of fs$l.readdirSync(dir)) { + if (skipInDir.includes(file)) { + continue; + } + if (nested?.has(file)) { + emptyDir(path$o.resolve(dir, file), nested.get(file)); + } + else { + fs$l.rmSync(path$o.resolve(dir, file), { recursive: true, force: true }); + } + } +} +function copyDir(srcDir, destDir) { + fs$l.mkdirSync(destDir, { recursive: true }); + for (const file of fs$l.readdirSync(srcDir)) { + const srcFile = path$o.resolve(srcDir, file); + if (srcFile === destDir) { + continue; + } + const destFile = path$o.resolve(destDir, file); + const stat = fs$l.statSync(srcFile); + if (stat.isDirectory()) { + copyDir(srcFile, destFile); + } + else { + fs$l.copyFileSync(srcFile, destFile); + } + } +} +const ERR_SYMLINK_IN_RECURSIVE_READDIR = 'ERR_SYMLINK_IN_RECURSIVE_READDIR'; +async function recursiveReaddir(dir) { + if (!fs$l.existsSync(dir)) { + return []; + } + let dirents; + try { + dirents = await fsp.readdir(dir, { withFileTypes: true }); + } + catch (e) { + if (e.code === 'EACCES') { + // Ignore permission errors + return []; + } + throw e; + } + if (dirents.some((dirent) => dirent.isSymbolicLink())) { + const err = new Error('Symbolic links are not supported in recursiveReaddir'); + err.code = ERR_SYMLINK_IN_RECURSIVE_READDIR; + throw err; + } + const files = await Promise.all(dirents.map((dirent) => { + const res = path$o.resolve(dir, dirent.name); + return dirent.isDirectory() ? recursiveReaddir(res) : normalizePath$3(res); + })); + return files.flat(1); +} +// `fs.realpathSync.native` resolves differently in Windows network drive, +// causing file read errors. skip for now. +// https://github.com/nodejs/node/issues/37737 +let safeRealpathSync = isWindows$3 + ? windowsSafeRealPathSync + : fs$l.realpathSync.native; +// Based on https://github.com/larrybahr/windows-network-drive +// MIT License, Copyright (c) 2017 Larry Bahr +const windowsNetworkMap = new Map(); +function windowsMappedRealpathSync(path) { + const realPath = fs$l.realpathSync.native(path); + if (realPath.startsWith('\\\\')) { + for (const [network, volume] of windowsNetworkMap) { + if (realPath.startsWith(network)) + return realPath.replace(network, volume); + } + } + return realPath; +} +const parseNetUseRE = /^(\w+)? +(\w:) +([^ ]+)\s/; +let firstSafeRealPathSyncRun = false; +function windowsSafeRealPathSync(path) { + if (!firstSafeRealPathSyncRun) { + optimizeSafeRealPathSync(); + firstSafeRealPathSyncRun = true; + } + return fs$l.realpathSync(path); +} +function optimizeSafeRealPathSync() { + // Skip if using Node <18.10 due to MAX_PATH issue: https://github.com/vitejs/vite/issues/12931 + const nodeVersion = process.versions.node.split('.').map(Number); + if (nodeVersion[0] < 18 || (nodeVersion[0] === 18 && nodeVersion[1] < 10)) { + safeRealpathSync = fs$l.realpathSync; + return; + } + // Check the availability `fs.realpathSync.native` + // in Windows virtual and RAM disks that bypass the Volume Mount Manager, in programs such as imDisk + // get the error EISDIR: illegal operation on a directory + try { + fs$l.realpathSync.native(path$o.resolve('./')); + } + catch (error) { + if (error.message.includes('EISDIR: illegal operation on a directory')) { + safeRealpathSync = fs$l.realpathSync; + return; + } + } + exec('net use', (error, stdout) => { + if (error) + return; + const lines = stdout.split('\n'); + // OK Y: \\NETWORKA\Foo Microsoft Windows Network + // OK Z: \\NETWORKA\Bar Microsoft Windows Network + for (const line of lines) { + const m = line.match(parseNetUseRE); + if (m) + windowsNetworkMap.set(m[3], m[2]); + } + if (windowsNetworkMap.size === 0) { + safeRealpathSync = fs$l.realpathSync.native; + } + else { + safeRealpathSync = windowsMappedRealpathSync; + } + }); +} +function ensureWatchedFile(watcher, file, root) { + if (file && + // only need to watch if out of root + !file.startsWith(withTrailingSlash(root)) && + // some rollup plugins use null bytes for private resolved Ids + !file.includes('\0') && + fs$l.existsSync(file)) { + // resolve file to normalized system path + watcher.add(path$o.resolve(file)); + } +} +const escapedSpaceCharacters = /( |\\t|\\n|\\f|\\r)+/g; +const imageSetUrlRE = /^(?:[\w\-]+\(.*?\)|'.*?'|".*?"|\S*)/; +function joinSrcset(ret) { + return ret.map(({ url, descriptor }) => `${url} ${descriptor}`).join(', '); +} +function splitSrcSetDescriptor(srcs) { + return splitSrcSet(srcs) + .map((s) => { + const src = s.replace(escapedSpaceCharacters, ' ').trim(); + const url = imageSetUrlRE.exec(src)?.[0] ?? ''; + return { + url, + descriptor: src.slice(url.length).trim(), + }; + }) + .filter(({ url }) => !!url); +} +function processSrcSet(srcs, replacer) { + return Promise.all(splitSrcSetDescriptor(srcs).map(async ({ url, descriptor }) => ({ + url: await replacer({ url, descriptor }), + descriptor, + }))).then(joinSrcset); +} +function processSrcSetSync(srcs, replacer) { + return joinSrcset(splitSrcSetDescriptor(srcs).map(({ url, descriptor }) => ({ + url: replacer({ url, descriptor }), + descriptor, + }))); +} +const cleanSrcSetRE = /(?:url|image|gradient|cross-fade)\([^)]*\)|"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|data:\w+\/[\w.+\-]+;base64,[\w+/=]+/g; +function splitSrcSet(srcs) { + const parts = []; + // There could be a ',' inside of url(data:...), linear-gradient(...), "data:..." or data:... + const cleanedSrcs = srcs.replace(cleanSrcSetRE, blankReplacer); + let startIndex = 0; + let splitIndex; + do { + splitIndex = cleanedSrcs.indexOf(',', startIndex); + parts.push(srcs.slice(startIndex, splitIndex !== -1 ? splitIndex : undefined)); + startIndex = splitIndex + 1; + } while (splitIndex !== -1); + return parts; +} +const windowsDriveRE = /^[A-Z]:/; +const replaceWindowsDriveRE = /^([A-Z]):\//; +const linuxAbsolutePathRE = /^\/[^/]/; +function escapeToLinuxLikePath(path) { + if (windowsDriveRE.test(path)) { + return path.replace(replaceWindowsDriveRE, '/windows/$1/'); + } + if (linuxAbsolutePathRE.test(path)) { + return `/linux${path}`; + } + return path; +} +const revertWindowsDriveRE = /^\/windows\/([A-Z])\//; +function unescapeToLinuxLikePath(path) { + if (path.startsWith('/linux/')) { + return path.slice('/linux'.length); + } + if (path.startsWith('/windows/')) { + return path.replace(revertWindowsDriveRE, '$1:/'); + } + return path; +} +// based on https://github.com/sveltejs/svelte/blob/abf11bb02b2afbd3e4cac509a0f70e318c306364/src/compiler/utils/mapped_code.ts#L221 +const nullSourceMap = { + names: [], + sources: [], + mappings: '', + version: 3, +}; +function combineSourcemaps(filename, sourcemapList) { + if (sourcemapList.length === 0 || + sourcemapList.every((m) => m.sources.length === 0)) { + return { ...nullSourceMap }; + } + // hack for parse broken with normalized absolute paths on windows (C:/path/to/something). + // escape them to linux like paths + // also avoid mutation here to prevent breaking plugin's using cache to generate sourcemaps like vue (see #7442) + sourcemapList = sourcemapList.map((sourcemap) => { + const newSourcemaps = { ...sourcemap }; + newSourcemaps.sources = sourcemap.sources.map((source) => source ? escapeToLinuxLikePath(source) : null); + if (sourcemap.sourceRoot) { + newSourcemaps.sourceRoot = escapeToLinuxLikePath(sourcemap.sourceRoot); + } + return newSourcemaps; + }); + const escapedFilename = escapeToLinuxLikePath(filename); + // We don't declare type here so we can convert/fake/map as RawSourceMap + let map; //: SourceMap + let mapIndex = 1; + const useArrayInterface = sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === undefined; + if (useArrayInterface) { + map = remapping(sourcemapList, () => null); + } + else { + map = remapping(sourcemapList[0], function loader(sourcefile) { + if (sourcefile === escapedFilename && sourcemapList[mapIndex]) { + return sourcemapList[mapIndex++]; + } + else { + return null; + } + }); + } + if (!map.file) { + delete map.file; + } + // unescape the previous hack + map.sources = map.sources.map((source) => source ? unescapeToLinuxLikePath(source) : source); + map.file = filename; + return map; +} +function unique(arr) { + return Array.from(new Set(arr)); +} +/** + * Returns resolved localhost address when `dns.lookup` result differs from DNS + * + * `dns.lookup` result is same when defaultResultOrder is `verbatim`. + * Even if defaultResultOrder is `ipv4first`, `dns.lookup` result maybe same. + * For example, when IPv6 is not supported on that machine/network. + */ +async function getLocalhostAddressIfDiffersFromDNS() { + const [nodeResult, dnsResult] = await Promise.all([ + promises.lookup('localhost'), + promises.lookup('localhost', { verbatim: true }), + ]); + const isSame = nodeResult.family === dnsResult.family && + nodeResult.address === dnsResult.address; + return isSame ? undefined : nodeResult.address; +} +function diffDnsOrderChange(oldUrls, newUrls) { + return !(oldUrls === newUrls || + (oldUrls && + newUrls && + arrayEqual(oldUrls.local, newUrls.local) && + arrayEqual(oldUrls.network, newUrls.network))); +} +async function resolveHostname(optionsHost) { + let host; + if (optionsHost === undefined || optionsHost === false) { + // Use a secure default + host = 'localhost'; + } + else if (optionsHost === true) { + // If passed --host in the CLI without arguments + host = undefined; // undefined typically means 0.0.0.0 or :: (listen on all IPs) + } + else { + host = optionsHost; + } + // Set host name to localhost when possible + let name = host === undefined || wildcardHosts.has(host) ? 'localhost' : host; + if (host === 'localhost') { + // See #8647 for more details. + const localhostAddr = await getLocalhostAddressIfDiffersFromDNS(); + if (localhostAddr) { + name = localhostAddr; + } + } + return { host, name }; +} +async function resolveServerUrls(server, options, config) { + const address = server.address(); + const isAddressInfo = (x) => x?.address; + if (!isAddressInfo(address)) { + return { local: [], network: [] }; + } + const local = []; + const network = []; + const hostname = await resolveHostname(options.host); + const protocol = options.https ? 'https' : 'http'; + const port = address.port; + const base = config.rawBase === './' || config.rawBase === '' ? '/' : config.rawBase; + if (hostname.host !== undefined && !wildcardHosts.has(hostname.host)) { + let hostnameName = hostname.name; + // ipv6 host + if (hostnameName.includes(':')) { + hostnameName = `[${hostnameName}]`; + } + const address = `${protocol}://${hostnameName}:${port}${base}`; + if (loopbackHosts.has(hostname.host)) { + local.push(address); + } + else { + network.push(address); + } + } + else { + Object.values(os$4.networkInterfaces()) + .flatMap((nInterface) => nInterface ?? []) + .filter((detail) => detail && + detail.address && + (detail.family === 'IPv4' || + // @ts-expect-error Node 18.0 - 18.3 returns number + detail.family === 4)) + .forEach((detail) => { + let host = detail.address.replace('127.0.0.1', hostname.name); + // ipv6 host + if (host.includes(':')) { + host = `[${host}]`; + } + const url = `${protocol}://${host}:${port}${base}`; + if (detail.address.includes('127.0.0.1')) { + local.push(url); + } + else { + network.push(url); + } + }); + } + return { local, network }; +} +function arraify(target) { + return Array.isArray(target) ? target : [target]; +} +// Taken from https://stackoverflow.com/a/36328890 +const multilineCommentsRE = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g; +const singlelineCommentsRE = /\/\/.*/g; +const requestQuerySplitRE = /\?(?!.*[/|}])/; +const requestQueryMaybeEscapedSplitRE = /\\?\?(?!.*[/|}])/; +const blankReplacer = (match) => ' '.repeat(match.length); +function getHash(text, length = 8) { + const h = createHash$2('sha256').update(text).digest('hex').substring(0, length); + if (length <= 64) + return h; + return h.padEnd(length, '_'); +} +const _dirname = path$o.dirname(fileURLToPath(import.meta.url)); +const requireResolveFromRootWithFallback = (root, id) => { + // check existence first, so if the package is not found, + // it won't be cached by nodejs, since there isn't a way to invalidate them: + // https://github.com/nodejs/node/issues/44663 + const found = resolvePackageData(id, root) || resolvePackageData(id, _dirname); + if (!found) { + const error = new Error(`${JSON.stringify(id)} not found.`); + error.code = 'MODULE_NOT_FOUND'; + throw error; + } + // actually resolve + // Search in the root directory first, and fallback to the default require paths. + return _require$1.resolve(id, { paths: [root, _dirname] }); +}; +function emptyCssComments(raw) { + return raw.replace(multilineCommentsRE, blankReplacer); +} +function backwardCompatibleWorkerPlugins(plugins) { + if (Array.isArray(plugins)) { + return plugins; + } + if (typeof plugins === 'function') { + return plugins(); + } + return []; +} +function mergeConfigRecursively(defaults, overrides, rootPath) { + const merged = { ...defaults }; + for (const key in overrides) { + const value = overrides[key]; + if (value == null) { + continue; + } + const existing = merged[key]; + if (existing == null) { + merged[key] = value; + continue; + } + // fields that require special handling + if (key === 'alias' && (rootPath === 'resolve' || rootPath === '')) { + merged[key] = mergeAlias(existing, value); + continue; + } + else if (key === 'assetsInclude' && rootPath === '') { + merged[key] = [].concat(existing, value); + continue; + } + else if (key === 'noExternal' && + rootPath === 'ssr' && + (existing === true || value === true)) { + merged[key] = true; + continue; + } + else if (key === 'plugins' && rootPath === 'worker') { + merged[key] = () => [ + ...backwardCompatibleWorkerPlugins(existing), + ...backwardCompatibleWorkerPlugins(value), + ]; + continue; + } + if (Array.isArray(existing) || Array.isArray(value)) { + merged[key] = [...arraify(existing ?? []), ...arraify(value ?? [])]; + continue; + } + if (isObject$1(existing) && isObject$1(value)) { + merged[key] = mergeConfigRecursively(existing, value, rootPath ? `${rootPath}.${key}` : key); + continue; + } + merged[key] = value; + } + return merged; +} +function mergeConfig(defaults, overrides, isRoot = true) { + if (typeof defaults === 'function' || typeof overrides === 'function') { + throw new Error(`Cannot merge config in form of callback`); + } + return mergeConfigRecursively(defaults, overrides, isRoot ? '' : '.'); +} +function mergeAlias(a, b) { + if (!a) + return b; + if (!b) + return a; + if (isObject$1(a) && isObject$1(b)) { + return { ...a, ...b }; + } + // the order is flipped because the alias is resolved from top-down, + // where the later should have higher priority + return [...normalizeAlias(b), ...normalizeAlias(a)]; +} +function normalizeAlias(o = []) { + return Array.isArray(o) + ? o.map(normalizeSingleAlias) + : Object.keys(o).map((find) => normalizeSingleAlias({ + find, + replacement: o[find], + })); +} +// https://github.com/vitejs/vite/issues/1363 +// work around https://github.com/rollup/plugins/issues/759 +function normalizeSingleAlias({ find, replacement, customResolver, }) { + if (typeof find === 'string' && + find[find.length - 1] === '/' && + replacement[replacement.length - 1] === '/') { + find = find.slice(0, find.length - 1); + replacement = replacement.slice(0, replacement.length - 1); + } + const alias = { + find, + replacement, + }; + if (customResolver) { + alias.customResolver = customResolver; + } + return alias; +} +/** + * Transforms transpiled code result where line numbers aren't altered, + * so we can skip sourcemap generation during dev + */ +function transformStableResult(s, id, config) { + return { + code: s.toString(), + map: config.command === 'build' && config.build.sourcemap + ? s.generateMap({ hires: 'boundary', source: id }) + : null, + }; +} +async function asyncFlatten(arr) { + do { + arr = (await Promise.all(arr)).flat(Infinity); + } while (arr.some((v) => v?.then)); + return arr; +} +// strip UTF-8 BOM +function stripBomTag(content) { + if (content.charCodeAt(0) === 0xfeff) { + return content.slice(1); + } + return content; +} +const windowsDrivePathPrefixRE = /^[A-Za-z]:[/\\]/; +/** + * path.isAbsolute also returns true for drive relative paths on windows (e.g. /something) + * this function returns false for them but true for absolute paths (e.g. C:/something) + */ +const isNonDriveRelativeAbsolutePath = (p) => { + if (!isWindows$3) + return p[0] === '/'; + return windowsDrivePathPrefixRE.test(p); +}; +/** + * Determine if a file is being requested with the correct case, to ensure + * consistent behavior between dev and prod and across operating systems. + */ +function shouldServeFile(filePath, root) { + // can skip case check on Linux + if (!isCaseInsensitiveFS) + return true; + return hasCorrectCase(filePath, root); +} +/** + * Note that we can't use realpath here, because we don't want to follow + * symlinks. + */ +function hasCorrectCase(file, assets) { + if (file === assets) + return true; + const parent = path$o.dirname(file); + if (fs$l.readdirSync(parent).includes(path$o.basename(file))) { + return hasCorrectCase(parent, assets); + } + return false; +} +function joinUrlSegments(a, b) { + if (!a || !b) { + return a || b || ''; + } + if (a[a.length - 1] === '/') { + a = a.substring(0, a.length - 1); + } + if (b[0] !== '/') { + b = '/' + b; + } + return a + b; +} +function removeLeadingSlash(str) { + return str[0] === '/' ? str.slice(1) : str; +} +function stripBase(path, base) { + if (path === base) { + return '/'; + } + const devBase = withTrailingSlash(base); + return path.startsWith(devBase) ? path.slice(devBase.length - 1) : path; +} +function arrayEqual(a, b) { + if (a === b) + return true; + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) { + if (a[i] !== b[i]) + return false; + } + return true; +} +function evalValue(rawValue) { + const fn = new Function(` + var console, exports, global, module, process, require + return (\n${rawValue}\n) + `); + return fn(); +} +function getNpmPackageName(importPath) { + const parts = importPath.split('/'); + if (parts[0][0] === '@') { + if (!parts[1]) + return null; + return `${parts[0]}/${parts[1]}`; + } + else { + return parts[0]; + } +} +const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g; +function escapeRegex(str) { + return str.replace(escapeRegexRE, '\\$&'); +} +function getPackageManagerCommand(type = 'install') { + const packageManager = process.env.npm_config_user_agent?.split(' ')[0].split('/')[0] || 'npm'; + switch (type) { + case 'install': + return packageManager === 'npm' ? 'npm install' : `${packageManager} add`; + case 'uninstall': + return packageManager === 'npm' + ? 'npm uninstall' + : `${packageManager} remove`; + case 'update': + return packageManager === 'yarn' + ? 'yarn upgrade' + : `${packageManager} update`; + default: + throw new TypeError(`Unknown command type: ${type}`); + } +} +function isDevServer(server) { + return 'pluginContainer' in server; +} +function promiseWithResolvers() { + let resolve; + let reject; + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + return { promise, resolve, reject }; +} +function createSerialPromiseQueue() { + let previousTask; + return { + async run(f) { + const thisTask = f(); + // wait for both the previous task and this task + // so that this function resolves in the order this function is called + const depTasks = Promise.all([previousTask, thisTask]); + previousTask = depTasks; + const [, result] = await depTasks; + // this task was the last one, clear `previousTask` to free up memory + if (previousTask === depTasks) { + previousTask = undefined; + } + return result; + }, + }; +} +function sortObjectKeys(obj) { + const sorted = {}; + for (const key of Object.keys(obj).sort()) { + sorted[key] = obj[key]; + } + return sorted; +} +function displayTime(time) { + // display: {X}ms + if (time < 1000) { + return `${time}ms`; + } + time = time / 1000; + // display: {X}s + if (time < 60) { + return `${time.toFixed(2)}s`; + } + const mins = parseInt((time / 60).toString()); + const seconds = time % 60; + // display: {X}m {Y}s + return `${mins}m${seconds < 1 ? '' : ` ${seconds.toFixed(0)}s`}`; +} + +/* eslint no-console: 0 */ +const LogLevels = { + silent: 0, + error: 1, + warn: 2, + info: 3, +}; +let lastType; +let lastMsg; +let sameCount = 0; +function clearScreen() { + const repeatCount = process.stdout.rows - 2; + const blank = repeatCount > 0 ? '\n'.repeat(repeatCount) : ''; + console.log(blank); + readline.cursorTo(process.stdout, 0, 0); + readline.clearScreenDown(process.stdout); +} +// Only initialize the timeFormatter when the timestamp option is used, and +// reuse it across all loggers +let timeFormatter; +function getTimeFormatter() { + timeFormatter ??= new Intl.DateTimeFormat(undefined, { + hour: 'numeric', + minute: 'numeric', + second: 'numeric', + }); + return timeFormatter; +} +function createLogger(level = 'info', options = {}) { + if (options.customLogger) { + return options.customLogger; + } + const loggedErrors = new WeakSet(); + const { prefix = '[vite]', allowClearScreen = true } = options; + const thresh = LogLevels[level]; + const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI; + const clear = canClearScreen ? clearScreen : () => { }; + function format(type, msg, options = {}) { + if (options.timestamp) { + const tag = type === 'info' + ? colors$1.cyan(colors$1.bold(prefix)) + : type === 'warn' + ? colors$1.yellow(colors$1.bold(prefix)) + : colors$1.red(colors$1.bold(prefix)); + return `${colors$1.dim(getTimeFormatter().format(new Date()))} ${tag} ${msg}`; + } + else { + return msg; + } + } + function output(type, msg, options = {}) { + if (thresh >= LogLevels[type]) { + const method = type === 'info' ? 'log' : type; + if (options.error) { + loggedErrors.add(options.error); + } + if (canClearScreen) { + if (type === lastType && msg === lastMsg) { + sameCount++; + clear(); + console[method](format(type, msg, options), colors$1.yellow(`(x${sameCount + 1})`)); + } + else { + sameCount = 0; + lastMsg = msg; + lastType = type; + if (options.clear) { + clear(); + } + console[method](format(type, msg, options)); + } + } + else { + console[method](format(type, msg, options)); + } + } + } + const warnedMessages = new Set(); + const logger = { + hasWarned: false, + info(msg, opts) { + output('info', msg, opts); + }, + warn(msg, opts) { + logger.hasWarned = true; + output('warn', msg, opts); + }, + warnOnce(msg, opts) { + if (warnedMessages.has(msg)) + return; + logger.hasWarned = true; + output('warn', msg, opts); + warnedMessages.add(msg); + }, + error(msg, opts) { + logger.hasWarned = true; + output('error', msg, opts); + }, + clearScreen(type) { + if (thresh >= LogLevels[type]) { + clear(); + } + }, + hasErrorLogged(error) { + return loggedErrors.has(error); + }, + }; + return logger; +} +function printServerUrls(urls, optionsHost, info) { + const colorUrl = (url) => colors$1.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors$1.bold(port)}/`)); + for (const url of urls.local) { + info(` ${colors$1.green('➜')} ${colors$1.bold('Local')}: ${colorUrl(url)}`); + } + for (const url of urls.network) { + info(` ${colors$1.green('➜')} ${colors$1.bold('Network')}: ${colorUrl(url)}`); + } + if (urls.network.length === 0 && optionsHost === undefined) { + info(colors$1.dim(` ${colors$1.green('➜')} ${colors$1.bold('Network')}: use `) + + colors$1.bold('--host') + + colors$1.dim(' to expose')); + } +} + +const groups = [ + { name: 'Assets', color: colors$1.green }, + { name: 'CSS', color: colors$1.magenta }, + { name: 'JS', color: colors$1.cyan }, +]; +const COMPRESSIBLE_ASSETS_RE = /\.(?:html|json|svg|txt|xml|xhtml)$/; +function buildReporterPlugin(config) { + const compress = promisify$4(gzip); + const chunkLimit = config.build.chunkSizeWarningLimit; + const numberFormatter = new Intl.NumberFormat('en', { + maximumFractionDigits: 2, + minimumFractionDigits: 2, + }); + const displaySize = (bytes) => { + return `${numberFormatter.format(bytes / 1000)} kB`; + }; + const tty = process.stdout.isTTY && !process.env.CI; + const shouldLogInfo = LogLevels[config.logLevel || 'info'] >= LogLevels.info; + let hasTransformed = false; + let hasRenderedChunk = false; + let hasCompressChunk = false; + let transformedCount = 0; + let chunkCount = 0; + let compressedCount = 0; + async function getCompressedSize(code) { + if (config.build.ssr || !config.build.reportCompressedSize) { + return null; + } + if (shouldLogInfo && !hasCompressChunk) { + if (!tty) { + config.logger.info('computing gzip size...'); + } + else { + writeLine('computing gzip size (0)...'); + } + hasCompressChunk = true; + } + const compressed = await compress(typeof code === 'string' ? code : Buffer.from(code)); + compressedCount++; + if (shouldLogInfo && tty) { + writeLine(`computing gzip size (${compressedCount})...`); + } + return compressed.length; + } + const logTransform = throttle((id) => { + writeLine(`transforming (${transformedCount}) ${colors$1.dim(path$o.relative(config.root, id))}`); + }); + return { + name: 'vite:reporter', + transform(_, id) { + transformedCount++; + if (shouldLogInfo) { + if (!tty) { + if (!hasTransformed) { + config.logger.info(`transforming...`); + } + } + else { + if (id.includes(`?`)) + return; + logTransform(id); + } + hasTransformed = true; + } + return null; + }, + buildStart() { + transformedCount = 0; + }, + buildEnd() { + if (shouldLogInfo) { + if (tty) { + clearLine$1(); + } + config.logger.info(`${colors$1.green(`✓`)} ${transformedCount} modules transformed.`); + } + }, + renderStart() { + chunkCount = 0; + compressedCount = 0; + }, + renderChunk(code, chunk, options) { + if (!options.inlineDynamicImports) { + for (const id of chunk.moduleIds) { + const module = this.getModuleInfo(id); + if (!module) + continue; + // When a dynamic importer shares a chunk with the imported module, + // warn that the dynamic imported module will not be moved to another chunk (#12850). + if (module.importers.length && module.dynamicImporters.length) { + // Filter out the intersection of dynamic importers and sibling modules in + // the same chunk. The intersecting dynamic importers' dynamic import is not + // expected to work. Note we're only detecting the direct ineffective + // dynamic import here. + const detectedIneffectiveDynamicImport = module.dynamicImporters.some((id) => !isInNodeModules$1(id) && chunk.moduleIds.includes(id)); + if (detectedIneffectiveDynamicImport) { + this.warn(`\n(!) ${module.id} is dynamically imported by ${module.dynamicImporters.join(', ')} but also statically imported by ${module.importers.join(', ')}, dynamic import will not move module into another chunk.\n`); + } + } + } + } + chunkCount++; + if (shouldLogInfo) { + if (!tty) { + if (!hasRenderedChunk) { + config.logger.info('rendering chunks...'); + } + } + else { + writeLine(`rendering chunks (${chunkCount})...`); + } + hasRenderedChunk = true; + } + return null; + }, + generateBundle() { + if (shouldLogInfo && tty) + clearLine$1(); + }, + async writeBundle({ dir: outDir }, output) { + let hasLargeChunks = false; + if (shouldLogInfo) { + const entries = (await Promise.all(Object.values(output).map(async (chunk) => { + if (chunk.type === 'chunk') { + return { + name: chunk.fileName, + group: 'JS', + size: chunk.code.length, + compressedSize: await getCompressedSize(chunk.code), + mapSize: chunk.map ? chunk.map.toString().length : null, + }; + } + else { + if (chunk.fileName.endsWith('.map')) + return null; + const isCSS = chunk.fileName.endsWith('.css'); + const isCompressible = isCSS || COMPRESSIBLE_ASSETS_RE.test(chunk.fileName); + return { + name: chunk.fileName, + group: isCSS ? 'CSS' : 'Assets', + size: chunk.source.length, + mapSize: null, + compressedSize: isCompressible + ? await getCompressedSize(chunk.source) + : null, + }; + } + }))).filter(isDefined); + if (tty) + clearLine$1(); + let longest = 0; + let biggestSize = 0; + let biggestMap = 0; + let biggestCompressSize = 0; + for (const entry of entries) { + if (entry.name.length > longest) + longest = entry.name.length; + if (entry.size > biggestSize) + biggestSize = entry.size; + if (entry.mapSize && entry.mapSize > biggestMap) { + biggestMap = entry.mapSize; + } + if (entry.compressedSize && + entry.compressedSize > biggestCompressSize) { + biggestCompressSize = entry.compressedSize; + } + } + const sizePad = displaySize(biggestSize).length; + const mapPad = displaySize(biggestMap).length; + const compressPad = displaySize(biggestCompressSize).length; + const relativeOutDir = normalizePath$3(path$o.relative(config.root, path$o.resolve(config.root, outDir ?? config.build.outDir))); + const assetsDir = path$o.join(config.build.assetsDir, '/'); + for (const group of groups) { + const filtered = entries.filter((e) => e.group === group.name); + if (!filtered.length) + continue; + for (const entry of filtered.sort((a, z) => a.size - z.size)) { + const isLarge = group.name === 'JS' && entry.size / 1000 > chunkLimit; + if (isLarge) + hasLargeChunks = true; + const sizeColor = isLarge ? colors$1.yellow : colors$1.dim; + let log = colors$1.dim(withTrailingSlash(relativeOutDir)); + log += + !config.build.lib && + entry.name.startsWith(withTrailingSlash(assetsDir)) + ? colors$1.dim(assetsDir) + + group.color(entry.name + .slice(assetsDir.length) + .padEnd(longest + 2 - assetsDir.length)) + : group.color(entry.name.padEnd(longest + 2)); + log += colors$1.bold(sizeColor(displaySize(entry.size).padStart(sizePad))); + if (entry.compressedSize) { + log += colors$1.dim(` │ gzip: ${displaySize(entry.compressedSize).padStart(compressPad)}`); + } + if (entry.mapSize) { + log += colors$1.dim(` │ map: ${displaySize(entry.mapSize).padStart(mapPad)}`); + } + config.logger.info(log); + } + } + } + else { + hasLargeChunks = Object.values(output).some((chunk) => { + return chunk.type === 'chunk' && chunk.code.length / 1000 > chunkLimit; + }); + } + if (hasLargeChunks && + config.build.minify && + !config.build.lib && + !config.build.ssr) { + config.logger.warn(colors$1.yellow(`\n(!) Some chunks are larger than ${chunkLimit} kB after minification. Consider:\n` + + `- Using dynamic import() to code-split the application\n` + + `- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks\n` + + `- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.`)); + } + }, + }; +} +function writeLine(output) { + clearLine$1(); + if (output.length < process.stdout.columns) { + process.stdout.write(output); + } + else { + process.stdout.write(output.substring(0, process.stdout.columns - 1)); + } +} +function clearLine$1() { + process.stdout.clearLine(0); + process.stdout.cursorTo(0); +} +function throttle(fn) { + let timerHandle = null; + return (...args) => { + if (timerHandle) + return; + fn(...args); + timerHandle = setTimeout(() => { + timerHandle = null; + }, 100); + }; +} + +const POSIX_SEP_RE = new RegExp('\\' + path$o.posix.sep, 'g'); +const NATIVE_SEP_RE = new RegExp('\\' + path$o.sep, 'g'); +/** @type {Map}*/ +const PATTERN_REGEX_CACHE = new Map(); +const GLOB_ALL_PATTERN = `**/*`; +const TS_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts']; +const JS_EXTENSIONS = ['.js', '.jsx', '.mjs', '.cjs']; +const TSJS_EXTENSIONS = TS_EXTENSIONS.concat(JS_EXTENSIONS); +const TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext) => ext.substring(1)).join('|')})`; +const TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext) => ext.substring(1)).join( + '|' +)})`; +const IS_POSIX = path$o.posix.sep === path$o.sep; + +/** + * @template T + * @returns {{resolve:(result:T)=>void, reject:(error:any)=>void, promise: Promise}} + */ +function makePromise() { + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; +} + +/** + * @param {string} filename + * @param {import('./cache.js').TSConfckCache} [cache] + * @returns {Promise} + */ +async function resolveTSConfigJson(filename, cache) { + if (path$o.extname(filename) !== '.json') { + return; // ignore files that are not json + } + const tsconfig = path$o.resolve(filename); + if (cache && (cache.hasParseResult(tsconfig) || cache.hasParseResult(filename))) { + return tsconfig; + } + return promises$1.stat(tsconfig).then((stat) => { + if (stat.isFile() || stat.isFIFO()) { + return tsconfig; + } else { + throw new Error(`${filename} exists but is not a regular file.`); + } + }); +} + +/** + * + * @param {string} dir an absolute directory path + * @returns {boolean} if dir path includes a node_modules segment + */ +const isInNodeModules = IS_POSIX + ? (dir) => dir.includes('/node_modules/') + : (dir) => dir.match(/[/\\]node_modules[/\\]/); + +/** + * convert posix separator to native separator + * + * eg. + * windows: C:/foo/bar -> c:\foo\bar + * linux: /foo/bar -> /foo/bar + * + * @param {string} filename with posix separators + * @returns {string} filename with native separators + */ +const posix2native = IS_POSIX + ? (filename) => filename + : (filename) => filename.replace(POSIX_SEP_RE, path$o.sep); + +/** + * convert native separator to posix separator + * + * eg. + * windows: C:\foo\bar -> c:/foo/bar + * linux: /foo/bar -> /foo/bar + * + * @param {string} filename - filename with native separators + * @returns {string} filename with posix separators + */ +const native2posix = IS_POSIX + ? (filename) => filename + : (filename) => filename.replace(NATIVE_SEP_RE, path$o.posix.sep); + +/** + * converts params to native separator, resolves path and converts native back to posix + * + * needed on windows to handle posix paths in tsconfig + * + * @param dir {string|null} directory to resolve from + * @param filename {string} filename or pattern to resolve + * @returns string + */ +const resolve2posix = IS_POSIX + ? (dir, filename) => (dir ? path$o.resolve(dir, filename) : path$o.resolve(filename)) + : (dir, filename) => + native2posix( + dir + ? path$o.resolve(posix2native(dir), posix2native(filename)) + : path$o.resolve(posix2native(filename)) + ); + +/** + * + * @param {import('./public.d.ts').TSConfckParseResult} result + * @param {import('./public.d.ts').TSConfckParseOptions} [options] + * @returns {string[]} + */ +function resolveReferencedTSConfigFiles(result, options) { + const dir = path$o.dirname(result.tsconfigFile); + return result.tsconfig.references.map((ref) => { + const refPath = ref.path.endsWith('.json') + ? ref.path + : path$o.join(ref.path, options?.configName ?? 'tsconfig.json'); + return resolve2posix(dir, refPath); + }); +} + +/** + * @param {string} filename + * @param {import('./public.d.ts').TSConfckParseResult} result + * @returns {import('./public.d.ts').TSConfckParseResult} + */ +function resolveSolutionTSConfig(filename, result) { + const allowJs = result.tsconfig.compilerOptions?.allowJs; + const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS; + if ( + result.referenced && + extensions.some((ext) => filename.endsWith(ext)) && + !isIncluded(filename, result) + ) { + const solutionTSConfig = result.referenced.find((referenced) => + isIncluded(filename, referenced) + ); + if (solutionTSConfig) { + return solutionTSConfig; + } + } + return result; +} + +/** + * + * @param {string} filename + * @param {import('./public.d.ts').TSConfckParseResult} result + * @returns {boolean} + */ +function isIncluded(filename, result) { + const dir = native2posix(path$o.dirname(result.tsconfigFile)); + const files = (result.tsconfig.files || []).map((file) => resolve2posix(dir, file)); + const absoluteFilename = resolve2posix(null, filename); + if (files.includes(filename)) { + return true; + } + const allowJs = result.tsconfig.compilerOptions?.allowJs; + const isIncluded = isGlobMatch( + absoluteFilename, + dir, + result.tsconfig.include || (result.tsconfig.files ? [] : [GLOB_ALL_PATTERN]), + allowJs + ); + if (isIncluded) { + const isExcluded = isGlobMatch(absoluteFilename, dir, result.tsconfig.exclude || [], allowJs); + return !isExcluded; + } + return false; +} + +/** + * test filenames agains glob patterns in tsconfig + * + * @param filename {string} posix style abolute path to filename to test + * @param dir {string} posix style absolute path to directory of tsconfig containing patterns + * @param patterns {string[]} glob patterns to match against + * @param allowJs {boolean} allowJs setting in tsconfig to include js extensions in checks + * @returns {boolean} true when at least one pattern matches filename + */ +function isGlobMatch(filename, dir, patterns, allowJs) { + const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS; + return patterns.some((pattern) => { + // filename must end with part of pattern that comes after last wildcard + let lastWildcardIndex = pattern.length; + let hasWildcard = false; + for (let i = pattern.length - 1; i > -1; i--) { + if (pattern[i] === '*' || pattern[i] === '?') { + lastWildcardIndex = i; + hasWildcard = true; + break; + } + } + + // if pattern does not end with wildcard, filename must end with pattern after last wildcard + if ( + lastWildcardIndex < pattern.length - 1 && + !filename.endsWith(pattern.slice(lastWildcardIndex + 1)) + ) { + return false; + } + + // if pattern ends with *, filename must end with a default extension + if (pattern.endsWith('*') && !extensions.some((ext) => filename.endsWith(ext))) { + return false; + } + + // for **/* , filename must start with the dir + if (pattern === GLOB_ALL_PATTERN) { + return filename.startsWith(`${dir}/`); + } + + const resolvedPattern = resolve2posix(dir, pattern); + + // filename must start with part of pattern that comes before first wildcard + let firstWildcardIndex = -1; + for (let i = 0; i < resolvedPattern.length; i++) { + if (resolvedPattern[i] === '*' || resolvedPattern[i] === '?') { + firstWildcardIndex = i; + hasWildcard = true; + break; + } + } + if ( + firstWildcardIndex > 1 && + !filename.startsWith(resolvedPattern.slice(0, firstWildcardIndex - 1)) + ) { + return false; + } + + // if no wildcard in pattern, filename must be equal to resolved pattern + if (!hasWildcard) { + return filename === resolvedPattern; + } + + // complex pattern, use regex to check it + if (PATTERN_REGEX_CACHE.has(resolvedPattern)) { + return PATTERN_REGEX_CACHE.get(resolvedPattern).test(filename); + } + const regex = pattern2regex(resolvedPattern, allowJs); + PATTERN_REGEX_CACHE.set(resolvedPattern, regex); + return regex.test(filename); + }); +} + +/** + * @param {string} resolvedPattern + * @param {boolean} allowJs + * @returns {RegExp} + */ +function pattern2regex(resolvedPattern, allowJs) { + let regexStr = '^'; + for (let i = 0; i < resolvedPattern.length; i++) { + const char = resolvedPattern[i]; + if (char === '?') { + regexStr += '[^\\/]'; + continue; + } + if (char === '*') { + if (resolvedPattern[i + 1] === '*' && resolvedPattern[i + 2] === '/') { + i += 2; + regexStr += '(?:[^\\/]*\\/)*'; // zero or more path segments + continue; + } + regexStr += '[^\\/]*'; + continue; + } + if ('/.+^${}()|[]\\'.includes(char)) { + regexStr += `\\`; + } + regexStr += char; + } + + // add known file endings if pattern ends on * + if (resolvedPattern.endsWith('*')) { + regexStr += allowJs ? TSJS_EXTENSIONS_RE_GROUP : TS_EXTENSIONS_RE_GROUP; + } + regexStr += '$'; + + return new RegExp(regexStr); +} + +/** + * find the closest tsconfig.json file + * + * @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd) + * @param {import('./public.d.ts').TSConfckFindOptions} [options] - options + * @returns {Promise} absolute path to closest tsconfig.json or null if not found + */ +async function find(filename, options) { + let dir = path$o.dirname(path$o.resolve(filename)); + if (options?.ignoreNodeModules && isInNodeModules(dir)) { + return null; + } + const cache = options?.cache; + const configName = options?.configName ?? 'tsconfig.json'; + if (cache?.hasConfigPath(dir, configName)) { + return cache.getConfigPath(dir, configName); + } + const { /** @type {Promise} */ promise, resolve, reject } = makePromise(); + if (options?.root && !path$o.isAbsolute(options.root)) { + options.root = path$o.resolve(options.root); + } + findUp(dir, { promise, resolve, reject }, options); + return promise; +} + +/** + * + * @param {string} dir + * @param {{promise:Promise,resolve:(result:string|null)=>void,reject:(err:any)=>void}} madePromise + * @param {import('./public.d.ts').TSConfckFindOptions} [options] - options + */ +function findUp(dir, { resolve, reject, promise }, options) { + const { cache, root, configName } = options ?? {}; + if (cache) { + if (cache.hasConfigPath(dir, configName)) { + let cached; + try { + cached = cache.getConfigPath(dir, configName); + } catch (e) { + reject(e); + return; + } + if (cached?.then) { + cached.then(resolve).catch(reject); + } else { + resolve(cached); + } + } else { + cache.setConfigPath(dir, promise, configName); + } + } + const tsconfig = path$o.join(dir, options?.configName ?? 'tsconfig.json'); + fs$l.stat(tsconfig, (err, stats) => { + if (stats && (stats.isFile() || stats.isFIFO())) { + resolve(tsconfig); + } else if (err?.code !== 'ENOENT') { + reject(err); + } else { + let parent; + if (root === dir || (parent = path$o.dirname(dir)) === dir) { + resolve(null); + } else { + findUp(parent, { promise, resolve, reject }, options); + } + } + }); +} + +/* + this file contains code from strip-bom and strip-json-comments by Sindre Sorhus + https://github.com/sindresorhus/strip-json-comments/blob/v4.0.0/index.js + https://github.com/sindresorhus/strip-bom/blob/v5.0.0/index.js + licensed under MIT, see ../LICENSE +*/ + +/** + * convert content of tsconfig.json to regular json + * + * @param {string} tsconfigJson - content of tsconfig.json + * @returns {string} content as regular json, comments and dangling commas have been replaced with whitespace + */ +function toJson(tsconfigJson) { + const stripped = stripDanglingComma(stripJsonComments(stripBom(tsconfigJson))); + if (stripped.trim() === '') { + // only whitespace left after stripping, return empty object so that JSON.parse still works + return '{}'; + } else { + return stripped; + } +} + +/** + * replace dangling commas from pseudo-json string with single space + * implementation heavily inspired by strip-json-comments + * + * @param {string} pseudoJson + * @returns {string} + */ +function stripDanglingComma(pseudoJson) { + let insideString = false; + let offset = 0; + let result = ''; + let danglingCommaPos = null; + for (let i = 0; i < pseudoJson.length; i++) { + const currentCharacter = pseudoJson[i]; + if (currentCharacter === '"') { + const escaped = isEscaped(pseudoJson, i); + if (!escaped) { + insideString = !insideString; + } + } + if (insideString) { + danglingCommaPos = null; + continue; + } + if (currentCharacter === ',') { + danglingCommaPos = i; + continue; + } + if (danglingCommaPos) { + if (currentCharacter === '}' || currentCharacter === ']') { + result += pseudoJson.slice(offset, danglingCommaPos) + ' '; + offset = danglingCommaPos + 1; + danglingCommaPos = null; + } else if (!currentCharacter.match(/\s/)) { + danglingCommaPos = null; + } + } + } + return result + pseudoJson.substring(offset); +} + +// start strip-json-comments +/** + * + * @param {string} jsonString + * @param {number} quotePosition + * @returns {boolean} + */ +function isEscaped(jsonString, quotePosition) { + let index = quotePosition - 1; + let backslashCount = 0; + + while (jsonString[index] === '\\') { + index -= 1; + backslashCount += 1; + } + + return Boolean(backslashCount % 2); +} + +/** + * + * @param {string} string + * @param {number?} start + * @param {number?} end + */ +function strip(string, start, end) { + return string.slice(start, end).replace(/\S/g, ' '); +} + +const singleComment = Symbol('singleComment'); +const multiComment = Symbol('multiComment'); + +/** + * @param {string} jsonString + * @returns {string} + */ +function stripJsonComments(jsonString) { + let isInsideString = false; + /** @type {false | symbol} */ + let isInsideComment = false; + let offset = 0; + let result = ''; + + for (let index = 0; index < jsonString.length; index++) { + const currentCharacter = jsonString[index]; + const nextCharacter = jsonString[index + 1]; + + if (!isInsideComment && currentCharacter === '"') { + const escaped = isEscaped(jsonString, index); + if (!escaped) { + isInsideString = !isInsideString; + } + } + + if (isInsideString) { + continue; + } + + if (!isInsideComment && currentCharacter + nextCharacter === '//') { + result += jsonString.slice(offset, index); + offset = index; + isInsideComment = singleComment; + index++; + } else if (isInsideComment === singleComment && currentCharacter + nextCharacter === '\r\n') { + index++; + isInsideComment = false; + result += strip(jsonString, offset, index); + offset = index; + } else if (isInsideComment === singleComment && currentCharacter === '\n') { + isInsideComment = false; + result += strip(jsonString, offset, index); + offset = index; + } else if (!isInsideComment && currentCharacter + nextCharacter === '/*') { + result += jsonString.slice(offset, index); + offset = index; + isInsideComment = multiComment; + index++; + } else if (isInsideComment === multiComment && currentCharacter + nextCharacter === '*/') { + index++; + isInsideComment = false; + result += strip(jsonString, offset, index + 1); + offset = index + 1; + } + } + + return result + (isInsideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); +} +// end strip-json-comments + +// start strip-bom +/** + * @param {string} string + * @returns {string} + */ +function stripBom(string) { + // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string + // conversion translates it to FEFF (UTF-16 BOM). + if (string.charCodeAt(0) === 0xfeff) { + return string.slice(1); + } + return string; +} +// end strip-bom + +const not_found_result = { + tsconfigFile: null, + tsconfig: {} +}; + +/** + * parse the closest tsconfig.json file + * + * @param {string} filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd) + * @param {import('./public.d.ts').TSConfckParseOptions} [options] - options + * @returns {Promise} + * @throws {TSConfckParseError} + */ +async function parse$f(filename, options) { + /** @type {import('./cache.js').TSConfckCache} */ + const cache = options?.cache; + if (cache?.hasParseResult(filename)) { + return getParsedDeep(filename, cache, options); + } + const { + resolve, + reject, + /** @type {Promise}*/ + promise + } = makePromise(); + cache?.setParseResult(filename, promise); + try { + let tsconfigFile = + (await resolveTSConfigJson(filename, cache)) || (await find(filename, options)); + if (!tsconfigFile) { + resolve(not_found_result); + return promise; + } + let result; + if (filename !== tsconfigFile && cache?.hasParseResult(tsconfigFile)) { + result = await getParsedDeep(tsconfigFile, cache, options); + } else { + result = await parseFile$1(tsconfigFile, cache, filename === tsconfigFile); + await Promise.all([parseExtends(result, cache), parseReferences(result, options)]); + } + resolve(resolveSolutionTSConfig(filename, result)); + } catch (e) { + reject(e); + } + return promise; +} + +/** + * ensure extends and references are parsed + * + * @param {string} filename - cached file + * @param {import('./cache.js').TSConfckCache} cache - cache + * @param {import('./public.d.ts').TSConfckParseOptions} options - options + */ +async function getParsedDeep(filename, cache, options) { + const result = await cache.getParseResult(filename); + if ( + (result.tsconfig.extends && !result.extended) || + (result.tsconfig.references && !result.referenced) + ) { + const promise = Promise.all([ + parseExtends(result, cache), + parseReferences(result, options) + ]).then(() => result); + cache.setParseResult(filename, promise); + return promise; + } + return result; +} + +/** + * + * @param {string} tsconfigFile - path to tsconfig file + * @param {import('./cache.js').TSConfckCache} [cache] - cache + * @param {boolean} [skipCache] - skip cache + * @returns {Promise} + */ +async function parseFile$1(tsconfigFile, cache, skipCache) { + if (!skipCache && cache?.hasParseResult(tsconfigFile)) { + return cache.getParseResult(tsconfigFile); + } + const promise = promises$1 + .readFile(tsconfigFile, 'utf-8') + .then(toJson) + .then((json) => { + const parsed = JSON.parse(json); + applyDefaults(parsed, tsconfigFile); + return { + tsconfigFile, + tsconfig: normalizeTSConfig(parsed, path$o.dirname(tsconfigFile)) + }; + }) + .catch((e) => { + throw new TSConfckParseError( + `parsing ${tsconfigFile} failed: ${e}`, + 'PARSE_FILE', + tsconfigFile, + e + ); + }); + if (!skipCache) { + cache?.setParseResult(tsconfigFile, promise); + } + return promise; +} + +/** + * normalize to match the output of ts.parseJsonConfigFileContent + * + * @param {any} tsconfig - typescript tsconfig output + * @param {string} dir - directory + */ +function normalizeTSConfig(tsconfig, dir) { + // set baseUrl to absolute path + if (tsconfig.compilerOptions?.baseUrl && !path$o.isAbsolute(tsconfig.compilerOptions.baseUrl)) { + tsconfig.compilerOptions.baseUrl = resolve2posix(dir, tsconfig.compilerOptions.baseUrl); + } + return tsconfig; +} + +/** + * + * @param {import('./public.d.ts').TSConfckParseResult} result + * @param {import('./public.d.ts').TSConfckParseOptions} [options] + * @returns {Promise} + */ +async function parseReferences(result, options) { + if (!result.tsconfig.references) { + return; + } + const referencedFiles = resolveReferencedTSConfigFiles(result, options); + const referenced = await Promise.all( + referencedFiles.map((file) => parseFile$1(file, options?.cache)) + ); + await Promise.all(referenced.map((ref) => parseExtends(ref, options?.cache))); + referenced.forEach((ref) => { + ref.solution = result; + }); + result.referenced = referenced; +} + +/** + * @param {import('./public.d.ts').TSConfckParseResult} result + * @param {import('./cache.js').TSConfckCache}[cache] + * @returns {Promise} + */ +async function parseExtends(result, cache) { + if (!result.tsconfig.extends) { + return; + } + // use result as first element in extended + // but dereference tsconfig so that mergeExtended can modify the original without affecting extended[0] + /** @type {import('./public.d.ts').TSConfckParseResult[]} */ + const extended = [ + { tsconfigFile: result.tsconfigFile, tsconfig: JSON.parse(JSON.stringify(result.tsconfig)) } + ]; + + // flatten extends graph into extended + let pos = 0; + /** @type {string[]} */ + const extendsPath = []; + let currentBranchDepth = 0; + while (pos < extended.length) { + const extending = extended[pos]; + extendsPath.push(extending.tsconfigFile); + if (extending.tsconfig.extends) { + // keep following this branch + currentBranchDepth += 1; + /** @type {string[]} */ + let resolvedExtends; + if (!Array.isArray(extending.tsconfig.extends)) { + resolvedExtends = [resolveExtends(extending.tsconfig.extends, extending.tsconfigFile)]; + } else { + // reverse because typescript 5.0 treats ['a','b','c'] as c extends b extends a + resolvedExtends = extending.tsconfig.extends + .reverse() + .map((ex) => resolveExtends(ex, extending.tsconfigFile)); + } + + const circularExtends = resolvedExtends.find((tsconfigFile) => + extendsPath.includes(tsconfigFile) + ); + if (circularExtends) { + const circle = extendsPath.concat([circularExtends]).join(' -> '); + throw new TSConfckParseError( + `Circular dependency in "extends": ${circle}`, + 'EXTENDS_CIRCULAR', + result.tsconfigFile + ); + } + // add new extends to the list directly after current + extended.splice( + pos + 1, + 0, + ...(await Promise.all(resolvedExtends.map((file) => parseFile$1(file, cache)))) + ); + } else { + // reached a leaf, backtrack to the last branching point and continue + extendsPath.splice(-currentBranchDepth); + currentBranchDepth = 0; + } + pos = pos + 1; + } + result.extended = extended; + // skip first as it is the original config + for (const ext of result.extended.slice(1)) { + extendTSConfig(result, ext); + } +} + +/** + * + * @param {string} extended + * @param {string} from + * @returns {string} + */ +function resolveExtends(extended, from) { + if (extended === '..') { + // see #149 + extended = '../tsconfig.json'; + } + const req = createRequire$2(from); + let error; + try { + return req.resolve(extended); + } catch (e) { + error = e; + } + if (extended[0] !== '.' && !path$o.isAbsolute(extended)) { + try { + return req.resolve(`${extended}/tsconfig.json`); + } catch (e) { + error = e; + } + } + + throw new TSConfckParseError( + `failed to resolve "extends":"${extended}" in ${from}`, + 'EXTENDS_RESOLVE', + from, + error + ); +} + +// references, extends and custom keys are not carried over +const EXTENDABLE_KEYS = [ + 'compilerOptions', + 'files', + 'include', + 'exclude', + 'watchOptions', + 'compileOnSave', + 'typeAcquisition', + 'buildOptions' +]; + +/** + * + * @param {import('./public.d.ts').TSConfckParseResult} extending + * @param {import('./public.d.ts').TSConfckParseResult} extended + * @returns void + */ +function extendTSConfig(extending, extended) { + const extendingConfig = extending.tsconfig; + const extendedConfig = extended.tsconfig; + const relativePath = native2posix( + path$o.relative(path$o.dirname(extending.tsconfigFile), path$o.dirname(extended.tsconfigFile)) + ); + for (const key of Object.keys(extendedConfig).filter((key) => EXTENDABLE_KEYS.includes(key))) { + if (key === 'compilerOptions') { + if (!extendingConfig.compilerOptions) { + extendingConfig.compilerOptions = {}; + } + for (const option of Object.keys(extendedConfig.compilerOptions)) { + if (Object.prototype.hasOwnProperty.call(extendingConfig.compilerOptions, option)) { + continue; // already set + } + extendingConfig.compilerOptions[option] = rebaseRelative( + option, + extendedConfig.compilerOptions[option], + relativePath + ); + } + } else if (extendingConfig[key] === undefined) { + if (key === 'watchOptions') { + extendingConfig.watchOptions = {}; + for (const option of Object.keys(extendedConfig.watchOptions)) { + extendingConfig.watchOptions[option] = rebaseRelative( + option, + extendedConfig.watchOptions[option], + relativePath + ); + } + } else { + extendingConfig[key] = rebaseRelative(key, extendedConfig[key], relativePath); + } + } + } +} + +const REBASE_KEYS = [ + // root + 'files', + 'include', + 'exclude', + // compilerOptions + 'baseUrl', + 'rootDir', + 'rootDirs', + 'typeRoots', + 'outDir', + 'outFile', + 'declarationDir', + // watchOptions + 'excludeDirectories', + 'excludeFiles' +]; + +/** @typedef {string | string[]} PathValue */ + +/** + * + * @param {string} key + * @param {PathValue} value + * @param {string} prependPath + * @returns {PathValue} + */ +function rebaseRelative(key, value, prependPath) { + if (!REBASE_KEYS.includes(key)) { + return value; + } + if (Array.isArray(value)) { + return value.map((x) => rebasePath(x, prependPath)); + } else { + return rebasePath(value, prependPath); + } +} + +/** + * + * @param {string} value + * @param {string} prependPath + * @returns {string} + */ +function rebasePath(value, prependPath) { + if (path$o.isAbsolute(value)) { + return value; + } else { + // relative paths use posix syntax in tsconfig + return path$o.posix.normalize(path$o.posix.join(prependPath, value)); + } +} + +class TSConfckParseError extends Error { + /** + * error code + * @type {string} + */ + code; + /** + * error cause + * @type { Error | undefined} + */ + cause; + + /** + * absolute path of tsconfig file where the error happened + * @type {string} + */ + tsconfigFile; + /** + * + * @param {string} message - error message + * @param {string} code - error code + * @param {string} tsconfigFile - path to tsconfig file + * @param {Error?} cause - cause of this error + */ + constructor(message, code, tsconfigFile, cause) { + super(message); + // Set the prototype explicitly. + Object.setPrototypeOf(this, TSConfckParseError.prototype); + this.name = TSConfckParseError.name; + this.code = code; + this.cause = cause; + this.tsconfigFile = tsconfigFile; + } +} + +/** + * + * @param {any} tsconfig + * @param {string} tsconfigFile + */ +function applyDefaults(tsconfig, tsconfigFile) { + if (isJSConfig(tsconfigFile)) { + tsconfig.compilerOptions = { + ...DEFAULT_JSCONFIG_COMPILER_OPTIONS, + ...tsconfig.compilerOptions + }; + } +} + +const DEFAULT_JSCONFIG_COMPILER_OPTIONS = { + allowJs: true, + maxNodeModuleJsDepth: 2, + allowSyntheticDefaultImports: true, + skipLibCheck: true, + noEmit: true +}; + +/** + * @param {string} configFileName + */ +function isJSConfig(configFileName) { + return path$o.basename(configFileName) === 'jsconfig.json'; +} + +/** @template T */ +class TSConfckCache { + /** + * clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted + */ + clear() { + this.#configPaths.clear(); + this.#parsed.clear(); + } + + /** + * has cached closest config for files in dir + * @param {string} dir + * @param {string} [configName=tsconfig.json] + * @returns {boolean} + */ + hasConfigPath(dir, configName = 'tsconfig.json') { + return this.#configPaths.has(`${dir}/${configName}`); + } + + /** + * get cached closest tsconfig for files in dir + * @param {string} dir + * @param {string} [configName=tsconfig.json] + * @returns {Promise|string|null} + * @throws {unknown} if cached value is an error + */ + getConfigPath(dir, configName = 'tsconfig.json') { + const key = `${dir}/${configName}`; + const value = this.#configPaths.get(key); + if (value == null || value.length || value.then) { + return value; + } else { + throw value; + } + } + + /** + * has parsed tsconfig for file + * @param {string} file + * @returns {boolean} + */ + hasParseResult(file) { + return this.#parsed.has(file); + } + + /** + * get parsed tsconfig for file + * @param {string} file + * @returns {Promise|T} + * @throws {unknown} if cached value is an error + */ + getParseResult(file) { + const value = this.#parsed.get(file); + if (value.then || value.tsconfig) { + return value; + } else { + throw value; // cached error, rethrow + } + } + + /** + * @internal + * @private + * @param file + * @param {Promise} result + */ + setParseResult(file, result) { + this.#parsed.set(file, result); + result + .then((parsed) => { + if (this.#parsed.get(file) === result) { + this.#parsed.set(file, parsed); + } + }) + .catch((e) => { + if (this.#parsed.get(file) === result) { + this.#parsed.set(file, e); + } + }); + } + + /** + * @internal + * @private + * @param {string} dir + * @param {Promise} configPath + * @param {string} [configName=tsconfig.json] + */ + setConfigPath(dir, configPath, configName = 'tsconfig.json') { + const key = `${dir}/${configName}`; + this.#configPaths.set(key, configPath); + configPath + .then((path) => { + if (this.#configPaths.get(key) === configPath) { + this.#configPaths.set(key, path); + } + }) + .catch((e) => { + if (this.#configPaths.get(key) === configPath) { + this.#configPaths.set(key, e); + } + }); + } + + /** + * map directories to their closest tsconfig.json + * @internal + * @private + * @type{Map|string|null)>} + */ + #configPaths = new Map(); + + /** + * map files to their parsed tsconfig result + * @internal + * @private + * @type {Map|T)> } + */ + #parsed = new Map(); +} + +const debug$h = createDebugger('vite:esbuild'); +// IIFE content looks like `var MyLib = function() {`. +// Spaces are removed and parameters are mangled when minified +const IIFE_BEGIN_RE = /(const|var)\s+\S+\s*=\s*function\([^()]*\)\s*\{\s*"use strict";/; +const validExtensionRE = /\.\w+$/; +const jsxExtensionsRE = /\.(?:j|t)sx\b/; +let server; +async function transformWithEsbuild(code, filename, options, inMap) { + let loader = options?.loader; + if (!loader) { + // if the id ends with a valid ext, use it (e.g. vue blocks) + // otherwise, cleanup the query before checking the ext + const ext = path$o + .extname(validExtensionRE.test(filename) ? filename : cleanUrl(filename)) + .slice(1); + if (ext === 'cjs' || ext === 'mjs') { + loader = 'js'; + } + else if (ext === 'cts' || ext === 'mts') { + loader = 'ts'; + } + else { + loader = ext; + } + } + let tsconfigRaw = options?.tsconfigRaw; + // if options provide tsconfigRaw in string, it takes highest precedence + if (typeof tsconfigRaw !== 'string') { + // these fields would affect the compilation result + // https://esbuild.github.io/content-types/#tsconfig-json + const meaningfulFields = [ + 'alwaysStrict', + 'experimentalDecorators', + 'importsNotUsedAsValues', + 'jsx', + 'jsxFactory', + 'jsxFragmentFactory', + 'jsxImportSource', + 'preserveValueImports', + 'target', + 'useDefineForClassFields', + 'verbatimModuleSyntax', + ]; + const compilerOptionsForFile = {}; + if (loader === 'ts' || loader === 'tsx') { + const loadedTsconfig = await loadTsconfigJsonForFile(filename); + const loadedCompilerOptions = loadedTsconfig.compilerOptions ?? {}; + for (const field of meaningfulFields) { + if (field in loadedCompilerOptions) { + // @ts-expect-error TypeScript can't tell they are of the same type + compilerOptionsForFile[field] = loadedCompilerOptions[field]; + } + } + } + const compilerOptions = { + ...compilerOptionsForFile, + ...tsconfigRaw?.compilerOptions, + }; + // esbuild uses `useDefineForClassFields: true` when `tsconfig.compilerOptions.target` isn't declared + // but we want `useDefineForClassFields: false` when `tsconfig.compilerOptions.target` isn't declared + // to align with the TypeScript's behavior + if (compilerOptions.useDefineForClassFields === undefined && + compilerOptions.target === undefined) { + compilerOptions.useDefineForClassFields = false; + } + // esbuild uses tsconfig fields when both the normal options and tsconfig was set + // but we want to prioritize the normal options + if (options) { + options.jsx && (compilerOptions.jsx = undefined); + options.jsxFactory && (compilerOptions.jsxFactory = undefined); + options.jsxFragment && (compilerOptions.jsxFragmentFactory = undefined); + options.jsxImportSource && (compilerOptions.jsxImportSource = undefined); + } + tsconfigRaw = { + ...tsconfigRaw, + compilerOptions, + }; + } + const resolvedOptions = { + sourcemap: true, + // ensure source file name contains full query + sourcefile: filename, + ...options, + loader, + tsconfigRaw, + }; + // Some projects in the ecosystem are calling this function with an ESBuildOptions + // object and esbuild throws an error for extra fields + // @ts-expect-error include exists in ESBuildOptions + delete resolvedOptions.include; + // @ts-expect-error exclude exists in ESBuildOptions + delete resolvedOptions.exclude; + // @ts-expect-error jsxInject exists in ESBuildOptions + delete resolvedOptions.jsxInject; + try { + const result = await transform$1(code, resolvedOptions); + let map; + if (inMap && resolvedOptions.sourcemap) { + const nextMap = JSON.parse(result.map); + nextMap.sourcesContent = []; + map = combineSourcemaps(filename, [ + nextMap, + inMap, + ]); + } + else { + map = + resolvedOptions.sourcemap && resolvedOptions.sourcemap !== 'inline' + ? JSON.parse(result.map) + : { mappings: '' }; + } + return { + ...result, + map, + }; + } + catch (e) { + debug$h?.(`esbuild error with options used: `, resolvedOptions); + // patch error information + if (e.errors) { + e.frame = ''; + e.errors.forEach((m) => { + if (m.text === 'Experimental decorators are not currently enabled' || + m.text === + 'Parameter decorators only work when experimental decorators are enabled') { + m.text += + '. Vite 5 now uses esbuild 0.18 and you need to enable them by adding "experimentalDecorators": true in your "tsconfig.json" file.'; + } + e.frame += `\n` + prettifyMessage(m, code); + }); + e.loc = e.errors[0].location; + } + throw e; + } +} +function esbuildPlugin(config) { + const options = config.esbuild; + const { jsxInject, include, exclude, ...esbuildTransformOptions } = options; + const filter = createFilter(include || /\.(m?ts|[jt]sx)$/, exclude || /\.js$/); + // Remove optimization options for dev as we only need to transpile them, + // and for build as the final optimization is in `buildEsbuildPlugin` + const transformOptions = { + target: 'esnext', + charset: 'utf8', + ...esbuildTransformOptions, + minify: false, + minifyIdentifiers: false, + minifySyntax: false, + minifyWhitespace: false, + treeShaking: false, + // keepNames is not needed when minify is disabled. + // Also transforming multiple times with keepNames enabled breaks + // tree-shaking. (#9164) + keepNames: false, + }; + return { + name: 'vite:esbuild', + configureServer(_server) { + server = _server; + server.watcher + .on('add', reloadOnTsconfigChange) + .on('change', reloadOnTsconfigChange) + .on('unlink', reloadOnTsconfigChange); + }, + buildEnd() { + // recycle serve to avoid preventing Node self-exit (#6815) + server = null; + }, + async transform(code, id) { + if (filter(id) || filter(cleanUrl(id))) { + const result = await transformWithEsbuild(code, id, transformOptions); + if (result.warnings.length) { + result.warnings.forEach((m) => { + this.warn(prettifyMessage(m, code)); + }); + } + if (jsxInject && jsxExtensionsRE.test(id)) { + result.code = jsxInject + ';' + result.code; + } + return { + code: result.code, + map: result.map, + }; + } + }, + }; +} +const rollupToEsbuildFormatMap = { + es: 'esm', + cjs: 'cjs', + // passing `var Lib = (() => {})()` to esbuild with format = "iife" + // will turn it to `(() => { var Lib = (() => {})() })()`, + // so we remove the format config to tell esbuild not doing this + // + // although esbuild doesn't change format, there is still possibility + // that `{ treeShaking: true }` removes a top-level no-side-effect variable + // like: `var Lib = 1`, which becomes `` after esbuild transforming, + // but thankfully rollup does not do this optimization now + iife: undefined, +}; +const buildEsbuildPlugin = (config) => { + return { + name: 'vite:esbuild-transpile', + async renderChunk(code, chunk, opts) { + // @ts-expect-error injected by @vitejs/plugin-legacy + if (opts.__vite_skip_esbuild__) { + return null; + } + const options = resolveEsbuildTranspileOptions(config, opts.format); + if (!options) { + return null; + } + const res = await transformWithEsbuild(code, chunk.fileName, options); + if (config.build.lib) { + // #7188, esbuild adds helpers out of the UMD and IIFE wrappers, and the + // names are minified potentially causing collision with other globals. + // We inject the helpers inside the wrappers. + // e.g. turn: + // (function(){ /*actual content/* })() + // into: + // (function(){ /*actual content/* })() + // Not using regex because it's too hard to rule out performance issues like #8738 #8099 #10900 #14065 + // Instead, using plain string index manipulation (indexOf, slice) which is simple and performant + // We don't need to create a MagicString here because both the helpers and + // the headers don't modify the sourcemap + const esbuildCode = res.code; + const contentIndex = opts.format === 'iife' + ? Math.max(esbuildCode.search(IIFE_BEGIN_RE), 0) + : opts.format === 'umd' + ? esbuildCode.indexOf(`(function(`) // same for minified or not + : 0; + if (contentIndex > 0) { + const esbuildHelpers = esbuildCode.slice(0, contentIndex); + res.code = esbuildCode + .slice(contentIndex) + .replace(`"use strict";`, `"use strict";` + esbuildHelpers); + } + } + return res; + }, + }; +}; +function resolveEsbuildTranspileOptions(config, format) { + const target = config.build.target; + const minify = config.build.minify === 'esbuild'; + if ((!target || target === 'esnext') && !minify) { + return null; + } + // Do not minify whitespace for ES lib output since that would remove + // pure annotations and break tree-shaking + // https://github.com/vuejs/core/issues/2860#issuecomment-926882793 + const isEsLibBuild = config.build.lib && format === 'es'; + const esbuildOptions = config.esbuild || {}; + const options = { + charset: 'utf8', + ...esbuildOptions, + loader: 'js', + target: target || undefined, + format: rollupToEsbuildFormatMap[format], + // the final build should always support dynamic import and import.meta. + // if they need to be polyfilled, plugin-legacy should be used. + // plugin-legacy detects these two features when checking for modern code. + supported: { + 'dynamic-import': true, + 'import-meta': true, + ...esbuildOptions.supported, + }, + }; + // If no minify, disable all minify options + if (!minify) { + return { + ...options, + minify: false, + minifyIdentifiers: false, + minifySyntax: false, + minifyWhitespace: false, + treeShaking: false, + }; + } + // If user enable fine-grain minify options, minify with their options instead + if (options.minifyIdentifiers != null || + options.minifySyntax != null || + options.minifyWhitespace != null) { + if (isEsLibBuild) { + // Disable minify whitespace as it breaks tree-shaking + return { + ...options, + minify: false, + minifyIdentifiers: options.minifyIdentifiers ?? true, + minifySyntax: options.minifySyntax ?? true, + minifyWhitespace: false, + treeShaking: true, + }; + } + else { + return { + ...options, + minify: false, + minifyIdentifiers: options.minifyIdentifiers ?? true, + minifySyntax: options.minifySyntax ?? true, + minifyWhitespace: options.minifyWhitespace ?? true, + treeShaking: true, + }; + } + } + // Else apply default minify options + if (isEsLibBuild) { + // Minify all except whitespace as it breaks tree-shaking + return { + ...options, + minify: false, + minifyIdentifiers: true, + minifySyntax: true, + minifyWhitespace: false, + treeShaking: true, + }; + } + else { + return { + ...options, + minify: true, + treeShaking: true, + }; + } +} +function prettifyMessage(m, code) { + let res = colors$1.yellow(m.text); + if (m.location) { + res += `\n` + generateCodeFrame(code, m.location); + } + return res + `\n`; +} +let tsconfckCache; +async function loadTsconfigJsonForFile(filename) { + try { + if (!tsconfckCache) { + tsconfckCache = new TSConfckCache(); + } + const result = await parse$f(filename, { + cache: tsconfckCache, + ignoreNodeModules: true, + }); + // tsconfig could be out of root, make sure it is watched on dev + if (server && result.tsconfigFile) { + ensureWatchedFile(server.watcher, result.tsconfigFile, server.config.root); + } + return result.tsconfig; + } + catch (e) { + if (e instanceof TSConfckParseError) { + // tsconfig could be out of root, make sure it is watched on dev + if (server && e.tsconfigFile) { + ensureWatchedFile(server.watcher, e.tsconfigFile, server.config.root); + } + } + throw e; + } +} +async function reloadOnTsconfigChange(changedFile) { + // server could be closed externally after a file change is detected + if (!server) + return; + // any tsconfig.json that's added in the workspace could be closer to a code file than a previously cached one + // any json file in the tsconfig cache could have been used to compile ts + if (path$o.basename(changedFile) === 'tsconfig.json' || + (changedFile.endsWith('.json') && + tsconfckCache?.hasParseResult(changedFile))) { + server.config.logger.info(`changed tsconfig file detected: ${changedFile} - Clearing cache and forcing full-reload to ensure TypeScript is compiled with updated config values.`, { clear: server.config.clearScreen, timestamp: true }); + // clear module graph to remove code compiled with outdated config + server.moduleGraph.invalidateAll(); + // reset tsconfck so that recompile works with up2date configs + tsconfckCache?.clear(); + // server may not be available if vite config is updated at the same time + if (server) { + // force full reload + server.hot.send({ + type: 'full-reload', + path: '*', + }); + } + } +} + +// src/realWorker.ts +var Worker = class { + /** @internal */ + _code; + /** @internal */ + _parentFunctions; + /** @internal */ + _max; + /** @internal */ + _pool; + /** @internal */ + _idlePool; + /** @internal */ + _queue; + constructor(fn, options = {}) { + this._code = genWorkerCode(fn, options.parentFunctions ?? {}); + this._parentFunctions = options.parentFunctions ?? {}; + const defaultMax = Math.max( + 1, + // os.availableParallelism is available from Node.js 18.14.0 + (os$4.availableParallelism?.() ?? os$4.cpus().length) - 1 + ); + this._max = options.max || defaultMax; + this._pool = []; + this._idlePool = []; + this._queue = []; + } + async run(...args) { + const worker = await this._getAvailableWorker(); + return new Promise((resolve, reject) => { + worker.currentResolve = resolve; + worker.currentReject = reject; + worker.postMessage({ type: "run", args }); + }); + } + stop() { + this._pool.forEach((w) => w.unref()); + this._queue.forEach( + ([, reject]) => reject( + new Error("Main worker pool stopped before a worker was available.") + ) + ); + this._pool = []; + this._idlePool = []; + this._queue = []; + } + /** @internal */ + async _getAvailableWorker() { + if (this._idlePool.length) { + return this._idlePool.shift(); + } + if (this._pool.length < this._max) { + const worker = new Worker$1(this._code, { eval: true }); + worker.on("message", async (args) => { + if (args.type === "run") { + if ("result" in args) { + worker.currentResolve && worker.currentResolve(args.result); + worker.currentResolve = null; + } else { + if (args.error instanceof ReferenceError) { + args.error.message += ". Maybe you forgot to pass the function to parentFunction?"; + } + worker.currentReject && worker.currentReject(args.error); + worker.currentReject = null; + } + this._assignDoneWorker(worker); + } else if (args.type === "parentFunction") { + try { + const result = await this._parentFunctions[args.name](...args.args); + worker.postMessage({ type: "parentFunction", id: args.id, result }); + } catch (e) { + worker.postMessage({ + type: "parentFunction", + id: args.id, + error: e + }); + } + } + }); + worker.on("error", (err) => { + worker.currentReject && worker.currentReject(err); + worker.currentReject = null; + }); + worker.on("exit", (code) => { + const i = this._pool.indexOf(worker); + if (i > -1) + this._pool.splice(i, 1); + if (code !== 0 && worker.currentReject) { + worker.currentReject( + new Error(`Worker stopped with non-0 exit code ${code}`) + ); + worker.currentReject = null; + } + }); + this._pool.push(worker); + return worker; + } + let resolve; + let reject; + const onWorkerAvailablePromise = new Promise((r, rj) => { + resolve = r; + reject = rj; + }); + this._queue.push([resolve, reject]); + return onWorkerAvailablePromise; + } + /** @internal */ + _assignDoneWorker(worker) { + if (this._queue.length) { + const [resolve] = this._queue.shift(); + resolve(worker); + return; + } + this._idlePool.push(worker); + } +}; +function genWorkerCode(fn, parentFunctions) { + const createParentFunctionCaller = (parentPort) => { + let id = 0; + const resolvers = /* @__PURE__ */ new Map(); + const call = (key) => async (...args) => { + id++; + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + resolvers.set(id, { resolve, reject }); + parentPort.postMessage({ type: "parentFunction", id, name: key, args }); + return await promise; + }; + const receive = (id2, args) => { + if (resolvers.has(id2)) { + const { resolve, reject } = resolvers.get(id2); + resolvers.delete(id2); + if ("result" in args) { + resolve(args.result); + } else { + reject(args.error); + } + } + }; + return { call, receive }; + }; + return ` +const { parentPort } = require('worker_threads') +const parentFunctionCaller = (${createParentFunctionCaller.toString()})(parentPort) + +const doWork = (() => { + ${Object.keys(parentFunctions).map( + (key) => `const ${key} = parentFunctionCaller.call(${JSON.stringify(key)});` + ).join("\n")} + return (${fn.toString()})() +})() + +parentPort.on('message', async (args) => { + if (args.type === 'run') { + try { + const res = await doWork(...args.args) + parentPort.postMessage({ type: 'run', result: res }) + } catch (e) { + parentPort.postMessage({ type: 'run', error: e }) + } + } else if (args.type === 'parentFunction') { + parentFunctionCaller.receive(args.id, args) + } +}) + `; +} +var FakeWorker = class { + /** @internal */ + _fn; + constructor(fn, options = {}) { + const argsAndCode = genFakeWorkerArgsAndCode( + fn, + options.parentFunctions ?? {} + ); + const require2 = createRequire$1(import.meta.url); + this._fn = new Function(...argsAndCode)(require2, options.parentFunctions); + } + async run(...args) { + try { + return await this._fn(...args); + } catch (err) { + if (err instanceof ReferenceError) { + err.message += ". Maybe you forgot to pass the function to parentFunction?"; + } + throw err; + } + } + stop() { + } +}; +function genFakeWorkerArgsAndCode(fn, parentFunctions) { + return [ + "require", + "parentFunctions", + ` +${Object.keys(parentFunctions).map((key) => `const ${key} = parentFunctions[${JSON.stringify(key)}];`).join("\n")} +return (${fn.toString()})() + ` + ]; +} + +// src/workerWithFallback.ts +var WorkerWithFallback = class { + /** @internal */ + _disableReal; + /** @internal */ + _realWorker; + /** @internal */ + _fakeWorker; + /** @internal */ + _shouldUseFake; + constructor(fn, options) { + this._disableReal = options.max !== void 0 && options.max <= 0; + this._realWorker = new Worker(fn, options); + this._fakeWorker = new FakeWorker(fn, options); + this._shouldUseFake = options.shouldUseFake; + } + async run(...args) { + const useFake = this._disableReal || this._shouldUseFake(...args); + return this[useFake ? "_fakeWorker" : "_realWorker"].run(...args); + } + stop() { + this._realWorker.stop(); + this._fakeWorker.stop(); + } +}; + +let terserPath; +const loadTerserPath = (root) => { + if (terserPath) + return terserPath; + try { + terserPath = requireResolveFromRootWithFallback(root, 'terser'); + } + catch (e) { + if (e.code === 'MODULE_NOT_FOUND') { + throw new Error('terser not found. Since Vite v3, terser has become an optional dependency. You need to install it.'); + } + else { + const message = new Error(`terser failed to load:\n${e.message}`); + message.stack = e.stack + '\n' + message.stack; + throw message; + } + } + return terserPath; +}; +function terserPlugin(config) { + const { maxWorkers, ...terserOptions } = config.build.terserOptions; + const makeWorker = () => new Worker(() => async (terserPath, code, options) => { + // test fails when using `import`. maybe related: https://github.com/nodejs/node/issues/43205 + // eslint-disable-next-line no-restricted-globals -- this function runs inside cjs + const terser = require(terserPath); + return terser.minify(code, options); + }, { + max: maxWorkers, + }); + let worker; + return { + name: 'vite:terser', + async renderChunk(code, _chunk, outputOptions) { + // This plugin is included for any non-false value of config.build.minify, + // so that normal chunks can use the preferred minifier, and legacy chunks + // can use terser. + if (config.build.minify !== 'terser' && + // @ts-expect-error injected by @vitejs/plugin-legacy + !outputOptions.__vite_force_terser__) { + return null; + } + // Do not minify ES lib output since that would remove pure annotations + // and break tree-shaking. + if (config.build.lib && outputOptions.format === 'es') { + return null; + } + // Lazy load worker. + worker ||= makeWorker(); + const terserPath = loadTerserPath(config.root); + const res = await worker.run(terserPath, code, { + safari10: true, + ...terserOptions, + sourceMap: !!outputOptions.sourcemap, + module: outputOptions.format.startsWith('es'), + toplevel: outputOptions.format === 'cjs', + }); + return { + code: res.code, + map: res.map, + }; + }, + closeBundle() { + worker?.stop(); + }, + }; +} + +const mimes$1 = { + "3g2": "video/3gpp2", + "3gp": "video/3gpp", + "3gpp": "video/3gpp", + "3mf": "model/3mf", + "aac": "audio/aac", + "ac": "application/pkix-attr-cert", + "adp": "audio/adpcm", + "adts": "audio/aac", + "ai": "application/postscript", + "aml": "application/automationml-aml+xml", + "amlx": "application/automationml-amlx+zip", + "amr": "audio/amr", + "apng": "image/apng", + "appcache": "text/cache-manifest", + "appinstaller": "application/appinstaller", + "appx": "application/appx", + "appxbundle": "application/appxbundle", + "asc": "application/pgp-keys", + "atom": "application/atom+xml", + "atomcat": "application/atomcat+xml", + "atomdeleted": "application/atomdeleted+xml", + "atomsvc": "application/atomsvc+xml", + "au": "audio/basic", + "avci": "image/avci", + "avcs": "image/avcs", + "avif": "image/avif", + "aw": "application/applixware", + "bdoc": "application/bdoc", + "bin": "application/octet-stream", + "bmp": "image/bmp", + "bpk": "application/octet-stream", + "btf": "image/prs.btif", + "btif": "image/prs.btif", + "buffer": "application/octet-stream", + "ccxml": "application/ccxml+xml", + "cdfx": "application/cdfx+xml", + "cdmia": "application/cdmi-capability", + "cdmic": "application/cdmi-container", + "cdmid": "application/cdmi-domain", + "cdmio": "application/cdmi-object", + "cdmiq": "application/cdmi-queue", + "cer": "application/pkix-cert", + "cgm": "image/cgm", + "cjs": "application/node", + "class": "application/java-vm", + "coffee": "text/coffeescript", + "conf": "text/plain", + "cpl": "application/cpl+xml", + "cpt": "application/mac-compactpro", + "crl": "application/pkix-crl", + "css": "text/css", + "csv": "text/csv", + "cu": "application/cu-seeme", + "cwl": "application/cwl", + "cww": "application/prs.cww", + "davmount": "application/davmount+xml", + "dbk": "application/docbook+xml", + "deb": "application/octet-stream", + "def": "text/plain", + "deploy": "application/octet-stream", + "dib": "image/bmp", + "disposition-notification": "message/disposition-notification", + "dist": "application/octet-stream", + "distz": "application/octet-stream", + "dll": "application/octet-stream", + "dmg": "application/octet-stream", + "dms": "application/octet-stream", + "doc": "application/msword", + "dot": "application/msword", + "dpx": "image/dpx", + "drle": "image/dicom-rle", + "dsc": "text/prs.lines.tag", + "dssc": "application/dssc+der", + "dtd": "application/xml-dtd", + "dump": "application/octet-stream", + "dwd": "application/atsc-dwd+xml", + "ear": "application/java-archive", + "ecma": "application/ecmascript", + "elc": "application/octet-stream", + "emf": "image/emf", + "eml": "message/rfc822", + "emma": "application/emma+xml", + "emotionml": "application/emotionml+xml", + "eps": "application/postscript", + "epub": "application/epub+zip", + "exe": "application/octet-stream", + "exi": "application/exi", + "exp": "application/express", + "exr": "image/aces", + "ez": "application/andrew-inset", + "fdf": "application/fdf", + "fdt": "application/fdt+xml", + "fits": "image/fits", + "g3": "image/g3fax", + "gbr": "application/rpki-ghostbusters", + "geojson": "application/geo+json", + "gif": "image/gif", + "glb": "model/gltf-binary", + "gltf": "model/gltf+json", + "gml": "application/gml+xml", + "gpx": "application/gpx+xml", + "gram": "application/srgs", + "grxml": "application/srgs+xml", + "gxf": "application/gxf", + "gz": "application/gzip", + "h261": "video/h261", + "h263": "video/h263", + "h264": "video/h264", + "heic": "image/heic", + "heics": "image/heic-sequence", + "heif": "image/heif", + "heifs": "image/heif-sequence", + "hej2": "image/hej2k", + "held": "application/atsc-held+xml", + "hjson": "application/hjson", + "hlp": "application/winhlp", + "hqx": "application/mac-binhex40", + "hsj2": "image/hsj2", + "htm": "text/html", + "html": "text/html", + "ics": "text/calendar", + "ief": "image/ief", + "ifb": "text/calendar", + "iges": "model/iges", + "igs": "model/iges", + "img": "application/octet-stream", + "in": "text/plain", + "ini": "text/plain", + "ink": "application/inkml+xml", + "inkml": "application/inkml+xml", + "ipfix": "application/ipfix", + "iso": "application/octet-stream", + "its": "application/its+xml", + "jade": "text/jade", + "jar": "application/java-archive", + "jhc": "image/jphc", + "jls": "image/jls", + "jp2": "image/jp2", + "jpe": "image/jpeg", + "jpeg": "image/jpeg", + "jpf": "image/jpx", + "jpg": "image/jpeg", + "jpg2": "image/jp2", + "jpgm": "image/jpm", + "jpgv": "video/jpeg", + "jph": "image/jph", + "jpm": "image/jpm", + "jpx": "image/jpx", + "js": "text/javascript", + "json": "application/json", + "json5": "application/json5", + "jsonld": "application/ld+json", + "jsonml": "application/jsonml+json", + "jsx": "text/jsx", + "jt": "model/jt", + "jxr": "image/jxr", + "jxra": "image/jxra", + "jxrs": "image/jxrs", + "jxs": "image/jxs", + "jxsc": "image/jxsc", + "jxsi": "image/jxsi", + "jxss": "image/jxss", + "kar": "audio/midi", + "ktx": "image/ktx", + "ktx2": "image/ktx2", + "less": "text/less", + "lgr": "application/lgr+xml", + "list": "text/plain", + "litcoffee": "text/coffeescript", + "log": "text/plain", + "lostxml": "application/lost+xml", + "lrf": "application/octet-stream", + "m1v": "video/mpeg", + "m21": "application/mp21", + "m2a": "audio/mpeg", + "m2v": "video/mpeg", + "m3a": "audio/mpeg", + "m4a": "audio/mp4", + "m4p": "application/mp4", + "m4s": "video/iso.segment", + "ma": "application/mathematica", + "mads": "application/mads+xml", + "maei": "application/mmt-aei+xml", + "man": "text/troff", + "manifest": "text/cache-manifest", + "map": "application/json", + "mar": "application/octet-stream", + "markdown": "text/markdown", + "mathml": "application/mathml+xml", + "mb": "application/mathematica", + "mbox": "application/mbox", + "md": "text/markdown", + "mdx": "text/mdx", + "me": "text/troff", + "mesh": "model/mesh", + "meta4": "application/metalink4+xml", + "metalink": "application/metalink+xml", + "mets": "application/mets+xml", + "mft": "application/rpki-manifest", + "mid": "audio/midi", + "midi": "audio/midi", + "mime": "message/rfc822", + "mj2": "video/mj2", + "mjp2": "video/mj2", + "mjs": "text/javascript", + "mml": "text/mathml", + "mods": "application/mods+xml", + "mov": "video/quicktime", + "mp2": "audio/mpeg", + "mp21": "application/mp21", + "mp2a": "audio/mpeg", + "mp3": "audio/mpeg", + "mp4": "video/mp4", + "mp4a": "audio/mp4", + "mp4s": "application/mp4", + "mp4v": "video/mp4", + "mpd": "application/dash+xml", + "mpe": "video/mpeg", + "mpeg": "video/mpeg", + "mpf": "application/media-policy-dataset+xml", + "mpg": "video/mpeg", + "mpg4": "video/mp4", + "mpga": "audio/mpeg", + "mpp": "application/dash-patch+xml", + "mrc": "application/marc", + "mrcx": "application/marcxml+xml", + "ms": "text/troff", + "mscml": "application/mediaservercontrol+xml", + "msh": "model/mesh", + "msi": "application/octet-stream", + "msix": "application/msix", + "msixbundle": "application/msixbundle", + "msm": "application/octet-stream", + "msp": "application/octet-stream", + "mtl": "model/mtl", + "musd": "application/mmt-usd+xml", + "mxf": "application/mxf", + "mxmf": "audio/mobile-xmf", + "mxml": "application/xv+xml", + "n3": "text/n3", + "nb": "application/mathematica", + "nq": "application/n-quads", + "nt": "application/n-triples", + "obj": "model/obj", + "oda": "application/oda", + "oga": "audio/ogg", + "ogg": "audio/ogg", + "ogv": "video/ogg", + "ogx": "application/ogg", + "omdoc": "application/omdoc+xml", + "onepkg": "application/onenote", + "onetmp": "application/onenote", + "onetoc": "application/onenote", + "onetoc2": "application/onenote", + "opf": "application/oebps-package+xml", + "opus": "audio/ogg", + "otf": "font/otf", + "owl": "application/rdf+xml", + "oxps": "application/oxps", + "p10": "application/pkcs10", + "p7c": "application/pkcs7-mime", + "p7m": "application/pkcs7-mime", + "p7s": "application/pkcs7-signature", + "p8": "application/pkcs8", + "pdf": "application/pdf", + "pfr": "application/font-tdpfr", + "pgp": "application/pgp-encrypted", + "pkg": "application/octet-stream", + "pki": "application/pkixcmp", + "pkipath": "application/pkix-pkipath", + "pls": "application/pls+xml", + "png": "image/png", + "prc": "model/prc", + "prf": "application/pics-rules", + "provx": "application/provenance+xml", + "ps": "application/postscript", + "pskcxml": "application/pskc+xml", + "pti": "image/prs.pti", + "qt": "video/quicktime", + "raml": "application/raml+yaml", + "rapd": "application/route-apd+xml", + "rdf": "application/rdf+xml", + "relo": "application/p2p-overlay+xml", + "rif": "application/reginfo+xml", + "rl": "application/resource-lists+xml", + "rld": "application/resource-lists-diff+xml", + "rmi": "audio/midi", + "rnc": "application/relax-ng-compact-syntax", + "rng": "application/xml", + "roa": "application/rpki-roa", + "roff": "text/troff", + "rq": "application/sparql-query", + "rs": "application/rls-services+xml", + "rsat": "application/atsc-rsat+xml", + "rsd": "application/rsd+xml", + "rsheet": "application/urc-ressheet+xml", + "rss": "application/rss+xml", + "rtf": "text/rtf", + "rtx": "text/richtext", + "rusd": "application/route-usd+xml", + "s3m": "audio/s3m", + "sbml": "application/sbml+xml", + "scq": "application/scvp-cv-request", + "scs": "application/scvp-cv-response", + "sdp": "application/sdp", + "senmlx": "application/senml+xml", + "sensmlx": "application/sensml+xml", + "ser": "application/java-serialized-object", + "setpay": "application/set-payment-initiation", + "setreg": "application/set-registration-initiation", + "sgi": "image/sgi", + "sgm": "text/sgml", + "sgml": "text/sgml", + "shex": "text/shex", + "shf": "application/shf+xml", + "shtml": "text/html", + "sieve": "application/sieve", + "sig": "application/pgp-signature", + "sil": "audio/silk", + "silo": "model/mesh", + "siv": "application/sieve", + "slim": "text/slim", + "slm": "text/slim", + "sls": "application/route-s-tsid+xml", + "smi": "application/smil+xml", + "smil": "application/smil+xml", + "snd": "audio/basic", + "so": "application/octet-stream", + "spdx": "text/spdx", + "spp": "application/scvp-vp-response", + "spq": "application/scvp-vp-request", + "spx": "audio/ogg", + "sql": "application/sql", + "sru": "application/sru+xml", + "srx": "application/sparql-results+xml", + "ssdl": "application/ssdl+xml", + "ssml": "application/ssml+xml", + "stk": "application/hyperstudio", + "stl": "model/stl", + "stpx": "model/step+xml", + "stpxz": "model/step-xml+zip", + "stpz": "model/step+zip", + "styl": "text/stylus", + "stylus": "text/stylus", + "svg": "image/svg+xml", + "svgz": "image/svg+xml", + "swidtag": "application/swid+xml", + "t": "text/troff", + "t38": "image/t38", + "td": "application/urc-targetdesc+xml", + "tei": "application/tei+xml", + "teicorpus": "application/tei+xml", + "text": "text/plain", + "tfi": "application/thraud+xml", + "tfx": "image/tiff-fx", + "tif": "image/tiff", + "tiff": "image/tiff", + "toml": "application/toml", + "tr": "text/troff", + "trig": "application/trig", + "ts": "video/mp2t", + "tsd": "application/timestamped-data", + "tsv": "text/tab-separated-values", + "ttc": "font/collection", + "ttf": "font/ttf", + "ttl": "text/turtle", + "ttml": "application/ttml+xml", + "txt": "text/plain", + "u3d": "model/u3d", + "u8dsn": "message/global-delivery-status", + "u8hdr": "message/global-headers", + "u8mdn": "message/global-disposition-notification", + "u8msg": "message/global", + "ubj": "application/ubjson", + "uri": "text/uri-list", + "uris": "text/uri-list", + "urls": "text/uri-list", + "vcard": "text/vcard", + "vrml": "model/vrml", + "vtt": "text/vtt", + "vxml": "application/voicexml+xml", + "war": "application/java-archive", + "wasm": "application/wasm", + "wav": "audio/wav", + "weba": "audio/webm", + "webm": "video/webm", + "webmanifest": "application/manifest+json", + "webp": "image/webp", + "wgsl": "text/wgsl", + "wgt": "application/widget", + "wif": "application/watcherinfo+xml", + "wmf": "image/wmf", + "woff": "font/woff", + "woff2": "font/woff2", + "wrl": "model/vrml", + "wsdl": "application/wsdl+xml", + "wspolicy": "application/wspolicy+xml", + "x3d": "model/x3d+xml", + "x3db": "model/x3d+fastinfoset", + "x3dbz": "model/x3d+binary", + "x3dv": "model/x3d-vrml", + "x3dvz": "model/x3d+vrml", + "x3dz": "model/x3d+xml", + "xaml": "application/xaml+xml", + "xav": "application/xcap-att+xml", + "xca": "application/xcap-caps+xml", + "xcs": "application/calendar+xml", + "xdf": "application/xcap-diff+xml", + "xdssc": "application/dssc+xml", + "xel": "application/xcap-el+xml", + "xenc": "application/xenc+xml", + "xer": "application/patch-ops-error+xml", + "xfdf": "application/xfdf", + "xht": "application/xhtml+xml", + "xhtml": "application/xhtml+xml", + "xhvml": "application/xv+xml", + "xlf": "application/xliff+xml", + "xm": "audio/xm", + "xml": "text/xml", + "xns": "application/xcap-ns+xml", + "xop": "application/xop+xml", + "xpl": "application/xproc+xml", + "xsd": "application/xml", + "xsf": "application/prs.xsf+xml", + "xsl": "application/xml", + "xslt": "application/xml", + "xspf": "application/xspf+xml", + "xvm": "application/xv+xml", + "xvml": "application/xv+xml", + "yaml": "text/yaml", + "yang": "application/yang", + "yin": "application/yin+xml", + "yml": "text/yaml", + "zip": "application/zip" +}; + +function lookup(extn) { + let tmp = ('' + extn).trim().toLowerCase(); + let idx = tmp.lastIndexOf('.'); + return mimes$1[!~idx ? tmp : tmp.substring(++idx)]; +} + +const publicFilesMap = new WeakMap(); +async function initPublicFiles(config) { + let fileNames; + try { + fileNames = await recursiveReaddir(config.publicDir); + } + catch (e) { + if (e.code === ERR_SYMLINK_IN_RECURSIVE_READDIR) { + return; + } + throw e; + } + const publicFiles = new Set(fileNames.map((fileName) => fileName.slice(config.publicDir.length))); + publicFilesMap.set(config, publicFiles); + return publicFiles; +} +function getPublicFiles(config) { + return publicFilesMap.get(config); +} +function checkPublicFile(url, config) { + // note if the file is in /public, the resolver would have returned it + // as-is so it's not going to be a fully resolved path. + const { publicDir } = config; + if (!publicDir || url[0] !== '/') { + return; + } + const fileName = cleanUrl(url); + // short-circuit if we have an in-memory publicFiles cache + const publicFiles = getPublicFiles(config); + if (publicFiles) { + return publicFiles.has(fileName) + ? normalizePath$3(path$o.join(publicDir, fileName)) + : undefined; + } + const publicFile = normalizePath$3(path$o.join(publicDir, fileName)); + if (!publicFile.startsWith(withTrailingSlash(publicDir))) { + // can happen if URL starts with '../' + return; + } + return fs$l.existsSync(publicFile) ? publicFile : undefined; +} + +// referenceId is base64url but replaces - with $ +const assetUrlRE = /__VITE_ASSET__([\w$]+)__(?:\$_(.*?)__)?/g; +const jsSourceMapRE = /\.[cm]?js\.map$/; +const assetCache = new WeakMap(); +const generatedAssets = new WeakMap(); +// add own dictionary entry by directly assigning mrmime +function registerCustomMime() { + // https://github.com/lukeed/mrmime/issues/3 + mimes$1['ico'] = 'image/x-icon'; + // https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers#flac + mimes$1['flac'] = 'audio/flac'; + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types + mimes$1['eot'] = 'application/vnd.ms-fontobject'; +} +function renderAssetUrlInJS(ctx, config, chunk, opts, code) { + const toRelativeRuntime = createToImportMetaURLBasedRelativeRuntime(opts.format, config.isWorker); + let match; + let s; + // Urls added with JS using e.g. + // imgElement.src = "__VITE_ASSET__5aA0Ddc0__" are using quotes + // Urls added in CSS that is imported in JS end up like + // var inlined = ".inlined{color:green;background:url(__VITE_ASSET__5aA0Ddc0__)}\n"; + // In both cases, the wrapping should already be fine + assetUrlRE.lastIndex = 0; + while ((match = assetUrlRE.exec(code))) { + s ||= new MagicString(code); + const [full, referenceId, postfix = ''] = match; + const file = ctx.getFileName(referenceId); + chunk.viteMetadata.importedAssets.add(cleanUrl(file)); + const filename = file + postfix; + const replacement = toOutputFilePathInJS(filename, 'asset', chunk.fileName, 'js', config, toRelativeRuntime); + const replacementString = typeof replacement === 'string' + ? JSON.stringify(replacement).slice(1, -1) + : `"+${replacement.runtime}+"`; + s.update(match.index, match.index + full.length, replacementString); + } + // Replace __VITE_PUBLIC_ASSET__5aA0Ddc0__ with absolute paths + const publicAssetUrlMap = publicAssetUrlCache.get(config); + publicAssetUrlRE.lastIndex = 0; + while ((match = publicAssetUrlRE.exec(code))) { + s ||= new MagicString(code); + const [full, hash] = match; + const publicUrl = publicAssetUrlMap.get(hash).slice(1); + const replacement = toOutputFilePathInJS(publicUrl, 'public', chunk.fileName, 'js', config, toRelativeRuntime); + const replacementString = typeof replacement === 'string' + ? JSON.stringify(replacement).slice(1, -1) + : `"+${replacement.runtime}+"`; + s.update(match.index, match.index + full.length, replacementString); + } + return s; +} +// During build, if we don't use a virtual file for public assets, rollup will +// watch for these ids resulting in watching the root of the file system in Windows, +const viteBuildPublicIdPrefix = '\0vite:asset:public'; +/** + * Also supports loading plain strings with import text from './foo.txt?raw' + */ +function assetPlugin(config) { + registerCustomMime(); + let moduleGraph; + return { + name: 'vite:asset', + buildStart() { + assetCache.set(config, new Map()); + generatedAssets.set(config, new Map()); + }, + configureServer(server) { + moduleGraph = server.moduleGraph; + }, + resolveId(id) { + if (!config.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) { + return; + } + // imports to absolute urls pointing to files in /public + // will fail to resolve in the main resolver. handle them here. + const publicFile = checkPublicFile(id, config); + if (publicFile) { + return config.command === 'build' + ? `${viteBuildPublicIdPrefix}${id}` + : id; + } + }, + async load(id) { + if (id.startsWith(viteBuildPublicIdPrefix)) { + id = id.slice(viteBuildPublicIdPrefix.length); + } + if (id[0] === '\0') { + // Rollup convention, this id should be handled by the + // plugin that marked it with \0 + return; + } + // raw requests, read from disk + if (rawRE.test(id)) { + const file = checkPublicFile(id, config) || cleanUrl(id); + this.addWatchFile(file); + // raw query, read file and return as string + return `export default ${JSON.stringify(await fsp.readFile(file, 'utf-8'))}`; + } + if (!urlRE.test(id) && !config.assetsInclude(cleanUrl(id))) { + return; + } + id = removeUrlQuery(id); + let url = await fileToUrl$1(id, config, this); + // Inherit HMR timestamp if this asset was invalidated + if (moduleGraph) { + const mod = moduleGraph.getModuleById(id); + if (mod && mod.lastHMRTimestamp > 0) { + url = injectQuery(url, `t=${mod.lastHMRTimestamp}`); + } + } + return `export default ${JSON.stringify(url)}`; + }, + renderChunk(code, chunk, opts) { + const s = renderAssetUrlInJS(this, config, chunk, opts, code); + if (s) { + return { + code: s.toString(), + map: config.build.sourcemap + ? s.generateMap({ hires: 'boundary' }) + : null, + }; + } + else { + return null; + } + }, + generateBundle(_, bundle) { + // do not emit assets for SSR build + if (config.command === 'build' && + config.build.ssr && + !config.build.ssrEmitAssets) { + for (const file in bundle) { + if (bundle[file].type === 'asset' && + !file.endsWith('ssr-manifest.json') && + !jsSourceMapRE.test(file)) { + delete bundle[file]; + } + } + } + }, + }; +} +async function fileToUrl$1(id, config, ctx) { + if (config.command === 'serve') { + return fileToDevUrl(id, config); + } + else { + return fileToBuiltUrl(id, config, ctx); + } +} +function fileToDevUrl(id, config) { + let rtn; + if (checkPublicFile(id, config)) { + // in public dir during dev, keep the url as-is + rtn = id; + } + else if (id.startsWith(withTrailingSlash(config.root))) { + // in project root, infer short public path + rtn = '/' + path$o.posix.relative(config.root, id); + } + else { + // outside of project root, use absolute fs path + // (this is special handled by the serve static middleware + rtn = path$o.posix.join(FS_PREFIX, id); + } + const base = joinUrlSegments(config.server?.origin ?? '', config.base); + return joinUrlSegments(base, removeLeadingSlash(rtn)); +} +function getPublicAssetFilename(hash, config) { + return publicAssetUrlCache.get(config)?.get(hash); +} +const publicAssetUrlCache = new WeakMap(); +const publicAssetUrlRE = /__VITE_PUBLIC_ASSET__([a-z\d]{8})__/g; +function publicFileToBuiltUrl(url, config) { + if (config.command !== 'build') { + // We don't need relative base or renderBuiltUrl support during dev + return joinUrlSegments(config.base, url); + } + const hash = getHash(url); + let cache = publicAssetUrlCache.get(config); + if (!cache) { + cache = new Map(); + publicAssetUrlCache.set(config, cache); + } + if (!cache.get(hash)) { + cache.set(hash, url); + } + return `__VITE_PUBLIC_ASSET__${hash}__`; +} +const GIT_LFS_PREFIX = Buffer$1.from('version https://git-lfs.github.com'); +function isGitLfsPlaceholder(content) { + if (content.length < GIT_LFS_PREFIX.length) + return false; + // Check whether the content begins with the characteristic string of Git LFS placeholders + return GIT_LFS_PREFIX.compare(content, 0, GIT_LFS_PREFIX.length) === 0; +} +/** + * Register an asset to be emitted as part of the bundle (if necessary) + * and returns the resolved public URL + */ +async function fileToBuiltUrl(id, config, pluginContext, skipPublicCheck = false, forceInline) { + if (!skipPublicCheck && checkPublicFile(id, config)) { + return publicFileToBuiltUrl(id, config); + } + const cache = assetCache.get(config); + const cached = cache.get(id); + if (cached) { + return cached; + } + const file = cleanUrl(id); + const content = await fsp.readFile(file); + let url; + if (shouldInline(config, file, id, content, forceInline)) { + if (config.build.lib && isGitLfsPlaceholder(content)) { + config.logger.warn(colors$1.yellow(`Inlined file ${id} was not downloaded via Git LFS`)); + } + if (file.endsWith('.svg')) { + url = svgToDataURL(content); + } + else { + const mimeType = lookup(file) ?? 'application/octet-stream'; + // base64 inlined as a string + url = `data:${mimeType};base64,${content.toString('base64')}`; + } + } + else { + // emit as asset + const { search, hash } = parse$i(id); + const postfix = (search || '') + (hash || ''); + const referenceId = pluginContext.emitFile({ + // Ignore directory structure for asset file names + name: path$o.basename(file), + type: 'asset', + source: content, + }); + const originalName = normalizePath$3(path$o.relative(config.root, file)); + generatedAssets.get(config).set(referenceId, { originalName }); + url = `__VITE_ASSET__${referenceId}__${postfix ? `$_${postfix}__` : ``}`; // TODO_BASE + } + cache.set(id, url); + return url; +} +async function urlToBuiltUrl(url, importer, config, pluginContext, forceInline) { + if (checkPublicFile(url, config)) { + return publicFileToBuiltUrl(url, config); + } + const file = url[0] === '/' + ? path$o.join(config.root, url) + : path$o.join(path$o.dirname(importer), url); + return fileToBuiltUrl(file, config, pluginContext, + // skip public check since we just did it above + true, forceInline); +} +const shouldInline = (config, file, id, content, forceInline) => { + if (config.build.lib) + return true; + if (forceInline !== undefined) + return forceInline; + let limit; + if (typeof config.build.assetsInlineLimit === 'function') { + const userShouldInline = config.build.assetsInlineLimit(file, content); + if (userShouldInline != null) + return userShouldInline; + limit = DEFAULT_ASSETS_INLINE_LIMIT; + } + else { + limit = Number(config.build.assetsInlineLimit); + } + if (file.endsWith('.html')) + return false; + // Don't inline SVG with fragments, as they are meant to be reused + if (file.endsWith('.svg') && id.includes('#')) + return false; + return content.length < limit && !isGitLfsPlaceholder(content); +}; +const nestedQuotesRE = /"[^"']*'[^"]*"|'[^'"]*"[^']*'/; +// Inspired by https://github.com/iconify/iconify/blob/main/packages/utils/src/svg/url.ts +function svgToDataURL(content) { + const stringContent = content.toString(); + // If the SVG contains some text or HTML, any transformation is unsafe, and given that double quotes would then + // need to be escaped, the gain to use a data URI would be ridiculous if not negative + if (stringContent.includes('\s+<') + .replaceAll('"', "'") + .replaceAll('%', '%25') + .replaceAll('#', '%23') + .replaceAll('<', '%3c') + .replaceAll('>', '%3e') + // Spaces are not valid in srcset it has some use cases + // it can make the uncompressed URI slightly higher than base64, but will compress way better + // https://github.com/vitejs/vite/pull/14643#issuecomment-1766288673 + .replaceAll(/\s+/g, '%20')); + } +} + +const endsWithJSRE = /\.[cm]?js$/; +function manifestPlugin(config) { + const manifest = {}; + let outputCount; + return { + name: 'vite:manifest', + buildStart() { + outputCount = 0; + }, + generateBundle({ format }, bundle) { + function getChunkName(chunk) { + return getChunkOriginalFileName(chunk, config.root, format); + } + function getInternalImports(imports) { + const filteredImports = []; + for (const file of imports) { + if (bundle[file] === undefined) { + continue; + } + filteredImports.push(getChunkName(bundle[file])); + } + return filteredImports; + } + function createChunk(chunk) { + const manifestChunk = { + file: chunk.fileName, + }; + if (chunk.facadeModuleId) { + manifestChunk.src = getChunkName(chunk); + } + if (chunk.isEntry) { + manifestChunk.isEntry = true; + } + if (chunk.isDynamicEntry) { + manifestChunk.isDynamicEntry = true; + } + if (chunk.imports.length) { + const internalImports = getInternalImports(chunk.imports); + if (internalImports.length > 0) { + manifestChunk.imports = internalImports; + } + } + if (chunk.dynamicImports.length) { + const internalImports = getInternalImports(chunk.dynamicImports); + if (internalImports.length > 0) { + manifestChunk.dynamicImports = internalImports; + } + } + if (chunk.viteMetadata?.importedCss.size) { + manifestChunk.css = [...chunk.viteMetadata.importedCss]; + } + if (chunk.viteMetadata?.importedAssets.size) { + manifestChunk.assets = [...chunk.viteMetadata.importedAssets]; + } + return manifestChunk; + } + function createAsset(asset, src, isEntry) { + const manifestChunk = { + file: asset.fileName, + src, + }; + if (isEntry) + manifestChunk.isEntry = true; + return manifestChunk; + } + const fileNameToAssetMeta = new Map(); + const assets = generatedAssets.get(config); + assets.forEach((asset, referenceId) => { + try { + const fileName = this.getFileName(referenceId); + fileNameToAssetMeta.set(fileName, asset); + } + catch (error) { + // The asset was generated as part of a different output option. + // It was already handled during the previous run of this plugin. + assets.delete(referenceId); + } + }); + const fileNameToAsset = new Map(); + for (const file in bundle) { + const chunk = bundle[file]; + if (chunk.type === 'chunk') { + manifest[getChunkName(chunk)] = createChunk(chunk); + } + else if (chunk.type === 'asset' && typeof chunk.name === 'string') { + // Add every unique asset to the manifest, keyed by its original name + const assetMeta = fileNameToAssetMeta.get(chunk.fileName); + const src = assetMeta?.originalName ?? chunk.name; + const asset = createAsset(chunk, src, assetMeta?.isEntry); + // If JS chunk and asset chunk are both generated from the same source file, + // prioritize JS chunk as it contains more information + const file = manifest[src]?.file; + if (file && endsWithJSRE.test(file)) + continue; + manifest[src] = asset; + fileNameToAsset.set(chunk.fileName, asset); + } + } + // Add deduplicated assets to the manifest + assets.forEach(({ originalName }, referenceId) => { + if (!manifest[originalName]) { + const fileName = this.getFileName(referenceId); + const asset = fileNameToAsset.get(fileName); + if (asset) { + manifest[originalName] = asset; + } + } + }); + outputCount++; + const output = config.build.rollupOptions?.output; + const outputLength = Array.isArray(output) ? output.length : 1; + if (outputCount >= outputLength) { + this.emitFile({ + fileName: typeof config.build.manifest === 'string' + ? config.build.manifest + : '.vite/manifest.json', + type: 'asset', + source: JSON.stringify(sortObjectKeys(manifest), undefined, 2), + }); + } + }, + }; +} +function getChunkOriginalFileName(chunk, root, format) { + if (chunk.facadeModuleId) { + let name = normalizePath$3(path$o.relative(root, chunk.facadeModuleId)); + if (format === 'system' && !chunk.name.includes('-legacy')) { + const ext = path$o.extname(name); + const endPos = ext.length !== 0 ? -ext.length : undefined; + name = name.slice(0, endPos) + `-legacy` + ext; + } + return name.replace(/\0/g, ''); + } + else { + return `_` + path$o.basename(chunk.fileName); + } +} + +// This is based on @rollup/plugin-data-uri +// MIT Licensed https://github.com/rollup/plugins/blob/master/LICENSE +// ref https://github.com/vitejs/vite/issues/1428#issuecomment-757033808 +const dataUriRE = /^([^/]+\/[^;,]+)(;base64)?,([\s\S]*)$/; +const base64RE = /base64/i; +const dataUriPrefix = `\0/@data-uri/`; +/** + * Build only, since importing from a data URI works natively. + */ +function dataURIPlugin() { + let resolved; + return { + name: 'vite:data-uri', + buildStart() { + resolved = new Map(); + }, + resolveId(id) { + if (!dataUriRE.test(id)) { + return; + } + const uri = new URL$3(id); + if (uri.protocol !== 'data:') { + return; + } + const match = uri.pathname.match(dataUriRE); + if (!match) { + return; + } + const [, mime, format, data] = match; + if (mime !== 'text/javascript') { + throw new Error(`data URI with non-JavaScript mime type is not supported. If you're using legacy JavaScript MIME types (such as 'application/javascript'), please use 'text/javascript' instead.`); + } + // decode data + const base64 = format && base64RE.test(format.substring(1)); + const content = base64 + ? Buffer.from(data, 'base64').toString('utf-8') + : data; + resolved.set(id, content); + return dataUriPrefix + id; + }, + load(id) { + if (id.startsWith(dataUriPrefix)) { + return resolved.get(id.slice(dataUriPrefix.length)); + } + }, + }; +} + +/* es-module-lexer 1.4.1 */ +const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$e(E,g="@"){if(!C)return init.then((()=>parse$e(E)));const I=E.length+1,k=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;k>0&&C.memory.grow(Math.ceil(k/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const o=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),k=C.se();let K;C.ip()&&(K=w(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),o.push({n:K,s:A,e:Q,ss:I,se:k,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),k=I[0],K=B<0?void 0:E.slice(B,g),o=K?K[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===k||"'"===k?w(I):I,ln:'"'===o||"'"===o?w(K):K});}function w(A){try{return (0, eval)(A)}catch(A){}}return [o,D,!!C.f(),!!C.ms()]}function Q(A,Q){const B=A.length;let C=0;for(;C>>8;}}function B(A,Q){const B=A.length;let C=0;for(;CA.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E; + +var convertSourceMap$1 = {}; + +(function (exports) { + + Object.defineProperty(exports, 'commentRegex', { + get: function getCommentRegex () { + // Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data. + return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg; + } + }); + + + Object.defineProperty(exports, 'mapFileCommentRegex', { + get: function getMapFileCommentRegex () { + // Matches sourceMappingURL in either // or /* comment styles. + return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg; + } + }); + + var decodeBase64; + if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + decodeBase64 = decodeBase64WithBufferFrom; + } else { + decodeBase64 = decodeBase64WithNewBuffer; + } + } else { + decodeBase64 = decodeBase64WithAtob; + } + + function decodeBase64WithBufferFrom(base64) { + return Buffer.from(base64, 'base64').toString(); + } + + function decodeBase64WithNewBuffer(base64) { + if (typeof value === 'number') { + throw new TypeError('The value to decode must not be of type number.'); + } + return new Buffer(base64, 'base64').toString(); + } + + function decodeBase64WithAtob(base64) { + return decodeURIComponent(escape(atob(base64))); + } + + function stripComment(sm) { + return sm.split(',').pop(); + } + + function readFromFileMap(sm, read) { + var r = exports.mapFileCommentRegex.exec(sm); + // for some odd reason //# .. captures in 1 and /* .. */ in 2 + var filename = r[1] || r[2]; + + try { + var sm = read(filename); + if (sm != null && typeof sm.catch === 'function') { + return sm.catch(throwError); + } else { + return sm; + } + } catch (e) { + throwError(e); + } + + function throwError(e) { + throw new Error('An error occurred while trying to read the map file at ' + filename + '\n' + e.stack); + } + } + + function Converter (sm, opts) { + opts = opts || {}; + + if (opts.hasComment) { + sm = stripComment(sm); + } + + if (opts.encoding === 'base64') { + sm = decodeBase64(sm); + } else if (opts.encoding === 'uri') { + sm = decodeURIComponent(sm); + } + + if (opts.isJSON || opts.encoding) { + sm = JSON.parse(sm); + } + + this.sourcemap = sm; + } + + Converter.prototype.toJSON = function (space) { + return JSON.stringify(this.sourcemap, null, space); + }; + + if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + Converter.prototype.toBase64 = encodeBase64WithBufferFrom; + } else { + Converter.prototype.toBase64 = encodeBase64WithNewBuffer; + } + } else { + Converter.prototype.toBase64 = encodeBase64WithBtoa; + } + + function encodeBase64WithBufferFrom() { + var json = this.toJSON(); + return Buffer.from(json, 'utf8').toString('base64'); + } + + function encodeBase64WithNewBuffer() { + var json = this.toJSON(); + if (typeof json === 'number') { + throw new TypeError('The json to encode must not be of type number.'); + } + return new Buffer(json, 'utf8').toString('base64'); + } + + function encodeBase64WithBtoa() { + var json = this.toJSON(); + return btoa(unescape(encodeURIComponent(json))); + } + + Converter.prototype.toURI = function () { + var json = this.toJSON(); + return encodeURIComponent(json); + }; + + Converter.prototype.toComment = function (options) { + var encoding, content, data; + if (options != null && options.encoding === 'uri') { + encoding = ''; + content = this.toURI(); + } else { + encoding = ';base64'; + content = this.toBase64(); + } + data = 'sourceMappingURL=data:application/json;charset=utf-8' + encoding + ',' + content; + return options != null && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; + }; + + // returns copy instead of original + Converter.prototype.toObject = function () { + return JSON.parse(this.toJSON()); + }; + + Converter.prototype.addProperty = function (key, value) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead'); + return this.setProperty(key, value); + }; + + Converter.prototype.setProperty = function (key, value) { + this.sourcemap[key] = value; + return this; + }; + + Converter.prototype.getProperty = function (key) { + return this.sourcemap[key]; + }; + + exports.fromObject = function (obj) { + return new Converter(obj); + }; + + exports.fromJSON = function (json) { + return new Converter(json, { isJSON: true }); + }; + + exports.fromURI = function (uri) { + return new Converter(uri, { encoding: 'uri' }); + }; + + exports.fromBase64 = function (base64) { + return new Converter(base64, { encoding: 'base64' }); + }; + + exports.fromComment = function (comment) { + var m, encoding; + comment = comment + .replace(/^\/\*/g, '//') + .replace(/\*\/$/g, ''); + m = exports.commentRegex.exec(comment); + encoding = m && m[4] || 'uri'; + return new Converter(comment, { encoding: encoding, hasComment: true }); + }; + + function makeConverter(sm) { + return new Converter(sm, { isJSON: true }); + } + + exports.fromMapFileComment = function (comment, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileComment`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + + var sm = readFromFileMap(comment, read); + if (sm != null && typeof sm.then === 'function') { + return sm.then(makeConverter); + } else { + return makeConverter(sm); + } + }; + + // Finds last sourcemap comment in file or returns null if none was found + exports.fromSource = function (content) { + var m = content.match(exports.commentRegex); + return m ? exports.fromComment(m.pop()) : null; + }; + + // Finds last sourcemap comment in file or returns null if none was found + exports.fromMapFileSource = function (content, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileSource`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + var m = content.match(exports.mapFileCommentRegex); + return m ? exports.fromMapFileComment(m.pop(), read) : null; + }; + + exports.removeComments = function (src) { + return src.replace(exports.commentRegex, ''); + }; + + exports.removeMapFileComments = function (src) { + return src.replace(exports.mapFileCommentRegex, ''); + }; + + exports.generateMapFileComment = function (file, options) { + var data = 'sourceMappingURL=' + file; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; + }; +} (convertSourceMap$1)); + +var convertSourceMap = /*@__PURE__*/getDefaultExportFromCjs(convertSourceMap$1); + +const debug$g = createDebugger('vite:sourcemap', { + onlyWhenFocused: true, +}); +// Virtual modules should be prefixed with a null byte to avoid a +// false positive "missing source" warning. We also check for certain +// prefixes used for special handling in esbuildDepPlugin. +const virtualSourceRE = /^(?:dep:|browser-external:|virtual:)|\0/; +async function computeSourceRoute(map, file) { + let sourceRoot; + try { + // The source root is undefined for virtual modules and permission errors. + sourceRoot = await fsp.realpath(path$o.resolve(path$o.dirname(file), map.sourceRoot || '')); + } + catch { } + return sourceRoot; +} +async function injectSourcesContent(map, file, logger) { + let sourceRootPromise; + const missingSources = []; + const sourcesContent = map.sourcesContent || []; + const sourcesContentPromises = []; + for (let index = 0; index < map.sources.length; index++) { + const sourcePath = map.sources[index]; + if (!sourcesContent[index] && + sourcePath && + !virtualSourceRE.test(sourcePath)) { + sourcesContentPromises.push((async () => { + // inject content from source file when sourcesContent is null + sourceRootPromise ??= computeSourceRoute(map, file); + const sourceRoot = await sourceRootPromise; + let resolvedSourcePath = decodeURI(sourcePath); + if (sourceRoot) { + resolvedSourcePath = path$o.resolve(sourceRoot, resolvedSourcePath); + } + sourcesContent[index] = await fsp + .readFile(resolvedSourcePath, 'utf-8') + .catch(() => { + missingSources.push(resolvedSourcePath); + return null; + }); + })()); + } + } + await Promise.all(sourcesContentPromises); + map.sourcesContent = sourcesContent; + // Use this command… + // DEBUG="vite:sourcemap" vite build + // …to log the missing sources. + if (missingSources.length) { + logger.warnOnce(`Sourcemap for "${file}" points to missing source files`); + debug$g?.(`Missing sources:\n ` + missingSources.join(`\n `)); + } +} +function genSourceMapUrl(map) { + if (typeof map !== 'string') { + map = JSON.stringify(map); + } + return `data:application/json;base64,${Buffer.from(map).toString('base64')}`; +} +function getCodeWithSourcemap(type, code, map) { + if (debug$g) { + code += `\n/*${JSON.stringify(map, null, 2).replace(/\*\//g, '*\\/')}*/\n`; + } + if (type === 'js') { + code += `\n//# sourceMappingURL=${genSourceMapUrl(map)}`; + } + else if (type === 'css') { + code += `\n/*# sourceMappingURL=${genSourceMapUrl(map)} */`; + } + return code; +} +function applySourcemapIgnoreList(map, sourcemapPath, sourcemapIgnoreList, logger) { + let { x_google_ignoreList } = map; + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + for (let sourcesIndex = 0; sourcesIndex < map.sources.length; ++sourcesIndex) { + const sourcePath = map.sources[sourcesIndex]; + if (!sourcePath) + continue; + const ignoreList = sourcemapIgnoreList(path$o.isAbsolute(sourcePath) + ? sourcePath + : path$o.resolve(path$o.dirname(sourcemapPath), sourcePath), sourcemapPath); + if (logger && typeof ignoreList !== 'boolean') { + logger.warn('sourcemapIgnoreList function must return a boolean.'); + } + if (ignoreList && !x_google_ignoreList.includes(sourcesIndex)) { + x_google_ignoreList.push(sourcesIndex); + } + } + if (x_google_ignoreList.length > 0) { + if (!map.x_google_ignoreList) + map.x_google_ignoreList = x_google_ignoreList; + } +} + +var tasks = {}; + +var utils$g = {}; + +var array$1 = {}; + +Object.defineProperty(array$1, "__esModule", { value: true }); +array$1.splitWhen = array$1.flatten = void 0; +function flatten$1(items) { + return items.reduce((collection, item) => [].concat(collection, item), []); +} +array$1.flatten = flatten$1; +function splitWhen(items, predicate) { + const result = [[]]; + let groupIndex = 0; + for (const item of items) { + if (predicate(item)) { + groupIndex++; + result[groupIndex] = []; + } + else { + result[groupIndex].push(item); + } + } + return result; +} +array$1.splitWhen = splitWhen; + +var errno$1 = {}; + +Object.defineProperty(errno$1, "__esModule", { value: true }); +errno$1.isEnoentCodeError = void 0; +function isEnoentCodeError(error) { + return error.code === 'ENOENT'; +} +errno$1.isEnoentCodeError = isEnoentCodeError; + +var fs$h = {}; + +Object.defineProperty(fs$h, "__esModule", { value: true }); +fs$h.createDirentFromStats = void 0; +let DirentFromStats$1 = class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +}; +function createDirentFromStats$1(name, stats) { + return new DirentFromStats$1(name, stats); +} +fs$h.createDirentFromStats = createDirentFromStats$1; + +var path$h = {}; + +Object.defineProperty(path$h, "__esModule", { value: true }); +path$h.convertPosixPathToPattern = path$h.convertWindowsPathToPattern = path$h.convertPathToPattern = path$h.escapePosixPath = path$h.escapeWindowsPath = path$h.escape = path$h.removeLeadingDotSegment = path$h.makeAbsolute = path$h.unixify = void 0; +const os$3 = require$$2; +const path$g = require$$0$4; +const IS_WINDOWS_PLATFORM = os$3.platform() === 'win32'; +const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ +/** + * All non-escaped special characters. + * Posix: ()*?[]{|}, !+@ before (, ! at the beginning, \\ before non-special characters. + * Windows: (){}[], !+@ before (, ! at the beginning. + */ +const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; +const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g; +/** + * The device path (\\.\ or \\?\). + * https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths + */ +const DOS_DEVICE_PATH_RE = /^\\\\([.?])/; +/** + * All backslashes except those escaping special characters. + * Windows: !()+@{} + * https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions + */ +const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g; +/** + * Designed to work only with simple paths: `dir\\file`. + */ +function unixify(filepath) { + return filepath.replace(/\\/g, '/'); +} +path$h.unixify = unixify; +function makeAbsolute(cwd, filepath) { + return path$g.resolve(cwd, filepath); +} +path$h.makeAbsolute = makeAbsolute; +function removeLeadingDotSegment(entry) { + // We do not use `startsWith` because this is 10x slower than current implementation for some cases. + // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with + if (entry.charAt(0) === '.') { + const secondCharactery = entry.charAt(1); + if (secondCharactery === '/' || secondCharactery === '\\') { + return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); + } + } + return entry; +} +path$h.removeLeadingDotSegment = removeLeadingDotSegment; +path$h.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; +function escapeWindowsPath(pattern) { + return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); +} +path$h.escapeWindowsPath = escapeWindowsPath; +function escapePosixPath(pattern) { + return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); +} +path$h.escapePosixPath = escapePosixPath; +path$h.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; +function convertWindowsPathToPattern(filepath) { + return escapeWindowsPath(filepath) + .replace(DOS_DEVICE_PATH_RE, '//$1') + .replace(WINDOWS_BACKSLASHES_RE, '/'); +} +path$h.convertWindowsPathToPattern = convertWindowsPathToPattern; +function convertPosixPathToPattern(filepath) { + return escapePosixPath(filepath); +} +path$h.convertPosixPathToPattern = convertPosixPathToPattern; + +var pattern$1 = {}; + +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob$1 = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; + +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = isExtglob$1; +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var isGlob$2 = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); +}; + +var isGlob$1 = isGlob$2; +var pathPosixDirname = require$$0$4.posix.dirname; +var isWin32 = require$$2.platform() === 'win32'; + +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ +var globParent$2 = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob$1(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; + +var utils$f = {}; + +(function (exports) { + + exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; + }; + + /** + * Find a node of the given type + */ + + exports.find = (node, type) => node.nodes.find(node => node.type === type); + + /** + * Find a node of the given type + */ + + exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; + }; + + /** + * Escape the given node with '\\' before node.value + */ + + exports.escapeNode = (block, n = 0, type) => { + let node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } + }; + + /** + * Returns true if the given brace node should be enclosed in literal braces + */ + + exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a brace node is invalid. + */ + + exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a node is an open or close node + */ + + exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; + }; + + /** + * Reduce an array of text nodes. + */ + + exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; + }, []); + + /** + * Flatten an array + */ + + exports.flatten = (...args) => { + const result = []; + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + let ele = arr[i]; + Array.isArray(ele) ? flat(ele) : ele !== void 0 && result.push(ele); + } + return result; + }; + flat(args); + return result; + }; +} (utils$f)); + +const utils$e = utils$f; + +var stringify$7 = (ast, options = {}) => { + let stringify = (node, parent = {}) => { + let invalidBlock = options.escapeInvalid && utils$e.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; + + if (node.value) { + if ((invalidBlock || invalidNode) && utils$e.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } + + if (node.value) { + return node.value; + } + + if (node.nodes) { + for (let child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); +}; + +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ + +var isNumber$2 = function(num) { + if (typeof num === 'number') { + return num - num === 0; + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; +}; + +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + +const isNumber$1 = isNumber$2; + +const toRegexRange$1 = (min, max, options) => { + if (isNumber$1(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); + } + + if (max === void 0 || min === max) { + return String(min); + } + + if (isNumber$1(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); + } + + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; + } + + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + + if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) { + return toRegexRange$1.cache[cacheKey].result; + } + + let a = Math.min(min, max); + let b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives); + + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; + } + + toRegexRange$1.cache[cacheKey] = state; + return state.result; +}; + +function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false) || []; + let onlyPositive = filterPatterns(pos, neg, '', false) || []; + let intersected = filterPatterns(neg, pos, '-?', true) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); +} + +function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops = [...stops]; + stops.sort(compare); + return stops; +} + +/** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + +function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; + + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit); + + } else { + count++; + } + } + + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } + + return { pattern, count: [count], digits }; +} + +function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(max, tok, options); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } + + return tokens; +} + +function filterPatterns(arr, comparison, prefix, intersection, options) { + let result = []; + + for (let ele of arr) { + let { string } = ele; + + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } + + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); + } + } + return result; +} + +/** + * Zip strings + */ + +function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; +} + +function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; +} + +function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); +} + +function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); +} + +function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); +} + +function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; +} + +function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; +} + +function hasPadding(str) { + return /^-?(0+)\d/.test(str); +} + +function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } + + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; + + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } +} + +/** + * Cache + */ + +toRegexRange$1.cache = {}; +toRegexRange$1.clearCache = () => (toRegexRange$1.cache = {}); + +/** + * Expose `toRegexRange` + */ + +var toRegexRange_1 = toRegexRange$1; + +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + +const util$1 = require$$0$6; +const toRegexRange = toRegexRange_1; + +const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + +const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); +}; + +const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); +}; + +const isNumber = num => Number.isInteger(+num); + +const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; +}; + +const stringify$6 = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; + } + return options.stringify === true; +}; + +const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); + } + if (toNumber === false) { + return String(input); + } + return input; +}; + +const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; +}; + +const toSequence = (parts, options) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; + + if (parts.positives.length) { + positives = parts.positives.join('|'); + } + + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.join('|')})`; + } + + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } + + if (options.wrap) { + return `(${prefix}${result})`; + } + + return result; +}; + +const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); + } + + let start = String.fromCharCode(a); + if (a === b) return start; + + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; +}; + +const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); + } + return toRegexRange(start, end, options); +}; + +const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util$1.inspect(...args)); +}; + +const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; +}; + +const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; +}; + +const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); + + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } + + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; + + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); + + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify$6(start, end, options) === false; + let format = options.transform || transform(toNumber); + + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + } + + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options) + : toRegex(range, null, { wrap: false, ...options }); + } + + return range; +}; + +const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } + + + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); + + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } + + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } + + return range; +}; + +const fill$2 = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); + } + + if (typeof step === 'function') { + return fill$2(start, end, 1, { transform: step }); + } + + if (isObject(step)) { + return fill$2(start, end, 0, step); + } + + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill$2(start, end, 1, step); + } + + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); +}; + +var fillRange = fill$2; + +const fill$1 = fillRange; +const utils$d = utils$f; + +const compile$1 = (ast, options = {}) => { + let walk = (node, parent = {}) => { + let invalidBlock = utils$d.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let invalid = invalidBlock === true || invalidNode === true; + let prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + if (node.isClose === true) { + return prefix + node.value; + } + + if (node.type === 'open') { + return invalid ? (prefix + node.value) : '('; + } + + if (node.type === 'close') { + return invalid ? (prefix + node.value) : ')'; + } + + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); + } + + if (node.value) { + return node.value; + } + + if (node.nodes && node.ranges > 0) { + let args = utils$d.reduce(node.nodes); + let range = fill$1(...args, { ...options, wrap: false, toRegex: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (let child of node.nodes) { + output += walk(child, node); + } + } + return output; + }; + + return walk(ast); +}; + +var compile_1 = compile$1; + +const fill = fillRange; +const stringify$5 = stringify$7; +const utils$c = utils$f; + +const append$1 = (queue = '', stash = '', enclose = false) => { + let result = []; + + queue = [].concat(queue); + stash = [].concat(stash); + + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils$c.flatten(stash).map(ele => `{${ele}}`) : stash; + } + + for (let item of queue) { + if (Array.isArray(item)) { + for (let value of item) { + result.push(append$1(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append$1(item, ele, enclose) : (item + ele)); + } + } + } + return utils$c.flatten(result); +}; + +const expand$2 = (ast, options = {}) => { + let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; + + let walk = (node, parent = {}) => { + node.queue = []; + + let p = parent; + let q = parent.queue; + + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } + + if (node.invalid || node.dollar) { + q.push(append$1(q.pop(), stringify$5(node, options))); + return; + } + + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append$1(q.pop(), ['{}'])); + return; + } + + if (node.nodes && node.ranges > 0) { + let args = utils$c.reduce(node.nodes); + + if (utils$c.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } + + let range = fill(...args, options); + if (range.length === 0) { + range = stringify$5(node, options); + } + + q.push(append$1(q.pop(), range)); + node.nodes = []; + return; + } + + let enclose = utils$c.encloseBrace(node); + let queue = node.queue; + let block = node; + + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } + + for (let i = 0; i < node.nodes.length; i++) { + let child = node.nodes[i]; + + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } + + if (child.type === 'close') { + q.push(append$1(q.pop(), queue, enclose)); + continue; + } + + if (child.value && child.type !== 'open') { + queue.push(append$1(queue.pop(), child.value)); + continue; + } + + if (child.nodes) { + walk(child, node); + } + } + + return queue; + }; + + return utils$c.flatten(walk(ast)); +}; + +var expand_1$1 = expand$2; + +var constants$3 = { + MAX_LENGTH: 1024 * 64, + + // Digits + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ + + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ + + CHAR_ASTERISK: '*', /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ +}; + +const stringify$4 = stringify$7; + +/** + * Constants + */ + +const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE +} = constants$3; + +/** + * parse + */ + +const parse$d = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + let opts = options || {}; + let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + let ast = { type: 'root', input, nodes: [] }; + let stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + let length = input.length; + let index = 0; + let depth = 0; + let value; + + /** + * Helpers + */ + + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } + + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + + push({ type: 'bos' }); + + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); + + /** + * Invalid chars + */ + + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + + /** + * Escaped chars + */ + + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } + + /** + * Right square bracket (literal): ']' + */ + + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } + + /** + * Left square bracket: '[' + */ + + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + let next; + + while (index < length && (next = advance())) { + value += next; + + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + + if (brackets === 0) { + break; + } + } + } + + push({ type: 'text', value }); + continue; + } + + /** + * Parentheses + */ + + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } + + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } + + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + let open = value; + let next; + + if (options.keepQuotes !== true) { + value = ''; + } + + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + + value += next; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Left curly brace: '{' + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + + let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + let brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } + + /** + * Right curly brace: '}' + */ + + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } + + let type = 'close'; + block = stack.pop(); + block.close = true; + + push({ type, value }); + depth--; + + block = stack[stack.length - 1]; + continue; + } + + /** + * Comma: ',' + */ + + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + let open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify$4(block) }]; + } + + push({ type: 'comma', value }); + block.commas++; + continue; + } + + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + let siblings = block.nodes; + + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } + + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; + + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } + + block.ranges++; + block.args = []; + continue; + } + + if (prev.type === 'range') { + siblings.pop(); + + let before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + + push({ type: 'dot', value }); + continue; + } + + /** + * Text + */ + + push({ type: 'text', value }); + } + + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); + + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + + // get the location of the block on parent.nodes (block's siblings) + let parent = stack[stack.length - 1]; + let index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + + push({ type: 'eos' }); + return ast; +}; + +var parse_1$2 = parse$d; + +const stringify$3 = stringify$7; +const compile = compile_1; +const expand$1 = expand_1$1; +const parse$c = parse_1$2; + +/** + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + +const braces$2 = (input, options = {}) => { + let output = []; + + if (Array.isArray(input)) { + for (let pattern of input) { + let result = braces$2.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces$2.create(input, options)); + } + + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; + } + return output; +}; + +/** + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public + */ + +braces$2.parse = (input, options = {}) => parse$c(input, options); + +/** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces$2.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify$3(braces$2.parse(input, options), options); + } + return stringify$3(input, options); +}; + +/** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. + * + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces$2.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces$2.parse(input, options); + } + return compile(input, options); +}; + +/** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. + * + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces$2.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces$2.parse(input, options); + } + + let result = expand$1(input, options); + + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); + } + + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; + } + + return result; +}; + +/** + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces$2.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } + + return options.expand !== true + ? braces$2.compile(input, options) + : braces$2.expand(input, options); +}; + +/** + * Expose "braces" + */ + +var braces_1 = braces$2; + +const util = require$$0$6; +const braces$1 = braces_1; +const picomatch$2 = picomatch$3; +const utils$b = utils$k; +const isEmptyString = val => val === '' || val === './'; + +/** + * Returns an array of strings that match one or more glob patterns. + * + * ```js + * const mm = require('micromatch'); + * // mm(list, patterns[, options]); + * + * console.log(mm(['a.js', 'a.txt'], ['*.js'])); + * //=> [ 'a.js' ] + * ``` + * @param {String|Array} `list` List of strings to match. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) + * @return {Array} Returns an array of matches + * @summary false + * @api public + */ + +const micromatch$1 = (list, patterns, options) => { + patterns = [].concat(patterns); + list = [].concat(list); + + let omit = new Set(); + let keep = new Set(); + let items = new Set(); + let negatives = 0; + + let onResult = state => { + items.add(state.output); + if (options && options.onResult) { + options.onResult(state); + } + }; + + for (let i = 0; i < patterns.length; i++) { + let isMatch = picomatch$2(String(patterns[i]), { ...options, onResult }, true); + let negated = isMatch.state.negated || isMatch.state.negatedExtglob; + if (negated) negatives++; + + for (let item of list) { + let matched = isMatch(item, true); + + let match = negated ? !matched.isMatch : matched.isMatch; + if (!match) continue; + + if (negated) { + omit.add(matched.output); + } else { + omit.delete(matched.output); + keep.add(matched.output); + } + } + } + + let result = negatives === patterns.length ? [...items] : [...keep]; + let matches = result.filter(item => !omit.has(item)); + + if (options && matches.length === 0) { + if (options.failglob === true) { + throw new Error(`No matches found for "${patterns.join(', ')}"`); + } + + if (options.nonull === true || options.nullglob === true) { + return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; + } + } + + return matches; +}; + +/** + * Backwards compatibility + */ + +micromatch$1.match = micromatch$1; + +/** + * Returns a matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns + * true if the string is a match. + * + * ```js + * const mm = require('micromatch'); + * // mm.matcher(pattern[, options]); + * + * const isMatch = mm.matcher('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @param {String} `pattern` Glob pattern + * @param {Object} `options` + * @return {Function} Returns a matcher function. + * @api public + */ + +micromatch$1.matcher = (pattern, options) => picomatch$2(pattern, options); + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const mm = require('micromatch'); + * // mm.isMatch(string, patterns[, options]); + * + * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(mm.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `[options]` See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +micromatch$1.isMatch = (str, patterns, options) => picomatch$2(patterns, options)(str); + +/** + * Backwards compatibility + */ + +micromatch$1.any = micromatch$1.isMatch; + +/** + * Returns a list of strings that _**do not match any**_ of the given `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.not(list, patterns[, options]); + * + * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); + * //=> ['b.b', 'c.c'] + * ``` + * @param {Array} `list` Array of strings to match. + * @param {String|Array} `patterns` One or more glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of strings that **do not match** the given patterns. + * @api public + */ + +micromatch$1.not = (list, patterns, options = {}) => { + patterns = [].concat(patterns).map(String); + let result = new Set(); + let items = []; + + let onResult = state => { + if (options.onResult) options.onResult(state); + items.push(state.output); + }; + + let matches = new Set(micromatch$1(list, patterns, { ...options, onResult })); + + for (let item of items) { + if (!matches.has(item)) { + result.add(item); + } + } + return [...result]; +}; + +/** + * Returns true if the given `string` contains the given pattern. Similar + * to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * ```js + * var mm = require('micromatch'); + * // mm.contains(string, pattern[, options]); + * + * console.log(mm.contains('aa/bb/cc', '*b')); + * //=> true + * console.log(mm.contains('aa/bb/cc', '*d')); + * //=> false + * ``` + * @param {String} `str` The string to match. + * @param {String|Array} `patterns` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any of the patterns matches any part of `str`. + * @api public + */ + +micromatch$1.contains = (str, pattern, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); + } + + if (Array.isArray(pattern)) { + return pattern.some(p => micromatch$1.contains(str, p, options)); + } + + if (typeof pattern === 'string') { + if (isEmptyString(str) || isEmptyString(pattern)) { + return false; + } + + if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { + return true; + } + } + + return micromatch$1.isMatch(str, pattern, { ...options, contains: true }); +}; + +/** + * Filter the keys of the given object with the given `glob` pattern + * and `options`. Does not attempt to match nested keys. If you need this feature, + * use [glob-object][] instead. + * + * ```js + * const mm = require('micromatch'); + * // mm.matchKeys(object, patterns[, options]); + * + * const obj = { aa: 'a', ab: 'b', ac: 'c' }; + * console.log(mm.matchKeys(obj, '*b')); + * //=> { ab: 'b' } + * ``` + * @param {Object} `object` The object with keys to filter. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Object} Returns an object with only keys that match the given patterns. + * @api public + */ + +micromatch$1.matchKeys = (obj, patterns, options) => { + if (!utils$b.isObject(obj)) { + throw new TypeError('Expected the first argument to be an object'); + } + let keys = micromatch$1(Object.keys(obj), patterns, options); + let res = {}; + for (let key of keys) res[key] = obj[key]; + return res; +}; + +/** + * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.some(list, patterns[, options]); + * + * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // true + * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list` + * @api public + */ + +micromatch$1.some = (list, patterns, options) => { + let items = [].concat(list); + + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch$2(String(pattern), options); + if (items.some(item => isMatch(item))) { + return true; + } + } + return false; +}; + +/** + * Returns true if every string in the given `list` matches + * any of the given glob `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.every(list, patterns[, options]); + * + * console.log(mm.every('foo.js', ['foo.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // false + * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list` + * @api public + */ + +micromatch$1.every = (list, patterns, options) => { + let items = [].concat(list); + + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch$2(String(pattern), options); + if (!items.every(item => isMatch(item))) { + return false; + } + } + return true; +}; + +/** + * Returns true if **all** of the given `patterns` match + * the specified string. + * + * ```js + * const mm = require('micromatch'); + * // mm.all(string, patterns[, options]); + * + * console.log(mm.all('foo.js', ['foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); + * // false + * + * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); + * // true + * ``` + * @param {String|Array} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +micromatch$1.all = (str, patterns, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); + } + + return [].concat(patterns).every(p => picomatch$2(p, options)(str)); +}; + +/** + * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. + * + * ```js + * const mm = require('micromatch'); + * // mm.capture(pattern, string[, options]); + * + * console.log(mm.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(mm.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `glob` Glob pattern to use for matching. + * @param {String} `input` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`. + * @api public + */ + +micromatch$1.capture = (glob, input, options) => { + let posix = utils$b.isWindows(options); + let regex = picomatch$2.makeRe(String(glob), { ...options, capture: true }); + let match = regex.exec(posix ? utils$b.toPosixSlashes(input) : input); + + if (match) { + return match.slice(1).map(v => v === void 0 ? '' : v); + } +}; + +/** + * Create a regular expression from the given glob `pattern`. + * + * ```js + * const mm = require('micromatch'); + * // mm.makeRe(pattern[, options]); + * + * console.log(mm.makeRe('*.js')); + * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ + * ``` + * @param {String} `pattern` A glob pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +micromatch$1.makeRe = (...args) => picomatch$2.makeRe(...args); + +/** + * Scan a glob pattern to separate the pattern into segments. Used + * by the [split](#split) method. + * + * ```js + * const mm = require('micromatch'); + * const state = mm.scan(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +micromatch$1.scan = (...args) => picomatch$2.scan(...args); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const mm = require('micromatch'); + * const state = mm.parse(pattern[, options]); + * ``` + * @param {String} `glob` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as regex source string. + * @api public + */ + +micromatch$1.parse = (patterns, options) => { + let res = []; + for (let pattern of [].concat(patterns || [])) { + for (let str of braces$1(String(pattern), options)) { + res.push(picomatch$2.parse(str, options)); + } + } + return res; +}; + +/** + * Process the given brace `pattern`. + * + * ```js + * const { braces } = require('micromatch'); + * console.log(braces('foo/{a,b,c}/bar')); + * //=> [ 'foo/(a|b|c)/bar' ] + * + * console.log(braces('foo/{a,b,c}/bar', { expand: true })); + * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] + * ``` + * @param {String} `pattern` String with brace pattern to process. + * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. + * @return {Array} + * @api public + */ + +micromatch$1.braces = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { + return [pattern]; + } + return braces$1(pattern, options); +}; + +/** + * Expand braces + */ + +micromatch$1.braceExpand = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + return micromatch$1.braces(pattern, { ...options, expand: true }); +}; + +/** + * Expose micromatch + */ + +var micromatch_1 = micromatch$1; + +var micromatch$2 = /*@__PURE__*/getDefaultExportFromCjs(micromatch_1); + +Object.defineProperty(pattern$1, "__esModule", { value: true }); +pattern$1.removeDuplicateSlashes = pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0; +const path$f = require$$0$4; +const globParent$1 = globParent$2; +const micromatch = micromatch_1; +const GLOBSTAR$1 = '**'; +const ESCAPE_SYMBOL = '\\'; +const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; +const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; +const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; +const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; +const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; +/** + * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string. + * The latter is due to the presence of the device path at the beginning of the UNC path. + */ +const DOUBLE_SLASH_RE$1 = /(?!^)\/{2,}/g; +function isStaticPattern(pattern, options = {}) { + return !isDynamicPattern(pattern, options); +} +pattern$1.isStaticPattern = isStaticPattern; +function isDynamicPattern(pattern, options = {}) { + /** + * A special case with an empty string is necessary for matching patterns that start with a forward slash. + * An empty string cannot be a dynamic pattern. + * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. + */ + if (pattern === '') { + return false; + } + /** + * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check + * filepath directly (without read directory). + */ + if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { + return true; + } + if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { + return true; + } + return false; +} +pattern$1.isDynamicPattern = isDynamicPattern; +function hasBraceExpansion(pattern) { + const openingBraceIndex = pattern.indexOf('{'); + if (openingBraceIndex === -1) { + return false; + } + const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1); + if (closingBraceIndex === -1) { + return false; + } + const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); + return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); +} +function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; +} +pattern$1.convertToPositivePattern = convertToPositivePattern; +function convertToNegativePattern(pattern) { + return '!' + pattern; +} +pattern$1.convertToNegativePattern = convertToNegativePattern; +function isNegativePattern(pattern) { + return pattern.startsWith('!') && pattern[1] !== '('; +} +pattern$1.isNegativePattern = isNegativePattern; +function isPositivePattern(pattern) { + return !isNegativePattern(pattern); +} +pattern$1.isPositivePattern = isPositivePattern; +function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); +} +pattern$1.getNegativePatterns = getNegativePatterns; +function getPositivePatterns$1(patterns) { + return patterns.filter(isPositivePattern); +} +pattern$1.getPositivePatterns = getPositivePatterns$1; +/** + * Returns patterns that can be applied inside the current directory. + * + * @example + * // ['./*', '*', 'a/*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsInsideCurrentDirectory(patterns) { + return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); +} +pattern$1.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; +/** + * Returns patterns to be expanded relative to (outside) the current directory. + * + * @example + * // ['../*', './../*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsOutsideCurrentDirectory(patterns) { + return patterns.filter(isPatternRelatedToParentDirectory); +} +pattern$1.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; +function isPatternRelatedToParentDirectory(pattern) { + return pattern.startsWith('..') || pattern.startsWith('./..'); +} +pattern$1.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; +function getBaseDirectory(pattern) { + return globParent$1(pattern, { flipBackslashes: false }); +} +pattern$1.getBaseDirectory = getBaseDirectory; +function hasGlobStar(pattern) { + return pattern.includes(GLOBSTAR$1); +} +pattern$1.hasGlobStar = hasGlobStar; +function endsWithSlashGlobStar(pattern) { + return pattern.endsWith('/' + GLOBSTAR$1); +} +pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar; +function isAffectDepthOfReadingPattern(pattern) { + const basename = path$f.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); +} +pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; +function expandPatternsWithBraceExpansion(patterns) { + return patterns.reduce((collection, pattern) => { + return collection.concat(expandBraceExpansion(pattern)); + }, []); +} +pattern$1.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; +function expandBraceExpansion(pattern) { + const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true }); + /** + * Sort the patterns by length so that the same depth patterns are processed side by side. + * `a/{b,}/{c,}/*` – `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']` + */ + patterns.sort((a, b) => a.length - b.length); + /** + * Micromatch can return an empty string in the case of patterns like `{a,}`. + */ + return patterns.filter((pattern) => pattern !== ''); +} +pattern$1.expandBraceExpansion = expandBraceExpansion; +function getPatternParts(pattern, options) { + let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); + /** + * The scan method returns an empty array in some cases. + * See micromatch/picomatch#58 for more details. + */ + if (parts.length === 0) { + parts = [pattern]; + } + /** + * The scan method does not return an empty part for the pattern with a forward slash. + * This is another part of micromatch/picomatch#58. + */ + if (parts[0].startsWith('/')) { + parts[0] = parts[0].slice(1); + parts.unshift(''); + } + return parts; +} +pattern$1.getPatternParts = getPatternParts; +function makeRe(pattern, options) { + return micromatch.makeRe(pattern, options); +} +pattern$1.makeRe = makeRe; +function convertPatternsToRe(patterns, options) { + return patterns.map((pattern) => makeRe(pattern, options)); +} +pattern$1.convertPatternsToRe = convertPatternsToRe; +function matchAny(entry, patternsRe) { + return patternsRe.some((patternRe) => patternRe.test(entry)); +} +pattern$1.matchAny = matchAny; +/** + * This package only works with forward slashes as a path separator. + * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes. + */ +function removeDuplicateSlashes(pattern) { + return pattern.replace(DOUBLE_SLASH_RE$1, '/'); +} +pattern$1.removeDuplicateSlashes = removeDuplicateSlashes; + +var stream$4 = {}; + +/* + * merge2 + * https://github.com/teambition/merge2 + * + * Copyright (c) 2014-2020 Teambition + * Licensed under the MIT license. + */ +const Stream = require$$0$7; +const PassThrough = Stream.PassThrough; +const slice = Array.prototype.slice; + +var merge2_1 = merge2$1; + +function merge2$1 () { + const streamsQueue = []; + const args = slice.call(arguments); + let merging = false; + let options = args[args.length - 1]; + + if (options && !Array.isArray(options) && options.pipe == null) { + args.pop(); + } else { + options = {}; + } + + const doEnd = options.end !== false; + const doPipeError = options.pipeError === true; + if (options.objectMode == null) { + options.objectMode = true; + } + if (options.highWaterMark == null) { + options.highWaterMark = 64 * 1024; + } + const mergedStream = PassThrough(options); + + function addStream () { + for (let i = 0, len = arguments.length; i < len; i++) { + streamsQueue.push(pauseStreams(arguments[i], options)); + } + mergeStream(); + return this + } + + function mergeStream () { + if (merging) { + return + } + merging = true; + + let streams = streamsQueue.shift(); + if (!streams) { + process.nextTick(endStream); + return + } + if (!Array.isArray(streams)) { + streams = [streams]; + } + + let pipesCount = streams.length + 1; + + function next () { + if (--pipesCount > 0) { + return + } + merging = false; + mergeStream(); + } + + function pipe (stream) { + function onend () { + stream.removeListener('merge2UnpipeEnd', onend); + stream.removeListener('end', onend); + if (doPipeError) { + stream.removeListener('error', onerror); + } + next(); + } + function onerror (err) { + mergedStream.emit('error', err); + } + // skip ended stream + if (stream._readableState.endEmitted) { + return next() + } + + stream.on('merge2UnpipeEnd', onend); + stream.on('end', onend); + + if (doPipeError) { + stream.on('error', onerror); + } + + stream.pipe(mergedStream, { end: false }); + // compatible for old stream + stream.resume(); + } + + for (let i = 0; i < streams.length; i++) { + pipe(streams[i]); + } + + next(); + } + + function endStream () { + merging = false; + // emit 'queueDrain' when all streams merged. + mergedStream.emit('queueDrain'); + if (doEnd) { + mergedStream.end(); + } + } + + mergedStream.setMaxListeners(0); + mergedStream.add = addStream; + mergedStream.on('unpipe', function (stream) { + stream.emit('merge2UnpipeEnd'); + }); + + if (args.length) { + addStream.apply(null, args); + } + return mergedStream +} + +// check and pause streams for pipe. +function pauseStreams (streams, options) { + if (!Array.isArray(streams)) { + // Backwards-compat with old-style streams + if (!streams._readableState && streams.pipe) { + streams = streams.pipe(PassThrough(options)); + } + if (!streams._readableState || !streams.pause || !streams.pipe) { + throw new Error('Only readable stream can be merged.') + } + streams.pause(); + } else { + for (let i = 0, len = streams.length; i < len; i++) { + streams[i] = pauseStreams(streams[i], options); + } + } + return streams +} + +Object.defineProperty(stream$4, "__esModule", { value: true }); +stream$4.merge = void 0; +const merge2 = merge2_1; +function merge$1(streams) { + const mergedStream = merge2(streams); + streams.forEach((stream) => { + stream.once('error', (error) => mergedStream.emit('error', error)); + }); + mergedStream.once('close', () => propagateCloseEventToSources(streams)); + mergedStream.once('end', () => propagateCloseEventToSources(streams)); + return mergedStream; +} +stream$4.merge = merge$1; +function propagateCloseEventToSources(streams) { + streams.forEach((stream) => stream.emit('close')); +} + +var string$2 = {}; + +Object.defineProperty(string$2, "__esModule", { value: true }); +string$2.isEmpty = string$2.isString = void 0; +function isString(input) { + return typeof input === 'string'; +} +string$2.isString = isString; +function isEmpty$1(input) { + return input === ''; +} +string$2.isEmpty = isEmpty$1; + +Object.defineProperty(utils$g, "__esModule", { value: true }); +utils$g.string = utils$g.stream = utils$g.pattern = utils$g.path = utils$g.fs = utils$g.errno = utils$g.array = void 0; +const array = array$1; +utils$g.array = array; +const errno = errno$1; +utils$g.errno = errno; +const fs$g = fs$h; +utils$g.fs = fs$g; +const path$e = path$h; +utils$g.path = path$e; +const pattern = pattern$1; +utils$g.pattern = pattern; +const stream$3 = stream$4; +utils$g.stream = stream$3; +const string$1 = string$2; +utils$g.string = string$1; + +Object.defineProperty(tasks, "__esModule", { value: true }); +tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0; +const utils$a = utils$g; +function generate(input, settings) { + const patterns = processPatterns(input, settings); + const ignore = processPatterns(settings.ignore, settings); + const positivePatterns = getPositivePatterns(patterns); + const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); + const staticPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isStaticPattern(pattern, settings)); + const dynamicPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isDynamicPattern(pattern, settings)); + const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); + const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); + return staticTasks.concat(dynamicTasks); +} +tasks.generate = generate; +function processPatterns(input, settings) { + let patterns = input; + /** + * The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry + * and some problems with the micromatch package (see fast-glob issues: #365, #394). + * + * To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown + * in matching in the case of a large set of patterns after expansion. + */ + if (settings.braceExpansion) { + patterns = utils$a.pattern.expandPatternsWithBraceExpansion(patterns); + } + /** + * If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used + * at any nesting level. + * + * We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change + * the pattern in the filter before creating a regular expression. There is no need to change the patterns + * in the application. Only on the input. + */ + if (settings.baseNameMatch) { + patterns = patterns.map((pattern) => pattern.includes('/') ? pattern : `**/${pattern}`); + } + /** + * This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion. + */ + return patterns.map((pattern) => utils$a.pattern.removeDuplicateSlashes(pattern)); +} +/** + * Returns tasks grouped by basic pattern directories. + * + * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. + * This is necessary because directory traversal starts at the base directory and goes deeper. + */ +function convertPatternsToTasks(positive, negative, dynamic) { + const tasks = []; + const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive); + const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); + const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); + tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); + /* + * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory + * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. + */ + if ('.' in insideCurrentDirectoryGroup) { + tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); + } + else { + tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); + } + return tasks; +} +tasks.convertPatternsToTasks = convertPatternsToTasks; +function getPositivePatterns(patterns) { + return utils$a.pattern.getPositivePatterns(patterns); +} +tasks.getPositivePatterns = getPositivePatterns; +function getNegativePatternsAsPositive(patterns, ignore) { + const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils$a.pattern.convertToPositivePattern); + return positive; +} +tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive; +function groupPatternsByBaseDirectory(patterns) { + const group = {}; + return patterns.reduce((collection, pattern) => { + const base = utils$a.pattern.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } + else { + collection[base] = [pattern]; + } + return collection; + }, group); +} +tasks.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; +function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map((base) => { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); +} +tasks.convertPatternGroupsToTasks = convertPatternGroupsToTasks; +function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + dynamic, + positive, + negative, + base, + patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern)) + }; +} +tasks.convertPatternGroupToTask = convertPatternGroupToTask; + +var async$7 = {}; + +var async$6 = {}; + +var out$3 = {}; + +var async$5 = {}; + +var async$4 = {}; + +var out$2 = {}; + +var async$3 = {}; + +var out$1 = {}; + +var async$2 = {}; + +Object.defineProperty(async$2, "__esModule", { value: true }); +async$2.read = void 0; +function read$3(path, settings, callback) { + settings.fs.lstat(path, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback$2(callback, lstatError); + return; + } + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback$2(callback, lstat); + return; + } + settings.fs.stat(path, (statError, stat) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback$2(callback, statError); + return; + } + callSuccessCallback$2(callback, lstat); + return; + } + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + callSuccessCallback$2(callback, stat); + }); + }); +} +async$2.read = read$3; +function callFailureCallback$2(callback, error) { + callback(error); +} +function callSuccessCallback$2(callback, result) { + callback(null, result); +} + +var sync$8 = {}; + +Object.defineProperty(sync$8, "__esModule", { value: true }); +sync$8.read = void 0; +function read$2(path, settings) { + const lstat = settings.fs.lstatSync(path); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; + } + try { + const stat = settings.fs.statSync(path); + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + return stat; + } + catch (error) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; + } + throw error; + } +} +sync$8.read = read$2; + +var settings$3 = {}; + +var fs$f = {}; + +(function (exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + const fs = require$$0__default; + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync + }; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); + } + exports.createFileSystemAdapter = createFileSystemAdapter; +} (fs$f)); + +Object.defineProperty(settings$3, "__esModule", { value: true }); +const fs$e = fs$f; +let Settings$2 = class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs$e.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +}; +settings$3.default = Settings$2; + +Object.defineProperty(out$1, "__esModule", { value: true }); +out$1.statSync = out$1.stat = out$1.Settings = void 0; +const async$1 = async$2; +const sync$7 = sync$8; +const settings_1$3 = settings$3; +out$1.Settings = settings_1$3.default; +function stat$4(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async$1.read(path, getSettings$2(), optionsOrSettingsOrCallback); + return; + } + async$1.read(path, getSettings$2(optionsOrSettingsOrCallback), callback); +} +out$1.stat = stat$4; +function statSync(path, optionsOrSettings) { + const settings = getSettings$2(optionsOrSettings); + return sync$7.read(path, settings); +} +out$1.statSync = statSync; +function getSettings$2(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1$3.default) { + return settingsOrOptions; + } + return new settings_1$3.default(settingsOrOptions); +} + +/*! queue-microtask. MIT License. Feross Aboukhadijeh */ + +let promise$1; + +var queueMicrotask_1 = typeof queueMicrotask === 'function' + ? queueMicrotask.bind(typeof window !== 'undefined' ? window : commonjsGlobal) + // reuse resolved promise, and allocate it lazily + : cb => (promise$1 || (promise$1 = Promise.resolve())) + .then(cb) + .catch(err => setTimeout(() => { throw err }, 0)); + +/*! run-parallel. MIT License. Feross Aboukhadijeh */ + +var runParallel_1 = runParallel; + +const queueMicrotask$1 = queueMicrotask_1; + +function runParallel (tasks, cb) { + let results, pending, keys; + let isSync = true; + + if (Array.isArray(tasks)) { + results = []; + pending = tasks.length; + } else { + keys = Object.keys(tasks); + results = {}; + pending = keys.length; + } + + function done (err) { + function end () { + if (cb) cb(err, results); + cb = null; + } + if (isSync) queueMicrotask$1(end); + else end(); + } + + function each (i, err, result) { + results[i] = result; + if (--pending === 0 || err) { + done(err); + } + } + + if (!pending) { + // empty + done(null); + } else if (keys) { + // object + keys.forEach(function (key) { + tasks[key](function (err, result) { each(key, err, result); }); + }); + } else { + // array + tasks.forEach(function (task, i) { + task(function (err, result) { each(i, err, result); }); + }); + } + + isSync = false; +} + +var constants$2 = {}; + +Object.defineProperty(constants$2, "__esModule", { value: true }); +constants$2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; +const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); +if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); +} +const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); +const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); +const SUPPORTED_MAJOR_VERSION = 10; +const SUPPORTED_MINOR_VERSION = 10; +const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; +const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; +/** + * IS `true` for Node.js 10.10 and greater. + */ +constants$2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; + +var utils$9 = {}; + +var fs$d = {}; + +Object.defineProperty(fs$d, "__esModule", { value: true }); +fs$d.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +} +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +fs$d.createDirentFromStats = createDirentFromStats; + +Object.defineProperty(utils$9, "__esModule", { value: true }); +utils$9.fs = void 0; +const fs$c = fs$d; +utils$9.fs = fs$c; + +var common$a = {}; + +Object.defineProperty(common$a, "__esModule", { value: true }); +common$a.joinPathSegments = void 0; +function joinPathSegments$1(a, b, separator) { + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +common$a.joinPathSegments = joinPathSegments$1; + +Object.defineProperty(async$3, "__esModule", { value: true }); +async$3.readdir = async$3.readdirWithFileTypes = async$3.read = void 0; +const fsStat$5 = out$1; +const rpl = runParallel_1; +const constants_1$1 = constants$2; +const utils$8 = utils$9; +const common$9 = common$a; +function read$1(directory, settings, callback) { + if (!settings.stats && constants_1$1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes$1(directory, settings, callback); + return; + } + readdir$3(directory, settings, callback); +} +async$3.read = read$1; +function readdirWithFileTypes$1(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback$1(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common$9.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback$1(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback$1(callback, rplError); + return; + } + callSuccessCallback$1(callback, rplEntries); + }); + }); +} +async$3.readdirWithFileTypes = readdirWithFileTypes$1; +function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils$8.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; +} +function readdir$3(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback$1(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path = common$9.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat$5.stat(path, settings.fsStatSettings, (error, stats) => { + if (error !== null) { + done(error); + return; + } + const entry = { + name, + path, + dirent: utils$8.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback$1(callback, rplError); + return; + } + callSuccessCallback$1(callback, entries); + }); + }); +} +async$3.readdir = readdir$3; +function callFailureCallback$1(callback, error) { + callback(error); +} +function callSuccessCallback$1(callback, result) { + callback(null, result); +} + +var sync$6 = {}; + +Object.defineProperty(sync$6, "__esModule", { value: true }); +sync$6.readdir = sync$6.readdirWithFileTypes = sync$6.read = void 0; +const fsStat$4 = out$1; +const constants_1 = constants$2; +const utils$7 = utils$9; +const common$8 = common$a; +function read(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); + } + return readdir$2(directory, settings); +} +sync$6.read = read; +function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common$8.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils$7.fs.createDirentFromStats(entry.name, stats); + } + catch (error) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error; + } + } + } + return entry; + }); +} +sync$6.readdirWithFileTypes = readdirWithFileTypes; +function readdir$2(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common$8.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat$4.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils$7.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + return entry; + }); +} +sync$6.readdir = readdir$2; + +var settings$2 = {}; + +var fs$b = {}; + +(function (exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + const fs = require$$0__default; + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync + }; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); + } + exports.createFileSystemAdapter = createFileSystemAdapter; +} (fs$b)); + +Object.defineProperty(settings$2, "__esModule", { value: true }); +const path$d = require$$0$4; +const fsStat$3 = out$1; +const fs$a = fs$b; +let Settings$1 = class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs$a.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$d.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat$3.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +}; +settings$2.default = Settings$1; + +Object.defineProperty(out$2, "__esModule", { value: true }); +out$2.Settings = out$2.scandirSync = out$2.scandir = void 0; +const async = async$3; +const sync$5 = sync$6; +const settings_1$2 = settings$2; +out$2.Settings = settings_1$2.default; +function scandir(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings$1(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings$1(optionsOrSettingsOrCallback), callback); +} +out$2.scandir = scandir; +function scandirSync(path, optionsOrSettings) { + const settings = getSettings$1(optionsOrSettings); + return sync$5.read(path, settings); +} +out$2.scandirSync = scandirSync; +function getSettings$1(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1$2.default) { + return settingsOrOptions; + } + return new settings_1$2.default(settingsOrOptions); +} + +var queue = {exports: {}}; + +function reusify$1 (Constructor) { + var head = new Constructor(); + var tail = head; + + function get () { + var current = head; + + if (current.next) { + head = current.next; + } else { + head = new Constructor(); + tail = head; + } + + current.next = null; + + return current + } + + function release (obj) { + tail.next = obj; + tail = obj; + } + + return { + get: get, + release: release + } +} + +var reusify_1 = reusify$1; + +/* eslint-disable no-var */ + +var reusify = reusify_1; + +function fastqueue (context, worker, concurrency) { + if (typeof context === 'function') { + concurrency = worker; + worker = context; + context = null; + } + + if (concurrency < 1) { + throw new Error('fastqueue concurrency must be greater than 1') + } + + var cache = reusify(Task); + var queueHead = null; + var queueTail = null; + var _running = 0; + var errorHandler = null; + + var self = { + push: push, + drain: noop$4, + saturated: noop$4, + pause: pause, + paused: false, + concurrency: concurrency, + running: running, + resume: resume, + idle: idle, + length: length, + getQueue: getQueue, + unshift: unshift, + empty: noop$4, + kill: kill, + killAndDrain: killAndDrain, + error: error + }; + + return self + + function running () { + return _running + } + + function pause () { + self.paused = true; + } + + function length () { + var current = queueHead; + var counter = 0; + + while (current) { + current = current.next; + counter++; + } + + return counter + } + + function getQueue () { + var current = queueHead; + var tasks = []; + + while (current) { + tasks.push(current.value); + current = current.next; + } + + return tasks + } + + function resume () { + if (!self.paused) return + self.paused = false; + for (var i = 0; i < self.concurrency; i++) { + _running++; + release(); + } + } + + function idle () { + return _running === 0 && self.length() === 0 + } + + function push (value, done) { + var current = cache.get(); + + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop$4; + current.errorHandler = errorHandler; + + if (_running === self.concurrency || self.paused) { + if (queueTail) { + queueTail.next = current; + queueTail = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); + } + } else { + _running++; + worker.call(context, current.value, current.worked); + } + } + + function unshift (value, done) { + var current = cache.get(); + + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop$4; + + if (_running === self.concurrency || self.paused) { + if (queueHead) { + current.next = queueHead; + queueHead = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); + } + } else { + _running++; + worker.call(context, current.value, current.worked); + } + } + + function release (holder) { + if (holder) { + cache.release(holder); + } + var next = queueHead; + if (next) { + if (!self.paused) { + if (queueTail === queueHead) { + queueTail = null; + } + queueHead = next.next; + next.next = null; + worker.call(context, next.value, next.worked); + if (queueTail === null) { + self.empty(); + } + } else { + _running--; + } + } else if (--_running === 0) { + self.drain(); + } + } + + function kill () { + queueHead = null; + queueTail = null; + self.drain = noop$4; + } + + function killAndDrain () { + queueHead = null; + queueTail = null; + self.drain(); + self.drain = noop$4; + } + + function error (handler) { + errorHandler = handler; + } +} + +function noop$4 () {} + +function Task () { + this.value = null; + this.callback = noop$4; + this.next = null; + this.release = noop$4; + this.context = null; + this.errorHandler = null; + + var self = this; + + this.worked = function worked (err, result) { + var callback = self.callback; + var errorHandler = self.errorHandler; + var val = self.value; + self.value = null; + self.callback = noop$4; + if (self.errorHandler) { + errorHandler(err, val); + } + callback.call(self.context, err, result); + self.release(self); + }; +} + +function queueAsPromised (context, worker, concurrency) { + if (typeof context === 'function') { + concurrency = worker; + worker = context; + context = null; + } + + function asyncWrapper (arg, cb) { + worker.call(this, arg) + .then(function (res) { + cb(null, res); + }, cb); + } + + var queue = fastqueue(context, asyncWrapper, concurrency); + + var pushCb = queue.push; + var unshiftCb = queue.unshift; + + queue.push = push; + queue.unshift = unshift; + queue.drained = drained; + + return queue + + function push (value) { + var p = new Promise(function (resolve, reject) { + pushCb(value, function (err, result) { + if (err) { + reject(err); + return + } + resolve(result); + }); + }); + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop$4); + + return p + } + + function unshift (value) { + var p = new Promise(function (resolve, reject) { + unshiftCb(value, function (err, result) { + if (err) { + reject(err); + return + } + resolve(result); + }); + }); + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop$4); + + return p + } + + function drained () { + var previousDrain = queue.drain; + + var p = new Promise(function (resolve) { + queue.drain = function () { + previousDrain(); + resolve(); + }; + }); + + return p + } +} + +queue.exports = fastqueue; +queue.exports.promise = queueAsPromised; + +var queueExports = queue.exports; + +var common$7 = {}; + +Object.defineProperty(common$7, "__esModule", { value: true }); +common$7.joinPathSegments = common$7.replacePathSegmentSeparator = common$7.isAppliedFilter = common$7.isFatalError = void 0; +function isFatalError(settings, error) { + if (settings.errorFilter === null) { + return true; + } + return !settings.errorFilter(error); +} +common$7.isFatalError = isFatalError; +function isAppliedFilter(filter, value) { + return filter === null || filter(value); +} +common$7.isAppliedFilter = isAppliedFilter; +function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); +} +common$7.replacePathSegmentSeparator = replacePathSegmentSeparator; +function joinPathSegments(a, b, separator) { + if (a === '') { + return b; + } + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +common$7.joinPathSegments = joinPathSegments; + +var reader$1 = {}; + +Object.defineProperty(reader$1, "__esModule", { value: true }); +const common$6 = common$7; +let Reader$1 = class Reader { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common$6.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } +}; +reader$1.default = Reader$1; + +Object.defineProperty(async$4, "__esModule", { value: true }); +const events_1 = require$$0$5; +const fsScandir$2 = out$2; +const fastq = queueExports; +const common$5 = common$7; +const reader_1$4 = reader$1; +class AsyncReader extends reader_1$4.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir$2.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit('end'); + } + }; + } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; + } + get isDestroyed() { + return this._isDestroyed; + } + destroy() { + if (this._isDestroyed) { + throw new Error('The reader is already destroyed'); + } + this._isDestroyed = true; + this._queue.killAndDrain(); + } + onEntry(callback) { + this._emitter.on('entry', callback); + } + onError(callback) { + this._emitter.once('error', callback); + } + onEnd(callback) { + this._emitter.once('end', callback); + } + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error) => { + if (error !== null) { + this._handleError(error); + } + }); + } + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { + if (error !== null) { + done(error, undefined); + return; + } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, undefined); + }); + } + _handleError(error) { + if (this._isDestroyed || !common$5.isFatalError(this._settings, error)) { + return; + } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit('error', error); + } + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common$5.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common$5.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common$5.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _emitEntry(entry) { + this._emitter.emit('entry', entry); + } +} +async$4.default = AsyncReader; + +Object.defineProperty(async$5, "__esModule", { value: true }); +const async_1$4 = async$4; +class AsyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1$4.default(this._root, this._settings); + this._storage = []; + } + read(callback) { + this._reader.onError((error) => { + callFailureCallback(callback, error); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); + } +} +async$5.default = AsyncProvider; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, entries) { + callback(null, entries); +} + +var stream$2 = {}; + +Object.defineProperty(stream$2, "__esModule", { value: true }); +const stream_1$5 = require$$0$7; +const async_1$3 = async$4; +class StreamProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1$3.default(this._root, this._settings); + this._stream = new stream_1$5.Readable({ + objectMode: true, + read: () => { }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); + } + read() { + this._reader.onError((error) => { + this._stream.emit('error', error); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; + } +} +stream$2.default = StreamProvider; + +var sync$4 = {}; + +var sync$3 = {}; + +Object.defineProperty(sync$3, "__esModule", { value: true }); +const fsScandir$1 = out$2; +const common$4 = common$7; +const reader_1$3 = reader$1; +class SyncReader extends reader_1$3.default { + constructor() { + super(...arguments); + this._scandir = fsScandir$1.scandirSync; + this._storage = []; + this._queue = new Set(); + } + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; + } + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); + } + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); + } + } + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } + catch (error) { + this._handleError(error); + } + } + _handleError(error) { + if (!common$4.isFatalError(this._settings, error)) { + return; + } + throw error; + } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common$4.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common$4.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common$4.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _pushToStorage(entry) { + this._storage.push(entry); + } +} +sync$3.default = SyncReader; + +Object.defineProperty(sync$4, "__esModule", { value: true }); +const sync_1$3 = sync$3; +class SyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1$3.default(this._root, this._settings); + } + read() { + return this._reader.read(); + } +} +sync$4.default = SyncProvider; + +var settings$1 = {}; + +Object.defineProperty(settings$1, "__esModule", { value: true }); +const path$c = require$$0$4; +const fsScandir = out$2; +class Settings { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, undefined); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$c.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +settings$1.default = Settings; + +Object.defineProperty(out$3, "__esModule", { value: true }); +out$3.Settings = out$3.walkStream = out$3.walkSync = out$3.walk = void 0; +const async_1$2 = async$5; +const stream_1$4 = stream$2; +const sync_1$2 = sync$4; +const settings_1$1 = settings$1; +out$3.Settings = settings_1$1.default; +function walk$2(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + new async_1$2.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; + } + new async_1$2.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); +} +out$3.walk = walk$2; +function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1$2.default(directory, settings); + return provider.read(); +} +out$3.walkSync = walkSync; +function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1$4.default(directory, settings); + return provider.read(); +} +out$3.walkStream = walkStream; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1$1.default) { + return settingsOrOptions; + } + return new settings_1$1.default(settingsOrOptions); +} + +var reader = {}; + +Object.defineProperty(reader, "__esModule", { value: true }); +const path$b = require$$0$4; +const fsStat$2 = out$1; +const utils$6 = utils$g; +class Reader { + constructor(_settings) { + this._settings = _settings; + this._fsStatSettings = new fsStat$2.Settings({ + followSymbolicLink: this._settings.followSymbolicLinks, + fs: this._settings.fs, + throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks + }); + } + _getFullEntryPath(filepath) { + return path$b.resolve(this._settings.cwd, filepath); + } + _makeEntry(stats, pattern) { + const entry = { + name: pattern, + path: pattern, + dirent: utils$6.fs.createDirentFromStats(pattern, stats) + }; + if (this._settings.stats) { + entry.stats = stats; + } + return entry; + } + _isFatalError(error) { + return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; + } +} +reader.default = Reader; + +var stream$1 = {}; + +Object.defineProperty(stream$1, "__esModule", { value: true }); +const stream_1$3 = require$$0$7; +const fsStat$1 = out$1; +const fsWalk$2 = out$3; +const reader_1$2 = reader; +class ReaderStream extends reader_1$2.default { + constructor() { + super(...arguments); + this._walkStream = fsWalk$2.walkStream; + this._stat = fsStat$1.stat; + } + dynamic(root, options) { + return this._walkStream(root, options); + } + static(patterns, options) { + const filepaths = patterns.map(this._getFullEntryPath, this); + const stream = new stream_1$3.PassThrough({ objectMode: true }); + stream._write = (index, _enc, done) => { + return this._getEntry(filepaths[index], patterns[index], options) + .then((entry) => { + if (entry !== null && options.entryFilter(entry)) { + stream.push(entry); + } + if (index === filepaths.length - 1) { + stream.end(); + } + done(); + }) + .catch(done); + }; + for (let i = 0; i < filepaths.length; i++) { + stream.write(i); + } + return stream; + } + _getEntry(filepath, pattern, options) { + return this._getStat(filepath) + .then((stats) => this._makeEntry(stats, pattern)) + .catch((error) => { + if (options.errorFilter(error)) { + return null; + } + throw error; + }); + } + _getStat(filepath) { + return new Promise((resolve, reject) => { + this._stat(filepath, this._fsStatSettings, (error, stats) => { + return error === null ? resolve(stats) : reject(error); + }); + }); + } +} +stream$1.default = ReaderStream; + +Object.defineProperty(async$6, "__esModule", { value: true }); +const fsWalk$1 = out$3; +const reader_1$1 = reader; +const stream_1$2 = stream$1; +class ReaderAsync extends reader_1$1.default { + constructor() { + super(...arguments); + this._walkAsync = fsWalk$1.walk; + this._readerStream = new stream_1$2.default(this._settings); + } + dynamic(root, options) { + return new Promise((resolve, reject) => { + this._walkAsync(root, options, (error, entries) => { + if (error === null) { + resolve(entries); + } + else { + reject(error); + } + }); + }); + } + async static(patterns, options) { + const entries = []; + const stream = this._readerStream.static(patterns, options); + // After #235, replace it with an asynchronous iterator. + return new Promise((resolve, reject) => { + stream.once('error', reject); + stream.on('data', (entry) => entries.push(entry)); + stream.once('end', () => resolve(entries)); + }); + } +} +async$6.default = ReaderAsync; + +var provider = {}; + +var deep = {}; + +var partial = {}; + +var matcher = {}; + +Object.defineProperty(matcher, "__esModule", { value: true }); +const utils$5 = utils$g; +class Matcher { + constructor(_patterns, _settings, _micromatchOptions) { + this._patterns = _patterns; + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this._storage = []; + this._fillStorage(); + } + _fillStorage() { + for (const pattern of this._patterns) { + const segments = this._getPatternSegments(pattern); + const sections = this._splitSegmentsIntoSections(segments); + this._storage.push({ + complete: sections.length <= 1, + pattern, + segments, + sections + }); + } + } + _getPatternSegments(pattern) { + const parts = utils$5.pattern.getPatternParts(pattern, this._micromatchOptions); + return parts.map((part) => { + const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings); + if (!dynamic) { + return { + dynamic: false, + pattern: part + }; + } + return { + dynamic: true, + pattern: part, + patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions) + }; + }); + } + _splitSegmentsIntoSections(segments) { + return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern)); + } +} +matcher.default = Matcher; + +Object.defineProperty(partial, "__esModule", { value: true }); +const matcher_1 = matcher; +class PartialMatcher extends matcher_1.default { + match(filepath) { + const parts = filepath.split('/'); + const levels = parts.length; + const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); + for (const pattern of patterns) { + const section = pattern.sections[0]; + /** + * In this case, the pattern has a globstar and we must read all directories unconditionally, + * but only if the level has reached the end of the first group. + * + * fixtures/{a,b}/** + * ^ true/false ^ always true + */ + if (!pattern.complete && levels > section.length) { + return true; + } + const match = parts.every((part, index) => { + const segment = pattern.segments[index]; + if (segment.dynamic && segment.patternRe.test(part)) { + return true; + } + if (!segment.dynamic && segment.pattern === part) { + return true; + } + return false; + }); + if (match) { + return true; + } + } + return false; + } +} +partial.default = PartialMatcher; + +Object.defineProperty(deep, "__esModule", { value: true }); +const utils$4 = utils$g; +const partial_1 = partial; +class DeepFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + } + getFilter(basePath, positive, negative) { + const matcher = this._getMatcher(positive); + const negativeRe = this._getNegativePatternsRe(negative); + return (entry) => this._filter(basePath, entry, matcher, negativeRe); + } + _getMatcher(patterns) { + return new partial_1.default(patterns, this._settings, this._micromatchOptions); + } + _getNegativePatternsRe(patterns) { + const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern); + return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); + } + _filter(basePath, entry, matcher, negativeRe) { + if (this._isSkippedByDeep(basePath, entry.path)) { + return false; + } + if (this._isSkippedSymbolicLink(entry)) { + return false; + } + const filepath = utils$4.path.removeLeadingDotSegment(entry.path); + if (this._isSkippedByPositivePatterns(filepath, matcher)) { + return false; + } + return this._isSkippedByNegativePatterns(filepath, negativeRe); + } + _isSkippedByDeep(basePath, entryPath) { + /** + * Avoid unnecessary depth calculations when it doesn't matter. + */ + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; + } + _getEntryLevel(basePath, entryPath) { + const entryPathDepth = entryPath.split('/').length; + if (basePath === '') { + return entryPathDepth; + } + const basePathDepth = basePath.split('/').length; + return entryPathDepth - basePathDepth; + } + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); + } + _isSkippedByPositivePatterns(entryPath, matcher) { + return !this._settings.baseNameMatch && !matcher.match(entryPath); + } + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils$4.pattern.matchAny(entryPath, patternsRe); + } +} +deep.default = DeepFilter; + +var entry$1 = {}; + +Object.defineProperty(entry$1, "__esModule", { value: true }); +const utils$3 = utils$g; +class EntryFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this.index = new Map(); + } + getFilter(positive, negative) { + const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions); + const negativeRe = utils$3.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })); + return (entry) => this._filter(entry, positiveRe, negativeRe); + } + _filter(entry, positiveRe, negativeRe) { + const filepath = utils$3.path.removeLeadingDotSegment(entry.path); + if (this._settings.unique && this._isDuplicateEntry(filepath)) { + return false; + } + if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { + return false; + } + if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) { + return false; + } + const isDirectory = entry.dirent.isDirectory(); + const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory); + if (this._settings.unique && isMatched) { + this._createIndexRecord(filepath); + } + return isMatched; + } + _isDuplicateEntry(filepath) { + return this.index.has(filepath); + } + _createIndexRecord(filepath) { + this.index.set(filepath, undefined); + } + _onlyFileFilter(entry) { + return this._settings.onlyFiles && !entry.dirent.isFile(); + } + _onlyDirectoryFilter(entry) { + return this._settings.onlyDirectories && !entry.dirent.isDirectory(); + } + _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { + if (!this._settings.absolute) { + return false; + } + const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, entryPath); + return utils$3.pattern.matchAny(fullpath, patternsRe); + } + _isMatchToPatterns(filepath, patternsRe, isDirectory) { + // Trying to match files and directories by patterns. + const isMatched = utils$3.pattern.matchAny(filepath, patternsRe); + // A pattern with a trailling slash can be used for directory matching. + // To apply such pattern, we need to add a tralling slash to the path. + if (!isMatched && isDirectory) { + return utils$3.pattern.matchAny(filepath + '/', patternsRe); + } + return isMatched; + } +} +entry$1.default = EntryFilter; + +var error$1 = {}; + +Object.defineProperty(error$1, "__esModule", { value: true }); +const utils$2 = utils$g; +class ErrorFilter { + constructor(_settings) { + this._settings = _settings; + } + getFilter() { + return (error) => this._isNonFatalError(error); + } + _isNonFatalError(error) { + return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors; + } +} +error$1.default = ErrorFilter; + +var entry = {}; + +Object.defineProperty(entry, "__esModule", { value: true }); +const utils$1 = utils$g; +class EntryTransformer { + constructor(_settings) { + this._settings = _settings; + } + getTransformer() { + return (entry) => this._transform(entry); + } + _transform(entry) { + let filepath = entry.path; + if (this._settings.absolute) { + filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils$1.path.unixify(filepath); + } + if (this._settings.markDirectories && entry.dirent.isDirectory()) { + filepath += '/'; + } + if (!this._settings.objectMode) { + return filepath; + } + return Object.assign(Object.assign({}, entry), { path: filepath }); + } +} +entry.default = EntryTransformer; + +Object.defineProperty(provider, "__esModule", { value: true }); +const path$a = require$$0$4; +const deep_1 = deep; +const entry_1 = entry$1; +const error_1 = error$1; +const entry_2 = entry; +class Provider { + constructor(_settings) { + this._settings = _settings; + this.errorFilter = new error_1.default(this._settings); + this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); + this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); + this.entryTransformer = new entry_2.default(this._settings); + } + _getRootDirectory(task) { + return path$a.resolve(this._settings.cwd, task.base); + } + _getReaderOptions(task) { + const basePath = task.base === '.' ? '' : task.base; + return { + basePath, + pathSegmentSeparator: '/', + concurrency: this._settings.concurrency, + deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), + entryFilter: this.entryFilter.getFilter(task.positive, task.negative), + errorFilter: this.errorFilter.getFilter(), + followSymbolicLinks: this._settings.followSymbolicLinks, + fs: this._settings.fs, + stats: this._settings.stats, + throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, + transform: this.entryTransformer.getTransformer() + }; + } + _getMicromatchOptions() { + return { + dot: this._settings.dot, + matchBase: this._settings.baseNameMatch, + nobrace: !this._settings.braceExpansion, + nocase: !this._settings.caseSensitiveMatch, + noext: !this._settings.extglob, + noglobstar: !this._settings.globstar, + posix: true, + strictSlashes: false + }; + } +} +provider.default = Provider; + +Object.defineProperty(async$7, "__esModule", { value: true }); +const async_1$1 = async$6; +const provider_1$2 = provider; +class ProviderAsync extends provider_1$2.default { + constructor() { + super(...arguments); + this._reader = new async_1$1.default(this._settings); + } + async read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = await this.api(root, task, options); + return entries.map((entry) => options.transform(entry)); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +async$7.default = ProviderAsync; + +var stream = {}; + +Object.defineProperty(stream, "__esModule", { value: true }); +const stream_1$1 = require$$0$7; +const stream_2 = stream$1; +const provider_1$1 = provider; +class ProviderStream extends provider_1$1.default { + constructor() { + super(...arguments); + this._reader = new stream_2.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const source = this.api(root, task, options); + const destination = new stream_1$1.Readable({ objectMode: true, read: () => { } }); + source + .once('error', (error) => destination.emit('error', error)) + .on('data', (entry) => destination.emit('data', options.transform(entry))) + .once('end', () => destination.emit('end')); + destination + .once('close', () => source.destroy()); + return destination; + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +stream.default = ProviderStream; + +var sync$2 = {}; + +var sync$1 = {}; + +Object.defineProperty(sync$1, "__esModule", { value: true }); +const fsStat = out$1; +const fsWalk = out$3; +const reader_1 = reader; +class ReaderSync extends reader_1.default { + constructor() { + super(...arguments); + this._walkSync = fsWalk.walkSync; + this._statSync = fsStat.statSync; + } + dynamic(root, options) { + return this._walkSync(root, options); + } + static(patterns, options) { + const entries = []; + for (const pattern of patterns) { + const filepath = this._getFullEntryPath(pattern); + const entry = this._getEntry(filepath, pattern, options); + if (entry === null || !options.entryFilter(entry)) { + continue; + } + entries.push(entry); + } + return entries; + } + _getEntry(filepath, pattern, options) { + try { + const stats = this._getStat(filepath); + return this._makeEntry(stats, pattern); + } + catch (error) { + if (options.errorFilter(error)) { + return null; + } + throw error; + } + } + _getStat(filepath) { + return this._statSync(filepath, this._fsStatSettings); + } +} +sync$1.default = ReaderSync; + +Object.defineProperty(sync$2, "__esModule", { value: true }); +const sync_1$1 = sync$1; +const provider_1 = provider; +class ProviderSync extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new sync_1$1.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = this.api(root, task, options); + return entries.map(options.transform); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +sync$2.default = ProviderSync; + +var settings = {}; + +(function (exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; + const fs = require$$0__default; + const os = require$$2; + /** + * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. + * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 + */ + const CPU_COUNT = Math.max(os.cpus().length, 1); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + lstatSync: fs.lstatSync, + stat: fs.stat, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync + }; + class Settings { + constructor(_options = {}) { + this._options = _options; + this.absolute = this._getValue(this._options.absolute, false); + this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); + this.braceExpansion = this._getValue(this._options.braceExpansion, true); + this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); + this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); + this.cwd = this._getValue(this._options.cwd, process.cwd()); + this.deep = this._getValue(this._options.deep, Infinity); + this.dot = this._getValue(this._options.dot, false); + this.extglob = this._getValue(this._options.extglob, true); + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); + this.fs = this._getFileSystemMethods(this._options.fs); + this.globstar = this._getValue(this._options.globstar, true); + this.ignore = this._getValue(this._options.ignore, []); + this.markDirectories = this._getValue(this._options.markDirectories, false); + this.objectMode = this._getValue(this._options.objectMode, false); + this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); + this.onlyFiles = this._getValue(this._options.onlyFiles, true); + this.stats = this._getValue(this._options.stats, false); + this.suppressErrors = this._getValue(this._options.suppressErrors, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); + this.unique = this._getValue(this._options.unique, true); + if (this.onlyDirectories) { + this.onlyFiles = false; + } + if (this.stats) { + this.objectMode = true; + } + // Remove the cast to the array in the next major (#404). + this.ignore = [].concat(this.ignore); + } + _getValue(option, value) { + return option === undefined ? value : option; + } + _getFileSystemMethods(methods = {}) { + return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); + } + } + exports.default = Settings; +} (settings)); + +const taskManager = tasks; +const async_1 = async$7; +const stream_1 = stream; +const sync_1 = sync$2; +const settings_1 = settings; +const utils = utils$g; +async function FastGlob(source, options) { + assertPatternsInput(source); + const works = getWorks(source, async_1.default, options); + const result = await Promise.all(works); + return utils.array.flatten(result); +} +// https://github.com/typescript-eslint/typescript-eslint/issues/60 +// eslint-disable-next-line no-redeclare +(function (FastGlob) { + FastGlob.glob = FastGlob; + FastGlob.globSync = sync; + FastGlob.globStream = stream; + FastGlob.async = FastGlob; + function sync(source, options) { + assertPatternsInput(source); + const works = getWorks(source, sync_1.default, options); + return utils.array.flatten(works); + } + FastGlob.sync = sync; + function stream(source, options) { + assertPatternsInput(source); + const works = getWorks(source, stream_1.default, options); + /** + * The stream returned by the provider cannot work with an asynchronous iterator. + * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. + * This affects performance (+25%). I don't see best solution right now. + */ + return utils.stream.merge(works); + } + FastGlob.stream = stream; + function generateTasks(source, options) { + assertPatternsInput(source); + const patterns = [].concat(source); + const settings = new settings_1.default(options); + return taskManager.generate(patterns, settings); + } + FastGlob.generateTasks = generateTasks; + function isDynamicPattern(source, options) { + assertPatternsInput(source); + const settings = new settings_1.default(options); + return utils.pattern.isDynamicPattern(source, settings); + } + FastGlob.isDynamicPattern = isDynamicPattern; + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escape(source); + } + FastGlob.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertPathToPattern(source); + } + FastGlob.convertPathToPattern = convertPathToPattern; + (function (posix) { + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escapePosixPath(source); + } + posix.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertPosixPathToPattern(source); + } + posix.convertPathToPattern = convertPathToPattern; + })(FastGlob.posix || (FastGlob.posix = {})); + (function (win32) { + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escapeWindowsPath(source); + } + win32.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertWindowsPathToPattern(source); + } + win32.convertPathToPattern = convertPathToPattern; + })(FastGlob.win32 || (FastGlob.win32 = {})); +})(FastGlob || (FastGlob = {})); +function getWorks(source, _Provider, options) { + const patterns = [].concat(source); + const settings = new settings_1.default(options); + const tasks = taskManager.generate(patterns, settings); + const provider = new _Provider(settings); + return tasks.map(provider.read, provider); +} +function assertPatternsInput(input) { + const source = [].concat(input); + const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + if (!isValidSource) { + throw new TypeError('Patterns must be a string (non empty) or an array of strings'); + } +} +var out = FastGlob; + +var glob = /*@__PURE__*/getDefaultExportFromCjs(out); + +var dist = {}; + +(function (exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.lilconfigSync = exports.lilconfig = exports.defaultLoaders = void 0; + const path = require$$0$4; + const fs = require$$0__default; + const os = require$$2; + const fsReadFileAsync = fs.promises.readFile; + function getDefaultSearchPlaces(name) { + return [ + 'package.json', + `.${name}rc.json`, + `.${name}rc.js`, + `.${name}rc.cjs`, + `.config/${name}rc`, + `.config/${name}rc.json`, + `.config/${name}rc.js`, + `.config/${name}rc.cjs`, + `${name}.config.js`, + `${name}.config.cjs`, + ]; + } + function parentDir(p) { + return path.dirname(p) || path.sep; + } + exports.defaultLoaders = Object.freeze({ + '.js': __require, + '.json': __require, + '.cjs': __require, + noExt(_, content) { + return JSON.parse(content); + }, + }); + function getExtDesc(ext) { + return ext === 'noExt' ? 'files without extensions' : `extension "${ext}"`; + } + function getOptions(name, options = {}) { + const conf = { + stopDir: os.homedir(), + searchPlaces: getDefaultSearchPlaces(name), + ignoreEmptySearchPlaces: true, + cache: true, + transform: (x) => x, + packageProp: [name], + ...options, + loaders: { ...exports.defaultLoaders, ...options.loaders }, + }; + conf.searchPlaces.forEach(place => { + const key = path.extname(place) || 'noExt'; + const loader = conf.loaders[key]; + if (!loader) { + throw new Error(`No loader specified for ${getExtDesc(key)}, so searchPlaces item "${place}" is invalid`); + } + if (typeof loader !== 'function') { + throw new Error(`loader for ${getExtDesc(key)} is not a function (type provided: "${typeof loader}"), so searchPlaces item "${place}" is invalid`); + } + }); + return conf; + } + function getPackageProp(props, obj) { + if (typeof props === 'string' && props in obj) + return obj[props]; + return ((Array.isArray(props) ? props : props.split('.')).reduce((acc, prop) => (acc === undefined ? acc : acc[prop]), obj) || null); + } + function validateFilePath(filepath) { + if (!filepath) + throw new Error('load must pass a non-empty string'); + } + function validateLoader(loader, ext) { + if (!loader) + throw new Error(`No loader specified for extension "${ext}"`); + if (typeof loader !== 'function') + throw new Error('loader is not a function'); + } + const makeEmplace = (enableCache) => (c, filepath, res) => { + if (enableCache) + c.set(filepath, res); + return res; + }; + function lilconfig(name, options) { + const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, cache, } = getOptions(name, options); + const searchCache = new Map(); + const loadCache = new Map(); + const emplace = makeEmplace(cache); + return { + async search(searchFrom = process.cwd()) { + const result = { + config: null, + filepath: '', + }; + const visited = new Set(); + let dir = searchFrom; + dirLoop: while (true) { + if (cache) { + const r = searchCache.get(dir); + if (r !== undefined) { + for (const p of visited) + searchCache.set(p, r); + return r; + } + visited.add(dir); + } + for (const searchPlace of searchPlaces) { + const filepath = path.join(dir, searchPlace); + try { + await fs.promises.access(filepath); + } + catch (_a) { + continue; + } + const content = String(await fsReadFileAsync(filepath)); + const loaderKey = path.extname(searchPlace) || 'noExt'; + const loader = loaders[loaderKey]; + if (searchPlace === 'package.json') { + const pkg = await loader(filepath, content); + const maybeConfig = getPackageProp(packageProp, pkg); + if (maybeConfig != null) { + result.config = maybeConfig; + result.filepath = filepath; + break dirLoop; + } + continue; + } + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + continue; + if (isEmpty) { + result.isEmpty = true; + result.config = undefined; + } + else { + validateLoader(loader, loaderKey); + result.config = await loader(filepath, content); + } + result.filepath = filepath; + break dirLoop; + } + if (dir === stopDir || dir === parentDir(dir)) + break dirLoop; + dir = parentDir(dir); + } + const transformed = result.filepath === '' && result.config === null + ? transform(null) + : transform(result); + if (cache) { + for (const p of visited) + searchCache.set(p, transformed); + } + return transformed; + }, + async load(filepath) { + validateFilePath(filepath); + const absPath = path.resolve(process.cwd(), filepath); + if (cache && loadCache.has(absPath)) { + return loadCache.get(absPath); + } + const { base, ext } = path.parse(absPath); + const loaderKey = ext || 'noExt'; + const loader = loaders[loaderKey]; + validateLoader(loader, loaderKey); + const content = String(await fsReadFileAsync(absPath)); + if (base === 'package.json') { + const pkg = await loader(absPath, content); + return emplace(loadCache, absPath, transform({ + config: getPackageProp(packageProp, pkg), + filepath: absPath, + })); + } + const result = { + config: null, + filepath: absPath, + }; + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + return emplace(loadCache, absPath, transform({ + config: undefined, + filepath: absPath, + isEmpty: true, + })); + result.config = isEmpty + ? undefined + : await loader(absPath, content); + return emplace(loadCache, absPath, transform(isEmpty ? { ...result, isEmpty, config: undefined } : result)); + }, + clearLoadCache() { + if (cache) + loadCache.clear(); + }, + clearSearchCache() { + if (cache) + searchCache.clear(); + }, + clearCaches() { + if (cache) { + loadCache.clear(); + searchCache.clear(); + } + }, + }; + } + exports.lilconfig = lilconfig; + function lilconfigSync(name, options) { + const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, cache, } = getOptions(name, options); + const searchCache = new Map(); + const loadCache = new Map(); + const emplace = makeEmplace(cache); + return { + search(searchFrom = process.cwd()) { + const result = { + config: null, + filepath: '', + }; + const visited = new Set(); + let dir = searchFrom; + dirLoop: while (true) { + if (cache) { + const r = searchCache.get(dir); + if (r !== undefined) { + for (const p of visited) + searchCache.set(p, r); + return r; + } + visited.add(dir); + } + for (const searchPlace of searchPlaces) { + const filepath = path.join(dir, searchPlace); + try { + fs.accessSync(filepath); + } + catch (_a) { + continue; + } + const loaderKey = path.extname(searchPlace) || 'noExt'; + const loader = loaders[loaderKey]; + const content = String(fs.readFileSync(filepath)); + if (searchPlace === 'package.json') { + const pkg = loader(filepath, content); + const maybeConfig = getPackageProp(packageProp, pkg); + if (maybeConfig != null) { + result.config = maybeConfig; + result.filepath = filepath; + break dirLoop; + } + continue; + } + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + continue; + if (isEmpty) { + result.isEmpty = true; + result.config = undefined; + } + else { + validateLoader(loader, loaderKey); + result.config = loader(filepath, content); + } + result.filepath = filepath; + break dirLoop; + } + if (dir === stopDir || dir === parentDir(dir)) + break dirLoop; + dir = parentDir(dir); + } + const transformed = result.filepath === '' && result.config === null + ? transform(null) + : transform(result); + if (cache) { + for (const p of visited) + searchCache.set(p, transformed); + } + return transformed; + }, + load(filepath) { + validateFilePath(filepath); + const absPath = path.resolve(process.cwd(), filepath); + if (cache && loadCache.has(absPath)) { + return loadCache.get(absPath); + } + const { base, ext } = path.parse(absPath); + const loaderKey = ext || 'noExt'; + const loader = loaders[loaderKey]; + validateLoader(loader, loaderKey); + const content = String(fs.readFileSync(absPath)); + if (base === 'package.json') { + const pkg = loader(absPath, content); + return transform({ + config: getPackageProp(packageProp, pkg), + filepath: absPath, + }); + } + const result = { + config: null, + filepath: absPath, + }; + const isEmpty = content.trim() === ''; + if (isEmpty && ignoreEmptySearchPlaces) + return emplace(loadCache, absPath, transform({ + filepath: absPath, + config: undefined, + isEmpty: true, + })); + result.config = isEmpty ? undefined : loader(absPath, content); + return emplace(loadCache, absPath, transform(isEmpty ? { ...result, isEmpty, config: undefined } : result)); + }, + clearLoadCache() { + if (cache) + loadCache.clear(); + }, + clearSearchCache() { + if (cache) + searchCache.clear(); + }, + clearCaches() { + if (cache) { + loadCache.clear(); + searchCache.clear(); + } + }, + }; + } + exports.lilconfigSync = lilconfigSync; +} (dist)); + +const ALIAS = Symbol.for('yaml.alias'); +const DOC = Symbol.for('yaml.document'); +const MAP = Symbol.for('yaml.map'); +const PAIR = Symbol.for('yaml.pair'); +const SCALAR$1 = Symbol.for('yaml.scalar'); +const SEQ = Symbol.for('yaml.seq'); +const NODE_TYPE = Symbol.for('yaml.node.type'); +const isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS; +const isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC; +const isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP; +const isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR; +const isScalar$1 = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR$1; +const isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ; +function isCollection$1(node) { + if (node && typeof node === 'object') + switch (node[NODE_TYPE]) { + case MAP: + case SEQ: + return true; + } + return false; +} +function isNode$1(node) { + if (node && typeof node === 'object') + switch (node[NODE_TYPE]) { + case ALIAS: + case MAP: + case SCALAR$1: + case SEQ: + return true; + } + return false; +} +const hasAnchor = (node) => (isScalar$1(node) || isCollection$1(node)) && !!node.anchor; + +const BREAK$1 = Symbol('break visit'); +const SKIP$1 = Symbol('skip children'); +const REMOVE$1 = Symbol('remove node'); +/** + * Apply a visitor to an AST node or document. + * + * Walks through the tree (depth-first) starting from `node`, calling a + * `visitor` function with three arguments: + * - `key`: For sequence values and map `Pair`, the node's index in the + * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly. + * `null` for the root node. + * - `node`: The current node. + * - `path`: The ancestry of the current node. + * + * The return value of the visitor may be used to control the traversal: + * - `undefined` (default): Do nothing and continue + * - `visit.SKIP`: Do not visit the children of this node, continue with next + * sibling + * - `visit.BREAK`: Terminate traversal completely + * - `visit.REMOVE`: Remove the current node, then continue with the next one + * - `Node`: Replace the current node, then continue by visiting it + * - `number`: While iterating the items of a sequence or map, set the index + * of the next step. This is useful especially if the index of the current + * node has changed. + * + * If `visitor` is a single function, it will be called with all values + * encountered in the tree, including e.g. `null` values. Alternatively, + * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`, + * `Alias` and `Scalar` node. To define the same visitor function for more than + * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar) + * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most + * specific defined one will be used for each node. + */ +function visit$1(node, visitor) { + const visitor_ = initVisitor(visitor); + if (isDocument(node)) { + const cd = visit_(null, node.contents, visitor_, Object.freeze([node])); + if (cd === REMOVE$1) + node.contents = null; + } + else + visit_(null, node, visitor_, Object.freeze([])); +} +// Without the `as symbol` casts, TS declares these in the `visit` +// namespace using `var`, but then complains about that because +// `unique symbol` must be `const`. +/** Terminate visit traversal completely */ +visit$1.BREAK = BREAK$1; +/** Do not visit the children of the current node */ +visit$1.SKIP = SKIP$1; +/** Remove the current node */ +visit$1.REMOVE = REMOVE$1; +function visit_(key, node, visitor, path) { + const ctrl = callVisitor(key, node, visitor, path); + if (isNode$1(ctrl) || isPair(ctrl)) { + replaceNode(key, path, ctrl); + return visit_(key, ctrl, visitor, path); + } + if (typeof ctrl !== 'symbol') { + if (isCollection$1(node)) { + path = Object.freeze(path.concat(node)); + for (let i = 0; i < node.items.length; ++i) { + const ci = visit_(i, node.items[i], visitor, path); + if (typeof ci === 'number') + i = ci - 1; + else if (ci === BREAK$1) + return BREAK$1; + else if (ci === REMOVE$1) { + node.items.splice(i, 1); + i -= 1; + } + } + } + else if (isPair(node)) { + path = Object.freeze(path.concat(node)); + const ck = visit_('key', node.key, visitor, path); + if (ck === BREAK$1) + return BREAK$1; + else if (ck === REMOVE$1) + node.key = null; + const cv = visit_('value', node.value, visitor, path); + if (cv === BREAK$1) + return BREAK$1; + else if (cv === REMOVE$1) + node.value = null; + } + } + return ctrl; +} +/** + * Apply an async visitor to an AST node or document. + * + * Walks through the tree (depth-first) starting from `node`, calling a + * `visitor` function with three arguments: + * - `key`: For sequence values and map `Pair`, the node's index in the + * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly. + * `null` for the root node. + * - `node`: The current node. + * - `path`: The ancestry of the current node. + * + * The return value of the visitor may be used to control the traversal: + * - `Promise`: Must resolve to one of the following values + * - `undefined` (default): Do nothing and continue + * - `visit.SKIP`: Do not visit the children of this node, continue with next + * sibling + * - `visit.BREAK`: Terminate traversal completely + * - `visit.REMOVE`: Remove the current node, then continue with the next one + * - `Node`: Replace the current node, then continue by visiting it + * - `number`: While iterating the items of a sequence or map, set the index + * of the next step. This is useful especially if the index of the current + * node has changed. + * + * If `visitor` is a single function, it will be called with all values + * encountered in the tree, including e.g. `null` values. Alternatively, + * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`, + * `Alias` and `Scalar` node. To define the same visitor function for more than + * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar) + * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most + * specific defined one will be used for each node. + */ +async function visitAsync(node, visitor) { + const visitor_ = initVisitor(visitor); + if (isDocument(node)) { + const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node])); + if (cd === REMOVE$1) + node.contents = null; + } + else + await visitAsync_(null, node, visitor_, Object.freeze([])); +} +// Without the `as symbol` casts, TS declares these in the `visit` +// namespace using `var`, but then complains about that because +// `unique symbol` must be `const`. +/** Terminate visit traversal completely */ +visitAsync.BREAK = BREAK$1; +/** Do not visit the children of the current node */ +visitAsync.SKIP = SKIP$1; +/** Remove the current node */ +visitAsync.REMOVE = REMOVE$1; +async function visitAsync_(key, node, visitor, path) { + const ctrl = await callVisitor(key, node, visitor, path); + if (isNode$1(ctrl) || isPair(ctrl)) { + replaceNode(key, path, ctrl); + return visitAsync_(key, ctrl, visitor, path); + } + if (typeof ctrl !== 'symbol') { + if (isCollection$1(node)) { + path = Object.freeze(path.concat(node)); + for (let i = 0; i < node.items.length; ++i) { + const ci = await visitAsync_(i, node.items[i], visitor, path); + if (typeof ci === 'number') + i = ci - 1; + else if (ci === BREAK$1) + return BREAK$1; + else if (ci === REMOVE$1) { + node.items.splice(i, 1); + i -= 1; + } + } + } + else if (isPair(node)) { + path = Object.freeze(path.concat(node)); + const ck = await visitAsync_('key', node.key, visitor, path); + if (ck === BREAK$1) + return BREAK$1; + else if (ck === REMOVE$1) + node.key = null; + const cv = await visitAsync_('value', node.value, visitor, path); + if (cv === BREAK$1) + return BREAK$1; + else if (cv === REMOVE$1) + node.value = null; + } + } + return ctrl; +} +function initVisitor(visitor) { + if (typeof visitor === 'object' && + (visitor.Collection || visitor.Node || visitor.Value)) { + return Object.assign({ + Alias: visitor.Node, + Map: visitor.Node, + Scalar: visitor.Node, + Seq: visitor.Node + }, visitor.Value && { + Map: visitor.Value, + Scalar: visitor.Value, + Seq: visitor.Value + }, visitor.Collection && { + Map: visitor.Collection, + Seq: visitor.Collection + }, visitor); + } + return visitor; +} +function callVisitor(key, node, visitor, path) { + if (typeof visitor === 'function') + return visitor(key, node, path); + if (isMap(node)) + return visitor.Map?.(key, node, path); + if (isSeq(node)) + return visitor.Seq?.(key, node, path); + if (isPair(node)) + return visitor.Pair?.(key, node, path); + if (isScalar$1(node)) + return visitor.Scalar?.(key, node, path); + if (isAlias(node)) + return visitor.Alias?.(key, node, path); + return undefined; +} +function replaceNode(key, path, node) { + const parent = path[path.length - 1]; + if (isCollection$1(parent)) { + parent.items[key] = node; + } + else if (isPair(parent)) { + if (key === 'key') + parent.key = node; + else + parent.value = node; + } + else if (isDocument(parent)) { + parent.contents = node; + } + else { + const pt = isAlias(parent) ? 'alias' : 'scalar'; + throw new Error(`Cannot replace node with ${pt} parent`); + } +} + +const escapeChars = { + '!': '%21', + ',': '%2C', + '[': '%5B', + ']': '%5D', + '{': '%7B', + '}': '%7D' +}; +const escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, ch => escapeChars[ch]); +class Directives { + constructor(yaml, tags) { + /** + * The directives-end/doc-start marker `---`. If `null`, a marker may still be + * included in the document's stringified representation. + */ + this.docStart = null; + /** The doc-end marker `...`. */ + this.docEnd = false; + this.yaml = Object.assign({}, Directives.defaultYaml, yaml); + this.tags = Object.assign({}, Directives.defaultTags, tags); + } + clone() { + const copy = new Directives(this.yaml, this.tags); + copy.docStart = this.docStart; + return copy; + } + /** + * During parsing, get a Directives instance for the current document and + * update the stream state according to the current version's spec. + */ + atDocument() { + const res = new Directives(this.yaml, this.tags); + switch (this.yaml.version) { + case '1.1': + this.atNextDocument = true; + break; + case '1.2': + this.atNextDocument = false; + this.yaml = { + explicit: Directives.defaultYaml.explicit, + version: '1.2' + }; + this.tags = Object.assign({}, Directives.defaultTags); + break; + } + return res; + } + /** + * @param onError - May be called even if the action was successful + * @returns `true` on success + */ + add(line, onError) { + if (this.atNextDocument) { + this.yaml = { explicit: Directives.defaultYaml.explicit, version: '1.1' }; + this.tags = Object.assign({}, Directives.defaultTags); + this.atNextDocument = false; + } + const parts = line.trim().split(/[ \t]+/); + const name = parts.shift(); + switch (name) { + case '%TAG': { + if (parts.length !== 2) { + onError(0, '%TAG directive should contain exactly two parts'); + if (parts.length < 2) + return false; + } + const [handle, prefix] = parts; + this.tags[handle] = prefix; + return true; + } + case '%YAML': { + this.yaml.explicit = true; + if (parts.length !== 1) { + onError(0, '%YAML directive should contain exactly one part'); + return false; + } + const [version] = parts; + if (version === '1.1' || version === '1.2') { + this.yaml.version = version; + return true; + } + else { + const isValid = /^\d+\.\d+$/.test(version); + onError(6, `Unsupported YAML version ${version}`, isValid); + return false; + } + } + default: + onError(0, `Unknown directive ${name}`, true); + return false; + } + } + /** + * Resolves a tag, matching handles to those defined in %TAG directives. + * + * @returns Resolved tag, which may also be the non-specific tag `'!'` or a + * `'!local'` tag, or `null` if unresolvable. + */ + tagName(source, onError) { + if (source === '!') + return '!'; // non-specific tag + if (source[0] !== '!') { + onError(`Not a valid tag: ${source}`); + return null; + } + if (source[1] === '<') { + const verbatim = source.slice(2, -1); + if (verbatim === '!' || verbatim === '!!') { + onError(`Verbatim tags aren't resolved, so ${source} is invalid.`); + return null; + } + if (source[source.length - 1] !== '>') + onError('Verbatim tags must end with a >'); + return verbatim; + } + const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s); + if (!suffix) + onError(`The ${source} tag has no suffix`); + const prefix = this.tags[handle]; + if (prefix) { + try { + return prefix + decodeURIComponent(suffix); + } + catch (error) { + onError(String(error)); + return null; + } + } + if (handle === '!') + return source; // local tag + onError(`Could not resolve tag: ${source}`); + return null; + } + /** + * Given a fully resolved tag, returns its printable string form, + * taking into account current tag prefixes and defaults. + */ + tagString(tag) { + for (const [handle, prefix] of Object.entries(this.tags)) { + if (tag.startsWith(prefix)) + return handle + escapeTagName(tag.substring(prefix.length)); + } + return tag[0] === '!' ? tag : `!<${tag}>`; + } + toString(doc) { + const lines = this.yaml.explicit + ? [`%YAML ${this.yaml.version || '1.2'}`] + : []; + const tagEntries = Object.entries(this.tags); + let tagNames; + if (doc && tagEntries.length > 0 && isNode$1(doc.contents)) { + const tags = {}; + visit$1(doc.contents, (_key, node) => { + if (isNode$1(node) && node.tag) + tags[node.tag] = true; + }); + tagNames = Object.keys(tags); + } + else + tagNames = []; + for (const [handle, prefix] of tagEntries) { + if (handle === '!!' && prefix === 'tag:yaml.org,2002:') + continue; + if (!doc || tagNames.some(tn => tn.startsWith(prefix))) + lines.push(`%TAG ${handle} ${prefix}`); + } + return lines.join('\n'); + } +} +Directives.defaultYaml = { explicit: false, version: '1.2' }; +Directives.defaultTags = { '!!': 'tag:yaml.org,2002:' }; + +/** + * Verify that the input string is a valid anchor. + * + * Will throw on errors. + */ +function anchorIsValid(anchor) { + if (/[\x00-\x19\s,[\]{}]/.test(anchor)) { + const sa = JSON.stringify(anchor); + const msg = `Anchor must not contain whitespace or control characters: ${sa}`; + throw new Error(msg); + } + return true; +} +function anchorNames(root) { + const anchors = new Set(); + visit$1(root, { + Value(_key, node) { + if (node.anchor) + anchors.add(node.anchor); + } + }); + return anchors; +} +/** Find a new anchor name with the given `prefix` and a one-indexed suffix. */ +function findNewAnchor(prefix, exclude) { + for (let i = 1; true; ++i) { + const name = `${prefix}${i}`; + if (!exclude.has(name)) + return name; + } +} +function createNodeAnchors(doc, prefix) { + const aliasObjects = []; + const sourceObjects = new Map(); + let prevAnchors = null; + return { + onAnchor: (source) => { + aliasObjects.push(source); + if (!prevAnchors) + prevAnchors = anchorNames(doc); + const anchor = findNewAnchor(prefix, prevAnchors); + prevAnchors.add(anchor); + return anchor; + }, + /** + * With circular references, the source node is only resolved after all + * of its child nodes are. This is why anchors are set only after all of + * the nodes have been created. + */ + setAnchors: () => { + for (const source of aliasObjects) { + const ref = sourceObjects.get(source); + if (typeof ref === 'object' && + ref.anchor && + (isScalar$1(ref.node) || isCollection$1(ref.node))) { + ref.node.anchor = ref.anchor; + } + else { + const error = new Error('Failed to resolve repeated object (this should not happen)'); + error.source = source; + throw error; + } + } + }, + sourceObjects + }; +} + +/** + * Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec, + * in section 24.5.1.1 "Runtime Semantics: InternalizeJSONProperty" of the + * 2021 edition: https://tc39.es/ecma262/#sec-json.parse + * + * Includes extensions for handling Map and Set objects. + */ +function applyReviver(reviver, obj, key, val) { + if (val && typeof val === 'object') { + if (Array.isArray(val)) { + for (let i = 0, len = val.length; i < len; ++i) { + const v0 = val[i]; + const v1 = applyReviver(reviver, val, String(i), v0); + if (v1 === undefined) + delete val[i]; + else if (v1 !== v0) + val[i] = v1; + } + } + else if (val instanceof Map) { + for (const k of Array.from(val.keys())) { + const v0 = val.get(k); + const v1 = applyReviver(reviver, val, k, v0); + if (v1 === undefined) + val.delete(k); + else if (v1 !== v0) + val.set(k, v1); + } + } + else if (val instanceof Set) { + for (const v0 of Array.from(val)) { + const v1 = applyReviver(reviver, val, v0, v0); + if (v1 === undefined) + val.delete(v0); + else if (v1 !== v0) { + val.delete(v0); + val.add(v1); + } + } + } + else { + for (const [k, v0] of Object.entries(val)) { + const v1 = applyReviver(reviver, val, k, v0); + if (v1 === undefined) + delete val[k]; + else if (v1 !== v0) + val[k] = v1; + } + } + } + return reviver.call(obj, key, val); +} + +/** + * Recursively convert any node or its contents to native JavaScript + * + * @param value - The input value + * @param arg - If `value` defines a `toJSON()` method, use this + * as its first argument + * @param ctx - Conversion context, originally set in Document#toJS(). If + * `{ keep: true }` is not set, output should be suitable for JSON + * stringification. + */ +function toJS(value, arg, ctx) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + if (Array.isArray(value)) + return value.map((v, i) => toJS(v, String(i), ctx)); + if (value && typeof value.toJSON === 'function') { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + if (!ctx || !hasAnchor(value)) + return value.toJSON(arg, ctx); + const data = { aliasCount: 0, count: 1, res: undefined }; + ctx.anchors.set(value, data); + ctx.onCreate = res => { + data.res = res; + delete ctx.onCreate; + }; + const res = value.toJSON(arg, ctx); + if (ctx.onCreate) + ctx.onCreate(res); + return res; + } + if (typeof value === 'bigint' && !ctx?.keep) + return Number(value); + return value; +} + +class NodeBase { + constructor(type) { + Object.defineProperty(this, NODE_TYPE, { value: type }); + } + /** Create a copy of this node. */ + clone() { + const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); + if (this.range) + copy.range = this.range.slice(); + return copy; + } + /** A plain JavaScript representation of this node. */ + toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { + if (!isDocument(doc)) + throw new TypeError('A document argument is required'); + const ctx = { + anchors: new Map(), + doc, + keep: true, + mapAsMap: mapAsMap === true, + mapKeyWarned: false, + maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100 + }; + const res = toJS(this, '', ctx); + if (typeof onAnchor === 'function') + for (const { count, res } of ctx.anchors.values()) + onAnchor(res, count); + return typeof reviver === 'function' + ? applyReviver(reviver, { '': res }, '', res) + : res; + } +} + +class Alias extends NodeBase { + constructor(source) { + super(ALIAS); + this.source = source; + Object.defineProperty(this, 'tag', { + set() { + throw new Error('Alias nodes cannot have tags'); + } + }); + } + /** + * Resolve the value of this alias within `doc`, finding the last + * instance of the `source` anchor before this node. + */ + resolve(doc) { + let found = undefined; + visit$1(doc, { + Node: (_key, node) => { + if (node === this) + return visit$1.BREAK; + if (node.anchor === this.source) + found = node; + } + }); + return found; + } + toJSON(_arg, ctx) { + if (!ctx) + return { source: this.source }; + const { anchors, doc, maxAliasCount } = ctx; + const source = this.resolve(doc); + if (!source) { + const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; + throw new ReferenceError(msg); + } + let data = anchors.get(source); + if (!data) { + // Resolve anchors for Node.prototype.toJS() + toJS(source, null, ctx); + data = anchors.get(source); + } + /* istanbul ignore if */ + if (!data || data.res === undefined) { + const msg = 'This should not happen: Alias anchor was not resolved?'; + throw new ReferenceError(msg); + } + if (maxAliasCount >= 0) { + data.count += 1; + if (data.aliasCount === 0) + data.aliasCount = getAliasCount(doc, source, anchors); + if (data.count * data.aliasCount > maxAliasCount) { + const msg = 'Excessive alias count indicates a resource exhaustion attack'; + throw new ReferenceError(msg); + } + } + return data.res; + } + toString(ctx, _onComment, _onChompKeep) { + const src = `*${this.source}`; + if (ctx) { + anchorIsValid(this.source); + if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) { + const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; + throw new Error(msg); + } + if (ctx.implicitKey) + return `${src} `; + } + return src; + } +} +function getAliasCount(doc, node, anchors) { + if (isAlias(node)) { + const source = node.resolve(doc); + const anchor = anchors && source && anchors.get(source); + return anchor ? anchor.count * anchor.aliasCount : 0; + } + else if (isCollection$1(node)) { + let count = 0; + for (const item of node.items) { + const c = getAliasCount(doc, item, anchors); + if (c > count) + count = c; + } + return count; + } + else if (isPair(node)) { + const kc = getAliasCount(doc, node.key, anchors); + const vc = getAliasCount(doc, node.value, anchors); + return Math.max(kc, vc); + } + return 1; +} + +const isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object'); +class Scalar extends NodeBase { + constructor(value) { + super(SCALAR$1); + this.value = value; + } + toJSON(arg, ctx) { + return ctx?.keep ? this.value : toJS(this.value, arg, ctx); + } + toString() { + return String(this.value); + } +} +Scalar.BLOCK_FOLDED = 'BLOCK_FOLDED'; +Scalar.BLOCK_LITERAL = 'BLOCK_LITERAL'; +Scalar.PLAIN = 'PLAIN'; +Scalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE'; +Scalar.QUOTE_SINGLE = 'QUOTE_SINGLE'; + +const defaultTagPrefix = 'tag:yaml.org,2002:'; +function findTagObject(value, tagName, tags) { + if (tagName) { + const match = tags.filter(t => t.tag === tagName); + const tagObj = match.find(t => !t.format) ?? match[0]; + if (!tagObj) + throw new Error(`Tag ${tagName} not found`); + return tagObj; + } + return tags.find(t => t.identify?.(value) && !t.format); +} +function createNode(value, tagName, ctx) { + if (isDocument(value)) + value = value.contents; + if (isNode$1(value)) + return value; + if (isPair(value)) { + const map = ctx.schema[MAP].createNode?.(ctx.schema, null, ctx); + map.items.push(value); + return map; + } + if (value instanceof String || + value instanceof Number || + value instanceof Boolean || + (typeof BigInt !== 'undefined' && value instanceof BigInt) // not supported everywhere + ) { + // https://tc39.es/ecma262/#sec-serializejsonproperty + value = value.valueOf(); + } + const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx; + // Detect duplicate references to the same object & use Alias nodes for all + // after first. The `ref` wrapper allows for circular references to resolve. + let ref = undefined; + if (aliasDuplicateObjects && value && typeof value === 'object') { + ref = sourceObjects.get(value); + if (ref) { + if (!ref.anchor) + ref.anchor = onAnchor(value); + return new Alias(ref.anchor); + } + else { + ref = { anchor: null, node: null }; + sourceObjects.set(value, ref); + } + } + if (tagName?.startsWith('!!')) + tagName = defaultTagPrefix + tagName.slice(2); + let tagObj = findTagObject(value, tagName, schema.tags); + if (!tagObj) { + if (value && typeof value.toJSON === 'function') { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + value = value.toJSON(); + } + if (!value || typeof value !== 'object') { + const node = new Scalar(value); + if (ref) + ref.node = node; + return node; + } + tagObj = + value instanceof Map + ? schema[MAP] + : Symbol.iterator in Object(value) + ? schema[SEQ] + : schema[MAP]; + } + if (onTagObj) { + onTagObj(tagObj); + delete ctx.onTagObj; + } + const node = tagObj?.createNode + ? tagObj.createNode(ctx.schema, value, ctx) + : typeof tagObj?.nodeClass?.from === 'function' + ? tagObj.nodeClass.from(ctx.schema, value, ctx) + : new Scalar(value); + if (tagName) + node.tag = tagName; + else if (!tagObj.default) + node.tag = tagObj.tag; + if (ref) + ref.node = node; + return node; +} + +function collectionFromPath(schema, path, value) { + let v = value; + for (let i = path.length - 1; i >= 0; --i) { + const k = path[i]; + if (typeof k === 'number' && Number.isInteger(k) && k >= 0) { + const a = []; + a[k] = v; + v = a; + } + else { + v = new Map([[k, v]]); + } + } + return createNode(v, undefined, { + aliasDuplicateObjects: false, + keepUndefined: false, + onAnchor: () => { + throw new Error('This should not happen, please report a bug.'); + }, + schema, + sourceObjects: new Map() + }); +} +// Type guard is intentionally a little wrong so as to be more useful, +// as it does not cover untypable empty non-string iterables (e.g. []). +const isEmptyPath = (path) => path == null || + (typeof path === 'object' && !!path[Symbol.iterator]().next().done); +class Collection extends NodeBase { + constructor(type, schema) { + super(type); + Object.defineProperty(this, 'schema', { + value: schema, + configurable: true, + enumerable: false, + writable: true + }); + } + /** + * Create a copy of this collection. + * + * @param schema - If defined, overwrites the original's schema + */ + clone(schema) { + const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); + if (schema) + copy.schema = schema; + copy.items = copy.items.map(it => isNode$1(it) || isPair(it) ? it.clone(schema) : it); + if (this.range) + copy.range = this.range.slice(); + return copy; + } + /** + * Adds a value to the collection. For `!!map` and `!!omap` the value must + * be a Pair instance or a `{ key, value }` object, which may not have a key + * that already exists in the map. + */ + addIn(path, value) { + if (isEmptyPath(path)) + this.add(value); + else { + const [key, ...rest] = path; + const node = this.get(key, true); + if (isCollection$1(node)) + node.addIn(rest, value); + else if (node === undefined && this.schema) + this.set(key, collectionFromPath(this.schema, rest, value)); + else + throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); + } + } + /** + * Removes a value from the collection. + * @returns `true` if the item was found and removed. + */ + deleteIn(path) { + const [key, ...rest] = path; + if (rest.length === 0) + return this.delete(key); + const node = this.get(key, true); + if (isCollection$1(node)) + return node.deleteIn(rest); + else + throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); + } + /** + * Returns item at `key`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + getIn(path, keepScalar) { + const [key, ...rest] = path; + const node = this.get(key, true); + if (rest.length === 0) + return !keepScalar && isScalar$1(node) ? node.value : node; + else + return isCollection$1(node) ? node.getIn(rest, keepScalar) : undefined; + } + hasAllNullValues(allowScalar) { + return this.items.every(node => { + if (!isPair(node)) + return false; + const n = node.value; + return (n == null || + (allowScalar && + isScalar$1(n) && + n.value == null && + !n.commentBefore && + !n.comment && + !n.tag)); + }); + } + /** + * Checks if the collection includes a value with the key `key`. + */ + hasIn(path) { + const [key, ...rest] = path; + if (rest.length === 0) + return this.has(key); + const node = this.get(key, true); + return isCollection$1(node) ? node.hasIn(rest) : false; + } + /** + * Sets a value in this collection. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + setIn(path, value) { + const [key, ...rest] = path; + if (rest.length === 0) { + this.set(key, value); + } + else { + const node = this.get(key, true); + if (isCollection$1(node)) + node.setIn(rest, value); + else if (node === undefined && this.schema) + this.set(key, collectionFromPath(this.schema, rest, value)); + else + throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); + } + } +} +Collection.maxFlowStringSingleLineLength = 60; + +/** + * Stringifies a comment. + * + * Empty comment lines are left empty, + * lines consisting of a single space are replaced by `#`, + * and all other lines are prefixed with a `#`. + */ +const stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, '#'); +function indentComment(comment, indent) { + if (/^\n+$/.test(comment)) + return comment.substring(1); + return indent ? comment.replace(/^(?! *$)/gm, indent) : comment; +} +const lineComment = (str, indent, comment) => str.endsWith('\n') + ? indentComment(comment, indent) + : comment.includes('\n') + ? '\n' + indentComment(comment, indent) + : (str.endsWith(' ') ? '' : ' ') + comment; + +const FOLD_FLOW = 'flow'; +const FOLD_BLOCK = 'block'; +const FOLD_QUOTED = 'quoted'; +/** + * Tries to keep input at up to `lineWidth` characters, splitting only on spaces + * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are + * terminated with `\n` and started with `indent`. + */ +function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) { + if (!lineWidth || lineWidth < 0) + return text; + const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length); + if (text.length <= endStep) + return text; + const folds = []; + const escapedFolds = {}; + let end = lineWidth - indent.length; + if (typeof indentAtStart === 'number') { + if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) + folds.push(0); + else + end = lineWidth - indentAtStart; + } + let split = undefined; + let prev = undefined; + let overflow = false; + let i = -1; + let escStart = -1; + let escEnd = -1; + if (mode === FOLD_BLOCK) { + i = consumeMoreIndentedLines(text, i); + if (i !== -1) + end = i + endStep; + } + for (let ch; (ch = text[(i += 1)]);) { + if (mode === FOLD_QUOTED && ch === '\\') { + escStart = i; + switch (text[i + 1]) { + case 'x': + i += 3; + break; + case 'u': + i += 5; + break; + case 'U': + i += 9; + break; + default: + i += 1; + } + escEnd = i; + } + if (ch === '\n') { + if (mode === FOLD_BLOCK) + i = consumeMoreIndentedLines(text, i); + end = i + endStep; + split = undefined; + } + else { + if (ch === ' ' && + prev && + prev !== ' ' && + prev !== '\n' && + prev !== '\t') { + // space surrounded by non-space can be replaced with newline + indent + const next = text[i + 1]; + if (next && next !== ' ' && next !== '\n' && next !== '\t') + split = i; + } + if (i >= end) { + if (split) { + folds.push(split); + end = split + endStep; + split = undefined; + } + else if (mode === FOLD_QUOTED) { + // white-space collected at end may stretch past lineWidth + while (prev === ' ' || prev === '\t') { + prev = ch; + ch = text[(i += 1)]; + overflow = true; + } + // Account for newline escape, but don't break preceding escape + const j = i > escEnd + 1 ? i - 2 : escStart - 1; + // Bail out if lineWidth & minContentWidth are shorter than an escape string + if (escapedFolds[j]) + return text; + folds.push(j); + escapedFolds[j] = true; + end = j + endStep; + split = undefined; + } + else { + overflow = true; + } + } + } + prev = ch; + } + if (overflow && onOverflow) + onOverflow(); + if (folds.length === 0) + return text; + if (onFold) + onFold(); + let res = text.slice(0, folds[0]); + for (let i = 0; i < folds.length; ++i) { + const fold = folds[i]; + const end = folds[i + 1] || text.length; + if (fold === 0) + res = `\n${indent}${text.slice(0, end)}`; + else { + if (mode === FOLD_QUOTED && escapedFolds[fold]) + res += `${text[fold]}\\`; + res += `\n${indent}${text.slice(fold + 1, end)}`; + } + } + return res; +} +/** + * Presumes `i + 1` is at the start of a line + * @returns index of last newline in more-indented block + */ +function consumeMoreIndentedLines(text, i) { + let ch = text[i + 1]; + while (ch === ' ' || ch === '\t') { + do { + ch = text[(i += 1)]; + } while (ch && ch !== '\n'); + ch = text[i + 1]; + } + return i; +} + +const getFoldOptions = (ctx, isBlock) => ({ + indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart, + lineWidth: ctx.options.lineWidth, + minContentWidth: ctx.options.minContentWidth +}); +// Also checks for lines starting with %, as parsing the output as YAML 1.1 will +// presume that's starting a new document. +const containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str); +function lineLengthOverLimit(str, lineWidth, indentLength) { + if (!lineWidth || lineWidth < 0) + return false; + const limit = lineWidth - indentLength; + const strLen = str.length; + if (strLen <= limit) + return false; + for (let i = 0, start = 0; i < strLen; ++i) { + if (str[i] === '\n') { + if (i - start > limit) + return true; + start = i + 1; + if (strLen - start <= limit) + return false; + } + } + return true; +} +function doubleQuotedString(value, ctx) { + const json = JSON.stringify(value); + if (ctx.options.doubleQuotedAsJSON) + return json; + const { implicitKey } = ctx; + const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength; + const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : ''); + let str = ''; + let start = 0; + for (let i = 0, ch = json[i]; ch; ch = json[++i]) { + if (ch === ' ' && json[i + 1] === '\\' && json[i + 2] === 'n') { + // space before newline needs to be escaped to not be folded + str += json.slice(start, i) + '\\ '; + i += 1; + start = i; + ch = '\\'; + } + if (ch === '\\') + switch (json[i + 1]) { + case 'u': + { + str += json.slice(start, i); + const code = json.substr(i + 2, 4); + switch (code) { + case '0000': + str += '\\0'; + break; + case '0007': + str += '\\a'; + break; + case '000b': + str += '\\v'; + break; + case '001b': + str += '\\e'; + break; + case '0085': + str += '\\N'; + break; + case '00a0': + str += '\\_'; + break; + case '2028': + str += '\\L'; + break; + case '2029': + str += '\\P'; + break; + default: + if (code.substr(0, 2) === '00') + str += '\\x' + code.substr(2); + else + str += json.substr(i, 6); + } + i += 5; + start = i + 1; + } + break; + case 'n': + if (implicitKey || + json[i + 2] === '"' || + json.length < minMultiLineLength) { + i += 1; + } + else { + // folding will eat first newline + str += json.slice(start, i) + '\n\n'; + while (json[i + 2] === '\\' && + json[i + 3] === 'n' && + json[i + 4] !== '"') { + str += '\n'; + i += 2; + } + str += indent; + // space after newline needs to be escaped to not be folded + if (json[i + 2] === ' ') + str += '\\'; + i += 1; + start = i + 1; + } + break; + default: + i += 1; + } + } + str = start ? str + json.slice(start) : json; + return implicitKey + ? str + : foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx, false)); +} +function singleQuotedString(value, ctx) { + if (ctx.options.singleQuote === false || + (ctx.implicitKey && value.includes('\n')) || + /[ \t]\n|\n[ \t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline + ) + return doubleQuotedString(value, ctx); + const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : ''); + const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'"; + return ctx.implicitKey + ? res + : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false)); +} +function quotedString(value, ctx) { + const { singleQuote } = ctx.options; + let qs; + if (singleQuote === false) + qs = doubleQuotedString; + else { + const hasDouble = value.includes('"'); + const hasSingle = value.includes("'"); + if (hasDouble && !hasSingle) + qs = singleQuotedString; + else if (hasSingle && !hasDouble) + qs = doubleQuotedString; + else + qs = singleQuote ? singleQuotedString : doubleQuotedString; + } + return qs(value, ctx); +} +// The negative lookbehind avoids a polynomial search, +// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind +let blockEndNewlines; +try { + blockEndNewlines = new RegExp('(^|(?\n'; + // determine chomping from whitespace at value end + let chomp; + let endStart; + for (endStart = value.length; endStart > 0; --endStart) { + const ch = value[endStart - 1]; + if (ch !== '\n' && ch !== '\t' && ch !== ' ') + break; + } + let end = value.substring(endStart); + const endNlPos = end.indexOf('\n'); + if (endNlPos === -1) { + chomp = '-'; // strip + } + else if (value === end || endNlPos !== end.length - 1) { + chomp = '+'; // keep + if (onChompKeep) + onChompKeep(); + } + else { + chomp = ''; // clip + } + if (end) { + value = value.slice(0, -end.length); + if (end[end.length - 1] === '\n') + end = end.slice(0, -1); + end = end.replace(blockEndNewlines, `$&${indent}`); + } + // determine indent indicator from whitespace at value start + let startWithSpace = false; + let startEnd; + let startNlPos = -1; + for (startEnd = 0; startEnd < value.length; ++startEnd) { + const ch = value[startEnd]; + if (ch === ' ') + startWithSpace = true; + else if (ch === '\n') + startNlPos = startEnd; + else + break; + } + let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd); + if (start) { + value = value.substring(start.length); + start = start.replace(/\n+/g, `$&${indent}`); + } + const indentSize = indent ? '2' : '1'; // root is at -1 + let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp; + if (comment) { + header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' ')); + if (onComment) + onComment(); + } + if (literal) { + value = value.replace(/\n+/g, `$&${indent}`); + return `${header}\n${indent}${start}${value}${end}`; + } + value = value + .replace(/\n+/g, '\n$&') + .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded + // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent + .replace(/\n+/g, `$&${indent}`); + const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true)); + return `${header}\n${indent}${body}`; +} +function plainString(item, ctx, onComment, onChompKeep) { + const { type, value } = item; + const { actualString, implicitKey, indent, indentStep, inFlow } = ctx; + if ((implicitKey && value.includes('\n')) || + (inFlow && /[[\]{},]/.test(value))) { + return quotedString(value, ctx); + } + if (!value || + /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) { + // not allowed: + // - empty string, '-' or '?' + // - start with an indicator character (except [?:-]) or /[?-] / + // - '\n ', ': ' or ' \n' anywhere + // - '#' not preceded by a non-space char + // - end with ' ' or ':' + return implicitKey || inFlow || !value.includes('\n') + ? quotedString(value, ctx) + : blockString(item, ctx, onComment, onChompKeep); + } + if (!implicitKey && + !inFlow && + type !== Scalar.PLAIN && + value.includes('\n')) { + // Where allowed & type not set explicitly, prefer block style for multiline strings + return blockString(item, ctx, onComment, onChompKeep); + } + if (containsDocumentMarker(value)) { + if (indent === '') { + ctx.forceBlockIndent = true; + return blockString(item, ctx, onComment, onChompKeep); + } + else if (implicitKey && indent === indentStep) { + return quotedString(value, ctx); + } + } + const str = value.replace(/\n+/g, `$&\n${indent}`); + // Verify that output will be parsed as a string, as e.g. plain numbers and + // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'), + // and others in v1.1. + if (actualString) { + const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && tag.test?.test(str); + const { compat, tags } = ctx.doc.schema; + if (tags.some(test) || compat?.some(test)) + return quotedString(value, ctx); + } + return implicitKey + ? str + : foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx, false)); +} +function stringifyString(item, ctx, onComment, onChompKeep) { + const { implicitKey, inFlow } = ctx; + const ss = typeof item.value === 'string' + ? item + : Object.assign({}, item, { value: String(item.value) }); + let { type } = item; + if (type !== Scalar.QUOTE_DOUBLE) { + // force double quotes on control characters & unpaired surrogates + if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value)) + type = Scalar.QUOTE_DOUBLE; + } + const _stringify = (_type) => { + switch (_type) { + case Scalar.BLOCK_FOLDED: + case Scalar.BLOCK_LITERAL: + return implicitKey || inFlow + ? quotedString(ss.value, ctx) // blocks are not valid inside flow containers + : blockString(ss, ctx, onComment, onChompKeep); + case Scalar.QUOTE_DOUBLE: + return doubleQuotedString(ss.value, ctx); + case Scalar.QUOTE_SINGLE: + return singleQuotedString(ss.value, ctx); + case Scalar.PLAIN: + return plainString(ss, ctx, onComment, onChompKeep); + default: + return null; + } + }; + let res = _stringify(type); + if (res === null) { + const { defaultKeyType, defaultStringType } = ctx.options; + const t = (implicitKey && defaultKeyType) || defaultStringType; + res = _stringify(t); + if (res === null) + throw new Error(`Unsupported default string type ${t}`); + } + return res; +} + +function createStringifyContext(doc, options) { + const opt = Object.assign({ + blockQuote: true, + commentString: stringifyComment, + defaultKeyType: null, + defaultStringType: 'PLAIN', + directives: null, + doubleQuotedAsJSON: false, + doubleQuotedMinMultiLineLength: 40, + falseStr: 'false', + flowCollectionPadding: true, + indentSeq: true, + lineWidth: 80, + minContentWidth: 20, + nullStr: 'null', + simpleKeys: false, + singleQuote: null, + trueStr: 'true', + verifyAliasOrder: true + }, doc.schema.toStringOptions, options); + let inFlow; + switch (opt.collectionStyle) { + case 'block': + inFlow = false; + break; + case 'flow': + inFlow = true; + break; + default: + inFlow = null; + } + return { + anchors: new Set(), + doc, + flowCollectionPadding: opt.flowCollectionPadding ? ' ' : '', + indent: '', + indentStep: typeof opt.indent === 'number' ? ' '.repeat(opt.indent) : ' ', + inFlow, + options: opt + }; +} +function getTagObject(tags, item) { + if (item.tag) { + const match = tags.filter(t => t.tag === item.tag); + if (match.length > 0) + return match.find(t => t.format === item.format) ?? match[0]; + } + let tagObj = undefined; + let obj; + if (isScalar$1(item)) { + obj = item.value; + const match = tags.filter(t => t.identify?.(obj)); + tagObj = + match.find(t => t.format === item.format) ?? match.find(t => !t.format); + } + else { + obj = item; + tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass); + } + if (!tagObj) { + const name = obj?.constructor?.name ?? typeof obj; + throw new Error(`Tag not resolved for ${name} value`); + } + return tagObj; +} +// needs to be called before value stringifier to allow for circular anchor refs +function stringifyProps(node, tagObj, { anchors, doc }) { + if (!doc.directives) + return ''; + const props = []; + const anchor = (isScalar$1(node) || isCollection$1(node)) && node.anchor; + if (anchor && anchorIsValid(anchor)) { + anchors.add(anchor); + props.push(`&${anchor}`); + } + const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag; + if (tag) + props.push(doc.directives.tagString(tag)); + return props.join(' '); +} +function stringify$2(item, ctx, onComment, onChompKeep) { + if (isPair(item)) + return item.toString(ctx, onComment, onChompKeep); + if (isAlias(item)) { + if (ctx.doc.directives) + return item.toString(ctx); + if (ctx.resolvedAliases?.has(item)) { + throw new TypeError(`Cannot stringify circular structure without alias nodes`); + } + else { + if (ctx.resolvedAliases) + ctx.resolvedAliases.add(item); + else + ctx.resolvedAliases = new Set([item]); + item = item.resolve(ctx.doc); + } + } + let tagObj = undefined; + const node = isNode$1(item) + ? item + : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) }); + if (!tagObj) + tagObj = getTagObject(ctx.doc.schema.tags, node); + const props = stringifyProps(node, tagObj, ctx); + if (props.length > 0) + ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1; + const str = typeof tagObj.stringify === 'function' + ? tagObj.stringify(node, ctx, onComment, onChompKeep) + : isScalar$1(node) + ? stringifyString(node, ctx, onComment, onChompKeep) + : node.toString(ctx, onComment, onChompKeep); + if (!props) + return str; + return isScalar$1(node) || str[0] === '{' || str[0] === '[' + ? `${props} ${str}` + : `${props}\n${ctx.indent}${str}`; +} + +function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { + const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx; + let keyComment = (isNode$1(key) && key.comment) || null; + if (simpleKeys) { + if (keyComment) { + throw new Error('With simple keys, key nodes cannot have comments'); + } + if (isCollection$1(key)) { + const msg = 'With simple keys, collection cannot be used as a key value'; + throw new Error(msg); + } + } + let explicitKey = !simpleKeys && + (!key || + (keyComment && value == null && !ctx.inFlow) || + isCollection$1(key) || + (isScalar$1(key) + ? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL + : typeof key === 'object')); + ctx = Object.assign({}, ctx, { + allNullValues: false, + implicitKey: !explicitKey && (simpleKeys || !allNullValues), + indent: indent + indentStep + }); + let keyCommentDone = false; + let chompKeep = false; + let str = stringify$2(key, ctx, () => (keyCommentDone = true), () => (chompKeep = true)); + if (!explicitKey && !ctx.inFlow && str.length > 1024) { + if (simpleKeys) + throw new Error('With simple keys, single line scalar must not span more than 1024 characters'); + explicitKey = true; + } + if (ctx.inFlow) { + if (allNullValues || value == null) { + if (keyCommentDone && onComment) + onComment(); + return str === '' ? '?' : explicitKey ? `? ${str}` : str; + } + } + else if ((allNullValues && !simpleKeys) || (value == null && explicitKey)) { + str = `? ${str}`; + if (keyComment && !keyCommentDone) { + str += lineComment(str, ctx.indent, commentString(keyComment)); + } + else if (chompKeep && onChompKeep) + onChompKeep(); + return str; + } + if (keyCommentDone) + keyComment = null; + if (explicitKey) { + if (keyComment) + str += lineComment(str, ctx.indent, commentString(keyComment)); + str = `? ${str}\n${indent}:`; + } + else { + str = `${str}:`; + if (keyComment) + str += lineComment(str, ctx.indent, commentString(keyComment)); + } + let vsb, vcb, valueComment; + if (isNode$1(value)) { + vsb = !!value.spaceBefore; + vcb = value.commentBefore; + valueComment = value.comment; + } + else { + vsb = false; + vcb = null; + valueComment = null; + if (value && typeof value === 'object') + value = doc.createNode(value); + } + ctx.implicitKey = false; + if (!explicitKey && !keyComment && isScalar$1(value)) + ctx.indentAtStart = str.length + 1; + chompKeep = false; + if (!indentSeq && + indentStep.length >= 2 && + !ctx.inFlow && + !explicitKey && + isSeq(value) && + !value.flow && + !value.tag && + !value.anchor) { + // If indentSeq === false, consider '- ' as part of indentation where possible + ctx.indent = ctx.indent.substring(2); + } + let valueCommentDone = false; + const valueStr = stringify$2(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true)); + let ws = ' '; + if (keyComment || vsb || vcb) { + ws = vsb ? '\n' : ''; + if (vcb) { + const cs = commentString(vcb); + ws += `\n${indentComment(cs, ctx.indent)}`; + } + if (valueStr === '' && !ctx.inFlow) { + if (ws === '\n') + ws = '\n\n'; + } + else { + ws += `\n${ctx.indent}`; + } + } + else if (!explicitKey && isCollection$1(value)) { + const vs0 = valueStr[0]; + const nl0 = valueStr.indexOf('\n'); + const hasNewline = nl0 !== -1; + const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0; + if (hasNewline || !flow) { + let hasPropsLine = false; + if (hasNewline && (vs0 === '&' || vs0 === '!')) { + let sp0 = valueStr.indexOf(' '); + if (vs0 === '&' && + sp0 !== -1 && + sp0 < nl0 && + valueStr[sp0 + 1] === '!') { + sp0 = valueStr.indexOf(' ', sp0 + 1); + } + if (sp0 === -1 || nl0 < sp0) + hasPropsLine = true; + } + if (!hasPropsLine) + ws = `\n${ctx.indent}`; + } + } + else if (valueStr === '' || valueStr[0] === '\n') { + ws = ''; + } + str += ws + valueStr; + if (ctx.inFlow) { + if (valueCommentDone && onComment) + onComment(); + } + else if (valueComment && !valueCommentDone) { + str += lineComment(str, ctx.indent, commentString(valueComment)); + } + else if (chompKeep && onChompKeep) { + onChompKeep(); + } + return str; +} + +function warn(logLevel, warning) { + if (logLevel === 'debug' || logLevel === 'warn') { + // https://github.com/typescript-eslint/typescript-eslint/issues/7478 + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain + if (typeof process !== 'undefined' && process.emitWarning) + process.emitWarning(warning); + else + console.warn(warning); + } +} + +const MERGE_KEY = '<<'; +function addPairToJSMap(ctx, map, { key, value }) { + if (ctx?.doc.schema.merge && isMergeKey(key)) { + value = isAlias(value) ? value.resolve(ctx.doc) : value; + if (isSeq(value)) + for (const it of value.items) + mergeToJSMap(ctx, map, it); + else if (Array.isArray(value)) + for (const it of value) + mergeToJSMap(ctx, map, it); + else + mergeToJSMap(ctx, map, value); + } + else { + const jsKey = toJS(key, '', ctx); + if (map instanceof Map) { + map.set(jsKey, toJS(value, jsKey, ctx)); + } + else if (map instanceof Set) { + map.add(jsKey); + } + else { + const stringKey = stringifyKey(key, jsKey, ctx); + const jsValue = toJS(value, stringKey, ctx); + if (stringKey in map) + Object.defineProperty(map, stringKey, { + value: jsValue, + writable: true, + enumerable: true, + configurable: true + }); + else + map[stringKey] = jsValue; + } + } + return map; +} +const isMergeKey = (key) => key === MERGE_KEY || + (isScalar$1(key) && + key.value === MERGE_KEY && + (!key.type || key.type === Scalar.PLAIN)); +// If the value associated with a merge key is a single mapping node, each of +// its key/value pairs is inserted into the current mapping, unless the key +// already exists in it. If the value associated with the merge key is a +// sequence, then this sequence is expected to contain mapping nodes and each +// of these nodes is merged in turn according to its order in the sequence. +// Keys in mapping nodes earlier in the sequence override keys specified in +// later mapping nodes. -- http://yaml.org/type/merge.html +function mergeToJSMap(ctx, map, value) { + const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value; + if (!isMap(source)) + throw new Error('Merge sources must be maps or map aliases'); + const srcMap = source.toJSON(null, ctx, Map); + for (const [key, value] of srcMap) { + if (map instanceof Map) { + if (!map.has(key)) + map.set(key, value); + } + else if (map instanceof Set) { + map.add(key); + } + else if (!Object.prototype.hasOwnProperty.call(map, key)) { + Object.defineProperty(map, key, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + } + return map; +} +function stringifyKey(key, jsKey, ctx) { + if (jsKey === null) + return ''; + if (typeof jsKey !== 'object') + return String(jsKey); + if (isNode$1(key) && ctx?.doc) { + const strCtx = createStringifyContext(ctx.doc, {}); + strCtx.anchors = new Set(); + for (const node of ctx.anchors.keys()) + strCtx.anchors.add(node.anchor); + strCtx.inFlow = true; + strCtx.inStringifyKey = true; + const strKey = key.toString(strCtx); + if (!ctx.mapKeyWarned) { + let jsonStr = JSON.stringify(strKey); + if (jsonStr.length > 40) + jsonStr = jsonStr.substring(0, 36) + '..."'; + warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`); + ctx.mapKeyWarned = true; + } + return strKey; + } + return JSON.stringify(jsKey); +} + +function createPair(key, value, ctx) { + const k = createNode(key, undefined, ctx); + const v = createNode(value, undefined, ctx); + return new Pair(k, v); +} +class Pair { + constructor(key, value = null) { + Object.defineProperty(this, NODE_TYPE, { value: PAIR }); + this.key = key; + this.value = value; + } + clone(schema) { + let { key, value } = this; + if (isNode$1(key)) + key = key.clone(schema); + if (isNode$1(value)) + value = value.clone(schema); + return new Pair(key, value); + } + toJSON(_, ctx) { + const pair = ctx?.mapAsMap ? new Map() : {}; + return addPairToJSMap(ctx, pair, this); + } + toString(ctx, onComment, onChompKeep) { + return ctx?.doc + ? stringifyPair(this, ctx, onComment, onChompKeep) + : JSON.stringify(this); + } +} + +function stringifyCollection(collection, ctx, options) { + const flow = ctx.inFlow ?? collection.flow; + const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection; + return stringify(collection, ctx, options); +} +function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) { + const { indent, options: { commentString } } = ctx; + const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null }); + let chompKeep = false; // flag for the preceding node's status + const lines = []; + for (let i = 0; i < items.length; ++i) { + const item = items[i]; + let comment = null; + if (isNode$1(item)) { + if (!chompKeep && item.spaceBefore) + lines.push(''); + addCommentBefore(ctx, lines, item.commentBefore, chompKeep); + if (item.comment) + comment = item.comment; + } + else if (isPair(item)) { + const ik = isNode$1(item.key) ? item.key : null; + if (ik) { + if (!chompKeep && ik.spaceBefore) + lines.push(''); + addCommentBefore(ctx, lines, ik.commentBefore, chompKeep); + } + } + chompKeep = false; + let str = stringify$2(item, itemCtx, () => (comment = null), () => (chompKeep = true)); + if (comment) + str += lineComment(str, itemIndent, commentString(comment)); + if (chompKeep && comment) + chompKeep = false; + lines.push(blockItemPrefix + str); + } + let str; + if (lines.length === 0) { + str = flowChars.start + flowChars.end; + } + else { + str = lines[0]; + for (let i = 1; i < lines.length; ++i) { + const line = lines[i]; + str += line ? `\n${indent}${line}` : '\n'; + } + } + if (comment) { + str += '\n' + indentComment(commentString(comment), indent); + if (onComment) + onComment(); + } + else if (chompKeep && onChompKeep) + onChompKeep(); + return str; +} +function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemIndent, onComment }) { + const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx; + itemIndent += indentStep; + const itemCtx = Object.assign({}, ctx, { + indent: itemIndent, + inFlow: true, + type: null + }); + let reqNewline = false; + let linesAtValue = 0; + const lines = []; + for (let i = 0; i < items.length; ++i) { + const item = items[i]; + let comment = null; + if (isNode$1(item)) { + if (item.spaceBefore) + lines.push(''); + addCommentBefore(ctx, lines, item.commentBefore, false); + if (item.comment) + comment = item.comment; + } + else if (isPair(item)) { + const ik = isNode$1(item.key) ? item.key : null; + if (ik) { + if (ik.spaceBefore) + lines.push(''); + addCommentBefore(ctx, lines, ik.commentBefore, false); + if (ik.comment) + reqNewline = true; + } + const iv = isNode$1(item.value) ? item.value : null; + if (iv) { + if (iv.comment) + comment = iv.comment; + if (iv.commentBefore) + reqNewline = true; + } + else if (item.value == null && ik?.comment) { + comment = ik.comment; + } + } + if (comment) + reqNewline = true; + let str = stringify$2(item, itemCtx, () => (comment = null)); + if (i < items.length - 1) + str += ','; + if (comment) + str += lineComment(str, itemIndent, commentString(comment)); + if (!reqNewline && (lines.length > linesAtValue || str.includes('\n'))) + reqNewline = true; + lines.push(str); + linesAtValue = lines.length; + } + let str; + const { start, end } = flowChars; + if (lines.length === 0) { + str = start + end; + } + else { + if (!reqNewline) { + const len = lines.reduce((sum, line) => sum + line.length + 2, 2); + reqNewline = len > Collection.maxFlowStringSingleLineLength; + } + if (reqNewline) { + str = start; + for (const line of lines) + str += line ? `\n${indentStep}${indent}${line}` : '\n'; + str += `\n${indent}${end}`; + } + else { + str = `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`; + } + } + if (comment) { + str += lineComment(str, indent, commentString(comment)); + if (onComment) + onComment(); + } + return str; +} +function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) { + if (comment && chompKeep) + comment = comment.replace(/^\n+/, ''); + if (comment) { + const ic = indentComment(commentString(comment), indent); + lines.push(ic.trimStart()); // Avoid double indent on first line + } +} + +function findPair(items, key) { + const k = isScalar$1(key) ? key.value : key; + for (const it of items) { + if (isPair(it)) { + if (it.key === key || it.key === k) + return it; + if (isScalar$1(it.key) && it.key.value === k) + return it; + } + } + return undefined; +} +class YAMLMap extends Collection { + static get tagName() { + return 'tag:yaml.org,2002:map'; + } + constructor(schema) { + super(MAP, schema); + this.items = []; + } + /** + * A generic collection parsing method that can be extended + * to other node classes that inherit from YAMLMap + */ + static from(schema, obj, ctx) { + const { keepUndefined, replacer } = ctx; + const map = new this(schema); + const add = (key, value) => { + if (typeof replacer === 'function') + value = replacer.call(obj, key, value); + else if (Array.isArray(replacer) && !replacer.includes(key)) + return; + if (value !== undefined || keepUndefined) + map.items.push(createPair(key, value, ctx)); + }; + if (obj instanceof Map) { + for (const [key, value] of obj) + add(key, value); + } + else if (obj && typeof obj === 'object') { + for (const key of Object.keys(obj)) + add(key, obj[key]); + } + if (typeof schema.sortMapEntries === 'function') { + map.items.sort(schema.sortMapEntries); + } + return map; + } + /** + * Adds a value to the collection. + * + * @param overwrite - If not set `true`, using a key that is already in the + * collection will throw. Otherwise, overwrites the previous value. + */ + add(pair, overwrite) { + let _pair; + if (isPair(pair)) + _pair = pair; + else if (!pair || typeof pair !== 'object' || !('key' in pair)) { + // In TypeScript, this never happens. + _pair = new Pair(pair, pair?.value); + } + else + _pair = new Pair(pair.key, pair.value); + const prev = findPair(this.items, _pair.key); + const sortEntries = this.schema?.sortMapEntries; + if (prev) { + if (!overwrite) + throw new Error(`Key ${_pair.key} already set`); + // For scalars, keep the old node & its comments and anchors + if (isScalar$1(prev.value) && isScalarValue(_pair.value)) + prev.value.value = _pair.value; + else + prev.value = _pair.value; + } + else if (sortEntries) { + const i = this.items.findIndex(item => sortEntries(_pair, item) < 0); + if (i === -1) + this.items.push(_pair); + else + this.items.splice(i, 0, _pair); + } + else { + this.items.push(_pair); + } + } + delete(key) { + const it = findPair(this.items, key); + if (!it) + return false; + const del = this.items.splice(this.items.indexOf(it), 1); + return del.length > 0; + } + get(key, keepScalar) { + const it = findPair(this.items, key); + const node = it?.value; + return (!keepScalar && isScalar$1(node) ? node.value : node) ?? undefined; + } + has(key) { + return !!findPair(this.items, key); + } + set(key, value) { + this.add(new Pair(key, value), true); + } + /** + * @param ctx - Conversion context, originally set in Document#toJS() + * @param {Class} Type - If set, forces the returned collection type + * @returns Instance of Type, Map, or Object + */ + toJSON(_, ctx, Type) { + const map = Type ? new Type() : ctx?.mapAsMap ? new Map() : {}; + if (ctx?.onCreate) + ctx.onCreate(map); + for (const item of this.items) + addPairToJSMap(ctx, map, item); + return map; + } + toString(ctx, onComment, onChompKeep) { + if (!ctx) + return JSON.stringify(this); + for (const item of this.items) { + if (!isPair(item)) + throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`); + } + if (!ctx.allNullValues && this.hasAllNullValues(false)) + ctx = Object.assign({}, ctx, { allNullValues: true }); + return stringifyCollection(this, ctx, { + blockItemPrefix: '', + flowChars: { start: '{', end: '}' }, + itemIndent: ctx.indent || '', + onChompKeep, + onComment + }); + } +} + +const map$1 = { + collection: 'map', + default: true, + nodeClass: YAMLMap, + tag: 'tag:yaml.org,2002:map', + resolve(map, onError) { + if (!isMap(map)) + onError('Expected a mapping for this tag'); + return map; + }, + createNode: (schema, obj, ctx) => YAMLMap.from(schema, obj, ctx) +}; + +class YAMLSeq extends Collection { + static get tagName() { + return 'tag:yaml.org,2002:seq'; + } + constructor(schema) { + super(SEQ, schema); + this.items = []; + } + add(value) { + this.items.push(value); + } + /** + * Removes a value from the collection. + * + * `key` must contain a representation of an integer for this to succeed. + * It may be wrapped in a `Scalar`. + * + * @returns `true` if the item was found and removed. + */ + delete(key) { + const idx = asItemIndex(key); + if (typeof idx !== 'number') + return false; + const del = this.items.splice(idx, 1); + return del.length > 0; + } + get(key, keepScalar) { + const idx = asItemIndex(key); + if (typeof idx !== 'number') + return undefined; + const it = this.items[idx]; + return !keepScalar && isScalar$1(it) ? it.value : it; + } + /** + * Checks if the collection includes a value with the key `key`. + * + * `key` must contain a representation of an integer for this to succeed. + * It may be wrapped in a `Scalar`. + */ + has(key) { + const idx = asItemIndex(key); + return typeof idx === 'number' && idx < this.items.length; + } + /** + * Sets a value in this collection. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + * + * If `key` does not contain a representation of an integer, this will throw. + * It may be wrapped in a `Scalar`. + */ + set(key, value) { + const idx = asItemIndex(key); + if (typeof idx !== 'number') + throw new Error(`Expected a valid index, not ${key}.`); + const prev = this.items[idx]; + if (isScalar$1(prev) && isScalarValue(value)) + prev.value = value; + else + this.items[idx] = value; + } + toJSON(_, ctx) { + const seq = []; + if (ctx?.onCreate) + ctx.onCreate(seq); + let i = 0; + for (const item of this.items) + seq.push(toJS(item, String(i++), ctx)); + return seq; + } + toString(ctx, onComment, onChompKeep) { + if (!ctx) + return JSON.stringify(this); + return stringifyCollection(this, ctx, { + blockItemPrefix: '- ', + flowChars: { start: '[', end: ']' }, + itemIndent: (ctx.indent || '') + ' ', + onChompKeep, + onComment + }); + } + static from(schema, obj, ctx) { + const { replacer } = ctx; + const seq = new this(schema); + if (obj && Symbol.iterator in Object(obj)) { + let i = 0; + for (let it of obj) { + if (typeof replacer === 'function') { + const key = obj instanceof Set ? it : String(i++); + it = replacer.call(obj, key, it); + } + seq.items.push(createNode(it, undefined, ctx)); + } + } + return seq; + } +} +function asItemIndex(key) { + let idx = isScalar$1(key) ? key.value : key; + if (idx && typeof idx === 'string') + idx = Number(idx); + return typeof idx === 'number' && Number.isInteger(idx) && idx >= 0 + ? idx + : null; +} + +const seq = { + collection: 'seq', + default: true, + nodeClass: YAMLSeq, + tag: 'tag:yaml.org,2002:seq', + resolve(seq, onError) { + if (!isSeq(seq)) + onError('Expected a sequence for this tag'); + return seq; + }, + createNode: (schema, obj, ctx) => YAMLSeq.from(schema, obj, ctx) +}; + +const string = { + identify: value => typeof value === 'string', + default: true, + tag: 'tag:yaml.org,2002:str', + resolve: str => str, + stringify(item, ctx, onComment, onChompKeep) { + ctx = Object.assign({ actualString: true }, ctx); + return stringifyString(item, ctx, onComment, onChompKeep); + } +}; + +const nullTag = { + identify: value => value == null, + createNode: () => new Scalar(null), + default: true, + tag: 'tag:yaml.org,2002:null', + test: /^(?:~|[Nn]ull|NULL)?$/, + resolve: () => new Scalar(null), + stringify: ({ source }, ctx) => typeof source === 'string' && nullTag.test.test(source) + ? source + : ctx.options.nullStr +}; + +const boolTag = { + identify: value => typeof value === 'boolean', + default: true, + tag: 'tag:yaml.org,2002:bool', + test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, + resolve: str => new Scalar(str[0] === 't' || str[0] === 'T'), + stringify({ source, value }, ctx) { + if (source && boolTag.test.test(source)) { + const sv = source[0] === 't' || source[0] === 'T'; + if (value === sv) + return source; + } + return value ? ctx.options.trueStr : ctx.options.falseStr; + } +}; + +function stringifyNumber({ format, minFractionDigits, tag, value }) { + if (typeof value === 'bigint') + return String(value); + const num = typeof value === 'number' ? value : Number(value); + if (!isFinite(num)) + return isNaN(num) ? '.nan' : num < 0 ? '-.inf' : '.inf'; + let n = JSON.stringify(value); + if (!format && + minFractionDigits && + (!tag || tag === 'tag:yaml.org,2002:float') && + /^\d/.test(n)) { + let i = n.indexOf('.'); + if (i < 0) { + i = n.length; + n += '.'; + } + let d = minFractionDigits - (n.length - i - 1); + while (d-- > 0) + n += '0'; + } + return n; +} + +const floatNaN$1 = { + identify: value => typeof value === 'number', + default: true, + tag: 'tag:yaml.org,2002:float', + test: /^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/, + resolve: str => str.slice(-3).toLowerCase() === 'nan' + ? NaN + : str[0] === '-' + ? Number.NEGATIVE_INFINITY + : Number.POSITIVE_INFINITY, + stringify: stringifyNumber +}; +const floatExp$1 = { + identify: value => typeof value === 'number', + default: true, + tag: 'tag:yaml.org,2002:float', + format: 'EXP', + test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, + resolve: str => parseFloat(str), + stringify(node) { + const num = Number(node.value); + return isFinite(num) ? num.toExponential() : stringifyNumber(node); + } +}; +const float$1 = { + identify: value => typeof value === 'number', + default: true, + tag: 'tag:yaml.org,2002:float', + test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/, + resolve(str) { + const node = new Scalar(parseFloat(str)); + const dot = str.indexOf('.'); + if (dot !== -1 && str[str.length - 1] === '0') + node.minFractionDigits = str.length - dot - 1; + return node; + }, + stringify: stringifyNumber +}; + +const intIdentify$2 = (value) => typeof value === 'bigint' || Number.isInteger(value); +const intResolve$1 = (str, offset, radix, { intAsBigInt }) => (intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix)); +function intStringify$1(node, radix, prefix) { + const { value } = node; + if (intIdentify$2(value) && value >= 0) + return prefix + value.toString(radix); + return stringifyNumber(node); +} +const intOct$1 = { + identify: value => intIdentify$2(value) && value >= 0, + default: true, + tag: 'tag:yaml.org,2002:int', + format: 'OCT', + test: /^0o[0-7]+$/, + resolve: (str, _onError, opt) => intResolve$1(str, 2, 8, opt), + stringify: node => intStringify$1(node, 8, '0o') +}; +const int$1 = { + identify: intIdentify$2, + default: true, + tag: 'tag:yaml.org,2002:int', + test: /^[-+]?[0-9]+$/, + resolve: (str, _onError, opt) => intResolve$1(str, 0, 10, opt), + stringify: stringifyNumber +}; +const intHex$1 = { + identify: value => intIdentify$2(value) && value >= 0, + default: true, + tag: 'tag:yaml.org,2002:int', + format: 'HEX', + test: /^0x[0-9a-fA-F]+$/, + resolve: (str, _onError, opt) => intResolve$1(str, 2, 16, opt), + stringify: node => intStringify$1(node, 16, '0x') +}; + +const schema$2 = [ + map$1, + seq, + string, + nullTag, + boolTag, + intOct$1, + int$1, + intHex$1, + floatNaN$1, + floatExp$1, + float$1 +]; + +function intIdentify$1(value) { + return typeof value === 'bigint' || Number.isInteger(value); +} +const stringifyJSON = ({ value }) => JSON.stringify(value); +const jsonScalars = [ + { + identify: value => typeof value === 'string', + default: true, + tag: 'tag:yaml.org,2002:str', + resolve: str => str, + stringify: stringifyJSON + }, + { + identify: value => value == null, + createNode: () => new Scalar(null), + default: true, + tag: 'tag:yaml.org,2002:null', + test: /^null$/, + resolve: () => null, + stringify: stringifyJSON + }, + { + identify: value => typeof value === 'boolean', + default: true, + tag: 'tag:yaml.org,2002:bool', + test: /^true|false$/, + resolve: str => str === 'true', + stringify: stringifyJSON + }, + { + identify: intIdentify$1, + default: true, + tag: 'tag:yaml.org,2002:int', + test: /^-?(?:0|[1-9][0-9]*)$/, + resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10), + stringify: ({ value }) => intIdentify$1(value) ? value.toString() : JSON.stringify(value) + }, + { + identify: value => typeof value === 'number', + default: true, + tag: 'tag:yaml.org,2002:float', + test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, + resolve: str => parseFloat(str), + stringify: stringifyJSON + } +]; +const jsonError = { + default: true, + tag: '', + test: /^/, + resolve(str, onError) { + onError(`Unresolved plain scalar ${JSON.stringify(str)}`); + return str; + } +}; +const schema$1 = [map$1, seq].concat(jsonScalars, jsonError); + +const binary = { + identify: value => value instanceof Uint8Array, + default: false, + tag: 'tag:yaml.org,2002:binary', + /** + * Returns a Buffer in node and an Uint8Array in browsers + * + * To use the resulting buffer as an image, you'll want to do something like: + * + * const blob = new Blob([buffer], { type: 'image/jpeg' }) + * document.querySelector('#photo').src = URL.createObjectURL(blob) + */ + resolve(src, onError) { + if (typeof Buffer === 'function') { + return Buffer.from(src, 'base64'); + } + else if (typeof atob === 'function') { + // On IE 11, atob() can't handle newlines + const str = atob(src.replace(/[\n\r]/g, '')); + const buffer = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) + buffer[i] = str.charCodeAt(i); + return buffer; + } + else { + onError('This environment does not support reading binary tags; either Buffer or atob is required'); + return src; + } + }, + stringify({ comment, type, value }, ctx, onComment, onChompKeep) { + const buf = value; // checked earlier by binary.identify() + let str; + if (typeof Buffer === 'function') { + str = + buf instanceof Buffer + ? buf.toString('base64') + : Buffer.from(buf.buffer).toString('base64'); + } + else if (typeof btoa === 'function') { + let s = ''; + for (let i = 0; i < buf.length; ++i) + s += String.fromCharCode(buf[i]); + str = btoa(s); + } + else { + throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required'); + } + if (!type) + type = Scalar.BLOCK_LITERAL; + if (type !== Scalar.QUOTE_DOUBLE) { + const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth); + const n = Math.ceil(str.length / lineWidth); + const lines = new Array(n); + for (let i = 0, o = 0; i < n; ++i, o += lineWidth) { + lines[i] = str.substr(o, lineWidth); + } + str = lines.join(type === Scalar.BLOCK_LITERAL ? '\n' : ' '); + } + return stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep); + } +}; + +function resolvePairs(seq, onError) { + if (isSeq(seq)) { + for (let i = 0; i < seq.items.length; ++i) { + let item = seq.items[i]; + if (isPair(item)) + continue; + else if (isMap(item)) { + if (item.items.length > 1) + onError('Each pair must have its own sequence indicator'); + const pair = item.items[0] || new Pair(new Scalar(null)); + if (item.commentBefore) + pair.key.commentBefore = pair.key.commentBefore + ? `${item.commentBefore}\n${pair.key.commentBefore}` + : item.commentBefore; + if (item.comment) { + const cn = pair.value ?? pair.key; + cn.comment = cn.comment + ? `${item.comment}\n${cn.comment}` + : item.comment; + } + item = pair; + } + seq.items[i] = isPair(item) ? item : new Pair(item); + } + } + else + onError('Expected a sequence for this tag'); + return seq; +} +function createPairs(schema, iterable, ctx) { + const { replacer } = ctx; + const pairs = new YAMLSeq(schema); + pairs.tag = 'tag:yaml.org,2002:pairs'; + let i = 0; + if (iterable && Symbol.iterator in Object(iterable)) + for (let it of iterable) { + if (typeof replacer === 'function') + it = replacer.call(iterable, String(i++), it); + let key, value; + if (Array.isArray(it)) { + if (it.length === 2) { + key = it[0]; + value = it[1]; + } + else + throw new TypeError(`Expected [key, value] tuple: ${it}`); + } + else if (it && it instanceof Object) { + const keys = Object.keys(it); + if (keys.length === 1) { + key = keys[0]; + value = it[key]; + } + else { + throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`); + } + } + else { + key = it; + } + pairs.items.push(createPair(key, value, ctx)); + } + return pairs; +} +const pairs = { + collection: 'seq', + default: false, + tag: 'tag:yaml.org,2002:pairs', + resolve: resolvePairs, + createNode: createPairs +}; + +class YAMLOMap extends YAMLSeq { + constructor() { + super(); + this.add = YAMLMap.prototype.add.bind(this); + this.delete = YAMLMap.prototype.delete.bind(this); + this.get = YAMLMap.prototype.get.bind(this); + this.has = YAMLMap.prototype.has.bind(this); + this.set = YAMLMap.prototype.set.bind(this); + this.tag = YAMLOMap.tag; + } + /** + * If `ctx` is given, the return type is actually `Map`, + * but TypeScript won't allow widening the signature of a child method. + */ + toJSON(_, ctx) { + if (!ctx) + return super.toJSON(_); + const map = new Map(); + if (ctx?.onCreate) + ctx.onCreate(map); + for (const pair of this.items) { + let key, value; + if (isPair(pair)) { + key = toJS(pair.key, '', ctx); + value = toJS(pair.value, key, ctx); + } + else { + key = toJS(pair, '', ctx); + } + if (map.has(key)) + throw new Error('Ordered maps must not include duplicate keys'); + map.set(key, value); + } + return map; + } + static from(schema, iterable, ctx) { + const pairs = createPairs(schema, iterable, ctx); + const omap = new this(); + omap.items = pairs.items; + return omap; + } +} +YAMLOMap.tag = 'tag:yaml.org,2002:omap'; +const omap = { + collection: 'seq', + identify: value => value instanceof Map, + nodeClass: YAMLOMap, + default: false, + tag: 'tag:yaml.org,2002:omap', + resolve(seq, onError) { + const pairs = resolvePairs(seq, onError); + const seenKeys = []; + for (const { key } of pairs.items) { + if (isScalar$1(key)) { + if (seenKeys.includes(key.value)) { + onError(`Ordered maps must not include duplicate keys: ${key.value}`); + } + else { + seenKeys.push(key.value); + } + } + } + return Object.assign(new YAMLOMap(), pairs); + }, + createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx) +}; + +function boolStringify({ value, source }, ctx) { + const boolObj = value ? trueTag : falseTag; + if (source && boolObj.test.test(source)) + return source; + return value ? ctx.options.trueStr : ctx.options.falseStr; +} +const trueTag = { + identify: value => value === true, + default: true, + tag: 'tag:yaml.org,2002:bool', + test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, + resolve: () => new Scalar(true), + stringify: boolStringify +}; +const falseTag = { + identify: value => value === false, + default: true, + tag: 'tag:yaml.org,2002:bool', + test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i, + resolve: () => new Scalar(false), + stringify: boolStringify +}; + +const floatNaN = { + identify: value => typeof value === 'number', + default: true, + tag: 'tag:yaml.org,2002:float', + test: /^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/, + resolve: (str) => str.slice(-3).toLowerCase() === 'nan' + ? NaN + : str[0] === '-' + ? Number.NEGATIVE_INFINITY + : Number.POSITIVE_INFINITY, + stringify: stringifyNumber +}; +const floatExp = { + identify: value => typeof value === 'number', + default: true, + tag: 'tag:yaml.org,2002:float', + format: 'EXP', + test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/, + resolve: (str) => parseFloat(str.replace(/_/g, '')), + stringify(node) { + const num = Number(node.value); + return isFinite(num) ? num.toExponential() : stringifyNumber(node); + } +}; +const float = { + identify: value => typeof value === 'number', + default: true, + tag: 'tag:yaml.org,2002:float', + test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/, + resolve(str) { + const node = new Scalar(parseFloat(str.replace(/_/g, ''))); + const dot = str.indexOf('.'); + if (dot !== -1) { + const f = str.substring(dot + 1).replace(/_/g, ''); + if (f[f.length - 1] === '0') + node.minFractionDigits = f.length; + } + return node; + }, + stringify: stringifyNumber +}; + +const intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value); +function intResolve(str, offset, radix, { intAsBigInt }) { + const sign = str[0]; + if (sign === '-' || sign === '+') + offset += 1; + str = str.substring(offset).replace(/_/g, ''); + if (intAsBigInt) { + switch (radix) { + case 2: + str = `0b${str}`; + break; + case 8: + str = `0o${str}`; + break; + case 16: + str = `0x${str}`; + break; + } + const n = BigInt(str); + return sign === '-' ? BigInt(-1) * n : n; + } + const n = parseInt(str, radix); + return sign === '-' ? -1 * n : n; +} +function intStringify(node, radix, prefix) { + const { value } = node; + if (intIdentify(value)) { + const str = value.toString(radix); + return value < 0 ? '-' + prefix + str.substr(1) : prefix + str; + } + return stringifyNumber(node); +} +const intBin = { + identify: intIdentify, + default: true, + tag: 'tag:yaml.org,2002:int', + format: 'BIN', + test: /^[-+]?0b[0-1_]+$/, + resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt), + stringify: node => intStringify(node, 2, '0b') +}; +const intOct = { + identify: intIdentify, + default: true, + tag: 'tag:yaml.org,2002:int', + format: 'OCT', + test: /^[-+]?0[0-7_]+$/, + resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt), + stringify: node => intStringify(node, 8, '0') +}; +const int = { + identify: intIdentify, + default: true, + tag: 'tag:yaml.org,2002:int', + test: /^[-+]?[0-9][0-9_]*$/, + resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt), + stringify: stringifyNumber +}; +const intHex = { + identify: intIdentify, + default: true, + tag: 'tag:yaml.org,2002:int', + format: 'HEX', + test: /^[-+]?0x[0-9a-fA-F_]+$/, + resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt), + stringify: node => intStringify(node, 16, '0x') +}; + +class YAMLSet extends YAMLMap { + constructor(schema) { + super(schema); + this.tag = YAMLSet.tag; + } + add(key) { + let pair; + if (isPair(key)) + pair = key; + else if (key && + typeof key === 'object' && + 'key' in key && + 'value' in key && + key.value === null) + pair = new Pair(key.key, null); + else + pair = new Pair(key, null); + const prev = findPair(this.items, pair.key); + if (!prev) + this.items.push(pair); + } + /** + * If `keepPair` is `true`, returns the Pair matching `key`. + * Otherwise, returns the value of that Pair's key. + */ + get(key, keepPair) { + const pair = findPair(this.items, key); + return !keepPair && isPair(pair) + ? isScalar$1(pair.key) + ? pair.key.value + : pair.key + : pair; + } + set(key, value) { + if (typeof value !== 'boolean') + throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`); + const prev = findPair(this.items, key); + if (prev && !value) { + this.items.splice(this.items.indexOf(prev), 1); + } + else if (!prev && value) { + this.items.push(new Pair(key)); + } + } + toJSON(_, ctx) { + return super.toJSON(_, ctx, Set); + } + toString(ctx, onComment, onChompKeep) { + if (!ctx) + return JSON.stringify(this); + if (this.hasAllNullValues(true)) + return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep); + else + throw new Error('Set items must all have null values'); + } + static from(schema, iterable, ctx) { + const { replacer } = ctx; + const set = new this(schema); + if (iterable && Symbol.iterator in Object(iterable)) + for (let value of iterable) { + if (typeof replacer === 'function') + value = replacer.call(iterable, value, value); + set.items.push(createPair(value, null, ctx)); + } + return set; + } +} +YAMLSet.tag = 'tag:yaml.org,2002:set'; +const set = { + collection: 'map', + identify: value => value instanceof Set, + nodeClass: YAMLSet, + default: false, + tag: 'tag:yaml.org,2002:set', + createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx), + resolve(map, onError) { + if (isMap(map)) { + if (map.hasAllNullValues(true)) + return Object.assign(new YAMLSet(), map); + else + onError('Set items must all have null values'); + } + else + onError('Expected a mapping for this tag'); + return map; + } +}; + +/** Internal types handle bigint as number, because TS can't figure it out. */ +function parseSexagesimal(str, asBigInt) { + const sign = str[0]; + const parts = sign === '-' || sign === '+' ? str.substring(1) : str; + const num = (n) => asBigInt ? BigInt(n) : Number(n); + const res = parts + .replace(/_/g, '') + .split(':') + .reduce((res, p) => res * num(60) + num(p), num(0)); + return (sign === '-' ? num(-1) * res : res); +} +/** + * hhhh:mm:ss.sss + * + * Internal types handle bigint as number, because TS can't figure it out. + */ +function stringifySexagesimal(node) { + let { value } = node; + let num = (n) => n; + if (typeof value === 'bigint') + num = n => BigInt(n); + else if (isNaN(value) || !isFinite(value)) + return stringifyNumber(node); + let sign = ''; + if (value < 0) { + sign = '-'; + value *= num(-1); + } + const _60 = num(60); + const parts = [value % _60]; // seconds, including ms + if (value < 60) { + parts.unshift(0); // at least one : is required + } + else { + value = (value - parts[0]) / _60; + parts.unshift(value % _60); // minutes + if (value >= 60) { + value = (value - parts[0]) / _60; + parts.unshift(value); // hours + } + } + return (sign + + parts + .map(n => String(n).padStart(2, '0')) + .join(':') + .replace(/000000\d*$/, '') // % 60 may introduce error + ); +} +const intTime = { + identify: value => typeof value === 'bigint' || Number.isInteger(value), + default: true, + tag: 'tag:yaml.org,2002:int', + format: 'TIME', + test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/, + resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt), + stringify: stringifySexagesimal +}; +const floatTime = { + identify: value => typeof value === 'number', + default: true, + tag: 'tag:yaml.org,2002:float', + format: 'TIME', + test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/, + resolve: str => parseSexagesimal(str, false), + stringify: stringifySexagesimal +}; +const timestamp = { + identify: value => value instanceof Date, + default: true, + tag: 'tag:yaml.org,2002:timestamp', + // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part + // may be omitted altogether, resulting in a date format. In such a case, the time part is + // assumed to be 00:00:00Z (start of day, UTC). + test: RegExp('^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd + '(?:' + // time is optional + '(?:t|T|[ \\t]+)' + // t | T | whitespace + '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)? + '(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30 + ')?$'), + resolve(str) { + const match = str.match(timestamp.test); + if (!match) + throw new Error('!!timestamp expects a date, starting with yyyy-mm-dd'); + const [, year, month, day, hour, minute, second] = match.map(Number); + const millisec = match[7] ? Number((match[7] + '00').substr(1, 3)) : 0; + let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec); + const tz = match[8]; + if (tz && tz !== 'Z') { + let d = parseSexagesimal(tz, false); + if (Math.abs(d) < 30) + d *= 60; + date -= 60000 * d; + } + return new Date(date); + }, + stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '') +}; + +const schema = [ + map$1, + seq, + string, + nullTag, + trueTag, + falseTag, + intBin, + intOct, + int, + intHex, + floatNaN, + floatExp, + float, + binary, + omap, + pairs, + set, + intTime, + floatTime, + timestamp +]; + +const schemas = new Map([ + ['core', schema$2], + ['failsafe', [map$1, seq, string]], + ['json', schema$1], + ['yaml11', schema], + ['yaml-1.1', schema] +]); +const tagsByName = { + binary, + bool: boolTag, + float: float$1, + floatExp: floatExp$1, + floatNaN: floatNaN$1, + floatTime, + int: int$1, + intHex: intHex$1, + intOct: intOct$1, + intTime, + map: map$1, + null: nullTag, + omap, + pairs, + seq, + set, + timestamp +}; +const coreKnownTags = { + 'tag:yaml.org,2002:binary': binary, + 'tag:yaml.org,2002:omap': omap, + 'tag:yaml.org,2002:pairs': pairs, + 'tag:yaml.org,2002:set': set, + 'tag:yaml.org,2002:timestamp': timestamp +}; +function getTags(customTags, schemaName) { + let tags = schemas.get(schemaName); + if (!tags) { + if (Array.isArray(customTags)) + tags = []; + else { + const keys = Array.from(schemas.keys()) + .filter(key => key !== 'yaml11') + .map(key => JSON.stringify(key)) + .join(', '); + throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`); + } + } + if (Array.isArray(customTags)) { + for (const tag of customTags) + tags = tags.concat(tag); + } + else if (typeof customTags === 'function') { + tags = customTags(tags.slice()); + } + return tags.map(tag => { + if (typeof tag !== 'string') + return tag; + const tagObj = tagsByName[tag]; + if (tagObj) + return tagObj; + const keys = Object.keys(tagsByName) + .map(key => JSON.stringify(key)) + .join(', '); + throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`); + }); +} + +const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0; +class Schema { + constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) { + this.compat = Array.isArray(compat) + ? getTags(compat, 'compat') + : compat + ? getTags(null, compat) + : null; + this.merge = !!merge; + this.name = (typeof schema === 'string' && schema) || 'core'; + this.knownTags = resolveKnownTags ? coreKnownTags : {}; + this.tags = getTags(customTags, this.name); + this.toStringOptions = toStringDefaults ?? null; + Object.defineProperty(this, MAP, { value: map$1 }); + Object.defineProperty(this, SCALAR$1, { value: string }); + Object.defineProperty(this, SEQ, { value: seq }); + // Used by createMap() + this.sortMapEntries = + typeof sortMapEntries === 'function' + ? sortMapEntries + : sortMapEntries === true + ? sortMapEntriesByKey + : null; + } + clone() { + const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this)); + copy.tags = this.tags.slice(); + return copy; + } +} + +function stringifyDocument(doc, options) { + const lines = []; + let hasDirectives = options.directives === true; + if (options.directives !== false && doc.directives) { + const dir = doc.directives.toString(doc); + if (dir) { + lines.push(dir); + hasDirectives = true; + } + else if (doc.directives.docStart) + hasDirectives = true; + } + if (hasDirectives) + lines.push('---'); + const ctx = createStringifyContext(doc, options); + const { commentString } = ctx.options; + if (doc.commentBefore) { + if (lines.length !== 1) + lines.unshift(''); + const cs = commentString(doc.commentBefore); + lines.unshift(indentComment(cs, '')); + } + let chompKeep = false; + let contentComment = null; + if (doc.contents) { + if (isNode$1(doc.contents)) { + if (doc.contents.spaceBefore && hasDirectives) + lines.push(''); + if (doc.contents.commentBefore) { + const cs = commentString(doc.contents.commentBefore); + lines.push(indentComment(cs, '')); + } + // top-level block scalars need to be indented if followed by a comment + ctx.forceBlockIndent = !!doc.comment; + contentComment = doc.contents.comment; + } + const onChompKeep = contentComment ? undefined : () => (chompKeep = true); + let body = stringify$2(doc.contents, ctx, () => (contentComment = null), onChompKeep); + if (contentComment) + body += lineComment(body, '', commentString(contentComment)); + if ((body[0] === '|' || body[0] === '>') && + lines[lines.length - 1] === '---') { + // Top-level block scalars with a preceding doc marker ought to use the + // same line for their header. + lines[lines.length - 1] = `--- ${body}`; + } + else + lines.push(body); + } + else { + lines.push(stringify$2(doc.contents, ctx)); + } + if (doc.directives?.docEnd) { + if (doc.comment) { + const cs = commentString(doc.comment); + if (cs.includes('\n')) { + lines.push('...'); + lines.push(indentComment(cs, '')); + } + else { + lines.push(`... ${cs}`); + } + } + else { + lines.push('...'); + } + } + else { + let dc = doc.comment; + if (dc && chompKeep) + dc = dc.replace(/^\n+/, ''); + if (dc) { + if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '') + lines.push(''); + lines.push(indentComment(commentString(dc), '')); + } + } + return lines.join('\n') + '\n'; +} + +class Document { + constructor(value, replacer, options) { + /** A comment before this Document */ + this.commentBefore = null; + /** A comment immediately after this Document */ + this.comment = null; + /** Errors encountered during parsing. */ + this.errors = []; + /** Warnings encountered during parsing. */ + this.warnings = []; + Object.defineProperty(this, NODE_TYPE, { value: DOC }); + let _replacer = null; + if (typeof replacer === 'function' || Array.isArray(replacer)) { + _replacer = replacer; + } + else if (options === undefined && replacer) { + options = replacer; + replacer = undefined; + } + const opt = Object.assign({ + intAsBigInt: false, + keepSourceTokens: false, + logLevel: 'warn', + prettyErrors: true, + strict: true, + uniqueKeys: true, + version: '1.2' + }, options); + this.options = opt; + let { version } = opt; + if (options?._directives) { + this.directives = options._directives.atDocument(); + if (this.directives.yaml.explicit) + version = this.directives.yaml.version; + } + else + this.directives = new Directives({ version }); + this.setSchema(version, options); + // @ts-expect-error We can't really know that this matches Contents. + this.contents = + value === undefined ? null : this.createNode(value, _replacer, options); + } + /** + * Create a deep copy of this Document and its contents. + * + * Custom Node values that inherit from `Object` still refer to their original instances. + */ + clone() { + const copy = Object.create(Document.prototype, { + [NODE_TYPE]: { value: DOC } + }); + copy.commentBefore = this.commentBefore; + copy.comment = this.comment; + copy.errors = this.errors.slice(); + copy.warnings = this.warnings.slice(); + copy.options = Object.assign({}, this.options); + if (this.directives) + copy.directives = this.directives.clone(); + copy.schema = this.schema.clone(); + // @ts-expect-error We can't really know that this matches Contents. + copy.contents = isNode$1(this.contents) + ? this.contents.clone(copy.schema) + : this.contents; + if (this.range) + copy.range = this.range.slice(); + return copy; + } + /** Adds a value to the document. */ + add(value) { + if (assertCollection(this.contents)) + this.contents.add(value); + } + /** Adds a value to the document. */ + addIn(path, value) { + if (assertCollection(this.contents)) + this.contents.addIn(path, value); + } + /** + * Create a new `Alias` node, ensuring that the target `node` has the required anchor. + * + * If `node` already has an anchor, `name` is ignored. + * Otherwise, the `node.anchor` value will be set to `name`, + * or if an anchor with that name is already present in the document, + * `name` will be used as a prefix for a new unique anchor. + * If `name` is undefined, the generated anchor will use 'a' as a prefix. + */ + createAlias(node, name) { + if (!node.anchor) { + const prev = anchorNames(this); + node.anchor = + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + !name || prev.has(name) ? findNewAnchor(name || 'a', prev) : name; + } + return new Alias(node.anchor); + } + createNode(value, replacer, options) { + let _replacer = undefined; + if (typeof replacer === 'function') { + value = replacer.call({ '': value }, '', value); + _replacer = replacer; + } + else if (Array.isArray(replacer)) { + const keyToStr = (v) => typeof v === 'number' || v instanceof String || v instanceof Number; + const asStr = replacer.filter(keyToStr).map(String); + if (asStr.length > 0) + replacer = replacer.concat(asStr); + _replacer = replacer; + } + else if (options === undefined && replacer) { + options = replacer; + replacer = undefined; + } + const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {}; + const { onAnchor, setAnchors, sourceObjects } = createNodeAnchors(this, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + anchorPrefix || 'a'); + const ctx = { + aliasDuplicateObjects: aliasDuplicateObjects ?? true, + keepUndefined: keepUndefined ?? false, + onAnchor, + onTagObj, + replacer: _replacer, + schema: this.schema, + sourceObjects + }; + const node = createNode(value, tag, ctx); + if (flow && isCollection$1(node)) + node.flow = true; + setAnchors(); + return node; + } + /** + * Convert a key and a value into a `Pair` using the current schema, + * recursively wrapping all values as `Scalar` or `Collection` nodes. + */ + createPair(key, value, options = {}) { + const k = this.createNode(key, null, options); + const v = this.createNode(value, null, options); + return new Pair(k, v); + } + /** + * Removes a value from the document. + * @returns `true` if the item was found and removed. + */ + delete(key) { + return assertCollection(this.contents) ? this.contents.delete(key) : false; + } + /** + * Removes a value from the document. + * @returns `true` if the item was found and removed. + */ + deleteIn(path) { + if (isEmptyPath(path)) { + if (this.contents == null) + return false; + // @ts-expect-error Presumed impossible if Strict extends false + this.contents = null; + return true; + } + return assertCollection(this.contents) + ? this.contents.deleteIn(path) + : false; + } + /** + * Returns item at `key`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + get(key, keepScalar) { + return isCollection$1(this.contents) + ? this.contents.get(key, keepScalar) + : undefined; + } + /** + * Returns item at `path`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + getIn(path, keepScalar) { + if (isEmptyPath(path)) + return !keepScalar && isScalar$1(this.contents) + ? this.contents.value + : this.contents; + return isCollection$1(this.contents) + ? this.contents.getIn(path, keepScalar) + : undefined; + } + /** + * Checks if the document includes a value with the key `key`. + */ + has(key) { + return isCollection$1(this.contents) ? this.contents.has(key) : false; + } + /** + * Checks if the document includes a value at `path`. + */ + hasIn(path) { + if (isEmptyPath(path)) + return this.contents !== undefined; + return isCollection$1(this.contents) ? this.contents.hasIn(path) : false; + } + /** + * Sets a value in this document. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + set(key, value) { + if (this.contents == null) { + // @ts-expect-error We can't really know that this matches Contents. + this.contents = collectionFromPath(this.schema, [key], value); + } + else if (assertCollection(this.contents)) { + this.contents.set(key, value); + } + } + /** + * Sets a value in this document. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + setIn(path, value) { + if (isEmptyPath(path)) { + // @ts-expect-error We can't really know that this matches Contents. + this.contents = value; + } + else if (this.contents == null) { + // @ts-expect-error We can't really know that this matches Contents. + this.contents = collectionFromPath(this.schema, Array.from(path), value); + } + else if (assertCollection(this.contents)) { + this.contents.setIn(path, value); + } + } + /** + * Change the YAML version and schema used by the document. + * A `null` version disables support for directives, explicit tags, anchors, and aliases. + * It also requires the `schema` option to be given as a `Schema` instance value. + * + * Overrides all previously set schema options. + */ + setSchema(version, options = {}) { + if (typeof version === 'number') + version = String(version); + let opt; + switch (version) { + case '1.1': + if (this.directives) + this.directives.yaml.version = '1.1'; + else + this.directives = new Directives({ version: '1.1' }); + opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' }; + break; + case '1.2': + case 'next': + if (this.directives) + this.directives.yaml.version = version; + else + this.directives = new Directives({ version }); + opt = { merge: false, resolveKnownTags: true, schema: 'core' }; + break; + case null: + if (this.directives) + delete this.directives; + opt = null; + break; + default: { + const sv = JSON.stringify(version); + throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`); + } + } + // Not using `instanceof Schema` to allow for duck typing + if (options.schema instanceof Object) + this.schema = options.schema; + else if (opt) + this.schema = new Schema(Object.assign(opt, options)); + else + throw new Error(`With a null YAML version, the { schema: Schema } option is required`); + } + // json & jsonArg are only used from toJSON() + toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { + const ctx = { + anchors: new Map(), + doc: this, + keep: !json, + mapAsMap: mapAsMap === true, + mapKeyWarned: false, + maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100 + }; + const res = toJS(this.contents, jsonArg ?? '', ctx); + if (typeof onAnchor === 'function') + for (const { count, res } of ctx.anchors.values()) + onAnchor(res, count); + return typeof reviver === 'function' + ? applyReviver(reviver, { '': res }, '', res) + : res; + } + /** + * A JSON representation of the document `contents`. + * + * @param jsonArg Used by `JSON.stringify` to indicate the array index or + * property name. + */ + toJSON(jsonArg, onAnchor) { + return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor }); + } + /** A YAML representation of the document. */ + toString(options = {}) { + if (this.errors.length > 0) + throw new Error('Document with errors cannot be stringified'); + if ('indent' in options && + (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) { + const s = JSON.stringify(options.indent); + throw new Error(`"indent" option must be a positive integer, not ${s}`); + } + return stringifyDocument(this, options); + } +} +function assertCollection(contents) { + if (isCollection$1(contents)) + return true; + throw new Error('Expected a YAML collection as document contents'); +} + +class YAMLError extends Error { + constructor(name, pos, code, message) { + super(); + this.name = name; + this.code = code; + this.message = message; + this.pos = pos; + } +} +class YAMLParseError extends YAMLError { + constructor(pos, code, message) { + super('YAMLParseError', pos, code, message); + } +} +class YAMLWarning extends YAMLError { + constructor(pos, code, message) { + super('YAMLWarning', pos, code, message); + } +} +const prettifyError = (src, lc) => (error) => { + if (error.pos[0] === -1) + return; + error.linePos = error.pos.map(pos => lc.linePos(pos)); + const { line, col } = error.linePos[0]; + error.message += ` at line ${line}, column ${col}`; + let ci = col - 1; + let lineStr = src + .substring(lc.lineStarts[line - 1], lc.lineStarts[line]) + .replace(/[\n\r]+$/, ''); + // Trim to max 80 chars, keeping col position near the middle + if (ci >= 60 && lineStr.length > 80) { + const trimStart = Math.min(ci - 39, lineStr.length - 79); + lineStr = '…' + lineStr.substring(trimStart); + ci -= trimStart - 1; + } + if (lineStr.length > 80) + lineStr = lineStr.substring(0, 79) + '…'; + // Include previous line in context if pointing at line start + if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) { + // Regexp won't match if start is trimmed + let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]); + if (prev.length > 80) + prev = prev.substring(0, 79) + '…\n'; + lineStr = prev + lineStr; + } + if (/[^ ]/.test(lineStr)) { + let count = 1; + const end = error.linePos[1]; + if (end && end.line === line && end.col > col) { + count = Math.max(1, Math.min(end.col - col, 80 - ci)); + } + const pointer = ' '.repeat(ci) + '^'.repeat(count); + error.message += `:\n\n${lineStr}\n${pointer}\n`; + } +}; + +function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnNewline }) { + let spaceBefore = false; + let atNewline = startOnNewline; + let hasSpace = startOnNewline; + let comment = ''; + let commentSep = ''; + let hasNewline = false; + let hasNewlineAfterProp = false; + let reqSpace = false; + let anchor = null; + let tag = null; + let comma = null; + let found = null; + let start = null; + for (const token of tokens) { + if (reqSpace) { + if (token.type !== 'space' && + token.type !== 'newline' && + token.type !== 'comma') + onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space'); + reqSpace = false; + } + switch (token.type) { + case 'space': + // At the doc level, tabs at line start may be parsed + // as leading white space rather than indentation. + // In a flow collection, only the parser handles indent. + if (!flow && + atNewline && + indicator !== 'doc-start' && + token.source[0] === '\t') + onError(token, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation'); + hasSpace = true; + break; + case 'comment': { + if (!hasSpace) + onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters'); + const cb = token.source.substring(1) || ' '; + if (!comment) + comment = cb; + else + comment += commentSep + cb; + commentSep = ''; + atNewline = false; + break; + } + case 'newline': + if (atNewline) { + if (comment) + comment += token.source; + else + spaceBefore = true; + } + else + commentSep += token.source; + atNewline = true; + hasNewline = true; + if (anchor || tag) + hasNewlineAfterProp = true; + hasSpace = true; + break; + case 'anchor': + if (anchor) + onError(token, 'MULTIPLE_ANCHORS', 'A node can have at most one anchor'); + if (token.source.endsWith(':')) + onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true); + anchor = token; + if (start === null) + start = token.offset; + atNewline = false; + hasSpace = false; + reqSpace = true; + break; + case 'tag': { + if (tag) + onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag'); + tag = token; + if (start === null) + start = token.offset; + atNewline = false; + hasSpace = false; + reqSpace = true; + break; + } + case indicator: + // Could here handle preceding comments differently + if (anchor || tag) + onError(token, 'BAD_PROP_ORDER', `Anchors and tags must be after the ${token.source} indicator`); + if (found) + onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow ?? 'collection'}`); + found = token; + atNewline = false; + hasSpace = false; + break; + case 'comma': + if (flow) { + if (comma) + onError(token, 'UNEXPECTED_TOKEN', `Unexpected , in ${flow}`); + comma = token; + atNewline = false; + hasSpace = false; + break; + } + // else fallthrough + default: + onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.type} token`); + atNewline = false; + hasSpace = false; + } + } + const last = tokens[tokens.length - 1]; + const end = last ? last.offset + last.source.length : offset; + if (reqSpace && + next && + next.type !== 'space' && + next.type !== 'newline' && + next.type !== 'comma' && + (next.type !== 'scalar' || next.source !== '')) + onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space'); + return { + comma, + found, + spaceBefore, + comment, + hasNewline, + hasNewlineAfterProp, + anchor, + tag, + end, + start: start ?? end + }; +} + +function containsNewline(key) { + if (!key) + return null; + switch (key.type) { + case 'alias': + case 'scalar': + case 'double-quoted-scalar': + case 'single-quoted-scalar': + if (key.source.includes('\n')) + return true; + if (key.end) + for (const st of key.end) + if (st.type === 'newline') + return true; + return false; + case 'flow-collection': + for (const it of key.items) { + for (const st of it.start) + if (st.type === 'newline') + return true; + if (it.sep) + for (const st of it.sep) + if (st.type === 'newline') + return true; + if (containsNewline(it.key) || containsNewline(it.value)) + return true; + } + return false; + default: + return true; + } +} + +function flowIndentCheck(indent, fc, onError) { + if (fc?.type === 'flow-collection') { + const end = fc.end[0]; + if (end.indent === indent && + (end.source === ']' || end.source === '}') && + containsNewline(fc)) { + const msg = 'Flow end indicator should be more indented than parent'; + onError(end, 'BAD_INDENT', msg, true); + } + } +} + +function mapIncludes(ctx, items, search) { + const { uniqueKeys } = ctx.options; + if (uniqueKeys === false) + return false; + const isEqual = typeof uniqueKeys === 'function' + ? uniqueKeys + : (a, b) => a === b || + (isScalar$1(a) && + isScalar$1(b) && + a.value === b.value && + !(a.value === '<<' && ctx.schema.merge)); + return items.some(pair => isEqual(pair.key, search)); +} + +const startColMsg = 'All mapping items must start at the same column'; +function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) { + const NodeClass = tag?.nodeClass ?? YAMLMap; + const map = new NodeClass(ctx.schema); + if (ctx.atRoot) + ctx.atRoot = false; + let offset = bm.offset; + let commentEnd = null; + for (const collItem of bm.items) { + const { start, key, sep, value } = collItem; + // key properties + const keyProps = resolveProps(start, { + indicator: 'explicit-key-ind', + next: key ?? sep?.[0], + offset, + onError, + startOnNewline: true + }); + const implicitKey = !keyProps.found; + if (implicitKey) { + if (key) { + if (key.type === 'block-seq') + onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'A block sequence may not be used as an implicit map key'); + else if ('indent' in key && key.indent !== bm.indent) + onError(offset, 'BAD_INDENT', startColMsg); + } + if (!keyProps.anchor && !keyProps.tag && !sep) { + commentEnd = keyProps.end; + if (keyProps.comment) { + if (map.comment) + map.comment += '\n' + keyProps.comment; + else + map.comment = keyProps.comment; + } + continue; + } + if (keyProps.hasNewlineAfterProp || containsNewline(key)) { + onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line'); + } + } + else if (keyProps.found?.indent !== bm.indent) { + onError(offset, 'BAD_INDENT', startColMsg); + } + // key value + const keyStart = keyProps.end; + const keyNode = key + ? composeNode(ctx, key, keyProps, onError) + : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError); + if (ctx.schema.compat) + flowIndentCheck(bm.indent, key, onError); + if (mapIncludes(ctx, map.items, keyNode)) + onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique'); + // value properties + const valueProps = resolveProps(sep ?? [], { + indicator: 'map-value-ind', + next: value, + offset: keyNode.range[2], + onError, + startOnNewline: !key || key.type === 'block-scalar' + }); + offset = valueProps.end; + if (valueProps.found) { + if (implicitKey) { + if (value?.type === 'block-map' && !valueProps.hasNewline) + onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'Nested mappings are not allowed in compact mappings'); + if (ctx.options.strict && + keyProps.start < valueProps.found.offset - 1024) + onError(keyNode.range, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit block mapping key'); + } + // value value + const valueNode = value + ? composeNode(ctx, value, valueProps, onError) + : composeEmptyNode(ctx, offset, sep, null, valueProps, onError); + if (ctx.schema.compat) + flowIndentCheck(bm.indent, value, onError); + offset = valueNode.range[2]; + const pair = new Pair(keyNode, valueNode); + if (ctx.options.keepSourceTokens) + pair.srcToken = collItem; + map.items.push(pair); + } + else { + // key with no value + if (implicitKey) + onError(keyNode.range, 'MISSING_CHAR', 'Implicit map keys need to be followed by map values'); + if (valueProps.comment) { + if (keyNode.comment) + keyNode.comment += '\n' + valueProps.comment; + else + keyNode.comment = valueProps.comment; + } + const pair = new Pair(keyNode); + if (ctx.options.keepSourceTokens) + pair.srcToken = collItem; + map.items.push(pair); + } + } + if (commentEnd && commentEnd < offset) + onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content'); + map.range = [bm.offset, offset, commentEnd ?? offset]; + return map; +} + +function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) { + const NodeClass = tag?.nodeClass ?? YAMLSeq; + const seq = new NodeClass(ctx.schema); + if (ctx.atRoot) + ctx.atRoot = false; + let offset = bs.offset; + let commentEnd = null; + for (const { start, value } of bs.items) { + const props = resolveProps(start, { + indicator: 'seq-item-ind', + next: value, + offset, + onError, + startOnNewline: true + }); + if (!props.found) { + if (props.anchor || props.tag || value) { + if (value && value.type === 'block-seq') + onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column'); + else + onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator'); + } + else { + commentEnd = props.end; + if (props.comment) + seq.comment = props.comment; + continue; + } + } + const node = value + ? composeNode(ctx, value, props, onError) + : composeEmptyNode(ctx, props.end, start, null, props, onError); + if (ctx.schema.compat) + flowIndentCheck(bs.indent, value, onError); + offset = node.range[2]; + seq.items.push(node); + } + seq.range = [bs.offset, offset, commentEnd ?? offset]; + return seq; +} + +function resolveEnd(end, offset, reqSpace, onError) { + let comment = ''; + if (end) { + let hasSpace = false; + let sep = ''; + for (const token of end) { + const { source, type } = token; + switch (type) { + case 'space': + hasSpace = true; + break; + case 'comment': { + if (reqSpace && !hasSpace) + onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters'); + const cb = source.substring(1) || ' '; + if (!comment) + comment = cb; + else + comment += sep + cb; + sep = ''; + break; + } + case 'newline': + if (comment) + sep += source; + hasSpace = true; + break; + default: + onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`); + } + offset += source.length; + } + } + return { comment, offset }; +} + +const blockMsg = 'Block collections are not allowed within flow collections'; +const isBlock$1 = (token) => token && (token.type === 'block-map' || token.type === 'block-seq'); +function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) { + const isMap = fc.start.source === '{'; + const fcName = isMap ? 'flow map' : 'flow sequence'; + const NodeClass = (tag?.nodeClass ?? (isMap ? YAMLMap : YAMLSeq)); + const coll = new NodeClass(ctx.schema); + coll.flow = true; + const atRoot = ctx.atRoot; + if (atRoot) + ctx.atRoot = false; + let offset = fc.offset + fc.start.source.length; + for (let i = 0; i < fc.items.length; ++i) { + const collItem = fc.items[i]; + const { start, key, sep, value } = collItem; + const props = resolveProps(start, { + flow: fcName, + indicator: 'explicit-key-ind', + next: key ?? sep?.[0], + offset, + onError, + startOnNewline: false + }); + if (!props.found) { + if (!props.anchor && !props.tag && !sep && !value) { + if (i === 0 && props.comma) + onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`); + else if (i < fc.items.length - 1) + onError(props.start, 'UNEXPECTED_TOKEN', `Unexpected empty item in ${fcName}`); + if (props.comment) { + if (coll.comment) + coll.comment += '\n' + props.comment; + else + coll.comment = props.comment; + } + offset = props.end; + continue; + } + if (!isMap && ctx.options.strict && containsNewline(key)) + onError(key, // checked by containsNewline() + 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line'); + } + if (i === 0) { + if (props.comma) + onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`); + } + else { + if (!props.comma) + onError(props.start, 'MISSING_CHAR', `Missing , between ${fcName} items`); + if (props.comment) { + let prevItemComment = ''; + loop: for (const st of start) { + switch (st.type) { + case 'comma': + case 'space': + break; + case 'comment': + prevItemComment = st.source.substring(1); + break loop; + default: + break loop; + } + } + if (prevItemComment) { + let prev = coll.items[coll.items.length - 1]; + if (isPair(prev)) + prev = prev.value ?? prev.key; + if (prev.comment) + prev.comment += '\n' + prevItemComment; + else + prev.comment = prevItemComment; + props.comment = props.comment.substring(prevItemComment.length + 1); + } + } + } + if (!isMap && !sep && !props.found) { + // item is a value in a seq + // → key & sep are empty, start does not include ? or : + const valueNode = value + ? composeNode(ctx, value, props, onError) + : composeEmptyNode(ctx, props.end, sep, null, props, onError); + coll.items.push(valueNode); + offset = valueNode.range[2]; + if (isBlock$1(value)) + onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg); + } + else { + // item is a key+value pair + // key value + const keyStart = props.end; + const keyNode = key + ? composeNode(ctx, key, props, onError) + : composeEmptyNode(ctx, keyStart, start, null, props, onError); + if (isBlock$1(key)) + onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg); + // value properties + const valueProps = resolveProps(sep ?? [], { + flow: fcName, + indicator: 'map-value-ind', + next: value, + offset: keyNode.range[2], + onError, + startOnNewline: false + }); + if (valueProps.found) { + if (!isMap && !props.found && ctx.options.strict) { + if (sep) + for (const st of sep) { + if (st === valueProps.found) + break; + if (st.type === 'newline') { + onError(st, 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line'); + break; + } + } + if (props.start < valueProps.found.offset - 1024) + onError(valueProps.found, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit flow sequence key'); + } + } + else if (value) { + if ('source' in value && value.source && value.source[0] === ':') + onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`); + else + onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`); + } + // value value + const valueNode = value + ? composeNode(ctx, value, valueProps, onError) + : valueProps.found + ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError) + : null; + if (valueNode) { + if (isBlock$1(value)) + onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg); + } + else if (valueProps.comment) { + if (keyNode.comment) + keyNode.comment += '\n' + valueProps.comment; + else + keyNode.comment = valueProps.comment; + } + const pair = new Pair(keyNode, valueNode); + if (ctx.options.keepSourceTokens) + pair.srcToken = collItem; + if (isMap) { + const map = coll; + if (mapIncludes(ctx, map.items, keyNode)) + onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique'); + map.items.push(pair); + } + else { + const map = new YAMLMap(ctx.schema); + map.flow = true; + map.items.push(pair); + coll.items.push(map); + } + offset = valueNode ? valueNode.range[2] : valueProps.end; + } + } + const expectedEnd = isMap ? '}' : ']'; + const [ce, ...ee] = fc.end; + let cePos = offset; + if (ce && ce.source === expectedEnd) + cePos = ce.offset + ce.source.length; + else { + const name = fcName[0].toUpperCase() + fcName.substring(1); + const msg = atRoot + ? `${name} must end with a ${expectedEnd}` + : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`; + onError(offset, atRoot ? 'MISSING_CHAR' : 'BAD_INDENT', msg); + if (ce && ce.source.length !== 1) + ee.unshift(ce); + } + if (ee.length > 0) { + const end = resolveEnd(ee, cePos, ctx.options.strict, onError); + if (end.comment) { + if (coll.comment) + coll.comment += '\n' + end.comment; + else + coll.comment = end.comment; + } + coll.range = [fc.offset, cePos, end.offset]; + } + else { + coll.range = [fc.offset, cePos, cePos]; + } + return coll; +} + +function resolveCollection(CN, ctx, token, onError, tagName, tag) { + const coll = token.type === 'block-map' + ? resolveBlockMap(CN, ctx, token, onError, tag) + : token.type === 'block-seq' + ? resolveBlockSeq(CN, ctx, token, onError, tag) + : resolveFlowCollection(CN, ctx, token, onError, tag); + const Coll = coll.constructor; + // If we got a tagName matching the class, or the tag name is '!', + // then use the tagName from the node class used to create it. + if (tagName === '!' || tagName === Coll.tagName) { + coll.tag = Coll.tagName; + return coll; + } + if (tagName) + coll.tag = tagName; + return coll; +} +function composeCollection(CN, ctx, token, tagToken, onError) { + const tagName = !tagToken + ? null + : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg)); + const expType = token.type === 'block-map' + ? 'map' + : token.type === 'block-seq' + ? 'seq' + : token.start.source === '{' + ? 'map' + : 'seq'; + // shortcut: check if it's a generic YAMLMap or YAMLSeq + // before jumping into the custom tag logic. + if (!tagToken || + !tagName || + tagName === '!' || + (tagName === YAMLMap.tagName && expType === 'map') || + (tagName === YAMLSeq.tagName && expType === 'seq') || + !expType) { + return resolveCollection(CN, ctx, token, onError, tagName); + } + let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType); + if (!tag) { + const kt = ctx.schema.knownTags[tagName]; + if (kt && kt.collection === expType) { + ctx.schema.tags.push(Object.assign({}, kt, { default: false })); + tag = kt; + } + else { + if (kt?.collection) { + onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true); + } + else { + onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true); + } + return resolveCollection(CN, ctx, token, onError, tagName); + } + } + const coll = resolveCollection(CN, ctx, token, onError, tagName, tag); + const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll; + const node = isNode$1(res) + ? res + : new Scalar(res); + node.range = coll.range; + node.tag = tagName; + if (tag?.format) + node.format = tag.format; + return node; +} + +function resolveBlockScalar(scalar, strict, onError) { + const start = scalar.offset; + const header = parseBlockScalarHeader(scalar, strict, onError); + if (!header) + return { value: '', type: null, comment: '', range: [start, start, start] }; + const type = header.mode === '>' ? Scalar.BLOCK_FOLDED : Scalar.BLOCK_LITERAL; + const lines = scalar.source ? splitLines(scalar.source) : []; + // determine the end of content & start of chomping + let chompStart = lines.length; + for (let i = lines.length - 1; i >= 0; --i) { + const content = lines[i][1]; + if (content === '' || content === '\r') + chompStart = i; + else + break; + } + // shortcut for empty contents + if (chompStart === 0) { + const value = header.chomp === '+' && lines.length > 0 + ? '\n'.repeat(Math.max(1, lines.length - 1)) + : ''; + let end = start + header.length; + if (scalar.source) + end += scalar.source.length; + return { value, type, comment: header.comment, range: [start, end, end] }; + } + // find the indentation level to trim from start + let trimIndent = scalar.indent + header.indent; + let offset = scalar.offset + header.length; + let contentStart = 0; + for (let i = 0; i < chompStart; ++i) { + const [indent, content] = lines[i]; + if (content === '' || content === '\r') { + if (header.indent === 0 && indent.length > trimIndent) + trimIndent = indent.length; + } + else { + if (indent.length < trimIndent) { + const message = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator'; + onError(offset + indent.length, 'MISSING_CHAR', message); + } + if (header.indent === 0) + trimIndent = indent.length; + contentStart = i; + break; + } + offset += indent.length + content.length + 1; + } + // include trailing more-indented empty lines in content + for (let i = lines.length - 1; i >= chompStart; --i) { + if (lines[i][0].length > trimIndent) + chompStart = i + 1; + } + let value = ''; + let sep = ''; + let prevMoreIndented = false; + // leading whitespace is kept intact + for (let i = 0; i < contentStart; ++i) + value += lines[i][0].slice(trimIndent) + '\n'; + for (let i = contentStart; i < chompStart; ++i) { + let [indent, content] = lines[i]; + offset += indent.length + content.length + 1; + const crlf = content[content.length - 1] === '\r'; + if (crlf) + content = content.slice(0, -1); + /* istanbul ignore if already caught in lexer */ + if (content && indent.length < trimIndent) { + const src = header.indent + ? 'explicit indentation indicator' + : 'first line'; + const message = `Block scalar lines must not be less indented than their ${src}`; + onError(offset - content.length - (crlf ? 2 : 1), 'BAD_INDENT', message); + indent = ''; + } + if (type === Scalar.BLOCK_LITERAL) { + value += sep + indent.slice(trimIndent) + content; + sep = '\n'; + } + else if (indent.length > trimIndent || content[0] === '\t') { + // more-indented content within a folded block + if (sep === ' ') + sep = '\n'; + else if (!prevMoreIndented && sep === '\n') + sep = '\n\n'; + value += sep + indent.slice(trimIndent) + content; + sep = '\n'; + prevMoreIndented = true; + } + else if (content === '') { + // empty line + if (sep === '\n') + value += '\n'; + else + sep = '\n'; + } + else { + value += sep + content; + sep = ' '; + prevMoreIndented = false; + } + } + switch (header.chomp) { + case '-': + break; + case '+': + for (let i = chompStart; i < lines.length; ++i) + value += '\n' + lines[i][0].slice(trimIndent); + if (value[value.length - 1] !== '\n') + value += '\n'; + break; + default: + value += '\n'; + } + const end = start + header.length + scalar.source.length; + return { value, type, comment: header.comment, range: [start, end, end] }; +} +function parseBlockScalarHeader({ offset, props }, strict, onError) { + /* istanbul ignore if should not happen */ + if (props[0].type !== 'block-scalar-header') { + onError(props[0], 'IMPOSSIBLE', 'Block scalar header not found'); + return null; + } + const { source } = props[0]; + const mode = source[0]; + let indent = 0; + let chomp = ''; + let error = -1; + for (let i = 1; i < source.length; ++i) { + const ch = source[i]; + if (!chomp && (ch === '-' || ch === '+')) + chomp = ch; + else { + const n = Number(ch); + if (!indent && n) + indent = n; + else if (error === -1) + error = offset + i; + } + } + if (error !== -1) + onError(error, 'UNEXPECTED_TOKEN', `Block scalar header includes extra characters: ${source}`); + let hasSpace = false; + let comment = ''; + let length = source.length; + for (let i = 1; i < props.length; ++i) { + const token = props[i]; + switch (token.type) { + case 'space': + hasSpace = true; + // fallthrough + case 'newline': + length += token.source.length; + break; + case 'comment': + if (strict && !hasSpace) { + const message = 'Comments must be separated from other tokens by white space characters'; + onError(token, 'MISSING_CHAR', message); + } + length += token.source.length; + comment = token.source.substring(1); + break; + case 'error': + onError(token, 'UNEXPECTED_TOKEN', token.message); + length += token.source.length; + break; + /* istanbul ignore next should not happen */ + default: { + const message = `Unexpected token in block scalar header: ${token.type}`; + onError(token, 'UNEXPECTED_TOKEN', message); + const ts = token.source; + if (ts && typeof ts === 'string') + length += ts.length; + } + } + } + return { mode, indent, chomp, comment, length }; +} +/** @returns Array of lines split up as `[indent, content]` */ +function splitLines(source) { + const split = source.split(/\n( *)/); + const first = split[0]; + const m = first.match(/^( *)/); + const line0 = m?.[1] + ? [m[1], first.slice(m[1].length)] + : ['', first]; + const lines = [line0]; + for (let i = 1; i < split.length; i += 2) + lines.push([split[i], split[i + 1]]); + return lines; +} + +function resolveFlowScalar(scalar, strict, onError) { + const { offset, type, source, end } = scalar; + let _type; + let value; + const _onError = (rel, code, msg) => onError(offset + rel, code, msg); + switch (type) { + case 'scalar': + _type = Scalar.PLAIN; + value = plainValue(source, _onError); + break; + case 'single-quoted-scalar': + _type = Scalar.QUOTE_SINGLE; + value = singleQuotedValue(source, _onError); + break; + case 'double-quoted-scalar': + _type = Scalar.QUOTE_DOUBLE; + value = doubleQuotedValue(source, _onError); + break; + /* istanbul ignore next should not happen */ + default: + onError(scalar, 'UNEXPECTED_TOKEN', `Expected a flow scalar value, but found: ${type}`); + return { + value: '', + type: null, + comment: '', + range: [offset, offset + source.length, offset + source.length] + }; + } + const valueEnd = offset + source.length; + const re = resolveEnd(end, valueEnd, strict, onError); + return { + value, + type: _type, + comment: re.comment, + range: [offset, valueEnd, re.offset] + }; +} +function plainValue(source, onError) { + let badChar = ''; + switch (source[0]) { + /* istanbul ignore next should not happen */ + case '\t': + badChar = 'a tab character'; + break; + case ',': + badChar = 'flow indicator character ,'; + break; + case '%': + badChar = 'directive indicator character %'; + break; + case '|': + case '>': { + badChar = `block scalar indicator ${source[0]}`; + break; + } + case '@': + case '`': { + badChar = `reserved character ${source[0]}`; + break; + } + } + if (badChar) + onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`); + return foldLines(source); +} +function singleQuotedValue(source, onError) { + if (source[source.length - 1] !== "'" || source.length === 1) + onError(source.length, 'MISSING_CHAR', "Missing closing 'quote"); + return foldLines(source.slice(1, -1)).replace(/''/g, "'"); +} +function foldLines(source) { + /** + * The negative lookbehind here and in the `re` RegExp is to + * prevent causing a polynomial search time in certain cases. + * + * The try-catch is for Safari, which doesn't support this yet: + * https://caniuse.com/js-regexp-lookbehind + */ + let first, line; + try { + first = new RegExp('(.*?)(? wsStart ? source.slice(wsStart, i + 1) : ch; + } + else { + res += ch; + } + } + if (source[source.length - 1] !== '"' || source.length === 1) + onError(source.length, 'MISSING_CHAR', 'Missing closing "quote'); + return res; +} +/** + * Fold a single newline into a space, multiple newlines to N - 1 newlines. + * Presumes `source[offset] === '\n'` + */ +function foldNewline(source, offset) { + let fold = ''; + let ch = source[offset + 1]; + while (ch === ' ' || ch === '\t' || ch === '\n' || ch === '\r') { + if (ch === '\r' && source[offset + 2] !== '\n') + break; + if (ch === '\n') + fold += '\n'; + offset += 1; + ch = source[offset + 1]; + } + if (!fold) + fold = ' '; + return { fold, offset }; +} +const escapeCodes = { + '0': '\0', + a: '\x07', + b: '\b', + e: '\x1b', + f: '\f', + n: '\n', + r: '\r', + t: '\t', + v: '\v', + N: '\u0085', + _: '\u00a0', + L: '\u2028', + P: '\u2029', + ' ': ' ', + '"': '"', + '/': '/', + '\\': '\\', + '\t': '\t' +}; +function parseCharCode(source, offset, length, onError) { + const cc = source.substr(offset, length); + const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc); + const code = ok ? parseInt(cc, 16) : NaN; + if (isNaN(code)) { + const raw = source.substr(offset - 2, length + 2); + onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`); + return raw; + } + return String.fromCodePoint(code); +} + +function composeScalar(ctx, token, tagToken, onError) { + const { value, type, comment, range } = token.type === 'block-scalar' + ? resolveBlockScalar(token, ctx.options.strict, onError) + : resolveFlowScalar(token, ctx.options.strict, onError); + const tagName = tagToken + ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg)) + : null; + const tag = tagToken && tagName + ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError) + : token.type === 'scalar' + ? findScalarTagByTest(ctx, value, token, onError) + : ctx.schema[SCALAR$1]; + let scalar; + try { + const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options); + scalar = isScalar$1(res) ? res : new Scalar(res); + } + catch (error) { + const msg = error instanceof Error ? error.message : String(error); + onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg); + scalar = new Scalar(value); + } + scalar.range = range; + scalar.source = value; + if (type) + scalar.type = type; + if (tagName) + scalar.tag = tagName; + if (tag.format) + scalar.format = tag.format; + if (comment) + scalar.comment = comment; + return scalar; +} +function findScalarTagByName(schema, value, tagName, tagToken, onError) { + if (tagName === '!') + return schema[SCALAR$1]; // non-specific tag + const matchWithTest = []; + for (const tag of schema.tags) { + if (!tag.collection && tag.tag === tagName) { + if (tag.default && tag.test) + matchWithTest.push(tag); + else + return tag; + } + } + for (const tag of matchWithTest) + if (tag.test?.test(value)) + return tag; + const kt = schema.knownTags[tagName]; + if (kt && !kt.collection) { + // Ensure that the known tag is available for stringifying, + // but does not get used by default. + schema.tags.push(Object.assign({}, kt, { default: false, test: undefined })); + return kt; + } + onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str'); + return schema[SCALAR$1]; +} +function findScalarTagByTest({ directives, schema }, value, token, onError) { + const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1]; + if (schema.compat) { + const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ?? + schema[SCALAR$1]; + if (tag.tag !== compat.tag) { + const ts = directives.tagString(tag.tag); + const cs = directives.tagString(compat.tag); + const msg = `Value may be parsed as either ${ts} or ${cs}`; + onError(token, 'TAG_RESOLVE_FAILED', msg, true); + } + } + return tag; +} + +function emptyScalarPosition(offset, before, pos) { + if (before) { + if (pos === null) + pos = before.length; + for (let i = pos - 1; i >= 0; --i) { + let st = before[i]; + switch (st.type) { + case 'space': + case 'comment': + case 'newline': + offset -= st.source.length; + continue; + } + // Technically, an empty scalar is immediately after the last non-empty + // node, but it's more useful to place it after any whitespace. + st = before[++i]; + while (st?.type === 'space') { + offset += st.source.length; + st = before[++i]; + } + break; + } + } + return offset; +} + +const CN = { composeNode, composeEmptyNode }; +function composeNode(ctx, token, props, onError) { + const { spaceBefore, comment, anchor, tag } = props; + let node; + let isSrcToken = true; + switch (token.type) { + case 'alias': + node = composeAlias(ctx, token, onError); + if (anchor || tag) + onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties'); + break; + case 'scalar': + case 'single-quoted-scalar': + case 'double-quoted-scalar': + case 'block-scalar': + node = composeScalar(ctx, token, tag, onError); + if (anchor) + node.anchor = anchor.source.substring(1); + break; + case 'block-map': + case 'block-seq': + case 'flow-collection': + node = composeCollection(CN, ctx, token, tag, onError); + if (anchor) + node.anchor = anchor.source.substring(1); + break; + default: { + const message = token.type === 'error' + ? token.message + : `Unsupported token (type: ${token.type})`; + onError(token, 'UNEXPECTED_TOKEN', message); + node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError); + isSrcToken = false; + } + } + if (anchor && node.anchor === '') + onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string'); + if (spaceBefore) + node.spaceBefore = true; + if (comment) { + if (token.type === 'scalar' && token.source === '') + node.comment = comment; + else + node.commentBefore = comment; + } + // @ts-expect-error Type checking misses meaning of isSrcToken + if (ctx.options.keepSourceTokens && isSrcToken) + node.srcToken = token; + return node; +} +function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) { + const token = { + type: 'scalar', + offset: emptyScalarPosition(offset, before, pos), + indent: -1, + source: '' + }; + const node = composeScalar(ctx, token, tag, onError); + if (anchor) { + node.anchor = anchor.source.substring(1); + if (node.anchor === '') + onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string'); + } + if (spaceBefore) + node.spaceBefore = true; + if (comment) { + node.comment = comment; + node.range[2] = end; + } + return node; +} +function composeAlias({ options }, { offset, source, end }, onError) { + const alias = new Alias(source.substring(1)); + if (alias.source === '') + onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string'); + if (alias.source.endsWith(':')) + onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true); + const valueEnd = offset + source.length; + const re = resolveEnd(end, valueEnd, options.strict, onError); + alias.range = [offset, valueEnd, re.offset]; + if (re.comment) + alias.comment = re.comment; + return alias; +} + +function composeDoc(options, directives, { offset, start, value, end }, onError) { + const opts = Object.assign({ _directives: directives }, options); + const doc = new Document(undefined, opts); + const ctx = { + atRoot: true, + directives: doc.directives, + options: doc.options, + schema: doc.schema + }; + const props = resolveProps(start, { + indicator: 'doc-start', + next: value ?? end?.[0], + offset, + onError, + startOnNewline: true + }); + if (props.found) { + doc.directives.docStart = true; + if (value && + (value.type === 'block-map' || value.type === 'block-seq') && + !props.hasNewline) + onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker'); + } + // @ts-expect-error If Contents is set, let's trust the user + doc.contents = value + ? composeNode(ctx, value, props, onError) + : composeEmptyNode(ctx, props.end, start, null, props, onError); + const contentEnd = doc.contents.range[2]; + const re = resolveEnd(end, contentEnd, false, onError); + if (re.comment) + doc.comment = re.comment; + doc.range = [offset, contentEnd, re.offset]; + return doc; +} + +function getErrorPos(src) { + if (typeof src === 'number') + return [src, src + 1]; + if (Array.isArray(src)) + return src.length === 2 ? src : [src[0], src[1]]; + const { offset, source } = src; + return [offset, offset + (typeof source === 'string' ? source.length : 1)]; +} +function parsePrelude(prelude) { + let comment = ''; + let atComment = false; + let afterEmptyLine = false; + for (let i = 0; i < prelude.length; ++i) { + const source = prelude[i]; + switch (source[0]) { + case '#': + comment += + (comment === '' ? '' : afterEmptyLine ? '\n\n' : '\n') + + (source.substring(1) || ' '); + atComment = true; + afterEmptyLine = false; + break; + case '%': + if (prelude[i + 1]?.[0] !== '#') + i += 1; + atComment = false; + break; + default: + // This may be wrong after doc-end, but in that case it doesn't matter + if (!atComment) + afterEmptyLine = true; + atComment = false; + } + } + return { comment, afterEmptyLine }; +} +/** + * Compose a stream of CST nodes into a stream of YAML Documents. + * + * ```ts + * import { Composer, Parser } from 'yaml' + * + * const src: string = ... + * const tokens = new Parser().parse(src) + * const docs = new Composer().compose(tokens) + * ``` + */ +class Composer { + constructor(options = {}) { + this.doc = null; + this.atDirectives = false; + this.prelude = []; + this.errors = []; + this.warnings = []; + this.onError = (source, code, message, warning) => { + const pos = getErrorPos(source); + if (warning) + this.warnings.push(new YAMLWarning(pos, code, message)); + else + this.errors.push(new YAMLParseError(pos, code, message)); + }; + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + this.directives = new Directives({ version: options.version || '1.2' }); + this.options = options; + } + decorate(doc, afterDoc) { + const { comment, afterEmptyLine } = parsePrelude(this.prelude); + //console.log({ dc: doc.comment, prelude, comment }) + if (comment) { + const dc = doc.contents; + if (afterDoc) { + doc.comment = doc.comment ? `${doc.comment}\n${comment}` : comment; + } + else if (afterEmptyLine || doc.directives.docStart || !dc) { + doc.commentBefore = comment; + } + else if (isCollection$1(dc) && !dc.flow && dc.items.length > 0) { + let it = dc.items[0]; + if (isPair(it)) + it = it.key; + const cb = it.commentBefore; + it.commentBefore = cb ? `${comment}\n${cb}` : comment; + } + else { + const cb = dc.commentBefore; + dc.commentBefore = cb ? `${comment}\n${cb}` : comment; + } + } + if (afterDoc) { + Array.prototype.push.apply(doc.errors, this.errors); + Array.prototype.push.apply(doc.warnings, this.warnings); + } + else { + doc.errors = this.errors; + doc.warnings = this.warnings; + } + this.prelude = []; + this.errors = []; + this.warnings = []; + } + /** + * Current stream status information. + * + * Mostly useful at the end of input for an empty stream. + */ + streamInfo() { + return { + comment: parsePrelude(this.prelude).comment, + directives: this.directives, + errors: this.errors, + warnings: this.warnings + }; + } + /** + * Compose tokens into documents. + * + * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. + * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. + */ + *compose(tokens, forceDoc = false, endOffset = -1) { + for (const token of tokens) + yield* this.next(token); + yield* this.end(forceDoc, endOffset); + } + /** Advance the composer by one CST token. */ + *next(token) { + switch (token.type) { + case 'directive': + this.directives.add(token.source, (offset, message, warning) => { + const pos = getErrorPos(token); + pos[0] += offset; + this.onError(pos, 'BAD_DIRECTIVE', message, warning); + }); + this.prelude.push(token.source); + this.atDirectives = true; + break; + case 'document': { + const doc = composeDoc(this.options, this.directives, token, this.onError); + if (this.atDirectives && !doc.directives.docStart) + this.onError(token, 'MISSING_CHAR', 'Missing directives-end/doc-start indicator line'); + this.decorate(doc, false); + if (this.doc) + yield this.doc; + this.doc = doc; + this.atDirectives = false; + break; + } + case 'byte-order-mark': + case 'space': + break; + case 'comment': + case 'newline': + this.prelude.push(token.source); + break; + case 'error': { + const msg = token.source + ? `${token.message}: ${JSON.stringify(token.source)}` + : token.message; + const error = new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg); + if (this.atDirectives || !this.doc) + this.errors.push(error); + else + this.doc.errors.push(error); + break; + } + case 'doc-end': { + if (!this.doc) { + const msg = 'Unexpected doc-end without preceding document'; + this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg)); + break; + } + this.doc.directives.docEnd = true; + const end = resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError); + this.decorate(this.doc, true); + if (end.comment) { + const dc = this.doc.comment; + this.doc.comment = dc ? `${dc}\n${end.comment}` : end.comment; + } + this.doc.range[2] = end.offset; + break; + } + default: + this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', `Unsupported token ${token.type}`)); + } + } + /** + * Call at end of input to yield any remaining document. + * + * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. + * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. + */ + *end(forceDoc = false, endOffset = -1) { + if (this.doc) { + this.decorate(this.doc, true); + yield this.doc; + this.doc = null; + } + else if (forceDoc) { + const opts = Object.assign({ _directives: this.directives }, this.options); + const doc = new Document(undefined, opts); + if (this.atDirectives) + this.onError(endOffset, 'MISSING_CHAR', 'Missing directives-end indicator line'); + doc.range = [0, endOffset, endOffset]; + this.decorate(doc, false); + yield doc; + } + } +} + +function resolveAsScalar(token, strict = true, onError) { + if (token) { + const _onError = (pos, code, message) => { + const offset = typeof pos === 'number' ? pos : Array.isArray(pos) ? pos[0] : pos.offset; + if (onError) + onError(offset, code, message); + else + throw new YAMLParseError([offset, offset + 1], code, message); + }; + switch (token.type) { + case 'scalar': + case 'single-quoted-scalar': + case 'double-quoted-scalar': + return resolveFlowScalar(token, strict, _onError); + case 'block-scalar': + return resolveBlockScalar(token, strict, _onError); + } + } + return null; +} +/** + * Create a new scalar token with `value` + * + * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`, + * as this function does not support any schema operations and won't check for such conflicts. + * + * @param value The string representation of the value, which will have its content properly indented. + * @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added. + * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value. + * @param context.indent The indent level of the token. + * @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value. + * @param context.offset The offset position of the token. + * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`. + */ +function createScalarToken(value, context) { + const { implicitKey = false, indent, inFlow = false, offset = -1, type = 'PLAIN' } = context; + const source = stringifyString({ type, value }, { + implicitKey, + indent: indent > 0 ? ' '.repeat(indent) : '', + inFlow, + options: { blockQuote: true, lineWidth: -1 } + }); + const end = context.end ?? [ + { type: 'newline', offset: -1, indent, source: '\n' } + ]; + switch (source[0]) { + case '|': + case '>': { + const he = source.indexOf('\n'); + const head = source.substring(0, he); + const body = source.substring(he + 1) + '\n'; + const props = [ + { type: 'block-scalar-header', offset, indent, source: head } + ]; + if (!addEndtoBlockProps(props, end)) + props.push({ type: 'newline', offset: -1, indent, source: '\n' }); + return { type: 'block-scalar', offset, indent, props, source: body }; + } + case '"': + return { type: 'double-quoted-scalar', offset, indent, source, end }; + case "'": + return { type: 'single-quoted-scalar', offset, indent, source, end }; + default: + return { type: 'scalar', offset, indent, source, end }; + } +} +/** + * Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have. + * + * Best efforts are made to retain any comments previously associated with the `token`, + * though all contents within a collection's `items` will be overwritten. + * + * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`, + * as this function does not support any schema operations and won't check for such conflicts. + * + * @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key. + * @param value The string representation of the value, which will have its content properly indented. + * @param context.afterKey In most cases, values after a key should have an additional level of indentation. + * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value. + * @param context.inFlow Being within a flow collection may affect the resolved type of the token's value. + * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`. + */ +function setScalarValue(token, value, context = {}) { + let { afterKey = false, implicitKey = false, inFlow = false, type } = context; + let indent = 'indent' in token ? token.indent : null; + if (afterKey && typeof indent === 'number') + indent += 2; + if (!type) + switch (token.type) { + case 'single-quoted-scalar': + type = 'QUOTE_SINGLE'; + break; + case 'double-quoted-scalar': + type = 'QUOTE_DOUBLE'; + break; + case 'block-scalar': { + const header = token.props[0]; + if (header.type !== 'block-scalar-header') + throw new Error('Invalid block scalar header'); + type = header.source[0] === '>' ? 'BLOCK_FOLDED' : 'BLOCK_LITERAL'; + break; + } + default: + type = 'PLAIN'; + } + const source = stringifyString({ type, value }, { + implicitKey: implicitKey || indent === null, + indent: indent !== null && indent > 0 ? ' '.repeat(indent) : '', + inFlow, + options: { blockQuote: true, lineWidth: -1 } + }); + switch (source[0]) { + case '|': + case '>': + setBlockScalarValue(token, source); + break; + case '"': + setFlowScalarValue(token, source, 'double-quoted-scalar'); + break; + case "'": + setFlowScalarValue(token, source, 'single-quoted-scalar'); + break; + default: + setFlowScalarValue(token, source, 'scalar'); + } +} +function setBlockScalarValue(token, source) { + const he = source.indexOf('\n'); + const head = source.substring(0, he); + const body = source.substring(he + 1) + '\n'; + if (token.type === 'block-scalar') { + const header = token.props[0]; + if (header.type !== 'block-scalar-header') + throw new Error('Invalid block scalar header'); + header.source = head; + token.source = body; + } + else { + const { offset } = token; + const indent = 'indent' in token ? token.indent : -1; + const props = [ + { type: 'block-scalar-header', offset, indent, source: head } + ]; + if (!addEndtoBlockProps(props, 'end' in token ? token.end : undefined)) + props.push({ type: 'newline', offset: -1, indent, source: '\n' }); + for (const key of Object.keys(token)) + if (key !== 'type' && key !== 'offset') + delete token[key]; + Object.assign(token, { type: 'block-scalar', indent, props, source: body }); + } +} +/** @returns `true` if last token is a newline */ +function addEndtoBlockProps(props, end) { + if (end) + for (const st of end) + switch (st.type) { + case 'space': + case 'comment': + props.push(st); + break; + case 'newline': + props.push(st); + return true; + } + return false; +} +function setFlowScalarValue(token, source, type) { + switch (token.type) { + case 'scalar': + case 'double-quoted-scalar': + case 'single-quoted-scalar': + token.type = type; + token.source = source; + break; + case 'block-scalar': { + const end = token.props.slice(1); + let oa = source.length; + if (token.props[0].type === 'block-scalar-header') + oa -= token.props[0].source.length; + for (const tok of end) + tok.offset += oa; + delete token.props; + Object.assign(token, { type, source, end }); + break; + } + case 'block-map': + case 'block-seq': { + const offset = token.offset + source.length; + const nl = { type: 'newline', offset, indent: token.indent, source: '\n' }; + delete token.items; + Object.assign(token, { type, source, end: [nl] }); + break; + } + default: { + const indent = 'indent' in token ? token.indent : -1; + const end = 'end' in token && Array.isArray(token.end) + ? token.end.filter(st => st.type === 'space' || + st.type === 'comment' || + st.type === 'newline') + : []; + for (const key of Object.keys(token)) + if (key !== 'type' && key !== 'offset') + delete token[key]; + Object.assign(token, { type, indent, source, end }); + } + } +} + +/** + * Stringify a CST document, token, or collection item + * + * Fair warning: This applies no validation whatsoever, and + * simply concatenates the sources in their logical order. + */ +const stringify$1 = (cst) => 'type' in cst ? stringifyToken(cst) : stringifyItem(cst); +function stringifyToken(token) { + switch (token.type) { + case 'block-scalar': { + let res = ''; + for (const tok of token.props) + res += stringifyToken(tok); + return res + token.source; + } + case 'block-map': + case 'block-seq': { + let res = ''; + for (const item of token.items) + res += stringifyItem(item); + return res; + } + case 'flow-collection': { + let res = token.start.source; + for (const item of token.items) + res += stringifyItem(item); + for (const st of token.end) + res += st.source; + return res; + } + case 'document': { + let res = stringifyItem(token); + if (token.end) + for (const st of token.end) + res += st.source; + return res; + } + default: { + let res = token.source; + if ('end' in token && token.end) + for (const st of token.end) + res += st.source; + return res; + } + } +} +function stringifyItem({ start, key, sep, value }) { + let res = ''; + for (const st of start) + res += st.source; + if (key) + res += stringifyToken(key); + if (sep) + for (const st of sep) + res += st.source; + if (value) + res += stringifyToken(value); + return res; +} + +const BREAK = Symbol('break visit'); +const SKIP = Symbol('skip children'); +const REMOVE = Symbol('remove item'); +/** + * Apply a visitor to a CST document or item. + * + * Walks through the tree (depth-first) starting from the root, calling a + * `visitor` function with two arguments when entering each item: + * - `item`: The current item, which included the following members: + * - `start: SourceToken[]` – Source tokens before the key or value, + * possibly including its anchor or tag. + * - `key?: Token | null` – Set for pair values. May then be `null`, if + * the key before the `:` separator is empty. + * - `sep?: SourceToken[]` – Source tokens between the key and the value, + * which should include the `:` map value indicator if `value` is set. + * - `value?: Token` – The value of a sequence item, or of a map pair. + * - `path`: The steps from the root to the current node, as an array of + * `['key' | 'value', number]` tuples. + * + * The return value of the visitor may be used to control the traversal: + * - `undefined` (default): Do nothing and continue + * - `visit.SKIP`: Do not visit the children of this token, continue with + * next sibling + * - `visit.BREAK`: Terminate traversal completely + * - `visit.REMOVE`: Remove the current item, then continue with the next one + * - `number`: Set the index of the next step. This is useful especially if + * the index of the current token has changed. + * - `function`: Define the next visitor for this item. After the original + * visitor is called on item entry, next visitors are called after handling + * a non-empty `key` and when exiting the item. + */ +function visit(cst, visitor) { + if ('type' in cst && cst.type === 'document') + cst = { start: cst.start, value: cst.value }; + _visit(Object.freeze([]), cst, visitor); +} +// Without the `as symbol` casts, TS declares these in the `visit` +// namespace using `var`, but then complains about that because +// `unique symbol` must be `const`. +/** Terminate visit traversal completely */ +visit.BREAK = BREAK; +/** Do not visit the children of the current item */ +visit.SKIP = SKIP; +/** Remove the current item */ +visit.REMOVE = REMOVE; +/** Find the item at `path` from `cst` as the root */ +visit.itemAtPath = (cst, path) => { + let item = cst; + for (const [field, index] of path) { + const tok = item?.[field]; + if (tok && 'items' in tok) { + item = tok.items[index]; + } + else + return undefined; + } + return item; +}; +/** + * Get the immediate parent collection of the item at `path` from `cst` as the root. + * + * Throws an error if the collection is not found, which should never happen if the item itself exists. + */ +visit.parentCollection = (cst, path) => { + const parent = visit.itemAtPath(cst, path.slice(0, -1)); + const field = path[path.length - 1][0]; + const coll = parent?.[field]; + if (coll && 'items' in coll) + return coll; + throw new Error('Parent collection not found'); +}; +function _visit(path, item, visitor) { + let ctrl = visitor(item, path); + if (typeof ctrl === 'symbol') + return ctrl; + for (const field of ['key', 'value']) { + const token = item[field]; + if (token && 'items' in token) { + for (let i = 0; i < token.items.length; ++i) { + const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor); + if (typeof ci === 'number') + i = ci - 1; + else if (ci === BREAK) + return BREAK; + else if (ci === REMOVE) { + token.items.splice(i, 1); + i -= 1; + } + } + if (typeof ctrl === 'function' && field === 'key') + ctrl = ctrl(item, path); + } + } + return typeof ctrl === 'function' ? ctrl(item, path) : ctrl; +} + +/** The byte order mark */ +const BOM = '\u{FEFF}'; +/** Start of doc-mode */ +const DOCUMENT = '\x02'; // C0: Start of Text +/** Unexpected end of flow-mode */ +const FLOW_END = '\x18'; // C0: Cancel +/** Next token is a scalar value */ +const SCALAR = '\x1f'; // C0: Unit Separator +/** @returns `true` if `token` is a flow or block collection */ +const isCollection = (token) => !!token && 'items' in token; +/** @returns `true` if `token` is a flow or block scalar; not an alias */ +const isScalar = (token) => !!token && + (token.type === 'scalar' || + token.type === 'single-quoted-scalar' || + token.type === 'double-quoted-scalar' || + token.type === 'block-scalar'); +/* istanbul ignore next */ +/** Get a printable representation of a lexer token */ +function prettyToken(token) { + switch (token) { + case BOM: + return ''; + case DOCUMENT: + return ''; + case FLOW_END: + return ''; + case SCALAR: + return ''; + default: + return JSON.stringify(token); + } +} +/** Identify the type of a lexer token. May return `null` for unknown tokens. */ +function tokenType(source) { + switch (source) { + case BOM: + return 'byte-order-mark'; + case DOCUMENT: + return 'doc-mode'; + case FLOW_END: + return 'flow-error-end'; + case SCALAR: + return 'scalar'; + case '---': + return 'doc-start'; + case '...': + return 'doc-end'; + case '': + case '\n': + case '\r\n': + return 'newline'; + case '-': + return 'seq-item-ind'; + case '?': + return 'explicit-key-ind'; + case ':': + return 'map-value-ind'; + case '{': + return 'flow-map-start'; + case '}': + return 'flow-map-end'; + case '[': + return 'flow-seq-start'; + case ']': + return 'flow-seq-end'; + case ',': + return 'comma'; + } + switch (source[0]) { + case ' ': + case '\t': + return 'space'; + case '#': + return 'comment'; + case '%': + return 'directive-line'; + case '*': + return 'alias'; + case '&': + return 'anchor'; + case '!': + return 'tag'; + case "'": + return 'single-quoted-scalar'; + case '"': + return 'double-quoted-scalar'; + case '|': + case '>': + return 'block-scalar-header'; + } + return null; +} + +var cst = { + __proto__: null, + BOM: BOM, + DOCUMENT: DOCUMENT, + FLOW_END: FLOW_END, + SCALAR: SCALAR, + createScalarToken: createScalarToken, + isCollection: isCollection, + isScalar: isScalar, + prettyToken: prettyToken, + resolveAsScalar: resolveAsScalar, + setScalarValue: setScalarValue, + stringify: stringify$1, + tokenType: tokenType, + visit: visit +}; + +/* +START -> stream + +stream + directive -> line-end -> stream + indent + line-end -> stream + [else] -> line-start + +line-end + comment -> line-end + newline -> . + input-end -> END + +line-start + doc-start -> doc + doc-end -> stream + [else] -> indent -> block-start + +block-start + seq-item-start -> block-start + explicit-key-start -> block-start + map-value-start -> block-start + [else] -> doc + +doc + line-end -> line-start + spaces -> doc + anchor -> doc + tag -> doc + flow-start -> flow -> doc + flow-end -> error -> doc + seq-item-start -> error -> doc + explicit-key-start -> error -> doc + map-value-start -> doc + alias -> doc + quote-start -> quoted-scalar -> doc + block-scalar-header -> line-end -> block-scalar(min) -> line-start + [else] -> plain-scalar(false, min) -> doc + +flow + line-end -> flow + spaces -> flow + anchor -> flow + tag -> flow + flow-start -> flow -> flow + flow-end -> . + seq-item-start -> error -> flow + explicit-key-start -> flow + map-value-start -> flow + alias -> flow + quote-start -> quoted-scalar -> flow + comma -> flow + [else] -> plain-scalar(true, 0) -> flow + +quoted-scalar + quote-end -> . + [else] -> quoted-scalar + +block-scalar(min) + newline + peek(indent < min) -> . + [else] -> block-scalar(min) + +plain-scalar(is-flow, min) + scalar-end(is-flow) -> . + peek(newline + (indent < min)) -> . + [else] -> plain-scalar(min) +*/ +function isEmpty(ch) { + switch (ch) { + case undefined: + case ' ': + case '\n': + case '\r': + case '\t': + return true; + default: + return false; + } +} +const hexDigits = '0123456789ABCDEFabcdef'.split(''); +const tagChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(''); +const invalidFlowScalarChars = ',[]{}'.split(''); +const invalidAnchorChars = ' ,[]{}\n\r\t'.split(''); +const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.includes(ch); +/** + * Splits an input string into lexical tokens, i.e. smaller strings that are + * easily identifiable by `tokens.tokenType()`. + * + * Lexing starts always in a "stream" context. Incomplete input may be buffered + * until a complete token can be emitted. + * + * In addition to slices of the original input, the following control characters + * may also be emitted: + * + * - `\x02` (Start of Text): A document starts with the next token + * - `\x18` (Cancel): Unexpected end of flow-mode (indicates an error) + * - `\x1f` (Unit Separator): Next token is a scalar value + * - `\u{FEFF}` (Byte order mark): Emitted separately outside documents + */ +class Lexer { + constructor() { + /** + * Flag indicating whether the end of the current buffer marks the end of + * all input + */ + this.atEnd = false; + /** + * Explicit indent set in block scalar header, as an offset from the current + * minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not + * explicitly set. + */ + this.blockScalarIndent = -1; + /** + * Block scalars that include a + (keep) chomping indicator in their header + * include trailing empty lines, which are otherwise excluded from the + * scalar's contents. + */ + this.blockScalarKeep = false; + /** Current input */ + this.buffer = ''; + /** + * Flag noting whether the map value indicator : can immediately follow this + * node within a flow context. + */ + this.flowKey = false; + /** Count of surrounding flow collection levels. */ + this.flowLevel = 0; + /** + * Minimum level of indentation required for next lines to be parsed as a + * part of the current scalar value. + */ + this.indentNext = 0; + /** Indentation level of the current line. */ + this.indentValue = 0; + /** Position of the next \n character. */ + this.lineEndPos = null; + /** Stores the state of the lexer if reaching the end of incpomplete input */ + this.next = null; + /** A pointer to `buffer`; the current position of the lexer. */ + this.pos = 0; + } + /** + * Generate YAML tokens from the `source` string. If `incomplete`, + * a part of the last line may be left as a buffer for the next call. + * + * @returns A generator of lexical tokens + */ + *lex(source, incomplete = false) { + if (source) { + this.buffer = this.buffer ? this.buffer + source : source; + this.lineEndPos = null; + } + this.atEnd = !incomplete; + let next = this.next ?? 'stream'; + while (next && (incomplete || this.hasChars(1))) + next = yield* this.parseNext(next); + } + atLineEnd() { + let i = this.pos; + let ch = this.buffer[i]; + while (ch === ' ' || ch === '\t') + ch = this.buffer[++i]; + if (!ch || ch === '#' || ch === '\n') + return true; + if (ch === '\r') + return this.buffer[i + 1] === '\n'; + return false; + } + charAt(n) { + return this.buffer[this.pos + n]; + } + continueScalar(offset) { + let ch = this.buffer[offset]; + if (this.indentNext > 0) { + let indent = 0; + while (ch === ' ') + ch = this.buffer[++indent + offset]; + if (ch === '\r') { + const next = this.buffer[indent + offset + 1]; + if (next === '\n' || (!next && !this.atEnd)) + return offset + indent + 1; + } + return ch === '\n' || indent >= this.indentNext || (!ch && !this.atEnd) + ? offset + indent + : -1; + } + if (ch === '-' || ch === '.') { + const dt = this.buffer.substr(offset, 3); + if ((dt === '---' || dt === '...') && isEmpty(this.buffer[offset + 3])) + return -1; + } + return offset; + } + getLine() { + let end = this.lineEndPos; + if (typeof end !== 'number' || (end !== -1 && end < this.pos)) { + end = this.buffer.indexOf('\n', this.pos); + this.lineEndPos = end; + } + if (end === -1) + return this.atEnd ? this.buffer.substring(this.pos) : null; + if (this.buffer[end - 1] === '\r') + end -= 1; + return this.buffer.substring(this.pos, end); + } + hasChars(n) { + return this.pos + n <= this.buffer.length; + } + setNext(state) { + this.buffer = this.buffer.substring(this.pos); + this.pos = 0; + this.lineEndPos = null; + this.next = state; + return null; + } + peek(n) { + return this.buffer.substr(this.pos, n); + } + *parseNext(next) { + switch (next) { + case 'stream': + return yield* this.parseStream(); + case 'line-start': + return yield* this.parseLineStart(); + case 'block-start': + return yield* this.parseBlockStart(); + case 'doc': + return yield* this.parseDocument(); + case 'flow': + return yield* this.parseFlowCollection(); + case 'quoted-scalar': + return yield* this.parseQuotedScalar(); + case 'block-scalar': + return yield* this.parseBlockScalar(); + case 'plain-scalar': + return yield* this.parsePlainScalar(); + } + } + *parseStream() { + let line = this.getLine(); + if (line === null) + return this.setNext('stream'); + if (line[0] === BOM) { + yield* this.pushCount(1); + line = line.substring(1); + } + if (line[0] === '%') { + let dirEnd = line.length; + const cs = line.indexOf('#'); + if (cs !== -1) { + const ch = line[cs - 1]; + if (ch === ' ' || ch === '\t') + dirEnd = cs - 1; + } + while (true) { + const ch = line[dirEnd - 1]; + if (ch === ' ' || ch === '\t') + dirEnd -= 1; + else + break; + } + const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true)); + yield* this.pushCount(line.length - n); // possible comment + this.pushNewline(); + return 'stream'; + } + if (this.atLineEnd()) { + const sp = yield* this.pushSpaces(true); + yield* this.pushCount(line.length - sp); + yield* this.pushNewline(); + return 'stream'; + } + yield DOCUMENT; + return yield* this.parseLineStart(); + } + *parseLineStart() { + const ch = this.charAt(0); + if (!ch && !this.atEnd) + return this.setNext('line-start'); + if (ch === '-' || ch === '.') { + if (!this.atEnd && !this.hasChars(4)) + return this.setNext('line-start'); + const s = this.peek(3); + if (s === '---' && isEmpty(this.charAt(3))) { + yield* this.pushCount(3); + this.indentValue = 0; + this.indentNext = 0; + return 'doc'; + } + else if (s === '...' && isEmpty(this.charAt(3))) { + yield* this.pushCount(3); + return 'stream'; + } + } + this.indentValue = yield* this.pushSpaces(false); + if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1))) + this.indentNext = this.indentValue; + return yield* this.parseBlockStart(); + } + *parseBlockStart() { + const [ch0, ch1] = this.peek(2); + if (!ch1 && !this.atEnd) + return this.setNext('block-start'); + if ((ch0 === '-' || ch0 === '?' || ch0 === ':') && isEmpty(ch1)) { + const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)); + this.indentNext = this.indentValue + 1; + this.indentValue += n; + return yield* this.parseBlockStart(); + } + return 'doc'; + } + *parseDocument() { + yield* this.pushSpaces(true); + const line = this.getLine(); + if (line === null) + return this.setNext('doc'); + let n = yield* this.pushIndicators(); + switch (line[n]) { + case '#': + yield* this.pushCount(line.length - n); + // fallthrough + case undefined: + yield* this.pushNewline(); + return yield* this.parseLineStart(); + case '{': + case '[': + yield* this.pushCount(1); + this.flowKey = false; + this.flowLevel = 1; + return 'flow'; + case '}': + case ']': + // this is an error + yield* this.pushCount(1); + return 'doc'; + case '*': + yield* this.pushUntil(isNotAnchorChar); + return 'doc'; + case '"': + case "'": + return yield* this.parseQuotedScalar(); + case '|': + case '>': + n += yield* this.parseBlockScalarHeader(); + n += yield* this.pushSpaces(true); + yield* this.pushCount(line.length - n); + yield* this.pushNewline(); + return yield* this.parseBlockScalar(); + default: + return yield* this.parsePlainScalar(); + } + } + *parseFlowCollection() { + let nl, sp; + let indent = -1; + do { + nl = yield* this.pushNewline(); + if (nl > 0) { + sp = yield* this.pushSpaces(false); + this.indentValue = indent = sp; + } + else { + sp = 0; + } + sp += yield* this.pushSpaces(true); + } while (nl + sp > 0); + const line = this.getLine(); + if (line === null) + return this.setNext('flow'); + if ((indent !== -1 && indent < this.indentNext && line[0] !== '#') || + (indent === 0 && + (line.startsWith('---') || line.startsWith('...')) && + isEmpty(line[3]))) { + // Allowing for the terminal ] or } at the same (rather than greater) + // indent level as the initial [ or { is technically invalid, but + // failing here would be surprising to users. + const atFlowEndMarker = indent === this.indentNext - 1 && + this.flowLevel === 1 && + (line[0] === ']' || line[0] === '}'); + if (!atFlowEndMarker) { + // this is an error + this.flowLevel = 0; + yield FLOW_END; + return yield* this.parseLineStart(); + } + } + let n = 0; + while (line[n] === ',') { + n += yield* this.pushCount(1); + n += yield* this.pushSpaces(true); + this.flowKey = false; + } + n += yield* this.pushIndicators(); + switch (line[n]) { + case undefined: + return 'flow'; + case '#': + yield* this.pushCount(line.length - n); + return 'flow'; + case '{': + case '[': + yield* this.pushCount(1); + this.flowKey = false; + this.flowLevel += 1; + return 'flow'; + case '}': + case ']': + yield* this.pushCount(1); + this.flowKey = true; + this.flowLevel -= 1; + return this.flowLevel ? 'flow' : 'doc'; + case '*': + yield* this.pushUntil(isNotAnchorChar); + return 'flow'; + case '"': + case "'": + this.flowKey = true; + return yield* this.parseQuotedScalar(); + case ':': { + const next = this.charAt(1); + if (this.flowKey || isEmpty(next) || next === ',') { + this.flowKey = false; + yield* this.pushCount(1); + yield* this.pushSpaces(true); + return 'flow'; + } + } + // fallthrough + default: + this.flowKey = false; + return yield* this.parsePlainScalar(); + } + } + *parseQuotedScalar() { + const quote = this.charAt(0); + let end = this.buffer.indexOf(quote, this.pos + 1); + if (quote === "'") { + while (end !== -1 && this.buffer[end + 1] === "'") + end = this.buffer.indexOf("'", end + 2); + } + else { + // double-quote + while (end !== -1) { + let n = 0; + while (this.buffer[end - 1 - n] === '\\') + n += 1; + if (n % 2 === 0) + break; + end = this.buffer.indexOf('"', end + 1); + } + } + // Only looking for newlines within the quotes + const qb = this.buffer.substring(0, end); + let nl = qb.indexOf('\n', this.pos); + if (nl !== -1) { + while (nl !== -1) { + const cs = this.continueScalar(nl + 1); + if (cs === -1) + break; + nl = qb.indexOf('\n', cs); + } + if (nl !== -1) { + // this is an error caused by an unexpected unindent + end = nl - (qb[nl - 1] === '\r' ? 2 : 1); + } + } + if (end === -1) { + if (!this.atEnd) + return this.setNext('quoted-scalar'); + end = this.buffer.length; + } + yield* this.pushToIndex(end + 1, false); + return this.flowLevel ? 'flow' : 'doc'; + } + *parseBlockScalarHeader() { + this.blockScalarIndent = -1; + this.blockScalarKeep = false; + let i = this.pos; + while (true) { + const ch = this.buffer[++i]; + if (ch === '+') + this.blockScalarKeep = true; + else if (ch > '0' && ch <= '9') + this.blockScalarIndent = Number(ch) - 1; + else if (ch !== '-') + break; + } + return yield* this.pushUntil(ch => isEmpty(ch) || ch === '#'); + } + *parseBlockScalar() { + let nl = this.pos - 1; // may be -1 if this.pos === 0 + let indent = 0; + let ch; + loop: for (let i = this.pos; (ch = this.buffer[i]); ++i) { + switch (ch) { + case ' ': + indent += 1; + break; + case '\n': + nl = i; + indent = 0; + break; + case '\r': { + const next = this.buffer[i + 1]; + if (!next && !this.atEnd) + return this.setNext('block-scalar'); + if (next === '\n') + break; + } // fallthrough + default: + break loop; + } + } + if (!ch && !this.atEnd) + return this.setNext('block-scalar'); + if (indent >= this.indentNext) { + if (this.blockScalarIndent === -1) + this.indentNext = indent; + else + this.indentNext += this.blockScalarIndent; + do { + const cs = this.continueScalar(nl + 1); + if (cs === -1) + break; + nl = this.buffer.indexOf('\n', cs); + } while (nl !== -1); + if (nl === -1) { + if (!this.atEnd) + return this.setNext('block-scalar'); + nl = this.buffer.length; + } + } + if (!this.blockScalarKeep) { + do { + let i = nl - 1; + let ch = this.buffer[i]; + if (ch === '\r') + ch = this.buffer[--i]; + const lastChar = i; // Drop the line if last char not more indented + while (ch === ' ' || ch === '\t') + ch = this.buffer[--i]; + if (ch === '\n' && i >= this.pos && i + 1 + indent > lastChar) + nl = i; + else + break; + } while (true); + } + yield SCALAR; + yield* this.pushToIndex(nl + 1, true); + return yield* this.parseLineStart(); + } + *parsePlainScalar() { + const inFlow = this.flowLevel > 0; + let end = this.pos - 1; + let i = this.pos - 1; + let ch; + while ((ch = this.buffer[++i])) { + if (ch === ':') { + const next = this.buffer[i + 1]; + if (isEmpty(next) || (inFlow && next === ',')) + break; + end = i; + } + else if (isEmpty(ch)) { + let next = this.buffer[i + 1]; + if (ch === '\r') { + if (next === '\n') { + i += 1; + ch = '\n'; + next = this.buffer[i + 1]; + } + else + end = i; + } + if (next === '#' || (inFlow && invalidFlowScalarChars.includes(next))) + break; + if (ch === '\n') { + const cs = this.continueScalar(i + 1); + if (cs === -1) + break; + i = Math.max(i, cs - 2); // to advance, but still account for ' #' + } + } + else { + if (inFlow && invalidFlowScalarChars.includes(ch)) + break; + end = i; + } + } + if (!ch && !this.atEnd) + return this.setNext('plain-scalar'); + yield SCALAR; + yield* this.pushToIndex(end + 1, true); + return inFlow ? 'flow' : 'doc'; + } + *pushCount(n) { + if (n > 0) { + yield this.buffer.substr(this.pos, n); + this.pos += n; + return n; + } + return 0; + } + *pushToIndex(i, allowEmpty) { + const s = this.buffer.slice(this.pos, i); + if (s) { + yield s; + this.pos += s.length; + return s.length; + } + else if (allowEmpty) + yield ''; + return 0; + } + *pushIndicators() { + switch (this.charAt(0)) { + case '!': + return ((yield* this.pushTag()) + + (yield* this.pushSpaces(true)) + + (yield* this.pushIndicators())); + case '&': + return ((yield* this.pushUntil(isNotAnchorChar)) + + (yield* this.pushSpaces(true)) + + (yield* this.pushIndicators())); + case '-': // this is an error + case '?': // this is an error outside flow collections + case ':': { + const inFlow = this.flowLevel > 0; + const ch1 = this.charAt(1); + if (isEmpty(ch1) || (inFlow && invalidFlowScalarChars.includes(ch1))) { + if (!inFlow) + this.indentNext = this.indentValue + 1; + else if (this.flowKey) + this.flowKey = false; + return ((yield* this.pushCount(1)) + + (yield* this.pushSpaces(true)) + + (yield* this.pushIndicators())); + } + } + } + return 0; + } + *pushTag() { + if (this.charAt(1) === '<') { + let i = this.pos + 2; + let ch = this.buffer[i]; + while (!isEmpty(ch) && ch !== '>') + ch = this.buffer[++i]; + return yield* this.pushToIndex(ch === '>' ? i + 1 : i, false); + } + else { + let i = this.pos + 1; + let ch = this.buffer[i]; + while (ch) { + if (tagChars.includes(ch)) + ch = this.buffer[++i]; + else if (ch === '%' && + hexDigits.includes(this.buffer[i + 1]) && + hexDigits.includes(this.buffer[i + 2])) { + ch = this.buffer[(i += 3)]; + } + else + break; + } + return yield* this.pushToIndex(i, false); + } + } + *pushNewline() { + const ch = this.buffer[this.pos]; + if (ch === '\n') + return yield* this.pushCount(1); + else if (ch === '\r' && this.charAt(1) === '\n') + return yield* this.pushCount(2); + else + return 0; + } + *pushSpaces(allowTabs) { + let i = this.pos - 1; + let ch; + do { + ch = this.buffer[++i]; + } while (ch === ' ' || (allowTabs && ch === '\t')); + const n = i - this.pos; + if (n > 0) { + yield this.buffer.substr(this.pos, n); + this.pos = i; + } + return n; + } + *pushUntil(test) { + let i = this.pos; + let ch = this.buffer[i]; + while (!test(ch)) + ch = this.buffer[++i]; + return yield* this.pushToIndex(i, false); + } +} + +/** + * Tracks newlines during parsing in order to provide an efficient API for + * determining the one-indexed `{ line, col }` position for any offset + * within the input. + */ +class LineCounter { + constructor() { + this.lineStarts = []; + /** + * Should be called in ascending order. Otherwise, call + * `lineCounter.lineStarts.sort()` before calling `linePos()`. + */ + this.addNewLine = (offset) => this.lineStarts.push(offset); + /** + * Performs a binary search and returns the 1-indexed { line, col } + * position of `offset`. If `line === 0`, `addNewLine` has never been + * called or `offset` is before the first known newline. + */ + this.linePos = (offset) => { + let low = 0; + let high = this.lineStarts.length; + while (low < high) { + const mid = (low + high) >> 1; // Math.floor((low + high) / 2) + if (this.lineStarts[mid] < offset) + low = mid + 1; + else + high = mid; + } + if (this.lineStarts[low] === offset) + return { line: low + 1, col: 1 }; + if (low === 0) + return { line: 0, col: offset }; + const start = this.lineStarts[low - 1]; + return { line: low, col: offset - start + 1 }; + }; + } +} + +function includesToken(list, type) { + for (let i = 0; i < list.length; ++i) + if (list[i].type === type) + return true; + return false; +} +function findNonEmptyIndex(list) { + for (let i = 0; i < list.length; ++i) { + switch (list[i].type) { + case 'space': + case 'comment': + case 'newline': + break; + default: + return i; + } + } + return -1; +} +function isFlowToken(token) { + switch (token?.type) { + case 'alias': + case 'scalar': + case 'single-quoted-scalar': + case 'double-quoted-scalar': + case 'flow-collection': + return true; + default: + return false; + } +} +function getPrevProps(parent) { + switch (parent.type) { + case 'document': + return parent.start; + case 'block-map': { + const it = parent.items[parent.items.length - 1]; + return it.sep ?? it.start; + } + case 'block-seq': + return parent.items[parent.items.length - 1].start; + /* istanbul ignore next should not happen */ + default: + return []; + } +} +/** Note: May modify input array */ +function getFirstKeyStartProps(prev) { + if (prev.length === 0) + return []; + let i = prev.length; + loop: while (--i >= 0) { + switch (prev[i].type) { + case 'doc-start': + case 'explicit-key-ind': + case 'map-value-ind': + case 'seq-item-ind': + case 'newline': + break loop; + } + } + while (prev[++i]?.type === 'space') { + /* loop */ + } + return prev.splice(i, prev.length); +} +function fixFlowSeqItems(fc) { + if (fc.start.type === 'flow-seq-start') { + for (const it of fc.items) { + if (it.sep && + !it.value && + !includesToken(it.start, 'explicit-key-ind') && + !includesToken(it.sep, 'map-value-ind')) { + if (it.key) + it.value = it.key; + delete it.key; + if (isFlowToken(it.value)) { + if (it.value.end) + Array.prototype.push.apply(it.value.end, it.sep); + else + it.value.end = it.sep; + } + else + Array.prototype.push.apply(it.start, it.sep); + delete it.sep; + } + } + } +} +/** + * A YAML concrete syntax tree (CST) parser + * + * ```ts + * const src: string = ... + * for (const token of new Parser().parse(src)) { + * // token: Token + * } + * ``` + * + * To use the parser with a user-provided lexer: + * + * ```ts + * function* parse(source: string, lexer: Lexer) { + * const parser = new Parser() + * for (const lexeme of lexer.lex(source)) + * yield* parser.next(lexeme) + * yield* parser.end() + * } + * + * const src: string = ... + * const lexer = new Lexer() + * for (const token of parse(src, lexer)) { + * // token: Token + * } + * ``` + */ +let Parser$1 = class Parser { + /** + * @param onNewLine - If defined, called separately with the start position of + * each new line (in `parse()`, including the start of input). + */ + constructor(onNewLine) { + /** If true, space and sequence indicators count as indentation */ + this.atNewLine = true; + /** If true, next token is a scalar value */ + this.atScalar = false; + /** Current indentation level */ + this.indent = 0; + /** Current offset since the start of parsing */ + this.offset = 0; + /** On the same line with a block map key */ + this.onKeyLine = false; + /** Top indicates the node that's currently being built */ + this.stack = []; + /** The source of the current token, set in parse() */ + this.source = ''; + /** The type of the current token, set in parse() */ + this.type = ''; + // Must be defined after `next()` + this.lexer = new Lexer(); + this.onNewLine = onNewLine; + } + /** + * Parse `source` as a YAML stream. + * If `incomplete`, a part of the last line may be left as a buffer for the next call. + * + * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens. + * + * @returns A generator of tokens representing each directive, document, and other structure. + */ + *parse(source, incomplete = false) { + if (this.onNewLine && this.offset === 0) + this.onNewLine(0); + for (const lexeme of this.lexer.lex(source, incomplete)) + yield* this.next(lexeme); + if (!incomplete) + yield* this.end(); + } + /** + * Advance the parser by the `source` of one lexical token. + */ + *next(source) { + this.source = source; + if (this.atScalar) { + this.atScalar = false; + yield* this.step(); + this.offset += source.length; + return; + } + const type = tokenType(source); + if (!type) { + const message = `Not a YAML token: ${source}`; + yield* this.pop({ type: 'error', offset: this.offset, message, source }); + this.offset += source.length; + } + else if (type === 'scalar') { + this.atNewLine = false; + this.atScalar = true; + this.type = 'scalar'; + } + else { + this.type = type; + yield* this.step(); + switch (type) { + case 'newline': + this.atNewLine = true; + this.indent = 0; + if (this.onNewLine) + this.onNewLine(this.offset + source.length); + break; + case 'space': + if (this.atNewLine && source[0] === ' ') + this.indent += source.length; + break; + case 'explicit-key-ind': + case 'map-value-ind': + case 'seq-item-ind': + if (this.atNewLine) + this.indent += source.length; + break; + case 'doc-mode': + case 'flow-error-end': + return; + default: + this.atNewLine = false; + } + this.offset += source.length; + } + } + /** Call at end of input to push out any remaining constructions */ + *end() { + while (this.stack.length > 0) + yield* this.pop(); + } + get sourceToken() { + const st = { + type: this.type, + offset: this.offset, + indent: this.indent, + source: this.source + }; + return st; + } + *step() { + const top = this.peek(1); + if (this.type === 'doc-end' && (!top || top.type !== 'doc-end')) { + while (this.stack.length > 0) + yield* this.pop(); + this.stack.push({ + type: 'doc-end', + offset: this.offset, + source: this.source + }); + return; + } + if (!top) + return yield* this.stream(); + switch (top.type) { + case 'document': + return yield* this.document(top); + case 'alias': + case 'scalar': + case 'single-quoted-scalar': + case 'double-quoted-scalar': + return yield* this.scalar(top); + case 'block-scalar': + return yield* this.blockScalar(top); + case 'block-map': + return yield* this.blockMap(top); + case 'block-seq': + return yield* this.blockSequence(top); + case 'flow-collection': + return yield* this.flowCollection(top); + case 'doc-end': + return yield* this.documentEnd(top); + } + /* istanbul ignore next should not happen */ + yield* this.pop(); + } + peek(n) { + return this.stack[this.stack.length - n]; + } + *pop(error) { + const token = error ?? this.stack.pop(); + /* istanbul ignore if should not happen */ + if (!token) { + const message = 'Tried to pop an empty stack'; + yield { type: 'error', offset: this.offset, source: '', message }; + } + else if (this.stack.length === 0) { + yield token; + } + else { + const top = this.peek(1); + if (token.type === 'block-scalar') { + // Block scalars use their parent rather than header indent + token.indent = 'indent' in top ? top.indent : 0; + } + else if (token.type === 'flow-collection' && top.type === 'document') { + // Ignore all indent for top-level flow collections + token.indent = 0; + } + if (token.type === 'flow-collection') + fixFlowSeqItems(token); + switch (top.type) { + case 'document': + top.value = token; + break; + case 'block-scalar': + top.props.push(token); // error + break; + case 'block-map': { + const it = top.items[top.items.length - 1]; + if (it.value) { + top.items.push({ start: [], key: token, sep: [] }); + this.onKeyLine = true; + return; + } + else if (it.sep) { + it.value = token; + } + else { + Object.assign(it, { key: token, sep: [] }); + this.onKeyLine = !includesToken(it.start, 'explicit-key-ind'); + return; + } + break; + } + case 'block-seq': { + const it = top.items[top.items.length - 1]; + if (it.value) + top.items.push({ start: [], value: token }); + else + it.value = token; + break; + } + case 'flow-collection': { + const it = top.items[top.items.length - 1]; + if (!it || it.value) + top.items.push({ start: [], key: token, sep: [] }); + else if (it.sep) + it.value = token; + else + Object.assign(it, { key: token, sep: [] }); + return; + } + /* istanbul ignore next should not happen */ + default: + yield* this.pop(); + yield* this.pop(token); + } + if ((top.type === 'document' || + top.type === 'block-map' || + top.type === 'block-seq') && + (token.type === 'block-map' || token.type === 'block-seq')) { + const last = token.items[token.items.length - 1]; + if (last && + !last.sep && + !last.value && + last.start.length > 0 && + findNonEmptyIndex(last.start) === -1 && + (token.indent === 0 || + last.start.every(st => st.type !== 'comment' || st.indent < token.indent))) { + if (top.type === 'document') + top.end = last.start; + else + top.items.push({ start: last.start }); + token.items.splice(-1, 1); + } + } + } + } + *stream() { + switch (this.type) { + case 'directive-line': + yield { type: 'directive', offset: this.offset, source: this.source }; + return; + case 'byte-order-mark': + case 'space': + case 'comment': + case 'newline': + yield this.sourceToken; + return; + case 'doc-mode': + case 'doc-start': { + const doc = { + type: 'document', + offset: this.offset, + start: [] + }; + if (this.type === 'doc-start') + doc.start.push(this.sourceToken); + this.stack.push(doc); + return; + } + } + yield { + type: 'error', + offset: this.offset, + message: `Unexpected ${this.type} token in YAML stream`, + source: this.source + }; + } + *document(doc) { + if (doc.value) + return yield* this.lineEnd(doc); + switch (this.type) { + case 'doc-start': { + if (findNonEmptyIndex(doc.start) !== -1) { + yield* this.pop(); + yield* this.step(); + } + else + doc.start.push(this.sourceToken); + return; + } + case 'anchor': + case 'tag': + case 'space': + case 'comment': + case 'newline': + doc.start.push(this.sourceToken); + return; + } + const bv = this.startBlockValue(doc); + if (bv) + this.stack.push(bv); + else { + yield { + type: 'error', + offset: this.offset, + message: `Unexpected ${this.type} token in YAML document`, + source: this.source + }; + } + } + *scalar(scalar) { + if (this.type === 'map-value-ind') { + const prev = getPrevProps(this.peek(2)); + const start = getFirstKeyStartProps(prev); + let sep; + if (scalar.end) { + sep = scalar.end; + sep.push(this.sourceToken); + delete scalar.end; + } + else + sep = [this.sourceToken]; + const map = { + type: 'block-map', + offset: scalar.offset, + indent: scalar.indent, + items: [{ start, key: scalar, sep }] + }; + this.onKeyLine = true; + this.stack[this.stack.length - 1] = map; + } + else + yield* this.lineEnd(scalar); + } + *blockScalar(scalar) { + switch (this.type) { + case 'space': + case 'comment': + case 'newline': + scalar.props.push(this.sourceToken); + return; + case 'scalar': + scalar.source = this.source; + // block-scalar source includes trailing newline + this.atNewLine = true; + this.indent = 0; + if (this.onNewLine) { + let nl = this.source.indexOf('\n') + 1; + while (nl !== 0) { + this.onNewLine(this.offset + nl); + nl = this.source.indexOf('\n', nl) + 1; + } + } + yield* this.pop(); + break; + /* istanbul ignore next should not happen */ + default: + yield* this.pop(); + yield* this.step(); + } + } + *blockMap(map) { + const it = map.items[map.items.length - 1]; + // it.sep is true-ish if pair already has key or : separator + switch (this.type) { + case 'newline': + this.onKeyLine = false; + if (it.value) { + const end = 'end' in it.value ? it.value.end : undefined; + const last = Array.isArray(end) ? end[end.length - 1] : undefined; + if (last?.type === 'comment') + end?.push(this.sourceToken); + else + map.items.push({ start: [this.sourceToken] }); + } + else if (it.sep) { + it.sep.push(this.sourceToken); + } + else { + it.start.push(this.sourceToken); + } + return; + case 'space': + case 'comment': + if (it.value) { + map.items.push({ start: [this.sourceToken] }); + } + else if (it.sep) { + it.sep.push(this.sourceToken); + } + else { + if (this.atIndentedComment(it.start, map.indent)) { + const prev = map.items[map.items.length - 2]; + const end = prev?.value?.end; + if (Array.isArray(end)) { + Array.prototype.push.apply(end, it.start); + end.push(this.sourceToken); + map.items.pop(); + return; + } + } + it.start.push(this.sourceToken); + } + return; + } + if (this.indent >= map.indent) { + const atNextItem = !this.onKeyLine && this.indent === map.indent && it.sep; + // For empty nodes, assign newline-separated not indented empty tokens to following node + let start = []; + if (atNextItem && it.sep && !it.value) { + const nl = []; + for (let i = 0; i < it.sep.length; ++i) { + const st = it.sep[i]; + switch (st.type) { + case 'newline': + nl.push(i); + break; + case 'space': + break; + case 'comment': + if (st.indent > map.indent) + nl.length = 0; + break; + default: + nl.length = 0; + } + } + if (nl.length >= 2) + start = it.sep.splice(nl[1]); + } + switch (this.type) { + case 'anchor': + case 'tag': + if (atNextItem || it.value) { + start.push(this.sourceToken); + map.items.push({ start }); + this.onKeyLine = true; + } + else if (it.sep) { + it.sep.push(this.sourceToken); + } + else { + it.start.push(this.sourceToken); + } + return; + case 'explicit-key-ind': + if (!it.sep && !includesToken(it.start, 'explicit-key-ind')) { + it.start.push(this.sourceToken); + } + else if (atNextItem || it.value) { + start.push(this.sourceToken); + map.items.push({ start }); + } + else { + this.stack.push({ + type: 'block-map', + offset: this.offset, + indent: this.indent, + items: [{ start: [this.sourceToken] }] + }); + } + this.onKeyLine = true; + return; + case 'map-value-ind': + if (includesToken(it.start, 'explicit-key-ind')) { + if (!it.sep) { + if (includesToken(it.start, 'newline')) { + Object.assign(it, { key: null, sep: [this.sourceToken] }); + } + else { + const start = getFirstKeyStartProps(it.start); + this.stack.push({ + type: 'block-map', + offset: this.offset, + indent: this.indent, + items: [{ start, key: null, sep: [this.sourceToken] }] + }); + } + } + else if (it.value) { + map.items.push({ start: [], key: null, sep: [this.sourceToken] }); + } + else if (includesToken(it.sep, 'map-value-ind')) { + this.stack.push({ + type: 'block-map', + offset: this.offset, + indent: this.indent, + items: [{ start, key: null, sep: [this.sourceToken] }] + }); + } + else if (isFlowToken(it.key) && + !includesToken(it.sep, 'newline')) { + const start = getFirstKeyStartProps(it.start); + const key = it.key; + const sep = it.sep; + sep.push(this.sourceToken); + // @ts-expect-error type guard is wrong here + delete it.key, delete it.sep; + this.stack.push({ + type: 'block-map', + offset: this.offset, + indent: this.indent, + items: [{ start, key, sep }] + }); + } + else if (start.length > 0) { + // Not actually at next item + it.sep = it.sep.concat(start, this.sourceToken); + } + else { + it.sep.push(this.sourceToken); + } + } + else { + if (!it.sep) { + Object.assign(it, { key: null, sep: [this.sourceToken] }); + } + else if (it.value || atNextItem) { + map.items.push({ start, key: null, sep: [this.sourceToken] }); + } + else if (includesToken(it.sep, 'map-value-ind')) { + this.stack.push({ + type: 'block-map', + offset: this.offset, + indent: this.indent, + items: [{ start: [], key: null, sep: [this.sourceToken] }] + }); + } + else { + it.sep.push(this.sourceToken); + } + } + this.onKeyLine = true; + return; + case 'alias': + case 'scalar': + case 'single-quoted-scalar': + case 'double-quoted-scalar': { + const fs = this.flowScalar(this.type); + if (atNextItem || it.value) { + map.items.push({ start, key: fs, sep: [] }); + this.onKeyLine = true; + } + else if (it.sep) { + this.stack.push(fs); + } + else { + Object.assign(it, { key: fs, sep: [] }); + this.onKeyLine = true; + } + return; + } + default: { + const bv = this.startBlockValue(map); + if (bv) { + if (atNextItem && + bv.type !== 'block-seq' && + includesToken(it.start, 'explicit-key-ind')) { + map.items.push({ start }); + } + this.stack.push(bv); + return; + } + } + } + } + yield* this.pop(); + yield* this.step(); + } + *blockSequence(seq) { + const it = seq.items[seq.items.length - 1]; + switch (this.type) { + case 'newline': + if (it.value) { + const end = 'end' in it.value ? it.value.end : undefined; + const last = Array.isArray(end) ? end[end.length - 1] : undefined; + if (last?.type === 'comment') + end?.push(this.sourceToken); + else + seq.items.push({ start: [this.sourceToken] }); + } + else + it.start.push(this.sourceToken); + return; + case 'space': + case 'comment': + if (it.value) + seq.items.push({ start: [this.sourceToken] }); + else { + if (this.atIndentedComment(it.start, seq.indent)) { + const prev = seq.items[seq.items.length - 2]; + const end = prev?.value?.end; + if (Array.isArray(end)) { + Array.prototype.push.apply(end, it.start); + end.push(this.sourceToken); + seq.items.pop(); + return; + } + } + it.start.push(this.sourceToken); + } + return; + case 'anchor': + case 'tag': + if (it.value || this.indent <= seq.indent) + break; + it.start.push(this.sourceToken); + return; + case 'seq-item-ind': + if (this.indent !== seq.indent) + break; + if (it.value || includesToken(it.start, 'seq-item-ind')) + seq.items.push({ start: [this.sourceToken] }); + else + it.start.push(this.sourceToken); + return; + } + if (this.indent > seq.indent) { + const bv = this.startBlockValue(seq); + if (bv) { + this.stack.push(bv); + return; + } + } + yield* this.pop(); + yield* this.step(); + } + *flowCollection(fc) { + const it = fc.items[fc.items.length - 1]; + if (this.type === 'flow-error-end') { + let top; + do { + yield* this.pop(); + top = this.peek(1); + } while (top && top.type === 'flow-collection'); + } + else if (fc.end.length === 0) { + switch (this.type) { + case 'comma': + case 'explicit-key-ind': + if (!it || it.sep) + fc.items.push({ start: [this.sourceToken] }); + else + it.start.push(this.sourceToken); + return; + case 'map-value-ind': + if (!it || it.value) + fc.items.push({ start: [], key: null, sep: [this.sourceToken] }); + else if (it.sep) + it.sep.push(this.sourceToken); + else + Object.assign(it, { key: null, sep: [this.sourceToken] }); + return; + case 'space': + case 'comment': + case 'newline': + case 'anchor': + case 'tag': + if (!it || it.value) + fc.items.push({ start: [this.sourceToken] }); + else if (it.sep) + it.sep.push(this.sourceToken); + else + it.start.push(this.sourceToken); + return; + case 'alias': + case 'scalar': + case 'single-quoted-scalar': + case 'double-quoted-scalar': { + const fs = this.flowScalar(this.type); + if (!it || it.value) + fc.items.push({ start: [], key: fs, sep: [] }); + else if (it.sep) + this.stack.push(fs); + else + Object.assign(it, { key: fs, sep: [] }); + return; + } + case 'flow-map-end': + case 'flow-seq-end': + fc.end.push(this.sourceToken); + return; + } + const bv = this.startBlockValue(fc); + /* istanbul ignore else should not happen */ + if (bv) + this.stack.push(bv); + else { + yield* this.pop(); + yield* this.step(); + } + } + else { + const parent = this.peek(2); + if (parent.type === 'block-map' && + ((this.type === 'map-value-ind' && parent.indent === fc.indent) || + (this.type === 'newline' && + !parent.items[parent.items.length - 1].sep))) { + yield* this.pop(); + yield* this.step(); + } + else if (this.type === 'map-value-ind' && + parent.type !== 'flow-collection') { + const prev = getPrevProps(parent); + const start = getFirstKeyStartProps(prev); + fixFlowSeqItems(fc); + const sep = fc.end.splice(1, fc.end.length); + sep.push(this.sourceToken); + const map = { + type: 'block-map', + offset: fc.offset, + indent: fc.indent, + items: [{ start, key: fc, sep }] + }; + this.onKeyLine = true; + this.stack[this.stack.length - 1] = map; + } + else { + yield* this.lineEnd(fc); + } + } + } + flowScalar(type) { + if (this.onNewLine) { + let nl = this.source.indexOf('\n') + 1; + while (nl !== 0) { + this.onNewLine(this.offset + nl); + nl = this.source.indexOf('\n', nl) + 1; + } + } + return { + type, + offset: this.offset, + indent: this.indent, + source: this.source + }; + } + startBlockValue(parent) { + switch (this.type) { + case 'alias': + case 'scalar': + case 'single-quoted-scalar': + case 'double-quoted-scalar': + return this.flowScalar(this.type); + case 'block-scalar-header': + return { + type: 'block-scalar', + offset: this.offset, + indent: this.indent, + props: [this.sourceToken], + source: '' + }; + case 'flow-map-start': + case 'flow-seq-start': + return { + type: 'flow-collection', + offset: this.offset, + indent: this.indent, + start: this.sourceToken, + items: [], + end: [] + }; + case 'seq-item-ind': + return { + type: 'block-seq', + offset: this.offset, + indent: this.indent, + items: [{ start: [this.sourceToken] }] + }; + case 'explicit-key-ind': { + this.onKeyLine = true; + const prev = getPrevProps(parent); + const start = getFirstKeyStartProps(prev); + start.push(this.sourceToken); + return { + type: 'block-map', + offset: this.offset, + indent: this.indent, + items: [{ start }] + }; + } + case 'map-value-ind': { + this.onKeyLine = true; + const prev = getPrevProps(parent); + const start = getFirstKeyStartProps(prev); + return { + type: 'block-map', + offset: this.offset, + indent: this.indent, + items: [{ start, key: null, sep: [this.sourceToken] }] + }; + } + } + return null; + } + atIndentedComment(start, indent) { + if (this.type !== 'comment') + return false; + if (this.indent <= indent) + return false; + return start.every(st => st.type === 'newline' || st.type === 'space'); + } + *documentEnd(docEnd) { + if (this.type !== 'doc-mode') { + if (docEnd.end) + docEnd.end.push(this.sourceToken); + else + docEnd.end = [this.sourceToken]; + if (this.type === 'newline') + yield* this.pop(); + } + } + *lineEnd(token) { + switch (this.type) { + case 'comma': + case 'doc-start': + case 'doc-end': + case 'flow-seq-end': + case 'flow-map-end': + case 'map-value-ind': + yield* this.pop(); + yield* this.step(); + break; + case 'newline': + this.onKeyLine = false; + // fallthrough + case 'space': + case 'comment': + default: + // all other values are errors + if (token.end) + token.end.push(this.sourceToken); + else + token.end = [this.sourceToken]; + if (this.type === 'newline') + yield* this.pop(); + } + } +}; + +function parseOptions(options) { + const prettyErrors = options.prettyErrors !== false; + const lineCounter = options.lineCounter || (prettyErrors && new LineCounter()) || null; + return { lineCounter, prettyErrors }; +} +/** + * Parse the input as a stream of YAML documents. + * + * Documents should be separated from each other by `...` or `---` marker lines. + * + * @returns If an empty `docs` array is returned, it will be of type + * EmptyStream and contain additional stream information. In + * TypeScript, you should use `'empty' in docs` as a type guard for it. + */ +function parseAllDocuments(source, options = {}) { + const { lineCounter, prettyErrors } = parseOptions(options); + const parser = new Parser$1(lineCounter?.addNewLine); + const composer = new Composer(options); + const docs = Array.from(composer.compose(parser.parse(source))); + if (prettyErrors && lineCounter) + for (const doc of docs) { + doc.errors.forEach(prettifyError(source, lineCounter)); + doc.warnings.forEach(prettifyError(source, lineCounter)); + } + if (docs.length > 0) + return docs; + return Object.assign([], { empty: true }, composer.streamInfo()); +} +/** Parse an input string into a single YAML.Document */ +function parseDocument(source, options = {}) { + const { lineCounter, prettyErrors } = parseOptions(options); + const parser = new Parser$1(lineCounter?.addNewLine); + const composer = new Composer(options); + // `doc` is always set by compose.end(true) at the very latest + let doc = null; + for (const _doc of composer.compose(parser.parse(source), true, source.length)) { + if (!doc) + doc = _doc; + else if (doc.options.logLevel !== 'silent') { + doc.errors.push(new YAMLParseError(_doc.range.slice(0, 2), 'MULTIPLE_DOCS', 'Source contains multiple documents; please use YAML.parseAllDocuments()')); + break; + } + } + if (prettyErrors && lineCounter) { + doc.errors.forEach(prettifyError(source, lineCounter)); + doc.warnings.forEach(prettifyError(source, lineCounter)); + } + return doc; +} +function parse$b(src, reviver, options) { + let _reviver = undefined; + if (typeof reviver === 'function') { + _reviver = reviver; + } + else if (options === undefined && reviver && typeof reviver === 'object') { + options = reviver; + } + const doc = parseDocument(src, options); + if (!doc) + return null; + doc.warnings.forEach(warning => warn(doc.options.logLevel, warning)); + if (doc.errors.length > 0) { + if (doc.options.logLevel !== 'silent') + throw doc.errors[0]; + else + doc.errors = []; + } + return doc.toJS(Object.assign({ reviver: _reviver }, options)); +} +function stringify(value, replacer, options) { + let _replacer = null; + if (typeof replacer === 'function' || Array.isArray(replacer)) { + _replacer = replacer; + } + else if (options === undefined && replacer) { + options = replacer; + } + if (typeof options === 'string') + options = options.length; + if (typeof options === 'number') { + const indent = Math.round(options); + options = indent < 1 ? undefined : indent > 8 ? { indent: 8 } : { indent }; + } + if (value === undefined) { + const { keepUndefined } = options ?? replacer ?? {}; + if (!keepUndefined) + return undefined; + } + return new Document(value, _replacer, options).toString(options); +} + +var YAML = { + __proto__: null, + Alias: Alias, + CST: cst, + Composer: Composer, + Document: Document, + Lexer: Lexer, + LineCounter: LineCounter, + Pair: Pair, + Parser: Parser$1, + Scalar: Scalar, + Schema: Schema, + YAMLError: YAMLError, + YAMLMap: YAMLMap, + YAMLParseError: YAMLParseError, + YAMLSeq: YAMLSeq, + YAMLWarning: YAMLWarning, + isAlias: isAlias, + isCollection: isCollection$1, + isDocument: isDocument, + isMap: isMap, + isNode: isNode$1, + isPair: isPair, + isScalar: isScalar$1, + isSeq: isSeq, + parse: parse$b, + parseAllDocuments: parseAllDocuments, + parseDocument: parseDocument, + stringify: stringify, + visit: visit$1, + visitAsync: visitAsync +}; + +// `export * as default from ...` fails on Webpack v4 +// https://github.com/eemeli/yaml/issues/228 + +var browser$2 = { + __proto__: null, + Alias: Alias, + CST: cst, + Composer: Composer, + Document: Document, + Lexer: Lexer, + LineCounter: LineCounter, + Pair: Pair, + Parser: Parser$1, + Scalar: Scalar, + Schema: Schema, + YAMLError: YAMLError, + YAMLMap: YAMLMap, + YAMLParseError: YAMLParseError, + YAMLSeq: YAMLSeq, + YAMLWarning: YAMLWarning, + default: YAML, + isAlias: isAlias, + isCollection: isCollection$1, + isDocument: isDocument, + isMap: isMap, + isNode: isNode$1, + isPair: isPair, + isScalar: isScalar$1, + isSeq: isSeq, + parse: parse$b, + parseAllDocuments: parseAllDocuments, + parseDocument: parseDocument, + stringify: stringify, + visit: visit$1, + visitAsync: visitAsync +}; + +var require$$3 = /*@__PURE__*/getAugmentedNamespace(browser$2); + +// eslint-disable-next-line n/no-deprecated-api +const { createRequire, createRequireFromPath } = require$$0$8; + +function req$2 (name, rootFile) { + const create = createRequire || createRequireFromPath; + const require = create(rootFile); + return require(name) +} + +var req_1 = req$2; + +const req$1 = req_1; + +/** + * Load Options + * + * @private + * @method options + * + * @param {Object} config PostCSS Config + * + * @return {Object} options PostCSS Options + */ +const options = (config, file) => { + if (config.parser && typeof config.parser === 'string') { + try { + config.parser = req$1(config.parser, file); + } catch (err) { + throw new Error(`Loading PostCSS Parser failed: ${err.message}\n\n(@${file})`) + } + } + + if (config.syntax && typeof config.syntax === 'string') { + try { + config.syntax = req$1(config.syntax, file); + } catch (err) { + throw new Error(`Loading PostCSS Syntax failed: ${err.message}\n\n(@${file})`) + } + } + + if (config.stringifier && typeof config.stringifier === 'string') { + try { + config.stringifier = req$1(config.stringifier, file); + } catch (err) { + throw new Error(`Loading PostCSS Stringifier failed: ${err.message}\n\n(@${file})`) + } + } + + if (config.plugins) { + delete config.plugins; + } + + return config +}; + +var options_1 = options; + +const req = req_1; + +/** + * Plugin Loader + * + * @private + * @method load + * + * @param {String} plugin PostCSS Plugin Name + * @param {Object} options PostCSS Plugin Options + * + * @return {Function} PostCSS Plugin + */ +const load = (plugin, options, file) => { + try { + if ( + options === null || + options === undefined || + Object.keys(options).length === 0 + ) { + return req(plugin, file) + } else { + return req(plugin, file)(options) + } + } catch (err) { + throw new Error(`Loading PostCSS Plugin failed: ${err.message}\n\n(@${file})`) + } +}; + +/** + * Load Plugins + * + * @private + * @method plugins + * + * @param {Object} config PostCSS Config Plugins + * + * @return {Array} plugins PostCSS Plugins + */ +const plugins = (config, file) => { + let plugins = []; + + if (Array.isArray(config.plugins)) { + plugins = config.plugins.filter(Boolean); + } else { + plugins = Object.keys(config.plugins) + .filter((plugin) => { + return config.plugins[plugin] !== false ? plugin : '' + }) + .map((plugin) => { + return load(plugin, config.plugins[plugin], file) + }); + } + + if (plugins.length && plugins.length > 0) { + plugins.forEach((plugin, i) => { + if (plugin.default) { + plugin = plugin.default; + } + + if (plugin.postcss === true) { + plugin = plugin(); + } else if (plugin.postcss) { + plugin = plugin.postcss; + } + + if ( + // eslint-disable-next-line + !( + (typeof plugin === 'object' && Array.isArray(plugin.plugins)) || + (typeof plugin === 'object' && plugin.postcssPlugin) || + (typeof plugin === 'function') + ) + ) { + throw new TypeError(`Invalid PostCSS Plugin found at: plugins[${i}]\n\n(@${file})`) + } + }); + } + + return plugins +}; + +var plugins_1 = plugins; + +const resolve = require$$0$4.resolve; +const url$4 = require$$0$9; + +const config$1 = dist; +const yaml = require$$3; + +const loadOptions = options_1; +const loadPlugins = plugins_1; + +/* istanbul ignore next */ +const interopRequireDefault = (obj) => obj && obj.__esModule ? obj : { default: obj }; + +/** + * Process the result from cosmiconfig + * + * @param {Object} ctx Config Context + * @param {Object} result Cosmiconfig result + * + * @return {Object} PostCSS Config + */ +const processResult = (ctx, result) => { + const file = result.filepath || ''; + let config = interopRequireDefault(result.config).default || {}; + + if (typeof config === 'function') { + config = config(ctx); + } else { + config = Object.assign({}, config, ctx); + } + + if (!config.plugins) { + config.plugins = []; + } + + return { + plugins: loadPlugins(config, file), + options: loadOptions(config, file), + file + } +}; + +/** + * Builds the Config Context + * + * @param {Object} ctx Config Context + * + * @return {Object} Config Context + */ +const createContext = (ctx) => { + /** + * @type {Object} + * + * @prop {String} cwd=process.cwd() Config search start location + * @prop {String} env=process.env.NODE_ENV Config Enviroment, will be set to `development` by `postcss-load-config` if `process.env.NODE_ENV` is `undefined` + */ + ctx = Object.assign({ + cwd: process.cwd(), + env: process.env.NODE_ENV + }, ctx); + + if (!ctx.env) { + process.env.NODE_ENV = 'development'; + } + + return ctx +}; + +const importDefault = async filepath => { + const module = await import(url$4.pathToFileURL(filepath).href); + return module.default +}; + +const addTypeScriptLoader = (options = {}, loader) => { + const moduleName = 'postcss'; + + return { + ...options, + searchPlaces: [ + ...(options.searchPlaces || []), + 'package.json', + `.${moduleName}rc`, + `.${moduleName}rc.json`, + `.${moduleName}rc.yaml`, + `.${moduleName}rc.yml`, + `.${moduleName}rc.ts`, + `.${moduleName}rc.cts`, + `.${moduleName}rc.js`, + `.${moduleName}rc.cjs`, + `.${moduleName}rc.mjs`, + `${moduleName}.config.ts`, + `${moduleName}.config.cts`, + `${moduleName}.config.js`, + `${moduleName}.config.cjs`, + `${moduleName}.config.mjs` + ], + loaders: { + ...options.loaders, + '.yaml': (filepath, content) => yaml.parse(content), + '.yml': (filepath, content) => yaml.parse(content), + '.js': importDefault, + '.cjs': importDefault, + '.mjs': importDefault, + '.ts': loader, + '.cts': loader + } + } +}; + +const withTypeScriptLoader = (rcFunc) => { + return (ctx, path, options) => { + return rcFunc(ctx, path, addTypeScriptLoader(options, (configFile) => { + let registerer = { enabled () {} }; + + try { + // Register TypeScript compiler instance + registerer = __require('ts-node').register({ + // transpile to cjs even if compilerOptions.module in tsconfig is not Node16/NodeNext. + moduleTypes: { '**/*.cts': 'cjs' } + }); + + return __require(configFile) + } catch (err) { + if (err.code === 'MODULE_NOT_FOUND') { + throw new Error( + `'ts-node' is required for the TypeScript configuration files. Make sure it is installed\nError: ${err.message}` + ) + } + + throw err + } finally { + registerer.enabled(false); + } + })) + } +}; + +/** + * Load Config + * + * @method rc + * + * @param {Object} ctx Config Context + * @param {String} path Config Path + * @param {Object} options Config Options + * + * @return {Promise} config PostCSS Config + */ +const rc = withTypeScriptLoader((ctx, path, options) => { + /** + * @type {Object} The full Config Context + */ + ctx = createContext(ctx); + + /** + * @type {String} `process.cwd()` + */ + path = path ? resolve(path) : process.cwd(); + + return config$1.lilconfig('postcss', options) + .search(path) + .then((result) => { + if (!result) { + throw new Error(`No PostCSS Config found in: ${path}`) + } + + return processResult(ctx, result) + }) +}); + +/** + * Autoload Config for PostCSS + * + * @author Michael Ciniawsky @michael-ciniawsky + * @license MIT + * + * @module postcss-load-config + * @version 2.1.0 + * + * @requires comsiconfig + * @requires ./options + * @requires ./plugins + */ +var src$1 = rc; + +var postcssrc = /*@__PURE__*/getDefaultExportFromCjs(src$1); + +// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell +// License: MIT. +var Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace; +RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu; +Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y; +Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu; +StringLiteral = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y; +NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y; +Template = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y; +WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu; +LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y; +MultiLineComment = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y; +SingleLineComment = /\/\/.*/y; +JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y; +JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu; +JSXString = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y; +JSXText = /[^<>{}]+/y; +TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/; +TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/; +KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/; +KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/; +Newline = RegExp(LineTerminatorSequence.source); +var jsTokens_1 = function*(input, {jsx = false} = {}) { + var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack; + ({length} = input); + lastIndex = 0; + lastSignificantToken = ""; + stack = [ + {tag: "JS"} + ]; + braces = []; + parenNesting = 0; + postfixIncDec = false; + while (lastIndex < length) { + mode = stack[stack.length - 1]; + switch (mode.tag) { + case "JS": + case "JSNonExpressionParen": + case "InterpolationInTemplate": + case "InterpolationInJSX": + if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) { + RegularExpressionLiteral.lastIndex = lastIndex; + if (match = RegularExpressionLiteral.exec(input)) { + lastIndex = RegularExpressionLiteral.lastIndex; + lastSignificantToken = match[0]; + postfixIncDec = true; + yield ({ + type: "RegularExpressionLiteral", + value: match[0], + closed: match[1] !== void 0 && match[1] !== "\\" + }); + continue; + } + } + Punctuator.lastIndex = lastIndex; + if (match = Punctuator.exec(input)) { + punctuator = match[0]; + nextLastIndex = Punctuator.lastIndex; + nextLastSignificantToken = punctuator; + switch (punctuator) { + case "(": + if (lastSignificantToken === "?NonExpressionParenKeyword") { + stack.push({ + tag: "JSNonExpressionParen", + nesting: parenNesting + }); + } + parenNesting++; + postfixIncDec = false; + break; + case ")": + parenNesting--; + postfixIncDec = true; + if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) { + stack.pop(); + nextLastSignificantToken = "?NonExpressionParenEnd"; + postfixIncDec = false; + } + break; + case "{": + Punctuator.lastIndex = 0; + isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken)); + braces.push(isExpression); + postfixIncDec = false; + break; + case "}": + switch (mode.tag) { + case "InterpolationInTemplate": + if (braces.length === mode.nesting) { + Template.lastIndex = lastIndex; + match = Template.exec(input); + lastIndex = Template.lastIndex; + lastSignificantToken = match[0]; + if (match[1] === "${") { + lastSignificantToken = "?InterpolationInTemplate"; + postfixIncDec = false; + yield ({ + type: "TemplateMiddle", + value: match[0] + }); + } else { + stack.pop(); + postfixIncDec = true; + yield ({ + type: "TemplateTail", + value: match[0], + closed: match[1] === "`" + }); + } + continue; + } + break; + case "InterpolationInJSX": + if (braces.length === mode.nesting) { + stack.pop(); + lastIndex += 1; + lastSignificantToken = "}"; + yield ({ + type: "JSXPunctuator", + value: "}" + }); + continue; + } + } + postfixIncDec = braces.pop(); + nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}"; + break; + case "]": + postfixIncDec = true; + break; + case "++": + case "--": + nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec"; + break; + case "<": + if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) { + stack.push({tag: "JSXTag"}); + lastIndex += 1; + lastSignificantToken = "<"; + yield ({ + type: "JSXPunctuator", + value: punctuator + }); + continue; + } + postfixIncDec = false; + break; + default: + postfixIncDec = false; + } + lastIndex = nextLastIndex; + lastSignificantToken = nextLastSignificantToken; + yield ({ + type: "Punctuator", + value: punctuator + }); + continue; + } + Identifier.lastIndex = lastIndex; + if (match = Identifier.exec(input)) { + lastIndex = Identifier.lastIndex; + nextLastSignificantToken = match[0]; + switch (match[0]) { + case "for": + case "if": + case "while": + case "with": + if (lastSignificantToken !== "." && lastSignificantToken !== "?.") { + nextLastSignificantToken = "?NonExpressionParenKeyword"; + } + } + lastSignificantToken = nextLastSignificantToken; + postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]); + yield ({ + type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName", + value: match[0] + }); + continue; + } + StringLiteral.lastIndex = lastIndex; + if (match = StringLiteral.exec(input)) { + lastIndex = StringLiteral.lastIndex; + lastSignificantToken = match[0]; + postfixIncDec = true; + yield ({ + type: "StringLiteral", + value: match[0], + closed: match[2] !== void 0 + }); + continue; + } + NumericLiteral.lastIndex = lastIndex; + if (match = NumericLiteral.exec(input)) { + lastIndex = NumericLiteral.lastIndex; + lastSignificantToken = match[0]; + postfixIncDec = true; + yield ({ + type: "NumericLiteral", + value: match[0] + }); + continue; + } + Template.lastIndex = lastIndex; + if (match = Template.exec(input)) { + lastIndex = Template.lastIndex; + lastSignificantToken = match[0]; + if (match[1] === "${") { + lastSignificantToken = "?InterpolationInTemplate"; + stack.push({ + tag: "InterpolationInTemplate", + nesting: braces.length + }); + postfixIncDec = false; + yield ({ + type: "TemplateHead", + value: match[0] + }); + } else { + postfixIncDec = true; + yield ({ + type: "NoSubstitutionTemplate", + value: match[0], + closed: match[1] === "`" + }); + } + continue; + } + break; + case "JSXTag": + case "JSXTagEnd": + JSXPunctuator.lastIndex = lastIndex; + if (match = JSXPunctuator.exec(input)) { + lastIndex = JSXPunctuator.lastIndex; + nextLastSignificantToken = match[0]; + switch (match[0]) { + case "<": + stack.push({tag: "JSXTag"}); + break; + case ">": + stack.pop(); + if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") { + nextLastSignificantToken = "?JSX"; + postfixIncDec = true; + } else { + stack.push({tag: "JSXChildren"}); + } + break; + case "{": + stack.push({ + tag: "InterpolationInJSX", + nesting: braces.length + }); + nextLastSignificantToken = "?InterpolationInJSX"; + postfixIncDec = false; + break; + case "/": + if (lastSignificantToken === "<") { + stack.pop(); + if (stack[stack.length - 1].tag === "JSXChildren") { + stack.pop(); + } + stack.push({tag: "JSXTagEnd"}); + } + } + lastSignificantToken = nextLastSignificantToken; + yield ({ + type: "JSXPunctuator", + value: match[0] + }); + continue; + } + JSXIdentifier.lastIndex = lastIndex; + if (match = JSXIdentifier.exec(input)) { + lastIndex = JSXIdentifier.lastIndex; + lastSignificantToken = match[0]; + yield ({ + type: "JSXIdentifier", + value: match[0] + }); + continue; + } + JSXString.lastIndex = lastIndex; + if (match = JSXString.exec(input)) { + lastIndex = JSXString.lastIndex; + lastSignificantToken = match[0]; + yield ({ + type: "JSXString", + value: match[0], + closed: match[2] !== void 0 + }); + continue; + } + break; + case "JSXChildren": + JSXText.lastIndex = lastIndex; + if (match = JSXText.exec(input)) { + lastIndex = JSXText.lastIndex; + lastSignificantToken = match[0]; + yield ({ + type: "JSXText", + value: match[0] + }); + continue; + } + switch (input[lastIndex]) { + case "<": + stack.push({tag: "JSXTag"}); + lastIndex++; + lastSignificantToken = "<"; + yield ({ + type: "JSXPunctuator", + value: "<" + }); + continue; + case "{": + stack.push({ + tag: "InterpolationInJSX", + nesting: braces.length + }); + lastIndex++; + lastSignificantToken = "?InterpolationInJSX"; + postfixIncDec = false; + yield ({ + type: "JSXPunctuator", + value: "{" + }); + continue; + } + } + WhiteSpace.lastIndex = lastIndex; + if (match = WhiteSpace.exec(input)) { + lastIndex = WhiteSpace.lastIndex; + yield ({ + type: "WhiteSpace", + value: match[0] + }); + continue; + } + LineTerminatorSequence.lastIndex = lastIndex; + if (match = LineTerminatorSequence.exec(input)) { + lastIndex = LineTerminatorSequence.lastIndex; + postfixIncDec = false; + if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) { + lastSignificantToken = "?NoLineTerminatorHere"; + } + yield ({ + type: "LineTerminatorSequence", + value: match[0] + }); + continue; + } + MultiLineComment.lastIndex = lastIndex; + if (match = MultiLineComment.exec(input)) { + lastIndex = MultiLineComment.lastIndex; + if (Newline.test(match[0])) { + postfixIncDec = false; + if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) { + lastSignificantToken = "?NoLineTerminatorHere"; + } + } + yield ({ + type: "MultiLineComment", + value: match[0], + closed: match[1] !== void 0 + }); + continue; + } + SingleLineComment.lastIndex = lastIndex; + if (match = SingleLineComment.exec(input)) { + lastIndex = SingleLineComment.lastIndex; + postfixIncDec = false; + yield ({ + type: "SingleLineComment", + value: match[0] + }); + continue; + } + firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex)); + lastIndex += firstCodePoint.length; + lastSignificantToken = firstCodePoint; + postfixIncDec = false; + yield ({ + type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid", + value: firstCodePoint + }); + } + return void 0; +}; + +var jsTokens = /*@__PURE__*/getDefaultExportFromCjs(jsTokens_1); + +function stripLiteralJsTokens(code, options) { + const FILL = options?.fillChar ?? " "; + const FILL_COMMENT = " "; + let result = ""; + const filter = options?.filter ?? (() => true); + const tokens = []; + for (const token of jsTokens(code, { jsx: false })) { + tokens.push(token); + if (token.type === "SingleLineComment") { + result += FILL_COMMENT.repeat(token.value.length); + continue; + } + if (token.type === "MultiLineComment") { + result += token.value.replace(/[^\n]/g, FILL_COMMENT); + continue; + } + if (token.type === "StringLiteral") { + const body = token.value.slice(1, -1); + if (filter(body)) { + result += token.value[0] + FILL.repeat(body.length) + token.value[token.value.length - 1]; + continue; + } + } + if (token.type === "NoSubstitutionTemplate") { + const body = token.value.slice(1, -1); + if (filter(body)) { + result += `\`${body.replace(/[^\n]/g, FILL)}\``; + continue; + } + } + if (token.type === "RegularExpressionLiteral") { + const body = token.value; + if (filter(body)) { + result += body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${FILL.repeat($1.length)}/${$2}`); + continue; + } + } + if (token.type === "TemplateHead") { + const body = token.value.slice(1, -2); + if (filter(body)) { + result += `\`${body.replace(/[^\n]/g, FILL)}\${`; + continue; + } + } + if (token.type === "TemplateTail") { + const body = token.value.slice(0, -2); + if (filter(body)) { + result += `}${body.replace(/[^\n]/g, FILL)}\``; + continue; + } + } + if (token.type === "TemplateMiddle") { + const body = token.value.slice(1, -2); + if (filter(body)) { + result += `}${body.replace(/[^\n]/g, FILL)}\${`; + continue; + } + } + result += token.value; + } + return { + result, + tokens + }; +} + +function stripLiteral(code, options) { + return stripLiteralDetailed(code, options).result; +} +function stripLiteralDetailed(code, options) { + return stripLiteralJsTokens(code, options); +} + +var main$1 = {exports: {}}; + +var name = "dotenv"; +var version$2 = "16.4.2"; +var description = "Loads environment variables from .env file"; +var main = "lib/main.js"; +var types$2 = "lib/main.d.ts"; +var exports = { + ".": { + types: "./lib/main.d.ts", + require: "./lib/main.js", + "default": "./lib/main.js" + }, + "./config": "./config.js", + "./config.js": "./config.js", + "./lib/env-options": "./lib/env-options.js", + "./lib/env-options.js": "./lib/env-options.js", + "./lib/cli-options": "./lib/cli-options.js", + "./lib/cli-options.js": "./lib/cli-options.js", + "./package.json": "./package.json" +}; +var scripts = { + "dts-check": "tsc --project tests/types/tsconfig.json", + lint: "standard", + "lint-readme": "standard-markdown", + pretest: "npm run lint && npm run dts-check", + test: "tap tests/*.js --100 -Rspec", + prerelease: "npm test", + release: "standard-version" +}; +var repository = { + type: "git", + url: "git://github.com/motdotla/dotenv.git" +}; +var funding = "https://dotenvx.com"; +var keywords$2 = [ + "dotenv", + "env", + ".env", + "environment", + "variables", + "config", + "settings" +]; +var readmeFilename = "README.md"; +var license = "BSD-2-Clause"; +var devDependencies = { + "@definitelytyped/dtslint": "^0.0.133", + "@types/node": "^18.11.3", + decache: "^4.6.1", + sinon: "^14.0.1", + standard: "^17.0.0", + "standard-markdown": "^7.1.0", + "standard-version": "^9.5.0", + tap: "^16.3.0", + tar: "^6.1.11", + typescript: "^4.8.4" +}; +var engines = { + node: ">=12" +}; +var browser$1 = { + fs: false +}; +var require$$4 = { + name: name, + version: version$2, + description: description, + main: main, + types: types$2, + exports: exports, + scripts: scripts, + repository: repository, + funding: funding, + keywords: keywords$2, + readmeFilename: readmeFilename, + license: license, + devDependencies: devDependencies, + engines: engines, + browser: browser$1 +}; + +const fs$9 = require$$0__default; +const path$9 = require$$0$4; +const os$2 = require$$2; +const crypto$1 = require$$0$a; +const packageJson = require$$4; + +const version$1 = packageJson.version; + +const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg; + +// Parse src into an Object +function parse$a (src) { + const obj = {}; + + // Convert buffer to string + let lines = src.toString(); + + // Convert line breaks to same format + lines = lines.replace(/\r\n?/mg, '\n'); + + let match; + while ((match = LINE.exec(lines)) != null) { + const key = match[1]; + + // Default undefined or null to empty string + let value = (match[2] || ''); + + // Remove whitespace + value = value.trim(); + + // Check if double quoted + const maybeQuote = value[0]; + + // Remove surrounding quotes + value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2'); + + // Expand newlines if double quoted + if (maybeQuote === '"') { + value = value.replace(/\\n/g, '\n'); + value = value.replace(/\\r/g, '\r'); + } + + // Add to object + obj[key] = value; + } + + return obj +} + +function _parseVault (options) { + const vaultPath = _vaultPath(options); + + // Parse .env.vault + const result = DotenvModule.configDotenv({ path: vaultPath }); + if (!result.parsed) { + const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`); + err.code = 'MISSING_DATA'; + throw err + } + + // handle scenario for comma separated keys - for use with key rotation + // example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod" + const keys = _dotenvKey(options).split(','); + const length = keys.length; + + let decrypted; + for (let i = 0; i < length; i++) { + try { + // Get full key + const key = keys[i].trim(); + + // Get instructions for decrypt + const attrs = _instructions(result, key); + + // Decrypt + decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key); + + break + } catch (error) { + // last key + if (i + 1 >= length) { + throw error + } + // try next key + } + } + + // Parse decrypted .env string + return DotenvModule.parse(decrypted) +} + +function _log (message) { + console.log(`[dotenv@${version$1}][INFO] ${message}`); +} + +function _warn (message) { + console.log(`[dotenv@${version$1}][WARN] ${message}`); +} + +function _debug (message) { + console.log(`[dotenv@${version$1}][DEBUG] ${message}`); +} + +function _dotenvKey (options) { + // prioritize developer directly setting options.DOTENV_KEY + if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) { + return options.DOTENV_KEY + } + + // secondary infra already contains a DOTENV_KEY environment variable + if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) { + return process.env.DOTENV_KEY + } + + // fallback to empty string + return '' +} + +function _instructions (result, dotenvKey) { + // Parse DOTENV_KEY. Format is a URI + let uri; + try { + uri = new URL(dotenvKey); + } catch (error) { + if (error.code === 'ERR_INVALID_URL') { + const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + throw error + } + + // Get decrypt key + const key = uri.password; + if (!key) { + const err = new Error('INVALID_DOTENV_KEY: Missing key part'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + // Get environment + const environment = uri.searchParams.get('environment'); + if (!environment) { + const err = new Error('INVALID_DOTENV_KEY: Missing environment part'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } + + // Get ciphertext payload + const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`; + const ciphertext = result.parsed[environmentKey]; // DOTENV_VAULT_PRODUCTION + if (!ciphertext) { + const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`); + err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'; + throw err + } + + return { ciphertext, key } +} + +function _vaultPath (options) { + let possibleVaultPath = null; + + if (options && options.path && options.path.length > 0) { + if (Array.isArray(options.path)) { + for (const filepath of options.path) { + if (fs$9.existsSync(filepath)) { + possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`; + } + } + } else { + possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`; + } + } else { + possibleVaultPath = path$9.resolve(process.cwd(), '.env.vault'); + } + + if (fs$9.existsSync(possibleVaultPath)) { + return possibleVaultPath + } + + return null +} + +function _resolveHome (envPath) { + return envPath[0] === '~' ? path$9.join(os$2.homedir(), envPath.slice(1)) : envPath +} + +function _configVault (options) { + _log('Loading env from encrypted .env.vault'); + + const parsed = DotenvModule._parseVault(options); + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + DotenvModule.populate(processEnv, parsed, options); + + return { parsed } +} + +function configDotenv (options) { + let dotenvPath = path$9.resolve(process.cwd(), '.env'); + let encoding = 'utf8'; + const debug = Boolean(options && options.debug); + + if (options) { + if (options.path != null) { + let envPath = options.path; + + if (Array.isArray(envPath)) { + for (const filepath of options.path) { + if (fs$9.existsSync(filepath)) { + envPath = filepath; + break + } + } + } + + dotenvPath = _resolveHome(envPath); + } + if (options.encoding != null) { + encoding = options.encoding; + } else { + if (debug) { + _debug('No encoding is specified. UTF-8 is used by default'); + } + } + } + + try { + // Specifying an encoding returns a string instead of a buffer + const parsed = DotenvModule.parse(fs$9.readFileSync(dotenvPath, { encoding })); + + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + DotenvModule.populate(processEnv, parsed, options); + + return { parsed } + } catch (e) { + if (debug) { + _debug(`Failed to load ${dotenvPath} ${e.message}`); + } + + return { error: e } + } +} + +// Populates process.env from .env file +function config (options) { + // fallback to original dotenv if DOTENV_KEY is not set + if (_dotenvKey(options).length === 0) { + return DotenvModule.configDotenv(options) + } + + const vaultPath = _vaultPath(options); + + // dotenvKey exists but .env.vault file does not exist + if (!vaultPath) { + _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`); + + return DotenvModule.configDotenv(options) + } + + return DotenvModule._configVault(options) +} + +function decrypt (encrypted, keyStr) { + const key = Buffer.from(keyStr.slice(-64), 'hex'); + let ciphertext = Buffer.from(encrypted, 'base64'); + + const nonce = ciphertext.subarray(0, 12); + const authTag = ciphertext.subarray(-16); + ciphertext = ciphertext.subarray(12, -16); + + try { + const aesgcm = crypto$1.createDecipheriv('aes-256-gcm', key, nonce); + aesgcm.setAuthTag(authTag); + return `${aesgcm.update(ciphertext)}${aesgcm.final()}` + } catch (error) { + const isRange = error instanceof RangeError; + const invalidKeyLength = error.message === 'Invalid key length'; + const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'; + + if (isRange || invalidKeyLength) { + const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)'); + err.code = 'INVALID_DOTENV_KEY'; + throw err + } else if (decryptionFailed) { + const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY'); + err.code = 'DECRYPTION_FAILED'; + throw err + } else { + throw error + } + } +} + +// Populate process.env with parsed values +function populate (processEnv, parsed, options = {}) { + const debug = Boolean(options && options.debug); + const override = Boolean(options && options.override); + + if (typeof parsed !== 'object') { + const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate'); + err.code = 'OBJECT_REQUIRED'; + throw err + } + + // Set process.env + for (const key of Object.keys(parsed)) { + if (Object.prototype.hasOwnProperty.call(processEnv, key)) { + if (override === true) { + processEnv[key] = parsed[key]; + } + + if (debug) { + if (override === true) { + _debug(`"${key}" is already defined and WAS overwritten`); + } else { + _debug(`"${key}" is already defined and was NOT overwritten`); + } + } + } else { + processEnv[key] = parsed[key]; + } + } +} + +const DotenvModule = { + configDotenv, + _configVault, + _parseVault, + config, + decrypt, + parse: parse$a, + populate +}; + +main$1.exports.configDotenv = DotenvModule.configDotenv; +main$1.exports._configVault = DotenvModule._configVault; +main$1.exports._parseVault = DotenvModule._parseVault; +main$1.exports.config = DotenvModule.config; +main$1.exports.decrypt = DotenvModule.decrypt; +var parse_1$1 = main$1.exports.parse = DotenvModule.parse; +main$1.exports.populate = DotenvModule.populate; + +main$1.exports = DotenvModule; + +// * / +// * (\\)? # is it escaped with a backslash? +// * (\$) # literal $ +// * (?!\() # shouldnt be followed by parenthesis +// * (\{?) # first brace wrap opening +// * ([\w.]+) # key +// * (?::-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))? # optional default nested 3 times +// * (\}?) # last brace warp closing +// * /xi + +const DOTENV_SUBSTITUTION_REGEX = /(\\)?(\$)(?!\()(\{?)([\w.]+)(?::?-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))?(\}?)/gi; + +function _resolveEscapeSequences (value) { + return value.replace(/\\\$/g, '$') +} + +function interpolate (value, processEnv, parsed) { + return value.replace(DOTENV_SUBSTITUTION_REGEX, (match, escaped, dollarSign, openBrace, key, defaultValue, closeBrace) => { + if (escaped === '\\') { + return match.slice(1) + } else { + if (processEnv[key]) { + return processEnv[key] + } + + if (parsed[key]) { + return parsed[key] + } + + if (defaultValue) { + if (defaultValue.startsWith('$')) { + return interpolate(defaultValue, processEnv, parsed) + } else { + return defaultValue + } + } + + return '' + } + }) +} + +function expand (options) { + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + + for (const key in options.parsed) { + let value = options.parsed[key]; + + const inProcessEnv = Object.prototype.hasOwnProperty.call(processEnv, key); + + if (inProcessEnv) { + if (processEnv[key] === options.parsed[key]) { + // assume was set to processEnv from the .env file if the values match and therefore interpolate + value = interpolate(value, processEnv, options.parsed); + } else { + // do not interpolate - assume processEnv had the intended value even if containing a $. + value = processEnv[key]; + } + } else { + // not inProcessEnv so assume interpolation for this .env key + value = interpolate(value, processEnv, options.parsed); + } + + options.parsed[key] = _resolveEscapeSequences(value); + } + + for (const processKey in options.parsed) { + processEnv[processKey] = options.parsed[processKey]; + } + + return options +} + +var expand_1 = expand; + +function getEnvFilesForMode(mode, envDir) { + return [ + /** default file */ `.env`, + /** local file */ `.env.local`, + /** mode file */ `.env.${mode}`, + /** mode local file */ `.env.${mode}.local`, + ].map((file) => normalizePath$3(path$o.join(envDir, file))); +} +function loadEnv(mode, envDir, prefixes = 'VITE_') { + if (mode === 'local') { + throw new Error(`"local" cannot be used as a mode name because it conflicts with ` + + `the .local postfix for .env files.`); + } + prefixes = arraify(prefixes); + const env = {}; + const envFiles = getEnvFilesForMode(mode, envDir); + const parsed = Object.fromEntries(envFiles.flatMap((filePath) => { + if (!tryStatSync(filePath)?.isFile()) + return []; + return Object.entries(parse_1$1(fs$l.readFileSync(filePath))); + })); + // test NODE_ENV override before expand as otherwise process.env.NODE_ENV would override this + if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) { + process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV; + } + // support BROWSER and BROWSER_ARGS env variables + if (parsed.BROWSER && process.env.BROWSER === undefined) { + process.env.BROWSER = parsed.BROWSER; + } + if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === undefined) { + process.env.BROWSER_ARGS = parsed.BROWSER_ARGS; + } + // let environment variables use each other. make a copy of `process.env` so that `dotenv-expand` + // doesn't re-assign the expanded values to the global `process.env`. + const processEnv = { ...process.env }; + expand_1({ parsed, processEnv }); + // only keys that start with prefix are exposed to client + for (const [key, value] of Object.entries(parsed)) { + if (prefixes.some((prefix) => key.startsWith(prefix))) { + env[key] = value; + } + } + // check if there are actual env variables starting with VITE_* + // these are typically provided inline and should be prioritized + for (const key in process.env) { + if (prefixes.some((prefix) => key.startsWith(prefix))) { + env[key] = process.env[key]; + } + } + return env; +} +function resolveEnvPrefix({ envPrefix = 'VITE_', }) { + envPrefix = arraify(envPrefix); + if (envPrefix.includes('')) { + throw new Error(`envPrefix option contains value '', which could lead unexpected exposure of sensitive information.`); + } + return envPrefix; +} + +const modulePreloadPolyfillId = 'vite/modulepreload-polyfill'; +const resolvedModulePreloadPolyfillId = '\0' + modulePreloadPolyfillId + '.js'; +function modulePreloadPolyfillPlugin(config) { + // `isModernFlag` is only available during build since it is resolved by `vite:build-import-analysis` + const skip = config.command !== 'build' || config.build.ssr; + let polyfillString; + return { + name: 'vite:modulepreload-polyfill', + resolveId(id) { + if (id === modulePreloadPolyfillId) { + return resolvedModulePreloadPolyfillId; + } + }, + load(id) { + if (id === resolvedModulePreloadPolyfillId) { + if (skip) { + return ''; + } + if (!polyfillString) { + polyfillString = `${isModernFlag}&&(${polyfill.toString()}());`; + } + return { code: polyfillString, moduleSideEffects: true }; + } + }, + }; +} +function polyfill() { + const relList = document.createElement('link').relList; + if (relList && relList.supports && relList.supports('modulepreload')) { + return; + } + for (const link of document.querySelectorAll('link[rel="modulepreload"]')) { + processPreload(link); + } + new MutationObserver((mutations) => { + for (const mutation of mutations) { + if (mutation.type !== 'childList') { + continue; + } + for (const node of mutation.addedNodes) { + if (node.tagName === 'LINK' && node.rel === 'modulepreload') + processPreload(node); + } + } + }).observe(document, { childList: true, subtree: true }); + function getFetchOpts(link) { + const fetchOpts = {}; + if (link.integrity) + fetchOpts.integrity = link.integrity; + if (link.referrerPolicy) + fetchOpts.referrerPolicy = link.referrerPolicy; + if (link.crossOrigin === 'use-credentials') + fetchOpts.credentials = 'include'; + else if (link.crossOrigin === 'anonymous') + fetchOpts.credentials = 'omit'; + else + fetchOpts.credentials = 'same-origin'; + return fetchOpts; + } + function processPreload(link) { + if (link.ep) + // ep marker = processed + return; + link.ep = true; + // prepopulate the load record + const fetchOpts = getFetchOpts(link); + fetch(link.href, fetchOpts); + } +} + +const htmlProxyRE$1 = /\?html-proxy=?(?:&inline-css)?(?:&style-attr)?&index=(\d+)\.(js|css)$/; +const isHtmlProxyRE = /\?html-proxy\b/; +const inlineCSSRE$1 = /__VITE_INLINE_CSS__([a-z\d]{8}_\d+)__/g; +// Do not allow preceding '.', but do allow preceding '...' for spread operations +const inlineImportRE = /(?]*type\s*=\s*(?:"importmap"|'importmap'|importmap)[^>]*>.*?<\/script>/is; +const moduleScriptRE = /[ \t]*]*type\s*=\s*(?:"module"|'module'|module)[^>]*>/i; +const modulePreloadLinkRE = /[ \t]*]*rel\s*=\s*(?:"modulepreload"|'modulepreload'|modulepreload)[\s\S]*?\/>/i; +const importMapAppendRE = new RegExp([moduleScriptRE, modulePreloadLinkRE].map((r) => r.source).join('|'), 'i'); +const isHTMLProxy = (id) => isHtmlProxyRE.test(id); +const isHTMLRequest = (request) => htmlLangRE.test(request); +// HTML Proxy Caches are stored by config -> filePath -> index +const htmlProxyMap = new WeakMap(); +// HTML Proxy Transform result are stored by config +// `${hash(importer)}_${query.index}` -> transformed css code +// PS: key like `hash(/vite/playground/assets/index.html)_1`) +const htmlProxyResult = new Map(); +function htmlInlineProxyPlugin(config) { + // Should do this when `constructor` rather than when `buildStart`, + // `buildStart` will be triggered multiple times then the cached result will be emptied. + // https://github.com/vitejs/vite/issues/6372 + htmlProxyMap.set(config, new Map()); + return { + name: 'vite:html-inline-proxy', + resolveId(id) { + if (isHTMLProxy(id)) { + return id; + } + }, + load(id) { + const proxyMatch = id.match(htmlProxyRE$1); + if (proxyMatch) { + const index = Number(proxyMatch[1]); + const file = cleanUrl(id); + const url = file.replace(normalizePath$3(config.root), ''); + const result = htmlProxyMap.get(config).get(url)?.[index]; + if (result) { + return result; + } + else { + throw new Error(`No matching HTML proxy module found from ${id}`); + } + } + }, + }; +} +function addToHTMLProxyCache(config, filePath, index, result) { + if (!htmlProxyMap.get(config)) { + htmlProxyMap.set(config, new Map()); + } + if (!htmlProxyMap.get(config).get(filePath)) { + htmlProxyMap.get(config).set(filePath, []); + } + htmlProxyMap.get(config).get(filePath)[index] = result; +} +function addToHTMLProxyTransformResult(hash, code) { + htmlProxyResult.set(hash, code); +} +// this extends the config in @vue/compiler-sfc with +const assetAttrsConfig = { + link: ['href'], + video: ['src', 'poster'], + source: ['src', 'srcset'], + img: ['src', 'srcset'], + image: ['xlink:href', 'href'], + use: ['xlink:href', 'href'], +}; +// Some `` elements should not be inlined in build. Excluding: +// - `shortcut` : only valid for IE <9, use `icon` +// - `mask-icon` : deprecated since Safari 12 (for pinned tabs) +// - `apple-touch-icon-precomposed` : only valid for iOS <7 (for avoiding gloss effect) +const noInlineLinkRels = new Set([ + 'icon', + 'apple-touch-icon', + 'apple-touch-startup-image', + 'manifest', +]); +const isAsyncScriptMap = new WeakMap(); +function nodeIsElement(node) { + return node.nodeName[0] !== '#'; +} +function traverseNodes(node, visitor) { + visitor(node); + if (nodeIsElement(node) || + node.nodeName === '#document' || + node.nodeName === '#document-fragment') { + node.childNodes.forEach((childNode) => traverseNodes(childNode, visitor)); + } +} +async function traverseHtml(html, filePath, visitor) { + // lazy load compiler + const { parse } = await import('./dep-kjUoH5nk.js'); + const ast = parse(html, { + scriptingEnabled: false, + sourceCodeLocationInfo: true, + onParseError: (e) => { + handleParseError(e, html, filePath); + }, + }); + traverseNodes(ast, visitor); +} +function getScriptInfo(node) { + let src; + let sourceCodeLocation; + let isModule = false; + let isAsync = false; + for (const p of node.attrs) { + if (p.prefix !== undefined) + continue; + if (p.name === 'src') { + if (!src) { + src = p; + sourceCodeLocation = node.sourceCodeLocation?.attrs['src']; + } + } + else if (p.name === 'type' && p.value && p.value === 'module') { + isModule = true; + } + else if (p.name === 'async') { + isAsync = true; + } + } + return { src, sourceCodeLocation, isModule, isAsync }; +} +const attrValueStartRE = /=\s*(.)/; +function overwriteAttrValue(s, sourceCodeLocation, newValue) { + const srcString = s.slice(sourceCodeLocation.startOffset, sourceCodeLocation.endOffset); + const valueStart = srcString.match(attrValueStartRE); + if (!valueStart) { + // overwrite attr value can only be called for a well-defined value + throw new Error(`[vite:html] internal error, failed to overwrite attribute value`); + } + const wrapOffset = valueStart[1] === '"' || valueStart[1] === "'" ? 1 : 0; + const valueOffset = valueStart.index + valueStart[0].length - 1; + s.update(sourceCodeLocation.startOffset + valueOffset + wrapOffset, sourceCodeLocation.endOffset - wrapOffset, newValue); + return s; +} +/** + * Format parse5 @type {ParserError} to @type {RollupError} + */ +function formatParseError(parserError, id, html) { + const formattedError = { + code: parserError.code, + message: `parse5 error code ${parserError.code}`, + frame: generateCodeFrame(html, parserError.startOffset, parserError.endOffset), + loc: { + file: id, + line: parserError.startLine, + column: parserError.startCol, + }, + }; + return formattedError; +} +function handleParseError(parserError, html, filePath) { + switch (parserError.code) { + case 'missing-doctype': + // ignore missing DOCTYPE + return; + case 'abandoned-head-element-child': + // Accept elements without closing tag in + return; + case 'duplicate-attribute': + // Accept duplicate attributes #9566 + // The first attribute is used, browsers silently ignore duplicates + return; + case 'non-void-html-element-start-tag-with-trailing-solidus': + // Allow self closing on non-void elements #10439 + return; + } + const parseError = formatParseError(parserError, filePath, html); + throw new Error(`Unable to parse HTML; ${parseError.message}\n` + + ` at ${parseError.loc.file}:${parseError.loc.line}:${parseError.loc.column}\n` + + `${parseError.frame}`); +} +/** + * Compiles index.html into an entry js module + */ +function buildHtmlPlugin(config) { + const [preHooks, normalHooks, postHooks] = resolveHtmlTransforms(config.plugins, config.logger); + preHooks.unshift(preImportMapHook(config)); + preHooks.push(htmlEnvHook(config)); + postHooks.push(postImportMapHook()); + const processedHtml = new Map(); + const isExcludedUrl = (url) => url[0] === '#' || isExternalUrl(url) || isDataUrl(url); + // Same reason with `htmlInlineProxyPlugin` + isAsyncScriptMap.set(config, new Map()); + return { + name: 'vite:build-html', + async transform(html, id) { + if (id.endsWith('.html')) { + id = normalizePath$3(id); + const relativeUrlPath = path$o.posix.relative(config.root, id); + const publicPath = `/${relativeUrlPath}`; + const publicBase = getBaseInHTML(relativeUrlPath, config); + const publicToRelative = (filename, importer) => publicBase + filename; + const toOutputPublicFilePath = (url) => toOutputFilePathInHtml(url.slice(1), 'public', relativeUrlPath, 'html', config, publicToRelative); + // Determines true start position for the node, either the < character + // position, or the newline at the end of the previous line's node. + const nodeStartWithLeadingWhitespace = (node) => { + const startOffset = node.sourceCodeLocation.startOffset; + if (startOffset === 0) + return 0; + // Gets the offset for the start of the line including the + // newline trailing the previous node + const lineStartOffset = startOffset - node.sourceCodeLocation.startCol; + // + // + // + // Here we want to target the newline at the end of the previous line + // as the start position for our target. + // + // + // + // + // However, if there is content between our target node start and the + // previous newline, we cannot strip it out without risking content deletion. + let isLineEmpty = false; + try { + const line = s.slice(Math.max(0, lineStartOffset), startOffset); + isLineEmpty = !line.trim(); + } + catch { + // magic-string may throw if there's some content removed in the sliced string, + // which we ignore and assume the line is not empty + } + return isLineEmpty ? lineStartOffset : startOffset; + }; + // pre-transform + html = await applyHtmlTransforms(html, preHooks, { + path: publicPath, + filename: id, + }); + let js = ''; + const s = new MagicString(html); + const scriptUrls = []; + const styleUrls = []; + let inlineModuleIndex = -1; + let everyScriptIsAsync = true; + let someScriptsAreAsync = false; + let someScriptsAreDefer = false; + const assetUrlsPromises = []; + // for each encountered asset url, rewrite original html so that it + // references the post-build location, ignoring empty attributes and + // attributes that directly reference named output. + const namedOutput = Object.keys(config?.build?.rollupOptions?.input || {}); + const processAssetUrl = async (url, shouldInline) => { + if (url !== '' && // Empty attribute + !namedOutput.includes(url) && // Direct reference to named output + !namedOutput.includes(removeLeadingSlash(url)) // Allow for absolute references as named output can't be an absolute path + ) { + try { + return await urlToBuiltUrl(url, id, config, this, shouldInline); + } + catch (e) { + if (e.code !== 'ENOENT') { + throw e; + } + } + } + return url; + }; + await traverseHtml(html, id, (node) => { + if (!nodeIsElement(node)) { + return; + } + let shouldRemove = false; + // script tags + if (node.nodeName === 'script') { + const { src, sourceCodeLocation, isModule, isAsync } = getScriptInfo(node); + const url = src && src.value; + const isPublicFile = !!(url && checkPublicFile(url, config)); + if (isPublicFile) { + // referencing public dir url, prefix with base + overwriteAttrValue(s, sourceCodeLocation, toOutputPublicFilePath(url)); + } + if (isModule) { + inlineModuleIndex++; + if (url && !isExcludedUrl(url) && !isPublicFile) { + // + const filePath = id.replace(normalizePath$3(config.root), ''); + addToHTMLProxyCache(config, filePath, inlineModuleIndex, { + code: contents, + }); + js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.js"`; + shouldRemove = true; + } + everyScriptIsAsync &&= isAsync; + someScriptsAreAsync ||= isAsync; + someScriptsAreDefer ||= !isAsync; + } + else if (url && !isPublicFile) { + if (!isExcludedUrl(url)) { + config.logger.warn(` asset + for (const { start, end, url } of scriptUrls) { + if (checkPublicFile(url, config)) { + s.update(start, end, toOutputPublicFilePath(url)); + } + else if (!isExcludedUrl(url)) { + s.update(start, end, await urlToBuiltUrl(url, id, config, this)); + } + } + // ignore if its url can't be resolved + const resolvedStyleUrls = await Promise.all(styleUrls.map(async (styleUrl) => ({ + ...styleUrl, + resolved: await this.resolve(styleUrl.url, id), + }))); + for (const { start, end, url, resolved } of resolvedStyleUrls) { + if (resolved == null) { + config.logger.warnOnce(`\n${url} doesn't exist at build time, it will remain unchanged to be resolved at runtime`); + const importExpression = `\nimport ${JSON.stringify(url)}`; + js = js.replace(importExpression, ''); + } + else { + s.remove(start, end); + } + } + processedHtml.set(id, s.toString()); + // inject module preload polyfill only when configured and needed + const { modulePreload } = config.build; + if (modulePreload !== false && + modulePreload.polyfill && + (someScriptsAreAsync || someScriptsAreDefer)) { + js = `import "${modulePreloadPolyfillId}";\n${js}`; + } + // Force rollup to keep this module from being shared between other entry points. + // If the resulting chunk is empty, it will be removed in generateBundle. + return { code: js, moduleSideEffects: 'no-treeshake' }; + } + }, + async generateBundle(options, bundle) { + const analyzedChunk = new Map(); + const inlineEntryChunk = new Set(); + const getImportedChunks = (chunk, seen = new Set()) => { + const chunks = []; + chunk.imports.forEach((file) => { + const importee = bundle[file]; + if (importee?.type === 'chunk' && !seen.has(file)) { + seen.add(file); + // post-order traversal + chunks.push(...getImportedChunks(importee, seen)); + chunks.push(importee); + } + }); + return chunks; + }; + const toScriptTag = (chunk, toOutputPath, isAsync) => ({ + tag: 'script', + attrs: { + ...(isAsync ? { async: true } : {}), + type: 'module', + // crossorigin must be set not only for serving assets in a different origin + // but also to make it possible to preload the script using ``. + // ``); + preTransformRequest(server, modulePath, base); + }; + await traverseHtml(html, filename, (node) => { + if (!nodeIsElement(node)) { + return; + } + // script tags + if (node.nodeName === 'script') { + const { src, sourceCodeLocation, isModule } = getScriptInfo(node); + if (src) { + const processedUrl = processNodeUrl(src.value, isSrcSet(src), config, htmlPath, originalUrl, server, !isModule); + if (processedUrl !== src.value) { + overwriteAttrValue(s, sourceCodeLocation, processedUrl); + } + } + else if (isModule && node.childNodes.length) { + addInlineModule(node, 'js'); + } + else if (node.childNodes.length) { + const scriptNode = node.childNodes[node.childNodes.length - 1]; + for (const { url, start, end, } of extractImportExpressionFromClassicScript(scriptNode)) { + const processedUrl = processNodeUrl(url, false, config, htmlPath, originalUrl); + if (processedUrl !== url) { + s.update(start, end, processedUrl); + } + } + } + } + const inlineStyle = findNeedTransformStyleAttribute(node); + if (inlineStyle) { + inlineModuleIndex++; + inlineStyles.push({ + index: inlineModuleIndex, + location: inlineStyle.location, + code: inlineStyle.attr.value, + }); + } + if (node.nodeName === 'style' && node.childNodes.length) { + const children = node.childNodes[0]; + styleUrl.push({ + start: children.sourceCodeLocation.startOffset, + end: children.sourceCodeLocation.endOffset, + code: children.value, + }); + } + // elements with [href/src] attrs + const assetAttrs = assetAttrsConfig[node.nodeName]; + if (assetAttrs) { + for (const p of node.attrs) { + const attrKey = getAttrKey(p); + if (p.value && assetAttrs.includes(attrKey)) { + const processedUrl = processNodeUrl(p.value, isSrcSet(p), config, htmlPath, originalUrl); + if (processedUrl !== p.value) { + overwriteAttrValue(s, node.sourceCodeLocation.attrs[attrKey], processedUrl); + } + } + } + } + }); + await Promise.all([ + ...styleUrl.map(async ({ start, end, code }, index) => { + const url = `${proxyModulePath}?html-proxy&direct&index=${index}.css`; + // ensure module in graph after successful load + const mod = await moduleGraph.ensureEntryFromUrl(url, false); + ensureWatchedFile(watcher, mod.file, config.root); + const result = await server.pluginContainer.transform(code, mod.id); + let content = ''; + if (result) { + if (result.map && 'version' in result.map) { + if (result.map.mappings) { + await injectSourcesContent(result.map, proxyModulePath, config.logger); + } + content = getCodeWithSourcemap('css', result.code, result.map); + } + else { + content = result.code; + } + } + s.overwrite(start, end, content); + }), + ...inlineStyles.map(async ({ index, location, code }) => { + // will transform with css plugin and cache result with css-post plugin + const url = `${proxyModulePath}?html-proxy&inline-css&style-attr&index=${index}.css`; + const mod = await moduleGraph.ensureEntryFromUrl(url, false); + ensureWatchedFile(watcher, mod.file, config.root); + await server?.pluginContainer.transform(code, mod.id); + const hash = getHash(cleanUrl(mod.id)); + const result = htmlProxyResult.get(`${hash}_${index}`); + overwriteAttrValue(s, location, result ?? ''); + }), + ]); + html = s.toString(); + return { + html, + tags: [ + { + tag: 'script', + attrs: { + type: 'module', + src: path$o.posix.join(base, CLIENT_PUBLIC_PATH), + }, + injectTo: 'head-prepend', + }, + ], + }; +}; +function indexHtmlMiddleware(root, server) { + const isDev = isDevServer(server); + const fsUtils = getFsUtils(server.config); + // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...` + return async function viteIndexHtmlMiddleware(req, res, next) { + if (res.writableEnded) { + return next(); + } + const url = req.url && cleanUrl(req.url); + // htmlFallbackMiddleware appends '.html' to URLs + if (url?.endsWith('.html') && req.headers['sec-fetch-dest'] !== 'script') { + let filePath; + if (isDev && url.startsWith(FS_PREFIX)) { + filePath = decodeURIComponent(fsPathFromId(url)); + } + else { + filePath = path$o.join(root, decodeURIComponent(url)); + } + if (fsUtils.existsSync(filePath)) { + const headers = isDev + ? server.config.server.headers + : server.config.preview.headers; + try { + let html = await fsp.readFile(filePath, 'utf-8'); + if (isDev) { + html = await server.transformIndexHtml(url, html, req.originalUrl); + } + return send(req, res, html, 'html', { headers }); + } + catch (e) { + return next(e); + } + } + } + next(); + }; +} +function preTransformRequest(server, url, base) { + if (!server.config.server.preTransformRequests) + return; + // transform all url as non-ssr as html includes client-side assets only + try { + url = unwrapId(stripBase(decodeURI(url), base)); + } + catch { + // ignore + return; + } + server.warmupRequest(url); +} + +const logTime = createDebugger('vite:time'); +function timeMiddleware(root) { + // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...` + return function viteTimeMiddleware(req, res, next) { + const start = performance.now(); + const end = res.end; + res.end = (...args) => { + logTime?.(`${timeFrom(start)} ${prettifyUrl(req.url, root)}`); + return end.call(res, ...args); + }; + next(); + }; +} + +class ModuleNode { + /** + * Public served url path, starts with / + */ + url; + /** + * Resolved file system path + query + */ + id = null; + file = null; + type; + info; + meta; + importers = new Set(); + clientImportedModules = new Set(); + ssrImportedModules = new Set(); + acceptedHmrDeps = new Set(); + acceptedHmrExports = null; + importedBindings = null; + isSelfAccepting; + transformResult = null; + ssrTransformResult = null; + ssrModule = null; + ssrError = null; + lastHMRTimestamp = 0; + lastInvalidationTimestamp = 0; + /** + * If the module only needs to update its imports timestamp (e.g. within an HMR chain), + * it is considered soft-invalidated. In this state, its `transformResult` should exist, + * and the next `transformRequest` for this module will replace the timestamps. + * + * By default the value is `undefined` if it's not soft/hard-invalidated. If it gets + * soft-invalidated, this will contain the previous `transformResult` value. If it gets + * hard-invalidated, this will be set to `'HARD_INVALIDATED'`. + * @internal + */ + invalidationState; + /** + * @internal + */ + ssrInvalidationState; + /** + * The module urls that are statically imported in the code. This information is separated + * out from `importedModules` as only importers that statically import the module can be + * soft invalidated. Other imports (e.g. watched files) needs the importer to be hard invalidated. + * @internal + */ + staticImportedUrls; + /** + * @param setIsSelfAccepting - set `false` to set `isSelfAccepting` later. e.g. #7870 + */ + constructor(url, setIsSelfAccepting = true) { + this.url = url; + this.type = isDirectCSSRequest(url) ? 'css' : 'js'; + if (setIsSelfAccepting) { + this.isSelfAccepting = false; + } + } + get importedModules() { + const importedModules = new Set(this.clientImportedModules); + for (const module of this.ssrImportedModules) { + importedModules.add(module); + } + return importedModules; + } +} +class ModuleGraph { + resolveId; + urlToModuleMap = new Map(); + idToModuleMap = new Map(); + etagToModuleMap = new Map(); + // a single file may corresponds to multiple modules with different queries + fileToModulesMap = new Map(); + safeModulesPath = new Set(); + /** + * @internal + */ + _unresolvedUrlToModuleMap = new Map(); + /** + * @internal + */ + _ssrUnresolvedUrlToModuleMap = new Map(); + constructor(resolveId) { + this.resolveId = resolveId; + } + async getModuleByUrl(rawUrl, ssr) { + // Quick path, if we already have a module for this rawUrl (even without extension) + rawUrl = removeImportQuery(removeTimestampQuery(rawUrl)); + const mod = this._getUnresolvedUrlToModule(rawUrl, ssr); + if (mod) { + return mod; + } + const [url] = await this._resolveUrl(rawUrl, ssr); + return this.urlToModuleMap.get(url); + } + getModuleById(id) { + return this.idToModuleMap.get(removeTimestampQuery(id)); + } + getModulesByFile(file) { + return this.fileToModulesMap.get(file); + } + onFileChange(file) { + const mods = this.getModulesByFile(file); + if (mods) { + const seen = new Set(); + mods.forEach((mod) => { + this.invalidateModule(mod, seen); + }); + } + } + invalidateModule(mod, seen = new Set(), timestamp = Date.now(), isHmr = false, + /** @internal */ + softInvalidate = false) { + const prevInvalidationState = mod.invalidationState; + const prevSsrInvalidationState = mod.ssrInvalidationState; + // Handle soft invalidation before the `seen` check, as consecutive soft/hard invalidations can + // cause the final soft invalidation state to be different. + // If soft invalidated, save the previous `transformResult` so that we can reuse and transform the + // import timestamps only in `transformRequest`. If there's no previous `transformResult`, hard invalidate it. + if (softInvalidate) { + mod.invalidationState ??= mod.transformResult ?? 'HARD_INVALIDATED'; + mod.ssrInvalidationState ??= mod.ssrTransformResult ?? 'HARD_INVALIDATED'; + } + // If hard invalidated, further soft invalidations have no effect until it's reset to `undefined` + else { + mod.invalidationState = 'HARD_INVALIDATED'; + mod.ssrInvalidationState = 'HARD_INVALIDATED'; + } + // Skip updating the module if it was already invalidated before and the invalidation state has not changed + if (seen.has(mod) && + prevInvalidationState === mod.invalidationState && + prevSsrInvalidationState === mod.ssrInvalidationState) { + return; + } + seen.add(mod); + if (isHmr) { + mod.lastHMRTimestamp = timestamp; + } + else { + // Save the timestamp for this invalidation, so we can avoid caching the result of possible already started + // processing being done for this module + mod.lastInvalidationTimestamp = timestamp; + } + // Don't invalidate mod.info and mod.meta, as they are part of the processing pipeline + // Invalidating the transform result is enough to ensure this module is re-processed next time it is requested + const etag = mod.transformResult?.etag; + if (etag) + this.etagToModuleMap.delete(etag); + mod.transformResult = null; + mod.ssrTransformResult = null; + mod.ssrModule = null; + mod.ssrError = null; + mod.importers.forEach((importer) => { + if (!importer.acceptedHmrDeps.has(mod)) { + // If the importer statically imports the current module, we can soft-invalidate the importer + // to only update the import timestamps. If it's not statically imported, e.g. watched/glob file, + // we can only soft invalidate if the current module was also soft-invalidated. A soft-invalidation + // doesn't need to trigger a re-load and re-transform of the importer. + const shouldSoftInvalidateImporter = importer.staticImportedUrls?.has(mod.url) || softInvalidate; + this.invalidateModule(importer, seen, timestamp, isHmr, shouldSoftInvalidateImporter); + } + }); + } + invalidateAll() { + const timestamp = Date.now(); + const seen = new Set(); + this.idToModuleMap.forEach((mod) => { + this.invalidateModule(mod, seen, timestamp); + }); + } + /** + * Update the module graph based on a module's updated imports information + * If there are dependencies that no longer have any importers, they are + * returned as a Set. + * + * @param staticImportedUrls Subset of `importedModules` where they're statically imported in code. + * This is only used for soft invalidations so `undefined` is fine but may cause more runtime processing. + */ + async updateModuleInfo(mod, importedModules, importedBindings, acceptedModules, acceptedExports, isSelfAccepting, ssr, + /** @internal */ + staticImportedUrls) { + mod.isSelfAccepting = isSelfAccepting; + const prevImports = ssr ? mod.ssrImportedModules : mod.clientImportedModules; + let noLongerImported; + let resolvePromises = []; + let resolveResults = new Array(importedModules.size); + let index = 0; + // update import graph + for (const imported of importedModules) { + const nextIndex = index++; + if (typeof imported === 'string') { + resolvePromises.push(this.ensureEntryFromUrl(imported, ssr).then((dep) => { + dep.importers.add(mod); + resolveResults[nextIndex] = dep; + })); + } + else { + imported.importers.add(mod); + resolveResults[nextIndex] = imported; + } + } + if (resolvePromises.length) { + await Promise.all(resolvePromises); + } + const nextImports = new Set(resolveResults); + if (ssr) { + mod.ssrImportedModules = nextImports; + } + else { + mod.clientImportedModules = nextImports; + } + // remove the importer from deps that were imported but no longer are. + prevImports.forEach((dep) => { + if (!mod.clientImportedModules.has(dep) && + !mod.ssrImportedModules.has(dep)) { + dep.importers.delete(mod); + if (!dep.importers.size) { + (noLongerImported || (noLongerImported = new Set())).add(dep); + } + } + }); + // update accepted hmr deps + resolvePromises = []; + resolveResults = new Array(acceptedModules.size); + index = 0; + for (const accepted of acceptedModules) { + const nextIndex = index++; + if (typeof accepted === 'string') { + resolvePromises.push(this.ensureEntryFromUrl(accepted, ssr).then((dep) => { + resolveResults[nextIndex] = dep; + })); + } + else { + resolveResults[nextIndex] = accepted; + } + } + if (resolvePromises.length) { + await Promise.all(resolvePromises); + } + mod.acceptedHmrDeps = new Set(resolveResults); + mod.staticImportedUrls = staticImportedUrls; + // update accepted hmr exports + mod.acceptedHmrExports = acceptedExports; + mod.importedBindings = importedBindings; + return noLongerImported; + } + async ensureEntryFromUrl(rawUrl, ssr, setIsSelfAccepting = true) { + return this._ensureEntryFromUrl(rawUrl, ssr, setIsSelfAccepting); + } + /** + * @internal + */ + async _ensureEntryFromUrl(rawUrl, ssr, setIsSelfAccepting = true, + // Optimization, avoid resolving the same url twice if the caller already did it + resolved) { + // Quick path, if we already have a module for this rawUrl (even without extension) + rawUrl = removeImportQuery(removeTimestampQuery(rawUrl)); + let mod = this._getUnresolvedUrlToModule(rawUrl, ssr); + if (mod) { + return mod; + } + const modPromise = (async () => { + const [url, resolvedId, meta] = await this._resolveUrl(rawUrl, ssr, resolved); + mod = this.idToModuleMap.get(resolvedId); + if (!mod) { + mod = new ModuleNode(url, setIsSelfAccepting); + if (meta) + mod.meta = meta; + this.urlToModuleMap.set(url, mod); + mod.id = resolvedId; + this.idToModuleMap.set(resolvedId, mod); + const file = (mod.file = cleanUrl(resolvedId)); + let fileMappedModules = this.fileToModulesMap.get(file); + if (!fileMappedModules) { + fileMappedModules = new Set(); + this.fileToModulesMap.set(file, fileMappedModules); + } + fileMappedModules.add(mod); + } + // multiple urls can map to the same module and id, make sure we register + // the url to the existing module in that case + else if (!this.urlToModuleMap.has(url)) { + this.urlToModuleMap.set(url, mod); + } + this._setUnresolvedUrlToModule(rawUrl, mod, ssr); + return mod; + })(); + // Also register the clean url to the module, so that we can short-circuit + // resolving the same url twice + this._setUnresolvedUrlToModule(rawUrl, modPromise, ssr); + return modPromise; + } + // some deps, like a css file referenced via @import, don't have its own + // url because they are inlined into the main css import. But they still + // need to be represented in the module graph so that they can trigger + // hmr in the importing css file. + createFileOnlyEntry(file) { + file = normalizePath$3(file); + let fileMappedModules = this.fileToModulesMap.get(file); + if (!fileMappedModules) { + fileMappedModules = new Set(); + this.fileToModulesMap.set(file, fileMappedModules); + } + const url = `${FS_PREFIX}${file}`; + for (const m of fileMappedModules) { + if (m.url === url || m.id === file) { + return m; + } + } + const mod = new ModuleNode(url); + mod.file = file; + fileMappedModules.add(mod); + return mod; + } + // for incoming urls, it is important to: + // 1. remove the HMR timestamp query (?t=xxxx) and the ?import query + // 2. resolve its extension so that urls with or without extension all map to + // the same module + async resolveUrl(url, ssr) { + url = removeImportQuery(removeTimestampQuery(url)); + const mod = await this._getUnresolvedUrlToModule(url, ssr); + if (mod?.id) { + return [mod.url, mod.id, mod.meta]; + } + return this._resolveUrl(url, ssr); + } + updateModuleTransformResult(mod, result, ssr) { + if (ssr) { + mod.ssrTransformResult = result; + } + else { + const prevEtag = mod.transformResult?.etag; + if (prevEtag) + this.etagToModuleMap.delete(prevEtag); + mod.transformResult = result; + if (result?.etag) + this.etagToModuleMap.set(result.etag, mod); + } + } + getModuleByEtag(etag) { + return this.etagToModuleMap.get(etag); + } + /** + * @internal + */ + _getUnresolvedUrlToModule(url, ssr) { + return (ssr ? this._ssrUnresolvedUrlToModuleMap : this._unresolvedUrlToModuleMap).get(url); + } + /** + * @internal + */ + _setUnresolvedUrlToModule(url, mod, ssr) { + (ssr + ? this._ssrUnresolvedUrlToModuleMap + : this._unresolvedUrlToModuleMap).set(url, mod); + } + /** + * @internal + */ + async _resolveUrl(url, ssr, alreadyResolved) { + const resolved = alreadyResolved ?? (await this.resolveId(url, !!ssr)); + const resolvedId = resolved?.id || url; + if (url !== resolvedId && + !url.includes('\0') && + !url.startsWith(`virtual:`)) { + const ext = extname$1(cleanUrl(resolvedId)); + if (ext) { + const pathname = cleanUrl(url); + if (!pathname.endsWith(ext)) { + url = pathname + ext + url.slice(pathname.length); + } + } + } + return [url, resolvedId, resolved?.meta]; + } +} + +function notFoundMiddleware() { + // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...` + return function vite404Middleware(_, res) { + res.statusCode = 404; + res.end(); + }; +} + +function warmupFiles(server) { + const options = server.config.server.warmup; + const root = server.config.root; + if (options?.clientFiles?.length) { + mapFiles(options.clientFiles, root).then((files) => { + for (const file of files) { + warmupFile(server, file, false); + } + }); + } + if (options?.ssrFiles?.length) { + mapFiles(options.ssrFiles, root).then((files) => { + for (const file of files) { + warmupFile(server, file, true); + } + }); + } +} +async function warmupFile(server, file, ssr) { + // transform html with the `transformIndexHtml` hook as Vite internals would + // pre-transform the imported JS modules linked. this may cause `transformIndexHtml` + // plugins to be executed twice, but that's probably fine. + if (file.endsWith('.html')) { + const url = htmlFileToUrl(file, server.config.root); + if (url) { + try { + const html = await fsp.readFile(file, 'utf-8'); + await server.transformIndexHtml(url, html); + } + catch (e) { + // Unexpected error, log the issue but avoid an unhandled exception + server.config.logger.error(`Pre-transform error (${colors$1.cyan(file)}): ${e.message}`, { + error: e, + timestamp: true, + }); + } + } + } + // for other files, pass it through `transformRequest` with warmup + else { + const url = fileToUrl(file, server.config.root); + await server.warmupRequest(url, { ssr }); + } +} +function htmlFileToUrl(file, root) { + const url = path$o.relative(root, file); + // out of root, ignore file + if (url[0] === '.') + return; + // file within root, create root-relative url + return '/' + normalizePath$3(url); +} +function fileToUrl(file, root) { + const url = path$o.relative(root, file); + // out of root, use /@fs/ prefix + if (url[0] === '.') { + return path$o.posix.join(FS_PREFIX, normalizePath$3(file)); + } + // file within root, create root-relative url + return '/' + normalizePath$3(url); +} +function mapFiles(files, root) { + return glob(files, { + cwd: root, + absolute: true, + }); +} + +function createServer(inlineConfig = {}) { + return _createServer(inlineConfig, { hotListen: true }); +} +async function _createServer(inlineConfig = {}, options) { + const config = await resolveConfig(inlineConfig, 'serve'); + const initPublicFilesPromise = initPublicFiles(config); + const { root, server: serverConfig } = config; + const httpsOptions = await resolveHttpsConfig(config.server.https); + const { middlewareMode } = serverConfig; + const resolvedWatchOptions = resolveChokidarOptions(config, { + disableGlobbing: true, + ...serverConfig.watch, + }); + const middlewares = connect$1(); + const httpServer = middlewareMode + ? null + : await resolveHttpServer(serverConfig, middlewares, httpsOptions); + const ws = createWebSocketServer(httpServer, config, httpsOptions); + const hot = createHMRBroadcaster() + .addChannel(ws) + .addChannel(createServerHMRChannel()); + if (typeof config.server.hmr === 'object' && config.server.hmr.channels) { + config.server.hmr.channels.forEach((channel) => hot.addChannel(channel)); + } + if (httpServer) { + setClientErrorHandler(httpServer, config.logger); + } + // eslint-disable-next-line eqeqeq + const watchEnabled = serverConfig.watch !== null; + const watcher = watchEnabled + ? chokidar.watch( + // config file dependencies and env file might be outside of root + [ + root, + ...config.configFileDependencies, + ...getEnvFilesForMode(config.mode, config.envDir), + ], resolvedWatchOptions) + : createNoopWatcher(resolvedWatchOptions); + const moduleGraph = new ModuleGraph((url, ssr) => container.resolveId(url, undefined, { ssr })); + const container = await createPluginContainer(config, moduleGraph, watcher); + const closeHttpServer = createServerCloseFn(httpServer); + let exitProcess; + const devHtmlTransformFn = createDevHtmlTransformFn(config); + let server = { + config, + middlewares, + httpServer, + watcher, + pluginContainer: container, + ws, + hot, + moduleGraph, + resolvedUrls: null, + ssrTransform(code, inMap, url, originalCode = code) { + return ssrTransform(code, inMap, url, originalCode, server.config); + }, + transformRequest(url, options) { + return transformRequest(url, server, options); + }, + async warmupRequest(url, options) { + await transformRequest(url, server, options).catch((e) => { + if (e?.code === ERR_OUTDATED_OPTIMIZED_DEP || + e?.code === ERR_CLOSED_SERVER) { + // these are expected errors + return; + } + // Unexpected error, log the issue but avoid an unhandled exception + server.config.logger.error(`Pre-transform error: ${e.message}`, { + error: e, + timestamp: true, + }); + }); + }, + transformIndexHtml(url, html, originalUrl) { + return devHtmlTransformFn(server, url, html, originalUrl); + }, + async ssrLoadModule(url, opts) { + return ssrLoadModule(url, server, undefined, undefined, opts?.fixStacktrace); + }, + async ssrFetchModule(url, importer) { + return ssrFetchModule(server, url, importer); + }, + ssrFixStacktrace(e) { + ssrFixStacktrace(e, moduleGraph); + }, + ssrRewriteStacktrace(stack) { + return ssrRewriteStacktrace(stack, moduleGraph); + }, + async reloadModule(module) { + if (serverConfig.hmr !== false && module.file) { + updateModules(module.file, [module], Date.now(), server); + } + }, + async listen(port, isRestart) { + await startServer(server, port); + if (httpServer) { + server.resolvedUrls = await resolveServerUrls(httpServer, config.server, config); + if (!isRestart && config.server.open) + server.openBrowser(); + } + return server; + }, + openBrowser() { + const options = server.config.server; + const url = server.resolvedUrls?.local[0] ?? server.resolvedUrls?.network[0]; + if (url) { + const path = typeof options.open === 'string' + ? new URL(options.open, url).href + : url; + // We know the url that the browser would be opened to, so we can + // start the request while we are awaiting the browser. This will + // start the crawling of static imports ~500ms before. + // preTransformRequests needs to be enabled for this optimization. + if (server.config.server.preTransformRequests) { + setTimeout(() => { + const getMethod = path.startsWith('https:') ? get$1 : get$2; + getMethod(path, { + headers: { + // Allow the history middleware to redirect to /index.html + Accept: 'text/html', + }, + }, (res) => { + res.on('end', () => { + // Ignore response, scripts discovered while processing the entry + // will be preprocessed (server.config.server.preTransformRequests) + }); + }) + .on('error', () => { + // Ignore errors + }) + .end(); + }, 0); + } + openBrowser(path, true, server.config.logger); + } + else { + server.config.logger.warn('No URL available to open in browser'); + } + }, + async close() { + if (!middlewareMode) { + process.off('SIGTERM', exitProcess); + if (process.env.CI !== 'true') { + process.stdin.off('end', exitProcess); + } + } + await Promise.allSettled([ + watcher.close(), + hot.close(), + container.close(), + getDepsOptimizer(server.config)?.close(), + getDepsOptimizer(server.config, true)?.close(), + closeHttpServer(), + ]); + // Await pending requests. We throw early in transformRequest + // and in hooks if the server is closing for non-ssr requests, + // so the import analysis plugin stops pre-transforming static + // imports and this block is resolved sooner. + // During SSR, we let pending requests finish to avoid exposing + // the server closed error to the users. + while (server._pendingRequests.size > 0) { + await Promise.allSettled([...server._pendingRequests.values()].map((pending) => pending.request)); + } + server.resolvedUrls = null; + }, + printUrls() { + if (server.resolvedUrls) { + printServerUrls(server.resolvedUrls, serverConfig.host, config.logger.info); + } + else if (middlewareMode) { + throw new Error('cannot print server URLs in middleware mode.'); + } + else { + throw new Error('cannot print server URLs before server.listen is called.'); + } + }, + bindCLIShortcuts(options) { + bindCLIShortcuts(server, options); + }, + async restart(forceOptimize) { + if (!server._restartPromise) { + server._forceOptimizeOnRestart = !!forceOptimize; + server._restartPromise = restartServer(server).finally(() => { + server._restartPromise = null; + server._forceOptimizeOnRestart = false; + }); + } + return server._restartPromise; + }, + _setInternalServer(_server) { + // Rebind internal the server variable so functions reference the user + // server instance after a restart + server = _server; + }, + _restartPromise: null, + _importGlobMap: new Map(), + _forceOptimizeOnRestart: false, + _pendingRequests: new Map(), + _fsDenyGlob: picomatch$4(config.server.fs.deny, { + matchBase: true, + nocase: true, + }), + _shortcutsOptions: undefined, + }; + // maintain consistency with the server instance after restarting. + const reflexServer = new Proxy(server, { + get: (_, property) => { + return server[property]; + }, + set: (_, property, value) => { + server[property] = value; + return true; + }, + }); + if (!middlewareMode) { + exitProcess = async () => { + try { + await server.close(); + } + finally { + process.exit(); + } + }; + process.once('SIGTERM', exitProcess); + if (process.env.CI !== 'true') { + process.stdin.on('end', exitProcess); + } + } + const publicFiles = await initPublicFilesPromise; + const onHMRUpdate = async (file, configOnly) => { + if (serverConfig.hmr !== false) { + try { + await handleHMRUpdate(file, server, configOnly); + } + catch (err) { + hot.send({ + type: 'error', + err: prepareError(err), + }); + } + } + }; + const { publicDir } = config; + const onFileAddUnlink = async (file, isUnlink) => { + file = normalizePath$3(file); + await container.watchChange(file, { event: isUnlink ? 'delete' : 'create' }); + if (publicDir && publicFiles) { + if (file.startsWith(publicDir)) { + const path = file.slice(publicDir.length); + publicFiles[isUnlink ? 'delete' : 'add'](path); + if (!isUnlink) { + const moduleWithSamePath = await moduleGraph.getModuleByUrl(path); + const etag = moduleWithSamePath?.transformResult?.etag; + if (etag) { + // The public file should win on the next request over a module with the + // same path. Prevent the transform etag fast path from serving the module + moduleGraph.etagToModuleMap.delete(etag); + } + } + } + } + await handleFileAddUnlink(file, server, isUnlink); + await onHMRUpdate(file, true); + }; + watcher.on('change', async (file) => { + file = normalizePath$3(file); + await container.watchChange(file, { event: 'update' }); + // invalidate module graph cache on file change + moduleGraph.onFileChange(file); + await onHMRUpdate(file, false); + }); + getFsUtils(config).initWatcher?.(watcher); + watcher.on('add', (file) => { + onFileAddUnlink(file, false); + }); + watcher.on('unlink', (file) => { + onFileAddUnlink(file, true); + }); + hot.on('vite:invalidate', async ({ path, message }) => { + const mod = moduleGraph.urlToModuleMap.get(path); + if (mod && mod.isSelfAccepting && mod.lastHMRTimestamp > 0) { + config.logger.info(colors$1.yellow(`hmr invalidate `) + + colors$1.dim(path) + + (message ? ` ${message}` : ''), { timestamp: true }); + const file = getShortName(mod.file, config.root); + updateModules(file, [...mod.importers], mod.lastHMRTimestamp, server, true); + } + }); + if (!middlewareMode && httpServer) { + httpServer.once('listening', () => { + // update actual port since this may be different from initial value + serverConfig.port = httpServer.address().port; + }); + } + // apply server configuration hooks from plugins + const postHooks = []; + for (const hook of config.getSortedPluginHooks('configureServer')) { + postHooks.push(await hook(reflexServer)); + } + // Internal middlewares ------------------------------------------------------ + // request timer + if (process.env.DEBUG) { + middlewares.use(timeMiddleware(root)); + } + // cors (enabled by default) + const { cors } = serverConfig; + if (cors !== false) { + middlewares.use(corsMiddleware(typeof cors === 'boolean' ? {} : cors)); + } + middlewares.use(cachedTransformMiddleware(server)); + // proxy + const { proxy } = serverConfig; + if (proxy) { + const middlewareServer = (isObject$1(serverConfig.middlewareMode) + ? serverConfig.middlewareMode.server + : null) || httpServer; + middlewares.use(proxyMiddleware(middlewareServer, proxy, config)); + } + // base + if (config.base !== '/') { + middlewares.use(baseMiddleware(config.rawBase, middlewareMode)); + } + // open in editor support + middlewares.use('/__open-in-editor', launchEditorMiddleware$1()); + // ping request handler + // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...` + middlewares.use(function viteHMRPingMiddleware(req, res, next) { + if (req.headers['accept'] === 'text/x-vite-ping') { + res.writeHead(204).end(); + } + else { + next(); + } + }); + // serve static files under /public + // this applies before the transform middleware so that these files are served + // as-is without transforms. + if (publicDir) { + middlewares.use(servePublicMiddleware(server, publicFiles)); + } + // main transform middleware + middlewares.use(transformMiddleware(server)); + // serve static files + middlewares.use(serveRawFsMiddleware(server)); + middlewares.use(serveStaticMiddleware(server)); + // html fallback + if (config.appType === 'spa' || config.appType === 'mpa') { + middlewares.use(htmlFallbackMiddleware(root, config.appType === 'spa', getFsUtils(config))); + } + // run post config hooks + // This is applied before the html middleware so that user middleware can + // serve custom content instead of index.html. + postHooks.forEach((fn) => fn && fn()); + if (config.appType === 'spa' || config.appType === 'mpa') { + // transform index.html + middlewares.use(indexHtmlMiddleware(root, server)); + // handle 404s + middlewares.use(notFoundMiddleware()); + } + // error handler + middlewares.use(errorMiddleware(server, middlewareMode)); + // httpServer.listen can be called multiple times + // when port when using next port number + // this code is to avoid calling buildStart multiple times + let initingServer; + let serverInited = false; + const initServer = async () => { + if (serverInited) + return; + if (initingServer) + return initingServer; + initingServer = (async function () { + await container.buildStart({}); + // start deps optimizer after all container plugins are ready + if (isDepsOptimizerEnabled(config, false)) { + await initDepsOptimizer(config, server); + } + warmupFiles(server); + initingServer = undefined; + serverInited = true; + })(); + return initingServer; + }; + if (!middlewareMode && httpServer) { + // overwrite listen to init optimizer before server start + const listen = httpServer.listen.bind(httpServer); + httpServer.listen = (async (port, ...args) => { + try { + // ensure ws server started + hot.listen(); + await initServer(); + } + catch (e) { + httpServer.emit('error', e); + return; + } + return listen(port, ...args); + }); + } + else { + if (options.hotListen) { + hot.listen(); + } + await initServer(); + } + return server; +} +async function startServer(server, inlinePort) { + const httpServer = server.httpServer; + if (!httpServer) { + throw new Error('Cannot call server.listen in middleware mode.'); + } + const options = server.config.server; + const hostname = await resolveHostname(options.host); + const configPort = inlinePort ?? options.port; + // When using non strict port for the dev server, the running port can be different from the config one. + // When restarting, the original port may be available but to avoid a switch of URL for the running + // browser tabs, we enforce the previously used port, expect if the config port changed. + const port = (!configPort || configPort === server._configServerPort + ? server._currentServerPort + : configPort) ?? DEFAULT_DEV_PORT; + server._configServerPort = configPort; + const serverPort = await httpServerStart(httpServer, { + port, + strictPort: options.strictPort, + host: hostname.host, + logger: server.config.logger, + }); + server._currentServerPort = serverPort; +} +function createServerCloseFn(server) { + if (!server) { + return () => Promise.resolve(); + } + let hasListened = false; + const openSockets = new Set(); + server.on('connection', (socket) => { + openSockets.add(socket); + socket.on('close', () => { + openSockets.delete(socket); + }); + }); + server.once('listening', () => { + hasListened = true; + }); + return () => new Promise((resolve, reject) => { + openSockets.forEach((s) => s.destroy()); + if (hasListened) { + server.close((err) => { + if (err) { + reject(err); + } + else { + resolve(); + } + }); + } + else { + resolve(); + } + }); +} +function resolvedAllowDir(root, dir) { + return normalizePath$3(path$o.resolve(root, dir)); +} +function resolveServerOptions(root, raw, logger) { + const server = { + preTransformRequests: true, + ...raw, + sourcemapIgnoreList: raw?.sourcemapIgnoreList === false + ? () => false + : raw?.sourcemapIgnoreList || isInNodeModules$1, + middlewareMode: !!raw?.middlewareMode, + }; + let allowDirs = server.fs?.allow; + const deny = server.fs?.deny || ['.env', '.env.*', '*.{crt,pem}']; + if (!allowDirs) { + allowDirs = [searchForWorkspaceRoot(root)]; + } + allowDirs = allowDirs.map((i) => resolvedAllowDir(root, i)); + // only push client dir when vite itself is outside-of-root + const resolvedClientDir = resolvedAllowDir(root, CLIENT_DIR); + if (!allowDirs.some((dir) => isParentDirectory(dir, resolvedClientDir))) { + allowDirs.push(resolvedClientDir); + } + server.fs = { + strict: server.fs?.strict ?? true, + allow: allowDirs, + deny, + cachedChecks: server.fs?.cachedChecks, + }; + if (server.origin?.endsWith('/')) { + server.origin = server.origin.slice(0, -1); + logger.warn(colors$1.yellow(`${colors$1.bold('(!)')} server.origin should not end with "/". Using "${server.origin}" instead.`)); + } + return server; +} +async function restartServer(server) { + global.__vite_start_time = performance.now(); + const shortcutsOptions = server._shortcutsOptions; + let inlineConfig = server.config.inlineConfig; + if (server._forceOptimizeOnRestart) { + inlineConfig = mergeConfig(inlineConfig, { + optimizeDeps: { + force: true, + }, + }); + } + // Reinit the server by creating a new instance using the same inlineConfig + // This will triger a reload of the config file and re-create the plugins and + // middlewares. We then assign all properties of the new server to the existing + // server instance and set the user instance to be used in the new server. + // This allows us to keep the same server instance for the user. + { + let newServer = null; + try { + // delay ws server listen + newServer = await _createServer(inlineConfig, { hotListen: false }); + } + catch (err) { + server.config.logger.error(err.message, { + timestamp: true, + }); + server.config.logger.error('server restart failed', { timestamp: true }); + return; + } + await server.close(); + // Assign new server props to existing server instance + const middlewares = server.middlewares; + newServer._configServerPort = server._configServerPort; + newServer._currentServerPort = server._currentServerPort; + Object.assign(server, newServer); + // Keep the same connect instance so app.use(vite.middlewares) works + // after a restart in middlewareMode (.route is always '/') + middlewares.stack = newServer.middlewares.stack; + server.middlewares = middlewares; + // Rebind internal server variable so functions reference the user server + newServer._setInternalServer(server); + } + const { logger, server: { port, middlewareMode }, } = server.config; + if (!middlewareMode) { + await server.listen(port, true); + } + else { + server.hot.listen(); + } + logger.info('server restarted.', { timestamp: true }); + if (shortcutsOptions) { + shortcutsOptions.print = false; + bindCLIShortcuts(server, shortcutsOptions); + } +} +/** + * Internal function to restart the Vite server and print URLs if changed + */ +async function restartServerWithUrls(server) { + if (server.config.server.middlewareMode) { + await server.restart(); + return; + } + const { port: prevPort, host: prevHost } = server.config.server; + const prevUrls = server.resolvedUrls; + await server.restart(); + const { logger, server: { port, host }, } = server.config; + if ((port ?? DEFAULT_DEV_PORT) !== (prevPort ?? DEFAULT_DEV_PORT) || + host !== prevHost || + diffDnsOrderChange(prevUrls, server.resolvedUrls)) { + logger.info(''); + server.printUrls(); + } +} + +var index = { + __proto__: null, + _createServer: _createServer, + createServer: createServer, + createServerCloseFn: createServerCloseFn, + resolveServerOptions: resolveServerOptions, + restartServerWithUrls: restartServerWithUrls +}; + +const debugHmr = createDebugger('vite:hmr'); +const whitespaceRE = /\s/; +const normalizedClientDir = normalizePath$3(CLIENT_DIR); +function getShortName(file, root) { + return file.startsWith(withTrailingSlash(root)) + ? path$o.posix.relative(root, file) + : file; +} +async function handleHMRUpdate(file, server, configOnly) { + const { hot, config, moduleGraph } = server; + const shortFile = getShortName(file, config.root); + const isConfig = file === config.configFile; + const isConfigDependency = config.configFileDependencies.some((name) => file === name); + const isEnv = config.inlineConfig.envFile !== false && + getEnvFilesForMode(config.mode, config.envDir).includes(file); + if (isConfig || isConfigDependency || isEnv) { + // auto restart server + debugHmr?.(`[config change] ${colors$1.dim(shortFile)}`); + config.logger.info(colors$1.green(`${path$o.relative(process.cwd(), file)} changed, restarting server...`), { clear: true, timestamp: true }); + try { + await restartServerWithUrls(server); + } + catch (e) { + config.logger.error(colors$1.red(e)); + } + return; + } + if (configOnly) { + return; + } + debugHmr?.(`[file change] ${colors$1.dim(shortFile)}`); + // (dev only) the client itself cannot be hot updated. + if (file.startsWith(withTrailingSlash(normalizedClientDir))) { + hot.send({ + type: 'full-reload', + path: '*', + }); + return; + } + const mods = moduleGraph.getModulesByFile(file); + // check if any plugin wants to perform custom HMR handling + const timestamp = Date.now(); + const hmrContext = { + file, + timestamp, + modules: mods ? [...mods] : [], + read: () => readModifiedFile(file), + server, + }; + for (const hook of config.getSortedPluginHooks('handleHotUpdate')) { + const filteredModules = await hook(hmrContext); + if (filteredModules) { + hmrContext.modules = filteredModules; + } + } + if (!hmrContext.modules.length) { + // html file cannot be hot updated + if (file.endsWith('.html')) { + config.logger.info(colors$1.green(`page reload `) + colors$1.dim(shortFile), { + clear: true, + timestamp: true, + }); + hot.send({ + type: 'full-reload', + path: config.server.middlewareMode + ? '*' + : '/' + normalizePath$3(path$o.relative(config.root, file)), + }); + } + else { + // loaded but not in the module graph, probably not js + debugHmr?.(`[no modules matched] ${colors$1.dim(shortFile)}`); + } + return; + } + updateModules(shortFile, hmrContext.modules, timestamp, server); +} +function updateModules(file, modules, timestamp, { config, hot, moduleGraph }, afterInvalidation) { + const updates = []; + const invalidatedModules = new Set(); + const traversedModules = new Set(); + let needFullReload = false; + for (const mod of modules) { + const boundaries = []; + const hasDeadEnd = propagateUpdate(mod, traversedModules, boundaries); + moduleGraph.invalidateModule(mod, invalidatedModules, timestamp, true); + if (needFullReload) { + continue; + } + if (hasDeadEnd) { + needFullReload = hasDeadEnd; + continue; + } + updates.push(...boundaries.map(({ boundary, acceptedVia, isWithinCircularImport }) => ({ + type: `${boundary.type}-update`, + timestamp, + path: normalizeHmrUrl(boundary.url), + acceptedPath: normalizeHmrUrl(acceptedVia.url), + explicitImportRequired: boundary.type === 'js' + ? isExplicitImportRequired(acceptedVia.url) + : false, + isWithinCircularImport, + // browser modules are invalidated by changing ?t= query, + // but in ssr we control the module system, so we can directly remove them form cache + ssrInvalidates: getSSRInvalidatedImporters(acceptedVia), + }))); + } + if (needFullReload) { + const reason = typeof needFullReload === 'string' + ? colors$1.dim(` (${needFullReload})`) + : ''; + config.logger.info(colors$1.green(`page reload `) + colors$1.dim(file) + reason, { clear: !afterInvalidation, timestamp: true }); + hot.send({ + type: 'full-reload', + }); + return; + } + if (updates.length === 0) { + debugHmr?.(colors$1.yellow(`no update happened `) + colors$1.dim(file)); + return; + } + config.logger.info(colors$1.green(`hmr update `) + + colors$1.dim([...new Set(updates.map((u) => u.path))].join(', ')), { clear: !afterInvalidation, timestamp: true }); + hot.send({ + type: 'update', + updates, + }); +} +function populateSSRImporters(module, timestamp, seen) { + module.ssrImportedModules.forEach((importer) => { + if (seen.has(importer)) { + return; + } + if (importer.lastHMRTimestamp === timestamp || + importer.lastInvalidationTimestamp === timestamp) { + seen.add(importer); + populateSSRImporters(importer, timestamp, seen); + } + }); + return seen; +} +function getSSRInvalidatedImporters(module) { + return [ + ...populateSSRImporters(module, module.lastHMRTimestamp, new Set()), + ].map((m) => m.file); +} +async function handleFileAddUnlink(file, server, isUnlink) { + const modules = [...(server.moduleGraph.getModulesByFile(file) || [])]; + if (isUnlink) { + for (const deletedMod of modules) { + deletedMod.importedModules.forEach((importedMod) => { + importedMod.importers.delete(deletedMod); + }); + } + } + modules.push(...getAffectedGlobModules(file, server)); + if (modules.length > 0) { + updateModules(getShortName(file, server.config.root), unique(modules), Date.now(), server); + } +} +function areAllImportsAccepted(importedBindings, acceptedExports) { + for (const binding of importedBindings) { + if (!acceptedExports.has(binding)) { + return false; + } + } + return true; +} +function propagateUpdate(node, traversedModules, boundaries, currentChain = [node]) { + if (traversedModules.has(node)) { + return false; + } + traversedModules.add(node); + // #7561 + // if the imports of `node` have not been analyzed, then `node` has not + // been loaded in the browser and we should stop propagation. + if (node.id && node.isSelfAccepting === undefined) { + debugHmr?.(`[propagate update] stop propagation because not analyzed: ${colors$1.dim(node.id)}`); + return false; + } + if (node.isSelfAccepting) { + boundaries.push({ + boundary: node, + acceptedVia: node, + isWithinCircularImport: isNodeWithinCircularImports(node, currentChain), + }); + // additionally check for CSS importers, since a PostCSS plugin like + // Tailwind JIT may register any file as a dependency to a CSS file. + for (const importer of node.importers) { + if (isCSSRequest(importer.url) && !currentChain.includes(importer)) { + propagateUpdate(importer, traversedModules, boundaries, currentChain.concat(importer)); + } + } + return false; + } + // A partially accepted module with no importers is considered self accepting, + // because the deal is "there are parts of myself I can't self accept if they + // are used outside of me". + // Also, the imported module (this one) must be updated before the importers, + // so that they do get the fresh imported module when/if they are reloaded. + if (node.acceptedHmrExports) { + boundaries.push({ + boundary: node, + acceptedVia: node, + isWithinCircularImport: isNodeWithinCircularImports(node, currentChain), + }); + } + else { + if (!node.importers.size) { + return true; + } + // #3716, #3913 + // For a non-CSS file, if all of its importers are CSS files (registered via + // PostCSS plugins) it should be considered a dead end and force full reload. + if (!isCSSRequest(node.url) && + [...node.importers].every((i) => isCSSRequest(i.url))) { + return true; + } + } + for (const importer of node.importers) { + const subChain = currentChain.concat(importer); + if (importer.acceptedHmrDeps.has(node)) { + boundaries.push({ + boundary: importer, + acceptedVia: node, + isWithinCircularImport: isNodeWithinCircularImports(importer, subChain), + }); + continue; + } + if (node.id && node.acceptedHmrExports && importer.importedBindings) { + const importedBindingsFromNode = importer.importedBindings.get(node.id); + if (importedBindingsFromNode && + areAllImportsAccepted(importedBindingsFromNode, node.acceptedHmrExports)) { + continue; + } + } + if (!currentChain.includes(importer) && + propagateUpdate(importer, traversedModules, boundaries, subChain)) { + return true; + } + } + return false; +} +/** + * Check importers recursively if it's an import loop. An accepted module within + * an import loop cannot recover its execution order and should be reloaded. + * + * @param node The node that accepts HMR and is a boundary + * @param nodeChain The chain of nodes/imports that lead to the node. + * (The last node in the chain imports the `node` parameter) + * @param currentChain The current chain tracked from the `node` parameter + * @param traversedModules The set of modules that have traversed + */ +function isNodeWithinCircularImports(node, nodeChain, currentChain = [node], traversedModules = new Set()) { + // To help visualize how each parameters work, imagine this import graph: + // + // A -> B -> C -> ACCEPTED -> D -> E -> NODE + // ^--------------------------| + // + // ACCEPTED: the node that accepts HMR. the `node` parameter. + // NODE : the initial node that triggered this HMR. + // + // This function will return true in the above graph, which: + // `node` : ACCEPTED + // `nodeChain` : [NODE, E, D, ACCEPTED] + // `currentChain` : [ACCEPTED, C, B] + // + // It works by checking if any `node` importers are within `nodeChain`, which + // means there's an import loop with a HMR-accepted module in it. + if (traversedModules.has(node)) { + return false; + } + traversedModules.add(node); + for (const importer of node.importers) { + // Node may import itself which is safe + if (importer === node) + continue; + // a PostCSS plugin like Tailwind JIT may register + // any file as a dependency to a CSS file. + // But in that case, the actual dependency chain is separate. + if (isCSSRequest(importer.url)) + continue; + // Check circular imports + const importerIndex = nodeChain.indexOf(importer); + if (importerIndex > -1) { + // Log extra debug information so users can fix and remove the circular imports + if (debugHmr) { + // Following explanation above: + // `importer` : E + // `currentChain` reversed : [B, C, ACCEPTED] + // `nodeChain` sliced & reversed : [D, E] + // Combined : [E, B, C, ACCEPTED, D, E] + const importChain = [ + importer, + ...[...currentChain].reverse(), + ...nodeChain.slice(importerIndex, -1).reverse(), + ]; + debugHmr(colors$1.yellow(`circular imports detected: `) + + importChain.map((m) => colors$1.dim(m.url)).join(' -> ')); + } + return true; + } + // Continue recursively + if (!currentChain.includes(importer)) { + const result = isNodeWithinCircularImports(importer, nodeChain, currentChain.concat(importer), traversedModules); + if (result) + return result; + } + } + return false; +} +function handlePrunedModules(mods, { hot }) { + // update the disposed modules' hmr timestamp + // since if it's re-imported, it should re-apply side effects + // and without the timestamp the browser will not re-import it! + const t = Date.now(); + mods.forEach((mod) => { + mod.lastHMRTimestamp = t; + debugHmr?.(`[dispose] ${colors$1.dim(mod.file)}`); + }); + hot.send({ + type: 'prune', + paths: [...mods].map((m) => m.url), + }); +} +/** + * Lex import.meta.hot.accept() for accepted deps. + * Since hot.accept() can only accept string literals or array of string + * literals, we don't really need a heavy @babel/parse call on the entire source. + * + * @returns selfAccepts + */ +function lexAcceptedHmrDeps(code, start, urls) { + let state = 0 /* LexerState.inCall */; + // the state can only be 2 levels deep so no need for a stack + let prevState = 0 /* LexerState.inCall */; + let currentDep = ''; + function addDep(index) { + urls.add({ + url: currentDep, + start: index - currentDep.length - 1, + end: index + 1, + }); + currentDep = ''; + } + for (let i = start; i < code.length; i++) { + const char = code.charAt(i); + switch (state) { + case 0 /* LexerState.inCall */: + case 4 /* LexerState.inArray */: + if (char === `'`) { + prevState = state; + state = 1 /* LexerState.inSingleQuoteString */; + } + else if (char === `"`) { + prevState = state; + state = 2 /* LexerState.inDoubleQuoteString */; + } + else if (char === '`') { + prevState = state; + state = 3 /* LexerState.inTemplateString */; + } + else if (whitespaceRE.test(char)) { + continue; + } + else { + if (state === 0 /* LexerState.inCall */) { + if (char === `[`) { + state = 4 /* LexerState.inArray */; + } + else { + // reaching here means the first arg is neither a string literal + // nor an Array literal (direct callback) or there is no arg + // in both case this indicates a self-accepting module + return true; // done + } + } + else if (state === 4 /* LexerState.inArray */) { + if (char === `]`) { + return false; // done + } + else if (char === ',') { + continue; + } + else { + error(i); + } + } + } + break; + case 1 /* LexerState.inSingleQuoteString */: + if (char === `'`) { + addDep(i); + if (prevState === 0 /* LexerState.inCall */) { + // accept('foo', ...) + return false; + } + else { + state = prevState; + } + } + else { + currentDep += char; + } + break; + case 2 /* LexerState.inDoubleQuoteString */: + if (char === `"`) { + addDep(i); + if (prevState === 0 /* LexerState.inCall */) { + // accept('foo', ...) + return false; + } + else { + state = prevState; + } + } + else { + currentDep += char; + } + break; + case 3 /* LexerState.inTemplateString */: + if (char === '`') { + addDep(i); + if (prevState === 0 /* LexerState.inCall */) { + // accept('foo', ...) + return false; + } + else { + state = prevState; + } + } + else if (char === '$' && code.charAt(i + 1) === '{') { + error(i); + } + else { + currentDep += char; + } + break; + default: + throw new Error('unknown import.meta.hot lexer state'); + } + } + return false; +} +function lexAcceptedHmrExports(code, start, exportNames) { + const urls = new Set(); + lexAcceptedHmrDeps(code, start, urls); + for (const { url } of urls) { + exportNames.add(url); + } + return urls.size > 0; +} +function normalizeHmrUrl(url) { + if (url[0] !== '.' && url[0] !== '/') { + url = wrapId(url); + } + return url; +} +function error(pos) { + const err = new Error(`import.meta.hot.accept() can only accept string literals or an ` + + `Array of string literals.`); + err.pos = pos; + throw err; +} +// vitejs/vite#610 when hot-reloading Vue files, we read immediately on file +// change event and sometimes this can be too early and get an empty buffer. +// Poll until the file's modified time has changed before reading again. +async function readModifiedFile(file) { + const content = await fsp.readFile(file, 'utf-8'); + if (!content) { + const mtime = (await fsp.stat(file)).mtimeMs; + for (let n = 0; n < 10; n++) { + await new Promise((r) => setTimeout(r, 10)); + const newMtime = (await fsp.stat(file)).mtimeMs; + if (newMtime !== mtime) { + break; + } + } + return await fsp.readFile(file, 'utf-8'); + } + else { + return content; + } +} +function createHMRBroadcaster() { + const channels = []; + const readyChannels = new WeakSet(); + const broadcaster = { + get channels() { + return [...channels]; + }, + addChannel(channel) { + if (channels.some((c) => c.name === channel.name)) { + throw new Error(`HMR channel "${channel.name}" is already defined.`); + } + channels.push(channel); + return broadcaster; + }, + on(event, listener) { + // emit connection event only when all channels are ready + if (event === 'connection') { + // make a copy so we don't wait for channels that might be added after this is triggered + const channels = this.channels; + channels.forEach((channel) => channel.on('connection', () => { + readyChannels.add(channel); + if (channels.every((c) => readyChannels.has(c))) { + listener(); + } + })); + return; + } + channels.forEach((channel) => channel.on(event, listener)); + return; + }, + off(event, listener) { + channels.forEach((channel) => channel.off(event, listener)); + return; + }, + send(...args) { + channels.forEach((channel) => channel.send(...args)); + }, + listen() { + channels.forEach((channel) => channel.listen()); + }, + close() { + return Promise.all(channels.map((channel) => channel.close())); + }, + }; + return broadcaster; +} +function createServerHMRChannel() { + const innerEmitter = new EventEmitter$4(); + const outsideEmitter = new EventEmitter$4(); + return { + name: 'ssr', + send(...args) { + let payload; + if (typeof args[0] === 'string') { + payload = { + type: 'custom', + event: args[0], + data: args[1], + }; + } + else { + payload = args[0]; + } + outsideEmitter.emit('send', payload); + }, + off(event, listener) { + innerEmitter.off(event, listener); + }, + on: ((event, listener) => { + innerEmitter.on(event, listener); + }), + close() { + innerEmitter.removeAllListeners(); + outsideEmitter.removeAllListeners(); + }, + listen() { + innerEmitter.emit('connection'); + }, + api: { + innerEmitter, + outsideEmitter, + }, + }; +} + +const debug$1 = createDebugger('vite:import-analysis'); +const clientDir = normalizePath$3(CLIENT_DIR); +const skipRE = /\.(?:map|json)(?:$|\?)/; +const canSkipImportAnalysis = (id) => skipRE.test(id) || isDirectCSSRequest(id); +const optimizedDepChunkRE = /\/chunk-[A-Z\d]{8}\.js/; +const optimizedDepDynamicRE = /-[A-Z\d]{8}\.js/; +const hasViteIgnoreRE = /\/\*\s*@vite-ignore\s*\*\//; +const urlIsStringRE = /^(?:'.*'|".*"|`.*`)$/; +const templateLiteralRE = /^\s*`(.*)`\s*$/; +function isExplicitImportRequired(url) { + return !isJSRequest(url) && !isCSSRequest(url); +} +function extractImportedBindings(id, source, importSpec, importedBindings) { + let bindings = importedBindings.get(id); + if (!bindings) { + bindings = new Set(); + importedBindings.set(id, bindings); + } + const isDynamic = importSpec.d > -1; + const isMeta = importSpec.d === -2; + if (isDynamic || isMeta) { + // this basically means the module will be impacted by any change in its dep + bindings.add('*'); + return; + } + const exp = source.slice(importSpec.ss, importSpec.se); + const [match0] = findStaticImports(exp); + if (!match0) { + return; + } + const parsed = parseStaticImport(match0); + if (!parsed) { + return; + } + if (parsed.namespacedImport) { + bindings.add('*'); + } + if (parsed.defaultImport) { + bindings.add('default'); + } + if (parsed.namedImports) { + for (const name of Object.keys(parsed.namedImports)) { + bindings.add(name); + } + } +} +/** + * Server-only plugin that lexes, resolves, rewrites and analyzes url imports. + * + * - Imports are resolved to ensure they exist on disk + * + * - Lexes HMR accept calls and updates import relationships in the module graph + * + * - Bare module imports are resolved (by @rollup-plugin/node-resolve) to + * absolute file paths, e.g. + * + * ```js + * import 'foo' + * ``` + * is rewritten to + * ```js + * import '/@fs//project/node_modules/foo/dist/foo.js' + * ``` + * + * - CSS imports are appended with `.js` since both the js module and the actual + * css (referenced via ``) may go through the transform pipeline: + * + * ```js + * import './style.css' + * ``` + * is rewritten to + * ```js + * import './style.css.js' + * ``` + */ +function importAnalysisPlugin(config) { + const { root, base } = config; + const fsUtils = getFsUtils(config); + const clientPublicPath = path$o.posix.join(base, CLIENT_PUBLIC_PATH); + const enablePartialAccept = config.experimental?.hmrPartialAccept; + let server; + let _env; + let _ssrEnv; + function getEnv(ssr) { + if (!_ssrEnv || !_env) { + const importMetaEnvKeys = {}; + const userDefineEnv = {}; + for (const key in config.env) { + importMetaEnvKeys[key] = JSON.stringify(config.env[key]); + } + for (const key in config.define) { + // non-import.meta.env.* is handled in `clientInjection` plugin + if (key.startsWith('import.meta.env.')) { + userDefineEnv[key.slice(16)] = config.define[key]; + } + } + const env = `import.meta.env = ${serializeDefine({ + ...importMetaEnvKeys, + SSR: '__vite_ssr__', + ...userDefineEnv, + })};`; + _ssrEnv = env.replace('__vite_ssr__', 'true'); + _env = env.replace('__vite_ssr__', 'false'); + } + return ssr ? _ssrEnv : _env; + } + return { + name: 'vite:import-analysis', + configureServer(_server) { + server = _server; + }, + async transform(source, importer, options) { + // In a real app `server` is always defined, but it is undefined when + // running src/node/server/__tests__/pluginContainer.spec.ts + if (!server) { + return null; + } + const ssr = options?.ssr === true; + if (canSkipImportAnalysis(importer)) { + debug$1?.(colors$1.dim(`[skipped] ${prettifyUrl(importer, root)}`)); + return null; + } + const msAtStart = debug$1 ? performance.now() : 0; + await init; + let imports; + let exports; + source = stripBomTag(source); + try { + [imports, exports] = parse$e(source); + } + catch (_e) { + const e = _e; + const { message, showCodeFrame } = createParseErrorInfo(importer, source); + this.error(message, showCodeFrame ? e.idx : undefined); + } + const depsOptimizer = getDepsOptimizer(config, ssr); + const { moduleGraph } = server; + // since we are already in the transform phase of the importer, it must + // have been loaded so its entry is guaranteed in the module graph. + const importerModule = moduleGraph.getModuleById(importer); + if (!importerModule) { + // This request is no longer valid. It could happen for optimized deps + // requests. A full reload is going to request this id again. + // Throwing an outdated error so we properly finish the request with a + // 504 sent to the browser. + throwOutdatedRequest(importer); + } + if (!imports.length && !this._addedImports) { + importerModule.isSelfAccepting = false; + debug$1?.(`${timeFrom(msAtStart)} ${colors$1.dim(`[no imports] ${prettifyUrl(importer, root)}`)}`); + return source; + } + let hasHMR = false; + let isSelfAccepting = false; + let hasEnv = false; + let needQueryInjectHelper = false; + let s; + const str = () => s || (s = new MagicString(source)); + let isPartiallySelfAccepting = false; + const importedBindings = enablePartialAccept + ? new Map() + : null; + const toAbsoluteUrl = (url) => path$o.posix.resolve(path$o.posix.dirname(importerModule.url), url); + const normalizeUrl = async (url, pos, forceSkipImportAnalysis = false) => { + url = stripBase(url, base); + let importerFile = importer; + const optimizeDeps = getDepOptimizationConfig(config, ssr); + if (moduleListContains(optimizeDeps?.exclude, url)) { + if (depsOptimizer) { + await depsOptimizer.scanProcessing; + // if the dependency encountered in the optimized file was excluded from the optimization + // the dependency needs to be resolved starting from the original source location of the optimized file + // because starting from node_modules/.vite will not find the dependency if it was not hoisted + // (that is, if it is under node_modules directory in the package source of the optimized file) + for (const optimizedModule of depsOptimizer.metadata.depInfoList) { + if (!optimizedModule.src) + continue; // Ignore chunks + if (optimizedModule.file === importerModule.file) { + importerFile = optimizedModule.src; + } + } + } + } + const resolved = await this.resolve(url, importerFile); + if (!resolved || resolved.meta?.['vite:alias']?.noResolved) { + // in ssr, we should let node handle the missing modules + if (ssr) { + return [url, url]; + } + // fix#9534, prevent the importerModuleNode being stopped from propagating updates + importerModule.isSelfAccepting = false; + return this.error(`Failed to resolve import "${url}" from "${normalizePath$3(path$o.relative(process.cwd(), importerFile))}". Does the file exist?`, pos); + } + if (isExternalUrl(resolved.id)) { + return [resolved.id, resolved.id]; + } + const isRelative = url[0] === '.'; + const isSelfImport = !isRelative && cleanUrl(url) === cleanUrl(importer); + // normalize all imports into resolved URLs + // e.g. `import 'foo'` -> `import '/@fs/.../node_modules/foo/index.js'` + if (resolved.id.startsWith(withTrailingSlash(root))) { + // in root: infer short absolute path from root + url = resolved.id.slice(root.length); + } + else if (depsOptimizer?.isOptimizedDepFile(resolved.id) || + // vite-plugin-react isn't following the leading \0 virtual module convention. + // This is a temporary hack to avoid expensive fs checks for React apps. + // We'll remove this as soon we're able to fix the react plugins. + (resolved.id !== '/@react-refresh' && + path$o.isAbsolute(resolved.id) && + fsUtils.existsSync(cleanUrl(resolved.id)))) { + // an optimized deps may not yet exists in the filesystem, or + // a regular file exists but is out of root: rewrite to absolute /@fs/ paths + url = path$o.posix.join(FS_PREFIX, resolved.id); + } + else { + url = resolved.id; + } + // if the resolved id is not a valid browser import specifier, + // prefix it to make it valid. We will strip this before feeding it + // back into the transform pipeline + if (url[0] !== '.' && url[0] !== '/') { + url = wrapId(resolved.id); + } + // make the URL browser-valid if not SSR + if (!ssr) { + // mark non-js/css imports with `?import` + if (isExplicitImportRequired(url)) { + url = injectQuery(url, 'import'); + } + else if ((isRelative || isSelfImport) && + !DEP_VERSION_RE.test(url)) { + // If the url isn't a request for a pre-bundled common chunk, + // for relative js/css imports, or self-module virtual imports + // (e.g. vue blocks), inherit importer's version query + // do not do this for unknown type imports, otherwise the appended + // query can break 3rd party plugin's extension checks. + const versionMatch = importer.match(DEP_VERSION_RE); + if (versionMatch) { + url = injectQuery(url, versionMatch[1]); + } + } + // check if the dep has been hmr updated. If yes, we need to attach + // its last updated timestamp to force the browser to fetch the most + // up-to-date version of this module. + try { + // delay setting `isSelfAccepting` until the file is actually used (#7870) + // We use an internal function to avoid resolving the url again + const depModule = await moduleGraph._ensureEntryFromUrl(unwrapId(url), ssr, canSkipImportAnalysis(url) || forceSkipImportAnalysis, resolved); + if (depModule.lastHMRTimestamp > 0) { + url = injectQuery(url, `t=${depModule.lastHMRTimestamp}`); + } + } + catch (e) { + // it's possible that the dep fails to resolve (non-existent import) + // attach location to the missing import + e.pos = pos; + throw e; + } + // prepend base + url = joinUrlSegments(base, url); + } + return [url, resolved.id]; + }; + const orderedImportedUrls = new Array(imports.length); + const orderedAcceptedUrls = new Array(imports.length); + const orderedAcceptedExports = new Array(imports.length); + await Promise.all(imports.map(async (importSpecifier, index) => { + const { s: start, e: end, ss: expStart, se: expEnd, d: dynamicIndex, a: attributeIndex, } = importSpecifier; + // #2083 User may use escape path, + // so use imports[index].n to get the unescaped string + let specifier = importSpecifier.n; + const rawUrl = source.slice(start, end); + // check import.meta usage + if (rawUrl === 'import.meta') { + const prop = source.slice(end, end + 4); + if (prop === '.hot') { + hasHMR = true; + const endHot = end + 4 + (source[end + 4] === '?' ? 1 : 0); + if (source.slice(endHot, endHot + 7) === '.accept') { + // further analyze accepted modules + if (source.slice(endHot, endHot + 14) === '.acceptExports') { + const importAcceptedExports = (orderedAcceptedExports[index] = + new Set()); + lexAcceptedHmrExports(source, source.indexOf('(', endHot + 14) + 1, importAcceptedExports); + isPartiallySelfAccepting = true; + } + else { + const importAcceptedUrls = (orderedAcceptedUrls[index] = + new Set()); + if (lexAcceptedHmrDeps(source, source.indexOf('(', endHot + 7) + 1, importAcceptedUrls)) { + isSelfAccepting = true; + } + } + } + } + else if (prop === '.env') { + hasEnv = true; + } + return; + } + else if (templateLiteralRE.test(rawUrl)) { + // If the import has backticks but isn't transformed as a glob import + // (as there's nothing to glob), check if it's simply a plain string. + // If so, we can replace the specifier as a plain string to prevent + // an incorrect "cannot be analyzed" warning. + if (!(rawUrl.includes('${') && rawUrl.includes('}'))) { + specifier = rawUrl.replace(templateLiteralRE, '$1'); + } + } + const isDynamicImport = dynamicIndex > -1; + // strip import attributes as we can process them ourselves + if (!isDynamicImport && attributeIndex > -1) { + str().remove(end + 1, expEnd); + } + // static import or valid string in dynamic import + // If resolvable, let's resolve it + if (specifier) { + // skip external / data uri + if (isExternalUrl(specifier) || isDataUrl(specifier)) { + return; + } + // skip ssr external + if (ssr) { + if (shouldExternalizeForSSR(specifier, importer, config)) { + return; + } + if (isBuiltin(specifier)) { + return; + } + } + // skip client + if (specifier === clientPublicPath) { + return; + } + // warn imports to non-asset /public files + if (specifier[0] === '/' && + !(config.assetsInclude(cleanUrl(specifier)) || + urlRE.test(specifier)) && + checkPublicFile(specifier, config)) { + throw new Error(`Cannot import non-asset file ${specifier} which is inside /public. ` + + `JS/CSS files inside /public are copied as-is on build and ` + + `can only be referenced via