@mx-space/cli 0.1.1 → 0.2.1

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.
Files changed (235) hide show
  1. package/README.md +101 -28
  2. package/ROADMAP.md +4 -3
  3. package/dist/{Lexical.dev-DpU35QTu.mjs → Lexical.dev-CMevU1DO.mjs} +1 -1
  4. package/dist/{Lexical.dev-DpU35QTu.mjs.map → Lexical.dev-CMevU1DO.mjs.map} +1 -1
  5. package/dist/{Lexical.node-gYNDt_p9.mjs → Lexical.node-BR9e7Cyk.mjs} +2 -2
  6. package/dist/{Lexical.node-gYNDt_p9.mjs.map → Lexical.node-BR9e7Cyk.mjs.map} +1 -1
  7. package/dist/{Lexical.prod-t4c3bHV3.mjs → Lexical.prod-PUD-z9fY.mjs} +1 -1
  8. package/dist/{Lexical.prod-t4c3bHV3.mjs.map → Lexical.prod-PUD-z9fY.mjs.map} +1 -1
  9. package/dist/{LexicalClipboard.dev-CdeeWCIq.mjs → LexicalClipboard.dev-DZC2zppG.mjs} +6 -6
  10. package/dist/{LexicalClipboard.dev-CdeeWCIq.mjs.map → LexicalClipboard.dev-DZC2zppG.mjs.map} +1 -1
  11. package/dist/{LexicalClipboard.node-0e9GBL1g.mjs → LexicalClipboard.node-e5G1wVGb.mjs} +2 -2
  12. package/dist/{LexicalClipboard.node-0e9GBL1g.mjs.map → LexicalClipboard.node-e5G1wVGb.mjs.map} +1 -1
  13. package/dist/{LexicalClipboard.prod-CsCWYmV7.mjs → LexicalClipboard.prod-DE2azzIb.mjs} +6 -6
  14. package/dist/{LexicalClipboard.prod-CsCWYmV7.mjs.map → LexicalClipboard.prod-DE2azzIb.mjs.map} +1 -1
  15. package/dist/{LexicalCodeCore.dev-haI2cqH8.mjs → LexicalCodeCore.dev-gs--x55I.mjs} +3 -3
  16. package/dist/{LexicalCodeCore.dev-haI2cqH8.mjs.map → LexicalCodeCore.dev-gs--x55I.mjs.map} +1 -1
  17. package/dist/{LexicalCodeCore.prod-D_k7zuE5.mjs → LexicalCodeCore.prod-DPHOnyEj.mjs} +3 -3
  18. package/dist/{LexicalCodeCore.prod-D_k7zuE5.mjs.map → LexicalCodeCore.prod-DPHOnyEj.mjs.map} +1 -1
  19. package/dist/{LexicalDragon.dev-CAggdFh_.mjs → LexicalDragon.dev-CVe8bzVN.mjs} +3 -3
  20. package/dist/{LexicalDragon.dev-CAggdFh_.mjs.map → LexicalDragon.dev-CVe8bzVN.mjs.map} +1 -1
  21. package/dist/{LexicalDragon.node-QMR_wqJg.mjs → LexicalDragon.node-c7EHvcnK.mjs} +2 -2
  22. package/dist/{LexicalDragon.node-QMR_wqJg.mjs.map → LexicalDragon.node-c7EHvcnK.mjs.map} +1 -1
  23. package/dist/{LexicalDragon.prod-OssQhwS-.mjs → LexicalDragon.prod-D6KvqyLD.mjs} +3 -3
  24. package/dist/{LexicalDragon.prod-OssQhwS-.mjs.map → LexicalDragon.prod-D6KvqyLD.mjs.map} +1 -1
  25. package/dist/{LexicalExtension.dev-CtDZiMCU.mjs → LexicalExtension.dev-PDo8HyEw.mjs} +3 -3
  26. package/dist/{LexicalExtension.dev-CtDZiMCU.mjs.map → LexicalExtension.dev-PDo8HyEw.mjs.map} +1 -1
  27. package/dist/{LexicalExtension.node-BM0gh8zu.mjs → LexicalExtension.node-BKzjRb-0.mjs} +2 -2
  28. package/dist/{LexicalExtension.node-BM0gh8zu.mjs.map → LexicalExtension.node-BKzjRb-0.mjs.map} +1 -1
  29. package/dist/{LexicalExtension.prod-Ug6emhEO.mjs → LexicalExtension.prod-D0x_lX7q.mjs} +3 -3
  30. package/dist/{LexicalExtension.prod-Ug6emhEO.mjs.map → LexicalExtension.prod-D0x_lX7q.mjs.map} +1 -1
  31. package/dist/{LexicalHeadless.dev-D4yQpl_s.mjs → LexicalHeadless.dev-DBKcW82j.mjs} +2 -2
  32. package/dist/{LexicalHeadless.dev-D4yQpl_s.mjs.map → LexicalHeadless.dev-DBKcW82j.mjs.map} +1 -1
  33. package/dist/{LexicalHeadless.prod-jeN65B3k.mjs → LexicalHeadless.prod-D4nEh7cR.mjs} +2 -2
  34. package/dist/{LexicalHeadless.prod-jeN65B3k.mjs.map → LexicalHeadless.prod-D4nEh7cR.mjs.map} +1 -1
  35. package/dist/{LexicalHtml.dev-BdU1_ITQ.mjs → LexicalHtml.dev-vsWW05es.mjs} +4 -4
  36. package/dist/{LexicalHtml.dev-BdU1_ITQ.mjs.map → LexicalHtml.dev-vsWW05es.mjs.map} +1 -1
  37. package/dist/{LexicalHtml.node-DLtAh00E.mjs → LexicalHtml.node-CpibAfba.mjs} +2 -2
  38. package/dist/{LexicalHtml.node-DLtAh00E.mjs.map → LexicalHtml.node-CpibAfba.mjs.map} +1 -1
  39. package/dist/{LexicalHtml.prod-DdLE1HHT.mjs → LexicalHtml.prod-Bqz-3WAp.mjs} +4 -4
  40. package/dist/{LexicalHtml.prod-DdLE1HHT.mjs.map → LexicalHtml.prod-Bqz-3WAp.mjs.map} +1 -1
  41. package/dist/{LexicalLink.dev-DK87Biuy.mjs → LexicalLink.dev-BO0J0B1E.mjs} +4 -4
  42. package/dist/{LexicalLink.dev-DK87Biuy.mjs.map → LexicalLink.dev-BO0J0B1E.mjs.map} +1 -1
  43. package/dist/{LexicalLink.prod-fssuv6Sf.mjs → LexicalLink.prod-D66AhUCZ.mjs} +4 -4
  44. package/dist/{LexicalLink.prod-fssuv6Sf.mjs.map → LexicalLink.prod-D66AhUCZ.mjs.map} +1 -1
  45. package/dist/{LexicalList.dev-BJ4dr_rk.mjs → LexicalList.dev-DVGTWRk0.mjs} +4 -4
  46. package/dist/{LexicalList.dev-BJ4dr_rk.mjs.map → LexicalList.dev-DVGTWRk0.mjs.map} +1 -1
  47. package/dist/{LexicalList.prod-jWBbaWfi.mjs → LexicalList.prod-Bao7NGl7.mjs} +4 -4
  48. package/dist/{LexicalList.prod-jWBbaWfi.mjs.map → LexicalList.prod-Bao7NGl7.mjs.map} +1 -1
  49. package/dist/{LexicalMarkdown.dev-C8e-eh6y.mjs → LexicalMarkdown.dev-CRWkZwlp.mjs} +4 -4
  50. package/dist/{LexicalMarkdown.dev-C8e-eh6y.mjs.map → LexicalMarkdown.dev-CRWkZwlp.mjs.map} +1 -1
  51. package/dist/{LexicalMarkdown.prod-k73tZVb2.mjs → LexicalMarkdown.prod-tGG6js4r.mjs} +4 -4
  52. package/dist/{LexicalMarkdown.prod-k73tZVb2.mjs.map → LexicalMarkdown.prod-tGG6js4r.mjs.map} +1 -1
  53. package/dist/{LexicalRichText.dev-CrSqq3K-.mjs → LexicalRichText.dev-DPXfQePC.mjs} +6 -6
  54. package/dist/{LexicalRichText.dev-CrSqq3K-.mjs.map → LexicalRichText.dev-DPXfQePC.mjs.map} +1 -1
  55. package/dist/{LexicalRichText.node-B7k7wlQz.mjs → LexicalRichText.node-BEkm_YwY.mjs} +5 -5
  56. package/dist/{LexicalRichText.node-B7k7wlQz.mjs.map → LexicalRichText.node-BEkm_YwY.mjs.map} +1 -1
  57. package/dist/{LexicalRichText.prod-CqvyxQ9m.mjs → LexicalRichText.prod-DlfudC5w.mjs} +6 -6
  58. package/dist/{LexicalRichText.prod-CqvyxQ9m.mjs.map → LexicalRichText.prod-DlfudC5w.mjs.map} +1 -1
  59. package/dist/{LexicalSelection.dev-sNOHKHe_.mjs → LexicalSelection.dev-BVTArZ-b.mjs} +2 -2
  60. package/dist/{LexicalSelection.dev-sNOHKHe_.mjs.map → LexicalSelection.dev-BVTArZ-b.mjs.map} +1 -1
  61. package/dist/{LexicalSelection.node-Di7GwBCZ.mjs → LexicalSelection.node-CQ8iTYsz.mjs} +2 -2
  62. package/dist/{LexicalSelection.node-Di7GwBCZ.mjs.map → LexicalSelection.node-CQ8iTYsz.mjs.map} +1 -1
  63. package/dist/{LexicalSelection.prod-SWllPJop.mjs → LexicalSelection.prod-BZKGGs-G.mjs} +2 -2
  64. package/dist/{LexicalSelection.prod-SWllPJop.mjs.map → LexicalSelection.prod-BZKGGs-G.mjs.map} +1 -1
  65. package/dist/{LexicalTable.dev-CQkLHXJx.mjs → LexicalTable.dev-C-AOEpJn.mjs} +5 -5
  66. package/dist/{LexicalTable.dev-CQkLHXJx.mjs.map → LexicalTable.dev-C-AOEpJn.mjs.map} +1 -1
  67. package/dist/{LexicalTable.prod-BtqCwKSi.mjs → LexicalTable.prod-Cyn0qWxZ.mjs} +5 -5
  68. package/dist/{LexicalTable.prod-BtqCwKSi.mjs.map → LexicalTable.prod-Cyn0qWxZ.mjs.map} +1 -1
  69. package/dist/{LexicalUtils.dev-DiUpsXE8.mjs → LexicalUtils.dev-DRRDyAlS.mjs} +3 -3
  70. package/dist/{LexicalUtils.dev-DiUpsXE8.mjs.map → LexicalUtils.dev-DRRDyAlS.mjs.map} +1 -1
  71. package/dist/{LexicalUtils.node-CmK462d1.mjs → LexicalUtils.node-Dz-HANi6.mjs} +2 -2
  72. package/dist/{LexicalUtils.node-CmK462d1.mjs.map → LexicalUtils.node-Dz-HANi6.mjs.map} +1 -1
  73. package/dist/{LexicalUtils.prod-bWwV4GAF.mjs → LexicalUtils.prod-CmeHwh8W.mjs} +3 -3
  74. package/dist/{LexicalUtils.prod-bWwV4GAF.mjs.map → LexicalUtils.prod-CmeHwh8W.mjs.map} +1 -1
  75. package/dist/{auth-OeKZZ_2x.mjs → auth-CAKmTDpF.mjs} +11 -11
  76. package/dist/auth-CAKmTDpF.mjs.map +1 -0
  77. package/dist/bin/mxs.d.mts +2 -1
  78. package/dist/bin/mxs.mjs +402 -55
  79. package/dist/bin/mxs.mjs.map +1 -1
  80. package/dist/{config-store-WL7dNMS6.mjs → config-store-B8_9iStL.mjs} +21 -81
  81. package/dist/config-store-B8_9iStL.mjs.map +1 -0
  82. package/dist/{create-Cxnqt_Wt.mjs → create-5wbU7IQh.mjs} +5 -5
  83. package/dist/{create-Cxnqt_Wt.mjs.map → create-5wbU7IQh.mjs.map} +1 -1
  84. package/dist/{create-DUOSAqBm.mjs → create-Bs6K7AyQ.mjs} +3 -3
  85. package/dist/{create-DUOSAqBm.mjs.map → create-Bs6K7AyQ.mjs.map} +1 -1
  86. package/dist/{create-C85MSrtt.mjs → create-DBReocgJ.mjs} +5 -5
  87. package/dist/{create-C85MSrtt.mjs.map → create-DBReocgJ.mjs.map} +1 -1
  88. package/dist/{create-BVHnXtIH.mjs → create-DGVaE0_S.mjs} +4 -4
  89. package/dist/{create-BVHnXtIH.mjs.map → create-DGVaE0_S.mjs.map} +1 -1
  90. package/dist/{create-BWA2WGrW.mjs → create-lLFZuMsz.mjs} +3 -3
  91. package/dist/{create-BWA2WGrW.mjs.map → create-lLFZuMsz.mjs.map} +1 -1
  92. package/dist/{delete-CGy-cV6k.mjs → delete-6tkhHQDp.mjs} +5 -5
  93. package/dist/delete-6tkhHQDp.mjs.map +1 -0
  94. package/dist/{delete-CcyrLNZv.mjs → delete-CRFxitDN.mjs} +6 -6
  95. package/dist/delete-CRFxitDN.mjs.map +1 -0
  96. package/dist/{delete-Cjxehwj7.mjs → delete-DU2Hvsy8.mjs} +5 -5
  97. package/dist/delete-DU2Hvsy8.mjs.map +1 -0
  98. package/dist/{delete-BEXOOFAJ.mjs → delete-nJmHtvfq.mjs} +6 -6
  99. package/dist/delete-nJmHtvfq.mjs.map +1 -0
  100. package/dist/{delete-CKqlAUT8.mjs → delete-tJhXI8s4.mjs} +5 -5
  101. package/dist/delete-tJhXI8s4.mjs.map +1 -0
  102. package/dist/{onboarding-C1t1yoay.mjs → dist-DJF1Ntdn.mjs} +95 -173
  103. package/dist/dist-DJF1Ntdn.mjs.map +1 -0
  104. package/dist/{document-output-C5PWbz2p.mjs → document-output-BFJdwPV0.mjs} +5 -5
  105. package/dist/document-output-BFJdwPV0.mjs.map +1 -0
  106. package/dist/{edit-BuKMUNVC.mjs → edit-BMjTbPQO.mjs} +5 -5
  107. package/dist/edit-BMjTbPQO.mjs.map +1 -0
  108. package/dist/{edit-DFnOnk4i.mjs → edit-BnEmMmv6.mjs} +9 -9
  109. package/dist/edit-BnEmMmv6.mjs.map +1 -0
  110. package/dist/{edit-BRaZ6GGg.mjs → edit-C4vRSmRy.mjs} +9 -9
  111. package/dist/{edit-BRaZ6GGg.mjs.map → edit-C4vRSmRy.mjs.map} +1 -1
  112. package/dist/{edit-t108N11Q.mjs → edit-CQsW5gnk.mjs} +8 -8
  113. package/dist/{edit-t108N11Q.mjs.map → edit-CQsW5gnk.mjs.map} +1 -1
  114. package/dist/{editor-xrF-j3UE.mjs → editor-BIw1ALTF.mjs} +4 -4
  115. package/dist/editor-BIw1ALTF.mjs.map +1 -0
  116. package/dist/{envelope-overlays-DPAlMNW1.mjs → envelope-overlays-DXXygxdF.mjs} +2 -2
  117. package/dist/{envelope-overlays-DPAlMNW1.mjs.map → envelope-overlays-DXXygxdF.mjs.map} +1 -1
  118. package/dist/{get-CwcNFb39.mjs → get-B3Y5hAAO.mjs} +3 -3
  119. package/dist/{get-CwcNFb39.mjs.map → get-B3Y5hAAO.mjs.map} +1 -1
  120. package/dist/{get-DnDvLa9S.mjs → get-C5fmd5Vf.mjs} +4 -4
  121. package/dist/{get-DnDvLa9S.mjs.map → get-C5fmd5Vf.mjs.map} +1 -1
  122. package/dist/{get-Doi-NKAh.mjs → get-Cdp2tmwz.mjs} +6 -6
  123. package/dist/get-Cdp2tmwz.mjs.map +1 -0
  124. package/dist/{get-DxTU7Nom.mjs → get-D18ChSKU.mjs} +3 -3
  125. package/dist/{get-DxTU7Nom.mjs.map → get-D18ChSKU.mjs.map} +1 -1
  126. package/dist/{get-BYoAlJwB.mjs → get-NSHTGu4Y.mjs} +4 -4
  127. package/dist/{get-BYoAlJwB.mjs.map → get-NSHTGu4Y.mjs.map} +1 -1
  128. package/dist/{get-GdRz82RW.mjs → get-XBPJr95m.mjs} +4 -4
  129. package/dist/{get-GdRz82RW.mjs.map → get-XBPJr95m.mjs.map} +1 -1
  130. package/dist/index.d.mts +57 -11
  131. package/dist/index.mjs +11 -10
  132. package/dist/{list-DVunNsXr.mjs → list-B6703n9X.mjs} +3 -3
  133. package/dist/{list-DVunNsXr.mjs.map → list-B6703n9X.mjs.map} +1 -1
  134. package/dist/{list-DN81zVDA.mjs → list-BtNocJhc.mjs} +3 -3
  135. package/dist/{list-DN81zVDA.mjs.map → list-BtNocJhc.mjs.map} +1 -1
  136. package/dist/{list-DHG-MzOM.mjs → list-C9dXrU9H.mjs} +3 -3
  137. package/dist/{list-DHG-MzOM.mjs.map → list-C9dXrU9H.mjs.map} +1 -1
  138. package/dist/{list-CtME3aDw.mjs → list-CcwcYZgN.mjs} +3 -3
  139. package/dist/{list-CtME3aDw.mjs.map → list-CcwcYZgN.mjs.map} +1 -1
  140. package/dist/{list-CLAcZYZ4.mjs → list-Ctc8b5gT.mjs} +3 -3
  141. package/dist/{list-CLAcZYZ4.mjs.map → list-Ctc8b5gT.mjs.map} +1 -1
  142. package/dist/{list-DbNCVZbz.mjs → list-b60JzCTw.mjs} +3 -3
  143. package/dist/{list-DbNCVZbz.mjs.map → list-b60JzCTw.mjs.map} +1 -1
  144. package/dist/{litexml-codec-CDoRloiR.mjs → litexml-codec-CfIxcPG0.mjs} +10 -10
  145. package/dist/{litexml-codec-CDoRloiR.mjs.map → litexml-codec-CfIxcPG0.mjs.map} +1 -1
  146. package/dist/{login-mjliJn8U.mjs → login-bZx4HaVs.mjs} +21 -9
  147. package/dist/{login-mjliJn8U.mjs.map → login-bZx4HaVs.mjs.map} +1 -1
  148. package/dist/logout-C0Dzitsu.mjs +18 -0
  149. package/dist/logout-C0Dzitsu.mjs.map +1 -0
  150. package/dist/ls-wMiTXZPQ.mjs +33 -0
  151. package/dist/ls-wMiTXZPQ.mjs.map +1 -0
  152. package/dist/mark-Dh9BErsf.mjs +29 -0
  153. package/dist/mark-Dh9BErsf.mjs.map +1 -0
  154. package/dist/onboarding-Bw_I8qpf.mjs +214 -0
  155. package/dist/onboarding-Bw_I8qpf.mjs.map +1 -0
  156. package/dist/{output-CTnO1lYt.d.mts → output-D2dDlyV2.d.mts} +1 -1
  157. package/dist/{output-BM7aBFwt.mjs → output-vzequvhd.mjs} +52 -9
  158. package/dist/output-vzequvhd.mjs.map +1 -0
  159. package/dist/{payload-CN11pUto.mjs → payload-CO4zbNr8.mjs} +17 -17
  160. package/dist/payload-CO4zbNr8.mjs.map +1 -0
  161. package/dist/profile-CNe2uWJi.mjs +172 -0
  162. package/dist/profile-CNe2uWJi.mjs.map +1 -0
  163. package/dist/{publish-akQWYsnL.mjs → publish-CzzucXQq.mjs} +4 -4
  164. package/dist/{publish-akQWYsnL.mjs.map → publish-CzzucXQq.mjs.map} +1 -1
  165. package/dist/{publish-CN3NTJ_r.mjs → publish-DRQkpxsz.mjs} +4 -4
  166. package/dist/{publish-CN3NTJ_r.mjs.map → publish-DRQkpxsz.mjs.map} +1 -1
  167. package/dist/{resolve-CyjMlaoJ.mjs → resolve-BYg5Gees.mjs} +5 -5
  168. package/dist/resolve-BYg5Gees.mjs.map +1 -0
  169. package/dist/{resolve-Bw5Po9yK.mjs → resolve-BlpMdnaM.mjs} +4 -4
  170. package/dist/resolve-BlpMdnaM.mjs.map +1 -0
  171. package/dist/{resolve-BogJOR7R.mjs → resolve-CUsHGcb-.mjs} +4 -4
  172. package/dist/resolve-CUsHGcb-.mjs.map +1 -0
  173. package/dist/{resolve-helpers-CahPoJ0Y.mjs → resolve-helpers-CoHYa2uk.mjs} +2 -2
  174. package/dist/{resolve-helpers-CahPoJ0Y.mjs.map → resolve-helpers-CoHYa2uk.mjs.map} +1 -1
  175. package/dist/{resolve-Bp1AfBmM.mjs → resolve-jdb1VqAG.mjs} +5 -5
  176. package/dist/resolve-jdb1VqAG.mjs.map +1 -0
  177. package/dist/rm-D-2iW1Cr.mjs +33 -0
  178. package/dist/rm-D-2iW1Cr.mjs.map +1 -0
  179. package/dist/run-Dnax6uhZ.mjs +130 -0
  180. package/dist/run-Dnax6uhZ.mjs.map +1 -0
  181. package/dist/self-update-CZywTwGd.mjs +1610 -0
  182. package/dist/self-update-CZywTwGd.mjs.map +1 -0
  183. package/dist/{set-ClbrGFGv.mjs → set-Dk28LAy5.mjs} +5 -5
  184. package/dist/set-Dk28LAy5.mjs.map +1 -0
  185. package/dist/{shared-C2EAn5h_.mjs → shared-d0_6ZPn_.mjs} +13 -9
  186. package/dist/shared-d0_6ZPn_.mjs.map +1 -0
  187. package/dist/show-DScu6mXz.mjs +39 -0
  188. package/dist/show-DScu6mXz.mjs.map +1 -0
  189. package/dist/status-8F6tgphP.mjs +23 -0
  190. package/dist/status-8F6tgphP.mjs.map +1 -0
  191. package/dist/{update-dc-72pUN.mjs → update-B1LGxV0n.mjs} +6 -6
  192. package/dist/{update-dc-72pUN.mjs.map → update-B1LGxV0n.mjs.map} +1 -1
  193. package/dist/{update-CHmckeo8.mjs → update-CXetpFT3.mjs} +4 -4
  194. package/dist/{update-CHmckeo8.mjs.map → update-CXetpFT3.mjs.map} +1 -1
  195. package/dist/{update-Duh-iVOZ.mjs → update-Dr4BW8U-.mjs} +6 -6
  196. package/dist/{update-Duh-iVOZ.mjs.map → update-Dr4BW8U-.mjs.map} +1 -1
  197. package/dist/{update-qfiC-9Og.mjs → update-bqcHRJPC.mjs} +6 -6
  198. package/dist/update-bqcHRJPC.mjs.map +1 -0
  199. package/dist/{update-CJjwg09n.mjs → update-dBtzzmkN.mjs} +5 -5
  200. package/dist/update-dBtzzmkN.mjs.map +1 -0
  201. package/dist/use-D7eKESSW.mjs +29 -0
  202. package/dist/use-D7eKESSW.mjs.map +1 -0
  203. package/dist/{whoami-UwcdRchK.mjs → whoami-CKSNd6zL.mjs} +6 -6
  204. package/dist/whoami-CKSNd6zL.mjs.map +1 -0
  205. package/package.json +15 -13
  206. package/LICENSE +0 -33
  207. package/dist/auth-OeKZZ_2x.mjs.map +0 -1
  208. package/dist/chunk-hT5z_Zn9.mjs +0 -35
  209. package/dist/config-store-WL7dNMS6.mjs.map +0 -1
  210. package/dist/delete-BEXOOFAJ.mjs.map +0 -1
  211. package/dist/delete-CGy-cV6k.mjs.map +0 -1
  212. package/dist/delete-CKqlAUT8.mjs.map +0 -1
  213. package/dist/delete-CcyrLNZv.mjs.map +0 -1
  214. package/dist/delete-Cjxehwj7.mjs.map +0 -1
  215. package/dist/document-output-C5PWbz2p.mjs.map +0 -1
  216. package/dist/edit-BuKMUNVC.mjs.map +0 -1
  217. package/dist/edit-DFnOnk4i.mjs.map +0 -1
  218. package/dist/editor-xrF-j3UE.mjs.map +0 -1
  219. package/dist/get-Doi-NKAh.mjs.map +0 -1
  220. package/dist/logout-Bslt_ZJ4.mjs +0 -11
  221. package/dist/logout-Bslt_ZJ4.mjs.map +0 -1
  222. package/dist/onboarding-C1t1yoay.mjs.map +0 -1
  223. package/dist/output-BM7aBFwt.mjs.map +0 -1
  224. package/dist/payload-CN11pUto.mjs.map +0 -1
  225. package/dist/resolve-BogJOR7R.mjs.map +0 -1
  226. package/dist/resolve-Bp1AfBmM.mjs.map +0 -1
  227. package/dist/resolve-Bw5Po9yK.mjs.map +0 -1
  228. package/dist/resolve-CyjMlaoJ.mjs.map +0 -1
  229. package/dist/set-ClbrGFGv.mjs.map +0 -1
  230. package/dist/shared-C2EAn5h_.mjs.map +0 -1
  231. package/dist/status-Cvyrrx-J.mjs +0 -22
  232. package/dist/status-Cvyrrx-J.mjs.map +0 -1
  233. package/dist/update-CJjwg09n.mjs.map +0 -1
  234. package/dist/update-qfiC-9Og.mjs.map +0 -1
  235. package/dist/whoami-UwcdRchK.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { A as $getCollapsedCaretRange, B as $getSiblingCaret, C as $getCaretInDirection, D as $getChildCaret, Gn as isHTMLElement, K as $isChildCaret, Kn as isInlineDomNode, L as $getPreviousSelection, M as $getEditorDOMRenderConfig, Pn as getDOMTextNode, Qn as removeClassNamesFromElement, R as $getRoot, S as $getAdjacentSiblingOrParentSiblingCaret, St as $splitNode, T as $getCaretRangeInDirection, Tn as addClassNamesToElement, V as $getState, Wn as isHTMLAnchorElement, Xn as mergeRegister, Y as $isElementNode, Yn as makeStepwiseIterator, a as $cloneWithProperties, b as $getAdjacentChildCaret, bt as $setState, dt as $normalizeCaret, f as $createParagraphNode, ht as $rewindSiblingCaret, i as $caretRangeFromSelection, j as $getEditor, k as $getChildCaretOrSelf, lt as $isTextPointCaret, mt as $removeTextFromCaretRange, ot as $isSiblingCaret, r as $caretFromPoint, rt as $isRangeSelection, vt as $setSelection, w as $getCaretRange, xt as $splitAtPointCaretNext, y as $findMatchingParent, yt as $setSelectionFromCaretRange, z as $getSelection, zn as isBlockDomNode } from "./Lexical.node-gYNDt_p9.mjs";
2
- import { o as createRectsFromDOMRange } from "./LexicalSelection.node-Di7GwBCZ.mjs";
1
+ import { A as $getCollapsedCaretRange, B as $getSiblingCaret, C as $getCaretInDirection, D as $getChildCaret, Gn as isHTMLElement, K as $isChildCaret, Kn as isInlineDomNode, L as $getPreviousSelection, M as $getEditorDOMRenderConfig, Pn as getDOMTextNode, Qn as removeClassNamesFromElement, R as $getRoot, S as $getAdjacentSiblingOrParentSiblingCaret, St as $splitNode, T as $getCaretRangeInDirection, Tn as addClassNamesToElement, V as $getState, Wn as isHTMLAnchorElement, Xn as mergeRegister, Y as $isElementNode, Yn as makeStepwiseIterator, a as $cloneWithProperties, b as $getAdjacentChildCaret, bt as $setState, dt as $normalizeCaret, f as $createParagraphNode, ht as $rewindSiblingCaret, i as $caretRangeFromSelection, j as $getEditor, k as $getChildCaretOrSelf, lt as $isTextPointCaret, mt as $removeTextFromCaretRange, ot as $isSiblingCaret, r as $caretFromPoint, rt as $isRangeSelection, vt as $setSelection, w as $getCaretRange, xt as $splitAtPointCaretNext, y as $findMatchingParent, yt as $setSelectionFromCaretRange, z as $getSelection, zn as isBlockDomNode } from "./Lexical.node-BR9e7Cyk.mjs";
2
+ import { o as createRectsFromDOMRange } from "./LexicalSelection.node-CQ8iTYsz.mjs";
3
3
  //#region ../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.dev.mjs
4
4
  /**
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -847,4 +847,4 @@ function makeStateWrapper(stateConfig) {
847
847
  //#endregion
848
848
  export { $descendantsMatching, $dfs, $dfsIterator, $filter, $findMatchingParent, $firstToLastIterator, $getAdjacentCaret, $getAdjacentSiblingOrParentSiblingCaret, $getDepth, $getNearestBlockElementAncestorOrThrow, $getNearestNodeOfType, $getNextRightPreorderNode, $getNextSiblingOrParentSibling, $handleIndentAndOutdent, $insertFirst, $insertNodeIntoLeaf, $insertNodeToNearestRoot, $insertNodeToNearestRootAtCaret, $isEditorIsNestedEditor, $lastToFirstIterator, $restoreEditorState, $reverseDfs, $reverseDfsIterator, $splitNode, $unwrapAndFilterDescendants, $unwrapNode, $wrapNodeInElement, CAN_USE_BEFORE_INPUT, CAN_USE_DOM, IS_ANDROID, IS_ANDROID_CHROME, IS_APPLE, IS_APPLE_WEBKIT, IS_CHROME, IS_FIREFOX, IS_IOS, IS_SAFARI, addClassNamesToElement, calculateZoomLevel, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isMimeType, makeStateWrapper, markSelection, mediaFileReader, mergeRegister, objectKlassEquals, mlcPositionNodeOnRange as positionNodeOnRange, registerNestedElementResolver, removeClassNamesFromElement, selectionAlwaysOnDisplay };
849
849
 
850
- //# sourceMappingURL=LexicalUtils.dev-DiUpsXE8.mjs.map
850
+ //# sourceMappingURL=LexicalUtils.dev-DRRDyAlS.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"LexicalUtils.dev-DiUpsXE8.mjs","names":[],"sources":["../../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.dev.mjs"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { isHTMLElement, mergeRegister, $getSelection, $isRangeSelection, $isElementNode, getDOMTextNode, $getEditor, $getEditorDOMRenderConfig, $getChildCaret, $findMatchingParent, $getChildCaretOrSelf, $getSiblingCaret, $getAdjacentSiblingOrParentSiblingCaret, $caretRangeFromSelection, $getCaretRangeInDirection, $removeTextFromCaretRange, $isTextPointCaret, $splitAtPointCaretNext, $setSelectionFromCaretRange, $getCaretRange, $getPreviousSelection, $caretFromPoint, $getRoot, $createParagraphNode, $getAdjacentChildCaret, $isChildCaret, $normalizeCaret, $getCollapsedCaretRange, $getCaretInDirection, $isSiblingCaret, $rewindSiblingCaret, $cloneWithProperties, $setSelection, makeStepwiseIterator, $getState, $setState } from 'lexical';\nexport { $findMatchingParent, $getAdjacentSiblingOrParentSiblingCaret, $splitNode, addClassNamesToElement, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, mergeRegister, removeClassNamesFromElement } from 'lexical';\nimport { createRectsFromDOMRange } from '@lexical/selection';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst CAN_USE_DOM$1 = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst documentMode = CAN_USE_DOM$1 && 'documentMode' in document ? document.documentMode : null;\nconst IS_APPLE$1 = CAN_USE_DOM$1 && /Mac|iPod|iPhone|iPad/.test(navigator.platform);\nconst IS_FIREFOX$1 = CAN_USE_DOM$1 && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);\nconst CAN_USE_BEFORE_INPUT$1 = CAN_USE_DOM$1 && 'InputEvent' in window && !documentMode ? 'getTargetRanges' in new window.InputEvent('input') : false;\nconst IS_IOS$1 = CAN_USE_DOM$1 && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\nconst IS_ANDROID$1 = CAN_USE_DOM$1 && /Android/.test(navigator.userAgent);\n\n// Exclude Android — Android WebView's UA contains \"Version/X.X ... Safari/537.36\"\n// which falsely matches the Safari regex, activating wrong composition code paths.\nconst IS_SAFARI$1 = CAN_USE_DOM$1 && /Version\\/[\\d.]+.*Safari/.test(navigator.userAgent) && !IS_ANDROID$1;\n\n// Keep these in case we need to use them in the future.\n// export const IS_WINDOWS: boolean = CAN_USE_DOM && /Win/.test(navigator.platform);\nconst IS_CHROME$1 = CAN_USE_DOM$1 && /^(?=.*Chrome).*/i.test(navigator.userAgent);\n// export const canUseTextInputEvent: boolean = CAN_USE_DOM && 'TextEvent' in window && !documentMode;\n\nconst IS_ANDROID_CHROME$1 = CAN_USE_DOM$1 && IS_ANDROID$1 && IS_CHROME$1;\nconst IS_APPLE_WEBKIT$1 = CAN_USE_DOM$1 && /AppleWebKit\\/[\\d.]+/.test(navigator.userAgent) && IS_APPLE$1 && !IS_CHROME$1;\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction px(value) {\n return `${value}px`;\n}\n\nconst mutationObserverConfig = {\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true\n};\nfunction prependDOMNode(parent, node) {\n parent.insertBefore(node, parent.firstChild);\n}\n\n/**\n * Place one or multiple newly created Nodes at the passed Range's position.\n * Multiple nodes will only be created when the Range spans multiple lines (aka\n * client rects).\n *\n * This function can come particularly useful to highlight particular parts of\n * the text without interfering with the EditorState, that will often replicate\n * the state across collab and clipboard.\n *\n * This function accounts for DOM updates which can modify the passed Range.\n * Hence, the function return to remove the listener.\n */\nfunction mlcPositionNodeOnRange(editor, range, onReposition) {\n let rootDOMNode = null;\n let parentDOMNode = null;\n let observer = null;\n let lastNodes = [];\n const wrapperNode = document.createElement('div');\n wrapperNode.style.position = 'relative';\n function position() {\n if (!(rootDOMNode !== null)) {\n formatDevErrorMessage(`Unexpected null rootDOMNode`);\n }\n if (!(parentDOMNode !== null)) {\n formatDevErrorMessage(`Unexpected null parentDOMNode`);\n }\n const {\n left: parentLeft,\n top: parentTop\n } = parentDOMNode.getBoundingClientRect();\n const rects = createRectsFromDOMRange(editor, range);\n if (!wrapperNode.isConnected) {\n prependDOMNode(parentDOMNode, wrapperNode);\n }\n let hasRepositioned = false;\n for (let i = 0; i < rects.length; i++) {\n const rect = rects[i];\n // Try to reuse the previously created Node when possible, no need to\n // remove/create on the most common case reposition case\n const rectNode = lastNodes[i] || document.createElement('div');\n const rectNodeStyle = rectNode.style;\n if (rectNodeStyle.position !== 'absolute') {\n rectNodeStyle.position = 'absolute';\n hasRepositioned = true;\n }\n const left = px(rect.left - parentLeft);\n if (rectNodeStyle.left !== left) {\n rectNodeStyle.left = left;\n hasRepositioned = true;\n }\n const top = px(rect.top - parentTop);\n if (rectNodeStyle.top !== top) {\n rectNode.style.top = top;\n hasRepositioned = true;\n }\n const width = px(rect.width);\n if (rectNodeStyle.width !== width) {\n rectNode.style.width = width;\n hasRepositioned = true;\n }\n const height = px(rect.height);\n if (rectNodeStyle.height !== height) {\n rectNode.style.height = height;\n hasRepositioned = true;\n }\n if (rectNode.parentNode !== wrapperNode) {\n wrapperNode.append(rectNode);\n hasRepositioned = true;\n }\n lastNodes[i] = rectNode;\n }\n while (lastNodes.length > rects.length) {\n lastNodes.pop();\n }\n if (hasRepositioned) {\n onReposition(lastNodes);\n }\n }\n function stop() {\n parentDOMNode = null;\n rootDOMNode = null;\n if (observer !== null) {\n observer.disconnect();\n }\n observer = null;\n wrapperNode.remove();\n for (const node of lastNodes) {\n node.remove();\n }\n lastNodes = [];\n }\n function restart() {\n const currentRootDOMNode = editor.getRootElement();\n if (currentRootDOMNode === null) {\n return stop();\n }\n const currentParentDOMNode = currentRootDOMNode.parentElement;\n if (!isHTMLElement(currentParentDOMNode)) {\n return stop();\n }\n stop();\n rootDOMNode = currentRootDOMNode;\n parentDOMNode = currentParentDOMNode;\n observer = new MutationObserver(mutations => {\n const nextRootDOMNode = editor.getRootElement();\n const nextParentDOMNode = nextRootDOMNode && nextRootDOMNode.parentElement;\n if (nextRootDOMNode !== rootDOMNode || nextParentDOMNode !== parentDOMNode) {\n return restart();\n }\n for (const mutation of mutations) {\n if (!wrapperNode.contains(mutation.target)) {\n // TODO throttle\n return position();\n }\n }\n });\n observer.observe(currentParentDOMNode, mutationObserverConfig);\n position();\n }\n const removeRootListener = editor.registerRootListener(restart);\n return () => {\n removeRootListener();\n stop();\n };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction $getOrderedSelectionPoints(selection) {\n const points = selection.getStartEndPoints();\n return selection.isBackward() ? [points[1], points[0]] : points;\n}\nfunction $rangeTargetFromPoint(point, node, dom) {\n if (point.type === 'text' || !$isElementNode(node)) {\n const textDOM = getDOMTextNode(dom) || dom;\n return [textDOM, point.offset];\n } else {\n const editor = $getEditor();\n const slot = $getEditorDOMRenderConfig(editor).$getDOMSlot(node, dom, editor);\n return [slot.element, slot.getFirstChildOffset() + point.offset];\n }\n}\nfunction $rangeFromPoints(editor, start, startNode, startDOM, end, endNode, endDOM) {\n const editorDocument = editor._window ? editor._window.document : document;\n const range = editorDocument.createRange();\n range.setStart(...$rangeTargetFromPoint(start, startNode, startDOM));\n range.setEnd(...$rangeTargetFromPoint(end, endNode, endDOM));\n return range;\n}\nfunction defaultOnReposition(domNodes) {\n for (const domNode of domNodes) {\n const domNodeStyle = domNode.style;\n if (domNodeStyle.background !== 'Highlight') {\n domNodeStyle.background = 'Highlight';\n }\n if (domNodeStyle.color !== 'HighlightText') {\n domNodeStyle.color = 'HighlightText';\n }\n if (domNodeStyle.marginTop !== px(-1.5)) {\n domNodeStyle.marginTop = px(-1.5);\n }\n if (domNodeStyle.paddingTop !== px(4)) {\n domNodeStyle.paddingTop = px(4);\n }\n if (domNodeStyle.paddingBottom !== px(0)) {\n domNodeStyle.paddingBottom = px(0);\n }\n }\n}\n\n/**\n * Place one or multiple newly created Nodes at the current selection. Multiple\n * nodes will only be created when the selection spans multiple lines (aka\n * client rects).\n *\n * This function can come useful when you want to show the selection but the\n * editor has been focused away.\n */\nfunction markSelection(editor, onReposition = defaultOnReposition) {\n let previousAnchorNode = null;\n let previousAnchorNodeDOM = null;\n let previousAnchorOffset = null;\n let previousFocusNode = null;\n let previousFocusNodeDOM = null;\n let previousFocusOffset = null;\n let removeRangeListener = () => {};\n function compute(editorState) {\n editorState.read(() => {\n const selection = $getSelection();\n if (!$isRangeSelection(selection)) {\n // TODO\n previousAnchorNode = null;\n previousAnchorOffset = null;\n previousFocusNode = null;\n previousFocusOffset = null;\n removeRangeListener();\n removeRangeListener = () => {};\n return;\n }\n const [start, end] = $getOrderedSelectionPoints(selection);\n const currentStartNode = start.getNode();\n const currentStartNodeKey = currentStartNode.getKey();\n const currentStartOffset = start.offset;\n const currentEndNode = end.getNode();\n const currentEndNodeKey = currentEndNode.getKey();\n const currentEndOffset = end.offset;\n const currentStartNodeDOM = editor.getElementByKey(currentStartNodeKey);\n const currentEndNodeDOM = editor.getElementByKey(currentEndNodeKey);\n const differentStartDOM = previousAnchorNode === null || currentStartNodeDOM !== previousAnchorNodeDOM || currentStartOffset !== previousAnchorOffset || currentStartNodeKey !== previousAnchorNode.getKey();\n const differentEndDOM = previousFocusNode === null || currentEndNodeDOM !== previousFocusNodeDOM || currentEndOffset !== previousFocusOffset || currentEndNodeKey !== previousFocusNode.getKey();\n if ((differentStartDOM || differentEndDOM) && currentStartNodeDOM !== null && currentEndNodeDOM !== null) {\n const range = $rangeFromPoints(editor, start, currentStartNode, currentStartNodeDOM, end, currentEndNode, currentEndNodeDOM);\n removeRangeListener();\n removeRangeListener = mlcPositionNodeOnRange(editor, range, onReposition);\n }\n previousAnchorNode = currentStartNode;\n previousAnchorNodeDOM = currentStartNodeDOM;\n previousAnchorOffset = currentStartOffset;\n previousFocusNode = currentEndNode;\n previousFocusNodeDOM = currentEndNodeDOM;\n previousFocusOffset = currentEndOffset;\n });\n }\n compute(editor.getEditorState());\n return mergeRegister(editor.registerUpdateListener(({\n editorState\n }) => compute(editorState)), () => {\n removeRangeListener();\n });\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction selectionAlwaysOnDisplay(editor, onReposition) {\n let removeSelectionMark = null;\n const onSelectionChange = () => {\n const domSelection = getSelection();\n const domAnchorNode = domSelection && domSelection.anchorNode;\n const editorRootElement = editor.getRootElement();\n const isSelectionInsideEditor = domAnchorNode !== null && editorRootElement !== null && editorRootElement.contains(domAnchorNode);\n if (isSelectionInsideEditor) {\n if (removeSelectionMark !== null) {\n removeSelectionMark();\n removeSelectionMark = null;\n }\n } else {\n if (removeSelectionMark === null) {\n removeSelectionMark = markSelection(editor, onReposition);\n }\n }\n };\n return editor.registerRootListener(rootElement => {\n if (rootElement) {\n const document = rootElement.ownerDocument;\n document.addEventListener('selectionchange', onSelectionChange);\n onSelectionChange();\n return () => {\n if (removeSelectionMark !== null) {\n removeSelectionMark();\n }\n document.removeEventListener('selectionchange', onSelectionChange);\n };\n }\n });\n}\n\n// Hotfix to export these with inlined types #5918\nconst CAN_USE_BEFORE_INPUT = CAN_USE_BEFORE_INPUT$1;\nconst CAN_USE_DOM = CAN_USE_DOM$1;\nconst IS_ANDROID = IS_ANDROID$1;\nconst IS_ANDROID_CHROME = IS_ANDROID_CHROME$1;\nconst IS_APPLE = IS_APPLE$1;\nconst IS_APPLE_WEBKIT = IS_APPLE_WEBKIT$1;\nconst IS_CHROME = IS_CHROME$1;\nconst IS_FIREFOX = IS_FIREFOX$1;\nconst IS_IOS = IS_IOS$1;\nconst IS_SAFARI = IS_SAFARI$1;\n\n/**\n * Returns true if the file type matches the types passed within the acceptableMimeTypes array, false otherwise.\n * The types passed must be strings and are CASE-SENSITIVE.\n * eg. if file is of type 'text' and acceptableMimeTypes = ['TEXT', 'IMAGE'] the function will return false.\n * @param file - The file you want to type check.\n * @param acceptableMimeTypes - An array of strings of types which the file is checked against.\n * @returns true if the file is an acceptable mime type, false otherwise.\n */\nfunction isMimeType(file, acceptableMimeTypes) {\n for (const acceptableType of acceptableMimeTypes) {\n if (file.type.startsWith(acceptableType)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Lexical File Reader with:\n * 1. MIME type support\n * 2. batched results (HistoryPlugin compatibility)\n * 3. Order aware (respects the order when multiple Files are passed)\n *\n * const filesResult = await mediaFileReader(files, ['image/']);\n * filesResult.forEach(file => editor.dispatchCommand('INSERT_IMAGE', \\\\{\n * src: file.result,\n * \\\\}));\n */\nfunction mediaFileReader(files, acceptableMimeTypes) {\n const filesIterator = files[Symbol.iterator]();\n return new Promise((resolve, reject) => {\n const processed = [];\n const handleNextFile = () => {\n const {\n done,\n value: file\n } = filesIterator.next();\n if (done) {\n return resolve(processed);\n }\n const fileReader = new FileReader();\n fileReader.addEventListener('error', reject);\n fileReader.addEventListener('load', () => {\n const result = fileReader.result;\n if (typeof result === 'string') {\n processed.push({\n file,\n result\n });\n }\n handleNextFile();\n });\n if (isMimeType(file, acceptableMimeTypes)) {\n fileReader.readAsDataURL(file);\n } else {\n handleNextFile();\n }\n };\n handleNextFile();\n });\n}\n/**\n * \"Depth-First Search\" starts at the root/top node of a tree and goes as far as it can down a branch end\n * before backtracking and finding a new path. Consider solving a maze by hugging either wall, moving down a\n * branch until you hit a dead-end (leaf) and backtracking to find the nearest branching path and repeat.\n * It will then return all the nodes found in the search in an array of objects.\n * Preorder traversal is used, meaning that nodes are listed in the order of when they are FIRST encountered.\n * @param startNode - The node to start the search (inclusive), if omitted, it will start at the root node.\n * @param endNode - The node to end the search (inclusive), if omitted, it will find all descendants of the startingNode. If endNode\n * is an ElementNode, it will stop before visiting any of its children.\n * @returns An array of objects of all the nodes found by the search, including their depth into the tree.\n * \\\\{depth: number, node: LexicalNode\\\\} It will always return at least 1 node (the start node).\n */\nfunction $dfs(startNode, endNode) {\n return Array.from($dfsIterator(startNode, endNode));\n}\n\n/**\n * Get the adjacent caret in the same direction\n *\n * @param caret A caret or null\n * @returns `caret.getAdjacentCaret()` or `null`\n */\nfunction $getAdjacentCaret(caret) {\n return caret ? caret.getAdjacentCaret() : null;\n}\n\n/**\n * $dfs iterator (right to left). Tree traversal is done on the fly as new values are requested with O(1) memory.\n * @param startNode - The node to start the search, if omitted, it will start at the root node.\n * @param endNode - The node to end the search, if omitted, it will find all descendants of the startingNode.\n * @returns An iterator, each yielded value is a DFSNode. It will always return at least 1 node (the start node).\n */\nfunction $reverseDfs(startNode, endNode) {\n return Array.from($reverseDfsIterator(startNode, endNode));\n}\n\n/**\n * $dfs iterator (left to right). Tree traversal is done on the fly as new values are requested with O(1) memory.\n * Preorder traversal is used, meaning that nodes are iterated over in the order of when they are FIRST encountered.\n * @param startNode - The node to start the search (inclusive), if omitted, it will start at the root node.\n * @param endNode - The node to end the search (inclusive), if omitted, it will find all descendants of the startingNode.\n * If endNode is an ElementNode, the iterator will end as soon as it reaches the endNode (no children will be visited).\n * @returns An iterator, each yielded value is a DFSNode. It will always return at least 1 node (the start node).\n */\nfunction $dfsIterator(startNode, endNode) {\n return $dfsCaretIterator('next', startNode, endNode);\n}\nfunction $getEndCaret(startNode, direction) {\n const rval = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(startNode, direction));\n return rval && rval[0];\n}\nfunction $dfsCaretIterator(direction, startNode, endNode) {\n const root = $getRoot();\n const start = startNode || root;\n const startCaret = $isElementNode(start) ? $getChildCaret(start, direction) : $getSiblingCaret(start, direction);\n const startDepth = $getDepth(start);\n const endCaret = endNode ? $getAdjacentChildCaret($getChildCaretOrSelf($getSiblingCaret(endNode, direction))) || $getEndCaret(endNode, direction) : $getEndCaret(start, direction);\n let depth = startDepth;\n return makeStepwiseIterator({\n hasNext: state => state !== null,\n initial: startCaret,\n map: state => ({\n depth,\n node: state.origin\n }),\n step: state => {\n if (state.isSameNodeCaret(endCaret)) {\n return null;\n }\n if ($isChildCaret(state)) {\n depth++;\n }\n const rval = $getAdjacentSiblingOrParentSiblingCaret(state);\n if (!rval || rval[0].isSameNodeCaret(endCaret)) {\n return null;\n }\n depth += rval[1];\n return rval[0];\n }\n });\n}\n\n/**\n * Returns the Node sibling when this exists, otherwise the closest parent sibling. For example\n * R -> P -> T1, T2\n * -> P2\n * returns T2 for node T1, P2 for node T2, and null for node P2.\n * @param node LexicalNode.\n * @returns An array (tuple) containing the found Lexical node and the depth difference, or null, if this node doesn't exist.\n */\nfunction $getNextSiblingOrParentSibling(node) {\n const rval = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(node, 'next'));\n return rval && [rval[0].origin, rval[1]];\n}\nfunction $getDepth(node) {\n let depth = -1;\n for (let innerNode = node; innerNode !== null; innerNode = innerNode.getParent()) {\n depth++;\n }\n return depth;\n}\n\n/**\n * Performs a right-to-left preorder tree traversal.\n * From the starting node it goes to the rightmost child, than backtracks to parent and finds new rightmost path.\n * It will return the next node in traversal sequence after the startingNode.\n * The traversal is similar to $dfs functions above, but the nodes are visited right-to-left, not left-to-right.\n * @param startingNode - The node to start the search.\n * @returns The next node in pre-order right to left traversal sequence or `null`, if the node does not exist\n */\nfunction $getNextRightPreorderNode(startingNode) {\n const startCaret = $getChildCaretOrSelf($getSiblingCaret(startingNode, 'previous'));\n const next = $getAdjacentSiblingOrParentSiblingCaret(startCaret, 'root');\n return next && next[0].origin;\n}\n\n/**\n * $dfs iterator (right to left). Tree traversal is done on the fly as new values are requested with O(1) memory.\n * @param startNode - The node to start the search, if omitted, it will start at the root node.\n * @param endNode - The node to end the search, if omitted, it will find all descendants of the startingNode.\n * @returns An iterator, each yielded value is a DFSNode. It will always return at least 1 node (the start node).\n */\nfunction $reverseDfsIterator(startNode, endNode) {\n return $dfsCaretIterator('previous', startNode, endNode);\n}\n\n/**\n * Takes a node and traverses up its ancestors (toward the root node)\n * in order to find a specific type of node.\n * @param node - the node to begin searching.\n * @param klass - an instance of the type of node to look for.\n * @returns the node of type klass that was passed, or null if none exist.\n */\nfunction $getNearestNodeOfType(node, klass) {\n let parent = node;\n while (parent != null) {\n if (parent instanceof klass) {\n return parent;\n }\n parent = parent.getParent();\n }\n return null;\n}\n\n/**\n * Returns the element node of the nearest ancestor, otherwise throws an error.\n * @param startNode - The starting node of the search\n * @returns The ancestor node found\n */\nfunction $getNearestBlockElementAncestorOrThrow(startNode) {\n const blockNode = $findMatchingParent(startNode, node => $isElementNode(node) && !node.isInline());\n if (!$isElementNode(blockNode)) {\n {\n formatDevErrorMessage(`Expected node ${startNode.__key} to have closest block element node.`);\n }\n }\n return blockNode;\n}\n/**\n * Attempts to resolve nested element nodes of the same type into a single node of that type.\n * It is generally used for marks/commenting\n * @param editor - The lexical editor\n * @param targetNode - The target for the nested element to be extracted from.\n * @param cloneNode - See {@link $createMarkNode}\n * @param handleOverlap - Handles any overlap between the node to extract and the targetNode\n * @returns The lexical editor\n */\nfunction registerNestedElementResolver(editor, targetNode, cloneNode, handleOverlap) {\n const $isTargetNode = node => {\n return node instanceof targetNode;\n };\n const $findMatch = node => {\n // First validate we don't have any children that are of the target,\n // as we need to handle them first.\n const children = node.getChildren();\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if ($isTargetNode(child)) {\n return null;\n }\n }\n let parentNode = node;\n let childNode = node;\n while (parentNode !== null) {\n childNode = parentNode;\n parentNode = parentNode.getParent();\n if ($isTargetNode(parentNode)) {\n return {\n child: childNode,\n parent: parentNode\n };\n }\n }\n return null;\n };\n const $elementNodeTransform = node => {\n const match = $findMatch(node);\n if (match !== null) {\n const {\n child,\n parent\n } = match;\n\n // Simple path, we can move child out and siblings into a new parent.\n\n if (child.is(node)) {\n handleOverlap(parent, node);\n const nextSiblings = child.getNextSiblings();\n const nextSiblingsLength = nextSiblings.length;\n parent.insertAfter(child);\n if (nextSiblingsLength !== 0) {\n const newParent = cloneNode(parent);\n child.insertAfter(newParent);\n for (let i = 0; i < nextSiblingsLength; i++) {\n newParent.append(nextSiblings[i]);\n }\n }\n if (!parent.canBeEmpty() && parent.getChildrenSize() === 0) {\n parent.remove();\n }\n }\n }\n };\n return editor.registerNodeTransform(targetNode, $elementNodeTransform);\n}\n\n/**\n * Clones the editor and marks it as dirty to be reconciled. If there was a selection,\n * it would be set back to its previous state, or null otherwise.\n * @param editor - The lexical editor\n * @param editorState - The editor's state\n */\nfunction $restoreEditorState(editor, editorState) {\n const FULL_RECONCILE = 2;\n const nodeMap = new Map();\n const activeEditorState = editor._pendingEditorState;\n for (const [key, node] of editorState._nodeMap) {\n nodeMap.set(key, $cloneWithProperties(node));\n }\n if (activeEditorState) {\n activeEditorState._nodeMap = nodeMap;\n }\n editor._dirtyType = FULL_RECONCILE;\n const selection = editorState._selection;\n $setSelection(selection === null ? null : selection.clone());\n}\n\n/**\n * If the selected insertion area is the root/shadow root node (see {@link lexical!$isRootOrShadowRoot}),\n * the node will be appended there, otherwise, it will be inserted before the insertion area.\n * If there is no selection where the node is to be inserted, it will be appended after any current nodes\n * within the tree, as a child of the root node. A paragraph will then be added after the inserted node and selected.\n * @param node - The node to be inserted\n * @returns The node after its insertion\n */\nfunction $insertNodeToNearestRoot(node) {\n const selection = $getSelection() || $getPreviousSelection();\n let initialCaret;\n if ($isRangeSelection(selection)) {\n initialCaret = $caretFromPoint(selection.focus, 'next');\n } else {\n if (selection != null) {\n const nodes = selection.getNodes();\n const lastNode = nodes[nodes.length - 1];\n if (lastNode) {\n initialCaret = $getSiblingCaret(lastNode, 'next');\n }\n }\n initialCaret = initialCaret || $getChildCaret($getRoot(), 'previous').getFlipped().insert($createParagraphNode());\n }\n const insertCaret = $insertNodeToNearestRootAtCaret(node, initialCaret);\n const adjacent = $getAdjacentChildCaret(insertCaret);\n const selectionCaret = $isChildCaret(adjacent) ? $normalizeCaret(adjacent) : insertCaret;\n $setSelectionFromCaretRange($getCollapsedCaretRange(selectionCaret));\n return node.getLatest();\n}\n\n/**\n * If the insertion caret is the root/shadow root node (see {@link lexical!$isRootOrShadowRoot}),\n * the node will be inserted there, otherwise the parent nodes will be split according to the\n * given options.\n * @param node - The node to be inserted\n * @param caret - The location to insert or split from\n * @returns The node after its insertion\n */\nfunction $insertNodeToNearestRootAtCaret(node, caret, options) {\n let insertCaret = $getCaretInDirection(caret, 'next');\n // Normalize boundary cases for TextPointCaret\n if ($isTextPointCaret(insertCaret)) {\n if (insertCaret.offset === 0) {\n insertCaret = $getSiblingCaret(insertCaret.origin, 'previous').getFlipped();\n } else if (insertCaret.offset === insertCaret.origin.getTextContentSize()) {\n insertCaret = $getSiblingCaret(insertCaret.origin, 'next');\n }\n }\n // Make sure we have a distinct node as the origin\n if (insertCaret.origin.is(node)) {\n if (!$isSiblingCaret(insertCaret)) {\n formatDevErrorMessage(`$insertNodeToNearestRootAtCaret node ${node.getKey()} of type ${node.getType()} can not be inserted into itself`);\n }\n insertCaret = $rewindSiblingCaret(insertCaret);\n }\n // Handle split boundary conditions where node is being inserted adjacent to itself\n if (node.is(insertCaret.getNodeAtCaret()) || node.is(insertCaret.getFlipped().getNodeAtCaret())) {\n node.remove(true);\n }\n for (let nextCaret = insertCaret; nextCaret; nextCaret = $splitAtPointCaretNext(nextCaret, options)) {\n insertCaret = nextCaret;\n }\n if (!!$isTextPointCaret(insertCaret)) {\n formatDevErrorMessage(`$insertNodeToNearestRootAtCaret: An unattached TextNode can not be split`);\n }\n insertCaret.insert(node.isInline() ? $createParagraphNode().append(node) : node);\n return $getCaretInDirection($getSiblingCaret(node.getLatest(), 'next'), caret.direction);\n}\n\n/**\n * Inserts a node into leaf — the deepest accessible node at the carriage position\n * @param node - The node to be inserted\n */\nfunction $insertNodeIntoLeaf(node) {\n const selection = $getSelection();\n if (!$isRangeSelection(selection)) {\n if (selection) {\n selection.insertNodes([node]);\n }\n return;\n }\n const caretRange = $caretRangeFromSelection(selection);\n let insertCaret = $getCaretRangeInDirection($removeTextFromCaretRange(caretRange), 'next').anchor;\n if ($isTextPointCaret(insertCaret)) {\n const nextAnchor = $splitAtPointCaretNext(insertCaret);\n if (!nextAnchor) {\n return;\n }\n insertCaret = nextAnchor;\n }\n const focus = insertCaret.getFlipped();\n focus.insert(node);\n $setSelectionFromCaretRange($getCaretRange(focus, focus));\n}\n\n/**\n * Wraps the node into another node created from a createElementNode function, eg. $createParagraphNode\n * @param node - Node to be wrapped.\n * @param createElementNode - Creates a new lexical element to wrap the to-be-wrapped node and returns it.\n * @returns A new lexical element with the previous node appended within (as a child, including its children).\n */\nfunction $wrapNodeInElement(node, createElementNode) {\n const elementNode = createElementNode();\n node.replace(elementNode);\n elementNode.append(node);\n return elementNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n/**\n * @param object = The instance of the type\n * @param objectClass = The class of the type\n * @returns Whether the object is has the same Klass of the objectClass, ignoring the difference across window (e.g. different iframes)\n */\nfunction objectKlassEquals(object, objectClass) {\n return object !== null ? Object.getPrototypeOf(object).constructor.name === objectClass.name : false;\n}\n\n/**\n * @deprecated Use Array filter or flatMap\n *\n * Filter the nodes\n * @param nodes Array of nodes that needs to be filtered\n * @param filterFn A filter function that returns node if the current node satisfies the condition otherwise null\n * @returns Array of filtered nodes\n */\n\nfunction $filter(nodes, filterFn) {\n const result = [];\n for (let i = 0; i < nodes.length; i++) {\n const node = filterFn(nodes[i]);\n if (node !== null) {\n result.push(node);\n }\n }\n return result;\n}\n\n/**\n * Applies the provided callback to each indentable block element in the Selection\n *\n * @param indentOrOutdent callback for performing the indent or outdent action\n * on a given block element.\n * @returns true if at least one block was handled, false otherwise.\n */\nfunction $handleIndentAndOutdent(indentOrOutdent) {\n const selection = $getSelection();\n if (!$isRangeSelection(selection)) {\n return false;\n }\n const alreadyHandled = new Set();\n const nodes = selection.getNodes();\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const key = node.getKey();\n if (alreadyHandled.has(key)) {\n continue;\n }\n const parentBlock = $findMatchingParent(node, parentNode => $isElementNode(parentNode) && !parentNode.isInline());\n if (parentBlock === null) {\n continue;\n }\n const parentKey = parentBlock.getKey();\n if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) {\n alreadyHandled.add(parentKey);\n indentOrOutdent(parentBlock);\n }\n }\n return alreadyHandled.size > 0;\n}\n\n/**\n * Appends the node before the first child of the parent node\n * @param parent A parent node\n * @param node Node that needs to be appended\n */\nfunction $insertFirst(parent, node) {\n $getChildCaret(parent, 'next').insert(node);\n}\nlet NEEDS_MANUAL_ZOOM = IS_FIREFOX || !CAN_USE_DOM ? false : undefined;\nfunction needsManualZoom() {\n if (NEEDS_MANUAL_ZOOM === undefined) {\n // If the browser implements standardized CSS zoom, then the client rect\n // will be wider after zoom is applied\n // https://chromestatus.com/feature/5198254868529152\n // https://github.com/facebook/lexical/issues/6863\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.opacity = '0';\n div.style.width = '100px';\n div.style.left = '-1000px';\n document.body.appendChild(div);\n const noZoom = div.getBoundingClientRect();\n div.style.setProperty('zoom', '2');\n NEEDS_MANUAL_ZOOM = div.getBoundingClientRect().width === noZoom.width;\n document.body.removeChild(div);\n }\n return NEEDS_MANUAL_ZOOM;\n}\n\n/**\n * Calculates the zoom level of an element as a result of using\n * css zoom property. For browsers that implement standardized CSS\n * zoom (Firefox, Chrome >= 128), this will always return 1.\n * @param element\n * @param useManualZoom - If true, always use zoom level will be calculated manually, otherwise it will be calculated on as needed basis.\n */\nfunction calculateZoomLevel(element, useManualZoom = false) {\n let zoom = 1;\n if (needsManualZoom() || useManualZoom) {\n while (element) {\n zoom *= Number(window.getComputedStyle(element).getPropertyValue('zoom'));\n element = element.parentElement;\n }\n }\n return zoom;\n}\n\n/**\n * Checks if the editor is a nested editor created by LexicalNestedComposer\n */\nfunction $isEditorIsNestedEditor(editor) {\n return editor._parentEditor !== null;\n}\n\n/**\n * A depth first last-to-first traversal of root that stops at each node that matches\n * $predicate and ensures that its parent is root. This is typically used to discard\n * invalid or unsupported wrapping nodes. For example, a TableNode must only have\n * TableRowNode as children, but an importer might add invalid nodes based on\n * caption, tbody, thead, etc. and this will unwrap and discard those.\n *\n * @param root The root to start the traversal\n * @param $predicate Should return true for nodes that are permitted to be children of root\n * @returns true if this unwrapped or removed any nodes\n */\nfunction $unwrapAndFilterDescendants(root, $predicate) {\n return $unwrapAndFilterDescendantsImpl(root, $predicate, null);\n}\nfunction $unwrapAndFilterDescendantsImpl(root, $predicate, $onSuccess) {\n let didMutate = false;\n for (const node of $lastToFirstIterator(root)) {\n if ($predicate(node)) {\n if ($onSuccess !== null) {\n $onSuccess(node);\n }\n continue;\n }\n didMutate = true;\n if ($isElementNode(node)) {\n $unwrapAndFilterDescendantsImpl(node, $predicate, $onSuccess || (child => node.insertAfter(child)));\n }\n node.remove();\n }\n return didMutate;\n}\n\n/**\n * A depth first traversal of the children array that stops at and collects\n * each node that `$predicate` matches. This is typically used to discard\n * invalid or unsupported wrapping nodes on a children array in the `after`\n * of an {@link lexical!DOMConversionOutput}. For example, a TableNode must only have\n * TableRowNode as children, but an importer might add invalid nodes based on\n * caption, tbody, thead, etc. and this will unwrap and discard those.\n *\n * This function is read-only and performs no mutation operations, which makes\n * it suitable for import and export purposes but likely not for any in-place\n * mutation. You should use {@link $unwrapAndFilterDescendants} for in-place\n * mutations such as node transforms.\n *\n * @param children The children to traverse\n * @param $predicate Should return true for nodes that are permitted to be children of root\n * @returns The children or their descendants that match $predicate\n */\n\nfunction $descendantsMatching(children, $predicate) {\n const result = [];\n const stack = Array.from(children).reverse();\n for (let child = stack.pop(); child !== undefined; child = stack.pop()) {\n if ($predicate(child)) {\n result.push(child);\n } else if ($isElementNode(child)) {\n for (const grandchild of $lastToFirstIterator(child)) {\n stack.push(grandchild);\n }\n }\n }\n return result;\n}\n\n/**\n * Return an iterator that yields each child of node from first to last, taking\n * care to preserve the next sibling before yielding the value in case the caller\n * removes the yielded node.\n *\n * @param node The node whose children to iterate\n * @returns An iterator of the node's children\n */\nfunction $firstToLastIterator(node) {\n return $childIterator($getChildCaret(node, 'next'));\n}\n\n/**\n * Return an iterator that yields each child of node from last to first, taking\n * care to preserve the previous sibling before yielding the value in case the caller\n * removes the yielded node.\n *\n * @param node The node whose children to iterate\n * @returns An iterator of the node's children\n */\nfunction $lastToFirstIterator(node) {\n return $childIterator($getChildCaret(node, 'previous'));\n}\nfunction $childIterator(startCaret) {\n const seen = new Set() ;\n return makeStepwiseIterator({\n hasNext: $isSiblingCaret,\n initial: startCaret.getAdjacentCaret(),\n map: caret => {\n const origin = caret.origin.getLatest();\n if (seen !== null) {\n const key = origin.getKey();\n if (!!seen.has(key)) {\n formatDevErrorMessage(`$childIterator: Cycle detected, node with key ${String(key)} has already been traversed`);\n }\n seen.add(key);\n }\n return origin;\n },\n step: caret => caret.getAdjacentCaret()\n });\n}\n\n/**\n * Replace this node with its children\n *\n * @param node The ElementNode to unwrap and remove\n */\nfunction $unwrapNode(node) {\n $rewindSiblingCaret($getSiblingCaret(node, 'next')).splice(1, node.getChildren());\n}\n\n/**\n * A wrapper that creates bound functions and methods for the\n * StateConfig to save some boilerplate when defining methods\n * or exporting only the accessors from your modules rather\n * than exposing the StateConfig directly.\n */\n\n/**\n * EXPERIMENTAL\n *\n * A convenience interface for working with {@link $getState} and\n * {@link $setState}.\n *\n * @param stateConfig The stateConfig to wrap with convenience functionality\n * @returns a StateWrapper\n */\nfunction makeStateWrapper(stateConfig) {\n const $get = node => $getState(node, stateConfig);\n const $set = (node, valueOrUpdater) => $setState(node, stateConfig, valueOrUpdater);\n return {\n $get,\n $set,\n accessors: [$get, $set],\n makeGetterMethod: () => function $getter() {\n return $get(this);\n },\n makeSetterMethod: () => function $setter(valueOrUpdater) {\n return $set(this, valueOrUpdater);\n },\n stateConfig\n };\n}\n\nexport { $descendantsMatching, $dfs, $dfsIterator, $filter, $firstToLastIterator, $getAdjacentCaret, $getDepth, $getNearestBlockElementAncestorOrThrow, $getNearestNodeOfType, $getNextRightPreorderNode, $getNextSiblingOrParentSibling, $handleIndentAndOutdent, $insertFirst, $insertNodeIntoLeaf, $insertNodeToNearestRoot, $insertNodeToNearestRootAtCaret, $isEditorIsNestedEditor, $lastToFirstIterator, $restoreEditorState, $reverseDfs, $reverseDfsIterator, $unwrapAndFilterDescendants, $unwrapNode, $wrapNodeInElement, CAN_USE_BEFORE_INPUT, CAN_USE_DOM, IS_ANDROID, IS_ANDROID_CHROME, IS_APPLE, IS_APPLE_WEBKIT, IS_CHROME, IS_FIREFOX, IS_IOS, IS_SAFARI, calculateZoomLevel, isMimeType, makeStateWrapper, markSelection, mediaFileReader, objectKlassEquals, mlcPositionNodeOnRange as positionNodeOnRange, registerNestedElementResolver, selectionAlwaysOnDisplay };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;AAsBA,SAAS,sBAAsB,SAAS;CACtC,MAAM,IAAI,MAAM,OAAO;AACzB;;;;;;;;AAUA,MAAM,gBAAgB,OAAO,WAAW,eAAe,OAAO,OAAO,aAAa,eAAe,OAAO,OAAO,SAAS,kBAAkB;;;;;;;;AAU1I,MAAM,eAAe,iBAAiB,kBAAkB,WAAW,SAAS,eAAe;AAC3F,MAAM,aAAa,iBAAiB,uBAAuB,KAAK,UAAU,QAAQ;AAClF,MAAM,eAAe,iBAAiB,mCAAmC,KAAK,UAAU,SAAS;AACjG,MAAM,yBAAyB,iBAAiB,gBAAgB,UAAU,CAAC,eAAe,qBAAqB,IAAI,OAAO,WAAW,OAAO,IAAI;AAChJ,MAAM,WAAW,iBAAiB,mBAAmB,KAAK,UAAU,SAAS,KAAK,CAAC,OAAO;AAC1F,MAAM,eAAe,iBAAiB,UAAU,KAAK,UAAU,SAAS;AAIxE,MAAM,cAAc,iBAAiB,0BAA0B,KAAK,UAAU,SAAS,KAAK,CAAC;AAI7F,MAAM,cAAc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AI,GAAG,GAChB,sBAAsB,iDAAiD,OAAO,GAAG,EAAE,4BAA4B;IAEjH,KAAK,IAAI,GAAG;GACd;GACA,OAAO;EACT;EACA,OAAM,UAAS,MAAM,iBAAiB;CACxC,CAAC;AACH;;;;;;AAOA,SAAS,YAAY,MAAM;CACzB,oBAAoB,iBAAiB,MAAM,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,YAAY,CAAC;AAClF;;;;;;;;;;;;;;;;AAkBA,SAAS,iBAAiB,aAAa;CACrC,MAAM,QAAO,SAAQ,UAAU,MAAM,WAAW;CAChD,MAAM,QAAQ,MAAM,mBAAmB,UAAU,MAAM,aAAa,cAAc;CAClF,OAAO;EACL;EACA;EACA,WAAW,CAAC,MAAM,IAAI;EACtB,wBAAwB,SAAS,UAAU;GACzC,OAAO,KAAK,IAAI;EAClB;EACA,wBAAwB,SAAS,QAAQ,gBAAgB;GACvD,OAAO,KAAK,MAAM,cAAc;EAClC;EACA;CACF;AACF"}
1
+ {"version":3,"file":"LexicalUtils.dev-DRRDyAlS.mjs","names":[],"sources":["../../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.dev.mjs"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { isHTMLElement, mergeRegister, $getSelection, $isRangeSelection, $isElementNode, getDOMTextNode, $getEditor, $getEditorDOMRenderConfig, $getChildCaret, $findMatchingParent, $getChildCaretOrSelf, $getSiblingCaret, $getAdjacentSiblingOrParentSiblingCaret, $caretRangeFromSelection, $getCaretRangeInDirection, $removeTextFromCaretRange, $isTextPointCaret, $splitAtPointCaretNext, $setSelectionFromCaretRange, $getCaretRange, $getPreviousSelection, $caretFromPoint, $getRoot, $createParagraphNode, $getAdjacentChildCaret, $isChildCaret, $normalizeCaret, $getCollapsedCaretRange, $getCaretInDirection, $isSiblingCaret, $rewindSiblingCaret, $cloneWithProperties, $setSelection, makeStepwiseIterator, $getState, $setState } from 'lexical';\nexport { $findMatchingParent, $getAdjacentSiblingOrParentSiblingCaret, $splitNode, addClassNamesToElement, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, mergeRegister, removeClassNamesFromElement } from 'lexical';\nimport { createRectsFromDOMRange } from '@lexical/selection';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst CAN_USE_DOM$1 = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst documentMode = CAN_USE_DOM$1 && 'documentMode' in document ? document.documentMode : null;\nconst IS_APPLE$1 = CAN_USE_DOM$1 && /Mac|iPod|iPhone|iPad/.test(navigator.platform);\nconst IS_FIREFOX$1 = CAN_USE_DOM$1 && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);\nconst CAN_USE_BEFORE_INPUT$1 = CAN_USE_DOM$1 && 'InputEvent' in window && !documentMode ? 'getTargetRanges' in new window.InputEvent('input') : false;\nconst IS_IOS$1 = CAN_USE_DOM$1 && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\nconst IS_ANDROID$1 = CAN_USE_DOM$1 && /Android/.test(navigator.userAgent);\n\n// Exclude Android — Android WebView's UA contains \"Version/X.X ... Safari/537.36\"\n// which falsely matches the Safari regex, activating wrong composition code paths.\nconst IS_SAFARI$1 = CAN_USE_DOM$1 && /Version\\/[\\d.]+.*Safari/.test(navigator.userAgent) && !IS_ANDROID$1;\n\n// Keep these in case we need to use them in the future.\n// export const IS_WINDOWS: boolean = CAN_USE_DOM && /Win/.test(navigator.platform);\nconst IS_CHROME$1 = CAN_USE_DOM$1 && /^(?=.*Chrome).*/i.test(navigator.userAgent);\n// export const canUseTextInputEvent: boolean = CAN_USE_DOM && 'TextEvent' in window && !documentMode;\n\nconst IS_ANDROID_CHROME$1 = CAN_USE_DOM$1 && IS_ANDROID$1 && IS_CHROME$1;\nconst IS_APPLE_WEBKIT$1 = CAN_USE_DOM$1 && /AppleWebKit\\/[\\d.]+/.test(navigator.userAgent) && IS_APPLE$1 && !IS_CHROME$1;\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction px(value) {\n return `${value}px`;\n}\n\nconst mutationObserverConfig = {\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true\n};\nfunction prependDOMNode(parent, node) {\n parent.insertBefore(node, parent.firstChild);\n}\n\n/**\n * Place one or multiple newly created Nodes at the passed Range's position.\n * Multiple nodes will only be created when the Range spans multiple lines (aka\n * client rects).\n *\n * This function can come particularly useful to highlight particular parts of\n * the text without interfering with the EditorState, that will often replicate\n * the state across collab and clipboard.\n *\n * This function accounts for DOM updates which can modify the passed Range.\n * Hence, the function return to remove the listener.\n */\nfunction mlcPositionNodeOnRange(editor, range, onReposition) {\n let rootDOMNode = null;\n let parentDOMNode = null;\n let observer = null;\n let lastNodes = [];\n const wrapperNode = document.createElement('div');\n wrapperNode.style.position = 'relative';\n function position() {\n if (!(rootDOMNode !== null)) {\n formatDevErrorMessage(`Unexpected null rootDOMNode`);\n }\n if (!(parentDOMNode !== null)) {\n formatDevErrorMessage(`Unexpected null parentDOMNode`);\n }\n const {\n left: parentLeft,\n top: parentTop\n } = parentDOMNode.getBoundingClientRect();\n const rects = createRectsFromDOMRange(editor, range);\n if (!wrapperNode.isConnected) {\n prependDOMNode(parentDOMNode, wrapperNode);\n }\n let hasRepositioned = false;\n for (let i = 0; i < rects.length; i++) {\n const rect = rects[i];\n // Try to reuse the previously created Node when possible, no need to\n // remove/create on the most common case reposition case\n const rectNode = lastNodes[i] || document.createElement('div');\n const rectNodeStyle = rectNode.style;\n if (rectNodeStyle.position !== 'absolute') {\n rectNodeStyle.position = 'absolute';\n hasRepositioned = true;\n }\n const left = px(rect.left - parentLeft);\n if (rectNodeStyle.left !== left) {\n rectNodeStyle.left = left;\n hasRepositioned = true;\n }\n const top = px(rect.top - parentTop);\n if (rectNodeStyle.top !== top) {\n rectNode.style.top = top;\n hasRepositioned = true;\n }\n const width = px(rect.width);\n if (rectNodeStyle.width !== width) {\n rectNode.style.width = width;\n hasRepositioned = true;\n }\n const height = px(rect.height);\n if (rectNodeStyle.height !== height) {\n rectNode.style.height = height;\n hasRepositioned = true;\n }\n if (rectNode.parentNode !== wrapperNode) {\n wrapperNode.append(rectNode);\n hasRepositioned = true;\n }\n lastNodes[i] = rectNode;\n }\n while (lastNodes.length > rects.length) {\n lastNodes.pop();\n }\n if (hasRepositioned) {\n onReposition(lastNodes);\n }\n }\n function stop() {\n parentDOMNode = null;\n rootDOMNode = null;\n if (observer !== null) {\n observer.disconnect();\n }\n observer = null;\n wrapperNode.remove();\n for (const node of lastNodes) {\n node.remove();\n }\n lastNodes = [];\n }\n function restart() {\n const currentRootDOMNode = editor.getRootElement();\n if (currentRootDOMNode === null) {\n return stop();\n }\n const currentParentDOMNode = currentRootDOMNode.parentElement;\n if (!isHTMLElement(currentParentDOMNode)) {\n return stop();\n }\n stop();\n rootDOMNode = currentRootDOMNode;\n parentDOMNode = currentParentDOMNode;\n observer = new MutationObserver(mutations => {\n const nextRootDOMNode = editor.getRootElement();\n const nextParentDOMNode = nextRootDOMNode && nextRootDOMNode.parentElement;\n if (nextRootDOMNode !== rootDOMNode || nextParentDOMNode !== parentDOMNode) {\n return restart();\n }\n for (const mutation of mutations) {\n if (!wrapperNode.contains(mutation.target)) {\n // TODO throttle\n return position();\n }\n }\n });\n observer.observe(currentParentDOMNode, mutationObserverConfig);\n position();\n }\n const removeRootListener = editor.registerRootListener(restart);\n return () => {\n removeRootListener();\n stop();\n };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction $getOrderedSelectionPoints(selection) {\n const points = selection.getStartEndPoints();\n return selection.isBackward() ? [points[1], points[0]] : points;\n}\nfunction $rangeTargetFromPoint(point, node, dom) {\n if (point.type === 'text' || !$isElementNode(node)) {\n const textDOM = getDOMTextNode(dom) || dom;\n return [textDOM, point.offset];\n } else {\n const editor = $getEditor();\n const slot = $getEditorDOMRenderConfig(editor).$getDOMSlot(node, dom, editor);\n return [slot.element, slot.getFirstChildOffset() + point.offset];\n }\n}\nfunction $rangeFromPoints(editor, start, startNode, startDOM, end, endNode, endDOM) {\n const editorDocument = editor._window ? editor._window.document : document;\n const range = editorDocument.createRange();\n range.setStart(...$rangeTargetFromPoint(start, startNode, startDOM));\n range.setEnd(...$rangeTargetFromPoint(end, endNode, endDOM));\n return range;\n}\nfunction defaultOnReposition(domNodes) {\n for (const domNode of domNodes) {\n const domNodeStyle = domNode.style;\n if (domNodeStyle.background !== 'Highlight') {\n domNodeStyle.background = 'Highlight';\n }\n if (domNodeStyle.color !== 'HighlightText') {\n domNodeStyle.color = 'HighlightText';\n }\n if (domNodeStyle.marginTop !== px(-1.5)) {\n domNodeStyle.marginTop = px(-1.5);\n }\n if (domNodeStyle.paddingTop !== px(4)) {\n domNodeStyle.paddingTop = px(4);\n }\n if (domNodeStyle.paddingBottom !== px(0)) {\n domNodeStyle.paddingBottom = px(0);\n }\n }\n}\n\n/**\n * Place one or multiple newly created Nodes at the current selection. Multiple\n * nodes will only be created when the selection spans multiple lines (aka\n * client rects).\n *\n * This function can come useful when you want to show the selection but the\n * editor has been focused away.\n */\nfunction markSelection(editor, onReposition = defaultOnReposition) {\n let previousAnchorNode = null;\n let previousAnchorNodeDOM = null;\n let previousAnchorOffset = null;\n let previousFocusNode = null;\n let previousFocusNodeDOM = null;\n let previousFocusOffset = null;\n let removeRangeListener = () => {};\n function compute(editorState) {\n editorState.read(() => {\n const selection = $getSelection();\n if (!$isRangeSelection(selection)) {\n // TODO\n previousAnchorNode = null;\n previousAnchorOffset = null;\n previousFocusNode = null;\n previousFocusOffset = null;\n removeRangeListener();\n removeRangeListener = () => {};\n return;\n }\n const [start, end] = $getOrderedSelectionPoints(selection);\n const currentStartNode = start.getNode();\n const currentStartNodeKey = currentStartNode.getKey();\n const currentStartOffset = start.offset;\n const currentEndNode = end.getNode();\n const currentEndNodeKey = currentEndNode.getKey();\n const currentEndOffset = end.offset;\n const currentStartNodeDOM = editor.getElementByKey(currentStartNodeKey);\n const currentEndNodeDOM = editor.getElementByKey(currentEndNodeKey);\n const differentStartDOM = previousAnchorNode === null || currentStartNodeDOM !== previousAnchorNodeDOM || currentStartOffset !== previousAnchorOffset || currentStartNodeKey !== previousAnchorNode.getKey();\n const differentEndDOM = previousFocusNode === null || currentEndNodeDOM !== previousFocusNodeDOM || currentEndOffset !== previousFocusOffset || currentEndNodeKey !== previousFocusNode.getKey();\n if ((differentStartDOM || differentEndDOM) && currentStartNodeDOM !== null && currentEndNodeDOM !== null) {\n const range = $rangeFromPoints(editor, start, currentStartNode, currentStartNodeDOM, end, currentEndNode, currentEndNodeDOM);\n removeRangeListener();\n removeRangeListener = mlcPositionNodeOnRange(editor, range, onReposition);\n }\n previousAnchorNode = currentStartNode;\n previousAnchorNodeDOM = currentStartNodeDOM;\n previousAnchorOffset = currentStartOffset;\n previousFocusNode = currentEndNode;\n previousFocusNodeDOM = currentEndNodeDOM;\n previousFocusOffset = currentEndOffset;\n });\n }\n compute(editor.getEditorState());\n return mergeRegister(editor.registerUpdateListener(({\n editorState\n }) => compute(editorState)), () => {\n removeRangeListener();\n });\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction selectionAlwaysOnDisplay(editor, onReposition) {\n let removeSelectionMark = null;\n const onSelectionChange = () => {\n const domSelection = getSelection();\n const domAnchorNode = domSelection && domSelection.anchorNode;\n const editorRootElement = editor.getRootElement();\n const isSelectionInsideEditor = domAnchorNode !== null && editorRootElement !== null && editorRootElement.contains(domAnchorNode);\n if (isSelectionInsideEditor) {\n if (removeSelectionMark !== null) {\n removeSelectionMark();\n removeSelectionMark = null;\n }\n } else {\n if (removeSelectionMark === null) {\n removeSelectionMark = markSelection(editor, onReposition);\n }\n }\n };\n return editor.registerRootListener(rootElement => {\n if (rootElement) {\n const document = rootElement.ownerDocument;\n document.addEventListener('selectionchange', onSelectionChange);\n onSelectionChange();\n return () => {\n if (removeSelectionMark !== null) {\n removeSelectionMark();\n }\n document.removeEventListener('selectionchange', onSelectionChange);\n };\n }\n });\n}\n\n// Hotfix to export these with inlined types #5918\nconst CAN_USE_BEFORE_INPUT = CAN_USE_BEFORE_INPUT$1;\nconst CAN_USE_DOM = CAN_USE_DOM$1;\nconst IS_ANDROID = IS_ANDROID$1;\nconst IS_ANDROID_CHROME = IS_ANDROID_CHROME$1;\nconst IS_APPLE = IS_APPLE$1;\nconst IS_APPLE_WEBKIT = IS_APPLE_WEBKIT$1;\nconst IS_CHROME = IS_CHROME$1;\nconst IS_FIREFOX = IS_FIREFOX$1;\nconst IS_IOS = IS_IOS$1;\nconst IS_SAFARI = IS_SAFARI$1;\n\n/**\n * Returns true if the file type matches the types passed within the acceptableMimeTypes array, false otherwise.\n * The types passed must be strings and are CASE-SENSITIVE.\n * eg. if file is of type 'text' and acceptableMimeTypes = ['TEXT', 'IMAGE'] the function will return false.\n * @param file - The file you want to type check.\n * @param acceptableMimeTypes - An array of strings of types which the file is checked against.\n * @returns true if the file is an acceptable mime type, false otherwise.\n */\nfunction isMimeType(file, acceptableMimeTypes) {\n for (const acceptableType of acceptableMimeTypes) {\n if (file.type.startsWith(acceptableType)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Lexical File Reader with:\n * 1. MIME type support\n * 2. batched results (HistoryPlugin compatibility)\n * 3. Order aware (respects the order when multiple Files are passed)\n *\n * const filesResult = await mediaFileReader(files, ['image/']);\n * filesResult.forEach(file => editor.dispatchCommand('INSERT_IMAGE', \\\\{\n * src: file.result,\n * \\\\}));\n */\nfunction mediaFileReader(files, acceptableMimeTypes) {\n const filesIterator = files[Symbol.iterator]();\n return new Promise((resolve, reject) => {\n const processed = [];\n const handleNextFile = () => {\n const {\n done,\n value: file\n } = filesIterator.next();\n if (done) {\n return resolve(processed);\n }\n const fileReader = new FileReader();\n fileReader.addEventListener('error', reject);\n fileReader.addEventListener('load', () => {\n const result = fileReader.result;\n if (typeof result === 'string') {\n processed.push({\n file,\n result\n });\n }\n handleNextFile();\n });\n if (isMimeType(file, acceptableMimeTypes)) {\n fileReader.readAsDataURL(file);\n } else {\n handleNextFile();\n }\n };\n handleNextFile();\n });\n}\n/**\n * \"Depth-First Search\" starts at the root/top node of a tree and goes as far as it can down a branch end\n * before backtracking and finding a new path. Consider solving a maze by hugging either wall, moving down a\n * branch until you hit a dead-end (leaf) and backtracking to find the nearest branching path and repeat.\n * It will then return all the nodes found in the search in an array of objects.\n * Preorder traversal is used, meaning that nodes are listed in the order of when they are FIRST encountered.\n * @param startNode - The node to start the search (inclusive), if omitted, it will start at the root node.\n * @param endNode - The node to end the search (inclusive), if omitted, it will find all descendants of the startingNode. If endNode\n * is an ElementNode, it will stop before visiting any of its children.\n * @returns An array of objects of all the nodes found by the search, including their depth into the tree.\n * \\\\{depth: number, node: LexicalNode\\\\} It will always return at least 1 node (the start node).\n */\nfunction $dfs(startNode, endNode) {\n return Array.from($dfsIterator(startNode, endNode));\n}\n\n/**\n * Get the adjacent caret in the same direction\n *\n * @param caret A caret or null\n * @returns `caret.getAdjacentCaret()` or `null`\n */\nfunction $getAdjacentCaret(caret) {\n return caret ? caret.getAdjacentCaret() : null;\n}\n\n/**\n * $dfs iterator (right to left). Tree traversal is done on the fly as new values are requested with O(1) memory.\n * @param startNode - The node to start the search, if omitted, it will start at the root node.\n * @param endNode - The node to end the search, if omitted, it will find all descendants of the startingNode.\n * @returns An iterator, each yielded value is a DFSNode. It will always return at least 1 node (the start node).\n */\nfunction $reverseDfs(startNode, endNode) {\n return Array.from($reverseDfsIterator(startNode, endNode));\n}\n\n/**\n * $dfs iterator (left to right). Tree traversal is done on the fly as new values are requested with O(1) memory.\n * Preorder traversal is used, meaning that nodes are iterated over in the order of when they are FIRST encountered.\n * @param startNode - The node to start the search (inclusive), if omitted, it will start at the root node.\n * @param endNode - The node to end the search (inclusive), if omitted, it will find all descendants of the startingNode.\n * If endNode is an ElementNode, the iterator will end as soon as it reaches the endNode (no children will be visited).\n * @returns An iterator, each yielded value is a DFSNode. It will always return at least 1 node (the start node).\n */\nfunction $dfsIterator(startNode, endNode) {\n return $dfsCaretIterator('next', startNode, endNode);\n}\nfunction $getEndCaret(startNode, direction) {\n const rval = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(startNode, direction));\n return rval && rval[0];\n}\nfunction $dfsCaretIterator(direction, startNode, endNode) {\n const root = $getRoot();\n const start = startNode || root;\n const startCaret = $isElementNode(start) ? $getChildCaret(start, direction) : $getSiblingCaret(start, direction);\n const startDepth = $getDepth(start);\n const endCaret = endNode ? $getAdjacentChildCaret($getChildCaretOrSelf($getSiblingCaret(endNode, direction))) || $getEndCaret(endNode, direction) : $getEndCaret(start, direction);\n let depth = startDepth;\n return makeStepwiseIterator({\n hasNext: state => state !== null,\n initial: startCaret,\n map: state => ({\n depth,\n node: state.origin\n }),\n step: state => {\n if (state.isSameNodeCaret(endCaret)) {\n return null;\n }\n if ($isChildCaret(state)) {\n depth++;\n }\n const rval = $getAdjacentSiblingOrParentSiblingCaret(state);\n if (!rval || rval[0].isSameNodeCaret(endCaret)) {\n return null;\n }\n depth += rval[1];\n return rval[0];\n }\n });\n}\n\n/**\n * Returns the Node sibling when this exists, otherwise the closest parent sibling. For example\n * R -> P -> T1, T2\n * -> P2\n * returns T2 for node T1, P2 for node T2, and null for node P2.\n * @param node LexicalNode.\n * @returns An array (tuple) containing the found Lexical node and the depth difference, or null, if this node doesn't exist.\n */\nfunction $getNextSiblingOrParentSibling(node) {\n const rval = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(node, 'next'));\n return rval && [rval[0].origin, rval[1]];\n}\nfunction $getDepth(node) {\n let depth = -1;\n for (let innerNode = node; innerNode !== null; innerNode = innerNode.getParent()) {\n depth++;\n }\n return depth;\n}\n\n/**\n * Performs a right-to-left preorder tree traversal.\n * From the starting node it goes to the rightmost child, than backtracks to parent and finds new rightmost path.\n * It will return the next node in traversal sequence after the startingNode.\n * The traversal is similar to $dfs functions above, but the nodes are visited right-to-left, not left-to-right.\n * @param startingNode - The node to start the search.\n * @returns The next node in pre-order right to left traversal sequence or `null`, if the node does not exist\n */\nfunction $getNextRightPreorderNode(startingNode) {\n const startCaret = $getChildCaretOrSelf($getSiblingCaret(startingNode, 'previous'));\n const next = $getAdjacentSiblingOrParentSiblingCaret(startCaret, 'root');\n return next && next[0].origin;\n}\n\n/**\n * $dfs iterator (right to left). Tree traversal is done on the fly as new values are requested with O(1) memory.\n * @param startNode - The node to start the search, if omitted, it will start at the root node.\n * @param endNode - The node to end the search, if omitted, it will find all descendants of the startingNode.\n * @returns An iterator, each yielded value is a DFSNode. It will always return at least 1 node (the start node).\n */\nfunction $reverseDfsIterator(startNode, endNode) {\n return $dfsCaretIterator('previous', startNode, endNode);\n}\n\n/**\n * Takes a node and traverses up its ancestors (toward the root node)\n * in order to find a specific type of node.\n * @param node - the node to begin searching.\n * @param klass - an instance of the type of node to look for.\n * @returns the node of type klass that was passed, or null if none exist.\n */\nfunction $getNearestNodeOfType(node, klass) {\n let parent = node;\n while (parent != null) {\n if (parent instanceof klass) {\n return parent;\n }\n parent = parent.getParent();\n }\n return null;\n}\n\n/**\n * Returns the element node of the nearest ancestor, otherwise throws an error.\n * @param startNode - The starting node of the search\n * @returns The ancestor node found\n */\nfunction $getNearestBlockElementAncestorOrThrow(startNode) {\n const blockNode = $findMatchingParent(startNode, node => $isElementNode(node) && !node.isInline());\n if (!$isElementNode(blockNode)) {\n {\n formatDevErrorMessage(`Expected node ${startNode.__key} to have closest block element node.`);\n }\n }\n return blockNode;\n}\n/**\n * Attempts to resolve nested element nodes of the same type into a single node of that type.\n * It is generally used for marks/commenting\n * @param editor - The lexical editor\n * @param targetNode - The target for the nested element to be extracted from.\n * @param cloneNode - See {@link $createMarkNode}\n * @param handleOverlap - Handles any overlap between the node to extract and the targetNode\n * @returns The lexical editor\n */\nfunction registerNestedElementResolver(editor, targetNode, cloneNode, handleOverlap) {\n const $isTargetNode = node => {\n return node instanceof targetNode;\n };\n const $findMatch = node => {\n // First validate we don't have any children that are of the target,\n // as we need to handle them first.\n const children = node.getChildren();\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if ($isTargetNode(child)) {\n return null;\n }\n }\n let parentNode = node;\n let childNode = node;\n while (parentNode !== null) {\n childNode = parentNode;\n parentNode = parentNode.getParent();\n if ($isTargetNode(parentNode)) {\n return {\n child: childNode,\n parent: parentNode\n };\n }\n }\n return null;\n };\n const $elementNodeTransform = node => {\n const match = $findMatch(node);\n if (match !== null) {\n const {\n child,\n parent\n } = match;\n\n // Simple path, we can move child out and siblings into a new parent.\n\n if (child.is(node)) {\n handleOverlap(parent, node);\n const nextSiblings = child.getNextSiblings();\n const nextSiblingsLength = nextSiblings.length;\n parent.insertAfter(child);\n if (nextSiblingsLength !== 0) {\n const newParent = cloneNode(parent);\n child.insertAfter(newParent);\n for (let i = 0; i < nextSiblingsLength; i++) {\n newParent.append(nextSiblings[i]);\n }\n }\n if (!parent.canBeEmpty() && parent.getChildrenSize() === 0) {\n parent.remove();\n }\n }\n }\n };\n return editor.registerNodeTransform(targetNode, $elementNodeTransform);\n}\n\n/**\n * Clones the editor and marks it as dirty to be reconciled. If there was a selection,\n * it would be set back to its previous state, or null otherwise.\n * @param editor - The lexical editor\n * @param editorState - The editor's state\n */\nfunction $restoreEditorState(editor, editorState) {\n const FULL_RECONCILE = 2;\n const nodeMap = new Map();\n const activeEditorState = editor._pendingEditorState;\n for (const [key, node] of editorState._nodeMap) {\n nodeMap.set(key, $cloneWithProperties(node));\n }\n if (activeEditorState) {\n activeEditorState._nodeMap = nodeMap;\n }\n editor._dirtyType = FULL_RECONCILE;\n const selection = editorState._selection;\n $setSelection(selection === null ? null : selection.clone());\n}\n\n/**\n * If the selected insertion area is the root/shadow root node (see {@link lexical!$isRootOrShadowRoot}),\n * the node will be appended there, otherwise, it will be inserted before the insertion area.\n * If there is no selection where the node is to be inserted, it will be appended after any current nodes\n * within the tree, as a child of the root node. A paragraph will then be added after the inserted node and selected.\n * @param node - The node to be inserted\n * @returns The node after its insertion\n */\nfunction $insertNodeToNearestRoot(node) {\n const selection = $getSelection() || $getPreviousSelection();\n let initialCaret;\n if ($isRangeSelection(selection)) {\n initialCaret = $caretFromPoint(selection.focus, 'next');\n } else {\n if (selection != null) {\n const nodes = selection.getNodes();\n const lastNode = nodes[nodes.length - 1];\n if (lastNode) {\n initialCaret = $getSiblingCaret(lastNode, 'next');\n }\n }\n initialCaret = initialCaret || $getChildCaret($getRoot(), 'previous').getFlipped().insert($createParagraphNode());\n }\n const insertCaret = $insertNodeToNearestRootAtCaret(node, initialCaret);\n const adjacent = $getAdjacentChildCaret(insertCaret);\n const selectionCaret = $isChildCaret(adjacent) ? $normalizeCaret(adjacent) : insertCaret;\n $setSelectionFromCaretRange($getCollapsedCaretRange(selectionCaret));\n return node.getLatest();\n}\n\n/**\n * If the insertion caret is the root/shadow root node (see {@link lexical!$isRootOrShadowRoot}),\n * the node will be inserted there, otherwise the parent nodes will be split according to the\n * given options.\n * @param node - The node to be inserted\n * @param caret - The location to insert or split from\n * @returns The node after its insertion\n */\nfunction $insertNodeToNearestRootAtCaret(node, caret, options) {\n let insertCaret = $getCaretInDirection(caret, 'next');\n // Normalize boundary cases for TextPointCaret\n if ($isTextPointCaret(insertCaret)) {\n if (insertCaret.offset === 0) {\n insertCaret = $getSiblingCaret(insertCaret.origin, 'previous').getFlipped();\n } else if (insertCaret.offset === insertCaret.origin.getTextContentSize()) {\n insertCaret = $getSiblingCaret(insertCaret.origin, 'next');\n }\n }\n // Make sure we have a distinct node as the origin\n if (insertCaret.origin.is(node)) {\n if (!$isSiblingCaret(insertCaret)) {\n formatDevErrorMessage(`$insertNodeToNearestRootAtCaret node ${node.getKey()} of type ${node.getType()} can not be inserted into itself`);\n }\n insertCaret = $rewindSiblingCaret(insertCaret);\n }\n // Handle split boundary conditions where node is being inserted adjacent to itself\n if (node.is(insertCaret.getNodeAtCaret()) || node.is(insertCaret.getFlipped().getNodeAtCaret())) {\n node.remove(true);\n }\n for (let nextCaret = insertCaret; nextCaret; nextCaret = $splitAtPointCaretNext(nextCaret, options)) {\n insertCaret = nextCaret;\n }\n if (!!$isTextPointCaret(insertCaret)) {\n formatDevErrorMessage(`$insertNodeToNearestRootAtCaret: An unattached TextNode can not be split`);\n }\n insertCaret.insert(node.isInline() ? $createParagraphNode().append(node) : node);\n return $getCaretInDirection($getSiblingCaret(node.getLatest(), 'next'), caret.direction);\n}\n\n/**\n * Inserts a node into leaf — the deepest accessible node at the carriage position\n * @param node - The node to be inserted\n */\nfunction $insertNodeIntoLeaf(node) {\n const selection = $getSelection();\n if (!$isRangeSelection(selection)) {\n if (selection) {\n selection.insertNodes([node]);\n }\n return;\n }\n const caretRange = $caretRangeFromSelection(selection);\n let insertCaret = $getCaretRangeInDirection($removeTextFromCaretRange(caretRange), 'next').anchor;\n if ($isTextPointCaret(insertCaret)) {\n const nextAnchor = $splitAtPointCaretNext(insertCaret);\n if (!nextAnchor) {\n return;\n }\n insertCaret = nextAnchor;\n }\n const focus = insertCaret.getFlipped();\n focus.insert(node);\n $setSelectionFromCaretRange($getCaretRange(focus, focus));\n}\n\n/**\n * Wraps the node into another node created from a createElementNode function, eg. $createParagraphNode\n * @param node - Node to be wrapped.\n * @param createElementNode - Creates a new lexical element to wrap the to-be-wrapped node and returns it.\n * @returns A new lexical element with the previous node appended within (as a child, including its children).\n */\nfunction $wrapNodeInElement(node, createElementNode) {\n const elementNode = createElementNode();\n node.replace(elementNode);\n elementNode.append(node);\n return elementNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n/**\n * @param object = The instance of the type\n * @param objectClass = The class of the type\n * @returns Whether the object is has the same Klass of the objectClass, ignoring the difference across window (e.g. different iframes)\n */\nfunction objectKlassEquals(object, objectClass) {\n return object !== null ? Object.getPrototypeOf(object).constructor.name === objectClass.name : false;\n}\n\n/**\n * @deprecated Use Array filter or flatMap\n *\n * Filter the nodes\n * @param nodes Array of nodes that needs to be filtered\n * @param filterFn A filter function that returns node if the current node satisfies the condition otherwise null\n * @returns Array of filtered nodes\n */\n\nfunction $filter(nodes, filterFn) {\n const result = [];\n for (let i = 0; i < nodes.length; i++) {\n const node = filterFn(nodes[i]);\n if (node !== null) {\n result.push(node);\n }\n }\n return result;\n}\n\n/**\n * Applies the provided callback to each indentable block element in the Selection\n *\n * @param indentOrOutdent callback for performing the indent or outdent action\n * on a given block element.\n * @returns true if at least one block was handled, false otherwise.\n */\nfunction $handleIndentAndOutdent(indentOrOutdent) {\n const selection = $getSelection();\n if (!$isRangeSelection(selection)) {\n return false;\n }\n const alreadyHandled = new Set();\n const nodes = selection.getNodes();\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const key = node.getKey();\n if (alreadyHandled.has(key)) {\n continue;\n }\n const parentBlock = $findMatchingParent(node, parentNode => $isElementNode(parentNode) && !parentNode.isInline());\n if (parentBlock === null) {\n continue;\n }\n const parentKey = parentBlock.getKey();\n if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) {\n alreadyHandled.add(parentKey);\n indentOrOutdent(parentBlock);\n }\n }\n return alreadyHandled.size > 0;\n}\n\n/**\n * Appends the node before the first child of the parent node\n * @param parent A parent node\n * @param node Node that needs to be appended\n */\nfunction $insertFirst(parent, node) {\n $getChildCaret(parent, 'next').insert(node);\n}\nlet NEEDS_MANUAL_ZOOM = IS_FIREFOX || !CAN_USE_DOM ? false : undefined;\nfunction needsManualZoom() {\n if (NEEDS_MANUAL_ZOOM === undefined) {\n // If the browser implements standardized CSS zoom, then the client rect\n // will be wider after zoom is applied\n // https://chromestatus.com/feature/5198254868529152\n // https://github.com/facebook/lexical/issues/6863\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.opacity = '0';\n div.style.width = '100px';\n div.style.left = '-1000px';\n document.body.appendChild(div);\n const noZoom = div.getBoundingClientRect();\n div.style.setProperty('zoom', '2');\n NEEDS_MANUAL_ZOOM = div.getBoundingClientRect().width === noZoom.width;\n document.body.removeChild(div);\n }\n return NEEDS_MANUAL_ZOOM;\n}\n\n/**\n * Calculates the zoom level of an element as a result of using\n * css zoom property. For browsers that implement standardized CSS\n * zoom (Firefox, Chrome >= 128), this will always return 1.\n * @param element\n * @param useManualZoom - If true, always use zoom level will be calculated manually, otherwise it will be calculated on as needed basis.\n */\nfunction calculateZoomLevel(element, useManualZoom = false) {\n let zoom = 1;\n if (needsManualZoom() || useManualZoom) {\n while (element) {\n zoom *= Number(window.getComputedStyle(element).getPropertyValue('zoom'));\n element = element.parentElement;\n }\n }\n return zoom;\n}\n\n/**\n * Checks if the editor is a nested editor created by LexicalNestedComposer\n */\nfunction $isEditorIsNestedEditor(editor) {\n return editor._parentEditor !== null;\n}\n\n/**\n * A depth first last-to-first traversal of root that stops at each node that matches\n * $predicate and ensures that its parent is root. This is typically used to discard\n * invalid or unsupported wrapping nodes. For example, a TableNode must only have\n * TableRowNode as children, but an importer might add invalid nodes based on\n * caption, tbody, thead, etc. and this will unwrap and discard those.\n *\n * @param root The root to start the traversal\n * @param $predicate Should return true for nodes that are permitted to be children of root\n * @returns true if this unwrapped or removed any nodes\n */\nfunction $unwrapAndFilterDescendants(root, $predicate) {\n return $unwrapAndFilterDescendantsImpl(root, $predicate, null);\n}\nfunction $unwrapAndFilterDescendantsImpl(root, $predicate, $onSuccess) {\n let didMutate = false;\n for (const node of $lastToFirstIterator(root)) {\n if ($predicate(node)) {\n if ($onSuccess !== null) {\n $onSuccess(node);\n }\n continue;\n }\n didMutate = true;\n if ($isElementNode(node)) {\n $unwrapAndFilterDescendantsImpl(node, $predicate, $onSuccess || (child => node.insertAfter(child)));\n }\n node.remove();\n }\n return didMutate;\n}\n\n/**\n * A depth first traversal of the children array that stops at and collects\n * each node that `$predicate` matches. This is typically used to discard\n * invalid or unsupported wrapping nodes on a children array in the `after`\n * of an {@link lexical!DOMConversionOutput}. For example, a TableNode must only have\n * TableRowNode as children, but an importer might add invalid nodes based on\n * caption, tbody, thead, etc. and this will unwrap and discard those.\n *\n * This function is read-only and performs no mutation operations, which makes\n * it suitable for import and export purposes but likely not for any in-place\n * mutation. You should use {@link $unwrapAndFilterDescendants} for in-place\n * mutations such as node transforms.\n *\n * @param children The children to traverse\n * @param $predicate Should return true for nodes that are permitted to be children of root\n * @returns The children or their descendants that match $predicate\n */\n\nfunction $descendantsMatching(children, $predicate) {\n const result = [];\n const stack = Array.from(children).reverse();\n for (let child = stack.pop(); child !== undefined; child = stack.pop()) {\n if ($predicate(child)) {\n result.push(child);\n } else if ($isElementNode(child)) {\n for (const grandchild of $lastToFirstIterator(child)) {\n stack.push(grandchild);\n }\n }\n }\n return result;\n}\n\n/**\n * Return an iterator that yields each child of node from first to last, taking\n * care to preserve the next sibling before yielding the value in case the caller\n * removes the yielded node.\n *\n * @param node The node whose children to iterate\n * @returns An iterator of the node's children\n */\nfunction $firstToLastIterator(node) {\n return $childIterator($getChildCaret(node, 'next'));\n}\n\n/**\n * Return an iterator that yields each child of node from last to first, taking\n * care to preserve the previous sibling before yielding the value in case the caller\n * removes the yielded node.\n *\n * @param node The node whose children to iterate\n * @returns An iterator of the node's children\n */\nfunction $lastToFirstIterator(node) {\n return $childIterator($getChildCaret(node, 'previous'));\n}\nfunction $childIterator(startCaret) {\n const seen = new Set() ;\n return makeStepwiseIterator({\n hasNext: $isSiblingCaret,\n initial: startCaret.getAdjacentCaret(),\n map: caret => {\n const origin = caret.origin.getLatest();\n if (seen !== null) {\n const key = origin.getKey();\n if (!!seen.has(key)) {\n formatDevErrorMessage(`$childIterator: Cycle detected, node with key ${String(key)} has already been traversed`);\n }\n seen.add(key);\n }\n return origin;\n },\n step: caret => caret.getAdjacentCaret()\n });\n}\n\n/**\n * Replace this node with its children\n *\n * @param node The ElementNode to unwrap and remove\n */\nfunction $unwrapNode(node) {\n $rewindSiblingCaret($getSiblingCaret(node, 'next')).splice(1, node.getChildren());\n}\n\n/**\n * A wrapper that creates bound functions and methods for the\n * StateConfig to save some boilerplate when defining methods\n * or exporting only the accessors from your modules rather\n * than exposing the StateConfig directly.\n */\n\n/**\n * EXPERIMENTAL\n *\n * A convenience interface for working with {@link $getState} and\n * {@link $setState}.\n *\n * @param stateConfig The stateConfig to wrap with convenience functionality\n * @returns a StateWrapper\n */\nfunction makeStateWrapper(stateConfig) {\n const $get = node => $getState(node, stateConfig);\n const $set = (node, valueOrUpdater) => $setState(node, stateConfig, valueOrUpdater);\n return {\n $get,\n $set,\n accessors: [$get, $set],\n makeGetterMethod: () => function $getter() {\n return $get(this);\n },\n makeSetterMethod: () => function $setter(valueOrUpdater) {\n return $set(this, valueOrUpdater);\n },\n stateConfig\n };\n}\n\nexport { $descendantsMatching, $dfs, $dfsIterator, $filter, $firstToLastIterator, $getAdjacentCaret, $getDepth, $getNearestBlockElementAncestorOrThrow, $getNearestNodeOfType, $getNextRightPreorderNode, $getNextSiblingOrParentSibling, $handleIndentAndOutdent, $insertFirst, $insertNodeIntoLeaf, $insertNodeToNearestRoot, $insertNodeToNearestRootAtCaret, $isEditorIsNestedEditor, $lastToFirstIterator, $restoreEditorState, $reverseDfs, $reverseDfsIterator, $unwrapAndFilterDescendants, $unwrapNode, $wrapNodeInElement, CAN_USE_BEFORE_INPUT, CAN_USE_DOM, IS_ANDROID, IS_ANDROID_CHROME, IS_APPLE, IS_APPLE_WEBKIT, IS_CHROME, IS_FIREFOX, IS_IOS, IS_SAFARI, calculateZoomLevel, isMimeType, makeStateWrapper, markSelection, mediaFileReader, objectKlassEquals, mlcPositionNodeOnRange as positionNodeOnRange, registerNestedElementResolver, selectionAlwaysOnDisplay };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;AAsBA,SAAS,sBAAsB,SAAS;CACtC,MAAM,IAAI,MAAM,OAAO;AACzB;;;;;;;;AAUA,MAAM,gBAAgB,OAAO,WAAW,eAAe,OAAO,OAAO,aAAa,eAAe,OAAO,OAAO,SAAS,kBAAkB;;;;;;;;AAU1I,MAAM,eAAe,iBAAiB,kBAAkB,WAAW,SAAS,eAAe;AAC3F,MAAM,aAAa,iBAAiB,uBAAuB,KAAK,UAAU,QAAQ;AAClF,MAAM,eAAe,iBAAiB,mCAAmC,KAAK,UAAU,SAAS;AACjG,MAAM,yBAAyB,iBAAiB,gBAAgB,UAAU,CAAC,eAAe,qBAAqB,IAAI,OAAO,WAAW,OAAO,IAAI;AAChJ,MAAM,WAAW,iBAAiB,mBAAmB,KAAK,UAAU,SAAS,KAAK,CAAC,OAAO;AAC1F,MAAM,eAAe,iBAAiB,UAAU,KAAK,UAAU,SAAS;AAIxE,MAAM,cAAc,iBAAiB,0BAA0B,KAAK,UAAU,SAAS,KAAK,CAAC;AAI7F,MAAM,cAAc,iBAAiB,mBAAmB,KAAK,UAAU,SAAS;AAGhF,MAAM,sBAAsB,iBAAiB,gBAAgB;AAC7D,MAAM,oBAAoB,iBAAiB,sBAAsB,KAAK,UAAU,SAAS,KAAK,cAAc,CAAC;;;;;;;;AAU7G,SAAS,GAAG,OAAO;CACjB,OAAO,GAAG,MAAM;AAClB;AAEA,MAAM,yBAAyB;CAC7B,YAAY;CACZ,eAAe;CACf,WAAW;CACX,SAAS;A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;;AAkBA,SAAS,iBAAiB,aAAa;CACrC,MAAM,QAAO,SAAQ,UAAU,MAAM,WAAW;CAChD,MAAM,QAAQ,MAAM,mBAAmB,UAAU,MAAM,aAAa,cAAc;CAClF,OAAO;EACL;EACA;EACA,WAAW,CAAC,MAAM,IAAI;EACtB,wBAAwB,SAAS,UAAU;GACzC,OAAO,KAAK,IAAI;EAClB;EACA,wBAAwB,SAAS,QAAQ,gBAAgB;GACvD,OAAO,KAAK,MAAM,cAAc;EAClC;EACA;CACF;AACF"}
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  */
9
- const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalUtils.dev-DiUpsXE8.mjs") : import("./LexicalUtils.prod-bWwV4GAF.mjs"));
9
+ const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalUtils.dev-DRRDyAlS.mjs") : import("./LexicalUtils.prod-CmeHwh8W.mjs"));
10
10
  const $descendantsMatching = mod.$descendantsMatching;
11
11
  const $dfs = mod.$dfs;
12
12
  mod.$dfsIterator;
@@ -63,4 +63,4 @@ const selectionAlwaysOnDisplay = mod.selectionAlwaysOnDisplay;
63
63
  //#endregion
64
64
  export { removeClassNamesFromElement as _, $getNearestNodeOfType as a, $insertNodeToNearestRoot as c, addClassNamesToElement as d, calculateZoomLevel as f, objectKlassEquals as g, mergeRegister as h, $getNearestBlockElementAncestorOrThrow as i, $insertNodeToNearestRootAtCaret as l, isHTMLElement as m, $dfs as n, $handleIndentAndOutdent as o, isHTMLAnchorElement as p, $findMatchingParent as r, $insertFirst as s, $descendantsMatching as t, $unwrapAndFilterDescendants as u, selectionAlwaysOnDisplay as v };
65
65
 
66
- //# sourceMappingURL=LexicalUtils.node-CmK462d1.mjs.map
66
+ //# sourceMappingURL=LexicalUtils.node-Dz-HANi6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"LexicalUtils.node-CmK462d1.mjs","names":[],"sources":["../../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.node.mjs"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalUtils.dev.mjs') : import('./LexicalUtils.prod.mjs'));\nexport const $descendantsMatching = mod.$descendantsMatching;\nexport const $dfs = mod.$dfs;\nexport const $dfsIterator = mod.$dfsIterator;\nexport const $filter = mod.$filter;\nexport const $findMatchingParent = mod.$findMatchingParent;\nexport const $firstToLastIterator = mod.$firstToLastIterator;\nexport const $getAdjacentCaret = mod.$getAdjacentCaret;\nexport const $getAdjacentSiblingOrParentSiblingCaret = mod.$getAdjacentSiblingOrParentSiblingCaret;\nexport const $getDepth = mod.$getDepth;\nexport const $getNearestBlockElementAncestorOrThrow = mod.$getNearestBlockElementAncestorOrThrow;\nexport const $getNearestNodeOfType = mod.$getNearestNodeOfType;\nexport const $getNextRightPreorderNode = mod.$getNextRightPreorderNode;\nexport const $getNextSiblingOrParentSibling = mod.$getNextSiblingOrParentSibling;\nexport const $handleIndentAndOutdent = mod.$handleIndentAndOutdent;\nexport const $insertFirst = mod.$insertFirst;\nexport const $insertNodeIntoLeaf = mod.$insertNodeIntoLeaf;\nexport const $insertNodeToNearestRoot = mod.$insertNodeToNearestRoot;\nexport const $insertNodeToNearestRootAtCaret = mod.$insertNodeToNearestRootAtCaret;\nexport const $isEditorIsNestedEditor = mod.$isEditorIsNestedEditor;\nexport const $lastToFirstIterator = mod.$lastToFirstIterator;\nexport const $restoreEditorState = mod.$restoreEditorState;\nexport const $reverseDfs = mod.$reverseDfs;\nexport const $reverseDfsIterator = mod.$reverseDfsIterator;\nexport const $splitNode = mod.$splitNode;\nexport const $unwrapAndFilterDescendants = mod.$unwrapAndFilterDescendants;\nexport const $unwrapNode = mod.$unwrapNode;\nexport const $wrapNodeInElement = mod.$wrapNodeInElement;\nexport const CAN_USE_BEFORE_INPUT = mod.CAN_USE_BEFORE_INPUT;\nexport const CAN_USE_DOM = mod.CAN_USE_DOM;\nexport const IS_ANDROID = mod.IS_ANDROID;\nexport const IS_ANDROID_CHROME = mod.IS_ANDROID_CHROME;\nexport const IS_APPLE = mod.IS_APPLE;\nexport const IS_APPLE_WEBKIT = mod.IS_APPLE_WEBKIT;\nexport const IS_CHROME = mod.IS_CHROME;\nexport const IS_FIREFOX = mod.IS_FIREFOX;\nexport const IS_IOS = mod.IS_IOS;\nexport const IS_SAFARI = mod.IS_SAFARI;\nexport const addClassNamesToElement = mod.addClassNamesToElement;\nexport const calculateZoomLevel = mod.calculateZoomLevel;\nexport const isBlockDomNode = mod.isBlockDomNode;\nexport const isHTMLAnchorElement = mod.isHTMLAnchorElement;\nexport const isHTMLElement = mod.isHTMLElement;\nexport const isInlineDomNode = mod.isInlineDomNode;\nexport const isMimeType = mod.isMimeType;\nexport const makeStateWrapper = mod.makeStateWrapper;\nexport const markSelection = mod.markSelection;\nexport const mediaFileReader = mod.mediaFileReader;\nexport const mergeRegister = mod.mergeRegister;\nexport const objectKlassEquals = mod.objectKlassEquals;\nexport const positionNodeOnRange = mod.positionNodeOnRange;\nexport const registerNestedElementResolver = mod.registerNestedElementResolver;\nexport const removeClassNamesFromElement = mod.removeClassNamesFromElement;\nexport const selectionAlwaysOnDisplay = mod.selectionAlwaysOnDisplay;"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAQA,MAAM,MAAM,OAAO,QAAQ,IAAI,aAAa,eAAe,OAAO,qCAA4B,OAAO;AACrG,MAAa,uBAAuB,IAAI;AACxC,MAAa,OAAO,IAAI;AACI,IAAI;AACT,IAAI;AAC3B,MAAa,sBAAsB,IAAI;AACH,IAAI;AACP,IAAI;AACkB,IAAI;AAClC,IAAI;AAC7B,MAAa,yCAAyC,IAAI;AAC1D,MAAa,wBAAwB,IAAI;AACA,IAAI;AACC,IAAI;AAClD,MAAa,0BAA0B,IAAI;AAC3C,MAAa,eAAe,IAAI;AACG,IAAI;AACvC,MAAa,2BAA2B,IAAI;AAC5C,MAAa,kCAAkC,IAAI;AACZ,IAAI;AACP,IAAI;AACL,IAAI;AACZ,IAAI;AACI,IAAI;AACb,IAAI;AAC9B,MAAa,8BAA8B,IAAI;AACpB,IAAI;AACG,IAAI;AACF,IAAI;AACb,IAAI;AACL,IAAI;AACG,IAAI;AACb,IAAI;AACG,IAAI;AACV,IAAI;AACH,IAAI;AACR,IAAI;AACD,IAAI;AAC7B,MAAa,yBAAyB,IAAI;AAC1C,MAAa,qBAAqB,IAAI;AACR,IAAI;AAClC,MAAa,sBAAsB,IAAI;AACvC,MAAa,gBAAgB,IAAI;AACF,IAAI;AACT,IAAI;AACE,IAAI;AACP,IAAI;AACF,IAAI;AACnC,MAAa,gBAAgB,IAAI;AACjC,MAAa,oBAAoB,IAAI;AACF,IAAI;AACM,IAAI;AACjD,MAAa,8BAA8B,IAAI;AAC/C,MAAa,2BAA2B,IAAI"}
1
+ {"version":3,"file":"LexicalUtils.node-Dz-HANi6.mjs","names":[],"sources":["../../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.node.mjs"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalUtils.dev.mjs') : import('./LexicalUtils.prod.mjs'));\nexport const $descendantsMatching = mod.$descendantsMatching;\nexport const $dfs = mod.$dfs;\nexport const $dfsIterator = mod.$dfsIterator;\nexport const $filter = mod.$filter;\nexport const $findMatchingParent = mod.$findMatchingParent;\nexport const $firstToLastIterator = mod.$firstToLastIterator;\nexport const $getAdjacentCaret = mod.$getAdjacentCaret;\nexport const $getAdjacentSiblingOrParentSiblingCaret = mod.$getAdjacentSiblingOrParentSiblingCaret;\nexport const $getDepth = mod.$getDepth;\nexport const $getNearestBlockElementAncestorOrThrow = mod.$getNearestBlockElementAncestorOrThrow;\nexport const $getNearestNodeOfType = mod.$getNearestNodeOfType;\nexport const $getNextRightPreorderNode = mod.$getNextRightPreorderNode;\nexport const $getNextSiblingOrParentSibling = mod.$getNextSiblingOrParentSibling;\nexport const $handleIndentAndOutdent = mod.$handleIndentAndOutdent;\nexport const $insertFirst = mod.$insertFirst;\nexport const $insertNodeIntoLeaf = mod.$insertNodeIntoLeaf;\nexport const $insertNodeToNearestRoot = mod.$insertNodeToNearestRoot;\nexport const $insertNodeToNearestRootAtCaret = mod.$insertNodeToNearestRootAtCaret;\nexport const $isEditorIsNestedEditor = mod.$isEditorIsNestedEditor;\nexport const $lastToFirstIterator = mod.$lastToFirstIterator;\nexport const $restoreEditorState = mod.$restoreEditorState;\nexport const $reverseDfs = mod.$reverseDfs;\nexport const $reverseDfsIterator = mod.$reverseDfsIterator;\nexport const $splitNode = mod.$splitNode;\nexport const $unwrapAndFilterDescendants = mod.$unwrapAndFilterDescendants;\nexport const $unwrapNode = mod.$unwrapNode;\nexport const $wrapNodeInElement = mod.$wrapNodeInElement;\nexport const CAN_USE_BEFORE_INPUT = mod.CAN_USE_BEFORE_INPUT;\nexport const CAN_USE_DOM = mod.CAN_USE_DOM;\nexport const IS_ANDROID = mod.IS_ANDROID;\nexport const IS_ANDROID_CHROME = mod.IS_ANDROID_CHROME;\nexport const IS_APPLE = mod.IS_APPLE;\nexport const IS_APPLE_WEBKIT = mod.IS_APPLE_WEBKIT;\nexport const IS_CHROME = mod.IS_CHROME;\nexport const IS_FIREFOX = mod.IS_FIREFOX;\nexport const IS_IOS = mod.IS_IOS;\nexport const IS_SAFARI = mod.IS_SAFARI;\nexport const addClassNamesToElement = mod.addClassNamesToElement;\nexport const calculateZoomLevel = mod.calculateZoomLevel;\nexport const isBlockDomNode = mod.isBlockDomNode;\nexport const isHTMLAnchorElement = mod.isHTMLAnchorElement;\nexport const isHTMLElement = mod.isHTMLElement;\nexport const isInlineDomNode = mod.isInlineDomNode;\nexport const isMimeType = mod.isMimeType;\nexport const makeStateWrapper = mod.makeStateWrapper;\nexport const markSelection = mod.markSelection;\nexport const mediaFileReader = mod.mediaFileReader;\nexport const mergeRegister = mod.mergeRegister;\nexport const objectKlassEquals = mod.objectKlassEquals;\nexport const positionNodeOnRange = mod.positionNodeOnRange;\nexport const registerNestedElementResolver = mod.registerNestedElementResolver;\nexport const removeClassNamesFromElement = mod.removeClassNamesFromElement;\nexport const selectionAlwaysOnDisplay = mod.selectionAlwaysOnDisplay;"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAQA,MAAM,MAAM,OAAO,QAAQ,IAAI,aAAa,eAAe,OAAO,qCAA4B,OAAO;AACrG,MAAa,uBAAuB,IAAI;AACxC,MAAa,OAAO,IAAI;AACI,IAAI;AACT,IAAI;AAC3B,MAAa,sBAAsB,IAAI;AACH,IAAI;AACP,IAAI;AACkB,IAAI;AAClC,IAAI;AAC7B,MAAa,yCAAyC,IAAI;AAC1D,MAAa,wBAAwB,IAAI;AACA,IAAI;AACC,IAAI;AAClD,MAAa,0BAA0B,IAAI;AAC3C,MAAa,eAAe,IAAI;AACG,IAAI;AACvC,MAAa,2BAA2B,IAAI;AAC5C,MAAa,kCAAkC,IAAI;AACZ,IAAI;AACP,IAAI;AACL,IAAI;AACZ,IAAI;AACI,IAAI;AACb,IAAI;AAC9B,MAAa,8BAA8B,IAAI;AACpB,IAAI;AACG,IAAI;AACF,IAAI;AACb,IAAI;AACL,IAAI;AACG,IAAI;AACb,IAAI;AACG,IAAI;AACV,IAAI;AACH,IAAI;AACR,IAAI;AACD,IAAI;AAC7B,MAAa,yBAAyB,IAAI;AAC1C,MAAa,qBAAqB,IAAI;AACR,IAAI;AAClC,MAAa,sBAAsB,IAAI;AACvC,MAAa,gBAAgB,IAAI;AACF,IAAI;AACT,IAAI;AACE,IAAI;AACP,IAAI;AACF,IAAI;AACnC,MAAa,gBAAgB,IAAI;AACjC,MAAa,oBAAoB,IAAI;AACF,IAAI;AACM,IAAI;AACjD,MAAa,8BAA8B,IAAI;AAC/C,MAAa,2BAA2B,IAAI"}
@@ -1,5 +1,5 @@
1
- import { A as $getCollapsedCaretRange, B as $getSiblingCaret, C as $getCaretInDirection, D as $getChildCaret, Gn as isHTMLElement, K as $isChildCaret, Kn as isInlineDomNode, L as $getPreviousSelection, M as $getEditorDOMRenderConfig, Pn as getDOMTextNode, Qn as removeClassNamesFromElement, R as $getRoot, S as $getAdjacentSiblingOrParentSiblingCaret, St as $splitNode, T as $getCaretRangeInDirection, Tn as addClassNamesToElement, V as $getState, Wn as isHTMLAnchorElement, Xn as mergeRegister, Y as $isElementNode, Yn as makeStepwiseIterator, a as $cloneWithProperties, b as $getAdjacentChildCaret, bt as $setState, dt as $normalizeCaret, f as $createParagraphNode, ht as $rewindSiblingCaret, i as $caretRangeFromSelection, j as $getEditor, k as $getChildCaretOrSelf, lt as $isTextPointCaret, mt as $removeTextFromCaretRange, ot as $isSiblingCaret, r as $caretFromPoint, rt as $isRangeSelection, vt as $setSelection, w as $getCaretRange, xt as $splitAtPointCaretNext, y as $findMatchingParent, yt as $setSelectionFromCaretRange, z as $getSelection, zn as isBlockDomNode } from "./Lexical.node-gYNDt_p9.mjs";
2
- import { o as createRectsFromDOMRange } from "./LexicalSelection.node-Di7GwBCZ.mjs";
1
+ import { A as $getCollapsedCaretRange, B as $getSiblingCaret, C as $getCaretInDirection, D as $getChildCaret, Gn as isHTMLElement, K as $isChildCaret, Kn as isInlineDomNode, L as $getPreviousSelection, M as $getEditorDOMRenderConfig, Pn as getDOMTextNode, Qn as removeClassNamesFromElement, R as $getRoot, S as $getAdjacentSiblingOrParentSiblingCaret, St as $splitNode, T as $getCaretRangeInDirection, Tn as addClassNamesToElement, V as $getState, Wn as isHTMLAnchorElement, Xn as mergeRegister, Y as $isElementNode, Yn as makeStepwiseIterator, a as $cloneWithProperties, b as $getAdjacentChildCaret, bt as $setState, dt as $normalizeCaret, f as $createParagraphNode, ht as $rewindSiblingCaret, i as $caretRangeFromSelection, j as $getEditor, k as $getChildCaretOrSelf, lt as $isTextPointCaret, mt as $removeTextFromCaretRange, ot as $isSiblingCaret, r as $caretFromPoint, rt as $isRangeSelection, vt as $setSelection, w as $getCaretRange, xt as $splitAtPointCaretNext, y as $findMatchingParent, yt as $setSelectionFromCaretRange, z as $getSelection, zn as isBlockDomNode } from "./Lexical.node-BR9e7Cyk.mjs";
2
+ import { o as createRectsFromDOMRange } from "./LexicalSelection.node-CQ8iTYsz.mjs";
3
3
  //#region ../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.prod.mjs
4
4
  /**
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -374,4 +374,4 @@ function Wt(t) {
374
374
  //#endregion
375
375
  export { Ht as $descendantsMatching, pt as $dfs, vt as $dfsIterator, Kt as $filter, $findMatchingParent, jt as $firstToLastIterator, mt as $getAdjacentCaret, $getAdjacentSiblingOrParentSiblingCaret, Et as $getDepth, Nt as $getNearestBlockElementAncestorOrThrow, At as $getNearestNodeOfType, Ct as $getNextRightPreorderNode, xt as $getNextSiblingOrParentSibling, _t as $handleIndentAndOutdent, $t as $insertFirst, Mt as $insertNodeIntoLeaf, Pt as $insertNodeToNearestRoot, Rt as $insertNodeToNearestRootAtCaret, It as $isEditorIsNestedEditor, zt as $lastToFirstIterator, Lt as $restoreEditorState, ht as $reverseDfs, St as $reverseDfsIterator, $splitNode, Ot as $unwrapAndFilterDescendants, Vt as $unwrapNode, Tt as $wrapNodeInElement, nt as CAN_USE_BEFORE_INPUT, ot as CAN_USE_DOM, rt as IS_ANDROID, it as IS_ANDROID_CHROME, lt as IS_APPLE, st as IS_APPLE_WEBKIT, ut as IS_CHROME, ct as IS_FIREFOX, at as IS_IOS, ft as IS_SAFARI, addClassNamesToElement, Ft as calculateZoomLevel, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, dt as isMimeType, Wt as makeStateWrapper, tt as markSelection, gt as mediaFileReader, mergeRegister, Bt as objectKlassEquals, X as positionNodeOnRange, bt as registerNestedElementResolver, removeClassNamesFromElement, et as selectionAlwaysOnDisplay };
376
376
 
377
- //# sourceMappingURL=LexicalUtils.prod-bWwV4GAF.mjs.map
377
+ //# sourceMappingURL=LexicalUtils.prod-CmeHwh8W.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"LexicalUtils.prod-bWwV4GAF.mjs","names":["k","t","r","l","s","i","n","o","e","d","f","C","u","A","a","K","c","T","x","E","S","y","L","N","b","P","R","M","v","h","p","m","g","w","_","$"],"sources":["../../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.prod.mjs"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{isHTMLElement as t,mergeRegister as e,$getSelection as n,$isRangeSelection as o,$isElementNode as r,getDOMTextNode as i,$getEditor as l,$getEditorDOMRenderConfig as s,$getChildCaret as u,$findMatchingParent as c,$getChildCaretOrSelf as a,$getSiblingCaret as f,$getAdjacentSiblingOrParentSiblingCaret as d,$caretRangeFromSelection as g,$getCaretRangeInDirection as p,$removeTextFromCaretRange as m,$isTextPointCaret as h,$splitAtPointCaretNext as v,$setSelectionFromCaretRange as y,$getCaretRange as w,$getPreviousSelection as x,$caretFromPoint as E,$getRoot as C,$createParagraphNode as S,$getAdjacentChildCaret as A,$isChildCaret as N,$normalizeCaret as b,$getCollapsedCaretRange as L,$getCaretInDirection as P,$isSiblingCaret as R,$rewindSiblingCaret as M,$cloneWithProperties as T,$setSelection as B,makeStepwiseIterator as K,$getState as _,$setState as $}from\"lexical\";export{$findMatchingParent,$getAdjacentSiblingOrParentSiblingCaret,$splitNode,addClassNamesToElement,isBlockDomNode,isHTMLAnchorElement,isHTMLElement,isInlineDomNode,mergeRegister,removeClassNamesFromElement}from\"lexical\";import{createRectsFromDOMRange as k}from\"@lexical/selection\";function F(t,...e){const n=new URL(\"https://lexical.dev/docs/error\"),o=new URLSearchParams;o.append(\"code\",t);for(const t of e)o.append(\"v\",t);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const I=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,O=I&&\"documentMode\"in document?document.documentMode:null,D=I&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),H=I&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),j=!(!I||!(\"InputEvent\"in window)||O)&&\"getTargetRanges\"in new window.InputEvent(\"input\"),z=I&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U=I&&/Android/.test(navigator.userAgent),V=I&&/Version\\/[\\d.]+.*Safari/.test(navigator.userAgent)&&!U,W=I&&/^(?=.*Chrome).*/i.test(navigator.userAgent),G=I&&U&&W,q=I&&/AppleWebKit\\/[\\d.]+/.test(navigator.userAgent)&&D&&!W;function J(t){return`${t}px`}const Q={attributes:!0,characterData:!0,childList:!0,subtree:!0};function X(e,n,o){let r=null,i=null,l=null,s=[];const u=document.createElement(\"div\");function c(){null===r&&F(182),null===i&&F(183);const{left:t,top:l}=i.getBoundingClientRect(),c=k(e,n);var a,f;u.isConnected||(f=u,(a=i).insertBefore(f,a.firstChild));let d=!1;for(let e=0;e<c.length;e++){const n=c[e],o=s[e]||document.createElement(\"div\"),r=o.style;\"absolute\"!==r.position&&(r.position=\"absolute\",d=!0);const i=J(n.left-t);r.left!==i&&(r.left=i,d=!0);const a=J(n.top-l);r.top!==a&&(o.style.top=a,d=!0);const f=J(n.width);r.width!==f&&(o.style.width=f,d=!0);const g=J(n.height);r.height!==g&&(o.style.height=g,d=!0),o.parentNode!==u&&(u.append(o),d=!0),s[e]=o}for(;s.length>c.length;)s.pop();d&&o(s)}function a(){i=null,r=null,null!==l&&l.disconnect(),l=null,u.remove();for(const t of s)t.remove();s=[]}u.style.position=\"relative\";const f=e.registerRootListener(function n(){const o=e.getRootElement();if(null===o)return a();const s=o.parentElement;if(!t(s))return a();a(),r=o,i=s,l=new MutationObserver(t=>{const o=e.getRootElement(),l=o&&o.parentElement;if(o!==r||l!==i)return n();for(const e of t)if(!u.contains(e.target))return c()}),l.observe(s,Q),c()});return()=>{f(),a()}}function Y(t,e,n){if(\"text\"!==t.type&&r(e)){const o=l(),r=s(o).$getDOMSlot(e,n,o);return[r.element,r.getFirstChildOffset()+t.offset]}return[i(n)||n,t.offset]}function Z(t){for(const e of t){const t=e.style;\"Highlight\"!==t.background&&(t.background=\"Highlight\"),\"HighlightText\"!==t.color&&(t.color=\"HighlightText\"),t.marginTop!==J(-1.5)&&(t.marginTop=J(-1.5)),t.paddingTop!==J(4)&&(t.paddingTop=J(4)),t.paddingBottom!==J(0)&&(t.paddingBottom=J(0))}}function tt(t,r=Z){let i=null,l=null,s=null,u=null,c=null,a=null,f=()=>{};function d(e){e.read(()=>{const e=n();if(!o(e))return i=null,s=null,u=null,a=null,f(),void(f=()=>{});const[d,g]=function(t){const e=t.getStartEndPoints();return t.isBackward()?[e[1],e[0]]:e}(e),p=d.getNode(),m=p.getKey(),h=d.offset,v=g.getNode(),y=v.getKey(),w=g.offset,x=t.getElementByKey(m),E=t.getElementByKey(y),C=null===i||x!==l||h!==s||m!==i.getKey(),S=null===u||E!==c||w!==a||y!==u.getKey();if((C||S)&&null!==x&&null!==E){const e=function(t,e,n,o,r,i,l){const s=(t._window?t._window.document:document).createRange();return s.setStart(...Y(e,n,o)),s.setEnd(...Y(r,i,l)),s}(t,d,p,x,g,v,E);f(),f=X(t,e,r)}i=p,l=x,s=h,u=v,c=E,a=w})}return d(t.getEditorState()),e(t.registerUpdateListener(({editorState:t})=>d(t)),()=>{f()})}function et(t,e){let n=null;const o=()=>{const o=getSelection(),r=o&&o.anchorNode,i=t.getRootElement();null!==r&&null!==i&&i.contains(r)?null!==n&&(n(),n=null):null===n&&(n=tt(t,e))};return t.registerRootListener(t=>{if(t){const e=t.ownerDocument;return e.addEventListener(\"selectionchange\",o),o(),()=>{null!==n&&n(),e.removeEventListener(\"selectionchange\",o)}}})}const nt=j,ot=I,rt=U,it=G,lt=D,st=q,ut=W,ct=H,at=z,ft=V;function dt(t,e){for(const n of e)if(t.type.startsWith(n))return!0;return!1}function gt(t,e){const n=t[Symbol.iterator]();return new Promise((t,o)=>{const r=[],i=()=>{const{done:l,value:s}=n.next();if(l)return t(r);const u=new FileReader;u.addEventListener(\"error\",o),u.addEventListener(\"load\",()=>{const t=u.result;\"string\"==typeof t&&r.push({file:s,result:t}),i()}),dt(s,e)?u.readAsDataURL(s):i()};i()})}function pt(t,e){return Array.from(vt(t,e))}function mt(t){return t?t.getAdjacentCaret():null}function ht(t,e){return Array.from(St(t,e))}function vt(t,e){return wt(\"next\",t,e)}function yt(t,e){const n=d(f(t,e));return n&&n[0]}function wt(t,e,n){const o=C(),i=e||o,l=r(i)?u(i,t):f(i,t),s=Et(i),c=n?A(a(f(n,t)))||yt(n,t):yt(i,t);let g=s;return K({hasNext:t=>null!==t,initial:l,map:t=>({depth:g,node:t.origin}),step:t=>{if(t.isSameNodeCaret(c))return null;N(t)&&g++;const e=d(t);return!e||e[0].isSameNodeCaret(c)?null:(g+=e[1],e[0])}})}function xt(t){const e=d(f(t,\"next\"));return e&&[e[0].origin,e[1]]}function Et(t){let e=-1;for(let n=t;null!==n;n=n.getParent())e++;return e}function Ct(t){const e=a(f(t,\"previous\")),n=d(e,\"root\");return n&&n[0].origin}function St(t,e){return wt(\"previous\",t,e)}function At(t,e){let n=t;for(;null!=n;){if(n instanceof e)return n;n=n.getParent()}return null}function Nt(t){const e=c(t,t=>r(t)&&!t.isInline());return r(e)||F(4,t.__key),e}function bt(t,e,n,o){const r=t=>t instanceof e;return t.registerNodeTransform(e,t=>{const e=(t=>{const e=t.getChildren();for(let t=0;t<e.length;t++){const n=e[t];if(r(n))return null}let n=t,o=t;for(;null!==n;)if(o=n,n=n.getParent(),r(n))return{child:o,parent:n};return null})(t);if(null!==e){const{child:r,parent:i}=e;if(r.is(t)){o(i,t);const e=r.getNextSiblings(),l=e.length;if(i.insertAfter(r),0!==l){const t=n(i);r.insertAfter(t);for(let n=0;n<l;n++)t.append(e[n])}i.canBeEmpty()||0!==i.getChildrenSize()||i.remove()}}})}function Lt(t,e){const n=new Map,o=t._pendingEditorState;for(const[t,o]of e._nodeMap)n.set(t,T(o));o&&(o._nodeMap=n),t._dirtyType=2;const r=e._selection;B(null===r?null:r.clone())}function Pt(t){const e=n()||x();let r;if(o(e))r=E(e.focus,\"next\");else{if(null!=e){const t=e.getNodes(),n=t[t.length-1];n&&(r=f(n,\"next\"))}r=r||u(C(),\"previous\").getFlipped().insert(S())}const i=Rt(t,r),l=A(i),s=N(l)?b(l):i;return y(L(s)),t.getLatest()}function Rt(t,e,n){let o=P(e,\"next\");h(o)&&(0===o.offset?o=f(o.origin,\"previous\").getFlipped():o.offset===o.origin.getTextContentSize()&&(o=f(o.origin,\"next\"))),o.origin.is(t)&&(R(o)||F(342,t.getKey(),t.getType()),o=M(o)),(t.is(o.getNodeAtCaret())||t.is(o.getFlipped().getNodeAtCaret()))&&t.remove(!0);for(let t=o;t;t=v(t,n))o=t;return h(o)&&F(283),o.insert(t.isInline()?S().append(t):t),P(f(t.getLatest(),\"next\"),e.direction)}function Mt(t){const e=n();if(!o(e))return void(e&&e.insertNodes([t]));const r=g(e);let i=p(m(r),\"next\").anchor;if(h(i)){const t=v(i);if(!t)return;i=t}const l=i.getFlipped();l.insert(t),y(w(l,l))}function Tt(t,e){const n=e();return t.replace(n),n.append(t),n}function Bt(t,e){return null!==t&&Object.getPrototypeOf(t).constructor.name===e.name}function Kt(t,e){const n=[];for(let o=0;o<t.length;o++){const r=e(t[o]);null!==r&&n.push(r)}return n}function _t(t){const e=n();if(!o(e))return!1;const i=new Set,l=e.getNodes();for(let e=0;e<l.length;e++){const n=l[e],o=n.getKey();if(i.has(o))continue;const s=c(n,t=>r(t)&&!t.isInline());if(null===s)continue;const u=s.getKey();s.canIndent()&&!i.has(u)&&(i.add(u),t(s))}return i.size>0}function $t(t,e){u(t,\"next\").insert(e)}let kt=!(ct||!ot)&&void 0;function Ft(t,e=!1){let n=1;if(function(){if(void 0===kt){const t=document.createElement(\"div\");t.style.position=\"absolute\",t.style.opacity=\"0\",t.style.width=\"100px\",t.style.left=\"-1000px\",document.body.appendChild(t);const e=t.getBoundingClientRect();t.style.setProperty(\"zoom\",\"2\"),kt=t.getBoundingClientRect().width===e.width,document.body.removeChild(t)}return kt}()||e)for(;t;)n*=Number(window.getComputedStyle(t).getPropertyValue(\"zoom\")),t=t.parentElement;return n}function It(t){return null!==t._parentEditor}function Ot(t,e){return Dt(t,e,null)}function Dt(t,e,n){let o=!1;for(const i of zt(t))e(i)?null!==n&&n(i):(o=!0,r(i)&&Dt(i,e,n||(t=>i.insertAfter(t))),i.remove());return o}function Ht(t,e){const n=[],o=Array.from(t).reverse();for(let t=o.pop();void 0!==t;t=o.pop())if(e(t))n.push(t);else if(r(t))for(const e of zt(t))o.push(e);return n}function jt(t){return Ut(u(t,\"next\"))}function zt(t){return Ut(u(t,\"previous\"))}function Ut(t){return K({hasNext:R,initial:t.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function Vt(t){M(f(t,\"next\")).splice(1,t.getChildren())}function Wt(t){const e=e=>_(e,t),n=(e,n)=>$(e,t,n);return{$get:e,$set:n,accessors:[e,n],makeGetterMethod:()=>function(){return e(this)},makeSetterMethod:()=>function(t){return n(this,t)},stateConfig:t}}export{Ht as $descendantsMatching,pt as $dfs,vt as $dfsIterator,Kt as $filter,jt as $firstToLastIterator,mt as $getAdjacentCaret,Et as $getDepth,Nt as $getNearestBlockElementAncestorOrThrow,At as $getNearestNodeOfType,Ct as $getNextRightPreorderNode,xt as $getNextSiblingOrParentSibling,_t as $handleIndentAndOutdent,$t as $insertFirst,Mt as $insertNodeIntoLeaf,Pt as $insertNodeToNearestRoot,Rt as $insertNodeToNearestRootAtCaret,It as $isEditorIsNestedEditor,zt as $lastToFirstIterator,Lt as $restoreEditorState,ht as $reverseDfs,St as $reverseDfsIterator,Ot as $unwrapAndFilterDescendants,Vt as $unwrapNode,Tt as $wrapNodeInElement,nt as CAN_USE_BEFORE_INPUT,ot as CAN_USE_DOM,rt as IS_ANDROID,it as IS_ANDROID_CHROME,lt as IS_APPLE,st as IS_APPLE_WEBKIT,ut as IS_CHROME,ct as IS_FIREFOX,at as IS_IOS,ft as IS_SAFARI,Ft as calculateZoomLevel,dt as isMimeType,Wt as makeStateWrapper,tt as markSelection,gt as mediaFileReader,Bt as objectKlassEquals,X as positionNodeOnRange,bt as registerNestedElementResolver,et as selectionAlwaysOnDisplay};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAQ2oC,SAAS,EAAE,GAAE,GAAG,GAAE;CAAC,MAAM,IAAE,IAAI,IAAI,gCAAgC,GAAE,IAAE,IAAI,gBAAc;CAAE,EAAE,OAAO,QAAO,CAAC;CAAE,KAAI,MAAM,KAAK,GAAE,EAAE,OAAO,KAAI,CAAC;CAAE,MAAM,EAAE,SAAO,EAAE,SAAS,GAAE,MAAM,2BAA2B,EAAE,UAAU,EAAE,SAAS,EAAE,+GAA+G;AAAC;AAAC,MAAM,IAAE,eAAa,OAAO,UAAQ,KAAK,MAAI,OAAO,YAAU,KAAK,MAAI,OAAO,SAAS,eAAc,IAAE,KAAG,kBAAiB,WAAS,SAAS,eAAa,MAAK,IAAE,KAAG,uBAAuB,KAAK,UAAU,QAAQ,GAAE,IAAE,KAAG,mCAAmC,KAAK,UAAU,SAAS,GAAE,IAAE,EAAE,CAAC,KAAG,EAAE,gBAAe,WAAS,MAAI,qBAAoB,IAAI,OAAO,WAAW,OAAO,GAAE,IAAE,KAAG,mBAAmB,KAAK,UAAU,SAAS,KAAG,CAAC,OAAO,UAAS,IAAE,KAAG,UAAU,KAAK,UAAU,SAAS,GAAE,IAAE,KAAG,0B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":"LexicalUtils.prod-CmeHwh8W.mjs","names":["k","t","r","l","s","i","n","o","e","d","f","C","u","A","a","K","c","T","x","E","S","y","L","N","b","P","R","M","v","h","p","m","g","w","_","$"],"sources":["../../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.prod.mjs"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{isHTMLElement as t,mergeRegister as e,$getSelection as n,$isRangeSelection as o,$isElementNode as r,getDOMTextNode as i,$getEditor as l,$getEditorDOMRenderConfig as s,$getChildCaret as u,$findMatchingParent as c,$getChildCaretOrSelf as a,$getSiblingCaret as f,$getAdjacentSiblingOrParentSiblingCaret as d,$caretRangeFromSelection as g,$getCaretRangeInDirection as p,$removeTextFromCaretRange as m,$isTextPointCaret as h,$splitAtPointCaretNext as v,$setSelectionFromCaretRange as y,$getCaretRange as w,$getPreviousSelection as x,$caretFromPoint as E,$getRoot as C,$createParagraphNode as S,$getAdjacentChildCaret as A,$isChildCaret as N,$normalizeCaret as b,$getCollapsedCaretRange as L,$getCaretInDirection as P,$isSiblingCaret as R,$rewindSiblingCaret as M,$cloneWithProperties as T,$setSelection as B,makeStepwiseIterator as K,$getState as _,$setState as $}from\"lexical\";export{$findMatchingParent,$getAdjacentSiblingOrParentSiblingCaret,$splitNode,addClassNamesToElement,isBlockDomNode,isHTMLAnchorElement,isHTMLElement,isInlineDomNode,mergeRegister,removeClassNamesFromElement}from\"lexical\";import{createRectsFromDOMRange as k}from\"@lexical/selection\";function F(t,...e){const n=new URL(\"https://lexical.dev/docs/error\"),o=new URLSearchParams;o.append(\"code\",t);for(const t of e)o.append(\"v\",t);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const I=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,O=I&&\"documentMode\"in document?document.documentMode:null,D=I&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),H=I&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),j=!(!I||!(\"InputEvent\"in window)||O)&&\"getTargetRanges\"in new window.InputEvent(\"input\"),z=I&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U=I&&/Android/.test(navigator.userAgent),V=I&&/Version\\/[\\d.]+.*Safari/.test(navigator.userAgent)&&!U,W=I&&/^(?=.*Chrome).*/i.test(navigator.userAgent),G=I&&U&&W,q=I&&/AppleWebKit\\/[\\d.]+/.test(navigator.userAgent)&&D&&!W;function J(t){return`${t}px`}const Q={attributes:!0,characterData:!0,childList:!0,subtree:!0};function X(e,n,o){let r=null,i=null,l=null,s=[];const u=document.createElement(\"div\");function c(){null===r&&F(182),null===i&&F(183);const{left:t,top:l}=i.getBoundingClientRect(),c=k(e,n);var a,f;u.isConnected||(f=u,(a=i).insertBefore(f,a.firstChild));let d=!1;for(let e=0;e<c.length;e++){const n=c[e],o=s[e]||document.createElement(\"div\"),r=o.style;\"absolute\"!==r.position&&(r.position=\"absolute\",d=!0);const i=J(n.left-t);r.left!==i&&(r.left=i,d=!0);const a=J(n.top-l);r.top!==a&&(o.style.top=a,d=!0);const f=J(n.width);r.width!==f&&(o.style.width=f,d=!0);const g=J(n.height);r.height!==g&&(o.style.height=g,d=!0),o.parentNode!==u&&(u.append(o),d=!0),s[e]=o}for(;s.length>c.length;)s.pop();d&&o(s)}function a(){i=null,r=null,null!==l&&l.disconnect(),l=null,u.remove();for(const t of s)t.remove();s=[]}u.style.position=\"relative\";const f=e.registerRootListener(function n(){const o=e.getRootElement();if(null===o)return a();const s=o.parentElement;if(!t(s))return a();a(),r=o,i=s,l=new MutationObserver(t=>{const o=e.getRootElement(),l=o&&o.parentElement;if(o!==r||l!==i)return n();for(const e of t)if(!u.contains(e.target))return c()}),l.observe(s,Q),c()});return()=>{f(),a()}}function Y(t,e,n){if(\"text\"!==t.type&&r(e)){const o=l(),r=s(o).$getDOMSlot(e,n,o);return[r.element,r.getFirstChildOffset()+t.offset]}return[i(n)||n,t.offset]}function Z(t){for(const e of t){const t=e.style;\"Highlight\"!==t.background&&(t.background=\"Highlight\"),\"HighlightText\"!==t.color&&(t.color=\"HighlightText\"),t.marginTop!==J(-1.5)&&(t.marginTop=J(-1.5)),t.paddingTop!==J(4)&&(t.paddingTop=J(4)),t.paddingBottom!==J(0)&&(t.paddingBottom=J(0))}}function tt(t,r=Z){let i=null,l=null,s=null,u=null,c=null,a=null,f=()=>{};function d(e){e.read(()=>{const e=n();if(!o(e))return i=null,s=null,u=null,a=null,f(),void(f=()=>{});const[d,g]=function(t){const e=t.getStartEndPoints();return t.isBackward()?[e[1],e[0]]:e}(e),p=d.getNode(),m=p.getKey(),h=d.offset,v=g.getNode(),y=v.getKey(),w=g.offset,x=t.getElementByKey(m),E=t.getElementByKey(y),C=null===i||x!==l||h!==s||m!==i.getKey(),S=null===u||E!==c||w!==a||y!==u.getKey();if((C||S)&&null!==x&&null!==E){const e=function(t,e,n,o,r,i,l){const s=(t._window?t._window.document:document).createRange();return s.setStart(...Y(e,n,o)),s.setEnd(...Y(r,i,l)),s}(t,d,p,x,g,v,E);f(),f=X(t,e,r)}i=p,l=x,s=h,u=v,c=E,a=w})}return d(t.getEditorState()),e(t.registerUpdateListener(({editorState:t})=>d(t)),()=>{f()})}function et(t,e){let n=null;const o=()=>{const o=getSelection(),r=o&&o.anchorNode,i=t.getRootElement();null!==r&&null!==i&&i.contains(r)?null!==n&&(n(),n=null):null===n&&(n=tt(t,e))};return t.registerRootListener(t=>{if(t){const e=t.ownerDocument;return e.addEventListener(\"selectionchange\",o),o(),()=>{null!==n&&n(),e.removeEventListener(\"selectionchange\",o)}}})}const nt=j,ot=I,rt=U,it=G,lt=D,st=q,ut=W,ct=H,at=z,ft=V;function dt(t,e){for(const n of e)if(t.type.startsWith(n))return!0;return!1}function gt(t,e){const n=t[Symbol.iterator]();return new Promise((t,o)=>{const r=[],i=()=>{const{done:l,value:s}=n.next();if(l)return t(r);const u=new FileReader;u.addEventListener(\"error\",o),u.addEventListener(\"load\",()=>{const t=u.result;\"string\"==typeof t&&r.push({file:s,result:t}),i()}),dt(s,e)?u.readAsDataURL(s):i()};i()})}function pt(t,e){return Array.from(vt(t,e))}function mt(t){return t?t.getAdjacentCaret():null}function ht(t,e){return Array.from(St(t,e))}function vt(t,e){return wt(\"next\",t,e)}function yt(t,e){const n=d(f(t,e));return n&&n[0]}function wt(t,e,n){const o=C(),i=e||o,l=r(i)?u(i,t):f(i,t),s=Et(i),c=n?A(a(f(n,t)))||yt(n,t):yt(i,t);let g=s;return K({hasNext:t=>null!==t,initial:l,map:t=>({depth:g,node:t.origin}),step:t=>{if(t.isSameNodeCaret(c))return null;N(t)&&g++;const e=d(t);return!e||e[0].isSameNodeCaret(c)?null:(g+=e[1],e[0])}})}function xt(t){const e=d(f(t,\"next\"));return e&&[e[0].origin,e[1]]}function Et(t){let e=-1;for(let n=t;null!==n;n=n.getParent())e++;return e}function Ct(t){const e=a(f(t,\"previous\")),n=d(e,\"root\");return n&&n[0].origin}function St(t,e){return wt(\"previous\",t,e)}function At(t,e){let n=t;for(;null!=n;){if(n instanceof e)return n;n=n.getParent()}return null}function Nt(t){const e=c(t,t=>r(t)&&!t.isInline());return r(e)||F(4,t.__key),e}function bt(t,e,n,o){const r=t=>t instanceof e;return t.registerNodeTransform(e,t=>{const e=(t=>{const e=t.getChildren();for(let t=0;t<e.length;t++){const n=e[t];if(r(n))return null}let n=t,o=t;for(;null!==n;)if(o=n,n=n.getParent(),r(n))return{child:o,parent:n};return null})(t);if(null!==e){const{child:r,parent:i}=e;if(r.is(t)){o(i,t);const e=r.getNextSiblings(),l=e.length;if(i.insertAfter(r),0!==l){const t=n(i);r.insertAfter(t);for(let n=0;n<l;n++)t.append(e[n])}i.canBeEmpty()||0!==i.getChildrenSize()||i.remove()}}})}function Lt(t,e){const n=new Map,o=t._pendingEditorState;for(const[t,o]of e._nodeMap)n.set(t,T(o));o&&(o._nodeMap=n),t._dirtyType=2;const r=e._selection;B(null===r?null:r.clone())}function Pt(t){const e=n()||x();let r;if(o(e))r=E(e.focus,\"next\");else{if(null!=e){const t=e.getNodes(),n=t[t.length-1];n&&(r=f(n,\"next\"))}r=r||u(C(),\"previous\").getFlipped().insert(S())}const i=Rt(t,r),l=A(i),s=N(l)?b(l):i;return y(L(s)),t.getLatest()}function Rt(t,e,n){let o=P(e,\"next\");h(o)&&(0===o.offset?o=f(o.origin,\"previous\").getFlipped():o.offset===o.origin.getTextContentSize()&&(o=f(o.origin,\"next\"))),o.origin.is(t)&&(R(o)||F(342,t.getKey(),t.getType()),o=M(o)),(t.is(o.getNodeAtCaret())||t.is(o.getFlipped().getNodeAtCaret()))&&t.remove(!0);for(let t=o;t;t=v(t,n))o=t;return h(o)&&F(283),o.insert(t.isInline()?S().append(t):t),P(f(t.getLatest(),\"next\"),e.direction)}function Mt(t){const e=n();if(!o(e))return void(e&&e.insertNodes([t]));const r=g(e);let i=p(m(r),\"next\").anchor;if(h(i)){const t=v(i);if(!t)return;i=t}const l=i.getFlipped();l.insert(t),y(w(l,l))}function Tt(t,e){const n=e();return t.replace(n),n.append(t),n}function Bt(t,e){return null!==t&&Object.getPrototypeOf(t).constructor.name===e.name}function Kt(t,e){const n=[];for(let o=0;o<t.length;o++){const r=e(t[o]);null!==r&&n.push(r)}return n}function _t(t){const e=n();if(!o(e))return!1;const i=new Set,l=e.getNodes();for(let e=0;e<l.length;e++){const n=l[e],o=n.getKey();if(i.has(o))continue;const s=c(n,t=>r(t)&&!t.isInline());if(null===s)continue;const u=s.getKey();s.canIndent()&&!i.has(u)&&(i.add(u),t(s))}return i.size>0}function $t(t,e){u(t,\"next\").insert(e)}let kt=!(ct||!ot)&&void 0;function Ft(t,e=!1){let n=1;if(function(){if(void 0===kt){const t=document.createElement(\"div\");t.style.position=\"absolute\",t.style.opacity=\"0\",t.style.width=\"100px\",t.style.left=\"-1000px\",document.body.appendChild(t);const e=t.getBoundingClientRect();t.style.setProperty(\"zoom\",\"2\"),kt=t.getBoundingClientRect().width===e.width,document.body.removeChild(t)}return kt}()||e)for(;t;)n*=Number(window.getComputedStyle(t).getPropertyValue(\"zoom\")),t=t.parentElement;return n}function It(t){return null!==t._parentEditor}function Ot(t,e){return Dt(t,e,null)}function Dt(t,e,n){let o=!1;for(const i of zt(t))e(i)?null!==n&&n(i):(o=!0,r(i)&&Dt(i,e,n||(t=>i.insertAfter(t))),i.remove());return o}function Ht(t,e){const n=[],o=Array.from(t).reverse();for(let t=o.pop();void 0!==t;t=o.pop())if(e(t))n.push(t);else if(r(t))for(const e of zt(t))o.push(e);return n}function jt(t){return Ut(u(t,\"next\"))}function zt(t){return Ut(u(t,\"previous\"))}function Ut(t){return K({hasNext:R,initial:t.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function Vt(t){M(f(t,\"next\")).splice(1,t.getChildren())}function Wt(t){const e=e=>_(e,t),n=(e,n)=>$(e,t,n);return{$get:e,$set:n,accessors:[e,n],makeGetterMethod:()=>function(){return e(this)},makeSetterMethod:()=>function(t){return n(this,t)},stateConfig:t}}export{Ht as $descendantsMatching,pt as $dfs,vt as $dfsIterator,Kt as $filter,jt as $firstToLastIterator,mt as $getAdjacentCaret,Et as $getDepth,Nt as $getNearestBlockElementAncestorOrThrow,At as $getNearestNodeOfType,Ct as $getNextRightPreorderNode,xt as $getNextSiblingOrParentSibling,_t as $handleIndentAndOutdent,$t as $insertFirst,Mt as $insertNodeIntoLeaf,Pt as $insertNodeToNearestRoot,Rt as $insertNodeToNearestRootAtCaret,It as $isEditorIsNestedEditor,zt as $lastToFirstIterator,Lt as $restoreEditorState,ht as $reverseDfs,St as $reverseDfsIterator,Ot as $unwrapAndFilterDescendants,Vt as $unwrapNode,Tt as $wrapNodeInElement,nt as CAN_USE_BEFORE_INPUT,ot as CAN_USE_DOM,rt as IS_ANDROID,it as IS_ANDROID_CHROME,lt as IS_APPLE,st as IS_APPLE_WEBKIT,ut as IS_CHROME,ct as IS_FIREFOX,at as IS_IOS,ft as IS_SAFARI,Ft as calculateZoomLevel,dt as isMimeType,Wt as makeStateWrapper,tt as markSelection,gt as mediaFileReader,Bt as objectKlassEquals,X as positionNodeOnRange,bt as registerNestedElementResolver,et as selectionAlwaysOnDisplay};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAQ2oC,SAAS,EAAE,GAAE,GAAG,GAAE;CAAC,MAAM,IAAE,IAAI,IAAI,gCAAgC,GAAE,IAAE,IAAI,gBAAc;CAAE,EAAE,OAAO,QAAO,CAAC;CAAE,KAAI,MAAM,KAAK,GAAE,EAAE,OAAO,KAAI,CAAC;CAAE,MAAM,EAAE,SAAO,EAAE,SAAS,GAAE,MAAM,2BAA2B,EAAE,UAAU,EAAE,SAAS,EAAE,+GAA+G;AAAC;AAAC,MAAM,IAAE,eAAa,OAAO,UAAQ,KAAK,MAAI,OAAO,YAAU,KAAK,MAAI,OAAO,SAAS,eAAc,IAAE,KAAG,kBAAiB,WAAS,SAAS,eAAa,MAAK,IAAE,KAAG,uBAAuB,KAAK,UAAU,QAAQ,GAAE,IAAE,KAAG,mCAAmC,KAAK,UAAU,SAAS,GAAE,IAAE,EAAE,CAAC,KAAG,EAAE,gBAAe,WAAS,MAAI,qBAAoB,IAAI,OAAO,WAAW,OAAO,GAAE,IAAE,KAAG,mBAAmB,KAAK,UAAU,SAAS,KAAG,CAAC,OAAO,UAAS,IAAE,KAAG,UAAU,KAAK,UAAU,SAAS,GAAE,IAAE,KAAG,0BAA0B,KAAK,UAAU,SAAS,KAAG,CAAC,GAAE,IAAE,KAAG,mBAAmB,KAAK,UAAU,SAAS,GAAE,IAAE,KAAG,KAAG,GAAE,IAAE,KAAG,sBAAsB,KAAK,UAAU,SAAS,KAAG,KAAG,CAAC;AAAE,SAAS,EAAE,GAAE;CAAC,OAAM,GAAG,EAAE;AAAG;AAAC,M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E,QAAQ;CAAE,KAAI,IAAI,IAAE,EAAE,IAAI,GAAE,KAAK,MAAI,GAAE,IAAE,EAAE,IAAI,GAAE,IAAG,EAAE,CAAC,GAAE,EAAE,KAAK,CAAC;MAAO,IAAGA,eAAE,CAAC,GAAE,KAAI,MAAM,KAAK,GAAG,CAAC,GAAE,EAAE,KAAK,CAAC;CAAE,OAAO;AAAC;AAAC,SAAS,GAAG,GAAE;CAAC,OAAO,GAAGU,eAAE,GAAE,MAAM,CAAC;AAAC;AAAC,SAAS,GAAG,GAAE;CAAC,OAAO,GAAGA,eAAE,GAAE,UAAU,CAAC;AAAC;AAAC,SAAS,GAAG,GAAE;CAAC,OAAOG,qBAAE;EAAC,SAAQW;EAAE,SAAQ,EAAE,iBAAiB;EAAE,MAAI,MAAG,EAAE,OAAO,UAAU;EAAE,OAAK,MAAG,EAAE,iBAAiB;CAAC,CAAC;AAAC;AAAC,SAAS,GAAG,GAAE;CAAC,oBAAEhB,iBAAE,GAAE,MAAM,CAAC,EAAE,OAAO,GAAE,EAAE,YAAY,CAAC;AAAC;AAAC,SAAS,GAAG,GAAE;CAAC,MAAM,KAAE,MAAGwB,UAAE,GAAE,CAAC,GAAE,KAAG,GAAE,MAAIC,UAAE,GAAE,GAAE,CAAC;CAAE,OAAM;EAAC,MAAK;EAAE,MAAK;EAAE,WAAU,CAAC,GAAE,CAAC;EAAE,wBAAqB,WAAU;GAAC,OAAO,EAAE,IAAI;EAAC;EAAE,wBAAqB,SAAS,GAAE;GAAC,OAAO,EAAE,MAAK,CAAC;EAAC;EAAE,aAAY;CAAC;AAAC"}
@@ -1,5 +1,5 @@
1
- import { s as MxsError } from "./output-BM7aBFwt.mjs";
2
- import { s as readCredentials, u as writeCredentials } from "./config-store-WL7dNMS6.mjs";
1
+ import { c as MxsErrorCode, s as MxsError } from "./output-vzequvhd.mjs";
2
+ import { f as writeCredentials, l as readCredentials } from "./config-store-B8_9iStL.mjs";
3
3
  //#region src/core/auth.ts
4
4
  const SUPPORTED_API_VERSIONS = [2];
5
5
  function defaultHttp() {
@@ -32,7 +32,7 @@ async function probeAuthEndpoint(apiUrl, http = defaultHttp()) {
32
32
  }
33
33
  }
34
34
  throw new MxsError({
35
- code: "auth.probe",
35
+ code: MxsErrorCode.AuthProbe,
36
36
  message: "cannot detect auth endpoint",
37
37
  hint: "verify the URL points at a running mx-core server"
38
38
  });
@@ -54,7 +54,7 @@ async function requestDeviceCode(authBase, clientId, scope = "openid profile ema
54
54
  body = await res.text();
55
55
  }
56
56
  throw new MxsError({
57
- code: "auth.denied",
57
+ code: MxsErrorCode.AuthDenied,
58
58
  message: `device code request failed (${res.status})`,
59
59
  details: body
60
60
  });
@@ -67,7 +67,7 @@ async function pollDeviceToken(authBase, clientId, deviceCode, opts) {
67
67
  let intervalMs = Math.max(1, opts.intervalSec) * 1e3;
68
68
  while (Date.now() < deadline) {
69
69
  if (opts.signal?.aborted) throw new MxsError({
70
- code: "auth.denied",
70
+ code: MxsErrorCode.AuthDenied,
71
71
  message: "aborted by user"
72
72
  });
73
73
  await sleep(intervalMs, opts.signal);
@@ -98,22 +98,22 @@ async function pollDeviceToken(authBase, clientId, deviceCode, opts) {
98
98
  continue;
99
99
  }
100
100
  if (err === "access_denied") throw new MxsError({
101
- code: "auth.denied",
101
+ code: MxsErrorCode.AuthDenied,
102
102
  message: "user denied the authorization request"
103
103
  });
104
104
  if (err === "expired_token") throw new MxsError({
105
- code: "auth.expired",
105
+ code: MxsErrorCode.AuthExpired,
106
106
  message: "device code expired before authorization completed",
107
107
  hint: "run `mxs auth login` again"
108
108
  });
109
109
  throw new MxsError({
110
- code: "auth.denied",
110
+ code: MxsErrorCode.AuthDenied,
111
111
  message: `device token request failed (${res.status})`,
112
112
  details: body
113
113
  });
114
114
  }
115
115
  throw new MxsError({
116
- code: "auth.expired",
116
+ code: MxsErrorCode.AuthExpired,
117
117
  message: "device authorization timed out",
118
118
  hint: "run `mxs auth login` again"
119
119
  });
@@ -191,7 +191,7 @@ function normalizeExpiresAt(value) {
191
191
  async function loadCredentialsOrThrow() {
192
192
  const cred = await readCredentials();
193
193
  if (!cred) throw new MxsError({
194
- code: "auth.missing",
194
+ code: MxsErrorCode.AuthMissing,
195
195
  message: "not authenticated",
196
196
  hint: "run `mxs auth login`"
197
197
  });
@@ -208,4 +208,4 @@ async function ensureFreshToken(authBase, clientId, http = defaultHttp()) {
208
208
  //#endregion
209
209
  export { loadCredentialsOrThrow as a, refreshAccessToken as c, isExpiringSoon as i, requestDeviceCode as l, defaultHttp as n, pollDeviceToken as o, ensureFreshToken as r, probeAuthEndpoint as s, SUPPORTED_API_VERSIONS as t, toCredentials as u };
210
210
 
211
- //# sourceMappingURL=auth-OeKZZ_2x.mjs.map
211
+ //# sourceMappingURL=auth-CAKmTDpF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-CAKmTDpF.mjs","names":[],"sources":["../src/core/auth.ts"],"sourcesContent":["import {\n type CredentialsShape,\n readCredentials,\n writeCredentials,\n} from './config-store'\nimport { MxsError, MxsErrorCode } from './errors'\n\nexport const SUPPORTED_API_VERSIONS = [2] as const\n\nexport interface DeviceCodeResponse {\n device_code: string\n user_code: string\n verification_uri: string\n verification_uri_complete?: string\n expires_in: number\n interval: number\n}\n\nexport interface DeviceTokenResponse {\n access_token: string\n token_type: string\n expires_in: number\n refresh_token?: string\n scope?: string\n user?: {\n id?: string\n email?: string\n name?: string\n }\n}\n\nexport interface ProbeResult {\n apiUrl: string\n apiBase: string\n authBase: string\n apiVersion: number\n}\n\nexport interface AuthHttp {\n fetch: typeof fetch\n}\n\nexport function defaultHttp(): AuthHttp {\n return { fetch: globalThis.fetch.bind(globalThis) }\n}\n\nexport async function probeAuthEndpoint(\n apiUrl: string,\n http: AuthHttp = defaultHttp(),\n): Promise<ProbeResult> {\n const candidates: { prefix: string; version: number | null }[] = [\n ...SUPPORTED_API_VERSIONS.map((v) => ({\n prefix: `/api/v${v}/auth`,\n version: v,\n })),\n { prefix: '/auth', version: null },\n ]\n for (const cand of candidates) {\n const probeUrl = `${apiUrl}${cand.prefix}/ok`\n let res: Response\n try {\n res = await http.fetch(probeUrl, { method: 'GET' })\n } catch {\n continue\n }\n if (res.ok) {\n const apiVersion = cand.version ?? SUPPORTED_API_VERSIONS[0]\n const apiBase =\n cand.prefix === '/auth' ? apiUrl : `${apiUrl}/api/v${apiVersion}`\n const authBase = `${apiUrl}${cand.prefix}`\n return { apiUrl, apiBase, authBase, apiVersion }\n }\n }\n throw new MxsError({\n code: MxsErrorCode.AuthProbe,\n message: 'cannot detect auth endpoint',\n hint: 'verify the URL points at a running mx-core server',\n })\n}\n\nexport async function requestDeviceCode(\n authBase: string,\n clientId: string,\n scope = 'openid profile email',\n http: AuthHttp = defaultHttp(),\n): Promise<DeviceCodeResponse> {\n const res = await http.fetch(`${authBase}/device/code`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ client_id: clientId, scope }),\n })\n if (!res.ok) {\n let body: unknown\n try {\n body = await res.json()\n } catch {\n body = await res.text()\n }\n throw new MxsError({\n code: MxsErrorCode.AuthDenied,\n message: `device code request failed (${res.status})`,\n details: body,\n })\n }\n return (await res.json()) as DeviceCodeResponse\n}\n\nexport interface PollOptions {\n intervalSec: number\n expiresInSec: number\n signal?: AbortSignal\n onTick?: (state: 'pending' | 'slow_down') => void\n http?: AuthHttp\n}\n\nexport async function pollDeviceToken(\n authBase: string,\n clientId: string,\n deviceCode: string,\n opts: PollOptions,\n): Promise<DeviceTokenResponse> {\n const http = opts.http ?? defaultHttp()\n const deadline = Date.now() + opts.expiresInSec * 1000\n let intervalMs = Math.max(1, opts.intervalSec) * 1000\n while (Date.now() < deadline) {\n if (opts.signal?.aborted) {\n throw new MxsError({\n code: MxsErrorCode.AuthDenied,\n message: 'aborted by user',\n })\n }\n await sleep(intervalMs, opts.signal)\n const res = await http.fetch(`${authBase}/device/token`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({\n grant_type: 'urn:ietf:params:oauth:grant-type:device_code',\n device_code: deviceCode,\n client_id: clientId,\n }),\n })\n let body: any\n try {\n body = await res.json()\n } catch {\n body = null\n }\n if (res.ok && body?.access_token) {\n return body as DeviceTokenResponse\n }\n const err = body?.error as string | undefined\n if (err === 'authorization_pending') {\n opts.onTick?.('pending')\n continue\n }\n if (err === 'slow_down') {\n intervalMs += 5000\n opts.onTick?.('slow_down')\n continue\n }\n if (err === 'access_denied') {\n throw new MxsError({\n code: MxsErrorCode.AuthDenied,\n message: 'user denied the authorization request',\n })\n }\n if (err === 'expired_token') {\n throw new MxsError({\n code: MxsErrorCode.AuthExpired,\n message: 'device code expired before authorization completed',\n hint: 'run `mxs auth login` again',\n })\n }\n throw new MxsError({\n code: MxsErrorCode.AuthDenied,\n message: `device token request failed (${res.status})`,\n details: body,\n })\n }\n throw new MxsError({\n code: MxsErrorCode.AuthExpired,\n message: 'device authorization timed out',\n hint: 'run `mxs auth login` again',\n })\n}\n\nfunction sleep(ms: number, signal?: AbortSignal): Promise<void> {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) return reject(new Error('aborted'))\n const timer = setTimeout(() => {\n if (signal) signal.removeEventListener('abort', onAbort)\n resolve()\n }, ms)\n const onAbort = () => {\n clearTimeout(timer)\n reject(new Error('aborted'))\n }\n signal?.addEventListener('abort', onAbort, { once: true })\n })\n}\n\nexport function toCredentials(resp: DeviceTokenResponse): CredentialsShape {\n return {\n access_token: resp.access_token,\n refresh_token: resp.refresh_token,\n expires_at: Date.now() + resp.expires_in * 1000,\n user: resp.user,\n }\n}\n\nexport function isExpiringSoon(\n cred: CredentialsShape,\n bufferMs = 60_000,\n): boolean {\n return cred.expires_at < Date.now() + bufferMs\n}\n\nexport async function refreshAccessToken(\n authBase: string,\n clientId: string,\n cred: CredentialsShape,\n http: AuthHttp = defaultHttp(),\n): Promise<CredentialsShape | null> {\n if (!cred.refresh_token) {\n return refreshSessionToken(authBase, cred, http)\n }\n const res = await http.fetch(`${authBase}/token`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({\n grant_type: 'refresh_token',\n refresh_token: cred.refresh_token,\n client_id: clientId,\n }),\n })\n if (!res.ok) return null\n const body = (await res.json()) as DeviceTokenResponse\n if (!body?.access_token) return null\n return {\n access_token: body.access_token,\n refresh_token: body.refresh_token ?? cred.refresh_token,\n expires_at: Date.now() + body.expires_in * 1000,\n user: body.user ?? cred.user,\n }\n}\n\nasync function refreshSessionToken(\n authBase: string,\n cred: CredentialsShape,\n http: AuthHttp,\n): Promise<CredentialsShape | null> {\n const res = await http.fetch(`${authBase}/get-session`, {\n method: 'GET',\n headers: {\n accept: 'application/json',\n authorization: `Bearer ${cred.access_token}`,\n },\n })\n if (!res.ok) return null\n const body = (await res.json().catch(() => null)) as {\n session?: { expiresAt?: string | Date | number }\n user?: CredentialsShape['user']\n } | null\n const expiresAt = normalizeExpiresAt(body?.session?.expiresAt)\n if (!expiresAt || expiresAt <= cred.expires_at) return null\n return {\n access_token: res.headers.get('set-auth-token') ?? cred.access_token,\n refresh_token: cred.refresh_token,\n expires_at: expiresAt,\n user: body?.user ?? cred.user,\n }\n}\n\nfunction normalizeExpiresAt(value: string | Date | number | undefined) {\n if (value === undefined) return null\n const time =\n value instanceof Date\n ? value.getTime()\n : typeof value === 'number'\n ? value\n : new Date(value).getTime()\n return Number.isFinite(time) ? time : null\n}\n\nexport async function loadCredentialsOrThrow(): Promise<CredentialsShape> {\n const cred = await readCredentials()\n if (!cred) {\n throw new MxsError({\n code: MxsErrorCode.AuthMissing,\n message: 'not authenticated',\n hint: 'run `mxs auth login`',\n })\n }\n return cred\n}\n\nexport async function ensureFreshToken(\n authBase: string,\n clientId: string,\n http: AuthHttp = defaultHttp(),\n): Promise<CredentialsShape> {\n const cred = await loadCredentialsOrThrow()\n if (!isExpiringSoon(cred)) return cred\n const refreshed = await refreshAccessToken(authBase, clientId, cred, http)\n if (!refreshed) return cred\n await writeCredentials(refreshed)\n return refreshed\n}\n"],"mapp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AAQ;EACR,SAAS;GACP,QAAQ;GACR,eAAe,UAAU,KAAK;EAChC;CACF,CAAC;CACD,IAAI,CAAC,IAAI,IAAI,OAAO;CACpB,MAAM,OAAQ,MAAM,IAAI,KAAK,EAAE,YAAY,IAAI;CAI/C,MAAM,YAAY,mBAAmB,MAAM,SAAS,SAAS;CAC7D,IAAI,CAAC,aAAa,aAAa,KAAK,YAAY,OAAO;CACvD,OAAO;EACL,cAAc,IAAI,QAAQ,IAAI,gBAAgB,KAAK,KAAK;EACxD,eAAe,KAAK;EACpB,YAAY;EACZ,MAAM,MAAM,QAAQ,KAAK;CAC3B;AACF;AAEA,SAAS,mBAAmB,OAA2C;CACrE,IAAI,UAAU,KAAA,GAAW,OAAO;CAChC,MAAM,OACJ,iBAAiB,OACb,MAAM,QAAQ,IACd,OAAO,UAAU,WACf,QACA,IAAI,KAAK,KAAK,EAAE,QAAQ;CAChC,OAAO,OAAO,SAAS,IAAI,IAAI,OAAO;AACxC;AAEA,eAAsB,yBAAoD;CACxE,MAAM,OAAO,MAAM,gBAAgB;CACnC,IAAI,CAAC,MACH,MAAM,IAAI,SAAS;EACjB,MAAM,aAAa;EACnB,SAAS;EACT,MAAM;CACR,CAAC;CAEH,OAAO;AACT;AAEA,eAAsB,iBACpB,UACA,UACA,OAAiB,YAAY,GACF;CAC3B,MAAM,OAAO,MAAM,uBAAuB;CAC1C,IAAI,CAAC,eAAe,IAAI,GAAG,OAAO;CAClC,MAAM,YAAY,MAAM,mBAAmB,UAAU,UAAU,MAAM,IAAI;CACzE,IAAI,CAAC,WAAW,OAAO;CACvB,MAAM,iBAAiB,SAAS;CAChC,OAAO;AACT"}
@@ -1,4 +1,4 @@
1
- import { t as OutputOptions } from "../output-CTnO1lYt.mjs";
1
+ import { t as OutputOptions } from "../output-D2dDlyV2.mjs";
2
2
 
3
3
  //#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/typings/index.d.ts
4
4
  // Type definitions for commander
@@ -920,6 +920,7 @@ interface GlobalOptions {
920
920
  quiet?: boolean;
921
921
  verbose?: boolean;
922
922
  dryRun?: boolean;
923
+ profile?: string;
923
924
  }
924
925
  declare function readGlobalOptions(cmd: Command): OutputOptions;
925
926
  declare function readGlobalFlags(cmd: Command): GlobalOptions;