@cfxjs/sirius-next-common 0.1.30 → 0.1.31
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/chunk-2AC7ZHUZ.js +108 -0
- package/dist/chunk-2AC7ZHUZ.js.map +1 -0
- package/dist/chunk-2AR6AKBW.js +108 -0
- package/dist/chunk-2AR6AKBW.js.map +1 -0
- package/dist/chunk-2B37TI7M.js +3629 -0
- package/dist/chunk-2B37TI7M.js.map +1 -0
- package/dist/chunk-2DQS237U.js +49 -0
- package/dist/chunk-2DQS237U.js.map +1 -0
- package/dist/chunk-2E3ZQNAA.js +105 -0
- package/dist/chunk-2E3ZQNAA.js.map +1 -0
- package/dist/chunk-2FQTYXCR.js +150 -0
- package/dist/chunk-2FQTYXCR.js.map +1 -0
- package/dist/chunk-2JSETNZP.js +49 -0
- package/dist/chunk-2JSETNZP.js.map +1 -0
- package/dist/chunk-2PCFNEA6.js +758 -0
- package/dist/chunk-2PCFNEA6.js.map +1 -0
- package/dist/chunk-2T22R5RC.js +150 -0
- package/dist/chunk-2T22R5RC.js.map +1 -0
- package/dist/chunk-2WIJJYAY.js +49 -0
- package/dist/chunk-2WIJJYAY.js.map +1 -0
- package/dist/chunk-2YQ5ZVQZ.js +127 -0
- package/dist/chunk-2YQ5ZVQZ.js.map +1 -0
- package/dist/chunk-37UXSSTW.js +108 -0
- package/dist/chunk-37UXSSTW.js.map +1 -0
- package/dist/chunk-3CALPBQ7.js +127 -0
- package/dist/chunk-3CALPBQ7.js.map +1 -0
- package/dist/chunk-3CH6GOE2.js +2324 -0
- package/dist/chunk-3CH6GOE2.js.map +1 -0
- package/dist/chunk-3DCEGH44.js +49 -0
- package/dist/chunk-3DCEGH44.js.map +1 -0
- package/dist/chunk-3TZYM3XB.js +2324 -0
- package/dist/chunk-3TZYM3XB.js.map +1 -0
- package/dist/chunk-3UOYXVKY.js +108 -0
- package/dist/chunk-3UOYXVKY.js.map +1 -0
- package/dist/chunk-3UQ7FBUS.js +212 -0
- package/dist/chunk-3UQ7FBUS.js.map +1 -0
- package/dist/chunk-3UQICWAL.js +2324 -0
- package/dist/chunk-3UQICWAL.js.map +1 -0
- package/dist/chunk-3UXPRBHP.js +63 -0
- package/dist/chunk-3UXPRBHP.js.map +1 -0
- package/dist/chunk-42BUQGDH.js +49 -0
- package/dist/chunk-42BUQGDH.js.map +1 -0
- package/dist/chunk-4CS4RZGM.js +105 -0
- package/dist/chunk-4CS4RZGM.js.map +1 -0
- package/dist/chunk-4EPLPSHC.js +141 -0
- package/dist/chunk-4EPLPSHC.js.map +1 -0
- package/dist/chunk-4FTKGTEQ.js +37 -0
- package/dist/chunk-4FTKGTEQ.js.map +1 -0
- package/dist/chunk-4HUVV4G4.js +1061 -0
- package/dist/chunk-4HUVV4G4.js.map +1 -0
- package/dist/chunk-4MRRABBI.js +108 -0
- package/dist/chunk-4MRRABBI.js.map +1 -0
- package/dist/chunk-4OD66DPK.js +127 -0
- package/dist/chunk-4OD66DPK.js.map +1 -0
- package/dist/chunk-4QAAXRTS.js +150 -0
- package/dist/chunk-4QAAXRTS.js.map +1 -0
- package/dist/chunk-4R3OW4WV.js +49 -0
- package/dist/chunk-4R3OW4WV.js.map +1 -0
- package/dist/chunk-4XGAQWSW.js +141 -0
- package/dist/chunk-4XGAQWSW.js.map +1 -0
- package/dist/chunk-56NGLTES.js +269 -0
- package/dist/chunk-56NGLTES.js.map +1 -0
- package/dist/chunk-5AT5ED4C.js +108 -0
- package/dist/chunk-5AT5ED4C.js.map +1 -0
- package/dist/chunk-5AWTR6YM.js +108 -0
- package/dist/chunk-5AWTR6YM.js.map +1 -0
- package/dist/chunk-5AZJKXQ3.js +212 -0
- package/dist/chunk-5AZJKXQ3.js.map +1 -0
- package/dist/chunk-5BPADY7H.js +108 -0
- package/dist/chunk-5BPADY7H.js.map +1 -0
- package/dist/chunk-5D2YCZH7.js +105 -0
- package/dist/chunk-5D2YCZH7.js.map +1 -0
- package/dist/chunk-5DCCPEBX.js +767 -0
- package/dist/chunk-5DCCPEBX.js.map +1 -0
- package/dist/chunk-5ETS67V7.js +105 -0
- package/dist/chunk-5ETS67V7.js.map +1 -0
- package/dist/chunk-5FAB2ET6.js +3629 -0
- package/dist/chunk-5FAB2ET6.js.map +1 -0
- package/dist/chunk-5GQIFO2C.js +37 -0
- package/dist/chunk-5GQIFO2C.js.map +1 -0
- package/dist/chunk-5LTSU66H.js +108 -0
- package/dist/chunk-5LTSU66H.js.map +1 -0
- package/dist/chunk-5NECIPUD.js +778 -0
- package/dist/chunk-5NECIPUD.js.map +1 -0
- package/dist/chunk-5UK3W5WD.js +2324 -0
- package/dist/chunk-5UK3W5WD.js.map +1 -0
- package/dist/chunk-5XWKWJAD.js +770 -0
- package/dist/chunk-5XWKWJAD.js.map +1 -0
- package/dist/chunk-63UNTPFL.js +37 -0
- package/dist/chunk-63UNTPFL.js.map +1 -0
- package/dist/chunk-643S7PF2.js +2324 -0
- package/dist/chunk-643S7PF2.js.map +1 -0
- package/dist/chunk-65TNN5BV.js +269 -0
- package/dist/chunk-65TNN5BV.js.map +1 -0
- package/dist/chunk-6BTRTTKV.js +49 -0
- package/dist/chunk-6BTRTTKV.js.map +1 -0
- package/dist/chunk-6DIZXRIZ.js +105 -0
- package/dist/chunk-6DIZXRIZ.js.map +1 -0
- package/dist/chunk-6GMQDV7F.js +2324 -0
- package/dist/chunk-6GMQDV7F.js.map +1 -0
- package/dist/chunk-6JT6D6UK.js +3629 -0
- package/dist/chunk-6JT6D6UK.js.map +1 -0
- package/dist/chunk-6KRFZ7DC.js +150 -0
- package/dist/chunk-6KRFZ7DC.js.map +1 -0
- package/dist/chunk-6LBN5Q46.js +127 -0
- package/dist/chunk-6LBN5Q46.js.map +1 -0
- package/dist/chunk-6ROOQJXE.js +2296 -0
- package/dist/chunk-6ROOQJXE.js.map +1 -0
- package/dist/chunk-6SNDJZIT.js +2324 -0
- package/dist/chunk-6SNDJZIT.js.map +1 -0
- package/dist/chunk-73J2LHWW.js +766 -0
- package/dist/chunk-73J2LHWW.js.map +1 -0
- package/dist/chunk-77N7DIV5.js +141 -0
- package/dist/chunk-77N7DIV5.js.map +1 -0
- package/dist/chunk-7EYW7NOW.js +49 -0
- package/dist/chunk-7EYW7NOW.js.map +1 -0
- package/dist/chunk-7IMRPA27.js +212 -0
- package/dist/chunk-7IMRPA27.js.map +1 -0
- package/dist/chunk-7P6QXR7Q.js +3629 -0
- package/dist/chunk-7P6QXR7Q.js.map +1 -0
- package/dist/chunk-7SNG5Q6N.js +108 -0
- package/dist/chunk-7SNG5Q6N.js.map +1 -0
- package/dist/chunk-7TUXGBWA.js +2324 -0
- package/dist/chunk-7TUXGBWA.js.map +1 -0
- package/dist/chunk-7TYFPXZM.js +127 -0
- package/dist/chunk-7TYFPXZM.js.map +1 -0
- package/dist/chunk-7YNSLQRX.js +105 -0
- package/dist/chunk-7YNSLQRX.js.map +1 -0
- package/dist/chunk-7Z5TESDO.js +2324 -0
- package/dist/chunk-7Z5TESDO.js.map +1 -0
- package/dist/chunk-A4RC4XI2.js +127 -0
- package/dist/chunk-A4RC4XI2.js.map +1 -0
- package/dist/chunk-ABOE4BMS.js +2297 -0
- package/dist/chunk-ABOE4BMS.js.map +1 -0
- package/dist/chunk-ACXJX26I.js +105 -0
- package/dist/chunk-ACXJX26I.js.map +1 -0
- package/dist/chunk-AOM2U3NI.js +127 -0
- package/dist/chunk-AOM2U3NI.js.map +1 -0
- package/dist/chunk-ARFU4MVK.js +105 -0
- package/dist/chunk-ARFU4MVK.js.map +1 -0
- package/dist/chunk-AV36QWLU.js +150 -0
- package/dist/chunk-AV36QWLU.js.map +1 -0
- package/dist/chunk-AWMDMCWK.js +49 -0
- package/dist/chunk-AWMDMCWK.js.map +1 -0
- package/dist/chunk-AWY3VNHP.js +3629 -0
- package/dist/chunk-AWY3VNHP.js.map +1 -0
- package/dist/chunk-AXJFKTN3.js +37 -0
- package/dist/chunk-AXJFKTN3.js.map +1 -0
- package/dist/chunk-AXUVM4JN.js +212 -0
- package/dist/chunk-AXUVM4JN.js.map +1 -0
- package/dist/chunk-AYQBPPP3.js +108 -0
- package/dist/chunk-AYQBPPP3.js.map +1 -0
- package/dist/chunk-B7XL2T2N.js +212 -0
- package/dist/chunk-B7XL2T2N.js.map +1 -0
- package/dist/chunk-BAGS2LKM.js +3629 -0
- package/dist/chunk-BAGS2LKM.js.map +1 -0
- package/dist/chunk-BBOUMR6V.js +49 -0
- package/dist/chunk-BBOUMR6V.js.map +1 -0
- package/dist/chunk-BFETX63Y.js +49 -0
- package/dist/chunk-BFETX63Y.js.map +1 -0
- package/dist/chunk-BFQR73CA.js +105 -0
- package/dist/chunk-BFQR73CA.js.map +1 -0
- package/dist/chunk-BK2MPMVQ.js +127 -0
- package/dist/chunk-BK2MPMVQ.js.map +1 -0
- package/dist/chunk-BKGE22HP.js +212 -0
- package/dist/chunk-BKGE22HP.js.map +1 -0
- package/dist/chunk-BM5CLWX2.js +150 -0
- package/dist/chunk-BM5CLWX2.js.map +1 -0
- package/dist/chunk-BME5LRGA.js +127 -0
- package/dist/chunk-BME5LRGA.js.map +1 -0
- package/dist/chunk-BMKWV6MT.js +150 -0
- package/dist/chunk-BMKWV6MT.js.map +1 -0
- package/dist/chunk-BR4RAVX2.js +108 -0
- package/dist/chunk-BR4RAVX2.js.map +1 -0
- package/dist/chunk-BS7B3EMS.js +108 -0
- package/dist/chunk-BS7B3EMS.js.map +1 -0
- package/dist/chunk-BSRSPJFJ.js +141 -0
- package/dist/chunk-BSRSPJFJ.js.map +1 -0
- package/dist/chunk-BWIZHOI2.js +49 -0
- package/dist/chunk-BWIZHOI2.js.map +1 -0
- package/dist/chunk-BZCTGGQY.js +127 -0
- package/dist/chunk-BZCTGGQY.js.map +1 -0
- package/dist/chunk-CBLGE6Z2.js +779 -0
- package/dist/chunk-CBLGE6Z2.js.map +1 -0
- package/dist/chunk-CLRYFOV5.js +141 -0
- package/dist/chunk-CLRYFOV5.js.map +1 -0
- package/dist/chunk-COVHTUVF.js +212 -0
- package/dist/chunk-COVHTUVF.js.map +1 -0
- package/dist/chunk-CPLGWDEN.js +49 -0
- package/dist/chunk-CPLGWDEN.js.map +1 -0
- package/dist/chunk-CS2I5M4S.js +105 -0
- package/dist/chunk-CS2I5M4S.js.map +1 -0
- package/dist/chunk-CWKNCI2W.js +127 -0
- package/dist/chunk-CWKNCI2W.js.map +1 -0
- package/dist/chunk-DAJGXKHR.js +150 -0
- package/dist/chunk-DAJGXKHR.js.map +1 -0
- package/dist/chunk-DKGHVKPK.js +212 -0
- package/dist/chunk-DKGHVKPK.js.map +1 -0
- package/dist/chunk-DNU5RBHH.js +141 -0
- package/dist/chunk-DNU5RBHH.js.map +1 -0
- package/dist/chunk-DRC2C2XE.js +127 -0
- package/dist/chunk-DRC2C2XE.js.map +1 -0
- package/dist/chunk-E5A5UOS7.js +105 -0
- package/dist/chunk-E5A5UOS7.js.map +1 -0
- package/dist/chunk-E7DZJYTC.js +105 -0
- package/dist/chunk-E7DZJYTC.js.map +1 -0
- package/dist/chunk-EAH4G6RO.js +108 -0
- package/dist/chunk-EAH4G6RO.js.map +1 -0
- package/dist/chunk-EGQYQILY.js +108 -0
- package/dist/chunk-EGQYQILY.js.map +1 -0
- package/dist/chunk-EGUK6K2E.js +3629 -0
- package/dist/chunk-EGUK6K2E.js.map +1 -0
- package/dist/chunk-EPMPPHVT.js +63 -0
- package/dist/chunk-EPMPPHVT.js.map +1 -0
- package/dist/chunk-F5N2VQVL.js +127 -0
- package/dist/chunk-F5N2VQVL.js.map +1 -0
- package/dist/chunk-FM6YARW4.js +766 -0
- package/dist/chunk-FM6YARW4.js.map +1 -0
- package/dist/chunk-FMOYEKMX.js +150 -0
- package/dist/chunk-FMOYEKMX.js.map +1 -0
- package/dist/chunk-FN7QONW6.js +141 -0
- package/dist/chunk-FN7QONW6.js.map +1 -0
- package/dist/chunk-FTFUKDYH.js +49 -0
- package/dist/chunk-FTFUKDYH.js.map +1 -0
- package/dist/chunk-FV5EI4UG.js +105 -0
- package/dist/chunk-FV5EI4UG.js.map +1 -0
- package/dist/chunk-FX7E4E72.js +758 -0
- package/dist/chunk-FX7E4E72.js.map +1 -0
- package/dist/chunk-G23MI4SY.js +49 -0
- package/dist/chunk-G23MI4SY.js.map +1 -0
- package/dist/chunk-G2FZDHRP.js +766 -0
- package/dist/chunk-G2FZDHRP.js.map +1 -0
- package/dist/chunk-G47DON3H.js +108 -0
- package/dist/chunk-G47DON3H.js.map +1 -0
- package/dist/chunk-G5H3DYSX.js +150 -0
- package/dist/chunk-G5H3DYSX.js.map +1 -0
- package/dist/chunk-G6KXPU5Y.js +49 -0
- package/dist/chunk-G6KXPU5Y.js.map +1 -0
- package/dist/chunk-G76ZVWZ5.js +3629 -0
- package/dist/chunk-G76ZVWZ5.js.map +1 -0
- package/dist/chunk-G7H5WJQA.js +127 -0
- package/dist/chunk-G7H5WJQA.js.map +1 -0
- package/dist/chunk-GETUZDGP.js +212 -0
- package/dist/chunk-GETUZDGP.js.map +1 -0
- package/dist/chunk-GOYSTFJI.js +212 -0
- package/dist/chunk-GOYSTFJI.js.map +1 -0
- package/dist/chunk-GRMZU5Y3.js +746 -0
- package/dist/chunk-GRMZU5Y3.js.map +1 -0
- package/dist/chunk-GSNT3LIT.js +141 -0
- package/dist/chunk-GSNT3LIT.js.map +1 -0
- package/dist/chunk-GWCOFAV6.js +108 -0
- package/dist/chunk-GWCOFAV6.js.map +1 -0
- package/dist/chunk-H4EKXKHX.js +49 -0
- package/dist/chunk-H4EKXKHX.js.map +1 -0
- package/dist/chunk-H5POGX4F.js +767 -0
- package/dist/chunk-H5POGX4F.js.map +1 -0
- package/dist/chunk-HCNLEH5X.js +141 -0
- package/dist/chunk-HCNLEH5X.js.map +1 -0
- package/dist/chunk-HDBSNWZF.js +63 -0
- package/dist/chunk-HDBSNWZF.js.map +1 -0
- package/dist/chunk-HI4LLWNL.js +141 -0
- package/dist/chunk-HI4LLWNL.js.map +1 -0
- package/dist/chunk-HKECWG4I.js +2296 -0
- package/dist/chunk-HKECWG4I.js.map +1 -0
- package/dist/chunk-HREO45K7.js +141 -0
- package/dist/chunk-HREO45K7.js.map +1 -0
- package/dist/chunk-HUV734CM.js +105 -0
- package/dist/chunk-HUV734CM.js.map +1 -0
- package/dist/chunk-I2HVPERU.js +212 -0
- package/dist/chunk-I2HVPERU.js.map +1 -0
- package/dist/chunk-I3SHVWGB.js +141 -0
- package/dist/chunk-I3SHVWGB.js.map +1 -0
- package/dist/chunk-I4B3KEBY.js +212 -0
- package/dist/chunk-I4B3KEBY.js.map +1 -0
- package/dist/chunk-IJNYQOSO.js +141 -0
- package/dist/chunk-IJNYQOSO.js.map +1 -0
- package/dist/chunk-ISWSG455.js +141 -0
- package/dist/chunk-ISWSG455.js.map +1 -0
- package/dist/chunk-IVQKAQFS.js +150 -0
- package/dist/chunk-IVQKAQFS.js.map +1 -0
- package/dist/chunk-J5SUNQMH.js +1062 -0
- package/dist/chunk-J5SUNQMH.js.map +1 -0
- package/dist/chunk-JAJJXQ6R.js +108 -0
- package/dist/chunk-JAJJXQ6R.js.map +1 -0
- package/dist/chunk-JEVIVCQW.js +212 -0
- package/dist/chunk-JEVIVCQW.js.map +1 -0
- package/dist/chunk-JGBJHG5S.js +49 -0
- package/dist/chunk-JGBJHG5S.js.map +1 -0
- package/dist/chunk-JLWVE6J4.js +141 -0
- package/dist/chunk-JLWVE6J4.js.map +1 -0
- package/dist/chunk-JONQGJC6.js +150 -0
- package/dist/chunk-JONQGJC6.js.map +1 -0
- package/dist/chunk-JQDLU5RP.js +150 -0
- package/dist/chunk-JQDLU5RP.js.map +1 -0
- package/dist/chunk-JT7N2FPE.js +778 -0
- package/dist/chunk-JT7N2FPE.js.map +1 -0
- package/dist/chunk-K23KIOIQ.js +127 -0
- package/dist/chunk-K23KIOIQ.js.map +1 -0
- package/dist/chunk-KBXOVA2L.js +3629 -0
- package/dist/chunk-KBXOVA2L.js.map +1 -0
- package/dist/chunk-KEGR3BC7.js +141 -0
- package/dist/chunk-KEGR3BC7.js.map +1 -0
- package/dist/chunk-KRISRRQK.js +49 -0
- package/dist/chunk-KRISRRQK.js.map +1 -0
- package/dist/chunk-KS5VQZU6.js +212 -0
- package/dist/chunk-KS5VQZU6.js.map +1 -0
- package/dist/chunk-KUBEFPJX.js +212 -0
- package/dist/chunk-KUBEFPJX.js.map +1 -0
- package/dist/chunk-KZCHRE37.js +212 -0
- package/dist/chunk-KZCHRE37.js.map +1 -0
- package/dist/chunk-L22R6ELB.js +3629 -0
- package/dist/chunk-L22R6ELB.js.map +1 -0
- package/dist/chunk-L5P4WBYC.js +108 -0
- package/dist/chunk-L5P4WBYC.js.map +1 -0
- package/dist/chunk-L6KKNETT.js +2323 -0
- package/dist/chunk-L6KKNETT.js.map +1 -0
- package/dist/chunk-LANOR6TZ.js +105 -0
- package/dist/chunk-LANOR6TZ.js.map +1 -0
- package/dist/chunk-LLMOI6VL.js +212 -0
- package/dist/chunk-LLMOI6VL.js.map +1 -0
- package/dist/chunk-LPES3U5W.js +127 -0
- package/dist/chunk-LPES3U5W.js.map +1 -0
- package/dist/chunk-M5OZBBXW.js +150 -0
- package/dist/chunk-M5OZBBXW.js.map +1 -0
- package/dist/chunk-M6OH4YB2.js +3629 -0
- package/dist/chunk-M6OH4YB2.js.map +1 -0
- package/dist/chunk-M7OSIPU7.js +108 -0
- package/dist/chunk-M7OSIPU7.js.map +1 -0
- package/dist/chunk-M7QNX2BI.js +779 -0
- package/dist/chunk-M7QNX2BI.js.map +1 -0
- package/dist/chunk-MHIOT5V4.js +49 -0
- package/dist/chunk-MHIOT5V4.js.map +1 -0
- package/dist/chunk-MID22PKC.js +150 -0
- package/dist/chunk-MID22PKC.js.map +1 -0
- package/dist/chunk-MILMNNPH.js +108 -0
- package/dist/chunk-MILMNNPH.js.map +1 -0
- package/dist/chunk-MRUMGRKZ.js +2296 -0
- package/dist/chunk-MRUMGRKZ.js.map +1 -0
- package/dist/chunk-MW63VCD7.js +2323 -0
- package/dist/chunk-MW63VCD7.js.map +1 -0
- package/dist/chunk-MWJV7N3A.js +127 -0
- package/dist/chunk-MWJV7N3A.js.map +1 -0
- package/dist/chunk-N3XXIFR7.js +105 -0
- package/dist/chunk-N3XXIFR7.js.map +1 -0
- package/dist/chunk-NBPROBMH.js +49 -0
- package/dist/chunk-NBPROBMH.js.map +1 -0
- package/dist/chunk-NBUX6ZAG.js +150 -0
- package/dist/chunk-NBUX6ZAG.js.map +1 -0
- package/dist/chunk-NH56ZTBH.js +108 -0
- package/dist/chunk-NH56ZTBH.js.map +1 -0
- package/dist/chunk-NIWODUGJ.js +212 -0
- package/dist/chunk-NIWODUGJ.js.map +1 -0
- package/dist/chunk-NKPYG7N5.js +3629 -0
- package/dist/chunk-NKPYG7N5.js.map +1 -0
- package/dist/chunk-NYECXZIF.js +3629 -0
- package/dist/chunk-NYECXZIF.js.map +1 -0
- package/dist/chunk-O3SZWPCH.js +45 -0
- package/dist/chunk-O3SZWPCH.js.map +1 -0
- package/dist/chunk-O7MIWZWE.js +141 -0
- package/dist/chunk-O7MIWZWE.js.map +1 -0
- package/dist/chunk-OCOJJLLH.js +2324 -0
- package/dist/chunk-OCOJJLLH.js.map +1 -0
- package/dist/chunk-OGY7DCWY.js +269 -0
- package/dist/chunk-OGY7DCWY.js.map +1 -0
- package/dist/chunk-OJQKHBLY.js +269 -0
- package/dist/chunk-OJQKHBLY.js.map +1 -0
- package/dist/chunk-OKODJI45.js +127 -0
- package/dist/chunk-OKODJI45.js.map +1 -0
- package/dist/chunk-OOLQDE53.js +127 -0
- package/dist/chunk-OOLQDE53.js.map +1 -0
- package/dist/chunk-ORQLZLQK.js +3629 -0
- package/dist/chunk-ORQLZLQK.js.map +1 -0
- package/dist/chunk-OTSKDKHM.js +2324 -0
- package/dist/chunk-OTSKDKHM.js.map +1 -0
- package/dist/chunk-OXQCF5AE.js +212 -0
- package/dist/chunk-OXQCF5AE.js.map +1 -0
- package/dist/chunk-OXV3WLAV.js +108 -0
- package/dist/chunk-OXV3WLAV.js.map +1 -0
- package/dist/chunk-OZGSZQRJ.js +141 -0
- package/dist/chunk-OZGSZQRJ.js.map +1 -0
- package/dist/chunk-P3FAHSAL.js +105 -0
- package/dist/chunk-P3FAHSAL.js.map +1 -0
- package/dist/chunk-P3USRJB6.js +63 -0
- package/dist/chunk-P3USRJB6.js.map +1 -0
- package/dist/chunk-P3UYW3SM.js +3629 -0
- package/dist/chunk-P3UYW3SM.js.map +1 -0
- package/dist/chunk-PEQTB3L3.js +63 -0
- package/dist/chunk-PEQTB3L3.js.map +1 -0
- package/dist/chunk-PHCEV52K.js +212 -0
- package/dist/chunk-PHCEV52K.js.map +1 -0
- package/dist/chunk-PHTN2RMZ.js +150 -0
- package/dist/chunk-PHTN2RMZ.js.map +1 -0
- package/dist/chunk-PT4KFLVX.js +127 -0
- package/dist/chunk-PT4KFLVX.js.map +1 -0
- package/dist/chunk-PXABE2QS.js +105 -0
- package/dist/chunk-PXABE2QS.js.map +1 -0
- package/dist/chunk-PZ5F4S72.js +105 -0
- package/dist/chunk-PZ5F4S72.js.map +1 -0
- package/dist/chunk-Q5L4ZFID.js +45 -0
- package/dist/chunk-Q5L4ZFID.js.map +1 -0
- package/dist/chunk-QBNAN25Q.js +3629 -0
- package/dist/chunk-QBNAN25Q.js.map +1 -0
- package/dist/chunk-QC7YXB2A.js +49 -0
- package/dist/chunk-QC7YXB2A.js.map +1 -0
- package/dist/chunk-QCF2GOD4.js +127 -0
- package/dist/chunk-QCF2GOD4.js.map +1 -0
- package/dist/chunk-QDOLY7AE.js +150 -0
- package/dist/chunk-QDOLY7AE.js.map +1 -0
- package/dist/chunk-QJ6YJACB.js +108 -0
- package/dist/chunk-QJ6YJACB.js.map +1 -0
- package/dist/chunk-QJVWIW4W.js +3629 -0
- package/dist/chunk-QJVWIW4W.js.map +1 -0
- package/dist/chunk-QPUA5EZG.js +127 -0
- package/dist/chunk-QPUA5EZG.js.map +1 -0
- package/dist/chunk-QRFTJ5PK.js +63 -0
- package/dist/chunk-QRFTJ5PK.js.map +1 -0
- package/dist/chunk-QSIQTYRK.js +150 -0
- package/dist/chunk-QSIQTYRK.js.map +1 -0
- package/dist/chunk-QZGHLUK3.js +2324 -0
- package/dist/chunk-QZGHLUK3.js.map +1 -0
- package/dist/chunk-QZYZHE4G.js +2324 -0
- package/dist/chunk-QZYZHE4G.js.map +1 -0
- package/dist/chunk-R2L6KXXE.js +212 -0
- package/dist/chunk-R2L6KXXE.js.map +1 -0
- package/dist/chunk-R5RHNLW3.js +49 -0
- package/dist/chunk-R5RHNLW3.js.map +1 -0
- package/dist/chunk-R7IIAD6L.js +3629 -0
- package/dist/chunk-R7IIAD6L.js.map +1 -0
- package/dist/chunk-RCSIFS35.js +141 -0
- package/dist/chunk-RCSIFS35.js.map +1 -0
- package/dist/chunk-RFIFIKH5.js +212 -0
- package/dist/chunk-RFIFIKH5.js.map +1 -0
- package/dist/chunk-RILCXBSP.js +141 -0
- package/dist/chunk-RILCXBSP.js.map +1 -0
- package/dist/chunk-RJ5SEZ6H.js +105 -0
- package/dist/chunk-RJ5SEZ6H.js.map +1 -0
- package/dist/chunk-RJPQCEQ6.js +127 -0
- package/dist/chunk-RJPQCEQ6.js.map +1 -0
- package/dist/chunk-RMMHHBN4.js +2324 -0
- package/dist/chunk-RMMHHBN4.js.map +1 -0
- package/dist/chunk-RS2HFIY2.js +141 -0
- package/dist/chunk-RS2HFIY2.js.map +1 -0
- package/dist/chunk-RSVS77WU.js +150 -0
- package/dist/chunk-RSVS77WU.js.map +1 -0
- package/dist/chunk-RWPM2WRI.js +150 -0
- package/dist/chunk-RWPM2WRI.js.map +1 -0
- package/dist/chunk-RZ7RCP5B.js +779 -0
- package/dist/chunk-RZ7RCP5B.js.map +1 -0
- package/dist/chunk-RZWV4WHX.js +763 -0
- package/dist/chunk-RZWV4WHX.js.map +1 -0
- package/dist/chunk-S2HBBVDW.js +150 -0
- package/dist/chunk-S2HBBVDW.js.map +1 -0
- package/dist/chunk-S5FEAS4U.js +105 -0
- package/dist/chunk-S5FEAS4U.js.map +1 -0
- package/dist/chunk-S5IQLRFT.js +141 -0
- package/dist/chunk-S5IQLRFT.js.map +1 -0
- package/dist/chunk-SAXB4ZDO.js +37 -0
- package/dist/chunk-SAXB4ZDO.js.map +1 -0
- package/dist/chunk-SBAVNLWF.js +269 -0
- package/dist/chunk-SBAVNLWF.js.map +1 -0
- package/dist/chunk-SDZ24S2Z.js +105 -0
- package/dist/chunk-SDZ24S2Z.js.map +1 -0
- package/dist/chunk-SFALBIG7.js +105 -0
- package/dist/chunk-SFALBIG7.js.map +1 -0
- package/dist/chunk-SHSHID4W.js +3629 -0
- package/dist/chunk-SHSHID4W.js.map +1 -0
- package/dist/chunk-SJGTHUQZ.js +141 -0
- package/dist/chunk-SJGTHUQZ.js.map +1 -0
- package/dist/chunk-SKHK3IPV.js +49 -0
- package/dist/chunk-SKHK3IPV.js.map +1 -0
- package/dist/chunk-SLXQ3EER.js +212 -0
- package/dist/chunk-SLXQ3EER.js.map +1 -0
- package/dist/chunk-SRT7BZXC.js +108 -0
- package/dist/chunk-SRT7BZXC.js.map +1 -0
- package/dist/chunk-SWBY4QZF.js +779 -0
- package/dist/chunk-SWBY4QZF.js.map +1 -0
- package/dist/chunk-SZYHR3C6.js +3629 -0
- package/dist/chunk-SZYHR3C6.js.map +1 -0
- package/dist/chunk-T4TPFHMN.js +2324 -0
- package/dist/chunk-T4TPFHMN.js.map +1 -0
- package/dist/chunk-TB7BKXRR.js +127 -0
- package/dist/chunk-TB7BKXRR.js.map +1 -0
- package/dist/chunk-THSJ53VG.js +2324 -0
- package/dist/chunk-THSJ53VG.js.map +1 -0
- package/dist/chunk-TLT6LNWC.js +762 -0
- package/dist/chunk-TLT6LNWC.js.map +1 -0
- package/dist/chunk-TO6QANN4.js +3629 -0
- package/dist/chunk-TO6QANN4.js.map +1 -0
- package/dist/chunk-TRQSR7DW.js +108 -0
- package/dist/chunk-TRQSR7DW.js.map +1 -0
- package/dist/chunk-U4SMFDJW.js +49 -0
- package/dist/chunk-U4SMFDJW.js.map +1 -0
- package/dist/chunk-U6VIVFW5.js +2324 -0
- package/dist/chunk-U6VIVFW5.js.map +1 -0
- package/dist/chunk-UCTOF4ZB.js +49 -0
- package/dist/chunk-UCTOF4ZB.js.map +1 -0
- package/dist/chunk-UGUV2DJS.js +141 -0
- package/dist/chunk-UGUV2DJS.js.map +1 -0
- package/dist/chunk-UVEC2ZT3.js +2324 -0
- package/dist/chunk-UVEC2ZT3.js.map +1 -0
- package/dist/chunk-UVZ7YB5Q.js +141 -0
- package/dist/chunk-UVZ7YB5Q.js.map +1 -0
- package/dist/chunk-UXTFUCX3.js +766 -0
- package/dist/chunk-UXTFUCX3.js.map +1 -0
- package/dist/chunk-V6ES4L5B.js +105 -0
- package/dist/chunk-V6ES4L5B.js.map +1 -0
- package/dist/chunk-V77JV3LI.js +105 -0
- package/dist/chunk-V77JV3LI.js.map +1 -0
- package/dist/chunk-VA5BITJE.js +1055 -0
- package/dist/chunk-VA5BITJE.js.map +1 -0
- package/dist/chunk-VAATEBIW.js +108 -0
- package/dist/chunk-VAATEBIW.js.map +1 -0
- package/dist/chunk-VAO3CU7Z.js +127 -0
- package/dist/chunk-VAO3CU7Z.js.map +1 -0
- package/dist/chunk-VAPOFMDE.js +3629 -0
- package/dist/chunk-VAPOFMDE.js.map +1 -0
- package/dist/chunk-VFFVPHNL.js +766 -0
- package/dist/chunk-VFFVPHNL.js.map +1 -0
- package/dist/chunk-VFGZAHLS.js +2324 -0
- package/dist/chunk-VFGZAHLS.js.map +1 -0
- package/dist/chunk-VGY5HS74.js +150 -0
- package/dist/chunk-VGY5HS74.js.map +1 -0
- package/dist/chunk-VVBGPWM7.js +63 -0
- package/dist/chunk-VVBGPWM7.js.map +1 -0
- package/dist/chunk-W5QDF2MZ.js +49 -0
- package/dist/chunk-W5QDF2MZ.js.map +1 -0
- package/dist/chunk-WDIFNDEX.js +108 -0
- package/dist/chunk-WDIFNDEX.js.map +1 -0
- package/dist/chunk-WKSSRTA4.js +212 -0
- package/dist/chunk-WKSSRTA4.js.map +1 -0
- package/dist/chunk-WMKO32NA.js +269 -0
- package/dist/chunk-WMKO32NA.js.map +1 -0
- package/dist/chunk-WNFHRRSN.js +141 -0
- package/dist/chunk-WNFHRRSN.js.map +1 -0
- package/dist/chunk-WOXDTLCE.js +766 -0
- package/dist/chunk-WOXDTLCE.js.map +1 -0
- package/dist/chunk-WQA63C6Q.js +127 -0
- package/dist/chunk-WQA63C6Q.js.map +1 -0
- package/dist/chunk-WQPQHQZW.js +3629 -0
- package/dist/chunk-WQPQHQZW.js.map +1 -0
- package/dist/chunk-WZLSC3BW.js +105 -0
- package/dist/chunk-WZLSC3BW.js.map +1 -0
- package/dist/chunk-XHNBO2OJ.js +127 -0
- package/dist/chunk-XHNBO2OJ.js.map +1 -0
- package/dist/chunk-XOZZONEG.js +150 -0
- package/dist/chunk-XOZZONEG.js.map +1 -0
- package/dist/chunk-XQJF2ZL3.js +212 -0
- package/dist/chunk-XQJF2ZL3.js.map +1 -0
- package/dist/chunk-XSP66P6F.js +3629 -0
- package/dist/chunk-XSP66P6F.js.map +1 -0
- package/dist/chunk-XUF35GZZ.js +127 -0
- package/dist/chunk-XUF35GZZ.js.map +1 -0
- package/dist/chunk-XZ7I2PAE.js +212 -0
- package/dist/chunk-XZ7I2PAE.js.map +1 -0
- package/dist/chunk-XZ7IRZK6.js +127 -0
- package/dist/chunk-XZ7IRZK6.js.map +1 -0
- package/dist/chunk-Y66GAXT2.js +141 -0
- package/dist/chunk-Y66GAXT2.js.map +1 -0
- package/dist/chunk-YBZ5CS5C.js +269 -0
- package/dist/chunk-YBZ5CS5C.js.map +1 -0
- package/dist/chunk-YD5Q3Y2F.js +108 -0
- package/dist/chunk-YD5Q3Y2F.js.map +1 -0
- package/dist/chunk-YG6AABZU.js +212 -0
- package/dist/chunk-YG6AABZU.js.map +1 -0
- package/dist/chunk-YHPBVKLF.js +141 -0
- package/dist/chunk-YHPBVKLF.js.map +1 -0
- package/dist/chunk-YLEMBSEW.js +2296 -0
- package/dist/chunk-YLEMBSEW.js.map +1 -0
- package/dist/chunk-YMSK4DCV.js +141 -0
- package/dist/chunk-YMSK4DCV.js.map +1 -0
- package/dist/chunk-YN7GVWUB.js +150 -0
- package/dist/chunk-YN7GVWUB.js.map +1 -0
- package/dist/chunk-YNJXTJA7.js +212 -0
- package/dist/chunk-YNJXTJA7.js.map +1 -0
- package/dist/chunk-YO6RK4HG.js +2324 -0
- package/dist/chunk-YO6RK4HG.js.map +1 -0
- package/dist/chunk-YTHROHEF.js +108 -0
- package/dist/chunk-YTHROHEF.js.map +1 -0
- package/dist/chunk-YU46EWPE.js +141 -0
- package/dist/chunk-YU46EWPE.js.map +1 -0
- package/dist/chunk-YUN3ZAZC.js +1061 -0
- package/dist/chunk-YUN3ZAZC.js.map +1 -0
- package/dist/chunk-YVA4QJBC.js +141 -0
- package/dist/chunk-YVA4QJBC.js.map +1 -0
- package/dist/chunk-YXYTN6OZ.js +766 -0
- package/dist/chunk-YXYTN6OZ.js.map +1 -0
- package/dist/chunk-YY6H5XXH.js +108 -0
- package/dist/chunk-YY6H5XXH.js.map +1 -0
- package/dist/chunk-YYM6I7YW.js +127 -0
- package/dist/chunk-YYM6I7YW.js.map +1 -0
- package/dist/chunk-Z3OTC4H5.js +212 -0
- package/dist/chunk-Z3OTC4H5.js.map +1 -0
- package/dist/chunk-Z6NZREQ5.js +3629 -0
- package/dist/chunk-Z6NZREQ5.js.map +1 -0
- package/dist/chunk-ZARVS4SN.js +105 -0
- package/dist/chunk-ZARVS4SN.js.map +1 -0
- package/dist/chunk-ZD2MHVFB.js +212 -0
- package/dist/chunk-ZD2MHVFB.js.map +1 -0
- package/dist/chunk-ZERMPYAP.js +49 -0
- package/dist/chunk-ZERMPYAP.js.map +1 -0
- package/dist/chunk-ZEZ2ISAF.js +127 -0
- package/dist/chunk-ZEZ2ISAF.js.map +1 -0
- package/dist/chunk-ZJS7CFI7.js +212 -0
- package/dist/chunk-ZJS7CFI7.js.map +1 -0
- package/dist/chunk-ZQETFQBM.js +105 -0
- package/dist/chunk-ZQETFQBM.js.map +1 -0
- package/dist/chunk-ZRVVYM5P.js +2324 -0
- package/dist/chunk-ZRVVYM5P.js.map +1 -0
- package/dist/components/AddressContainer/CoreAddressContainer.js +7 -7
- package/dist/components/AddressContainer/EVMAddressContainer.js +7 -7
- package/dist/components/AddressContainer/addressSwitcher.js +5 -5
- package/dist/components/AddressContainer/addressView.js +4 -4
- package/dist/components/AddressContainer/label.js +3 -3
- package/dist/components/Age/index.js +3 -3
- package/dist/components/CopyButton/index.js +2 -2
- package/dist/components/DownloadCSV/index.js +3 -3
- package/dist/components/Footer/index.d.ts +5 -5
- package/dist/components/Footer/index.js.map +1 -1
- package/dist/components/GasPriceDropdown/index.js +1 -1
- package/dist/components/IncreasePercent/index.js +1 -1
- package/dist/components/InfoIconWithTooltip/index.js +2 -2
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/NetworkIcon/index.d.ts +9 -0
- package/dist/components/NetworkIcon/index.js +20 -0
- package/dist/components/NetworkIcon/index.js.map +1 -0
- package/dist/components/PhishingAddressContainer/index.js +2 -2
- package/dist/components/Price/index.js +2 -2
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Select/select.js +2 -2
- package/dist/components/Text/index.js +3 -3
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/TransactionAction/coreTransactionAction.js +7 -7
- package/dist/components/TransactionAction/evmTransactionAction.js +7 -7
- package/dist/store/types.d.ts +10 -7
- package/dist/utils/contractManagerTool.d.ts +21 -30
- package/dist/utils/contractManagerTool.js +18 -23
- package/dist/utils/contractManagerTool.js.map +1 -1
- package/dist/utils/index.d.ts +10 -7
- package/dist/utils/index.js +5 -1
- package/package.json +2 -2
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useBreakpoint
|
|
3
|
+
} from "./chunk-TOKKKTFG.js";
|
|
4
|
+
import {
|
|
5
|
+
Tooltip
|
|
6
|
+
} from "./chunk-MW63VCD7.js";
|
|
7
|
+
import {
|
|
8
|
+
selectText
|
|
9
|
+
} from "./chunk-4WJBUQY7.js";
|
|
10
|
+
|
|
11
|
+
// src/components/Text/index.tsx
|
|
12
|
+
import React from "react";
|
|
13
|
+
import clsx from "clsx";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var getTypeColor = (type) => {
|
|
16
|
+
const colors = {
|
|
17
|
+
default: "inherit",
|
|
18
|
+
primary: "#7cd77b",
|
|
19
|
+
secondary: "#666",
|
|
20
|
+
success: "#7cd77b",
|
|
21
|
+
warning: "#ffc438",
|
|
22
|
+
error: "#e15c56"
|
|
23
|
+
};
|
|
24
|
+
return colors[type] || colors.default;
|
|
25
|
+
};
|
|
26
|
+
var Text = React.memo(
|
|
27
|
+
({
|
|
28
|
+
className,
|
|
29
|
+
children,
|
|
30
|
+
maxWidth: _maxWidth,
|
|
31
|
+
mobileMaxWidth = _maxWidth,
|
|
32
|
+
maxCount: _maxCount,
|
|
33
|
+
mobileMaxCount = _maxCount,
|
|
34
|
+
hoverValue,
|
|
35
|
+
hoverValueMaxCount: outerHoverValueMaxCount,
|
|
36
|
+
tag = "p",
|
|
37
|
+
type = "default",
|
|
38
|
+
hideTooltip = false,
|
|
39
|
+
...props
|
|
40
|
+
}) => {
|
|
41
|
+
const Component = tag;
|
|
42
|
+
const bp = useBreakpoint();
|
|
43
|
+
let child = children;
|
|
44
|
+
const maxCount = bp === "s" ? mobileMaxCount : _maxCount;
|
|
45
|
+
const maxWidth = bp === "s" ? mobileMaxWidth : _maxWidth;
|
|
46
|
+
if (maxWidth === void 0 && maxCount && typeof children === "string" && children.length > maxCount) {
|
|
47
|
+
child = String.prototype.substr.call(children, 0, maxCount) + "...";
|
|
48
|
+
}
|
|
49
|
+
let textContent = hoverValue || children;
|
|
50
|
+
if (bp === "s" && typeof textContent === "string") {
|
|
51
|
+
const hoverValueMaxCount = outerHoverValueMaxCount || 34;
|
|
52
|
+
let textContentCopy = textContent;
|
|
53
|
+
let newTextContent = [];
|
|
54
|
+
let count = 0;
|
|
55
|
+
while (textContentCopy.length > hoverValueMaxCount) {
|
|
56
|
+
newTextContent.push(
|
|
57
|
+
/* @__PURE__ */ jsx("span", { children: textContentCopy.substr(0, hoverValueMaxCount) }, count)
|
|
58
|
+
);
|
|
59
|
+
newTextContent.push(/* @__PURE__ */ jsx("br", {}, `br${count}`));
|
|
60
|
+
textContentCopy = textContentCopy.substr(hoverValueMaxCount);
|
|
61
|
+
if (count > 3) {
|
|
62
|
+
textContentCopy = textContentCopy.substr(0, hoverValueMaxCount - 3) + "...";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
newTextContent.push(/* @__PURE__ */ jsx("span", { children: textContentCopy }, ++count));
|
|
66
|
+
textContent = newTextContent;
|
|
67
|
+
}
|
|
68
|
+
const tooltipText = !hideTooltip && React.createElement(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
onClick: (e) => {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
e.stopPropagation();
|
|
74
|
+
selectText(e.currentTarget);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
textContent
|
|
78
|
+
);
|
|
79
|
+
const p = { title: tooltipText };
|
|
80
|
+
return React.createElement(Tooltip, p, [
|
|
81
|
+
/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
82
|
+
Component,
|
|
83
|
+
{
|
|
84
|
+
className: clsx(
|
|
85
|
+
"sirius-text truncate vertical-bottom",
|
|
86
|
+
"all-[a]:truncate all-[a]:vertical-bottom all-[a]:cursor-pointer all-[a:hover]:text-#0626ae",
|
|
87
|
+
className
|
|
88
|
+
),
|
|
89
|
+
style: {
|
|
90
|
+
maxWidth,
|
|
91
|
+
display: maxWidth === void 0 ? "inherit" : "inline-block",
|
|
92
|
+
color: getTypeColor(type)
|
|
93
|
+
},
|
|
94
|
+
...props,
|
|
95
|
+
children: child
|
|
96
|
+
}
|
|
97
|
+
) }, "text")
|
|
98
|
+
]);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
Text
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=chunk-LANOR6TZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Text/index.tsx"],"sourcesContent":["import React from 'react';\nimport clsx from 'clsx';\nimport { Tooltip } from '../Tooltip';\nimport { selectText } from '../../utils';\nimport { useBreakpoint } from '../../utils/media';\n\ntype NormalTypes =\n | 'default'\n | 'secondary'\n | 'success'\n | 'warning'\n | 'error'\n | 'primary';\n\ntype TextProps = {\n children?: React.ReactNode;\n maxWidth?: string;\n mobileMaxWidth?: string;\n maxCount?: number;\n mobileMaxCount?: number;\n hoverValue?: React.ReactNode;\n hoverValueMaxCount?: number;\n tag?: 'p' | 'span';\n type?: NormalTypes;\n hideTooltip?: boolean;\n};\ntype NativeAttrs = Omit<React.HTMLAttributes<any>, keyof TextProps>;\n\nconst getTypeColor = (type: NormalTypes) => {\n const colors: { [key in NormalTypes]: string } = {\n default: 'inherit',\n primary: '#7cd77b',\n secondary: '#666',\n success: '#7cd77b',\n warning: '#ffc438',\n error: '#e15c56',\n };\n\n return colors[type] || colors.default;\n};\n\n// note:\n// 1. maxWidth priority is higher than maxCount\n// 2. maxCount only apply to string\n// 3. if hoverValue is provided, use hoverValue as Tooltip text, otherwise use children\n// if text of prop tooltip is provided, use as Tooltip text\nexport const Text = React.memo(\n ({\n className,\n children,\n maxWidth: _maxWidth,\n mobileMaxWidth = _maxWidth,\n maxCount: _maxCount,\n mobileMaxCount = _maxCount,\n hoverValue,\n hoverValueMaxCount: outerHoverValueMaxCount,\n tag = 'p',\n type = 'default',\n hideTooltip = false,\n ...props\n }: NativeAttrs & TextProps) => {\n const Component = tag;\n const bp = useBreakpoint();\n let child: React.ReactNode = children;\n const maxCount = bp === 's' ? mobileMaxCount : _maxCount;\n const maxWidth = bp === 's' ? mobileMaxWidth : _maxWidth;\n if (\n maxWidth === undefined &&\n maxCount &&\n typeof children === 'string' &&\n children.length > maxCount\n ) {\n child = String.prototype.substr.call(children, 0, maxCount) + '...';\n }\n\n let textContent = hoverValue || children;\n // 控制移动端字符串类型 tooltip 的长度\n // 这里有个问题,就是截断的位置可能是一个完整的单词,暂时没有办法处理,如果为了避免这种情况,需要由外面传入前对内容进行处理,比如设置固定宽度小于 24rem\n // @todo 后续可以试下读取文本长度,动态设置容器宽度值的方式,可以避免截断位置的问题\n if (bp === 's' && typeof textContent === 'string') {\n const hoverValueMaxCount = outerHoverValueMaxCount || 34; // default text count is 36\n let textContentCopy: string = textContent;\n let newTextContent: Array<React.ReactNode> = [];\n let count = 0;\n while (textContentCopy.length > hoverValueMaxCount) {\n newTextContent.push(\n <span key={count}>\n {textContentCopy.substr(0, hoverValueMaxCount)}\n </span>,\n );\n newTextContent.push(<br key={`br${count}`} />);\n textContentCopy = textContentCopy.substr(hoverValueMaxCount);\n // 防止文本过长的情况\n if (count > 3) {\n textContentCopy =\n textContentCopy.substr(0, hoverValueMaxCount - 3) + '...';\n }\n }\n newTextContent.push(<span key={++count}>{textContentCopy}</span>);\n textContent = newTextContent;\n }\n const tooltipText =\n !hideTooltip &&\n React.createElement(\n 'div',\n {\n onClick: e => {\n e.preventDefault();\n e.stopPropagation();\n selectText(e.currentTarget);\n },\n },\n textContent,\n );\n\n const p = { title: tooltipText };\n return React.createElement(Tooltip, p, [\n <span key=\"text\">\n <Component\n className={clsx(\n 'sirius-text truncate vertical-bottom',\n 'all-[a]:truncate all-[a]:vertical-bottom all-[a]:cursor-pointer all-[a:hover]:text-#0626ae',\n className,\n )}\n style={{\n maxWidth,\n display: maxWidth === undefined ? 'inherit' : 'inline-block',\n color: getTypeColor(type),\n }}\n {...props}\n >\n {child}\n </Component>\n </span>,\n ]);\n },\n);\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,WAAW;A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ACxD;AAAA,MACF;AACA,qBAAe,KAAK,oBAAC,UAAoB,6BAAV,EAAE,KAAwB,CAAO;AAChE,oBAAc;AAAA,IAChB;AACA,UAAM,cACJ,CAAC,eACD,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,QACE,SAAS,OAAK;AACZ,YAAE,eAAe;AACjB,YAAE,gBAAgB;AAClB,qBAAW,EAAE,aAAa;AAAA,QAC5B;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAEF,UAAM,IAAI,EAAE,OAAO,YAAY;AAC/B,WAAO,MAAM,cAAc,SAAS,GAAG;AAAA,MACrC,oBAAC,UACC;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,OAAO;AAAA,YACL;AAAA,YACA,SAAS,aAAa,SAAY,YAAY;AAAA,YAC9C,OAAO,aAAa,IAAI;AAAA,UAC1B;AAAA,UACC,GAAG;AAAA,UAEH;AAAA;AAAA,MACH,KAfQ,MAgBV;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RenderAddress
|
|
3
|
+
} from "./chunk-TB7BKXRR.js";
|
|
4
|
+
import {
|
|
5
|
+
formatAddress,
|
|
6
|
+
isInnerContractAddress
|
|
7
|
+
} from "./chunk-OJQKHBLY.js";
|
|
8
|
+
import {
|
|
9
|
+
Tooltip
|
|
10
|
+
} from "./chunk-VFGZAHLS.js";
|
|
11
|
+
import {
|
|
12
|
+
coreCorrespondsToEspace,
|
|
13
|
+
formatString,
|
|
14
|
+
getNetwork
|
|
15
|
+
} from "./chunk-WOXDTLCE.js";
|
|
16
|
+
import {
|
|
17
|
+
getEnvConfig,
|
|
18
|
+
getTranslations,
|
|
19
|
+
useGlobalData
|
|
20
|
+
} from "./chunk-DQGLZCIG.js";
|
|
21
|
+
|
|
22
|
+
// src/components/AddressContainer/addressSwitcher.tsx
|
|
23
|
+
import { AlertTriangle, File } from "@zeit-ui/react-icons";
|
|
24
|
+
import InternalContractIcon from "./internal-contract-icon-ZH2RG3CU.png";
|
|
25
|
+
import ContractIcon from "./contract-icon-P3W2HUAA.png";
|
|
26
|
+
import VerifiedIcon from "./verified-VJRHZNN7.png";
|
|
27
|
+
import isMeIcon from "./me-SIV36SR7.png";
|
|
28
|
+
import { isPosAddress } from "@cfx-kit/dapp-utils/dist/address";
|
|
29
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
+
var ContractCreatedAddress = (props) => {
|
|
31
|
+
const { contractCreated = "", outputType, t, isFull } = props;
|
|
32
|
+
const translations = getTranslations();
|
|
33
|
+
const contractAddress = formatAddress(contractCreated, outputType);
|
|
34
|
+
const customProps = {
|
|
35
|
+
content: t(translations.transaction.contractCreation),
|
|
36
|
+
alias: t(translations.transaction.contractCreation),
|
|
37
|
+
hrefAddress: contractAddress,
|
|
38
|
+
cfxAddress: contractAddress,
|
|
39
|
+
maxWidth: 160
|
|
40
|
+
};
|
|
41
|
+
const mergedProps = { ...props, ...customProps };
|
|
42
|
+
return RenderAddress({
|
|
43
|
+
...mergedProps,
|
|
44
|
+
prefix: /* @__PURE__ */ jsx("div", { className: `mr-[2px] flex-shrink-0 ${isFull ? "icon" : ""}`, children: /* @__PURE__ */ jsx(Tooltip, { title: mergedProps.content, children: /* @__PURE__ */ jsx("div", { className: "relative w-[16px] h-[16px]", children: /* @__PURE__ */ jsx(
|
|
45
|
+
"img",
|
|
46
|
+
{
|
|
47
|
+
className: "w-[16px] h-[16px] align-bottom mb-[3px]",
|
|
48
|
+
src: ContractIcon,
|
|
49
|
+
alt: mergedProps.content
|
|
50
|
+
}
|
|
51
|
+
) }) }) })
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var CoreHexAddress = (props) => {
|
|
55
|
+
const { value, t, isFull, maxWidth } = props;
|
|
56
|
+
const { globalData } = useGlobalData();
|
|
57
|
+
const ENV_CONFIG = getEnvConfig();
|
|
58
|
+
const translations = getTranslations();
|
|
59
|
+
const hexAddress = formatAddress(value, "hex");
|
|
60
|
+
const network = getNetwork(
|
|
61
|
+
globalData?.networks,
|
|
62
|
+
coreCorrespondsToEspace(ENV_CONFIG.ENV_NETWORK_ID)
|
|
63
|
+
);
|
|
64
|
+
const url = `${window.location.protocol}${network.url}/address/${hexAddress}`;
|
|
65
|
+
return RenderAddress({
|
|
66
|
+
cfxAddress: hexAddress,
|
|
67
|
+
hoverValue: hexAddress,
|
|
68
|
+
link: url,
|
|
69
|
+
isFull,
|
|
70
|
+
maxWidth,
|
|
71
|
+
suffixSize: 0,
|
|
72
|
+
prefix: /* @__PURE__ */ jsx("div", { className: "mr-[2px] flex-shrink-0", children: /* @__PURE__ */ jsx(Tooltip, { title: t(translations.general.eSpaceAddress), children: /* @__PURE__ */ jsx(File, { size: 16, color: "#17B38A" }) }) })
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
var InvalidAddress = (props) => {
|
|
76
|
+
const {
|
|
77
|
+
value,
|
|
78
|
+
alias,
|
|
79
|
+
t,
|
|
80
|
+
isFull,
|
|
81
|
+
maxWidth,
|
|
82
|
+
isFullNameTag,
|
|
83
|
+
hideAliasPrefixInHover
|
|
84
|
+
} = props;
|
|
85
|
+
const translations = getTranslations();
|
|
86
|
+
const tip = t(translations.general.invalidAddress);
|
|
87
|
+
return RenderAddress({
|
|
88
|
+
cfxAddress: value,
|
|
89
|
+
alias,
|
|
90
|
+
hoverValue: `${tip}: ${value}`,
|
|
91
|
+
content: alias ? formatString(alias, "tag") : value,
|
|
92
|
+
link: false,
|
|
93
|
+
isFull,
|
|
94
|
+
isFullNameTag,
|
|
95
|
+
maxWidth,
|
|
96
|
+
style: { color: "#e00909" },
|
|
97
|
+
prefix: /* @__PURE__ */ jsx("div", { className: "mr-[2px] flex-shrink-0", children: /* @__PURE__ */ jsx(Tooltip, { title: tip, children: /* @__PURE__ */ jsx(AlertTriangle, { size: 16, color: "#e00909" }) }) }),
|
|
98
|
+
hideAliasPrefixInHover
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
var ContractAddress = (props) => {
|
|
102
|
+
const { showIcon, verify, t, cfxAddress, isFull } = props;
|
|
103
|
+
const translations = getTranslations();
|
|
104
|
+
const isInnerContract = cfxAddress && isInnerContractAddress(cfxAddress);
|
|
105
|
+
const typeText = t(
|
|
106
|
+
isInnerContract ? translations.general.internalContract : verify ? translations.general.verifiedContract : translations.general.unverifiedContract
|
|
107
|
+
);
|
|
108
|
+
return RenderAddress({
|
|
109
|
+
...props,
|
|
110
|
+
prefix: showIcon ? /* @__PURE__ */ jsx("div", { className: `mr-[2px] flex-shrink-0 ${isFull ? "icon" : ""}`, children: /* @__PURE__ */ jsx(Tooltip, { title: typeText, children: /* @__PURE__ */ jsx("div", { className: "relative w-[16px] h-[16px]", children: isInnerContract ? /* @__PURE__ */ jsx(
|
|
111
|
+
"img",
|
|
112
|
+
{
|
|
113
|
+
className: "w-[16px] h-[16px] align-bottom mb-[5px]",
|
|
114
|
+
src: InternalContractIcon,
|
|
115
|
+
alt: typeText
|
|
116
|
+
}
|
|
117
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
118
|
+
/* @__PURE__ */ jsx(
|
|
119
|
+
"img",
|
|
120
|
+
{
|
|
121
|
+
className: "w-[16px] h-[16px] align-bottom mb-[5px]",
|
|
122
|
+
src: ContractIcon,
|
|
123
|
+
alt: typeText
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
verify ? /* @__PURE__ */ jsx(
|
|
127
|
+
"img",
|
|
128
|
+
{
|
|
129
|
+
className: "w-[8px] h-[8px] absolute bottom-[-1px] right-[1px]",
|
|
130
|
+
src: VerifiedIcon,
|
|
131
|
+
alt: ""
|
|
132
|
+
}
|
|
133
|
+
) : /* @__PURE__ */ jsx(Fragment, {})
|
|
134
|
+
] }) }) }) }) : /* @__PURE__ */ jsx(Fragment, {})
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
var MyAddress = (props) => {
|
|
138
|
+
const { isFull } = props;
|
|
139
|
+
return RenderAddress({
|
|
140
|
+
...props,
|
|
141
|
+
suffix: /* @__PURE__ */ jsx("div", { className: "mr-[2px] flex-shrink-0", children: /* @__PURE__ */ jsx(
|
|
142
|
+
"img",
|
|
143
|
+
{
|
|
144
|
+
className: "w-[38.5px] h-[16px] ml-[3px] align-bottom",
|
|
145
|
+
src: isMeIcon,
|
|
146
|
+
alt: "is me",
|
|
147
|
+
style: {
|
|
148
|
+
marginBottom: isFull ? "6px" : "4px"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
) })
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
var PosAddress = (props) => {
|
|
155
|
+
const {
|
|
156
|
+
alias,
|
|
157
|
+
isFull,
|
|
158
|
+
isFullNameTag,
|
|
159
|
+
maxWidth,
|
|
160
|
+
t,
|
|
161
|
+
link,
|
|
162
|
+
isMe,
|
|
163
|
+
hideAliasPrefixInHover
|
|
164
|
+
} = props;
|
|
165
|
+
const value = props.value;
|
|
166
|
+
if (!value) {
|
|
167
|
+
return /* @__PURE__ */ jsx(Fragment, { children: "--" });
|
|
168
|
+
}
|
|
169
|
+
if (isMe) {
|
|
170
|
+
return MyAddress(props);
|
|
171
|
+
}
|
|
172
|
+
const translations = getTranslations();
|
|
173
|
+
const content = alias ? formatString(alias, "tag") : formatString(value, "posAddress");
|
|
174
|
+
if (!isPosAddress(value)) {
|
|
175
|
+
const tip = t(translations.general.invalidPosAddress);
|
|
176
|
+
return RenderAddress({
|
|
177
|
+
cfxAddress: value,
|
|
178
|
+
alias,
|
|
179
|
+
hoverValue: `${tip}: ${value}`,
|
|
180
|
+
content,
|
|
181
|
+
link: false,
|
|
182
|
+
isFull,
|
|
183
|
+
isFullNameTag,
|
|
184
|
+
maxWidth,
|
|
185
|
+
style: { color: "#e00909" },
|
|
186
|
+
prefix: /* @__PURE__ */ jsx("div", { className: "mr-[2px] flex-shrink-0", children: /* @__PURE__ */ jsx(Tooltip, { title: tip, children: /* @__PURE__ */ jsx(AlertTriangle, { size: 16, color: "#e00909" }) }) }),
|
|
187
|
+
type: "pos",
|
|
188
|
+
hideAliasPrefixInHover
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
return RenderAddress({
|
|
192
|
+
cfxAddress: value,
|
|
193
|
+
alias,
|
|
194
|
+
link,
|
|
195
|
+
isFull,
|
|
196
|
+
isFullNameTag,
|
|
197
|
+
maxWidth,
|
|
198
|
+
type: "pos",
|
|
199
|
+
content,
|
|
200
|
+
hideAliasPrefixInHover
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export {
|
|
205
|
+
ContractCreatedAddress,
|
|
206
|
+
CoreHexAddress,
|
|
207
|
+
InvalidAddress,
|
|
208
|
+
ContractAddress,
|
|
209
|
+
MyAddress,
|
|
210
|
+
PosAddress
|
|
211
|
+
};
|
|
212
|
+
//# sourceMappingURL=chunk-LLMOI6VL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AddressContainer/addressSwitcher.tsx"],"sourcesContent":["import { WithTranslation } from 'react-i18next';\nimport { AlertTriangle, File } from '@zeit-ui/react-icons';\nimport InternalContractIcon from '../../images/internal-contract-icon.png';\nimport ContractIcon from '../../images/contract-icon.png';\nimport VerifiedIcon from '../../images/verified.png';\nimport isMeIcon from '../../images/me.png';\nimport { Tooltip } from '../Tooltip';\nimport { isPosAddress } from '@cfx-kit/dapp-utils/dist/address';\nimport { formatAddress, isInnerContractAddress } from '../../utils/address';\nimport { getTranslations, getEnvConfig, useGlobalData } from '../../store';\nimport { getNetwork, formatString, coreCorrespondsToEspace } from 'src/utils';\nimport { Props } from './types';\nimport { RenderAddress } from './addressView';\n\n// common\nexport const ContractCreatedAddress = (\n props: Props & WithTranslation & { outputType: 'hex' | 'base32' },\n) => {\n const { contractCreated = '', outputType, t, isFull } = props;\n\n const translations = getTranslations();\n\n const contractAddress = formatAddress(contractCreated, outputType);\n\n const customProps = {\n content: t(translations.transaction.contractCreation),\n alias: t(translations.transaction.contractCreation),\n hrefAddress: contractAddress,\n cfxAddress: contractAddress,\n maxWidth: 160,\n };\n\n const mergedProps = { ...props, ...customProps };\n return RenderAddress({\n ...mergedProps,\n prefix: (\n <div className={`mr-[2px] flex-shrink-0 ${isFull ? 'icon' : ''}`}>\n <Tooltip title={mergedProps.content}>\n <div className=\"relative w-[16px] h-[16px]\">\n <img\n className=\"w-[16px] h-[16px] align-bottom mb-[3px]\"\n src={ContractIcon}\n alt={mergedProps.content}\n />\n </div>\n </Tooltip>\n </div>\n ),\n });\n};\n\n// core\nexport const CoreHexAddress = (props: Props & WithTranslation) => {\n const { value, t, isFull, maxWidth } = props;\n const { globalData } = useGlobalData();\n\n const ENV_CONFIG = getEnvConfig();\n const translations = getTranslations();\n const hexAddress = formatAddress(value, 'hex');\n const network = getNetwork(\n globalData?.networks,\n coreCorrespondsToEspace(ENV_CONFIG.ENV_NETWORK_ID),\n );\n const url = `${window.location.protocol}${network.url}/address/${hexAddress}`;\n\n return RenderAddress({\n cfxAddress: hexAddress,\n hoverValue: hexAddress,\n link: url,\n isFull,\n maxWidth,\n suffixSize: 0,\n prefix: (\n <div className=\"mr-[2px] flex-shrink-0\">\n <Tooltip title={t((translations as any).general.eSpaceAddress)}>\n <File size={16} color=\"#17B38A\" />\n </Tooltip>\n </div>\n ),\n });\n};\n\n// common\nexport const InvalidAddress = (props: Props & WithTranslation) => {\n const {\n value,\n alias,\n t,\n isFull,\n maxWidth,\n isFullNameTag,\n hideAliasPrefixInHover,\n } = props;\n\n const translations = getTranslations();\n\n const tip = t(translations.general.invalidAddress);\n\n return RenderAddress({\n cfxAddress: value,\n alias,\n hoverValue: `${tip}: ${value}`,\n content: alias ? formatString(alias, 'tag') : value,\n link: false,\n isFull,\n isFullNameTag,\n maxWidth,\n style: { color: '#e00909' },\n prefix: (\n <div className=\"mr-[2px] flex-shrink-0\">\n <Tooltip title={tip}>\n <AlertTriangle size={16} color=\"#e00909\" />\n </Tooltip>\n </div>\n ),\n hideAliasPrefixInHover,\n });\n};\n\n// common\nexport const ContractAddress = (props: Props & WithTranslation) => {\n const { showIcon, verify, t, cfxAddress, isFull } = props;\n\n const translations = getTranslations();\n\n const isInnerContract = cfxAddress && isInnerContractAddress(cfxAddress);\n\n const typeText = t(\n isInnerContract\n ? translations.general.internalContract\n : verify\n ? translations.general.verifiedContract\n : translations.general.unverifiedContract,\n );\n\n return RenderAddress({\n ...props,\n prefix: showIcon ? (\n <div className={`mr-[2px] flex-shrink-0 ${isFull ? 'icon' : ''}`}>\n <Tooltip title={typeText}>\n <div className=\"relative w-[16px] h-[16px]\">\n {isInnerContract ? (\n <img\n className=\"w-[16px] h-[16px] align-bottom mb-[5px]\"\n src={InternalContractIcon}\n alt={typeText}\n />\n ) : (\n <>\n <img\n className=\"w-[16px] h-[16px] align-bottom mb-[5px]\"\n src={ContractIcon}\n alt={typeText}\n />\n {verify ? (\n <img\n className=\"w-[8px] h-[8px] absolute bottom-[-1px] right-[1px]\"\n src={VerifiedIcon}\n alt={''}\n />\n ) : (\n <></>\n )}\n </>\n )}\n </div>\n </Tooltip>\n </div>\n ) : (\n <></>\n ),\n });\n};\n\n// common\nexport const MyAddress = (props: Props & WithTranslation) => {\n const { isFull } = props;\n return RenderAddress({\n ...props,\n suffix: (\n <div className=\"mr-[2px] flex-shrink-0\">\n <img\n className=\"w-[38.5px] h-[16px] ml-[3px] align-bottom\"\n src={isMeIcon}\n alt=\"is me\"\n style={{\n marginBottom: isFull ? '6px' : '4px',\n }}\n />\n </div>\n ),\n });\n};\n\n// core\nexport const PosAddress = (props: Props & WithTranslation) => {\n const {\n alias,\n isFull,\n isFullNameTag,\n maxWidth,\n t,\n link,\n isMe,\n hideAliasPrefixInHover,\n } = props;\n const value = props.value;\n if (!value) {\n return <>--</>;\n }\n if (isMe) {\n return MyAddress(props);\n }\n const translations = getTranslations();\n const content = alias\n ? formatString(alias, 'tag')\n : formatString(value, 'posAddress');\n if (!isPosAddress(value)) {\n const tip = t(translations.general.invalidPosAddress);\n return RenderAddress({\n cfxAddress: value,\n alias,\n hoverValue: `${tip}: ${value}`,\n content,\n link: false,\n isFull,\n isFullNameTag,\n maxWidth,\n style: { color: '#e00909' },\n prefix: (\n <div className=\"mr-[2px] flex-shrink-0\">\n <Tooltip title={tip}>\n <AlertTriangle size={16} color=\"#e00909\" />\n </Tooltip>\n </div>\n ),\n type: 'pos',\n hideAliasPrefixInHover,\n });\n }\n\n return RenderAddress({\n cfxAddress: value,\n alias,\n link,\n isFull,\n isFullNameTag,\n maxWidth,\n type: 'pos',\n content,\n hideAliasPrefixInHover,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,eAAe,YAAY;AACpC,OAAO,0BAA0B;AACjC,OAAO,kBAAkB;AACzB,OAAO,kBAAkB;AACzB,OAAO,cAAc;AAErB,SAAS,oBAAoB;AAgCjB,SA0HM,UA1HN,KA6GE,YA7GF;AAxBL,IAAM,yBAAyB,CACpC,UACG;AACH,QAAM,EAAE,kBAAkB,IAAI,YAAY,GAAG,OAAO,IAAI;AAExD,QAAM,eAAe,gBAAgB;AAErC,QAAM,kBAAkB,cAAc,iBAAiB,UAAU;AAEjE,QAAM,cAAc;AAAA,IAClB,SAAS,EAAE,aAAa,YAAY,gBAAgB;AAAA,IACpD,OAAO,EAAE,aAAa,YAAY,gBAAgB;AAAA,IAClD,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAEA,QAAM,cAAc,EAAE,GAAG,OAAO,GAAG,YAAY;AAC/C,SAAO,cAAc;AAAA,IACnB,GAAG;AAAA,IACH,QACE,oBAAC,SAAI,WAAW,0BAA0B,SAAS,SAAS,MAC1D,8BAAC,WAAQ,OAAO,YAAY,SAC1B,8BAAC,SAAI,WAAU,8BACb;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,KAAK;AAAA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AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,QAAQ,MAAM;AACpB,MAAI,CAAC,OAAO;AACV,WAAO,gCAAE,gBAAE;AAAA,EACb;AACA,MAAI,MAAM;AACR,WAAO,UAAU,KAAK;AAAA,EACxB;AACA,QAAM,eAAe,gBAAgB;AACrC,QAAM,UAAU,QACZ,aAAa,OAAO,KAAK,IACzB,aAAa,OAAO,YAAY;AACpC,MAAI,CAAC,aAAa,KAAK,GAAG;AACxB,UAAM,MAAM,EAAE,aAAa,QAAQ,iBAAiB;AACpD,WAAO,cAAc;AAAA,MACnB,YAAY;AAAA,MACZ;AAAA,MACA,YAAY,GAAG,QAAQ;AAAA,MACvB;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,EAAE,OAAO,UAAU;AAAA,MAC1B,QACE,oBAAC,SAAI,WAAU,0BACb,8BAAC,WAAQ,OAAO,KACd,8BAAC,iBAAc,MAAM,IAAI,OAAM,WAAU,GAC3C,GACF;AAAA,MAEF,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,cAAc;AAAA,IACnB,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
convertCheckSum
|
|
3
|
+
} from "./chunk-OJQKHBLY.js";
|
|
4
|
+
import {
|
|
5
|
+
Text
|
|
6
|
+
} from "./chunk-PZ5F4S72.js";
|
|
7
|
+
import {
|
|
8
|
+
getTranslations
|
|
9
|
+
} from "./chunk-DQGLZCIG.js";
|
|
10
|
+
|
|
11
|
+
// src/components/AddressContainer/addressView.tsx
|
|
12
|
+
import { Translation } from "react-i18next";
|
|
13
|
+
import { shortenAddress } from "@cfx-kit/dapp-utils/dist/address";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var defaultPCMaxWidth = 138;
|
|
16
|
+
var renderTooltipContent = (tooltipContent) => {
|
|
17
|
+
return Object.entries(tooltipContent).map(([key, { label, value, hideLabel }]) => {
|
|
18
|
+
if (value) {
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
20
|
+
!hideLabel && /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Translation, { children: (t) => t(label) }) }),
|
|
21
|
+
value
|
|
22
|
+
] }, key);
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}).filter(Boolean);
|
|
26
|
+
};
|
|
27
|
+
var convertLink = ({
|
|
28
|
+
link,
|
|
29
|
+
type,
|
|
30
|
+
hrefAddress,
|
|
31
|
+
cfxAddress
|
|
32
|
+
}) => {
|
|
33
|
+
if (typeof link === "string") {
|
|
34
|
+
return link;
|
|
35
|
+
}
|
|
36
|
+
const address = hrefAddress || cfxAddress;
|
|
37
|
+
if (address && typeof address === "string") {
|
|
38
|
+
const pathname = window.location.pathname.toLowerCase();
|
|
39
|
+
const addressLower = address.toLowerCase();
|
|
40
|
+
if (pathname.includes("/address/" + addressLower)) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (type === "pow") {
|
|
44
|
+
return `/address/${address}`;
|
|
45
|
+
}
|
|
46
|
+
if (type === "pos") {
|
|
47
|
+
return `/pos/accounts/${address}`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
};
|
|
52
|
+
var RenderAddress = ({
|
|
53
|
+
cfxAddress,
|
|
54
|
+
alias,
|
|
55
|
+
hoverValue,
|
|
56
|
+
hrefAddress,
|
|
57
|
+
content,
|
|
58
|
+
link = "",
|
|
59
|
+
isFull = false,
|
|
60
|
+
isFullNameTag = false,
|
|
61
|
+
style = {},
|
|
62
|
+
maxWidth,
|
|
63
|
+
prefix = null,
|
|
64
|
+
suffix = null,
|
|
65
|
+
type = "pow",
|
|
66
|
+
addressLabel = "",
|
|
67
|
+
ENSLabel = "",
|
|
68
|
+
nametag = "",
|
|
69
|
+
hideAliasPrefixInHover = false
|
|
70
|
+
}) => {
|
|
71
|
+
const translations = getTranslations();
|
|
72
|
+
const name = content || ENSLabel || nametag || addressLabel || alias;
|
|
73
|
+
const defaultStyle = {
|
|
74
|
+
maxWidth: `${name && isFullNameTag || isFull ? "auto" : (maxWidth || defaultPCMaxWidth) + "px"}`
|
|
75
|
+
};
|
|
76
|
+
const href = convertLink({ link, type, hrefAddress, cfxAddress });
|
|
77
|
+
const Wrapper = href ? "a" : "div";
|
|
78
|
+
const tooltipContent = {
|
|
79
|
+
ENSLabel: {
|
|
80
|
+
label: translations?.ens?.tip,
|
|
81
|
+
value: ENSLabel
|
|
82
|
+
},
|
|
83
|
+
nametag: {
|
|
84
|
+
label: translations?.nametag?.tip,
|
|
85
|
+
value: nametag
|
|
86
|
+
},
|
|
87
|
+
addressLabel: {
|
|
88
|
+
label: translations?.profile.address.myNameTag,
|
|
89
|
+
value: addressLabel
|
|
90
|
+
},
|
|
91
|
+
alias: {
|
|
92
|
+
label: translations?.profile.address.publicNameTag,
|
|
93
|
+
value: alias,
|
|
94
|
+
hideLabel: hideAliasPrefixInHover
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const checksumAddress = convertCheckSum(cfxAddress);
|
|
98
|
+
const cfxAddressLabel = typeof cfxAddress === "string" && !isFull ? shortenAddress(checksumAddress) : checksumAddress;
|
|
99
|
+
return /* @__PURE__ */ jsxs("div", { className: "inline-flex", children: [
|
|
100
|
+
prefix,
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
Text,
|
|
103
|
+
{
|
|
104
|
+
tag: "span",
|
|
105
|
+
hoverValue: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
106
|
+
renderTooltipContent(tooltipContent),
|
|
107
|
+
/* @__PURE__ */ jsx("div", { children: hoverValue || checksumAddress })
|
|
108
|
+
] }),
|
|
109
|
+
children: /* @__PURE__ */ jsx(
|
|
110
|
+
Wrapper,
|
|
111
|
+
{
|
|
112
|
+
className: "block relative align-bottom cursor-default truncate",
|
|
113
|
+
style: { ...defaultStyle, ...style },
|
|
114
|
+
...href ? { href: String(href) } : {},
|
|
115
|
+
children: name || cfxAddressLabel
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
suffix
|
|
121
|
+
] });
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export {
|
|
125
|
+
RenderAddress
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=chunk-LPES3U5W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AddressContainer/addressView.tsx"],"sourcesContent":["import { Translation } from 'react-i18next';\nimport { Text } from '../Text';\nimport { convertCheckSum } from '../../utils/address';\nimport { getTranslations } from '../../store';\nimport { TooltipContent, RenderAddressProps } from './types';\nimport { shortenAddress } from '@cfx-kit/dapp-utils/dist/address';\n\nconst defaultPCMaxWidth = 138;\n\n// common\nconst renderTooltipContent = (tooltipContent: TooltipContent) => {\n return Object.entries(tooltipContent)\n .map(([key, { label, value, hideLabel }]) => {\n if (value) {\n return (\n <div key={key}>\n {!hideLabel && (\n <span>\n <Translation>{t => t(label)}</Translation>\n </span>\n )}\n {value}\n </div>\n );\n }\n return null;\n })\n .filter(Boolean);\n};\n\n// common\nconst convertLink = ({\n link,\n type,\n hrefAddress,\n cfxAddress,\n}: RenderAddressProps) => {\n if (typeof link === 'string') {\n return link;\n }\n\n const address = hrefAddress || cfxAddress;\n\n if (address && typeof address === 'string') {\n const pathname = window.location.pathname.toLowerCase();\n const addressLower = address.toLowerCase();\n if (pathname.includes('/address/' + addressLower)) {\n return false;\n }\n\n if (type === 'pow') {\n return `/address/${address}`;\n }\n\n if (type === 'pos') {\n return `/pos/accounts/${address}`;\n }\n }\n\n return false;\n};\n\n// common\nexport const RenderAddress = ({\n cfxAddress,\n alias,\n hoverValue,\n hrefAddress,\n content,\n link = '',\n isFull = false,\n isFullNameTag = false,\n style = {},\n maxWidth,\n prefix = null,\n suffix = null,\n type = 'pow',\n addressLabel = '',\n ENSLabel = '',\n nametag = '',\n hideAliasPrefixInHover = false,\n}: RenderAddressProps) => {\n const translations = getTranslations();\n\n const name = content || ENSLabel || nametag || addressLabel || alias;\n\n const defaultStyle = {\n maxWidth: `${(name && isFullNameTag) || isFull ? 'auto' : (maxWidth || defaultPCMaxWidth) + 'px'}`,\n };\n\n const href = convertLink({ link, type, hrefAddress, cfxAddress });\n\n const Wrapper = href ? 'a' : 'div';\n\n const tooltipContent: TooltipContent = {\n ENSLabel: {\n label: (translations as any)?.ens?.tip,\n value: ENSLabel,\n },\n nametag: {\n label: translations?.nametag?.tip,\n value: nametag,\n },\n addressLabel: {\n label: translations?.profile.address.myNameTag,\n value: addressLabel,\n },\n alias: {\n label: translations?.profile.address.publicNameTag,\n value: alias,\n hideLabel: hideAliasPrefixInHover,\n },\n };\n\n const checksumAddress = convertCheckSum(cfxAddress);\n\n const cfxAddressLabel =\n typeof cfxAddress === 'string' && !isFull\n ? shortenAddress(checksumAddress!)\n : checksumAddress;\n\n return (\n <div className=\"inline-flex\">\n {prefix}\n <Text\n tag=\"span\"\n hoverValue={\n <>\n {renderTooltipContent(tooltipContent)}\n <div>{hoverValue || checksumAddress}</div>\n </>\n }\n >\n <Wrapper\n className=\"block relative align-bottom cursor-default truncate\"\n style={{ ...defaultStyle, ...style }}\n {...(href ? { href: String(href) } : {})}\n >\n {name || cfxAddressLabel}\n </Wrapper>\n </Text>\n {suffix}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,mBAAmB;AAK5B,SAAS,sBAAsB;AAUrB,SAgHA,UA7GM,KAHN;AARV,IAAM,oBAAoB;AAG1B,IAAM,uBAAuB,CAAC,mBAAmC;AAC/D,SAA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+
import { useEffect, useCallback, useMemo } from "react";
|
|
10
|
+
import ReactDOM from "react-dom";
|
|
11
|
+
import { X } from "lucide-react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var Backdrop = ({
|
|
14
|
+
onClick,
|
|
15
|
+
children,
|
|
16
|
+
className
|
|
17
|
+
}) => /* @__PURE__ */ jsx("div", { className, onClick, children });
|
|
18
|
+
var ModalContent = ({
|
|
19
|
+
containerClassName,
|
|
20
|
+
closable,
|
|
21
|
+
onClose,
|
|
22
|
+
children,
|
|
23
|
+
loading,
|
|
24
|
+
modalStyles
|
|
25
|
+
}) => /* @__PURE__ */ jsx(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: cn("relative bg-[#FFF] rounded shadow-lg", containerClassName),
|
|
29
|
+
tabIndex: -1,
|
|
30
|
+
style: modalStyles,
|
|
31
|
+
children: /* @__PURE__ */ jsxs(Spin, { spinning: loading, children: [
|
|
32
|
+
closable && /* @__PURE__ */ jsx(X, { className: "h-4 w-4 absolute right-5 top-5", onClick: onClose }),
|
|
33
|
+
/* @__PURE__ */ jsx("div", { className: "p-4", children })
|
|
34
|
+
] })
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
var useEventListener = (eventName, handler, active) => {
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (active) {
|
|
40
|
+
const eventListener = (event) => handler(event);
|
|
41
|
+
document.addEventListener(eventName, eventListener);
|
|
42
|
+
return () => {
|
|
43
|
+
document.removeEventListener(eventName, eventListener);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}, [eventName, handler, active]);
|
|
47
|
+
};
|
|
48
|
+
var Modal = ({
|
|
49
|
+
open,
|
|
50
|
+
closeOnEsc = true,
|
|
51
|
+
closable = true,
|
|
52
|
+
preventScroll = true,
|
|
53
|
+
backdropClassName = "",
|
|
54
|
+
containerClassName = "",
|
|
55
|
+
onOpen = () => {
|
|
56
|
+
},
|
|
57
|
+
onClose,
|
|
58
|
+
children,
|
|
59
|
+
width = "600px",
|
|
60
|
+
maskClosable = true,
|
|
61
|
+
centered = true,
|
|
62
|
+
loading = false
|
|
63
|
+
}) => {
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (open) {
|
|
66
|
+
onOpen?.();
|
|
67
|
+
if (preventScroll) {
|
|
68
|
+
document.body.style.overflow = "hidden";
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
if (preventScroll) {
|
|
72
|
+
document.body.style.overflow = "";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return () => {
|
|
76
|
+
if (preventScroll) {
|
|
77
|
+
document.body.style.overflow = "";
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}, [open, onOpen, preventScroll]);
|
|
81
|
+
const handleKeyDown = useCallback(
|
|
82
|
+
(event) => {
|
|
83
|
+
if (event.key === "Escape" && closeOnEsc && onClose) {
|
|
84
|
+
onClose?.();
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
[closeOnEsc, onClose]
|
|
88
|
+
);
|
|
89
|
+
const handleClickOutside = useCallback(() => {
|
|
90
|
+
if (onClose && maskClosable) {
|
|
91
|
+
onClose?.();
|
|
92
|
+
}
|
|
93
|
+
}, [onClose, maskClosable]);
|
|
94
|
+
const handleBackdropClick = useCallback(
|
|
95
|
+
(event) => {
|
|
96
|
+
if (maskClosable && event.target === event.currentTarget && onClose) {
|
|
97
|
+
onClose?.();
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
[maskClosable, onClose]
|
|
101
|
+
);
|
|
102
|
+
const modalStyles = useMemo(
|
|
103
|
+
() => ({
|
|
104
|
+
width: typeof width === "string" ? width : `${width}px`,
|
|
105
|
+
margin: centered ? "auto" : void 0
|
|
106
|
+
}),
|
|
107
|
+
[width, centered]
|
|
108
|
+
);
|
|
109
|
+
useEventListener(
|
|
110
|
+
"keydown",
|
|
111
|
+
handleKeyDown,
|
|
112
|
+
open && closeOnEsc
|
|
113
|
+
);
|
|
114
|
+
useEventListener(
|
|
115
|
+
"mousedown",
|
|
116
|
+
handleClickOutside,
|
|
117
|
+
open && maskClosable
|
|
118
|
+
);
|
|
119
|
+
if (!open)
|
|
120
|
+
return null;
|
|
121
|
+
return ReactDOM.createPortal(
|
|
122
|
+
/* @__PURE__ */ jsx(
|
|
123
|
+
Backdrop,
|
|
124
|
+
{
|
|
125
|
+
onClick: handleBackdropClick,
|
|
126
|
+
className: cn(
|
|
127
|
+
"fixed inset-0 bg-[#000] bg-opacity-25 flex items-center justify-center z-10000",
|
|
128
|
+
backdropClassName
|
|
129
|
+
),
|
|
130
|
+
children: /* @__PURE__ */ jsx(
|
|
131
|
+
ModalContent,
|
|
132
|
+
{
|
|
133
|
+
containerClassName,
|
|
134
|
+
closable,
|
|
135
|
+
onClose,
|
|
136
|
+
children,
|
|
137
|
+
loading,
|
|
138
|
+
modalStyles
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
document.body
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export {
|
|
148
|
+
Modal
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=chunk-M5OZBBXW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Modal/index.tsx"],"sourcesContent":["import React, { useEffect, useCallback, useMemo } from 'react';\nimport ReactDOM from 'react-dom';\nimport { X } from 'lucide-react';\nimport { Spin } from '../Spin';\nimport { cn } from '../../utils';\n\ninterface ModalProps {\n open: boolean;\n closeOnEsc?: boolean;\n closable?: boolean;\n preventScroll?: boolean;\n backdropClassName?: string;\n containerClassName?: string;\n onOpen?: () => void;\n onClose?: () => void;\n children?: React.ReactNode;\n width?: string | number;\n maskClosable?: boolean;\n centered?: boolean;\n loading?: boolean;\n}\n\ninterface ModalContentProps {\n containerClassName: string;\n closable: boolean;\n onClose?: VoidFunction;\n children?: React.ReactNode;\n loading?: boolean;\n modalStyles: React.CSSProperties;\n}\n\ninterface BackdropProps {\n onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n className: string;\n children?: React.ReactNode;\n}\n\nconst Backdrop: React.FC<BackdropProps> = ({\n onClick,\n children,\n className,\n}) => (\n <div className={className} onClick={onClick}>\n {children}\n </div>\n);\n\nconst ModalContent = ({\n containerClassName,\n closable,\n onClose,\n children,\n loading,\n modalStyles,\n}: ModalContentProps) => (\n <div\n className={cn('relative bg-[#FFF] rounded shadow-lg', containerClassName)}\n tabIndex={-1}\n style={modalStyles}\n >\n <Spin spinning={loading}>\n {closable && (\n <X className=\"h-4 w-4 absolute right-5 top-5\" onClick={onClose} />\n )}\n <div className=\"p-4\">{children}</div>\n </Spin>\n </div>\n);\n\nconst useEventListener = (\n eventName: string,\n handler: (event: Event) => void,\n active: boolean,\n) => {\n useEffect(() => {\n if (active) {\n const eventListener = (event: Event) => handler(event);\n\n document.addEventListener(eventName, eventListener);\n return () => {\n document.removeEventListener(eventName, eventListener);\n };\n }\n }, [eventName, handler, active]);\n};\n\nconst Modal: React.FC<ModalProps> = ({\n open,\n closeOnEsc = true,\n closable = true,\n preventScroll = true,\n backdropClassName = '',\n containerClassName = '',\n onOpen = () => {},\n onClose,\n children,\n width = '600px',\n maskClosable = true,\n centered = true,\n loading = false,\n}) => {\n useEffect(() => {\n if (open) {\n onOpen?.();\n if (preventScroll) {\n document.body.style.overflow = 'hidden';\n }\n } else {\n if (preventScroll) {\n document.body.style.overflow = '';\n }\n }\n return () => {\n if (preventScroll) {\n document.body.style.overflow = '';\n }\n };\n }, [open, onOpen, preventScroll]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Escape' && closeOnEsc && onClose) {\n onClose?.();\n }\n },\n [closeOnEsc, onClose],\n );\n\n const handleClickOutside = useCallback(() => {\n if (onClose && maskClosable) {\n onClose?.();\n }\n }, [onClose, maskClosable]);\n\n const handleBackdropClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n if (maskClosable && event.target === event.currentTarget && onClose) {\n onClose?.();\n }\n },\n [maskClosable, onClose],\n );\n\n const modalStyles: React.CSSProperties = useMemo(\n () => ({\n width: typeof width === 'string' ? width : `${width}px`,\n margin: centered ? 'auto' : undefined,\n }),\n [width, centered],\n );\n\n useEventListener(\n 'keydown',\n handleKeyDown as (event: Event) => void,\n open && closeOnEsc,\n );\n useEventListener(\n 'mousedown',\n handleClickOutside as (event: Event) => void,\n open && maskClosable,\n );\n\n if (!open) return null;\n\n return ReactDOM.createPortal(\n <Backdrop\n onClick={handleBackdropClick}\n className={cn(\n 'fixed inset-0 bg-[#000] bg-opacity-25 flex items-center justify-center z-10000',\n backdropClassName,\n )}\n >\n <ModalContent\n containerClassName={containerClassName}\n closable={closable}\n onClose={onClose}\n children={children}\n loading={loading}\n modalStyles={modalStyles}\n />\n </Backdrop>,\n document.body,\n );\n};\n\nexport { Modal };\n"],"mappings":";;;;;;;;AAAA,SAAgB,WAAW,aAAa,eAAe;AACvD,OAAO,cAAc;AACrB,SAAS,SAAS;AAwChB,cAkBE,YAlBF;AALF,IAAM,WAAoC,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AACF,MACE,oBAAC,SAAI,WAAsB,SACxB,UACH;AAGF,IAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,GAAG,wCAAwC,kBAAkB;AAAA,IACxE,UAAU;AAAA,IACV,OAAO;AAAA,IAEP,+BAAC,QAAK,UAAU,SACb;AAAA,kBACC,oBAAC,KAAE,WAAU,kCAAiC,SAAS,SAAS;AAAA,MAElE,oBAAC,SAAI,WAAU,OAAO,UAAS;AAAA,OACjC;AAAA;AACF;AAGF,IAAM,mBAAmB,CACvB,WACA,SACA,WACG;AACH,YAAU,MAAM;AACd,QAAI,QAAQ;AAC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