@anhnv/lexical-playground 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DateTimeComponent-DX3ALs4U.cjs +1 -0
- package/dist/DateTimeComponent-DaF6ca1f.js +174 -0
- package/dist/EquationComponent-BrbIAXFZ.js +105 -0
- package/dist/EquationComponent-DFRdSLyf.cjs +3 -0
- package/dist/ExcalidrawComponent-B2RIlh-t.js +174 -0
- package/dist/ExcalidrawComponent-VGrNBMwa.cjs +1 -0
- package/dist/ImageComponent-CFLPSAon.cjs +1 -0
- package/dist/ImageComponent-Dr9Y0gPd.js +286 -0
- package/dist/ImageResizer-riowDF8s.cjs +1 -0
- package/dist/ImageResizer-wZz1Oitl.js +199 -0
- package/dist/PollComponent-DpWrUNaL.js +152 -0
- package/dist/PollComponent-hitipp8H.cjs +1 -0
- package/dist/QuestionComponent-BYluUh-8.cjs +1 -0
- package/dist/QuestionComponent-DQFO_Or8.js +60 -0
- package/dist/StickyComponent-B-sytJ7W.js +161 -0
- package/dist/StickyComponent-DGi089bO.cjs +1 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
- package/dist/babel-CqfpZa5G.js +7195 -0
- package/dist/babel-CryJy3T1.cjs +15 -0
- package/dist/estree-CJTW2kur.cjs +44 -0
- package/dist/estree-DmlwiAu4.js +4453 -0
- package/dist/fonts/Assistant/Assistant-Bold.woff2 +0 -0
- package/dist/fonts/Assistant/Assistant-Medium.woff2 +0 -0
- package/dist/fonts/Assistant/Assistant-Regular.woff2 +0 -0
- package/dist/fonts/Assistant/Assistant-SemiBold.woff2 +0 -0
- package/dist/fonts/Cascadia/CascadiaCode-Regular.woff2 +0 -0
- package/dist/fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2 +0 -0
- package/dist/fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2 +0 -0
- package/dist/fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2 +0 -0
- package/dist/fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2 +0 -0
- package/dist/fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2 +0 -0
- package/dist/fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2 +0 -0
- package/dist/fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2 +0 -0
- package/dist/fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2 +0 -0
- package/dist/fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2 +0 -0
- package/dist/fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2 +0 -0
- package/dist/fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2 +0 -0
- package/dist/fonts/Liberation/LiberationSans-Regular.woff2 +0 -0
- package/dist/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2 +0 -0
- package/dist/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2 +0 -0
- package/dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2 +0 -0
- package/dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2 +0 -0
- package/dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2 +0 -0
- package/dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2 +0 -0
- package/dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2 +0 -0
- package/dist/fonts/Virgil/Virgil-Regular.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-019d66dcad46dc156b162d267f981c20.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-04b718e5623574919c8b0dea5f301444.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-069e77aac84590e2e991d0a0176d34f2.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-06c77b8c66e51ed6c63ccb502dd8b8af.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-08e0dc436ad0ad61ba5558db0674d762.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-093b9ef39a46ceae95a1df18a0a3a326.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-095c169f3314805276f603a362766abd.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-09850c4077f3fffe707905872e0e2460.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-0986d134c05864f5025962eef9f994a0.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-0b5d723fdc4e249c140f0909e87d03b4.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-0f626226ba1272e832aea87bafd9720e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-0f7fb1e0d5015bb1371343153ecf7ce3.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-0fa55a080fcd0f9dc2e0b0058b793df8.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-0facdf1ea213ba40261022f5d5ed4493.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-10a7ae9a371830a80c3d844acf1c02d7.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-112c051027b2d766c19a519f6ee1f4f7.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-11c345711937f0ba4b8f7b6b919c8440.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-12b52b58eb3df36804b9a654ec9ee194.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-13ae07ed2e272d26d59bc0691cd7117a.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-13d2887ec8ee73c43acdabc52a05af7b.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-145aa02cdd91946e67dc934e1acffe75.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-15dc6d811c9cd078f9086a740d5a1038.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-173945821411c09f70c95f98d590e697.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-1b611157cd46bb184d4fa4dae2d6a2b8.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-1e6fd68f1f3902ce48ce8c69df385622.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-1ee544f0f1dac422545c505baa788992.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-1fdc0c67ed57263a80fd108c1f6ccf24.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-203b0e569e3b14aac86a003dc3fa523e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-20cc1bbf50e7efb442756cb605672c1f.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-20e7bf72fa05de9adf7dbcc7bf51dde6.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-21430ee05a1248901da8d0de08744d47.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-23686f7f29da6e8008c36dd3a80c83d6.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-23ad2d71b280f00b1363b95b7bea94eb.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-23f228f3999c01983860012330e4be08.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-24476a126f129212beb33f66853ea151.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-24a21c1e4449222e8d1898d69ff3a404.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-25b7f38e18f035f96cb5e547bd2bd08c.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-29cec36cd205b211da97acabaa62f055.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-2a26d20a23b00898ce82f09d2ee47c3f.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-2adbc89c11e65905393d3dfc468b9d5b.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-2b7441d46298788ac94e610ffcc709b6.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-2b77e8ebfb2367ab2662396a60e7d320.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-2cf96d082d35ea3d8106851223ad0d16.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-2d43040e86ff03ba677f6f9c04cd0805.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-2e33e8dc771ef5e1d9127d60a6b73679.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-33432927cd87d40cfe393c7482bf221f.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-353f33792a8f60dc69323ddf635a269e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-36925dfe329a45086cbb7fc5c20d45ac.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-3717077e38f98d89eae729b6c14e56dc.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-3756e81d3e149cf6099163ee79944fec.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-395c35dd584b56b0789f58a0559beaf1.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-3c9de2ae0ea4bc91a510942dfa4be8d2.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-3cc70dbb64df5b21f1326cc24dee2195.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-3e1f8f654357353bf0e04ba5c34b5f7f.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-3e63ed8162808a9e425ed80a8bc79114.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-3eaa538115d76932653c21d8dc28f207.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4095eb84ef3874e2600247bee0b04026.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-41521fade99856108931b4768b1b2648.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-450da755d5bcb70906e1295e559b9602.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-452225341522a7942f0f6aab1a5c91a3.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4535823663ad81405188a528d8f2b1a2.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4806e761d750087c2d734fc64596eaff.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4a0fdb40036e87b40aa08dd30584cb85.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4a38cc3e9cf104e69ba246d37f8cf135.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4aca6a43e59aceee2166b0c7e4e85ef1.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4bfaa8ffa64c5ee560aa2daba7c9cbd3.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4dc6d5f188d5c96d44815cd1e81aa885.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4ddc14ed3eb0c3e46364317dfc0144a3.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4ee10ae43505e2e0bc62656ced49c0fa.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-4f50e5136e136527280bc902c5817561.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-51502f1206be09c565f1547c406e9558.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-51a0e808bbc8361236ac521a119758a3.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-52a84a22fd1369bffeaf21da2d6158dc.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-5330a2119a716e4e7224ed108b085dac.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-543fa46ace099a7099dad69123399400.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-544fc28abe2c5c30e62383fd4dac255f.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-54acdfc2166ad7fcbd074f75fd4a56ba.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-5572b3513ba8df57a3d5d7303ee6b11b.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-56467a5c8840c4d23a60b2f935114848.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-56a32a7689abd0326e57c10c6c069bb4.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-57862b464a55b18c7bf234ce22907d73.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-583d166e56ba0de4b77eabb47ef67839.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-5882ffa04f32584d26109137e2da4352.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-58fd02350d0bc52cf1ca3bb32ce9766e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-5935a5775af3d5c6307ac667bd9ae74e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-59e9ff77b0efaf684bc09274fb6908c9.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-5a1ce3117cfe90c48e8fb4a9a00f694d.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-5a45d991244d4c7140217e1e5f5ca4f4.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-5a7fac4b8b23a6e4e5ba0c9bf1756c91.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-5b0ed6971aaab9c8ad563230bd5471a7.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-5d2898fbc097a7e24c6f38d80587621e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-603aefd23e350ba7eb124273e3c9bcf1.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-60a3089806700d379f11827ee9843b6b.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-60a41c7e1c68f22424e6d22df544bc82.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-642b26e2e5f5fb780b51b593dbc8c851.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-66493ba5a8367f2928812f446f47b56a.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-670ba603758d94268e8606f240a42e12.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-671a2c20b1eb9e4ef8a192833940e319.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-684d65f1793cac449dde5d59cb3c47fb.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-69c09cc5fa3e55c74fc4821f76909cc3.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-6ae5b42180ad70b971c91e7eefb8eba2.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-6e092f71c1e634059ada0e52abadce67.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-6f3256af8454371776bc46670d33cc65.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-6fe5c5973cc06f74b2387a631ea36b88.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-70c2eb8d64e71a42a834eb857ea9df51.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-70e811fd7994e61f408c923de6ddd078.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7197d6fda6cba7c3874c53d6381ca239.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-72252d73220fa3cd856677888cee1635.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-72536a3d71b694a0d53dd90ddceae41e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-726303e0774b4e678bff8c2deb6ca603.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-733171b4ffcd17ea1fe1c0ba627173bf.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-739bc1a567439c7cffcd1614644593d2.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-73e309718fd16cea44b4d54a33581811.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7494dc504ae00ee9cd0505f990f88c5d.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-74e2263a91439c25b91d5132ce9f4d62.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-761d05e3cd968cf574166867998ef06a.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7718fe60986d8b42b1be9c5ace5ccf25.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-774d4f764a1299da5d28ec2f2ffe0d69.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-79d494361ae093b69e74ee9dbe65bfd4.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-79f007c1c6d07557120982951ea67998.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7a07ddc0f0c0f5f4a9bad6ee3dda66b5.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7ab2bed91166a9dca83a5ebfbe2a7f38.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7ccce86603f80a099ddb0cb21d4ae3e3.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7e4bde7e9c7f84cd34d8a845e384c746.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7e929f262f30c8ee78bf398150b1a7cd.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7eb9fffd1aa890d07d0f88cc82e6cfe4.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-7f855356ab893b0d2b9c1c83b8116f0e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-829615148e6357d826b9242eb7fbbd1e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-866fa7613df6b3fd272bcfd4530c0bb9.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-87599f94b6cc129d505b375798d0d751.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-8c2f33cee3993174f7e87c28e4bf42ee.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-8d3bcabb847b56243b16afe62adaaf21.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-8de5b863cb50dfefdd07cb11c774d579.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-8e9f97f01034820170065b2921b4fb5e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-8f476c4c99813d57cbe6eca4727388ad.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-903bb6865f3452e2fda42e3a25547bc5.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-91ddb2969bf2d31ba02ad82998d1314c.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-938d90c10ff8c20386af7f242c05d6b0.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-93fc8f28a33234bcadf1527cafabd502.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-95429962233afd82db1c27df1500a28c.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-9544732d2e62d1a429674f8ee41b5d3a.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-9592bfc861f07bcb8d75c196b370e548.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-95bfd249da4902577b4b7d76ebdd0b44.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-968cffdc8ee679da094e77ebf50f58ef.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-97f7f48ce90c9429bf32ae51469db74d.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-982b630266d87db93d2539affb1275c6.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-98f2ad84457de7f3740d9920b8fa8667.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-99a16ef6a64934d5781933dbd9c46b2e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-9cfb2a77a4e45025105ad29a1748b90d.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-9d81066dd2b337c938df6e90380a00dc.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-9eb5a99df4e76ac3363453ac9ca288b1.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-a004ddfcb26e67bd6e678c8ed19e25ce.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-a0ca5df4258213d7fc9fce80f65ce760.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-a1f916d6039285c4ffb900cd654e418f.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-a203b91dad570bf05a58c3c3ddb529bf.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-a365e82ed54697a52f27adcea1315fe8.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-a4c34be6d42152e64b0df90bc4607f64.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-a7accba310e821da5505f71c03b76bdb.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-aa0d470430e6391eca720c7cfa44446f.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-aa5c9ca6cf4fba00433b7aa3fa10671a.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-ac9ceb44437becc3e9c4dbfebab7fc2d.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-b1220a3c61f85cc0408deedb4c5f57a2.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-b358f7a51ece39a3247942b1feabdb29.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-b57aaedfd8ebdf3931f25119dc6a5eb2.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-b5c1596551c256e0e9cf02028595b092.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-b6d128682ee29e471486354d486a1b90.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-b6fd38ca30869792244804b04bc058da.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-b7d203b051eff504ff59ddca7576b6a9.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-b96d9226ce77ec94ceca043d712182e6.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-ba3de316d63c7e339987b16f41a0b879.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-bafff7a14c27403dcc6cf1432e8ea836.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-bd77e3c7f9e0b072d96af37f73d1aa32.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-be549ab72f0719d606a5c01e2c0219b6.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-c16ed9740b85badf16e86ea782a3062f.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-c1f94158256bb1f3bf665b053d895af9.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-c40533fdf4cc57177b12803598af7e59.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-c4a687ac4f0c2766eefc9f77ed99cddf.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-c69f61a4ab18d0488c8d1fc12e7028e8.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-c8b71798409ccc126ee264a00aadcf21.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-c99eda15fc26a2941579560f76c3a5cf.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-cb17fc3db95f6d139afc9d31a8e93293.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-cbaaefaaf326668277aa24dfa93c4d28.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-cd145ce4a0ea18469358df53c207bc1b.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-cdbce89e82cc1ab53a2decbf5819278f.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-ce4884f96f11589608b76b726a755803.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-cf2cc71752631e579e35b0e423bf2638.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-cf6ff4e0f491ca0cf3038187a997b9b4.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-cfb211578629b7e8153b37240de6a9d5.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-d0cf73942fea1c74edbdf0b3011f4656.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-d2666cbed13462c5dc36fa2f15c202ca.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-d3716376641d615e2995605b29bca7b6.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-dac48066b5883d8b4551fc584f0c2a3e.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-dbea1af6dcd9860be40c3d18254338f5.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-e11567fd2accf9957cd0d3c2be937d87.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-e2ead7ea7da0437f085f42ffc05f8d13.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-e3fcf5180fd466c8915c4e8069491054.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-e480d9c614742d05f0e78f274f1e69e6.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-e4bca6cfa53e499cae0a6be4894a90e9.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-e51ef413167c6e14e0c0fdcc585f2fc9.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-e5f453bb04da18eed01675eeebd88bf8.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-e656f091b9dc4709722c9f4b84d3c797.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-ec181b795ac1fb5a50d700b6e996d745.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-ee8bae97908d5147b423f77ad0d3c1bb.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-f0f13b5c60e0af5553bd359f5513be1b.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-f2b54d4e7be0eaefe1c2c56836fa5368.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-f56414bf9bced67990def8660e306759.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-f5d079153c99a25b9be5b8583c4cc8a7.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-f6032fc06eb20480f096199713f70885.woff2 +0 -0
- package/dist/fonts/Xiaolai/Xiaolai-Regular-f8ee5d36068a42b51d0e4a1116cfcec1.woff2 +0 -0
- package/dist/html-C9xlBp6Q.cjs +25 -0
- package/dist/html-COoGaLph.js +2788 -0
- package/dist/index-BF-WAqsp.cjs +5 -0
- package/dist/index-C0BTrOQP.js +28947 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +4 -0
- package/dist/logo.svg +1 -0
- package/dist/markdown-B0Hak0DU.cjs +62 -0
- package/dist/markdown-BDWdOrGs.js +3192 -0
- package/dist/postcss-Byg44mmr.cjs +61 -0
- package/dist/postcss-CCzdrMa5.js +4735 -0
- package/dist/standalone-9koseMU7.js +2429 -0
- package/dist/standalone-B68uB4ar.cjs +29 -0
- package/dist/style.css +1 -0
- package/dist/typescript-BKKrhwbC.cjs +21 -0
- package/dist/typescript-BWpY7CXP.js +12965 -0
- package/package.json +106 -0
|
@@ -0,0 +1,2429 @@
|
|
|
1
|
+
var $u = Object.create, Xe = Object.defineProperty, Ju = Object.getOwnPropertyDescriptor, Ru = Object.getOwnPropertyNames, Mu = Object.getPrototypeOf, Vu = Object.prototype.hasOwnProperty, Wu = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Ue = (e, t) => {
|
|
2
|
+
for (var u in t) Xe(e, u, { get: t[u], enumerable: !0 });
|
|
3
|
+
}, Ku = (e, t, u, r) => {
|
|
4
|
+
if (t && typeof t == "object" || typeof t == "function") for (let n of Ru(t)) !Vu.call(e, n) && n !== u && Xe(e, n, { get: () => t[n], enumerable: !(r = Ju(t, n)) || r.enumerable });
|
|
5
|
+
return e;
|
|
6
|
+
}, zu = (e, t, u) => (u = e != null ? $u(Mu(e)) : {}, Ku(Xe(u, "default", { value: e, enumerable: !0 }), e)), Xu = Wu((e, t) => {
|
|
7
|
+
var u, r, n, D, a, i, o, s, l, f, c, F, d, p, E, g, m, b, C;
|
|
8
|
+
d = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu, F = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y, u = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu, E = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y, c = /(?: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, g = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y, C = /[\t\v\f\ufeff\p{Zs}]+/yu, s = /\r?\n|[\r\u2028\u2029]/y, l = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y, p = /\/\/.*/y, n = /[<>.:={}]|\/(?![\/*])/y, r = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu, D = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y, a = /[^<>{}]+/y, b = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/, m = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/, i = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/, o = /^(?:return|throw|yield)$/, f = RegExp(s.source), t.exports = function* (y, { jsx: w = !1 } = {}) {
|
|
9
|
+
var x, L, $, v, B, se, h, P, le, N, ue, A, he, k;
|
|
10
|
+
for ({ length: se } = y, v = 0, B = "", k = [{ tag: "JS" }], x = [], ue = 0, A = !1; v < se; ) {
|
|
11
|
+
switch (P = k[k.length - 1], P.tag) {
|
|
12
|
+
case "JS":
|
|
13
|
+
case "JSNonExpressionParen":
|
|
14
|
+
case "InterpolationInTemplate":
|
|
15
|
+
case "InterpolationInJSX":
|
|
16
|
+
if (y[v] === "/" && (b.test(B) || i.test(B)) && (d.lastIndex = v, h = d.exec(y))) {
|
|
17
|
+
v = d.lastIndex, B = h[0], A = !0, yield { type: "RegularExpressionLiteral", value: h[0], closed: h[1] !== void 0 && h[1] !== "\\" };
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (F.lastIndex = v, h = F.exec(y)) {
|
|
21
|
+
switch (he = h[0], le = F.lastIndex, N = he, he) {
|
|
22
|
+
case "(":
|
|
23
|
+
B === "?NonExpressionParenKeyword" && k.push({ tag: "JSNonExpressionParen", nesting: ue }), ue++, A = !1;
|
|
24
|
+
break;
|
|
25
|
+
case ")":
|
|
26
|
+
ue--, A = !0, P.tag === "JSNonExpressionParen" && ue === P.nesting && (k.pop(), N = "?NonExpressionParenEnd", A = !1);
|
|
27
|
+
break;
|
|
28
|
+
case "{":
|
|
29
|
+
F.lastIndex = 0, $ = !m.test(B) && (b.test(B) || i.test(B)), x.push($), A = !1;
|
|
30
|
+
break;
|
|
31
|
+
case "}":
|
|
32
|
+
switch (P.tag) {
|
|
33
|
+
case "InterpolationInTemplate":
|
|
34
|
+
if (x.length === P.nesting) {
|
|
35
|
+
g.lastIndex = v, h = g.exec(y), v = g.lastIndex, B = h[0], h[1] === "${" ? (B = "?InterpolationInTemplate", A = !1, yield { type: "TemplateMiddle", value: h[0] }) : (k.pop(), A = !0, yield { type: "TemplateTail", value: h[0], closed: h[1] === "`" });
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
case "InterpolationInJSX":
|
|
40
|
+
if (x.length === P.nesting) {
|
|
41
|
+
k.pop(), v += 1, B = "}", yield { type: "JSXPunctuator", value: "}" };
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
A = x.pop(), N = A ? "?ExpressionBraceEnd" : "}";
|
|
46
|
+
break;
|
|
47
|
+
case "]":
|
|
48
|
+
A = !0;
|
|
49
|
+
break;
|
|
50
|
+
case "++":
|
|
51
|
+
case "--":
|
|
52
|
+
N = A ? "?PostfixIncDec" : "?UnaryIncDec";
|
|
53
|
+
break;
|
|
54
|
+
case "<":
|
|
55
|
+
if (w && (b.test(B) || i.test(B))) {
|
|
56
|
+
k.push({ tag: "JSXTag" }), v += 1, B = "<", yield { type: "JSXPunctuator", value: he };
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
A = !1;
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
A = !1;
|
|
63
|
+
}
|
|
64
|
+
v = le, B = N, yield { type: "Punctuator", value: he };
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (u.lastIndex = v, h = u.exec(y)) {
|
|
68
|
+
switch (v = u.lastIndex, N = h[0], h[0]) {
|
|
69
|
+
case "for":
|
|
70
|
+
case "if":
|
|
71
|
+
case "while":
|
|
72
|
+
case "with":
|
|
73
|
+
B !== "." && B !== "?." && (N = "?NonExpressionParenKeyword");
|
|
74
|
+
}
|
|
75
|
+
B = N, A = !i.test(h[0]), yield { type: h[1] === "#" ? "PrivateIdentifier" : "IdentifierName", value: h[0] };
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (E.lastIndex = v, h = E.exec(y)) {
|
|
79
|
+
v = E.lastIndex, B = h[0], A = !0, yield { type: "StringLiteral", value: h[0], closed: h[2] !== void 0 };
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (c.lastIndex = v, h = c.exec(y)) {
|
|
83
|
+
v = c.lastIndex, B = h[0], A = !0, yield { type: "NumericLiteral", value: h[0] };
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (g.lastIndex = v, h = g.exec(y)) {
|
|
87
|
+
v = g.lastIndex, B = h[0], h[1] === "${" ? (B = "?InterpolationInTemplate", k.push({ tag: "InterpolationInTemplate", nesting: x.length }), A = !1, yield { type: "TemplateHead", value: h[0] }) : (A = !0, yield { type: "NoSubstitutionTemplate", value: h[0], closed: h[1] === "`" });
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
case "JSXTag":
|
|
92
|
+
case "JSXTagEnd":
|
|
93
|
+
if (n.lastIndex = v, h = n.exec(y)) {
|
|
94
|
+
switch (v = n.lastIndex, N = h[0], h[0]) {
|
|
95
|
+
case "<":
|
|
96
|
+
k.push({ tag: "JSXTag" });
|
|
97
|
+
break;
|
|
98
|
+
case ">":
|
|
99
|
+
k.pop(), B === "/" || P.tag === "JSXTagEnd" ? (N = "?JSX", A = !0) : k.push({ tag: "JSXChildren" });
|
|
100
|
+
break;
|
|
101
|
+
case "{":
|
|
102
|
+
k.push({ tag: "InterpolationInJSX", nesting: x.length }), N = "?InterpolationInJSX", A = !1;
|
|
103
|
+
break;
|
|
104
|
+
case "/":
|
|
105
|
+
B === "<" && (k.pop(), k[k.length - 1].tag === "JSXChildren" && k.pop(), k.push({ tag: "JSXTagEnd" }));
|
|
106
|
+
}
|
|
107
|
+
B = N, yield { type: "JSXPunctuator", value: h[0] };
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (r.lastIndex = v, h = r.exec(y)) {
|
|
111
|
+
v = r.lastIndex, B = h[0], yield { type: "JSXIdentifier", value: h[0] };
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (D.lastIndex = v, h = D.exec(y)) {
|
|
115
|
+
v = D.lastIndex, B = h[0], yield { type: "JSXString", value: h[0], closed: h[2] !== void 0 };
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
case "JSXChildren":
|
|
120
|
+
if (a.lastIndex = v, h = a.exec(y)) {
|
|
121
|
+
v = a.lastIndex, B = h[0], yield { type: "JSXText", value: h[0] };
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
switch (y[v]) {
|
|
125
|
+
case "<":
|
|
126
|
+
k.push({ tag: "JSXTag" }), v++, B = "<", yield { type: "JSXPunctuator", value: "<" };
|
|
127
|
+
continue;
|
|
128
|
+
case "{":
|
|
129
|
+
k.push({ tag: "InterpolationInJSX", nesting: x.length }), v++, B = "?InterpolationInJSX", A = !1, yield { type: "JSXPunctuator", value: "{" };
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (C.lastIndex = v, h = C.exec(y)) {
|
|
134
|
+
v = C.lastIndex, yield { type: "WhiteSpace", value: h[0] };
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (s.lastIndex = v, h = s.exec(y)) {
|
|
138
|
+
v = s.lastIndex, A = !1, o.test(B) && (B = "?NoLineTerminatorHere"), yield { type: "LineTerminatorSequence", value: h[0] };
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (l.lastIndex = v, h = l.exec(y)) {
|
|
142
|
+
v = l.lastIndex, f.test(h[0]) && (A = !1, o.test(B) && (B = "?NoLineTerminatorHere")), yield { type: "MultiLineComment", value: h[0], closed: h[1] !== void 0 };
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (p.lastIndex = v, h = p.exec(y)) {
|
|
146
|
+
v = p.lastIndex, A = !1, yield { type: "SingleLineComment", value: h[0] };
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
L = String.fromCodePoint(y.codePointAt(v)), v += L.length, B = L, A = !1, yield { type: P.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid", value: L };
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}), Uu = {};
|
|
153
|
+
Ue(Uu, { __debug: () => La, check: () => Pa, doc: () => Ou, format: () => Lu, formatWithCursor: () => ju, getSupportInfo: () => ja, util: () => _u, version: () => oa });
|
|
154
|
+
var me = (e, t) => (u, r, ...n) => u | 1 && r == null ? void 0 : (t.call(r) ?? r[e]).apply(r, n), qu = String.prototype.replaceAll ?? function(e, t) {
|
|
155
|
+
return e.global ? this.replace(e, t) : this.split(e).join(t);
|
|
156
|
+
}, Hu = me("replaceAll", function() {
|
|
157
|
+
if (typeof this == "string") return qu;
|
|
158
|
+
}), xe = Hu, Gu = class {
|
|
159
|
+
diff(e, t, u = {}) {
|
|
160
|
+
let r;
|
|
161
|
+
typeof u == "function" ? (r = u, u = {}) : "callback" in u && (r = u.callback);
|
|
162
|
+
let n = this.castInput(e, u), D = this.castInput(t, u), a = this.removeEmpty(this.tokenize(n, u)), i = this.removeEmpty(this.tokenize(D, u));
|
|
163
|
+
return this.diffWithOptionsObj(a, i, u, r);
|
|
164
|
+
}
|
|
165
|
+
diffWithOptionsObj(e, t, u, r) {
|
|
166
|
+
var n;
|
|
167
|
+
let D = (g) => {
|
|
168
|
+
if (g = this.postProcess(g, u), r) {
|
|
169
|
+
setTimeout(function() {
|
|
170
|
+
r(g);
|
|
171
|
+
}, 0);
|
|
172
|
+
return;
|
|
173
|
+
} else return g;
|
|
174
|
+
}, a = t.length, i = e.length, o = 1, s = a + i;
|
|
175
|
+
u.maxEditLength != null && (s = Math.min(s, u.maxEditLength));
|
|
176
|
+
let l = (n = u.timeout) !== null && n !== void 0 ? n : 1 / 0, f = Date.now() + l, c = [{ oldPos: -1, lastComponent: void 0 }], F = this.extractCommon(c[0], t, e, 0, u);
|
|
177
|
+
if (c[0].oldPos + 1 >= i && F + 1 >= a) return D(this.buildValues(c[0].lastComponent, t, e));
|
|
178
|
+
let d = -1 / 0, p = 1 / 0, E = () => {
|
|
179
|
+
for (let g = Math.max(d, -o); g <= Math.min(p, o); g += 2) {
|
|
180
|
+
let m, b = c[g - 1], C = c[g + 1];
|
|
181
|
+
b && (c[g - 1] = void 0);
|
|
182
|
+
let y = !1;
|
|
183
|
+
if (C) {
|
|
184
|
+
let x = C.oldPos - g;
|
|
185
|
+
y = C && 0 <= x && x < a;
|
|
186
|
+
}
|
|
187
|
+
let w = b && b.oldPos + 1 < i;
|
|
188
|
+
if (!y && !w) {
|
|
189
|
+
c[g] = void 0;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (!w || y && b.oldPos < C.oldPos ? m = this.addToPath(C, !0, !1, 0, u) : m = this.addToPath(b, !1, !0, 1, u), F = this.extractCommon(m, t, e, g, u), m.oldPos + 1 >= i && F + 1 >= a) return D(this.buildValues(m.lastComponent, t, e)) || !0;
|
|
193
|
+
c[g] = m, m.oldPos + 1 >= i && (p = Math.min(p, g - 1)), F + 1 >= a && (d = Math.max(d, g + 1));
|
|
194
|
+
}
|
|
195
|
+
o++;
|
|
196
|
+
};
|
|
197
|
+
if (r) (function g() {
|
|
198
|
+
setTimeout(function() {
|
|
199
|
+
if (o > s || Date.now() > f) return r(void 0);
|
|
200
|
+
E() || g();
|
|
201
|
+
}, 0);
|
|
202
|
+
})();
|
|
203
|
+
else for (; o <= s && Date.now() <= f; ) {
|
|
204
|
+
let g = E();
|
|
205
|
+
if (g) return g;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
addToPath(e, t, u, r, n) {
|
|
209
|
+
let D = e.lastComponent;
|
|
210
|
+
return D && !n.oneChangePerToken && D.added === t && D.removed === u ? { oldPos: e.oldPos + r, lastComponent: { count: D.count + 1, added: t, removed: u, previousComponent: D.previousComponent } } : { oldPos: e.oldPos + r, lastComponent: { count: 1, added: t, removed: u, previousComponent: D } };
|
|
211
|
+
}
|
|
212
|
+
extractCommon(e, t, u, r, n) {
|
|
213
|
+
let D = t.length, a = u.length, i = e.oldPos, o = i - r, s = 0;
|
|
214
|
+
for (; o + 1 < D && i + 1 < a && this.equals(u[i + 1], t[o + 1], n); ) o++, i++, s++, n.oneChangePerToken && (e.lastComponent = { count: 1, previousComponent: e.lastComponent, added: !1, removed: !1 });
|
|
215
|
+
return s && !n.oneChangePerToken && (e.lastComponent = { count: s, previousComponent: e.lastComponent, added: !1, removed: !1 }), e.oldPos = i, o;
|
|
216
|
+
}
|
|
217
|
+
equals(e, t, u) {
|
|
218
|
+
return u.comparator ? u.comparator(e, t) : e === t || !!u.ignoreCase && e.toLowerCase() === t.toLowerCase();
|
|
219
|
+
}
|
|
220
|
+
removeEmpty(e) {
|
|
221
|
+
let t = [];
|
|
222
|
+
for (let u = 0; u < e.length; u++) e[u] && t.push(e[u]);
|
|
223
|
+
return t;
|
|
224
|
+
}
|
|
225
|
+
castInput(e, t) {
|
|
226
|
+
return e;
|
|
227
|
+
}
|
|
228
|
+
tokenize(e, t) {
|
|
229
|
+
return Array.from(e);
|
|
230
|
+
}
|
|
231
|
+
join(e) {
|
|
232
|
+
return e.join("");
|
|
233
|
+
}
|
|
234
|
+
postProcess(e, t) {
|
|
235
|
+
return e;
|
|
236
|
+
}
|
|
237
|
+
get useLongestToken() {
|
|
238
|
+
return !1;
|
|
239
|
+
}
|
|
240
|
+
buildValues(e, t, u) {
|
|
241
|
+
let r = [], n;
|
|
242
|
+
for (; e; ) r.push(e), n = e.previousComponent, delete e.previousComponent, e = n;
|
|
243
|
+
r.reverse();
|
|
244
|
+
let D = r.length, a = 0, i = 0, o = 0;
|
|
245
|
+
for (; a < D; a++) {
|
|
246
|
+
let s = r[a];
|
|
247
|
+
if (s.removed) s.value = this.join(u.slice(o, o + s.count)), o += s.count;
|
|
248
|
+
else {
|
|
249
|
+
if (!s.added && this.useLongestToken) {
|
|
250
|
+
let l = t.slice(i, i + s.count);
|
|
251
|
+
l = l.map(function(f, c) {
|
|
252
|
+
let F = u[o + c];
|
|
253
|
+
return F.length > f.length ? F : f;
|
|
254
|
+
}), s.value = this.join(l);
|
|
255
|
+
} else s.value = this.join(t.slice(i, i + s.count));
|
|
256
|
+
i += s.count, s.added || (o += s.count);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return r;
|
|
260
|
+
}
|
|
261
|
+
}, Yu = class extends Gu {
|
|
262
|
+
tokenize(e) {
|
|
263
|
+
return e.slice();
|
|
264
|
+
}
|
|
265
|
+
join(e) {
|
|
266
|
+
return e;
|
|
267
|
+
}
|
|
268
|
+
removeEmpty(e) {
|
|
269
|
+
return e;
|
|
270
|
+
}
|
|
271
|
+
}, Qu = new Yu();
|
|
272
|
+
function Zu(e, t, u) {
|
|
273
|
+
return Qu.diff(e, t, u);
|
|
274
|
+
}
|
|
275
|
+
var er = () => {
|
|
276
|
+
}, tr = er, $t = "cr", Jt = "crlf", ur = "lf", rr = ur, qe = "\r", Rt = `\r
|
|
277
|
+
`, Se = `
|
|
278
|
+
`, nr = Se;
|
|
279
|
+
function Dr(e) {
|
|
280
|
+
let t = e.indexOf(qe);
|
|
281
|
+
return t !== -1 ? e.charAt(t + 1) === Se ? Jt : $t : rr;
|
|
282
|
+
}
|
|
283
|
+
function He(e) {
|
|
284
|
+
return e === $t ? qe : e === Jt ? Rt : nr;
|
|
285
|
+
}
|
|
286
|
+
var ar = /* @__PURE__ */ new Map([[Se, /\n/gu], [qe, /\r/gu], [Rt, /\r\n/gu]]);
|
|
287
|
+
function Mt(e, t) {
|
|
288
|
+
let u = ar.get(t);
|
|
289
|
+
return e.match(u)?.length ?? 0;
|
|
290
|
+
}
|
|
291
|
+
var ir = /\r\n?/gu;
|
|
292
|
+
function or(e) {
|
|
293
|
+
return xe(0, e, ir, Se);
|
|
294
|
+
}
|
|
295
|
+
function sr(e) {
|
|
296
|
+
return this[e < 0 ? this.length + e : e];
|
|
297
|
+
}
|
|
298
|
+
var lr = me("at", function() {
|
|
299
|
+
if (Array.isArray(this) || typeof this == "string") return sr;
|
|
300
|
+
}), S = lr, ie = "string", z = "array", ee = "cursor", X = "indent", U = "align", q = "trim", _ = "group", M = "fill", T = "if-break", H = "indent-if-break", G = "line-suffix", Y = "line-suffix-boundary", I = "line", V = "label", j = "break-parent", Vt = /* @__PURE__ */ new Set([ee, X, U, q, _, M, T, H, G, Y, I, V, j]);
|
|
301
|
+
function cr(e) {
|
|
302
|
+
let t = e.length;
|
|
303
|
+
for (; t > 0 && (e[t - 1] === "\r" || e[t - 1] === `
|
|
304
|
+
`); ) t--;
|
|
305
|
+
return t < e.length ? e.slice(0, t) : e;
|
|
306
|
+
}
|
|
307
|
+
function fr(e) {
|
|
308
|
+
if (typeof e == "string") return ie;
|
|
309
|
+
if (Array.isArray(e)) return z;
|
|
310
|
+
if (!e) return;
|
|
311
|
+
let { type: t } = e;
|
|
312
|
+
if (Vt.has(t)) return t;
|
|
313
|
+
}
|
|
314
|
+
var oe = fr, Fr = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
|
|
315
|
+
function dr(e) {
|
|
316
|
+
let t = e === null ? "null" : typeof e;
|
|
317
|
+
if (t !== "string" && t !== "object") return `Unexpected doc '${t}',
|
|
318
|
+
Expected it to be 'string' or 'object'.`;
|
|
319
|
+
if (oe(e)) throw new Error("doc is valid.");
|
|
320
|
+
let u = Object.prototype.toString.call(e);
|
|
321
|
+
if (u !== "[object Object]") return `Unexpected doc '${u}'.`;
|
|
322
|
+
let r = Fr([...Vt].map((n) => `'${n}'`));
|
|
323
|
+
return `Unexpected doc.type '${e.type}'.
|
|
324
|
+
Expected it to be ${r}.`;
|
|
325
|
+
}
|
|
326
|
+
var pr = class extends Error {
|
|
327
|
+
name = "InvalidDocError";
|
|
328
|
+
constructor(e) {
|
|
329
|
+
super(dr(e)), this.doc = e;
|
|
330
|
+
}
|
|
331
|
+
}, Fe = pr, ft = {};
|
|
332
|
+
function hr(e, t, u, r) {
|
|
333
|
+
let n = [e];
|
|
334
|
+
for (; n.length > 0; ) {
|
|
335
|
+
let D = n.pop();
|
|
336
|
+
if (D === ft) {
|
|
337
|
+
u(n.pop());
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
u && n.push(D, ft);
|
|
341
|
+
let a = oe(D);
|
|
342
|
+
if (!a) throw new Fe(D);
|
|
343
|
+
if (t?.(D) !== !1) switch (a) {
|
|
344
|
+
case z:
|
|
345
|
+
case M: {
|
|
346
|
+
let i = a === z ? D : D.parts;
|
|
347
|
+
for (let o = i.length, s = o - 1; s >= 0; --s) n.push(i[s]);
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
case T:
|
|
351
|
+
n.push(D.flatContents, D.breakContents);
|
|
352
|
+
break;
|
|
353
|
+
case _:
|
|
354
|
+
if (r && D.expandedStates) for (let i = D.expandedStates.length, o = i - 1; o >= 0; --o) n.push(D.expandedStates[o]);
|
|
355
|
+
else n.push(D.contents);
|
|
356
|
+
break;
|
|
357
|
+
case U:
|
|
358
|
+
case X:
|
|
359
|
+
case H:
|
|
360
|
+
case V:
|
|
361
|
+
case G:
|
|
362
|
+
n.push(D.contents);
|
|
363
|
+
break;
|
|
364
|
+
case ie:
|
|
365
|
+
case ee:
|
|
366
|
+
case q:
|
|
367
|
+
case Y:
|
|
368
|
+
case I:
|
|
369
|
+
case j:
|
|
370
|
+
break;
|
|
371
|
+
default:
|
|
372
|
+
throw new Fe(D);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
var Ge = hr;
|
|
377
|
+
function Ie(e, t) {
|
|
378
|
+
if (typeof e == "string") return t(e);
|
|
379
|
+
let u = /* @__PURE__ */ new Map();
|
|
380
|
+
return r(e);
|
|
381
|
+
function r(D) {
|
|
382
|
+
if (u.has(D)) return u.get(D);
|
|
383
|
+
let a = n(D);
|
|
384
|
+
return u.set(D, a), a;
|
|
385
|
+
}
|
|
386
|
+
function n(D) {
|
|
387
|
+
switch (oe(D)) {
|
|
388
|
+
case z:
|
|
389
|
+
return t(D.map(r));
|
|
390
|
+
case M:
|
|
391
|
+
return t({ ...D, parts: D.parts.map(r) });
|
|
392
|
+
case T:
|
|
393
|
+
return t({ ...D, breakContents: r(D.breakContents), flatContents: r(D.flatContents) });
|
|
394
|
+
case _: {
|
|
395
|
+
let { expandedStates: a, contents: i } = D;
|
|
396
|
+
return a ? (a = a.map(r), i = a[0]) : i = r(i), t({ ...D, contents: i, expandedStates: a });
|
|
397
|
+
}
|
|
398
|
+
case U:
|
|
399
|
+
case X:
|
|
400
|
+
case H:
|
|
401
|
+
case V:
|
|
402
|
+
case G:
|
|
403
|
+
return t({ ...D, contents: r(D.contents) });
|
|
404
|
+
case ie:
|
|
405
|
+
case ee:
|
|
406
|
+
case q:
|
|
407
|
+
case Y:
|
|
408
|
+
case I:
|
|
409
|
+
case j:
|
|
410
|
+
return t(D);
|
|
411
|
+
default:
|
|
412
|
+
throw new Fe(D);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function Ye(e, t, u) {
|
|
417
|
+
let r = u, n = !1;
|
|
418
|
+
function D(a) {
|
|
419
|
+
if (n) return !1;
|
|
420
|
+
let i = t(a);
|
|
421
|
+
i !== void 0 && (n = !0, r = i);
|
|
422
|
+
}
|
|
423
|
+
return Ge(e, D), r;
|
|
424
|
+
}
|
|
425
|
+
function Cr(e) {
|
|
426
|
+
if (e.type === _ && e.break || e.type === I && e.hard || e.type === j) return !0;
|
|
427
|
+
}
|
|
428
|
+
function gr(e) {
|
|
429
|
+
return Ye(e, Cr, !1);
|
|
430
|
+
}
|
|
431
|
+
function Ft(e) {
|
|
432
|
+
if (e.length > 0) {
|
|
433
|
+
let t = S(0, e, -1);
|
|
434
|
+
!t.expandedStates && !t.break && (t.break = "propagated");
|
|
435
|
+
}
|
|
436
|
+
return null;
|
|
437
|
+
}
|
|
438
|
+
function Er(e) {
|
|
439
|
+
let t = /* @__PURE__ */ new Set(), u = [];
|
|
440
|
+
function r(D) {
|
|
441
|
+
if (D.type === j && Ft(u), D.type === _) {
|
|
442
|
+
if (u.push(D), t.has(D)) return !1;
|
|
443
|
+
t.add(D);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
function n(D) {
|
|
447
|
+
D.type === _ && u.pop().break && Ft(u);
|
|
448
|
+
}
|
|
449
|
+
Ge(e, r, n, !0);
|
|
450
|
+
}
|
|
451
|
+
function mr(e) {
|
|
452
|
+
return e.type === I && !e.hard ? e.soft ? "" : " " : e.type === T ? e.flatContents : e;
|
|
453
|
+
}
|
|
454
|
+
function yr(e) {
|
|
455
|
+
return Ie(e, mr);
|
|
456
|
+
}
|
|
457
|
+
function dt(e) {
|
|
458
|
+
for (e = [...e]; e.length >= 2 && S(0, e, -2).type === I && S(0, e, -1).type === j; ) e.length -= 2;
|
|
459
|
+
if (e.length > 0) {
|
|
460
|
+
let t = Ce(S(0, e, -1));
|
|
461
|
+
e[e.length - 1] = t;
|
|
462
|
+
}
|
|
463
|
+
return e;
|
|
464
|
+
}
|
|
465
|
+
function Ce(e) {
|
|
466
|
+
switch (oe(e)) {
|
|
467
|
+
case X:
|
|
468
|
+
case H:
|
|
469
|
+
case _:
|
|
470
|
+
case G:
|
|
471
|
+
case V: {
|
|
472
|
+
let t = Ce(e.contents);
|
|
473
|
+
return { ...e, contents: t };
|
|
474
|
+
}
|
|
475
|
+
case T:
|
|
476
|
+
return { ...e, breakContents: Ce(e.breakContents), flatContents: Ce(e.flatContents) };
|
|
477
|
+
case M:
|
|
478
|
+
return { ...e, parts: dt(e.parts) };
|
|
479
|
+
case z:
|
|
480
|
+
return dt(e);
|
|
481
|
+
case ie:
|
|
482
|
+
return cr(e);
|
|
483
|
+
case U:
|
|
484
|
+
case ee:
|
|
485
|
+
case q:
|
|
486
|
+
case Y:
|
|
487
|
+
case I:
|
|
488
|
+
case j:
|
|
489
|
+
break;
|
|
490
|
+
default:
|
|
491
|
+
throw new Fe(e);
|
|
492
|
+
}
|
|
493
|
+
return e;
|
|
494
|
+
}
|
|
495
|
+
function Wt(e) {
|
|
496
|
+
return Ce(Br(e));
|
|
497
|
+
}
|
|
498
|
+
function vr(e) {
|
|
499
|
+
switch (oe(e)) {
|
|
500
|
+
case M:
|
|
501
|
+
if (e.parts.every((t) => t === "")) return "";
|
|
502
|
+
break;
|
|
503
|
+
case _:
|
|
504
|
+
if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
|
|
505
|
+
if (e.contents.type === _ && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates) return e.contents;
|
|
506
|
+
break;
|
|
507
|
+
case U:
|
|
508
|
+
case X:
|
|
509
|
+
case H:
|
|
510
|
+
case G:
|
|
511
|
+
if (!e.contents) return "";
|
|
512
|
+
break;
|
|
513
|
+
case T:
|
|
514
|
+
if (!e.flatContents && !e.breakContents) return "";
|
|
515
|
+
break;
|
|
516
|
+
case z: {
|
|
517
|
+
let t = [];
|
|
518
|
+
for (let u of e) {
|
|
519
|
+
if (!u) continue;
|
|
520
|
+
let [r, ...n] = Array.isArray(u) ? u : [u];
|
|
521
|
+
typeof r == "string" && typeof S(0, t, -1) == "string" ? t[t.length - 1] += r : t.push(r), t.push(...n);
|
|
522
|
+
}
|
|
523
|
+
return t.length === 0 ? "" : t.length === 1 ? t[0] : t;
|
|
524
|
+
}
|
|
525
|
+
case ie:
|
|
526
|
+
case ee:
|
|
527
|
+
case q:
|
|
528
|
+
case Y:
|
|
529
|
+
case I:
|
|
530
|
+
case V:
|
|
531
|
+
case j:
|
|
532
|
+
break;
|
|
533
|
+
default:
|
|
534
|
+
throw new Fe(e);
|
|
535
|
+
}
|
|
536
|
+
return e;
|
|
537
|
+
}
|
|
538
|
+
function Br(e) {
|
|
539
|
+
return Ie(e, (t) => vr(t));
|
|
540
|
+
}
|
|
541
|
+
function br(e, t = Gt) {
|
|
542
|
+
return Ie(e, (u) => typeof u == "string" ? Ut(t, u.split(`
|
|
543
|
+
`)) : u);
|
|
544
|
+
}
|
|
545
|
+
function Ar(e) {
|
|
546
|
+
if (e.type === I) return !0;
|
|
547
|
+
}
|
|
548
|
+
function wr(e) {
|
|
549
|
+
return Ye(e, Ar, !1);
|
|
550
|
+
}
|
|
551
|
+
function Ae(e, t) {
|
|
552
|
+
return e.type === V ? { ...e, contents: t(e.contents) } : t(e);
|
|
553
|
+
}
|
|
554
|
+
var kr = tr;
|
|
555
|
+
function ke(e) {
|
|
556
|
+
return { type: X, contents: e };
|
|
557
|
+
}
|
|
558
|
+
function de(e, t) {
|
|
559
|
+
return { type: U, contents: t, n: e };
|
|
560
|
+
}
|
|
561
|
+
function xr(e) {
|
|
562
|
+
return de(Number.NEGATIVE_INFINITY, e);
|
|
563
|
+
}
|
|
564
|
+
function Kt(e) {
|
|
565
|
+
return de({ type: "root" }, e);
|
|
566
|
+
}
|
|
567
|
+
function Sr(e) {
|
|
568
|
+
return de(-1, e);
|
|
569
|
+
}
|
|
570
|
+
function zt(e, t, u) {
|
|
571
|
+
let r = e;
|
|
572
|
+
if (t > 0) {
|
|
573
|
+
for (let n = 0; n < Math.floor(t / u); ++n) r = ke(r);
|
|
574
|
+
r = de(t % u, r), r = de(Number.NEGATIVE_INFINITY, r);
|
|
575
|
+
}
|
|
576
|
+
return r;
|
|
577
|
+
}
|
|
578
|
+
var Ne = { type: j }, De = { type: ee };
|
|
579
|
+
function Ir(e) {
|
|
580
|
+
return { type: M, parts: e };
|
|
581
|
+
}
|
|
582
|
+
function Xt(e, t = {}) {
|
|
583
|
+
return kr(t.expandedStates), { type: _, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
|
|
584
|
+
}
|
|
585
|
+
function Nr(e, t) {
|
|
586
|
+
return Xt(e[0], { ...t, expandedStates: e });
|
|
587
|
+
}
|
|
588
|
+
function Or(e, t = "", u = {}) {
|
|
589
|
+
return { type: T, breakContents: e, flatContents: t, groupId: u.groupId };
|
|
590
|
+
}
|
|
591
|
+
function _r(e, t) {
|
|
592
|
+
return { type: H, contents: e, groupId: t.groupId, negate: t.negate };
|
|
593
|
+
}
|
|
594
|
+
function Ut(e, t) {
|
|
595
|
+
let u = [];
|
|
596
|
+
for (let r = 0; r < t.length; r++) r !== 0 && u.push(e), u.push(t[r]);
|
|
597
|
+
return u;
|
|
598
|
+
}
|
|
599
|
+
function Tr(e, t) {
|
|
600
|
+
return e ? { type: V, label: e, contents: t } : t;
|
|
601
|
+
}
|
|
602
|
+
var qt = { type: I }, Pr = { type: I, soft: !0 }, Qe = { type: I, hard: !0 }, K = [Qe, Ne], Ht = { type: I, hard: !0, literal: !0 }, Gt = [Ht, Ne];
|
|
603
|
+
function Ve(e) {
|
|
604
|
+
return { type: G, contents: e };
|
|
605
|
+
}
|
|
606
|
+
var jr = { type: Y }, Lr = { type: q };
|
|
607
|
+
function W(e) {
|
|
608
|
+
if (!e) return "";
|
|
609
|
+
if (Array.isArray(e)) {
|
|
610
|
+
let t = [];
|
|
611
|
+
for (let u of e) if (Array.isArray(u)) t.push(...W(u));
|
|
612
|
+
else {
|
|
613
|
+
let r = W(u);
|
|
614
|
+
r !== "" && t.push(r);
|
|
615
|
+
}
|
|
616
|
+
return t;
|
|
617
|
+
}
|
|
618
|
+
return e.type === T ? { ...e, breakContents: W(e.breakContents), flatContents: W(e.flatContents) } : e.type === _ ? { ...e, contents: W(e.contents), expandedStates: e.expandedStates?.map(W) } : e.type === M ? { type: "fill", parts: e.parts.map(W) } : e.contents ? { ...e, contents: W(e.contents) } : e;
|
|
619
|
+
}
|
|
620
|
+
function $r(e) {
|
|
621
|
+
let t = /* @__PURE__ */ Object.create(null), u = /* @__PURE__ */ new Set();
|
|
622
|
+
return r(W(e));
|
|
623
|
+
function r(D, a, i) {
|
|
624
|
+
if (typeof D == "string") return JSON.stringify(D);
|
|
625
|
+
if (Array.isArray(D)) {
|
|
626
|
+
let o = D.map(r).filter(Boolean);
|
|
627
|
+
return o.length === 1 ? o[0] : `[${o.join(", ")}]`;
|
|
628
|
+
}
|
|
629
|
+
if (D.type === I) {
|
|
630
|
+
let o = i?.[a + 1]?.type === j;
|
|
631
|
+
return D.literal ? o ? "literalline" : "literallineWithoutBreakParent" : D.hard ? o ? "hardline" : "hardlineWithoutBreakParent" : D.soft ? "softline" : "line";
|
|
632
|
+
}
|
|
633
|
+
if (D.type === j) return i?.[a - 1]?.type === I && i[a - 1].hard ? void 0 : "breakParent";
|
|
634
|
+
if (D.type === q) return "trim";
|
|
635
|
+
if (D.type === X) return "indent(" + r(D.contents) + ")";
|
|
636
|
+
if (D.type === U) return D.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + r(D.contents) + ")" : D.n < 0 ? "dedent(" + r(D.contents) + ")" : D.n.type === "root" ? "markAsRoot(" + r(D.contents) + ")" : "align(" + JSON.stringify(D.n) + ", " + r(D.contents) + ")";
|
|
637
|
+
if (D.type === T) return "ifBreak(" + r(D.breakContents) + (D.flatContents ? ", " + r(D.flatContents) : "") + (D.groupId ? (D.flatContents ? "" : ', ""') + `, { groupId: ${n(D.groupId)} }` : "") + ")";
|
|
638
|
+
if (D.type === H) {
|
|
639
|
+
let o = [];
|
|
640
|
+
D.negate && o.push("negate: true"), D.groupId && o.push(`groupId: ${n(D.groupId)}`);
|
|
641
|
+
let s = o.length > 0 ? `, { ${o.join(", ")} }` : "";
|
|
642
|
+
return `indentIfBreak(${r(D.contents)}${s})`;
|
|
643
|
+
}
|
|
644
|
+
if (D.type === _) {
|
|
645
|
+
let o = [];
|
|
646
|
+
D.break && D.break !== "propagated" && o.push("shouldBreak: true"), D.id && o.push(`id: ${n(D.id)}`);
|
|
647
|
+
let s = o.length > 0 ? `, { ${o.join(", ")} }` : "";
|
|
648
|
+
return D.expandedStates ? `conditionalGroup([${D.expandedStates.map((l) => r(l)).join(",")}]${s})` : `group(${r(D.contents)}${s})`;
|
|
649
|
+
}
|
|
650
|
+
if (D.type === M) return `fill([${D.parts.map((o) => r(o)).join(", ")}])`;
|
|
651
|
+
if (D.type === G) return "lineSuffix(" + r(D.contents) + ")";
|
|
652
|
+
if (D.type === Y) return "lineSuffixBoundary";
|
|
653
|
+
if (D.type === V) return `label(${JSON.stringify(D.label)}, ${r(D.contents)})`;
|
|
654
|
+
if (D.type === ee) return "cursor";
|
|
655
|
+
throw new Error("Unknown doc type " + D.type);
|
|
656
|
+
}
|
|
657
|
+
function n(D) {
|
|
658
|
+
if (typeof D != "symbol") return JSON.stringify(String(D));
|
|
659
|
+
if (D in t) return t[D];
|
|
660
|
+
let a = D.description || "symbol";
|
|
661
|
+
for (let i = 0; ; i++) {
|
|
662
|
+
let o = a + (i > 0 ? ` #${i}` : "");
|
|
663
|
+
if (!u.has(o)) return u.add(o), t[D] = `Symbol.for(${JSON.stringify(o)})`;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
var Jr = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
668
|
+
function Rr(e) {
|
|
669
|
+
return e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
|
|
670
|
+
}
|
|
671
|
+
function Mr(e) {
|
|
672
|
+
return e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9776 && e <= 9783 || e >= 9800 && e <= 9811 || e === 9855 || e >= 9866 && e <= 9871 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12773 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e >= 94192 && e <= 94198 || e >= 94208 && e <= 101589 || e >= 101631 && e <= 101662 || e >= 101760 && e <= 101874 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e >= 119552 && e <= 119638 || e >= 119648 && e <= 119670 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128728 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129674 || e >= 129678 && e <= 129734 || e === 129736 || e >= 129741 && e <= 129756 || e >= 129759 && e <= 129770 || e >= 129775 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141;
|
|
673
|
+
}
|
|
674
|
+
var Vr = "©®‼⁉™ℹ↔↕↖↗↘↙↩↪⌨⏏⏱⏲⏸⏹⏺▪▫▶◀◻◼☀☁☂☃☄☎☑☘☝☠☢☣☦☪☮☯☸☹☺♀♂♟♠♣♥♦♨♻♾⚒⚔⚕⚖⚗⚙⚛⚜⚠⚧⚰⚱⛈⛏⛑⛓⛩⛱⛷⛸⛹✂✈✉✌✍✏✒✔✖✝✡✳✴❄❇❣❤➡⤴⤵⬅⬆⬇", Wr = /[^\x20-\x7F]/u, Kr = new Set(Vr);
|
|
675
|
+
function zr(e) {
|
|
676
|
+
if (!e) return 0;
|
|
677
|
+
if (!Wr.test(e)) return e.length;
|
|
678
|
+
e = e.replace(Jr(), (u) => Kr.has(u) ? " " : " ");
|
|
679
|
+
let t = 0;
|
|
680
|
+
for (let u of e) {
|
|
681
|
+
let r = u.codePointAt(0);
|
|
682
|
+
r <= 31 || r >= 127 && r <= 159 || r >= 768 && r <= 879 || r >= 65024 && r <= 65039 || (t += Rr(r) || Mr(r) ? 2 : 1);
|
|
683
|
+
}
|
|
684
|
+
return t;
|
|
685
|
+
}
|
|
686
|
+
var Ze = zr, Xr = { type: 0 }, Ur = { type: 1 }, Yt = { value: "", length: 0, queue: [], get root() {
|
|
687
|
+
return Yt;
|
|
688
|
+
} };
|
|
689
|
+
function Qt(e, t, u) {
|
|
690
|
+
let r = t.type === 1 ? e.queue.slice(0, -1) : [...e.queue, t], n = "", D = 0, a = 0, i = 0;
|
|
691
|
+
for (let d of r) switch (d.type) {
|
|
692
|
+
case 0:
|
|
693
|
+
l(), u.useTabs ? o(1) : s(u.tabWidth);
|
|
694
|
+
break;
|
|
695
|
+
case 3: {
|
|
696
|
+
let { string: p } = d;
|
|
697
|
+
l(), n += p, D += p.length;
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
case 2: {
|
|
701
|
+
let { width: p } = d;
|
|
702
|
+
a += 1, i += p;
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
default:
|
|
706
|
+
throw new Error(`Unexpected indent comment '${d.type}'.`);
|
|
707
|
+
}
|
|
708
|
+
return c(), { ...e, value: n, length: D, queue: r };
|
|
709
|
+
function o(d) {
|
|
710
|
+
n += " ".repeat(d), D += u.tabWidth * d;
|
|
711
|
+
}
|
|
712
|
+
function s(d) {
|
|
713
|
+
n += " ".repeat(d), D += d;
|
|
714
|
+
}
|
|
715
|
+
function l() {
|
|
716
|
+
u.useTabs ? f() : c();
|
|
717
|
+
}
|
|
718
|
+
function f() {
|
|
719
|
+
a > 0 && o(a), F();
|
|
720
|
+
}
|
|
721
|
+
function c() {
|
|
722
|
+
i > 0 && s(i), F();
|
|
723
|
+
}
|
|
724
|
+
function F() {
|
|
725
|
+
a = 0, i = 0;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
function qr(e, t, u) {
|
|
729
|
+
if (!t) return e;
|
|
730
|
+
if (t.type === "root") return { ...e, root: e };
|
|
731
|
+
if (t === Number.NEGATIVE_INFINITY) return e.root;
|
|
732
|
+
let r;
|
|
733
|
+
return typeof t == "number" ? t < 0 ? r = Ur : r = { type: 2, width: t } : r = { type: 3, string: t }, Qt(e, r, u);
|
|
734
|
+
}
|
|
735
|
+
function Hr(e, t) {
|
|
736
|
+
return Qt(e, Xr, t);
|
|
737
|
+
}
|
|
738
|
+
function Gr(e) {
|
|
739
|
+
let t = 0;
|
|
740
|
+
for (let u = e.length - 1; u >= 0; u--) {
|
|
741
|
+
let r = e[u];
|
|
742
|
+
if (r === " " || r === " ") t++;
|
|
743
|
+
else break;
|
|
744
|
+
}
|
|
745
|
+
return t;
|
|
746
|
+
}
|
|
747
|
+
function Zt(e) {
|
|
748
|
+
let t = Gr(e);
|
|
749
|
+
return { text: t === 0 ? e : e.slice(0, e.length - t), count: t };
|
|
750
|
+
}
|
|
751
|
+
var O = /* @__PURE__ */ Symbol("MODE_BREAK"), J = /* @__PURE__ */ Symbol("MODE_FLAT"), We = /* @__PURE__ */ Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
752
|
+
function Be(e, t, u, r, n, D) {
|
|
753
|
+
if (u === Number.POSITIVE_INFINITY) return !0;
|
|
754
|
+
let a = t.length, i = !1, o = [e], s = "";
|
|
755
|
+
for (; u >= 0; ) {
|
|
756
|
+
if (o.length === 0) {
|
|
757
|
+
if (a === 0) return !0;
|
|
758
|
+
o.push(t[--a]);
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
761
|
+
let { mode: l, doc: f } = o.pop(), c = oe(f);
|
|
762
|
+
switch (c) {
|
|
763
|
+
case ie:
|
|
764
|
+
f && (i && (s += " ", u -= 1, i = !1), s += f, u -= Ze(f));
|
|
765
|
+
break;
|
|
766
|
+
case z:
|
|
767
|
+
case M: {
|
|
768
|
+
let F = c === z ? f : f.parts, d = f[We] ?? 0;
|
|
769
|
+
for (let p = F.length - 1; p >= d; p--) o.push({ mode: l, doc: F[p] });
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
case X:
|
|
773
|
+
case U:
|
|
774
|
+
case H:
|
|
775
|
+
case V:
|
|
776
|
+
o.push({ mode: l, doc: f.contents });
|
|
777
|
+
break;
|
|
778
|
+
case q: {
|
|
779
|
+
let { text: F, count: d } = Zt(s);
|
|
780
|
+
s = F, u += d;
|
|
781
|
+
break;
|
|
782
|
+
}
|
|
783
|
+
case _: {
|
|
784
|
+
if (D && f.break) return !1;
|
|
785
|
+
let F = f.break ? O : l, d = f.expandedStates && F === O ? S(0, f.expandedStates, -1) : f.contents;
|
|
786
|
+
o.push({ mode: F, doc: d });
|
|
787
|
+
break;
|
|
788
|
+
}
|
|
789
|
+
case T: {
|
|
790
|
+
let F = (f.groupId ? n[f.groupId] || J : l) === O ? f.breakContents : f.flatContents;
|
|
791
|
+
F && o.push({ mode: l, doc: F });
|
|
792
|
+
break;
|
|
793
|
+
}
|
|
794
|
+
case I:
|
|
795
|
+
if (l === O || f.hard) return !0;
|
|
796
|
+
f.soft || (i = !0);
|
|
797
|
+
break;
|
|
798
|
+
case G:
|
|
799
|
+
r = !0;
|
|
800
|
+
break;
|
|
801
|
+
case Y:
|
|
802
|
+
if (r) return !1;
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return !1;
|
|
807
|
+
}
|
|
808
|
+
function Oe(e, t) {
|
|
809
|
+
let u = /* @__PURE__ */ Object.create(null), r = t.printWidth, n = He(t.endOfLine), D = 0, a = [{ indent: Yt, mode: O, doc: e }], i = "", o = !1, s = [], l = [], f = [], c = [], F = 0;
|
|
810
|
+
for (Er(e); a.length > 0; ) {
|
|
811
|
+
let { indent: m, mode: b, doc: C } = a.pop();
|
|
812
|
+
switch (oe(C)) {
|
|
813
|
+
case ie: {
|
|
814
|
+
let y = n !== `
|
|
815
|
+
` ? xe(0, C, `
|
|
816
|
+
`, n) : C;
|
|
817
|
+
y && (i += y, a.length > 0 && (D += Ze(y)));
|
|
818
|
+
break;
|
|
819
|
+
}
|
|
820
|
+
case z:
|
|
821
|
+
for (let y = C.length - 1; y >= 0; y--) a.push({ indent: m, mode: b, doc: C[y] });
|
|
822
|
+
break;
|
|
823
|
+
case ee:
|
|
824
|
+
if (l.length >= 2) throw new Error("There are too many 'cursor' in doc.");
|
|
825
|
+
l.push(F + i.length);
|
|
826
|
+
break;
|
|
827
|
+
case X:
|
|
828
|
+
a.push({ indent: Hr(m, t), mode: b, doc: C.contents });
|
|
829
|
+
break;
|
|
830
|
+
case U:
|
|
831
|
+
a.push({ indent: qr(m, C.n, t), mode: b, doc: C.contents });
|
|
832
|
+
break;
|
|
833
|
+
case q:
|
|
834
|
+
g();
|
|
835
|
+
break;
|
|
836
|
+
case _:
|
|
837
|
+
switch (b) {
|
|
838
|
+
case J:
|
|
839
|
+
if (!o) {
|
|
840
|
+
a.push({ indent: m, mode: C.break ? O : J, doc: C.contents });
|
|
841
|
+
break;
|
|
842
|
+
}
|
|
843
|
+
case O: {
|
|
844
|
+
o = !1;
|
|
845
|
+
let y = { indent: m, mode: J, doc: C.contents }, w = r - D, x = s.length > 0;
|
|
846
|
+
if (!C.break && Be(y, a, w, x, u)) a.push(y);
|
|
847
|
+
else if (C.expandedStates) {
|
|
848
|
+
let L = S(0, C.expandedStates, -1);
|
|
849
|
+
if (C.break) {
|
|
850
|
+
a.push({ indent: m, mode: O, doc: L });
|
|
851
|
+
break;
|
|
852
|
+
} else for (let $ = 1; $ < C.expandedStates.length + 1; $++) if ($ >= C.expandedStates.length) {
|
|
853
|
+
a.push({ indent: m, mode: O, doc: L });
|
|
854
|
+
break;
|
|
855
|
+
} else {
|
|
856
|
+
let v = C.expandedStates[$], B = { indent: m, mode: J, doc: v };
|
|
857
|
+
if (Be(B, a, w, x, u)) {
|
|
858
|
+
a.push(B);
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
} else a.push({ indent: m, mode: O, doc: C.contents });
|
|
863
|
+
break;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
C.id && (u[C.id] = S(0, a, -1).mode);
|
|
867
|
+
break;
|
|
868
|
+
case M: {
|
|
869
|
+
let y = r - D, w = C[We] ?? 0, { parts: x } = C, L = x.length - w;
|
|
870
|
+
if (L === 0) break;
|
|
871
|
+
let $ = x[w + 0], v = x[w + 1], B = { indent: m, mode: J, doc: $ }, se = { indent: m, mode: O, doc: $ }, h = Be(B, [], y, s.length > 0, u, !0);
|
|
872
|
+
if (L === 1) {
|
|
873
|
+
h ? a.push(B) : a.push(se);
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
let P = { indent: m, mode: J, doc: v }, le = { indent: m, mode: O, doc: v };
|
|
877
|
+
if (L === 2) {
|
|
878
|
+
h ? a.push(P, B) : a.push(le, se);
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
let N = x[w + 2], ue = { indent: m, mode: b, doc: { ...C, [We]: w + 2 } }, A = Be({ indent: m, mode: J, doc: [$, v, N] }, [], y, s.length > 0, u, !0);
|
|
882
|
+
a.push(ue), A ? a.push(P, B) : h ? a.push(le, B) : a.push(le, se);
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
case T:
|
|
886
|
+
case H: {
|
|
887
|
+
let y = C.groupId ? u[C.groupId] : b;
|
|
888
|
+
if (y === O) {
|
|
889
|
+
let w = C.type === T ? C.breakContents : C.negate ? C.contents : ke(C.contents);
|
|
890
|
+
w && a.push({ indent: m, mode: b, doc: w });
|
|
891
|
+
}
|
|
892
|
+
if (y === J) {
|
|
893
|
+
let w = C.type === T ? C.flatContents : C.negate ? ke(C.contents) : C.contents;
|
|
894
|
+
w && a.push({ indent: m, mode: b, doc: w });
|
|
895
|
+
}
|
|
896
|
+
break;
|
|
897
|
+
}
|
|
898
|
+
case G:
|
|
899
|
+
s.push({ indent: m, mode: b, doc: C.contents });
|
|
900
|
+
break;
|
|
901
|
+
case Y:
|
|
902
|
+
s.length > 0 && a.push({ indent: m, mode: b, doc: Qe });
|
|
903
|
+
break;
|
|
904
|
+
case I:
|
|
905
|
+
switch (b) {
|
|
906
|
+
case J:
|
|
907
|
+
if (C.hard) o = !0;
|
|
908
|
+
else {
|
|
909
|
+
C.soft || (i += " ", D += 1);
|
|
910
|
+
break;
|
|
911
|
+
}
|
|
912
|
+
case O:
|
|
913
|
+
if (s.length > 0) {
|
|
914
|
+
a.push({ indent: m, mode: b, doc: C }, ...s.reverse()), s.length = 0;
|
|
915
|
+
break;
|
|
916
|
+
}
|
|
917
|
+
C.literal ? (i += n, D = 0, m.root && (m.root.value && (i += m.root.value), D = m.root.length)) : (g(), i += n + m.value, D = m.length);
|
|
918
|
+
break;
|
|
919
|
+
}
|
|
920
|
+
break;
|
|
921
|
+
case V:
|
|
922
|
+
a.push({ indent: m, mode: b, doc: C.contents });
|
|
923
|
+
break;
|
|
924
|
+
case j:
|
|
925
|
+
break;
|
|
926
|
+
default:
|
|
927
|
+
throw new Fe(C);
|
|
928
|
+
}
|
|
929
|
+
a.length === 0 && s.length > 0 && (a.push(...s.reverse()), s.length = 0);
|
|
930
|
+
}
|
|
931
|
+
let d = f.join("") + i, p = [...c, ...l];
|
|
932
|
+
if (p.length !== 2) return { formatted: d };
|
|
933
|
+
let E = p[0];
|
|
934
|
+
return { formatted: d, cursorNodeStart: E, cursorNodeText: d.slice(E, S(0, p, -1)) };
|
|
935
|
+
function g() {
|
|
936
|
+
let { text: m, count: b } = Zt(i);
|
|
937
|
+
m && (f.push(m), F += m.length), i = "", D -= b, l.length > 0 && (c.push(...l.map((C) => Math.min(C, F))), l.length = 0);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function Yr(e, t, u = 0) {
|
|
941
|
+
let r = 0;
|
|
942
|
+
for (let n = u; n < e.length; ++n) e[n] === " " ? r = r + t - r % t : r++;
|
|
943
|
+
return r;
|
|
944
|
+
}
|
|
945
|
+
var et = Yr, Qr = class {
|
|
946
|
+
constructor(e) {
|
|
947
|
+
this.stack = [e];
|
|
948
|
+
}
|
|
949
|
+
get key() {
|
|
950
|
+
let { stack: e, siblings: t } = this;
|
|
951
|
+
return S(0, e, t === null ? -2 : -4) ?? null;
|
|
952
|
+
}
|
|
953
|
+
get index() {
|
|
954
|
+
return this.siblings === null ? null : S(0, this.stack, -2);
|
|
955
|
+
}
|
|
956
|
+
get node() {
|
|
957
|
+
return S(0, this.stack, -1);
|
|
958
|
+
}
|
|
959
|
+
get parent() {
|
|
960
|
+
return this.getNode(1);
|
|
961
|
+
}
|
|
962
|
+
get grandparent() {
|
|
963
|
+
return this.getNode(2);
|
|
964
|
+
}
|
|
965
|
+
get isInArray() {
|
|
966
|
+
return this.siblings !== null;
|
|
967
|
+
}
|
|
968
|
+
get siblings() {
|
|
969
|
+
let { stack: e } = this, t = S(0, e, -3);
|
|
970
|
+
return Array.isArray(t) ? t : null;
|
|
971
|
+
}
|
|
972
|
+
get next() {
|
|
973
|
+
let { siblings: e } = this;
|
|
974
|
+
return e === null ? null : e[this.index + 1];
|
|
975
|
+
}
|
|
976
|
+
get previous() {
|
|
977
|
+
let { siblings: e } = this;
|
|
978
|
+
return e === null ? null : e[this.index - 1];
|
|
979
|
+
}
|
|
980
|
+
get isFirst() {
|
|
981
|
+
return this.index === 0;
|
|
982
|
+
}
|
|
983
|
+
get isLast() {
|
|
984
|
+
let { siblings: e, index: t } = this;
|
|
985
|
+
return e !== null && t === e.length - 1;
|
|
986
|
+
}
|
|
987
|
+
get isRoot() {
|
|
988
|
+
return this.stack.length === 1;
|
|
989
|
+
}
|
|
990
|
+
get root() {
|
|
991
|
+
return this.stack[0];
|
|
992
|
+
}
|
|
993
|
+
get ancestors() {
|
|
994
|
+
return [...this.#e()];
|
|
995
|
+
}
|
|
996
|
+
getName() {
|
|
997
|
+
let { stack: e } = this, { length: t } = e;
|
|
998
|
+
return t > 1 ? S(0, e, -2) : null;
|
|
999
|
+
}
|
|
1000
|
+
getValue() {
|
|
1001
|
+
return S(0, this.stack, -1);
|
|
1002
|
+
}
|
|
1003
|
+
getNode(e = 0) {
|
|
1004
|
+
let t = this.#t(e);
|
|
1005
|
+
return t === -1 ? null : this.stack[t];
|
|
1006
|
+
}
|
|
1007
|
+
getParentNode(e = 0) {
|
|
1008
|
+
return this.getNode(e + 1);
|
|
1009
|
+
}
|
|
1010
|
+
#t(e) {
|
|
1011
|
+
let { stack: t } = this;
|
|
1012
|
+
for (let u = t.length - 1; u >= 0; u -= 2) if (!Array.isArray(t[u]) && --e < 0) return u;
|
|
1013
|
+
return -1;
|
|
1014
|
+
}
|
|
1015
|
+
call(e, ...t) {
|
|
1016
|
+
let { stack: u } = this, { length: r } = u, n = S(0, u, -1);
|
|
1017
|
+
for (let D of t) n = n?.[D], u.push(D, n);
|
|
1018
|
+
try {
|
|
1019
|
+
return e(this);
|
|
1020
|
+
} finally {
|
|
1021
|
+
u.length = r;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
callParent(e, t = 0) {
|
|
1025
|
+
let u = this.#t(t + 1), r = this.stack.splice(u + 1);
|
|
1026
|
+
try {
|
|
1027
|
+
return e(this);
|
|
1028
|
+
} finally {
|
|
1029
|
+
this.stack.push(...r);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
each(e, ...t) {
|
|
1033
|
+
let { stack: u } = this, { length: r } = u, n = S(0, u, -1);
|
|
1034
|
+
for (let D of t) n = n[D], u.push(D, n);
|
|
1035
|
+
try {
|
|
1036
|
+
for (let D = 0; D < n.length; ++D) u.push(D, n[D]), e(this, D, n), u.length -= 2;
|
|
1037
|
+
} finally {
|
|
1038
|
+
u.length = r;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
map(e, ...t) {
|
|
1042
|
+
let u = [];
|
|
1043
|
+
return this.each((r, n, D) => {
|
|
1044
|
+
u[n] = e(r, n, D);
|
|
1045
|
+
}, ...t), u;
|
|
1046
|
+
}
|
|
1047
|
+
match(...e) {
|
|
1048
|
+
let t = this.stack.length - 1, u = null, r = this.stack[t--];
|
|
1049
|
+
for (let n of e) {
|
|
1050
|
+
if (r === void 0) return !1;
|
|
1051
|
+
let D = null;
|
|
1052
|
+
if (typeof u == "number" && (D = u, u = this.stack[t--], r = this.stack[t--]), n && !n(r, u, D)) return !1;
|
|
1053
|
+
u = this.stack[t--], r = this.stack[t--];
|
|
1054
|
+
}
|
|
1055
|
+
return !0;
|
|
1056
|
+
}
|
|
1057
|
+
findAncestor(e) {
|
|
1058
|
+
for (let t of this.#e()) if (e(t)) return t;
|
|
1059
|
+
}
|
|
1060
|
+
hasAncestor(e) {
|
|
1061
|
+
for (let t of this.#e()) if (e(t)) return !0;
|
|
1062
|
+
return !1;
|
|
1063
|
+
}
|
|
1064
|
+
*#e() {
|
|
1065
|
+
let { stack: e } = this;
|
|
1066
|
+
for (let t = e.length - 3; t >= 0; t -= 2) {
|
|
1067
|
+
let u = e[t];
|
|
1068
|
+
Array.isArray(u) || (yield u);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}, Zr = Qr;
|
|
1072
|
+
function en(e) {
|
|
1073
|
+
return e !== null && typeof e == "object";
|
|
1074
|
+
}
|
|
1075
|
+
var tt = en;
|
|
1076
|
+
function ye(e) {
|
|
1077
|
+
return (t, u, r) => {
|
|
1078
|
+
let n = !!r?.backwards;
|
|
1079
|
+
if (u === !1) return !1;
|
|
1080
|
+
let { length: D } = t, a = u;
|
|
1081
|
+
for (; a >= 0 && a < D; ) {
|
|
1082
|
+
let i = t.charAt(a);
|
|
1083
|
+
if (e instanceof RegExp) {
|
|
1084
|
+
if (!e.test(i)) return a;
|
|
1085
|
+
} else if (!e.includes(i)) return a;
|
|
1086
|
+
n ? a-- : a++;
|
|
1087
|
+
}
|
|
1088
|
+
return a === -1 || a === D ? a : !1;
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
var tn = ye(/\s/u), Z = ye(" "), eu = ye(",; "), tu = ye(/[^\n\r]/u), pt = (e) => e === `
|
|
1092
|
+
` || e === "\r" || e === "\u2028" || e === "\u2029";
|
|
1093
|
+
function un(e, t, u) {
|
|
1094
|
+
let r = !!u?.backwards;
|
|
1095
|
+
if (t === !1) return !1;
|
|
1096
|
+
let n = e.charAt(t);
|
|
1097
|
+
if (r) {
|
|
1098
|
+
if (e.charAt(t - 1) === "\r" && n === `
|
|
1099
|
+
`) return t - 2;
|
|
1100
|
+
if (pt(n)) return t - 1;
|
|
1101
|
+
} else {
|
|
1102
|
+
if (n === "\r" && e.charAt(t + 1) === `
|
|
1103
|
+
`) return t + 2;
|
|
1104
|
+
if (pt(n)) return t + 1;
|
|
1105
|
+
}
|
|
1106
|
+
return t;
|
|
1107
|
+
}
|
|
1108
|
+
var ae = un;
|
|
1109
|
+
function rn(e, t, u = {}) {
|
|
1110
|
+
let r = Z(e, u.backwards ? t - 1 : t, u), n = ae(e, r, u);
|
|
1111
|
+
return r !== n;
|
|
1112
|
+
}
|
|
1113
|
+
var Q = rn;
|
|
1114
|
+
function nn(e) {
|
|
1115
|
+
return Array.isArray(e) && e.length > 0;
|
|
1116
|
+
}
|
|
1117
|
+
var Dn = nn;
|
|
1118
|
+
function* _e(e, t) {
|
|
1119
|
+
let { getVisitorKeys: u, filter: r = () => !0 } = t, n = (D) => tt(D) && r(D);
|
|
1120
|
+
for (let D of u(e)) {
|
|
1121
|
+
let a = e[D];
|
|
1122
|
+
if (Array.isArray(a)) for (let i of a) n(i) && (yield i);
|
|
1123
|
+
else n(a) && (yield a);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
function* an(e, t) {
|
|
1127
|
+
let u = [e];
|
|
1128
|
+
for (let r = 0; r < u.length; r++) {
|
|
1129
|
+
let n = u[r];
|
|
1130
|
+
for (let D of _e(n, t)) yield D, u.push(D);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
function on(e, t) {
|
|
1134
|
+
return _e(e, t).next().done;
|
|
1135
|
+
}
|
|
1136
|
+
function uu(e, t, u) {
|
|
1137
|
+
let { cache: r } = u;
|
|
1138
|
+
if (r.has(e)) return r.get(e);
|
|
1139
|
+
let { filter: n } = u;
|
|
1140
|
+
if (!n) return [];
|
|
1141
|
+
let D, a = (u.getChildren?.(e, u) ?? [..._e(e, { getVisitorKeys: u.getVisitorKeys })]).flatMap((s) => (D ?? (D = [e, ...t]), n(s, D) ? [s] : uu(s, D, u))), { locStart: i, locEnd: o } = u;
|
|
1142
|
+
return a.sort((s, l) => i(s) - i(l) || o(s) - o(l)), r.set(e, a), a;
|
|
1143
|
+
}
|
|
1144
|
+
var ru = uu;
|
|
1145
|
+
function sn(e) {
|
|
1146
|
+
let t = e.type || e.kind || "(unknown type)", u = String(e.name || e.id && (typeof e.id == "object" ? e.id.name : e.id) || e.key && (typeof e.key == "object" ? e.key.name : e.key) || e.value && (typeof e.value == "object" ? "" : String(e.value)) || e.operator || "");
|
|
1147
|
+
return u.length > 20 && (u = u.slice(0, 19) + "…"), t + (u ? " " + u : "");
|
|
1148
|
+
}
|
|
1149
|
+
function ut(e, t) {
|
|
1150
|
+
(e.comments ?? (e.comments = [])).push(t), t.printed = !1, t.nodeDescription = sn(e);
|
|
1151
|
+
}
|
|
1152
|
+
function ge(e, t) {
|
|
1153
|
+
t.leading = !0, t.trailing = !1, ut(e, t);
|
|
1154
|
+
}
|
|
1155
|
+
function re(e, t, u) {
|
|
1156
|
+
t.leading = !1, t.trailing = !1, u && (t.marker = u), ut(e, t);
|
|
1157
|
+
}
|
|
1158
|
+
function Ee(e, t) {
|
|
1159
|
+
t.leading = !1, t.trailing = !0, ut(e, t);
|
|
1160
|
+
}
|
|
1161
|
+
var nu = /* @__PURE__ */ new WeakMap();
|
|
1162
|
+
function Du(e, t, u, r, n = []) {
|
|
1163
|
+
let { locStart: D, locEnd: a } = u, i = D(t), o = a(t), s = ru(e, n, { cache: nu, locStart: D, locEnd: a, getVisitorKeys: u.getVisitorKeys, filter: u.printer.canAttachComment, getChildren: u.printer.getCommentChildNodes }), l, f, c = 0, F = s.length;
|
|
1164
|
+
for (; c < F; ) {
|
|
1165
|
+
let d = c + F >> 1, p = s[d], E = D(p), g = a(p);
|
|
1166
|
+
if (E <= i && o <= g) return Du(p, t, u, p, [p, ...n]);
|
|
1167
|
+
if (g <= i) {
|
|
1168
|
+
l = p, c = d + 1;
|
|
1169
|
+
continue;
|
|
1170
|
+
}
|
|
1171
|
+
if (o <= E) {
|
|
1172
|
+
f = p, F = d;
|
|
1173
|
+
continue;
|
|
1174
|
+
}
|
|
1175
|
+
throw new Error("Comment location overlaps with node location");
|
|
1176
|
+
}
|
|
1177
|
+
if (r?.type === "TemplateLiteral") {
|
|
1178
|
+
let { quasis: d } = r, p = je(d, t, u);
|
|
1179
|
+
l && je(d, l, u) !== p && (l = null), f && je(d, f, u) !== p && (f = null);
|
|
1180
|
+
}
|
|
1181
|
+
return { enclosingNode: r, precedingNode: l, followingNode: f };
|
|
1182
|
+
}
|
|
1183
|
+
var Pe = () => !1;
|
|
1184
|
+
function ln(e, t) {
|
|
1185
|
+
let { comments: u } = e;
|
|
1186
|
+
if (delete e.comments, !Dn(u) || !t.printer.canAttachComment) return;
|
|
1187
|
+
let r = [], { printer: { features: { experimental_avoidAstMutation: n }, handleComments: D = {} }, originalText: a } = t, { ownLine: i = Pe, endOfLine: o = Pe, remaining: s = Pe } = D, l = u.map((f, c) => ({ ...Du(e, f, t), comment: f, text: a, options: t, ast: e, isLastComment: u.length - 1 === c }));
|
|
1188
|
+
for (let [f, c] of l.entries()) {
|
|
1189
|
+
let { comment: F, precedingNode: d, enclosingNode: p, followingNode: E, text: g, options: m, ast: b, isLastComment: C } = c, y;
|
|
1190
|
+
if (n ? y = [c] : (F.enclosingNode = p, F.precedingNode = d, F.followingNode = E, y = [F, g, m, b, C]), cn(g, m, l, f)) F.placement = "ownLine", i(...y) || (E ? ge(E, F) : d ? Ee(d, F) : re(p || b, F));
|
|
1191
|
+
else if (fn(g, m, l, f)) F.placement = "endOfLine", o(...y) || (d ? Ee(d, F) : E ? ge(E, F) : re(p || b, F));
|
|
1192
|
+
else if (F.placement = "remaining", !s(...y)) if (d && E) {
|
|
1193
|
+
let w = r.length;
|
|
1194
|
+
w > 0 && r[w - 1].followingNode !== E && ht(r, m), r.push(c);
|
|
1195
|
+
} else d ? Ee(d, F) : E ? ge(E, F) : re(p || b, F);
|
|
1196
|
+
}
|
|
1197
|
+
if (ht(r, t), !n) for (let f of u) delete f.precedingNode, delete f.enclosingNode, delete f.followingNode;
|
|
1198
|
+
}
|
|
1199
|
+
var au = (e) => !/[\S\n\u2028\u2029]/u.test(e);
|
|
1200
|
+
function cn(e, t, u, r) {
|
|
1201
|
+
let { comment: n, precedingNode: D } = u[r], { locStart: a, locEnd: i } = t, o = a(n);
|
|
1202
|
+
if (D) for (let s = r - 1; s >= 0; s--) {
|
|
1203
|
+
let { comment: l, precedingNode: f } = u[s];
|
|
1204
|
+
if (f !== D || !au(e.slice(i(l), o))) break;
|
|
1205
|
+
o = a(l);
|
|
1206
|
+
}
|
|
1207
|
+
return Q(e, o, { backwards: !0 });
|
|
1208
|
+
}
|
|
1209
|
+
function fn(e, t, u, r) {
|
|
1210
|
+
let { comment: n, followingNode: D } = u[r], { locStart: a, locEnd: i } = t, o = i(n);
|
|
1211
|
+
if (D) for (let s = r + 1; s < u.length; s++) {
|
|
1212
|
+
let { comment: l, followingNode: f } = u[s];
|
|
1213
|
+
if (f !== D || !au(e.slice(o, a(l)))) break;
|
|
1214
|
+
o = i(l);
|
|
1215
|
+
}
|
|
1216
|
+
return Q(e, o);
|
|
1217
|
+
}
|
|
1218
|
+
function ht(e, t) {
|
|
1219
|
+
let u = e.length;
|
|
1220
|
+
if (u === 0) return;
|
|
1221
|
+
let { precedingNode: r, followingNode: n } = e[0], D = t.locStart(n), a;
|
|
1222
|
+
for (a = u; a > 0; --a) {
|
|
1223
|
+
let { comment: i, precedingNode: o, followingNode: s } = e[a - 1], l = t.originalText.slice(t.locEnd(i), D);
|
|
1224
|
+
if (t.printer.isGap?.(l, t) ?? /^[\s(]*$/u.test(l)) D = t.locStart(i);
|
|
1225
|
+
else break;
|
|
1226
|
+
}
|
|
1227
|
+
for (let [i, { comment: o }] of e.entries()) i < a ? Ee(r, o) : ge(n, o);
|
|
1228
|
+
for (let i of [r, n]) i.comments && i.comments.length > 1 && i.comments.sort((o, s) => t.locStart(o) - t.locStart(s));
|
|
1229
|
+
e.length = 0;
|
|
1230
|
+
}
|
|
1231
|
+
function je(e, t, u) {
|
|
1232
|
+
let r = u.locStart(t) - 1;
|
|
1233
|
+
for (let n = 1; n < e.length; ++n) if (r < u.locStart(e[n])) return n - 1;
|
|
1234
|
+
return 0;
|
|
1235
|
+
}
|
|
1236
|
+
function Fn(e, t) {
|
|
1237
|
+
let u = t - 1;
|
|
1238
|
+
u = Z(e, u, { backwards: !0 }), u = ae(e, u, { backwards: !0 }), u = Z(e, u, { backwards: !0 });
|
|
1239
|
+
let r = ae(e, u, { backwards: !0 });
|
|
1240
|
+
return u !== r;
|
|
1241
|
+
}
|
|
1242
|
+
var rt = Fn;
|
|
1243
|
+
function iu(e, t) {
|
|
1244
|
+
let u = e.node;
|
|
1245
|
+
return u.printed = !0, t.printer.printComment(e, t);
|
|
1246
|
+
}
|
|
1247
|
+
function dn(e, t) {
|
|
1248
|
+
let u = e.node, r = [iu(e, t)], { printer: n, originalText: D, locStart: a, locEnd: i } = t;
|
|
1249
|
+
if (n.isBlockComment?.(u)) {
|
|
1250
|
+
let s = Q(D, i(u)) ? Q(D, a(u), { backwards: !0 }) ? K : qt : " ";
|
|
1251
|
+
r.push(s);
|
|
1252
|
+
} else r.push(K);
|
|
1253
|
+
let o = ae(D, Z(D, i(u)));
|
|
1254
|
+
return o !== !1 && Q(D, o) && r.push(K), r;
|
|
1255
|
+
}
|
|
1256
|
+
function pn(e, t, u) {
|
|
1257
|
+
let r = e.node, n = iu(e, t), { printer: D, originalText: a, locStart: i } = t, o = D.isBlockComment?.(r);
|
|
1258
|
+
if (u?.hasLineSuffix && !u?.isBlock || Q(a, i(r), { backwards: !0 })) {
|
|
1259
|
+
let s = rt(a, i(r));
|
|
1260
|
+
return { doc: Ve([K, s ? K : "", n]), isBlock: o, hasLineSuffix: !0 };
|
|
1261
|
+
}
|
|
1262
|
+
return !o || u?.hasLineSuffix ? { doc: [Ve([" ", n]), Ne], isBlock: o, hasLineSuffix: !0 } : { doc: [" ", n], isBlock: o, hasLineSuffix: !1 };
|
|
1263
|
+
}
|
|
1264
|
+
function hn(e, t) {
|
|
1265
|
+
let u = e.node;
|
|
1266
|
+
if (!u) return {};
|
|
1267
|
+
let r = t[/* @__PURE__ */ Symbol.for("printedComments")];
|
|
1268
|
+
if ((u.comments || []).filter((i) => !r.has(i)).length === 0) return { leading: "", trailing: "" };
|
|
1269
|
+
let n = [], D = [], a;
|
|
1270
|
+
return e.each(() => {
|
|
1271
|
+
let i = e.node;
|
|
1272
|
+
if (r?.has(i)) return;
|
|
1273
|
+
let { leading: o, trailing: s } = i;
|
|
1274
|
+
o ? n.push(dn(e, t)) : s && (a = pn(e, t, a), D.push(a.doc));
|
|
1275
|
+
}, "comments"), { leading: n, trailing: D };
|
|
1276
|
+
}
|
|
1277
|
+
function Cn(e, t, u) {
|
|
1278
|
+
let { leading: r, trailing: n } = hn(e, u);
|
|
1279
|
+
return !r && !n ? t : Ae(t, (D) => [r, D, n]);
|
|
1280
|
+
}
|
|
1281
|
+
function gn(e) {
|
|
1282
|
+
let { [/* @__PURE__ */ Symbol.for("comments")]: t, [/* @__PURE__ */ Symbol.for("printedComments")]: u } = e;
|
|
1283
|
+
for (let r of t) {
|
|
1284
|
+
if (!r.printed && !u.has(r)) throw new Error('Comment "' + r.value.trim() + '" was not printed. Please report this error!');
|
|
1285
|
+
delete r.printed;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
var ou = class extends Error {
|
|
1289
|
+
name = "ConfigError";
|
|
1290
|
+
}, Ct = class extends Error {
|
|
1291
|
+
name = "UndefinedParserError";
|
|
1292
|
+
}, En = { checkIgnorePragma: { category: "Special", type: "boolean", default: !1, description: "Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.", cliCategory: "Other" }, cursorOffset: { category: "Special", type: "int", default: -1, range: { start: -1, end: 1 / 0, step: 1 }, description: "Print (to stderr) where a cursor at the given position would move to after formatting.", cliCategory: "Editor" }, endOfLine: { category: "Global", type: "choice", default: "lf", description: "Which end of line characters to apply.", choices: [{ value: "lf", description: "Line Feed only (\\n), common on Linux and macOS as well as inside git repos" }, { value: "crlf", description: "Carriage Return + Line Feed characters (\\r\\n), common on Windows" }, { value: "cr", description: "Carriage Return character only (\\r), used very rarely" }, { value: "auto", description: `Maintain existing
|
|
1293
|
+
(mixed values within one file are normalised by looking at what's used after the first line)` }] }, filepath: { category: "Special", type: "path", description: "Specify the input filepath. This will be used to do parser inference.", cliName: "stdin-filepath", cliCategory: "Other", cliDescription: "Path to the file to pretend that stdin comes from." }, insertPragma: { category: "Special", type: "boolean", default: !1, description: "Insert @format pragma into file's first docblock comment.", cliCategory: "Other" }, parser: { category: "Global", type: "choice", default: void 0, description: "Which parser to use.", exception: (e) => typeof e == "string" || typeof e == "function", choices: [{ value: "flow", description: "Flow" }, { value: "babel", description: "JavaScript" }, { value: "babel-flow", description: "Flow" }, { value: "babel-ts", description: "TypeScript" }, { value: "typescript", description: "TypeScript" }, { value: "acorn", description: "JavaScript" }, { value: "espree", description: "JavaScript" }, { value: "meriyah", description: "JavaScript" }, { value: "css", description: "CSS" }, { value: "less", description: "Less" }, { value: "scss", description: "SCSS" }, { value: "json", description: "JSON" }, { value: "json5", description: "JSON5" }, { value: "jsonc", description: "JSON with Comments" }, { value: "json-stringify", description: "JSON.stringify" }, { value: "graphql", description: "GraphQL" }, { value: "markdown", description: "Markdown" }, { value: "mdx", description: "MDX" }, { value: "vue", description: "Vue" }, { value: "yaml", description: "YAML" }, { value: "glimmer", description: "Ember / Handlebars" }, { value: "html", description: "HTML" }, { value: "angular", description: "Angular" }, { value: "lwc", description: "Lightning Web Components" }, { value: "mjml", description: "MJML" }] }, plugins: { type: "path", array: !0, default: [{ value: [] }], category: "Global", description: "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.", exception: (e) => typeof e == "string" || typeof e == "object", cliName: "plugin", cliCategory: "Config" }, printWidth: { category: "Global", type: "int", default: 80, description: "The line length where Prettier will try wrap.", range: { start: 0, end: 1 / 0, step: 1 } }, rangeEnd: { category: "Special", type: "int", default: 1 / 0, range: { start: 0, end: 1 / 0, step: 1 }, description: `Format code ending at a given character offset (exclusive).
|
|
1294
|
+
The range will extend forwards to the end of the selected statement.`, cliCategory: "Editor" }, rangeStart: { category: "Special", type: "int", default: 0, range: { start: 0, end: 1 / 0, step: 1 }, description: `Format code starting at a given character offset.
|
|
1295
|
+
The range will extend backwards to the start of the first line containing the selected statement.`, cliCategory: "Editor" }, requirePragma: { category: "Special", type: "boolean", default: !1, description: "Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.", cliCategory: "Other" }, tabWidth: { type: "int", category: "Global", default: 2, description: "Number of spaces per indentation level.", range: { start: 0, end: 1 / 0, step: 1 } }, useTabs: { category: "Global", type: "boolean", default: !1, description: "Indent with tabs instead of spaces." }, embeddedLanguageFormatting: { category: "Global", type: "choice", default: "auto", description: "Control how Prettier formats quoted code embedded in the file.", choices: [{ value: "auto", description: "Format embedded code if Prettier can automatically identify it." }, { value: "off", description: "Never automatically format embedded code." }] } };
|
|
1296
|
+
function su({ plugins: e = [], showDeprecated: t = !1 } = {}) {
|
|
1297
|
+
let u = e.flatMap((n) => n.languages ?? []), r = [];
|
|
1298
|
+
for (let n of yn(Object.assign({}, ...e.map(({ options: D }) => D), En))) !t && n.deprecated || (Array.isArray(n.choices) && (t || (n.choices = n.choices.filter((D) => !D.deprecated)), n.name === "parser" && (n.choices = [...n.choices, ...mn(n.choices, u, e)])), n.pluginDefaults = Object.fromEntries(e.filter((D) => D.defaultOptions?.[n.name] !== void 0).map((D) => [D.name, D.defaultOptions[n.name]])), r.push(n));
|
|
1299
|
+
return { languages: u, options: r };
|
|
1300
|
+
}
|
|
1301
|
+
function* mn(e, t, u) {
|
|
1302
|
+
let r = new Set(e.map((n) => n.value));
|
|
1303
|
+
for (let n of t) if (n.parsers) {
|
|
1304
|
+
for (let D of n.parsers) if (!r.has(D)) {
|
|
1305
|
+
r.add(D);
|
|
1306
|
+
let a = u.find((o) => o.parsers && Object.prototype.hasOwnProperty.call(o.parsers, D)), i = n.name;
|
|
1307
|
+
a?.name && (i += ` (plugin: ${a.name})`), yield { value: D, description: i };
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
function yn(e) {
|
|
1312
|
+
let t = [];
|
|
1313
|
+
for (let [u, r] of Object.entries(e)) {
|
|
1314
|
+
let n = { name: u, ...r };
|
|
1315
|
+
Array.isArray(n.default) && (n.default = S(0, n.default, -1).value), t.push(n);
|
|
1316
|
+
}
|
|
1317
|
+
return t;
|
|
1318
|
+
}
|
|
1319
|
+
var vn = Array.prototype.toReversed ?? function() {
|
|
1320
|
+
return [...this].reverse();
|
|
1321
|
+
}, Bn = me("toReversed", function() {
|
|
1322
|
+
if (Array.isArray(this)) return vn;
|
|
1323
|
+
}), bn = Bn;
|
|
1324
|
+
function An() {
|
|
1325
|
+
let e = globalThis, t = e.Deno?.build?.os;
|
|
1326
|
+
return typeof t == "string" ? t === "windows" : e.navigator?.platform?.startsWith("Win") ?? e.process?.platform?.startsWith("win") ?? !1;
|
|
1327
|
+
}
|
|
1328
|
+
var wn = An();
|
|
1329
|
+
function lu(e) {
|
|
1330
|
+
if (e = e instanceof URL ? e : new URL(e), e.protocol !== "file:") throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);
|
|
1331
|
+
return e;
|
|
1332
|
+
}
|
|
1333
|
+
function kn(e) {
|
|
1334
|
+
return e = lu(e), decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
|
|
1335
|
+
}
|
|
1336
|
+
function xn(e) {
|
|
1337
|
+
e = lu(e);
|
|
1338
|
+
let t = decodeURIComponent(e.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
|
|
1339
|
+
return e.hostname !== "" && (t = `\\\\${e.hostname}${t}`), t;
|
|
1340
|
+
}
|
|
1341
|
+
function Sn(e) {
|
|
1342
|
+
return wn ? xn(e) : kn(e);
|
|
1343
|
+
}
|
|
1344
|
+
var In = (e) => String(e).split(/[/\\]/u).pop(), Nn = (e) => String(e).startsWith("file:");
|
|
1345
|
+
function gt(e, t) {
|
|
1346
|
+
if (!t) return;
|
|
1347
|
+
let u = In(t).toLowerCase();
|
|
1348
|
+
return e.find(({ filenames: r }) => r?.some((n) => n.toLowerCase() === u)) ?? e.find(({ extensions: r }) => r?.some((n) => u.endsWith(n)));
|
|
1349
|
+
}
|
|
1350
|
+
function On(e, t) {
|
|
1351
|
+
if (t) return e.find(({ name: u }) => u.toLowerCase() === t) ?? e.find(({ aliases: u }) => u?.includes(t)) ?? e.find(({ extensions: u }) => u?.includes(`.${t}`));
|
|
1352
|
+
}
|
|
1353
|
+
var _n = void 0;
|
|
1354
|
+
function Et(e, t) {
|
|
1355
|
+
if (t) {
|
|
1356
|
+
if (Nn(t)) try {
|
|
1357
|
+
t = Sn(t);
|
|
1358
|
+
} catch {
|
|
1359
|
+
return;
|
|
1360
|
+
}
|
|
1361
|
+
if (typeof t == "string") return e.find(({ isSupported: u }) => u?.({ filepath: t }));
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
function Tn(e, t) {
|
|
1365
|
+
let u = bn(0, e.plugins).flatMap((r) => r.languages ?? []);
|
|
1366
|
+
return (On(u, t.language) ?? gt(u, t.physicalFile) ?? gt(u, t.file) ?? Et(u, t.physicalFile) ?? Et(u, t.file) ?? _n?.(u, t.physicalFile))?.parsers[0];
|
|
1367
|
+
}
|
|
1368
|
+
var cu = Tn, fe = { key: (e) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e) ? e : JSON.stringify(e), value(e) {
|
|
1369
|
+
if (e === null || typeof e != "object") return JSON.stringify(e);
|
|
1370
|
+
if (Array.isArray(e)) return `[${e.map((u) => fe.value(u)).join(", ")}]`;
|
|
1371
|
+
let t = Object.keys(e);
|
|
1372
|
+
return t.length === 0 ? "{}" : `{ ${t.map((u) => `${fe.key(u)}: ${fe.value(e[u])}`).join(", ")} }`;
|
|
1373
|
+
}, pair: ({ key: e, value: t }) => fe.value({ [e]: t }) }, nt = new Proxy(String, { get: () => nt }), R = nt, fu = () => nt, Pn = (e, t, { descriptor: u }) => {
|
|
1374
|
+
let r = [`${R.yellow(typeof e == "string" ? u.key(e) : u.pair(e))} is deprecated`];
|
|
1375
|
+
return t && r.push(`we now treat it as ${R.blue(typeof t == "string" ? u.key(t) : u.pair(t))}`), r.join("; ") + ".";
|
|
1376
|
+
}, Fu = /* @__PURE__ */ Symbol.for("vnopts.VALUE_NOT_EXIST"), we = /* @__PURE__ */ Symbol.for("vnopts.VALUE_UNCHANGED"), mt = " ".repeat(2), jn = (e, t, u) => {
|
|
1377
|
+
let { text: r, list: n } = u.normalizeExpectedResult(u.schemas[e].expected(u)), D = [];
|
|
1378
|
+
return r && D.push(yt(e, t, r, u.descriptor)), n && D.push([yt(e, t, n.title, u.descriptor)].concat(n.values.map((a) => du(a, u.loggerPrintWidth))).join(`
|
|
1379
|
+
`)), pu(D, u.loggerPrintWidth);
|
|
1380
|
+
};
|
|
1381
|
+
function yt(e, t, u, r) {
|
|
1382
|
+
return [`Invalid ${R.red(r.key(e))} value.`, `Expected ${R.blue(u)},`, `but received ${t === Fu ? R.gray("nothing") : R.red(r.value(t))}.`].join(" ");
|
|
1383
|
+
}
|
|
1384
|
+
function du({ text: e, list: t }, u) {
|
|
1385
|
+
let r = [];
|
|
1386
|
+
return e && r.push(`- ${R.blue(e)}`), t && r.push([`- ${R.blue(t.title)}:`].concat(t.values.map((n) => du(n, u - mt.length).replace(/^|\n/g, `$&${mt}`))).join(`
|
|
1387
|
+
`)), pu(r, u);
|
|
1388
|
+
}
|
|
1389
|
+
function pu(e, t) {
|
|
1390
|
+
if (e.length === 1) return e[0];
|
|
1391
|
+
let [u, r] = e, [n, D] = e.map((a) => a.split(`
|
|
1392
|
+
`, 1)[0].length);
|
|
1393
|
+
return n > t && n > D ? r : u;
|
|
1394
|
+
}
|
|
1395
|
+
var ce = [], Le = [];
|
|
1396
|
+
function $e(e, t, u) {
|
|
1397
|
+
if (e === t) return 0;
|
|
1398
|
+
let r = u?.maxDistance, n = e;
|
|
1399
|
+
e.length > t.length && (e = t, t = n);
|
|
1400
|
+
let D = e.length, a = t.length;
|
|
1401
|
+
for (; D > 0 && e.charCodeAt(~-D) === t.charCodeAt(~-a); ) D--, a--;
|
|
1402
|
+
let i = 0;
|
|
1403
|
+
for (; i < D && e.charCodeAt(i) === t.charCodeAt(i); ) i++;
|
|
1404
|
+
if (D -= i, a -= i, r !== void 0 && a - D > r) return r;
|
|
1405
|
+
if (D === 0) return r !== void 0 && a > r ? r : a;
|
|
1406
|
+
let o, s, l, f, c = 0, F = 0;
|
|
1407
|
+
for (; c < D; ) Le[c] = e.charCodeAt(i + c), ce[c] = ++c;
|
|
1408
|
+
for (; F < a; ) {
|
|
1409
|
+
for (o = t.charCodeAt(i + F), l = F++, s = F, c = 0; c < D; c++) f = o === Le[c] ? l : l + 1, l = ce[c], s = ce[c] = l > s ? f > s ? s + 1 : f : f > l ? l + 1 : f;
|
|
1410
|
+
if (r !== void 0) {
|
|
1411
|
+
let d = s;
|
|
1412
|
+
for (c = 0; c < D; c++) ce[c] < d && (d = ce[c]);
|
|
1413
|
+
if (d > r) return r;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
return ce.length = D, Le.length = D, r !== void 0 && s > r ? r : s;
|
|
1417
|
+
}
|
|
1418
|
+
function Ln(e, t, u) {
|
|
1419
|
+
if (!Array.isArray(t) || t.length === 0) return;
|
|
1420
|
+
let r = u?.maxDistance, n = e.length;
|
|
1421
|
+
for (let o of t) if (o === e) return o;
|
|
1422
|
+
let D, a = Number.POSITIVE_INFINITY, i = /* @__PURE__ */ new Set();
|
|
1423
|
+
for (let o of t) {
|
|
1424
|
+
if (i.has(o)) continue;
|
|
1425
|
+
i.add(o);
|
|
1426
|
+
let s = Math.abs(o.length - n);
|
|
1427
|
+
if (s >= a || s > r) continue;
|
|
1428
|
+
let l = Number.isFinite(a) ? Math.min(a, r) : r, f = l === void 0 ? $e(e, o) : $e(e, o, { maxDistance: l });
|
|
1429
|
+
if (f > r) continue;
|
|
1430
|
+
let c = f;
|
|
1431
|
+
if (l !== void 0 && f === l && l === r && (c = $e(e, o)), c < a && (a = c, D = o, a === 0)) break;
|
|
1432
|
+
}
|
|
1433
|
+
if (!(a > r)) return D;
|
|
1434
|
+
}
|
|
1435
|
+
var hu = (e, t, { descriptor: u, logger: r, schemas: n }) => {
|
|
1436
|
+
let D = [`Ignored unknown option ${R.yellow(u.pair({ key: e, value: t }))}.`], a = Ln(e, Object.keys(n), { maxDistance: 3 });
|
|
1437
|
+
a && D.push(`Did you mean ${R.blue(u.key(a))}?`), r.warn(D.join(" "));
|
|
1438
|
+
}, $n = ["default", "expected", "validate", "deprecated", "forward", "redirect", "overlap", "preprocess", "postprocess"];
|
|
1439
|
+
function Jn(e, t) {
|
|
1440
|
+
let u = new e(t), r = Object.create(u);
|
|
1441
|
+
for (let n of $n) n in t && (r[n] = Rn(t[n], u, te.prototype[n].length));
|
|
1442
|
+
return r;
|
|
1443
|
+
}
|
|
1444
|
+
var te = class {
|
|
1445
|
+
static create(e) {
|
|
1446
|
+
return Jn(this, e);
|
|
1447
|
+
}
|
|
1448
|
+
constructor(e) {
|
|
1449
|
+
this.name = e.name;
|
|
1450
|
+
}
|
|
1451
|
+
default(e) {
|
|
1452
|
+
}
|
|
1453
|
+
expected(e) {
|
|
1454
|
+
return "nothing";
|
|
1455
|
+
}
|
|
1456
|
+
validate(e, t) {
|
|
1457
|
+
return !1;
|
|
1458
|
+
}
|
|
1459
|
+
deprecated(e, t) {
|
|
1460
|
+
return !1;
|
|
1461
|
+
}
|
|
1462
|
+
forward(e, t) {
|
|
1463
|
+
}
|
|
1464
|
+
redirect(e, t) {
|
|
1465
|
+
}
|
|
1466
|
+
overlap(e, t, u) {
|
|
1467
|
+
return e;
|
|
1468
|
+
}
|
|
1469
|
+
preprocess(e, t) {
|
|
1470
|
+
return e;
|
|
1471
|
+
}
|
|
1472
|
+
postprocess(e, t) {
|
|
1473
|
+
return we;
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1476
|
+
function Rn(e, t, u) {
|
|
1477
|
+
return typeof e == "function" ? (...r) => e(...r.slice(0, u - 1), t, ...r.slice(u - 1)) : () => e;
|
|
1478
|
+
}
|
|
1479
|
+
var Mn = class extends te {
|
|
1480
|
+
constructor(e) {
|
|
1481
|
+
super(e), this._sourceName = e.sourceName;
|
|
1482
|
+
}
|
|
1483
|
+
expected(e) {
|
|
1484
|
+
return e.schemas[this._sourceName].expected(e);
|
|
1485
|
+
}
|
|
1486
|
+
validate(e, t) {
|
|
1487
|
+
return t.schemas[this._sourceName].validate(e, t);
|
|
1488
|
+
}
|
|
1489
|
+
redirect(e, t) {
|
|
1490
|
+
return this._sourceName;
|
|
1491
|
+
}
|
|
1492
|
+
}, Vn = class extends te {
|
|
1493
|
+
expected() {
|
|
1494
|
+
return "anything";
|
|
1495
|
+
}
|
|
1496
|
+
validate() {
|
|
1497
|
+
return !0;
|
|
1498
|
+
}
|
|
1499
|
+
}, Wn = class extends te {
|
|
1500
|
+
constructor({ valueSchema: e, name: t = e.name, ...u }) {
|
|
1501
|
+
super({ ...u, name: t }), this._valueSchema = e;
|
|
1502
|
+
}
|
|
1503
|
+
expected(e) {
|
|
1504
|
+
let { text: t, list: u } = e.normalizeExpectedResult(this._valueSchema.expected(e));
|
|
1505
|
+
return { text: t && `an array of ${t}`, list: u && { title: "an array of the following values", values: [{ list: u }] } };
|
|
1506
|
+
}
|
|
1507
|
+
validate(e, t) {
|
|
1508
|
+
if (!Array.isArray(e)) return !1;
|
|
1509
|
+
let u = [];
|
|
1510
|
+
for (let r of e) {
|
|
1511
|
+
let n = t.normalizeValidateResult(this._valueSchema.validate(r, t), r);
|
|
1512
|
+
n !== !0 && u.push(n.value);
|
|
1513
|
+
}
|
|
1514
|
+
return u.length === 0 ? !0 : { value: u };
|
|
1515
|
+
}
|
|
1516
|
+
deprecated(e, t) {
|
|
1517
|
+
let u = [];
|
|
1518
|
+
for (let r of e) {
|
|
1519
|
+
let n = t.normalizeDeprecatedResult(this._valueSchema.deprecated(r, t), r);
|
|
1520
|
+
n !== !1 && u.push(...n.map(({ value: D }) => ({ value: [D] })));
|
|
1521
|
+
}
|
|
1522
|
+
return u;
|
|
1523
|
+
}
|
|
1524
|
+
forward(e, t) {
|
|
1525
|
+
let u = [];
|
|
1526
|
+
for (let r of e) {
|
|
1527
|
+
let n = t.normalizeForwardResult(this._valueSchema.forward(r, t), r);
|
|
1528
|
+
u.push(...n.map(vt));
|
|
1529
|
+
}
|
|
1530
|
+
return u;
|
|
1531
|
+
}
|
|
1532
|
+
redirect(e, t) {
|
|
1533
|
+
let u = [], r = [];
|
|
1534
|
+
for (let n of e) {
|
|
1535
|
+
let D = t.normalizeRedirectResult(this._valueSchema.redirect(n, t), n);
|
|
1536
|
+
"remain" in D && u.push(D.remain), r.push(...D.redirect.map(vt));
|
|
1537
|
+
}
|
|
1538
|
+
return u.length === 0 ? { redirect: r } : { redirect: r, remain: u };
|
|
1539
|
+
}
|
|
1540
|
+
overlap(e, t) {
|
|
1541
|
+
return e.concat(t);
|
|
1542
|
+
}
|
|
1543
|
+
};
|
|
1544
|
+
function vt({ from: e, to: t }) {
|
|
1545
|
+
return { from: [e], to: t };
|
|
1546
|
+
}
|
|
1547
|
+
var Kn = class extends te {
|
|
1548
|
+
expected() {
|
|
1549
|
+
return "true or false";
|
|
1550
|
+
}
|
|
1551
|
+
validate(e) {
|
|
1552
|
+
return typeof e == "boolean";
|
|
1553
|
+
}
|
|
1554
|
+
};
|
|
1555
|
+
function zn(e, t) {
|
|
1556
|
+
let u = /* @__PURE__ */ Object.create(null);
|
|
1557
|
+
for (let r of e) {
|
|
1558
|
+
let n = r[t];
|
|
1559
|
+
if (u[n]) throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);
|
|
1560
|
+
u[n] = r;
|
|
1561
|
+
}
|
|
1562
|
+
return u;
|
|
1563
|
+
}
|
|
1564
|
+
function Xn(e, t) {
|
|
1565
|
+
let u = /* @__PURE__ */ new Map();
|
|
1566
|
+
for (let r of e) {
|
|
1567
|
+
let n = r[t];
|
|
1568
|
+
if (u.has(n)) throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);
|
|
1569
|
+
u.set(n, r);
|
|
1570
|
+
}
|
|
1571
|
+
return u;
|
|
1572
|
+
}
|
|
1573
|
+
function Un() {
|
|
1574
|
+
let e = /* @__PURE__ */ Object.create(null);
|
|
1575
|
+
return (t) => {
|
|
1576
|
+
let u = JSON.stringify(t);
|
|
1577
|
+
return e[u] ? !0 : (e[u] = !0, !1);
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1580
|
+
function qn(e, t) {
|
|
1581
|
+
let u = [], r = [];
|
|
1582
|
+
for (let n of e) t(n) ? u.push(n) : r.push(n);
|
|
1583
|
+
return [u, r];
|
|
1584
|
+
}
|
|
1585
|
+
function Hn(e) {
|
|
1586
|
+
return e === Math.floor(e);
|
|
1587
|
+
}
|
|
1588
|
+
function Gn(e, t) {
|
|
1589
|
+
if (e === t) return 0;
|
|
1590
|
+
let u = typeof e, r = typeof t, n = ["undefined", "object", "boolean", "number", "string"];
|
|
1591
|
+
return u !== r ? n.indexOf(u) - n.indexOf(r) : u !== "string" ? Number(e) - Number(t) : e.localeCompare(t);
|
|
1592
|
+
}
|
|
1593
|
+
function Yn(e) {
|
|
1594
|
+
return (...t) => {
|
|
1595
|
+
let u = e(...t);
|
|
1596
|
+
return typeof u == "string" ? new Error(u) : u;
|
|
1597
|
+
};
|
|
1598
|
+
}
|
|
1599
|
+
function Bt(e) {
|
|
1600
|
+
return e === void 0 ? {} : e;
|
|
1601
|
+
}
|
|
1602
|
+
function Cu(e) {
|
|
1603
|
+
if (typeof e == "string") return { text: e };
|
|
1604
|
+
let { text: t, list: u } = e;
|
|
1605
|
+
return Qn((t || u) !== void 0, "Unexpected `expected` result, there should be at least one field."), u ? { text: t, list: { title: u.title, values: u.values.map(Cu) } } : { text: t };
|
|
1606
|
+
}
|
|
1607
|
+
function bt(e, t) {
|
|
1608
|
+
return e === !0 ? !0 : e === !1 ? { value: t } : e;
|
|
1609
|
+
}
|
|
1610
|
+
function At(e, t, u = !1) {
|
|
1611
|
+
return e === !1 ? !1 : e === !0 ? u ? !0 : [{ value: t }] : "value" in e ? [e] : e.length === 0 ? !1 : e;
|
|
1612
|
+
}
|
|
1613
|
+
function wt(e, t) {
|
|
1614
|
+
return typeof e == "string" || "key" in e ? { from: t, to: e } : "from" in e ? { from: e.from, to: e.to } : { from: t, to: e.to };
|
|
1615
|
+
}
|
|
1616
|
+
function Ke(e, t) {
|
|
1617
|
+
return e === void 0 ? [] : Array.isArray(e) ? e.map((u) => wt(u, t)) : [wt(e, t)];
|
|
1618
|
+
}
|
|
1619
|
+
function kt(e, t) {
|
|
1620
|
+
let u = Ke(typeof e == "object" && "redirect" in e ? e.redirect : e, t);
|
|
1621
|
+
return u.length === 0 ? { remain: t, redirect: u } : typeof e == "object" && "remain" in e ? { remain: e.remain, redirect: u } : { redirect: u };
|
|
1622
|
+
}
|
|
1623
|
+
function Qn(e, t) {
|
|
1624
|
+
if (!e) throw new Error(t);
|
|
1625
|
+
}
|
|
1626
|
+
var Zn = class extends te {
|
|
1627
|
+
constructor(e) {
|
|
1628
|
+
super(e), this._choices = Xn(e.choices.map((t) => t && typeof t == "object" ? t : { value: t }), "value");
|
|
1629
|
+
}
|
|
1630
|
+
expected({ descriptor: e }) {
|
|
1631
|
+
let t = Array.from(this._choices.keys()).map((n) => this._choices.get(n)).filter(({ hidden: n }) => !n).map((n) => n.value).sort(Gn).map(e.value), u = t.slice(0, -2), r = t.slice(-2);
|
|
1632
|
+
return { text: u.concat(r.join(" or ")).join(", "), list: { title: "one of the following values", values: t } };
|
|
1633
|
+
}
|
|
1634
|
+
validate(e) {
|
|
1635
|
+
return this._choices.has(e);
|
|
1636
|
+
}
|
|
1637
|
+
deprecated(e) {
|
|
1638
|
+
let t = this._choices.get(e);
|
|
1639
|
+
return t && t.deprecated ? { value: e } : !1;
|
|
1640
|
+
}
|
|
1641
|
+
forward(e) {
|
|
1642
|
+
let t = this._choices.get(e);
|
|
1643
|
+
return t ? t.forward : void 0;
|
|
1644
|
+
}
|
|
1645
|
+
redirect(e) {
|
|
1646
|
+
let t = this._choices.get(e);
|
|
1647
|
+
return t ? t.redirect : void 0;
|
|
1648
|
+
}
|
|
1649
|
+
}, eD = class extends te {
|
|
1650
|
+
expected() {
|
|
1651
|
+
return "a number";
|
|
1652
|
+
}
|
|
1653
|
+
validate(e, t) {
|
|
1654
|
+
return typeof e == "number";
|
|
1655
|
+
}
|
|
1656
|
+
}, tD = class extends eD {
|
|
1657
|
+
expected() {
|
|
1658
|
+
return "an integer";
|
|
1659
|
+
}
|
|
1660
|
+
validate(e, t) {
|
|
1661
|
+
return t.normalizeValidateResult(super.validate(e, t), e) === !0 && Hn(e);
|
|
1662
|
+
}
|
|
1663
|
+
}, xt = class extends te {
|
|
1664
|
+
expected() {
|
|
1665
|
+
return "a string";
|
|
1666
|
+
}
|
|
1667
|
+
validate(e) {
|
|
1668
|
+
return typeof e == "string";
|
|
1669
|
+
}
|
|
1670
|
+
}, uD = fe, rD = hu, nD = jn, DD = Pn, aD = class {
|
|
1671
|
+
constructor(e, t) {
|
|
1672
|
+
let { logger: u = console, loggerPrintWidth: r = 80, descriptor: n = uD, unknown: D = rD, invalid: a = nD, deprecated: i = DD, missing: o = () => !1, required: s = () => !1, preprocess: l = (c) => c, postprocess: f = () => we } = t || {};
|
|
1673
|
+
this._utils = { descriptor: n, logger: u || { warn: () => {
|
|
1674
|
+
} }, loggerPrintWidth: r, schemas: zn(e, "name"), normalizeDefaultResult: Bt, normalizeExpectedResult: Cu, normalizeDeprecatedResult: At, normalizeForwardResult: Ke, normalizeRedirectResult: kt, normalizeValidateResult: bt }, this._unknownHandler = D, this._invalidHandler = Yn(a), this._deprecatedHandler = i, this._identifyMissing = (c, F) => !(c in F) || o(c, F), this._identifyRequired = s, this._preprocess = l, this._postprocess = f, this.cleanHistory();
|
|
1675
|
+
}
|
|
1676
|
+
cleanHistory() {
|
|
1677
|
+
this._hasDeprecationWarned = Un();
|
|
1678
|
+
}
|
|
1679
|
+
normalize(e) {
|
|
1680
|
+
let t = {}, u = [this._preprocess(e, this._utils)], r = () => {
|
|
1681
|
+
for (; u.length !== 0; ) {
|
|
1682
|
+
let n = u.shift(), D = this._applyNormalization(n, t);
|
|
1683
|
+
u.push(...D);
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
r();
|
|
1687
|
+
for (let n of Object.keys(this._utils.schemas)) {
|
|
1688
|
+
let D = this._utils.schemas[n];
|
|
1689
|
+
if (!(n in t)) {
|
|
1690
|
+
let a = Bt(D.default(this._utils));
|
|
1691
|
+
"value" in a && u.push({ [n]: a.value });
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
r();
|
|
1695
|
+
for (let n of Object.keys(this._utils.schemas)) {
|
|
1696
|
+
if (!(n in t)) continue;
|
|
1697
|
+
let D = this._utils.schemas[n], a = t[n], i = D.postprocess(a, this._utils);
|
|
1698
|
+
i !== we && (this._applyValidation(i, n, D), t[n] = i);
|
|
1699
|
+
}
|
|
1700
|
+
return this._applyPostprocess(t), this._applyRequiredCheck(t), t;
|
|
1701
|
+
}
|
|
1702
|
+
_applyNormalization(e, t) {
|
|
1703
|
+
let u = [], { knownKeys: r, unknownKeys: n } = this._partitionOptionKeys(e);
|
|
1704
|
+
for (let D of r) {
|
|
1705
|
+
let a = this._utils.schemas[D], i = a.preprocess(e[D], this._utils);
|
|
1706
|
+
this._applyValidation(i, D, a);
|
|
1707
|
+
let o = ({ from: f, to: c }) => {
|
|
1708
|
+
u.push(typeof c == "string" ? { [c]: f } : { [c.key]: c.value });
|
|
1709
|
+
}, s = ({ value: f, redirectTo: c }) => {
|
|
1710
|
+
let F = At(a.deprecated(f, this._utils), i, !0);
|
|
1711
|
+
if (F !== !1) if (F === !0) this._hasDeprecationWarned(D) || this._utils.logger.warn(this._deprecatedHandler(D, c, this._utils));
|
|
1712
|
+
else for (let { value: d } of F) {
|
|
1713
|
+
let p = { key: D, value: d };
|
|
1714
|
+
if (!this._hasDeprecationWarned(p)) {
|
|
1715
|
+
let E = typeof c == "string" ? { key: c, value: d } : c;
|
|
1716
|
+
this._utils.logger.warn(this._deprecatedHandler(p, E, this._utils));
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
};
|
|
1720
|
+
Ke(a.forward(i, this._utils), i).forEach(o);
|
|
1721
|
+
let l = kt(a.redirect(i, this._utils), i);
|
|
1722
|
+
if (l.redirect.forEach(o), "remain" in l) {
|
|
1723
|
+
let f = l.remain;
|
|
1724
|
+
t[D] = D in t ? a.overlap(t[D], f, this._utils) : f, s({ value: f });
|
|
1725
|
+
}
|
|
1726
|
+
for (let { from: f, to: c } of l.redirect) s({ value: f, redirectTo: c });
|
|
1727
|
+
}
|
|
1728
|
+
for (let D of n) {
|
|
1729
|
+
let a = e[D];
|
|
1730
|
+
this._applyUnknownHandler(D, a, t, (i, o) => {
|
|
1731
|
+
u.push({ [i]: o });
|
|
1732
|
+
});
|
|
1733
|
+
}
|
|
1734
|
+
return u;
|
|
1735
|
+
}
|
|
1736
|
+
_applyRequiredCheck(e) {
|
|
1737
|
+
for (let t of Object.keys(this._utils.schemas)) if (this._identifyMissing(t, e) && this._identifyRequired(t)) throw this._invalidHandler(t, Fu, this._utils);
|
|
1738
|
+
}
|
|
1739
|
+
_partitionOptionKeys(e) {
|
|
1740
|
+
let [t, u] = qn(Object.keys(e).filter((r) => !this._identifyMissing(r, e)), (r) => r in this._utils.schemas);
|
|
1741
|
+
return { knownKeys: t, unknownKeys: u };
|
|
1742
|
+
}
|
|
1743
|
+
_applyValidation(e, t, u) {
|
|
1744
|
+
let r = bt(u.validate(e, this._utils), e);
|
|
1745
|
+
if (r !== !0) throw this._invalidHandler(t, r.value, this._utils);
|
|
1746
|
+
}
|
|
1747
|
+
_applyUnknownHandler(e, t, u, r) {
|
|
1748
|
+
let n = this._unknownHandler(e, t, this._utils);
|
|
1749
|
+
if (n) for (let D of Object.keys(n)) {
|
|
1750
|
+
if (this._identifyMissing(D, n)) continue;
|
|
1751
|
+
let a = n[D];
|
|
1752
|
+
D in this._utils.schemas ? r(D, a) : u[D] = a;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
_applyPostprocess(e) {
|
|
1756
|
+
let t = this._postprocess(e, this._utils);
|
|
1757
|
+
if (t !== we) {
|
|
1758
|
+
if (t.delete) for (let u of t.delete) delete e[u];
|
|
1759
|
+
if (t.override) {
|
|
1760
|
+
let { knownKeys: u, unknownKeys: r } = this._partitionOptionKeys(t.override);
|
|
1761
|
+
for (let n of u) {
|
|
1762
|
+
let D = t.override[n];
|
|
1763
|
+
this._applyValidation(D, n, this._utils.schemas[n]), e[n] = D;
|
|
1764
|
+
}
|
|
1765
|
+
for (let n of r) {
|
|
1766
|
+
let D = t.override[n];
|
|
1767
|
+
this._applyUnknownHandler(n, D, e, (a, i) => {
|
|
1768
|
+
let o = this._utils.schemas[a];
|
|
1769
|
+
this._applyValidation(i, a, o), e[a] = i;
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
}, Je;
|
|
1776
|
+
function iD(e, t, { logger: u = !1, isCLI: r = !1, passThrough: n = !1, FlagSchema: D, descriptor: a } = {}) {
|
|
1777
|
+
if (r) {
|
|
1778
|
+
if (!D) throw new Error("'FlagSchema' option is required.");
|
|
1779
|
+
if (!a) throw new Error("'descriptor' option is required.");
|
|
1780
|
+
} else a = fe;
|
|
1781
|
+
let i = n ? Array.isArray(n) ? (c, F) => n.includes(c) ? { [c]: F } : void 0 : (c, F) => ({ [c]: F }) : (c, F, d) => {
|
|
1782
|
+
let { _: p, ...E } = d.schemas;
|
|
1783
|
+
return hu(c, F, { ...d, schemas: E });
|
|
1784
|
+
}, o = oD(t, { isCLI: r, FlagSchema: D }), s = new aD(o, { logger: u, unknown: i, descriptor: a }), l = u !== !1;
|
|
1785
|
+
l && Je && (s._hasDeprecationWarned = Je);
|
|
1786
|
+
let f = s.normalize(e);
|
|
1787
|
+
return l && (Je = s._hasDeprecationWarned), f;
|
|
1788
|
+
}
|
|
1789
|
+
function oD(e, { isCLI: t, FlagSchema: u }) {
|
|
1790
|
+
let r = [];
|
|
1791
|
+
t && r.push(Vn.create({ name: "_" }));
|
|
1792
|
+
for (let n of e) r.push(sD(n, { isCLI: t, optionInfos: e, FlagSchema: u })), n.alias && t && r.push(Mn.create({ name: n.alias, sourceName: n.name }));
|
|
1793
|
+
return r;
|
|
1794
|
+
}
|
|
1795
|
+
function sD(e, { isCLI: t, optionInfos: u, FlagSchema: r }) {
|
|
1796
|
+
let { name: n } = e, D = { name: n }, a, i = {};
|
|
1797
|
+
switch (e.type) {
|
|
1798
|
+
case "int":
|
|
1799
|
+
a = tD, t && (D.preprocess = Number);
|
|
1800
|
+
break;
|
|
1801
|
+
case "string":
|
|
1802
|
+
a = xt;
|
|
1803
|
+
break;
|
|
1804
|
+
case "choice":
|
|
1805
|
+
a = Zn, D.choices = e.choices.map((o) => o?.redirect ? { ...o, redirect: { to: { key: e.name, value: o.redirect } } } : o);
|
|
1806
|
+
break;
|
|
1807
|
+
case "boolean":
|
|
1808
|
+
a = Kn;
|
|
1809
|
+
break;
|
|
1810
|
+
case "flag":
|
|
1811
|
+
a = r, D.flags = u.flatMap((o) => [o.alias, o.description && o.name, o.oppositeDescription && `no-${o.name}`].filter(Boolean));
|
|
1812
|
+
break;
|
|
1813
|
+
case "path":
|
|
1814
|
+
a = xt;
|
|
1815
|
+
break;
|
|
1816
|
+
default:
|
|
1817
|
+
throw new Error(`Unexpected type ${e.type}`);
|
|
1818
|
+
}
|
|
1819
|
+
if (e.exception ? D.validate = (o, s, l) => e.exception(o) || s.validate(o, l) : D.validate = (o, s, l) => o === void 0 || s.validate(o, l), e.redirect && (i.redirect = (o) => o ? { to: typeof e.redirect == "string" ? e.redirect : { key: e.redirect.option, value: e.redirect.value } } : void 0), e.deprecated && (i.deprecated = !0), t && !e.array) {
|
|
1820
|
+
let o = D.preprocess || ((s) => s);
|
|
1821
|
+
D.preprocess = (s, l, f) => l.preprocess(o(Array.isArray(s) ? S(0, s, -1) : s), f);
|
|
1822
|
+
}
|
|
1823
|
+
return e.array ? Wn.create({ ...t ? { preprocess: (o) => Array.isArray(o) ? o : [o] } : {}, ...i, valueSchema: a.create(D) }) : a.create({ ...D, ...i });
|
|
1824
|
+
}
|
|
1825
|
+
var lD = iD, cD = Array.prototype.findLast ?? function(e) {
|
|
1826
|
+
for (let t = this.length - 1; t >= 0; t--) {
|
|
1827
|
+
let u = this[t];
|
|
1828
|
+
if (e(u, t, this)) return u;
|
|
1829
|
+
}
|
|
1830
|
+
}, fD = me("findLast", function() {
|
|
1831
|
+
if (Array.isArray(this)) return cD;
|
|
1832
|
+
}), gu = fD, FD = /* @__PURE__ */ Symbol.for("PRETTIER_IS_FRONT_MATTER"), dD = [];
|
|
1833
|
+
function pD(e) {
|
|
1834
|
+
return !!e?.[FD];
|
|
1835
|
+
}
|
|
1836
|
+
var Dt = pD, Eu = /* @__PURE__ */ new Set(["yaml", "toml"]), mu = ({ node: e }) => Dt(e) && Eu.has(e.language);
|
|
1837
|
+
async function hD(e, t, u, r) {
|
|
1838
|
+
let { node: n } = u, { language: D } = n;
|
|
1839
|
+
if (!Eu.has(D)) return;
|
|
1840
|
+
let a = n.value.trim(), i;
|
|
1841
|
+
if (a) {
|
|
1842
|
+
let o = D === "yaml" ? D : cu(r, { language: D });
|
|
1843
|
+
if (!o) return;
|
|
1844
|
+
i = a ? await e(a, { parser: o }) : "";
|
|
1845
|
+
} else i = a;
|
|
1846
|
+
return Kt([n.startDelimiter, n.explicitLanguage ?? "", K, i, i ? K : "", n.endDelimiter]);
|
|
1847
|
+
}
|
|
1848
|
+
function CD(e, t) {
|
|
1849
|
+
return mu({ node: e }) && (delete t.end, delete t.raw, delete t.value), t;
|
|
1850
|
+
}
|
|
1851
|
+
var gD = CD;
|
|
1852
|
+
function ED({ node: e }) {
|
|
1853
|
+
return e.raw;
|
|
1854
|
+
}
|
|
1855
|
+
var mD = ED, yu = /* @__PURE__ */ new Set(["tokens", "comments", "parent", "enclosingNode", "precedingNode", "followingNode"]), yD = (e) => Object.keys(e).filter((t) => !yu.has(t));
|
|
1856
|
+
function vD(e, t) {
|
|
1857
|
+
let u = e ? (r) => e(r, yu) : yD;
|
|
1858
|
+
return t ? new Proxy(u, { apply: (r, n, D) => Dt(D[0]) ? dD : Reflect.apply(r, n, D) }) : u;
|
|
1859
|
+
}
|
|
1860
|
+
var St = vD;
|
|
1861
|
+
function vu(e, t) {
|
|
1862
|
+
if (!t) throw new Error("parserName is required.");
|
|
1863
|
+
let u = gu(0, e, (n) => n.parsers && Object.prototype.hasOwnProperty.call(n.parsers, t));
|
|
1864
|
+
if (u) return u;
|
|
1865
|
+
let r = `Couldn't resolve parser "${t}".`;
|
|
1866
|
+
throw r += " Plugins must be explicitly added to the standalone bundle.", new ou(r);
|
|
1867
|
+
}
|
|
1868
|
+
function BD(e, t) {
|
|
1869
|
+
if (!t) throw new Error("astFormat is required.");
|
|
1870
|
+
let u = gu(0, e, (n) => n.printers && Object.prototype.hasOwnProperty.call(n.printers, t));
|
|
1871
|
+
if (u) return u;
|
|
1872
|
+
let r = `Couldn't find plugin for AST format "${t}".`;
|
|
1873
|
+
throw r += " Plugins must be explicitly added to the standalone bundle.", new ou(r);
|
|
1874
|
+
}
|
|
1875
|
+
function at({ plugins: e, parser: t }) {
|
|
1876
|
+
let u = vu(e, t);
|
|
1877
|
+
return Bu(u, t);
|
|
1878
|
+
}
|
|
1879
|
+
function Bu(e, t) {
|
|
1880
|
+
let u = e.parsers[t];
|
|
1881
|
+
return typeof u == "function" ? u() : u;
|
|
1882
|
+
}
|
|
1883
|
+
async function bD(e, t) {
|
|
1884
|
+
let u = e.printers[t], r = typeof u == "function" ? await u() : u;
|
|
1885
|
+
return AD(r);
|
|
1886
|
+
}
|
|
1887
|
+
var Re = /* @__PURE__ */ new WeakMap();
|
|
1888
|
+
function AD(e) {
|
|
1889
|
+
if (Re.has(e)) return Re.get(e);
|
|
1890
|
+
let { features: t, getVisitorKeys: u, embed: r, massageAstNode: n, print: D, ...a } = e;
|
|
1891
|
+
t = SD(t);
|
|
1892
|
+
let i = t.experimental_frontMatterSupport;
|
|
1893
|
+
u = St(u, i.massageAstNode || i.embed || i.print);
|
|
1894
|
+
let o = n;
|
|
1895
|
+
n && i.massageAstNode && (o = new Proxy(n, { apply(c, F, d) {
|
|
1896
|
+
return gD(...d), Reflect.apply(c, F, d);
|
|
1897
|
+
} }));
|
|
1898
|
+
let s = r;
|
|
1899
|
+
if (r) {
|
|
1900
|
+
let c;
|
|
1901
|
+
s = new Proxy(r, { get(F, d, p) {
|
|
1902
|
+
return d === "getVisitorKeys" ? (c ?? (c = r.getVisitorKeys ? St(r.getVisitorKeys, i.massageAstNode || i.embed) : u), c) : Reflect.get(F, d, p);
|
|
1903
|
+
}, apply: (F, d, p) => i.embed && mu(...p) ? hD : Reflect.apply(F, d, p) });
|
|
1904
|
+
}
|
|
1905
|
+
let l = D;
|
|
1906
|
+
i.print && (l = new Proxy(D, { apply(c, F, d) {
|
|
1907
|
+
let [p] = d;
|
|
1908
|
+
return Dt(p.node) ? mD(p) : Reflect.apply(c, F, d);
|
|
1909
|
+
} }));
|
|
1910
|
+
let f = { features: t, getVisitorKeys: u, embed: s, massageAstNode: o, print: l, ...a };
|
|
1911
|
+
return Re.set(e, f), f;
|
|
1912
|
+
}
|
|
1913
|
+
var wD = ["clean", "embed", "print"], kD = Object.fromEntries(wD.map((e) => [e, !1]));
|
|
1914
|
+
function xD(e) {
|
|
1915
|
+
return { ...kD, ...e };
|
|
1916
|
+
}
|
|
1917
|
+
function SD(e) {
|
|
1918
|
+
return { experimental_avoidAstMutation: !1, ...e, experimental_frontMatterSupport: xD(e?.experimental_frontMatterSupport) };
|
|
1919
|
+
}
|
|
1920
|
+
var It = { astFormat: "estree", printer: {}, originalText: void 0, locStart: null, locEnd: null, getVisitorKeys: null };
|
|
1921
|
+
async function ID(e, t = {}) {
|
|
1922
|
+
let u = { ...e };
|
|
1923
|
+
if (!u.parser) if (u.filepath) {
|
|
1924
|
+
if (u.parser = cu(u, { physicalFile: u.filepath }), !u.parser) throw new Ct(`No parser could be inferred for file "${u.filepath}".`);
|
|
1925
|
+
} else throw new Ct("No parser and no file path given, couldn't infer a parser.");
|
|
1926
|
+
let r = su({ plugins: e.plugins, showDeprecated: !0 }).options, n = { ...It, ...Object.fromEntries(r.filter((f) => f.default !== void 0).map((f) => [f.name, f.default])) }, D = vu(u.plugins, u.parser), a = await Bu(D, u.parser);
|
|
1927
|
+
u.astFormat = a.astFormat, u.locEnd = a.locEnd, u.locStart = a.locStart;
|
|
1928
|
+
let i = D.printers?.[a.astFormat] ? D : BD(u.plugins, a.astFormat), o = await bD(i, a.astFormat);
|
|
1929
|
+
u.printer = o, u.getVisitorKeys = o.getVisitorKeys;
|
|
1930
|
+
let s = i.defaultOptions ? Object.fromEntries(Object.entries(i.defaultOptions).filter(([, f]) => f !== void 0)) : {}, l = { ...n, ...s };
|
|
1931
|
+
for (let [f, c] of Object.entries(l)) (u[f] === null || u[f] === void 0) && (u[f] = c);
|
|
1932
|
+
return u.parser === "json" && (u.trailingComma = "none"), lD(u, r, { passThrough: Object.keys(It), ...t });
|
|
1933
|
+
}
|
|
1934
|
+
var pe = ID;
|
|
1935
|
+
zu(Xu());
|
|
1936
|
+
var it = { keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], strictBind: ["eval", "arguments"] };
|
|
1937
|
+
new Set(it.keyword);
|
|
1938
|
+
new Set(it.strict);
|
|
1939
|
+
new Set(it.strictBind);
|
|
1940
|
+
var be = (e, t) => (u) => e(t(u));
|
|
1941
|
+
function bu(e) {
|
|
1942
|
+
return { keyword: e.cyan, capitalized: e.yellow, jsxIdentifier: e.yellow, punctuator: e.yellow, number: e.magenta, string: e.green, regex: e.magenta, comment: e.gray, invalid: be(be(e.white, e.bgRed), e.bold), gutter: e.gray, marker: be(e.red, e.bold), message: be(e.red, e.bold), reset: e.reset };
|
|
1943
|
+
}
|
|
1944
|
+
bu(fu());
|
|
1945
|
+
bu(fu());
|
|
1946
|
+
function ND() {
|
|
1947
|
+
return new Proxy({}, { get: () => (e) => e });
|
|
1948
|
+
}
|
|
1949
|
+
var Nt = /\r\n|[\n\r\u2028\u2029]/;
|
|
1950
|
+
function OD(e, t, u) {
|
|
1951
|
+
let r = Object.assign({ column: 0, line: -1 }, e.start), n = Object.assign({}, r, e.end), { linesAbove: D = 2, linesBelow: a = 3 } = u || {}, i = r.line, o = r.column, s = n.line, l = n.column, f = Math.max(i - (D + 1), 0), c = Math.min(t.length, s + a);
|
|
1952
|
+
i === -1 && (f = 0), s === -1 && (c = t.length);
|
|
1953
|
+
let F = s - i, d = {};
|
|
1954
|
+
if (F) for (let p = 0; p <= F; p++) {
|
|
1955
|
+
let E = p + i;
|
|
1956
|
+
if (!o) d[E] = !0;
|
|
1957
|
+
else if (p === 0) {
|
|
1958
|
+
let g = t[E - 1].length;
|
|
1959
|
+
d[E] = [o, g - o + 1];
|
|
1960
|
+
} else if (p === F) d[E] = [0, l];
|
|
1961
|
+
else {
|
|
1962
|
+
let g = t[E - p].length;
|
|
1963
|
+
d[E] = [0, g];
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
else o === l ? o ? d[i] = [o, 0] : d[i] = !0 : d[i] = [o, l - o];
|
|
1967
|
+
return { start: f, end: c, markerLines: d };
|
|
1968
|
+
}
|
|
1969
|
+
function _D(e, t, u = {}) {
|
|
1970
|
+
let r = ND(), n = e.split(Nt), { start: D, end: a, markerLines: i } = OD(t, n, u), o = t.start && typeof t.start.column == "number", s = String(a).length, l = e.split(Nt, a).slice(D, a).map((f, c) => {
|
|
1971
|
+
let F = D + 1 + c, d = ` ${` ${F}`.slice(-s)} |`, p = i[F], E = !i[F + 1];
|
|
1972
|
+
if (p) {
|
|
1973
|
+
let g = "";
|
|
1974
|
+
if (Array.isArray(p)) {
|
|
1975
|
+
let m = f.slice(0, Math.max(p[0] - 1, 0)).replace(/[^\t]/g, " "), b = p[1] || 1;
|
|
1976
|
+
g = [`
|
|
1977
|
+
`, r.gutter(d.replace(/\d/g, " ")), " ", m, r.marker("^").repeat(b)].join(""), E && u.message && (g += " " + r.message(u.message));
|
|
1978
|
+
}
|
|
1979
|
+
return [r.marker(">"), r.gutter(d), f.length > 0 ? ` ${f}` : "", g].join("");
|
|
1980
|
+
} else return ` ${r.gutter(d)}${f.length > 0 ? ` ${f}` : ""}`;
|
|
1981
|
+
}).join(`
|
|
1982
|
+
`);
|
|
1983
|
+
return u.message && !o && (l = `${" ".repeat(s + 1)}${u.message}
|
|
1984
|
+
${l}`), l;
|
|
1985
|
+
}
|
|
1986
|
+
async function TD(e, t) {
|
|
1987
|
+
let u = await at(t), r = u.preprocess ? await u.preprocess(e, t) : e;
|
|
1988
|
+
t.originalText = r;
|
|
1989
|
+
let n;
|
|
1990
|
+
try {
|
|
1991
|
+
n = await u.parse(r, t, t);
|
|
1992
|
+
} catch (D) {
|
|
1993
|
+
PD(D, e);
|
|
1994
|
+
}
|
|
1995
|
+
return { text: r, ast: n };
|
|
1996
|
+
}
|
|
1997
|
+
function PD(e, t) {
|
|
1998
|
+
let { loc: u } = e;
|
|
1999
|
+
if (u) {
|
|
2000
|
+
let r = _D(t, u, {});
|
|
2001
|
+
throw e.message += `
|
|
2002
|
+
` + r, e.codeFrame = r, e;
|
|
2003
|
+
}
|
|
2004
|
+
throw e;
|
|
2005
|
+
}
|
|
2006
|
+
var ve = TD;
|
|
2007
|
+
async function jD(e, t, u, r, n) {
|
|
2008
|
+
if (u.embeddedLanguageFormatting !== "auto") return;
|
|
2009
|
+
let { printer: D } = u, { embed: a } = D;
|
|
2010
|
+
if (!a) return;
|
|
2011
|
+
if (a.length > 2) throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");
|
|
2012
|
+
let { hasPrettierIgnore: i } = D, { getVisitorKeys: o } = a, s = [];
|
|
2013
|
+
c();
|
|
2014
|
+
let l = e.stack;
|
|
2015
|
+
for (let { print: F, node: d, pathStack: p } of s) try {
|
|
2016
|
+
e.stack = p;
|
|
2017
|
+
let E = await F(f, t, e, u);
|
|
2018
|
+
E && n.set(d, E);
|
|
2019
|
+
} catch (E) {
|
|
2020
|
+
if (globalThis.PRETTIER_DEBUG) throw E;
|
|
2021
|
+
}
|
|
2022
|
+
e.stack = l;
|
|
2023
|
+
function f(F, d) {
|
|
2024
|
+
return LD(F, d, u, r);
|
|
2025
|
+
}
|
|
2026
|
+
function c() {
|
|
2027
|
+
let { node: F } = e;
|
|
2028
|
+
if (F === null || typeof F != "object" || i?.(e)) return;
|
|
2029
|
+
for (let p of o(F)) Array.isArray(F[p]) ? e.each(c, p) : e.call(c, p);
|
|
2030
|
+
let d = a(e, u);
|
|
2031
|
+
if (d) {
|
|
2032
|
+
if (typeof d == "function") {
|
|
2033
|
+
s.push({ print: d, node: F, pathStack: [...e.stack] });
|
|
2034
|
+
return;
|
|
2035
|
+
}
|
|
2036
|
+
n.set(F, d);
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
async function LD(e, t, u, r) {
|
|
2041
|
+
let n = await pe({ ...u, ...t, parentParser: u.parser, originalText: e, cursorOffset: void 0, rangeStart: void 0, rangeEnd: void 0 }, { passThrough: !0 }), { ast: D } = await ve(e, n), a = await r(D, n);
|
|
2042
|
+
return Wt(a);
|
|
2043
|
+
}
|
|
2044
|
+
function $D(e, t, u, r) {
|
|
2045
|
+
let { originalText: n, [/* @__PURE__ */ Symbol.for("comments")]: D, locStart: a, locEnd: i, [/* @__PURE__ */ Symbol.for("printedComments")]: o } = t, { node: s } = e, l = a(s), f = i(s);
|
|
2046
|
+
for (let F of D) a(F) >= l && i(F) <= f && o.add(F);
|
|
2047
|
+
let { printPrettierIgnored: c } = t.printer;
|
|
2048
|
+
return c ? c(e, t, u, r) : n.slice(l, f);
|
|
2049
|
+
}
|
|
2050
|
+
var JD = $D;
|
|
2051
|
+
async function Te(e, t) {
|
|
2052
|
+
({ ast: e } = await Au(e, t));
|
|
2053
|
+
let u = /* @__PURE__ */ new Map(), r = new Zr(e), n = /* @__PURE__ */ new Map();
|
|
2054
|
+
await jD(r, a, t, Te, n);
|
|
2055
|
+
let D = await Ot(r, t, a, void 0, n);
|
|
2056
|
+
if (gn(t), t.cursorOffset >= 0) {
|
|
2057
|
+
if (t.nodeAfterCursor && !t.nodeBeforeCursor) return [De, D];
|
|
2058
|
+
if (t.nodeBeforeCursor && !t.nodeAfterCursor) return [D, De];
|
|
2059
|
+
}
|
|
2060
|
+
return D;
|
|
2061
|
+
function a(o, s) {
|
|
2062
|
+
return o === void 0 || o === r ? i(s) : Array.isArray(o) ? r.call(() => i(s), ...o) : r.call(() => i(s), o);
|
|
2063
|
+
}
|
|
2064
|
+
function i(o) {
|
|
2065
|
+
let s = r.node;
|
|
2066
|
+
if (s == null) return "";
|
|
2067
|
+
let l = tt(s) && o === void 0;
|
|
2068
|
+
if (l && u.has(s)) return u.get(s);
|
|
2069
|
+
let f = Ot(r, t, a, o, n);
|
|
2070
|
+
return l && u.set(s, f), f;
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
function Ot(e, t, u, r, n) {
|
|
2074
|
+
let { node: D } = e, { printer: a } = t, i;
|
|
2075
|
+
switch (a.hasPrettierIgnore?.(e) ? i = JD(e, t, u, r) : n.has(D) ? i = n.get(D) : i = a.print(e, t, u, r), D) {
|
|
2076
|
+
case t.cursorNode:
|
|
2077
|
+
i = Ae(i, (o) => [De, o, De]);
|
|
2078
|
+
break;
|
|
2079
|
+
case t.nodeBeforeCursor:
|
|
2080
|
+
i = Ae(i, (o) => [o, De]);
|
|
2081
|
+
break;
|
|
2082
|
+
case t.nodeAfterCursor:
|
|
2083
|
+
i = Ae(i, (o) => [De, o]);
|
|
2084
|
+
break;
|
|
2085
|
+
}
|
|
2086
|
+
return a.printComment && !a.willPrintOwnComments?.(e, t) && (i = Cn(e, i, t)), i;
|
|
2087
|
+
}
|
|
2088
|
+
async function Au(e, t) {
|
|
2089
|
+
let u = e.comments ?? [];
|
|
2090
|
+
t[/* @__PURE__ */ Symbol.for("comments")] = u, t[/* @__PURE__ */ Symbol.for("printedComments")] = /* @__PURE__ */ new Set(), ln(e, t);
|
|
2091
|
+
let { printer: { preprocess: r } } = t;
|
|
2092
|
+
return e = r ? await r(e, t) : e, { ast: e, comments: u };
|
|
2093
|
+
}
|
|
2094
|
+
function RD(e, t) {
|
|
2095
|
+
let { cursorOffset: u, locStart: r, locEnd: n, getVisitorKeys: D } = t, a = (F) => r(F) <= u && n(F) >= u, i = e, o = [e];
|
|
2096
|
+
for (let F of an(e, { getVisitorKeys: D, filter: a })) o.push(F), i = F;
|
|
2097
|
+
if (on(i, { getVisitorKeys: D })) return { cursorNode: i };
|
|
2098
|
+
let s, l, f = -1, c = Number.POSITIVE_INFINITY;
|
|
2099
|
+
for (; o.length > 0 && (s === void 0 || l === void 0); ) {
|
|
2100
|
+
i = o.pop();
|
|
2101
|
+
let F = s !== void 0, d = l !== void 0;
|
|
2102
|
+
for (let p of _e(i, { getVisitorKeys: D })) {
|
|
2103
|
+
if (!F) {
|
|
2104
|
+
let E = n(p);
|
|
2105
|
+
E <= u && E > f && (s = p, f = E);
|
|
2106
|
+
}
|
|
2107
|
+
if (!d) {
|
|
2108
|
+
let E = r(p);
|
|
2109
|
+
E >= u && E < c && (l = p, c = E);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
return { nodeBeforeCursor: s, nodeAfterCursor: l };
|
|
2114
|
+
}
|
|
2115
|
+
var wu = RD;
|
|
2116
|
+
function MD(e, t) {
|
|
2117
|
+
let { printer: u } = t, r = u.massageAstNode;
|
|
2118
|
+
if (!r) return e;
|
|
2119
|
+
let { getVisitorKeys: n } = u, { ignoredProperties: D } = r;
|
|
2120
|
+
return a(e);
|
|
2121
|
+
function a(i, o) {
|
|
2122
|
+
if (!tt(i)) return i;
|
|
2123
|
+
if (Array.isArray(i)) return i.map((c) => a(c, o)).filter(Boolean);
|
|
2124
|
+
let s = {}, l = new Set(n(i));
|
|
2125
|
+
for (let c in i) !Object.prototype.hasOwnProperty.call(i, c) || D?.has(c) || (l.has(c) ? s[c] = a(i[c], i) : s[c] = i[c]);
|
|
2126
|
+
let f = r(i, s, o);
|
|
2127
|
+
if (f !== null) return f ?? s;
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
var VD = MD, WD = Array.prototype.findLastIndex ?? function(e) {
|
|
2131
|
+
for (let t = this.length - 1; t >= 0; t--) {
|
|
2132
|
+
let u = this[t];
|
|
2133
|
+
if (e(u, t, this)) return t;
|
|
2134
|
+
}
|
|
2135
|
+
return -1;
|
|
2136
|
+
}, KD = me("findLastIndex", function() {
|
|
2137
|
+
if (Array.isArray(this)) return WD;
|
|
2138
|
+
}), zD = KD, XD = ({ parser: e }) => e === "json" || e === "json5" || e === "jsonc" || e === "json-stringify";
|
|
2139
|
+
function UD(e, t) {
|
|
2140
|
+
return t = new Set(t), e.find((u) => ku.has(u.type) && t.has(u));
|
|
2141
|
+
}
|
|
2142
|
+
function _t(e) {
|
|
2143
|
+
let t = zD(0, e, (u) => u.type !== "Program" && u.type !== "File");
|
|
2144
|
+
return t === -1 ? e : e.slice(0, t + 1);
|
|
2145
|
+
}
|
|
2146
|
+
function qD(e, t, { locStart: u, locEnd: r }) {
|
|
2147
|
+
let [n, ...D] = e, [a, ...i] = t;
|
|
2148
|
+
if (n === a) return [n, a];
|
|
2149
|
+
let o = u(n);
|
|
2150
|
+
for (let l of _t(i)) if (u(l) >= o) a = l;
|
|
2151
|
+
else break;
|
|
2152
|
+
let s = r(a);
|
|
2153
|
+
for (let l of _t(D)) {
|
|
2154
|
+
if (r(l) <= s) n = l;
|
|
2155
|
+
else break;
|
|
2156
|
+
if (n === a) break;
|
|
2157
|
+
}
|
|
2158
|
+
return [n, a];
|
|
2159
|
+
}
|
|
2160
|
+
function ze(e, t, u, r, n = [], D) {
|
|
2161
|
+
let { locStart: a, locEnd: i } = u, o = a(e), s = i(e);
|
|
2162
|
+
if (t > s || t < o || D === "rangeEnd" && t === o || D === "rangeStart" && t === s) return;
|
|
2163
|
+
let l = [e, ...n], f = ru(e, l, { cache: nu, locStart: a, locEnd: i, getVisitorKeys: u.getVisitorKeys, filter: u.printer.canAttachComment, getChildren: u.printer.getCommentChildNodes });
|
|
2164
|
+
for (let c of f) {
|
|
2165
|
+
let F = ze(c, t, u, r, l, D);
|
|
2166
|
+
if (F) return F;
|
|
2167
|
+
}
|
|
2168
|
+
if (r(e, n[0])) return l;
|
|
2169
|
+
}
|
|
2170
|
+
function HD(e, t) {
|
|
2171
|
+
return t !== "DeclareExportDeclaration" && e !== "TypeParameterDeclaration" && (e === "Directive" || e === "TypeAlias" || e === "TSExportAssignment" || e.startsWith("Declare") || e.startsWith("TSDeclare") || e.endsWith("Statement") || e.endsWith("Declaration"));
|
|
2172
|
+
}
|
|
2173
|
+
var ku = /* @__PURE__ */ new Set(["JsonRoot", "ObjectExpression", "ArrayExpression", "StringLiteral", "NumericLiteral", "BooleanLiteral", "NullLiteral", "UnaryExpression", "TemplateLiteral"]), GD = /* @__PURE__ */ new Set(["OperationDefinition", "FragmentDefinition", "VariableDefinition", "TypeExtensionDefinition", "ObjectTypeDefinition", "FieldDefinition", "DirectiveDefinition", "EnumTypeDefinition", "EnumValueDefinition", "InputValueDefinition", "InputObjectTypeDefinition", "SchemaDefinition", "OperationTypeDefinition", "InterfaceTypeDefinition", "UnionTypeDefinition", "ScalarTypeDefinition"]);
|
|
2174
|
+
function Tt(e, t, u) {
|
|
2175
|
+
if (!t) return !1;
|
|
2176
|
+
switch (e.parser) {
|
|
2177
|
+
case "flow":
|
|
2178
|
+
case "hermes":
|
|
2179
|
+
case "babel":
|
|
2180
|
+
case "babel-flow":
|
|
2181
|
+
case "babel-ts":
|
|
2182
|
+
case "typescript":
|
|
2183
|
+
case "acorn":
|
|
2184
|
+
case "espree":
|
|
2185
|
+
case "meriyah":
|
|
2186
|
+
case "oxc":
|
|
2187
|
+
case "oxc-ts":
|
|
2188
|
+
case "__babel_estree":
|
|
2189
|
+
return HD(t.type, u?.type);
|
|
2190
|
+
case "json":
|
|
2191
|
+
case "json5":
|
|
2192
|
+
case "jsonc":
|
|
2193
|
+
case "json-stringify":
|
|
2194
|
+
return ku.has(t.type);
|
|
2195
|
+
case "graphql":
|
|
2196
|
+
return GD.has(t.kind);
|
|
2197
|
+
case "vue":
|
|
2198
|
+
return t.tag !== "root";
|
|
2199
|
+
}
|
|
2200
|
+
return !1;
|
|
2201
|
+
}
|
|
2202
|
+
function YD(e, t, u) {
|
|
2203
|
+
let { rangeStart: r, rangeEnd: n, locStart: D, locEnd: a } = t, i = e.slice(r, n).search(/\S/u), o = i === -1;
|
|
2204
|
+
if (!o) for (r += i; n > r && !/\S/u.test(e[n - 1]); --n) ;
|
|
2205
|
+
let s = ze(u, r, t, (F, d) => Tt(t, F, d), [], "rangeStart");
|
|
2206
|
+
if (!s) return;
|
|
2207
|
+
let l = o ? s : ze(u, n, t, (F) => Tt(t, F), [], "rangeEnd");
|
|
2208
|
+
if (!l) return;
|
|
2209
|
+
let f, c;
|
|
2210
|
+
if (XD(t)) {
|
|
2211
|
+
let F = UD(s, l);
|
|
2212
|
+
f = F, c = F;
|
|
2213
|
+
} else [f, c] = qD(s, l, t);
|
|
2214
|
+
return [Math.min(D(f), D(c)), Math.max(a(f), a(c))];
|
|
2215
|
+
}
|
|
2216
|
+
var xu = "\uFEFF", Pt = /* @__PURE__ */ Symbol("cursor");
|
|
2217
|
+
async function Su(e, t, u = 0) {
|
|
2218
|
+
if (!e || e.trim().length === 0) return { formatted: "", cursorOffset: -1, comments: [] };
|
|
2219
|
+
let { ast: r, text: n } = await ve(e, t);
|
|
2220
|
+
t.cursorOffset >= 0 && (t = { ...t, ...wu(r, t) });
|
|
2221
|
+
let D = await Te(r, t);
|
|
2222
|
+
u > 0 && (D = zt([K, D], u, t.tabWidth));
|
|
2223
|
+
let a = Oe(D, t);
|
|
2224
|
+
if (u > 0) {
|
|
2225
|
+
let o = a.formatted.trim();
|
|
2226
|
+
a.cursorNodeStart !== void 0 && (a.cursorNodeStart -= a.formatted.indexOf(o), a.cursorNodeStart < 0 && (a.cursorNodeStart = 0, a.cursorNodeText = a.cursorNodeText.trimStart()), a.cursorNodeStart + a.cursorNodeText.length > o.length && (a.cursorNodeText = a.cursorNodeText.trimEnd())), a.formatted = o + He(t.endOfLine);
|
|
2227
|
+
}
|
|
2228
|
+
let i = t[/* @__PURE__ */ Symbol.for("comments")];
|
|
2229
|
+
if (t.cursorOffset >= 0) {
|
|
2230
|
+
let o, s, l, f;
|
|
2231
|
+
if ((t.cursorNode || t.nodeBeforeCursor || t.nodeAfterCursor) && a.cursorNodeText) if (l = a.cursorNodeStart, f = a.cursorNodeText, t.cursorNode) o = t.locStart(t.cursorNode), s = n.slice(o, t.locEnd(t.cursorNode));
|
|
2232
|
+
else {
|
|
2233
|
+
if (!t.nodeBeforeCursor && !t.nodeAfterCursor) throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");
|
|
2234
|
+
o = t.nodeBeforeCursor ? t.locEnd(t.nodeBeforeCursor) : 0;
|
|
2235
|
+
let g = t.nodeAfterCursor ? t.locStart(t.nodeAfterCursor) : n.length;
|
|
2236
|
+
s = n.slice(o, g);
|
|
2237
|
+
}
|
|
2238
|
+
else o = 0, s = n, l = 0, f = a.formatted;
|
|
2239
|
+
let c = t.cursorOffset - o;
|
|
2240
|
+
if (s === f) return { formatted: a.formatted, cursorOffset: l + c, comments: i };
|
|
2241
|
+
let F = s.split("");
|
|
2242
|
+
F.splice(c, 0, Pt);
|
|
2243
|
+
let d = f.split(""), p = Zu(F, d), E = l;
|
|
2244
|
+
for (let g of p) if (g.removed) {
|
|
2245
|
+
if (g.value.includes(Pt)) break;
|
|
2246
|
+
} else E += g.count;
|
|
2247
|
+
return { formatted: a.formatted, cursorOffset: E, comments: i };
|
|
2248
|
+
}
|
|
2249
|
+
return { formatted: a.formatted, cursorOffset: -1, comments: i };
|
|
2250
|
+
}
|
|
2251
|
+
async function QD(e, t) {
|
|
2252
|
+
let { ast: u, text: r } = await ve(e, t), [n, D] = YD(r, t, u) ?? [0, 0], a = r.slice(n, D), i = Math.min(n, r.lastIndexOf(`
|
|
2253
|
+
`, n) + 1), o = r.slice(i, n).match(/^\s*/u)[0], s = et(o, t.tabWidth), l = await Su(a, { ...t, rangeStart: 0, rangeEnd: Number.POSITIVE_INFINITY, cursorOffset: t.cursorOffset > n && t.cursorOffset <= D ? t.cursorOffset - n : -1, endOfLine: "lf" }, s), f = l.formatted.trimEnd(), { cursorOffset: c } = t;
|
|
2254
|
+
c > D ? c += f.length - a.length : l.cursorOffset >= 0 && (c = l.cursorOffset + n);
|
|
2255
|
+
let F = r.slice(0, n) + f + r.slice(D);
|
|
2256
|
+
if (t.endOfLine !== "lf") {
|
|
2257
|
+
let d = He(t.endOfLine);
|
|
2258
|
+
c >= 0 && d === `\r
|
|
2259
|
+
` && (c += Mt(F.slice(0, c), `
|
|
2260
|
+
`)), F = xe(0, F, `
|
|
2261
|
+
`, d);
|
|
2262
|
+
}
|
|
2263
|
+
return { formatted: F, cursorOffset: c, comments: l.comments };
|
|
2264
|
+
}
|
|
2265
|
+
function Me(e, t, u) {
|
|
2266
|
+
return typeof t != "number" || Number.isNaN(t) || t < 0 || t > e.length ? u : t;
|
|
2267
|
+
}
|
|
2268
|
+
function jt(e, t) {
|
|
2269
|
+
let { cursorOffset: u, rangeStart: r, rangeEnd: n } = t;
|
|
2270
|
+
return u = Me(e, u, -1), r = Me(e, r, 0), n = Me(e, n, e.length), { ...t, cursorOffset: u, rangeStart: r, rangeEnd: n };
|
|
2271
|
+
}
|
|
2272
|
+
function Iu(e, t) {
|
|
2273
|
+
let { cursorOffset: u, rangeStart: r, rangeEnd: n, endOfLine: D } = jt(e, t), a = e.charAt(0) === xu;
|
|
2274
|
+
if (a && (e = e.slice(1), u--, r--, n--), D === "auto" && (D = Dr(e)), e.includes("\r")) {
|
|
2275
|
+
let i = (o) => Mt(e.slice(0, Math.max(o, 0)), `\r
|
|
2276
|
+
`);
|
|
2277
|
+
u -= i(u), r -= i(r), n -= i(n), e = or(e);
|
|
2278
|
+
}
|
|
2279
|
+
return { hasBOM: a, text: e, options: jt(e, { ...t, cursorOffset: u, rangeStart: r, rangeEnd: n, endOfLine: D }) };
|
|
2280
|
+
}
|
|
2281
|
+
async function Lt(e, t) {
|
|
2282
|
+
let u = await at(t);
|
|
2283
|
+
return !u.hasPragma || u.hasPragma(e);
|
|
2284
|
+
}
|
|
2285
|
+
async function ZD(e, t) {
|
|
2286
|
+
return (await at(t)).hasIgnorePragma?.(e);
|
|
2287
|
+
}
|
|
2288
|
+
async function Nu(e, t) {
|
|
2289
|
+
let { hasBOM: u, text: r, options: n } = Iu(e, await pe(t));
|
|
2290
|
+
if (n.rangeStart >= n.rangeEnd && r !== "" || n.requirePragma && !await Lt(r, n) || n.checkIgnorePragma && await ZD(r, n)) return { formatted: e, cursorOffset: t.cursorOffset, comments: [] };
|
|
2291
|
+
let D;
|
|
2292
|
+
return n.rangeStart > 0 || n.rangeEnd < r.length ? D = await QD(r, n) : (!n.requirePragma && n.insertPragma && n.printer.insertPragma && !await Lt(r, n) && (r = n.printer.insertPragma(r)), D = await Su(r, n)), u && (D.formatted = xu + D.formatted, D.cursorOffset >= 0 && D.cursorOffset++), D;
|
|
2293
|
+
}
|
|
2294
|
+
async function ea(e, t, u) {
|
|
2295
|
+
let { text: r, options: n } = Iu(e, await pe(t)), D = await ve(r, n);
|
|
2296
|
+
return u && (u.preprocessForPrint && (D.ast = await Au(D.ast, n)), u.massage && (D.ast = VD(D.ast, n))), D;
|
|
2297
|
+
}
|
|
2298
|
+
async function ta(e, t) {
|
|
2299
|
+
t = await pe(t);
|
|
2300
|
+
let u = await Te(e, t);
|
|
2301
|
+
return Oe(u, t);
|
|
2302
|
+
}
|
|
2303
|
+
async function ua(e, t) {
|
|
2304
|
+
let u = $r(e), { formatted: r } = await Nu(u, { ...t, parser: "__js_expression" });
|
|
2305
|
+
return r;
|
|
2306
|
+
}
|
|
2307
|
+
async function ra(e, t) {
|
|
2308
|
+
t = await pe(t);
|
|
2309
|
+
let { ast: u } = await ve(e, t);
|
|
2310
|
+
return t.cursorOffset >= 0 && (t = { ...t, ...wu(u, t) }), Te(u, t);
|
|
2311
|
+
}
|
|
2312
|
+
async function na(e, t) {
|
|
2313
|
+
return Oe(e, await pe(t));
|
|
2314
|
+
}
|
|
2315
|
+
var Ou = {};
|
|
2316
|
+
Ue(Ou, { builders: () => Da, printer: () => aa, utils: () => ia });
|
|
2317
|
+
var Da = { join: Ut, line: qt, softline: Pr, hardline: K, literalline: Gt, group: Xt, conditionalGroup: Nr, fill: Ir, lineSuffix: Ve, lineSuffixBoundary: jr, cursor: De, breakParent: Ne, ifBreak: Or, trim: Lr, indent: ke, indentIfBreak: _r, align: de, addAlignmentToDoc: zt, markAsRoot: Kt, dedentToRoot: xr, dedent: Sr, hardlineWithoutBreakParent: Qe, literallineWithoutBreakParent: Ht, label: Tr, concat: (e) => e }, aa = { printDocToString: Oe }, ia = { willBreak: gr, traverseDoc: Ge, findInDoc: Ye, mapDoc: Ie, removeLines: yr, stripTrailingHardline: Wt, replaceEndOfLine: br, canBreak: wr }, oa = "3.7.4", _u = {};
|
|
2318
|
+
Ue(_u, { addDanglingComment: () => re, addLeadingComment: () => ge, addTrailingComment: () => Ee, getAlignmentSize: () => et, getIndentSize: () => da, getMaxContinuousCount: () => Ca, getNextNonSpaceNonCommentCharacter: () => Ea, getNextNonSpaceNonCommentCharacterIndex: () => Sa, getPreferredQuote: () => Ba, getStringWidth: () => Ze, hasNewline: () => Q, hasNewlineInRange: () => Aa, hasSpaces: () => ka, isNextLineEmpty: () => Ta, isNextLineEmptyAfterIndex: () => ct, isPreviousLineEmpty: () => Na, makeString: () => _a, skip: () => ye, skipEverythingButNewLine: () => tu, skipInlineComment: () => ot, skipNewline: () => ae, skipSpaces: () => Z, skipToLineEnd: () => eu, skipTrailingComment: () => st, skipWhitespace: () => tn });
|
|
2319
|
+
function sa(e, t) {
|
|
2320
|
+
if (t === !1) return !1;
|
|
2321
|
+
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
|
|
2322
|
+
for (let u = t + 2; u < e.length; ++u) if (e.charAt(u) === "*" && e.charAt(u + 1) === "/") return u + 2;
|
|
2323
|
+
}
|
|
2324
|
+
return t;
|
|
2325
|
+
}
|
|
2326
|
+
var ot = sa;
|
|
2327
|
+
function la(e, t) {
|
|
2328
|
+
return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? tu(e, t) : t;
|
|
2329
|
+
}
|
|
2330
|
+
var st = la;
|
|
2331
|
+
function ca(e, t) {
|
|
2332
|
+
let u = null, r = t;
|
|
2333
|
+
for (; r !== u; ) u = r, r = Z(e, r), r = ot(e, r), r = st(e, r), r = ae(e, r);
|
|
2334
|
+
return r;
|
|
2335
|
+
}
|
|
2336
|
+
var lt = ca;
|
|
2337
|
+
function fa(e, t) {
|
|
2338
|
+
let u = null, r = t;
|
|
2339
|
+
for (; r !== u; ) u = r, r = eu(e, r), r = ot(e, r), r = Z(e, r);
|
|
2340
|
+
return r = st(e, r), r = ae(e, r), r !== !1 && Q(e, r);
|
|
2341
|
+
}
|
|
2342
|
+
var ct = fa;
|
|
2343
|
+
function Fa(e, t) {
|
|
2344
|
+
let u = e.lastIndexOf(`
|
|
2345
|
+
`);
|
|
2346
|
+
return u === -1 ? 0 : et(e.slice(u + 1).match(/^[\t ]*/u)[0], t);
|
|
2347
|
+
}
|
|
2348
|
+
var da = Fa;
|
|
2349
|
+
function pa(e) {
|
|
2350
|
+
if (typeof e != "string") throw new TypeError("Expected a string");
|
|
2351
|
+
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2352
|
+
}
|
|
2353
|
+
function ha(e, t) {
|
|
2354
|
+
let u = e.matchAll(new RegExp(`(?:${pa(t)})+`, "gu"));
|
|
2355
|
+
return u.reduce || (u = [...u]), u.reduce((r, [n]) => Math.max(r, n.length), 0) / t.length;
|
|
2356
|
+
}
|
|
2357
|
+
var Ca = ha;
|
|
2358
|
+
function ga(e, t) {
|
|
2359
|
+
let u = lt(e, t);
|
|
2360
|
+
return u === !1 ? "" : e.charAt(u);
|
|
2361
|
+
}
|
|
2362
|
+
var Ea = ga, Tu = Object.freeze({ character: "'", codePoint: 39 }), Pu = Object.freeze({ character: '"', codePoint: 34 }), ma = Object.freeze({ preferred: Tu, alternate: Pu }), ya = Object.freeze({ preferred: Pu, alternate: Tu });
|
|
2363
|
+
function va(e, t) {
|
|
2364
|
+
let { preferred: u, alternate: r } = t === !0 || t === "'" ? ma : ya, { length: n } = e, D = 0, a = 0;
|
|
2365
|
+
for (let i = 0; i < n; i++) {
|
|
2366
|
+
let o = e.charCodeAt(i);
|
|
2367
|
+
o === u.codePoint ? D++ : o === r.codePoint && a++;
|
|
2368
|
+
}
|
|
2369
|
+
return (D > a ? r : u).character;
|
|
2370
|
+
}
|
|
2371
|
+
var Ba = va;
|
|
2372
|
+
function ba(e, t, u) {
|
|
2373
|
+
for (let r = t; r < u; ++r) if (e.charAt(r) === `
|
|
2374
|
+
`) return !0;
|
|
2375
|
+
return !1;
|
|
2376
|
+
}
|
|
2377
|
+
var Aa = ba;
|
|
2378
|
+
function wa(e, t, u = {}) {
|
|
2379
|
+
return Z(e, u.backwards ? t - 1 : t, u) !== t;
|
|
2380
|
+
}
|
|
2381
|
+
var ka = wa;
|
|
2382
|
+
function xa(e, t, u) {
|
|
2383
|
+
return lt(e, u(t));
|
|
2384
|
+
}
|
|
2385
|
+
function Sa(e, t) {
|
|
2386
|
+
return arguments.length === 2 || typeof t == "number" ? lt(e, t) : xa(...arguments);
|
|
2387
|
+
}
|
|
2388
|
+
function Ia(e, t, u) {
|
|
2389
|
+
return rt(e, u(t));
|
|
2390
|
+
}
|
|
2391
|
+
function Na(e, t) {
|
|
2392
|
+
return arguments.length === 2 || typeof t == "number" ? rt(e, t) : Ia(...arguments);
|
|
2393
|
+
}
|
|
2394
|
+
function Oa(e, t, u) {
|
|
2395
|
+
return ct(e, u(t));
|
|
2396
|
+
}
|
|
2397
|
+
function _a(e, t, u) {
|
|
2398
|
+
let r = t === '"' ? "'" : '"', n = xe(0, e, /\\(.)|(["'])/gsu, (D, a, i) => a === r ? a : i === t ? "\\" + i : i || (u && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a) ? a : "\\" + a));
|
|
2399
|
+
return t + n + t;
|
|
2400
|
+
}
|
|
2401
|
+
function Ta(e, t) {
|
|
2402
|
+
return arguments.length === 2 || typeof t == "number" ? ct(e, t) : Oa(...arguments);
|
|
2403
|
+
}
|
|
2404
|
+
function ne(e, t = 1) {
|
|
2405
|
+
return async (...u) => {
|
|
2406
|
+
let r = u[t] ?? {}, n = r.plugins ?? [];
|
|
2407
|
+
return u[t] = { ...r, plugins: Array.isArray(n) ? n : Object.values(n) }, e(...u);
|
|
2408
|
+
};
|
|
2409
|
+
}
|
|
2410
|
+
var ju = ne(Nu);
|
|
2411
|
+
async function Lu(e, t) {
|
|
2412
|
+
let { formatted: u } = await ju(e, { ...t, cursorOffset: -1 });
|
|
2413
|
+
return u;
|
|
2414
|
+
}
|
|
2415
|
+
async function Pa(e, t) {
|
|
2416
|
+
return await Lu(e, t) === e;
|
|
2417
|
+
}
|
|
2418
|
+
var ja = ne(su, 0), La = { parse: ne(ea), formatAST: ne(ta), formatDoc: ne(ua), printToDoc: ne(ra), printDocToString: ne(na) };
|
|
2419
|
+
export {
|
|
2420
|
+
La as __debug,
|
|
2421
|
+
Pa as check,
|
|
2422
|
+
Uu as default,
|
|
2423
|
+
Ou as doc,
|
|
2424
|
+
Lu as format,
|
|
2425
|
+
ju as formatWithCursor,
|
|
2426
|
+
ja as getSupportInfo,
|
|
2427
|
+
_u as util,
|
|
2428
|
+
oa as version
|
|
2429
|
+
};
|