@cfxjs/sirius-next-common 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arrowDown-2RQGEVL5.svg +3 -0
- package/dist/chunk-25QWXIAS.js +60 -0
- package/dist/chunk-25QWXIAS.js.map +1 -0
- package/dist/chunk-27GSITHB.js +28 -0
- package/dist/chunk-27GSITHB.js.map +1 -0
- package/dist/chunk-2C7IFQEA.js +27 -0
- package/dist/chunk-2C7IFQEA.js.map +1 -0
- package/dist/chunk-2CS64Q56.js +102 -0
- package/dist/chunk-2CS64Q56.js.map +1 -0
- package/dist/chunk-2CWEC36S.js +53 -0
- package/dist/chunk-2CWEC36S.js.map +1 -0
- package/dist/chunk-2GJPZIIE.js +27 -0
- package/dist/chunk-2GJPZIIE.js.map +1 -0
- package/dist/chunk-2IQSVQYV.js +27 -0
- package/dist/chunk-2IQSVQYV.js.map +1 -0
- package/dist/chunk-2ONZ5M75.js +3441 -0
- package/dist/chunk-2ONZ5M75.js.map +1 -0
- package/dist/chunk-2QKLQSRN.js +176 -0
- package/dist/chunk-2QKLQSRN.js.map +1 -0
- package/dist/chunk-2SJLVUR5.js +27 -0
- package/dist/chunk-2SJLVUR5.js.map +1 -0
- package/dist/chunk-2TNEFW2L.js +216 -0
- package/dist/chunk-2TNEFW2L.js.map +1 -0
- package/dist/chunk-3GGF3ULC.js +35 -0
- package/dist/chunk-3GGF3ULC.js.map +1 -0
- package/dist/chunk-3X7J72D7.js +100 -0
- package/dist/chunk-3X7J72D7.js.map +1 -0
- package/dist/chunk-45GWWTGX.js +102 -0
- package/dist/chunk-45GWWTGX.js.map +1 -0
- package/dist/chunk-45HVL3QX.js +27 -0
- package/dist/chunk-45HVL3QX.js.map +1 -0
- package/dist/chunk-4BMQQQOY.js +216 -0
- package/dist/chunk-4BMQQQOY.js.map +1 -0
- package/dist/chunk-4DOTFHHM.js +27 -0
- package/dist/chunk-4DOTFHHM.js.map +1 -0
- package/dist/chunk-4LQWWDGW.js +707 -0
- package/dist/chunk-4LQWWDGW.js.map +1 -0
- package/dist/chunk-4V4K4OJ4.js +100 -0
- package/dist/chunk-4V4K4OJ4.js.map +1 -0
- package/dist/chunk-4V7MBDIS.js +25 -0
- package/dist/chunk-4V7MBDIS.js.map +1 -0
- package/dist/chunk-4YULAKSU.js +27 -0
- package/dist/chunk-4YULAKSU.js.map +1 -0
- package/dist/chunk-4ZNTVKIA.js +22 -0
- package/dist/chunk-4ZNTVKIA.js.map +1 -0
- package/dist/chunk-52EWSX7J.js +27 -0
- package/dist/chunk-52EWSX7J.js.map +1 -0
- package/dist/chunk-546TZBBU.js +19 -0
- package/dist/chunk-546TZBBU.js.map +1 -0
- package/dist/chunk-54J4VH5Z.js +119 -0
- package/dist/chunk-54J4VH5Z.js.map +1 -0
- package/dist/chunk-54SPUUOZ.js +27 -0
- package/dist/chunk-54SPUUOZ.js.map +1 -0
- package/dist/chunk-5A2Q4BEC.js +65 -0
- package/dist/chunk-5A2Q4BEC.js.map +1 -0
- package/dist/chunk-5AEWLDN5.js +49 -0
- package/dist/chunk-5AEWLDN5.js.map +1 -0
- package/dist/chunk-5IE7FJUY.js +22 -0
- package/dist/chunk-5IE7FJUY.js.map +1 -0
- package/dist/chunk-5IEZKHNQ.js +1478 -0
- package/dist/chunk-5IEZKHNQ.js.map +1 -0
- package/dist/chunk-5IGPCDW5.js +60 -0
- package/dist/chunk-5IGPCDW5.js.map +1 -0
- package/dist/chunk-5NHNBLID.js +22 -0
- package/dist/chunk-5NHNBLID.js.map +1 -0
- package/dist/chunk-5S6I7VBP.js +27 -0
- package/dist/chunk-5S6I7VBP.js.map +1 -0
- package/dist/chunk-5V3UMMXJ.js +120 -0
- package/dist/chunk-5V3UMMXJ.js.map +1 -0
- package/dist/chunk-5VHCSEOH.js +179 -0
- package/dist/chunk-5VHCSEOH.js.map +1 -0
- package/dist/chunk-5ZLN3VJU.js +27 -0
- package/dist/chunk-5ZLN3VJU.js.map +1 -0
- package/dist/chunk-624443IP.js +37 -0
- package/dist/chunk-624443IP.js.map +1 -0
- package/dist/chunk-653SDFEF.js +27 -0
- package/dist/chunk-653SDFEF.js.map +1 -0
- package/dist/chunk-6A2TFIV6.js +100 -0
- package/dist/chunk-6A2TFIV6.js.map +1 -0
- package/dist/chunk-6CCBKPZA.js +27 -0
- package/dist/chunk-6CCBKPZA.js.map +1 -0
- package/dist/chunk-6FOBETW2.js +46 -0
- package/dist/chunk-6FOBETW2.js.map +1 -0
- package/dist/chunk-6ITBEFLS.js +49 -0
- package/dist/chunk-6ITBEFLS.js.map +1 -0
- package/dist/chunk-6LDPUF6C.js +60 -0
- package/dist/chunk-6LDPUF6C.js.map +1 -0
- package/dist/chunk-6R6YFBB2.js +22 -0
- package/dist/chunk-6R6YFBB2.js.map +1 -0
- package/dist/chunk-6UEVM7Q5.js +22 -0
- package/dist/chunk-6UEVM7Q5.js.map +1 -0
- package/dist/chunk-6UM5Y3SL.js +50 -0
- package/dist/chunk-6UM5Y3SL.js.map +1 -0
- package/dist/chunk-6Z6JAP4R.js +216 -0
- package/dist/chunk-6Z6JAP4R.js.map +1 -0
- package/dist/chunk-73DPEDDS.js +22 -0
- package/dist/chunk-73DPEDDS.js.map +1 -0
- package/dist/chunk-75JL3FSB.js +22 -0
- package/dist/chunk-75JL3FSB.js.map +1 -0
- package/dist/chunk-7J3MHSMU.js +176 -0
- package/dist/chunk-7J3MHSMU.js.map +1 -0
- package/dist/chunk-7JFLXBAL.js +62 -0
- package/dist/chunk-7JFLXBAL.js.map +1 -0
- package/dist/chunk-7SZUSPWM.js +179 -0
- package/dist/chunk-7SZUSPWM.js.map +1 -0
- package/dist/chunk-7TEFIAEG.js +176 -0
- package/dist/chunk-7TEFIAEG.js.map +1 -0
- package/dist/chunk-7U5APTOH.js +27 -0
- package/dist/chunk-7U5APTOH.js.map +1 -0
- package/dist/chunk-7XAT5SZJ.js +27 -0
- package/dist/chunk-7XAT5SZJ.js.map +1 -0
- package/dist/chunk-A2SOYUX7.js +22 -0
- package/dist/chunk-A2SOYUX7.js.map +1 -0
- package/dist/chunk-A356EUBR.js +27 -0
- package/dist/chunk-A356EUBR.js.map +1 -0
- package/dist/chunk-A63F3M2G.js +22 -0
- package/dist/chunk-A63F3M2G.js.map +1 -0
- package/dist/chunk-A6U63XS7.js +22 -0
- package/dist/chunk-A6U63XS7.js.map +1 -0
- package/dist/chunk-ADTPJ4V5.js +22 -0
- package/dist/chunk-ADTPJ4V5.js.map +1 -0
- package/dist/chunk-AEYHX3HP.js +61 -0
- package/dist/chunk-AEYHX3HP.js.map +1 -0
- package/dist/chunk-AGOKIWZZ.js +844 -0
- package/dist/chunk-AGOKIWZZ.js.map +1 -0
- package/dist/chunk-AGT5MA6S.js +61 -0
- package/dist/chunk-AGT5MA6S.js.map +1 -0
- package/dist/chunk-AIAFDTQT.js +196 -0
- package/dist/chunk-AIAFDTQT.js.map +1 -0
- package/dist/chunk-APPX7GEO.js +65 -0
- package/dist/chunk-APPX7GEO.js.map +1 -0
- package/dist/chunk-AQ6P63XV.js +36 -0
- package/dist/chunk-AQ6P63XV.js.map +1 -0
- package/dist/chunk-AQPHS44A.js +65 -0
- package/dist/chunk-AQPHS44A.js.map +1 -0
- package/dist/chunk-AQUETLB4.js +707 -0
- package/dist/chunk-AQUETLB4.js.map +1 -0
- package/dist/chunk-AURJNQGW.js +61 -0
- package/dist/chunk-AURJNQGW.js.map +1 -0
- package/dist/chunk-AXQV56I2.js +22 -0
- package/dist/chunk-AXQV56I2.js.map +1 -0
- package/dist/chunk-AYF5K4JP.js +216 -0
- package/dist/chunk-AYF5K4JP.js.map +1 -0
- package/dist/chunk-AYFCTFCN.js +22 -0
- package/dist/chunk-AYFCTFCN.js.map +1 -0
- package/dist/chunk-BO72SP7F.js +111 -0
- package/dist/chunk-BO72SP7F.js.map +1 -0
- package/dist/chunk-BU3LY3N5.js +37 -0
- package/dist/chunk-BU3LY3N5.js.map +1 -0
- package/dist/chunk-C2OQXICS.js +47 -0
- package/dist/chunk-C2OQXICS.js.map +1 -0
- package/dist/chunk-C6QGEHOL.js +838 -0
- package/dist/chunk-C6QGEHOL.js.map +1 -0
- package/dist/chunk-CBRX2B6Y.js +22 -0
- package/dist/chunk-CBRX2B6Y.js.map +1 -0
- package/dist/chunk-CIJA77I4.js +3459 -0
- package/dist/chunk-CIJA77I4.js.map +1 -0
- package/dist/chunk-CJOYNPNQ.js +22 -0
- package/dist/chunk-CJOYNPNQ.js.map +1 -0
- package/dist/chunk-CJQCVR64.js +41 -0
- package/dist/chunk-CJQCVR64.js.map +1 -0
- package/dist/chunk-CSL32MKT.js +112 -0
- package/dist/chunk-CSL32MKT.js.map +1 -0
- package/dist/chunk-CXSJ4LQP.js +62 -0
- package/dist/chunk-CXSJ4LQP.js.map +1 -0
- package/dist/chunk-CXZHHWAG.js +93 -0
- package/dist/chunk-CXZHHWAG.js.map +1 -0
- package/dist/chunk-D2KNOIZJ.js +27 -0
- package/dist/chunk-D2KNOIZJ.js.map +1 -0
- package/dist/chunk-DWU7MK5E.js +176 -0
- package/dist/chunk-DWU7MK5E.js.map +1 -0
- package/dist/chunk-DYCUWPED.js +61 -0
- package/dist/chunk-DYCUWPED.js.map +1 -0
- package/dist/chunk-E34G4YSV.js +176 -0
- package/dist/chunk-E34G4YSV.js.map +1 -0
- package/dist/chunk-ECJNCBFQ.js +102 -0
- package/dist/chunk-ECJNCBFQ.js.map +1 -0
- package/dist/chunk-ELG6GDH4.js +27 -0
- package/dist/chunk-ELG6GDH4.js.map +1 -0
- package/dist/chunk-ELZCOMBE.js +707 -0
- package/dist/chunk-ELZCOMBE.js.map +1 -0
- package/dist/chunk-ESAPWIDV.js +63 -0
- package/dist/chunk-ESAPWIDV.js.map +1 -0
- package/dist/chunk-EXW5F6NL.js +46 -0
- package/dist/chunk-EXW5F6NL.js.map +1 -0
- package/dist/chunk-F2TMU3AL.js +61 -0
- package/dist/chunk-F2TMU3AL.js.map +1 -0
- package/dist/chunk-F2UNHDUR.js +16 -0
- package/dist/chunk-F2UNHDUR.js.map +1 -0
- package/dist/chunk-FAGFAIUU.js +27 -0
- package/dist/chunk-FAGFAIUU.js.map +1 -0
- package/dist/chunk-FCMOSB7E.js +65 -0
- package/dist/chunk-FCMOSB7E.js.map +1 -0
- package/dist/chunk-FLVGMPHV.js +216 -0
- package/dist/chunk-FLVGMPHV.js.map +1 -0
- package/dist/chunk-FSLH4MIP.js +62 -0
- package/dist/chunk-FSLH4MIP.js.map +1 -0
- package/dist/chunk-FXBVUGRI.js +80 -0
- package/dist/chunk-FXBVUGRI.js.map +1 -0
- package/dist/chunk-G24D2NRU.js +22 -0
- package/dist/chunk-G24D2NRU.js.map +1 -0
- package/dist/chunk-GKAPQ7LN.js +3632 -0
- package/dist/chunk-GKAPQ7LN.js.map +1 -0
- package/dist/chunk-GUHILBGR.js +63 -0
- package/dist/chunk-GUHILBGR.js.map +1 -0
- package/dist/chunk-H3IMRG3I.js +53 -0
- package/dist/chunk-H3IMRG3I.js.map +1 -0
- package/dist/chunk-H3V3K4DD.js +44 -0
- package/dist/chunk-H3V3K4DD.js.map +1 -0
- package/dist/chunk-HA7FJBYQ.js +60 -0
- package/dist/chunk-HA7FJBYQ.js.map +1 -0
- package/dist/chunk-HBVMUDIG.js +46 -0
- package/dist/chunk-HBVMUDIG.js.map +1 -0
- package/dist/chunk-HI4CUQ7A.js +27 -0
- package/dist/chunk-HI4CUQ7A.js.map +1 -0
- package/dist/chunk-HOA5BC7S.js +27 -0
- package/dist/chunk-HOA5BC7S.js.map +1 -0
- package/dist/chunk-HR2KNVPF.js +61 -0
- package/dist/chunk-HR2KNVPF.js.map +1 -0
- package/dist/chunk-I3WPTSFO.js +179 -0
- package/dist/chunk-I3WPTSFO.js.map +1 -0
- package/dist/chunk-IB7T4CUM.js +3459 -0
- package/dist/chunk-IB7T4CUM.js.map +1 -0
- package/dist/chunk-ICXZGCLG.js +120 -0
- package/dist/chunk-ICXZGCLG.js.map +1 -0
- package/dist/chunk-IJ4UPXWM.js +35 -0
- package/dist/chunk-IJ4UPXWM.js.map +1 -0
- package/dist/chunk-ILQXEOSB.js +61 -0
- package/dist/chunk-ILQXEOSB.js.map +1 -0
- package/dist/chunk-IM77KPX5.js +78 -0
- package/dist/chunk-IM77KPX5.js.map +1 -0
- package/dist/chunk-IS76X5TE.js +100 -0
- package/dist/chunk-IS76X5TE.js.map +1 -0
- package/dist/chunk-J5NPC6NJ.js +27 -0
- package/dist/chunk-J5NPC6NJ.js.map +1 -0
- package/dist/chunk-JACMNCWT.js +215 -0
- package/dist/chunk-JACMNCWT.js.map +1 -0
- package/dist/chunk-JCVKAQDU.js +100 -0
- package/dist/chunk-JCVKAQDU.js.map +1 -0
- package/dist/chunk-JO46BYJI.js +93 -0
- package/dist/chunk-JO46BYJI.js.map +1 -0
- package/dist/chunk-JO5JHISS.js +93 -0
- package/dist/chunk-JO5JHISS.js.map +1 -0
- package/dist/chunk-JOYMTLWQ.js +176 -0
- package/dist/chunk-JOYMTLWQ.js.map +1 -0
- package/dist/chunk-JQXQDMRC.js +61 -0
- package/dist/chunk-JQXQDMRC.js.map +1 -0
- package/dist/chunk-JRAFUCCF.js +22 -0
- package/dist/chunk-JRAFUCCF.js.map +1 -0
- package/dist/chunk-JTZF2MUU.js +27 -0
- package/dist/chunk-JTZF2MUU.js.map +1 -0
- package/dist/chunk-JZRCC4Q7.js +119 -0
- package/dist/chunk-JZRCC4Q7.js.map +1 -0
- package/dist/chunk-KAGD5CB6.js +100 -0
- package/dist/chunk-KAGD5CB6.js.map +1 -0
- package/dist/chunk-KAPSY6QS.js +27 -0
- package/dist/chunk-KAPSY6QS.js.map +1 -0
- package/dist/chunk-KK7XFZMX.js +46 -0
- package/dist/chunk-KK7XFZMX.js.map +1 -0
- package/dist/chunk-KKIH2YPS.js +27 -0
- package/dist/chunk-KKIH2YPS.js.map +1 -0
- package/dist/chunk-KMV3NISR.js +65 -0
- package/dist/chunk-KMV3NISR.js.map +1 -0
- package/dist/chunk-KSSYWOD6.js +93 -0
- package/dist/chunk-KSSYWOD6.js.map +1 -0
- package/dist/chunk-L2JESTXK.js +62 -0
- package/dist/chunk-L2JESTXK.js.map +1 -0
- package/dist/chunk-LDWHYCAM.js +838 -0
- package/dist/chunk-LDWHYCAM.js.map +1 -0
- package/dist/chunk-LHGVVIEZ.js +707 -0
- package/dist/chunk-LHGVVIEZ.js.map +1 -0
- package/dist/chunk-LJWHSXL5.js +61 -0
- package/dist/chunk-LJWHSXL5.js.map +1 -0
- package/dist/chunk-LRRZQJVV.js +216 -0
- package/dist/chunk-LRRZQJVV.js.map +1 -0
- package/dist/chunk-LYI4EQZ3.js +120 -0
- package/dist/chunk-LYI4EQZ3.js.map +1 -0
- package/dist/chunk-M2WED4GE.js +107 -0
- package/dist/chunk-M2WED4GE.js.map +1 -0
- package/dist/chunk-M4L4LFJJ.js +22 -0
- package/dist/chunk-M4L4LFJJ.js.map +1 -0
- package/dist/chunk-M6AOTEU6.js +119 -0
- package/dist/chunk-M6AOTEU6.js.map +1 -0
- package/dist/chunk-MABMW3F2.js +37 -0
- package/dist/chunk-MABMW3F2.js.map +1 -0
- package/dist/chunk-MCZT23D6.js +119 -0
- package/dist/chunk-MCZT23D6.js.map +1 -0
- package/dist/chunk-MH7KB7D2.js +27 -0
- package/dist/chunk-MH7KB7D2.js.map +1 -0
- package/dist/chunk-MSQQRS5T.js +63 -0
- package/dist/chunk-MSQQRS5T.js.map +1 -0
- package/dist/chunk-MZRFBOWD.js +22 -0
- package/dist/chunk-MZRFBOWD.js.map +1 -0
- package/dist/chunk-N6B5ZKDM.js +60 -0
- package/dist/chunk-N6B5ZKDM.js.map +1 -0
- package/dist/chunk-N6V3EZQS.js +46 -0
- package/dist/chunk-N6V3EZQS.js.map +1 -0
- package/dist/chunk-NCT7N5ZO.js +781 -0
- package/dist/chunk-NCT7N5ZO.js.map +1 -0
- package/dist/chunk-NFAJYSI7.js +27 -0
- package/dist/chunk-NFAJYSI7.js.map +1 -0
- package/dist/chunk-NMFJLSY5.js +100 -0
- package/dist/chunk-NMFJLSY5.js.map +1 -0
- package/dist/chunk-NO7KRLGV.js +100 -0
- package/dist/chunk-NO7KRLGV.js.map +1 -0
- package/dist/chunk-NWSIXBRD.js +93 -0
- package/dist/chunk-NWSIXBRD.js.map +1 -0
- package/dist/chunk-O4QARNTB.js +179 -0
- package/dist/chunk-O4QARNTB.js.map +1 -0
- package/dist/chunk-O6NJ56NA.js +43 -0
- package/dist/chunk-O6NJ56NA.js.map +1 -0
- package/dist/chunk-OBX6RJEW.js +78 -0
- package/dist/chunk-OBX6RJEW.js.map +1 -0
- package/dist/chunk-OGYP6XKU.js +19 -0
- package/dist/chunk-OGYP6XKU.js.map +1 -0
- package/dist/chunk-OK7ZHYID.js +196 -0
- package/dist/chunk-OK7ZHYID.js.map +1 -0
- package/dist/chunk-ONRPKCIB.js +27 -0
- package/dist/chunk-ONRPKCIB.js.map +1 -0
- package/dist/chunk-OTMKUAHM.js +60 -0
- package/dist/chunk-OTMKUAHM.js.map +1 -0
- package/dist/chunk-OWEKHXL6.js +37 -0
- package/dist/chunk-OWEKHXL6.js.map +1 -0
- package/dist/chunk-OYJGSKTU.js +102 -0
- package/dist/chunk-OYJGSKTU.js.map +1 -0
- package/dist/chunk-P3STXDCF.js +119 -0
- package/dist/chunk-P3STXDCF.js.map +1 -0
- package/dist/chunk-P5STBOCR.js +352 -0
- package/dist/chunk-P5STBOCR.js.map +1 -0
- package/dist/chunk-PDGP7SBR.js +43 -0
- package/dist/chunk-PDGP7SBR.js.map +1 -0
- package/dist/chunk-PTT2OZV4.js +14 -0
- package/dist/chunk-PTT2OZV4.js.map +1 -0
- package/dist/chunk-PWBOQ74R.js +22 -0
- package/dist/chunk-PWBOQ74R.js.map +1 -0
- package/dist/chunk-Q7C37EMA.js +93 -0
- package/dist/chunk-Q7C37EMA.js.map +1 -0
- package/dist/chunk-QCOK2N67.js +62 -0
- package/dist/chunk-QCOK2N67.js.map +1 -0
- package/dist/chunk-QEA5CFVU.js +61 -0
- package/dist/chunk-QEA5CFVU.js.map +1 -0
- package/dist/chunk-QGFBNI4G.js +22 -0
- package/dist/chunk-QGFBNI4G.js.map +1 -0
- package/dist/chunk-QI52IGHS.js +27 -0
- package/dist/chunk-QI52IGHS.js.map +1 -0
- package/dist/chunk-QNPGAFQK.js +49 -0
- package/dist/chunk-QNPGAFQK.js.map +1 -0
- package/dist/chunk-R5ECXT74.js +150 -0
- package/dist/chunk-R5ECXT74.js.map +1 -0
- package/dist/chunk-R66RPCTU.js +27 -0
- package/dist/chunk-R66RPCTU.js.map +1 -0
- package/dist/chunk-R6JXPAOX.js +50 -0
- package/dist/chunk-R6JXPAOX.js.map +1 -0
- package/dist/chunk-RLWYAD7T.js +27 -0
- package/dist/chunk-RLWYAD7T.js.map +1 -0
- package/dist/chunk-RLZTFLPD.js +24 -0
- package/dist/chunk-RLZTFLPD.js.map +1 -0
- package/dist/chunk-ROAIYVDT.js +22 -0
- package/dist/chunk-ROAIYVDT.js.map +1 -0
- package/dist/chunk-RRIL2F7M.js +100 -0
- package/dist/chunk-RRIL2F7M.js.map +1 -0
- package/dist/chunk-RV66XRFR.js +111 -0
- package/dist/chunk-RV66XRFR.js.map +1 -0
- package/dist/chunk-RVRQ2255.js +60 -0
- package/dist/chunk-RVRQ2255.js.map +1 -0
- package/dist/chunk-S4JJPIDW.js +22 -0
- package/dist/chunk-S4JJPIDW.js.map +1 -0
- package/dist/chunk-SCXHS4HO.js +709 -0
- package/dist/chunk-SCXHS4HO.js.map +1 -0
- package/dist/chunk-SI5YJXRM.js +709 -0
- package/dist/chunk-SI5YJXRM.js.map +1 -0
- package/dist/chunk-SQZ7HX2Q.js +180 -0
- package/dist/chunk-SQZ7HX2Q.js.map +1 -0
- package/dist/chunk-T5PU6MYN.js +22 -0
- package/dist/chunk-T5PU6MYN.js.map +1 -0
- package/dist/chunk-T7BICPTT.js +3459 -0
- package/dist/chunk-T7BICPTT.js.map +1 -0
- package/dist/chunk-TGINZWRL.js +27 -0
- package/dist/chunk-TGINZWRL.js.map +1 -0
- package/dist/chunk-TJ6J4LRS.js +22 -0
- package/dist/chunk-TJ6J4LRS.js.map +1 -0
- package/dist/chunk-TS7XJ6JK.js +22 -0
- package/dist/chunk-TS7XJ6JK.js.map +1 -0
- package/dist/chunk-TU4M4EAJ.js +177 -0
- package/dist/chunk-TU4M4EAJ.js.map +1 -0
- package/dist/chunk-TZ25WIJN.js +27 -0
- package/dist/chunk-TZ25WIJN.js.map +1 -0
- package/dist/chunk-U3JDCY6F.js +100 -0
- package/dist/chunk-U3JDCY6F.js.map +1 -0
- package/dist/chunk-UBCDOZDY.js +3452 -0
- package/dist/chunk-UBCDOZDY.js.map +1 -0
- package/dist/chunk-UDM4PGUT.js +62 -0
- package/dist/chunk-UDM4PGUT.js.map +1 -0
- package/dist/chunk-UH5JZYVE.js +49 -0
- package/dist/chunk-UH5JZYVE.js.map +1 -0
- package/dist/chunk-ULQ2DZPS.js +22 -0
- package/dist/chunk-ULQ2DZPS.js.map +1 -0
- package/dist/chunk-UQLL5CUW.js +112 -0
- package/dist/chunk-UQLL5CUW.js.map +1 -0
- package/dist/chunk-UT4JDBL4.js +61 -0
- package/dist/chunk-UT4JDBL4.js.map +1 -0
- package/dist/chunk-UV6SB23I.js +27 -0
- package/dist/chunk-UV6SB23I.js.map +1 -0
- package/dist/chunk-V5QBEPMZ.js +763 -0
- package/dist/chunk-V5QBEPMZ.js.map +1 -0
- package/dist/chunk-V75DEMU4.js +27 -0
- package/dist/chunk-V75DEMU4.js.map +1 -0
- package/dist/chunk-VF7HI7RV.js +22 -0
- package/dist/chunk-VF7HI7RV.js.map +1 -0
- package/dist/chunk-W6E7LNDA.js +61 -0
- package/dist/chunk-W6E7LNDA.js.map +1 -0
- package/dist/chunk-WATQ7EQT.js +22 -0
- package/dist/chunk-WATQ7EQT.js.map +1 -0
- package/dist/chunk-WDM5CTLH.js +3459 -0
- package/dist/chunk-WDM5CTLH.js.map +1 -0
- package/dist/chunk-WDQ2AOIO.js +61 -0
- package/dist/chunk-WDQ2AOIO.js.map +1 -0
- package/dist/chunk-WFCK7FPT.js +60 -0
- package/dist/chunk-WFCK7FPT.js.map +1 -0
- package/dist/chunk-WIAW4POL.js +22 -0
- package/dist/chunk-WIAW4POL.js.map +1 -0
- package/dist/chunk-WLKMIQSZ.js +22 -0
- package/dist/chunk-WLKMIQSZ.js.map +1 -0
- package/dist/chunk-WM2V2ZCY.js +100 -0
- package/dist/chunk-WM2V2ZCY.js.map +1 -0
- package/dist/chunk-WML236LE.js +30 -0
- package/dist/chunk-WML236LE.js.map +1 -0
- package/dist/chunk-X34QEZHK.js +61 -0
- package/dist/chunk-X34QEZHK.js.map +1 -0
- package/dist/chunk-X4Y3E73B.js +107 -0
- package/dist/chunk-X4Y3E73B.js.map +1 -0
- package/dist/chunk-XCKMXAL2.js +57 -0
- package/dist/chunk-XCKMXAL2.js.map +1 -0
- package/dist/chunk-XQHSIGUO.js +196 -0
- package/dist/chunk-XQHSIGUO.js.map +1 -0
- package/dist/chunk-Y4M2WIUH.js +27 -0
- package/dist/chunk-Y4M2WIUH.js.map +1 -0
- package/dist/chunk-YDGIQMYG.js +37 -0
- package/dist/chunk-YDGIQMYG.js.map +1 -0
- package/dist/chunk-YK5KNGDQ.js +61 -0
- package/dist/chunk-YK5KNGDQ.js.map +1 -0
- package/dist/chunk-YMHY5AZC.js +22 -0
- package/dist/chunk-YMHY5AZC.js.map +1 -0
- package/dist/chunk-YO35FTDP.js +102 -0
- package/dist/chunk-YO35FTDP.js.map +1 -0
- package/dist/chunk-YRCX5J3B.js +22 -0
- package/dist/chunk-YRCX5J3B.js.map +1 -0
- package/dist/chunk-YVIZX6QJ.js +2266 -0
- package/dist/chunk-YVIZX6QJ.js.map +1 -0
- package/dist/chunk-Z2Z6JPLB.js +27 -0
- package/dist/chunk-Z2Z6JPLB.js.map +1 -0
- package/dist/chunk-ZCC5UWKB.js +61 -0
- package/dist/chunk-ZCC5UWKB.js.map +1 -0
- package/dist/chunk-ZDW2WA4O.js +61 -0
- package/dist/chunk-ZDW2WA4O.js.map +1 -0
- package/dist/chunk-ZSP5VMHE.js +61 -0
- package/dist/chunk-ZSP5VMHE.js.map +1 -0
- package/dist/chunk-ZWGO3274.js +27 -0
- package/dist/chunk-ZWGO3274.js.map +1 -0
- package/dist/chunk-ZXZQSDM4.js +112 -0
- package/dist/chunk-ZXZQSDM4.js.map +1 -0
- package/dist/components/AddressContainer/addressSwitcher.d.ts +15 -0
- package/dist/components/AddressContainer/addressSwitcher.js +25 -0
- package/dist/components/AddressContainer/addressSwitcher.js.map +1 -0
- package/dist/components/AddressContainer/addressView.d.ts +9 -0
- package/dist/components/AddressContainer/addressView.js +14 -0
- package/dist/components/AddressContainer/addressView.js.map +1 -0
- package/dist/components/AddressContainer/index.d.ts +11 -0
- package/dist/components/AddressContainer/index.js +151 -0
- package/dist/components/AddressContainer/index.js.map +1 -0
- package/dist/components/AddressContainer/label.d.ts +11 -0
- package/dist/components/AddressContainer/label.js +10 -0
- package/dist/components/AddressContainer/label.js.map +1 -0
- package/dist/components/AddressContainer/types.d.ts +72 -0
- package/dist/components/AddressContainer/types.js +1 -0
- package/dist/components/AddressContainer/types.js.map +1 -0
- package/dist/components/Button/ActionButton/index.d.ts +10 -0
- package/dist/components/Button/ActionButton/index.js +8 -0
- package/dist/components/Button/ActionButton/index.js.map +1 -0
- package/dist/components/Button/BaseButton/index.d.ts +10 -0
- package/dist/components/Button/BaseButton/index.js +7 -0
- package/dist/components/Button/BaseButton/index.js.map +1 -0
- package/dist/components/Button/IconButton/index.d.ts +6 -0
- package/dist/components/Button/IconButton/index.js +8 -0
- package/dist/components/Button/IconButton/index.js.map +1 -0
- package/dist/components/Button/index.d.ts +15 -0
- package/dist/components/Button/index.js +19 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Card/index.d.ts +9 -0
- package/dist/components/Card/index.js +8 -0
- package/dist/components/Card/index.js.map +1 -0
- package/dist/components/Charts/BreadcrumbNav.d.ts +11 -0
- package/dist/components/Charts/BreadcrumbNav.js +9 -0
- package/dist/components/Charts/BreadcrumbNav.js.map +1 -0
- package/dist/components/Charts/ChartOptions.d.ts +7 -0
- package/dist/components/Charts/ChartOptions.js +9 -0
- package/dist/components/Charts/ChartOptions.js.map +1 -0
- package/dist/components/Charts/PreviewChartTemplate.d.ts +7 -0
- package/dist/components/Charts/PreviewChartTemplate.js +75 -0
- package/dist/components/Charts/PreviewChartTemplate.js.map +1 -0
- package/dist/components/Charts/PreviewTitle.d.ts +19 -0
- package/dist/components/Charts/PreviewTitle.js +10 -0
- package/dist/components/Charts/PreviewTitle.js.map +1 -0
- package/dist/components/Charts/StockChartTemplate.d.ts +7 -0
- package/dist/components/Charts/StockChartTemplate.js +111 -0
- package/dist/components/Charts/StockChartTemplate.js.map +1 -0
- package/dist/components/Charts/StockTitle.d.ts +15 -0
- package/dist/components/Charts/StockTitle.js +7 -0
- package/dist/components/Charts/StockTitle.js.map +1 -0
- package/dist/components/Charts/config.d.ts +206 -0
- package/dist/components/Charts/config.js +17 -0
- package/dist/components/Charts/config.js.map +1 -0
- package/dist/components/CookieTip/CookieIcon.d.ts +5 -0
- package/dist/components/CookieTip/CookieIcon.js +7 -0
- package/dist/components/CookieTip/CookieIcon.js.map +1 -0
- package/dist/components/CookieTip/index.d.ts +6 -0
- package/dist/components/CookieTip/index.js +51 -0
- package/dist/components/CookieTip/index.js.map +1 -0
- package/dist/components/CopyButton/index.d.ts +13 -0
- package/dist/components/CopyButton/index.js +81 -0
- package/dist/components/CopyButton/index.js.map +1 -0
- package/dist/components/CountDown/index.d.ts +11 -0
- package/dist/components/CountDown/index.js +69 -0
- package/dist/components/CountDown/index.js.map +1 -0
- package/dist/components/DeleteIcon/index.d.ts +8 -0
- package/dist/components/DeleteIcon/index.js +44 -0
- package/dist/components/DeleteIcon/index.js.map +1 -0
- package/dist/components/Description/index.d.ts +15 -0
- package/dist/components/Description/index.js +7 -0
- package/dist/components/Description/index.js.map +1 -0
- package/dist/components/Divider/index.d.ts +5 -0
- package/dist/components/Divider/index.js +7 -0
- package/dist/components/Divider/index.js.map +1 -0
- package/dist/components/DownloadCSV/index.d.ts +7 -0
- package/dist/components/DownloadCSV/index.js +81 -0
- package/dist/components/DownloadCSV/index.js.map +1 -0
- package/dist/components/Dropdown/index.d.ts +12 -0
- package/dist/components/Dropdown/index.js +111 -0
- package/dist/components/Dropdown/index.js.map +1 -0
- package/dist/components/Empty/index.d.ts +17 -0
- package/dist/components/Empty/index.js +45 -0
- package/dist/components/Empty/index.js.map +1 -0
- package/dist/components/FileUpload/index.d.ts +9 -0
- package/dist/components/FileUpload/index.js +47 -0
- package/dist/components/FileUpload/index.js.map +1 -0
- package/dist/components/Footer/index.d.ts +11 -0
- package/dist/components/Footer/index.js +40 -0
- package/dist/components/Footer/index.js.map +1 -0
- package/dist/components/GasPriceDropdown/index.d.ts +5 -0
- package/dist/components/GasPriceDropdown/index.js +257 -0
- package/dist/components/GasPriceDropdown/index.js.map +1 -0
- package/dist/components/ImageSkeleton/index.d.ts +5 -0
- package/dist/components/ImageSkeleton/index.js +45 -0
- package/dist/components/ImageSkeleton/index.js.map +1 -0
- package/dist/components/InfoIconWithTooltip/InfoIcon.d.ts +6 -0
- package/dist/components/InfoIconWithTooltip/InfoIcon.js +7 -0
- package/dist/components/InfoIconWithTooltip/InfoIcon.js.map +1 -0
- package/dist/components/InfoIconWithTooltip/index.d.ts +10 -0
- package/dist/components/InfoIconWithTooltip/index.js +26 -0
- package/dist/components/InfoIconWithTooltip/index.js.map +1 -0
- package/dist/components/Link/index.d.ts +11 -0
- package/dist/components/Link/index.js +8 -0
- package/dist/components/Link/index.js.map +1 -0
- package/dist/components/List/index.d.ts +17 -0
- package/dist/components/List/index.js +62 -0
- package/dist/components/List/index.js.map +1 -0
- package/dist/components/Loading/head.png.png +0 -0
- package/dist/components/Loading/index.d.ts +5 -0
- package/dist/components/Loading/index.js +23 -0
- package/dist/components/Loading/index.js.map +1 -0
- package/dist/components/Loading/loading.d.ts +3 -0
- package/dist/components/Loading/loading.js +7 -0
- package/dist/components/Loading/loading.js.js +7 -0
- package/dist/components/Loading/loading.js.js.map +1 -0
- package/dist/components/Loading/loading.js.map +1 -0
- package/dist/components/Modal/index.d.ts +20 -0
- package/dist/components/Modal/index.js +10 -0
- package/dist/components/Modal/index.js.map +1 -0
- package/dist/components/PageHeader/index.d.ts +9 -0
- package/dist/components/PageHeader/index.js +25 -0
- package/dist/components/PageHeader/index.js.map +1 -0
- package/dist/components/Price/index.d.ts +8 -0
- package/dist/components/Price/index.js +39 -0
- package/dist/components/Price/index.js.map +1 -0
- package/dist/components/Remark/index.d.ts +11 -0
- package/dist/components/Remark/index.js +25 -0
- package/dist/components/Remark/index.js.map +1 -0
- package/dist/components/SearchIcon/index.d.ts +8 -0
- package/dist/components/SearchIcon/index.js +22 -0
- package/dist/components/SearchIcon/index.js.map +1 -0
- package/dist/components/Select/index.d.ts +21 -0
- package/dist/components/Select/index.js +79 -0
- package/dist/components/Select/index.js.map +1 -0
- package/dist/components/Select/select.d.ts +15 -0
- package/dist/components/Select/select.js +28 -0
- package/dist/components/Select/select.js.map +1 -0
- package/dist/components/Skeleton/index.d.ts +16 -0
- package/dist/components/Skeleton/index.js +7 -0
- package/dist/components/Skeleton/index.js.map +1 -0
- package/dist/components/SkeletonContainer/index.d.ts +13 -0
- package/dist/components/SkeletonContainer/index.js +8 -0
- package/dist/components/SkeletonContainer/index.js.map +1 -0
- package/dist/components/SkeletonContainer copy/index.js +18 -0
- package/dist/components/SkeletonContainer copy/index.js.map +1 -0
- package/dist/components/Spin/index.d.ts +9 -0
- package/dist/components/Spin/index.js +7 -0
- package/dist/components/Spin/index.js.map +1 -0
- package/dist/components/Text/index.d.ts +18 -0
- package/dist/components/Text/index.js +12 -0
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/TextLogo/index.d.ts +13 -0
- package/dist/components/TextLogo/index.js +32 -0
- package/dist/components/TextLogo/index.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +11 -0
- package/dist/components/Tooltip/index.js +8 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/contract-icon-P3W2HUAA.png +0 -0
- package/dist/gas-high-2FHHZJBC.png +0 -0
- package/dist/gas-low-JCWBTFHA.png +0 -0
- package/dist/gas-median-6ZSO4ALW.png +0 -0
- package/dist/head-QBKK4MAD.png +0 -0
- package/dist/icon-gas-5GGIE2EY.svg +10 -0
- package/dist/info-LDHHCVQK.svg +11 -0
- package/dist/internal-contract-icon-ZH2RG3CU.png +0 -0
- package/dist/loading-head-QBKK4MAD.png +0 -0
- package/dist/loading-header-QBKK4MAD.png +0 -0
- package/dist/logo-cns-7CXISC6I.svg +5 -0
- package/dist/me-SIV36SR7.png +0 -0
- package/dist/refresh-76F4NLDY.svg +4 -0
- package/dist/store/index.d.ts +15 -0
- package/dist/store/index.js +21 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/types.d.ts +79 -0
- package/dist/store/types.js +1 -0
- package/dist/store/types.js.map +1 -0
- package/dist/table-whoops-UDAVUZCG.png +0 -0
- package/dist/uno.css +457 -0
- package/dist/utils/address.d.ts +26 -0
- package/dist/utils/address.js +43 -0
- package/dist/utils/address.js.map +1 -0
- package/dist/utils/constants.d.ts +31 -0
- package/dist/utils/constants.js +15 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/cookie.d.ts +9 -0
- package/dist/utils/cookie.js +7 -0
- package/dist/utils/cookie.js.map +1 -0
- package/dist/utils/ga.d.ts +35 -0
- package/dist/utils/ga.js +23 -0
- package/dist/utils/ga.js.map +1 -0
- package/dist/utils/hooks/useAge.d.ts +5 -0
- package/dist/utils/hooks/useAge.js +19 -0
- package/dist/utils/hooks/useAge.js.map +1 -0
- package/dist/utils/hooks/useENS.d.ts +9 -0
- package/dist/utils/hooks/useENS.js +13 -0
- package/dist/utils/hooks/useENS.js.map +1 -0
- package/dist/utils/hooks/useGetTxnStatus.d.ts +11 -0
- package/dist/utils/hooks/useGetTxnStatus.js +91 -0
- package/dist/utils/hooks/useGetTxnStatus.js.map +1 -0
- package/dist/utils/index.d.ts +142 -0
- package/dist/utils/index.js +110 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/media.d.ts +17 -0
- package/dist/utils/media.js +11 -0
- package/dist/utils/media.js.map +1 -0
- package/dist/utils/request.d.ts +21 -0
- package/dist/utils/request.js +15 -0
- package/dist/utils/request.js.map +1 -0
- package/dist/utils/rpcRequest.d.ts +3 -0
- package/dist/utils/rpcRequest.js +9 -0
- package/dist/utils/rpcRequest.js.map +1 -0
- package/dist/verified-VJRHZNN7.png +0 -0
- package/package.json +79 -0
|
@@ -0,0 +1,3459 @@
|
|
|
1
|
+
// src/components/Tooltip/index.tsx
|
|
2
|
+
import {
|
|
3
|
+
Children as Children2,
|
|
4
|
+
isValidElement as isValidElement2,
|
|
5
|
+
cloneElement as cloneElement2
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
// ../../node_modules/.pnpm/@cfx-kit+ui-components@0.0.17_@zag-js+accordion@0.19.1_@zag-js+checkbox@0.19.1_@zag-js+dialog_fmko2yy6bkfybbxu2fwkms7fpm/node_modules/@cfx-kit/ui-components/dist/chunk-G2ADBYYC.js
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __defProps = Object.defineProperties;
|
|
11
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
|
+
var __spreadValues = (a2, b) => {
|
|
17
|
+
for (var prop in b || (b = {}))
|
|
18
|
+
if (__hasOwnProp.call(b, prop))
|
|
19
|
+
__defNormalProp(a2, prop, b[prop]);
|
|
20
|
+
if (__getOwnPropSymbols)
|
|
21
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
22
|
+
if (__propIsEnum.call(b, prop))
|
|
23
|
+
__defNormalProp(a2, prop, b[prop]);
|
|
24
|
+
}
|
|
25
|
+
return a2;
|
|
26
|
+
};
|
|
27
|
+
var __spreadProps = (a2, b) => __defProps(a2, __getOwnPropDescs(b));
|
|
28
|
+
var __objRest = (source, exclude) => {
|
|
29
|
+
var target = {};
|
|
30
|
+
for (var prop in source)
|
|
31
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
if (source != null && __getOwnPropSymbols)
|
|
34
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
35
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
36
|
+
target[prop] = source[prop];
|
|
37
|
+
}
|
|
38
|
+
return target;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// ../../node_modules/.pnpm/@cfx-kit+ui-components@0.0.17_@zag-js+accordion@0.19.1_@zag-js+checkbox@0.19.1_@zag-js+dialog_fmko2yy6bkfybbxu2fwkms7fpm/node_modules/@cfx-kit/ui-components/dist/Tooltip.js
|
|
42
|
+
import { useEffect as useEffect3, useId, isValidElement, cloneElement, Children } from "react";
|
|
43
|
+
|
|
44
|
+
// ../../node_modules/.pnpm/@zag-js+anatomy@0.19.1/node_modules/@zag-js/anatomy/dist/index.mjs
|
|
45
|
+
var createAnatomy = (name, parts2 = []) => ({
|
|
46
|
+
parts: (...values) => {
|
|
47
|
+
if (isEmpty(parts2)) {
|
|
48
|
+
return createAnatomy(name, values);
|
|
49
|
+
}
|
|
50
|
+
throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?");
|
|
51
|
+
},
|
|
52
|
+
extendWith: (...values) => createAnatomy(name, [...parts2, ...values]),
|
|
53
|
+
rename: (newName) => createAnatomy(newName, parts2),
|
|
54
|
+
keys: () => parts2,
|
|
55
|
+
build: () => [...new Set(parts2)].reduce(
|
|
56
|
+
(prev, part) => Object.assign(prev, {
|
|
57
|
+
[part]: {
|
|
58
|
+
selector: [
|
|
59
|
+
`&[data-scope="${toKebabCase(name)}"][data-part="${toKebabCase(part)}"]`,
|
|
60
|
+
`& [data-scope="${toKebabCase(name)}"][data-part="${toKebabCase(part)}"]`
|
|
61
|
+
].join(", "),
|
|
62
|
+
attrs: { "data-scope": toKebabCase(name), "data-part": toKebabCase(part) }
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
{}
|
|
66
|
+
)
|
|
67
|
+
});
|
|
68
|
+
var toKebabCase = (value) => value.replace(/([A-Z])([A-Z])/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
69
|
+
var isEmpty = (v) => v.length === 0;
|
|
70
|
+
|
|
71
|
+
// ../../node_modules/.pnpm/@zag-js+dom-query@0.19.1/node_modules/@zag-js/dom-query/dist/index.mjs
|
|
72
|
+
var dataAttr = (guard) => {
|
|
73
|
+
return guard ? "" : void 0;
|
|
74
|
+
};
|
|
75
|
+
function isHTMLElement(value) {
|
|
76
|
+
return typeof value === "object" && value?.nodeType === Node.ELEMENT_NODE && typeof value?.nodeName === "string";
|
|
77
|
+
}
|
|
78
|
+
var getDocument = (node) => {
|
|
79
|
+
if (node.nodeType === Node.DOCUMENT_NODE)
|
|
80
|
+
return node;
|
|
81
|
+
return node.ownerDocument ?? document;
|
|
82
|
+
};
|
|
83
|
+
function createScope(methods) {
|
|
84
|
+
const screen = {
|
|
85
|
+
getRootNode: (ctx) => ctx.getRootNode?.() ?? document,
|
|
86
|
+
getDoc: (ctx) => getDocument(screen.getRootNode(ctx)),
|
|
87
|
+
getWin: (ctx) => screen.getDoc(ctx).defaultView ?? window,
|
|
88
|
+
getActiveElement: (ctx) => screen.getDoc(ctx).activeElement,
|
|
89
|
+
getById: (ctx, id) => screen.getRootNode(ctx).getElementById(id),
|
|
90
|
+
setValue: (elem, value) => {
|
|
91
|
+
if (elem == null || value == null)
|
|
92
|
+
return;
|
|
93
|
+
elem.value = value.toString();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return { ...screen, ...methods };
|
|
97
|
+
}
|
|
98
|
+
function isScrollParent(el) {
|
|
99
|
+
const win = el.ownerDocument.defaultView || window;
|
|
100
|
+
const { overflow, overflowX, overflowY } = win.getComputedStyle(el);
|
|
101
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
102
|
+
}
|
|
103
|
+
function getParent(el) {
|
|
104
|
+
if (el.localName === "html")
|
|
105
|
+
return el;
|
|
106
|
+
return el.assignedSlot || el.parentElement || el.ownerDocument.documentElement;
|
|
107
|
+
}
|
|
108
|
+
function getScrollParent(el) {
|
|
109
|
+
if (["html", "body", "#document"].includes(el.localName)) {
|
|
110
|
+
return el.ownerDocument.body;
|
|
111
|
+
}
|
|
112
|
+
if (isHTMLElement(el) && isScrollParent(el)) {
|
|
113
|
+
return el;
|
|
114
|
+
}
|
|
115
|
+
return getScrollParent(getParent(el));
|
|
116
|
+
}
|
|
117
|
+
function getScrollParents(el, list = []) {
|
|
118
|
+
const parent = getScrollParent(el);
|
|
119
|
+
const isBody = parent === el.ownerDocument.body;
|
|
120
|
+
const win = parent.ownerDocument.defaultView || window;
|
|
121
|
+
const target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(parent) ? parent : []) : parent;
|
|
122
|
+
const parents = list.concat(target);
|
|
123
|
+
return isBody ? parents : parents.concat(getScrollParents(getParent(target)));
|
|
124
|
+
}
|
|
125
|
+
var isDom = () => typeof document !== "undefined";
|
|
126
|
+
function getPlatform() {
|
|
127
|
+
const agent = navigator.userAgentData;
|
|
128
|
+
return agent?.platform ?? navigator.platform;
|
|
129
|
+
}
|
|
130
|
+
var pt = (v) => isDom() && v.test(getPlatform());
|
|
131
|
+
var vn = (v) => isDom() && v.test(navigator.vendor);
|
|
132
|
+
var isSafari = () => isApple() && vn(/apple/i);
|
|
133
|
+
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
|
|
134
|
+
function raf(fn) {
|
|
135
|
+
const id = globalThis.requestAnimationFrame(fn);
|
|
136
|
+
return () => {
|
|
137
|
+
globalThis.cancelAnimationFrame(id);
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// ../../node_modules/.pnpm/@floating-ui+utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
142
|
+
var min = Math.min;
|
|
143
|
+
var max = Math.max;
|
|
144
|
+
var oppositeSideMap = {
|
|
145
|
+
left: "right",
|
|
146
|
+
right: "left",
|
|
147
|
+
bottom: "top",
|
|
148
|
+
top: "bottom"
|
|
149
|
+
};
|
|
150
|
+
var oppositeAlignmentMap = {
|
|
151
|
+
start: "end",
|
|
152
|
+
end: "start"
|
|
153
|
+
};
|
|
154
|
+
function clamp(start, value, end) {
|
|
155
|
+
return max(start, min(value, end));
|
|
156
|
+
}
|
|
157
|
+
function evaluate(value, param) {
|
|
158
|
+
return typeof value === "function" ? value(param) : value;
|
|
159
|
+
}
|
|
160
|
+
function getSide(placement) {
|
|
161
|
+
return placement.split("-")[0];
|
|
162
|
+
}
|
|
163
|
+
function getAlignment(placement) {
|
|
164
|
+
return placement.split("-")[1];
|
|
165
|
+
}
|
|
166
|
+
function getOppositeAxis(axis) {
|
|
167
|
+
return axis === "x" ? "y" : "x";
|
|
168
|
+
}
|
|
169
|
+
function getAxisLength(axis) {
|
|
170
|
+
return axis === "y" ? "height" : "width";
|
|
171
|
+
}
|
|
172
|
+
function getSideAxis(placement) {
|
|
173
|
+
return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
|
|
174
|
+
}
|
|
175
|
+
function getAlignmentAxis(placement) {
|
|
176
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
177
|
+
}
|
|
178
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
179
|
+
if (rtl === void 0) {
|
|
180
|
+
rtl = false;
|
|
181
|
+
}
|
|
182
|
+
const alignment = getAlignment(placement);
|
|
183
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
184
|
+
const length = getAxisLength(alignmentAxis);
|
|
185
|
+
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
186
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
187
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
188
|
+
}
|
|
189
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
190
|
+
}
|
|
191
|
+
function getExpandedPlacements(placement) {
|
|
192
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
193
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
194
|
+
}
|
|
195
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
196
|
+
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
197
|
+
}
|
|
198
|
+
function getSideList(side, isStart, rtl) {
|
|
199
|
+
const lr = ["left", "right"];
|
|
200
|
+
const rl = ["right", "left"];
|
|
201
|
+
const tb = ["top", "bottom"];
|
|
202
|
+
const bt = ["bottom", "top"];
|
|
203
|
+
switch (side) {
|
|
204
|
+
case "top":
|
|
205
|
+
case "bottom":
|
|
206
|
+
if (rtl)
|
|
207
|
+
return isStart ? rl : lr;
|
|
208
|
+
return isStart ? lr : rl;
|
|
209
|
+
case "left":
|
|
210
|
+
case "right":
|
|
211
|
+
return isStart ? tb : bt;
|
|
212
|
+
default:
|
|
213
|
+
return [];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
217
|
+
const alignment = getAlignment(placement);
|
|
218
|
+
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
219
|
+
if (alignment) {
|
|
220
|
+
list = list.map((side) => side + "-" + alignment);
|
|
221
|
+
if (flipAlignment) {
|
|
222
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return list;
|
|
226
|
+
}
|
|
227
|
+
function getOppositePlacement(placement) {
|
|
228
|
+
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
|
|
229
|
+
}
|
|
230
|
+
function expandPaddingObject(padding) {
|
|
231
|
+
return {
|
|
232
|
+
top: 0,
|
|
233
|
+
right: 0,
|
|
234
|
+
bottom: 0,
|
|
235
|
+
left: 0,
|
|
236
|
+
...padding
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function getPaddingObject(padding) {
|
|
240
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
241
|
+
top: padding,
|
|
242
|
+
right: padding,
|
|
243
|
+
bottom: padding,
|
|
244
|
+
left: padding
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function rectToClientRect(rect) {
|
|
248
|
+
return {
|
|
249
|
+
...rect,
|
|
250
|
+
top: rect.y,
|
|
251
|
+
left: rect.x,
|
|
252
|
+
right: rect.x + rect.width,
|
|
253
|
+
bottom: rect.y + rect.height
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// ../../node_modules/.pnpm/@floating-ui+core@1.6.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
258
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
259
|
+
let {
|
|
260
|
+
reference,
|
|
261
|
+
floating
|
|
262
|
+
} = _ref;
|
|
263
|
+
const sideAxis = getSideAxis(placement);
|
|
264
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
265
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
266
|
+
const side = getSide(placement);
|
|
267
|
+
const isVertical = sideAxis === "y";
|
|
268
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
269
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
270
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
271
|
+
let coords;
|
|
272
|
+
switch (side) {
|
|
273
|
+
case "top":
|
|
274
|
+
coords = {
|
|
275
|
+
x: commonX,
|
|
276
|
+
y: reference.y - floating.height
|
|
277
|
+
};
|
|
278
|
+
break;
|
|
279
|
+
case "bottom":
|
|
280
|
+
coords = {
|
|
281
|
+
x: commonX,
|
|
282
|
+
y: reference.y + reference.height
|
|
283
|
+
};
|
|
284
|
+
break;
|
|
285
|
+
case "right":
|
|
286
|
+
coords = {
|
|
287
|
+
x: reference.x + reference.width,
|
|
288
|
+
y: commonY
|
|
289
|
+
};
|
|
290
|
+
break;
|
|
291
|
+
case "left":
|
|
292
|
+
coords = {
|
|
293
|
+
x: reference.x - floating.width,
|
|
294
|
+
y: commonY
|
|
295
|
+
};
|
|
296
|
+
break;
|
|
297
|
+
default:
|
|
298
|
+
coords = {
|
|
299
|
+
x: reference.x,
|
|
300
|
+
y: reference.y
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
switch (getAlignment(placement)) {
|
|
304
|
+
case "start":
|
|
305
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
306
|
+
break;
|
|
307
|
+
case "end":
|
|
308
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
return coords;
|
|
312
|
+
}
|
|
313
|
+
var computePosition = async (reference, floating, config) => {
|
|
314
|
+
const {
|
|
315
|
+
placement = "bottom",
|
|
316
|
+
strategy = "absolute",
|
|
317
|
+
middleware = [],
|
|
318
|
+
platform: platform2
|
|
319
|
+
} = config;
|
|
320
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
321
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
322
|
+
let rects = await platform2.getElementRects({
|
|
323
|
+
reference,
|
|
324
|
+
floating,
|
|
325
|
+
strategy
|
|
326
|
+
});
|
|
327
|
+
let {
|
|
328
|
+
x,
|
|
329
|
+
y: y2
|
|
330
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
331
|
+
let statefulPlacement = placement;
|
|
332
|
+
let middlewareData = {};
|
|
333
|
+
let resetCount = 0;
|
|
334
|
+
for (let i2 = 0; i2 < validMiddleware.length; i2++) {
|
|
335
|
+
const {
|
|
336
|
+
name,
|
|
337
|
+
fn
|
|
338
|
+
} = validMiddleware[i2];
|
|
339
|
+
const {
|
|
340
|
+
x: nextX,
|
|
341
|
+
y: nextY,
|
|
342
|
+
data,
|
|
343
|
+
reset
|
|
344
|
+
} = await fn({
|
|
345
|
+
x,
|
|
346
|
+
y: y2,
|
|
347
|
+
initialPlacement: placement,
|
|
348
|
+
placement: statefulPlacement,
|
|
349
|
+
strategy,
|
|
350
|
+
middlewareData,
|
|
351
|
+
rects,
|
|
352
|
+
platform: platform2,
|
|
353
|
+
elements: {
|
|
354
|
+
reference,
|
|
355
|
+
floating
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
x = nextX != null ? nextX : x;
|
|
359
|
+
y2 = nextY != null ? nextY : y2;
|
|
360
|
+
middlewareData = {
|
|
361
|
+
...middlewareData,
|
|
362
|
+
[name]: {
|
|
363
|
+
...middlewareData[name],
|
|
364
|
+
...data
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
if (reset && resetCount <= 50) {
|
|
368
|
+
resetCount++;
|
|
369
|
+
if (typeof reset === "object") {
|
|
370
|
+
if (reset.placement) {
|
|
371
|
+
statefulPlacement = reset.placement;
|
|
372
|
+
}
|
|
373
|
+
if (reset.rects) {
|
|
374
|
+
rects = reset.rects === true ? await platform2.getElementRects({
|
|
375
|
+
reference,
|
|
376
|
+
floating,
|
|
377
|
+
strategy
|
|
378
|
+
}) : reset.rects;
|
|
379
|
+
}
|
|
380
|
+
({
|
|
381
|
+
x,
|
|
382
|
+
y: y2
|
|
383
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
384
|
+
}
|
|
385
|
+
i2 = -1;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
x,
|
|
390
|
+
y: y2,
|
|
391
|
+
placement: statefulPlacement,
|
|
392
|
+
strategy,
|
|
393
|
+
middlewareData
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
async function detectOverflow(state, options) {
|
|
397
|
+
var _await$platform$isEle;
|
|
398
|
+
if (options === void 0) {
|
|
399
|
+
options = {};
|
|
400
|
+
}
|
|
401
|
+
const {
|
|
402
|
+
x,
|
|
403
|
+
y: y2,
|
|
404
|
+
platform: platform2,
|
|
405
|
+
rects,
|
|
406
|
+
elements,
|
|
407
|
+
strategy
|
|
408
|
+
} = state;
|
|
409
|
+
const {
|
|
410
|
+
boundary = "clippingAncestors",
|
|
411
|
+
rootBoundary = "viewport",
|
|
412
|
+
elementContext = "floating",
|
|
413
|
+
altBoundary = false,
|
|
414
|
+
padding = 0
|
|
415
|
+
} = evaluate(options, state);
|
|
416
|
+
const paddingObject = getPaddingObject(padding);
|
|
417
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
418
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
419
|
+
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
420
|
+
element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
|
|
421
|
+
boundary,
|
|
422
|
+
rootBoundary,
|
|
423
|
+
strategy
|
|
424
|
+
}));
|
|
425
|
+
const rect = elementContext === "floating" ? {
|
|
426
|
+
...rects.floating,
|
|
427
|
+
x,
|
|
428
|
+
y: y2
|
|
429
|
+
} : rects.reference;
|
|
430
|
+
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
431
|
+
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
432
|
+
x: 1,
|
|
433
|
+
y: 1
|
|
434
|
+
} : {
|
|
435
|
+
x: 1,
|
|
436
|
+
y: 1
|
|
437
|
+
};
|
|
438
|
+
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
439
|
+
elements,
|
|
440
|
+
rect,
|
|
441
|
+
offsetParent,
|
|
442
|
+
strategy
|
|
443
|
+
}) : rect);
|
|
444
|
+
return {
|
|
445
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
446
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
447
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
448
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
var arrow = (options) => ({
|
|
452
|
+
name: "arrow",
|
|
453
|
+
options,
|
|
454
|
+
async fn(state) {
|
|
455
|
+
const {
|
|
456
|
+
x,
|
|
457
|
+
y: y2,
|
|
458
|
+
placement,
|
|
459
|
+
rects,
|
|
460
|
+
platform: platform2,
|
|
461
|
+
elements,
|
|
462
|
+
middlewareData
|
|
463
|
+
} = state;
|
|
464
|
+
const {
|
|
465
|
+
element,
|
|
466
|
+
padding = 0
|
|
467
|
+
} = evaluate(options, state) || {};
|
|
468
|
+
if (element == null) {
|
|
469
|
+
return {};
|
|
470
|
+
}
|
|
471
|
+
const paddingObject = getPaddingObject(padding);
|
|
472
|
+
const coords = {
|
|
473
|
+
x,
|
|
474
|
+
y: y2
|
|
475
|
+
};
|
|
476
|
+
const axis = getAlignmentAxis(placement);
|
|
477
|
+
const length = getAxisLength(axis);
|
|
478
|
+
const arrowDimensions = await platform2.getDimensions(element);
|
|
479
|
+
const isYAxis = axis === "y";
|
|
480
|
+
const minProp = isYAxis ? "top" : "left";
|
|
481
|
+
const maxProp = isYAxis ? "bottom" : "right";
|
|
482
|
+
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
483
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
484
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
485
|
+
const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
|
|
486
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
487
|
+
if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
|
|
488
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
489
|
+
}
|
|
490
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
491
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
492
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
493
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
494
|
+
const min$1 = minPadding;
|
|
495
|
+
const max3 = clientSize - arrowDimensions[length] - maxPadding;
|
|
496
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
497
|
+
const offset2 = clamp(min$1, center, max3);
|
|
498
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
499
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max3 : 0;
|
|
500
|
+
return {
|
|
501
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
502
|
+
data: {
|
|
503
|
+
[axis]: offset2,
|
|
504
|
+
centerOffset: center - offset2 - alignmentOffset,
|
|
505
|
+
...shouldAddOffset && {
|
|
506
|
+
alignmentOffset
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
reset: shouldAddOffset
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
var flip = function(options) {
|
|
514
|
+
if (options === void 0) {
|
|
515
|
+
options = {};
|
|
516
|
+
}
|
|
517
|
+
return {
|
|
518
|
+
name: "flip",
|
|
519
|
+
options,
|
|
520
|
+
async fn(state) {
|
|
521
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
522
|
+
const {
|
|
523
|
+
placement,
|
|
524
|
+
middlewareData,
|
|
525
|
+
rects,
|
|
526
|
+
initialPlacement,
|
|
527
|
+
platform: platform2,
|
|
528
|
+
elements
|
|
529
|
+
} = state;
|
|
530
|
+
const {
|
|
531
|
+
mainAxis: checkMainAxis = true,
|
|
532
|
+
crossAxis: checkCrossAxis = true,
|
|
533
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
534
|
+
fallbackStrategy = "bestFit",
|
|
535
|
+
fallbackAxisSideDirection = "none",
|
|
536
|
+
flipAlignment = true,
|
|
537
|
+
...detectOverflowOptions
|
|
538
|
+
} = evaluate(options, state);
|
|
539
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
540
|
+
return {};
|
|
541
|
+
}
|
|
542
|
+
const side = getSide(placement);
|
|
543
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
544
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
545
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
546
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
|
|
547
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
548
|
+
}
|
|
549
|
+
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
550
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
551
|
+
const overflows = [];
|
|
552
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
553
|
+
if (checkMainAxis) {
|
|
554
|
+
overflows.push(overflow[side]);
|
|
555
|
+
}
|
|
556
|
+
if (checkCrossAxis) {
|
|
557
|
+
const sides2 = getAlignmentSides(placement, rects, rtl);
|
|
558
|
+
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
|
|
559
|
+
}
|
|
560
|
+
overflowsData = [...overflowsData, {
|
|
561
|
+
placement,
|
|
562
|
+
overflows
|
|
563
|
+
}];
|
|
564
|
+
if (!overflows.every((side2) => side2 <= 0)) {
|
|
565
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
566
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
567
|
+
const nextPlacement = placements2[nextIndex];
|
|
568
|
+
if (nextPlacement) {
|
|
569
|
+
return {
|
|
570
|
+
data: {
|
|
571
|
+
index: nextIndex,
|
|
572
|
+
overflows: overflowsData
|
|
573
|
+
},
|
|
574
|
+
reset: {
|
|
575
|
+
placement: nextPlacement
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a2, b) => a2.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
580
|
+
if (!resetPlacement) {
|
|
581
|
+
switch (fallbackStrategy) {
|
|
582
|
+
case "bestFit": {
|
|
583
|
+
var _overflowsData$map$so;
|
|
584
|
+
const placement2 = (_overflowsData$map$so = overflowsData.map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b) => a2[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
|
|
585
|
+
if (placement2) {
|
|
586
|
+
resetPlacement = placement2;
|
|
587
|
+
}
|
|
588
|
+
break;
|
|
589
|
+
}
|
|
590
|
+
case "initialPlacement":
|
|
591
|
+
resetPlacement = initialPlacement;
|
|
592
|
+
break;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
if (placement !== resetPlacement) {
|
|
596
|
+
return {
|
|
597
|
+
reset: {
|
|
598
|
+
placement: resetPlacement
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
return {};
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
};
|
|
607
|
+
async function convertValueToCoords(state, options) {
|
|
608
|
+
const {
|
|
609
|
+
placement,
|
|
610
|
+
platform: platform2,
|
|
611
|
+
elements
|
|
612
|
+
} = state;
|
|
613
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
614
|
+
const side = getSide(placement);
|
|
615
|
+
const alignment = getAlignment(placement);
|
|
616
|
+
const isVertical = getSideAxis(placement) === "y";
|
|
617
|
+
const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
|
|
618
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
619
|
+
const rawValue = evaluate(options, state);
|
|
620
|
+
let {
|
|
621
|
+
mainAxis,
|
|
622
|
+
crossAxis,
|
|
623
|
+
alignmentAxis
|
|
624
|
+
} = typeof rawValue === "number" ? {
|
|
625
|
+
mainAxis: rawValue,
|
|
626
|
+
crossAxis: 0,
|
|
627
|
+
alignmentAxis: null
|
|
628
|
+
} : {
|
|
629
|
+
mainAxis: 0,
|
|
630
|
+
crossAxis: 0,
|
|
631
|
+
alignmentAxis: null,
|
|
632
|
+
...rawValue
|
|
633
|
+
};
|
|
634
|
+
if (alignment && typeof alignmentAxis === "number") {
|
|
635
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
636
|
+
}
|
|
637
|
+
return isVertical ? {
|
|
638
|
+
x: crossAxis * crossAxisMulti,
|
|
639
|
+
y: mainAxis * mainAxisMulti
|
|
640
|
+
} : {
|
|
641
|
+
x: mainAxis * mainAxisMulti,
|
|
642
|
+
y: crossAxis * crossAxisMulti
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
var offset = function(options) {
|
|
646
|
+
if (options === void 0) {
|
|
647
|
+
options = 0;
|
|
648
|
+
}
|
|
649
|
+
return {
|
|
650
|
+
name: "offset",
|
|
651
|
+
options,
|
|
652
|
+
async fn(state) {
|
|
653
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
654
|
+
const {
|
|
655
|
+
x,
|
|
656
|
+
y: y2,
|
|
657
|
+
placement,
|
|
658
|
+
middlewareData
|
|
659
|
+
} = state;
|
|
660
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
661
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
662
|
+
return {};
|
|
663
|
+
}
|
|
664
|
+
return {
|
|
665
|
+
x: x + diffCoords.x,
|
|
666
|
+
y: y2 + diffCoords.y,
|
|
667
|
+
data: {
|
|
668
|
+
...diffCoords,
|
|
669
|
+
placement
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
};
|
|
675
|
+
var shift = function(options) {
|
|
676
|
+
if (options === void 0) {
|
|
677
|
+
options = {};
|
|
678
|
+
}
|
|
679
|
+
return {
|
|
680
|
+
name: "shift",
|
|
681
|
+
options,
|
|
682
|
+
async fn(state) {
|
|
683
|
+
const {
|
|
684
|
+
x,
|
|
685
|
+
y: y2,
|
|
686
|
+
placement
|
|
687
|
+
} = state;
|
|
688
|
+
const {
|
|
689
|
+
mainAxis: checkMainAxis = true,
|
|
690
|
+
crossAxis: checkCrossAxis = false,
|
|
691
|
+
limiter = {
|
|
692
|
+
fn: (_ref) => {
|
|
693
|
+
let {
|
|
694
|
+
x: x2,
|
|
695
|
+
y: y3
|
|
696
|
+
} = _ref;
|
|
697
|
+
return {
|
|
698
|
+
x: x2,
|
|
699
|
+
y: y3
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
...detectOverflowOptions
|
|
704
|
+
} = evaluate(options, state);
|
|
705
|
+
const coords = {
|
|
706
|
+
x,
|
|
707
|
+
y: y2
|
|
708
|
+
};
|
|
709
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
710
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
711
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
712
|
+
let mainAxisCoord = coords[mainAxis];
|
|
713
|
+
let crossAxisCoord = coords[crossAxis];
|
|
714
|
+
if (checkMainAxis) {
|
|
715
|
+
const minSide = mainAxis === "y" ? "top" : "left";
|
|
716
|
+
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
717
|
+
const min3 = mainAxisCoord + overflow[minSide];
|
|
718
|
+
const max3 = mainAxisCoord - overflow[maxSide];
|
|
719
|
+
mainAxisCoord = clamp(min3, mainAxisCoord, max3);
|
|
720
|
+
}
|
|
721
|
+
if (checkCrossAxis) {
|
|
722
|
+
const minSide = crossAxis === "y" ? "top" : "left";
|
|
723
|
+
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
724
|
+
const min3 = crossAxisCoord + overflow[minSide];
|
|
725
|
+
const max3 = crossAxisCoord - overflow[maxSide];
|
|
726
|
+
crossAxisCoord = clamp(min3, crossAxisCoord, max3);
|
|
727
|
+
}
|
|
728
|
+
const limitedCoords = limiter.fn({
|
|
729
|
+
...state,
|
|
730
|
+
[mainAxis]: mainAxisCoord,
|
|
731
|
+
[crossAxis]: crossAxisCoord
|
|
732
|
+
});
|
|
733
|
+
return {
|
|
734
|
+
...limitedCoords,
|
|
735
|
+
data: {
|
|
736
|
+
x: limitedCoords.x - x,
|
|
737
|
+
y: limitedCoords.y - y2
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
};
|
|
743
|
+
var size = function(options) {
|
|
744
|
+
if (options === void 0) {
|
|
745
|
+
options = {};
|
|
746
|
+
}
|
|
747
|
+
return {
|
|
748
|
+
name: "size",
|
|
749
|
+
options,
|
|
750
|
+
async fn(state) {
|
|
751
|
+
const {
|
|
752
|
+
placement,
|
|
753
|
+
rects,
|
|
754
|
+
platform: platform2,
|
|
755
|
+
elements
|
|
756
|
+
} = state;
|
|
757
|
+
const {
|
|
758
|
+
apply = () => {
|
|
759
|
+
},
|
|
760
|
+
...detectOverflowOptions
|
|
761
|
+
} = evaluate(options, state);
|
|
762
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
763
|
+
const side = getSide(placement);
|
|
764
|
+
const alignment = getAlignment(placement);
|
|
765
|
+
const isYAxis = getSideAxis(placement) === "y";
|
|
766
|
+
const {
|
|
767
|
+
width,
|
|
768
|
+
height
|
|
769
|
+
} = rects.floating;
|
|
770
|
+
let heightSide;
|
|
771
|
+
let widthSide;
|
|
772
|
+
if (side === "top" || side === "bottom") {
|
|
773
|
+
heightSide = side;
|
|
774
|
+
widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
|
|
775
|
+
} else {
|
|
776
|
+
widthSide = side;
|
|
777
|
+
heightSide = alignment === "end" ? "top" : "bottom";
|
|
778
|
+
}
|
|
779
|
+
const overflowAvailableHeight = height - overflow[heightSide];
|
|
780
|
+
const overflowAvailableWidth = width - overflow[widthSide];
|
|
781
|
+
const noShift = !state.middlewareData.shift;
|
|
782
|
+
let availableHeight = overflowAvailableHeight;
|
|
783
|
+
let availableWidth = overflowAvailableWidth;
|
|
784
|
+
if (isYAxis) {
|
|
785
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
786
|
+
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
787
|
+
} else {
|
|
788
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
789
|
+
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
790
|
+
}
|
|
791
|
+
if (noShift && !alignment) {
|
|
792
|
+
const xMin = max(overflow.left, 0);
|
|
793
|
+
const xMax = max(overflow.right, 0);
|
|
794
|
+
const yMin = max(overflow.top, 0);
|
|
795
|
+
const yMax = max(overflow.bottom, 0);
|
|
796
|
+
if (isYAxis) {
|
|
797
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
798
|
+
} else {
|
|
799
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
await apply({
|
|
803
|
+
...state,
|
|
804
|
+
availableWidth,
|
|
805
|
+
availableHeight
|
|
806
|
+
});
|
|
807
|
+
const nextDimensions = await platform2.getDimensions(elements.floating);
|
|
808
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
809
|
+
return {
|
|
810
|
+
reset: {
|
|
811
|
+
rects: true
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
return {};
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
// ../../node_modules/.pnpm/@floating-ui+utils@0.1.6/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
821
|
+
var min2 = Math.min;
|
|
822
|
+
var max2 = Math.max;
|
|
823
|
+
var round = Math.round;
|
|
824
|
+
var createCoords = (v) => ({
|
|
825
|
+
x: v,
|
|
826
|
+
y: v
|
|
827
|
+
});
|
|
828
|
+
|
|
829
|
+
// ../../node_modules/.pnpm/@floating-ui+utils@0.1.6/node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.mjs
|
|
830
|
+
function getNodeName(node) {
|
|
831
|
+
if (isNode(node)) {
|
|
832
|
+
return (node.nodeName || "").toLowerCase();
|
|
833
|
+
}
|
|
834
|
+
return "#document";
|
|
835
|
+
}
|
|
836
|
+
function getWindow(node) {
|
|
837
|
+
var _node$ownerDocument;
|
|
838
|
+
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
839
|
+
}
|
|
840
|
+
function getDocumentElement(node) {
|
|
841
|
+
var _ref;
|
|
842
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
843
|
+
}
|
|
844
|
+
function isNode(value) {
|
|
845
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
846
|
+
}
|
|
847
|
+
function isElement(value) {
|
|
848
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
849
|
+
}
|
|
850
|
+
function isHTMLElement2(value) {
|
|
851
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
852
|
+
}
|
|
853
|
+
function isShadowRoot(value) {
|
|
854
|
+
if (typeof ShadowRoot === "undefined") {
|
|
855
|
+
return false;
|
|
856
|
+
}
|
|
857
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
858
|
+
}
|
|
859
|
+
function isOverflowElement(element) {
|
|
860
|
+
const {
|
|
861
|
+
overflow,
|
|
862
|
+
overflowX,
|
|
863
|
+
overflowY,
|
|
864
|
+
display
|
|
865
|
+
} = getComputedStyle(element);
|
|
866
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
867
|
+
}
|
|
868
|
+
function isTableElement(element) {
|
|
869
|
+
return ["table", "td", "th"].includes(getNodeName(element));
|
|
870
|
+
}
|
|
871
|
+
function isContainingBlock(element) {
|
|
872
|
+
const webkit = isWebKit();
|
|
873
|
+
const css = getComputedStyle(element);
|
|
874
|
+
return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
|
|
875
|
+
}
|
|
876
|
+
function getContainingBlock(element) {
|
|
877
|
+
let currentNode = getParentNode(element);
|
|
878
|
+
while (isHTMLElement2(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
879
|
+
if (isContainingBlock(currentNode)) {
|
|
880
|
+
return currentNode;
|
|
881
|
+
} else {
|
|
882
|
+
currentNode = getParentNode(currentNode);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
return null;
|
|
886
|
+
}
|
|
887
|
+
function isWebKit() {
|
|
888
|
+
if (typeof CSS === "undefined" || !CSS.supports)
|
|
889
|
+
return false;
|
|
890
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
891
|
+
}
|
|
892
|
+
function isLastTraversableNode(node) {
|
|
893
|
+
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
894
|
+
}
|
|
895
|
+
function getComputedStyle(element) {
|
|
896
|
+
return getWindow(element).getComputedStyle(element);
|
|
897
|
+
}
|
|
898
|
+
function getNodeScroll(element) {
|
|
899
|
+
if (isElement(element)) {
|
|
900
|
+
return {
|
|
901
|
+
scrollLeft: element.scrollLeft,
|
|
902
|
+
scrollTop: element.scrollTop
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
return {
|
|
906
|
+
scrollLeft: element.pageXOffset,
|
|
907
|
+
scrollTop: element.pageYOffset
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
function getParentNode(node) {
|
|
911
|
+
if (getNodeName(node) === "html") {
|
|
912
|
+
return node;
|
|
913
|
+
}
|
|
914
|
+
const result = (
|
|
915
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
916
|
+
node.assignedSlot || // DOM Element detected.
|
|
917
|
+
node.parentNode || // ShadowRoot detected.
|
|
918
|
+
isShadowRoot(node) && node.host || // Fallback.
|
|
919
|
+
getDocumentElement(node)
|
|
920
|
+
);
|
|
921
|
+
return isShadowRoot(result) ? result.host : result;
|
|
922
|
+
}
|
|
923
|
+
function getNearestOverflowAncestor(node) {
|
|
924
|
+
const parentNode = getParentNode(node);
|
|
925
|
+
if (isLastTraversableNode(parentNode)) {
|
|
926
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
927
|
+
}
|
|
928
|
+
if (isHTMLElement2(parentNode) && isOverflowElement(parentNode)) {
|
|
929
|
+
return parentNode;
|
|
930
|
+
}
|
|
931
|
+
return getNearestOverflowAncestor(parentNode);
|
|
932
|
+
}
|
|
933
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
934
|
+
var _node$ownerDocument2;
|
|
935
|
+
if (list === void 0) {
|
|
936
|
+
list = [];
|
|
937
|
+
}
|
|
938
|
+
if (traverseIframes === void 0) {
|
|
939
|
+
traverseIframes = true;
|
|
940
|
+
}
|
|
941
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
942
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
943
|
+
const win = getWindow(scrollableAncestor);
|
|
944
|
+
if (isBody) {
|
|
945
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
946
|
+
}
|
|
947
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
// ../../node_modules/.pnpm/@floating-ui+dom@1.5.1/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
951
|
+
function getCssDimensions(element) {
|
|
952
|
+
const css = getComputedStyle(element);
|
|
953
|
+
let width = parseFloat(css.width) || 0;
|
|
954
|
+
let height = parseFloat(css.height) || 0;
|
|
955
|
+
const hasOffset = isHTMLElement2(element);
|
|
956
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
957
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
958
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
959
|
+
if (shouldFallback) {
|
|
960
|
+
width = offsetWidth;
|
|
961
|
+
height = offsetHeight;
|
|
962
|
+
}
|
|
963
|
+
return {
|
|
964
|
+
width,
|
|
965
|
+
height,
|
|
966
|
+
$: shouldFallback
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
function unwrapElement(element) {
|
|
970
|
+
return !isElement(element) ? element.contextElement : element;
|
|
971
|
+
}
|
|
972
|
+
function getScale(element) {
|
|
973
|
+
const domElement = unwrapElement(element);
|
|
974
|
+
if (!isHTMLElement2(domElement)) {
|
|
975
|
+
return createCoords(1);
|
|
976
|
+
}
|
|
977
|
+
const rect = domElement.getBoundingClientRect();
|
|
978
|
+
const {
|
|
979
|
+
width,
|
|
980
|
+
height,
|
|
981
|
+
$
|
|
982
|
+
} = getCssDimensions(domElement);
|
|
983
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
984
|
+
let y2 = ($ ? round(rect.height) : rect.height) / height;
|
|
985
|
+
if (!x || !Number.isFinite(x)) {
|
|
986
|
+
x = 1;
|
|
987
|
+
}
|
|
988
|
+
if (!y2 || !Number.isFinite(y2)) {
|
|
989
|
+
y2 = 1;
|
|
990
|
+
}
|
|
991
|
+
return {
|
|
992
|
+
x,
|
|
993
|
+
y: y2
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
var noOffsets = /* @__PURE__ */ createCoords(0);
|
|
997
|
+
function getVisualOffsets(element) {
|
|
998
|
+
const win = getWindow(element);
|
|
999
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
1000
|
+
return noOffsets;
|
|
1001
|
+
}
|
|
1002
|
+
return {
|
|
1003
|
+
x: win.visualViewport.offsetLeft,
|
|
1004
|
+
y: win.visualViewport.offsetTop
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1008
|
+
if (isFixed === void 0) {
|
|
1009
|
+
isFixed = false;
|
|
1010
|
+
}
|
|
1011
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
1012
|
+
return false;
|
|
1013
|
+
}
|
|
1014
|
+
return isFixed;
|
|
1015
|
+
}
|
|
1016
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1017
|
+
if (includeScale === void 0) {
|
|
1018
|
+
includeScale = false;
|
|
1019
|
+
}
|
|
1020
|
+
if (isFixedStrategy === void 0) {
|
|
1021
|
+
isFixedStrategy = false;
|
|
1022
|
+
}
|
|
1023
|
+
const clientRect = element.getBoundingClientRect();
|
|
1024
|
+
const domElement = unwrapElement(element);
|
|
1025
|
+
let scale = createCoords(1);
|
|
1026
|
+
if (includeScale) {
|
|
1027
|
+
if (offsetParent) {
|
|
1028
|
+
if (isElement(offsetParent)) {
|
|
1029
|
+
scale = getScale(offsetParent);
|
|
1030
|
+
}
|
|
1031
|
+
} else {
|
|
1032
|
+
scale = getScale(element);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1036
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1037
|
+
let y2 = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1038
|
+
let width = clientRect.width / scale.x;
|
|
1039
|
+
let height = clientRect.height / scale.y;
|
|
1040
|
+
if (domElement) {
|
|
1041
|
+
const win = getWindow(domElement);
|
|
1042
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1043
|
+
let currentIFrame = win.frameElement;
|
|
1044
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
1045
|
+
const iframeScale = getScale(currentIFrame);
|
|
1046
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1047
|
+
const css = getComputedStyle(currentIFrame);
|
|
1048
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1049
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1050
|
+
x *= iframeScale.x;
|
|
1051
|
+
y2 *= iframeScale.y;
|
|
1052
|
+
width *= iframeScale.x;
|
|
1053
|
+
height *= iframeScale.y;
|
|
1054
|
+
x += left;
|
|
1055
|
+
y2 += top;
|
|
1056
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
return rectToClientRect({
|
|
1060
|
+
width,
|
|
1061
|
+
height,
|
|
1062
|
+
x,
|
|
1063
|
+
y: y2
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1067
|
+
let {
|
|
1068
|
+
rect,
|
|
1069
|
+
offsetParent,
|
|
1070
|
+
strategy
|
|
1071
|
+
} = _ref;
|
|
1072
|
+
const isOffsetParentAnElement = isHTMLElement2(offsetParent);
|
|
1073
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1074
|
+
if (offsetParent === documentElement) {
|
|
1075
|
+
return rect;
|
|
1076
|
+
}
|
|
1077
|
+
let scroll = {
|
|
1078
|
+
scrollLeft: 0,
|
|
1079
|
+
scrollTop: 0
|
|
1080
|
+
};
|
|
1081
|
+
let scale = createCoords(1);
|
|
1082
|
+
const offsets = createCoords(0);
|
|
1083
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
|
1084
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
1085
|
+
scroll = getNodeScroll(offsetParent);
|
|
1086
|
+
}
|
|
1087
|
+
if (isHTMLElement2(offsetParent)) {
|
|
1088
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1089
|
+
scale = getScale(offsetParent);
|
|
1090
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1091
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
return {
|
|
1095
|
+
width: rect.width * scale.x,
|
|
1096
|
+
height: rect.height * scale.y,
|
|
1097
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
1098
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
function getClientRects(element) {
|
|
1102
|
+
return Array.from(element.getClientRects());
|
|
1103
|
+
}
|
|
1104
|
+
function getWindowScrollBarX(element) {
|
|
1105
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1106
|
+
}
|
|
1107
|
+
function getDocumentRect(element) {
|
|
1108
|
+
const html = getDocumentElement(element);
|
|
1109
|
+
const scroll = getNodeScroll(element);
|
|
1110
|
+
const body = element.ownerDocument.body;
|
|
1111
|
+
const width = max2(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1112
|
+
const height = max2(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1113
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1114
|
+
const y2 = -scroll.scrollTop;
|
|
1115
|
+
if (getComputedStyle(body).direction === "rtl") {
|
|
1116
|
+
x += max2(html.clientWidth, body.clientWidth) - width;
|
|
1117
|
+
}
|
|
1118
|
+
return {
|
|
1119
|
+
width,
|
|
1120
|
+
height,
|
|
1121
|
+
x,
|
|
1122
|
+
y: y2
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
function getViewportRect(element, strategy) {
|
|
1126
|
+
const win = getWindow(element);
|
|
1127
|
+
const html = getDocumentElement(element);
|
|
1128
|
+
const visualViewport = win.visualViewport;
|
|
1129
|
+
let width = html.clientWidth;
|
|
1130
|
+
let height = html.clientHeight;
|
|
1131
|
+
let x = 0;
|
|
1132
|
+
let y2 = 0;
|
|
1133
|
+
if (visualViewport) {
|
|
1134
|
+
width = visualViewport.width;
|
|
1135
|
+
height = visualViewport.height;
|
|
1136
|
+
const visualViewportBased = isWebKit();
|
|
1137
|
+
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
1138
|
+
x = visualViewport.offsetLeft;
|
|
1139
|
+
y2 = visualViewport.offsetTop;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return {
|
|
1143
|
+
width,
|
|
1144
|
+
height,
|
|
1145
|
+
x,
|
|
1146
|
+
y: y2
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1150
|
+
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
1151
|
+
const top = clientRect.top + element.clientTop;
|
|
1152
|
+
const left = clientRect.left + element.clientLeft;
|
|
1153
|
+
const scale = isHTMLElement2(element) ? getScale(element) : createCoords(1);
|
|
1154
|
+
const width = element.clientWidth * scale.x;
|
|
1155
|
+
const height = element.clientHeight * scale.y;
|
|
1156
|
+
const x = left * scale.x;
|
|
1157
|
+
const y2 = top * scale.y;
|
|
1158
|
+
return {
|
|
1159
|
+
width,
|
|
1160
|
+
height,
|
|
1161
|
+
x,
|
|
1162
|
+
y: y2
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1166
|
+
let rect;
|
|
1167
|
+
if (clippingAncestor === "viewport") {
|
|
1168
|
+
rect = getViewportRect(element, strategy);
|
|
1169
|
+
} else if (clippingAncestor === "document") {
|
|
1170
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
1171
|
+
} else if (isElement(clippingAncestor)) {
|
|
1172
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1173
|
+
} else {
|
|
1174
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1175
|
+
rect = {
|
|
1176
|
+
...clippingAncestor,
|
|
1177
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1178
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
return rectToClientRect(rect);
|
|
1182
|
+
}
|
|
1183
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
1184
|
+
const parentNode = getParentNode(element);
|
|
1185
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1186
|
+
return false;
|
|
1187
|
+
}
|
|
1188
|
+
return getComputedStyle(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1189
|
+
}
|
|
1190
|
+
function getClippingElementAncestors(element, cache) {
|
|
1191
|
+
const cachedResult = cache.get(element);
|
|
1192
|
+
if (cachedResult) {
|
|
1193
|
+
return cachedResult;
|
|
1194
|
+
}
|
|
1195
|
+
let result = getOverflowAncestors(element).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
1196
|
+
let currentContainingBlockComputedStyle = null;
|
|
1197
|
+
const elementIsFixed = getComputedStyle(element).position === "fixed";
|
|
1198
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1199
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1200
|
+
const computedStyle = getComputedStyle(currentNode);
|
|
1201
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1202
|
+
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
1203
|
+
currentContainingBlockComputedStyle = null;
|
|
1204
|
+
}
|
|
1205
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1206
|
+
if (shouldDropCurrentNode) {
|
|
1207
|
+
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
1208
|
+
} else {
|
|
1209
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1210
|
+
}
|
|
1211
|
+
currentNode = getParentNode(currentNode);
|
|
1212
|
+
}
|
|
1213
|
+
cache.set(element, result);
|
|
1214
|
+
return result;
|
|
1215
|
+
}
|
|
1216
|
+
function getClippingRect(_ref) {
|
|
1217
|
+
let {
|
|
1218
|
+
element,
|
|
1219
|
+
boundary,
|
|
1220
|
+
rootBoundary,
|
|
1221
|
+
strategy
|
|
1222
|
+
} = _ref;
|
|
1223
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1224
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1225
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
1226
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1227
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1228
|
+
accRect.top = max2(rect.top, accRect.top);
|
|
1229
|
+
accRect.right = min2(rect.right, accRect.right);
|
|
1230
|
+
accRect.bottom = min2(rect.bottom, accRect.bottom);
|
|
1231
|
+
accRect.left = max2(rect.left, accRect.left);
|
|
1232
|
+
return accRect;
|
|
1233
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1234
|
+
return {
|
|
1235
|
+
width: clippingRect.right - clippingRect.left,
|
|
1236
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
1237
|
+
x: clippingRect.left,
|
|
1238
|
+
y: clippingRect.top
|
|
1239
|
+
};
|
|
1240
|
+
}
|
|
1241
|
+
function getDimensions(element) {
|
|
1242
|
+
return getCssDimensions(element);
|
|
1243
|
+
}
|
|
1244
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1245
|
+
const isOffsetParentAnElement = isHTMLElement2(offsetParent);
|
|
1246
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1247
|
+
const isFixed = strategy === "fixed";
|
|
1248
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1249
|
+
let scroll = {
|
|
1250
|
+
scrollLeft: 0,
|
|
1251
|
+
scrollTop: 0
|
|
1252
|
+
};
|
|
1253
|
+
const offsets = createCoords(0);
|
|
1254
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1255
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
1256
|
+
scroll = getNodeScroll(offsetParent);
|
|
1257
|
+
}
|
|
1258
|
+
if (isOffsetParentAnElement) {
|
|
1259
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1260
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1261
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1262
|
+
} else if (documentElement) {
|
|
1263
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
return {
|
|
1267
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
1268
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
1269
|
+
width: rect.width,
|
|
1270
|
+
height: rect.height
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
1274
|
+
if (!isHTMLElement2(element) || getComputedStyle(element).position === "fixed") {
|
|
1275
|
+
return null;
|
|
1276
|
+
}
|
|
1277
|
+
if (polyfill) {
|
|
1278
|
+
return polyfill(element);
|
|
1279
|
+
}
|
|
1280
|
+
return element.offsetParent;
|
|
1281
|
+
}
|
|
1282
|
+
function getOffsetParent(element, polyfill) {
|
|
1283
|
+
const window2 = getWindow(element);
|
|
1284
|
+
if (!isHTMLElement2(element)) {
|
|
1285
|
+
return window2;
|
|
1286
|
+
}
|
|
1287
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1288
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
1289
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1290
|
+
}
|
|
1291
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
|
1292
|
+
return window2;
|
|
1293
|
+
}
|
|
1294
|
+
return offsetParent || getContainingBlock(element) || window2;
|
|
1295
|
+
}
|
|
1296
|
+
var getElementRects = async function(_ref) {
|
|
1297
|
+
let {
|
|
1298
|
+
reference,
|
|
1299
|
+
floating,
|
|
1300
|
+
strategy
|
|
1301
|
+
} = _ref;
|
|
1302
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1303
|
+
const getDimensionsFn = this.getDimensions;
|
|
1304
|
+
return {
|
|
1305
|
+
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
|
1306
|
+
floating: {
|
|
1307
|
+
x: 0,
|
|
1308
|
+
y: 0,
|
|
1309
|
+
...await getDimensionsFn(floating)
|
|
1310
|
+
}
|
|
1311
|
+
};
|
|
1312
|
+
};
|
|
1313
|
+
function isRTL(element) {
|
|
1314
|
+
return getComputedStyle(element).direction === "rtl";
|
|
1315
|
+
}
|
|
1316
|
+
var platform = {
|
|
1317
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1318
|
+
getDocumentElement,
|
|
1319
|
+
getClippingRect,
|
|
1320
|
+
getOffsetParent,
|
|
1321
|
+
getElementRects,
|
|
1322
|
+
getClientRects,
|
|
1323
|
+
getDimensions,
|
|
1324
|
+
getScale,
|
|
1325
|
+
isElement,
|
|
1326
|
+
isRTL
|
|
1327
|
+
};
|
|
1328
|
+
var computePosition2 = (reference, floating, options) => {
|
|
1329
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1330
|
+
const mergedOptions = {
|
|
1331
|
+
platform,
|
|
1332
|
+
...options
|
|
1333
|
+
};
|
|
1334
|
+
const platformWithCache = {
|
|
1335
|
+
...mergedOptions.platform,
|
|
1336
|
+
_c: cache
|
|
1337
|
+
};
|
|
1338
|
+
return computePosition(reference, floating, {
|
|
1339
|
+
...mergedOptions,
|
|
1340
|
+
platform: platformWithCache
|
|
1341
|
+
});
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1344
|
+
// ../../node_modules/.pnpm/@zag-js+utils@0.19.1/node_modules/@zag-js/utils/dist/index.mjs
|
|
1345
|
+
var callAll = (...fns) => (...a2) => {
|
|
1346
|
+
fns.forEach(function(fn) {
|
|
1347
|
+
fn?.(...a2);
|
|
1348
|
+
});
|
|
1349
|
+
};
|
|
1350
|
+
function compact(obj) {
|
|
1351
|
+
if (!isPlainObject(obj) || obj === void 0) {
|
|
1352
|
+
return obj;
|
|
1353
|
+
}
|
|
1354
|
+
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
|
|
1355
|
+
const filtered = {};
|
|
1356
|
+
for (const key of keys) {
|
|
1357
|
+
const value = obj[key];
|
|
1358
|
+
if (value !== void 0) {
|
|
1359
|
+
filtered[key] = compact(value);
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
return filtered;
|
|
1363
|
+
}
|
|
1364
|
+
var isPlainObject = (value) => {
|
|
1365
|
+
return value && typeof value === "object" && value.constructor === Object;
|
|
1366
|
+
};
|
|
1367
|
+
|
|
1368
|
+
// ../../node_modules/.pnpm/@zag-js+element-rect@0.19.1/node_modules/@zag-js/element-rect/dist/index.mjs
|
|
1369
|
+
var rafId;
|
|
1370
|
+
var observedElements = /* @__PURE__ */ new Map();
|
|
1371
|
+
var getRectFn = (el) => el.getBoundingClientRect();
|
|
1372
|
+
function trackElementRect(el, options) {
|
|
1373
|
+
const { scope = "rect", getRect = getRectFn, onChange } = options;
|
|
1374
|
+
const loop = getLoopFn({ scope, getRect });
|
|
1375
|
+
const data = observedElements.get(el);
|
|
1376
|
+
if (!data) {
|
|
1377
|
+
observedElements.set(el, {
|
|
1378
|
+
rect: {},
|
|
1379
|
+
callbacks: [onChange]
|
|
1380
|
+
});
|
|
1381
|
+
if (observedElements.size === 1) {
|
|
1382
|
+
rafId = requestAnimationFrame(loop);
|
|
1383
|
+
}
|
|
1384
|
+
} else {
|
|
1385
|
+
data.callbacks.push(onChange);
|
|
1386
|
+
onChange(getRect(el));
|
|
1387
|
+
}
|
|
1388
|
+
return function unobserve() {
|
|
1389
|
+
const data2 = observedElements.get(el);
|
|
1390
|
+
if (!data2)
|
|
1391
|
+
return;
|
|
1392
|
+
const index = data2.callbacks.indexOf(onChange);
|
|
1393
|
+
if (index > -1) {
|
|
1394
|
+
data2.callbacks.splice(index, 1);
|
|
1395
|
+
}
|
|
1396
|
+
if (data2.callbacks.length === 0) {
|
|
1397
|
+
observedElements.delete(el);
|
|
1398
|
+
if (observedElements.size === 0) {
|
|
1399
|
+
cancelAnimationFrame(rafId);
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
function getLoopFn(options) {
|
|
1405
|
+
const { scope, getRect } = options;
|
|
1406
|
+
const isEqual = getEqualityFn(scope);
|
|
1407
|
+
return function loop() {
|
|
1408
|
+
const changedRectsData = [];
|
|
1409
|
+
observedElements.forEach((data, element) => {
|
|
1410
|
+
const newRect = getRect(element);
|
|
1411
|
+
if (!isEqual(data.rect, newRect)) {
|
|
1412
|
+
data.rect = newRect;
|
|
1413
|
+
changedRectsData.push(data);
|
|
1414
|
+
}
|
|
1415
|
+
});
|
|
1416
|
+
changedRectsData.forEach((data) => {
|
|
1417
|
+
data.callbacks.forEach((callback) => callback(data.rect));
|
|
1418
|
+
});
|
|
1419
|
+
rafId = requestAnimationFrame(loop);
|
|
1420
|
+
};
|
|
1421
|
+
}
|
|
1422
|
+
var isEqualSize = (a2, b) => a2.width === b.width && a2.height === b.height;
|
|
1423
|
+
var isEqualPosition = (a2, b) => a2.top === b.top && a2.left === b.left;
|
|
1424
|
+
var isEqualRect = (a2, b) => isEqualSize(a2, b) && isEqualPosition(a2, b);
|
|
1425
|
+
function getEqualityFn(scope) {
|
|
1426
|
+
if (scope === "size")
|
|
1427
|
+
return isEqualSize;
|
|
1428
|
+
if (scope === "position")
|
|
1429
|
+
return isEqualPosition;
|
|
1430
|
+
return isEqualRect;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// ../../node_modules/.pnpm/@zag-js+popper@0.19.1/node_modules/@zag-js/popper/dist/index.mjs
|
|
1434
|
+
var callAll2 = (...fns) => () => fns.forEach((fn) => fn());
|
|
1435
|
+
var isHTMLElement3 = (el) => {
|
|
1436
|
+
return typeof el === "object" && el !== null && el.nodeType === 1;
|
|
1437
|
+
};
|
|
1438
|
+
var addDomEvent = (el, type, fn, options) => {
|
|
1439
|
+
el.addEventListener(type, fn, options);
|
|
1440
|
+
return () => el.removeEventListener(type, fn, options);
|
|
1441
|
+
};
|
|
1442
|
+
function resolveOptions(option) {
|
|
1443
|
+
const bool = typeof option === "boolean";
|
|
1444
|
+
return {
|
|
1445
|
+
ancestorResize: bool ? option : option.ancestorResize ?? true,
|
|
1446
|
+
ancestorScroll: bool ? option : option.ancestorScroll ?? true,
|
|
1447
|
+
referenceResize: bool ? option : option.referenceResize ?? true
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1450
|
+
function autoUpdate(reference, floating, update, options = false) {
|
|
1451
|
+
const { ancestorScroll, ancestorResize, referenceResize } = resolveOptions(options);
|
|
1452
|
+
const useAncestors = ancestorScroll || ancestorResize;
|
|
1453
|
+
const ancestors = [];
|
|
1454
|
+
if (useAncestors && isHTMLElement3(reference)) {
|
|
1455
|
+
ancestors.push(...getOverflowAncestors(reference));
|
|
1456
|
+
}
|
|
1457
|
+
function addResizeListeners() {
|
|
1458
|
+
let cleanups = [trackElementRect(floating, { scope: "size", onChange: update })];
|
|
1459
|
+
if (referenceResize && isHTMLElement3(reference)) {
|
|
1460
|
+
cleanups.push(trackElementRect(reference, { onChange: update }));
|
|
1461
|
+
}
|
|
1462
|
+
cleanups.push(callAll2(...ancestors.map((el) => addDomEvent(el, "resize", update))));
|
|
1463
|
+
return () => cleanups.forEach((fn) => fn());
|
|
1464
|
+
}
|
|
1465
|
+
function addScrollListeners() {
|
|
1466
|
+
return callAll2(...ancestors.map((el) => addDomEvent(el, "scroll", update, { passive: true })));
|
|
1467
|
+
}
|
|
1468
|
+
return callAll2(addResizeListeners(), addScrollListeners());
|
|
1469
|
+
}
|
|
1470
|
+
var toVar = (value) => ({ variable: value, reference: `var(${value})` });
|
|
1471
|
+
var cssVars = {
|
|
1472
|
+
arrowSize: toVar("--arrow-size"),
|
|
1473
|
+
arrowSizeHalf: toVar("--arrow-size-half"),
|
|
1474
|
+
arrowBg: toVar("--arrow-background"),
|
|
1475
|
+
transformOrigin: toVar("--transform-origin"),
|
|
1476
|
+
arrowOffset: toVar("--arrow-offset")
|
|
1477
|
+
};
|
|
1478
|
+
var getTransformOrigin = (arrow2) => ({
|
|
1479
|
+
top: "bottom center",
|
|
1480
|
+
"top-start": arrow2 ? `${arrow2.x}px bottom` : "left bottom",
|
|
1481
|
+
"top-end": arrow2 ? `${arrow2.x}px bottom` : "right bottom",
|
|
1482
|
+
bottom: "top center",
|
|
1483
|
+
"bottom-start": arrow2 ? `${arrow2.x}px top` : "top left",
|
|
1484
|
+
"bottom-end": arrow2 ? `${arrow2.x}px top` : "top right",
|
|
1485
|
+
left: "right center",
|
|
1486
|
+
"left-start": arrow2 ? `right ${arrow2.y}px` : "right top",
|
|
1487
|
+
"left-end": arrow2 ? `right ${arrow2.y}px` : "right bottom",
|
|
1488
|
+
right: "left center",
|
|
1489
|
+
"right-start": arrow2 ? `left ${arrow2.y}px` : "left top",
|
|
1490
|
+
"right-end": arrow2 ? `left ${arrow2.y}px` : "left bottom"
|
|
1491
|
+
});
|
|
1492
|
+
var transformOrigin = {
|
|
1493
|
+
name: "transformOrigin",
|
|
1494
|
+
fn({ placement, elements, middlewareData }) {
|
|
1495
|
+
const { arrow: arrow2 } = middlewareData;
|
|
1496
|
+
const transformOrigin2 = getTransformOrigin(arrow2)[placement];
|
|
1497
|
+
const { floating } = elements;
|
|
1498
|
+
floating.style.setProperty(cssVars.transformOrigin.variable, transformOrigin2);
|
|
1499
|
+
return {
|
|
1500
|
+
data: { transformOrigin: transformOrigin2 }
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1504
|
+
var shiftArrow = (opts) => ({
|
|
1505
|
+
name: "shiftArrow",
|
|
1506
|
+
fn({ placement, middlewareData }) {
|
|
1507
|
+
const { element: arrow2 } = opts;
|
|
1508
|
+
if (middlewareData.arrow) {
|
|
1509
|
+
const { x, y: y2 } = middlewareData.arrow;
|
|
1510
|
+
const dir = placement.split("-")[0];
|
|
1511
|
+
Object.assign(arrow2.style, {
|
|
1512
|
+
left: x != null ? `${x}px` : "",
|
|
1513
|
+
top: y2 != null ? `${y2}px` : "",
|
|
1514
|
+
[dir]: `calc(100% + ${cssVars.arrowOffset.reference})`
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1517
|
+
return {};
|
|
1518
|
+
}
|
|
1519
|
+
});
|
|
1520
|
+
var defaultOptions = {
|
|
1521
|
+
strategy: "absolute",
|
|
1522
|
+
placement: "bottom",
|
|
1523
|
+
listeners: true,
|
|
1524
|
+
gutter: 8,
|
|
1525
|
+
flip: true,
|
|
1526
|
+
sameWidth: false,
|
|
1527
|
+
overflowPadding: 8
|
|
1528
|
+
};
|
|
1529
|
+
function getPlacementImpl(reference, floating, opts = {}) {
|
|
1530
|
+
if (!floating || !reference)
|
|
1531
|
+
return;
|
|
1532
|
+
const options = Object.assign({}, defaultOptions, opts);
|
|
1533
|
+
const arrowEl = floating.querySelector("[data-part=arrow]");
|
|
1534
|
+
const middleware = [];
|
|
1535
|
+
const boundary = typeof options.boundary === "function" ? options.boundary() : options.boundary;
|
|
1536
|
+
if (options.flip) {
|
|
1537
|
+
middleware.push(
|
|
1538
|
+
flip({
|
|
1539
|
+
boundary,
|
|
1540
|
+
padding: options.overflowPadding
|
|
1541
|
+
})
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
if (options.gutter || options.offset) {
|
|
1545
|
+
const arrowOffset = arrowEl ? arrowEl.offsetHeight / 2 : 0;
|
|
1546
|
+
let mainAxis = options.offset?.mainAxis ?? options.gutter;
|
|
1547
|
+
let crossAxis = options.offset?.crossAxis;
|
|
1548
|
+
if (mainAxis != null)
|
|
1549
|
+
mainAxis += arrowOffset;
|
|
1550
|
+
const offsetOptions = compact({ mainAxis, crossAxis });
|
|
1551
|
+
middleware.push(offset(offsetOptions));
|
|
1552
|
+
}
|
|
1553
|
+
middleware.push(
|
|
1554
|
+
shift({
|
|
1555
|
+
boundary,
|
|
1556
|
+
crossAxis: options.overlap,
|
|
1557
|
+
padding: options.overflowPadding
|
|
1558
|
+
})
|
|
1559
|
+
);
|
|
1560
|
+
if (arrowEl) {
|
|
1561
|
+
middleware.push(
|
|
1562
|
+
arrow({ element: arrowEl, padding: 8 }),
|
|
1563
|
+
shiftArrow({ element: arrowEl })
|
|
1564
|
+
);
|
|
1565
|
+
}
|
|
1566
|
+
middleware.push(transformOrigin);
|
|
1567
|
+
middleware.push(
|
|
1568
|
+
size({
|
|
1569
|
+
padding: options.overflowPadding,
|
|
1570
|
+
apply({ rects, availableHeight, availableWidth }) {
|
|
1571
|
+
const referenceWidth = Math.round(rects.reference.width);
|
|
1572
|
+
floating.style.setProperty("--reference-width", `${referenceWidth}px`);
|
|
1573
|
+
floating.style.setProperty("--available-width", `${availableWidth}px`);
|
|
1574
|
+
floating.style.setProperty("--available-height", `${availableHeight}px`);
|
|
1575
|
+
}
|
|
1576
|
+
})
|
|
1577
|
+
);
|
|
1578
|
+
function compute(config = {}) {
|
|
1579
|
+
if (!reference || !floating)
|
|
1580
|
+
return;
|
|
1581
|
+
const { placement, strategy, onComplete } = options;
|
|
1582
|
+
computePosition2(reference, floating, {
|
|
1583
|
+
placement,
|
|
1584
|
+
middleware,
|
|
1585
|
+
strategy,
|
|
1586
|
+
...config
|
|
1587
|
+
}).then((data) => {
|
|
1588
|
+
const x = Math.round(data.x);
|
|
1589
|
+
floating.style.setProperty("--x", `${x}px`);
|
|
1590
|
+
const y2 = Math.round(data.y);
|
|
1591
|
+
floating.style.setProperty("--y", `${y2}px`);
|
|
1592
|
+
onComplete?.(data);
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
compute();
|
|
1596
|
+
return callAll(
|
|
1597
|
+
options.listeners ? autoUpdate(reference, floating, compute, options.listeners) : void 0,
|
|
1598
|
+
options.onCleanup
|
|
1599
|
+
);
|
|
1600
|
+
}
|
|
1601
|
+
function getPlacement(referenceOrFn, floatingOrFn, opts = {}) {
|
|
1602
|
+
const { defer, ...restOptions } = opts;
|
|
1603
|
+
const func = defer ? raf : (v) => v();
|
|
1604
|
+
const cleanups = [];
|
|
1605
|
+
cleanups.push(
|
|
1606
|
+
func(() => {
|
|
1607
|
+
const reference = typeof referenceOrFn === "function" ? referenceOrFn() : referenceOrFn;
|
|
1608
|
+
const floating = typeof floatingOrFn === "function" ? floatingOrFn() : floatingOrFn;
|
|
1609
|
+
cleanups.push(getPlacementImpl(reference, floating, restOptions));
|
|
1610
|
+
})
|
|
1611
|
+
);
|
|
1612
|
+
return () => {
|
|
1613
|
+
cleanups.forEach((fn) => fn?.());
|
|
1614
|
+
};
|
|
1615
|
+
}
|
|
1616
|
+
var ARROW_FLOATING_STYLE = {
|
|
1617
|
+
bottom: "rotate(45deg)",
|
|
1618
|
+
left: "rotate(135deg)",
|
|
1619
|
+
top: "rotate(225deg)",
|
|
1620
|
+
right: "rotate(315deg)"
|
|
1621
|
+
};
|
|
1622
|
+
function getPlacementStyles(options = {}) {
|
|
1623
|
+
const { placement = "bottom", sameWidth, fitViewport, strategy = "absolute" } = options;
|
|
1624
|
+
return {
|
|
1625
|
+
arrow: {
|
|
1626
|
+
position: "absolute",
|
|
1627
|
+
width: cssVars.arrowSize.reference,
|
|
1628
|
+
height: cssVars.arrowSize.reference,
|
|
1629
|
+
[cssVars.arrowSizeHalf.variable]: `calc(${cssVars.arrowSize.reference} / 2)`,
|
|
1630
|
+
[cssVars.arrowOffset.variable]: `calc(${cssVars.arrowSizeHalf.reference} * -1)`
|
|
1631
|
+
},
|
|
1632
|
+
arrowTip: {
|
|
1633
|
+
transform: ARROW_FLOATING_STYLE[placement.split("-")[0]],
|
|
1634
|
+
background: cssVars.arrowBg.reference,
|
|
1635
|
+
top: "0",
|
|
1636
|
+
left: "0",
|
|
1637
|
+
width: "100%",
|
|
1638
|
+
height: "100%",
|
|
1639
|
+
position: "absolute",
|
|
1640
|
+
zIndex: "inherit"
|
|
1641
|
+
},
|
|
1642
|
+
floating: {
|
|
1643
|
+
position: strategy,
|
|
1644
|
+
minWidth: sameWidth ? void 0 : "max-content",
|
|
1645
|
+
width: sameWidth ? "var(--reference-width)" : void 0,
|
|
1646
|
+
maxWidth: fitViewport ? "var(--available-width)" : void 0,
|
|
1647
|
+
maxHeight: fitViewport ? "var(--available-height)" : void 0,
|
|
1648
|
+
top: "0px",
|
|
1649
|
+
left: "0px",
|
|
1650
|
+
transform: `translate3d(var(--x), var(--y), 0)`
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
// ../../node_modules/.pnpm/proxy-compare@2.5.1/node_modules/proxy-compare/dist/index.modern.js
|
|
1656
|
+
var e = Symbol();
|
|
1657
|
+
var t = Symbol();
|
|
1658
|
+
var r = "a";
|
|
1659
|
+
var n = "w";
|
|
1660
|
+
var o = (e2, t2) => new Proxy(e2, t2);
|
|
1661
|
+
var s = Object.getPrototypeOf;
|
|
1662
|
+
var c = /* @__PURE__ */ new WeakMap();
|
|
1663
|
+
var l = (e2) => e2 && (c.has(e2) ? c.get(e2) : s(e2) === Object.prototype || s(e2) === Array.prototype);
|
|
1664
|
+
var f = (e2) => "object" == typeof e2 && null !== e2;
|
|
1665
|
+
var i = (e2) => {
|
|
1666
|
+
if (Array.isArray(e2))
|
|
1667
|
+
return Array.from(e2);
|
|
1668
|
+
const t2 = Object.getOwnPropertyDescriptors(e2);
|
|
1669
|
+
return Object.values(t2).forEach((e3) => {
|
|
1670
|
+
e3.configurable = true;
|
|
1671
|
+
}), Object.create(s(e2), t2);
|
|
1672
|
+
};
|
|
1673
|
+
var u = (e2) => e2[t] || e2;
|
|
1674
|
+
var a = (s2, c2, f2, p2) => {
|
|
1675
|
+
if (!l(s2))
|
|
1676
|
+
return s2;
|
|
1677
|
+
let g = p2 && p2.get(s2);
|
|
1678
|
+
if (!g) {
|
|
1679
|
+
const e2 = u(s2);
|
|
1680
|
+
g = ((e3) => Object.values(Object.getOwnPropertyDescriptors(e3)).some((e4) => !e4.configurable && !e4.writable))(e2) ? [e2, i(e2)] : [e2], null == p2 || p2.set(s2, g);
|
|
1681
|
+
}
|
|
1682
|
+
const [y2, h2] = g;
|
|
1683
|
+
let w = f2 && f2.get(y2);
|
|
1684
|
+
return w && w[1].f === !!h2 || (w = ((o2, s3) => {
|
|
1685
|
+
const c3 = { f: s3 };
|
|
1686
|
+
let l2 = false;
|
|
1687
|
+
const f3 = (e2, t2) => {
|
|
1688
|
+
if (!l2) {
|
|
1689
|
+
let s4 = c3[r].get(o2);
|
|
1690
|
+
if (s4 || (s4 = {}, c3[r].set(o2, s4)), e2 === n)
|
|
1691
|
+
s4[n] = true;
|
|
1692
|
+
else {
|
|
1693
|
+
let r2 = s4[e2];
|
|
1694
|
+
r2 || (r2 = /* @__PURE__ */ new Set(), s4[e2] = r2), r2.add(t2);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
}, i2 = { get: (e2, n2) => n2 === t ? o2 : (f3("k", n2), a(Reflect.get(e2, n2), c3[r], c3.c, c3.t)), has: (t2, n2) => n2 === e ? (l2 = true, c3[r].delete(o2), true) : (f3("h", n2), Reflect.has(t2, n2)), getOwnPropertyDescriptor: (e2, t2) => (f3("o", t2), Reflect.getOwnPropertyDescriptor(e2, t2)), ownKeys: (e2) => (f3(n), Reflect.ownKeys(e2)) };
|
|
1698
|
+
return s3 && (i2.set = i2.deleteProperty = () => false), [i2, c3];
|
|
1699
|
+
})(y2, !!h2), w[1].p = o(h2 || y2, w[0]), f2 && f2.set(y2, w)), w[1][r] = c2, w[1].c = f2, w[1].t = p2, w[1].p;
|
|
1700
|
+
};
|
|
1701
|
+
var p = (e2, t2, r2, o2) => {
|
|
1702
|
+
if (Object.is(e2, t2))
|
|
1703
|
+
return false;
|
|
1704
|
+
if (!f(e2) || !f(t2))
|
|
1705
|
+
return true;
|
|
1706
|
+
const s2 = r2.get(u(e2));
|
|
1707
|
+
if (!s2)
|
|
1708
|
+
return true;
|
|
1709
|
+
if (o2) {
|
|
1710
|
+
const r3 = o2.get(e2);
|
|
1711
|
+
if (r3 && r3.n === t2)
|
|
1712
|
+
return r3.g;
|
|
1713
|
+
o2.set(e2, { n: t2, g: false });
|
|
1714
|
+
}
|
|
1715
|
+
let c2 = null;
|
|
1716
|
+
try {
|
|
1717
|
+
for (const r3 of s2.h || [])
|
|
1718
|
+
if (c2 = Reflect.has(e2, r3) !== Reflect.has(t2, r3), c2)
|
|
1719
|
+
return c2;
|
|
1720
|
+
if (true === s2[n]) {
|
|
1721
|
+
if (c2 = ((e3, t3) => {
|
|
1722
|
+
const r3 = Reflect.ownKeys(e3), n2 = Reflect.ownKeys(t3);
|
|
1723
|
+
return r3.length !== n2.length || r3.some((e4, t4) => e4 !== n2[t4]);
|
|
1724
|
+
})(e2, t2), c2)
|
|
1725
|
+
return c2;
|
|
1726
|
+
} else
|
|
1727
|
+
for (const r3 of s2.o || [])
|
|
1728
|
+
if (c2 = !!Reflect.getOwnPropertyDescriptor(e2, r3) != !!Reflect.getOwnPropertyDescriptor(t2, r3), c2)
|
|
1729
|
+
return c2;
|
|
1730
|
+
for (const n2 of s2.k || [])
|
|
1731
|
+
if (c2 = p(e2[n2], t2[n2], r2, o2), c2)
|
|
1732
|
+
return c2;
|
|
1733
|
+
return null === c2 && (c2 = true), c2;
|
|
1734
|
+
} finally {
|
|
1735
|
+
o2 && o2.set(e2, { n: t2, g: c2 });
|
|
1736
|
+
}
|
|
1737
|
+
};
|
|
1738
|
+
var y = (e2) => l(e2) && e2[t] || null;
|
|
1739
|
+
var h = (e2, t2 = true) => {
|
|
1740
|
+
c.set(e2, t2);
|
|
1741
|
+
};
|
|
1742
|
+
|
|
1743
|
+
// ../../node_modules/.pnpm/@zag-js+store@0.19.1/node_modules/@zag-js/store/dist/index.mjs
|
|
1744
|
+
var isDev = process.env.NODE_ENV !== "production";
|
|
1745
|
+
var isObject = (x) => typeof x === "object" && x !== null;
|
|
1746
|
+
var proxyStateMap = /* @__PURE__ */ new WeakMap();
|
|
1747
|
+
var refSet = /* @__PURE__ */ new WeakSet();
|
|
1748
|
+
var buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) => new Proxy(target, handler), canProxy = (x) => isObject(x) && !refSet.has(x) && (Array.isArray(x) || !(Symbol.iterator in x)) && !(x instanceof WeakMap) && !(x instanceof WeakSet) && !(x instanceof Error) && !(x instanceof Number) && !(x instanceof Date) && !(x instanceof String) && !(x instanceof RegExp) && !(x instanceof ArrayBuffer), defaultHandlePromise = (promise) => {
|
|
1749
|
+
switch (promise.status) {
|
|
1750
|
+
case "fulfilled":
|
|
1751
|
+
return promise.value;
|
|
1752
|
+
case "rejected":
|
|
1753
|
+
throw promise.reason;
|
|
1754
|
+
default:
|
|
1755
|
+
throw promise;
|
|
1756
|
+
}
|
|
1757
|
+
}, snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version, handlePromise = defaultHandlePromise) => {
|
|
1758
|
+
const cache = snapCache.get(target);
|
|
1759
|
+
if (cache?.[0] === version) {
|
|
1760
|
+
return cache[1];
|
|
1761
|
+
}
|
|
1762
|
+
const snap = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target));
|
|
1763
|
+
h(snap, true);
|
|
1764
|
+
snapCache.set(target, [version, snap]);
|
|
1765
|
+
Reflect.ownKeys(target).forEach((key) => {
|
|
1766
|
+
const value = Reflect.get(target, key);
|
|
1767
|
+
if (refSet.has(value)) {
|
|
1768
|
+
h(value, false);
|
|
1769
|
+
snap[key] = value;
|
|
1770
|
+
} else if (value instanceof Promise) {
|
|
1771
|
+
Object.defineProperty(snap, key, {
|
|
1772
|
+
get() {
|
|
1773
|
+
return handlePromise(value);
|
|
1774
|
+
}
|
|
1775
|
+
});
|
|
1776
|
+
} else if (proxyStateMap.has(value)) {
|
|
1777
|
+
snap[key] = snapshot(value, handlePromise);
|
|
1778
|
+
} else {
|
|
1779
|
+
snap[key] = value;
|
|
1780
|
+
}
|
|
1781
|
+
});
|
|
1782
|
+
return Object.freeze(snap);
|
|
1783
|
+
}, proxyCache = /* @__PURE__ */ new WeakMap(), versionHolder = [1, 1], proxyFunction2 = (initialObject) => {
|
|
1784
|
+
if (!isObject(initialObject)) {
|
|
1785
|
+
throw new Error("object required");
|
|
1786
|
+
}
|
|
1787
|
+
const found = proxyCache.get(initialObject);
|
|
1788
|
+
if (found) {
|
|
1789
|
+
return found;
|
|
1790
|
+
}
|
|
1791
|
+
let version = versionHolder[0];
|
|
1792
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
1793
|
+
const notifyUpdate = (op, nextVersion = ++versionHolder[0]) => {
|
|
1794
|
+
if (version !== nextVersion) {
|
|
1795
|
+
version = nextVersion;
|
|
1796
|
+
listeners.forEach((listener) => listener(op, nextVersion));
|
|
1797
|
+
}
|
|
1798
|
+
};
|
|
1799
|
+
let checkVersion = versionHolder[1];
|
|
1800
|
+
const ensureVersion = (nextCheckVersion = ++versionHolder[1]) => {
|
|
1801
|
+
if (checkVersion !== nextCheckVersion && !listeners.size) {
|
|
1802
|
+
checkVersion = nextCheckVersion;
|
|
1803
|
+
propProxyStates.forEach(([propProxyState]) => {
|
|
1804
|
+
const propVersion = propProxyState[1](nextCheckVersion);
|
|
1805
|
+
if (propVersion > version) {
|
|
1806
|
+
version = propVersion;
|
|
1807
|
+
}
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1810
|
+
return version;
|
|
1811
|
+
};
|
|
1812
|
+
const createPropListener = (prop) => (op, nextVersion) => {
|
|
1813
|
+
const newOp = [...op];
|
|
1814
|
+
newOp[1] = [prop, ...newOp[1]];
|
|
1815
|
+
notifyUpdate(newOp, nextVersion);
|
|
1816
|
+
};
|
|
1817
|
+
const propProxyStates = /* @__PURE__ */ new Map();
|
|
1818
|
+
const addPropListener = (prop, propProxyState) => {
|
|
1819
|
+
if (isDev && propProxyStates.has(prop)) {
|
|
1820
|
+
throw new Error("prop listener already exists");
|
|
1821
|
+
}
|
|
1822
|
+
if (listeners.size) {
|
|
1823
|
+
const remove = propProxyState[3](createPropListener(prop));
|
|
1824
|
+
propProxyStates.set(prop, [propProxyState, remove]);
|
|
1825
|
+
} else {
|
|
1826
|
+
propProxyStates.set(prop, [propProxyState]);
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
const removePropListener = (prop) => {
|
|
1830
|
+
const entry = propProxyStates.get(prop);
|
|
1831
|
+
if (entry) {
|
|
1832
|
+
propProxyStates.delete(prop);
|
|
1833
|
+
entry[1]?.();
|
|
1834
|
+
}
|
|
1835
|
+
};
|
|
1836
|
+
const addListener = (listener) => {
|
|
1837
|
+
listeners.add(listener);
|
|
1838
|
+
if (listeners.size === 1) {
|
|
1839
|
+
propProxyStates.forEach(([propProxyState, prevRemove], prop) => {
|
|
1840
|
+
if (isDev && prevRemove) {
|
|
1841
|
+
throw new Error("remove already exists");
|
|
1842
|
+
}
|
|
1843
|
+
const remove = propProxyState[3](createPropListener(prop));
|
|
1844
|
+
propProxyStates.set(prop, [propProxyState, remove]);
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
const removeListener = () => {
|
|
1848
|
+
listeners.delete(listener);
|
|
1849
|
+
if (listeners.size === 0) {
|
|
1850
|
+
propProxyStates.forEach(([propProxyState, remove], prop) => {
|
|
1851
|
+
if (remove) {
|
|
1852
|
+
remove();
|
|
1853
|
+
propProxyStates.set(prop, [propProxyState]);
|
|
1854
|
+
}
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
};
|
|
1858
|
+
return removeListener;
|
|
1859
|
+
};
|
|
1860
|
+
const baseObject = Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject));
|
|
1861
|
+
const handler = {
|
|
1862
|
+
deleteProperty(target, prop) {
|
|
1863
|
+
const prevValue = Reflect.get(target, prop);
|
|
1864
|
+
removePropListener(prop);
|
|
1865
|
+
const deleted = Reflect.deleteProperty(target, prop);
|
|
1866
|
+
if (deleted) {
|
|
1867
|
+
notifyUpdate(["delete", [prop], prevValue]);
|
|
1868
|
+
}
|
|
1869
|
+
return deleted;
|
|
1870
|
+
},
|
|
1871
|
+
set(target, prop, value, receiver) {
|
|
1872
|
+
const hasPrevValue = Reflect.has(target, prop);
|
|
1873
|
+
const prevValue = Reflect.get(target, prop, receiver);
|
|
1874
|
+
if (hasPrevValue && (objectIs(prevValue, value) || proxyCache.has(value) && objectIs(prevValue, proxyCache.get(value)))) {
|
|
1875
|
+
return true;
|
|
1876
|
+
}
|
|
1877
|
+
removePropListener(prop);
|
|
1878
|
+
if (isObject(value)) {
|
|
1879
|
+
value = y(value) || value;
|
|
1880
|
+
}
|
|
1881
|
+
let nextValue = value;
|
|
1882
|
+
if (Object.getOwnPropertyDescriptor(target, prop)?.set) {
|
|
1883
|
+
} else if (value instanceof Promise) {
|
|
1884
|
+
value.then((v) => {
|
|
1885
|
+
value.status = "fulfilled";
|
|
1886
|
+
value.value = v;
|
|
1887
|
+
notifyUpdate(["resolve", [prop], v]);
|
|
1888
|
+
}).catch((e2) => {
|
|
1889
|
+
value.status = "rejected";
|
|
1890
|
+
value.reason = e2;
|
|
1891
|
+
notifyUpdate(["reject", [prop], e2]);
|
|
1892
|
+
});
|
|
1893
|
+
} else {
|
|
1894
|
+
if (!proxyStateMap.has(value) && canProxy(value)) {
|
|
1895
|
+
nextValue = proxy(value);
|
|
1896
|
+
}
|
|
1897
|
+
const childProxyState = !refSet.has(nextValue) && proxyStateMap.get(nextValue);
|
|
1898
|
+
if (childProxyState) {
|
|
1899
|
+
addPropListener(prop, childProxyState);
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
Reflect.set(target, prop, nextValue, receiver);
|
|
1903
|
+
notifyUpdate(["set", [prop], value, prevValue]);
|
|
1904
|
+
return true;
|
|
1905
|
+
}
|
|
1906
|
+
};
|
|
1907
|
+
const proxyObject = newProxy(baseObject, handler);
|
|
1908
|
+
proxyCache.set(initialObject, proxyObject);
|
|
1909
|
+
const proxyState = [baseObject, ensureVersion, createSnapshot, addListener];
|
|
1910
|
+
proxyStateMap.set(proxyObject, proxyState);
|
|
1911
|
+
Reflect.ownKeys(initialObject).forEach((key) => {
|
|
1912
|
+
const desc = Object.getOwnPropertyDescriptor(initialObject, key);
|
|
1913
|
+
if (desc.get || desc.set) {
|
|
1914
|
+
Object.defineProperty(baseObject, key, desc);
|
|
1915
|
+
} else {
|
|
1916
|
+
proxyObject[key] = initialObject[key];
|
|
1917
|
+
}
|
|
1918
|
+
});
|
|
1919
|
+
return proxyObject;
|
|
1920
|
+
}) => [
|
|
1921
|
+
// public functions
|
|
1922
|
+
proxyFunction2,
|
|
1923
|
+
// shared state
|
|
1924
|
+
proxyStateMap,
|
|
1925
|
+
refSet,
|
|
1926
|
+
// internal things
|
|
1927
|
+
objectIs,
|
|
1928
|
+
newProxy,
|
|
1929
|
+
canProxy,
|
|
1930
|
+
defaultHandlePromise,
|
|
1931
|
+
snapCache,
|
|
1932
|
+
createSnapshot,
|
|
1933
|
+
proxyCache,
|
|
1934
|
+
versionHolder
|
|
1935
|
+
];
|
|
1936
|
+
var [proxyFunction] = buildProxyFunction();
|
|
1937
|
+
function proxy(initialObject = {}) {
|
|
1938
|
+
return proxyFunction(initialObject);
|
|
1939
|
+
}
|
|
1940
|
+
function subscribe(proxyObject, callback, notifyInSync) {
|
|
1941
|
+
const proxyState = proxyStateMap.get(proxyObject);
|
|
1942
|
+
if (isDev && !proxyState) {
|
|
1943
|
+
console.warn("Please use proxy object");
|
|
1944
|
+
}
|
|
1945
|
+
let promise;
|
|
1946
|
+
const ops = [];
|
|
1947
|
+
const addListener = proxyState[3];
|
|
1948
|
+
let isListenerActive = false;
|
|
1949
|
+
const listener = (op) => {
|
|
1950
|
+
ops.push(op);
|
|
1951
|
+
if (notifyInSync) {
|
|
1952
|
+
callback(ops.splice(0));
|
|
1953
|
+
return;
|
|
1954
|
+
}
|
|
1955
|
+
if (!promise) {
|
|
1956
|
+
promise = Promise.resolve().then(() => {
|
|
1957
|
+
promise = void 0;
|
|
1958
|
+
if (isListenerActive) {
|
|
1959
|
+
callback(ops.splice(0));
|
|
1960
|
+
}
|
|
1961
|
+
});
|
|
1962
|
+
}
|
|
1963
|
+
};
|
|
1964
|
+
const removeListener = addListener(listener);
|
|
1965
|
+
isListenerActive = true;
|
|
1966
|
+
return () => {
|
|
1967
|
+
isListenerActive = false;
|
|
1968
|
+
removeListener();
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
function snapshot(proxyObject, handlePromise) {
|
|
1972
|
+
const proxyState = proxyStateMap.get(proxyObject);
|
|
1973
|
+
if (isDev && !proxyState) {
|
|
1974
|
+
console.warn("Please use proxy object");
|
|
1975
|
+
}
|
|
1976
|
+
const [target, ensureVersion, createSnapshot] = proxyState;
|
|
1977
|
+
return createSnapshot(target, ensureVersion(), handlePromise);
|
|
1978
|
+
}
|
|
1979
|
+
function ref(obj) {
|
|
1980
|
+
refSet.add(obj);
|
|
1981
|
+
return obj;
|
|
1982
|
+
}
|
|
1983
|
+
function proxyWithComputed(initialObject, computedFns) {
|
|
1984
|
+
const keys = Object.keys(computedFns);
|
|
1985
|
+
keys.forEach((key) => {
|
|
1986
|
+
if (Object.getOwnPropertyDescriptor(initialObject, key)) {
|
|
1987
|
+
throw new Error("object property already defined");
|
|
1988
|
+
}
|
|
1989
|
+
const computedFn = computedFns[key];
|
|
1990
|
+
const { get, set: set2 } = typeof computedFn === "function" ? { get: computedFn } : computedFn;
|
|
1991
|
+
const desc = {};
|
|
1992
|
+
desc.get = () => get(snapshot(proxyObject));
|
|
1993
|
+
if (set2) {
|
|
1994
|
+
desc.set = (newValue) => set2(proxyObject, newValue);
|
|
1995
|
+
}
|
|
1996
|
+
Object.defineProperty(initialObject, key, desc);
|
|
1997
|
+
});
|
|
1998
|
+
const proxyObject = proxy(initialObject);
|
|
1999
|
+
return proxyObject;
|
|
2000
|
+
}
|
|
2001
|
+
var defaultCompareFn = (prev, next) => Object.is(prev, next);
|
|
2002
|
+
function subscribeKey(obj, key, fn, sync, compareFn) {
|
|
2003
|
+
let prev = Reflect.get(snapshot(obj), key);
|
|
2004
|
+
const isEqual = compareFn || defaultCompareFn;
|
|
2005
|
+
function onSnapshotChange() {
|
|
2006
|
+
const snap = snapshot(obj);
|
|
2007
|
+
if (isEqual(prev, snap[key]))
|
|
2008
|
+
return;
|
|
2009
|
+
fn(snap[key]);
|
|
2010
|
+
prev = Reflect.get(snap, key);
|
|
2011
|
+
}
|
|
2012
|
+
return subscribe(obj, onSnapshotChange, sync);
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
// ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/full/index.mjs
|
|
2016
|
+
function set(obj, key, val) {
|
|
2017
|
+
if (typeof val.value === "object")
|
|
2018
|
+
val.value = klona(val.value);
|
|
2019
|
+
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === "__proto__") {
|
|
2020
|
+
Object.defineProperty(obj, key, val);
|
|
2021
|
+
} else
|
|
2022
|
+
obj[key] = val.value;
|
|
2023
|
+
}
|
|
2024
|
+
function klona(x) {
|
|
2025
|
+
if (typeof x !== "object")
|
|
2026
|
+
return x;
|
|
2027
|
+
var i2 = 0, k, list, tmp, str = Object.prototype.toString.call(x);
|
|
2028
|
+
if (str === "[object Object]") {
|
|
2029
|
+
tmp = Object.create(x.__proto__ || null);
|
|
2030
|
+
} else if (str === "[object Array]") {
|
|
2031
|
+
tmp = Array(x.length);
|
|
2032
|
+
} else if (str === "[object Set]") {
|
|
2033
|
+
tmp = /* @__PURE__ */ new Set();
|
|
2034
|
+
x.forEach(function(val) {
|
|
2035
|
+
tmp.add(klona(val));
|
|
2036
|
+
});
|
|
2037
|
+
} else if (str === "[object Map]") {
|
|
2038
|
+
tmp = /* @__PURE__ */ new Map();
|
|
2039
|
+
x.forEach(function(val, key) {
|
|
2040
|
+
tmp.set(klona(key), klona(val));
|
|
2041
|
+
});
|
|
2042
|
+
} else if (str === "[object Date]") {
|
|
2043
|
+
tmp = /* @__PURE__ */ new Date(+x);
|
|
2044
|
+
} else if (str === "[object RegExp]") {
|
|
2045
|
+
tmp = new RegExp(x.source, x.flags);
|
|
2046
|
+
} else if (str === "[object DataView]") {
|
|
2047
|
+
tmp = new x.constructor(klona(x.buffer));
|
|
2048
|
+
} else if (str === "[object ArrayBuffer]") {
|
|
2049
|
+
tmp = x.slice(0);
|
|
2050
|
+
} else if (str.slice(-6) === "Array]") {
|
|
2051
|
+
tmp = new x.constructor(x);
|
|
2052
|
+
}
|
|
2053
|
+
if (tmp) {
|
|
2054
|
+
for (list = Object.getOwnPropertySymbols(x); i2 < list.length; i2++) {
|
|
2055
|
+
set(tmp, list[i2], Object.getOwnPropertyDescriptor(x, list[i2]));
|
|
2056
|
+
}
|
|
2057
|
+
for (i2 = 0, list = Object.getOwnPropertyNames(x); i2 < list.length; i2++) {
|
|
2058
|
+
if (Object.hasOwnProperty.call(tmp, k = list[i2]) && tmp[k] === x[k])
|
|
2059
|
+
continue;
|
|
2060
|
+
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
return tmp || x;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
// ../../node_modules/.pnpm/@zag-js+core@0.19.1/node_modules/@zag-js/core/dist/index.mjs
|
|
2067
|
+
var __defProp2 = Object.defineProperty;
|
|
2068
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2069
|
+
var __publicField = (obj, key, value) => {
|
|
2070
|
+
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2071
|
+
return value;
|
|
2072
|
+
};
|
|
2073
|
+
function clear(v) {
|
|
2074
|
+
while (v.length > 0)
|
|
2075
|
+
v.pop();
|
|
2076
|
+
return v;
|
|
2077
|
+
}
|
|
2078
|
+
var runIfFn = (v, ...a2) => {
|
|
2079
|
+
const res = typeof v === "function" ? v(...a2) : v;
|
|
2080
|
+
return res ?? void 0;
|
|
2081
|
+
};
|
|
2082
|
+
var cast = (v) => v;
|
|
2083
|
+
var noop = () => {
|
|
2084
|
+
};
|
|
2085
|
+
var uuid = /* @__PURE__ */ (() => {
|
|
2086
|
+
let id = 0;
|
|
2087
|
+
return () => {
|
|
2088
|
+
id++;
|
|
2089
|
+
return id.toString(36);
|
|
2090
|
+
};
|
|
2091
|
+
})();
|
|
2092
|
+
var isDev2 = () => process.env.NODE_ENV !== "production";
|
|
2093
|
+
var isArray = (v) => Array.isArray(v);
|
|
2094
|
+
var isObject2 = (v) => !(v == null || typeof v !== "object" || isArray(v));
|
|
2095
|
+
var isNumber = (v) => typeof v === "number" && !Number.isNaN(v);
|
|
2096
|
+
var isString = (v) => typeof v === "string";
|
|
2097
|
+
var isFunction = (v) => typeof v === "function";
|
|
2098
|
+
function compact2(obj) {
|
|
2099
|
+
if (!isPlainObject2(obj) || obj === void 0) {
|
|
2100
|
+
return obj;
|
|
2101
|
+
}
|
|
2102
|
+
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
|
|
2103
|
+
const filtered = {};
|
|
2104
|
+
for (const key of keys) {
|
|
2105
|
+
const value = obj[key];
|
|
2106
|
+
if (value !== void 0) {
|
|
2107
|
+
filtered[key] = compact2(value);
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
return filtered;
|
|
2111
|
+
}
|
|
2112
|
+
var isPlainObject2 = (value) => {
|
|
2113
|
+
return value && typeof value === "object" && value.constructor === Object;
|
|
2114
|
+
};
|
|
2115
|
+
function warn(...a2) {
|
|
2116
|
+
const m = a2.length === 1 ? a2[0] : a2[1];
|
|
2117
|
+
const c2 = a2.length === 2 ? a2[0] : true;
|
|
2118
|
+
if (c2 && process.env.NODE_ENV !== "production") {
|
|
2119
|
+
console.warn(m);
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
function invariant(...a2) {
|
|
2123
|
+
const m = a2.length === 1 ? a2[0] : a2[1];
|
|
2124
|
+
const c2 = a2.length === 2 ? a2[0] : true;
|
|
2125
|
+
if (c2 && process.env.NODE_ENV !== "production") {
|
|
2126
|
+
throw new Error(m);
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
function deepMerge(source, ...objects) {
|
|
2130
|
+
for (const obj of objects) {
|
|
2131
|
+
const target = compact2(obj);
|
|
2132
|
+
for (const key in target) {
|
|
2133
|
+
if (isObject2(obj[key])) {
|
|
2134
|
+
if (!source[key]) {
|
|
2135
|
+
source[key] = {};
|
|
2136
|
+
}
|
|
2137
|
+
deepMerge(source[key], obj[key]);
|
|
2138
|
+
} else {
|
|
2139
|
+
source[key] = obj[key];
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
return source;
|
|
2144
|
+
}
|
|
2145
|
+
function structuredClone(v) {
|
|
2146
|
+
return klona(v);
|
|
2147
|
+
}
|
|
2148
|
+
function toEvent(event) {
|
|
2149
|
+
const obj = isString(event) ? { type: event } : event;
|
|
2150
|
+
return obj;
|
|
2151
|
+
}
|
|
2152
|
+
function toArray(value) {
|
|
2153
|
+
if (!value)
|
|
2154
|
+
return [];
|
|
2155
|
+
return isArray(value) ? value.slice() : [value];
|
|
2156
|
+
}
|
|
2157
|
+
function isGuardHelper(value) {
|
|
2158
|
+
return isObject2(value) && value.predicate != null;
|
|
2159
|
+
}
|
|
2160
|
+
var Truthy = () => true;
|
|
2161
|
+
function exec(guardMap, ctx, event, meta) {
|
|
2162
|
+
return (guard) => {
|
|
2163
|
+
if (isString(guard)) {
|
|
2164
|
+
return !!guardMap[guard]?.(ctx, event, meta);
|
|
2165
|
+
}
|
|
2166
|
+
if (isFunction(guard)) {
|
|
2167
|
+
return guard(ctx, event, meta);
|
|
2168
|
+
}
|
|
2169
|
+
return guard.predicate(guardMap)(ctx, event, meta);
|
|
2170
|
+
};
|
|
2171
|
+
}
|
|
2172
|
+
function or(...conditions) {
|
|
2173
|
+
return {
|
|
2174
|
+
predicate: (guardMap) => (ctx, event, meta) => conditions.map(exec(guardMap, ctx, event, meta)).some(Boolean)
|
|
2175
|
+
};
|
|
2176
|
+
}
|
|
2177
|
+
function and(...conditions) {
|
|
2178
|
+
return {
|
|
2179
|
+
predicate: (guardMap) => (ctx, event, meta) => conditions.map(exec(guardMap, ctx, event, meta)).every(Boolean)
|
|
2180
|
+
};
|
|
2181
|
+
}
|
|
2182
|
+
function not(condition) {
|
|
2183
|
+
return {
|
|
2184
|
+
predicate: (guardMap) => (ctx, event, meta) => {
|
|
2185
|
+
return !exec(guardMap, ctx, event, meta)(condition);
|
|
2186
|
+
}
|
|
2187
|
+
};
|
|
2188
|
+
}
|
|
2189
|
+
function stateIn(...values) {
|
|
2190
|
+
return (_ctx, _evt, meta) => meta.state.matches(...values);
|
|
2191
|
+
}
|
|
2192
|
+
var guards = { or, and, not, stateIn };
|
|
2193
|
+
function determineGuardFn(guard, guardMap) {
|
|
2194
|
+
guard = guard ?? Truthy;
|
|
2195
|
+
return (context, event, meta) => {
|
|
2196
|
+
if (isString(guard)) {
|
|
2197
|
+
const value = guardMap[guard];
|
|
2198
|
+
return isFunction(value) ? value(context, event, meta) : value;
|
|
2199
|
+
}
|
|
2200
|
+
if (isGuardHelper(guard)) {
|
|
2201
|
+
return guard.predicate(guardMap)(context, event, meta);
|
|
2202
|
+
}
|
|
2203
|
+
return guard?.(context, event, meta);
|
|
2204
|
+
};
|
|
2205
|
+
}
|
|
2206
|
+
function determineActionsFn(values, guardMap) {
|
|
2207
|
+
return (context, event, meta) => {
|
|
2208
|
+
if (isGuardHelper(values)) {
|
|
2209
|
+
return values.predicate(guardMap)(context, event, meta);
|
|
2210
|
+
}
|
|
2211
|
+
return values;
|
|
2212
|
+
};
|
|
2213
|
+
}
|
|
2214
|
+
function createProxy(config) {
|
|
2215
|
+
const computedContext = config.computed ?? cast({});
|
|
2216
|
+
const initialContext = config.context ?? cast({});
|
|
2217
|
+
const state = proxy({
|
|
2218
|
+
value: config.initial ?? "",
|
|
2219
|
+
previousValue: "",
|
|
2220
|
+
event: cast({}),
|
|
2221
|
+
previousEvent: cast({}),
|
|
2222
|
+
context: proxyWithComputed(initialContext, computedContext),
|
|
2223
|
+
done: false,
|
|
2224
|
+
tags: [],
|
|
2225
|
+
hasTag(tag) {
|
|
2226
|
+
return this.tags.includes(tag);
|
|
2227
|
+
},
|
|
2228
|
+
matches(...value) {
|
|
2229
|
+
return value.includes(this.value);
|
|
2230
|
+
},
|
|
2231
|
+
can(event) {
|
|
2232
|
+
return cast(this).nextEvents.includes(event);
|
|
2233
|
+
},
|
|
2234
|
+
get nextEvents() {
|
|
2235
|
+
const stateEvents = config.states?.[this.value]?.["on"] ?? {};
|
|
2236
|
+
const globalEvents = config?.on ?? {};
|
|
2237
|
+
return Object.keys({ ...stateEvents, ...globalEvents });
|
|
2238
|
+
},
|
|
2239
|
+
get changed() {
|
|
2240
|
+
if (this.event.value === "machine.init" || !this.previousValue)
|
|
2241
|
+
return false;
|
|
2242
|
+
return this.value !== this.previousValue;
|
|
2243
|
+
}
|
|
2244
|
+
});
|
|
2245
|
+
return cast(state);
|
|
2246
|
+
}
|
|
2247
|
+
function determineDelayFn(delay, delaysMap) {
|
|
2248
|
+
return (context, event) => {
|
|
2249
|
+
if (isNumber(delay))
|
|
2250
|
+
return delay;
|
|
2251
|
+
if (isFunction(delay)) {
|
|
2252
|
+
return delay(context, event);
|
|
2253
|
+
}
|
|
2254
|
+
if (isString(delay)) {
|
|
2255
|
+
const value = Number.parseFloat(delay);
|
|
2256
|
+
if (!Number.isNaN(value)) {
|
|
2257
|
+
return value;
|
|
2258
|
+
}
|
|
2259
|
+
if (delaysMap) {
|
|
2260
|
+
const valueOrFn = delaysMap?.[delay];
|
|
2261
|
+
invariant(
|
|
2262
|
+
valueOrFn == null,
|
|
2263
|
+
`[@zag-js/core > determine-delay] Cannot determine delay for \`${delay}\`. It doesn't exist in \`options.delays\``
|
|
2264
|
+
);
|
|
2265
|
+
return isFunction(valueOrFn) ? valueOrFn(context, event) : valueOrFn;
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
};
|
|
2269
|
+
}
|
|
2270
|
+
function toTarget(target) {
|
|
2271
|
+
return isString(target) ? { target } : target;
|
|
2272
|
+
}
|
|
2273
|
+
function determineTransitionFn(transitions, guardMap) {
|
|
2274
|
+
return (context, event, meta) => {
|
|
2275
|
+
return toArray(transitions).map(toTarget).find((transition) => {
|
|
2276
|
+
const determineGuard = determineGuardFn(transition.guard, guardMap);
|
|
2277
|
+
const guard = determineGuard(context, event, meta);
|
|
2278
|
+
return guard ?? transition.target ?? transition.actions;
|
|
2279
|
+
});
|
|
2280
|
+
};
|
|
2281
|
+
}
|
|
2282
|
+
var Machine = class _Machine {
|
|
2283
|
+
// Let's get started!
|
|
2284
|
+
constructor(config, options) {
|
|
2285
|
+
__publicField(
|
|
2286
|
+
this,
|
|
2287
|
+
"status",
|
|
2288
|
+
"Not Started"
|
|
2289
|
+
/* NotStarted */
|
|
2290
|
+
);
|
|
2291
|
+
__publicField(this, "state");
|
|
2292
|
+
__publicField(this, "initialState");
|
|
2293
|
+
__publicField(this, "initialContext");
|
|
2294
|
+
__publicField(this, "id");
|
|
2295
|
+
__publicField(
|
|
2296
|
+
this,
|
|
2297
|
+
"type",
|
|
2298
|
+
"machine"
|
|
2299
|
+
/* Machine */
|
|
2300
|
+
);
|
|
2301
|
+
__publicField(this, "activityEvents", /* @__PURE__ */ new Map());
|
|
2302
|
+
__publicField(this, "delayedEvents", /* @__PURE__ */ new Map());
|
|
2303
|
+
__publicField(this, "stateListeners", /* @__PURE__ */ new Set());
|
|
2304
|
+
__publicField(this, "contextListeners", /* @__PURE__ */ new Set());
|
|
2305
|
+
__publicField(this, "eventListeners", /* @__PURE__ */ new Set());
|
|
2306
|
+
__publicField(this, "doneListeners", /* @__PURE__ */ new Set());
|
|
2307
|
+
__publicField(this, "contextWatchers", /* @__PURE__ */ new Set());
|
|
2308
|
+
__publicField(this, "removeStateListener", noop);
|
|
2309
|
+
__publicField(this, "removeEventListener", noop);
|
|
2310
|
+
__publicField(this, "removeContextListener", noop);
|
|
2311
|
+
__publicField(this, "parent");
|
|
2312
|
+
__publicField(this, "children", /* @__PURE__ */ new Map());
|
|
2313
|
+
__publicField(this, "guardMap");
|
|
2314
|
+
__publicField(this, "actionMap");
|
|
2315
|
+
__publicField(this, "delayMap");
|
|
2316
|
+
__publicField(this, "activityMap");
|
|
2317
|
+
__publicField(this, "sync");
|
|
2318
|
+
__publicField(this, "options");
|
|
2319
|
+
__publicField(this, "config");
|
|
2320
|
+
__publicField(this, "start", (init) => {
|
|
2321
|
+
this.state.value = "";
|
|
2322
|
+
if (this.status === "Running") {
|
|
2323
|
+
return this;
|
|
2324
|
+
}
|
|
2325
|
+
this.status = "Running";
|
|
2326
|
+
this.removeStateListener = subscribe(
|
|
2327
|
+
this.state,
|
|
2328
|
+
() => {
|
|
2329
|
+
this.stateListeners.forEach((listener) => {
|
|
2330
|
+
listener(this.stateSnapshot);
|
|
2331
|
+
});
|
|
2332
|
+
},
|
|
2333
|
+
this.sync
|
|
2334
|
+
);
|
|
2335
|
+
this.removeEventListener = subscribeKey(
|
|
2336
|
+
this.state,
|
|
2337
|
+
"event",
|
|
2338
|
+
(event22) => {
|
|
2339
|
+
this.executeActions(this.config.onEvent, event22);
|
|
2340
|
+
this.eventListeners.forEach((listener) => {
|
|
2341
|
+
listener(event22);
|
|
2342
|
+
});
|
|
2343
|
+
},
|
|
2344
|
+
this.sync
|
|
2345
|
+
);
|
|
2346
|
+
this.removeContextListener = subscribe(
|
|
2347
|
+
this.state.context,
|
|
2348
|
+
() => {
|
|
2349
|
+
this.log("Context:", this.contextSnapshot);
|
|
2350
|
+
this.contextListeners.forEach((listener) => {
|
|
2351
|
+
listener(this.contextSnapshot);
|
|
2352
|
+
});
|
|
2353
|
+
},
|
|
2354
|
+
this.sync || this.options.debug
|
|
2355
|
+
);
|
|
2356
|
+
this.setupContextWatchers();
|
|
2357
|
+
this.executeActivities(
|
|
2358
|
+
toEvent(
|
|
2359
|
+
"machine.start"
|
|
2360
|
+
/* Start */
|
|
2361
|
+
),
|
|
2362
|
+
toArray(this.config.activities),
|
|
2363
|
+
"machine.start"
|
|
2364
|
+
/* Start */
|
|
2365
|
+
);
|
|
2366
|
+
this.executeActions(this.config.entry, toEvent(
|
|
2367
|
+
"machine.start"
|
|
2368
|
+
/* Start */
|
|
2369
|
+
));
|
|
2370
|
+
const event2 = toEvent(
|
|
2371
|
+
"machine.init"
|
|
2372
|
+
/* Init */
|
|
2373
|
+
);
|
|
2374
|
+
const target = isObject2(init) ? init.value : init;
|
|
2375
|
+
const context = isObject2(init) ? init.context : void 0;
|
|
2376
|
+
if (context) {
|
|
2377
|
+
this.setContext(context);
|
|
2378
|
+
}
|
|
2379
|
+
const transition = {
|
|
2380
|
+
target: target ?? this.config.initial
|
|
2381
|
+
};
|
|
2382
|
+
const next = this.getNextStateInfo(transition, event2);
|
|
2383
|
+
this.initialState = next;
|
|
2384
|
+
this.performStateChangeEffects(this.state.value, next, event2);
|
|
2385
|
+
return this;
|
|
2386
|
+
});
|
|
2387
|
+
__publicField(this, "setupContextWatchers", () => {
|
|
2388
|
+
for (const [key, fn] of Object.entries(this.config.watch ?? {})) {
|
|
2389
|
+
const compareFn = this.options.compareFns?.[key];
|
|
2390
|
+
const cleanup = subscribeKey(
|
|
2391
|
+
this.state.context,
|
|
2392
|
+
key,
|
|
2393
|
+
() => {
|
|
2394
|
+
this.executeActions(fn, this.state.event);
|
|
2395
|
+
},
|
|
2396
|
+
this.sync,
|
|
2397
|
+
compareFn
|
|
2398
|
+
);
|
|
2399
|
+
this.contextWatchers.add(cleanup);
|
|
2400
|
+
}
|
|
2401
|
+
});
|
|
2402
|
+
__publicField(this, "stop", () => {
|
|
2403
|
+
if (this.status === "Stopped")
|
|
2404
|
+
return;
|
|
2405
|
+
this.performExitEffects(this.state.value, toEvent(
|
|
2406
|
+
"machine.stop"
|
|
2407
|
+
/* Stop */
|
|
2408
|
+
));
|
|
2409
|
+
this.executeActions(this.config.exit, toEvent(
|
|
2410
|
+
"machine.stop"
|
|
2411
|
+
/* Stop */
|
|
2412
|
+
));
|
|
2413
|
+
this.setState("");
|
|
2414
|
+
this.setEvent(
|
|
2415
|
+
"machine.stop"
|
|
2416
|
+
/* Stop */
|
|
2417
|
+
);
|
|
2418
|
+
this.stopStateListeners();
|
|
2419
|
+
this.stopChildren();
|
|
2420
|
+
this.stopActivities();
|
|
2421
|
+
this.stopDelayedEvents();
|
|
2422
|
+
this.stopContextWatchers();
|
|
2423
|
+
this.stopEventListeners();
|
|
2424
|
+
this.stopContextListeners();
|
|
2425
|
+
this.status = "Stopped";
|
|
2426
|
+
return this;
|
|
2427
|
+
});
|
|
2428
|
+
__publicField(this, "stopEventListeners", () => {
|
|
2429
|
+
this.eventListeners.clear();
|
|
2430
|
+
this.removeEventListener();
|
|
2431
|
+
});
|
|
2432
|
+
__publicField(this, "stopContextListeners", () => {
|
|
2433
|
+
this.contextListeners.clear();
|
|
2434
|
+
this.removeContextListener();
|
|
2435
|
+
});
|
|
2436
|
+
__publicField(this, "stopStateListeners", () => {
|
|
2437
|
+
this.removeStateListener();
|
|
2438
|
+
this.stateListeners.clear();
|
|
2439
|
+
});
|
|
2440
|
+
__publicField(this, "stopContextWatchers", () => {
|
|
2441
|
+
this.contextWatchers.forEach((fn) => fn());
|
|
2442
|
+
this.contextWatchers.clear();
|
|
2443
|
+
});
|
|
2444
|
+
__publicField(this, "stopDelayedEvents", () => {
|
|
2445
|
+
this.delayedEvents.forEach((state) => {
|
|
2446
|
+
state.forEach((stop) => stop());
|
|
2447
|
+
});
|
|
2448
|
+
this.delayedEvents.clear();
|
|
2449
|
+
});
|
|
2450
|
+
__publicField(this, "stopActivities", (state) => {
|
|
2451
|
+
if (state) {
|
|
2452
|
+
this.activityEvents.get(state)?.forEach((stop) => stop());
|
|
2453
|
+
this.activityEvents.get(state)?.clear();
|
|
2454
|
+
this.activityEvents.delete(state);
|
|
2455
|
+
} else {
|
|
2456
|
+
this.activityEvents.forEach((state2) => {
|
|
2457
|
+
state2.forEach((stop) => stop());
|
|
2458
|
+
state2.clear();
|
|
2459
|
+
});
|
|
2460
|
+
this.activityEvents.clear();
|
|
2461
|
+
}
|
|
2462
|
+
});
|
|
2463
|
+
__publicField(this, "sendChild", (evt, to) => {
|
|
2464
|
+
const event2 = toEvent(evt);
|
|
2465
|
+
const id = runIfFn(to, this.contextSnapshot);
|
|
2466
|
+
const child = this.children.get(id);
|
|
2467
|
+
if (!child) {
|
|
2468
|
+
invariant(`[@zag-js/core] Cannot send '${event2.type}' event to unknown child`);
|
|
2469
|
+
}
|
|
2470
|
+
child.send(event2);
|
|
2471
|
+
});
|
|
2472
|
+
__publicField(this, "stopChild", (id) => {
|
|
2473
|
+
if (!this.children.has(id)) {
|
|
2474
|
+
invariant(`[@zag-js/core > stop-child] Cannot stop unknown child ${id}`);
|
|
2475
|
+
}
|
|
2476
|
+
this.children.get(id).stop();
|
|
2477
|
+
this.children.delete(id);
|
|
2478
|
+
});
|
|
2479
|
+
__publicField(this, "removeChild", (id) => {
|
|
2480
|
+
this.children.delete(id);
|
|
2481
|
+
});
|
|
2482
|
+
__publicField(this, "stopChildren", () => {
|
|
2483
|
+
this.children.forEach((child) => child.stop());
|
|
2484
|
+
this.children.clear();
|
|
2485
|
+
});
|
|
2486
|
+
__publicField(this, "setParent", (parent) => {
|
|
2487
|
+
this.parent = parent;
|
|
2488
|
+
});
|
|
2489
|
+
__publicField(this, "spawn", (src, id) => {
|
|
2490
|
+
const actor = runIfFn(src);
|
|
2491
|
+
if (id)
|
|
2492
|
+
actor.id = id;
|
|
2493
|
+
actor.type = "machine.actor";
|
|
2494
|
+
actor.setParent(this);
|
|
2495
|
+
this.children.set(actor.id, cast(actor));
|
|
2496
|
+
actor.onDone(() => {
|
|
2497
|
+
this.removeChild(actor.id);
|
|
2498
|
+
}).start();
|
|
2499
|
+
return cast(ref(actor));
|
|
2500
|
+
});
|
|
2501
|
+
__publicField(this, "stopActivity", (key) => {
|
|
2502
|
+
if (!this.state.value)
|
|
2503
|
+
return;
|
|
2504
|
+
const cleanups = this.activityEvents.get(this.state.value);
|
|
2505
|
+
cleanups?.get(key)?.();
|
|
2506
|
+
cleanups?.delete(key);
|
|
2507
|
+
});
|
|
2508
|
+
__publicField(this, "addActivityCleanup", (state, key, cleanup) => {
|
|
2509
|
+
if (!state)
|
|
2510
|
+
return;
|
|
2511
|
+
if (!this.activityEvents.has(state)) {
|
|
2512
|
+
this.activityEvents.set(state, /* @__PURE__ */ new Map([[key, cleanup]]));
|
|
2513
|
+
} else {
|
|
2514
|
+
this.activityEvents.get(state)?.set(key, cleanup);
|
|
2515
|
+
}
|
|
2516
|
+
});
|
|
2517
|
+
__publicField(this, "setState", (target) => {
|
|
2518
|
+
this.state.previousValue = this.state.value;
|
|
2519
|
+
this.state.value = target;
|
|
2520
|
+
const stateNode = this.getStateNode(target);
|
|
2521
|
+
if (target == null) {
|
|
2522
|
+
clear(this.state.tags);
|
|
2523
|
+
} else {
|
|
2524
|
+
this.state.tags = toArray(stateNode?.tags);
|
|
2525
|
+
}
|
|
2526
|
+
});
|
|
2527
|
+
__publicField(this, "transformContext", (context) => {
|
|
2528
|
+
this.options?.transformContext?.(context);
|
|
2529
|
+
return context;
|
|
2530
|
+
});
|
|
2531
|
+
__publicField(this, "setContext", (context) => {
|
|
2532
|
+
if (!context)
|
|
2533
|
+
return;
|
|
2534
|
+
deepMerge(this.state.context, this.transformContext(context));
|
|
2535
|
+
});
|
|
2536
|
+
__publicField(this, "withContext", (context) => {
|
|
2537
|
+
const transformed = this.transformContext(context);
|
|
2538
|
+
const newContext = { ...this.config.context, ...compact2(transformed) };
|
|
2539
|
+
return new _Machine({ ...this.config, context: newContext }, this.options);
|
|
2540
|
+
});
|
|
2541
|
+
__publicField(this, "setOptions", (options2) => {
|
|
2542
|
+
const opts = compact2(options2);
|
|
2543
|
+
this.actionMap = { ...this.actionMap, ...opts.actions };
|
|
2544
|
+
this.delayMap = { ...this.delayMap, ...opts.delays };
|
|
2545
|
+
this.activityMap = { ...this.activityMap, ...opts.activities };
|
|
2546
|
+
this.guardMap = { ...this.guardMap, ...opts.guards };
|
|
2547
|
+
});
|
|
2548
|
+
__publicField(this, "getStateNode", (state) => {
|
|
2549
|
+
if (!state)
|
|
2550
|
+
return;
|
|
2551
|
+
return this.config.states?.[state];
|
|
2552
|
+
});
|
|
2553
|
+
__publicField(this, "getNextStateInfo", (transitions, event2) => {
|
|
2554
|
+
const transition = this.determineTransition(transitions, event2);
|
|
2555
|
+
const isTargetless = !transition?.target;
|
|
2556
|
+
const target = transition?.target ?? this.state.value;
|
|
2557
|
+
const changed = this.state.value !== target;
|
|
2558
|
+
const stateNode = this.getStateNode(target);
|
|
2559
|
+
const reenter = !isTargetless && !changed && !transition?.internal;
|
|
2560
|
+
const info = {
|
|
2561
|
+
reenter,
|
|
2562
|
+
transition,
|
|
2563
|
+
stateNode,
|
|
2564
|
+
target,
|
|
2565
|
+
changed
|
|
2566
|
+
};
|
|
2567
|
+
this.log("NextState:", `[${event2.type}]`, this.state.value, "---->", info.target);
|
|
2568
|
+
return info;
|
|
2569
|
+
});
|
|
2570
|
+
__publicField(this, "getActionFromDelayedTransition", (transition) => {
|
|
2571
|
+
const event2 = toEvent(
|
|
2572
|
+
"machine.after"
|
|
2573
|
+
/* After */
|
|
2574
|
+
);
|
|
2575
|
+
const determineDelay = determineDelayFn(transition.delay, this.delayMap);
|
|
2576
|
+
const delay = determineDelay(this.contextSnapshot, event2);
|
|
2577
|
+
let id;
|
|
2578
|
+
return {
|
|
2579
|
+
entry: () => {
|
|
2580
|
+
id = globalThis.setTimeout(() => {
|
|
2581
|
+
const next = this.getNextStateInfo(transition, event2);
|
|
2582
|
+
this.performStateChangeEffects(this.state.value, next, event2);
|
|
2583
|
+
}, delay);
|
|
2584
|
+
},
|
|
2585
|
+
exit: () => {
|
|
2586
|
+
globalThis.clearTimeout(id);
|
|
2587
|
+
}
|
|
2588
|
+
};
|
|
2589
|
+
});
|
|
2590
|
+
__publicField(this, "getDelayedEventActions", (state) => {
|
|
2591
|
+
const stateNode = this.getStateNode(state);
|
|
2592
|
+
const event2 = toEvent(
|
|
2593
|
+
"machine.after"
|
|
2594
|
+
/* After */
|
|
2595
|
+
);
|
|
2596
|
+
if (!stateNode || !stateNode.after)
|
|
2597
|
+
return;
|
|
2598
|
+
const entries = [];
|
|
2599
|
+
const exits = [];
|
|
2600
|
+
if (isArray(stateNode.after)) {
|
|
2601
|
+
const transition = this.determineTransition(stateNode.after, event2);
|
|
2602
|
+
if (!transition)
|
|
2603
|
+
return;
|
|
2604
|
+
const actions = this.getActionFromDelayedTransition(transition);
|
|
2605
|
+
entries.push(actions.entry);
|
|
2606
|
+
exits.push(actions.exit);
|
|
2607
|
+
} else if (isObject2(stateNode.after)) {
|
|
2608
|
+
for (const delay in stateNode.after) {
|
|
2609
|
+
const transition = stateNode.after[delay];
|
|
2610
|
+
let resolvedTransition = {};
|
|
2611
|
+
if (isArray(transition)) {
|
|
2612
|
+
const picked = this.determineTransition(transition, event2);
|
|
2613
|
+
if (picked)
|
|
2614
|
+
resolvedTransition = picked;
|
|
2615
|
+
} else if (isString(transition)) {
|
|
2616
|
+
resolvedTransition = { target: transition, delay };
|
|
2617
|
+
} else {
|
|
2618
|
+
resolvedTransition = { ...transition, delay };
|
|
2619
|
+
}
|
|
2620
|
+
const actions = this.getActionFromDelayedTransition(resolvedTransition);
|
|
2621
|
+
entries.push(actions.entry);
|
|
2622
|
+
exits.push(actions.exit);
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
return { entries, exits };
|
|
2626
|
+
});
|
|
2627
|
+
__publicField(this, "executeActions", (actions, event2) => {
|
|
2628
|
+
const pickedActions = determineActionsFn(actions, this.guardMap)(this.contextSnapshot, event2, this.guardMeta);
|
|
2629
|
+
for (const action of toArray(pickedActions)) {
|
|
2630
|
+
const fn = isString(action) ? this.actionMap?.[action] : action;
|
|
2631
|
+
warn(
|
|
2632
|
+
isString(action) && !fn,
|
|
2633
|
+
`[@zag-js/core > execute-actions] No implementation found for action: \`${action}\``
|
|
2634
|
+
);
|
|
2635
|
+
fn?.(this.state.context, event2, this.meta);
|
|
2636
|
+
}
|
|
2637
|
+
});
|
|
2638
|
+
__publicField(this, "executeActivities", (event2, activities, state) => {
|
|
2639
|
+
for (const activity of activities) {
|
|
2640
|
+
const fn = isString(activity) ? this.activityMap?.[activity] : activity;
|
|
2641
|
+
if (!fn) {
|
|
2642
|
+
warn(`[@zag-js/core > execute-activity] No implementation found for activity: \`${activity}\``);
|
|
2643
|
+
continue;
|
|
2644
|
+
}
|
|
2645
|
+
const cleanup = fn(this.state.context, event2, this.meta);
|
|
2646
|
+
if (cleanup) {
|
|
2647
|
+
const key = isString(activity) ? activity : activity.name || uuid();
|
|
2648
|
+
this.addActivityCleanup(state ?? this.state.value, key, cleanup);
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
});
|
|
2652
|
+
__publicField(this, "createEveryActivities", (every, callbackfn) => {
|
|
2653
|
+
if (!every)
|
|
2654
|
+
return;
|
|
2655
|
+
const event2 = toEvent(
|
|
2656
|
+
"machine.every"
|
|
2657
|
+
/* Every */
|
|
2658
|
+
);
|
|
2659
|
+
if (isArray(every)) {
|
|
2660
|
+
const picked = toArray(every).find((transition) => {
|
|
2661
|
+
const delayOrFn = transition.delay;
|
|
2662
|
+
const determineDelay2 = determineDelayFn(delayOrFn, this.delayMap);
|
|
2663
|
+
const delay2 = determineDelay2(this.contextSnapshot, event2);
|
|
2664
|
+
const determineGuard = determineGuardFn(transition.guard, this.guardMap);
|
|
2665
|
+
const guard = determineGuard(this.contextSnapshot, event2, this.guardMeta);
|
|
2666
|
+
return guard ?? delay2 != null;
|
|
2667
|
+
});
|
|
2668
|
+
if (!picked)
|
|
2669
|
+
return;
|
|
2670
|
+
const determineDelay = determineDelayFn(picked.delay, this.delayMap);
|
|
2671
|
+
const delay = determineDelay(this.contextSnapshot, event2);
|
|
2672
|
+
const activity = () => {
|
|
2673
|
+
const id = globalThis.setInterval(() => {
|
|
2674
|
+
this.executeActions(picked.actions, event2);
|
|
2675
|
+
}, delay);
|
|
2676
|
+
return () => {
|
|
2677
|
+
globalThis.clearInterval(id);
|
|
2678
|
+
};
|
|
2679
|
+
};
|
|
2680
|
+
callbackfn(activity);
|
|
2681
|
+
} else {
|
|
2682
|
+
for (const interval in every) {
|
|
2683
|
+
const actions = every?.[interval];
|
|
2684
|
+
const determineDelay = determineDelayFn(interval, this.delayMap);
|
|
2685
|
+
const delay = determineDelay(this.contextSnapshot, event2);
|
|
2686
|
+
const activity = () => {
|
|
2687
|
+
const id = globalThis.setInterval(() => {
|
|
2688
|
+
this.executeActions(actions, event2);
|
|
2689
|
+
}, delay);
|
|
2690
|
+
return () => {
|
|
2691
|
+
globalThis.clearInterval(id);
|
|
2692
|
+
};
|
|
2693
|
+
};
|
|
2694
|
+
callbackfn(activity);
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
});
|
|
2698
|
+
__publicField(this, "setEvent", (event2) => {
|
|
2699
|
+
this.state.previousEvent = this.state.event;
|
|
2700
|
+
this.state.event = ref(toEvent(event2));
|
|
2701
|
+
});
|
|
2702
|
+
__publicField(this, "performExitEffects", (current, event2) => {
|
|
2703
|
+
const currentState = this.state.value;
|
|
2704
|
+
if (currentState === "")
|
|
2705
|
+
return;
|
|
2706
|
+
const stateNode = current ? this.getStateNode(current) : void 0;
|
|
2707
|
+
this.stopActivities(currentState);
|
|
2708
|
+
const _exit = determineActionsFn(stateNode?.exit, this.guardMap)(this.contextSnapshot, event2, this.guardMeta);
|
|
2709
|
+
const exitActions = toArray(_exit);
|
|
2710
|
+
const afterExitActions = this.delayedEvents.get(currentState);
|
|
2711
|
+
if (afterExitActions) {
|
|
2712
|
+
exitActions.push(...afterExitActions);
|
|
2713
|
+
}
|
|
2714
|
+
this.executeActions(exitActions, event2);
|
|
2715
|
+
this.eventListeners.clear();
|
|
2716
|
+
});
|
|
2717
|
+
__publicField(this, "performEntryEffects", (next, event2) => {
|
|
2718
|
+
const stateNode = this.getStateNode(next);
|
|
2719
|
+
const activities = toArray(stateNode?.activities);
|
|
2720
|
+
this.createEveryActivities(stateNode?.every, (activity) => {
|
|
2721
|
+
activities.unshift(activity);
|
|
2722
|
+
});
|
|
2723
|
+
if (activities.length > 0) {
|
|
2724
|
+
this.executeActivities(event2, activities);
|
|
2725
|
+
}
|
|
2726
|
+
const pickedActions = determineActionsFn(stateNode?.entry, this.guardMap)(
|
|
2727
|
+
this.contextSnapshot,
|
|
2728
|
+
event2,
|
|
2729
|
+
this.guardMeta
|
|
2730
|
+
);
|
|
2731
|
+
const entryActions = toArray(pickedActions);
|
|
2732
|
+
const afterActions = this.getDelayedEventActions(next);
|
|
2733
|
+
if (stateNode?.after && afterActions) {
|
|
2734
|
+
this.delayedEvents.set(next, afterActions?.exits);
|
|
2735
|
+
entryActions.push(...afterActions.entries);
|
|
2736
|
+
}
|
|
2737
|
+
this.executeActions(entryActions, event2);
|
|
2738
|
+
if (stateNode?.type === "final") {
|
|
2739
|
+
this.state.done = true;
|
|
2740
|
+
this.doneListeners.forEach((listener) => {
|
|
2741
|
+
listener(this.stateSnapshot);
|
|
2742
|
+
});
|
|
2743
|
+
this.stop();
|
|
2744
|
+
}
|
|
2745
|
+
});
|
|
2746
|
+
__publicField(this, "performTransitionEffects", (transitions, event2) => {
|
|
2747
|
+
const transition = this.determineTransition(transitions, event2);
|
|
2748
|
+
this.executeActions(transition?.actions, event2);
|
|
2749
|
+
});
|
|
2750
|
+
__publicField(this, "performStateChangeEffects", (current, next, event2) => {
|
|
2751
|
+
this.setEvent(event2);
|
|
2752
|
+
const changed = next.changed || next.reenter;
|
|
2753
|
+
if (changed) {
|
|
2754
|
+
this.performExitEffects(current, event2);
|
|
2755
|
+
}
|
|
2756
|
+
this.performTransitionEffects(next.transition, event2);
|
|
2757
|
+
this.setState(next.target);
|
|
2758
|
+
if (changed) {
|
|
2759
|
+
this.performEntryEffects(next.target, event2);
|
|
2760
|
+
}
|
|
2761
|
+
});
|
|
2762
|
+
__publicField(this, "determineTransition", (transition, event2) => {
|
|
2763
|
+
const fn = determineTransitionFn(transition, this.guardMap);
|
|
2764
|
+
return fn?.(this.contextSnapshot, event2, this.guardMeta);
|
|
2765
|
+
});
|
|
2766
|
+
__publicField(this, "sendParent", (evt) => {
|
|
2767
|
+
if (!this.parent) {
|
|
2768
|
+
invariant("[@zag-js/core > send-parent] Cannot send event to an unknown parent");
|
|
2769
|
+
}
|
|
2770
|
+
const event2 = toEvent(evt);
|
|
2771
|
+
this.parent?.send(event2);
|
|
2772
|
+
});
|
|
2773
|
+
__publicField(this, "log", (...args) => {
|
|
2774
|
+
if (isDev2() && this.options.debug) {
|
|
2775
|
+
console.log(...args);
|
|
2776
|
+
}
|
|
2777
|
+
});
|
|
2778
|
+
__publicField(this, "send", (evt) => {
|
|
2779
|
+
const event2 = toEvent(evt);
|
|
2780
|
+
this.transition(this.state.value, event2);
|
|
2781
|
+
});
|
|
2782
|
+
__publicField(this, "transition", (state, evt) => {
|
|
2783
|
+
const stateNode = isString(state) ? this.getStateNode(state) : state?.stateNode;
|
|
2784
|
+
const event2 = toEvent(evt);
|
|
2785
|
+
if (!stateNode && !this.config.on) {
|
|
2786
|
+
const msg = this.status === "Stopped" ? "[@zag-js/core > transition] Cannot transition a stopped machine" : `[@zag-js/core > transition] State does not have a definition for \`state\`: ${state}, \`event\`: ${event2.type}`;
|
|
2787
|
+
warn(msg);
|
|
2788
|
+
return;
|
|
2789
|
+
}
|
|
2790
|
+
const transitions = stateNode?.on?.[event2.type] ?? this.config.on?.[event2.type];
|
|
2791
|
+
const next = this.getNextStateInfo(transitions, event2);
|
|
2792
|
+
this.performStateChangeEffects(this.state.value, next, event2);
|
|
2793
|
+
return next.stateNode;
|
|
2794
|
+
});
|
|
2795
|
+
__publicField(this, "subscribe", (listener) => {
|
|
2796
|
+
this.stateListeners.add(listener);
|
|
2797
|
+
if (this.status === "Running") {
|
|
2798
|
+
listener(this.stateSnapshot);
|
|
2799
|
+
}
|
|
2800
|
+
return () => {
|
|
2801
|
+
this.stateListeners.delete(listener);
|
|
2802
|
+
};
|
|
2803
|
+
});
|
|
2804
|
+
__publicField(this, "onDone", (listener) => {
|
|
2805
|
+
this.doneListeners.add(listener);
|
|
2806
|
+
return this;
|
|
2807
|
+
});
|
|
2808
|
+
__publicField(this, "onTransition", (listener) => {
|
|
2809
|
+
this.stateListeners.add(listener);
|
|
2810
|
+
if (this.status === "Running") {
|
|
2811
|
+
listener(this.stateSnapshot);
|
|
2812
|
+
}
|
|
2813
|
+
return this;
|
|
2814
|
+
});
|
|
2815
|
+
__publicField(this, "onChange", (listener) => {
|
|
2816
|
+
this.contextListeners.add(listener);
|
|
2817
|
+
return this;
|
|
2818
|
+
});
|
|
2819
|
+
__publicField(this, "onEvent", (listener) => {
|
|
2820
|
+
this.eventListeners.add(listener);
|
|
2821
|
+
return this;
|
|
2822
|
+
});
|
|
2823
|
+
this.config = structuredClone(config);
|
|
2824
|
+
this.options = structuredClone(options ?? {});
|
|
2825
|
+
this.id = this.config.id ?? `machine-${uuid()}`;
|
|
2826
|
+
this.guardMap = this.options?.guards ?? {};
|
|
2827
|
+
this.actionMap = this.options?.actions ?? {};
|
|
2828
|
+
this.delayMap = this.options?.delays ?? {};
|
|
2829
|
+
this.activityMap = this.options?.activities ?? {};
|
|
2830
|
+
this.sync = this.options?.sync ?? false;
|
|
2831
|
+
this.state = createProxy(this.config);
|
|
2832
|
+
this.initialContext = snapshot(this.state.context);
|
|
2833
|
+
this.transformContext(this.state.context);
|
|
2834
|
+
const event = toEvent(
|
|
2835
|
+
"machine.created"
|
|
2836
|
+
/* Created */
|
|
2837
|
+
);
|
|
2838
|
+
this.executeActions(this.config?.created, event);
|
|
2839
|
+
}
|
|
2840
|
+
// immutable state value
|
|
2841
|
+
get stateSnapshot() {
|
|
2842
|
+
return cast(snapshot(this.state));
|
|
2843
|
+
}
|
|
2844
|
+
getState() {
|
|
2845
|
+
return this.stateSnapshot;
|
|
2846
|
+
}
|
|
2847
|
+
// immutable context value
|
|
2848
|
+
get contextSnapshot() {
|
|
2849
|
+
return this.stateSnapshot.context;
|
|
2850
|
+
}
|
|
2851
|
+
/**
|
|
2852
|
+
* A reference to the instance methods of the machine.
|
|
2853
|
+
* Useful when spawning child machines and managing the communication between them.
|
|
2854
|
+
*/
|
|
2855
|
+
get self() {
|
|
2856
|
+
const self = this;
|
|
2857
|
+
return {
|
|
2858
|
+
id: this.id,
|
|
2859
|
+
send: this.send.bind(this),
|
|
2860
|
+
sendParent: this.sendParent.bind(this),
|
|
2861
|
+
sendChild: this.sendChild.bind(this),
|
|
2862
|
+
stop: this.stop.bind(this),
|
|
2863
|
+
stopChild: this.stopChild.bind(this),
|
|
2864
|
+
spawn: this.spawn.bind(this),
|
|
2865
|
+
stopActivity: this.stopActivity.bind(this),
|
|
2866
|
+
get state() {
|
|
2867
|
+
return self.stateSnapshot;
|
|
2868
|
+
},
|
|
2869
|
+
get initialContext() {
|
|
2870
|
+
return self.initialContext;
|
|
2871
|
+
},
|
|
2872
|
+
get initialState() {
|
|
2873
|
+
return self.initialState?.target ?? "";
|
|
2874
|
+
}
|
|
2875
|
+
};
|
|
2876
|
+
}
|
|
2877
|
+
get meta() {
|
|
2878
|
+
return {
|
|
2879
|
+
state: this.stateSnapshot,
|
|
2880
|
+
guards: this.guardMap,
|
|
2881
|
+
send: this.send.bind(this),
|
|
2882
|
+
self: this.self,
|
|
2883
|
+
initialContext: this.initialContext,
|
|
2884
|
+
initialState: this.initialState?.target ?? "",
|
|
2885
|
+
getState: () => this.stateSnapshot,
|
|
2886
|
+
getAction: (key) => this.actionMap[key],
|
|
2887
|
+
getGuard: (key) => this.guardMap[key]
|
|
2888
|
+
};
|
|
2889
|
+
}
|
|
2890
|
+
get guardMeta() {
|
|
2891
|
+
return {
|
|
2892
|
+
state: this.stateSnapshot
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2895
|
+
get [Symbol.toStringTag]() {
|
|
2896
|
+
return "Machine";
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2899
|
+
var createMachine = (config, options) => new Machine(config, options);
|
|
2900
|
+
|
|
2901
|
+
// ../../node_modules/.pnpm/@zag-js+dom-event@0.19.1/node_modules/@zag-js/dom-event/dist/index.mjs
|
|
2902
|
+
var addDomEvent2 = (target, eventName, handler, options) => {
|
|
2903
|
+
const node = typeof target === "function" ? target() : target;
|
|
2904
|
+
node?.addEventListener(eventName, handler, options);
|
|
2905
|
+
return () => {
|
|
2906
|
+
node?.removeEventListener(eventName, handler, options);
|
|
2907
|
+
};
|
|
2908
|
+
};
|
|
2909
|
+
|
|
2910
|
+
// ../../node_modules/.pnpm/@zag-js+tooltip@0.19.1/node_modules/@zag-js/tooltip/dist/index.mjs
|
|
2911
|
+
var anatomy = createAnatomy("tooltip").parts("trigger", "arrow", "arrowTip", "positioner", "content");
|
|
2912
|
+
var parts = anatomy.build();
|
|
2913
|
+
var dom = createScope({
|
|
2914
|
+
getTriggerId: (ctx) => ctx.ids?.trigger ?? `tooltip:${ctx.id}:trigger`,
|
|
2915
|
+
getContentId: (ctx) => ctx.ids?.content ?? `tooltip:${ctx.id}:content`,
|
|
2916
|
+
getArrowId: (ctx) => ctx.ids?.arrow ?? `tooltip:${ctx.id}:arrow`,
|
|
2917
|
+
getPositionerId: (ctx) => ctx.ids?.positioner ?? `tooltip:${ctx.id}:popper`,
|
|
2918
|
+
getTriggerEl: (ctx) => dom.getById(ctx, dom.getTriggerId(ctx)),
|
|
2919
|
+
getContentEl: (ctx) => dom.getById(ctx, dom.getContentId(ctx)),
|
|
2920
|
+
getPositionerEl: (ctx) => dom.getById(ctx, dom.getPositionerId(ctx)),
|
|
2921
|
+
getArrowEl: (ctx) => dom.getById(ctx, dom.getArrowId(ctx)),
|
|
2922
|
+
getScrollParent: (ctx) => getScrollParent(dom.getTriggerEl(ctx))
|
|
2923
|
+
});
|
|
2924
|
+
var store = proxy({
|
|
2925
|
+
id: null,
|
|
2926
|
+
prevId: null,
|
|
2927
|
+
setId(val) {
|
|
2928
|
+
this.prevId = this.id;
|
|
2929
|
+
this.id = val;
|
|
2930
|
+
}
|
|
2931
|
+
});
|
|
2932
|
+
function connect(state, send, normalize) {
|
|
2933
|
+
const id = state.context.id;
|
|
2934
|
+
const hasAriaLabel = state.context.hasAriaLabel;
|
|
2935
|
+
const isOpen = state.hasTag("open");
|
|
2936
|
+
const triggerId = dom.getTriggerId(state.context);
|
|
2937
|
+
const contentId = dom.getContentId(state.context);
|
|
2938
|
+
const isDisabled = state.context.disabled;
|
|
2939
|
+
const popperStyles = getPlacementStyles({
|
|
2940
|
+
...state.context.positioning,
|
|
2941
|
+
placement: state.context.currentPlacement
|
|
2942
|
+
});
|
|
2943
|
+
return {
|
|
2944
|
+
isOpen,
|
|
2945
|
+
open() {
|
|
2946
|
+
send("OPEN");
|
|
2947
|
+
},
|
|
2948
|
+
close() {
|
|
2949
|
+
send("CLOSE");
|
|
2950
|
+
},
|
|
2951
|
+
setPositioning(options = {}) {
|
|
2952
|
+
send({ type: "SET_POSITIONING", options });
|
|
2953
|
+
},
|
|
2954
|
+
triggerProps: normalize.button({
|
|
2955
|
+
...parts.trigger.attrs,
|
|
2956
|
+
id: triggerId,
|
|
2957
|
+
"data-expanded": dataAttr(isOpen),
|
|
2958
|
+
"data-state": isOpen ? "open" : "closed",
|
|
2959
|
+
"aria-describedby": isOpen ? contentId : void 0,
|
|
2960
|
+
onClick() {
|
|
2961
|
+
send("CLICK");
|
|
2962
|
+
},
|
|
2963
|
+
onFocus() {
|
|
2964
|
+
if (state.event.type === "POINTER_DOWN")
|
|
2965
|
+
return;
|
|
2966
|
+
send("FOCUS");
|
|
2967
|
+
},
|
|
2968
|
+
onBlur() {
|
|
2969
|
+
if (id === store.id) {
|
|
2970
|
+
send("BLUR");
|
|
2971
|
+
}
|
|
2972
|
+
},
|
|
2973
|
+
onPointerDown() {
|
|
2974
|
+
if (isDisabled)
|
|
2975
|
+
return;
|
|
2976
|
+
if (id === store.id) {
|
|
2977
|
+
send("POINTER_DOWN");
|
|
2978
|
+
}
|
|
2979
|
+
},
|
|
2980
|
+
onPointerMove(event) {
|
|
2981
|
+
if (isDisabled || event.pointerType === "touch")
|
|
2982
|
+
return;
|
|
2983
|
+
send("POINTER_MOVE");
|
|
2984
|
+
},
|
|
2985
|
+
onPointerLeave() {
|
|
2986
|
+
if (isDisabled)
|
|
2987
|
+
return;
|
|
2988
|
+
send("POINTER_LEAVE");
|
|
2989
|
+
},
|
|
2990
|
+
onPointerCancel() {
|
|
2991
|
+
if (isDisabled)
|
|
2992
|
+
return;
|
|
2993
|
+
send("POINTER_LEAVE");
|
|
2994
|
+
}
|
|
2995
|
+
}),
|
|
2996
|
+
arrowProps: normalize.element({
|
|
2997
|
+
id: dom.getArrowId(state.context),
|
|
2998
|
+
...parts.arrow.attrs,
|
|
2999
|
+
style: popperStyles.arrow
|
|
3000
|
+
}),
|
|
3001
|
+
arrowTipProps: normalize.element({
|
|
3002
|
+
...parts.arrowTip.attrs,
|
|
3003
|
+
style: popperStyles.arrowTip
|
|
3004
|
+
}),
|
|
3005
|
+
positionerProps: normalize.element({
|
|
3006
|
+
id: dom.getPositionerId(state.context),
|
|
3007
|
+
...parts.positioner.attrs,
|
|
3008
|
+
style: popperStyles.floating
|
|
3009
|
+
}),
|
|
3010
|
+
contentProps: normalize.element({
|
|
3011
|
+
...parts.content.attrs,
|
|
3012
|
+
hidden: !isOpen,
|
|
3013
|
+
"data-state": isOpen ? "open" : "closed",
|
|
3014
|
+
role: hasAriaLabel ? void 0 : "tooltip",
|
|
3015
|
+
id: hasAriaLabel ? void 0 : contentId,
|
|
3016
|
+
"data-placement": state.context.currentPlacement,
|
|
3017
|
+
onPointerEnter() {
|
|
3018
|
+
send("CONTENT.POINTER_MOVE");
|
|
3019
|
+
},
|
|
3020
|
+
onPointerLeave() {
|
|
3021
|
+
send("CONTENT.POINTER_LEAVE");
|
|
3022
|
+
},
|
|
3023
|
+
style: {
|
|
3024
|
+
pointerEvents: state.context.interactive ? "auto" : "none"
|
|
3025
|
+
}
|
|
3026
|
+
})
|
|
3027
|
+
};
|
|
3028
|
+
}
|
|
3029
|
+
var { and: and2, not: not2 } = guards;
|
|
3030
|
+
function machine(userContext) {
|
|
3031
|
+
const ctx = compact(userContext);
|
|
3032
|
+
return createMachine(
|
|
3033
|
+
{
|
|
3034
|
+
id: "tooltip",
|
|
3035
|
+
initial: "closed",
|
|
3036
|
+
context: {
|
|
3037
|
+
openDelay: 1e3,
|
|
3038
|
+
closeDelay: 500,
|
|
3039
|
+
closeOnPointerDown: true,
|
|
3040
|
+
closeOnEsc: true,
|
|
3041
|
+
interactive: true,
|
|
3042
|
+
currentPlacement: void 0,
|
|
3043
|
+
...ctx,
|
|
3044
|
+
hasPointerMoveOpened: false,
|
|
3045
|
+
positioning: {
|
|
3046
|
+
placement: "bottom",
|
|
3047
|
+
...ctx.positioning
|
|
3048
|
+
}
|
|
3049
|
+
},
|
|
3050
|
+
computed: {
|
|
3051
|
+
hasAriaLabel: (ctx2) => !!ctx2["aria-label"]
|
|
3052
|
+
},
|
|
3053
|
+
watch: {
|
|
3054
|
+
disabled: ["closeIfDisabled"],
|
|
3055
|
+
open: ["toggleVisibility"]
|
|
3056
|
+
},
|
|
3057
|
+
on: {
|
|
3058
|
+
OPEN: "open",
|
|
3059
|
+
CLOSE: "closed"
|
|
3060
|
+
},
|
|
3061
|
+
states: {
|
|
3062
|
+
closed: {
|
|
3063
|
+
tags: ["closed"],
|
|
3064
|
+
entry: ["clearGlobalId", "invokeOnClose"],
|
|
3065
|
+
on: {
|
|
3066
|
+
FOCUS: "open",
|
|
3067
|
+
POINTER_LEAVE: {
|
|
3068
|
+
actions: ["clearPointerMoveOpened"]
|
|
3069
|
+
},
|
|
3070
|
+
POINTER_MOVE: [
|
|
3071
|
+
{
|
|
3072
|
+
guard: and2("noVisibleTooltip", not2("hasPointerMoveOpened")),
|
|
3073
|
+
target: "opening"
|
|
3074
|
+
},
|
|
3075
|
+
{
|
|
3076
|
+
guard: not2("hasPointerMoveOpened"),
|
|
3077
|
+
target: "open",
|
|
3078
|
+
actions: ["setPointerMoveOpened"]
|
|
3079
|
+
}
|
|
3080
|
+
]
|
|
3081
|
+
}
|
|
3082
|
+
},
|
|
3083
|
+
opening: {
|
|
3084
|
+
tags: ["closed"],
|
|
3085
|
+
activities: ["trackScroll", "trackPointerlockChange"],
|
|
3086
|
+
after: {
|
|
3087
|
+
OPEN_DELAY: {
|
|
3088
|
+
target: "open",
|
|
3089
|
+
actions: ["setPointerMoveOpened"]
|
|
3090
|
+
}
|
|
3091
|
+
},
|
|
3092
|
+
on: {
|
|
3093
|
+
POINTER_LEAVE: {
|
|
3094
|
+
target: "closed",
|
|
3095
|
+
actions: ["clearPointerMoveOpened"]
|
|
3096
|
+
},
|
|
3097
|
+
BLUR: "closed",
|
|
3098
|
+
SCROLL: "closed",
|
|
3099
|
+
POINTER_LOCK_CHANGE: "closed",
|
|
3100
|
+
POINTER_DOWN: {
|
|
3101
|
+
guard: "closeOnPointerDown",
|
|
3102
|
+
target: "closed"
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
},
|
|
3106
|
+
open: {
|
|
3107
|
+
tags: ["open"],
|
|
3108
|
+
activities: [
|
|
3109
|
+
"trackEscapeKey",
|
|
3110
|
+
"trackDisabledTriggerOnSafari",
|
|
3111
|
+
"trackScroll",
|
|
3112
|
+
"trackPointerlockChange",
|
|
3113
|
+
"trackPositioning"
|
|
3114
|
+
],
|
|
3115
|
+
entry: ["setGlobalId", "invokeOnOpen"],
|
|
3116
|
+
on: {
|
|
3117
|
+
POINTER_LEAVE: [
|
|
3118
|
+
{
|
|
3119
|
+
guard: "isVisible",
|
|
3120
|
+
target: "closing",
|
|
3121
|
+
actions: ["clearPointerMoveOpened"]
|
|
3122
|
+
},
|
|
3123
|
+
{
|
|
3124
|
+
target: "closed",
|
|
3125
|
+
actions: ["clearPointerMoveOpened"]
|
|
3126
|
+
}
|
|
3127
|
+
],
|
|
3128
|
+
BLUR: "closed",
|
|
3129
|
+
ESCAPE: "closed",
|
|
3130
|
+
SCROLL: "closed",
|
|
3131
|
+
POINTER_LOCK_CHANGE: "closed",
|
|
3132
|
+
"CONTENT.POINTER_LEAVE": {
|
|
3133
|
+
guard: "isInteractive",
|
|
3134
|
+
target: "closing"
|
|
3135
|
+
},
|
|
3136
|
+
POINTER_DOWN: {
|
|
3137
|
+
guard: "closeOnPointerDown",
|
|
3138
|
+
target: "closed"
|
|
3139
|
+
},
|
|
3140
|
+
CLICK: "closed",
|
|
3141
|
+
SET_POSITIONING: {
|
|
3142
|
+
actions: "setPositioning"
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
},
|
|
3146
|
+
closing: {
|
|
3147
|
+
tags: ["open"],
|
|
3148
|
+
activities: ["trackStore", "trackPositioning"],
|
|
3149
|
+
after: {
|
|
3150
|
+
CLOSE_DELAY: "closed"
|
|
3151
|
+
},
|
|
3152
|
+
on: {
|
|
3153
|
+
FORCE_CLOSE: "closed",
|
|
3154
|
+
POINTER_MOVE: {
|
|
3155
|
+
target: "open",
|
|
3156
|
+
actions: ["setPointerMoveOpened"]
|
|
3157
|
+
},
|
|
3158
|
+
"CONTENT.POINTER_MOVE": {
|
|
3159
|
+
guard: "isInteractive",
|
|
3160
|
+
target: "open"
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
},
|
|
3166
|
+
{
|
|
3167
|
+
activities: {
|
|
3168
|
+
trackPositioning(ctx2) {
|
|
3169
|
+
ctx2.currentPlacement = ctx2.positioning.placement;
|
|
3170
|
+
const getPositionerEl = () => dom.getPositionerEl(ctx2);
|
|
3171
|
+
return getPlacement(dom.getTriggerEl(ctx2), getPositionerEl, {
|
|
3172
|
+
...ctx2.positioning,
|
|
3173
|
+
defer: true,
|
|
3174
|
+
onComplete(data) {
|
|
3175
|
+
ctx2.currentPlacement = data.placement;
|
|
3176
|
+
},
|
|
3177
|
+
onCleanup() {
|
|
3178
|
+
ctx2.currentPlacement = void 0;
|
|
3179
|
+
}
|
|
3180
|
+
});
|
|
3181
|
+
},
|
|
3182
|
+
trackPointerlockChange(ctx2, _evt, { send }) {
|
|
3183
|
+
const onChange = () => send("POINTER_LOCK_CHANGE");
|
|
3184
|
+
return addDomEvent2(dom.getDoc(ctx2), "pointerlockchange", onChange, false);
|
|
3185
|
+
},
|
|
3186
|
+
trackScroll(ctx2, _evt, { send }) {
|
|
3187
|
+
const trigger = dom.getTriggerEl(ctx2);
|
|
3188
|
+
if (!trigger)
|
|
3189
|
+
return;
|
|
3190
|
+
const cleanups = getScrollParents(trigger).map((el) => {
|
|
3191
|
+
const opts = { passive: true, capture: true };
|
|
3192
|
+
return addDomEvent2(el, "scroll", () => send("SCROLL"), opts);
|
|
3193
|
+
});
|
|
3194
|
+
return () => {
|
|
3195
|
+
cleanups.forEach((fn) => fn?.());
|
|
3196
|
+
};
|
|
3197
|
+
},
|
|
3198
|
+
trackStore(ctx2, _evt, { send }) {
|
|
3199
|
+
return subscribe(store, () => {
|
|
3200
|
+
if (store.id !== ctx2.id) {
|
|
3201
|
+
send("FORCE_CLOSE");
|
|
3202
|
+
}
|
|
3203
|
+
});
|
|
3204
|
+
},
|
|
3205
|
+
trackDisabledTriggerOnSafari(ctx2, _evt, { send }) {
|
|
3206
|
+
if (!isSafari())
|
|
3207
|
+
return;
|
|
3208
|
+
const doc = dom.getDoc(ctx2);
|
|
3209
|
+
return addDomEvent2(doc, "pointermove", (event) => {
|
|
3210
|
+
const selector = "[data-part=trigger][data-expanded]";
|
|
3211
|
+
if (isHTMLElement(event.target) && event.target.closest(selector))
|
|
3212
|
+
return;
|
|
3213
|
+
send("POINTER_LEAVE");
|
|
3214
|
+
});
|
|
3215
|
+
},
|
|
3216
|
+
trackEscapeKey(ctx2, _evt, { send }) {
|
|
3217
|
+
if (!ctx2.closeOnEsc)
|
|
3218
|
+
return;
|
|
3219
|
+
const doc = dom.getDoc(ctx2);
|
|
3220
|
+
return addDomEvent2(doc, "keydown", (event) => {
|
|
3221
|
+
if (event.key === "Escape") {
|
|
3222
|
+
send("ESCAPE");
|
|
3223
|
+
}
|
|
3224
|
+
});
|
|
3225
|
+
}
|
|
3226
|
+
},
|
|
3227
|
+
actions: {
|
|
3228
|
+
setGlobalId(ctx2) {
|
|
3229
|
+
store.setId(ctx2.id);
|
|
3230
|
+
},
|
|
3231
|
+
clearGlobalId(ctx2) {
|
|
3232
|
+
if (ctx2.id === store.id) {
|
|
3233
|
+
store.setId(null);
|
|
3234
|
+
}
|
|
3235
|
+
},
|
|
3236
|
+
invokeOnOpen(ctx2, evt) {
|
|
3237
|
+
const omit = ["CONTENT.POINTER_MOVE", "POINTER_MOVE"];
|
|
3238
|
+
if (!omit.includes(evt.type)) {
|
|
3239
|
+
ctx2.onOpen?.();
|
|
3240
|
+
}
|
|
3241
|
+
},
|
|
3242
|
+
invokeOnClose(ctx2) {
|
|
3243
|
+
ctx2.onClose?.();
|
|
3244
|
+
},
|
|
3245
|
+
closeIfDisabled(ctx2, _evt, { send }) {
|
|
3246
|
+
if (!ctx2.disabled)
|
|
3247
|
+
return;
|
|
3248
|
+
send("CLOSE");
|
|
3249
|
+
},
|
|
3250
|
+
setPositioning(ctx2, evt) {
|
|
3251
|
+
const getPositionerEl = () => dom.getPositionerEl(ctx2);
|
|
3252
|
+
getPlacement(dom.getTriggerEl(ctx2), getPositionerEl, {
|
|
3253
|
+
...ctx2.positioning,
|
|
3254
|
+
...evt.options,
|
|
3255
|
+
defer: true,
|
|
3256
|
+
listeners: false
|
|
3257
|
+
});
|
|
3258
|
+
},
|
|
3259
|
+
toggleVisibility(ctx2, _evt, { send }) {
|
|
3260
|
+
send({ type: ctx2.open ? "OPEN" : "CLOSE", src: "controlled" });
|
|
3261
|
+
},
|
|
3262
|
+
setPointerMoveOpened(ctx2) {
|
|
3263
|
+
ctx2.hasPointerMoveOpened = true;
|
|
3264
|
+
},
|
|
3265
|
+
clearPointerMoveOpened(ctx2) {
|
|
3266
|
+
ctx2.hasPointerMoveOpened = false;
|
|
3267
|
+
}
|
|
3268
|
+
},
|
|
3269
|
+
guards: {
|
|
3270
|
+
closeOnPointerDown: (ctx2) => ctx2.closeOnPointerDown,
|
|
3271
|
+
noVisibleTooltip: () => store.id === null,
|
|
3272
|
+
isVisible: (ctx2) => ctx2.id === store.id,
|
|
3273
|
+
isInteractive: (ctx2) => ctx2.interactive,
|
|
3274
|
+
hasPointerMoveOpened: (ctx2) => !!ctx2.hasPointerMoveOpened
|
|
3275
|
+
},
|
|
3276
|
+
delays: {
|
|
3277
|
+
OPEN_DELAY: (ctx2) => ctx2.openDelay,
|
|
3278
|
+
CLOSE_DELAY: (ctx2) => ctx2.closeDelay
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
);
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
// ../../node_modules/.pnpm/@zag-js+types@0.19.1/node_modules/@zag-js/types/dist/index.mjs
|
|
3285
|
+
function createNormalizer(fn) {
|
|
3286
|
+
return new Proxy({}, {
|
|
3287
|
+
get() {
|
|
3288
|
+
return fn;
|
|
3289
|
+
}
|
|
3290
|
+
});
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
// ../../node_modules/.pnpm/@zag-js+react@0.19.1_react-dom@18.2.0_react@18.2.0/node_modules/@zag-js/react/dist/index.mjs
|
|
3294
|
+
import { createElement, useReducer, useRef } from "react";
|
|
3295
|
+
import { createPortal } from "react-dom";
|
|
3296
|
+
import { useEffect, useLayoutEffect } from "react";
|
|
3297
|
+
import ReactExports, { useCallback, useEffect as useEffect2, useMemo, useRef as useRef2, useSyncExternalStore } from "react";
|
|
3298
|
+
import { useRef as useRef3 } from "react";
|
|
3299
|
+
var normalizeProps = createNormalizer((v) => v);
|
|
3300
|
+
var useSafeLayoutEffect = typeof document !== "undefined" ? useLayoutEffect : useEffect;
|
|
3301
|
+
var { use } = ReactExports;
|
|
3302
|
+
var targetCache = /* @__PURE__ */ new WeakMap();
|
|
3303
|
+
function useSnapshot(proxyObject, options) {
|
|
3304
|
+
const notifyInSync = options?.sync;
|
|
3305
|
+
const lastSnapshot = useRef2();
|
|
3306
|
+
const lastAffected = useRef2();
|
|
3307
|
+
const currSnapshot = useSyncExternalStore(
|
|
3308
|
+
useCallback(
|
|
3309
|
+
(callback) => {
|
|
3310
|
+
const unsub = subscribe(proxyObject, callback, notifyInSync);
|
|
3311
|
+
callback();
|
|
3312
|
+
return unsub;
|
|
3313
|
+
},
|
|
3314
|
+
[proxyObject, notifyInSync]
|
|
3315
|
+
),
|
|
3316
|
+
() => {
|
|
3317
|
+
const nextSnapshot = snapshot(proxyObject, use);
|
|
3318
|
+
try {
|
|
3319
|
+
if (lastSnapshot.current && lastAffected.current && !p(lastSnapshot.current, nextSnapshot, lastAffected.current, /* @__PURE__ */ new WeakMap())) {
|
|
3320
|
+
return lastSnapshot.current;
|
|
3321
|
+
}
|
|
3322
|
+
} catch (e2) {
|
|
3323
|
+
}
|
|
3324
|
+
return nextSnapshot;
|
|
3325
|
+
},
|
|
3326
|
+
() => snapshot(proxyObject, use)
|
|
3327
|
+
);
|
|
3328
|
+
const currAffected = /* @__PURE__ */ new WeakMap();
|
|
3329
|
+
useEffect2(() => {
|
|
3330
|
+
lastSnapshot.current = currSnapshot;
|
|
3331
|
+
lastAffected.current = currAffected;
|
|
3332
|
+
});
|
|
3333
|
+
const proxyCache = useMemo(() => /* @__PURE__ */ new WeakMap(), []);
|
|
3334
|
+
return a(currSnapshot, currAffected, proxyCache, targetCache);
|
|
3335
|
+
}
|
|
3336
|
+
function useConstant(fn) {
|
|
3337
|
+
const ref2 = useRef3();
|
|
3338
|
+
if (!ref2.current)
|
|
3339
|
+
ref2.current = { v: fn() };
|
|
3340
|
+
return ref2.current.v;
|
|
3341
|
+
}
|
|
3342
|
+
function useService(machine2, options) {
|
|
3343
|
+
const { actions, state: hydratedState, context } = options ?? {};
|
|
3344
|
+
const service = useConstant(() => {
|
|
3345
|
+
const instance = typeof machine2 === "function" ? machine2() : machine2;
|
|
3346
|
+
return context ? instance.withContext(context) : instance;
|
|
3347
|
+
});
|
|
3348
|
+
useSafeLayoutEffect(() => {
|
|
3349
|
+
service.start(hydratedState);
|
|
3350
|
+
if (service.state.can("SETUP")) {
|
|
3351
|
+
service.send("SETUP");
|
|
3352
|
+
}
|
|
3353
|
+
return () => {
|
|
3354
|
+
service.stop();
|
|
3355
|
+
};
|
|
3356
|
+
}, []);
|
|
3357
|
+
service.setOptions({ actions });
|
|
3358
|
+
service.setContext(context);
|
|
3359
|
+
return service;
|
|
3360
|
+
}
|
|
3361
|
+
function useMachine(machine2, options) {
|
|
3362
|
+
const service = useService(machine2, options);
|
|
3363
|
+
const state = useSnapshot(service.state);
|
|
3364
|
+
const typedState = state;
|
|
3365
|
+
return [typedState, service.send, service];
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3368
|
+
// ../../node_modules/.pnpm/@cfx-kit+ui-components@0.0.17_@zag-js+accordion@0.19.1_@zag-js+checkbox@0.19.1_@zag-js+dialog_fmko2yy6bkfybbxu2fwkms7fpm/node_modules/@cfx-kit/ui-components/dist/Tooltip.js
|
|
3369
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3370
|
+
var Tooltip = (_a) => {
|
|
3371
|
+
var _b = _a, {
|
|
3372
|
+
id,
|
|
3373
|
+
open = false,
|
|
3374
|
+
openDelay = 200,
|
|
3375
|
+
closeDelay = 200,
|
|
3376
|
+
arrow: arrow2 = true,
|
|
3377
|
+
positioning,
|
|
3378
|
+
children,
|
|
3379
|
+
containerClassName,
|
|
3380
|
+
trigger
|
|
3381
|
+
} = _b, props = __objRest(_b, [
|
|
3382
|
+
"id",
|
|
3383
|
+
"open",
|
|
3384
|
+
"openDelay",
|
|
3385
|
+
"closeDelay",
|
|
3386
|
+
"arrow",
|
|
3387
|
+
"positioning",
|
|
3388
|
+
"children",
|
|
3389
|
+
"containerClassName",
|
|
3390
|
+
"trigger"
|
|
3391
|
+
]);
|
|
3392
|
+
const uniqueId = useId();
|
|
3393
|
+
const [state, send] = useMachine(machine(__spreadValues({ id: id != null ? id : uniqueId, openDelay, closeDelay, positioning }, props)));
|
|
3394
|
+
const api = connect(state, send, normalizeProps);
|
|
3395
|
+
useEffect3(() => {
|
|
3396
|
+
if (open === true) {
|
|
3397
|
+
api.open();
|
|
3398
|
+
} else {
|
|
3399
|
+
api.close();
|
|
3400
|
+
}
|
|
3401
|
+
}, [open]);
|
|
3402
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3403
|
+
typeof trigger === "function" ? trigger({ triggerProps: api.triggerProps }) : null,
|
|
3404
|
+
api.isOpen && /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({ className: `ui-tooltip${containerClassName ? ` ${containerClassName}` : ""}` }, api.positionerProps), { children: [
|
|
3405
|
+
arrow2 && /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({}, api.arrowProps), { children: /* @__PURE__ */ jsx("div", __spreadValues({}, api.arrowTipProps)) })),
|
|
3406
|
+
typeof children === "function" && children({ contentProps: api.contentProps }),
|
|
3407
|
+
typeof children !== "function" ? Children.count(children) === 1 && isValidElement(children) ? cloneElement(children, __spreadValues({}, api.contentProps)) : /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({}, api.contentProps), { children })) : null
|
|
3408
|
+
] }))
|
|
3409
|
+
] });
|
|
3410
|
+
};
|
|
3411
|
+
var Tooltip_default = Tooltip;
|
|
3412
|
+
|
|
3413
|
+
// src/components/Tooltip/index.tsx
|
|
3414
|
+
import clsx from "clsx";
|
|
3415
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
3416
|
+
var Tooltip2 = ({
|
|
3417
|
+
title,
|
|
3418
|
+
children = null,
|
|
3419
|
+
positioning = {},
|
|
3420
|
+
triggerProps: _triggerProps = {},
|
|
3421
|
+
...rest
|
|
3422
|
+
}) => {
|
|
3423
|
+
const { placement = "top" } = positioning;
|
|
3424
|
+
return /* @__PURE__ */ jsx2(
|
|
3425
|
+
Tooltip_default,
|
|
3426
|
+
{
|
|
3427
|
+
trigger: ({ triggerProps }) => {
|
|
3428
|
+
if (Children2.count(children) === 1 && isValidElement2(children)) {
|
|
3429
|
+
delete triggerProps.onClick;
|
|
3430
|
+
return cloneElement2(children, {
|
|
3431
|
+
...triggerProps,
|
|
3432
|
+
...children.props,
|
|
3433
|
+
..._triggerProps
|
|
3434
|
+
});
|
|
3435
|
+
} else {
|
|
3436
|
+
return /* @__PURE__ */ jsx2("span", { ...triggerProps, ..._triggerProps, children });
|
|
3437
|
+
}
|
|
3438
|
+
},
|
|
3439
|
+
containerClassName: clsx(
|
|
3440
|
+
"sirius-next-tooltip",
|
|
3441
|
+
"lh-normal max-w-250px z-1000 w-max min-w-unset!",
|
|
3442
|
+
"all-[a]:text-[var(--theme-color-blue0)] all-[a:hover]:text-[var(--theme-color-blue2)]",
|
|
3443
|
+
"[&.ui-tooltip>[data-part=arrow]]:[--arrow-size:6px] [&.ui-tooltip>[data-part=arrow]]:[--arrow-background:#333]"
|
|
3444
|
+
),
|
|
3445
|
+
openDelay: 0,
|
|
3446
|
+
...rest,
|
|
3447
|
+
positioning: {
|
|
3448
|
+
...positioning,
|
|
3449
|
+
placement
|
|
3450
|
+
},
|
|
3451
|
+
children: /* @__PURE__ */ jsx2("div", { className: "px-8px py-6px text-12px text-#fff text-left shadow break-words ws-normal bg-#333 min-w-30px min-h-32px decoration-none rounded-2px", children: title })
|
|
3452
|
+
}
|
|
3453
|
+
);
|
|
3454
|
+
};
|
|
3455
|
+
|
|
3456
|
+
export {
|
|
3457
|
+
Tooltip2 as Tooltip
|
|
3458
|
+
};
|
|
3459
|
+
//# sourceMappingURL=chunk-IB7T4CUM.js.map
|