@sheetxl/studio-vanilla 0.4.13 → 0.4.14
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/README.md +2 -2
- package/browser/cjs/10IK8MFijJb-yvV6.cjs +7 -0
- package/browser/cjs/1bCMnueqxHW3rn0c.cjs +6 -0
- package/browser/cjs/AnJTeEGq7VP4T1b7.cjs +161 -0
- package/browser/cjs/BH3MYcOF7rxLX3Bk.cjs +15 -0
- package/browser/cjs/BQ4QeJYaIhLaInyR.cjs +6 -0
- package/browser/cjs/BU5k1OZewc-Z-kR9.cjs +6 -0
- package/browser/cjs/BlwK-VslgEVH2cgX.cjs +145 -0
- package/browser/cjs/Bm9fNNMIOLIwq-94.cjs +6 -0
- package/browser/cjs/BtiY-n4sGy6WaqNg.cjs +32 -0
- package/browser/cjs/BxgDhdrrKrJMEaXd.cjs +6 -0
- package/browser/cjs/BzT1y15V6Zs7c_zX.cjs +6 -0
- package/browser/cjs/C0ySf2emOB0Mslc-.cjs +6 -0
- package/browser/cjs/CE5U7gB5L-PE17gV.cjs +6 -0
- package/browser/cjs/CHd9vauNLHnOLflj.cjs +6 -0
- package/browser/cjs/CJZtyunL_qaXFylY.cjs +12 -0
- package/browser/cjs/CJoJ19i1z94kndlS.cjs +19 -0
- package/browser/cjs/CNcsGELwCAV-A5oH.cjs +16 -0
- package/browser/cjs/CTuM_aZX8wZICUe_.cjs +6 -0
- package/browser/cjs/CWW_yQpIswo7DEAT.cjs +6 -0
- package/browser/cjs/CXIHULOe7x4DYKXw.cjs +12 -0
- package/browser/cjs/CYLnJHryQcQO4XoG.cjs +6 -0
- package/browser/cjs/C_mbaid3FQ52usBI.cjs +6 -0
- package/browser/cjs/Cj_1qUo5cZ3FnOpK.cjs +6 -0
- package/browser/cjs/Cl0XSnWVDoaHTIlF.cjs +6 -0
- package/browser/cjs/CnLdhURNkVXo_0Eg.cjs +6 -0
- package/browser/cjs/CpIIsygD5mnJyl47.cjs +1501 -0
- package/browser/cjs/CpRfx14is2_4Wgp3.cjs +6 -0
- package/browser/cjs/Cuq8Nim-ol5Gdehe.cjs +6 -0
- package/browser/cjs/D4NcrJlqcLExwCNT.cjs +124 -0
- package/browser/cjs/D4vbOk4hD8-b-c10.cjs +6 -0
- package/browser/cjs/D5YUIQeOcujtq6XS.cjs +7 -0
- package/browser/cjs/D6uIvR-6Y690_Em2.cjs +11 -0
- package/browser/cjs/DAbScbuk-sjZXMIC.cjs +11 -0
- package/browser/cjs/DBNXGIWfZmgb_sHL.cjs +6 -0
- package/browser/cjs/DCd5OZXj2IRbxEF2.cjs +6 -0
- package/browser/cjs/DFNisISrsMnZrV4B.cjs +6 -0
- package/browser/cjs/DIYOARVcGtRjKpjZ.cjs +6 -0
- package/browser/cjs/DL4HgriZ3TY2K-QP.cjs +6 -0
- package/browser/cjs/DPbzY4ppgKPrdbWc.cjs +6 -0
- package/browser/cjs/DQGdVVTxixgptLdj.cjs +366 -0
- package/browser/cjs/DWzQm8Q32qNP7qKL.cjs +6 -0
- package/browser/cjs/D_7RtbQABH1zdcjr.cjs +7 -0
- package/browser/cjs/D_Q0s9KLnWHwKxTK.cjs +6 -0
- package/browser/cjs/DdTcwutSPJMeCIv3.cjs +6 -0
- package/browser/cjs/DlnKrZRyxBfbqaTi.cjs +13 -0
- package/browser/cjs/DtpB0PMEtamaB-Hv.cjs +6 -0
- package/browser/cjs/Dv8SE05ABKNLPY6A.cjs +6 -0
- package/browser/cjs/DxBLU16_E62Umowp.cjs +6 -0
- package/browser/cjs/VU_KaqGTjvnisS9e.cjs +6 -0
- package/browser/cjs/bS_BOH9cvVCFy36v.cjs +6 -0
- package/browser/cjs/dbUUj8LyIitsdYpk.cjs +6 -0
- package/browser/cjs/eZGLUWbfY3JdZRM5.cjs +6 -0
- package/browser/cjs/index.cjs +3 -4
- package/browser/cjs/mBk4Z4LZ65b3f58_.cjs +6 -0
- package/browser/cjs/rIOsSIPwxoXlIawS.cjs +6 -0
- package/browser/cjs/sMBG5eQ3-iacLXUm.cjs +6 -0
- package/browser/cjs/tShlMZrIxsGZSeHX.cjs +42 -0
- package/browser/cjs/xDqIifM_--oXscCV.cjs +6 -0
- package/browser/cjs/yBSdtSSuNERefFhR.cjs +15 -0
- package/{cdn/assets/DHydjLSnijEgtpyU.js → browser/esm/4eRu4yzXkvCBip8J.mjs} +1 -1
- package/browser/esm/73gcCsbqgbW3KIoA.mjs +1346 -0
- package/browser/esm/B383N9irNfyfYC2l.mjs +20 -0
- package/{cdn/assets/C3EFzvmp0DcC_HAx.js → browser/esm/B4ji-HZTY0uvH8r7.mjs} +1 -1
- package/{cdn/assets/D-5VYBO5_VEh6fEW.js → browser/esm/B8TNpfJ8ymQcPriE.mjs} +1 -1
- package/browser/esm/BBDu-GNDE7ZA-1sJ.mjs +56 -0
- package/{cdn/assets/BwpBFv8Ks2ka07ch.js → browser/esm/BF5nlSYZ38RJ0dPX.mjs} +1 -1
- package/{cdn/assets/B1Iys8a964LGNZKf.js → browser/esm/BHy77Km4i4t5U7ka.mjs} +1 -1
- package/{cdn/assets/BMiA9p1uOrwnooVT.js → browser/esm/BIUVt79NHXdZx2Dz.mjs} +1 -1
- package/browser/esm/BP6hA-zc0dMuMOIA.mjs +3755 -0
- package/{cdn/assets/BUwNyHytF9St68tJ.js → browser/esm/BPen6C7JE2sWVgdi.mjs} +1 -1
- package/{cdn/assets/DvFNLgeMJ9LdQROu.js → browser/esm/BUqd1uVUNoWmepd2.mjs} +54 -55
- package/browser/esm/BXABqQEa6kQQcjmt.mjs +820 -0
- package/{cdn/assets/BL6TUDSeou6wPejW.js → browser/esm/BZxAttR2mi9td3k1.mjs} +1 -1
- package/{cdn/assets/C4vStn7wNlvrxdsp.js → browser/esm/B_pEA9HeXKvEOCdS.mjs} +1 -1
- package/browser/esm/BbW_1O3cEhZ4aSgS.mjs +55785 -0
- package/browser/esm/BdFNxdtES-3_yQ9R.mjs +421 -0
- package/{cdn/assets/BciokME96sykArSM.js → browser/esm/BfFDvyaRcdKS0wPD.mjs} +1 -1
- package/browser/esm/Bqqcb80cNalBs-sB.mjs +939 -0
- package/browser/esm/BrEcIDq0-c5AiQEf.mjs +21 -0
- package/{cdn/assets/CrLrvmlJhYpNpXqR.js → browser/esm/BvYUsRgBXLSuaQ-S.mjs} +1 -1
- package/{cdn/assets/C-Z8wvIy20kJ7R-k.js → browser/esm/BzE-61bmpRQzEVPt.mjs} +1 -1
- package/browser/esm/C28AZ0Rwo79iGg0v.mjs +13208 -0
- package/browser/esm/C5GgK_mW25DZYw-I.mjs +2344 -0
- package/{cdn/assets/XysyS9rk9tFdbzZh.js → browser/esm/CHjb5a2xwEWs4RgS.mjs} +505 -513
- package/{cdn/assets/DXtbonLk2ESfF4Dh.js → browser/esm/CITPwlsNzJvv551I.mjs} +1 -1
- package/browser/esm/CJiHNujoVUdO_G7X.mjs +46 -0
- package/{cdn/assets/C5q0qaKi2eeDgoO8.js → browser/esm/CN73n4VDayKh_l1J.mjs} +1 -1
- package/{cdn/assets/B2RAJJJFkcaWUfUW.js → browser/esm/CcARDY0PFSWkqsG9.mjs} +1 -1
- package/browser/esm/CeF0ZRfeSy83i80_.mjs +1575 -0
- package/{cdn/assets/BBJxLS-wB_nXRnI2.js → browser/esm/Cmtx4dAVZrwq5cVO.mjs} +1 -1
- package/browser/esm/Crza3kRJdEVylOfk.mjs +29 -0
- package/browser/esm/D3L89e08b7ewR6mt.mjs +21 -0
- package/browser/esm/D4G17ip9xxOX5jDd.mjs +3934 -0
- package/{cdn/assets/CuNqTH3P8mCglRiz.js → browser/esm/D9eVsUckA6bWBHni.mjs} +1 -1
- package/browser/esm/DAscSzG63-mM5p50.mjs +41 -0
- package/browser/esm/DCyJNVtrh6kEt73Q.mjs +84 -0
- package/{cdn/assets/DFHruAftzuzBZ71r.js → browser/esm/DFwxjsVr4xKLPTGf.mjs} +65 -68
- package/{cdn/assets/9-cIcj6CRJx5HTn9.js → browser/esm/DHPHhaCxihdR9Hl6.mjs} +1 -1
- package/browser/esm/DKbJ-iVPuUbr3iZ_.mjs +47 -0
- package/browser/esm/DQLk_UmdpJBt-zZi.mjs +5582 -0
- package/browser/esm/DR7oVoNSe0FFWHOr.mjs +48 -0
- package/{cdn/assets/CKA4s2hlzSnrdWSD.js → browser/esm/DVRMAeHUj0-TY-vK.mjs} +1 -1
- package/{cdn/assets/N3pWBoccPrTedAw-.js → browser/esm/DXIWAG-DUKHzNlRl.mjs} +1 -1
- package/browser/esm/DbZJQpjZJIcz2ypV.mjs +39 -0
- package/{cdn/assets/KDGtuIzSpkf1vsmH.js → browser/esm/Dft4BSeY0bp0A6z0.mjs} +1 -1
- package/browser/esm/DgO85Q5iHe-ZmvtQ.mjs +633 -0
- package/browser/esm/DwRHGEuscm3FvnkM.mjs +1665 -0
- package/browser/esm/HyTvrvH0vItPFnFG.mjs +472 -0
- package/{cdn/assets/F6zW9Vj410C4yRVG.js → browser/esm/Pkb6GWdyZdze_XAw.mjs} +167 -166
- package/browser/esm/QZikWr_NQfcFWCBV.mjs +44 -0
- package/{cdn/assets/5XdpCWQ6AcxZ6oY1.js → browser/esm/aLv-xujBO4X6ilhV.mjs} +1 -1
- package/{cdn/assets/Gz4u4ewyWfB-Pf-a.js → browser/esm/c9fba0RuWGogsH0X.mjs} +4 -5
- package/browser/esm/index.mjs +6 -2
- package/{cdn/assets/BxblmHGC7YxZcuak.js → browser/esm/jkSJc6Omxbf-rPQY.mjs} +1 -1
- package/{cdn/assets/CT0d1P-Aav62lUvV.js → browser/esm/uuCmCmYQQXgwyRSd.mjs} +1 -1
- package/{cdn/assets/DD3csu4pddGtMp3n.js → browser/esm/w3TGaFTjdsc4XTcz.mjs} +537 -539
- package/browser/esm/wV8riZWKJE7AoKQk.mjs +1365 -0
- package/{cdn/assets/CsorxCiOoe7qX9j1.js → browser/esm/wxvli1IH1NkfqE6-.mjs} +1 -1
- package/cdn/assets/{C9eQW5GKgPRmKKgJ.js → 0fI22OQK5IczUH6s.js} +2 -2
- package/cdn/assets/4eRu4yzXkvCBip8J.js +10 -0
- package/cdn/assets/5HYy7pIZxQRDUQl-.js +50 -0
- package/cdn/assets/6oc_f4xkoSmftsRd.js +22 -0
- package/cdn/assets/73gcCsbqgbW3KIoA.js +1346 -0
- package/cdn/assets/B3TPDOzYf_VRBIr6.js +2177 -0
- package/cdn/assets/B4HW_cy7gbE01jar.js +390 -0
- package/cdn/assets/B4ji-HZTY0uvH8r7.js +10 -0
- package/cdn/assets/B7Ky6m4VWP8vxhPt.js +1702 -0
- package/cdn/assets/B8TNpfJ8ymQcPriE.js +24 -0
- package/cdn/assets/BEfetwH6zTr6B51I.js +3755 -0
- package/cdn/assets/BF5nlSYZ38RJ0dPX.js +10 -0
- package/cdn/assets/BHy77Km4i4t5U7ka.js +10 -0
- package/cdn/assets/BIUVt79NHXdZx2Dz.js +10 -0
- package/cdn/assets/BPen6C7JE2sWVgdi.js +10 -0
- package/cdn/assets/BS1p7DgoyO-WkvB8.js +41 -0
- package/cdn/assets/BZxAttR2mi9td3k1.js +10 -0
- package/cdn/assets/B_pEA9HeXKvEOCdS.js +10 -0
- package/cdn/assets/BdFNxdtES-3_yQ9R.js +421 -0
- package/cdn/assets/BfFDvyaRcdKS0wPD.js +10 -0
- package/cdn/assets/{quOP5QFyTT9soNIl.js → BiKaXKU3o287mgkN.js} +1 -1
- package/cdn/assets/BvYUsRgBXLSuaQ-S.js +10 -0
- package/cdn/assets/BzE-61bmpRQzEVPt.js +10 -0
- package/cdn/assets/{CV8UjJPDVplXjK1E.js → C0yI-QYraFhnJUdD.js} +19 -19
- package/cdn/assets/C28AZ0Rwo79iGg0v.js +13208 -0
- package/cdn/assets/{BDE7FUo2oiivrvBL.js → C3FTuqvfGalOVHql.js} +15 -15
- package/cdn/assets/C3W0xsNrt-Was9g-.js +84 -0
- package/cdn/assets/C8rQWD8C7ccUHNZL.js +3934 -0
- package/cdn/assets/CITPwlsNzJvv551I.js +10 -0
- package/cdn/assets/CN73n4VDayKh_l1J.js +10 -0
- package/cdn/assets/{0j_nQmV1Bb0lJ6sB.js → CWkF-50YF43t7qge.js} +4 -4
- package/cdn/assets/{8U2WVdbZHYCBnd9L.js → CaKPs_ILqLIWfUUN.js} +13 -13
- package/cdn/assets/CcARDY0PFSWkqsG9.js +21 -0
- package/cdn/assets/{Xwyp21e7L5fTeb_y.js → Cdx6LrqtHZKbwl63.js} +186 -184
- package/cdn/assets/{6JtXguBKwGj6dqfy.js → ChB-XZno7w9v221u.js} +385 -387
- package/cdn/assets/CkY7wM_4OGwZvJ4f.js +942 -0
- package/cdn/assets/Cmtx4dAVZrwq5cVO.js +10 -0
- package/cdn/assets/{BlYoycYtR-sUp0iC.js → CrBywNOOyPHSBoTT.js} +4 -4
- package/cdn/assets/D9eVsUckA6bWBHni.js +10 -0
- package/cdn/assets/{DPQqTIMsRLhMxPIy.js → DBpku3D2DSTmW4II.js} +2 -2
- package/cdn/assets/DEOxG6u6itV8bGym.js +2346 -0
- package/cdn/assets/DHPHhaCxihdR9Hl6.js +10 -0
- package/cdn/assets/{DXHirQMr483hJBil.js → DMWARnjq06oQnfrL.js} +15 -15
- package/cdn/assets/{BNh9nSR83reiVMKt.js → DRa6yXWuTlAjuaKT.js} +2 -2
- package/cdn/assets/DVRMAeHUj0-TY-vK.js +10 -0
- package/{browser/esm/CVeyOpbAhaBhDRye.mjs → cdn/assets/DXIWAG-DUKHzNlRl.js} +7 -2
- package/cdn/assets/{0e9wDKSn4SFxSmP5.js → DYowHOSLHcADsXuK.js} +3 -3
- package/cdn/assets/{f3_QXO8z0p-q4nJo.js → DZNoPrlxULASVlOi.js} +4 -4
- package/cdn/assets/DaUJajqmQYuM0Gew.js +150 -0
- package/cdn/assets/DcdQwhlGoI1knRUy.js +46 -0
- package/cdn/assets/Dft4BSeY0bp0A6z0.js +10 -0
- package/cdn/assets/DgO85Q5iHe-ZmvtQ.js +633 -0
- package/cdn/assets/{CR01MBraUPYPpwy4.js → Dm0hrXCbV7DITOhi.js} +2 -2
- package/cdn/assets/{BgnlshX157Ob6RLs.js → DnWjhq4ZlgIuFcii.js} +2 -2
- package/cdn/assets/DwRHGEuscm3FvnkM.js +1665 -0
- package/cdn/assets/DzyNujjbHLXo9UmH.js +1466 -0
- package/cdn/assets/{B_2bXmyji3Dr7LRM.js → EYTSqAG9YOdb1vKx.js} +21832 -23233
- package/cdn/assets/{BVYDmdUGWvMG5gNK.js → Ux2jUY_EwSsYBCov.js} +1 -1
- package/cdn/assets/{Bsa9-Itkf_SdDBM9.js → XoKiuP2ZFq0cNGkH.js} +4 -4
- package/cdn/assets/{2mxiQm6dELsqQoX7.js → Zi3E5Kzxw2FPtLVL.js} +1376 -1418
- package/cdn/assets/aLv-xujBO4X6ilhV.js +10 -0
- package/cdn/assets/jkSJc6Omxbf-rPQY.js +10 -0
- package/cdn/assets/uuCmCmYQQXgwyRSd.js +10 -0
- package/cdn/assets/wV8riZWKJE7AoKQk.js +1365 -0
- package/cdn/assets/wxvli1IH1NkfqE6-.js +10 -0
- package/cdn/index.js +2 -2
- package/cdn/loader.js +1 -1
- package/package.json +3 -3
- package/types/index.d.ts +1 -0
- package/browser/cjs/-DkdmW3XP1ICRY25.cjs +0 -7
- package/browser/cjs/B-KQs1Bf48nEucW7.cjs +0 -7
- package/browser/cjs/B1xnY7pDnbnNzknG.cjs +0 -7
- package/browser/cjs/B6A5w_aWHkigBc6j.cjs +0 -7
- package/browser/cjs/B9jxuOg1CXcmbi9J.cjs +0 -110
- package/browser/cjs/BAYjkr4LmsWRLoPr.cjs +0 -7
- package/browser/cjs/BG2uV2RpxrfZyCuV.cjs +0 -7
- package/browser/cjs/BGCPG4Ip5ZijUQwi.cjs +0 -7
- package/browser/cjs/BHTlBOQH-tPGoKgo.cjs +0 -7
- package/browser/cjs/BLBNzBvRVl9VLynf.cjs +0 -7
- package/browser/cjs/BLh6E7ER8mrM6vc_.cjs +0 -7
- package/browser/cjs/BMaq_2S3IFrE5XeJ.cjs +0 -7
- package/browser/cjs/BO7Pbclmywy-QCSV.cjs +0 -13
- package/browser/cjs/BPlthbyKkqCDjgxO.cjs +0 -7
- package/browser/cjs/BUGo0mXtBfFOmQXV.cjs +0 -7
- package/browser/cjs/BdHdXCz_K1djQgI4.cjs +0 -7
- package/browser/cjs/BfNkb1jDZkJf3wRA.cjs +0 -7
- package/browser/cjs/BfdQd2UEOlOc5iF3.cjs +0 -7
- package/browser/cjs/Bi9KvObgq_kJ_pjC.cjs +0 -7
- package/browser/cjs/BjPpJjnABDd3_WOZ.cjs +0 -7
- package/browser/cjs/BsSNzyN8kOGCKzso.cjs +0 -7
- package/browser/cjs/BtCcoaKKb8ZDnliG.cjs +0 -7
- package/browser/cjs/BwHquG4sSd7OJjxz.cjs +0 -7
- package/browser/cjs/BywNBbTVRYbgRbNI.cjs +0 -7
- package/browser/cjs/C04Qr5P8uyQ6Vcml.cjs +0 -7
- package/browser/cjs/C42ZEPRmW9Wcd7tI.cjs +0 -7
- package/browser/cjs/CBpt1PBR1VfBegko.cjs +0 -7
- package/browser/cjs/CED8Az5C8GWF7pUT.cjs +0 -7
- package/browser/cjs/CbD4Wa5QLTdRCYcz.cjs +0 -7
- package/browser/cjs/CbILz9Skl6lWf6yR.cjs +0 -7
- package/browser/cjs/CoFQQqIzuvS9PM77.cjs +0 -7
- package/browser/cjs/CpDNo2Lhwr5ZHECs.cjs +0 -7
- package/browser/cjs/CsamfGfFsItvSgo_.cjs +0 -7
- package/browser/cjs/Cx3kn5gBsQ-1bORi.cjs +0 -7
- package/browser/cjs/CxLvGnG44-qNI36G.cjs +0 -7
- package/browser/cjs/D-xyWit7jxctQCpR.cjs +0 -7
- package/browser/cjs/D4XQsK7d7DRctaOO.cjs +0 -7
- package/browser/cjs/D9rVEA1BdB0JZwhE.cjs +0 -7
- package/browser/cjs/DES2NmIRVZg-HXgs.cjs +0 -7
- package/browser/cjs/DFxeLNhACFIHb0nv.cjs +0 -7
- package/browser/cjs/DIv1SrLYeyVwcaxE.cjs +0 -7
- package/browser/cjs/DJ6L43osbaMzEV5K.cjs +0 -7
- package/browser/cjs/DMjLN_HDktNzzUB8.cjs +0 -7
- package/browser/cjs/DVPfPZCFjmYu3xyn.cjs +0 -7
- package/browser/cjs/DhSlaiQXxEOVtZkA.cjs +0 -7
- package/browser/cjs/Dh_dFnagz7dMZlGh.cjs +0 -7
- package/browser/cjs/DpF6vgGka2d-RKkb.cjs +0 -10
- package/browser/cjs/DtY0Jzlwnr_YKnV4.cjs +0 -7
- package/browser/cjs/DwyyFI1Ix0uc0Qoz.cjs +0 -7
- package/browser/cjs/Dy5_viRzFls9rOzN.cjs +0 -7
- package/browser/cjs/GkINjQ8Te3GKi2mx.cjs +0 -7
- package/browser/cjs/aN3KCqswA1SdJIMq.cjs +0 -7
- package/browser/cjs/hLJbgylpETByV4wc.cjs +0 -7
- package/browser/cjs/qumqKlVHFx89iLeu.cjs +0 -7
- package/browser/cjs/rKZjTYQ0WpTriIv6.cjs +0 -7
- package/browser/cjs/xjKotAOVt3JH36U7.cjs +0 -7
- package/browser/cjs/ymbPxio09Fw7I2BW.cjs +0 -7
- package/browser/esm/2P5dQT7wZToOh-n9.mjs +0 -7
- package/browser/esm/4GgcUVhUmQmiv9Ha.mjs +0 -110
- package/browser/esm/7_x68v6PpvRDox_Z.mjs +0 -7
- package/browser/esm/9icgSuuzXq6mlgM8.mjs +0 -7
- package/browser/esm/B354iAatN9y9AIIP.mjs +0 -7
- package/browser/esm/B5EVyoxm3aSlAnxN.mjs +0 -7
- package/browser/esm/BD8rE7MUxuHXsdcf.mjs +0 -7
- package/browser/esm/BGFWI1a1PmU8_hCE.mjs +0 -7
- package/browser/esm/BI6JAQCQx1V0F2aC.mjs +0 -7
- package/browser/esm/BIYg30d_9HaluFFz.mjs +0 -7
- package/browser/esm/BKL-uyBp_OE47lXd.mjs +0 -7
- package/browser/esm/BMwJCtLAYUW8wExX.mjs +0 -13
- package/browser/esm/BNOfK-lGWF2S8vQE.mjs +0 -7
- package/browser/esm/Ba433v6lQUMtECiY.mjs +0 -7
- package/browser/esm/BbZWfDW2LUyjqUDy.mjs +0 -7
- package/browser/esm/C238uBmZN1XXqMUb.mjs +0 -7
- package/browser/esm/C34whwRkHO0lhq4-.mjs +0 -7
- package/browser/esm/C6FEpAqSZoW5Hgte.mjs +0 -7
- package/browser/esm/COlW5ULL29SUKN1Z.mjs +0 -7
- package/browser/esm/CRyxOj2xPj9qe9LK.mjs +0 -7
- package/browser/esm/CVyVvtlJuCTn4MDh.mjs +0 -7
- package/browser/esm/CapeIfjWq-_BHMlE.mjs +0 -7
- package/browser/esm/CcQqGNgK2CsgNtuD.mjs +0 -7
- package/browser/esm/CdZSxrk3k1Lx6G8W.mjs +0 -7
- package/browser/esm/CdchvB_wAbv_6Whw.mjs +0 -7
- package/browser/esm/Cf8eDl3Tu5NAWWwG.mjs +0 -7
- package/browser/esm/Cfq9tttQlsKvfaCr.mjs +0 -7
- package/browser/esm/ClR6uLJoM-xKVYEc.mjs +0 -7
- package/browser/esm/Cnl_e-EYkZ3CLbi2.mjs +0 -7
- package/browser/esm/CtRS2ZCPF7IH_mXe.mjs +0 -7
- package/browser/esm/CuV-bwi1vcXAqFUY.mjs +0 -7
- package/browser/esm/CwVE0qelO_xgf-l1.mjs +0 -7
- package/browser/esm/D1Dzlta8ZVy08ng6.mjs +0 -7
- package/browser/esm/D1TjRQiHLWhpl-dl.mjs +0 -7
- package/browser/esm/D8BJ-y3ulgO_ezrj.mjs +0 -10
- package/browser/esm/DTDXNEbHVnnZONNL.mjs +0 -7
- package/browser/esm/DTWfi8Dl-c2s5moT.mjs +0 -7
- package/browser/esm/DYVBXcu1r5KRLB-1.mjs +0 -7
- package/browser/esm/DZjWyWMvr2XHQrBg.mjs +0 -7
- package/browser/esm/DhHK4QmASvgAq9Xy.mjs +0 -7
- package/browser/esm/DoFV2S6Su86IN5Ul.mjs +0 -7
- package/browser/esm/Dq3ybkgattcCsF_4.mjs +0 -7
- package/browser/esm/DqWoZ4TjweoJWX3o.mjs +0 -7
- package/browser/esm/DtXxHirBm16ldE1l.mjs +0 -7
- package/browser/esm/DtuWZG6c_8vKRSdr.mjs +0 -7
- package/browser/esm/FBG8XXdIMd9PfUIo.mjs +0 -7
- package/browser/esm/Nh7JiwvF01PblHQ0.mjs +0 -7
- package/browser/esm/PVYiH9vBQM6rqXI4.mjs +0 -7
- package/browser/esm/U5-LDZQ0qkJ2Y-p8.mjs +0 -7
- package/browser/esm/XhQDWZu47oe6bwHh.mjs +0 -7
- package/browser/esm/_BjU6TtI-mQfFpfy.mjs +0 -7
- package/browser/esm/gOUfyCw957TzcbNB.mjs +0 -7
- package/browser/esm/lmkbfs9sNc7f0oe5.mjs +0 -7
- package/browser/esm/naa0kcRwxHEYGaQB.mjs +0 -7
- package/browser/esm/qxOkQutRxmAi1vRh.mjs +0 -7
- package/browser/esm/tMSro0g2GM5BBTIH.mjs +0 -7
- package/cdn/assets/B-kFRtzNNkf4_SiP.js +0 -1701
- package/cdn/assets/BAzGoI9gE2G3F3on.js +0 -637
- package/cdn/assets/BLqaorJ5Wl-1YOoy.js +0 -3875
- package/cdn/assets/BQON-ToGsIBPrPkM.js +0 -1371
- package/cdn/assets/CHTspRZD2v_dU_eV.js +0 -22
- package/cdn/assets/CMBDD1Mjde6UL5ep.js +0 -84
- package/cdn/assets/CwdMjMPFdIs8SAV0.js +0 -1358
- package/cdn/assets/DUtu7r6CzW4dtW3E.js +0 -50
- package/cdn/assets/Dr5X-ng9wbwUWVr4.js +0 -41
- package/cdn/assets/Dvj7UEckqOBrgs9i.js +0 -3947
- package/cdn/assets/KtKlo5mM4kTTfFgi.js +0 -46
- package/cdn/assets/NTINjW8JjyZudT8s.js +0 -13449
- package/cdn/assets/R9RwlorPWfftoboH.js +0 -2373
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{aP as e,u as t,_ as n,aQ as r,aR as i,W as o,aS as s,aT as a,aU as c,aV as u,aW as l,l as h,aX as f,aY as d}from"./4GgcUVhUmQmiv9Ha.mjs";var p="object"==typeof global&&global&&global.Object===Object&&global,m="object"==typeof self&&self&&self.Object===Object&&self,E=p||m||Function("return this")(),g=E.Symbol,T=Object.prototype,A=T.hasOwnProperty,I=T.toString,N=g?g.toStringTag:void 0,y=Object.prototype.toString,R=g?g.toStringTag:void 0;function v(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":R&&R in Object(e)?function(e){var t=A.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch(e){}var i=I.call(e);return r&&(t?e[N]=n:delete e[N]),i}(e):function(e){return y.call(e)}(e)}function O(e){return null!=e&&"object"==typeof e}function S(e){return"symbol"==typeof e||O(e)&&"[object Symbol]"==v(e)}function _(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var L=Array.isArray,x=g?g.prototype:void 0,C=x?x.toString:void 0;function k(e){if("string"==typeof e)return e;if(L(e))return _(e,k)+"";if(S(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var b=/\s/,P=/^\s+/;function w(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var M=/^[-+]0x[0-9a-f]+$/i,U=/^0b[01]+$/i,F=/^0o[0-7]+$/i,D=parseInt,j=1/0;function B(e){return e?(e=function(e){if("number"==typeof e)return e;if(S(e))return NaN;if(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&b.test(e.charAt(t)););return t}(e)+1).replace(P,""):e}(e);var n=U.test(e);return n||F.test(e)?D(e.slice(2),n?2:8):M.test(e)?NaN:+e}(e))===j||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function $(e){var t=B(e),n=t%1;return t==t?n?t-n:t:0}function W(e){return e}function G(e){if(!w(e))return!1;var t=v(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var K,z=E["__core-js_shared__"],V=(K=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",H=Function.prototype.toString;function Y(e){if(null!=e){try{return H.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var X=/^\[object .+?Constructor\]$/,q=Function.prototype,Z=Object.prototype,Q=q.toString,J=Z.hasOwnProperty,ee=RegExp("^"+Q.call(J).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function te(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!w(e)||(t=e,V&&V in t))&&(G(e)?ee:X).test(Y(e));var t}(n)?n:void 0}var ne=te(E,"WeakMap"),re=Object.create,ie=function(){function e(){}return function(t){if(!w(t))return{};if(re)return re(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function oe(){}var se,ae,ce,ue=Date.now,le=function(){try{var e=te(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),he=le?function(e,t){return le(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:W,fe=(se=he,ae=0,ce=0,function(){var e=ue(),t=16-(e-ce);if(ce=e,t>0){if(++ae>=800)return arguments[0]}else ae=0;return se.apply(void 0,arguments)});function de(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function pe(e,t,n,r){for(var i=e.length,o=n+-1;++o<i;)if(t(e[o],o,e))return o;return-1}function me(e){return e!=e}function Ee(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):pe(e,me,n)}function ge(e,t){return!(null==e||!e.length)&&Ee(e,t,0)>-1}var Te=/^(?:0|[1-9]\d*)$/;function Ae(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Te.test(e))&&e>-1&&e%1==0&&e<t}function Ie(e,t,n){"__proto__"==t&&le?le(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ne(e,t){return e===t||e!=e&&t!=t}var ye=Object.prototype.hasOwnProperty;function Re(e,t,n){var r=e[t];ye.call(e,t)&&Ne(r,n)&&(void 0!==n||t in e)||Ie(e,t,n)}function ve(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],c=void 0;void 0===c&&(c=e[a]),i?Ie(n,a,c):Re(n,a,c)}return n}var Oe=Math.max;function Se(e,t){return fe(function(e,t,n){return t=Oe(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Oe(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,t,W),e+"")}function _e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Le(e){return null!=e&&_e(e.length)&&!G(e)}function xe(e,t,n){if(!w(n))return!1;var r=typeof t;return!!("number"==r?Le(n)&&Ae(t,n.length):"string"==r&&t in n)&&Ne(n[t],e)}var Ce=Object.prototype;function ke(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ce)}function be(e){return O(e)&&"[object Arguments]"==v(e)}var Pe=Object.prototype,we=Pe.hasOwnProperty,Me=Pe.propertyIsEnumerable,Ue=be(function(){return arguments}())?be:function(e){return O(e)&&we.call(e,"callee")&&!Me.call(e,"callee")},Fe="object"==typeof exports&&exports&&!exports.nodeType&&exports,De=Fe&&"object"==typeof module&&module&&!module.nodeType&&module,je=De&&De.exports===Fe?E.Buffer:void 0,Be=(je?je.isBuffer:void 0)||function(){return!1},$e={};function We(e){return function(t){return e(t)}}$e["[object Float32Array]"]=$e["[object Float64Array]"]=$e["[object Int8Array]"]=$e["[object Int16Array]"]=$e["[object Int32Array]"]=$e["[object Uint8Array]"]=$e["[object Uint8ClampedArray]"]=$e["[object Uint16Array]"]=$e["[object Uint32Array]"]=!0,$e["[object Arguments]"]=$e["[object Array]"]=$e["[object ArrayBuffer]"]=$e["[object Boolean]"]=$e["[object DataView]"]=$e["[object Date]"]=$e["[object Error]"]=$e["[object Function]"]=$e["[object Map]"]=$e["[object Number]"]=$e["[object Object]"]=$e["[object RegExp]"]=$e["[object Set]"]=$e["[object String]"]=$e["[object WeakMap]"]=!1;var Ge="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ke=Ge&&"object"==typeof module&&module&&!module.nodeType&&module,ze=Ke&&Ke.exports===Ge&&p.process,Ve=function(){try{return Ke&&Ke.require&&Ke.require("util").types||ze&&ze.binding&&ze.binding("util")}catch(e){}}(),He=Ve&&Ve.isTypedArray,Ye=He?We(He):function(e){return O(e)&&_e(e.length)&&!!$e[v(e)]},Xe=Object.prototype.hasOwnProperty;function qe(e,t){var n=L(e),r=!n&&Ue(e),i=!n&&!r&&Be(e),o=!n&&!r&&!i&&Ye(e),s=n||r||i||o,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)!t&&!Xe.call(e,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Ae(u,c))||a.push(u);return a}function Ze(e,t){return function(n){return e(t(n))}}var Qe=Ze(Object.keys,Object),Je=Object.prototype.hasOwnProperty;function et(e){if(!ke(e))return Qe(e);var t=[];for(var n in Object(e))Je.call(e,n)&&"constructor"!=n&&t.push(n);return t}function tt(e){return Le(e)?qe(e):et(e)}var nt,rt=Object.prototype.hasOwnProperty,it=(nt=function(e,t){if(ke(t)||Le(t))ve(t,tt(t),e);else for(var n in t)rt.call(t,n)&&Re(e,n,t[n])},Se(function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=nt.length>3&&"function"==typeof i?(r--,i):void 0,o&&xe(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var s=t[n];s&&nt(e,s)}return e})),ot=Object.prototype.hasOwnProperty;function st(e){return Le(e)?qe(e,!0):function(e){if(!w(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ke(e),n=[];for(var r in e)("constructor"!=r||!t&&ot.call(e,r))&&n.push(r);return n}(e)}var at=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ct=/^\w*$/;function ut(e,t){if(L(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!S(e))||ct.test(e)||!at.test(e)||null!=t&&e in Object(t)}var lt=te(Object,"create"),ht=Object.prototype.hasOwnProperty,ft=Object.prototype.hasOwnProperty;function dt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function pt(e,t){for(var n=e.length;n--;)if(Ne(e[n][0],t))return n;return-1}dt.prototype.clear=function(){this.__data__=lt?lt(null):{},this.size=0},dt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},dt.prototype.get=function(e){var t=this.__data__;if(lt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ht.call(t,e)?t[e]:void 0},dt.prototype.has=function(e){var t=this.__data__;return lt?void 0!==t[e]:ft.call(t,e)},dt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=lt&&void 0===t?"__lodash_hash_undefined__":t,this};var mt=Array.prototype.splice;function Et(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Et.prototype.clear=function(){this.__data__=[],this.size=0},Et.prototype.delete=function(e){var t=this.__data__,n=pt(t,e);return!(n<0||(n==t.length-1?t.pop():mt.call(t,n,1),--this.size,0))},Et.prototype.get=function(e){var t=this.__data__,n=pt(t,e);return n<0?void 0:t[n][1]},Et.prototype.has=function(e){return pt(this.__data__,e)>-1},Et.prototype.set=function(e,t){var n=this.__data__,r=pt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var gt=te(E,"Map");function Tt(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function At(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function It(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(It.Cache||At),n}At.prototype.clear=function(){this.size=0,this.__data__={hash:new dt,map:new(gt||Et),string:new dt}},At.prototype.delete=function(e){var t=Tt(this,e).delete(e);return this.size-=t?1:0,t},At.prototype.get=function(e){return Tt(this,e).get(e)},At.prototype.has=function(e){return Tt(this,e).has(e)},At.prototype.set=function(e,t){var n=Tt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},It.Cache=At;var Nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yt=/\\(\\)?/g,Rt=function(){var e=It(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Nt,function(e,n,r,i){t.push(r?i.replace(yt,"$1"):n||e)}),t},function(e){return 500===t.size&&t.clear(),e}),t=e.cache;return e}();function vt(e,t){return L(e)?e:ut(e,t)?[e]:Rt(function(e){return null==e?"":k(e)}(e))}function Ot(e){if("string"==typeof e||S(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function St(e,t){for(var n=0,r=(t=vt(t,e)).length;null!=e&&n<r;)e=e[Ot(t[n++])];return n&&n==r?e:void 0}function _t(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Lt=g?g.isConcatSpreadable:void 0;function xt(e){return L(e)||Ue(e)||!!(Lt&&e&&e[Lt])}function Ct(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=xt),i||(i=[]);++o<s;){var a=e[o];n(a)?_t(i,a):r||(i[i.length]=a)}return i}function kt(e){return null!=e&&e.length?Ct(e):[]}var bt=Ze(Object.getPrototypeOf,Object);function Pt(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function wt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Mt(e){var t=this.__data__=new Et(e);this.size=t.size}Mt.prototype.clear=function(){this.__data__=new Et,this.size=0},Mt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mt.prototype.get=function(e){return this.__data__.get(e)},Mt.prototype.has=function(e){return this.__data__.has(e)},Mt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Et){var r=n.__data__;if(!gt||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new At(r)}return n.set(e,t),this.size=n.size,this};var Ut="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ft=Ut&&"object"==typeof module&&module&&!module.nodeType&&module,Dt=Ft&&Ft.exports===Ut?E.Buffer:void 0,jt=Dt?Dt.allocUnsafe:void 0;function Bt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function $t(){return[]}var Wt=Object.prototype.propertyIsEnumerable,Gt=Object.getOwnPropertySymbols,Kt=Gt?function(e){return null==e?[]:(e=Object(e),Bt(Gt(e),function(t){return Wt.call(e,t)}))}:$t,zt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)_t(t,Kt(e)),e=bt(e);return t}:$t;function Vt(e,t,n){var r=t(e);return L(e)?r:_t(r,n(e))}function Ht(e){return Vt(e,tt,Kt)}var Yt=te(E,"DataView"),Xt=te(E,"Promise"),qt=te(E,"Set"),Zt="[object Map]",Qt="[object Promise]",Jt="[object Set]",en="[object WeakMap]",tn="[object DataView]",nn=Y(Yt),rn=Y(gt),on=Y(Xt),sn=Y(qt),an=Y(ne),cn=v;(Yt&&cn(new Yt(new ArrayBuffer(1)))!=tn||gt&&cn(new gt)!=Zt||Xt&&cn(Xt.resolve())!=Qt||qt&&cn(new qt)!=Jt||ne&&cn(new ne)!=en)&&(cn=function(e){var t=v(e),n="[object Object]"==t?e.constructor:void 0,r=n?Y(n):"";if(r)switch(r){case nn:return tn;case rn:return Zt;case on:return Qt;case sn:return Jt;case an:return en}return t});var un=Object.prototype.hasOwnProperty,ln=E.Uint8Array,hn=/\w*$/,fn=g?g.prototype:void 0,dn=fn?fn.valueOf:void 0;var pn=Ve&&Ve.isMap,mn=pn?We(pn):function(e){return O(e)&&"[object Map]"==cn(e)},En=Ve&&Ve.isSet,gn=En?We(En):function(e){return O(e)&&"[object Set]"==cn(e)},Tn="[object Arguments]",An="[object Function]",In="[object Object]",Nn={};function yn(e,t,n,r,i,o){var s;if(void 0!==s)return s;if(!w(e))return e;var a=L(e);if(a)return s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&un.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,s);var c=cn(e),u=c==An||"[object GeneratorFunction]"==c;if(Be(e))return function(e){var t=e.length,n=jt?jt(t):new e.constructor(t);return e.copy(n),n}(e);if(c==In||c==Tn||u&&!i)return s=u?{}:function(e){return"function"!=typeof e.constructor||ke(e)?{}:ie(bt(e))}(e),function(e,t){return ve(e,Kt(e),t)}(e,function(e,t){return e&&ve(t,tt(t),e)}(s,e));if(!Nn[c])return i?e:{};s=function(e,t){var n,r,i,o,s,a=e.constructor;switch(t){case"[object ArrayBuffer]":return s=new(o=e).constructor(o.byteLength),new ln(s).set(new ln(o)),s;case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return i=(r=e).buffer,new r.constructor(i,r.byteOffset,r.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=e.buffer;return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,hn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return n=e,dn?Object(dn.call(n)):{}}}(e,c),o||(o=new Mt);var l=o.get(e);if(l)return l;o.set(e,s),gn(e)?e.forEach(function(r){s.add(yn(r,t,n,r,e,o))}):mn(e)&&e.forEach(function(r,i){s.set(i,yn(r,t,n,i,e,o))});var h=a?void 0:Ht(e);return de(h||e,function(r,i){h&&(r=e[i=r]),Re(s,i,yn(r,t,n,i,e,o))}),s}function Rn(e){return yn(e,4)}function vn(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i}function On(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new At;++t<n;)this.add(e[t])}function Sn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function _n(e,t){return e.has(t)}function Ln(e,t,n,r,i,o){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(e),l=o.get(t);if(u&&l)return u==t&&l==e;var h=-1,f=!0,d=2&n?new On:void 0;for(o.set(e,t),o.set(t,e);++h<a;){var p=e[h],m=t[h];if(r)var E=s?r(m,p,h,t,e,o):r(p,m,h,e,t,o);if(void 0!==E){if(E)continue;f=!1;break}if(d){if(!Sn(t,function(e,t){if(!_n(d,t)&&(p===e||i(p,e,n,r,o)))return d.push(t)})){f=!1;break}}else if(p!==m&&!i(p,m,n,r,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function xn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}Nn[Tn]=Nn["[object Array]"]=Nn["[object ArrayBuffer]"]=Nn["[object DataView]"]=Nn["[object Boolean]"]=Nn["[object Date]"]=Nn["[object Float32Array]"]=Nn["[object Float64Array]"]=Nn["[object Int8Array]"]=Nn["[object Int16Array]"]=Nn["[object Int32Array]"]=Nn["[object Map]"]=Nn["[object Number]"]=Nn[In]=Nn["[object RegExp]"]=Nn["[object Set]"]=Nn["[object String]"]=Nn["[object Symbol]"]=Nn["[object Uint8Array]"]=Nn["[object Uint8ClampedArray]"]=Nn["[object Uint16Array]"]=Nn["[object Uint32Array]"]=!0,Nn["[object Error]"]=Nn[An]=Nn["[object WeakMap]"]=!1,On.prototype.add=On.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},On.prototype.has=function(e){return this.__data__.has(e)};var kn=g?g.prototype:void 0,bn=kn?kn.valueOf:void 0,Pn=Object.prototype.hasOwnProperty,wn="[object Arguments]",Mn="[object Array]",Un="[object Object]",Fn=Object.prototype.hasOwnProperty;function Dn(e,t,n,r,i){return e===t||(null==e||null==t||!O(e)&&!O(t)?e!=e&&t!=t:function(e,t,n,r,i,o){var s=L(e),a=L(t),c=s?Mn:cn(e),u=a?Mn:cn(t),l=(c=c==wn?Un:c)==Un,h=(u=u==wn?Un:u)==Un,f=c==u;if(f&&Be(e)){if(!Be(t))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new Mt),s||Ye(e)?Ln(e,t,n,r,i,o):function(e,t,n,r,i,o,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new ln(e),new ln(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ne(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=xn;case"[object Set]":var c=1&r;if(a||(a=Cn),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var l=Ln(a(e),a(t),r,i,o,s);return s.delete(e),l;case"[object Symbol]":if(bn)return bn.call(e)==bn.call(t)}return!1}(e,t,c,n,r,i,o);if(!(1&n)){var d=l&&Fn.call(e,"__wrapped__"),p=h&&Fn.call(t,"__wrapped__");if(d||p){var m=d?e.value():e,E=p?t.value():t;return o||(o=new Mt),i(m,E,n,r,o)}}return!!f&&(o||(o=new Mt),function(e,t,n,r,i,o){var s=1&n,a=Ht(e),c=a.length;if(c!=Ht(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:Pn.call(t,l)))return!1}var h=o.get(e),f=o.get(t);if(h&&f)return h==t&&f==e;var d=!0;o.set(e,t),o.set(t,e);for(var p=s;++u<c;){var m=e[l=a[u]],E=t[l];if(r)var g=s?r(E,m,l,t,e,o):r(m,E,l,e,t,o);if(!(void 0===g?m===E||i(m,E,n,r,o):g)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var T=e.constructor,A=t.constructor;T==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof T&&T instanceof T&&"function"==typeof A&&A instanceof A||(d=!1)}return o.delete(e),o.delete(t),d}(e,t,n,r,i,o))}(e,t,n,r,Dn,i))}function jn(e){return e==e&&!w(e)}function Bn(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}function $n(e,t){return null!=e&&t in Object(e)}function Wn(e,t,n){for(var r=-1,i=(t=vt(t,e)).length,o=!1;++r<i;){var s=Ot(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&_e(i)&&Ae(s,i)&&(L(e)||Ue(e))}function Gn(e){return"function"==typeof e?e:null==e?W:"object"==typeof e?L(e)?function(e,t){return ut(e)&&jn(t)?Bn(Ot(e),t):function(n){var r=function(e,t){var n=null==e?void 0:St(e,t);return void 0===n?void 0:n}(n,e);return void 0===r&&r===t?function(e,t){return null!=e&&Wn(e,t,$n)}(n,e):Dn(t,r,3)}}(e[0],e[1]):function(e){var t=function(e){for(var t=tt(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,jn(i)]}return t}(e);return 1==t.length&&t[0][2]?Bn(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n){var r=n.length,i=r;if(null==e)return!i;for(e=Object(e);r--;){var o=n[r];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r<i;){var s=(o=n[r])[0],a=e[s],c=o[1];if(o[2]){if(void 0===a&&!(s in e))return!1}else if(!Dn(c,a,3,void 0,new Mt))return!1}return!0}(n,0,t)}}(e):function(e){return ut(e)?(t=Ot(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return St(t,e)}}(e);var t}(e)}function Kn(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}var zn,Vn=(zn=function(e,t){return e&&function(e,t,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var a=o[++r];if(!1===t(i[a],a,i))break}return e}(e,t,tt)},function(e,t){if(null==e)return e;if(!Le(e))return zn(e,t);for(var n=e.length,r=-1,i=Object(e);++r<n&&!1!==t(i[r],r,i););return e});function Hn(e,t,n,r){return Vn(e,function(e,i,o){t(r,e,n(e),o)}),r}var Yn=Object.prototype,Xn=Yn.hasOwnProperty,qn=Se(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&xe(t[0],t[1],i)&&(r=1);++n<r;)for(var o=t[n],s=st(o),a=-1,c=s.length;++a<c;){var u=s[a],l=e[u];(void 0===l||Ne(l,Yn[u])&&!Xn.call(e,u))&&(e[u]=o[u])}return e});function Zn(e){return O(e)&&Le(e)}var Qn=Se(function(e,t){return Zn(e)?function(e,t){var n=-1,r=ge,i=!0,o=e.length,s=[],a=t.length;if(!o)return s;t.length>=200&&(r=_n,i=!1,t=new On(t));e:for(;++n<o;){var c=e[n],u=c;if(c=0!==c?c:0,i&&u==u){for(var l=a;l--;)if(t[l]===u)continue e;s.push(c)}else r(t,u,undefined)||s.push(c)}return s}(e,Ct(t,0,Zn,!0)):[]});function Jn(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function er(e,t,n){var r=null==e?0:e.length;return r?Pt(e,(t=void 0===t?1:$(t))<0?0:t,r):[]}function tr(e,t,n){var r=null==e?0:e.length;return r?Pt(e,0,(t=r-(t=void 0===t?1:$(t)))<0?0:t):[]}function nr(e,t){var n;return(L(e)?de:Vn)(e,"function"==typeof(n=t)?n:W)}function rr(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function ir(e,t){var n=!0;return Vn(e,function(e,r,i){return n=!!t(e,r,i)}),n}function or(e,t,n){return(L(e)?rr:ir)(e,Gn(t))}function sr(e,t){var n=[];return Vn(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function ar(e,t){return(L(e)?Bt:sr)(e,Gn(t))}var cr,ur=Math.max,lr=(cr=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:$(n);return i<0&&(i=ur(r+i,0)),pe(e,Gn(t),i)},function(e,t,n){var r=Object(e);if(!Le(e)){var i=Gn(t);e=tt(e),t=function(e){return i(r[e],e,r)}}var o=cr(e,t,n);return o>-1?r[i?e[o]:o]:void 0});function hr(e){return e&&e.length?e[0]:void 0}function fr(e,t){var n=-1,r=Le(e)?Array(e.length):[];return Vn(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function dr(e,t){return(L(e)?_:fr)(e,Gn(t))}function pr(e,t){return Ct(dr(e,t))}var mr,Er=Object.prototype.hasOwnProperty,gr=(mr=function(e,t,n){Er.call(e,n)?e[n].push(t):Ie(e,n,[t])},function(e,t){return(L(e)?Kn:Hn)(e,mr,Gn(t),{})}),Tr=Object.prototype.hasOwnProperty;function Ar(e,t){return null!=e&&Tr.call(e,t)}function Ir(e,t){return null!=e&&Wn(e,t,Ar)}function Nr(e){return"string"==typeof e||!L(e)&&O(e)&&"[object String]"==v(e)}function yr(e){return null==e?[]:function(e,t){return _(t,function(t){return e[t]})}(e,tt(e))}var Rr=Math.max;function vr(e,t,n,r){e=Le(e)?e:yr(e),n=n?$(n):0;var i=e.length;return n<0&&(n=Rr(i+n,0)),Nr(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ee(e,t,n)>-1}function Or(e,t,n){return null!=e&&e.length?Ee(e,t,0):-1}var Sr=Object.prototype.hasOwnProperty;function _r(e){if(null==e)return!0;if(Le(e)&&(L(e)||"string"==typeof e||"function"==typeof e.splice||Be(e)||Ye(e)||Ue(e)))return!e.length;var t=cn(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ke(e))return!et(e).length;for(var n in e)if(Sr.call(e,n))return!1;return!0}var Lr=Ve&&Ve.isRegExp,xr=Lr?We(Lr):function(e){return O(e)&&"[object RegExp]"==v(e)};function Cr(e){return void 0===e}function kr(e,t,n,r){if(!w(e))return e;for(var i=-1,o=(t=vt(t,e)).length,s=o-1,a=e;null!=a&&++i<o;){var c=Ot(t[i]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=s){var l=a[c];void 0===(u=void 0)&&(u=w(l)?l:Ae(t[i+1])?[]:{})}Re(a,c,u),a=a[c]}return e}function br(e,t){if(null==e)return{};var n=_(function(e){return Vt(e,st,zt)}(e),function(e){return[e]});return t=Gn(t),function(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=St(e,s);n(a,s)&&kr(o,vt(s,e),a)}return o}(e,n,function(e,n){return t(e,n[0])})}function Pr(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function wr(e,t,n){var r=L(e)?wt:Pr,i=arguments.length<3;return r(e,Gn(t),n,i,Vn)}function Mr(e,t){return(L(e)?Bt:sr)(e,function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}(Gn(t)))}function Ur(e,t){var n;return Vn(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function Fr(e,t,n){return(L(e)?Sn:Ur)(e,Gn(t))}var Dr=qt&&1/Cn(new qt([,-0]))[1]==1/0?function(e){return new qt(e)}:oe;function jr(e){return e&&e.length?function(e){var t=-1,n=ge,r=e.length,i=!0,o=[],s=o;if(r>=200){var a=Dr(e);if(a)return Cn(a);i=!1,n=_n,s=new On}else s=o;e:for(;++t<r;){var c=e[t],u=c;if(c=0!==c?c:0,i&&u==u){for(var l=s.length;l--;)if(s[l]===u)continue e;o.push(c)}else n(s,u,undefined)||(s!==o&&s.push(u),o.push(c))}return o}(e):[]}function Br(e){console&&console.error&&console.error(`Error: ${e}`)}function $r(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function Wr(e){const t=(new Date).getTime(),n=e();return{time:(new Date).getTime()-t,value:n}}function Gr(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}function Kr(e){return Nr((t=e).LABEL)&&""!==t.LABEL?e.LABEL:e.name;var t}class zr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),nr(this.definition,t=>{t.accept(e)})}}class Vr extends zr{constructor(e){super([]),this.idx=1,it(this,br(e,e=>void 0!==e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Hr extends zr{constructor(e){super(e.definition),this.orgText="",it(this,br(e,e=>void 0!==e))}}class Yr extends zr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,it(this,br(e,e=>void 0!==e))}}class Xr extends zr{constructor(e){super(e.definition),this.idx=1,it(this,br(e,e=>void 0!==e))}}class qr extends zr{constructor(e){super(e.definition),this.idx=1,it(this,br(e,e=>void 0!==e))}}class Zr extends zr{constructor(e){super(e.definition),this.idx=1,it(this,br(e,e=>void 0!==e))}}class Qr extends zr{constructor(e){super(e.definition),this.idx=1,it(this,br(e,e=>void 0!==e))}}class Jr extends zr{constructor(e){super(e.definition),this.idx=1,it(this,br(e,e=>void 0!==e))}}class ei extends zr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,it(this,br(e,e=>void 0!==e))}}class ti{constructor(e){this.idx=1,it(this,br(e,e=>void 0!==e))}accept(e){e.visit(this)}}function ni(e){function t(e){return dr(e,ni)}if(e instanceof Vr){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return Nr(e.label)&&(t.label=e.label),t}if(e instanceof Yr)return{type:"Alternative",definition:t(e.definition)};if(e instanceof Xr)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof qr)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Zr)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:ni(new ti({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Jr)return{type:"RepetitionWithSeparator",idx:e.idx,separator:ni(new ti({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Qr)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof ei)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof ti){const t={type:"Terminal",name:e.terminalType.name,label:Kr(e.terminalType),idx:e.idx};Nr(e.label)&&(t.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=xr(n)?n.source:n),t}if(e instanceof Hr)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}class ri{visit(e){const t=e;switch(t.constructor){case Vr:return this.visitNonTerminal(t);case Yr:return this.visitAlternative(t);case Xr:return this.visitOption(t);case qr:return this.visitRepetitionMandatory(t);case Zr:return this.visitRepetitionMandatoryWithSeparator(t);case Jr:return this.visitRepetitionWithSeparator(t);case Qr:return this.visitRepetition(t);case ei:return this.visitAlternation(t);case ti:return this.visitTerminal(t);case Hr:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function ii(e,t=[]){return!!(e instanceof Xr||e instanceof Qr||e instanceof Jr)||(e instanceof ei?Fr(e.definition,e=>ii(e,t)):!(e instanceof Vr&&vr(t,e))&&e instanceof zr&&(e instanceof Vr&&t.push(e),or(e.definition,e=>ii(e,t))))}function oi(e){if(e instanceof Vr)return"SUBRULE";if(e instanceof Xr)return"OPTION";if(e instanceof ei)return"OR";if(e instanceof qr)return"AT_LEAST_ONE";if(e instanceof Zr)return"AT_LEAST_ONE_SEP";if(e instanceof Jr)return"MANY_SEP";if(e instanceof Qr)return"MANY";if(e instanceof ti)return"CONSUME";throw Error("non exhaustive match")}class si{walk(e,t=[]){nr(e.definition,(n,r)=>{const i=er(e.definition,r+1);if(n instanceof Vr)this.walkProdRef(n,i,t);else if(n instanceof ti)this.walkTerminal(n,i,t);else if(n instanceof Yr)this.walkFlat(n,i,t);else if(n instanceof Xr)this.walkOption(n,i,t);else if(n instanceof qr)this.walkAtLeastOne(n,i,t);else if(n instanceof Zr)this.walkAtLeastOneSep(n,i,t);else if(n instanceof Jr)this.walkManySep(n,i,t);else if(n instanceof Qr)this.walkMany(n,i,t);else{if(!(n instanceof ei))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new Xr({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=ai(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new Xr({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=ai(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);nr(e.definition,e=>{const t=new Yr({definition:[e]});this.walk(t,r)})}}function ai(e,t,n){return[new Xr({definition:[new ti({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function ci(e){if(e instanceof Vr)return ci(e.referencedRule);if(e instanceof ti)return[e.terminalType];if(function(e){return e instanceof Yr||e instanceof Xr||e instanceof Qr||e instanceof qr||e instanceof Zr||e instanceof Jr||e instanceof ti||e instanceof Hr}(e))return function(e){let t=[];const n=e.definition;let r,i=0,o=n.length>i,s=!0;for(;o&&s;)r=n[i],s=ii(r),t=t.concat(ci(r)),i+=1,o=n.length>i;return jr(t)}(e);if(function(e){return e instanceof ei}(e))return function(e){const t=dr(e.definition,e=>ci(e));return jr(kt(t))}(e);throw Error("non exhaustive match")}const ui="_~IN~_";class li extends si{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,o=e.idx,i.name+o+ui+this.topProd.name);var i,o;const s=t.concat(n),a=ci(new Yr({definition:s}));this.follows[r]=a}}function hi(e){return e.charCodeAt(0)}function fi(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function di(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function pi(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function mi(e){return"Character"===e.type}const Ei=[];for(let e=hi("0");e<=hi("9");e++)Ei.push(e);const gi=[hi("_")].concat(Ei);for(let e=hi("a");e<=hi("z");e++)gi.push(e);for(let e=hi("A");e<=hi("Z");e++)gi.push(e);const Ti=[hi(" "),hi("\f"),hi("\n"),hi("\r"),hi("\t"),hi("\v"),hi("\t"),hi(" "),hi(" "),hi(" "),hi(" "),hi(" "),hi(" "),hi(" "),hi(" "),hi(" "),hi(" "),hi(" "),hi(" "),hi(" "),hi("\u2028"),hi("\u2029"),hi(" "),hi(" "),hi(" "),hi("\ufeff")],Ai=/[0-9a-fA-F]/,Ii=/[0-9]/,Ni=/[1-9]/;class yi{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}let Ri={};const vi=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":di(n,"global");break;case"i":di(n,"ignoreCase");break;case"m":di(n,"multiLine");break;case"u":di(n,"unicode");break;case"y":di(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}pi(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return function(){throw Error("Internal Error - Should never get here!")}()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;pi(t)}if(!0!==e||void 0!==t)return pi(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}if(void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),pi(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[hi("\n"),hi("\r"),hi("\u2028"),hi("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Ei;break;case"D":e=Ei,t=!0;break;case"s":e=Ti;break;case"S":e=Ti,t=!0;break;case"w":e=gi;break;case"W":e=gi,t=!0}if(pi(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=hi("\f");break;case"n":e=hi("\n");break;case"r":e=hi("\r");break;case"t":e=hi("\t");break;case"v":e=hi("\v")}if(pi(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:hi("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:hi(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:hi(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,mi(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,mi(n)){if(n.value<t.value)throw Error("Range out of order in character class");e.push({from:t.value,to:n.value})}else fi(t.value,e),e.push(hi("-")),fi(n.value,e)}else fi(t.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}}classAtom(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:hi("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;this.consumeChar("("),"?"===this.peekChar(0)?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;const t=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(!1===Ni.test(e))throw Error("Expecting a positive integer");for(;Ii.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(!1===Ii.test(e))throw Error("Expecting an integer");for(;Ii.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:hi(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return"-"===this.peekChar()&&this.isClassAtom(1)}isDigit(){return Ii.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}}isQuantifier(){const e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(e){return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let t="";for(let n=0;n<e;n++){const e=this.popChar();if(!1===Ai.test(e))throw Error("Expecting a HexDecimal digits");t+=e}return{type:"Character",value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Oi(e){const t=e.toString();if(Ri.hasOwnProperty(t))return Ri[t];{const e=vi.pattern(t);return Ri[t]=e,e}}const Si="Complement Sets are not supported for first char optimization",_i='Unable to use "first char" lexer optimizations:\n';function Li(e,t=!1){try{const t=Oi(e);return xi(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Si)t&&$r(`${_i}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Br(`${_i}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function xi(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r<e.value.length;r++)xi(e.value[r],t,n);break;case"Alternative":const r=e.value;for(let e=0;e<r.length;e++){const i=r[e];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const o=i;switch(o.type){case"Character":Ci(o.value,t,n);break;case"Set":if(!0===o.complement)throw Error(Si);nr(o.value,e=>{if("number"==typeof e)Ci(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)Ci(e,t,n);else{for(let e=r.from;e<=r.to&&e<Xi;e++)Ci(e,t,n);if(r.to>=Xi){const e=r.from>=Xi?r.from:Xi,n=r.to,i=Zi(e),o=Zi(n);for(let e=i;e<=o;e++)t[e]=e}}}});break;case"Group":xi(o.value,t,n);break;default:throw Error("Non Exhaustive Match")}const s=void 0!==o.quantifier&&0===o.quantifier.atLeast;if("Group"===o.type&&!1===bi(o)||"Group"!==o.type&&!1===s)break}break;default:throw Error("non exhaustive match!")}return yr(t)}function Ci(e,t,n){const r=Zi(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=Zi(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=Zi(e.charCodeAt(0));t[n]=n}}}(e,t)}function ki(e,t){return lr(e.value,e=>{if("number"==typeof e)return vr(t,e);{const n=e;return void 0!==lr(t,e=>n.from<=e&&e<=n.to)}})}function bi(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(L(e.value)?or(e.value,bi):bi(e.value))}class Pi extends yi{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}super.visitChildren(e)}}visitCharacter(e){vr(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===ki(e,this.targetCharCodes)&&(this.found=!0):void 0!==ki(e,this.targetCharCodes)&&(this.found=!0)}}function wi(e,t){if(t instanceof RegExp){const n=Oi(t),r=new Pi(e);return r.visit(n),r.found}return void 0!==lr(t,t=>vr(e,t.charCodeAt(0)))}const Mi="PATTERN",Ui="defaultMode",Fi="modes";let Di="boolean"==typeof new RegExp("(?:)").sticky;const ji=/[^\\][$]/,Bi=/[^\\[][\^]|^\^/;function $i(e){const t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}function Wi(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function Gi(e){const t=e.PATTERN;if(xr(t))return!1;if(G(t))return!0;if(Ir(t,"exec"))return!0;if(Nr(t))return!1;throw Error("non exhaustive match")}function Ki(e){return!(!Nr(e)||1!==e.length)&&e.charCodeAt(0)}const zi={test:function(e){const t=e.length;for(let n=this.lastIndex;n<t;n++){const t=e.charCodeAt(n);if(10===t)return this.lastIndex=n+1,!0;if(13===t)return 10===e.charCodeAt(n+1)?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function Vi(e,t){if(Ir(e,"LINE_BREAKS"))return!1;if(xr(e.PATTERN)){try{wi(t,e.PATTERN)}catch(e){return{issue:ao.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if(Nr(e.PATTERN))return!1;if(Gi(e))return{issue:ao.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function Hi(e){return dr(e,e=>Nr(e)?e.charCodeAt(0):e)}function Yi(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const Xi=256;let qi=[];function Zi(e){return e<Xi?e:qi[e]}function Qi(e,t){const n=e.tokenTypeIdx;return n===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[n]}function Ji(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}let eo=1;const to={};function no(e){const t=function(e){let t=Rn(e),n=e,r=!0;for(;r;){n=vn(kt(dr(n,e=>e.CATEGORIES)));const e=Qn(n,t);t=t.concat(e),_r(e)?r=!1:n=e}return t}(e);!function(e){nr(e,e=>{io(e)||(to[eo]=e,e.tokenTypeIdx=eo++),oo(e)&&!L(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),oo(e)||(e.CATEGORIES=[]),Ir(e,"categoryMatches")||(e.categoryMatches=[]),function(e){return Ir(e,"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){nr(e,e=>{ro([],e)})}(t),function(e){nr(e,e=>{e.categoryMatches=[],nr(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(to[n].tokenTypeIdx)})})}(t),nr(t,e=>{e.isParent=e.categoryMatches.length>0})}function ro(e,t){nr(e,e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),nr(t.CATEGORIES,n=>{const r=e.concat(t);vr(r,n)||ro(r,n)})}function io(e){return Ir(e,"tokenTypeIdx")}function oo(e){return Ir(e,"CATEGORIES")}function so(e){return Ir(e,"tokenTypeIdx")}var ao,co;(co=ao||(ao={}))[co.MISSING_PATTERN=0]="MISSING_PATTERN",co[co.INVALID_PATTERN=1]="INVALID_PATTERN",co[co.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",co[co.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",co[co.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",co[co.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",co[co.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",co[co.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",co[co.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",co[co.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",co[co.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",co[co.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",co[co.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",co[co.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",co[co.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",co[co.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",co[co.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",co[co.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";const uo={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(uo);class lo{constructor(e,t=uo){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);const{time:r,value:i}=Wr(t),o=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=it({},uo,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===uo.lineTerminatorsPattern)this.config.lineTerminatorsPattern=zi;else if(this.config.lineTerminatorCharacters===uo.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),L(e)?n={modes:{defaultMode:Rn(e)},defaultMode:Ui}:(r=!1,n=Rn(e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Ir(e,Ui)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ui+"> property in its definition\n",type:ao.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Ir(e,Fi)||t.push({message:"A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",type:ao.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Ir(e,Fi)&&Ir(e,Ui)&&!Ir(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Ui}: <${e.defaultMode}>which does not exist\n`,type:ao.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Ir(e,Fi)&&nr(e.modes,(e,n)=>{nr(e,(r,i)=>{Cr(r)?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:ao.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Ir(r,"LONGER_ALT")&&nr(L(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT],i=>{Cr(i)||vr(e,i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${n}>\n`,type:ao.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const o=Mr(vn(kt(yr(e.modes))),e=>e[Mi]===lo.NA),s=Hi(n);return t&&nr(o,e=>{const t=Vi(e,s);if(!1!==t){const n=function(e,t){if(t.issue===ao.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===ao.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Ir(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):wi(s,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:ao.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},nr(n.modes,(e,t)=>{n.modes[t]=Mr(e,e=>Cr(e))});const i=tt(n.modes);if(nr(n.modes,(e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=ar(e,e=>!Ir(e,Mi)),n=dr(t,e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:ao.MISSING_PATTERN,tokenTypes:[e]}));return{errors:n,valid:Qn(e,t)}}(e);n=n.concat(r.errors);const i=function(e){const t=ar(e,e=>{const t=e[Mi];return!(xr(t)||G(t)||Ir(t,"exec")||Nr(t))}),n=dr(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ao.INVALID_PATTERN,tokenTypes:[e]}));return{errors:n,valid:Qn(e,t)}}(r.valid),o=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=ar(e,e=>xr(e[Mi]));return t=t.concat(function(e){class t extends yi{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}const n=ar(e,e=>{const n=e.PATTERN;try{const e=Oi(n),r=new t;return r.visit(e),r.found}catch(e){return ji.test(n.source)}}),r=dr(n,e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:ao.EOI_ANCHOR_FOUND,tokenTypes:[e]}));return r}(n)),t=t.concat(function(e){class t extends yi{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}const n=ar(e,e=>{const n=e.PATTERN;try{const e=Oi(n),r=new t;return r.visit(e),r.found}catch(e){return Bi.test(n.source)}}),r=dr(n,e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:ao.SOI_ANCHOR_FOUND,tokenTypes:[e]}));return r}(n)),t=t.concat(function(e){const t=ar(e,e=>{const t=e[Mi];return t instanceof RegExp&&(t.multiline||t.global)}),n=dr(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ao.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}));return n}(n)),t=t.concat(function(e){const t=[];let n=dr(e,n=>wr(e,(e,r)=>(n.PATTERN.source!==r.PATTERN.source||vr(t,r)||r.PATTERN===lo.NA||(t.push(r),e.push(r)),e),[]));n=vn(n);const r=dr(ar(n,e=>e.length>1),e=>{const t=dr(e,e=>e.name);return{message:`The same RegExp pattern ->${hr(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:ao.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}});return r}(n)),t=t.concat(function(e){const t=ar(e,e=>e.PATTERN.test("")),n=dr(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:ao.EMPTY_MATCH_PATTERN,tokenTypes:[e]}));return n}(n)),t}(o)),n=n.concat(function(e){const t=ar(e,e=>{if(!Ir(e,"GROUP"))return!1;const t=e.GROUP;return t!==lo.SKIPPED&&t!==lo.NA&&!Nr(t)}),n=dr(t,e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ao.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}));return n}(o)),n=n.concat(function(e,t){const n=ar(e,e=>void 0!==e.PUSH_MODE&&!vr(t,e.PUSH_MODE)),r=dr(n,e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:ao.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}));return r}(o,t)),n=n.concat(function(e){const t=[],n=wr(e,(e,t,n)=>{const r=t.PATTERN;return r===lo.NA||(Nr(r)?e.push({str:r,idx:n,tokenType:t}):xr(r)&&(i=r,void 0===lr([".","\\","[","]","|","^","$","(",")","?","*","+","{"],e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return nr(e,(e,r)=>{nr(n,({str:n,idx:i,tokenType:o})=>{if(r<i&&function(e,t){if(xr(t)){const n=t.exec(e);return null!==n&&0===n.index}if(G(t))return t(e,0,[],{});if(Ir(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(n,e.PATTERN)){const n=`Token: ->${o.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:ao.UNREACHABLE_PATTERN,tokenTypes:[e,o]})}})}),t}(o)),n}(e,i))}),_r(this.lexerDefinitionErrors)){let r;no(e),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=qn(t,{useSticky:Di,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()})).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(_r(qi)){qi=new Array(65536);for(let e=0;e<65536;e++)qi[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=Mr(e,e=>e[Mi]===lo.NA)});let i,o,s,a,c,u,l,h,f,d,p,m=!1;n("Transform Patterns",()=>{m=!1,i=dr(r,e=>{const n=e[Mi];if(xr(n)){const e=n.source;return 1!==e.length||"^"===e||"$"===e||"."===e||n.ignoreCase?2!==e.length||"\\"!==e[0]||vr(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],e[1])?t.useSticky?Wi(n):$i(n):e[1]:e}if(G(n))return m=!0,{exec:n};if("object"==typeof n)return m=!0,n;if("string"==typeof n){if(1===n.length)return n;{const e=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=new RegExp(e);return t.useSticky?Wi(r):$i(r)}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{o=dr(r,e=>e.tokenTypeIdx),s=dr(r,e=>{const t=e.GROUP;if(t!==lo.SKIPPED){if(Nr(t))return t;if(Cr(t))return!1;throw Error("non exhaustive match")}}),a=dr(r,e=>{const t=e.LONGER_ALT;if(t)return L(t)?dr(t,e=>Or(r,e)):[Or(r,t)]}),c=dr(r,e=>e.PUSH_MODE),u=dr(r,e=>Ir(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=Hi(t.lineTerminatorCharacters);l=dr(r,e=>!1),"onlyOffset"!==t.positionTracking&&(l=dr(r,t=>Ir(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===Vi(t,e)&&wi(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=dr(r,Gi),f=dr(i,Ki),d=wr(r,(e,t)=>{const n=t.GROUP;return Nr(n)&&n!==lo.SKIPPED&&(e[n]=[]),e},{}),p=dr(i,(e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:l[t],isCustom:h[t],short:f[t],group:s[t],push:c[t],pop:u[t],tokenTypeIdx:o[t],tokenType:r[t]}))});let E=!0,g=[];return t.safeMode||n("First Char Optimization",()=>{g=wr(r,(e,n,r)=>{if("string"==typeof n.PATTERN){const t=Zi(n.PATTERN.charCodeAt(0));Yi(e,t,p[r])}else if(L(n.START_CHARS_HINT)){let t;nr(n.START_CHARS_HINT,n=>{const i=Zi("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,Yi(e,i,p[r]))})}else if(xr(n.PATTERN))if(n.PATTERN.unicode)E=!1,t.ensureOptimizations&&Br(`${_i}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Li(n.PATTERN,t.ensureOptimizations);_r(i)&&(E=!1),nr(i,t=>{Yi(e,t,p[r])})}else t.ensureOptimizations&&Br(`${_i}\tTokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),E=!1;return e},[])}),{emptyGroups:d,patternIdxToConfig:p,charCodeToPatternIdxToConfig:g,hasCustom:m,canBeOptimized:E}}(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=it({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,!_r(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const e=dr(this.lexerDefinitionErrors,e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}nr(this.lexerDefinitionWarning,e=>{$r(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Di?(this.chopInput=W,this.match=this.matchWithTest):(this.updateLastIndex=oe,this.match=this.matchWithExec),r&&(this.handleModes=oe),!1===this.trackStartLines&&(this.computeNewColumn=W),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=oe),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=wr(this.canModeBeOptimized,(e,t,n)=>(!1===t&&e.push(n),e),[]);if(t.ensureOptimizations&&!_r(e))throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ri={}}),this.TRACE_INIT("toFastProperties",()=>{Gr(this)})})}tokenize(e,t=this.defaultMode){if(!_r(this.lexerDefinitionErrors)){const e=dr(this.lexerDefinitionErrors,e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,o,s,a,c,u,l,h,f,d,p,m,E;const g=e,T=g.length;let A=0,I=0;const N=this.hasCustom?0:Math.floor(e.length/10),y=new Array(N),R=[];let v=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0;const S=function(e){const t={};return nr(tt(e),n=>{const r=e[n];if(!L(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),_=this.trackStartLines,x=this.config.lineTerminatorsPattern;let C=0,k=[],b=[];const P=[],w=[];let M;function U(){return k}function F(e){const t=Zi(e),n=b[t];return void 0===n?w:n}Object.freeze(w);const D=e=>{if(1===P.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);R.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{P.pop();const e=Jn(P);k=this.patternIdxToConfig[e],b=this.charCodeToPatternIdxToConfig[e],C=k.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;M=b&&t?F:U}};function j(e){P.push(e),b=this.charCodeToPatternIdxToConfig[e],k=this.patternIdxToConfig[e],C=k.length,C=k.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;M=b&&t?F:U}let B;j.call(this,t);const $=this.config.recoveryEnabled;for(;A<T;){a=null;const t=g.charCodeAt(A),N=M(t),L=N.length;for(n=0;n<L;n++){B=N[n];const r=B.pattern;c=null;const l=B.short;if(!1!==l?t===l&&(a=r):!0===B.isCustom?(E=r.exec(g,A,y,S),null!==E?(a=E[0],void 0!==E.payload&&(c=E.payload)):a=null):(this.updateLastIndex(r,A),a=this.match(r,e,A)),null!==a){if(s=B.longerAlt,void 0!==s){const t=s.length;for(i=0;i<t;i++){const t=k[s[i]],n=t.pattern;if(u=null,!0===t.isCustom?(E=n.exec(g,A,y,S),null!==E?(o=E[0],void 0!==E.payload&&(u=E.payload)):o=null):(this.updateLastIndex(n,A),o=this.match(n,e,A)),o&&o.length>a.length){a=o,c=u,B=t;break}}}break}}if(null!==a){if(l=a.length,h=B.group,void 0!==h&&(f=B.tokenTypeIdx,d=this.createTokenInstance(a,A,f,B.tokenType,v,O,l),this.handlePayload(d,c),!1===h?I=this.addToken(y,I,d):S[h].push(d)),e=this.chopInput(e,l),A+=l,O=this.computeNewColumn(O,l),!0===_&&!0===B.canLineTerminator){let e,t,n=0;x.lastIndex=0;do{e=x.test(a),!0===e&&(t=x.lastIndex-1,n++)}while(!0===e);0!==n&&(v+=n,O=l-t,this.updateTokenEndLineColumnLocation(d,h,t,n,v,O,l))}this.handleModes(B,D,j,d)}else{const t=A,n=v,i=O;let o=!1===$;for(;!1===o&&A<T;)for(e=this.chopInput(e,1),A++,r=0;r<C;r++){const t=k[r],n=t.pattern,i=t.short;if(!1!==i?g.charCodeAt(A)===i&&(o=!0):!0===t.isCustom?o=null!==n.exec(g,A,y,S):(this.updateLastIndex(n,A),o=null!==n.exec(e)),!0===o)break}if(p=A-t,O=this.computeNewColumn(O,p),m=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(g,t,p,n,i),R.push({offset:t,line:n,column:i,length:p,message:m}),!1===$)break}}return this.hasCustom||(y.length=I),{tokens:y,groups:S,errors:R}}handleModes(e,t,n,r){if(!0===e.pop){const i=e.push;t(r),void 0!==i&&n.call(this,i)}else void 0!==e.push&&n.call(this,e.push)}chopInput(e,t){return e.substring(t)}updateLastIndex(e,t){e.lastIndex=t}updateTokenEndLineColumnLocation(e,t,n,r,i,o,s){let a,c;void 0!==t&&(a=n===s-1,c=a?-1:0,1===r&&!0===a||(e.endLine=i+c,e.endColumn=o-1-c))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,t,n,r,i,o){return{image:e,startOffset:t,startLine:i,startColumn:o,tokenTypeIdx:n,tokenType:r}}createFullToken(e,t,n,r,i,o,s){return{image:e,startOffset:t,endOffset:t+s-1,startLine:i,endLine:i,startColumn:o,endColumn:o+s-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,++t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){null!==t&&(e.payload=t)}matchWithTest(e,t,n){return!0===e.test(t)?t.substring(n,e.lastIndex):null}matchWithExec(e,t){const n=e.exec(t);return null!==n?n[0]:null}}function ho(e){return fo(e)?e.LABEL:e.name}function fo(e){return Nr(e.LABEL)&&""!==e.LABEL}lo.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",lo.NA=/NOT_APPLICABLE/;const po="categories",mo="label",Eo="group",go="push_mode",To="pop_mode",Ao="longer_alt",Io="line_breaks",No="start_chars_hint";function yo(e){return function(e){const t=e.pattern,n={};if(n.name=e.name,Cr(t)||(n.PATTERN=t),Ir(e,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";return Ir(e,po)&&(n.CATEGORIES=e[po]),no([n]),Ir(e,mo)&&(n.LABEL=e[mo]),Ir(e,Eo)&&(n.GROUP=e[Eo]),Ir(e,To)&&(n.POP_MODE=e[To]),Ir(e,go)&&(n.PUSH_MODE=e[go]),Ir(e,Ao)&&(n.LONGER_ALT=e[Ao]),Ir(e,Io)&&(n.LINE_BREAKS=e[Io]),Ir(e,No)&&(n.START_CHARS_HINT=e[No]),n}(e)}const Ro=yo({name:"EOF",pattern:lo.NA});function vo(e,t,n,r,i,o,s,a){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}no([Ro]);const Oo={buildMismatchTokenMessage:({expected:e,actual:t,previous:n,ruleName:r})=>`Expecting ${fo(e)?`--\x3e ${ho(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const o="Expecting: ",s="\nbut found: '"+hr(t).image+"'";if(r)return o+r+s;{const t=dr(wr(e,(e,t)=>e.concat(t),[]),e=>`[${dr(e,e=>ho(e)).join(", ")}]`);return o+`one of these possible Token sequences:\n${dr(t,(e,t)=>` ${t+1}. ${e}`).join("\n")}`+s}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",o="\nbut found: '"+hr(t).image+"'";return n?i+n+o:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${dr(e,e=>`[${dr(e,e=>ho(e)).join(",")}]`).join(" ,")}>`+o}};Object.freeze(Oo);const So={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},_o={buildDuplicateFoundError(e,t){const n=e.name,r=hr(t),i=r.idx,o=oi(r),s=(a=r)instanceof ti?a.terminalType.name:a instanceof Vr?a.nonTerminalName:"";var a;let c=`->${o}${i>0?i:""}<- ${s?`with argument: ->${s}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,"\n"),c},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=dr(e.prefixPath,e=>ho(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=dr(e.prefixPath,e=>ho(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=oi(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${dr(e.leftRecursionPath,e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof Hr?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Lo extends ri{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){nr(yr(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:zs.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class xo extends si{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Rn(this.path.ruleStack).reverse(),this.occurrenceStack=Rn(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){_r(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Co extends xo{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new Yr({definition:e});this.possibleTokTypes=ci(r),this.found=!0}}}class ko extends si{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class bo extends ko{walkMany(e,t,n){if(e.idx===this.occurrence){const e=hr(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof ti&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class Po extends ko{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=hr(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof ti&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class wo extends ko{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=hr(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof ti&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Mo extends ko{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=hr(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof ti&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Uo(e,t,n=[]){n=Rn(n);let r=[],i=0;function o(o){const s=Uo(o.concat(er(e,i+1)),t,n);return r.concat(s)}for(;n.length<t&&i<e.length;){const t=e[i];if(t instanceof Yr)return o(t.definition);if(t instanceof Vr)return o(t.definition);if(t instanceof Xr)r=o(t.definition);else{if(t instanceof qr)return o(t.definition.concat([new Qr({definition:t.definition})]));if(t instanceof Zr)return o([new Yr({definition:t.definition}),new Qr({definition:[new ti({terminalType:t.separator})].concat(t.definition)})]);if(t instanceof Jr){const e=t.definition.concat([new Qr({definition:[new ti({terminalType:t.separator})].concat(t.definition)})]);r=o(e)}else if(t instanceof Qr){const e=t.definition.concat([new Qr({definition:t.definition})]);r=o(e)}else{if(t instanceof ei)return nr(t.definition,e=>{!1===_r(e.definition)&&(r=o(e.definition))}),r;if(!(t instanceof ti))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:er(e,i)}),r}function Fo(e,t,n,r){const i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE";let a=!1;const c=t.length,u=c-r-1,l=[],h=[];for(h.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!_r(h);){const e=h.pop();if(e===s){a&&Jn(h).idx<=u&&h.pop();continue}const r=e.def,f=e.idx,d=e.ruleStack,p=e.occurrenceStack;if(_r(r))continue;const m=r[0];if(m===i){const e={idx:f,def:er(r),ruleStack:tr(d),occurrenceStack:tr(p)};h.push(e)}else if(m instanceof ti)if(f<c-1){const e=f+1;if(n(t[e],m.terminalType)){const t={idx:e,def:er(r),ruleStack:d,occurrenceStack:p};h.push(t)}}else{if(f!==c-1)throw Error("non exhaustive match");l.push({nextTokenType:m.terminalType,nextTokenOccurrence:m.idx,ruleStack:d,occurrenceStack:p}),a=!0}else if(m instanceof Vr){const e=Rn(d);e.push(m.nonTerminalName);const t=Rn(p);t.push(m.idx);const n={idx:f,def:m.definition.concat(o,er(r)),ruleStack:e,occurrenceStack:t};h.push(n)}else if(m instanceof Xr){const e={idx:f,def:er(r),ruleStack:d,occurrenceStack:p};h.push(e),h.push(s);const t={idx:f,def:m.definition.concat(er(r)),ruleStack:d,occurrenceStack:p};h.push(t)}else if(m instanceof qr){const e=new Qr({definition:m.definition,idx:m.idx}),t={idx:f,def:m.definition.concat([e],er(r)),ruleStack:d,occurrenceStack:p};h.push(t)}else if(m instanceof Zr){const e=new ti({terminalType:m.separator}),t=new Qr({definition:[e].concat(m.definition),idx:m.idx}),n={idx:f,def:m.definition.concat([t],er(r)),ruleStack:d,occurrenceStack:p};h.push(n)}else if(m instanceof Jr){const e={idx:f,def:er(r),ruleStack:d,occurrenceStack:p};h.push(e),h.push(s);const t=new ti({terminalType:m.separator}),n=new Qr({definition:[t].concat(m.definition),idx:m.idx}),i={idx:f,def:m.definition.concat([n],er(r)),ruleStack:d,occurrenceStack:p};h.push(i)}else if(m instanceof Qr){const e={idx:f,def:er(r),ruleStack:d,occurrenceStack:p};h.push(e),h.push(s);const t=new Qr({definition:m.definition,idx:m.idx}),n={idx:f,def:m.definition.concat([t],er(r)),ruleStack:d,occurrenceStack:p};h.push(n)}else if(m instanceof ei)for(let e=m.definition.length-1;e>=0;e--){const t={idx:f,def:m.definition[e].definition.concat(er(r)),ruleStack:d,occurrenceStack:p};h.push(t),h.push(s)}else if(m instanceof Yr)h.push({idx:f,def:m.definition.concat(er(r)),ruleStack:d,occurrenceStack:p});else{if(!(m instanceof Hr))throw Error("non exhaustive match");h.push(Do(m,f,d,p))}}return l}function Do(e,t,n,r){const i=Rn(n);i.push(e.name);const o=Rn(r);return o.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:o}}var jo;function Bo(e){if(e instanceof Xr||"Option"===e)return jo.OPTION;if(e instanceof Qr||"Repetition"===e)return jo.REPETITION;if(e instanceof qr||"RepetitionMandatory"===e)return jo.REPETITION_MANDATORY;if(e instanceof Zr||"RepetitionMandatoryWithSeparator"===e)return jo.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof Jr||"RepetitionWithSeparator"===e)return jo.REPETITION_WITH_SEPARATOR;if(e instanceof ei||"Alternation"===e)return jo.ALTERNATION;throw Error("non exhaustive match")}function $o(e,t,n,r){const i=e.length,o=or(e,e=>or(e,e=>1===e.length));if(t)return function(t){const r=dr(t,e=>e.GATE);for(let t=0;t<i;t++){const i=e[t],o=i.length,s=r[t];if(void 0===s||!1!==s.call(this))e:for(let e=0;e<o;e++){const r=i[e],o=r.length;for(let e=0;e<o;e++){const t=this.LA(e+1);if(!1===n(t,r[e]))continue e}return t}}};if(o&&!r){const t=wr(dr(e,e=>kt(e)),(e,t,n)=>(nr(t,t=>{Ir(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),nr(t.categoryMatches,t=>{Ir(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t<i;t++){const r=e[t],i=r.length;e:for(let e=0;e<i;e++){const i=r[e],o=i.length;for(let e=0;e<o;e++){const t=this.LA(e+1);if(!1===n(t,i[e]))continue e}return t}}}}function Wo(e,t,n){const r=or(e,e=>1===e.length),i=e.length;if(r&&!n){const t=kt(e);if(1===t.length&&_r(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{const e=wr(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,nr(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){const t=this.LA(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;n<i;n++){const r=e[n],i=r.length;for(let e=0;e<i;e++){const n=this.LA(e+1);if(!1===t(n,r[e]))continue e}return!0}return!1}}!function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"}(jo||(jo={}));class Go extends si{constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)}walkOption(e,t,n){this.checkIsTarget(e,jo.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,jo.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,jo.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,jo.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,jo.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}}class Ko extends ri{constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||void 0!==this.targetRef&&e!==this.targetRef||(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,jo.OPTION)}visitRepetition(e){this.checkIsTarget(e,jo.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,jo.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,jo.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,jo.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,jo.ALTERNATION)}}function zo(e){const t=new Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function Vo(e){let t=[""];for(let n=0;n<e.length;n++){const r=e[n],i=[];for(let e=0;e<t.length;e++){const n=t[e];i.push(n+"_"+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){const t="_"+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function Ho(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;const i=e[r];for(let e=0;e<t.length;e++)if(!0===i[t[e]])return!1}return!0}function Yo(e,t){const n=dr(e,e=>Uo([e],1)),r=zo(n.length),i=dr(n,e=>{const t={};return nr(e,e=>{nr(Vo(e.partialPath),e=>{t[e]=!0})}),t});let o=n;for(let e=1;e<=t;e++){const n=o;o=zo(n.length);for(let s=0;s<n.length;s++){const a=n[s];for(let n=0;n<a.length;n++){const c=a[n].partialPath,u=a[n].suffixDef,l=Vo(c);if(Ho(i,l,s)||_r(u)||c.length===t){const e=r[s];if(!1===Zo(e,c)){e.push(c);for(let e=0;e<l.length;e++){const t=l[e];i[s][t]=!0}}}else{const t=Uo(u,e+1,c);o[s]=o[s].concat(t),nr(t,e=>{nr(Vo(e.partialPath),e=>{i[s][e]=!0})})}}}}return r}function Xo(e,t,n,r){const i=new Ko(e,jo.ALTERNATION,r);return t.accept(i),Yo(i.result,n)}function qo(e,t,n,r){const i=new Ko(e,n);t.accept(i);const o=i.result,s=new Go(t,e,n).startWalking();return Yo([new Yr({definition:o}),new Yr({definition:s})],r)}function Zo(e,t){e:for(let n=0;n<e.length;n++){const r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){const n=t[e],i=r[e];if(!1==(n===i||void 0!==i.categoryMatchesMap[n.tokenTypeIdx]))continue e}return!0}}return!1}function Qo(e){return or(e,e=>or(e,e=>or(e,e=>_r(e.categoryMatches))))}function Jo(e){return`${oi(e)}_#_${e.idx}_#_${es(e)}`}function es(e){return e instanceof ti?e.terminalType.name:e instanceof Vr?e.nonTerminalName:""}class ts extends ri{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function ns(e,t,n,r=[]){const i=[],o=rs(t.definition);if(_r(o))return[];{const t=e.name;vr(o,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:zs.LEFT_RECURSION,ruleName:t});const s=pr(Qn(o,r.concat([e])),t=>{const i=Rn(r);return i.push(t),ns(e,t,n,i)});return i.concat(s)}}function rs(e){let t=[];if(_r(e))return t;const n=hr(e);if(n instanceof Vr)t.push(n.referencedRule);else if(n instanceof Yr||n instanceof Xr||n instanceof qr||n instanceof Zr||n instanceof Jr||n instanceof Qr)t=t.concat(rs(n.definition));else if(n instanceof ei)t=kt(dr(n.definition,e=>rs(e.definition)));else if(!(n instanceof ti))throw Error("non exhaustive match");const r=ii(n),i=e.length>1;if(r&&i){const n=er(e);return t.concat(rs(n))}return t}class is extends ri{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class os extends ri{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const ss="MismatchedTokenException",as="NoViableAltException",cs="EarlyExitException",us="NotAllInputParsedException",ls=[ss,as,cs,us];function hs(e){return vr(ls,e.name)}Object.freeze(ls);class fs extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class ds extends fs{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=ss}}class ps extends fs{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=as}}class ms extends fs{constructor(e,t){super(e,t),this.name=us}}class Es extends fs{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=cs}}const gs={},Ts="InRuleRecoveryException";class As extends Error{constructor(e){super(e),this.name=Ts}}function Is(e,t,n,r,i,o,s){const a=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[a];if(void 0===c){const e=this.getCurrRuleFullName();c=new o(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=c}let u=c.token,l=c.occurrence;const h=c.isEndOfRule;1===this.RULE_STACK.length&&h&&void 0===u&&(u=Ro,l=1),void 0!==u&&void 0!==l&&this.shouldInRepetitionRecoveryBeTried(u,l,s)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ns=1024,ys=1280,Rs=1536;function vs(e,t,n){return n|t|e}class Os{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:Gs.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(_r(t)){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return pr(e,e=>ns(e,e,_o))}validateEmptyOrAlternatives(e){return pr(e,e=>function(e,t){const n=new is;return e.accept(n),pr(n.alternations,n=>pr(tr(n.definition),(r,i)=>_r(Fo([r],[],Qi,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:zs.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,_o))}validateAmbiguousAlternationAlternatives(e,t){return pr(e,e=>function(e,t,n){const r=new is;e.accept(r);let i=r.alternations;i=Mr(i,e=>!0===e.ignoreAmbiguities);const o=pr(i,r=>{const i=r.idx,o=r.maxLookahead||t,s=Xo(i,e,o,r),a=function(e,t,n,r){const i=[],o=wr(e,(n,r,o)=>(!0===t.definition[o].ignoreAmbiguities||nr(r,r=>{const s=[o];nr(e,(e,n)=>{o!==n&&Zo(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&s.push(n)}),s.length>1&&!Zo(i,r)&&(i.push(r),n.push({alts:s,path:r}))}),n),[]),s=dr(o,e=>{const i=dr(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:zs.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}});return s}(s,r,e,n),c=function(e,t,n,r){const i=wr(e,(e,t,n)=>{const r=dr(t,e=>({idx:n,path:e}));return e.concat(r)},[]),o=vn(pr(i,e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const o=e.idx,s=e.path;return dr(ar(i,e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<o&&(n=e.path,r=s,n.length<r.length&&or(n,(e,t)=>{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}),e=>{const i=[e.idx+1,o+1],s=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:zs.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:s,alternatives:i}})}));return o}(s,r,e,n);return a.concat(c)});return o}(e,t,_o))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return nr(e,e=>{const i=new os;e.accept(i),nr(i.allProductions,i=>{const o=Bo(i),s=i.maxLookahead||t;if(_r(kt(qo(i.idx,e,o,s)[0]))){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:zs.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,_o)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,o){const s=Xo(e,t,n);return o(s,r,Qo(s)?Ji:Qi,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,$o)}buildLookaheadForOptional(e){return function(e,t,n,r,i,o){const s=qo(e,t,i,n),a=Qo(s)?Ji:Qi;return o(s[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Bo(e.prodType),Wo)}}const Ss=new class extends ri{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function _s(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==1&&(e.endOffset=t.endOffset)}function Ls(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset==1&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function xs(e,t){Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:t})}function Cs(e,t){const n=tt(e),r=n.length;for(let i=0;i<r;i++){const r=e[n[i]],o=r.length;for(let e=0;e<o;e++){const n=r[e];void 0===n.tokenTypeIdx&&this[n.name](n.children,t)}}}var ks;!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(ks||(ks={}));const bs={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(bs);const Ps=!0,ws=Math.pow(2,8)-1,Ms=yo({name:"RECORDING_PHASE_TOKEN",pattern:lo.NA});no([Ms]);const Us=vo(Ms,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(Us);const Fs={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};function Ds(e,t,n,r=!1){$s(n);const i=Jn(this.recordingProdStack),o=G(t)?t:t.DEF,s=new e({definition:[],idx:n});return r&&(s.separator=t.SEP),Ir(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),bs}function js(e,t){$s(t);const n=Jn(this.recordingProdStack),r=!1===L(e),i=!1===r?e:e.DEF,o=new ei({definition:[],idx:t,ignoreAmbiguities:r&&!0===e.IGNORE_AMBIGUITIES});Ir(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD);const s=Fr(i,e=>G(e.GATE));return o.hasPredicates=s,n.definition.push(o),nr(i,e=>{const t=new Yr({definition:[]});o.definition.push(t),Ir(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Ir(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),bs}function Bs(e){return 0===e?"":`${e}`}function $s(e){if(e<0||e>ws){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${ws+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const Ws=vo(Ro,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Ws);const Gs=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Oo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Ks=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var zs,Vs,Hs;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(zs||(zs={}));class Ys{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{Gr(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),nr(this.definedRulesNames,e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=qn(e,{errMsgProvider:So}),n={};return nr(e.rules,e=>{n[e.name]=e}),function(e,t){const n=new Lo(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:yr(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(_r(n)&&!1===this.skipValidations){const n=(e={rules:yr(this.gastProductionsCache),tokenTypes:yr(this.tokensMap),errMsgProvider:_o,grammarName:t},function(e,t,n,r){const i=pr(e,e=>function(e,t){const n=new ts;e.accept(n);const r=n.allProductions,i=dr(yr(br(gr(r,Jo),e=>e.length>1)),n=>{const r=hr(n),i=t.buildDuplicateFoundError(e,n),o=oi(r),s={message:i,type:zs.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:o,occurrence:r.idx},a=es(r);return a&&(s.parameter=a),s});return i}(e,n)),o=function(e,t,n){const r=[],i=dr(t,e=>e.name);return nr(e,e=>{const t=e.name;if(vr(i,t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:zs.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),s=pr(e,e=>function(e,t){const n=new is;e.accept(n);const r=pr(n.alternations,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:zs.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[]);return r}(e,n)),a=pr(e,t=>function(e,t,n,r){const i=[],o=wr(t,(t,n)=>n.name===e.name?t+1:t,0);if(o>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:zs.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(o,s,a)}((e=qn(e,{errMsgProvider:_o})).rules,e.tokenTypes,e.errMsgProvider,e.grammarName)),r=function(e){return dr(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),e=>Object.assign({type:zs.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:yr(this.gastProductionsCache),tokenTypes:yr(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(n,r)}var e}),_r(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return nr(e,e=>{const n=new li(e).startWalking();it(t,n)}),t}(yr(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:yr(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(yr(this.gastProductionsCache))})),!Ys.DEFER_DEFINITION_ERRORS_HANDLING&&!_r(this.definitionErrors))throw e=dr(this.definitionErrors,e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),Ir(t,"ignoredIssues"))throw new Error("The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Ir(t,"skipValidations")?t.skipValidations:Gs.skipValidations}}Ys.DEFER_DEFINITION_ERRORS_HANDLING=!1,Vs=Ys,Hs=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Ir(e,"recoveryEnabled")?e.recoveryEnabled:Gs.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Is)}getTokenToInsert(e){const t=vo(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),o=this.exportLexerState(),s=[];let a=!1;const c=this.LA(1);let u=this.LA(1);const l=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:this.getCurrRuleFullName()}),n=new ds(t,c,this.LA(0));n.resyncedTokens=tr(s),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void l();if(n.call(this))return l(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,s))}this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new As("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(_r(t))return!1;const n=this.LA(1);return void 0!==lr(t,e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return vr(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),n=2;for(;;){const r=lr(e,e=>Qi(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return gs;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return dr(e,(n,r)=>0===r?gs:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return kt(dr(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===gs)return[Ro];const t=e.ruleName+e.idxInCallingRule+ui+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ro)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return tr(t)}attemptInRepetitionRecovery(e,t,n,r,i,o,s){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:Rn(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return dr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},class{initLooksAhead(e){this.dynamicTokensEnabled=Ir(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Gs.dynamicTokensEnabled,this.maxLookahead=Ir(e,"maxLookahead")?e.maxLookahead:Gs.maxLookahead,this.lookaheadStrategy=Ir(e,"lookaheadStrategy")?e.lookaheadStrategy:new Os({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){nr(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:s}=function(e){Ss.reset(),e.accept(Ss);const t=Ss.dslMethods;return Ss.reset(),t}(e);nr(t,t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${oi(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=vs(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),nr(n,t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,oi(t))}),nr(r,t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,oi(t))}),nr(i,t=>{this.computeLookaheadFunc(e,t.idx,Ns,"RepetitionMandatory",t.maxLookahead,oi(t))}),nr(o,t=>{this.computeLookaheadFunc(e,t.idx,Rs,"RepetitionMandatoryWithSeparator",t.maxLookahead,oi(t))}),nr(s,t=>{this.computeLookaheadFunc(e,t.idx,ys,"RepetitionWithSeparator",t.maxLookahead,oi(t))})})})}computeLookaheadFunc(e,t,n,r,i,o){this.TRACE_INIT(`${o}${0===t?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),s=vs(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(s,o)})}getKeyForAutomaticLookahead(e,t){return vs(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Ir(e,"nodeLocationTracking")?e.nodeLocationTracking:Gs.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ls,this.setNodeLocationFromNode=Ls,this.cstPostRule=oe,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=oe,this.setNodeLocationFromNode=oe,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_s,this.setNodeLocationFromNode=_s,this.cstPostRule=oe,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=oe,this.setNodeLocationFromNode=oe,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=oe,this.setNodeLocationFromNode=oe,this.cstPostRule=oe,this.setInitialNodeLocation=oe}else this.cstInvocationStateUpdate=oe,this.cstFinallyStateUpdate=oe,this.cstPostTerminal=oe,this.cstPostNonTerminal=oe,this.cstPostRule=oe}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,o;i=t,o=e,void 0===(r=n).children[o]?r.children[o]=[i]:r.children[o].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Cr(this.baseCstVisitorConstructor)){const e=function(e,t){const n=function(){};xs(n,e+"BaseSemantics");const r={visit:function(e,t){if(L(e)&&(e=e[0]),!Cr(e))return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){const n=ar(t,t=>!1===G(e[t])),r=dr(n,t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:ks.MISSING_METHOD,methodName:t}));return vn(r)}(e,t);return n}(this,t);if(!_r(e)){const t=dr(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,tt(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Cr(this.baseCstVisitorWithDefaultsConstructor)){const e=function(e,t,n){const r=function(){};xs(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return nr(t,e=>{i[e]=Cs}),(r.prototype=i).constructor=r,r}(this.className,tt(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Ws}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Ws:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Ji,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Ir(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(L(e)){if(_r(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(L(e))this.tokensMap=wr(e,(e,t)=>(e[t.name]=t,e),{});else if(Ir(e,"modes")&&or(kt(yr(e.modes)),so)){const t=jr(kt(yr(e.modes)));this.tokensMap=wr(t,(e,t)=>(e[t.name]=t,e),{})}else{if(!w(e))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Rn(e)}this.tokensMap.EOF=Ro;const n=or(Ir(e,"modes")?kt(yr(e.modes)):yr(e),e=>_r(e.categoryMatches));this.tokenMatcher=n?Ji:Qi,no(yr(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Ir(n,"resyncEnabled")?n.resyncEnabled:Ks.resyncEnabled,i=Ir(n,"recoveryValueFunc")?n.recoveryValueFunc:Ks.recoveryValueFunc,o=this.ruleShortNameIdx<<12;let s;return this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o,s=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(s,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){const r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(hs(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ns,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,jo.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ns,e,wo)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Rs,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,jo.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Mo],t,Rs,e,Mo)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let o=!0;for(;!0===i.call(this)&&!0===o;)o=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,bo,o)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ys,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Po],t,ys,e,Po)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,Rs,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=L(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new ms(t,e))}}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw hs(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ds(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Ts?n:e}}}saveRecogState(){const e=this.errors,t=Rn(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ro)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=Ks){if(vr(this.definedRulesNames,e)){const t={message:_o.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:zs.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);const r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=Ks){const r=function(e,t,n){const r=[];let i;return vr(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:zs.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(hs(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return dr(yr(this.gastProductionsCache),ni)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Ir(e,"errorMessageProvider")?e.errorMessageProvider:Gs.errorMessageProvider}SAVE_ERROR(e){if(hs(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Rn(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Rn(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=qo(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],o=[];for(let e=1;e<=this.maxLookahead;e++)o.push(this.LA(e));const s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:o,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new Es(s,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=Xo(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const o=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ps(s,this.LA(1),o))}},class{initContentAssist(){}computeContentAssist(e,t){const n=this.gastProductionsCache[e];if(Cr(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Fo([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=hr(e.ruleStack),n=this.getGAstProductions()[t];return new Co(n,e).startWalking()}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Ws}topLevelRuleRecord(e,t){try{const n=new Hr({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return Ds.call(this,Xr,e,t)}atLeastOneInternalRecord(e,t){Ds.call(this,qr,t,e)}atLeastOneSepFirstInternalRecord(e,t){Ds.call(this,Zr,t,e,Ps)}manyInternalRecord(e,t){Ds.call(this,Qr,t,e)}manySepFirstInternalRecord(e,t){Ds.call(this,Jr,t,e,Ps)}orInternalRecord(e,t){return js.call(this,e,t)}subruleInternalRecord(e,t,n){if($s(t),!e||!1===Ir(e,"ruleName")){const n=new Error(`<SUBRULE${Bs(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=Jn(this.recordingProdStack),i=e.ruleName,o=new Vr({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(o),this.outputCst?Fs:bs}consumeInternalRecord(e,t,n){if($s(t),!io(e)){const n=new Error(`<CONSUME${Bs(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=Jn(this.recordingProdStack),i=new ti({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Us}},class{initPerformanceTracer(e){if(Ir(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Gs.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);const{time:r,value:i}=Wr(t),o=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()}}],Hs.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(Vs.prototype,n,r):Vs.prototype[n]=e.prototype[n]})});class Xs extends Ys{constructor(e,t=Gs){const n=Rn(t);n.outputCst=!1,super(e,n)}}const qs=yo({name:"WhiteSpace",pattern:/\s+/,group:lo.SKIPPED}),Zs=yo({name:"String",pattern:/"(""|[^"])*"/}),Qs=yo({name:"SingleQuotedString",pattern:/'(''|[^'])*'/}),Js=yo({name:"SheetQuoted",pattern:/'((?![\\/[\]*?:]).)+?'!/}),ea=yo({name:"FunctionToken",pattern:/[A-Za-z_]+[A-Za-z_0-9.]*\(/}),ta=yo({name:"NamedTableReference",pattern:/[A-Za-z_]+[A-Za-z_0-9.]*\[/}),na=yo({name:"BracketedString",pattern:/\[([^[\]]*)\]/,longer_alt:[ta,Zs]}),ra=yo({name:"LiteralError",pattern:/#PARSE!|#NULL!|#DIV\/0!|#VALUE!|#NUM!|#FIELD!|#N\/A|#GETTING_DATA|#SPILL!|#CONNECT!|#BLOCKED!|#UNKNOWN!|#FIELD!|#CALC!|#BUSY!|#PYTHON!|#TIMEOUT!/}),ia=yo({name:"RefError",pattern:/#REF!|#NAME\?/}),oa=yo({name:"Sheet",pattern:/[A-Za-z_.\d\u007F-\uFFFF]+!/}),sa=/^[a-zA-Z_][a-zA-Z0-9_.?]*:?/,aa=yo({name:"Name",pattern:{exec:(e,t)=>{try{const n=sa.exec(e.substring(t));if(n){const e=n[0];if(e.endsWith(":")){const t=e.length;return"."===e[t-2]?[e.substring(0,t-2)]:[e.substring(0,t-1)]}return[e]}}catch(e){console.warn("Error parsing name",e)}return null}},line_breaks:!1,start_chars_hint:(()=>{const e=[];for(let t=65;t<=90;t++)e.push(t);for(let t=97;t<=122;t++)e.push(t);for(let t=48;t<=57;t++)e.push(t);return e})()}),ca=yo({name:"Cell",pattern:/[$]?[A-Za-z]{1,3}[$]?[1-9][0-9]*/,longer_alt:aa}),ua=yo({name:"Column",pattern:/[$]?[A-Za-z]{1,3}/,longer_alt:aa}),la=yo({name:"AbsRow",pattern:/[$][0-9]+/,longer_alt:aa}),ha=yo({name:"NumberToken",pattern:/[0-9]+[.]?[0-9]*([eE][+-][0-9]+)?/}),fa=yo({name:"Boolean",pattern:/TRUE|FALSE/i}),da=yo({name:"Comma",pattern:/,/}),pa=yo({name:"RangeUnion",pattern:/:/}),ma=yo({name:"RangeTrimFull",pattern:/\.:\./}),Ea=yo({name:"RangeTrimLeading",pattern:/\.:/}),ga=yo({name:"RangeTrimTrailing",pattern:/:\./}),Ta=yo({name:"Semicolon",pattern:/;/}),Aa=yo({name:"OpenParen",pattern:/\(/}),Ia=yo({name:"CloseParen",pattern:/\)/}),Na=yo({name:"OpenSquareParen",pattern:/\[/}),ya=yo({name:"CloseSquareParen",pattern:/]/});yo({name:"exclamationMark",pattern:/!/});const Ra=yo({name:"OpenCurlyParen",pattern:/{/}),va=yo({name:"CloseCurlyParen",pattern:/}/}),Oa=yo({name:"QuoteS",pattern:/'/}),Sa=yo({name:"MulOp",pattern:/\*/}),_a=yo({name:"PlusOp",pattern:/\+/}),La=yo({name:"DivOp",pattern:/\//}),xa=yo({name:"MinOp",pattern:/-/}),Ca=yo({name:"ImplicitIntersectOp",pattern:/@/}),ka=yo({name:"ConcatOp",pattern:/&/}),ba=yo({name:"ExOp",pattern:/\^/}),Pa=yo({name:"PercentOp",pattern:/%/}),wa=yo({name:"TableSpecifier",pattern:/#(All|Data|Headers|Totals|This Row)/i}),Ma=yo({name:"ArrayAnchorOp",pattern:/#/,longer_alt:[wa,ra,ia]}),Ua=yo({name:"GtOp",pattern:/>/}),Fa=yo({name:"EqOp",pattern:/=/}),Da=yo({name:"LtOp",pattern:/</}),ja=[qs,Zs,Js,Qs,ea,ta,na,ra,ia,oa,ca,fa,ua,la,wa,Ma,Ca,aa,ha,da,ma,Ea,ga,pa,Ta,Aa,Ia,Na,ya,Ra,va,Oa,Sa,_a,La,xa,ka,ba,Sa,Pa,yo({name:"NeqOp",pattern:/<>/}),yo({name:"GteOp",pattern:/>=/}),yo({name:"LteOp",pattern:/<=/}),Ua,Fa,Da],Ba=new lo(ja,{ensureOptimizations:!0}),$a={};ja.forEach(e=>{$a[e.name]=e});const Wa={boolean:3,string:2,number:1},Ga=(e,t)=>{let n=e+t;return n=Math.abs(n)<99e-14?0:n,isFinite(n)?n:Number.NaN},Ka=(e,t)=>{let n=e-t;return n=Math.abs(n)<99e-14?0:n,isFinite(n)?n:Number.NaN},za=(e,t)=>{let n=e*t;return n=Math.abs(n)<99e-14?0:n,isFinite(n)?n:Number.NaN},Va=(e,t)=>{if(0===t)return 1/0;let n=e/t;return n=Math.abs(n)<99e-14?0:n,isFinite(n)?n:Number.NaN},Ha=(e,t)=>{const n=e**t;return isFinite(n)?n:Number.NaN},Ya=(e="",t="")=>(null===e&&(e=""),null===t&&(t=""),"boolean"==typeof e&&(e=e?"TRUE":"FALSE"),"boolean"==typeof t&&(t=t?"TRUE":"FALSE"),""+e+t),Xa=(e=null,t=null)=>typeof e==typeof t&&e===t,qa=(e=null,t=null)=>typeof e!=typeof t||e!==t,Za=(e=null,t=null)=>{const n=typeof e,r=typeof t;return n===r?e>t:Wa[n]>Wa[r]},Qa=(e=null,t=null)=>{const n=typeof e,r=typeof t;return n===r?e>=t:Wa[n]>=Wa[r]},Ja=(e=null,t=null)=>{const n=typeof e,r=typeof t;return n===r?e<t:Wa[n]<Wa[r]},ec=(e=null,t=null)=>{const n=typeof e,r=typeof t;return n===r?e<=t:Wa[n]<=Wa[r]},tc={type:h.Number,coerce:!0,includeBoolean:!0,includeMistyped:!0,mismatchFill:t.BuiltIn.NA},nc={type:h.String,coerce:!0,includeMistyped:!0,mismatchFill:t.BuiltIn.NA},rc={type:null,coerce:!0,includeMistyped:!0,mismatchFill:t.BuiltIn.NA},ic=(e,n,r,i)=>{if(null!==n&&void 0!==n.colStart&&(n=e.getValueAt(n.rowStart,n.colStart)),null!==r&&void 0!==r.colStart&&(r=e.getValueAt(r.rowStart,r.colStart)),"number"==typeof n&&"number"==typeof r)return i(n,r);let o,s;if(n?.isIRange?o=n:r?.isIRange&&(s=r),!o&&!s){const e=!1;return n=f(n,d(n,!0),h.Number,!0,e),r=f(r,d(r,!0),h.Number,!0,e),n instanceof t.Value?n:r instanceof t.Value?r:i(n,r)}return o||(o=e.getRange(n)),o.broadcast(r,i,tc).fillEmpty(0)},oc=(e,t,n,r)=>{let i,o;return null!==t&&void 0!==t.colStart&&(t=e.getValueAt(t.rowStart,t.colStart)),null!==n&&void 0!==n.colStart&&(n=e.getValueAt(n.rowStart,n.colStart)),t?.isIRange?(i=t,o=n):n?.isIRange&&(i=n,o=t),i?i.broadcast(o,r,rc):r(t,n)},sc=(e,n)=>{null==n&&(n=0);let r,i=1;if("+"===e)return n;if("-"!==e)throw new t.Value(`Unrecognized prefix: ${e}`);return i=-i,n?.isIRange&&(r=n),r?r.broadcast(i,za,rc):"number"!=typeof(n=f(n,d(n,!0),h.Number))||isNaN(n)?t.BuiltIn.Value:n*i},ac=(e,n,r,i)=>{if(!n)return t.BuiltIn.Ref;if(n.isIReferenceRange&&(n=n.getCoords()),void 0===n.colStart)return t.BuiltIn.Ref;if(r.isIReferenceRange&&(r=r.getCoords()),void 0===r.colStart)return t.BuiltIn.Ref;const o=i(n,r);return o?e.getReference(o):t.BuiltIn.Null},cc={"+":(e,t,n)=>ic(e,t,n,Ga),"-":(e,t,n)=>ic(e,t,n,Ka),"*":(e,t,n)=>ic(e,t,n,za),"/":(e,t,n)=>ic(e,t,n,Va),"^":(e,t,n)=>ic(e,t,n,Ha)," ":(e,t,n,r)=>ac(e,t,n,o.intersectRanges),":":(e,t,n,r)=>ac(e,t,n,o.unionRanges),".:.":(e,t,n,r)=>{const i=ac(e,t,n,o.unionRanges);return e.getFunction("TRIMRANGE").execute(i,3,3)},".:":(e,t,n,r)=>{const i=ac(e,t,n,o.unionRanges);return e.getFunction("TRIMRANGE").execute(i,1,1)},":.":(e,t,n,r)=>{const i=ac(e,t,n,o.unionRanges);return e.getFunction("TRIMRANGE").execute(i,2,2)},"&":(e,t,n)=>((e,t,n,r)=>{if(null!==t&&void 0!==t.colStart&&(t=e.getValueAt(t.rowStart,t.colStart)),null!==n&&void 0!==n.colStart&&(n=e.getValueAt(n.rowStart,n.colStart)),"string"==typeof t&&"string"==typeof n)return r(t,n);let i,o;return t?.isIRange?i=t:n?.isIRange&&(o=n),i||o?(i||(i=e.getRange(t)),i.broadcast(n,r,nc)):r(t=f(t,d(t,!0),h.String),n=f(n,d(n,!0),h.String))})(e,t,n,Ya),"=":(e,t,n)=>oc(e,t,n,Xa),"<>":(e,t,n)=>oc(e,t,n,qa),">":(e,t,n)=>oc(e,t,n,Za),"<":(e,t,n)=>oc(e,t,n,Ja),">=":(e,t,n)=>oc(e,t,n,Qa),"<=":(e,t,n)=>oc(e,t,n,ec)},uc={"-":(e,t)=>sc("-",t),"+":(e,t)=>sc("+",t),"@":(e,n)=>{if(!n||!n.isIReferenceRange)return n;const r=n.getCoords(),i=n,o=e.getPosition(),s=i.getHeight(),a=i.getWidth();if(a>1&&s>1)return t.BuiltIn.Value;if(s>1){const e=o.rowIndex-r.rowStart;if(e>=0&&e<s)return i.getValueAt(e,0)}else{if(!(a>1))return i.getValueAt(0,0);{const e=o.colIndex-r.colStart;if(e>=0&&e<a)return i.getValueAt(0,e)}}return t.BuiltIn.Value}},lc={"%":(e,t)=>ic(e,t,100,Va),"#":(e,n)=>e.getSpillAt(n.rowStart,n.colStart)||t.BuiltIn.Ref};function hc(e){const t=(e=e.toUpperCase()).length;let n=0;for(let r=0;r<t;r++){const i=e.charCodeAt(r);isNaN(i)||(n+=(i-64)*26**(t-r-1))}return n}function fc(e){return{type:"cell",value:Object.freeze({colIndex:e.colIndex,rowIndex:e.rowIndex,$colIndex:e.$colIndex||!1,$rowIndex:e.$rowIndex||!1}),inputs:null,isReference:!0}}function dc(e,t){const n=e.startsWith("$");n&&(e=e.substring(1));let r=parseInt(e)-1;return n||r===Number.MIN_SAFE_INTEGER||(r-=t.colIndex),{type:"cell",value:Object.freeze({colIndex:Number.MIN_SAFE_INTEGER,$colIndex:!1,rowIndex:r,$rowIndex:n}),inputs:null,isReference:!0}}function pc(e,t){return{type:"function",value:e=e.toUpperCase(),inputs:t}}function mc(e,t){return{type:"tableReference",value:e,inputs:t}}function Ec(e){return{type:"tableSpecifier",value:e,inputs:null,isReference:!0}}function gc(e,t,n,r=!1){const i={type:"infix",value:e,inputs:[t,n]};return r&&(i.isReference=!0),i}function Tc(e,t,n=!1){const r={type:"postfix",value:e,inputs:[t]};return n&&(r.isReference=!0),r}function Ac(e,t,n=!1){const r={type:"prefix",value:e,inputs:[t]};return n&&(r.isReference=!0),r}function Ic(e){return{type:"named",value:e,inputs:null,isReference:!0}}function Nc(e){return{type:"number",value:Number(e),isLiteral:!0}}function yc(e){let t=e;const n=e&&e.length>1&&'"'===e[0]&&'"'===e[e.length-1];return n&&(t=e.substring(1,e.length-1)),{type:n?"quotedString":"string",value:t,isLiteral:!0}}function Rc(e){return{type:"boolean",value:"TRUE"===e||"TRUE"===e.toUpperCase(),isLiteral:!0}}function vc(e){return{type:"error",value:t.getBuiltInByLabel(e.toUpperCase()),isLiteral:!0}}function Oc(e){return{type:"error",value:e?t.getBuiltInByLabel(e.toUpperCase()):t.BuiltIn.Ref,inputs:null,isReference:!0}}function Sc(e,t){const n=function e(n,r){const i=n.inputs;let o;if(i){const t=i.length;for(let r=0;r<t;r++){const t=i[r],s=e(t,n);s!==t&&(o||(o=[...i]),o[r]=s)}}const s=o?{...n,inputs:o}:n,a=t(s,r);return void 0===a?s:a}(e,void 0);return n||this}function _c(e,t){let n=0,r=Sc(e,e=>{const t={...e};return t.evalIndex=n++,t});const i=new Array(n),o=new Set,s=new Map;let a;const c=new Map,u=[],h=[];r=Sc(r,(e,t)=>{const n=e.type,r=e.evalIndex;if(i[r]=null,e.isReference){const t=e,r={node:e,index:c.size,op:null,value:null,inputs:null};if(c.set(t,r),"cell"===n){const n=t.value;return n.$colIndex&&(r.hasHorizontalAbs=!0),n.$rowIndex&&(r.hasVerticalAbs=!0),r.value=s.size,s.set(t,s.size),o.add(r),e.refIndex=h.length,void h.push(r.index)}if("infix"===n||"prefix"===n||"postfix"===n||"spill"===n){const n=t.inputs,i=n.length,s=e.value;r.op=s;const a=new Array(i);r.inputs=a;for(let e=0;e<i;e++){const t=n[e],i=c.get(t);i&&(i.hasHorizontalAbs&&(r.hasHorizontalAbs=!0),i.hasVerticalAbs&&(r.hasVerticalAbs=!0)),a[e]=i?i.index:-1,o.delete(i)}if(o.add(r),kc.includes(s)){const t=n[0],i=!!t&&"cell"===t.type,o=n[1],s=!!o&&"cell"===o.type;i&&s&&(h.splice(o.refIndex,1),o.refIndex=t.refIndex,e.refIndex=t.refIndex,h[t.refIndex]=r.index)}else"#"===s&&(e.refIndex=n[0].refIndex);return void u.push(e)}if("error"===n||"named"===n){a||(a=new Map);const i=t.value;let s=a.get(i);return r.op=n,void 0===s&&(s=a.size,a.set(i,s)),r.value=s,o.add(r),e.refIndex=h.length,void h.push(r.index)}"tableReference"===n&&(r.op=n),"tableSpecifier"===n&&(r.op=n),"structuredArg"===n&&(r.op=n)}else if(t&&t.isReference){const t=e,n={node:e,index:c.size,op:"function",value:e.value,inputs:null};c.set(t,n)}if(e.isLiteral)if("array"!==n)i[r]=e.value;else{const t=e.value,n=t.length,o=new Array(n);for(let e=0;e<n;e++){const n=t[e].value,r=n.length,i=new Array(r);for(let e=0;e<r;e++){const t=n[e];let r=t.value;if("prefix"===t.type){const e=t.value;r=t.inputs[0].value,"-"===e&&(r=-r)}i[e]=r}o[e]=i}i[r]=l(o)}else{if("empty"!==n)return u.push(e),e;i[r]=void 0}});const f=new Array(s.size);s.forEach((e,t)=>{const n=t.value,r=n.colIndex,i=n.rowIndex,o=n.$colIndex,s=n.$rowIndex,a={colStart:r,rowStart:i,colEnd:r,rowEnd:i,$colStart:o,$rowStart:s,$colEnd:o,$rowEnd:s};r===Number.MIN_SAFE_INTEGER&&(a.colEnd=Number.MAX_SAFE_INTEGER),i===Number.MIN_SAFE_INTEGER&&(a.rowEnd=Number.MAX_SAFE_INTEGER),n.sheetName&&(a.sheetName=n.sheetName),f[e]=a});const d=f.length,p=new Array(d);for(let e=0;e<d;e++)p[e]={colStart:0,rowStart:0,colEnd:0,rowEnd:0,sheetName:null};const m=new Array(c.size);let E;c.forEach(e=>{m[e.index]=e}),a&&(E=[],a.forEach((e,t)=>{E.push(t)}));const g=[];o.forEach(e=>{g.push(e.index)});const T=u.length;for(let e=0;e<T;e++){const t=u[e],n=t.type;if("infix"===n){const e=t.value;t.fn=cc[e]}else if("prefix"===n){const e=t.value;t.fn=uc[e]}else if("postfix"===n){const e=t.value;t.fn=lc[e]}}const A=function(e){const t=[],n=(e,n)=>{const r={type:e.type,value:e.value};void 0!==e.evalIndex&&(r.evalIndex=e.evalIndex),void 0!==e.refIndex&&(r.refIndex=e.refIndex),n&&(r.ctx=n),t.push(r)},r=(e,n,r,i)=>{if(null==n)return;if(t.length>1&&"whitespace"===e&&"whitespace"===t[t.length-1].type)return;const o={type:e,value:n};r&&(o.ctx=r),void 0!==i&&(o.evalIndex=i),t.push(o)};!function e(t,i,o){const s=t.evalIndex??o??0,a=t.type,c=(t,n,i)=>{if(!t)return;const o=t.length;for(let s=0;s<o;s++)e(t[s],n,i),s<o-1&&r("comma",",",n)};if(t.isLiteral){if(r("whitespace",t.wsBefore,i),"array"===a){r("type","{",i);const n=t.value,o=n.length;for(let t=0;t<o;t++){const a=n[t],c=a.value,u=c.length;for(let t=0;t<u;t++){const n=c[t];r("whitespace",n.wsBefore,i),e(n,i,s),r("whitespace",n.wsAfter,i),t<u-1&&r("comma",",",i)}t<o-1&&(r("whitespace",a.wsBefore,i),r("comma",";",i),r("whitespace",a.wsAfter,i))}t.error||r("type","}",i)}else"quotedString"===a?(t={type:a,value:'"'+t.value+'"'},n(t,i)):n(t,i);r("whitespace",t.wsAfter,i)}else if("infix"===a)e(t.inputs[0],i,s),r("whitespace",t.wsBefore,i),n(t,i),r("whitespace",t.wsAfter,i),e(t.inputs[1],i,s);else if("prefix"===a)r("whitespace",t.wsBefore,i),n(t,i),r("whitespace",t.wsAfter,i),e(t.inputs[0],i,s);else if("postfix"===a)e(t.inputs[0],i,s),r("whitespace",t.wsBefore,i),n(t,i),r("whitespace",t.wsAfter,i);else{r("whitespace",t.wsBefore,i);const o=t.inputs;switch(a){case"function":n(t,i);const u={name:String(t.value),argIndex:-1};if(r("paren","(",u,t.evalIndex),o){const t=o.length;for(let n=0;n<t;n++){const i={...u,argIndex:n};e(o[n],i,s),n<t-1&&r("comma",",",i)}}t.error||r("paren",")",u,t.evalIndex);break;case"cell":n(t,i);break;case"paren":r(a,"(",i,s),c(o,i,s),t.error||r(a,")",i,s);break;case"squareParen":r(a,"[",i,s),c(o,i,s),t.error||r(a,"]",i,s);break;case"tableReference":n(t,i);const l={name:String(t.value),argIndex:-1};if(r("paren","[",l),o){const t=o.length;for(let n=0;n<t;n++){const i={...l,argIndex:n};e(o[n],i,s),n<t-1&&r("comma",",",i)}}t.error||r("paren","]",l);break;default:void 0!==t.value&&n(t,i),o&&o.forEach(t=>e(t,i,s))}r("whitespace",t.wsAfter,i)}}(e);const i=t.length;for(let e=0;e<i;e++){const n=t[e];if("whitespace"===n.type&&void 0===n.evalIndex){const r=t[e+1];r&&void 0!==r.evalIndex&&(n.evalIndex=r.evalIndex)}}return t}(r);return{ast:r,evaluations:i,executions:u,precedentsAbsolute:p,precedentsExecute:m,precedentsNamed:E,precedentsRelative:f,precedentsRoot:g,references:h,tokens:A,error:t}}function Lc(e,n){let r,i=-1,o="";Number.isSafeInteger(e.previousToken?.startLine)?(i=e.previousToken.startLine,r=e.previousToken.endColumn+1):Number.isSafeInteger(e.token?.startLine)&&(i=e.token.startLine,r=e.token.startColumn),-1!==i?(o+="\n"+n.split("\n")[i-1]+"\n",o+=Array(r-1).fill(" ").join("")+"^\n",o+=`Error at position ${i}:${r}\n`+e.message,e.errorLocation={line:i,column:r}):o=n+"\n"+e.message;const s=new t.Parse(o);return s.details=e,s}const xc=function(e,t){return t.wsBefore&&(e.wsBefore=t.wsBefore),t.wsAfter&&(e.wsAfter=t.wsAfter),t.image&&(e.image=t.image),e},Cc=Object.freeze([[":",".:.",".:",,":."],["^"],["*","/"],["+","-"],["&"],["<",">","=","<>","<=",">="]]),kc=Object.freeze([":",".:.",".:",,":."]),bc=Object.freeze([":"," ",".:.",".:",,":."]),Pc=Object.freeze(["@"]),wc=Object.freeze(["#"]),Mc=Object.freeze(bc.concat(Pc).concat(wc)),{String:Uc,SheetQuoted:Fc,SingleQuotedString:Dc,FunctionToken:jc,NamedTableReference:Bc,LiteralError:$c,RefError:Wc,Cell:Gc,Sheet:Kc,Name:zc,NumberToken:Vc,Boolean:Hc,Column:Yc,AbsRow:Xc,ImplicitIntersectOp:qc,Comma:Zc,RangeUnion:Qc,RangeTrimFull:Jc,RangeTrimLeading:eu,RangeTrimTrailing:tu,Semicolon:nu,OpenParen:ru,CloseParen:iu,OpenSquareParen:ou,CloseSquareParen:su,OpenCurlyParen:au,CloseCurlyParen:cu,MulOp:uu,PlusOp:lu,DivOp:hu,MinOp:fu,ConcatOp:du,ExOp:pu,PercentOp:mu,ArrayAnchorOp:Eu,TableSpecifier:gu,BracketedString:Tu,NeqOp:Au,GteOp:Iu,LteOp:Nu,GtOp:yu,EqOp:Ru,LtOp:vu}=$a;class Ou extends Xs{constructor(){super($a,{nodeLocationTracking:"full",maxLookahead:1,skipValidations:!0,recoveryEnabled:!0}),this.position={colIndex:0,rowIndex:0},this.astErrors=[];const e=this,t=(t,n,r)=>{let i;e.CONSUME(n);const o=e.getLexerPosition();i=e.ACTION(()=>(i={type:t,value:null,inputs:null},this._ensureWhitespace(i,o,!0)));const s=[],a=e.SUBRULE(e.intersectOp);a&&s.push(a);const c=e.SUBRULE(e.group),u=e.OPTION(()=>this.CONSUME(r));return i=e.ACTION(()=>{if(c)for(let e=0;e<c.length;e++)s.push(c[e]);return i&&(u||this._reportError(i,"Missing closing parenthesis",o),i.inputs=s),this._ensureWhitespace(i,e.getLexerPosition(),!1,!0)}),i};e.RULE("infixOp",()=>{const t=[],n=[e.SUBRULE(e.postfixOp)];return e.MANY(()=>{const r=e.OR(e.c1||(e.c1=[{ALT:()=>e.CONSUME(Qc).image},{ALT:()=>e.CONSUME(lu).image},{ALT:()=>e.CONSUME(fu).image},{ALT:()=>e.CONSUME(uu).image},{ALT:()=>e.CONSUME(hu).image},{ALT:()=>e.CONSUME(pu).image},{ALT:()=>e.CONSUME(du).image},{ALT:()=>e.CONSUME(yu).image},{ALT:()=>e.CONSUME(Ru).image},{ALT:()=>e.CONSUME(vu).image},{ALT:()=>e.CONSUME(Au).image},{ALT:()=>e.CONSUME(Iu).image},{ALT:()=>e.CONSUME(Nu).image},{ALT:()=>e.CONSUME(Jc).image},{ALT:()=>e.CONSUME(eu).image},{ALT:()=>e.CONSUME(tu).image}]));t.push([r,e.getLexerPosition(),Mc.includes(r)]),n.push(e.SUBRULE2(e.postfixOp))}),e.ACTION(()=>{let e=t.length;const r=Cc.length;for(let i=0;e>0&&i<r;i++){const r=Cc[i];let o=t.length;for(let i=0;i<o;i++){const s=t[i],a=s[0];if(!r.includes(a))continue;let c=gc(a,n[i],n[i+1],s[2]);c=this._ensureWhitespace(c,s[1]),t.splice(i,1),n.splice(i,2,c),i--,o--,e--}}}),n[0]}),e.RULE("plusMinusOp",()=>e.OR([{ALT:()=>e.CONSUME(lu).image},{ALT:()=>e.CONSUME(fu).image}])),e.RULE("postfixOp",()=>{let t=e.SUBRULE(e.prefixOp);const n=[];return e.MANY(()=>{const t=e.OR([{ALT:()=>e.CONSUME(mu).image},{ALT:()=>e.CONSUME(Eu).image}]);e.ACTION(()=>{n.push([t,e.getLexerPosition()])})}),e.ACTION(()=>{const e=n.length;if(0!==e)for(let r=0;r<e;r++){const e=n[r],i=e[0],o=e[1],s=Mc.includes(i);t=Tc(i,t,s),t=this._ensureWhitespace(t,o)}}),t}),e.RULE("prefixOp",()=>{const t=[];e.MANY(()=>{const n=e.OR([{ALT:()=>e.CONSUME(lu).image},{ALT:()=>e.CONSUME(fu).image},{ALT:()=>e.CONSUME(qc).image}]);e.ACTION(()=>{t.push([n,e.getLexerPosition()])})});let n=e.SUBRULE(e.formula);return e.ACTION(()=>{const e=t.length;if(0!==e)for(let r=e-1;r>=0;r--){const e=t[r],i=e[0],o=e[1],s=Mc.includes(i);n=Ac(i,n,s),n=this._ensureWhitespace(n,o)}}),n}),e.RULE("intersectOp",()=>{const t=[e.SUBRULE(e.infixOp)];return e.MANY(()=>{e.OPTION({GATE:()=>{const t=e.LA(0);return e.LA(1).startOffset>t.endOffset+1},DEF:()=>{t.push(e.SUBRULE3(e.infixOp))}})}),e.ACTION(()=>{for(;t.length>1;){let e=t.length-1;for(let n=0;n<e;n++){const r=t[n],i=t[n+1],o=gc(" ",r,i,!0);if(delete r.wsAfter,i.wsBefore){const e=i.wsBefore.slice(0,-1),t=e.length;delete i.wsBefore,t>0&&(o.wsBefore=e)}n+1<e&&delete i.wsAfter,t.splice(n,2,o),n--,e--}}}),t[0]}),e.RULE("formula",()=>e.OR9([{ALT:()=>e.SUBRULE(e.referenceWithoutInfix)},{ALT:()=>e.SUBRULE(e.function)},{ALT:()=>e.SUBRULE(e.paren)},{ALT:()=>e.SUBRULE(e.namedTableReference)},{ALT:()=>e.SUBRULE(e.bracketedString)},{ALT:()=>e.SUBRULE(e.squareParen)},{ALT:()=>e.SUBRULE(e.literal)},{ALT:()=>e.SUBRULE(e.literalArray)}])),e.RULE("group",()=>{const t=[];return e.MANY(()=>{e.CONSUME(Zc);const n=e.SUBRULE2(e.intersectOp);e.ACTION(()=>{t.push(n)})}),t}),e.RULE("paren",()=>t("paren",ru,iu)),e.RULE("literalArray",()=>{let t={type:"row",value:[],isLiteral:!0};e.CONSUME(au);const n=e.getLexerPosition();let r=e.ACTION(()=>this._ensureWhitespace({type:"array",value:[t],isLiteral:!0},n,!0));const i=e.SUBRULE(e.literalForArray);e.ACTION(()=>{t.value.push(i)}),e.MANY(()=>{const n=e.OR([{ALT:()=>e.CONSUME(Zc).image},{ALT:()=>e.CONSUME(nu).image}]),i=e.SUBRULE2(e.literalForArray);e.ACTION(()=>{","===n||(t={type:"row",value:[],isLiteral:!0},r.value.push(t)),t.value.push(i)})});const o=e.OPTION(()=>this.CONSUME(cu));return r=e.ACTION(()=>(o||this._reportError(r,"Missing closing parenthesis '}'",n),this._ensureWhitespace(r,e.getLexerPosition(),!1,!0))),r}),e.RULE("literalForArray",()=>e.OR([{ALT:()=>{const t=e.OPTION(()=>e.SUBRULE(e.plusMinusOp)),n=e.CONSUME(Vc),r=e.ACTION(()=>this._ensureWhitespace(Nc(n.image),e.getLexerPosition()));return t?e.ACTION(()=>function(e,t){return{type:"prefix",value:e,inputs:[t]}}(t,r)):r}},{ALT:()=>{const t=e.CONSUME(Uc);return e.ACTION(()=>this._ensureWhitespace(yc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Hc);return e.ACTION(()=>this._ensureWhitespace(Rc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME($c);return e.ACTION(()=>this._ensureWhitespace(vc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Wc);return e.ACTION(()=>this._ensureWhitespace(Oc(t.image),e.getLexerPosition()))}}])),e.RULE("literal",()=>e.OR([{ALT:()=>{const t=e.CONSUME(Vc);return e.ACTION(()=>this._ensureWhitespace(Nc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Uc);return e.ACTION(()=>this._ensureWhitespace(yc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Hc);return e.ACTION(()=>this._ensureWhitespace(Rc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME($c);return e.ACTION(()=>this._ensureWhitespace(vc(t.image),e.getLexerPosition()))}}])),e.RULE("function",()=>{const t=e.CONSUME(jc).image.slice(0,-1),n=e.getLexerPosition(),r=e.SUBRULE(e.functionArguments);let i=e.ACTION(()=>this._ensureWhitespace(pc(t,r),n,!0));const o=e.OPTION(()=>this.CONSUME(iu));return i=e.ACTION(()=>(o||this._reportError(i,"Missing closing parenthesis ')'",n),this._ensureWhitespace(i,e.getLexerPosition(),!1,!0))),i}),e.RULE("functionArguments",()=>{const t=[];return e.MANY2(()=>{let n;e.CONSUME2(Zc),n=e.ACTION(()=>this._ensureWhitespace({type:"empty",value:""},e.getLexerPosition(),!1,!0)),t.push(n)}),e.OPTION(()=>{t.push(e.SUBRULE(e.intersectOp)),e.MANY(()=>{let n;e.CONSUME1(Zc),n=e.ACTION(()=>this._ensureWhitespace({type:"empty",value:""},e.getLexerPosition(),!1,!0)),t.push(n),e.OPTION3(()=>{t.pop(),t.push(e.SUBRULE2(e.intersectOp))})})}),t}),e.RULE("bracketedString",()=>{const t=e.CONSUME(Tu),n=e.getLexerPosition();return e.ACTION(()=>{const r=t.image;let i=mc("",[Ec(r.substring(1,r.length-1))]);return i=this._ensureWhitespace(i,n,!0,!1),i=this._ensureWhitespace(i,e.getLexerPosition(),!1,!0),i})}),e.RULE("squareParen",()=>{e.CONSUME(ou);const t=e.getLexerPosition();let n=mc("",[e.SUBRULE(e.structuredArgument)]);const r=e.OPTION(()=>this.CONSUME(su));return e.ACTION(()=>{r||this._reportError(n,"Missing closing parenthesis ']'",t),n=this._ensureWhitespace(n,t,!0,!1),n=this._ensureWhitespace(n,e.getLexerPosition(),!1,!0)}),n}),e.RULE("namedTableReference",()=>{const t=e.CONSUME(Bc).image.slice(0,-1),n=e.getLexerPosition(),r=e.SUBRULE(e.structuredArguments);let i=e.ACTION(()=>this._ensureWhitespace(mc(t,r),n,!0));const o=e.OPTION(()=>this.CONSUME(su));return i=e.ACTION(()=>(o||this._reportError(i,"Missing closing parenthesis ']'",n),this._ensureWhitespace(i,e.getLexerPosition(),!1,!0))),i}),e.RULE("structuredArguments",()=>{const t=[];return e.MANY2(()=>{e.CONSUME2(Zc),e.ACTION(()=>{t.push(this._ensureWhitespace({type:"empty",value:""},e.getLexerPosition(),!1,!0))})}),e.OPTION(()=>{const n=e.SUBRULE(e.structuredArgument);e.ACTION(()=>{n&&t.push(n)}),e.MANY(()=>{e.CONSUME1(Zc),e.OPTION3(()=>{let n=e.SUBRULE2(e.structuredArgument);e.ACTION(()=>{n||(n=this._ensureWhitespace({type:"empty",value:""},e.getLexerPosition(),!1,!0)),t.push(n)})})})}),t}),e.RULE("structuredArgument",()=>{const t=e.OPTION(()=>e.CONSUME(qc)),n=e.getLexerPosition(),r=e.OPTION2(()=>this.CONSUME(ou));let i=e.OR([{ALT:()=>{const t=e.CONSUME(gu);return e.ACTION(()=>this._ensureWhitespace(Ec(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Tu);return e.ACTION(()=>this._ensureWhitespace(Ec(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(zc);return e.ACTION(()=>this._ensureWhitespace(Ic(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Dc);return e.ACTION(()=>this._ensureWhitespace(yc(t.image),e.getLexerPosition()))}}]);if(r){const t=e.OPTION3(()=>this.CONSUME(iu));e.ACTION(()=>(t||this._reportError(i,"Missing closing parenthesis ']'",n),this._ensureWhitespace(i,e.getLexerPosition(),!1,!0))),i={type:"structuredArg",value:null,inputs:[i]}}return e.ACTION(()=>{t&&(i=Ac(t.image,i,!0),i=this._ensureWhitespace(i,e.getLexerPosition()))}),i}),e.RULE("referenceWithoutInfix",()=>e.OR([{ALT:()=>e.SUBRULE(e.reference)},{ALT:()=>{const t=e.SUBRULE(e.prefixSheetName),n=e.SUBRULE2(e.formula);return e.ACTION(()=>{if((e=n)&&e.isFormulaError)return n;var e;n.ref&&(n.ref.sheet=t)}),n}}])),e.RULE("reference",()=>{const t=e.OPTION4(()=>e.CONSUME(qc));let n=e.OR([{ALT:()=>{const t=e.CONSUME(Gc),n=e.getLexerPosition(),r=e.OPTION(()=>e.CONSUME(Eu));return e.ACTION(()=>{const i=this._ensureWhitespace(function(e,t){const n=e.match(/([$]?)([A-Za-z]{1,3})([$]?)([1-9][0-9]*)/);let r=hc(n[2])-1;const i=1===n[1].length;let o=+n[4]-1;const s=1===n[3].length;return i||r===Number.MIN_SAFE_INTEGER||(r-=t.colIndex),s||o===Number.MIN_SAFE_INTEGER||(o-=t.rowIndex),{type:"cell",value:Object.freeze({colIndex:r,rowIndex:o,$colIndex:i,$rowIndex:s}),inputs:null,isReference:!0}}(t.image,e.position),n);return r?this._ensureWhitespace(Tc("#",i,!0),n):i})}},{ALT:()=>{const t=e.CONSUME(zc);return e.ACTION(()=>this._ensureWhitespace(Ic(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Yc);return e.ACTION(()=>this._ensureWhitespace(function(e,t){const n=e.startsWith("$");n&&(e=e.substring(1));let r=hc(e)-1;return n||r===Number.MIN_SAFE_INTEGER||(r-=t.colIndex),{type:"cell",value:Object.freeze({colIndex:r,rowIndex:Number.MIN_SAFE_INTEGER,$colIndex:n,$rowIndex:!1}),inputs:null,isReference:!0}}(t.image,e.position),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Xc);return e.ACTION(()=>this._ensureWhitespace(dc(t.image,e.position),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Wc);return e.ACTION(()=>this._ensureWhitespace(Oc(t.image),e.getLexerPosition()))}}]);return e.ACTION(()=>{t&&(n=Ac(t,n,!0),n=this._ensureWhitespace(n,e.getLexerPosition()))}),n}),e.RULE("prefixSheetName",()=>e.OR([{ALT:()=>e.CONSUME(Kc).image.slice(0,-1)},{ALT:()=>e.CONSUME(Fc).image.slice(1,-2).replace(/''/g,"'")}])),e.performSelfAnalysis()}_reportError(e,t,n=void 0,r="SyntaxError"){void 0===n&&(n=this.getLexerPosition()),e.error=!0,this.astErrors.push({name:r,message:t,previousToken:this.input[n],ast:e})}_ensureWhitespace(e,t,n=!1,r=!1){if(!e)return console.warn("node is null"),e;const i=this.input,o=i[t];if(e.image||(e.image=o.image),!r){const n=o.startOffset,r=i[t-1],s=r?.endOffset??-1;s+1<n&&(e.wsBefore=" ".repeat(n-s-1))}if(!n){const n=o.endOffset,r=i[t+1],s=r?.startOffset??this.inputTextLength;n+1<s&&(e.wsAfter=" ".repeat(s-n-1))}return e}_createAST(e,n){const r=function(e){const n=Ba.tokenize(e);if(n.errors.length>0){const r=n.errors[0],i=r.line,o=r.column;let s="\n"+e.split("\n")[i-1]+"\n";throw s+=Array(o-1).fill(" ").join("")+"^\n",r.message=s+`Error at position ${i}:${o}\n`+r.message,r.errorLocation={line:i,column:o},new t.Parse(r.message,{line:i,column:o,offset:r.offset,length:r.length})}return n}(n);let i;if(!r)return i={type:"text",value:n},i;const o=r.tokens;this.input=o,this.inputTextLength=n.length;const s=e.getPosition();return this.position=s,this.astErrors=[],this.reset(),i=this.intersectOp(),i=Sc(i,(e,t)=>{let n=e.type;if("function"===n&&e.value&&e.value.toUpperCase().startsWith("_XLFN.")){const t=e.value.substring(6);let r=e.image.substring(6),i=e;"ANCHORARRAY"===t?(i=Tc("#",e.inputs[0],!0),r="#"):"SINGLE"===t?(i=Ac("@",e.inputs[0],!0),r="@"):i=pc(t,e.inputs),xc(i,e),i.image=r,n=(e=i).type}const r=t?.isReference;if(r){const n=t.value;if((":"===n||".:."===n||".:"===n||":."===n)&&Number.isInteger(e.value)){const n=t.inputs[0]===e?t.inputs[1]:t.inputs[0];if(n&&Number.isInteger(n.value)){const t=dc(e.image,s);return xc(t,e),t}}}else if("cell"===n){const t=e.value;if(t.rowIndex===Number.MIN_SAFE_INTEGER||t.colIndex>=16384){const t=Ic(e.image);return xc(t,e),t}}return e}),i}build(e,r){if(0===r.length)throw Error("Input must not be empty.");let i,o,s;try{i=this._createAST(e,r)}catch(e){s=e instanceof t.Parse?e:new t.Parse(e.message,e)}const a=this.errors;a.length>0&&(s=Lc(a[0],r));const c=this.astErrors;return c.length>0&&(s=Lc(c[0],r)),o=i?_c(i,s):{ast:null,evaluations:n.EmptyArray,executions:n.EmptyArray,precedentsAbsolute:n.EmptyArray,precedentsExecute:n.EmptyArray,precedentsNamed:null,precedentsRelative:n.EmptyArray,precedentsRoot:n.EmptyArray,references:n.EmptyArray,tokens:n.EmptyArray,error:s},o}}class Su{constructor(e,t){this._options=e,this._compiled=t}getTextAt(e,t,n=!1){return n?r(this._compiled.tokens):i(this._compiled.tokens,e,t)}getTokens(){return this._compiled.tokens}getError(){return this._compiled.error??null}isEquals(e){if(!(e&&e instanceof Su))return!1;if(this===e)return!0;const t=this._compiled.tokens,n=e._compiled.tokens;return t.length===n.length&&r(t)===r(n)}getReferences(){const e=this._compiled,t=e.references,r=t.length;if(0===r)return n.EmptyArray;const i=e.precedentsExecute,o=e.precedentsRelative,s=new Array(r);for(let n=0;n<r;n++){const r=i[t[n]],a=r.inputs;if(a&&2===a.length){const e=o[i[a[0]].value],t=o[i[a[1]].value];s[n]={colStart:e.colStart,rowStart:e.rowStart,colEnd:t.colEnd,rowEnd:t.rowEnd,$colStart:e.$colStart,$rowStart:e.$rowStart,$colEnd:t.$colEnd,$rowEnd:t.$rowEnd,sheetName:e.sheetName}}else if("cell"===r.node.type){const e=o[r.value];s[n]={...e}}else if("named"===r.op){const t=e.precedentsNamed;s[n]=t[r.value]}else"error"===r.op&&(s[n]=r.node.value)}return s}setReferenceAt(e,t){const r=this._compiled,i=r.references;if(0===i.length)return n.EmptyArray;const s=r.precedentsExecute,a=i[e];if(void 0===a)throw new Error(`Invalid reference index: ${e}`);const c=s[a],u=c.node,l=u.inputs??n.EmptyArray;let h,f,d=!1;t&&(h={colIndex:t.colStart,rowIndex:t.rowStart,$colIndex:t.$colStart??!1,$rowIndex:t.$rowStart??!1},t.sheetName&&(h.sheetName=t.sheetName),d=!o.isSingleCell(t),d&&(f={colIndex:t.colEnd,rowIndex:t.rowEnd,$colIndex:t.$colEnd??!1,$rowIndex:t.$rowEnd??!1},t.colEnd===Number.MAX_SAFE_INTEGER&&(f.colIndex=Number.MIN_SAFE_INTEGER),t.rowEnd===Number.MAX_SAFE_INTEGER&&(f.rowIndex=Number.MIN_SAFE_INTEGER)));const p=2===l.length;let m=-1,E=-1;if(p)m=l[0].evalIndex,E=l[1].evalIndex;else{if("cell"!==u.type)throw"named"===c.op?new Error("Cannot setReference for a named reference"):new Error(`Invalidate reference index: ${e}`);m=u.evalIndex}const g=this._compiled.ast,T=Sc(g,e=>{if(!e||!e.isReference)return;const n=e.type;if(!t&&kc.includes(e.value)){const e=l[0],t=l[1];let n=e.evalIndex===m,r=t.evalIndex===E;if(n||r){const e=Oc();return e.image="#REF!",e}}if("cell"!==n&&"error"!==n)return;const r=e.evalIndex;let i,o=r===m;if(o||r===E){if(t)if(p===d){let t=o?h:f;i={...e},i.value=t,i.image=null}else i=d?gc(":",fc(h),fc(f),!0):fc(h);else i=Oc(),i.image="#REF!";return i}});if(T===g)return this;const A=_c(T,this._compiled.error),I=this._options;return new Su(I,A)}_resolveNamed(e,n,r,i){const o=this._options?.getNamed;if(!o)return t.BuiltIn.Name;let a=o?.(e,this._options.getSheetName?.())?.[0];return a?(a.isFormulaError||(a=s(a,n,r,i)),a):t.BuiltIn.Name}getDirectPrecedentsAt(e,r,i=!1,a,c){const u=this._compiled,l=u.precedentsRoot,h=l.length;if(0===h)return n.EmptyArray;const f=u.precedentsRelative,d=u.precedentsAbsolute,p=f.length;for(let t=0;t<p;t++){const n=f[t];let i=d[t],o=s(n,e,r,i);d[t]=o}let m=!1;const E=u.precedentsExecute,g=E.length,T=_u;for(let n=0;n<g;n++){const i=E[n],s=i.op;if(!s){const e=d[i.value];T[i.index]=e;continue}if("named"===s){m=!0,T[i.index]=this._resolveNamed(i.node.value,e,r);continue}if("error"===s){T[i.index]=i.node.value;continue}if("@"===s||"#"===s){T[i.index]=T[i.inputs[0]];continue}const a=i.inputs;if(!a)continue;let c=T[a[0]];if(void 0===c){T[i.index]=t.BuiltIn.Value;continue}if(c.isFormulaError){T[i.index]=c;continue}let u,l=T[a[1]];void 0!==l?l.isFormulaError?T[i.index]=l:(" "===s?u=o.intersectRanges(c,l):":"!==s&&".:."!==s&&":."!==s&&".:"!==s||(u=T[i.index]=o.unionRanges(c,l)),T[i.index]=u??t.BuiltIn.Null):T[i.index]=t.BuiltIn.Value}const A=new Array(h);for(let e=0;e<h;e++){const t=l[e],n=T[t];if(A[e]=void 0!==n?.rowStart?{...n}:n,a||c){const r=E[t];m&&"named"===r.op?(a&&(a[e]=n.$colStart||n.$colEnd),c&&(c[e]=n.$rowStart||n.$rowEnd)):(a&&(a[e]=r.hasVerticalAbs),c&&(c[e]=r.hasHorizontalAbs))}}return A}evaluate(e,n,r){const i=e.getPosition(),o=i?.rowIndex??0,a=i?.colIndex??0;let c=this._compiled;if(void 0!==n){let e;if(Sc(c.ast,t=>{t.evalIndex===n&&(e=t)}),!e)throw new Error(`Invalid evalIndex: ${n}`);c=_c(e,c.error)}if(c.error)return c.error;const l=c.evaluations,h=c.executions;let f,d;r||(r=this._resolvePrecedents(e));const p=c.precedentsExecute,m=c.precedentsRelative,E=c.precedentsAbsolute,g=p.length;for(let t=0;t<g;t++){const n=p[t],r=n.op;if(r){if("named"===r){const t=n.node;let r=this._resolveNamed(n.node.value,o,a);void 0!==r?.colStart&&(r=e.getReference(r)),l[t.evalIndex]=r}else if("error"===r){const e=n.node;l[e.evalIndex]=n.node.value}}else{const e=m[n.value];let r=E[t];const i=s(e,o,a,r),c=n.node;l[c.evalIndex]=i}}const T=c.precedentsRoot,A=T.length;if(A!==r.length)return t.BuiltIn.Parse;for(let e=0;e<A;e++){const t=p[T[e]].node;let n=r[e];n.isIRange&&"cell"===t.type&&n.size>1&&(n=n.getValueAt(0,0)??null),l[t.evalIndex]=n}let I;const N=n=>{const r=n.inputs,i=r?r.length:0;let o;switch(n.type){case"infix":const s=n.value;let a=l[r[0].evalIndex],c=l[r[1].evalIndex];if("+"===s&&"number"==typeof a&&"number"==typeof c){const e=a+c;return Math.abs(e)<99e-14?0:e}if("-"===s&&"number"==typeof a&&"number"==typeof c){const e=a-c;return Math.abs(e)<99e-14?0:e}if(a&&a.isFormulaError)return a;if(c&&c.isFormulaError)return c;const h=n.fn;return o=h?h(e,a,c):t.BuiltIn.Value,o=u(o,null),o;case"function":I||(I=new Array(i)),I.length!==i&&(I.length=i);for(let e=0;e<i;e++)I[e]=l[r[e].evalIndex];return o=this._callFunction(e,n,I),o&&"function"==typeof o.then?o.then(r=>{r=u(r,e),o instanceof t.Known&&(d=o),l[n.evalIndex]=r}).catch(e=>{const r=e instanceof t.Known?e:new t.Value("Uncaught error",{cause:e});l[n.evalIndex]=r}):o instanceof t.Known&&(d=o),o;case"prefix":case"postfix":let f=l[r[0].evalIndex];if(f&&f.isFormulaError)return f;const p=n.fn;return o=p?p(e,f):t.BuiltIn.Value,o;case"paren":if(1===i)return l[r[0].evalIndex];{const e=new Array(i);for(let t=0;t<i;t++)e[t]=l[r[t].evalIndex];return e}case"named":return null;case"empty":return}};let y=h.length;for(let e=0;e<y;e++){const t=h[e];if(d)return d;if(f)f=f.then(()=>{const e=N(t);return l[t.evalIndex]=e,e});else{const e=N(t);l[t.evalIndex]=e,e&&"function"==typeof e.then&&(f=e)}}if(f)return f.then(()=>{const t=l[l.length-1];return this._finalizeReturnValue(e,t)});const R=l[l.length-1];return this._finalizeReturnValue(e,R)}_resolvePrecedents(e){const r=e.getPosition(),i=r?.rowIndex??0,o=r?.colIndex??0,s=this.getDirectPrecedentsAt(i,o),a=s.length;let c;if(a>0){c=new Array(a);for(let n=0;n<a;n++){const r=s[n];if(r instanceof t.Known)c[n]=r;else if(Array.isArray(r)){const t=new Array(r.length);for(let n=0;n<r.length;n++)t[n]=e.getReference(r[n]);c[n]=t}else c[n]=e.getReference(r)}}else c=n.EmptyArray;return c}wrapImplicit(e,t,n){const r=this._compiled.ast;if(!r||!r.isReference)return this;if("cell"===r.type)return this;if("@"===r.value)return this;if(!n)return this;const i=a(t)+c(e);if(n.has(i))return this;const o=_c(Ac("@",r,!0),this._compiled.error);return new Su(this._options,o)}_callFunction(e,n,r){const i=n?.cacheFn??e.getFunction(n.value);if(!i)return new t.Parse;const o=i.isBuiltIn();let s;o?n.cacheFn=i:this._context=e;try{s=i.execute(...r)}catch(e){s=e instanceof t.Known?e:new t.Value(e.message,{cause:e})}return o||(this._context=null),void 0===s?new t.Parse:s}_finalizeReturnValue(e,n){if(n&&void 0!==n.colStart&&(n=e.getValueAt(n.rowStart,n.colStart)),Array.isArray(n))if(1===n.length&&Array.isArray(n[0])&&1===n[0].length)n=n[0][0],Array.isArray(n)&&(n=t.BuiltIn.Value);else try{n=e.getRange(n)}catch(e){n=t.BuiltIn.Value}return n?.isIRange?1===n.size?(n=n.getValueAt(0,0,Lu),null===(n=u(n,e))&&(n=0)):n=n.fillEmpty(0):null===(n=u(n,e))&&(n=0),n}get[Symbol.toStringTag](){return"[FormulaBlock]"}toString(){const e=this._compiled;if(e.error)return e.error.toString();const t=this._context;if(t){const e=t.getPosition();return this.getTextAt(e.rowIndex,e.colIndex)}return r(e.tokens)}}const _u=new Array(20);for(let e=0;e<_u.length;e++)_u[e]={colStart:0,rowStart:0,colEnd:0,rowEnd:0,sheetName:null};const Lu={type:null};class xu{constructor(t){this._options={getEntireCoords:e,...t},this._astBuilder=new Ou}parse(e,t){e.getPosition().sheetName;const n=this._astBuilder.build(e,t);return new Su(this._options,n)}eval(e,t){return this.parse(e,t).evaluate(e)}}export{xu as FormulaParser};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{r as e,aj as a,j as t,s,B as n,aF as l,aG as o}from"./4GgcUVhUmQmiv9Ha.mjs";const i=["Ok","Cancel"],r=e.memo(r=>{const{value:d=null,context:u,onOption:p,onValidateOption:c,onDone:m,onUpdate:g,options:x=i,defaultOption:f=x?.[0],cancelOption:N="Cancel",sx:y,...T}=r,O=e.useMemo(()=>u?.getNames().findValidName("Range1"),[]),V=e.useMemo(()=>{if(!d)return!0},[]),[C,h]=e.useState({displayText:d?.getName()??O,errorText:null}),[j,R]=e.useState({displayValue:d?.getRanges()??u?.selection()??null,errorText:null}),[v,F]=e.useState(!1),w=e.useCallback(async e=>!C.errorText&&!j.errorText,[u]),D=a((e,a,t)=>{if(!a){let e=null;V?e=u?.getNames().addReference(C?.displayText,j?.displayValue,!1):("reference"===d.getType()&&d.doBatch(()=>{d.setName(C?.displayText),d.setReference(j?.displayValue)},`Edit Named '${C?.displayText}'`),e=d),e&&(e.select(),g(e,V))}p?.(e,a,t),m?.()},[u,C,j,m,p,f,N,g]),S=a(e=>{let a=null;try{u?.getNames().validateName(e)}catch(e){a=e.message}h({displayText:e,errorText:a})},[]),b=a(e=>{d&&d.getName().toLowerCase()===e.toLowerCase()||u?.getNames().validateName(e)},[u,d]),k=e.useCallback(e=>{R({displayValue:e??null,errorText:null})},[]);return t.jsx(s,{title:(V?"Define":"Edit")+" Range",options:x,onOption:D,onValidateOption:w,defaultOption:f,cancelOption:N,autoFocusSel:".autoFocus",sx:{width:"460px",...y},...T,children:t.jsxs(n,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),range:"flex",flexDirection:"column"},children:[t.jsx(l,{formName:"name",defaultInput:O,value:C.displayText,onChangeInput:S,onValidate:b,onFocus:e=>{v||e.target?.select(),F(!0)}}),t.jsx(o,{formName:"range",value:j.displayValue,onChangeInput:k,resolvedAddress:u.getNames().getRanges.bind(u.getNames()),onFocus:e=>{v||e.target?.select(),F(!0)}})]})})});export{r as NamedReferenceDialog,r as default};
|