@payloadcms/richtext-lexical 4.0.0-internal.4804abd → 4.0.0-internal.4c2ee12

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 (602) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/exports/client/Field-MT4FK3IP.js +2 -0
  3. package/dist/exports/client/Field-MT4FK3IP.js.map +7 -0
  4. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  5. package/dist/exports/client/{chunk-X3D4LZS7.js.map → chunk-3LRZDIIG.js.map} +4 -4
  6. package/dist/exports/client/chunk-E6LSRRP2.js +2 -0
  7. package/dist/exports/client/chunk-E6LSRRP2.js.map +7 -0
  8. package/dist/exports/client/chunk-ZQX5HXUL.js +2 -0
  9. package/dist/exports/client/chunk-ZQX5HXUL.js.map +7 -0
  10. package/dist/exports/client/component-6DQLENIE.js +2 -0
  11. package/dist/exports/client/component-6DQLENIE.js.map +7 -0
  12. package/dist/exports/client/componentInline-HNE5G4TE.js +2 -0
  13. package/dist/exports/client/index.d.ts +1 -2
  14. package/dist/exports/client/index.d.ts.map +1 -1
  15. package/dist/exports/client/index.js +28 -28
  16. package/dist/exports/client/index.js.map +4 -4
  17. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  18. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  19. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  20. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  21. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  22. package/dist/features/blocks/client/component/index.d.ts +0 -6
  23. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  24. package/dist/features/blocks/client/component/index.js +169 -101
  25. package/dist/features/blocks/client/component/index.js.map +1 -1
  26. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  27. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  28. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  29. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  30. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  31. package/dist/features/blocks/client/componentInline/index.css +0 -1
  32. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  33. package/dist/features/blocks/client/componentInline/index.js +30 -22
  34. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  35. package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
  36. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  37. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  38. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  39. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  40. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  41. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  42. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  43. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  44. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  45. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  46. package/dist/features/blocks/server/index.js +2 -2
  47. package/dist/features/blocks/server/index.js.map +1 -1
  48. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  49. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  50. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  51. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  52. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  53. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  54. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  55. package/dist/features/blocks/server/schema.d.ts +2 -0
  56. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  57. package/dist/features/blocks/server/schema.js +7 -9
  58. package/dist/features/blocks/server/schema.js.map +1 -1
  59. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  60. package/dist/features/blocks/server/validate.js +1 -1
  61. package/dist/features/blocks/server/validate.js.map +1 -1
  62. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  63. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  64. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  65. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  66. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  67. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  68. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  69. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  70. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  71. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  72. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  73. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  74. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  75. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  76. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  77. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  78. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  79. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  80. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  81. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  82. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  83. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  84. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  85. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  86. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  87. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  88. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  89. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  90. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  91. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  92. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  93. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  94. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  95. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  96. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  97. package/dist/features/heading/constants.d.ts +2 -0
  98. package/dist/features/heading/constants.d.ts.map +1 -0
  99. package/dist/features/heading/constants.js +2 -0
  100. package/dist/features/heading/constants.js.map +1 -0
  101. package/dist/features/heading/server/index.d.ts.map +1 -1
  102. package/dist/features/heading/server/index.js +5 -1
  103. package/dist/features/heading/server/index.js.map +1 -1
  104. package/dist/features/heading/server/schema.d.ts.map +1 -1
  105. package/dist/features/heading/server/validate.d.ts +6 -0
  106. package/dist/features/heading/server/validate.d.ts.map +1 -0
  107. package/dist/features/heading/server/validate.js +15 -0
  108. package/dist/features/heading/server/validate.js.map +1 -0
  109. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  110. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  111. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  112. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  113. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  114. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  115. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  116. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  117. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  118. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  119. package/dist/features/horizontalRule/server/schema.js +6 -5
  120. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  121. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  122. package/dist/features/indent/client/IndentPlugin.js +122 -1
  123. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  124. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  125. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  126. package/dist/features/indent/server/i18n.js +74 -37
  127. package/dist/features/indent/server/i18n.js.map +1 -1
  128. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  129. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  130. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -5
  131. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  132. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -2
  133. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  134. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  135. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  136. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  137. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  138. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  139. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  140. package/dist/features/link/nodes/LinkNode.js +2 -15
  141. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  142. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  143. package/dist/features/link/server/baseFields.js.map +1 -1
  144. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  145. package/dist/features/link/server/index.js +2 -2
  146. package/dist/features/link/server/index.js.map +1 -1
  147. package/dist/features/link/server/schema.d.ts.map +1 -1
  148. package/dist/features/link/server/validate.d.ts.map +1 -1
  149. package/dist/features/link/server/validate.js +1 -1
  150. package/dist/features/link/server/validate.js.map +1 -1
  151. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  152. package/dist/features/lists/checklist/server/index.js +5 -2
  153. package/dist/features/lists/checklist/server/index.js.map +1 -1
  154. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  155. package/dist/features/lists/orderedList/server/index.js +5 -2
  156. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  157. package/dist/features/lists/shared/constants.d.ts +2 -0
  158. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  159. package/dist/features/lists/shared/constants.js +2 -0
  160. package/dist/features/lists/shared/constants.js.map +1 -0
  161. package/dist/features/lists/shared/validate.d.ts +5 -0
  162. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  163. package/dist/features/lists/shared/validate.js +15 -0
  164. package/dist/features/lists/shared/validate.js.map +1 -0
  165. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  166. package/dist/features/lists/unorderedList/server/index.js +5 -2
  167. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  168. package/dist/features/relationship/client/components/index.css +3 -6
  169. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  170. package/dist/features/relationship/client/index.d.ts +2 -2
  171. package/dist/features/relationship/client/index.d.ts.map +1 -1
  172. package/dist/features/relationship/client/index.js.map +1 -1
  173. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  174. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  175. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  176. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  177. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  178. package/dist/features/relationship/client/plugins/index.js +27 -31
  179. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  180. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  181. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  182. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  183. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  184. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  185. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  186. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  187. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  188. package/dist/features/relationship/server/index.d.ts +8 -1
  189. package/dist/features/relationship/server/index.d.ts.map +1 -1
  190. package/dist/features/relationship/server/index.js +28 -11
  191. package/dist/features/relationship/server/index.js.map +1 -1
  192. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  193. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  194. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  195. package/dist/features/relationship/server/schema.d.ts +3 -2
  196. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  197. package/dist/features/relationship/server/schema.js +9 -12
  198. package/dist/features/relationship/server/schema.js.map +1 -1
  199. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  200. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  201. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  202. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  203. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  204. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  205. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  206. package/dist/features/table/client/index.d.ts.map +1 -0
  207. package/dist/features/table/client/index.js.map +1 -0
  208. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  209. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  210. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  211. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  212. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -1
  213. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  214. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  215. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  216. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  217. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  218. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  219. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  220. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  221. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  222. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  223. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  224. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  225. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  226. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  227. package/dist/features/table/client/utils/debounce.js.map +1 -0
  228. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  229. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  230. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  231. package/dist/features/table/markdownTransformer.js.map +1 -0
  232. package/dist/features/table/server/index.d.ts +3 -0
  233. package/dist/features/table/server/index.d.ts.map +1 -0
  234. package/dist/features/{experimental_table → table}/server/index.js +4 -4
  235. package/dist/features/table/server/index.js.map +1 -0
  236. package/dist/features/table/server/schema.d.ts.map +1 -0
  237. package/dist/features/table/server/schema.js.map +1 -0
  238. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  239. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  240. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  241. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  242. package/dist/features/toolbars/fixed/client/Toolbar/index.css +78 -6
  243. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  244. package/dist/features/toolbars/fixed/client/Toolbar/index.js +19 -1
  245. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  246. package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
  247. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  248. package/dist/features/toolbars/inline/client/Toolbar/index.js +17 -2
  249. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  250. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  251. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  252. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  253. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  254. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  255. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  256. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -14
  257. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  258. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  259. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  260. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +79 -0
  261. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  262. package/dist/features/typesServer.d.ts +17 -12
  263. package/dist/features/typesServer.d.ts.map +1 -1
  264. package/dist/features/typesServer.js.map +1 -1
  265. package/dist/features/upload/client/component/index.css +0 -2
  266. package/dist/features/upload/client/component/index.js +2 -1
  267. package/dist/features/upload/client/component/index.js.map +1 -1
  268. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  269. package/dist/features/upload/client/index.d.ts +3 -2
  270. package/dist/features/upload/client/index.d.ts.map +1 -1
  271. package/dist/features/upload/client/index.js.map +1 -1
  272. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  273. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  274. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  275. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  276. package/dist/features/upload/client/plugin/index.js +50 -53
  277. package/dist/features/upload/client/plugin/index.js.map +1 -1
  278. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  279. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  280. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  281. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  282. package/dist/features/upload/server/index.d.ts +7 -3
  283. package/dist/features/upload/server/index.d.ts.map +1 -1
  284. package/dist/features/upload/server/index.js +20 -16
  285. package/dist/features/upload/server/index.js.map +1 -1
  286. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  287. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  288. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  289. package/dist/features/upload/server/schema.d.ts +4 -16
  290. package/dist/features/upload/server/schema.d.ts.map +1 -1
  291. package/dist/features/upload/server/schema.js +8 -10
  292. package/dist/features/upload/server/schema.js.map +1 -1
  293. package/dist/features/upload/server/validate.d.ts +2 -2
  294. package/dist/features/upload/server/validate.d.ts.map +1 -1
  295. package/dist/features/upload/server/validate.js +4 -1
  296. package/dist/features/upload/server/validate.js.map +1 -1
  297. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  298. package/dist/field/Diff/converters/listitem/index.js +2 -1
  299. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  300. package/dist/field/Diff/converters/relationship/index.css +0 -1
  301. package/dist/field/Diff/converters/unknown/index.css +0 -1
  302. package/dist/field/Diff/converters/upload/index.css +0 -1
  303. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  304. package/dist/field/Diff/index.css +0 -2
  305. package/dist/field/Diff/index.d.ts +3 -2
  306. package/dist/field/Diff/index.d.ts.map +1 -1
  307. package/dist/field/Diff/index.js +3 -2
  308. package/dist/field/Diff/index.js.map +1 -1
  309. package/dist/field/Field.d.ts.map +1 -1
  310. package/dist/field/Field.js +26 -16
  311. package/dist/field/Field.js.map +1 -1
  312. package/dist/field/RenderLexical/index.d.ts +3 -1
  313. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  314. package/dist/field/RenderLexical/index.js +23 -23
  315. package/dist/field/RenderLexical/index.js.map +1 -1
  316. package/dist/field/ViewSelector.d.ts.map +1 -1
  317. package/dist/field/ViewSelector.js +1 -0
  318. package/dist/field/ViewSelector.js.map +1 -1
  319. package/dist/field/bundled.css +1 -1
  320. package/dist/field/index.css +2 -3
  321. package/dist/field/rscEntry.d.ts +2 -2
  322. package/dist/field/rscEntry.d.ts.map +1 -1
  323. package/dist/field/rscEntry.js.map +1 -1
  324. package/dist/i18n.d.ts.map +1 -1
  325. package/dist/i18n.js +68 -0
  326. package/dist/i18n.js.map +1 -1
  327. package/dist/index.d.ts +5 -5
  328. package/dist/index.d.ts.map +1 -1
  329. package/dist/index.js +31 -52
  330. package/dist/index.js.map +1 -1
  331. package/dist/lexical/LexicalEditor.css +30 -19
  332. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  333. package/dist/lexical/LexicalEditor.js +62 -99
  334. package/dist/lexical/LexicalEditor.js.map +1 -1
  335. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  336. package/dist/lexical/LexicalProvider.js +7 -22
  337. package/dist/lexical/LexicalProvider.js.map +1 -1
  338. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  339. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  340. package/dist/lexical/config/server/loader.d.ts +1 -1
  341. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  342. package/dist/lexical/config/server/loader.js +2 -2
  343. package/dist/lexical/config/server/loader.js.map +1 -1
  344. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  345. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  346. package/dist/lexical/config/server/sanitize.js +2 -2
  347. package/dist/lexical/config/server/sanitize.js.map +1 -1
  348. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  349. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  350. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  351. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  352. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  353. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  354. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  355. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  356. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  357. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  358. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  359. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  360. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
  361. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  362. package/dist/lexical/plugins/SlashMenu/index.css +0 -2
  363. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
  364. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  365. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  366. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  367. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +2 -0
  368. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  369. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
  370. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  371. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  372. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  373. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  374. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  375. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  376. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  377. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  378. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  379. package/dist/lexical/theme/EditorTheme.css +0 -2
  380. package/dist/lexical/ui/ContentEditable.css +19 -14
  381. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  382. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  383. package/dist/lexical/ui/ContentEditable.js +21 -7
  384. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  385. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  386. package/dist/lexical/ui/icons/H3/index.js +13 -6
  387. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  388. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  389. package/dist/lexical/ui/icons/H4/index.js +13 -6
  390. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  391. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  392. package/dist/lexical/ui/icons/H5/index.js +13 -6
  393. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  394. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  395. package/dist/lexical/ui/icons/H6/index.js +13 -6
  396. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  397. package/dist/lexical/utils/markdown/createBlockNode.d.ts +1 -1
  398. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  399. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  400. package/dist/lexical/utils/point.d.ts.map +1 -1
  401. package/dist/lexical/utils/rect.d.ts.map +1 -1
  402. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  403. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  404. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  405. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  406. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  407. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  408. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  409. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  410. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  411. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  412. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  413. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  414. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  415. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  416. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  417. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  418. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  419. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  420. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  421. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  422. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  423. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  424. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  425. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  426. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  427. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  428. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  429. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  430. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  431. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  432. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  433. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  434. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  435. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  436. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  437. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  438. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  439. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  440. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  441. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  442. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  443. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  444. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  445. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  446. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  447. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  448. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  449. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  450. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  451. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  452. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  453. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  454. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  455. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  456. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  457. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  458. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  459. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  460. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  461. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  462. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  463. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  464. package/dist/presets/llmInstructions.d.ts +2 -0
  465. package/dist/presets/llmInstructions.d.ts.map +1 -0
  466. package/dist/presets/llmInstructions.js +13 -0
  467. package/dist/presets/llmInstructions.js.map +1 -0
  468. package/dist/types/builtInNodes.d.ts +1 -1
  469. package/dist/types/builtInNodes.d.ts.map +1 -1
  470. package/dist/types/builtInNodes.js +8 -3
  471. package/dist/types/builtInNodes.js.map +1 -1
  472. package/dist/types/index.d.ts +4 -7
  473. package/dist/types/index.d.ts.map +1 -1
  474. package/dist/types/index.js.map +1 -1
  475. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  476. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  477. package/dist/types/jsonSchemaHelpers.js +7 -2
  478. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  479. package/dist/types/nodeTypes.d.ts +6 -1
  480. package/dist/types/nodeTypes.d.ts.map +1 -1
  481. package/dist/types/nodeTypes.js.map +1 -1
  482. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  483. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  484. package/dist/utilities/buildInitialState.d.ts +3 -2
  485. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  486. package/dist/utilities/buildInitialState.js +1 -0
  487. package/dist/utilities/buildInitialState.js.map +1 -1
  488. package/dist/utilities/createServerFeature.d.ts +1 -1
  489. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  490. package/dist/utilities/createServerFeature.js +2 -2
  491. package/dist/utilities/createServerFeature.js.map +1 -1
  492. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  493. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  494. package/dist/utilities/editorConfigFactory.js +9 -9
  495. package/dist/utilities/editorConfigFactory.js.map +1 -1
  496. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
  497. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
  498. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  499. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  500. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  501. package/dist/utilities/generateImportMap.d.ts +3 -3
  502. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  503. package/dist/utilities/generateImportMap.js +3 -7
  504. package/dist/utilities/generateImportMap.js.map +1 -1
  505. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  506. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  507. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  508. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  509. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  510. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  511. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  512. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  513. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  514. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  515. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  516. package/dist/validate/hasText.d.ts +2 -2
  517. package/dist/validate/hasText.d.ts.map +1 -1
  518. package/dist/validate/hasText.js.map +1 -1
  519. package/dist/validate/index.d.ts +1 -1
  520. package/dist/validate/index.d.ts.map +1 -1
  521. package/package.json +99 -27
  522. package/dist/@types/assets.d.js +0 -2
  523. package/dist/@types/assets.d.js.map +0 -1
  524. package/dist/dependencyChecker.spec.js +0 -16
  525. package/dist/dependencyChecker.spec.js.map +0 -1
  526. package/dist/exports/client/Field-DXKR3OGV.js +0 -2
  527. package/dist/exports/client/Field-DXKR3OGV.js.map +0 -7
  528. package/dist/exports/client/bundled.css +0 -1
  529. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  530. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  531. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  532. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  533. package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
  534. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  535. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  536. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  537. package/dist/exports/server/rsc.browser.d.ts +0 -11
  538. package/dist/exports/server/rsc.browser.d.ts.map +0 -1
  539. package/dist/exports/server/rsc.browser.js +0 -10
  540. package/dist/exports/server/rsc.browser.js.map +0 -1
  541. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  542. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  543. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  544. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  545. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  546. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  547. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  548. package/dist/features/experimental_table/client/index.js.map +0 -1
  549. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  550. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  551. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  552. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  553. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  554. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  555. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  556. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  557. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  558. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  559. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  560. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  561. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  562. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  563. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  564. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  565. package/dist/features/experimental_table/server/index.d.ts +0 -3
  566. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  567. package/dist/features/experimental_table/server/index.js.map +0 -1
  568. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  569. package/dist/features/experimental_table/server/schema.js.map +0 -1
  570. package/dist/features/link/markdownTransformer.spec.js +0 -195
  571. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  572. package/dist/field/clientEntry.d.ts +0 -29
  573. package/dist/field/clientEntry.d.ts.map +0 -1
  574. package/dist/field/clientEntry.js +0 -86
  575. package/dist/field/clientEntry.js.map +0 -1
  576. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  577. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  578. package/dist/lexical/utils/url.spec.js +0 -114
  579. package/dist/lexical/utils/url.spec.js.map +0 -1
  580. package/dist/utilities/jsx/jsx.spec.js +0 -178
  581. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  582. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-HNE5G4TE.js.map} +0 -0
  583. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  584. /package/dist/features/{experimental_table → table}/client/index.js +0 -0
  585. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  586. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  587. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  588. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  589. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  590. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  591. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  592. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  593. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  594. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  595. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  596. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  597. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  598. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  599. /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
  600. /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
  601. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  602. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -1,26 +1,26 @@
1
- "use client";import{a as be,c as xt,d as Ct,e as bt}from"./chunk-ESITTE3C.js";import{a as qe}from"./chunk-DBWINSQN.js";import{a as Oo,b as Qe}from"./chunk-UD4DQ4AK.js";import{a as gr,b as xr,c as Oe}from"./chunk-5VIL27GI.js";import{a as Yc}from"./chunk-WSAPGI3Z.js";import{a as se,b as Cr,c as Fo,d as Po,e as qc,f as Qc,h as eu,j as tu,m as ou}from"./chunk-X3D4LZS7.js";import{a as Zc,b as U}from"./chunk-RJ5MAOKZ.js";function X(t){return{items:t,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}import{c as su}from"react/compiler-runtime";import{useLexicalComposerContext as au}from"@lexical/react/LexicalComposerContext";import{$isDecoratorBlockNode as ke}from"@lexical/react/LexicalDecoratorBlockNode";import{$findMatchingParent as cu}from"@lexical/utils";import{$getSelection as uu,$isElementNode as me,$isNodeSelection as du,$isRangeSelection as kt,COMMAND_PRIORITY_LOW as mu,FORMAT_ELEMENT_COMMAND as _t}from"lexical";import{useEffect as pu}from"react";import{jsx as br}from"react/jsx-runtime";import"react";var nu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m3 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5M7.5 15a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",kr=({className:t})=>br("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:br("path",{clipRule:"evenodd",d:nu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as _r}from"react/jsx-runtime";import"react";var ru="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Tr=({className:t})=>_r("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:_r("path",{clipRule:"evenodd",d:ru,fill:"currentColor",fillRule:"evenodd"})});import{jsx as wr}from"react/jsx-runtime";import"react";var lu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Ut=({className:t})=>wr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:wr("path",{clipRule:"evenodd",d:lu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Er}from"react/jsx-runtime";import"react";var iu="M19 7.5a.5.5 0 0 0-.5-.5h-13a.5.5 0 0 0 0 1h13a.5.5 0 0 0 .5-.5m0 4a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0 0 1h7a.5.5 0 0 0 .5-.5m-.5 3.5a.5.5 0 0 1 0 1h-9a.5.5 0 0 1 0-1z",Sr=({className:t})=>Er("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Er("path",{clipRule:"evenodd",d:iu,fill:"currentColor",fillRule:"evenodd"})});var A=t=>o=>{let n={clientFeatureProps:o};if(typeof t=="function")n.feature=({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:u,resolvedFeatures:d,schemaPath:c,unSanitizedEditorConfig:a})=>{let m=t({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:u,props:o,resolvedFeatures:d,schemaPath:c,unSanitizedEditorConfig:a});return m.sanitizedClientFeatureProps===null&&(m.sanitizedClientFeatureProps=o),m};else{let r={...t};r.sanitizedClientFeatureProps=o,n.feature=r}return n};var Nr=t=>({type:"dropdown",ChildComponent:Ut,iconOnly:!0,items:t,key:"align",order:30});var Ie=t=>me(t)?t.getFormatType():t.__format,Lr=[Nr([{ChildComponent:Ut,isActive:({selection:t})=>{if(!kt(t))return!1;for(let e of t.getNodes()){if((me(e)||ke(e))&&Ie(e)==="left")continue;let o=e.getParent();if(!((me(o)||ke(o))&&Ie(o)==="left"))return!1}return!0},key:"alignLeft",label:({i18n:t})=>t.t("lexical:align:alignLeftLabel"),onSelect:({editor:t})=>{t.dispatchCommand(_t,"left")},order:1},{ChildComponent:kr,isActive:({selection:t})=>{if(!kt(t))return!1;for(let e of t.getNodes()){if((me(e)||ke(e))&&Ie(e)==="center")continue;let o=e.getParent();if(!((me(o)||ke(o))&&Ie(o)==="center"))return!1}return!0},key:"alignCenter",label:({i18n:t})=>t.t("lexical:align:alignCenterLabel"),onSelect:({editor:t})=>{t.dispatchCommand(_t,"center")},order:2},{ChildComponent:Sr,isActive:({selection:t})=>{if(!kt(t))return!1;for(let e of t.getNodes()){if((me(e)||ke(e))&&Ie(e)==="right")continue;let o=e.getParent();if(!((me(o)||ke(o))&&Ie(o)==="right"))return!1}return!0},key:"alignRight",label:({i18n:t})=>t.t("lexical:align:alignRightLabel"),onSelect:({editor:t})=>{t.dispatchCommand(_t,"right")},order:3},{ChildComponent:Tr,isActive:({selection:t})=>{if(!kt(t))return!1;for(let e of t.getNodes()){if((me(e)||ke(e))&&Ie(e)==="justify")continue;let o=e.getParent();if(!((me(o)||ke(o))&&Ie(o)==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:t})=>t.t("lexical:align:alignJustifyLabel"),onSelect:({editor:t})=>{t.dispatchCommand(_t,"justify")},order:4}])],fu=()=>{let t=su(3),[e]=au(),o,n;return t[0]!==e?(o=()=>e.registerCommand(_t,xu,mu),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),pu(o,n),null},hu=A({plugins:[{Component:fu,position:"normal"}],toolbarFixed:{groups:Lr},toolbarInline:{groups:Lr}});function gu(t){return(me(t)||ke(t))&&!t.isInline()}function xu(t){let e=uu();if(!kt(e)&&!du(e))return!1;let o=e.getNodes();for(let n of o){let r=cu(n,gu);r!==null&&r.setFormat(t)}return!0}import{QUOTE as ku}from"@lexical/markdown";import{$createQuoteNode as Mr,$isQuoteNode as Rr,QuoteNode as _u}from"@lexical/rich-text";import{$setBlocksType as Ar}from"@lexical/selection";import{$getSelection as $r,$isRangeSelection as Tu}from"lexical";import{jsx as yr}from"react/jsx-runtime";import"react";var Cu="M13.5353 10.5725C13.5353 9.47709 11.0456 9.99991 11.0456 7.85883C11.0456 6.46464 12.1162 5.61816 13.361 5.61816C14.805 5.61816 16 6.86298 16 8.92937C16 11.2945 14.4564 13.7841 11.1203 14.3816L10.8216 13.1368C12.888 12.4895 13.5353 11.4937 13.5353 10.5725ZM6.71369 10.5725C6.71369 9.47709 4.22407 9.99991 4.22407 7.85883C4.22407 6.46464 5.29461 5.61816 6.53942 5.61816C7.9834 5.61816 9.17842 6.86298 9.17842 8.92937C9.17842 11.2945 7.63485 13.7841 4.29876 14.3816L4 13.1368C6.06639 12.4895 6.71369 11.4937 6.71369 10.5725Z",Bo=({className:t})=>yr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:yr("path",{d:Cu,fill:"currentColor"})});import{jsx as vr}from"react/jsx-runtime";import"react";var bu={16:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 .5.5V5a.5.5 0 0 1-1 0V4H8.5v8h1a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1h1V4H4v1a.5.5 0 0 1-1 0z",24:"M6 6.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5V9a.5.5 0 0 1-1 0V7h-4.5v10h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2V7H7v2a.5.5 0 0 1-1 0z"},Tt=({className:t,size:e=24})=>vr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:vr("path",{clipRule:"evenodd",d:bu[e],fill:"currentColor",fillRule:"evenodd"})});var te=t=>({type:"dropdown",ChildComponent:Tt,items:t,key:"text",order:25});var Ir=[te([{ChildComponent:Bo,isActive:({selection:t})=>{if(!Tu(t))return!1;for(let e of t.getNodes())if(!Rr(e)&&!Rr(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=$r();Ar(e,()=>Mr())})},order:20}])],wu=A({markdownTransformers:[ku],nodes:[_u],slashMenu:{groups:[X([{Icon:Bo,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=$r();Ar(e,()=>Mr())})}}])]},toolbarFixed:{groups:Ir},toolbarInline:{groups:Ir}});import{getTranslation as qt}from"@payloadcms/translations";import{jsx as Dr}from"react/jsx-runtime";import"react";var Eu="M10.5 7C11.3284 7 12 7.67157 12 8.5V11.5C12 11.7329 11.9453 11.9527 11.8506 12.1494C12.0473 12.0547 12.2671 12 12.5 12H15.5C16.3284 12 17 12.6716 17 13.5V16.5C17 17.3284 16.3284 18 15.5 18H12.5C12.1151 18 11.7655 17.8535 11.5 17.6152C11.2345 17.8535 10.8849 18 10.5 18H7.5C6.67157 18 6 17.3284 6 16.5V13.5C6 13.1154 6.14578 12.7655 6.38379 12.5C6.14578 12.2345 6 11.8846 6 11.5V8.5C6 7.67157 6.67157 7 7.5 7H10.5ZM12.5 13C12.2239 13 12 13.2239 12 13.5V16.5C12 16.7761 12.2239 17 12.5 17H15.5C15.7761 17 16 16.7761 16 16.5V13.5C16 13.2239 15.7761 13 15.5 13H12.5ZM7.5 13C7.22386 13 7 13.2239 7 13.5V16.5C7 16.7761 7.22386 17 7.5 17H10.5C10.7761 17 11 16.7761 11 16.5V13.5C11 13.2239 10.7761 13 10.5 13H7.5ZM7.5 8C7.22386 8 7 8.22386 7 8.5V11.5C7 11.7761 7.22386 12 7.5 12H10.5C10.7761 12 11 11.7761 11 11.5V8.5C11 8.22386 10.7761 8 10.5 8H7.5ZM17.5 5C18.3284 5 19 5.67157 19 6.5V9.5C19 10.3284 18.3284 11 17.5 11H14.5C13.6716 11 13 10.3284 13 9.5V6.5C13 5.67157 13.6716 5 14.5 5H17.5ZM14.5 6C14.2239 6 14 6.22386 14 6.5V9.5C14 9.77614 14.2239 10 14.5 10H17.5C17.7761 10 18 9.77614 18 9.5V6.5C18 6.22386 17.7761 6 17.5 6H14.5Z",jo=({className:t})=>Dr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Dr("path",{d:Eu,fill:"currentColor"})});import{jsx as Or}from"react/jsx-runtime";import"react";var Su="M17 8C18.1046 8 19 8.89543 19 10V14L18.9893 14.2041C18.8938 15.1457 18.1457 15.8938 17.2041 15.9893L17 16H7L6.7959 15.9893C5.78722 15.887 5 15.0357 5 14V10C5 8.89543 5.89543 8 7 8H17ZM7 9C6.44772 9 6 9.44772 6 10V14C6 14.5523 6.44772 15 7 15H17C17.5523 15 18 14.5523 18 14V10C18 9.44772 17.5523 9 17 9H7ZM9 11C9.55228 11 10 11.4477 10 12C10 12.5523 9.55228 13 9 13C8.44772 13 8 12.5523 8 12C8 11.4477 8.44772 11 9 11ZM12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11ZM15 11C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13C14.4477 13 14 12.5523 14 12C14 11.4477 14.4477 11 15 11Z",Ho=({className:t})=>Or("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Or("path",{clipRule:"evenodd",d:Su,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Nu}from"react/jsx-runtime";import"react";function Fr(t,e){let{admin:o,imageAltText:n,imageURL:r}=t,l=o?.images,s,i;if(l?.icon?(s=typeof l.icon=="string"?l.icon:l.icon.url,i=typeof l.icon=="string"?void 0:l.icon.alt):l?.thumbnail?(s=typeof l.thumbnail=="string"?l.thumbnail:l.thumbnail.url,i=typeof l.thumbnail=="string"?void 0:l.thumbnail.alt):(s=r,i=n),!s)return e;let u=i??"Block Image";return()=>Nu("img",{alt:u,className:"lexical-block-custom-image",src:s,style:{maxHeight:20,maxWidth:20}})}import{$parseSerializedNode as tl}from"lexical";import{JSOX as Go}from"jsox";function Vt({propsString:t}){let e={},o="",n=!0;for(let r=0;r<t.length;r++){let l=t[r];if(n)l==="="||l===" "?o&&(l===" "?(e[o]=!0,o=""):n=!1):o+=l;else{let s=Lu(t,r);e[o]=s.value,r=s.newIndex,o="",n=!0}}return o&&(e[o]=!0),e}function Lu(t,e){let o=t[e];return o==='"'?Pr(t,e):o==="'"?Pr(t,e,!0):o==="{"?vu(t,e):o==="["?yu(t,e):Iu(t,e)}function yu(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="["?o++:t[r]==="]"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:Go.parse(`[${n}]`)}}function Pr(t,e,o=!1){let n="",r=e+1;for(;r<t.length&&(t[r]!==(o?"'":'"')||t[r-1]==="\\");)n+=t[r],r++;return{newIndex:r,value:n}}function vu(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="{"?o++:t[r]==="}"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:Ru(n)}}function Ru(t){return t[0]!=="{"?Go.parse(t):Go.parse(t.replace(/(\w+):/g,'"$1":'))}function Iu(t,e){let o="",n=e;for(;n<t.length&&t[n]!==" ";)o+=t[n],n++;return{newIndex:n-1,value:o}}function wt({props:t}){let e=[];for(let[o,n]of Object.entries(t))typeof n=="string"?e.push(`${o}="${Mu(n)}"`):typeof n=="number"?e.push(`${o}={${n}}`):typeof n=="boolean"?n&&e.push(`${o}`):n!==null&&typeof n=="object"&&(Array.isArray(n)?e.push(`${o}={[${n.map(r=>JSON.stringify(r,Br)).join(", ")}]}`):e.push(`${o}={${JSON.stringify(n,Br)}}`));return e.join(" ")}function Mu(t){return t.replace(/"/g,"&quot;")}function Br(t,e){return typeof e=="string"?e.replace(/'/g,"\\'"):e}function Wt({isEndOptional:t,lines:e,regexpEndRegex:o,startLineIndex:n,startMatch:r,trimChildren:l}){let s="",i="",u=e.slice(n),d=!1,c=0,a=0,m=null,p=!1,h=0,f=u[0].slice(0,r.index),g=0,_=n;e:for(let[R,b]of u.entries()){let x=l?b.trim():b,C=0;if(l)for(let T=0;T<b.length&&b[T]===" ";T++)C++;let k=0;for(R===0&&(k=(r.index??0)+r[0].length-C);k<x.length;){let T=x[k],I=x[k+1];if(d){if(T==="`"&&h++,h%2===0)if(T==="<"&&I==="/"){if(c--,c<0){i[i.length-1]===`
2
- `&&(i=i.slice(0,-1)),_=R;for(let L=k;L<x.length;L++)if(x[L]===">"){g=L+1;break}break e}}else if(T==="/"&&I===">"){if(c--,c<0){i[i.length-1]===`
3
- `&&(i=i.slice(0,-1)),_=R,g=k+2;break e}}else T==="<"&&I!=="/"&&c++;i+=T}else{if(T==="{"&&!m?a++:T==="}"&&!m?a--:(T==='"'||T==="'")&&!m?m=T:T===m&&(m=null),T==="/"&&I===">"&&a===0&&!m){p=!0,_=R,g=k+2;break e}else if(T===">"&&a===0&&!m){d=!0,k++;continue}s+=T}k++}if(d?i?.length>0&&R>0&&(i+=`
1
+ "use client";import{a as Ir,b as kt,c as xe,e as _t,f as Tt,g as Et}from"./chunk-E6LSRRP2.js";import{a as et}from"./chunk-DBWINSQN.js";import{a as Ko,b as tt,c as ot,d as ye,e as nt}from"./chunk-ZQX5HXUL.js";import{a as Rr,b as vr,c as De}from"./chunk-5VIL27GI.js";import{a as mu}from"./chunk-WSAPGI3Z.js";import{a as se,b as Mr,c as Ar,d as Jo,e as Xo,f as pu,g as fu,i as hu,k as gu,n as xu}from"./chunk-3LRZDIIG.js";import{a as du,b as U}from"./chunk-RJ5MAOKZ.js";function q(t){return{items:t,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}import{c as Tu}from"react/compiler-runtime";import{useLexicalComposerContext as Eu}from"@lexical/react/LexicalComposerContext";import{$isDecoratorBlockNode as Ce}from"@lexical/react/LexicalDecoratorBlockNode";import{$findMatchingParent as wu}from"@lexical/utils";import{$getSelection as Su,$isElementNode as pe,$isNodeSelection as Nu,$isRangeSelection as wt,COMMAND_PRIORITY_LOW as Lu,FORMAT_ELEMENT_COMMAND as St}from"lexical";import{useEffect as yu}from"react";import{jsx as Dr}from"react/jsx-runtime";import"react";var Cu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m3 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5M7.5 15a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",$r=({className:t})=>Dr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Dr("path",{clipRule:"evenodd",d:Cu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Or}from"react/jsx-runtime";import"react";var bu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Fr=({className:t})=>Or("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Or("path",{clipRule:"evenodd",d:bu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Pr}from"react/jsx-runtime";import"react";var ku="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Jt=({className:t})=>Pr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Pr("path",{clipRule:"evenodd",d:ku,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Br}from"react/jsx-runtime";import"react";var _u="M19 7.5a.5.5 0 0 0-.5-.5h-13a.5.5 0 0 0 0 1h13a.5.5 0 0 0 .5-.5m0 4a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0 0 1h7a.5.5 0 0 0 .5-.5m-.5 3.5a.5.5 0 0 1 0 1h-9a.5.5 0 0 1 0-1z",jr=({className:t})=>Br("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Br("path",{clipRule:"evenodd",d:_u,fill:"currentColor",fillRule:"evenodd"})});var A=t=>o=>{let n={clientFeatureProps:o};if(typeof t=="function")n.feature=({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:c,resolvedFeatures:u,schemaPath:d,unSanitizedEditorConfig:a})=>{let p=t({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:c,props:o,resolvedFeatures:u,schemaPath:d,unSanitizedEditorConfig:a});return p.sanitizedClientFeatureProps===null&&(p.sanitizedClientFeatureProps=o),p};else{let r={...t};r.sanitizedClientFeatureProps=o,n.feature=r}return n};var Hr=t=>({type:"dropdown",ChildComponent:Jt,iconOnly:!0,items:t,key:"align",order:30});var Re=t=>pe(t)?t.getFormatType():t.__format,zr=[Hr([{ChildComponent:Jt,isActive:({selection:t})=>{if(!wt(t))return!1;for(let e of t.getNodes()){if((pe(e)||Ce(e))&&Re(e)==="left")continue;let o=e.getParent();if(!((pe(o)||Ce(o))&&Re(o)==="left"))return!1}return!0},key:"alignLeft",label:({i18n:t})=>t.t("lexical:align:alignLeftLabel"),onSelect:({editor:t})=>{t.dispatchCommand(St,"left")},order:1},{ChildComponent:$r,isActive:({selection:t})=>{if(!wt(t))return!1;for(let e of t.getNodes()){if((pe(e)||Ce(e))&&Re(e)==="center")continue;let o=e.getParent();if(!((pe(o)||Ce(o))&&Re(o)==="center"))return!1}return!0},key:"alignCenter",label:({i18n:t})=>t.t("lexical:align:alignCenterLabel"),onSelect:({editor:t})=>{t.dispatchCommand(St,"center")},order:2},{ChildComponent:jr,isActive:({selection:t})=>{if(!wt(t))return!1;for(let e of t.getNodes()){if((pe(e)||Ce(e))&&Re(e)==="right")continue;let o=e.getParent();if(!((pe(o)||Ce(o))&&Re(o)==="right"))return!1}return!0},key:"alignRight",label:({i18n:t})=>t.t("lexical:align:alignRightLabel"),onSelect:({editor:t})=>{t.dispatchCommand(St,"right")},order:3},{ChildComponent:Fr,isActive:({selection:t})=>{if(!wt(t))return!1;for(let e of t.getNodes()){if((pe(e)||Ce(e))&&Re(e)==="justify")continue;let o=e.getParent();if(!((pe(o)||Ce(o))&&Re(o)==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:t})=>t.t("lexical:align:alignJustifyLabel"),onSelect:({editor:t})=>{t.dispatchCommand(St,"justify")},order:4}])],Ru=()=>{let t=Tu(3),[e]=Eu(),o,n;return t[0]!==e?(o=()=>e.registerCommand(St,Mu,Lu),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),yu(o,n),null},vu=A({plugins:[{Component:Ru,position:"normal"}],toolbarFixed:{groups:zr},toolbarInline:{groups:zr}});function Iu(t){return(pe(t)||Ce(t))&&!t.isInline()}function Mu(t){let e=Su();if(!wt(e)&&!Nu(e))return!1;let o=e.getNodes();for(let n of o){let r=wu(n,Iu);r!==null&&r.setFormat(t)}return!0}import{QUOTE as $u}from"@lexical/markdown";import{$createQuoteNode as Kr,$isQuoteNode as Wr,QuoteNode as Ou}from"@lexical/rich-text";import{$setBlocksType as Jr}from"@lexical/selection";import{$getSelection as Xr,$isRangeSelection as Fu}from"lexical";import{jsx as Gr}from"react/jsx-runtime";import"react";var Au="M13.5353 10.5725C13.5353 9.47709 11.0456 9.99991 11.0456 7.85883C11.0456 6.46464 12.1162 5.61816 13.361 5.61816C14.805 5.61816 16 6.86298 16 8.92937C16 11.2945 14.4564 13.7841 11.1203 14.3816L10.8216 13.1368C12.888 12.4895 13.5353 11.4937 13.5353 10.5725ZM6.71369 10.5725C6.71369 9.47709 4.22407 9.99991 4.22407 7.85883C4.22407 6.46464 5.29461 5.61816 6.53942 5.61816C7.9834 5.61816 9.17842 6.86298 9.17842 8.92937C9.17842 11.2945 7.63485 13.7841 4.29876 14.3816L4 13.1368C6.06639 12.4895 6.71369 11.4937 6.71369 10.5725Z",Yo=({className:t})=>Gr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Gr("path",{d:Au,fill:"currentColor"})});import{jsx as Ur}from"react/jsx-runtime";import"react";var Du={16:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 .5.5V5a.5.5 0 0 1-1 0V4H8.5v8h1a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1h1V4H4v1a.5.5 0 0 1-1 0z",24:"M6 6.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5V9a.5.5 0 0 1-1 0V7h-4.5v10h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2V7H7v2a.5.5 0 0 1-1 0z"},Nt=({className:t,size:e=24})=>Ur("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ur("path",{clipRule:"evenodd",d:Du[e],fill:"currentColor",fillRule:"evenodd"})});var oe=t=>({type:"dropdown",ChildComponent:Nt,items:t,key:"text",order:25});var Vr=[oe([{ChildComponent:Yo,isActive:({selection:t})=>{if(!Fu(t))return!1;for(let e of t.getNodes())if(!Wr(e)&&!Wr(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Xr();Jr(e,()=>Kr())})},order:20}])],Pu=A({markdownTransformers:[$u],nodes:[Ou],slashMenu:{groups:[q([{Icon:Yo,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Xr();Jr(e,()=>Kr())})}}])]},toolbarFixed:{groups:Vr},toolbarInline:{groups:Vr}});import{getTranslation as ro}from"@payloadcms/translations";import{jsx as Yr}from"react/jsx-runtime";import"react";var Bu="M10.5 7C11.3284 7 12 7.67157 12 8.5V11.5C12 11.7329 11.9453 11.9527 11.8506 12.1494C12.0473 12.0547 12.2671 12 12.5 12H15.5C16.3284 12 17 12.6716 17 13.5V16.5C17 17.3284 16.3284 18 15.5 18H12.5C12.1151 18 11.7655 17.8535 11.5 17.6152C11.2345 17.8535 10.8849 18 10.5 18H7.5C6.67157 18 6 17.3284 6 16.5V13.5C6 13.1154 6.14578 12.7655 6.38379 12.5C6.14578 12.2345 6 11.8846 6 11.5V8.5C6 7.67157 6.67157 7 7.5 7H10.5ZM12.5 13C12.2239 13 12 13.2239 12 13.5V16.5C12 16.7761 12.2239 17 12.5 17H15.5C15.7761 17 16 16.7761 16 16.5V13.5C16 13.2239 15.7761 13 15.5 13H12.5ZM7.5 13C7.22386 13 7 13.2239 7 13.5V16.5C7 16.7761 7.22386 17 7.5 17H10.5C10.7761 17 11 16.7761 11 16.5V13.5C11 13.2239 10.7761 13 10.5 13H7.5ZM7.5 8C7.22386 8 7 8.22386 7 8.5V11.5C7 11.7761 7.22386 12 7.5 12H10.5C10.7761 12 11 11.7761 11 11.5V8.5C11 8.22386 10.7761 8 10.5 8H7.5ZM17.5 5C18.3284 5 19 5.67157 19 6.5V9.5C19 10.3284 18.3284 11 17.5 11H14.5C13.6716 11 13 10.3284 13 9.5V6.5C13 5.67157 13.6716 5 14.5 5H17.5ZM14.5 6C14.2239 6 14 6.22386 14 6.5V9.5C14 9.77614 14.2239 10 14.5 10H17.5C17.7761 10 18 9.77614 18 9.5V6.5C18 6.22386 17.7761 6 17.5 6H14.5Z",Zo=({className:t})=>Yr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Yr("path",{d:Bu,fill:"currentColor"})});import{jsx as Zr}from"react/jsx-runtime";import"react";var ju="M17 8C18.1046 8 19 8.89543 19 10V14L18.9893 14.2041C18.8938 15.1457 18.1457 15.8938 17.2041 15.9893L17 16H7L6.7959 15.9893C5.78722 15.887 5 15.0357 5 14V10C5 8.89543 5.89543 8 7 8H17ZM7 9C6.44772 9 6 9.44772 6 10V14C6 14.5523 6.44772 15 7 15H17C17.5523 15 18 14.5523 18 14V10C18 9.44772 17.5523 9 17 9H7ZM9 11C9.55228 11 10 11.4477 10 12C10 12.5523 9.55228 13 9 13C8.44772 13 8 12.5523 8 12C8 11.4477 8.44772 11 9 11ZM12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11ZM15 11C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13C14.4477 13 14 12.5523 14 12C14 11.4477 14.4477 11 15 11Z",qo=({className:t})=>Zr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Zr("path",{clipRule:"evenodd",d:ju,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Hu}from"react/jsx-runtime";import"react";function qr(t,e){let{admin:o,imageAltText:n,imageURL:r}=t,l=o?.images,s,i;if(l?.icon?(s=typeof l.icon=="string"?l.icon:l.icon.url,i=typeof l.icon=="string"?void 0:l.icon.alt):l?.thumbnail?(s=typeof l.thumbnail=="string"?l.thumbnail:l.thumbnail.url,i=typeof l.thumbnail=="string"?void 0:l.thumbnail.alt):(s=r,i=n),!s)return e;let c=i??"Block Image";return()=>Hu("img",{alt:c,className:"lexical-block-custom-image",src:s,style:{maxHeight:20,maxWidth:20}})}import{$parseSerializedNode as xl}from"lexical";import{JSOX as Qo}from"jsox";function Xt({propsString:t}){let e={},o="",n=!0;for(let r=0;r<t.length;r++){let l=t[r];if(n)l==="="||l===" "?o&&(l===" "?(e[o]=!0,o=""):n=!1):o+=l;else{let s=zu(t,r);e[o]=s.value,r=s.newIndex,o="",n=!0}}return o&&(e[o]=!0),e}function zu(t,e){let o=t[e];return o==='"'?Qr(t,e):o==="'"?Qr(t,e,!0):o==="{"?Uu(t,e):o==="["?Gu(t,e):Vu(t,e)}function Gu(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="["?o++:t[r]==="]"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:Qo.parse(`[${n}]`)}}function Qr(t,e,o=!1){let n="",r=e+1;for(;r<t.length&&(t[r]!==(o?"'":'"')||t[r-1]==="\\");)n+=t[r],r++;return{newIndex:r,value:n}}function Uu(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="{"?o++:t[r]==="}"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:Wu(n)}}function Wu(t){return t[0]!=="{"?Qo.parse(t):Qo.parse(t.replace(/(\w+):/g,'"$1":'))}function Vu(t,e){let o="",n=e;for(;n<t.length&&t[n]!==" ";)o+=t[n],n++;return{newIndex:n-1,value:o}}function Lt({props:t}){let e=[];for(let[o,n]of Object.entries(t))typeof n=="string"?e.push(`${o}="${Ku(n)}"`):typeof n=="number"?e.push(`${o}={${n}}`):typeof n=="boolean"?n&&e.push(`${o}`):n!==null&&typeof n=="object"&&(Array.isArray(n)?e.push(`${o}={[${n.map(r=>JSON.stringify(r,el)).join(", ")}]}`):e.push(`${o}={${JSON.stringify(n,el)}}`));return e.join(" ")}function Ku(t){return t.replace(/"/g,"&quot;")}function el(t,e){return typeof e=="string"?e.replace(/'/g,"\\'"):e}function Yt({isEndOptional:t,lines:e,regexpEndRegex:o,startLineIndex:n,startMatch:r,trimChildren:l}){let s="",i="",c=e.slice(n),u=!1,d=0,a=0,p=null,m=!1,f=0,h=c[0].slice(0,r.index),g=0,C=n;e:for(let[L,x]of c.entries()){let b=l?x.trim():x,k=0;if(l)for(let T=0;T<x.length&&x[T]===" ";T++)k++;let _=0;for(L===0&&(_=(r.index??0)+r[0].length-k);_<b.length;){let T=b[_],I=b[_+1];if(u){if(T==="`"&&f++,f%2===0)if(T==="<"&&I==="/"){if(d--,d<0){i[i.length-1]===`
2
+ `&&(i=i.slice(0,-1)),C=L;for(let N=_;N<b.length;N++)if(b[N]===">"){g=N+1;break}break e}}else if(T==="/"&&I===">"){if(d--,d<0){i[i.length-1]===`
3
+ `&&(i=i.slice(0,-1)),C=L,g=_+2;break e}}else T==="<"&&I!=="/"&&d++;i+=T}else{if(T==="{"&&!p?a++:T==="}"&&!p?a--:(T==='"'||T==="'")&&!p?p=T:T===p&&(p=null),T==="/"&&I===">"&&a===0&&!p){m=!0,C=L,g=_+2;break e}else if(T===">"&&a===0&&!p){u=!0,_++;continue}s+=T}_++}if(u?i?.length>0&&L>0&&(i+=`
4
4
  `):s+=`
5
- `,o&&c<0){let T=x.match(o);if(T?.index!==void 0){_=R,g=T.index+T[0].length-1;break}}if(R===u.length-1&&!t&&!p)throw new Error("End match not found for lines "+e.join(`
5
+ `,o&&d<0){let T=b.match(o);if(T?.index!==void 0){C=L,g=T.index+T[0].length-1;break}}if(L===c.length-1&&!t&&!m)throw new Error("End match not found for lines "+e.join(`
6
6
  `)+`
7
7
 
8
- . Start match: `+JSON.stringify(r))}return{afterEndLine:u[_].trim().slice(g),beforeStartLine:f,content:i,endLineIndex:n+_,endlineLastCharIndex:g,propsString:s}}import{jsx as fd}from"react/jsx-runtime";import hd from"bson-objectid";import{$applyNodeReplacement as gd}from"lexical";import"react";import{DecoratorBlockNode as Au}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as $u}from"@lexical/utils";import Du from"bson-objectid";import{$applyNodeReplacement as Ou}from"lexical";var Et=class extends Au{__cacheBuster;__fields;constructor({cacheBuster:e,fields:o,format:n,key:r}){super(n,r),this.__fields=o,this.__cacheBuster=e||0}static clone(e){return new this({cacheBuster:e.__cacheBuster,fields:e.__fields,format:e.__format,key:e.__key})}static getType(){return"block"}static importDOM(){return{}}static importJSON(e){e.version===1&&(e={...e,fields:{...e.fields.data},version:2});let o=Fu(e.fields);return o.setFormat(e.format),o}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return $u(o,e?.theme?.block),o}decorate(e,o){return null}exportDOM(){let e=document.createElement("div"),o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),type:"block",fields:this.getFields(),version:2}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}setFields(e,o){let n=this.getWritable();n.__fields=e,o||n.__cacheBuster++}};function Fu(t){return Ou(new Et({fields:{...t,id:t?.id||new Du.default().toHexString()}}))}import{jsx as V,jsxs as St}from"react/jsx-runtime";import{useLexicalComposerContext as Wu}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as zu}from"@lexical/react/useLexicalEditable";import{getTranslation as Ku}from"@payloadcms/translations";import{Button as Ur,Collapsible as Ju,Drawer as Xu,EditDepthProvider as Zu,ErrorPill as Yu,Form as qu,formatDrawerSlug as Qu,MoreIcon as ed,Pill as td,Popup as od,PopupList as Uo,RenderFields as nd,SectionTitle as rd,useConfig as ld,useDocumentForm as id,useDocumentInfo as Vr,useEditDepth as sd,useFormSubmitted as ad,useServerFunctions as cd,useTranslation as ud,XIcon as dd}from"@payloadcms/ui";import{abortAndIgnore as Vo}from"@payloadcms/ui/shared";import{$getNodeByKey as Kt,$getRoot as md,SKIP_DOM_SELECTION_TAG as Wo}from"lexical";import{deepCopyObjectSimpleWithoutReactComponents as Jt,reduceFieldsToValues as Wr}from"payload/shared";import Fe,{useCallback as zo,useEffect as Xt,useMemo as Pe,useRef as Ko}from"react";import{v4 as pd}from"uuid";import{c as Pu}from"react/compiler-runtime";import{jsx as zt,jsxs as Bu}from"react/jsx-runtime";import{useLexicalEditable as ju}from"@lexical/react/useLexicalEditable";import{RenderFields as Hu,useFormSubmitted as Gu}from"@payloadcms/ui";import Uu,{createContext as Vu}from"react";var jr=Vu({baseClass:"LexicalEditorTheme__block",BlockCollapsible:()=>null,BlockDrawer:()=>null,EditButton:()=>null,errorCount:0,formSchema:[],initialState:!1,nodeKey:"",RemoveButton:()=>null}),ae=()=>Uu.use(jr),Hr=t=>{let e=Pu(4),{Collapsible:o,CustomBlock:n,CustomLabel:r,...l}=t,{BlockDrawer:s,errorCount:i,formSchema:u}=l,c=Gu()&&i>0,a=ju(),m;e[0]!==o||e[1]!==i||e[2]!==c?(m=f=>{let{children:g,..._}=f;return zt(o,{errorCount:i,fieldHasErrors:c,..._,children:g})},e[0]=o,e[1]=i,e[2]=c,e[3]=m):m=e[3];let p=m,h={...l,BlockCollapsible:p};return n?Bu(jr,{value:h,children:[n,zt(s,{})]}):zt(p,{children:zt(Hu,{fields:u,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!a})})};function Gr({fields:t}){for(let e in t){let o=t[e];Array.isArray(o?.rows)&&"value"in o&&(o.disableFormData=!0)}return t}var zr=t=>{let{cacheBuster:e,className:o,CustomBlock:n,CustomLabel:r,formData:l,nodeKey:s}=t,i=ad(),{id:u,collectionSlug:d,globalSlug:c}=Vr(),{fieldProps:{featureClientSchemaMap:a,field:m,initialLexicalFormState:p,schemaPath:h},uuid:f}=U(),{fields:g}=id(),_=Ko(new AbortController),E=sd(),[R,b]=Fe.useState(0),{config:x}=ld(),C=Qu({slug:`lexical-blocks-create-${f}-${l.id}`,depth:E}),{toggleDrawer:k}=Oe(C),{getDocPreferences:T,setDocFieldPreferences:I}=Vr(),[L]=Wu(),S=zu(),N=l.blockType,{getFormState:w}=cd(),v=`${h}.lexical_internal_feature.blocks.lexical_blocks.${N}.fields`,[y,M]=Fe.useState(()=>{let B=p?.[l.id]?.formState;if(!B)return!1;let q=Object.fromEntries(Object.entries(B).map(([G,W])=>[G,G in l?{...W,initialValue:l[G],value:l[G]}:W]));return q.blockName={initialValue:l.blockName,passesCondition:!0,valid:!0,value:l.blockName},q}),$=Ko(!1),D=Ko(e);Xt(()=>{$.current?(D.current!==e&&M(!1),D.current=e):$.current=!0},[e]);let[F]=Fe.useState(()=>pd()),[P,Y]=Fe.useState(()=>{if(!r)return y?._components?.customComponents?.BlockLabel??void 0}),[J,Je]=Fe.useState(()=>{if(!n)return y?._components?.customComponents?.Block??void 0}),Re=Pe(()=>n?V(n,{className:o,formData:l,isEditor:!0,isJSXConverter:!1,nodeKey:s,useBlockComponentContext:ae}):J,[n,o,l,s,J]),xe=Pe(()=>r?V(r,{className:o,formData:l,isEditor:!0,isJSXConverter:!1,nodeKey:s,useBlockComponentContext:ae}):P,[r,o,l,s,P]);Xt(()=>{let B=new AbortController;return l&&!y&&(async()=>{let{state:G}=await w({id:u,collectionSlug:d,data:l,docPermissions:{fields:!0},docPreferences:await T(),documentFormState:Jt(g,{excludeFiles:!0}),globalSlug:c,initialBlockData:l,operation:"update",readOnly:!S,renderAllFields:!0,schemaPath:v,signal:B.signal});if(G){G.blockName={initialValue:l.blockName,passesCondition:!0,valid:!0,value:l.blockName};let W=Wr(Jt(G,{excludeFiles:!0}),!0);L.update(()=>{let z=Kt(s);if(z&&Me(z)){let ie=W;ie.blockType=N,z.setFields(ie,!0)}},{tag:Wo}),M(G),r||Y(G._components?.customComponents?.BlockLabel??void 0),n||Je(G._components?.customComponents?.Block??void 0)}})(),()=>{Vo(B)}},[w,v,S,u,r,n,l,L,s,y,d,c,T,g,N]);let[le,Ce]=Fe.useState(p?.[l.id]?.collapsed??!1),Ht=`${h}.lexical_internal_feature.blocks.lexical_blocks.${N}`,ft=a.blocks?.[Ht]?.[0]?.blocks?.[0],ee=typeof ft=="string"?x.blocksMap[ft]:ft,{i18n:ht,t:de}=ud(),Ao=zo(async({formState:B,submit:q})=>{Vo(_.current);let G=new AbortController;_.current=G;let{state:W}=await w({id:u,collectionSlug:d,docPermissions:{fields:!0},docPreferences:await T(),documentFormState:Jt(g,{excludeFiles:!0}),formState:B,globalSlug:c,initialBlockFormState:B,operation:"update",readOnly:!S,renderAllFields:!!q,schemaPath:v,signal:G.signal});if(!W)return B;B.blockName&&(W.blockName=B.blockName);let z=Wr(Gr({fields:Jt(W,{excludeFiles:!0})}),!0);if(setTimeout(()=>{L.update(()=>{let ie=Kt(s);if(ie&&Me(ie)){let Ye=z;Ye.blockType=N,ie.setFields(Ye,!0)}},{tag:Wo})},0),q){r||Y(W._components?.customComponents?.BlockLabel??void 0),n||Je(W._components?.customComponents?.Block??void 0);let ie=0;for(let Ye of Object.values(W))Ye?.valid===!1&&ie++;b(ie)}return W},[w,u,d,T,c,v,N,g,S,L,s,n,r]);Xt(()=>()=>{Vo(_.current)},[]);let Gt=zo(()=>{L.update(()=>{Kt(s)?.remove()})},[L,s]),[ir,Wc]=Fe.useState(0);Xt(()=>{let B=()=>{L.getEditorState().read(()=>{let G=md().getChildren(),W=0;for(let z of G)if(Me(z)){if(z.getKey()===s){Wc(W);return}W++}})};return B(),L.registerUpdateListener(()=>{B()})},[L,s]);let Ze=ee?.labels?.singular?Ku(ee.labels.singular,ht):ee?.slug,sr=zo(B=>{T().then(q=>{let W=q?.fields?.[m.name]?.collapsed,z=W&&W?.length?W:[];B?z.includes(l.id)||z.push(l.id):z.includes(l.id)&&z.splice(z.indexOf(l.id),1),I(m.name,{collapsed:z,hello:"hi"})})},[T,m.name,I,l.id]),ar=Pe(()=>()=>V(Ur,{buttonStyle:"ghost",className:`${o}__editButton`,disabled:!S,el:"button",icon:"edit",onClick:B=>(B.preventDefault(),B.stopPropagation(),k(),!1),onMouseDown:B=>{B.preventDefault()},round:!0,size:"medium",tooltip:de("lexical:blocks:inlineBlocks:edit",{label:Ze})}),[o,S,de,Ze,k]),cr=Pe(()=>()=>V(Ur,{buttonStyle:"ghost",className:`${o}__removeButton`,disabled:!S,icon:"x",onClick:B=>{B.preventDefault(),Gt()},round:!0,tooltip:"Remove Block"}),[o,S,Gt]),$o=Pe(()=>({Actions:B,children:q,className:G,collapsibleProps:W,disableBlockName:z,editButton:ie,errorCount:Ye,fieldHasErrors:Do,Label:fr,Pill:hr,removeButton:Kc,showDragHandle:Jc=!0,showRowNumber:Xc=!0})=>V("div",{className:`${o}__container ${o}-${N}`,children:V(Ju,{actions:typeof B<"u"?B:S?V(od,{button:V(ed,{}),buttonClassName:`${o}__actions-button`,caret:!1,horizontalAlign:"right",render:({close:gt})=>St(Uo.ButtonGroup,{buttonSize:"medium",children:[(Re&&ie!==!1||!Re&&ie)&&V(Uo.Button,{onClick:()=>{k(),gt()},children:de("general:edit")}),Kc!==!1&&St(Uo.Button,{onClick:()=>{Gt(),gt()},children:[V(dd,{}),de("general:remove")]})]}),size:"large"}):null,className:[`${o}__row`,Do?`${o}__row--has-errors`:`${o}__row--no-errors`,G].filter(Boolean).join(" "),collapsibleStyle:Do?"error":"default",dragHandleProps:Jc?{id:s,attributes:{role:"button",tabIndex:0},listeners:{}}:void 0,header:V("div",{className:`${o}__block-header`,children:typeof fr<"u"?fr:typeof xe<"u"?xe:St("div",{className:`${o}__block-label`,children:[Xc&&V("span",{className:`${o}__block-number`,children:String(ir+1).padStart(2,"0")}),typeof hr<"u"?hr:V(td,{className:`${o}__block-pill ${o}__block-pill-${N}`,pillStyle:"white",size:"small",children:Ze??N}),!z&&!ee?.admin?.disableBlockName&&V(rd,{path:"blockName",readOnly:!S}),Do&&V(Yu,{count:Ye??0,i18n:ht,withMessage:!0})]})}),isCollapsed:le,onToggle:gt=>{sr(gt),Ce(gt)},...W||{},children:q},0)}),[Re,xe,Ze,o,ee?.admin?.disableBlockName,N,ht,le,sr,S,s,Gt,ir,de,k]),ur=l?.id,{headerActions:dr,submitRef:mr}=gr(),pr=Pe(()=>()=>V(Zu,{children:V(Xu,{className:"",headerActions:dr,slug:C,title:de(`lexical:blocks:inlineBlocks:${ur?"edit":"create"}`,{label:Ze??de("lexical:blocks:inlineBlocks:label")}),children:y?St("div",{className:"fields-drawer",children:[V(nd,{fields:ee?.fields??[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:v,permissions:!0,readOnly:!S}),V(xr,{submitRef:mr})]}):null})}),[y,C,ur,Ze,de,S,ee?.fields,v,dr,mr]),zc=Pe(()=>y?V("div",{"data-block-drawer-slug":C,style:{display:"contents"},children:V(qu,{beforeSubmit:[async({formState:B})=>await Ao({formState:B,submit:!0})],el:"div",fields:ee?.fields??[],initialState:y,onChange:[Ao],onSubmit:(B,q)=>{q.blockType=N,L.update(()=>{let G=Kt(s);G&&Me(G)&&G.setFields(q,!0)},{tag:Wo}),k()},submitted:i,uuid:F,children:V(Hr,{baseClass:o,BlockDrawer:pr,Collapsible:$o,CustomBlock:Re,CustomLabel:xe,EditButton:ar,errorCount:R,formSchema:ee?.fields??[],initialState:y,nodeKey:s,RemoveButton:cr})})}):null,[$o,pr,Re,xe,N,C,cr,ar,o,L,R,k,ee?.fields,F,y,s,Ao,i]);return ee?zc:V($o,{disableBlockName:!0,fieldHasErrors:!0,children:St("div",{className:`${o}-not-found`,children:["Error: Block '",N,"' not found in the config but exists in the lexical data"]})})};var ce=class extends Et{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){e.version===1&&(e={...e,fields:{...e.fields.data},version:2});let o=Be(e.fields);return o.setFormat(e.format),o}decorate(...[e,o,n,r]){return fd(zr,{cacheBuster:this.getCacheBuster(),className:o.theme.block??"LexicalEditorTheme__block",CustomBlock:n,CustomLabel:r,formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Be(t){return gd(new ce({fields:{...t,id:t?.id||new hd.default().toHexString()}}))}function Me(t){return t instanceof ce}import{createHeadlessEditor as xd}from"@lexical/headless";import{$convertToMarkdownString as Cd}from"@lexical/markdown";function Jo(t,e){return({editorState:n})=>{let r=xd({nodes:t});try{r.setEditorState(r.parseEditorState(n))}catch(s){console.error("getLexicalToMarkdown: ERROR parsing editor state",s)}let l="";return r.getEditorState().read(()=>{l=Cd(e)}),l}}import{createHeadlessEditor as yd}from"@lexical/headless";import{$convertFromMarkdownString as el,TRANSFORMERS as Ld}from"@lexical/markdown";var Kr=/^[\t ]*$/,bd=/^(\s*)(\d+)\.\s/,kd=/^(\s*)[-*+]\s/,_d=/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,Jr=/^(#{1,6})\s/,Td=/^>\s/,wd=/^[ \t]*(\\`\\`\\`|```)(\w+)?/,Xr=/[ \t]*(\\`\\`\\`|```)$/,Ed=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Sd=/^\|(.+)\|\s?$/,Nd=/^(\| ?:?-*:? ?)+\|\s?$/,Zr=/^[ \t]*<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Yr=/^[ \t]*<\/[a-z_][\w-]*\s*>/i;function qr(t){if(t.endsWith("\\"))return[t.slice(0,-1),"\\"];let e=t.match(/^(.*?\S)( {2,})$/);return e?[e[1],e[2]]:null}function Qr(t,e){let o=t.split(`
9
- `),n=!1,r=[],l=0;for(let s=0;s<o.length;s++){let i=o[s],u=r[r.length-1],d=s<o.length-1?qr(i):null,c=u!==void 0&&qr(u)!==null;if(Ed.test(i)){r.push(i);continue}if(Xr.test(i)){l===0&&(n=!0),l===1&&(n=!1),l>0&&l--,r.push(i);continue}if(wd.test(i)){n=!0,l++,r.push(i);continue}if(n){r.push(i);continue}Kr.test(i)||Kr.test(u)||!u||Jr.test(u)||Jr.test(i)||Td.test(i)||bd.test(i)||kd.test(i)||_d.test(i)||Sd.test(i)||Nd.test(i)||c||!e||Zr.test(i)||Yr.test(i)||Zr.test(u)||Yr.test(u)||Xr.test(u)?r.push(i):r[r.length-1]=u+" "+(d===null?i.trim():i.trimStart())}return r.join(`
10
- `)}function Zt(t,e=Ld,o,n=!1,r=!1){if(n)return el(t,e,o,!0);let l=Qr(t,r);return el(l,e,o,!1,!1)}function Yt(t,e){return({markdown:n})=>{let r=yd({nodes:t});return r.update(()=>{Zt(n,e,void 0,!1,!0)},{discrete:!0}),r.getEditorState().toJSON()}}function vd(t){let e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{regExpEnd:new RegExp(`</(${e})\\s*>|<${e}[^>]*?/>`,"i"),regExpStart:new RegExp(`<(${e})([^>]*?)\\s*(/?)>`,"i")}}var nl=({blocks:t,inlineBlocks:e})=>{if(!t?.length&&!e?.length)return[];let o=[];if(t?.length)for(let n of t){let r=ol(n,!1);r&&(o=o.concat(r))}if(e?.length)for(let n of e){let r=ol(n,!0);r&&(o=o.concat(r))}return o};function ol(t,e){if(!t.jsx)return null;let o=vd(t.slug),n=[];return e?(n.push(({allNodes:r,allTransformers:l})=>({type:"text-match",dependencies:[xt],export:s=>{if(!bt(s)||s.getFields()?.blockType?.toLowerCase()!==t.slug.toLowerCase())return null;let i=s.getFields(),u=Jo(r,l),d=t.jsx.export({fields:i,lexicalToMarkdown:u});if(d===!1)return null;if(typeof d=="string")return d;let c=d.props&&Object.keys(d.props)?.length>0,a=d.props??{};return d?.children?.length?`<${i.blockType}${c?" "+wt({props:a}):""}>${d.children}</${i.blockType}>`:`<${i.blockType}${c?" "+wt({props:a}):""}/>`},getEndIndex:(s,i)=>{let{endlineLastCharIndex:u}=Wt({isEndOptional:!1,lines:[s.getTextContent()],regexpEndRegex:o.regExpEnd,startLineIndex:0,startMatch:i,trimChildren:!1});return u},importRegExp:t.jsx?.customStartRegex??o.regExpStart,regExp:/___ignoreignoreignore___/g,replace(s,i){let{content:u,propsString:d}=Wt({isEndOptional:!1,lines:[s.getTextContent()],regexpEndRegex:o.regExpEnd,startLineIndex:0,startMatch:{...i,index:0},trimChildren:!1});if(!t?.jsx?.import)return;let c=Yt(r,l),a=t.jsx.import({children:u,closeMatch:null,htmlToLexical:null,markdownToLexical:c,openMatch:i,props:d?Vt({propsString:d}):{}});if(a===!1)return;let m=Ct({blockType:t.slug,...a});s.replace(m)}})),n):(n.push(({allNodes:r,allTransformers:l})=>({dependencies:[ce],export:s=>{if(!Me(s)||s.getFields()?.blockType?.toLowerCase()!==t.slug.toLowerCase())return null;let i=s.getFields(),u=Jo(r,l),d=t.jsx.export({fields:i,lexicalToMarkdown:u});if(d===!1)return null;if(typeof d=="string")return d;let c=d.props&&Object.keys(d.props)?.length>0,a=d.props??{};if(d?.children?.length){let m=d.children,p="";if(m.includes(`
11
- `))for(let h of m.split(`
12
- `)){let f="";!t?.jsx?.doNotTrimChildren&&h!==""&&(f=" "),f+=h+`
13
- `,p+=f}else p=(t?.jsx?.doNotTrimChildren?"":" ")+m+`
14
- `;return`<${i.blockType}${c?" "+wt({props:a}):""}>
15
- ${p}</${i.blockType}>`}return`<${i.blockType}${c?" "+wt({props:a}):""}/>`},handleImportAfterStartMatch:t.jsx?.customEndRegex?void 0:({lines:s,rootNode:i,startLineIndex:u,startMatch:d,transformer:c})=>{let a=typeof c.regExpEnd=="object"&&"regExp"in c.regExpEnd?c.regExpEnd.regExp:c.regExpEnd,m=c.regExpEnd&&typeof c.regExpEnd=="object"&&"optional"in c.regExpEnd?c.regExpEnd.optional:!c.regExpEnd,{afterEndLine:p,beforeStartLine:h,content:f,endLineIndex:g,propsString:_}=Wt({isEndOptional:m,lines:s,regexpEndRegex:a,startLineIndex:u,startMatch:d,trimChildren:!1}),E="";if(t?.jsx?.doNotTrimChildren)E=f.endsWith(`
16
- `)?f.slice(0,-1):f;else if(f.includes(`
17
- `)){let C=f.split(`
18
- `),k=0;for(let T of C){if(k++,T.startsWith(" "))E+=T.slice(2);else if(T==="")E+=T;else{E=f.endsWith(`
19
- `)?f.slice(0,-1):f;break}E+=k===C.length?"":`
20
- `}}else E=(f.startsWith(" ")?f.slice(2):f)+`
21
- `;if(!t?.jsx?.import)return[!1,u];let R=Yt(r,l),b=t.jsx.import({children:E,closeMatch:null,htmlToLexical:null,markdownToLexical:R,openMatch:d,props:_?Vt({propsString:_}):{}});if(b===!1)return[!1,u];let x=Be({...b,blockType:t.slug});if(x){let C=null,k=null;if(h?.length){C=R({markdown:h})?.root?.children??[];let T=C?.[0];T&&i.append(tl(T))}if(i.append(x),p?.length){k=R({markdown:p})?.root?.children;let T=i.getChildren()[i.getChildren().length-1],I=tl(k[0])?.getChildren();if(I?.length)for(let L of I)T.append(L)}}return[!0,g]},regExpEnd:t.jsx?.customEndRegex??o.regExpEnd,regExpStart:t.jsx?.customStartRegex??o.regExpStart,type:"multiline-element",replace:(s,i,u,d,c)=>{if(t?.jsx?.import){if(!c){let g="";if(i)for(let _ of i)g+=_.getTextContent();c=[g]}let a="";t?.jsx?.doNotTrimChildren?a=c.join(`
22
- `):a=c.join(`
23
- `).trim();let m=u[1]?.trim(),p=Yt(r,l),h=t.jsx.import({children:a,closeMatch:d,htmlToLexical:null,markdownToLexical:p,openMatch:u,props:m?Vt({propsString:m}):{}});if(h===!1)return!1;let f=Be({...h,blockType:t.slug});f&&s.append(f);return}return!1}})),n)}import{createCommand as rl}from"lexical";var et=rl("INSERT_BLOCK_COMMAND"),tt=rl("INSERT_INLINE_BLOCK_COMMAND");import{c as Rd}from"react/compiler-runtime";import{useLexicalComposerContext as Id}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Md,$wrapNodeInElement as Ad,mergeRegister as $d}from"@lexical/utils";import{formatDrawerSlug as Dd,useEditDepth as Od}from"@payloadcms/ui";import{$createParagraphNode as Fd,$getNodeByKey as Pd,$getPreviousSelection as Bd,$getSelection as jd,$insertNodes as Hd,$isParagraphNode as Gd,$isRangeSelection as Ud,$isRootOrShadowRoot as Vd,COMMAND_PRIORITY_EDITOR as ll}from"lexical";import{useEffect as Wd,useState as zd}from"react";var il=()=>{let t=Rd(12),[e]=Id(),[o,n]=zd(null),{setCreatedInlineBlock:r,uuid:l}=U(),s=Od(),i="lexical-inlineBlocks-create-"+l,u;t[0]!==s||t[1]!==i?(u=Dd({slug:i,depth:s}),t[0]=s,t[1]=i,t[2]=u):u=t[2];let d=u,{toggleDrawer:c}=Oe(d,!0),a;t[3]!==e||t[4]!==r||t[5]!==o?(a=()=>{if(!e.hasNodes([ce]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return $d(e.registerCommand(et,p=>(e.update(()=>{let h=jd()||Bd();if(Ud(h)){let f=Be(p),{focus:g}=h,_=g.getNode();Md(f),Gd(_)&&!_.__first&&_.remove()}}),!0),ll),e.registerCommand(tt,p=>{if(o){let f=Pd(o);return!f||!bt(f)?!1:(f.setFields(p),n(null),!0)}let h=Ct(p);return r?.(h),Hd([h]),Vd(h.getParentOrThrow())&&Ad(h,Fd).selectEnd(),!0},ll))},t[3]=e,t[4]=r,t[5]=o,t[6]=a):a=t[6];let m;return t[7]!==e||t[8]!==r||t[9]!==o||t[10]!==c?(m=[e,r,o,c],t[7]=e,t[8]=r,t[9]=o,t[10]=c,t[11]=m):m=t[11],Wd(a,m),null};var Kd=A(({config:t,featureClientSchemaMap:e,props:o,schemaPath:n})=>{let r=`${n}.lexical_internal_feature.blocks.lexical_blocks`,l=`${n}.lexical_internal_feature.blocks.lexical_inline_blocks`,s=e.blocks;if(!s)return{};let i=Object.entries(s).filter(([a])=>a.startsWith(r+".")&&!a.replace(r+".","").includes(".")).map(([,a])=>a[0]),u=Object.entries(s).filter(([a])=>a.startsWith(l+".")&&!a.replace(l+".","").includes(".")).map(([,a])=>a[0]),d=i.map(a=>{let m=a.blocks[0];return typeof m=="string"?t.blocksMap[m]:m}).filter(a=>a!==void 0),c=u.map(a=>{let m=a.blocks[0];return typeof m=="string"?t.blocksMap[m]:m}).filter(a=>a!==void 0);return{markdownTransformers:nl({blocks:d,inlineBlocks:c}),nodes:[ce,xt],plugins:[{Component:il,position:"normal"}],sanitizedClientFeatureProps:o,slashMenu:{groups:[d?.length?{items:d.map(a=>({Icon:Fr(a,jo),key:"block-"+a.slug,keywords:["block","blocks",a.slug],label:({i18n:m})=>a?.labels?.singular?qt(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(et,{blockName:"",blockType:a.slug})}})),key:"blocks",label:({i18n:a})=>a.t("lexical:blocks:label")}:null,c?.length?{items:c.map(a=>({Icon:Ho,key:"inlineBlocks-"+a.slug,keywords:["inlineBlock","inline block",a.slug],label:({i18n:m})=>a?.labels?.singular?qt(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(tt,{blockName:"",blockType:a.slug})}})),key:"inlineBlocks",label:({i18n:a})=>a.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[d.length?{type:"dropdown",ChildComponent:jo,items:d.map((a,m)=>({isActive:void 0,key:"block-"+a.slug,label:({i18n:p})=>a?.labels?.singular?qt(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(et,{blockName:"",blockType:a.slug})},order:m})),key:"blocks",order:20}:null,c?.length?{type:"dropdown",ChildComponent:Ho,items:c.map((a,m)=>({isActive:void 0,key:"inlineBlock-"+a.slug,label:({i18n:p})=>a?.labels?.singular?qt(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(tt,{blockName:"",blockType:a.slug})},order:m})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as Zd}from"react/compiler-runtime";import{jsx as He,jsxs as qo}from"react/jsx-runtime";import{useLexicalComposerContext as Yd}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as qd,$createTextNode as Qd,$getRoot as e1,getDOMSelection as Xo}from"lexical";import*as dl from"react";import{useCallback as je,useEffect as Zo,useLayoutEffect as al,useRef as Yo,useState as Qt}from"react";var Jd=se&&"documentMode"in document?document.documentMode:null,sl=se&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),n6=se&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),r6=se&&"InputEvent"in window&&!Jd?"getTargetRanges"in new window.InputEvent("input"):!1,l6=se&&/Version\/[\d.].*Safari/.test(navigator.userAgent),i6=se&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,s6=se&&/Android/.test(navigator.userAgent),a6=se&&/Win/.test(navigator.platform),Xd=se&&/^(?=.*Chrome).*/i.test(navigator.userAgent),c6=se&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Xd;var t1=t=>{let e=document.createElement("textarea");e.value=t||"",e.style.position="absolute",e.style.opacity="0",document.body?.appendChild(e),e.focus(),e.select();try{let o=document.execCommand("copy");console.log(o)}catch(o){console.error(o)}document.body?.removeChild(e)},o1=(t,e)=>{let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e||"")),o.setAttribute("download",t),o.style.display="none",document.body?.appendChild(o),o.click(),document.body?.removeChild(o)},n1=t=>{let o=((n,r)=>{switch(n){case"click":return` await page.mouse.click(${r.x}, ${r.y});`;case"keydown":return` await page.keyboard.keydown('${r}');`;case"keyup":return` await page.keyboard.keyup('${r}');`;case"press":return` await page.keyboard.press('${r}');`;case"selectAll":return" await selectAll(page);";case"snapshot":return` await assertHTMLSnapshot(page);
8
+ . Start match: `+JSON.stringify(r))}return{afterEndLine:c[C].trim().slice(g),beforeStartLine:h,content:i,endLineIndex:n+C,endlineLastCharIndex:g,propsString:s}}import{jsx as Od}from"react/jsx-runtime";import Fd from"bson-objectid";import{$applyNodeReplacement as Pd}from"lexical";import"react";import{DecoratorBlockNode as Ju}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as Xu}from"@lexical/utils";import Yu from"bson-objectid";import{$applyNodeReplacement as Zu}from"lexical";var yt=class extends Ju{__cacheBuster;__fields;constructor({cacheBuster:e,fields:o,format:n,key:r}){super(n,r),this.__fields=o,this.__cacheBuster=e||0}static clone(e){return new this({cacheBuster:e.__cacheBuster,fields:e.__fields,format:e.__format,key:e.__key})}static getType(){return"block"}static importDOM(){return{}}static importJSON(e){let o=qu(e.fields);return o.setFormat(e.format),o}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return Xu(o,e?.theme?.block),o}decorate(e,o){return null}exportDOM(){let e=document.createElement("div"),o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),type:"block",fields:this.getFields()}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}setFields(e,o){let n=this.getWritable();n.__fields=e,o||n.__cacheBuster++}};function qu(t){return Zu(new yt({fields:{...t,id:t?.id||new Yu.default().toHexString()}}))}import{jsx as G,jsxs as ve,Fragment as md}from"react/jsx-runtime";import{useLexicalComposerContext as pd}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as fd}from"@lexical/react/useLexicalEditable";import{getTranslation as hd}from"@payloadcms/translations";import{Button as il,Collapsible as gd,Drawer as xd,EditDepthProvider as Cd,ErrorPill as bd,Form as kd,formatDrawerSlug as _d,MoreIcon as Td,Pill as Ed,Popup as wd,PopupList as Rt,RenderFields as Sd,SectionTitle as Nd,useConfig as Ld,useDocumentForm as yd,useDocumentInfo as sl,useEditDepth as Rd,useFormSubmitted as vd,useServerFunctions as Id,useTranslation as Md,XIcon as Ad}from"@payloadcms/ui";import{abortAndIgnore as on}from"@payloadcms/ui/shared";import{$getNodeByKey as Qt,$getRoot as Dd,SKIP_DOM_SELECTION_TAG as nn}from"lexical";import{deepCopyObjectSimpleWithoutReactComponents as vt}from"payload/shared";import $e,{useCallback as rn,useEffect as eo,useMemo as Oe,useRef as to}from"react";import{v4 as $d}from"uuid";import{c as Qu}from"react/compiler-runtime";import{jsx as Zt,jsxs as ed}from"react/jsx-runtime";import{useLexicalEditable as td}from"@lexical/react/useLexicalEditable";import{RenderFields as od,useFormSubmitted as nd}from"@payloadcms/ui";import rd,{createContext as ld}from"react";var tl=ld({baseClass:"LexicalEditorTheme__block",BlockCollapsible:()=>null,BlockDrawer:()=>null,EditButton:()=>null,errorCount:0,formSchema:[],initialState:!1,nodeKey:"",RemoveButton:()=>null}),ae=()=>rd.use(tl),ol=t=>{let e=Qu(4),{Collapsible:o,CustomBlock:n,CustomLabel:r,...l}=t,{BlockDrawer:s,errorCount:i,formSchema:c}=l,d=nd()&&i>0,a=td(),p;e[0]!==o||e[1]!==i||e[2]!==d?(p=h=>{let{children:g,...C}=h;return Zt(o,{errorCount:i,fieldHasErrors:d,...C,children:g})},e[0]=o,e[1]=i,e[2]=d,e[3]=p):p=e[3];let m=p,f={...l,BlockCollapsible:m};return n?ed(tl,{value:f,children:[n,Zt(s,{})]}):Zt(m,{children:Zt(od,{fields:c,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!a})})};import{useId as dd}from"react";import{$getNodeByKey as qt,COMMAND_PRIORITY_HIGH as id,KEY_DOWN_COMMAND as sd,SKIP_DOM_SELECTION_TAG as ad}from"lexical";import{useCallback as en,useEffect as nl,useLayoutEffect as cd,useRef as tn,useState as ud}from"react";function rl({editor:t,nodeKey:e}){let[o,n]=ud(null),r=tn(null),l=tn(!1),s=tn(!1),i=o!==null;nl(()=>t.registerCommand(sd,a=>{let p=a?.target;return p instanceof HTMLElement&&!!t.getElementByKey(e)?.contains(p)&&!!p.closest(".collapsible__actions button")},id),[t,e]),nl(()=>{if(!i)return;let a,p=()=>{l.current=!0},m=()=>{l.current=!1,s.current&&(a=setTimeout(()=>{r.current=null,n(null)},0))};return document.addEventListener("pointerdown",p,!0),document.addEventListener("pointerup",m,!0),document.addEventListener("pointercancel",m,!0),()=>{document.removeEventListener("pointerdown",p,!0),document.removeEventListener("pointerup",m,!0),document.removeEventListener("pointercancel",m,!0),clearTimeout(a),l.current=!1,s.current=!1}},[i]),cd(()=>{if(o===null)return;let a=[];return t.getEditorState().read(()=>{let p=qt(e),m=p?.getParent()?.getChildren(),f=p?.getIndexWithinParent();if(!m||f===void 0||f===o)return;let h=m.map(I=>t.getElementByKey(I.getKey())),g=h[f],C=h[o],E=h[f+(o>f?1:-1)];if(!g||!C||!E)return;let L=g.getBoundingClientRect(),x=C.getBoundingClientRect(),b=E.getBoundingClientRect(),k=o>f,_=k?x.bottom-L.bottom:x.top-L.top,T=k?L.top-b.top:L.bottom-b.bottom;for(let I=Math.min(f,o);I<=Math.max(f,o);I++){let N=h[I];if(N){let w=N.style.translate;a.push(()=>{N.style.translate=w}),N.style.translate=`0 ${I===f?_:T}px`}}g.querySelector(".collapsible__drag")?.scrollIntoView({block:"nearest"})}),()=>a.forEach(p=>p())},[t,e,o]);let c=en(({direction:a,index:p})=>{t.isEditable()&&t.update(()=>{let m=qt(e),f=m?.getParent()?.getChildren();if(!m||!f)return;let h=m.getIndexWithinParent(),g=p??h+(a??0),C=f[g];C&&C!==m&&(g<h?C.insertBefore(m):C.insertAfter(m))},{onUpdate:()=>{requestAnimationFrame(()=>{let m=t.getElementByKey(e)?.querySelector(".collapsible__toggle-wrap");(m?.querySelector(".collapsible__drag")??m?.querySelector(".LexicalEditorTheme__block__actions-button"))?.focus()})},tag:ad})},[t,e]),u=en(a=>{t.isEditable()&&(a.key===" "||a.key==="Enter"?(a.preventDefault(),a.stopPropagation(),r.current===null?(t.getEditorState().read(()=>{r.current=qt(e)?.getIndexWithinParent()??null}),n(r.current)):(c({index:r.current}),r.current=null,n(null))):r.current!==null&&(a.key==="Escape"||a.key==="Tab"?(r.current=null,n(null),a.key==="Escape"&&(a.preventDefault(),a.stopPropagation())):(a.key==="ArrowUp"||a.key==="ArrowDown")&&(a.preventDefault(),a.stopPropagation(),t.getEditorState().read(()=>{let p=qt(e)?.getParent()?.getChildrenSize()??0;r.current=Math.max(0,Math.min(p-1,(r.current??0)+(a.key==="ArrowDown"?1:-1)))}),n(r.current))))},[t,c,e]),d=en(()=>{if(l.current){s.current=!0;return}r.current=null,n(null)},[]);return{isReordering:i,move:c,onBlur:d,onKeyDown:u,targetIndex:o}}function ll({children:t,editor:e,nodeKey:o}){let n=rl({editor:e,nodeKey:o}),r=dd();return t({...n,reorderInstructionsID:r})}var al=t=>{let{cacheBuster:e,className:o,CustomBlock:n,CustomLabel:r,formData:l,nodeKey:s}=t,i=vd(),{id:c,collectionSlug:u,globalSlug:d}=sl(),{fieldProps:{featureClientSchemaMap:a,field:p,initialLexicalFormState:m,schemaPath:f},uuid:h}=U(),{fields:g}=yd(),C=to(new AbortController),E=Rd(),[L,x]=$e.useState(0),{config:b}=Ld(),k=_d({slug:`lexical-blocks-create-${h}-${l.id}`,depth:E}),{toggleDrawer:_}=De(k),{getDocPreferences:T,setDocFieldPreferences:I}=sl(),[N]=pd(),w=fd(),y=l.blockType,S=to(l);S.current=l;let R=`${f}.lexical_internal_feature.blocks.lexical_blocks.${y}`,F=a.blocks?.[R]?.[0]?.blocks?.[0],M=typeof F=="string"?b.blocksMap[F]:F,{getFormState:B}=Id(),$=`${f}.lexical_internal_feature.blocks.lexical_blocks.${y}.fields`,[P,V]=$e.useState(()=>{let H=m?.[l.id],Z=H?.formState;if(!Z)return!1;let K=Ir({cachedFormState:Z,cachedSchemaPath:H.schemaPath,currentSchemaPath:$,formData:l});return K?{...K,blockName:{initialValue:l.blockName,passesCondition:!0,valid:!0,value:l.blockName}}:!1}),Xe=to(!1),xt=to(e);eo(()=>{Xe.current?(xt.current!==e&&V(!1),xt.current=e):Xe.current=!0},[e]);let[Ye]=$e.useState(()=>$d()),[ie,me]=$e.useState(()=>{if(!r)return P?._components?.customComponents?.BlockLabel??void 0}),[Ct,Wt]=$e.useState(()=>{if(!n)return P?._components?.customComponents?.Block??void 0}),ce=Oe(()=>n?G(n,{className:o,formData:l,isEditor:!0,isJSXConverter:!1,nodeKey:s,useBlockComponentContext:ae}):Ct,[n,o,l,s,Ct]),Ae=Oe(()=>r?G(r,{className:o,formData:l,isEditor:!0,isJSXConverter:!1,nodeKey:s,useBlockComponentContext:ae}):ie,[r,o,l,s,ie]);eo(()=>{let H=new AbortController;return M&&l&&!P&&(async()=>{let{state:K}=await B({id:c,collectionSlug:u,data:l,docPermissions:{fields:!0},docPreferences:await T(),documentFormState:vt(g,{excludeFiles:!0}),globalSlug:d,initialBlockData:l,operation:"update",readOnly:!w,renderAllFields:!0,schemaPath:$,signal:H.signal});if(K){K.blockName={initialValue:l.blockName,passesCondition:!0,valid:!0,value:l.blockName};let ee=kt(vt(K,{excludeFiles:!0}));N.update(()=>{let W=Qt(s);if(W&&Ie(W)){let qe=ee;qe.blockType=y,W.setFields(qe,!0)}},{tag:nn}),V(K),r||me(K._components?.customComponents?.BlockLabel??void 0),n||Wt(K._components?.customComponents?.Block??void 0)}})(),()=>{on(H)}},[B,$,w,c,r,n,l,N,s,P,u,d,T,g,y,M]);let[Vt,Ho]=$e.useState(m?.[l.id]?.collapsed??!1),{i18n:bt,t:Y}=Md(),zo=rn(async({formState:H,submit:Z})=>{on(C.current);let K=new AbortController;C.current=K;let ee=kt(vt(H,{excludeFiles:!0}),S.current),{state:W}=await B({id:c,collectionSlug:u,data:ee,docPermissions:{fields:!0},docPreferences:await T(),documentFormState:vt(g,{excludeFiles:!0}),formState:H,globalSlug:d,initialBlockData:ee,operation:"update",readOnly:!w,renderAllFields:!!Z,schemaPath:$,signal:K.signal});if(!W)return H;H.blockName&&(W.blockName=H.blockName);let qe=kt(vt(W,{excludeFiles:!0}),ee);if(setTimeout(()=>{N.update(()=>{let ge=Qt(s);if(ge&&Ie(ge)){let Qe=qe;Qe.blockType=y,ge.setFields(Qe,!0)}},{tag:nn})},0),Z){r||me(W._components?.customComponents?.BlockLabel??void 0),n||Wt(W._components?.customComponents?.Block??void 0);let ge=0;for(let Qe of Object.values(W))Qe?.valid===!1&&ge++;x(ge)}return W},[B,c,u,T,d,$,y,g,w,N,s,n,r]);eo(()=>()=>{on(C.current)},[]);let Kt=rn(()=>{N.update(()=>{Qt(s)?.remove()})},[N,s]),[xr,nu]=$e.useState(0);eo(()=>{let H=()=>{N.getEditorState().read(()=>{let K=Dd().getChildren(),ee=0;for(let W of K)if(Ie(W)){if(W.getKey()===s){nu(ee);return}ee++}})};return H(),N.registerUpdateListener(()=>{H()})},[N,s]);let Ze=M?.labels?.singular?hd(M.labels.singular,bt):M?.slug,Cr=rn(H=>{T().then(Z=>{let ee=Z?.fields?.[p.name]?.collapsed,W=ee&&ee?.length?ee:[];H?W.includes(l.id)||W.push(l.id):W.includes(l.id)&&W.splice(W.indexOf(l.id),1),I(p.name,{collapsed:W,hello:"hi"})})},[T,p.name,I,l.id]),br=Oe(()=>()=>G(il,{buttonStyle:"ghost",className:`${o}__editButton`,disabled:!w,el:"button",icon:"edit",onClick:H=>(H.preventDefault(),H.stopPropagation(),_(),!1),onMouseDown:H=>{H.preventDefault()},round:!0,size:"medium",tooltip:Y("lexical:blocks:inlineBlocks:edit",{label:Ze})}),[o,w,Y,Ze,_]),kr=Oe(()=>()=>G(il,{buttonStyle:"ghost",className:`${o}__removeButton`,disabled:!w,icon:"x",onClick:H=>{H.preventDefault(),Kt()},round:!0,tooltip:"Remove Block"}),[o,w,Kt]),Go=Oe(()=>function({Actions:Z,children:K,className:ee,collapsibleProps:W,disableBlockName:qe,editButton:ge,errorCount:Qe,fieldHasErrors:Uo,Label:Sr,Pill:Nr,removeButton:lu,showDragHandle:iu=!0,showRowNumber:su=!0}){return G(ll,{editor:N,nodeKey:s,children:({isReordering:Wo,move:Lr,onBlur:au,onKeyDown:cu,reorderInstructionsID:yr,targetIndex:uu})=>G("div",{className:`${o}__container ${o}-${y}`,onKeyDownCapture:J=>{let Vo=J.target;J.altKey||J.ctrlKey||J.metaKey||Vo.closest(".collapsible")?.parentElement!==J.currentTarget||(Vo.matches(".collapsible__drag")&&(J.key!=="Escape"||Wo)&&[" ","ArrowDown","ArrowUp","Enter","Escape","Tab"].includes(J.key)?(cu(J),J.stopPropagation()):J.key==="Tab"&&Vo.matches(".collapsible__toggle")&&J.stopPropagation())},children:ve(gd,{actions:typeof Z<"u"?Z:w?G(wd,{button:G(Td,{}),buttonAriaLabel:Y("general:moreOptions"),buttonClassName:`${o}__actions-button`,caret:!1,horizontalAlign:"right",popupType:"menu",render:({close:J})=>ve(Rt.ButtonGroup,{buttonSize:"medium",children:[G(Rt.Button,{onClick:()=>{J(),Lr({direction:-1})},children:Y("general:moveUp")}),G(Rt.Button,{onClick:()=>{J(),Lr({direction:1})},children:Y("general:moveDown")}),(ce&&ge!==!1||!ce&&ge)&&G(Rt.Button,{onClick:()=>{_(),J()},children:Y("general:edit")}),lu!==!1&&ve(Rt.Button,{onClick:()=>{Kt(),J()},children:[G(Ad,{}),Y("general:remove")]})]}),size:"large"}):null,className:[`${o}__row`,Uo?`${o}__row--has-errors`:`${o}__row--no-errors`,ee].filter(Boolean).join(" "),collapsibleStyle:Uo?"error":"default",dragHandleProps:iu&&w?{id:s,attributes:{"aria-describedby":yr,"aria-pressed":Wo,role:"button",tabIndex:0},listeners:{onBlur:au}}:void 0,header:G("div",{className:`${o}__block-header`,children:typeof Sr<"u"?Sr:typeof Ae<"u"?Ae:ve("div",{className:`${o}__block-label`,children:[su&&G("span",{className:`${o}__block-number`,children:String(xr+1).padStart(2,"0")}),typeof Nr<"u"?Nr:G(Ed,{className:`${o}__block-pill ${o}__block-pill-${y}`,pillStyle:"white",size:"small",children:Ze??y}),!qe&&!M?.admin?.disableBlockName&&G(Nd,{path:"blockName",readOnly:!w}),Uo&&G(bd,{count:Qe??0,i18n:bt,withMessage:!0})]})}),isCollapsed:Vt,onToggle:J=>{Cr(J),Ho(J)},...W||{},AfterCollapsible:ve(md,{children:[W?.AfterCollapsible,G("span",{className:"sr-only",role:"status",children:Wo?`${Y("general:order")}: ${(uu??0)+1}`:""})]}),children:[ve("span",{className:"sr-only",id:yr,children:["Space / Enter \xB7 ",Y("general:moveUp")," \u2191 \xB7 ",Y("general:moveDown")," \u2193 \xB7"," ",Y("general:cancel")," Escape"]}),K]},0)})})},[N,ce,Ae,Ze,o,M?.admin?.disableBlockName,y,bt,Vt,Cr,w,s,Kt,xr,Y,_]),_r=l?.id,{headerActions:Tr,submitRef:Er}=Rr(),wr=Oe(()=>()=>G(Cd,{children:G(xd,{className:"",headerActions:Tr,slug:k,title:Y(`lexical:blocks:inlineBlocks:${_r?"edit":"create"}`,{label:Ze??Y("lexical:blocks:inlineBlocks:label")}),children:P?ve("div",{className:"fields-drawer",children:[G(Sd,{fields:M?.fields??[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:$,permissions:!0,readOnly:!w}),G(vr,{submitRef:Er})]}):null})}),[P,k,_r,Ze,Y,w,M?.fields,$,Tr,Er]),ru=Oe(()=>P?G("div",{"data-block-drawer-slug":k,style:{display:"contents"},children:G(kd,{beforeSubmit:[async({formState:H})=>await zo({formState:H,submit:!0})],el:"div",fields:M?.fields??[],initialState:P,onChange:[zo],onSubmit:H=>{let Z=kt(H,S.current);Z.blockType=y,N.update(()=>{let K=Qt(s);K&&Ie(K)&&K.setFields(Z,!0)},{tag:nn}),_()},submitted:i,uuid:Ye,children:G(ol,{baseClass:o,BlockDrawer:wr,Collapsible:Go,CustomBlock:ce,CustomLabel:Ae,EditButton:br,errorCount:L,formSchema:M?.fields??[],initialState:P,nodeKey:s,RemoveButton:kr})})}):null,[Go,wr,ce,Ae,y,k,kr,br,o,N,L,_,M?.fields,Ye,P,s,zo,i]);return M?ru:G(Go,{disableBlockName:!0,fieldHasErrors:!0,children:ve("div",{className:`${o}-not-found`,children:["Error: Block '",y,"' not found in the config but exists in the lexical data"]})})};var ue=class extends yt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){let o=Fe(e.fields);return o.setFormat(e.format),o}decorate(...[e,o,n,r]){return Od(al,{cacheBuster:this.getCacheBuster(),className:o.theme.block??"LexicalEditorTheme__block",CustomBlock:n,CustomLabel:r,formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Fe(t){return Pd(new ue({fields:{...t,id:t?.id||new Fd.default().toHexString()}}))}function Ie(t){return t instanceof ue}import{createHeadlessEditor as Bd}from"@lexical/headless";import{$convertToMarkdownString as jd}from"@lexical/markdown";function ln(t,e){return({editorState:n})=>{let r=Bd({nodes:t});try{r.setEditorState(r.parseEditorState(n))}catch(s){console.error("getLexicalToMarkdown: ERROR parsing editor state",s)}let l="";return r.getEditorState().read(()=>{l=jd(e)}),l}}import{createHeadlessEditor as Yd}from"@lexical/headless";import{$convertFromMarkdownString as gl,TRANSFORMERS as Xd}from"@lexical/markdown";var cl=/^[\t ]*$/,Hd=/^(\s*)(\d+)\.\s/,zd=/^(\s*)[-*+]\s/,Gd=/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,ul=/^(#{1,6})\s/,Ud=/^>\s/,Wd=/^[ \t]*(\\`\\`\\`|```)(\w+)?/,dl=/[ \t]*(\\`\\`\\`|```)$/,Vd=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Kd=/^\|(.+)\|\s?$/,Jd=/^(\| ?:?-*:? ?)+\|\s?$/,ml=/^[ \t]*<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,pl=/^[ \t]*<\/[a-z_][\w-]*\s*>/i;function fl(t){if(t.endsWith("\\"))return[t.slice(0,-1),"\\"];let e=t.match(/^(.*?\S)( {2,})$/);return e?[e[1],e[2]]:null}function hl(t,e){let o=t.split(`
9
+ `),n=!1,r=[],l=0;for(let s=0;s<o.length;s++){let i=o[s],c=r[r.length-1],u=s<o.length-1?fl(i):null,d=c!==void 0&&fl(c)!==null;if(Vd.test(i)){r.push(i);continue}if(dl.test(i)){l===0&&(n=!0),l===1&&(n=!1),l>0&&l--,r.push(i);continue}if(Wd.test(i)){n=!0,l++,r.push(i);continue}if(n){r.push(i);continue}cl.test(i)||cl.test(c)||!c||ul.test(c)||ul.test(i)||Ud.test(i)||Hd.test(i)||zd.test(i)||Gd.test(i)||Kd.test(i)||Jd.test(i)||d||!e||ml.test(i)||pl.test(i)||ml.test(c)||pl.test(c)||dl.test(c)?r.push(i):r[r.length-1]=c+" "+(u===null?i.trim():i.trimStart())}return r.join(`
10
+ `)}function oo(t,e=Xd,o,n=!1,r=!1){if(n)return gl(t,e,o,!0);let l=hl(t,r);return gl(l,e,o,!1,!1)}function no(t,e){return({markdown:n})=>{let r=Yd({nodes:t});return r.update(()=>{oo(n,e,void 0,!1,!0)},{discrete:!0}),r.getEditorState().toJSON()}}function Zd(t){let e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{regExpEnd:new RegExp(`</(${e})\\s*>|<${e}[^>]*?/>`,"i"),regExpStart:new RegExp(`<(${e})([^>]*?)\\s*(/?)>`,"i")}}var bl=({blocks:t,inlineBlocks:e})=>{if(!t?.length&&!e?.length)return[];let o=[];if(t?.length)for(let n of t){let r=Cl(n,!1);r&&(o=o.concat(r))}if(e?.length)for(let n of e){let r=Cl(n,!0);r&&(o=o.concat(r))}return o};function Cl(t,e){if(!t.jsx)return null;let o=Zd(t.slug),n=[];return e?(n.push(({allNodes:r,allTransformers:l})=>({type:"text-match",dependencies:[_t],export:s=>{if(!Et(s)||s.getFields()?.blockType?.toLowerCase()!==t.slug.toLowerCase())return null;let i=s.getFields(),c=ln(r,l),u=t.jsx.export({fields:i,lexicalToMarkdown:c});if(u===!1)return null;if(typeof u=="string")return u;let d=u.props&&Object.keys(u.props)?.length>0,a=u.props??{};return u?.children?.length?`<${i.blockType}${d?" "+Lt({props:a}):""}>${u.children}</${i.blockType}>`:`<${i.blockType}${d?" "+Lt({props:a}):""}/>`},getEndIndex:(s,i)=>{let{endlineLastCharIndex:c}=Yt({isEndOptional:!1,lines:[s.getTextContent()],regexpEndRegex:o.regExpEnd,startLineIndex:0,startMatch:i,trimChildren:!1});return c},importRegExp:t.jsx?.customStartRegex??o.regExpStart,regExp:/___ignoreignoreignore___/g,replace(s,i){let{content:c,propsString:u}=Yt({isEndOptional:!1,lines:[s.getTextContent()],regexpEndRegex:o.regExpEnd,startLineIndex:0,startMatch:{...i,index:0},trimChildren:!1});if(!t?.jsx?.import)return;let d=no(r,l),a=t.jsx.import({children:c,closeMatch:null,htmlToLexical:null,markdownToLexical:d,openMatch:i,props:u?Xt({propsString:u}):{}});if(a===!1)return;let p=Tt({blockType:t.slug,...a});s.replace(p)}})),n):(n.push(({allNodes:r,allTransformers:l})=>({dependencies:[ue],export:s=>{if(!Ie(s)||s.getFields()?.blockType?.toLowerCase()!==t.slug.toLowerCase())return null;let i=s.getFields(),c=ln(r,l),u=t.jsx.export({fields:i,lexicalToMarkdown:c});if(u===!1)return null;if(typeof u=="string")return u;let d=u.props&&Object.keys(u.props)?.length>0,a=u.props??{};if(u?.children?.length){let p=u.children,m="";if(p.includes(`
11
+ `))for(let f of p.split(`
12
+ `)){let h="";!t?.jsx?.doNotTrimChildren&&f!==""&&(h=" "),h+=f+`
13
+ `,m+=h}else m=(t?.jsx?.doNotTrimChildren?"":" ")+p+`
14
+ `;return`<${i.blockType}${d?" "+Lt({props:a}):""}>
15
+ ${m}</${i.blockType}>`}return`<${i.blockType}${d?" "+Lt({props:a}):""}/>`},handleImportAfterStartMatch:t.jsx?.customEndRegex?void 0:({lines:s,rootNode:i,startLineIndex:c,startMatch:u,transformer:d})=>{let a=typeof d.regExpEnd=="object"&&"regExp"in d.regExpEnd?d.regExpEnd.regExp:d.regExpEnd,p=d.regExpEnd&&typeof d.regExpEnd=="object"&&"optional"in d.regExpEnd?d.regExpEnd.optional:!d.regExpEnd,{afterEndLine:m,beforeStartLine:f,content:h,endLineIndex:g,propsString:C}=Yt({isEndOptional:p,lines:s,regexpEndRegex:a,startLineIndex:c,startMatch:u,trimChildren:!1}),E="";if(t?.jsx?.doNotTrimChildren)E=h.endsWith(`
16
+ `)?h.slice(0,-1):h;else if(h.includes(`
17
+ `)){let k=h.split(`
18
+ `),_=0;for(let T of k){if(_++,T.startsWith(" "))E+=T.slice(2);else if(T==="")E+=T;else{E=h.endsWith(`
19
+ `)?h.slice(0,-1):h;break}E+=_===k.length?"":`
20
+ `}}else E=(h.startsWith(" ")?h.slice(2):h)+`
21
+ `;if(!t?.jsx?.import)return[!1,c];let L=no(r,l),x=t.jsx.import({children:E,closeMatch:null,htmlToLexical:null,markdownToLexical:L,openMatch:u,props:C?Xt({propsString:C}):{}});if(x===!1)return[!1,c];let b=Fe({...x,blockType:t.slug});if(b){let k=null,_=null;if(f?.length){k=L({markdown:f})?.root?.children??[];let T=k?.[0];T&&i.append(xl(T))}if(i.append(b),m?.length){_=L({markdown:m})?.root?.children;let T=i.getChildren()[i.getChildren().length-1],I=xl(_[0])?.getChildren();if(I?.length)for(let N of I)T.append(N)}}return[!0,g]},regExpEnd:t.jsx?.customEndRegex??o.regExpEnd,regExpStart:t.jsx?.customStartRegex??o.regExpStart,type:"multiline-element",replace:(s,i,c,u,d)=>{if(t?.jsx?.import){if(!d){let g="";if(i)for(let C of i)g+=C.getTextContent();d=[g]}let a="";t?.jsx?.doNotTrimChildren?a=d.join(`
22
+ `):a=d.join(`
23
+ `).trim();let p=c[1]?.trim(),m=no(r,l),f=t.jsx.import({children:a,closeMatch:u,htmlToLexical:null,markdownToLexical:m,openMatch:c,props:p?Xt({propsString:p}):{}});if(f===!1)return!1;let h=Fe({...f,blockType:t.slug});h&&s.append(h);return}return!1}})),n)}import{createCommand as kl}from"lexical";var rt=kl("INSERT_BLOCK_COMMAND"),lt=kl("INSERT_INLINE_BLOCK_COMMAND");import{c as qd}from"react/compiler-runtime";import{useLexicalComposerContext as Qd}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as em,$wrapNodeInElement as tm,mergeRegister as om}from"@lexical/utils";import{formatDrawerSlug as nm,useEditDepth as rm}from"@payloadcms/ui";import{$createParagraphNode as lm,$getNodeByKey as im,$getPreviousSelection as sm,$getSelection as am,$insertNodes as cm,$isParagraphNode as um,$isRangeSelection as dm,$isRootOrShadowRoot as mm,COMMAND_PRIORITY_EDITOR as _l}from"lexical";import{useEffect as pm,useState as fm}from"react";var Tl=()=>{let t=qd(12),[e]=Qd(),[o,n]=fm(null),{setCreatedInlineBlock:r,uuid:l}=U(),s=rm(),i="lexical-inlineBlocks-create-"+l,c;t[0]!==s||t[1]!==i?(c=nm({slug:i,depth:s}),t[0]=s,t[1]=i,t[2]=c):c=t[2];let u=c,{toggleDrawer:d}=De(u,!0),a;t[3]!==e||t[4]!==r||t[5]!==o?(a=()=>{if(!e.hasNodes([ue]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return om(e.registerCommand(rt,m=>(e.update(()=>{let f=am()||sm();if(dm(f)){let h=Fe(m),{focus:g}=f,C=g.getNode();em(h),um(C)&&!C.__first&&C.remove()}}),!0),_l),e.registerCommand(lt,m=>{if(o){let h=im(o);return!h||!Et(h)?!1:(h.setFields(m),n(null),!0)}let f=Tt(m);return r?.(f),cm([f]),mm(f.getParentOrThrow())&&tm(f,lm).selectEnd(),!0},_l))},t[3]=e,t[4]=r,t[5]=o,t[6]=a):a=t[6];let p;return t[7]!==e||t[8]!==r||t[9]!==o||t[10]!==d?(p=[e,r,o,d],t[7]=e,t[8]=r,t[9]=o,t[10]=d,t[11]=p):p=t[11],pm(a,p),null};var hm=A(({config:t,featureClientSchemaMap:e,props:o,schemaPath:n})=>{let r=`${n}.lexical_internal_feature.blocks.lexical_blocks`,l=`${n}.lexical_internal_feature.blocks.lexical_inline_blocks`,s=e.blocks;if(!s)return{};let i=Object.entries(s).filter(([a])=>a.startsWith(r+".")&&!a.replace(r+".","").includes(".")).map(([,a])=>a[0]),c=Object.entries(s).filter(([a])=>a.startsWith(l+".")&&!a.replace(l+".","").includes(".")).map(([,a])=>a[0]),u=i.map(a=>{let p=a.blocks[0];return typeof p=="string"?t.blocksMap[p]:p}).filter(a=>a!==void 0),d=c.map(a=>{let p=a.blocks[0];return typeof p=="string"?t.blocksMap[p]:p}).filter(a=>a!==void 0);return{markdownTransformers:bl({blocks:u,inlineBlocks:d}),nodes:[ue,_t],plugins:[{Component:Tl,position:"normal"}],sanitizedClientFeatureProps:o,slashMenu:{groups:[u?.length?{items:u.map(a=>({Icon:qr(a,Zo),key:"block-"+a.slug,keywords:["block","blocks",a.slug],label:({i18n:p})=>a?.labels?.singular?ro(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(rt,{blockName:"",blockType:a.slug})}})),key:"blocks",label:({i18n:a})=>a.t("lexical:blocks:label")}:null,d?.length?{items:d.map(a=>({Icon:qo,key:"inlineBlocks-"+a.slug,keywords:["inlineBlock","inline block",a.slug],label:({i18n:p})=>a?.labels?.singular?ro(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(lt,{blockName:"",blockType:a.slug})}})),key:"inlineBlocks",label:({i18n:a})=>a.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[u.length?{type:"dropdown",ChildComponent:Zo,items:u.map((a,p)=>({isActive:void 0,key:"block-"+a.slug,label:({i18n:m})=>a?.labels?.singular?ro(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(rt,{blockName:"",blockType:a.slug})},order:p})),key:"blocks",order:20}:null,d?.length?{type:"dropdown",ChildComponent:qo,items:d.map((a,p)=>({isActive:void 0,key:"inlineBlock-"+a.slug,label:({i18n:m})=>a?.labels?.singular?ro(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(lt,{blockName:"",blockType:a.slug})},order:p})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as Cm}from"react/compiler-runtime";import{jsx as Be,jsxs as un}from"react/jsx-runtime";import{useLexicalComposerContext as bm}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as km,$createTextNode as _m,$getRoot as Tm,getDOMSelection as sn}from"lexical";import*as Ll from"react";import{useCallback as Pe,useEffect as an,useLayoutEffect as wl,useRef as cn,useState as lo}from"react";var gm=se&&"documentMode"in document?document.documentMode:null,El=se&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),X7=se&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Y7=se&&"InputEvent"in window&&!gm?"getTargetRanges"in new window.InputEvent("input"):!1,Z7=se&&/Version\/[\d.].*Safari/.test(navigator.userAgent),q7=se&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Q7=se&&/Android/.test(navigator.userAgent),e3=se&&/Win/.test(navigator.platform),xm=se&&/^(?=.*Chrome).*/i.test(navigator.userAgent),t3=se&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!xm;var Em=t=>{let e=document.createElement("textarea");e.value=t||"",e.style.position="absolute",e.style.opacity="0",document.body?.appendChild(e),e.focus(),e.select();try{let o=document.execCommand("copy");console.log(o)}catch(o){console.error(o)}document.body?.removeChild(e)},wm=(t,e)=>{let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e||"")),o.setAttribute("download",t),o.style.display="none",document.body?.appendChild(o),o.click(),document.body?.removeChild(o)},Sm=t=>{let o=((n,r)=>{switch(n){case"click":return` await page.mouse.click(${r.x}, ${r.y});`;case"keydown":return` await page.keyboard.keydown('${r}');`;case"keyup":return` await page.keyboard.keyup('${r}');`;case"press":return` await page.keyboard.press('${r}');`;case"selectAll":return" await selectAll(page);";case"snapshot":return` await assertHTMLSnapshot(page);
24
24
  await assertSelection(page, {
25
25
  anchorPath: [${r.anchorPath.toString()}],
26
26
  anchorOffset: ${r.anchorOffset},
@@ -30,7 +30,7 @@ ${p}</${i.blockType}>`}return`<${i.blockType}${c?" "+wt({props:a}):""}/>`},handl
30
30
  `;case"type":return` await page.keyboard.type('${r}');`;default:return""}})(t.name,t.value);switch(t.count){case 1:return o;case 2:return[o,o].join(`
31
31
  `);default:return` await repeat(${t.count}, async () => {
32
32
  ${o}
33
- );`}};function r1(t){return t.key.toLowerCase()==="a"&&(sl?t.metaKey:t.ctrlKey)}function l1(t){let{anchorNode:e,focusNode:o}=t,{anchorOffset:n,focusOffset:r}=t;return n!==0&&n--,r!==0&&r--,{anchorNode:e,anchorOffset:n,focusNode:o,focusOffset:r}}function cl(t,e){let o=t,n=[];for(;o!==e;)o!=null&&n.unshift(Array.from(o?.parentNode?.childNodes??[]).indexOf(o)),o=o?.parentNode;return n}var ul=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]);function i1(t){let[e,o]=Qt([]),[n,r]=Qt(!1),[,l]=Qt(""),[s,i]=Qt(""),u=Yo(null),d=Yo(!1),c=Yo(null),a=je(()=>t,[t]),m=je(()=>{let b=t.getRootElement(),x=Xo(t._window);return b==null||x==null||x.anchorNode==null||x.focusNode==null||!b.contains(x.anchorNode)||!b.contains(x.focusNode)?null:`
33
+ );`}};function Nm(t){return t.key.toLowerCase()==="a"&&(El?t.metaKey:t.ctrlKey)}function Lm(t){let{anchorNode:e,focusNode:o}=t,{anchorOffset:n,focusOffset:r}=t;return n!==0&&n--,r!==0&&r--,{anchorNode:e,anchorOffset:n,focusNode:o,focusOffset:r}}function Sl(t,e){let o=t,n=[];for(;o!==e;)o!=null&&n.unshift(Array.from(o?.parentNode?.childNodes??[]).indexOf(o)),o=o?.parentNode;return n}var Nl=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]);function ym(t){let[e,o]=lo([]),[n,r]=lo(!1),[,l]=lo(""),[s,i]=lo(""),c=cn(null),u=cn(!1),d=cn(null),a=Pe(()=>t,[t]),p=Pe(()=>{let x=t.getRootElement(),b=sn(t._window);return x==null||b==null||b.anchorNode==null||b.focusNode==null||!x.contains(b.anchorNode)||!x.contains(b.focusNode)?null:`
34
34
  import {
35
35
  initializeE2E,
36
36
  assertHTMLSnapshot,
@@ -47,19 +47,19 @@ describe('Test case', () => {
47
47
  const {page} = e2e;
48
48
 
49
49
  await page.focus('div[contenteditable="true"]');
50
- ${e.map(n1).join(`
50
+ ${e.map(Sm).join(`
51
51
  `)}
52
52
  });
53
53
  });
54
- `},[t,e]),p=je((b,x)=>{o(C=>{let k=e.length-1,T=e[k];if(T&&T.name===b){if(b==="type")return[...e.slice(0,k),{...T,value:T.value+x}];if(T.value===x)return[...e.slice(0,k),{...T,count:T.count+1}]}return[...C,{name:b,count:1,value:x}]})},[e,o]);al(()=>{let b=C=>{if(!n)return;let k=C.key;r1(C)?p("selectAll",""):ul.has(k)?p("press",C.key):[...k].length>1?p("keydown",C.key):p("type",C.key)},x=C=>{if(!n)return;let k=C.key;!ul.has(k)&&[...k].length>1&&p("keyup",C.key)};return t.registerRootListener((C,k)=>{k!==null&&(k.removeEventListener("keydown",b),k.removeEventListener("keyup",x)),C!==null&&(C.addEventListener("keydown",b),C.addEventListener("keyup",x))})},[t,n,p]),al(()=>{c.current&&c.current.scrollTo(0,c.current.scrollHeight)},[m]),Zo(()=>{if(e){let b=m();b!==null&&i(b),c.current&&c.current.scrollTo(0,c.current.scrollHeight)}},[m,e]),Zo(()=>t.registerUpdateListener(({dirtyElements:x,dirtyLeaves:C,editorState:k})=>{if(!n)return;let T=k._selection,I=u.current,L=d.current;if(I!==T){if(C.size===0&&x.size===0&&!L){let N=Xo(t._window);if(N&&(N.anchorNode==null||N.focusNode==null))return}u.current=T}d.current=!1;let S=m();S!==null&&i(S)}),[t,m,n,p]),Zo(()=>n?t.registerUpdateListener(()=>{let x=t.getRootElement();x!==null&&l(x?.innerHTML)}):void 0,[t,n]);let h=je(b=>{n||(b.update(()=>{let x=e1();x.clear();let C=Qd();x.append(qd().append(C)),C.select()}),o([])),r(x=>!x)},[n]),f=je(()=>{if(!n)return;let b=Xo(t._window);if(b===null||b.anchorNode==null||b.focusNode==null)return;let{anchorNode:x,anchorOffset:C,focusNode:k,focusOffset:T}=l1(b),I=a().getRootElement(),L;x!==null&&(L=cl(x,I));let S;k!==null&&(S=cl(k,I)),p("snapshot",{anchorNode:x,anchorOffset:C,anchorPath:L,focusNode:k,focusOffset:T,focusPath:S})},[p,n,a]),g=je(()=>{t1(m())},[m]),_=je(()=>{o1("test.js",m())},[m]);return[He("button",{className:`editor-dev-button ${n?"active":""}`,id:"test-recorder-button",onClick:b=>{h(a()),b.preventDefault()},title:n?"Disable test recorder":"Enable test recorder",type:"button",children:n?"Disable test recorder":"Enable test recorder"}),n?qo("div",{className:"test-recorder-output",children:[qo("div",{className:"test-recorder-toolbar",children:[He("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:b=>{f(),b.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),He("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:b=>{g(),b.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),He("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:b=>{_(),b.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),He("pre",{id:"test-recorder",ref:c,children:s})]}):null]}var ml=()=>{let t=Zd(3),[e]=Yd(),[o,n]=i1(e),r;return t[0]!==o||t[1]!==n?(r=qo(dl.Fragment,{children:[He("p",{children:"HI"}),o,n,He("p",{children:"DONE"})]}),t[0]=o,t[1]=n,t[2]=r):r=t[2],r};var s1=A({plugins:[{Component:ml,position:"bottom"}]});import{c as a1}from"react/compiler-runtime";import{jsx as c1}from"react/jsx-runtime";import{useLexicalComposerContext as u1}from"@lexical/react/LexicalComposerContext.js";import{TreeView as d1}from"@lexical/react/LexicalTreeView.js";import"react";var pl=()=>{let t=a1(2),[e]=u1(),o;return t[0]!==e?(o=c1(d1,{editor:e,timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",treeTypeButtonClassName:"debug-treetype-button",viewClassName:"tree-view-output"}),t[0]=e,t[1]=o):o=t[1],o};var m1=A({plugins:[{Component:pl,position:"bottom"}]});import{BOLD_ITALIC_STAR as f1,BOLD_ITALIC_UNDERSCORE as h1,BOLD_STAR as g1,BOLD_UNDERSCORE as x1}from"@lexical/markdown";import{$isTableSelection as C1}from"@lexical/table";import{$isRangeSelection as b1,FORMAT_TEXT_COMMAND as k1}from"lexical";import{jsx as fl}from"react/jsx-runtime";import"react";var p1="M14.5 9.25A1.75 1.75 0 0 1 12.75 11H9.5V7.5h3.25c.966 0 1.75.784 1.75 1.75M8 11V7.5A1.5 1.5 0 0 1 9.5 6h3.25a3.25 3.25 0 0 1 2.418 5.422A3.5 3.5 0 0 1 13.5 18h-4A1.5 1.5 0 0 1 8 16.5zm1.5 1.5v4h4a2 2 0 1 0 0-4z",hl=({className:t})=>fl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:fl("path",{clipRule:"evenodd",d:p1,fill:"currentColor",fillRule:"evenodd"})});var Z=t=>({type:"buttons",items:t,key:"format",order:40});var gl=[Z([{ChildComponent:hl,isActive:({selection:t})=>b1(t)||C1(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(k1,"bold")},order:1}])],_1=A(({featureProviderMap:t})=>{let e=[g1,x1];return t.get("italic")&&e.push(h1,f1),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:gl},toolbarInline:{groups:gl}}});import{INLINE_CODE as w1}from"@lexical/markdown";import{$isTableSelection as E1}from"@lexical/table";import{$isRangeSelection as S1,FORMAT_TEXT_COMMAND as N1}from"lexical";import{jsx as xl}from"react/jsx-runtime";import"react";var T1="M9.64645 8.14645C9.84171 7.95118 10.1582 7.95118 10.3535 8.14645C10.5487 8.34171 10.5487 8.65822 10.3535 8.85348L7.20699 12L10.3535 15.1464C10.5487 15.3417 10.5487 15.6582 10.3535 15.8535C10.1582 16.0487 9.84171 16.0487 9.64645 15.8535L6.14645 12.3535C5.95118 12.1582 5.95118 11.8417 6.14645 11.6464L9.64645 8.14645ZM13.6464 8.14645C13.8417 7.95118 14.1582 7.95118 14.3535 8.14645L17.8535 11.6464C18.0487 11.8417 18.0487 12.1582 17.8535 12.3535L14.3535 15.8535C14.1582 16.0487 13.8417 16.0487 13.6464 15.8535C13.4512 15.6582 13.4512 15.3417 13.6464 15.1464L16.7929 12L13.6464 8.85348C13.4512 8.65822 13.4512 8.34171 13.6464 8.14645Z",Cl=({className:t})=>xl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:xl("path",{clipRule:"evenodd",d:T1,fill:"currentColor",fillRule:"evenodd"})});var bl=[Z([{ChildComponent:Cl,isActive:({selection:t})=>S1(t)||E1(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(N1,"code")},order:7}])],L1=A({enableFormats:["code"],markdownTransformers:[w1],toolbarFixed:{groups:bl},toolbarInline:{groups:bl}});import{ITALIC_STAR as v1,ITALIC_UNDERSCORE as R1}from"@lexical/markdown";import{$isTableSelection as I1}from"@lexical/table";import{$isRangeSelection as M1,FORMAT_TEXT_COMMAND as A1}from"lexical";import{jsx as kl}from"react/jsx-runtime";import"react";var y1="M10 6.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-2.083L11.6 17h1.9a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2.083L12.4 7h-1.9a.5.5 0 0 1-.5-.5",_l=({className:t})=>kl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:kl("path",{clipRule:"evenodd",d:y1,fill:"currentColor",fillRule:"evenodd"})});var Tl=[Z([{ChildComponent:_l,isActive:({selection:t})=>M1(t)||I1(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(A1,"italic")},order:2}])],$1=A({enableFormats:["italic"],markdownTransformers:[v1,R1],toolbarFixed:{groups:Tl},toolbarInline:{groups:Tl}});import{STRIKETHROUGH as O1}from"@lexical/markdown";import{$isTableSelection as F1}from"@lexical/table";import{$isRangeSelection as P1,FORMAT_TEXT_COMMAND as B1}from"lexical";import{jsx as wl}from"react/jsx-runtime";import"react";var D1="M15.835 13.5a.27.27 0 0 1 .24.138q.306.554.306 1.316 0 1.01-.543 1.816-.543.8-1.554 1.268-1.01.462-2.409.462-1.323 0-2.295-.419-.972-.424-1.534-1.175a3.2 3.2 0 0 1-.533-1.135c-.082-.326.187-.614.522-.614.299 0 .539.233.625.519q.13.43.415.768.448.524 1.17.8.73.271 1.63.272.996 0 1.764-.32.773-.327 1.215-.906a2.16 2.16 0 0 0 .44-1.348q0-.645-.345-1.09c-.1-.132-.016-.352.15-.352zm-3.846-8q1.215 0 2.142.438.933.43 1.476 1.187.38.518.519 1.134c.07.31-.19.577-.507.577-.286 0-.518-.22-.6-.493q-.22-.738-.875-1.224-.864-.646-2.18-.646-.92 0-1.63.313-.703.308-1.1.85a2.04 2.04 0 0 0-.395 1.237q0 .492.217.874.216.376.588.652.376.278.843.475.474.197.972.338l1.052.288H18.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1h3.94a4.4 4.4 0 0 1-.844-.602q-.844-.781-.844-1.982 0-1.009.562-1.778t1.522-1.2q.959-.438 2.153-.438",El=({className:t})=>wl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:wl("path",{d:D1,fill:"currentColor"})});var Sl=[Z([{ChildComponent:El,isActive:({selection:t})=>P1(t)||F1(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(B1,"strikethrough")},order:4}])],j1=A({enableFormats:["strikethrough"],markdownTransformers:[O1],toolbarFixed:{groups:Sl},toolbarInline:{groups:Sl}});import{$isTableSelection as G1}from"@lexical/table";import{$isRangeSelection as U1,FORMAT_TEXT_COMMAND as V1}from"lexical";import{jsx as Nl}from"react/jsx-runtime";import"react";var H1="M7.51 15.65a.523.523 0 1 1-.985-.352l2.377-6.534a.83.83 0 0 1 1.56 0l2.374 6.534a.523.523 0 1 1-.985.351L9.722 9.57a.043.043 0 0 0-.08 0zm.162-2.238c0-.252.204-.456.456-.456h3.1a.456.456 0 0 1 0 .912h-3.1a.456.456 0 0 1-.456-.456m6.652 3.925a.436.436 0 0 1-.287-.765l1.64-1.431q.259-.228.433-.407.175-.178.266-.345a.76.76 0 0 0 .091-.365.61.61 0 0 0-.258-.52q-.255-.195-.63-.195-.4 0-.643.21a.7.7 0 0 0-.133.151c-.127.197-.3.403-.534.403s-.432-.194-.367-.418q.11-.378.434-.642.494-.402 1.257-.403.513 0 .897.183.387.181.604.501.217.316.217.714 0 .316-.13.586-.125.27-.395.555a9 9 0 0 1-.695.634l-.927.798a.023.023 0 0 0 .016.042h1.895a.357.357 0 0 1 0 .714z",Ll=({className:t})=>Nl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Nl("path",{d:H1,fill:"currentColor"})});var yl=[Z([{ChildComponent:Ll,isActive:({selection:t})=>U1(t)||G1(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(V1,"subscript")},order:5}])],W1=A({enableFormats:["subscript"],toolbarFixed:{groups:yl},toolbarInline:{groups:yl}});import{$isTableSelection as K1}from"@lexical/table";import{$isRangeSelection as J1,FORMAT_TEXT_COMMAND as X1}from"lexical";import{jsx as vl}from"react/jsx-runtime";import"react";var z1="M7.51 15.65a.523.523 0 1 1-.985-.352l2.377-6.534a.83.83 0 0 1 1.56 0l2.374 6.534a.523.523 0 1 1-.985.351L9.722 9.57a.043.043 0 0 0-.08 0zm.162-2.238c0-.252.204-.456.456-.456h3.1a.456.456 0 0 1 0 .912h-3.1a.456.456 0 0 1-.456-.456m6.652-1.303a.436.436 0 0 1-.287-.765l1.64-1.432q.259-.228.433-.406.175-.179.266-.346a.76.76 0 0 0 .091-.365.61.61 0 0 0-.258-.52q-.255-.195-.63-.194-.4 0-.643.209a.7.7 0 0 0-.133.152c-.127.196-.3.403-.534.403s-.432-.194-.367-.419q.11-.378.434-.641.494-.403 1.257-.403.513 0 .897.182.387.183.604.502.217.315.217.714 0 .315-.13.585-.125.27-.395.555a9 9 0 0 1-.695.635l-.927.798a.023.023 0 0 0 .016.041h1.895a.357.357 0 1 1 0 .715z",Rl=({className:t})=>vl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:vl("path",{d:z1,fill:"currentColor"})});var Il=[Z([{ChildComponent:Rl,isActive:({selection:t})=>J1(t)||K1(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(X1,"superscript")},order:6}])],Z1=A({enableFormats:["superscript"],toolbarFixed:{groups:Il},toolbarInline:{groups:Il}});import{$isTableSelection as q1}from"@lexical/table";import{$isRangeSelection as Q1,FORMAT_TEXT_COMMAND as em}from"lexical";import{jsx as Ml}from"react/jsx-runtime";import"react";var Y1="M9 7.5a.5.5 0 0 0-1 0V12a4 4 0 0 0 8 0V7.5a.5.5 0 0 0-1 0V12a3 3 0 1 1-6 0zM16.5 19a.5.5 0 0 0 0-1h-9a.5.5 0 0 0 0 1z",Al=({className:t})=>Ml("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ml("path",{clipRule:"evenodd",d:Y1,fill:"currentColor",fillRule:"evenodd"})});var $l=[Z([{ChildComponent:Al,isActive:({selection:t})=>Q1(t)||q1(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(em,"underline")},order:3}])],tm=A({enableFormats:["underline"],toolbarFixed:{groups:$l},toolbarInline:{groups:$l}});import{jsx as en}from"react/jsx-runtime";import{jsx as om}from"react/jsx-runtime";function nm(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var eo=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,n])=>[nm(o),n])):{};return om("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as rm}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as lm}from"@lexical/selection";import{$getNodeByKey as im,$getState as sm,$setState as am,createState as cm,TextNode as um}from"lexical";import{useEffect as dm}from"react";function Dl(t){let e=new Map;for(let o in t){let n=t[o],r=cm(o,{parse:l=>typeof l=="string"&&Object.keys(n).includes(l)?l:void 0});e.set(o,{stateConfig:r,stateValues:n})}return e}function Qo(t,e,o,n){t.update(()=>{lm(r=>{let l=e.get(o);if(!l)throw new Error(`State config for ${o} not found`);am(r,l.stateConfig,n)})})}function Ol({stateMap:t}){let[e]=rm();return dm(()=>e.registerMutationListener(um,o=>{e.getEditorState().read(()=>{for(let[n,r]of o){if(r==="destroyed")continue;let l=im(n),s=e.getElementByKey(n);if(!l||!s)continue;let i=Object.create(null);t.forEach((u,d)=>{let c=sm(l,u.stateConfig);if(!c){delete s.dataset[d];return}s.dataset[d]=c;let a=u.stateValues[c]?.css;a&&Object.assign(i,a)}),s.style.cssText="",Object.assign(s.style,i)}})}),[e]),null}var Fl=(t,e)=>{let o=[];for(let r in t.state){let l=t.state[r];for(let s in l){let i=l[s];o.push({ChildComponent:()=>en(eo,{css:i.css}),key:s,label:i.label,onSelect:({editor:u})=>{Qo(u,e,r,s)}})}}return[{type:"dropdown",ChildComponent:()=>en(eo,{css:{color:"var(--color-icon-secondary)"}}),items:[...[{ChildComponent:()=>en(eo,{}),key:"clear-style",label:({i18n:r})=>r.t("lexical:textState:defaultStyle"),onSelect:({editor:r})=>{for(let l in t.state)Qo(r,e,l,void 0)},order:1}],...o],key:"textState",order:30}]},mm=A(({props:t})=>{let e=Dl(t.state);return{plugins:[{Component:()=>Ol({stateMap:e}),position:"normal"}],toolbarFixed:{groups:Fl(t,e)},toolbarInline:{groups:Fl(t,e)}}});import{c as km}from"react/compiler-runtime";import{useLexicalComposerContext as _m}from"@lexical/react/LexicalComposerContext";import{$createHeadingNode as Tm,$isHeadingNode as Yl,HeadingNode as ei}from"@lexical/rich-text";import{$setBlocksType as wm}from"@lexical/selection";import{$getSelection as Em,$isRangeSelection as Sm}from"lexical";import{useEffect as Nm}from"react";import{jsx as Pl}from"react/jsx-runtime";import"react";var pm="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7zm11 6a.5.5 0 0 0-.777-.416l-1.5 1a.5.5 0 1 0 .554.832l.723-.482V17.5a.5.5 0 0 0 1 0z",Bl=({className:t})=>Pl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Pl("path",{d:pm,fill:"currentColor"})});import{jsx as jl}from"react/jsx-runtime";import"react";var fm="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7zm9.034 10.952c0 .303.245.548.548.548h2.97a.448.448 0 0 0 0-.896H17.48v-.04l.997-1.038q.562-.555.873-.945.314-.39.438-.711t.124-.653q0-.497-.245-.885a1.7 1.7 0 0 0-.684-.61A2.24 2.24 0 0 0 17.96 12a2.2 2.2 0 0 0-1.017.228 1.71 1.71 0 0 0-.888 1.13c-.064.268.168.495.444.495.275 0 .479-.236.595-.485l.019-.039q.12-.22.333-.338a1 1 0 0 1 .5-.121q.278 0 .495.11a.83.83 0 0 1 .341.312.9.9 0 0 1 .125.48q0 .245-.096.462t-.288.448-.48.529l-1.85 1.854a.55.55 0 0 0-.16.387",Hl=({className:t})=>jl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:jl("path",{d:fm,fill:"currentColor"})});import{jsx as Gl}from"react/jsx-runtime";import"react";var hm="M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",Ul=({className:t})=>Gl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Gl("path",{d:hm,fill:"currentColor"})});import{jsx as Vl}from"react/jsx-runtime";import"react";var gm="M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",Wl=({className:t})=>Vl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Vl("path",{d:gm,fill:"currentColor"})});import{jsx as zl}from"react/jsx-runtime";import"react";var xm="M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z",Kl=({className:t})=>zl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:zl("path",{d:xm,fill:"currentColor"})});import{jsx as Jl}from"react/jsx-runtime";import"react";var Cm="M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z",Xl=({className:t})=>Jl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Jl("path",{d:Cm,fill:"currentColor"})});import{HEADING as bm}from"@lexical/markdown";var Zl=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`;return{...bm,regExp:new RegExp(o)}};var ql=t=>{let e=Em();wm(e,()=>Tm(t))},Ql={h1:Bl,h2:Hl,h3:Ul,h4:Wl,h5:Kl,h6:Xl},Lm=A(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[te(e.map((n,r)=>({ChildComponent:Ql[n],isActive:({selection:l})=>{if(!Sm(l))return!1;for(let s of l.getNodes()){if(Yl(s)&&s.getTag()===n)continue;let i=s.getParent();if(!(Yl(i)&&i.getTag()===n))return!1}return!0},key:n,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:n.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{ql(n)})},order:r+2})))];return{markdownTransformers:[Zl(e)],nodes:[ei],plugins:[{Component:ym,position:"normal"}],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[X(e.map(n=>({Icon:Ql[n],key:`heading-${n.charAt(1)}`,keywords:["heading",n],label:({i18n:r})=>r.t("lexical:heading:label",{headingLevel:n.charAt(1)}),onSelect:({editor:r})=>{r.update(()=>{ql(n)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}}),ym=t=>{let e=km(9),{clientProps:o}=t,{enabledHeadingSizes:n}=o,r;e[0]!==n?(r=n===void 0?["h1","h2","h3","h4","h5","h6"]:n,e[0]=n,e[1]=r):r=e[1];let l=r,s;e[2]!==l?(s=l.at(-1),e[2]=l,e[3]=s):s=e[3];let i=s,[u]=_m(),d,c;return e[4]!==u||e[5]!==l||e[6]!==i?(d=()=>{if(!(!i||l.length===6))return u.registerNodeTransform(ei,a=>{l.includes(a.getTag())||a.setTag(i)})},c=[u,l,i],e[4]=u,e[5]=l,e[6]=i,e[7]=d,e[8]=c):(d=e[7],c=e[8]),Nm(d,c),null};import{$isNodeSelection as zm}from"lexical";import{jsx as ti}from"react/jsx-runtime";import"react";var vm="M18 12a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1 0-1h11a.5.5 0 0 1 .5.5",tn=({className:t})=>ti("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ti("path",{d:vm,fill:"currentColor"})});import{jsx as oi}from"react/jsx-runtime";import"react";var Rm={16:"M8.5 3.5a.5.5 0 0 0-1 0v4h-4a.5.5 0 0 0 0 1h4v4a.5.5 0 0 0 1 0v-4h4a.5.5 0 0 0 0-1h-4z",24:"M12 6a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 12 6"},ni=({className:t,size:e=24})=>oi("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:oi("path",{clipRule:"evenodd",d:Rm[e],fill:"currentColor",fillRule:"evenodd"})});var _e=t=>({type:"dropdown",ChildComponent:ni,items:t,key:"add",order:10});import{addClassNamesToElement as Im}from"@lexical/utils";import{$applyNodeReplacement as Mm,createCommand as Am,DecoratorNode as $m}from"lexical";var Lt=Am("INSERT_HORIZONTAL_RULE_COMMAND"),Nt=class extends $m{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:Dm,priority:0})}}static importJSON(e){return ri()}createDOM(e){let o=document.createElement("hr");return Im(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return`
55
- `}isInline(){return!1}updateDOM(){return!1}};function Dm(){return{node:ri()}}function ri(){return Mm(new Nt)}import{$applyNodeReplacement as Om}from"lexical";import"react";var Te=class extends Nt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return ot()}decorate(){return null}exportJSON(){return super.exportJSON()}};function ot(){return Om(new Te)}function Ge(t){return t instanceof Te}var li={type:"element",dependencies:[Te],export:(t,e)=>Ge(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=ot();e&&t.replace(e)}};import{c as Fm}from"react/compiler-runtime";import{useLexicalComposerContext as Pm}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as ii,$insertNodeToNearestRoot as Bm}from"@lexical/utils";import{$getRoot as jm,$getSelection as si,$isRangeSelection as ai,$isRootOrShadowRoot as ci,COMMAND_PRIORITY_EDITOR as Hm}from"lexical";import{useEffect as Gm}from"react";var on="LexicalEditorTheme__hrSelected",ui=()=>{let t=Fm(3),[e]=Pm(),o,n;return t[0]!==e?(o=()=>{let r=e.registerCommand(Lt,Um,Hm),l=e.registerUpdateListener(s=>{let{editorState:i}=s;i.read(()=>{let d=jm().getChildren(),c=si(),a=[];for(let b=0;b<d.length;b++){let x=d[b];if(Ge(x)){let C=e.getElementByKey(x.getKey());C&&a.push({element:C,index:b})}}if(a.length===0)return;if(!ai(c)||c.isCollapsed()){for(let{element:b}of a)b.classList.remove(on);return}let m=c.anchor.getNode(),p=c.focus.getNode(),h=ii(m,Vm)||m,f=ii(p,Wm)||p,g=d.indexOf(h),_=d.indexOf(f);if(g===-1||_===-1)return;let E=Math.min(g,_),R=Math.max(g,_);for(let{element:b,index:x}of a)x>=E&&x<=R?b.classList.add(on):b.classList.remove(on)})});return()=>{r(),l()}},n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Gm(o,n),null};function Um(t){let e=si();if(!ai(e))return!1;if(e.focus.getNode()!==null){let n=ot();Bm(n)}return!0}function Vm(t){return ci(t.getParent())}function Wm(t){return ci(t.getParent())}var Km=A({markdownTransformers:[li],nodes:[Te],plugins:[{Component:ui,position:"normal"}],slashMenu:{groups:[X([{Icon:tn,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(Lt,void 0)}}])]},toolbarFixed:{groups:[_e([{ChildComponent:tn,isActive:({selection:t})=>{if(!zm(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Ge(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(Lt,void 0)}}])]}});import{$findMatchingParent as _i}from"@lexical/utils";import{$isElementNode as ip,INDENT_CONTENT_COMMAND as sp,OUTDENT_CONTENT_COMMAND as ap}from"lexical";import{jsx as nn}from"react/jsx-runtime";import"react";var Jm="M7.854 6.146a.5.5 0 1 0-.708.708L8.293 8H5.5a.5.5 0 0 0 0 1h2.793l-1.147 1.146a.5.5 0 0 0 .708.708l2-2a.5.5 0 0 0 0-.708zM11.5 8a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zM5 12.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",di=({className:t})=>nn("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:nn("g",{transform:"scale(-1, 1) translate(-24, 0)",children:nn("path",{clipRule:"evenodd",d:Jm,fill:"currentColor",fillRule:"evenodd"})})});import{jsx as mi}from"react/jsx-runtime";import"react";var Xm="M7.854 6.146a.5.5 0 1 0-.708.708L8.293 8H5.5a.5.5 0 0 0 0 1h2.793l-1.147 1.146a.5.5 0 0 0 .708.708l2-2a.5.5 0 0 0 0-.708zM11.5 8a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zM5 12.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",pi=({className:t})=>mi("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:mi("path",{clipRule:"evenodd",d:Xm,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Zm}from"react/jsx-runtime";import{useLexicalComposerContext as Ym}from"@lexical/react/LexicalComposerContext";import{TabIndentationPlugin as qm}from"@lexical/react/LexicalTabIndentationPlugin";import{$findMatchingParent as Qm,mergeRegister as fi}from"@lexical/utils";import{$getSelection as ep,$isElementNode as Ci,$isRangeSelection as tp,COMMAND_PRIORITY_LOW as hi,INDENT_CONTENT_COMMAND as gi,KEY_TAB_COMMAND as op,OUTDENT_CONTENT_COMMAND as np,TabNode as rp}from"lexical";import{useEffect as xi}from"react";var bi=({clientProps:t})=>{let[e]=Ym(),{disabledNodes:o,disableTabNode:n}=t;return xi(()=>{if(!(!e||!o?.length))return fi(e.registerCommand(gi,()=>lp(r=>{if(!o.includes(r.getType())){let l=r.getIndent();r.setIndent(l+1)}}),hi),e.registerUpdateListener(({dirtyElements:r,editorState:l})=>{e.update(()=>{for(let[s]of r){let i=l._nodeMap.get(s);Ci(i)&&o.includes(i.getType())&&i.getIndent()>0&&i.setIndent(0)}})}))},[e,o]),xi(()=>{if(!(!e||!n))return fi(e.registerCommand(op,r=>(r.preventDefault(),e.dispatchCommand(r.shiftKey?np:gi,void 0)),hi),e.registerNodeTransform(rp,r=>{r.remove()}))},[e,n]),Zm(qm,{})};function lp(t){let e=ep();if(!tp(e))return!1;let o=new Set,n=e.getNodes();for(let r=0;r<n.length;r++){let l=n[r],s=l.getKey();if(o.has(s))continue;let i=Qm(l,d=>Ci(d)&&!d.isInline());if(i===null)continue;let u=i.getKey();i.canIndent()&&!o.has(u)&&(o.add(u),t(i))}return o.size>0}var ki=t=>({type:"buttons",items:t,key:"indent",order:35});var Ti=({disabledNodes:t})=>[ki([{ChildComponent:di,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],n=r=>wi(r)&&r.getIndent()>0;return o.some(r=>n(r)||!!_i(r,n))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(ap,void 0)},order:1},{ChildComponent:pi,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],n=r=>wi(r)&&!(t??[]).includes(r.getType());return o.some(r=>n(r)||!!_i(r,n))},key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(sp,void 0)},order:2}])],cp=A(({props:t})=>{let e=t.disabledNodes??[];return{plugins:[{Component:bi,position:"normal"}],sanitizedClientFeatureProps:t,toolbarFixed:{groups:Ti({disabledNodes:e})},toolbarInline:{groups:Ti({disabledNodes:e})}}}),wi=t=>ip(t)&&t.canIndent();import{$findMatchingParent as Lf}from"@lexical/utils";import{$getSelection as hn,$isRangeSelection as rs}from"lexical";import{jsx as Ei}from"react/jsx-runtime";import"react";var up={16:"M8.38 6.381a.29.29 0 0 1 .347-.056q.293.161.541.408a2.5 2.5 0 0 1 0 3.535l-2 2a2.5 2.5 0 0 1-3.535-3.535l.571-.573c.25-.249.692-.107.81.224a.46.46 0 0 1-.098.478l-.576.578a1.5 1.5 0 1 0 2.121 2.12l2-2a1.5 1.5 0 0 0 0-2.12c-.23-.23-.493-.509-.358-.805a.9.9 0 0 1 .178-.254m.352-2.648a2.5 2.5 0 1 1 3.535 3.535l-.471.47c-.253.254-.717.082-.819-.261a.44.44 0 0 1 .102-.435l.481-.481A1.5 1.5 0 0 0 9.44 4.44l-2 2a1.5 1.5 0 0 0 0 2.12c.136.138.168.365.031.502l-.182.181c-.154.154-.403.179-.557.025a2.5 2.5 0 0 1 0-3.535z",24:"M12.4436 10.3708C12.6861 10.5041 12.9148 10.6721 13.1204 10.8776C14.2919 12.0492 14.2918 13.9482 13.1204 15.1198L11.1204 17.1198C9.94879 18.2914 8.04975 18.2914 6.87817 17.1198C5.70664 15.9482 5.70661 14.0492 6.87817 12.8776L8.1477 11.6071C8.4098 11.345 8.89329 11.5392 8.97388 11.9011C9.00617 12.0462 8.96861 12.2012 8.86353 12.3063L7.5852 13.5847C6.80417 14.3657 6.80419 15.6317 7.5852 16.4128C8.36625 17.1938 9.63228 17.1938 10.4133 16.4128L12.4133 14.4128C13.1942 13.6317 13.1943 12.3657 12.4133 11.5847C12.4042 11.5755 12.3953 11.5662 12.386 11.5573C12.2925 11.468 12.1984 11.3736 12.1614 11.2497C12.0724 10.9515 12.1448 10.6149 12.3801 10.3796C12.397 10.3628 12.4228 10.3594 12.4436 10.3708ZM12.8782 6.87764C14.0497 5.70615 15.9488 5.70616 17.1204 6.87764C18.2919 8.04919 18.2919 9.94825 17.1204 11.1198L15.8508 12.3903C15.5887 12.6522 15.1053 12.4581 15.0247 12.0964C14.9924 11.9512 15.0308 11.7963 15.136 11.6911L16.4133 10.4128C17.1943 9.63175 17.1943 8.3657 16.4133 7.58467C15.6323 6.80371 14.3662 6.8037 13.5852 7.58467L11.5852 9.58467C10.8046 10.3657 10.8044 11.6319 11.5852 12.4128C11.5943 12.4219 11.6042 12.4303 11.6135 12.4392C11.7064 12.5278 11.7999 12.622 11.8372 12.7448C11.9276 13.044 11.8545 13.3827 11.6184 13.6188C11.6023 13.6347 11.5778 13.6383 11.5579 13.6276C11.3146 13.4942 11.0843 13.3259 10.8782 13.1198C9.7068 11.9484 9.707 10.0492 10.8782 8.87764L12.8782 6.87764Z"},to=({className:t,size:e=24})=>Ei("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ei("path",{d:up[e],fill:"currentColor"})});import{$isAtNodeEnd as Si}from"@lexical/selection";function nt(t){let{anchor:e}=t,{focus:o}=t,n=t.anchor.getNode(),r=t.focus.getNode();return n===r?n:t.isBackward()?Si(o)?n:r:Si(e)?n:r}var rn=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as wp}from"lexical";function ln(t){let e=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z\d+/]+=*$/i;return t=String(t).trim(),t.match(e)!=null||t.match(o)!=null?t:"https://"}var dp=/^(?:[a-zA-Z][a-zA-Z\d+.-]*:(?:\/\/)?(?:[-;:&=+$,\w]+@)?[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|www\.[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|(?:tel|mailto):[\w+.-]+)(?:\/[+~%/\w-]*)?(?:\?[-;&=%\w]*)?(?:#\w+)?$/,mp=/^(?:\/[\w\-./]*(?:\?[-;&=%\w]*)?(?:#[\w-]+)?|#[\w\-]+)$/;function Ni(t){if(!t||t.includes(" ")||/^[a-z][a-z\d+.-]*:\/[^/]/i.test(t))return!1;if(t==="https://"||dp.test(t)||mp.test(t))return!0;try{let e=new URL(t);return!(["ftp:","http:","https:"].includes(e.protocol)&&!e.hostname.includes("."))}catch{}return!1}import{addClassNamesToElement as pp,isHTMLAnchorElement as fp}from"@lexical/utils";import cn from"bson-objectid";import{$applyNodeReplacement as hp,$createTextNode as Li,$getSelection as gp,$isElementNode as yi,$isRangeSelection as an,createCommand as xp,ElementNode as Cp}from"lexical";var bp=new Set(["http:","https:","mailto:","sms:","tel:"]),oe=class extends Cp{__fields;__id;constructor({id:e,fields:o={linkType:"custom",newTab:!1},key:n}){super(n),this.__fields=o,this.__id=e}static clone(e){return new this({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:kp,priority:1})}}static importJSON(e){let o=we({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),e.version===2&&!e.id&&(e.id=new cn.default().toHexString(),e.version=3),o}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(e){let o=document.createElement("a");return this.__fields?.linkType==="custom"&&(o.href=this.sanitizeUrl(this.__fields.url??"")),(this.__fields?.newTab??!1)&&(o.target="_blank"),this.__fields?.newTab===!0&&this.__fields?.linkType==="custom"&&(o.rel=sn(o.rel,"add","noopener")),pp(o,e.theme.link),o}exportJSON(){let e=this.getFields();e?.linkType==="internal"?delete e.url:e?.linkType==="custom"&&delete e.doc;let o={...super.exportJSON(),type:"link",fields:e,version:3},n=this.getID();return n&&(o.id=n),o}extractWithChild(e,o,n){if(!an(o))return!1;let r=o.anchor.getNode(),l=o.focus.getNode();return this.isParentOf(r)&&this.isParentOf(l)&&o.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e,o=!0){let n=this.getParentOrThrow().insertNewAfter(e,o);if(yi(n)){let r=we({fields:this.__fields});return n.append(r),r}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!bp.has(o.protocol))return"about:blank"}catch{return"https://"}return e}setFields(e){let o=this.getWritable();return o.__fields=e,o}setID(e){let o=this.getWritable();return o.__id=e,o}updateDOM(e,o,n){let r=this.__fields?.url,l=this.__fields?.newTab;return r!=null&&r!==e.__fields?.url&&this.__fields?.linkType==="custom"&&(o.href=r),this.__fields?.linkType==="internal"&&e.__fields?.linkType==="custom"&&o.removeAttribute("href"),o.rel==null&&(o.rel=""),l!==e.__fields?.newTab&&(l??!1?(o.target="_blank",this.__fields?.linkType==="custom"&&(o.rel=sn(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=sn(o.rel,"remove","noopener"))),!1}updateFromJSON(e){let o=e;return super.updateFromJSON(o).setFields(o.fields).setID(o.id)}};function kp(t){let e=null;if(fp(t)){let o=t.textContent;o!==null&&o!==""&&(e=we({id:new cn.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function we({id:t,fields:e}){return hp(new oe({id:t??new cn.default().toHexString(),fields:e}))}function K(t){return t instanceof oe}var pe=xp("TOGGLE_LINK_COMMAND");function un(t){let e=gp();if(!an(e)&&(t===null||!t.selectedNodes?.length))return;let o=an(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(l=>{let s=l.getParent();K(s)&&(s.getChildren().forEach(u=>{s.insertBefore(u)}),s.remove())});return}if(o?.length===1){let l=o[0],s=K(l)?l:_p(l);if(s!==null){s.setFields(t.fields),t.text!=null&&t.text!==s.getTextContent()&&(s.append(Li(t.text)),s.getChildren().forEach(i=>{i!==s.getLastChild()&&i.remove()}));return}}let n=null,r=null;o?.forEach(l=>{let s=l.getParent();if(!(s===r||s===null||yi(l)&&!l.isInline())){if(K(s)){r=s,s.setFields(t.fields),t.text!=null&&t.text!==s.getTextContent()&&(s.append(Li(t.text)),s.getChildren().forEach(i=>{i!==s.getLastChild()&&i.remove()}));return}if(s.is(n)||(n=s,r=we({fields:t.fields}),K(s)?l.getPreviousSibling()===null?s.insertBefore(r):s.insertAfter(r):l.insertBefore(r)),K(l)){if(l.is(r))return;if(r!==null){let i=l.getChildren();r.append(...i)}l.remove();return}r!==null&&r.append(l)}})}function _p(t){return Tp(t,e=>K(e))}function Tp(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function sn(t,e,o){let n,r=`${t}`;if(e==="add"){if(r.includes(o)){let l=new RegExp(o,"g");r=r.replace(l,"").trim()}r=r.trim(),n=r.length===0?`${o}`:`${r} ${o}`}else{let l=new RegExp(o,"g");n=r.replace(l,"").trim()}return n}var Ep=(t,e)=>{let[,o,n]=e,r=we({fields:{doc:null,linkType:"custom",newTab:!1,url:n}}),l=wp(o);return l.setFormat(t.getFormat()),r.append(l),t.replace(r),l},Sp=t=>({type:"text-match",dependencies:[oe],export:(e,o)=>{if(!K(e))return null;let n=e,r=n.getFields(),l;return r.linkType==="internal"?t?.internalDocToHref?l=ln(t.internalDocToHref({linkNode:n.exportJSON()})):(console.warn("Lexical \u2192 Markdown converter: found internal link but internalDocToHref is not provided \u2014 link will have an empty href"),l=""):l=ln(r.url??""),`[${o(n)}](${l})`},importRegExp:/(?<!!)\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/(?<!!)\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:Ep,trigger:")"}),vi=Sp();import{$applyNodeReplacement as Np,$isElementNode as Lp}from"lexical";var Ee=class extends oe{static clone(e){return new this({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){let o=yt({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),o}exportJSON(){let e=super.exportJSON();return{type:"autolink",children:e.children,direction:e.direction,fields:e.fields,format:e.format,indent:e.indent,version:2}}insertNewAfter(e,o=!0){let n=this.getParentOrThrow().insertNewAfter(e,o);if(Lp(n)){let r=yt({fields:this.__fields});return n.append(r),r}return null}updateFromJSON(e){let o=e;return super.updateFromJSON(o).setFields(o.fields)}};function yt({fields:t}){return Np(new Ee({id:"",fields:t}))}function Se(t){return t instanceof Ee}import{c as yp}from"react/compiler-runtime";import{useLexicalComposerContext as vp}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Rp}from"@lexical/utils";import{$createTextNode as Ri,$getSelection as Ip,$isElementNode as Mi,$isLineBreakNode as Ai,$isNodeSelection as Mp,$isRangeSelection as Ap,$isTextNode as vt,TextNode as $p}from"lexical";import{useEffect as Dp}from"react";function Ii(t,e=o=>o){return o=>{let n=t.exec(o);return n===null?null:{index:n.index,length:n[0].length,text:n[0],url:e(n[0])}}}function $i(t,e){for(let o of e){let n=o(t);if(n!=null)return n}return null}var Op=/[.,;\s]/;function no(t){return t!==void 0&&Op.test(t)}function Di(t){return no(t[t.length-1])}function mn(t){return no(t[0])}function Fp(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function Oi(t){let e=t.getPreviousSibling();return Mi(e)&&(e=e.getLastDescendant()),e===null||Ai(e)||vt(e)&&Di(e.getTextContent())}function Fi(t){let e=t.getNextSibling();return Mi(e)&&(e=e.getFirstDescendant()),e===null||Ai(e)||vt(e)&&mn(e.getTextContent())}function Pp(t,e,o,n){return(t>0?no(o[t-1]):Oi(n[0]))?e<o.length?no(o[e]):Fi(n[n.length-1]):!1}function Bp(t,e,o){let n=[],r=[],l=[],s=0,i=0,u=[...t];for(;u.length>0;){let d=u[0],a=d.getTextContent().length,m=i;i+a<=e?(n.push(d),s+=a):m>=o?l.push(d):r.push(d),i+=a,u.shift()}return[s,n,r,l]}function jp(t,e,o,n){let r={linkType:"custom",url:n.url,...n.fields},l=yt({fields:r});if(t.length===1){let s=t[0],i;if(e===0?[i]=s.splitText(o):[,i]=s.splitText(e,o),i){let u=Ri(n.text);u.setFormat(i.getFormat()),u.setDetail(i.getDetail()),u.setStyle(i.getStyle()),l.append(u),i.replace(l)}return s}else if(t.length>1){let s=t[0],i=s.getTextContent().length,u;e===0?u=s:[,u]=s.splitText(e);let d=[],c;if(t.forEach(a=>{let p=a.getTextContent().length,h=i,f=i+p;if(h<o)if(f<=o)d.push(a);else{let[g,_]=a.splitText(o-h);g&&d.push(g),c=_}i+=p}),u){let a=Ip(),m=a?a.getNodes().find(vt):void 0,p=Ri(u.getTextContent());return p.setFormat(u.getFormat()),p.setDetail(u.getDetail()),p.setStyle(u.getStyle()),l.append(p,...d),m&&m===u&&(Ap(a)?p.select(a.anchor.offset,a.focus.offset):Mp(a)&&p.select(0,p.getTextContent().length)),u.replace(l),c}}}function Hp(t,e,o){let n=[...t],r=n.map(u=>u.getTextContent()).join(""),l=r,s,i=0;for(;(s=$i(l,e))!=null&&s!==null;){let u=s.index,d=s.length,c=u+d;if(Pp(i+u,i+c,r,n)){let[m,,p,h]=Bp(n,i+u,i+c),f=i+u-m,g=i+c-m,_=jp(p,f,g,s);n=_?[_,...h]:h,o(s.url,null),i=0}else i+=c;l=l.substring(c)}}function dn(t,e,o){let n=t.getChildren(),r=n.length;for(let u=0;u<r;u++){let d=n[u];if(!vt(d)||!d.isSimpleText()){oo(t),o(null,t.getFields()?.url??null);return}}let l=t.getTextContent(),s=$i(l,e);if(s===null||s.text!==l){oo(t),o(null,t.getFields()?.url??null);return}if(!Oi(t)||!Fi(t)){oo(t),o(null,t.getFields()?.url??null);return}let i=t.getFields()?.url;if(i!==s?.url){let u=t.getFields();u.url=s?.url,t.setFields(u),o(s.url,i??null)}}function Gp(t,e,o){let n=t.getPreviousSibling(),r=t.getNextSibling(),l=t.getTextContent();if(Se(n)){let s=n.getFields()?.url?n.getFields()?.url?.startsWith("mailto:")??!1:!1;(!mn(l)||Fp(l,s))&&(n.append(t),dn(n,e,o),o(null,n.getFields()?.url??null))}Se(r)&&!Di(l)&&(oo(r),dn(r,e,o),o(null,r.getFields()?.url??null))}function oo(t){let e=t.getChildren(),o=e.length;for(let n=o-1;n>=0;n--)t.insertAfter(e[n]);return t.remove(),e.map(n=>n.getLatest())}function Up(t){let e=[t],o=t.getNextSibling();for(;o!==null&&vt(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function Vp(t,e,o){let n=yp(5),r,l;n[0]!==t||n[1]!==e||n[2]!==o?(r=()=>{if(!t.hasNodes([Ee]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let s=(i,u)=>{o?.(i,u)};return Rp(t.registerNodeTransform($p,i=>{let u=i.getParentOrThrow(),d=i.getPreviousSibling();if(Se(u))dn(u,e,s);else if(!K(u)){if(i.isSimpleText()&&(mn(i.getTextContent())||!Se(d))){let c=Up(i);Hp(c,e,s)}Gp(i,e,s)}}))},l=[t,e,o],n[0]=t,n[1]=e,n[2]=o,n[3]=r,n[4]=l):(r=n[3],l=n[4]),Dp(r,l)}var Wp=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,zp=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,Kp=[Ii(Wp,t=>t.startsWith("http")?t:`https://${t}`),Ii(zp,t=>`mailto:${t}`)],Pi=()=>{let[t]=vp();return Vp(t,Kp),null};import{jsx as Jp}from"react/jsx-runtime";import{ClickableLinkPlugin as Xp}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var Bi=()=>Jp(Xp,{});import{jsx as gf}from"react/jsx-runtime";import"react";import{createPortal as xf}from"react-dom";import{jsx as ne,jsxs as Ue,Fragment as pn}from"react/jsx-runtime";import{useLexicalComposerContext as qp}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as Qp}from"@lexical/react/useLexicalEditable";import{$findMatchingParent as Wi,mergeRegister as zi}from"@lexical/utils";import{getTranslation as fn}from"@payloadcms/translations";import{formatDrawerSlug as ef,NewTabIcon as Ki,useConfig as tf,useEditDepth as of,useLocale as nf,useTranslation as rf,WriteIcon as lf}from"@payloadcms/ui";import{requests as sf}from"@payloadcms/ui/shared";import{$getSelection as Ji,$isLineBreakNode as af,$isRangeSelection as Xi,COMMAND_PRIORITY_HIGH as cf,COMMAND_PRIORITY_LOW as Zi,getDOMSelection as uf,KEY_ESCAPE_COMMAND as df,SELECTION_CHANGE_COMMAND as mf}from"lexical";import{formatAdminURL as pf}from"payload/shared";import ff,{useCallback as Yi,useEffect as io,useLayoutEffect as hf,useRef as qi,useState as Ve}from"react";import{jsx as ji}from"react/jsx-runtime";import"react";var Zp="M12.5 5C12.6326 5 12.7597 5.05272 12.8535 5.14648L16.8535 9.14648C16.9965 9.28948 17.0393 9.50457 16.9619 9.69141C16.8845 9.87821 16.7022 10 16.5 10H12.5C12.2239 10 12 9.77614 12 9.5V6H8.5C8.22386 6 8 6.22386 8 6.5V17.5C8 17.7761 8.22386 18 8.5 18H15.5C15.7761 18 16 17.7761 16 17.5V11.5C16 11.2239 16.2239 11 16.5 11C16.7761 11 17 11.2239 17 11.5V17.5C17 18.3284 16.3284 19 15.5 19H8.5C7.67157 19 7 18.3284 7 17.5V6.5C7 5.67157 7.67157 5 8.5 5H12.5ZM13 9H15.293L13 6.70703V9Z",Hi=({className:t})=>ji("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ji("path",{d:Zp,fill:"currentColor"})});import{jsx as Gi}from"react/jsx-runtime";import"react";var Ui={default:"M6 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .496.5h12.008a.5.5 0 0 0 .496-.5v-1A.5.5 0 0 0 18 5zM4.5 6.5a1.5 1.5 0 0 0 1.037 1.427L5.725 10H5a.5.5 0 0 0 0 1h.816l.653 7.181A2 2 0 0 0 8.46 20h7.078a2 2 0 0 0 1.992-1.819L18.184 11H19a.5.5 0 0 0 0-1h-.725l.188-2.073A1.5 1.5 0 0 0 19.5 6.5v-1A1.5 1.5 0 0 0 18 4H6a1.5 1.5 0 0 0-1.5 1.5zm2.965 11.59L6.548 8h10.905l-.918 10.09a1 1 0 0 1-.996.91H8.461a1 1 0 0 1-.996-.91M11 10.5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0zm3 0a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z",small:"M6.5 7a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-.039l-.08 1H17a.5.5 0 0 1 0 1h-.7l-.455 5.62A1.5 1.5 0 0 1 14.35 18h-4.7a1.5 1.5 0 0 1-1.495-1.38L7.7 11H7a.5.5 0 0 1 0-1h.62l-.081-1H7.5a1 1 0 0 1-1-1zm9.494 1h.506V7h-9v1zm-.536 1H8.542l.61 7.54a.5.5 0 0 0 .498.46h4.7a.5.5 0 0 0 .499-.46zM11.5 11.5a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0zm2 0a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0z"},Vi=({className:t,small:e})=>Gi("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Gi("path",{clipRule:"evenodd",d:e?Ui.small:Ui.default,fill:"currentColor",fillRule:"evenodd"})});function ro(t,e,o,n=10,r=5){let l=o.parentElement;if(t===null||l==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let s=o.getBoundingClientRect(),i=l.getBoundingClientRect(),u=t.top-n,d=t.left-r;e.style.width="max-content",e.style.maxWidth="none";let c=e.scrollWidth,a=i.right-d,m=d-i.left,p;if(c<=a)p=e.getBoundingClientRect();else{let h=m+t.width,f=m>a,_=Math.min(c,f?h:a);_<c&&(e.style.width=`${_}px`,e.style.maxWidth=`${_}px`,e.offsetHeight),f&&(d=t.right-_),p=e.getBoundingClientRect()}u<i.top&&(u+=p.height+t.height+n*2),d+p.width>i.right&&(d=i.right-p.width-r),u-=s.top,d-=s.left,e.style.opacity="1",e.style.transform=`translate(${d}px, ${u}px)`}import{createCommand as Yp}from"lexical";var lo=Yp("TOGGLE_LINK_WITH_MODAL_COMMAND");function Qi(t){t.preventDefault()}function es({anchorElem:t}){let[e]=qp(),[o,n]=Ve(),r=qi(null),l=qi(null),[s,i]=Ve(null),[u,d]=Ve(null),{fieldProps:{schemaPath:c},uuid:a}=U(),m=Qp(),{config:p,getEntityConfig:h}=tf(),{i18n:f,t:g}=rf(),[_,E]=Ve(),R=of(),[b,x]=Ve(!1),[C,k]=Ve([]),T=nf(),[I,L]=Ve(!1),S=ef({slug:"lexical-rich-text-link-"+a,depth:R}),{toggleDrawer:N}=Oe(S),w=Yi(()=>{x(!1),r&&r.current&&(r.current.style.opacity="0",r.current.style.transform="translate(-10000px, -10000px)"),L(!1),i(null),d(null),k([]),E(void 0)},[x,i,d,k]),v=Yi(()=>{let y=Ji(),M;if(!Xi(y)||!y){w();return}let $=nt(y);M=e.getElementByKey($.getKey())?.getBoundingClientRect();let D=Wi($,K),F=y.getNodes().filter(le=>!af(le)).find(le=>{let Ce=Wi(le,K);return D&&!D.is(Ce)||Ce&&!Ce.is(D)});if(D==null||F){w();return}n(D);let P=D.getFields(),Y={...P,id:D.getID(),text:D.getTextContent()};if(P?.linkType==="custom")i(P?.url??null),d(null);else{i(`${p.routes.admin==="/"?"":p.routes.admin}/collections/${P?.doc?.relationTo}/${P?.doc?.value}`);let le=P?.doc?.relationTo?h({collectionSlug:P?.doc?.relationTo}):void 0;if(!le)d(P?.label?String(P?.label):null),i(P?.url?String(P?.url):null);else{let Ce=typeof P.doc?.value=="object"?P.doc.value.id:P.doc?.value,Ht=P.doc?.relationTo;if(!Ce||!Ht)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let lr=g("fields:linkedTo",{label:`${fn(le.labels.singular,f)} - ${g("lexical:link:loadingWithEllipsis",f)}`}).replace(/<[^>]*>?/g,"");d(lr),sf.get(pf({apiRoute:p.routes.api,path:`/${Ht}/${Ce}`,serverURL:p.serverURL}),{headers:{"Accept-Language":f.language},params:{depth:0,locale:T?.code}}).then(async Xe=>{if(!Xe.ok)throw new Error(`HTTP error! Status: ${Xe.status}`);let ft=await Xe.json(),ee=le?.admin?.useAsTitle||"id",ht=ft[ee],de=g("fields:linkedTo",{label:`${fn(le.labels.singular,f)} - ${ht}`}).replace(/<[^>]*>?/g,"");d(de)}).catch(()=>{let Xe=g("fields:linkedTo",{label:`${fn(le.labels.singular,f)} - ${g("general:untitled",f)} - ID: ${Ce}`}).replace(/<[^>]*>?/g,"");d(Xe)})}}E(Y),x(!0),k(y?y?.getNodes():[]),Se(D)?L(!0):L(!1);let J=r.current,Je=uf(e._window),{activeElement:Re}=document;if(J===null)return;let xe=e.getRootElement();return Je!==null&&xe!==null&&xe.contains(Je.anchorNode)?(M||(M=Je.getRangeAt(0).getBoundingClientRect()),M!=null&&(M.y+=40,l.current=M)):(Re==null||Re.className!=="link-input")&&(xe!==null&&ro(null,J,t),i(null),d(null)),!0},[e,w,p.routes.admin,p.routes.api,p.serverURL,h,g,f,T?.code,t]);return io(()=>zi(e.registerCommand(lo,y=>(e.dispatchCommand(pe,y),v(),N(),!0),Zi)),[e,v,N,S]),io(()=>{let y=t.parentElement,M=()=>{e.getEditorState().read(()=>{v()})};return window.addEventListener("resize",M),y?.addEventListener("scroll",M),()=>{window.removeEventListener("resize",M),y?.removeEventListener("scroll",M)}},[t.parentElement,e,v]),io(()=>zi(e.registerUpdateListener(({editorState:y})=>{y.read(()=>{v()})}),e.registerCommand(mf,()=>(v(),!0),Zi),e.registerCommand(df,()=>b?(w(),!0):!1,cf)),[e,v,b,w]),io(()=>{e.getEditorState().read(()=>{v()})},[e,v]),hf(()=>{!b||!r.current||!t||!l.current||ro(l.current,r.current,t)},[s,u,b,t,o]),Ue(ff.Fragment,{children:[ne("div",{className:"link-editor","data-theme":"dark",ref:r,children:Ue("div",{className:"link-input",children:[o?.__fields?.linkType==="custom"?ne(to,{}):ne(Hi,{}),s&&s.length>0?Ue("a",{className:"link-input__url",href:s,rel:"noopener noreferrer",target:"_blank",children:[u!=null&&u.length>0?u:s,o?.__fields.newTab?Ue(pn,{children:[ne(Ki,{size:16})," ",ne("div",{className:"link-input__divider"})," "]}):null]}):u!=null&&u.length>0?Ue(pn,{children:[ne("span",{className:"link-input__label-pure",children:u}),o?.__fields.newTab?Ue(pn,{children:[ne(Ki,{size:16})," ",ne("div",{className:"link-input__divider"})," "]}):null]}):null,m&&Ue("div",{className:"link-input__actions",children:[ne("button",{"aria-label":"Edit link",className:"link-edit",onClick:y=>{y.preventDefault(),N()},onMouseDown:Qi,tabIndex:0,type:"button",children:ne(lf,{})}),!I&&ne("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(pe,null)},onMouseDown:Qi,tabIndex:0,type:"button",children:ne(Vi,{small:!0})})]})]})}),ne(Oo,{className:"lexical-link-edit-drawer",data:_,drawerSlug:S,drawerTitle:g("fields:editLink"),featureKey:"link",handleDrawerSubmit:(y,M)=>{let $=M,D={...$};delete D.text,e.update(()=>{let F=Ji(),P=null;if(Xi(F)?P=nt(F).getParent():C.length&&(P=C[0]?.getParent()??null),P&&Se(P)){let Y=we({fields:D});P.replace(Y,!0)}}),e.dispatchCommand(pe,{fields:D,selectedNodes:C,text:$.text})},schemaPath:c,schemaPathSuffix:"fields"})]})}var ts=t=>{let{anchorElem:e=document.body}=t;return xf(gf(es,{anchorElem:e}),e)};import{c as Cf}from"react/compiler-runtime";import{useLexicalComposerContext as bf}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as kf}from"@lexical/utils";import{$getSelection as _f,$isElementNode as Tf,$isRangeSelection as wf,COMMAND_PRIORITY_LOW as os,PASTE_COMMAND as Ef}from"lexical";import{useEffect as Sf}from"react";var ns=t=>{let e=Cf(5),{clientProps:o}=t,[n]=bf(),r,l;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==n?(r=()=>{if(!n.hasNodes([oe]))throw new Error("LinkPlugin: LinkNode not registered on editor");return kf(n.registerCommand(pe,s=>s===null?(un(null),!0):(s.fields?.linkType||(s.fields.linkType=o.defaultLinkType),s.fields?.url||(s.fields.url=o.defaultLinkURL),un(s),!0),os),n.registerCommand(Ef,s=>{let i=_f();if(!wf(i)||i.isCollapsed()||!(s instanceof ClipboardEvent)||s.clipboardData==null)return!1;let u=s.clipboardData.getData("text");if(!Ni(u))return!1;if(!i.getNodes().some(Nf)){let d={doc:null,linkType:"custom",newTab:!1,url:u};return n.dispatchCommand(pe,{fields:d,text:null}),s.preventDefault(),!0}return!1},os))},l=[o.defaultLinkType,o.defaultLinkURL,n],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=n,e[3]=r,e[4]=l):(r=e[3],l=e[4]),Sf(r,l),null};function Nf(t){return Tf(t)}var ls=[rn([{ChildComponent:to,isActive:({selection:t})=>{if(rs(t)){let e=nt(t);return Lf(e,K)!=null}return!1},isEnabled:({selection:t})=>!!(rs(t)&&hn()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(pe,null);else{let o,n=[];if(t.getEditorState().read(()=>{o=hn()?.getTextContent(),n=hn()?.getNodes()??[]}),!o?.length)return;let r={doc:null};t.dispatchCommand(lo,{fields:r,selectedNodes:n,text:o})}},order:1}])],yf=A(({props:t})=>({markdownTransformers:[vi],nodes:[oe,t?.disableAutoLinks===!0?null:Ee].filter(Boolean),plugins:[{Component:ns,position:"normal"},t?.disableAutoLinks===!0||t?.disableAutoLinks==="creationOnly"?null:{Component:Pi,position:"normal"},{Component:Bi,position:"normal"},{Component:ts,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:ls},toolbarInline:{groups:ls}}));import{$isListNode as xn,INSERT_CHECK_LIST_COMMAND as cs,ListItemNode as $f,ListNode as Df}from"@lexical/list";import{CHECK_LIST as Of}from"@lexical/markdown";import{$isRangeSelection as Ff}from"lexical";import{jsx as is}from"react/jsx-runtime";import"react";var vf={16:"M5.584 8.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.076l-1-1a.5.5 0 1 1 .708-.707l.568.569zM13 10a.5.5 0 0 1 0 1H8a.5.5 0 0 1 0-1zM5.583 3.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.076l-1-1a.5.5 0 0 1 .708-.707l.568.569zM13 5a.5.5 0 1 1 0 1H8a.5.5 0 0 1 0-1z",24:"M9.084 15.223a.5.5 0 1 1 .832.554l-2 3a.5.5 0 0 1-.77.076l-1-1a.5.5 0 1 1 .708-.707l.568.569zM17.5 17a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1zm-8.416-6.777a.5.5 0 0 1 .832.554l-2 3a.5.5 0 0 1-.77.077l-1-1a.5.5 0 1 1 .708-.707l.568.568zM17.5 12a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1zM9.084 5.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.077l-1-1a.5.5 0 1 1 .708-.708l.568.569zM17.5 7a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1z"},gn=({className:t,size:e=24})=>is("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:is("path",{d:vf[e],fill:"currentColor"})});import{jsx as Rf}from"react/jsx-runtime";import{ListPlugin as If}from"@lexical/react/LexicalListPlugin.js";import"react";var rt=()=>Rf(If,{});function so(t,e){return t==="ordered"?!e.has("unorderedList"):t==="checklist"?!e.has("unorderedList")&&!e.has("orderedList"):!1}function lt(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{jsx as Mf}from"react/jsx-runtime";import{CheckListPlugin as Af}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var ss=()=>Mf(Af,{});var as=[te([{ChildComponent:gn,isActive:({selection:t})=>{if(!Ff(t))return!1;for(let e of t.getNodes()){if(xn(e)&&e.getListType()==="check")continue;let o=e.getParent();if(xn(o)&&o.getListType()==="check")continue;let n=o?.getParent();if(!(xn(n)&&n.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(cs,void 0)},order:12}])],Pf=A(({featureProviderMap:t})=>{let e=[{Component:ss,position:"normal"}],o=so("checklist",t);return o&&e.push({Component:rt,position:"normal"}),{markdownTransformers:[Of],nodes:o?[Df,$f]:[],plugins:e,slashMenu:{groups:[lt([{Icon:gn,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:n})=>n.t("lexical:checklist:label"),onSelect:({editor:n})=>{n.dispatchCommand(cs,void 0)}}])]},toolbarFixed:{groups:as},toolbarInline:{groups:as}}});import{$isListNode as bn,INSERT_ORDERED_LIST_COMMAND as ms,ListItemNode as jf,ListNode as Hf}from"@lexical/list";import{ORDERED_LIST as Gf}from"@lexical/markdown";import{$isRangeSelection as Uf}from"lexical";import{jsx as us}from"react/jsx-runtime";import"react";var Bf={16:"M5.6 9.01a.5.5 0 0 1 .4.49v1a.5.5 0 0 1-.276.447L4 11.81V12h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-1l.005-.07a.5.5 0 0 1 .271-.377L5 10.19V10H3.5a.5.5 0 0 1 0-1h2zM12.5 12a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1zm0-4.5a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1zM4.6 3.01a.5.5 0 0 1 .4.49v3a.5.5 0 0 1-1 0V4h-.5a.5.5 0 0 1 0-1h1zM12.5 3a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1z",24:"M11 7a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6A.5.5 0 0 1 11 7M6 7a.5.5 0 0 1 .5-.5h1A.5.5 0 0 1 8 7v3.5a.5.5 0 1 1-1 0v-3h-.5A.5.5 0 0 1 6 7m0 6.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.276.447L7 16.31v.191h1.5a.5.5 0 0 1 0 1h-2A.5.5 0 0 1 6 17v-1a.5.5 0 0 1 .276-.447L8 14.69V14H6.5a.5.5 0 0 1-.5-.5m5.5 3a.5.5 0 1 0 0 1h6a.5.5 0 0 0 0-1zm0-5a.5.5 0 1 0 0 1h6a.5.5 0 0 0 0-1z"},Cn=({className:t,size:e=24})=>us("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:us("path",{clipRule:"evenodd",d:Bf[e],fill:"currentColor",fillRule:"evenodd"})});var ds=[te([{ChildComponent:Cn,isActive:({selection:t})=>{if(!Uf(t))return!1;for(let e of t.getNodes()){if(bn(e)&&e.getListType()==="number")continue;let o=e.getParent();if(bn(o)&&o.getListType()==="number")continue;let n=o?.getParent();if(!(bn(n)&&n.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(ms,void 0)},order:10}])],Vf=A(({featureProviderMap:t})=>{let e=so("ordered",t);return{markdownTransformers:[Gf],nodes:e?[Hf,jf]:[],plugins:e?[{Component:rt,position:"normal"}]:[],slashMenu:{groups:[lt([{Icon:Cn,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:o})=>o.t("lexical:orderedList:label"),onSelect:({editor:o})=>{o.dispatchCommand(ms,void 0)}}])]},toolbarFixed:{groups:ds},toolbarInline:{groups:ds}}});import{$isListNode as _n,INSERT_UNORDERED_LIST_COMMAND as hs,ListItemNode as zf,ListNode as Kf}from"@lexical/list";import{UNORDERED_LIST as Jf}from"@lexical/markdown";import{$isRangeSelection as Xf}from"lexical";import{jsx as ps}from"react/jsx-runtime";import"react";var Wf="M7 16C7.55228 16 8 16.4477 8 17C8 17.5523 7.55228 18 7 18C6.44772 18 6 17.5523 6 17C6 16.4477 6.44772 16 7 16ZM17.5 16.5C17.7761 16.5 18 16.7239 18 17C18 17.2761 17.7761 17.5 17.5 17.5H10.5C10.2239 17.5 10 17.2761 10 17C10 16.7239 10.2239 16.5 10.5 16.5H17.5ZM7 11C7.55228 11 8 11.4477 8 12C8 12.5523 7.55228 13 7 13C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11ZM17.5 11.5C17.7761 11.5 18 11.7239 18 12C18 12.2761 17.7761 12.5 17.5 12.5H10.5C10.2239 12.5 10 12.2761 10 12C10 11.7239 10.2239 11.5 10.5 11.5H17.5ZM7 6C7.55228 6 8 6.44772 8 7C8 7.55228 7.55228 8 7 8C6.44772 8 6 7.55228 6 7C6 6.44772 6.44772 6 7 6ZM17.5 6.5C17.7761 6.5 18 6.72386 18 7C18 7.27614 17.7761 7.5 17.5 7.5H10.5C10.2239 7.5 10 7.27614 10 7C10 6.72386 10.2239 6.5 10.5 6.5H17.5Z",kn=({className:t})=>ps("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ps("path",{d:Wf,fill:"currentColor"})});var fs=[te([{ChildComponent:kn,isActive:({selection:t})=>{if(!Xf(t))return!1;for(let e of t.getNodes()){if(_n(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(_n(o)&&o.getListType()==="bullet")continue;let n=o?.getParent();if(!(_n(n)&&n.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(hs,void 0)},order:11}])],Zf=A({markdownTransformers:[Jf],nodes:[Kf,zf],plugins:[{Component:rt,position:"normal"}],slashMenu:{groups:[lt([{Icon:kn,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(hs,void 0)}}])]},toolbarFixed:{groups:fs},toolbarInline:{groups:fs}});import{$setBlocksType as Cs}from"@lexical/selection";import{$createParagraphNode as bs,$getSelection as ks,$isParagraphNode as gs,$isRangeSelection as Yf}from"lexical";var xs=[te([{ChildComponent:Tt,isActive:({selection:t})=>{if(!Yf(t))return!1;for(let e of t.getNodes())if(!gs(e)&&!gs(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=ks();Cs(e,()=>bs())})},order:1}])],qf=A({slashMenu:{groups:[X([{Icon:Tt,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=ks();Cs(e,()=>bs())})}}])]},toolbarFixed:{groups:xs},toolbarInline:{groups:xs}});import{c as _0}from"react/compiler-runtime";import{jsx as js}from"react/jsx-runtime";import{useLexicalComposerContext as T0}from"@lexical/react/LexicalComposerContext";import{useEffect as w0,useState as E0}from"react";import{jsx as Bs,Fragment as k0}from"react/jsx-runtime";import"react";import{jsx as Qf}from"react/jsx-runtime";var _s={quote:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Qf("blockquote",{children:o})}};import{jsx as e0}from"react/jsx-runtime";var Ts={heading:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=t.tag;return e0(n,{children:o})}};import{jsx as t0}from"react/jsx-runtime";var ws={horizontalrule:t0("hr",{})};import{jsx as o0}from"react/jsx-runtime";var Es={linebreak:o0("br",{})};import{jsx as Ss}from"react/jsx-runtime";var Ns=({internalDocToHref:t})=>({autolink:({node:e,nodesToJSX:o})=>{let n=o({nodes:e.children}),r=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0;return Ss("a",{href:e.fields.url,rel:r,target:l,children:n})},link:({node:e,nodesToJSX:o})=>{let n=o({nodes:e.children}),r=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0,s=e.fields.url??"";return e.fields.linkType==="internal"&&(t?s=t({linkNode:e}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),s="#")),Ss("a",{href:s,rel:r,target:l,children:n})}});import{jsx as it,jsxs as n0,Fragment as r0}from"react/jsx-runtime";import{v4 as l0}from"uuid";var Ls={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=t.tag;return it(n,{className:`list-${t?.listType}`,children:o})},listitem:({node:t,nodesToJSX:e,parent:o})=>{let n=t.children.some(l=>l.type==="list"),r=e({nodes:t.children});if("listType"in o&&o?.listType==="check"){let l=l0();return it("li",{"aria-checked":t.checked?"true":"false",className:`list-item-checkbox${t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${n?" nestedListItem":""}`,role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:t?.value,children:n?r:n0(r0,{children:[it("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),it("label",{htmlFor:l,children:r}),it("br",{})]})})}else return it("li",{className:`${n?"nestedListItem":""}`,style:n?{listStyleType:"none"}:void 0,value:t?.value,children:r})}};import{jsx as Tn}from"react/jsx-runtime";var ys={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?Tn("p",{children:o}):Tn("p",{children:Tn("br",{})})}};var vs={tab:" "};import{jsx as Rt}from"react/jsx-runtime";var Rs={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Rt("div",{className:"lexical-table-container",children:Rt("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:Rt("tbody",{children:o})})})},tablecell:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=t.headerState>0?"th":"td",r=`lexical-table-cell-header-${t.headerState}`,l={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},s=t.colSpan&&t.colSpan>1?t.colSpan:void 0,i=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return Rt(n,{className:`lexical-table-cell ${r}`,colSpan:s,rowSpan:i,style:l,children:o})},tablerow:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Rt("tr",{className:"lexical-table-row",children:o})}};import{jsx as We}from"react/jsx-runtime";import"react";var O={DOM_ELEMENT_TYPE:1,DOM_TEXT_TYPE:3,NO_DIRTY_NODES:0,HAS_DIRTY_NODES:1,FULL_RECONCILE:2,IS_NORMAL:0,IS_TOKEN:1,IS_SEGMENTED:2,IS_INERT:3,IS_BOLD:1,IS_ITALIC:2,IS_STRIKETHROUGH:4,IS_UNDERLINE:8,IS_CODE:16,IS_SUBSCRIPT:32,IS_SUPERSCRIPT:64,IS_HIGHLIGHT:128,IS_DIRECTIONLESS:1,IS_UNMERGEABLE:2,IS_ALIGN_LEFT:1,IS_ALIGN_CENTER:2,IS_ALIGN_RIGHT:3,IS_ALIGN_JUSTIFY:4,IS_ALIGN_START:5,IS_ALIGN_END:6},i0=O.IS_BOLD|O.IS_ITALIC|O.IS_STRIKETHROUGH|O.IS_UNDERLINE|O.IS_CODE|O.IS_SUBSCRIPT|O.IS_SUPERSCRIPT|O.IS_HIGHLIGHT,s0="\xA0",a0=`
54
+ `},[t,e]),m=Pe((x,b)=>{o(k=>{let _=e.length-1,T=e[_];if(T&&T.name===x){if(x==="type")return[...e.slice(0,_),{...T,value:T.value+b}];if(T.value===b)return[...e.slice(0,_),{...T,count:T.count+1}]}return[...k,{name:x,count:1,value:b}]})},[e,o]);wl(()=>{let x=k=>{if(!n)return;let _=k.key;Nm(k)?m("selectAll",""):Nl.has(_)?m("press",k.key):[..._].length>1?m("keydown",k.key):m("type",k.key)},b=k=>{if(!n)return;let _=k.key;!Nl.has(_)&&[..._].length>1&&m("keyup",k.key)};return t.registerRootListener((k,_)=>{_!==null&&(_.removeEventListener("keydown",x),_.removeEventListener("keyup",b)),k!==null&&(k.addEventListener("keydown",x),k.addEventListener("keyup",b))})},[t,n,m]),wl(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),an(()=>{if(e){let x=p();x!==null&&i(x),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,e]),an(()=>t.registerUpdateListener(({dirtyElements:b,dirtyLeaves:k,editorState:_})=>{if(!n)return;let T=_._selection,I=c.current,N=u.current;if(I!==T){if(k.size===0&&b.size===0&&!N){let y=sn(t._window);if(y&&(y.anchorNode==null||y.focusNode==null))return}c.current=T}u.current=!1;let w=p();w!==null&&i(w)}),[t,p,n,m]),an(()=>n?t.registerUpdateListener(()=>{let b=t.getRootElement();b!==null&&l(b?.innerHTML)}):void 0,[t,n]);let f=Pe(x=>{n||(x.update(()=>{let b=Tm();b.clear();let k=_m();b.append(km().append(k)),k.select()}),o([])),r(b=>!b)},[n]),h=Pe(()=>{if(!n)return;let x=sn(t._window);if(x===null||x.anchorNode==null||x.focusNode==null)return;let{anchorNode:b,anchorOffset:k,focusNode:_,focusOffset:T}=Lm(x),I=a().getRootElement(),N;b!==null&&(N=Sl(b,I));let w;_!==null&&(w=Sl(_,I)),m("snapshot",{anchorNode:b,anchorOffset:k,anchorPath:N,focusNode:_,focusOffset:T,focusPath:w})},[m,n,a]),g=Pe(()=>{Em(p())},[p]),C=Pe(()=>{wm("test.js",p())},[p]);return[Be("button",{className:`editor-dev-button ${n?"active":""}`,id:"test-recorder-button",onClick:x=>{f(a()),x.preventDefault()},title:n?"Disable test recorder":"Enable test recorder",type:"button",children:n?"Disable test recorder":"Enable test recorder"}),n?un("div",{className:"test-recorder-output",children:[un("div",{className:"test-recorder-toolbar",children:[Be("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:x=>{h(),x.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Be("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:x=>{g(),x.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Be("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:x=>{C(),x.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Be("pre",{id:"test-recorder",ref:d,children:s})]}):null]}var yl=()=>{let t=Cm(3),[e]=bm(),[o,n]=ym(e),r;return t[0]!==o||t[1]!==n?(r=un(Ll.Fragment,{children:[Be("p",{children:"HI"}),o,n,Be("p",{children:"DONE"})]}),t[0]=o,t[1]=n,t[2]=r):r=t[2],r};var Rm=A({plugins:[{Component:yl,position:"bottom"}]});import{c as vm}from"react/compiler-runtime";import{jsx as Im}from"react/jsx-runtime";import{useLexicalComposerContext as Mm}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Am}from"@lexical/react/LexicalTreeView.js";import"react";var Rl=()=>{let t=vm(2),[e]=Mm(),o;return t[0]!==e?(o=Im(Am,{editor:e,timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",treeTypeButtonClassName:"debug-treetype-button",viewClassName:"tree-view-output"}),t[0]=e,t[1]=o):o=t[1],o};var Dm=A({plugins:[{Component:Rl,position:"bottom"}]});import{BOLD_ITALIC_STAR as Om,BOLD_ITALIC_UNDERSCORE as Fm,BOLD_STAR as Pm,BOLD_UNDERSCORE as Bm}from"@lexical/markdown";import{$isTableSelection as jm}from"@lexical/table";import{$isRangeSelection as Hm,FORMAT_TEXT_COMMAND as zm}from"lexical";import{jsx as vl}from"react/jsx-runtime";import"react";var $m="M14.5 9.25A1.75 1.75 0 0 1 12.75 11H9.5V7.5h3.25c.966 0 1.75.784 1.75 1.75M8 11V7.5A1.5 1.5 0 0 1 9.5 6h3.25a3.25 3.25 0 0 1 2.418 5.422A3.5 3.5 0 0 1 13.5 18h-4A1.5 1.5 0 0 1 8 16.5zm1.5 1.5v4h4a2 2 0 1 0 0-4z",Il=({className:t})=>vl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:vl("path",{clipRule:"evenodd",d:$m,fill:"currentColor",fillRule:"evenodd"})});var Q=t=>({type:"buttons",items:t,key:"format",order:40});var Ml=[Q([{ChildComponent:Il,isActive:({selection:t})=>Hm(t)||jm(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(zm,"bold")},order:1}])],Gm=A(({featureProviderMap:t})=>{let e=[Pm,Bm];return t.get("italic")&&e.push(Fm,Om),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:Ml},toolbarInline:{groups:Ml}}});import{INLINE_CODE as Wm}from"@lexical/markdown";import{$isTableSelection as Vm}from"@lexical/table";import{$isRangeSelection as Km,FORMAT_TEXT_COMMAND as Jm}from"lexical";import{jsx as Al}from"react/jsx-runtime";import"react";var Um="M9.64645 8.14645C9.84171 7.95118 10.1582 7.95118 10.3535 8.14645C10.5487 8.34171 10.5487 8.65822 10.3535 8.85348L7.20699 12L10.3535 15.1464C10.5487 15.3417 10.5487 15.6582 10.3535 15.8535C10.1582 16.0487 9.84171 16.0487 9.64645 15.8535L6.14645 12.3535C5.95118 12.1582 5.95118 11.8417 6.14645 11.6464L9.64645 8.14645ZM13.6464 8.14645C13.8417 7.95118 14.1582 7.95118 14.3535 8.14645L17.8535 11.6464C18.0487 11.8417 18.0487 12.1582 17.8535 12.3535L14.3535 15.8535C14.1582 16.0487 13.8417 16.0487 13.6464 15.8535C13.4512 15.6582 13.4512 15.3417 13.6464 15.1464L16.7929 12L13.6464 8.85348C13.4512 8.65822 13.4512 8.34171 13.6464 8.14645Z",Dl=({className:t})=>Al("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Al("path",{clipRule:"evenodd",d:Um,fill:"currentColor",fillRule:"evenodd"})});var $l=[Q([{ChildComponent:Dl,isActive:({selection:t})=>Km(t)||Vm(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(Jm,"code")},order:7}])],Xm=A({enableFormats:["code"],markdownTransformers:[Wm],toolbarFixed:{groups:$l},toolbarInline:{groups:$l}});import{ITALIC_STAR as Zm,ITALIC_UNDERSCORE as qm}from"@lexical/markdown";import{$isTableSelection as Qm}from"@lexical/table";import{$isRangeSelection as ep,FORMAT_TEXT_COMMAND as tp}from"lexical";import{jsx as Ol}from"react/jsx-runtime";import"react";var Ym="M10 6.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-2.083L11.6 17h1.9a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2.083L12.4 7h-1.9a.5.5 0 0 1-.5-.5",Fl=({className:t})=>Ol("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ol("path",{clipRule:"evenodd",d:Ym,fill:"currentColor",fillRule:"evenodd"})});var Pl=[Q([{ChildComponent:Fl,isActive:({selection:t})=>ep(t)||Qm(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(tp,"italic")},order:2}])],op=A({enableFormats:["italic"],markdownTransformers:[Zm,qm],toolbarFixed:{groups:Pl},toolbarInline:{groups:Pl}});import{STRIKETHROUGH as rp}from"@lexical/markdown";import{$isTableSelection as lp}from"@lexical/table";import{$isRangeSelection as ip,FORMAT_TEXT_COMMAND as sp}from"lexical";import{jsx as Bl}from"react/jsx-runtime";import"react";var np="M15.835 13.5a.27.27 0 0 1 .24.138q.306.554.306 1.316 0 1.01-.543 1.816-.543.8-1.554 1.268-1.01.462-2.409.462-1.323 0-2.295-.419-.972-.424-1.534-1.175a3.2 3.2 0 0 1-.533-1.135c-.082-.326.187-.614.522-.614.299 0 .539.233.625.519q.13.43.415.768.448.524 1.17.8.73.271 1.63.272.996 0 1.764-.32.773-.327 1.215-.906a2.16 2.16 0 0 0 .44-1.348q0-.645-.345-1.09c-.1-.132-.016-.352.15-.352zm-3.846-8q1.215 0 2.142.438.933.43 1.476 1.187.38.518.519 1.134c.07.31-.19.577-.507.577-.286 0-.518-.22-.6-.493q-.22-.738-.875-1.224-.864-.646-2.18-.646-.92 0-1.63.313-.703.308-1.1.85a2.04 2.04 0 0 0-.395 1.237q0 .492.217.874.216.376.588.652.376.278.843.475.474.197.972.338l1.052.288H18.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1h3.94a4.4 4.4 0 0 1-.844-.602q-.844-.781-.844-1.982 0-1.009.562-1.778t1.522-1.2q.959-.438 2.153-.438",jl=({className:t})=>Bl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Bl("path",{d:np,fill:"currentColor"})});var Hl=[Q([{ChildComponent:jl,isActive:({selection:t})=>ip(t)||lp(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(sp,"strikethrough")},order:4}])],ap=A({enableFormats:["strikethrough"],markdownTransformers:[rp],toolbarFixed:{groups:Hl},toolbarInline:{groups:Hl}});import{$isTableSelection as up}from"@lexical/table";import{$isRangeSelection as dp,FORMAT_TEXT_COMMAND as mp}from"lexical";import{jsx as zl}from"react/jsx-runtime";import"react";var cp="M7.51 15.65a.523.523 0 1 1-.985-.352l2.377-6.534a.83.83 0 0 1 1.56 0l2.374 6.534a.523.523 0 1 1-.985.351L9.722 9.57a.043.043 0 0 0-.08 0zm.162-2.238c0-.252.204-.456.456-.456h3.1a.456.456 0 0 1 0 .912h-3.1a.456.456 0 0 1-.456-.456m6.652 3.925a.436.436 0 0 1-.287-.765l1.64-1.431q.259-.228.433-.407.175-.178.266-.345a.76.76 0 0 0 .091-.365.61.61 0 0 0-.258-.52q-.255-.195-.63-.195-.4 0-.643.21a.7.7 0 0 0-.133.151c-.127.197-.3.403-.534.403s-.432-.194-.367-.418q.11-.378.434-.642.494-.402 1.257-.403.513 0 .897.183.387.181.604.501.217.316.217.714 0 .316-.13.586-.125.27-.395.555a9 9 0 0 1-.695.634l-.927.798a.023.023 0 0 0 .016.042h1.895a.357.357 0 0 1 0 .714z",Gl=({className:t})=>zl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:zl("path",{d:cp,fill:"currentColor"})});var Ul=[Q([{ChildComponent:Gl,isActive:({selection:t})=>dp(t)||up(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(mp,"subscript")},order:5}])],pp=A({enableFormats:["subscript"],toolbarFixed:{groups:Ul},toolbarInline:{groups:Ul}});import{$isTableSelection as hp}from"@lexical/table";import{$isRangeSelection as gp,FORMAT_TEXT_COMMAND as xp}from"lexical";import{jsx as Wl}from"react/jsx-runtime";import"react";var fp="M7.51 15.65a.523.523 0 1 1-.985-.352l2.377-6.534a.83.83 0 0 1 1.56 0l2.374 6.534a.523.523 0 1 1-.985.351L9.722 9.57a.043.043 0 0 0-.08 0zm.162-2.238c0-.252.204-.456.456-.456h3.1a.456.456 0 0 1 0 .912h-3.1a.456.456 0 0 1-.456-.456m6.652-1.303a.436.436 0 0 1-.287-.765l1.64-1.432q.259-.228.433-.406.175-.179.266-.346a.76.76 0 0 0 .091-.365.61.61 0 0 0-.258-.52q-.255-.195-.63-.194-.4 0-.643.209a.7.7 0 0 0-.133.152c-.127.196-.3.403-.534.403s-.432-.194-.367-.419q.11-.378.434-.641.494-.403 1.257-.403.513 0 .897.182.387.183.604.502.217.315.217.714 0 .315-.13.585-.125.27-.395.555a9 9 0 0 1-.695.635l-.927.798a.023.023 0 0 0 .016.041h1.895a.357.357 0 1 1 0 .715z",Vl=({className:t})=>Wl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Wl("path",{d:fp,fill:"currentColor"})});var Kl=[Q([{ChildComponent:Vl,isActive:({selection:t})=>gp(t)||hp(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(xp,"superscript")},order:6}])],Cp=A({enableFormats:["superscript"],toolbarFixed:{groups:Kl},toolbarInline:{groups:Kl}});import{$isTableSelection as kp}from"@lexical/table";import{$isRangeSelection as _p,FORMAT_TEXT_COMMAND as Tp}from"lexical";import{jsx as Jl}from"react/jsx-runtime";import"react";var bp="M9 7.5a.5.5 0 0 0-1 0V12a4 4 0 0 0 8 0V7.5a.5.5 0 0 0-1 0V12a3 3 0 1 1-6 0zM16.5 19a.5.5 0 0 0 0-1h-9a.5.5 0 0 0 0 1z",Xl=({className:t})=>Jl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Jl("path",{clipRule:"evenodd",d:bp,fill:"currentColor",fillRule:"evenodd"})});var Yl=[Q([{ChildComponent:Xl,isActive:({selection:t})=>_p(t)||kp(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(Tp,"underline")},order:3}])],Ep=A({enableFormats:["underline"],toolbarFixed:{groups:Yl},toolbarInline:{groups:Yl}});import{jsx as mn}from"react/jsx-runtime";import{jsx as wp}from"react/jsx-runtime";function Sp(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var io=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,n])=>[Sp(o),n])):{};return wp("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as Np}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as Lp}from"@lexical/selection";import{$getNodeByKey as yp,$getState as Rp,$setState as vp,createState as Ip,TextNode as Mp}from"lexical";import{useEffect as Ap}from"react";function Zl(t){let e=new Map;for(let o in t){let n=t[o],r=Ip(o,{parse:l=>typeof l=="string"&&Object.keys(n).includes(l)?l:void 0});e.set(o,{stateConfig:r,stateValues:n})}return e}function dn(t,e,o,n){t.update(()=>{Lp(r=>{let l=e.get(o);if(!l)throw new Error(`State config for ${o} not found`);vp(r,l.stateConfig,n)})})}function ql({stateMap:t}){let[e]=Np();return Ap(()=>e.registerMutationListener(Mp,o=>{e.getEditorState().read(()=>{for(let[n,r]of o){if(r==="destroyed")continue;let l=yp(n),s=e.getElementByKey(n);if(!l||!s)continue;let i=Object.create(null);t.forEach((c,u)=>{let d=Rp(l,c.stateConfig);if(!d){delete s.dataset[u];return}s.dataset[u]=d;let a=c.stateValues[d]?.css;a&&Object.assign(i,a)}),s.style.cssText="",Object.assign(s.style,i)}})}),[e]),null}var Ql=(t,e)=>{let o=[];for(let r in t.state){let l=t.state[r];for(let s in l){let i=l[s];o.push({ChildComponent:()=>mn(io,{css:i.css}),key:s,label:i.label,onSelect:({editor:c})=>{dn(c,e,r,s)}})}}return[{type:"dropdown",ChildComponent:()=>mn(io,{css:{color:"var(--color-icon-secondary)"}}),items:[...[{ChildComponent:()=>mn(io,{}),key:"clear-style",label:({i18n:r})=>r.t("lexical:textState:defaultStyle"),onSelect:({editor:r})=>{for(let l in t.state)dn(r,e,l,void 0)},order:1}],...o],key:"textState",order:30}]},Dp=A(({props:t})=>{let e=Zl(t.state);return{plugins:[{Component:()=>ql({stateMap:e}),position:"normal"}],toolbarFixed:{groups:Ql(t,e)},toolbarInline:{groups:Ql(t,e)}}});import{c as Yp}from"react/compiler-runtime";import{useLexicalComposerContext as Zp}from"@lexical/react/LexicalComposerContext";import{$createHeadingNode as qp,$isHeadingNode as pi,HeadingNode as gi}from"@lexical/rich-text";import{$setBlocksType as Qp}from"@lexical/selection";import{$getSelection as ef,$isRangeSelection as tf}from"lexical";import{useEffect as of}from"react";import{jsx as ei}from"react/jsx-runtime";import"react";var $p="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7zm11 6a.5.5 0 0 0-.777-.416l-1.5 1a.5.5 0 1 0 .554.832l.723-.482V17.5a.5.5 0 0 0 1 0z",ti=({className:t})=>ei("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ei("path",{d:$p,fill:"currentColor"})});import{jsx as oi}from"react/jsx-runtime";import"react";var Op="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7zm9.034 10.952c0 .303.245.548.548.548h2.97a.448.448 0 0 0 0-.896H17.48v-.04l.997-1.038q.562-.555.873-.945.314-.39.438-.711t.124-.653q0-.497-.245-.885a1.7 1.7 0 0 0-.684-.61A2.24 2.24 0 0 0 17.96 12a2.2 2.2 0 0 0-1.017.228 1.71 1.71 0 0 0-.888 1.13c-.064.268.168.495.444.495.275 0 .479-.236.595-.485l.019-.039q.12-.22.333-.338a1 1 0 0 1 .5-.121q.278 0 .495.11a.83.83 0 0 1 .341.312.9.9 0 0 1 .125.48q0 .245-.096.462t-.288.448-.48.529l-1.85 1.854a.55.55 0 0 0-.16.387",ni=({className:t})=>oi("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:oi("path",{d:Op,fill:"currentColor"})});import{jsx as ri,jsxs as Fp}from"react/jsx-runtime";import"react";var Pp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",Bp="M16.59 13.32 A1.5 1.25 0 1 1 18 15 A1.5 1.25 0 1 1 16.59 16.68",li=({className:t})=>Fp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[ri("path",{d:Pp,fill:"currentColor"}),ri("path",{d:Bp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{jsx as ii,jsxs as jp}from"react/jsx-runtime";import"react";var Hp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",zp="M18.85 17.5 V12.5 L16.5 15.85 H19.5",si=({className:t})=>jp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[ii("path",{d:Hp,fill:"currentColor"}),ii("path",{d:zp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{jsx as ai,jsxs as Gp}from"react/jsx-runtime";import"react";var Up="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",Wp="M19.2 12.5 H16.8 V14.9 A1.5 1.5 0 1 1 16.7 16.9",ci=({className:t})=>Gp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[ai("path",{d:Up,fill:"currentColor"}),ai("path",{d:Wp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{jsx as ui,jsxs as Vp}from"react/jsx-runtime";import"react";var Kp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",Jp="M18.85 12.55 C17.45 13.05 16.5 14.25 16.5 16 A1.5 1.5 0 1 1 19.5 16 A1.5 1.5 0 1 1 16.5 16",di=({className:t})=>Vp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[ui("path",{d:Kp,fill:"currentColor"}),ui("path",{d:Jp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{HEADING as Xp}from"@lexical/markdown";var mi=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`;return{...Xp,regExp:new RegExp(o)}};var fi=t=>{let e=ef();Qp(e,()=>qp(t))},hi={h1:ti,h2:ni,h3:li,h4:si,h5:ci,h6:di},nf=A(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[oe(e.map((n,r)=>({ChildComponent:hi[n],isActive:({selection:l})=>{if(!tf(l))return!1;for(let s of l.getNodes()){if(pi(s)&&s.getTag()===n)continue;let i=s.getParent();if(!(pi(i)&&i.getTag()===n))return!1}return!0},key:n,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:n.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{fi(n)})},order:r+2})))];return{markdownTransformers:[mi(e)],nodes:[gi],plugins:[{Component:rf,position:"normal"}],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[q(e.map(n=>({Icon:hi[n],key:`heading-${n.charAt(1)}`,keywords:["heading",n],label:({i18n:r})=>r.t("lexical:heading:label",{headingLevel:n.charAt(1)}),onSelect:({editor:r})=>{r.update(()=>{fi(n)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}}),rf=t=>{let e=Yp(9),{clientProps:o}=t,{enabledHeadingSizes:n}=o,r;e[0]!==n?(r=n===void 0?["h1","h2","h3","h4","h5","h6"]:n,e[0]=n,e[1]=r):r=e[1];let l=r,s;e[2]!==l?(s=l.at(-1),e[2]=l,e[3]=s):s=e[3];let i=s,[c]=Zp(),u,d;return e[4]!==c||e[5]!==l||e[6]!==i?(u=()=>{if(!(!i||l.length===6))return c.registerNodeTransform(gi,a=>{l.includes(a.getTag())||a.setTag(i)})},d=[c,l,i],e[4]=c,e[5]=l,e[6]=i,e[7]=u,e[8]=d):(u=e[7],d=e[8]),of(u,d),null};import{$isNodeSelection as Ef}from"lexical";import{jsx as xi}from"react/jsx-runtime";import"react";var lf="M18 12a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1 0-1h11a.5.5 0 0 1 .5.5",pn=({className:t})=>xi("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:xi("path",{d:lf,fill:"currentColor"})});var be=t=>({type:"dropdown",ChildComponent:Mr,items:t,key:"add",order:10});import{addClassNamesToElement as sf}from"@lexical/utils";import{$applyNodeReplacement as af,createCommand as cf,DecoratorNode as uf}from"lexical";var Mt=cf("INSERT_HORIZONTAL_RULE_COMMAND"),It=class extends uf{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:df,priority:0})}}static importJSON(e){return Ci()}createDOM(e){let o=document.createElement("hr");return sf(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{...super.exportJSON(),type:"horizontalrule"}}getTextContent(){return`
55
+ `}isInline(){return!1}updateDOM(){return!1}};function df(){return{node:Ci()}}function Ci(){return af(new It)}import{$applyNodeReplacement as mf}from"lexical";import"react";var ke=class extends It{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{hr:()=>({conversion:pf,priority:0})}}static importJSON(e){return je()}decorate(){return null}exportJSON(){return super.exportJSON()}};function pf(){return{node:je()}}function je(){return mf(new ke)}function He(t){return t instanceof ke}var bi={type:"element",dependencies:[ke],export:(t,e)=>He(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=je();e&&t.replace(e)}};import{c as ff}from"react/compiler-runtime";import{useLexicalComposerContext as hf}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as ki,$insertNodeToNearestRoot as gf}from"@lexical/utils";import{$getRoot as xf,$getSelection as _i,$isRangeSelection as Ti,$isRootOrShadowRoot as Ei,COMMAND_PRIORITY_EDITOR as Cf}from"lexical";import{useEffect as bf}from"react";var fn="LexicalEditorTheme__hrSelected",wi=()=>{let t=ff(3),[e]=hf(),o,n;return t[0]!==e?(o=()=>{let r=e.registerCommand(Mt,kf,Cf),l=e.registerUpdateListener(s=>{let{editorState:i}=s;i.read(()=>{let u=xf().getChildren(),d=_i(),a=[];for(let x=0;x<u.length;x++){let b=u[x];if(He(b)){let k=e.getElementByKey(b.getKey());k&&a.push({element:k,index:x})}}if(a.length===0)return;if(!Ti(d)||d.isCollapsed()){for(let{element:x}of a)x.classList.remove(fn);return}let p=d.anchor.getNode(),m=d.focus.getNode(),f=ki(p,_f)||p,h=ki(m,Tf)||m,g=u.indexOf(f),C=u.indexOf(h);if(g===-1||C===-1)return;let E=Math.min(g,C),L=Math.max(g,C);for(let{element:x,index:b}of a)b>=E&&b<=L?x.classList.add(fn):x.classList.remove(fn)})});return()=>{r(),l()}},n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),bf(o,n),null};function kf(t){let e=_i();if(!Ti(e))return!1;if(e.focus.getNode()!==null){let n=je();gf(n)}return!0}function _f(t){return Ei(t.getParent())}function Tf(t){return Ei(t.getParent())}var wf=A({markdownTransformers:[bi],nodes:[ke],plugins:[{Component:wi,position:"normal"}],slashMenu:{groups:[q([{Icon:pn,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(Mt,void 0)}}])]},toolbarFixed:{groups:[be([{ChildComponent:pn,isActive:({selection:t})=>{if(!Ef(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return He(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(Mt,void 0)}}])]}});import{$findMatchingParent as $i}from"@lexical/utils";import{$isElementNode as Bf,INDENT_CONTENT_COMMAND as jf,OUTDENT_CONTENT_COMMAND as Hf}from"lexical";import{jsx as hn}from"react/jsx-runtime";import"react";var Sf="M7.854 6.146a.5.5 0 1 0-.708.708L8.293 8H5.5a.5.5 0 0 0 0 1h2.793l-1.147 1.146a.5.5 0 0 0 .708.708l2-2a.5.5 0 0 0 0-.708zM11.5 8a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zM5 12.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Si=({className:t})=>hn("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:hn("g",{transform:"scale(-1, 1) translate(-24, 0)",children:hn("path",{clipRule:"evenodd",d:Sf,fill:"currentColor",fillRule:"evenodd"})})});import{jsx as Ni}from"react/jsx-runtime";import"react";var Nf="M7.854 6.146a.5.5 0 1 0-.708.708L8.293 8H5.5a.5.5 0 0 0 0 1h2.793l-1.147 1.146a.5.5 0 0 0 .708.708l2-2a.5.5 0 0 0 0-.708zM11.5 8a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zM5 12.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Li=({className:t})=>Ni("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ni("path",{clipRule:"evenodd",d:Nf,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Lf}from"react/jsx-runtime";import{useLexicalComposerContext as yf}from"@lexical/react/LexicalComposerContext";import{TabIndentationPlugin as Rf}from"@lexical/react/LexicalTabIndentationPlugin";import{$findMatchingParent as vf,mergeRegister as gn}from"@lexical/utils";import{$addUpdateTag as xn,$getSelection as vi,$isElementNode as Ii,$isRangeSelection as Mi,$isRootOrShadowRoot as If,BLUR_COMMAND as Mf,COMMAND_PRIORITY_HIGH as so,COMMAND_PRIORITY_LOW as Cn,FOCUS_COMMAND as Af,INDENT_CONTENT_COMMAND as yi,KEY_ESCAPE_COMMAND as Df,KEY_TAB_COMMAND as Ri,OUTDENT_CONTENT_COMMAND as $f,SELECTION_CHANGE_COMMAND as Of,SKIP_DOM_SELECTION_TAG as bn,TabNode as Ff}from"lexical";import{useEffect as kn}from"react";var Ai=({clientProps:t})=>{let[e]=yf(),{disabledNodes:o,disableTabNode:n}=t;return kn(()=>{let r=!1,l=!1,s=()=>{r=!1},i,c,u;function d(){s(),l=!1}function a(h){if(h.key!=="Tab"||!r){["Escape","Shift","Tab"].includes(h.key)||s();return}let g=e.getRootElement();if(!g)return;s(),l=!0,h.stopPropagation(),i?.(),clearTimeout(c);let C=g.closest(".rich-text-lexical")??g,E=new Set([g,...C.querySelectorAll('[tabindex], [contenteditable="true"], a[href], button, input, select, textarea, summary, iframe, audio[controls], video[controls]')]),L=new Map;for(let x of E)L.set(x,x.getAttribute("tabindex")),x.setAttribute("tabindex","-1");i=()=>{for(let[x,b]of L)b===null?x.removeAttribute("tabindex"):x.setAttribute("tabindex",b);i=void 0},c=setTimeout(()=>i?.(),0),e.update(()=>xn(bn))}function p(h){if(h.key==="Escape"&&!h.defaultPrevented&&e.isEditable()){if(r&&!h.repeat)return;h.preventDefault(),h.stopPropagation(),r=!0}}let m=e.registerRootListener(h=>{u?.abort(),u=new AbortController;let{signal:g}=u;h?.addEventListener("pointerdown",d,{signal:g}),h?.addEventListener("keydown",a,{capture:!0,signal:g}),h?.addEventListener("keydown",p,{signal:g})}),f=gn(e.registerCommand(Df,h=>e.isEditable()?(p(h),!0):!1,Cn),e.registerCommand(Ri,()=>{let h=vi();return Mi(h)&&h.isCollapsed()&&If(h.anchor.getNode())?(s(),l=!0,xn(bn),!0):!1},so),e.registerCommand(Mf,()=>(s(),!1),so),e.registerCommand(Af,()=>(d(),!1),so),e.registerCommand(Of,()=>{let h=e.getRootElement();return l&&h?.ownerDocument.activeElement!==h&&xn(bn),!1},so));return()=>{f(),m(),u?.abort(),clearTimeout(c),i?.()}},[e]),kn(()=>{if(!(!e||!o?.length))return gn(e.registerCommand(yi,()=>Pf(r=>{if(!o.includes(r.getType())){let l=r.getIndent();r.setIndent(l+1)}}),Cn),e.registerUpdateListener(({dirtyElements:r,editorState:l})=>{e.update(()=>{for(let[s]of r){let i=l._nodeMap.get(s);Ii(i)&&o.includes(i.getType())&&i.getIndent()>0&&i.setIndent(0)}})}))},[e,o]),kn(()=>{if(!(!e||!n))return gn(e.registerCommand(Ri,r=>(r.preventDefault(),e.dispatchCommand(r.shiftKey?$f:yi,void 0)),Cn),e.registerNodeTransform(Ff,r=>{r.remove()}))},[e,n]),Lf(Rf,{})};function Pf(t){let e=vi();if(!Mi(e))return!1;let o=new Set,n=e.getNodes();for(let r=0;r<n.length;r++){let l=n[r],s=l.getKey();if(o.has(s))continue;let i=vf(l,u=>Ii(u)&&!u.isInline());if(i===null)continue;let c=i.getKey();i.canIndent()&&!o.has(c)&&(o.add(c),t(i))}return o.size>0}var Di=t=>({type:"buttons",items:t,key:"indent",order:35});var Oi=({disabledNodes:t})=>[Di([{ChildComponent:Si,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],n=r=>Fi(r)&&r.getIndent()>0;return o.some(r=>n(r)||!!$i(r,n))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Hf,void 0)},order:1},{ChildComponent:Li,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],n=r=>Fi(r)&&!(t??[]).includes(r.getType());return o.some(r=>n(r)||!!$i(r,n))},key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(jf,void 0)},order:2}])],zf=A(({props:t})=>{let e=t.disabledNodes??[];return{plugins:[{Component:Ai,position:"normal"}],sanitizedClientFeatureProps:t,toolbarFixed:{groups:Oi({disabledNodes:e})},toolbarInline:{groups:Oi({disabledNodes:e})}}}),Fi=t=>Bf(t)&&t.canIndent();import{$findMatchingParent as i0}from"@lexical/utils";import{$getSelection as vn,$isRangeSelection as bs}from"lexical";import{jsx as Pi}from"react/jsx-runtime";import"react";var Gf={16:"M8.38 6.381a.29.29 0 0 1 .347-.056q.293.161.541.408a2.5 2.5 0 0 1 0 3.535l-2 2a2.5 2.5 0 0 1-3.535-3.535l.571-.573c.25-.249.692-.107.81.224a.46.46 0 0 1-.098.478l-.576.578a1.5 1.5 0 1 0 2.121 2.12l2-2a1.5 1.5 0 0 0 0-2.12c-.23-.23-.493-.509-.358-.805a.9.9 0 0 1 .178-.254m.352-2.648a2.5 2.5 0 1 1 3.535 3.535l-.471.47c-.253.254-.717.082-.819-.261a.44.44 0 0 1 .102-.435l.481-.481A1.5 1.5 0 0 0 9.44 4.44l-2 2a1.5 1.5 0 0 0 0 2.12c.136.138.168.365.031.502l-.182.181c-.154.154-.403.179-.557.025a2.5 2.5 0 0 1 0-3.535z",24:"M12.4436 10.3708C12.6861 10.5041 12.9148 10.6721 13.1204 10.8776C14.2919 12.0492 14.2918 13.9482 13.1204 15.1198L11.1204 17.1198C9.94879 18.2914 8.04975 18.2914 6.87817 17.1198C5.70664 15.9482 5.70661 14.0492 6.87817 12.8776L8.1477 11.6071C8.4098 11.345 8.89329 11.5392 8.97388 11.9011C9.00617 12.0462 8.96861 12.2012 8.86353 12.3063L7.5852 13.5847C6.80417 14.3657 6.80419 15.6317 7.5852 16.4128C8.36625 17.1938 9.63228 17.1938 10.4133 16.4128L12.4133 14.4128C13.1942 13.6317 13.1943 12.3657 12.4133 11.5847C12.4042 11.5755 12.3953 11.5662 12.386 11.5573C12.2925 11.468 12.1984 11.3736 12.1614 11.2497C12.0724 10.9515 12.1448 10.6149 12.3801 10.3796C12.397 10.3628 12.4228 10.3594 12.4436 10.3708ZM12.8782 6.87764C14.0497 5.70615 15.9488 5.70616 17.1204 6.87764C18.2919 8.04919 18.2919 9.94825 17.1204 11.1198L15.8508 12.3903C15.5887 12.6522 15.1053 12.4581 15.0247 12.0964C14.9924 11.9512 15.0308 11.7963 15.136 11.6911L16.4133 10.4128C17.1943 9.63175 17.1943 8.3657 16.4133 7.58467C15.6323 6.80371 14.3662 6.8037 13.5852 7.58467L11.5852 9.58467C10.8046 10.3657 10.8044 11.6319 11.5852 12.4128C11.5943 12.4219 11.6042 12.4303 11.6135 12.4392C11.7064 12.5278 11.7999 12.622 11.8372 12.7448C11.9276 13.044 11.8545 13.3827 11.6184 13.6188C11.6023 13.6347 11.5778 13.6383 11.5579 13.6276C11.3146 13.4942 11.0843 13.3259 10.8782 13.1198C9.7068 11.9484 9.707 10.0492 10.8782 8.87764L12.8782 6.87764Z"},ao=({className:t,size:e=24})=>Pi("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Pi("path",{d:Gf[e],fill:"currentColor"})});import{$isAtNodeEnd as Bi}from"@lexical/selection";function it(t){let{anchor:e}=t,{focus:o}=t,n=t.anchor.getNode(),r=t.focus.getNode();return n===r?n:t.isBackward()?Bi(o)?n:r:Bi(e)?n:r}var _n=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as o1}from"lexical";function Tn(t){let e=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z\d+/]+=*$/i;return t=String(t).trim(),t.match(e)!=null||t.match(o)!=null?t:"https://"}var Uf=/^(?:[a-zA-Z][a-zA-Z\d+.-]*:(?:\/\/)?(?:[-;:&=+$,\w]+@)?[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|www\.[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|(?:tel|mailto):[\w+.-]+)(?:\/[+~%/\w-]*)?(?:\?[-;&=%\w]*)?(?:#\w+)?$/,Wf=/^(?:\/[\w\-./]*(?:\?[-;&=%\w]*)?(?:#[\w-]+)?|#[\w\-]+)$/;function ji(t){if(!t||t.includes(" ")||/^[a-z][a-z\d+.-]*:\/[^/]/i.test(t))return!1;if(t==="https://"||Uf.test(t)||Wf.test(t))return!0;try{let e=new URL(t);return!(["ftp:","http:","https:"].includes(e.protocol)&&!e.hostname.includes("."))}catch{}return!1}import{addClassNamesToElement as Vf,isHTMLAnchorElement as Kf}from"@lexical/utils";import zi from"bson-objectid";import{$applyNodeReplacement as Jf,$createTextNode as Hi,$getSelection as Xf,$isElementNode as Gi,$isRangeSelection as wn,createCommand as Yf,ElementNode as Zf}from"lexical";var qf=new Set(["http:","https:","mailto:","sms:","tel:"]),ne=class extends Zf{__fields;__id;constructor({id:e,fields:o={linkType:"custom",newTab:!1},key:n}){super(n),this.__fields=o,this.__id=e}static clone(e){return new this({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:Qf,priority:1})}}static importJSON(e){return _e({}).updateFromJSON(e)}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(e){let o=document.createElement("a");return this.__fields?.linkType==="custom"&&(o.href=this.sanitizeUrl(this.__fields.url??"")),(this.__fields?.newTab??!1)&&(o.target="_blank"),this.__fields?.newTab===!0&&this.__fields?.linkType==="custom"&&(o.rel=En(o.rel,"add","noopener")),Vf(o,e.theme.link),o}exportJSON(){let e=this.getFields();e?.linkType==="internal"?delete e.url:e?.linkType==="custom"&&delete e.doc;let o={...super.exportJSON(),type:"link",fields:e},n=this.getID();return n&&(o.id=n),o}extractWithChild(e,o,n){if(!wn(o))return!1;let r=o.anchor.getNode(),l=o.focus.getNode();return this.isParentOf(r)&&this.isParentOf(l)&&o.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e,o=!0){let n=this.getParentOrThrow().insertNewAfter(e,o);if(Gi(n)){let r=_e({fields:this.__fields});return n.append(r),r}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!qf.has(o.protocol))return"about:blank"}catch{return"https://"}return e}setFields(e){let o=this.getWritable();return o.__fields=e,o}setID(e){let o=this.getWritable();return o.__id=e,o}updateDOM(e,o,n){let r=this.__fields?.url,l=this.__fields?.newTab;return r!=null&&r!==e.__fields?.url&&this.__fields?.linkType==="custom"&&(o.href=r),this.__fields?.linkType==="internal"&&e.__fields?.linkType==="custom"&&o.removeAttribute("href"),o.rel==null&&(o.rel=""),l!==e.__fields?.newTab&&(l??!1?(o.target="_blank",this.__fields?.linkType==="custom"&&(o.rel=En(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=En(o.rel,"remove","noopener"))),!1}updateFromJSON(e){let o=e;return super.updateFromJSON(o).setFields(o.fields).setID(o.id)}};function Qf(t){let e=null;if(Kf(t)){let o=t.textContent;o!==null&&o!==""&&(e=_e({id:new zi.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function _e({id:t,fields:e}){return Jf(new ne({id:t??new zi.default().toHexString(),fields:e}))}function X(t){return t instanceof ne}var fe=Yf("TOGGLE_LINK_COMMAND");function Sn(t){let e=Xf();if(!wn(e)&&(t===null||!t.selectedNodes?.length))return;let o=wn(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(l=>{let s=l.getParent();X(s)&&(s.getChildren().forEach(c=>{s.insertBefore(c)}),s.remove())});return}if(o?.length===1){let l=o[0],s=X(l)?l:e1(l);if(s!==null){s.setFields(t.fields),t.text!=null&&t.text!==s.getTextContent()&&(s.append(Hi(t.text)),s.getChildren().forEach(i=>{i!==s.getLastChild()&&i.remove()}));return}}let n=null,r=null;o?.forEach(l=>{let s=l.getParent();if(!(s===r||s===null||Gi(l)&&!l.isInline())){if(X(s)){r=s,s.setFields(t.fields),t.text!=null&&t.text!==s.getTextContent()&&(s.append(Hi(t.text)),s.getChildren().forEach(i=>{i!==s.getLastChild()&&i.remove()}));return}if(s.is(n)||(n=s,r=_e({fields:t.fields}),X(s)?l.getPreviousSibling()===null?s.insertBefore(r):s.insertAfter(r):l.insertBefore(r)),X(l)){if(l.is(r))return;if(r!==null){let i=l.getChildren();r.append(...i)}l.remove();return}r!==null&&r.append(l)}})}function e1(t){return t1(t,e=>X(e))}function t1(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function En(t,e,o){let n,r=`${t}`;if(e==="add"){if(r.includes(o)){let l=new RegExp(o,"g");r=r.replace(l,"").trim()}r=r.trim(),n=r.length===0?`${o}`:`${r} ${o}`}else{let l=new RegExp(o,"g");n=r.replace(l,"").trim()}return n}var n1=(t,e)=>{let[,o,n]=e,r=_e({fields:{doc:null,linkType:"custom",newTab:!1,url:n}}),l=o1(o);return l.setFormat(t.getFormat()),r.append(l),t.replace(r),l},r1=t=>({type:"text-match",dependencies:[ne],export:(e,o)=>{if(!X(e))return null;let n=e,r=n.getFields(),l;return r.linkType==="internal"?t?.internalDocToHref?l=Tn(t.internalDocToHref({linkNode:n.exportJSON()})):(console.warn("Lexical \u2192 Markdown converter: found internal link but internalDocToHref is not provided \u2014 link will have an empty href"),l=""):l=Tn(r.url??""),`[${o(n)}](${l})`},importRegExp:/(?<!!)\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/(?<!!)\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:n1,trigger:")"}),Ui=r1();import{$applyNodeReplacement as l1,$isElementNode as i1}from"lexical";var Te=class extends ne{static clone(e){return new this({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){return At({}).updateFromJSON(e)}exportJSON(){let e=super.exportJSON();return{type:"autolink",children:e.children,direction:e.direction,fields:e.fields,format:e.format,indent:e.indent,version:e.version}}insertNewAfter(e,o=!0){let n=this.getParentOrThrow().insertNewAfter(e,o);if(i1(n)){let r=At({fields:this.__fields});return n.append(r),r}return null}updateFromJSON(e){let o=e;return super.updateFromJSON(o).setFields(o.fields)}};function At({fields:t}){return l1(new Te({id:"",fields:t}))}function Ee(t){return t instanceof Te}import{c as s1}from"react/compiler-runtime";import{useLexicalComposerContext as a1}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as c1}from"@lexical/utils";import{$createTextNode as Wi,$getSelection as u1,$isElementNode as Ki,$isLineBreakNode as Ji,$isNodeSelection as d1,$isRangeSelection as m1,$isTextNode as Dt,TextNode as p1}from"lexical";import{useEffect as f1}from"react";function Vi(t,e=o=>o){return o=>{let n=t.exec(o);return n===null?null:{index:n.index,length:n[0].length,text:n[0],url:e(n[0])}}}function Xi(t,e){for(let o of e){let n=o(t);if(n!=null)return n}return null}var h1=/[.,;\s]/;function uo(t){return t!==void 0&&h1.test(t)}function Yi(t){return uo(t[t.length-1])}function Ln(t){return uo(t[0])}function g1(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function Zi(t){let e=t.getPreviousSibling();return Ki(e)&&(e=e.getLastDescendant()),e===null||Ji(e)||Dt(e)&&Yi(e.getTextContent())}function qi(t){let e=t.getNextSibling();return Ki(e)&&(e=e.getFirstDescendant()),e===null||Ji(e)||Dt(e)&&Ln(e.getTextContent())}function x1(t,e,o,n){return(t>0?uo(o[t-1]):Zi(n[0]))?e<o.length?uo(o[e]):qi(n[n.length-1]):!1}function C1(t,e,o){let n=[],r=[],l=[],s=0,i=0,c=[...t];for(;c.length>0;){let u=c[0],a=u.getTextContent().length,p=i;i+a<=e?(n.push(u),s+=a):p>=o?l.push(u):r.push(u),i+=a,c.shift()}return[s,n,r,l]}function b1(t,e,o,n){let r={linkType:"custom",url:n.url,...n.fields},l=At({fields:r});if(t.length===1){let s=t[0],i;if(e===0?[i]=s.splitText(o):[,i]=s.splitText(e,o),i){let c=Wi(n.text);c.setFormat(i.getFormat()),c.setDetail(i.getDetail()),c.setStyle(i.getStyle()),l.append(c),i.replace(l)}return s}else if(t.length>1){let s=t[0],i=s.getTextContent().length,c;e===0?c=s:[,c]=s.splitText(e);let u=[],d;if(t.forEach(a=>{let m=a.getTextContent().length,f=i,h=i+m;if(f<o)if(h<=o)u.push(a);else{let[g,C]=a.splitText(o-f);g&&u.push(g),d=C}i+=m}),c){let a=u1(),p=a?a.getNodes().find(Dt):void 0,m=Wi(c.getTextContent());return m.setFormat(c.getFormat()),m.setDetail(c.getDetail()),m.setStyle(c.getStyle()),l.append(m,...u),p&&p===c&&(m1(a)?m.select(a.anchor.offset,a.focus.offset):d1(a)&&m.select(0,m.getTextContent().length)),c.replace(l),d}}}function k1(t,e,o){let n=[...t],r=n.map(c=>c.getTextContent()).join(""),l=r,s,i=0;for(;(s=Xi(l,e))!=null&&s!==null;){let c=s.index,u=s.length,d=c+u;if(x1(i+c,i+d,r,n)){let[p,,m,f]=C1(n,i+c,i+d),h=i+c-p,g=i+d-p,C=b1(m,h,g,s);n=C?[C,...f]:f,o(s.url,null),i=0}else i+=d;l=l.substring(d)}}function Nn(t,e,o){let n=t.getChildren(),r=n.length;for(let c=0;c<r;c++){let u=n[c];if(!Dt(u)||!u.isSimpleText()){co(t),o(null,t.getFields()?.url??null);return}}let l=t.getTextContent(),s=Xi(l,e);if(s===null||s.text!==l){co(t),o(null,t.getFields()?.url??null);return}if(!Zi(t)||!qi(t)){co(t),o(null,t.getFields()?.url??null);return}let i=t.getFields()?.url;if(i!==s?.url){let c=t.getFields();c.url=s?.url,t.setFields(c),o(s.url,i??null)}}function _1(t,e,o){let n=t.getPreviousSibling(),r=t.getNextSibling(),l=t.getTextContent();if(Ee(n)){let s=n.getFields()?.url?n.getFields()?.url?.startsWith("mailto:")??!1:!1;(!Ln(l)||g1(l,s))&&(n.append(t),Nn(n,e,o),o(null,n.getFields()?.url??null))}Ee(r)&&!Yi(l)&&(co(r),Nn(r,e,o),o(null,r.getFields()?.url??null))}function co(t){let e=t.getChildren(),o=e.length;for(let n=o-1;n>=0;n--)t.insertAfter(e[n]);return t.remove(),e.map(n=>n.getLatest())}function T1(t){let e=[t],o=t.getNextSibling();for(;o!==null&&Dt(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function E1(t,e,o){let n=s1(5),r,l;n[0]!==t||n[1]!==e||n[2]!==o?(r=()=>{if(!t.hasNodes([Te]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let s=(i,c)=>{o?.(i,c)};return c1(t.registerNodeTransform(p1,i=>{let c=i.getParentOrThrow(),u=i.getPreviousSibling();if(Ee(c))Nn(c,e,s);else if(!X(c)){if(i.isSimpleText()&&(Ln(i.getTextContent())||!Ee(u))){let d=T1(i);k1(d,e,s)}_1(i,e,s)}}))},l=[t,e,o],n[0]=t,n[1]=e,n[2]=o,n[3]=r,n[4]=l):(r=n[3],l=n[4]),f1(r,l)}var w1=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,S1=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,N1=[Vi(w1,t=>t.startsWith("http")?t:`https://${t}`),Vi(S1,t=>`mailto:${t}`)],Qi=()=>{let[t]=a1();return E1(t,N1),null};import{jsx as L1}from"react/jsx-runtime";import{ClickableLinkPlugin as y1}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var es=()=>L1(y1,{});import{jsx as X1}from"react/jsx-runtime";import"react";import{createPortal as Y1}from"react-dom";import{jsx as re,jsxs as ze,Fragment as yn}from"react/jsx-runtime";import{useLexicalComposerContext as I1}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as M1}from"@lexical/react/useLexicalEditable";import{$findMatchingParent as is,mergeRegister as ss}from"@lexical/utils";import{getTranslation as Rn}from"@payloadcms/translations";import{formatDrawerSlug as A1,NewTabIcon as as,useConfig as D1,useEditDepth as $1,useLocale as O1,useTranslation as F1,WriteIcon as P1}from"@payloadcms/ui";import{requests as B1}from"@payloadcms/ui/shared";import{$getSelection as cs,$isLineBreakNode as j1,$isRangeSelection as us,$onUpdate as H1,COMMAND_PRIORITY_HIGH as z1,COMMAND_PRIORITY_LOW as ds,getDOMSelection as G1,KEY_ESCAPE_COMMAND as U1,SELECTION_CHANGE_COMMAND as W1}from"lexical";import{formatAdminURL as V1}from"payload/shared";import K1,{useCallback as ms,useEffect as fo,useLayoutEffect as J1,useRef as ps,useState as Ge}from"react";import{jsx as ts}from"react/jsx-runtime";import"react";var R1="M12.5 5C12.6326 5 12.7597 5.05272 12.8535 5.14648L16.8535 9.14648C16.9965 9.28948 17.0393 9.50457 16.9619 9.69141C16.8845 9.87821 16.7022 10 16.5 10H12.5C12.2239 10 12 9.77614 12 9.5V6H8.5C8.22386 6 8 6.22386 8 6.5V17.5C8 17.7761 8.22386 18 8.5 18H15.5C15.7761 18 16 17.7761 16 17.5V11.5C16 11.2239 16.2239 11 16.5 11C16.7761 11 17 11.2239 17 11.5V17.5C17 18.3284 16.3284 19 15.5 19H8.5C7.67157 19 7 18.3284 7 17.5V6.5C7 5.67157 7.67157 5 8.5 5H12.5ZM13 9H15.293L13 6.70703V9Z",os=({className:t})=>ts("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ts("path",{d:R1,fill:"currentColor"})});import{jsx as ns}from"react/jsx-runtime";import"react";var rs={default:"M6 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .496.5h12.008a.5.5 0 0 0 .496-.5v-1A.5.5 0 0 0 18 5zM4.5 6.5a1.5 1.5 0 0 0 1.037 1.427L5.725 10H5a.5.5 0 0 0 0 1h.816l.653 7.181A2 2 0 0 0 8.46 20h7.078a2 2 0 0 0 1.992-1.819L18.184 11H19a.5.5 0 0 0 0-1h-.725l.188-2.073A1.5 1.5 0 0 0 19.5 6.5v-1A1.5 1.5 0 0 0 18 4H6a1.5 1.5 0 0 0-1.5 1.5zm2.965 11.59L6.548 8h10.905l-.918 10.09a1 1 0 0 1-.996.91H8.461a1 1 0 0 1-.996-.91M11 10.5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0zm3 0a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z",small:"M6.5 7a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-.039l-.08 1H17a.5.5 0 0 1 0 1h-.7l-.455 5.62A1.5 1.5 0 0 1 14.35 18h-4.7a1.5 1.5 0 0 1-1.495-1.38L7.7 11H7a.5.5 0 0 1 0-1h.62l-.081-1H7.5a1 1 0 0 1-1-1zm9.494 1h.506V7h-9v1zm-.536 1H8.542l.61 7.54a.5.5 0 0 0 .498.46h4.7a.5.5 0 0 0 .499-.46zM11.5 11.5a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0zm2 0a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0z"},ls=({className:t,small:e})=>ns("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ns("path",{clipRule:"evenodd",d:e?rs.small:rs.default,fill:"currentColor",fillRule:"evenodd"})});function mo(t,e,o,n=10,r=5){let l=o.parentElement;if(t===null||l==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let s=o.getBoundingClientRect(),i=l.getBoundingClientRect(),c=t.top-n,u=t.left-r;e.style.width="max-content",e.style.maxWidth="none";let d=e.scrollWidth,a=i.right-u,p=u-i.left,m;if(d<=a)m=e.getBoundingClientRect();else{let f=p+t.width,h=p>a,C=Math.min(d,h?f:a);C<d&&(e.style.width=`${C}px`,e.style.maxWidth=`${C}px`,e.offsetHeight),h&&(u=t.right-C),m=e.getBoundingClientRect()}c<i.top&&(c+=m.height+t.height+n*2),u+m.width>i.right&&(u=i.right-m.width-r),c-=s.top,u-=s.left,e.style.opacity="1",e.style.transform=`translate(${u}px, ${c}px)`}import{createCommand as v1}from"lexical";var po=v1("TOGGLE_LINK_WITH_MODAL_COMMAND");function fs(t){t.preventDefault()}function hs({anchorElem:t}){let[e]=I1(),[o,n]=Ge(),r=ps(null),l=ps(null),[s,i]=Ge(null),[c,u]=Ge(null),{fieldProps:{schemaPath:d},uuid:a}=U(),p=M1(),{config:m,getEntityConfig:f}=D1(),{i18n:h,t:g}=F1(),[C,E]=Ge(),L=$1(),[x,b]=Ge(!1),[k,_]=Ge([]),T=O1(),[I,N]=Ge(!1),w=A1({slug:"lexical-rich-text-link-"+a,depth:L}),{toggleDrawer:y}=De(w),S=ms(()=>{b(!1),r&&r.current&&(r.current.style.opacity="0",r.current.style.transform="translate(-10000px, -10000px)"),N(!1),i(null),u(null),_([]),E(void 0)},[b,i,u,_]),R=ms(()=>{let v=cs(),D;if(!us(v)||!v){S();return}let F=it(v);D=e.getElementByKey(F.getKey())?.getBoundingClientRect();let M=is(F,X),B=v.getNodes().filter(ie=>!j1(ie)).find(ie=>{let me=is(ie,X);return M&&!M.is(me)||me&&!me.is(M)});if(M==null||B){S();return}n(M);let $=M.getFields(),P={...$,id:M.getID(),text:M.getTextContent()};if($?.linkType==="custom")i($?.url??null),u(null);else{i(`${m.routes.admin==="/"?"":m.routes.admin}/collections/${$?.doc?.relationTo}/${$?.doc?.value}`);let ie=$?.doc?.relationTo?f({collectionSlug:$?.doc?.relationTo}):void 0;if(!ie)u($?.label?String($?.label):null),i($?.url?String($?.url):null);else{let me=typeof $.doc?.value=="object"?$.doc.value.id:$.doc?.value,Ct=$.doc?.relationTo;if(!me||!Ct)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let Wt=g("fields:linkedTo",{label:`${Rn(ie.labels.singular,h)} - ${g("lexical:link:loadingWithEllipsis",h)}`}).replace(/<[^>]*>?/g,"");u(Wt),B1.get(V1({apiRoute:m.routes.api,path:`/${Ct}/${me}`,serverURL:m.serverURL}),{headers:{"Accept-Language":h.language},params:{depth:0,locale:T?.code}}).then(async ce=>{if(!ce.ok)throw new Error(`HTTP error! Status: ${ce.status}`);let Ae=await ce.json(),Vt=ie?.admin?.useAsTitle||"id",Ho=Ae[Vt],bt=g("fields:linkedTo",{label:`${Rn(ie.labels.singular,h)} - ${Ho}`}).replace(/<[^>]*>?/g,"");u(bt)}).catch(()=>{let ce=g("fields:linkedTo",{label:`${Rn(ie.labels.singular,h)} - ${g("general:untitled",h)} - ID: ${me}`}).replace(/<[^>]*>?/g,"");u(ce)})}}E(P),b(!0),_(v?v?.getNodes():[]),Ee(M)?N(!0):N(!1);let V=r.current,Xe=G1(e._window),{activeElement:xt}=document;if(V===null)return;let Ye=e.getRootElement();return Xe!==null&&Ye!==null&&Ye.contains(Xe.anchorNode)?(D||(D=Xe.getRangeAt(0).getBoundingClientRect()),D!=null&&(D.y+=40,l.current=D)):(xt==null||xt.className!=="link-input")&&(Ye!==null&&mo(null,V,t),i(null),u(null)),!0},[e,S,m.routes.admin,m.routes.api,m.serverURL,f,g,h,T?.code,t]);return fo(()=>ss(e.registerCommand(po,v=>(e.dispatchCommand(fe,v),R(),y(),!0),ds)),[e,R,y,w]),fo(()=>{let v=t.parentElement,D=()=>{e.getEditorState().read(()=>{R()})};return window.addEventListener("resize",D),v?.addEventListener("scroll",D),()=>{window.removeEventListener("resize",D),v?.removeEventListener("scroll",D)}},[t.parentElement,e,R]),fo(()=>ss(e.registerUpdateListener(({editorState:v})=>{v.read(()=>{R()})}),e.registerCommand(W1,()=>(H1(()=>e.read("latest",R)),!0),ds),e.registerCommand(U1,v=>x?(v.preventDefault(),v.stopImmediatePropagation(),S(),!0):!1,z1)),[e,R,x,S]),fo(()=>{e.getEditorState().read(()=>{R()})},[e,R]),J1(()=>{!x||!r.current||!t||!l.current||mo(l.current,r.current,t)},[s,c,x,t,o]),ze(K1.Fragment,{children:[re("div",{className:"link-editor","data-theme":"dark",hidden:!x,ref:r,children:ze("div",{className:"link-input",children:[o?.__fields?.linkType==="custom"?re(ao,{}):re(os,{}),s&&s.length>0?ze("a",{className:"link-input__url",href:s,rel:"noopener noreferrer",target:"_blank",children:[c!=null&&c.length>0?c:s,o?.__fields.newTab?ze(yn,{children:[re(as,{size:16})," ",re("div",{className:"link-input__divider"})," "]}):null]}):c!=null&&c.length>0?ze(yn,{children:[re("span",{className:"link-input__label-pure",children:c}),o?.__fields.newTab?ze(yn,{children:[re(as,{size:16})," ",re("div",{className:"link-input__divider"})," "]}):null]}):null,p&&ze("div",{className:"link-input__actions",children:[re("button",{"aria-label":"Edit link",className:"link-edit",onClick:v=>{v.preventDefault(),y()},onMouseDown:fs,tabIndex:0,type:"button",children:re(P1,{})}),!I&&re("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(fe,null)},onMouseDown:fs,tabIndex:0,type:"button",children:re(ls,{small:!0})})]})]})}),re(Ko,{className:"lexical-link-edit-drawer",data:C,drawerSlug:w,drawerTitle:g("fields:editLink"),featureKey:"link",handleDrawerSubmit:(v,D)=>{let F=D,M={...F};delete M.text,e.update(()=>{let B=cs(),$=null;if(us(B)?$=it(B).getParent():k.length&&($=k[0]?.getParent()??null),$&&Ee($)){let P=_e({fields:M});$.replace(P,!0)}}),e.dispatchCommand(fe,{fields:M,selectedNodes:k,text:F.text})},schemaPath:d,schemaPathSuffix:"fields"})]})}var gs=t=>{let{anchorElem:e=document.body}=t;return Y1(X1(hs,{anchorElem:e}),e)};import{c as Z1}from"react/compiler-runtime";import{useLexicalComposerContext as q1}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Q1}from"@lexical/utils";import{$getSelection as e0,$isElementNode as t0,$isRangeSelection as o0,COMMAND_PRIORITY_LOW as xs,PASTE_COMMAND as n0}from"lexical";import{useEffect as r0}from"react";var Cs=t=>{let e=Z1(5),{clientProps:o}=t,[n]=q1(),r,l;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==n?(r=()=>{if(!n.hasNodes([ne]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Q1(n.registerCommand(fe,s=>s===null?(Sn(null),!0):(s.fields?.linkType||(s.fields.linkType=o.defaultLinkType),s.fields?.url||(s.fields.url=o.defaultLinkURL),Sn(s),!0),xs),n.registerCommand(n0,s=>{let i=e0();if(!o0(i)||i.isCollapsed()||!(s instanceof ClipboardEvent)||s.clipboardData==null)return!1;let c=s.clipboardData.getData("text");if(!ji(c))return!1;if(!i.getNodes().some(l0)){let u={doc:null,linkType:"custom",newTab:!1,url:c};return n.dispatchCommand(fe,{fields:u,text:null}),s.preventDefault(),!0}return!1},xs))},l=[o.defaultLinkType,o.defaultLinkURL,n],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=n,e[3]=r,e[4]=l):(r=e[3],l=e[4]),r0(r,l),null};function l0(t){return t0(t)}var ks=[_n([{ChildComponent:ao,isActive:({selection:t})=>{if(bs(t)){let e=it(t);return i0(e,X)!=null}return!1},isEnabled:({selection:t})=>!!(bs(t)&&vn()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(fe,null);else{let o,n=[];if(t.getEditorState().read(()=>{o=vn()?.getTextContent(),n=vn()?.getNodes()??[]}),!o?.length)return;let r={doc:null};t.dispatchCommand(po,{fields:r,selectedNodes:n,text:o})}},order:1}])],s0=A(({props:t})=>({markdownTransformers:[Ui],nodes:[ne,t?.disableAutoLinks===!0?null:Te].filter(Boolean),plugins:[{Component:Cs,position:"normal"},t?.disableAutoLinks===!0||t?.disableAutoLinks==="creationOnly"?null:{Component:Qi,position:"normal"},{Component:es,position:"normal"},{Component:gs,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:ks},toolbarInline:{groups:ks}}));import{$isListNode as Mn,INSERT_CHECK_LIST_COMMAND as ws,ListItemNode as p0,ListNode as f0}from"@lexical/list";import{CHECK_LIST as h0}from"@lexical/markdown";import{$isRangeSelection as g0}from"lexical";import{jsx as _s}from"react/jsx-runtime";import"react";var a0={16:"M5.584 8.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.076l-1-1a.5.5 0 1 1 .708-.707l.568.569zM13 10a.5.5 0 0 1 0 1H8a.5.5 0 0 1 0-1zM5.583 3.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.076l-1-1a.5.5 0 0 1 .708-.707l.568.569zM13 5a.5.5 0 1 1 0 1H8a.5.5 0 0 1 0-1z",24:"M9.084 15.223a.5.5 0 1 1 .832.554l-2 3a.5.5 0 0 1-.77.076l-1-1a.5.5 0 1 1 .708-.707l.568.569zM17.5 17a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1zm-8.416-6.777a.5.5 0 0 1 .832.554l-2 3a.5.5 0 0 1-.77.077l-1-1a.5.5 0 1 1 .708-.707l.568.568zM17.5 12a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1zM9.084 5.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.077l-1-1a.5.5 0 1 1 .708-.708l.568.569zM17.5 7a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1z"},In=({className:t,size:e=24})=>_s("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:_s("path",{d:a0[e],fill:"currentColor"})});import{jsx as c0}from"react/jsx-runtime";import{ListPlugin as u0}from"@lexical/react/LexicalListPlugin.js";import"react";var st=()=>c0(u0,{});function ho(t,e){return t==="ordered"?!e.has("unorderedList"):t==="checklist"?!e.has("unorderedList")&&!e.has("orderedList"):!1}function at(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{jsx as d0}from"react/jsx-runtime";import{CheckListPlugin as m0}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var Ts=()=>d0(m0,{});var Es=[oe([{ChildComponent:In,isActive:({selection:t})=>{if(!g0(t))return!1;for(let e of t.getNodes()){if(Mn(e)&&e.getListType()==="check")continue;let o=e.getParent();if(Mn(o)&&o.getListType()==="check")continue;let n=o?.getParent();if(!(Mn(n)&&n.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(ws,void 0)},order:12}])],x0=A(({featureProviderMap:t})=>{let e=[{Component:Ts,position:"normal"}],o=ho("checklist",t);return o&&e.push({Component:st,position:"normal"}),{markdownTransformers:[h0],nodes:o?[f0,p0]:[],plugins:e,slashMenu:{groups:[at([{Icon:In,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:n})=>n.t("lexical:checklist:label"),onSelect:({editor:n})=>{n.dispatchCommand(ws,void 0)}}])]},toolbarFixed:{groups:Es},toolbarInline:{groups:Es}}});import{$isListNode as Dn,INSERT_ORDERED_LIST_COMMAND as Ls,ListItemNode as b0,ListNode as k0}from"@lexical/list";import{ORDERED_LIST as _0}from"@lexical/markdown";import{$isRangeSelection as T0}from"lexical";import{jsx as Ss}from"react/jsx-runtime";import"react";var C0={16:"M5.6 9.01a.5.5 0 0 1 .4.49v1a.5.5 0 0 1-.276.447L4 11.81V12h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-1l.005-.07a.5.5 0 0 1 .271-.377L5 10.19V10H3.5a.5.5 0 0 1 0-1h2zM12.5 12a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1zm0-4.5a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1zM4.6 3.01a.5.5 0 0 1 .4.49v3a.5.5 0 0 1-1 0V4h-.5a.5.5 0 0 1 0-1h1zM12.5 3a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1z",24:"M11 7a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6A.5.5 0 0 1 11 7M6 7a.5.5 0 0 1 .5-.5h1A.5.5 0 0 1 8 7v3.5a.5.5 0 1 1-1 0v-3h-.5A.5.5 0 0 1 6 7m0 6.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.276.447L7 16.31v.191h1.5a.5.5 0 0 1 0 1h-2A.5.5 0 0 1 6 17v-1a.5.5 0 0 1 .276-.447L8 14.69V14H6.5a.5.5 0 0 1-.5-.5m5.5 3a.5.5 0 1 0 0 1h6a.5.5 0 0 0 0-1zm0-5a.5.5 0 1 0 0 1h6a.5.5 0 0 0 0-1z"},An=({className:t,size:e=24})=>Ss("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ss("path",{clipRule:"evenodd",d:C0[e],fill:"currentColor",fillRule:"evenodd"})});var Ns=[oe([{ChildComponent:An,isActive:({selection:t})=>{if(!T0(t))return!1;for(let e of t.getNodes()){if(Dn(e)&&e.getListType()==="number")continue;let o=e.getParent();if(Dn(o)&&o.getListType()==="number")continue;let n=o?.getParent();if(!(Dn(n)&&n.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ls,void 0)},order:10}])],E0=A(({featureProviderMap:t})=>{let e=ho("ordered",t);return{markdownTransformers:[_0],nodes:e?[k0,b0]:[],plugins:e?[{Component:st,position:"normal"}]:[],slashMenu:{groups:[at([{Icon:An,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:o})=>o.t("lexical:orderedList:label"),onSelect:({editor:o})=>{o.dispatchCommand(Ls,void 0)}}])]},toolbarFixed:{groups:Ns},toolbarInline:{groups:Ns}}});import{$isListNode as On,INSERT_UNORDERED_LIST_COMMAND as vs,ListItemNode as S0,ListNode as N0}from"@lexical/list";import{UNORDERED_LIST as L0}from"@lexical/markdown";import{$isRangeSelection as y0}from"lexical";import{jsx as ys}from"react/jsx-runtime";import"react";var w0="M7 16C7.55228 16 8 16.4477 8 17C8 17.5523 7.55228 18 7 18C6.44772 18 6 17.5523 6 17C6 16.4477 6.44772 16 7 16ZM17.5 16.5C17.7761 16.5 18 16.7239 18 17C18 17.2761 17.7761 17.5 17.5 17.5H10.5C10.2239 17.5 10 17.2761 10 17C10 16.7239 10.2239 16.5 10.5 16.5H17.5ZM7 11C7.55228 11 8 11.4477 8 12C8 12.5523 7.55228 13 7 13C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11ZM17.5 11.5C17.7761 11.5 18 11.7239 18 12C18 12.2761 17.7761 12.5 17.5 12.5H10.5C10.2239 12.5 10 12.2761 10 12C10 11.7239 10.2239 11.5 10.5 11.5H17.5ZM7 6C7.55228 6 8 6.44772 8 7C8 7.55228 7.55228 8 7 8C6.44772 8 6 7.55228 6 7C6 6.44772 6.44772 6 7 6ZM17.5 6.5C17.7761 6.5 18 6.72386 18 7C18 7.27614 17.7761 7.5 17.5 7.5H10.5C10.2239 7.5 10 7.27614 10 7C10 6.72386 10.2239 6.5 10.5 6.5H17.5Z",$n=({className:t})=>ys("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ys("path",{d:w0,fill:"currentColor"})});var Rs=[oe([{ChildComponent:$n,isActive:({selection:t})=>{if(!y0(t))return!1;for(let e of t.getNodes()){if(On(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(On(o)&&o.getListType()==="bullet")continue;let n=o?.getParent();if(!(On(n)&&n.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(vs,void 0)},order:11}])],R0=A({markdownTransformers:[L0],nodes:[N0,S0],plugins:[{Component:st,position:"normal"}],slashMenu:{groups:[at([{Icon:$n,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(vs,void 0)}}])]},toolbarFixed:{groups:Rs},toolbarInline:{groups:Rs}});import{$setBlocksType as As}from"@lexical/selection";import{$createParagraphNode as Ds,$getSelection as $s,$isParagraphNode as Is,$isRangeSelection as v0}from"lexical";var Ms=[oe([{ChildComponent:Nt,isActive:({selection:t})=>{if(!v0(t))return!1;for(let e of t.getNodes())if(!Is(e)&&!Is(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=$s();As(e,()=>Ds())})},order:1}])],I0=A({slashMenu:{groups:[q([{Icon:Nt,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=$s();As(e,()=>Ds())})}}])]},toolbarFixed:{groups:Ms},toolbarInline:{groups:Ms}});import{c as eh}from"react/compiler-runtime";import{jsx as na}from"react/jsx-runtime";import{useLexicalComposerContext as th}from"@lexical/react/LexicalComposerContext";import{useEffect as oh,useState as nh}from"react";import{jsx as oa,Fragment as Q0}from"react/jsx-runtime";import"react";import{jsx as M0}from"react/jsx-runtime";var Os={quote:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return M0("blockquote",{children:o})}};import{jsx as A0}from"react/jsx-runtime";var Fs=new Set(["h1","h2","h3","h4","h5","h6"]);var Ps={heading:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=Fs.has(t.tag)?t.tag:"h1";return A0(n,{children:o})}};import{jsx as D0}from"react/jsx-runtime";var Bs={horizontalrule:D0("hr",{})};import{jsx as $0}from"react/jsx-runtime";var js={linebreak:$0("br",{})};import{jsx as Hs}from"react/jsx-runtime";var zs=({internalDocToHref:t})=>({autolink:({node:e,nodesToJSX:o})=>{let n=o({nodes:e.children}),r=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0;return Hs("a",{href:e.fields.url,rel:r,target:l,children:n})},link:({node:e,nodesToJSX:o})=>{let n=o({nodes:e.children}),r=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0,s=e.fields.url??"";return e.fields.linkType==="internal"&&(t?s=t({linkNode:e}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),s="#")),Hs("a",{href:s,rel:r,target:l,children:n})}});import{jsx as ct,jsxs as O0,Fragment as F0}from"react/jsx-runtime";import{v4 as P0}from"uuid";var Gs=new Set(["ol","ul"]);var Us={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=Gs.has(t.tag)?t.tag:"ul";return ct(n,{className:`list-${t?.listType}`,children:o})},listitem:({node:t,nodesToJSX:e,parent:o})=>{let n=t.children.some(l=>l.type==="list"),r=e({nodes:t.children});if("listType"in o&&o?.listType==="check"){let l=P0();return ct("li",{"aria-checked":t.checked?"true":"false",className:`list-item-checkbox${t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${n?" nestedListItem":""}`,role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:t?.value,children:n?r:O0(F0,{children:[ct("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),ct("label",{htmlFor:l,children:r}),ct("br",{})]})})}else return ct("li",{className:`${n?"nestedListItem":""}`,style:n?{listStyleType:"none"}:void 0,value:t?.value,children:r})}};import{jsx as Fn}from"react/jsx-runtime";var Ws={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?Fn("p",{children:o}):Fn("p",{children:Fn("br",{})})}};var Vs={tab:" "};import{jsx as $t}from"react/jsx-runtime";var Ks={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return $t("div",{className:"lexical-table-container",children:$t("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:$t("tbody",{children:o})})})},tablecell:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=t.headerState>0?"th":"td",r=`lexical-table-cell-header-${t.headerState}`,l={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},s=t.colSpan&&t.colSpan>1?t.colSpan:void 0,i=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return $t(n,{className:`lexical-table-cell ${r}`,colSpan:s,rowSpan:i,style:l,children:o})},tablerow:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return $t("tr",{className:"lexical-table-row",children:o})}};import{jsx as Ue}from"react/jsx-runtime";import"react";var O={DOM_ELEMENT_TYPE:1,DOM_TEXT_TYPE:3,NO_DIRTY_NODES:0,HAS_DIRTY_NODES:1,FULL_RECONCILE:2,IS_NORMAL:0,IS_TOKEN:1,IS_SEGMENTED:2,IS_INERT:3,IS_BOLD:1,IS_ITALIC:2,IS_STRIKETHROUGH:4,IS_UNDERLINE:8,IS_CODE:16,IS_SUBSCRIPT:32,IS_SUPERSCRIPT:64,IS_HIGHLIGHT:128,IS_DIRECTIONLESS:1,IS_UNMERGEABLE:2,IS_ALIGN_LEFT:1,IS_ALIGN_CENTER:2,IS_ALIGN_RIGHT:3,IS_ALIGN_JUSTIFY:4,IS_ALIGN_START:5,IS_ALIGN_END:6},B0=O.IS_BOLD|O.IS_ITALIC|O.IS_STRIKETHROUGH|O.IS_UNDERLINE|O.IS_CODE|O.IS_SUBSCRIPT|O.IS_SUPERSCRIPT|O.IS_HIGHLIGHT,j0="\xA0",H0=`
56
56
 
57
- `,Is="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Ms="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",c0=new RegExp("^[^"+Ms+"]*["+Is+"]"),u0=new RegExp("^[^"+Is+"]*["+Ms+"]"),d0={bold:O.IS_BOLD,code:O.IS_CODE,highlight:O.IS_HIGHLIGHT,italic:O.IS_ITALIC,strikethrough:O.IS_STRIKETHROUGH,subscript:O.IS_SUBSCRIPT,superscript:O.IS_SUPERSCRIPT,underline:O.IS_UNDERLINE},m0={directionless:O.IS_DIRECTIONLESS,unmergeable:O.IS_UNMERGEABLE},p0={center:O.IS_ALIGN_CENTER,end:O.IS_ALIGN_END,justify:O.IS_ALIGN_JUSTIFY,left:O.IS_ALIGN_LEFT,right:O.IS_ALIGN_RIGHT,start:O.IS_ALIGN_START},f0={[O.IS_ALIGN_CENTER]:"center",[O.IS_ALIGN_END]:"end",[O.IS_ALIGN_JUSTIFY]:"justify",[O.IS_ALIGN_LEFT]:"left",[O.IS_ALIGN_RIGHT]:"right",[O.IS_ALIGN_START]:"start"},h0={normal:O.IS_NORMAL,segmented:O.IS_SEGMENTED,token:O.IS_TOKEN},g0={[O.IS_NORMAL]:"normal",[O.IS_SEGMENTED]:"segmented",[O.IS_TOKEN]:"token"};var As={text:({node:t})=>{let e=t.text;return t.format&O.IS_BOLD&&(e=We("strong",{children:e})),t.format&O.IS_ITALIC&&(e=We("em",{children:e})),t.format&O.IS_STRIKETHROUGH&&(e=We("span",{style:{textDecoration:"line-through"},children:e})),t.format&O.IS_UNDERLINE&&(e=We("span",{style:{textDecoration:"underline"},children:e})),t.format&O.IS_CODE&&(e=We("code",{children:e})),t.format&O.IS_SUBSCRIPT&&(e=We("sub",{children:e})),t.format&O.IS_SUPERSCRIPT&&(e=We("sup",{children:e})),e}};import{jsx as It}from"react/jsx-runtime";var $s={upload:({node:t})=>{let e=t;if(typeof e.value!="object")return null;let o=e.value,n=e.fields?.alt||o?.alt||"",r=o.url;if(!o.mimeType.startsWith("image"))return It("a",{href:r,rel:"noopener noreferrer",children:o.filename});if(!o.sizes||!Object.keys(o.sizes).length)return It("img",{alt:n,height:o.height,src:r,width:o.width});let l=[];for(let s in o.sizes){let i=o.sizes[s];if(!i||!i.width||!i.height||!i.mimeType||!i.filesize||!i.filename||!i.url)continue;let u=i?.url;l.push(It("source",{media:`(max-width: ${i.width}px)`,srcSet:u,type:i.mimeType},s))}return l.push(It("img",{alt:n,height:o?.height,src:r,width:o?.width},"image")),It("picture",{children:l})}};var st={...ys,...As,...Es,..._s,...Rs,...Ts,...ws,...Ls,...Ns({}),...$s,...vs};import{jsx as co,Fragment as x0}from"react/jsx-runtime";import ao from"react";function Ds(t){if(!!!t?.root?.children?.length)return!1;let o=!1;if(t?.root?.children?.length===1&&t?.root?.children[0]?.type==="paragraph"){let n=t?.root?.children[0];if(!n?.children||n?.children?.length===0)o=!0;else if(n?.children?.length===1){let r=n?.children[0];r?.type==="text"&&(r?.text?.length||(o=!0))}}return!o}function C0(t){return e=>{let o={...e,isEditor:!1,isJSXConverter:!0};if(t.Component)return t.Component(o);if(t.html){let n=typeof t.html=="function"?t.html(o):t.html;return co("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function Os(t){return e=>{if(t.Component){let o={...e,isEditor:!1,isJSXConverter:!0};return t.Component(o)}if(t.Block){let o=e.node,n={childIndex:e.childIndex,converters:e.converters,formData:o.fields??{},isEditor:!1,isJSXConverter:!0,node:o,nodesToJSX:e.nodesToJSX,parent:e.parent};return ao.createElement(t.Block,n)}if(t.html){let o={...e,isEditor:!1,isJSXConverter:!0},n=typeof t.html=="function"?t.html(o):t.html;return co("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function b0(t){let e={};for(let[o,n]of Object.entries(t)){if(!n||typeof n!="object")continue;if(o==="blocks"){e.blocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.blocks[l]=Os(i))}continue}if(o==="inlineBlocks"){e.inlineBlocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.inlineBlocks[l]=Os(i))}continue}let r=n;(r.Component||r.html)&&(e[o]=C0(r))}return e}function Fs({converters:t,data:e,disableIndent:o,disableTextAlign:n,nodeMap:r}){if(Ds(e)){let l=r?b0(r):void 0,s=l?{...t,...l,blocks:{...t.blocks,...l.blocks},inlineBlocks:{...t.inlineBlocks,...l.inlineBlocks}}:t;return Ps({converters:s,disableIndent:o,disableTextAlign:n,nodes:e.root.children,parent:e.root})}return co(x0,{})}function Ps({converters:t,disableIndent:e,disableTextAlign:o,nodes:n,parent:r}){let l=t.unknown;return n.map((i,u)=>{let d;i.type==="block"?(d=t?.blocks?.[i?.fields?.blockType],!d&&!l&&console.error(`Lexical => JSX converter: Blocks converter: found ${i?.fields?.blockType} block, but no converter is provided`)):i.type==="inlineBlock"?(d=t?.inlineBlocks?.[i?.fields?.blockType],!d&&!l&&console.error(`Lexical => JSX converter: Inline Blocks converter: found ${i?.fields?.blockType} inline block, but no converter is provided`)):d=t[i.type];try{!d&&l&&(d=l);let c;d?c=typeof d=="function"?d({childIndex:u,converters:t,node:i,nodesToJSX:p=>Ps({converters:p.converters??t,disableIndent:p.disableIndent??e,disableTextAlign:p.disableTextAlign??o,nodes:p.nodes,parent:p.parent??{...i,parent:r}}),parent:r}):d:c=co("span",{children:"unknown node"},u);let a={};if(!o&&(!Array.isArray(o)||!o?.includes(i.type))&&"format"in i&&i.format)switch(i.format){case"center":a.textAlign="center";break;case"end":a.textAlign="right";break;case"justify":a.textAlign="justify";break;case"left":break;case"right":a.textAlign="right";break;case"start":a.textAlign="left";break}if(!e&&(!Array.isArray(e)||!e?.includes(i.type))&&"indent"in i&&i.indent&&i.type!=="listitem"&&(a.paddingInlineStart=`${Number(i.indent)*40}px`),ao.isValidElement(c)){if(a.textAlign||a.paddingInlineStart){let m={...a,...c?.props?.style??{}};return ao.cloneElement(c,{key:u,style:m})}return ao.cloneElement(c,{key:u})}return c}catch(c){return console.error("Error converting lexical node to JSX:",c,"node:",i),null}}).filter(Boolean)}function wn({className:t,converters:e,data:o,disableContainer:n,disableIndent:r,disableTextAlign:l,nodeMap:s}){if(!o)return null;let i=e,u={};i?typeof i=="function"?u=i({defaultConverters:st}):u=i:u=st;let d=o&&!Array.isArray(o)&&typeof o=="object"&&"root"in o&&Fs({converters:u,data:o,disableIndent:r,disableTextAlign:l,nodeMap:s});return n?Bs(k0,{children:d}):Bs("div",{className:t??"payload-richtext",children:d})}function Hs(){let t=_0(7),[e]=T0(),o;t[0]!==e?(o=()=>e.getEditorState().toJSON(),t[0]=e,t[1]=o):o=t[1];let[n,r]=E0(o),l,s;t[2]!==e?(l=()=>e.registerUpdateListener(u=>{let{editorState:d}=u;r(d.toJSON())}),s=[e],t[2]=e,t[3]=l,t[4]=s):(l=t[3],s=t[4]),w0(l,s);let i;return t[5]!==n?(i=js("div",{className:"debug-jsx-converter",children:js(wn,{converters:st,data:n})}),t[5]=n,t[6]=i):i=t[6],i}var S0=A({plugins:[{Component:Hs,position:"bottom"}]});var H={amber:{50:"oklch(0.987 0.022 95.277)",100:"oklch(0.962 0.059 95.617)",200:"oklch(0.924 0.12 95.746)",300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",800:"oklch(0.473 0.137 46.201)",900:"oklch(0.414 0.112 45.904)",950:"oklch(0.279 0.077 45.635)"},black:"#000",blue:{50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},current:"currentColor",cyan:{50:"oklch(0.984 0.019 200.873)",100:"oklch(0.956 0.045 203.388)",200:"oklch(0.917 0.08 205.041)",300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)",800:"oklch(0.45 0.085 224.283)",900:"oklch(0.398 0.07 227.392)",950:"oklch(0.302 0.056 229.695)"},emerald:{50:"oklch(0.979 0.021 166.113)",100:"oklch(0.95 0.052 163.051)",200:"oklch(0.905 0.093 164.15)",300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)",800:"oklch(0.432 0.095 166.913)",900:"oklch(0.378 0.077 168.94)",950:"oklch(0.262 0.051 172.552)"},fuchsia:{50:"oklch(0.977 0.017 320.058)",100:"oklch(0.952 0.037 318.852)",200:"oklch(0.903 0.076 319.62)",300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)",800:"oklch(0.452 0.211 324.591)",900:"oklch(0.401 0.17 325.612)",950:"oklch(0.293 0.136 325.661)"},gray:{50:"oklch(0.985 0.002 247.839)",100:"oklch(0.967 0.003 264.542)",200:"oklch(0.928 0.006 264.531)",300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",800:"oklch(0.278 0.033 256.848)",900:"oklch(0.21 0.034 264.665)",950:"oklch(0.13 0.028 261.692)"},green:{50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},indigo:{50:"oklch(0.962 0.018 272.314)",100:"oklch(0.93 0.034 272.788)",200:"oklch(0.87 0.065 274.039)",300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)",800:"oklch(0.398 0.195 277.366)",900:"oklch(0.359 0.144 278.697)",950:"oklch(0.257 0.09 281.288)"},inherit:"inherit",lime:{50:"oklch(0.986 0.031 120.757)",100:"oklch(0.967 0.067 122.328)",200:"oklch(0.938 0.127 124.321)",300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",800:"oklch(0.453 0.124 130.933)",900:"oklch(0.405 0.101 131.063)",950:"oklch(0.274 0.072 132.109)"},neutral:{50:"oklch(0.985 0 0)",100:"oklch(0.97 0 0)",200:"oklch(0.922 0 0)",300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",800:"oklch(0.269 0 0)",900:"oklch(0.205 0 0)",950:"oklch(0.145 0 0)"},orange:{50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},pink:{50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},purple:{50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717)"},red:{50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},rose:{50:"oklch(0.969 0.015 12.422)",100:"oklch(0.941 0.03 12.58)",200:"oklch(0.892 0.058 10.001)",300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)",800:"oklch(0.455 0.188 13.697)",900:"oklch(0.41 0.159 10.272)",950:"oklch(0.271 0.105 12.094)"},sky:{50:"oklch(0.977 0.013 236.62)",100:"oklch(0.951 0.026 236.824)",200:"oklch(0.901 0.058 230.902)",300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)",800:"oklch(0.443 0.11 240.79)",900:"oklch(0.391 0.09 240.876)",950:"oklch(0.293 0.066 243.157)"},slate:{50:"oklch(0.984 0.003 247.858)",100:"oklch(0.968 0.007 247.896)",200:"oklch(0.929 0.013 255.508)",300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",800:"oklch(0.279 0.041 260.031)",900:"oklch(0.208 0.042 265.755)",950:"oklch(0.129 0.042 264.695)"},stone:{50:"oklch(0.985 0.001 106.423)",100:"oklch(0.97 0.001 106.424)",200:"oklch(0.923 0.003 48.717)",300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",800:"oklch(0.268 0.007 34.298)",900:"oklch(0.216 0.006 56.043)",950:"oklch(0.147 0.004 49.25)"},teal:{50:"oklch(0.984 0.014 180.72)",100:"oklch(0.953 0.051 180.801)",200:"oklch(0.91 0.096 180.426)",300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)",800:"oklch(0.437 0.078 188.216)",900:"oklch(0.386 0.063 188.416)",950:"oklch(0.277 0.046 192.524)"},transparent:"transparent",violet:{50:"oklch(0.969 0.016 293.756)",100:"oklch(0.943 0.029 294.588)",200:"oklch(0.894 0.057 293.283)",300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)",800:"oklch(0.432 0.232 292.759)",900:"oklch(0.38 0.189 293.745)",950:"oklch(0.283 0.141 291.089)"},white:"#fff",yellow:{50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"},zinc:{50:"oklch(0.985 0 0)",100:"oklch(0.967 0.001 286.375)",200:"oklch(0.92 0.004 286.32)",300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",800:"oklch(0.274 0.006 286.033)",900:"oklch(0.21 0.006 285.885)",950:"oklch(0.141 0.005 285.823)"}},N0={text:{"text-red":{css:{color:`light-dark(${H.red[600]}, ${H.red[400]})`},label:"Red"},"text-orange":{css:{color:`light-dark(${H.orange[600]}, ${H.orange[400]})`},label:"Orange"},"text-yellow":{css:{color:`light-dark(${H.yellow[700]}, ${H.yellow[300]})`},label:"Yellow"},"text-green":{css:{color:`light-dark(${H.green[700]}, ${H.green[400]})`},label:"Green"},"text-blue":{css:{color:`light-dark(${H.blue[600]}, ${H.blue[400]})`},label:"Blue"},"text-purple":{css:{color:`light-dark(${H.purple[600]}, ${H.purple[400]})`},label:"Purple"},"text-pink":{css:{color:`light-dark(${H.pink[600]}, ${H.pink[400]})`},label:"Pink"}},background:{"bg-red":{css:{"background-color":`light-dark(${H.red[400]}, ${H.red[600]})`},label:"Red"},"bg-orange":{css:{"background-color":`light-dark(${H.orange[400]}, ${H.orange[600]})`},label:"Orange"},"bg-yellow":{css:{"background-color":`light-dark(${H.yellow[300]}, ${H.yellow[700]})`},label:"Yellow"},"bg-green":{css:{"background-color":`light-dark(${H.green[400]}, ${H.green[700]})`},label:"Green"},"bg-blue":{css:{"background-color":`light-dark(${H.blue[400]}, ${H.blue[600]})`},label:"Blue"},"bg-purple":{css:{"background-color":`light-dark(${H.purple[400]}, ${H.purple[600]})`},label:"Purple"},"bg-pink":{css:{"background-color":`light-dark(${H.pink[400]}, ${H.pink[600]})`},label:"Pink"}}};import{$isNodeSelection as fh}from"lexical";import{jsx as Gs}from"react/jsx-runtime";import"react";var L0="M9.5 6C9.77614 6 10 6.22386 10 6.5C10 6.77614 9.77614 7 9.5 7H7.5C7.22386 7 7 7.22386 7 7.5V16.5C7 16.7761 7.22386 17 7.5 17H16.5C16.7761 17 17 16.7761 17 16.5V14.5C17 14.2239 17.2239 14 17.5 14C17.7761 14 18 14.2239 18 14.5V16.5C18 17.3284 17.3284 18 16.5 18H7.5C6.67157 18 6 17.3284 6 16.5V7.5C6 6.67157 6.67157 6 7.5 6H9.5ZM17.5 6C17.7761 6 18 6.22386 18 6.5V11.5C18 11.7761 17.7761 12 17.5 12C17.2239 12 17 11.7761 17 11.5V7.70703L12.8535 11.8535C12.6583 12.0488 12.3417 12.0488 12.1465 11.8535C11.9512 11.6583 11.9512 11.3417 12.1465 11.1465L16.293 7H12.5C12.2239 7 12 6.77614 12 6.5C12 6.22386 12.2239 6 12.5 6H17.5Z",En=({className:t})=>Gs("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Gs("path",{d:L0,fill:"currentColor"})});import{jsx as M0}from"react/jsx-runtime";import{$applyNodeReplacement as A0}from"lexical";import*as Vs from"react";import{DecoratorBlockNode as y0}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as v0}from"@lexical/utils";import{$applyNodeReplacement as R0}from"lexical";function I0(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:Us({relationTo:o,value:e})}:null}var Mt=class extends y0{__data;constructor({data:e,format:o,key:n}){super(o,n),this.__data=e}static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"relationship"}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:I0,priority:2}}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id);let o={relationTo:e.relationTo,value:e.value},n=Us(o);return n.setFormat(e.format),n}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return v0(o,e?.theme?.relationship),o}decorate(e,o){return null}exportDOM(){let e=document.createElement("div");e.setAttribute("data-lexical-relationship-id",String(typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value)),e.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value}`}setData(e){let o=this.getWritable();o.__data=e}};function Us(t){return R0(new Mt({data:t}))}var $0=Vs.lazy(()=>import("./RelationshipComponent-YCPAKOL7.js").then(t=>({default:t.RelationshipComponent})));function D0(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:ze({relationTo:o,value:e})}:null}var Ne=class extends Mt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:D0,priority:2}}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id);let o={relationTo:e.relationTo,value:e.value},n=ze(o);return n.setFormat(e.format),n}decorate(e,o){return M0($0,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function ze(t){return A0(new Ne({data:t}))}function Sn(t){return t instanceof Ne}import{c as oh}from"react/compiler-runtime";import{jsx as nh}from"react/jsx-runtime";import{useLexicalComposerContext as rh}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as lh}from"@lexical/utils";import{$getPreviousSelection as ih,$getSelection as sh,$isParagraphNode as ah,$isRangeSelection as ch,COMMAND_PRIORITY_EDITOR as uh,createCommand as dh}from"lexical";import{useEffect as mh}from"react";import{c as Ks}from"react/compiler-runtime";import{jsx as Nn}from"react/jsx-runtime";import{useLexicalComposerContext as Js}from"@lexical/react/LexicalComposerContext.js";import{toast as K0}from"@payloadcms/ui";import{$getNodeByKey as J0,COMMAND_PRIORITY_EDITOR as Xs}from"lexical";import{useEffect as Zs,useState as X0}from"react";import{c as O0}from"react/compiler-runtime";import{jsx as F0}from"react/jsx-runtime";import{useLexicalComposerContext as P0}from"@lexical/react/LexicalComposerContext";import{useListDrawer as B0,useModal as j0}from"@payloadcms/ui";import{$getNodeByKey as Ws,$getPreviousSelection as H0,$getRoot as G0,$getSelection as U0,$isRangeSelection as V0,$setSelection as W0}from"lexical";import{useEffect as z0,useState as zs}from"react";var At=t=>{let e=O0(23),[o]=P0(),[n,r]=zs(null),[l,s]=zs(!1),[i,u,d]=B0(t),{closeDrawer:c,drawerSlug:a,isDrawerOpen:m,openDrawer:p}=d,{modalState:h}=j0(),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{let L=U0()??H0();r(L)},e[0]=f):f=e[0];let g=f,_;e[1]!==o||e[2]!==n?(_=()=>{n&&o.update(()=>{if(V0(n)){let{anchor:L,focus:S}=n;Ws(L.key)&&Ws(S.key)&&W0(n.clone())}else G0().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=n,e[3]=_):_=e[3];let E=_,R;e[4]!==c?(R=()=>{c()},e[4]=c,e[5]=R):R=e[5];let b=R,x,C;e[6]!==a||e[7]!==h||e[8]!==E||e[9]!==l?(x=()=>{if(!l)return;let L=h[a];L&&!L?.isOpen&&(s(!1),setTimeout(()=>{E()},1))},C=[h,a,E,l],e[6]=a,e[7]=h,e[8]=E,e[9]=l,e[10]=x,e[11]=C):(x=e[10],C=e[11]),z0(x,C);let k;e[12]!==u?(k=L=>F0(u,{...L,onClick:()=>{g()}}),e[12]=u,e[13]=k):k=e[13];let T;e[14]!==p?(T=()=>{g(),p(),s(!0)},e[14]=p,e[15]=T):T=e[15];let I;return e[16]!==i||e[17]!==b||e[18]!==m||e[19]!==a||e[20]!==k||e[21]!==T?(I={closeListDrawer:b,isListDrawerOpen:m,ListDrawer:i,listDrawerSlug:a,ListDrawerToggler:k,openListDrawer:T},e[16]=i,e[17]=b,e[18]=m,e[19]=a,e[20]=k,e[21]=T,e[22]=I):I=e[22],I};var Z0=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=J0(o);r&&r.replace(ze({relationTo:e,value:n}))}):t.dispatchCommand(Ln,{relationTo:e,value:n})},Y0=t=>{let e=Ks(14),{enabledCollectionSlugs:o}=t,[n]=Js(),[r,l]=X0(null),s=o?.[0],i;e[0]!==o||e[1]!==s?(i={collectionSlugs:o,selectedCollection:s},e[0]=o,e[1]=s,e[2]=i):i=e[2];let{closeListDrawer:u,ListDrawer:d,openListDrawer:c}=At(i),a,m;e[3]!==n||e[4]!==c?(a=()=>n.registerCommand(qe,g=>(l(g?.replace?g?.replace.nodeKey:null),c(),!0),Xs),m=[n,c],e[3]=n,e[4]=c,e[5]=a,e[6]=m):(a=e[5],m=e[6]),Zs(a,m);let p;e[7]!==u||e[8]!==n||e[9]!==r?(p=g=>{let{collectionSlug:_,doc:E}=g;Z0({editor:n,relationTo:_,replaceNodeKey:r,value:E.id}),u()},e[7]=u,e[8]=n,e[9]=r,e[10]=p):p=e[10];let h=p,f;return e[11]!==d||e[12]!==h?(f=Nn(d,{onSelect:h}),e[11]=d,e[12]=h,e[13]=f):f=e[13],f},q0=()=>{let t=Ks(3),[e]=Js(),o,n;return t[0]!==e?(o=()=>e.registerCommand(qe,Q0,Xs),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Zs(o,n),null},Ys=({enabledCollectionSlugs:t})=>t?.length?Nn(Y0,{enabledCollectionSlugs:t}):Nn(q0,{});function Q0(){return K0.error("No relationship collections enabled"),!0}import{useConfig as eh,useEntityVisibility as th}from"@payloadcms/ui";import*as Qs from"react";var qs=(t,{disabledCollections:e,enabledCollections:o,uploads:n,visibleSlugs:r})=>{let l=o?.length?new Set(o):null,s=e?.length?new Set(e):null;return t.filter(i=>{let{slug:u,admin:d,upload:c}=i;if(r&&!r.includes(u))return!1;if(n){if(!d?.enableRichTextRelationship||!c)return!1}else if(c||!d?.enableRichTextRelationship)return!1;return!(l&&!l.has(u)||s&&s.has(u))})};var uo=t=>{let{collectionSlugsBlacklist:e,collectionSlugsWhitelist:o,uploads:n=!1}=t||{},{config:{collections:r}}=eh(),{visibleEntities:l}=th();return Qs.useMemo(()=>{let s=qs(r,{disabledCollections:e,enabledCollections:o,uploads:n,visibleSlugs:l?.collections});return{enabledCollections:s,enabledCollectionSlugs:s.map(i=>i.slug)}},[r,l,n,o,e])};var Ln=dh("INSERT_RELATIONSHIP_COMMAND"),ea=t=>{let e=oh(8),{clientProps:o}=t,[n]=rh(),r=o?.disabledCollections,l=o?.enabledCollections,s;e[0]!==r||e[1]!==l?(s={collectionSlugsBlacklist:r,collectionSlugsWhitelist:l},e[0]=r,e[1]=l,e[2]=s):s=e[2];let{enabledCollectionSlugs:i}=uo(s),u,d;e[3]!==n?(u=()=>{if(!n.hasNodes([Ne]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return n.registerCommand(Ln,ph,uh)},d=[n],e[3]=n,e[4]=u,e[5]=d):(u=e[4],d=e[5]),mh(u,d);let c;return e[6]!==i?(c=nh(Ys,{enabledCollectionSlugs:i}),e[6]=i,e[7]=c):c=e[7],c};function ph(t){let e=sh()||ih();if(ch(e)){let o=ze(t),{focus:n}=e,r=n.getNode();lh(o),ah(r)&&!r.__first&&r.remove()}return!0}var hh=A({nodes:[Ne],plugins:[{Component:ea,position:"normal"}],slashMenu:{groups:[X([{Icon:En,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(qe,{replace:!1})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:En,isActive:({selection:t})=>{if(!fh(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Sn(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(qe,{replace:!1})}}])]}});import{c as Uh}from"react/compiler-runtime";import{jsx as fe,jsxs as Vh}from"react/jsx-runtime";import{useLexicalComposerContext as Wh}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as ua}from"@lexical/react/useLexicalEditable";import{useScrollInfo as zh,useThrottledEffect as Kh,useTranslation as Jh}from"@payloadcms/ui";import*as ho from"react";import{useMemo as Mn}from"react";import{jsx as gh,jsxs as xh}from"react/jsx-runtime";import{Tooltip as Ch,useTranslation as bh}from"@payloadcms/ui";import{$addUpdateTag as kh}from"lexical";import{useCallback as ta,useEffect as _h,useMemo as oa,useRef as Th,useState as wh}from"react";var yn="toolbar-popup__button",$t=({active:t=!1,children:e,editor:o,enabled:n=!0,item:r})=>{let{i18n:l}=bh(),{fieldProps:{featureClientSchemaMap:s,schemaPath:i}}=U(),[u,d]=wh(!1),c=Th(null);_h(()=>{c.current?.removeAttribute("data-pressing")},[t]);let a=oa(()=>r.label?typeof r.label=="function"?r.label({featureClientSchemaMap:s,i18n:l,schemaPath:i}):r.label:r.key.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,f=>f.toUpperCase()),[s,l,i,r]),m=oa(()=>[yn,n?"":"disabled",t?"active":"",r.key?`${yn}-${r.key}`:""].filter(Boolean).join(" "),[t,n,r.key]),p=ta(()=>{n&&o.focus(()=>{o.update(()=>{kh("toolbar")}),r.onSelect?.({editor:o,isActive:t})})},[o,r,t,n]),h=ta(f=>{f.preventDefault(),f.currentTarget.setAttribute("data-pressing","")},[]);return xh("button",{"aria-label":a,className:m,"data-button-key":r.key,disabled:!n,onClick:p,onMouseDown:h,onPointerEnter:()=>d(!0),onPointerLeave:()=>{d(!1),c.current?.removeAttribute("data-pressing")},ref:c,type:"button",children:[gh(Ch,{className:`${yn}__tooltip`,show:u,children:a}),e]})};import{c as Rh}from"react/compiler-runtime";import{jsx as at}from"react/jsx-runtime";import Ih,{useMemo as Mh}from"react";import{useTranslation as Ah}from"@payloadcms/ui";import{jsx as Ae,jsxs as na}from"react/jsx-runtime";import{Button as Eh}from"@payloadcms/ui";import{$addUpdateTag as Sh,isDOMNode as Nh}from"lexical";import mo,{useCallback as Lh,useEffect as po,useMemo as la,useRef as vn,useState as Rn}from"react";import{createPortal as yh}from"react-dom";var ra="toolbar-popup__dropdown-item",ia=mo.createContext(null);function sa({active:t,children:e,editor:o,enabled:n,Icon:r,item:l,itemKey:s,tooltip:i}){let u=la(()=>[ra,n===!1?"disabled":"",t?"active":"",l?.key?`${ra}-${l.key}`:""].filter(Boolean).join(" "),[n,t,l.key]),d=vn(null),c=mo.use(ia);if(c===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:a}=c;return po(()=>{d?.current!=null&&a(d)},[d,a]),Ae(Eh,{"aria-label":i,buttonStyle:"ghost",className:u,disabled:n===!1,extraButtonProps:{"data-item-key":s},icon:r,iconPosition:"left",onClick:()=>{n!==!1&&o.focus(()=>{o.update(()=>{Sh("toolbar")}),l.onSelect?.({editor:o,isActive:t})})},onMouseDown:m=>{m.preventDefault()},ref:d,tooltip:i,type:"button",children:e})}function vh({children:t,dropdownKey:e,dropDownRef:o,itemsContainerClassNames:n,onClose:r}){let[l,s]=Rn(),[i,u]=Rn(),d=Lh(m=>{s(p=>p!=null?[...p,m]:[m])},[s]),c=m=>{if(l==null)return;let{key:p}=m;["ArrowDown","ArrowUp","Escape","Tab"].includes(p)&&m.preventDefault(),p==="Escape"||p==="Tab"?r():p==="ArrowUp"?u(h=>{if(h==null)return l[0];let f=l.indexOf(h)-1;return l[f===-1?l.length-1:f]}):p==="ArrowDown"&&u(h=>h==null?l[0]:l[l.indexOf(h)+1])},a=la(()=>({registerItem:d}),[d]);return po(()=>{l!=null&&i==null&&u(l[0]),i!=null&&i?.current!=null&&i.current.focus()},[l,i]),Ae(ia,{value:a,children:Ae("div",{className:(n??["toolbar-popup__dropdown-items"]).join(" "),"data-dropdown-key":e,"data-theme":"dark",onKeyDown:c,ref:o,children:t})})}function aa({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:n=!1,dropdownKey:r,Icon:l,itemsContainerClassNames:s,label:i,stopCloseOnClickSelf:u}){let d=vn(null),c=vn(null),[a,m]=Rn(!1),p=()=>{m(!1),c?.current!=null&&c.current.focus()};po(()=>{let f=c.current,g=d.current;if(a&&f!==null&&g!==null){let{left:_,top:E}=f.getBoundingClientRect(),R=window.scrollY||document.documentElement.scrollTop;g.style.top=`${E+R+f.offsetHeight+5}px`,g.style.left=`${Math.min(_-5,window.innerWidth-g.offsetWidth-20)}px`}},[d,c,a]),po(()=>{let f=c.current;if(f!==null&&a){let g=_=>{let E=_.target;Nh(E)&&(u&&d.current&&d.current.contains(E)||f.contains(E)||m(!1))};return document.addEventListener("click",g),()=>{document.removeEventListener("click",g)}}},[d,c,a,u]);let h=yh(Ae(vh,{dropdownKey:r,dropDownRef:d,itemsContainerClassNames:s,onClose:p,children:o}),document.body);return na(mo.Fragment,{children:[na("button",{"aria-label":t,className:e+(a?" active":""),"data-dropdown-key":r,disabled:n,onClick:f=>{f.preventDefault(),m(!a)},onMouseDown:f=>{f.preventDefault()},ref:c,type:"button",children:[l&&Ae(l,{}),i&&Ae("span",{className:"toolbar-popup__dropdown-label",children:i}),Ae("i",{className:"toolbar-popup__dropdown-caret"})]}),a&&Ae(mo.Fragment,{children:h})]})}var In="toolbar-popup__dropdown",$h=t=>{let e=Rh(15),{active:o,anchorElem:n,editor:r,enabled:l,iconOnly:s,item:i}=t,{i18n:u}=Ah(),{fieldProps:d}=U(),{featureClientSchemaMap:c,schemaPath:a}=d;if(i.Component){let p;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==l||e[4]!==i?(p=i?.Component&&at(i.Component,{active:o,anchorElem:n,editor:r,enabled:l,item:i},i.key),e[0]=o,e[1]=n,e[2]=r,e[3]=l,e[4]=i,e[5]=p):p=e[5],p}let m;if(e[6]!==o||e[7]!==r||e[8]!==l||e[9]!==c||e[10]!==u||e[11]!==s||e[12]!==i||e[13]!==a){let p=i.key,h;i.label&&(p=typeof i.label=="function"?i.label({featureClientSchemaMap:c,i18n:u,schemaPath:a}):i.label),p.length>25?h=p.substring(0,25)+"...":h=p,m=at(sa,{active:o,editor:r,enabled:l,Icon:i?.ChildComponent?at(i.ChildComponent,{}):void 0,item:i,itemKey:i.key,tooltip:s?p:void 0,children:at("span",{className:"text",children:h})},i.key),e[6]=o,e[7]=r,e[8]=l,e[9]=c,e[10]=u,e[11]=s,e[12]=i,e[13]=a,e[14]=m}else m=e[14];return m},Dh=Ih.memo($h),Dt=({anchorElem:t,classNames:e,editor:o,group:n,groupState:r,Icon:l,itemsContainerClassNames:s,label:i})=>{let{items:u,key:d}=n,c=Mh(()=>u?.length?u.map(a=>at(Dh,{active:r.activeItemKeys.includes(a.key),anchorElem:t,editor:o,enabled:r.enabledItemKeys.includes(a.key),iconOnly:n.iconOnly,item:a},a.key)):null,[u,r.activeItemKeys,r.enabledItemKeys,t,o]);return at(aa,{buttonAriaLabel:`${d} dropdown`,buttonClassName:[In,`${In}-${d}`,...e||[]].filter(Boolean).join(" "),disabled:!r.enabledGroup,dropdownKey:d,Icon:l,itemsContainerClassNames:[`${In}-items`,...s||[]],label:i,children:c},d)};import{mergeRegister as Oh}from"@lexical/utils";import{$getSelection as Fh}from"lexical";import{useCallback as Ph,useDeferredValue as Bh,useEffect as jh,useRef as ca,useState as Hh}from"react";function Gh(t){let e=new Map,o=new Map;if(!t?.length)return{groupStates:o,itemStates:e};for(let n of t){let r=[];for(let l of n.items)e.set(l.key,{active:!1,enabled:!0}),r.push(l.key);o.set(n.key,{activeItemKeys:[],activeItems:[],enabledGroup:!0,enabledItemKeys:r})}return{groupStates:o,itemStates:e}}function fo(t,e){let[o,n]=Hh(()=>Gh(e)),r=Bh(o),l=U(),s=ca(l);s.current=l;let i=ca(e);i.current=e;let u=Cr(),d=Ph(()=>{t.getEditorState().read(()=>{let c=Fh();if(!c)return;let a=i.current;if(!a?.length)return;let m=s.current,p=new Map,h=new Map;for(let f of a){let g=[],_=[],E=[],R=f.type==="dropdown"?f.maxActiveItems??1:void 0;for(let x of f.items){let C=x.isActive?(!R||g.length<R)&&x.isActive({editor:t,editorConfigContext:m,selection:c}):!1,k=x.isEnabled?x.isEnabled({editor:t,editorConfigContext:m,selection:c}):!0;C&&(g.push(x.key),_.push(x)),k&&E.push(x.key),p.set(x.key,{active:C,enabled:k})}let b=f.type==="dropdown"&&f.isEnabled?f.isEnabled({editor:t,editorConfigContext:m,selection:c}):!0;h.set(f.key,{activeItemKeys:g,activeItems:_,enabledGroup:b,enabledItemKeys:E})}n({groupStates:h,itemStates:p})})},[t]);return jh(()=>{u(d);let c=()=>{u(d)},a=Oh(t.registerUpdateListener(c));return document.addEventListener("mouseup",c),()=>{a(),document.removeEventListener("mouseup",c)}},[t,u,d]),r}function Xh({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&fe(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?fe($t,{active:t,editor:o,enabled:n,item:r,children:fe(r.ChildComponent,{})},r.key):null}function Zh({anchorElem:t,editor:e,editorConfig:o,group:n,index:r,toolbarStates:l}){let{i18n:s}=Jh(),{fieldProps:{featureClientSchemaMap:i,schemaPath:u}}=U(),d=l.groupStates.get(n.key),c=Mn(()=>{if(n.type!=="dropdown")return;let m=d?.activeItems?.[0];return m?m.ChildComponent:n.ChildComponent},[n,d?.activeItems]),a=Mn(()=>{if(n.type!=="dropdown")return;let m=d?.activeItems;if(!m?.length)return;if(m.length>1)return s.t("lexical:general:toolbarItemsActive",{count:m.length});let p=m[0],h=p.key;return p.label&&(h=typeof p.label=="function"?p.label({featureClientSchemaMap:i,i18n:s,schemaPath:u}):p.label),h.length>25&&(h=h.substring(0,25)+"..."),h},[n,d?.activeItems,s,i,u]);return Vh("div",{className:`fixed-toolbar__group fixed-toolbar__group-${n.key}`,"data-toolbar-group-key":n.key,children:[n.type==="dropdown"&&n.items.length&&d?fe(Dt,{anchorElem:t,editor:e,group:n,groupState:d,Icon:c,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a}):null,n.type==="buttons"&&n.items.length?n.items.map(m=>{let p=l.itemStates.get(m.key);return fe(Xh,{active:p?.active??!1,anchorElem:t,editor:e,enabled:p?.enabled??!0,item:m},m.key)}):null,r<o.features.toolbarFixed?.groups.length-1&&fe("div",{className:"divider"})]},n.key)}function Yh({anchorElem:t,clientProps:e,editor:o,editorConfig:n,parentWithFixedToolbar:r}){let l=ho.useRef(null),s=ua(),{y:i}=zh(),u=fo(o,n?.features?.toolbarFixed?.groups),d=Mn(()=>{if(!r||e?.disableIfParentHasFixedToolbar)return null;let a=r.editorContainerRef.current.previousElementSibling;for(;a;){if(a.classList.contains("fixed-toolbar"))return a;a=a.previousElementSibling}return null},[e?.disableIfParentHasFixedToolbar,r]);return Kh(()=>{if(!d)return;let c=l.current;if(!c)return;let a=c.getBoundingClientRect(),m=d.getBoundingClientRect();if(!(a.bottom<m.top||a.top>m.bottom))c.classList.remove("fixed-toolbar"),c.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),d.classList.remove("fixed-toolbar"),d.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!c.classList.contains("fixed-toolbar--overlapping"))return;c.classList.remove("fixed-toolbar--overlapping"),c.classList.add("fixed-toolbar"),d.classList.remove("fixed-toolbar--hide"),d.classList.add("fixed-toolbar")}},50,[l,d,i]),fe("div",{className:"fixed-toolbar",onFocus:c=>{c.stopPropagation()},ref:l,children:s&&fe(ho.Fragment,{children:n?.features&&n.features?.toolbarFixed?.groups.map((c,a)=>fe(Zh,{anchorElem:t,editor:o,editorConfig:n,group:c,index:a,toolbarStates:u},c.key))})})}var da=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return da(t.parentEditor)}return!1},ma=t=>{let e=Uh(6),{clientProps:o}=t,[n]=Wh(),r=U();if(!ua())return null;let{editorConfig:s}=r,i=o.applyToFocusedEditor&&r.focusedEditor?.editor||n,u=o.applyToFocusedEditor&&r.focusedEditor?.editorConfig||s,d,c;if(e[0]!==o||e[1]!==i||e[2]!==u||e[3]!==r){c=Symbol.for("react.early_return_sentinel");e:{let a=da(r);if(o?.disableIfParentHasFixedToolbar&&a){c=null;break e}if(!u?.features?.toolbarFixed?.groups?.length){c=null;break e}d=fe(Yh,{anchorElem:document.body,clientProps:o,editor:i,editorConfig:u,parentWithFixedToolbar:a})}e[0]=o,e[1]=i,e[2]=u,e[3]=r,e[4]=d,e[5]=c}else d=e[4],c=e[5];return c!==Symbol.for("react.early_return_sentinel")?c:d};var qh=A({plugins:[{Component:ma,position:"aboveContainer"}]});import{c as Qh}from"react/compiler-runtime";import{jsx as Le,jsxs as ha}from"react/jsx-runtime";import{useLexicalComposerContext as e5}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as t5}from"@lexical/react/useLexicalEditable";import{mergeRegister as ga}from"@lexical/utils";import{$getSelection as xa,$isRangeSelection as pa,$isTextNode as o5,COMMAND_PRIORITY_LOW as n5,getDOMSelection as Ca,SELECTION_CHANGE_COMMAND as r5}from"lexical";import{useCallback as xo,useEffect as Ot,useMemo as l5,useRef as fa,useState as i5}from"react";import"react";import{createPortal as s5}from"react-dom";function An(t,e){let o=t.getRangeAt(0),n;if(t.anchorNode===e){let r=e;for(;r.firstElementChild!=null;)r=r.firstElementChild;n=r.getBoundingClientRect()}else n=o.getBoundingClientRect();return n}function go(t){let{alwaysDisplayOnTop:e=!1,anchorElem:o,anchorFlippedOffset:n=0,floatingElem:r,horizontalOffset:l=32,horizontalPosition:s="left",specialHandlingForCaret:i=!1,targetRect:u,verticalGap:d=10}=t,c=o.parentElement;if(u===null||c==null){r.style.opacity="0",r.style.transform="translate(-10000px, -10000px)";return}let a=r.getBoundingClientRect(),m=o.getBoundingClientRect(),p=c.getBoundingClientRect(),h=u.top-a.height-d,f=u.left-l;s==="center"&&(f=u.left+u.width/2-a.width/2);let g=0;return!e&&h<p.top&&!i&&(g=a.height+u.height+d*2,h+=g),s==="center"?f+a.width>p.right?f=p.right-a.width-l:f<p.left&&(f=p.left+l):f+a.width>p.right&&(f=p.right-a.width-l),f-=m.left,r.style.opacity="1",i&&n!==0?(h-=m.bottom-n+a.height-3,r.style.transform=`translate(${f}px, ${h}px) rotate(180deg)`):(h-=m.top,r.style.transform=`translate(${f}px, ${h}px)`),g}function a5({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&Le(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?Le($t,{active:t,editor:o,enabled:n,item:r,children:Le(r.ChildComponent,{})},r.key):null}function c5({anchorElem:t,editor:e,group:o,index:n,toolbarStates:r}){let{editorConfig:l}=U(),s=r.groupStates.get(o.key),i=l5(()=>o.type!=="dropdown"?void 0:s?.activeItems?.[0]?.ChildComponent??o.ChildComponent,[o,s?.activeItems]);return ha("div",{className:`inline-toolbar-popup__group inline-toolbar-popup__group-${o.key}`,"data-toolbar-group-key":o.key,children:[o.type==="dropdown"&&o.items.length&&s?Le(Dt,{anchorElem:t,editor:e,group:o,groupState:s,Icon:i}):null,o.type==="buttons"&&o.items.length?o.items.map(u=>{let d=r.itemStates.get(u.key);return Le(a5,{active:d?.active??!1,anchorElem:t,editor:e,enabled:d?.enabled??!0,item:u},u.key)}):null,n<l.features.toolbarInline?.groups.length-1&&Le("div",{className:"divider"})]},o.key)}function u5({anchorElem:t,editor:e}){let o=fa(null),n=fa(null),{editorConfig:r}=U(),l=fo(e,r?.features?.toolbarInline?.groups),s=xo(()=>{if(o?.current){let c=o.current.style.opacity==="0",a=o.current.style.pointerEvents==="none";c||(o.current.style.opacity="0"),a||(o.current.style.pointerEvents="none")}},[o]),i=xo(c=>{if(o?.current&&(c.buttons===1||c.buttons===3)){let a=o.current.style.opacity==="0",m=o.current.style.pointerEvents==="none";if(!a||!m){let p=c.clientX,h=c.clientY,f=document.elementFromPoint(p,h);o.current.contains(f)||s()}}},[s]),u=xo(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);Ot(()=>(document.addEventListener("mousemove",i),document.addEventListener("mouseup",u),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",u)}),[o,i,u]);let d=xo(()=>{let c=xa(),a=Ca(e._window);if(o.current===null)return;let m=t.querySelector(":scope > .link-editor"),p=m!==null&&"style"in m&&m?.style?.opacity==="1",h=e.getRootElement();if(c!==null&&a!==null&&!a.isCollapsed&&h!==null&&h.contains(a.anchorNode)){let f=An(a,h),g=go({alwaysDisplayOnTop:p,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:f});n.current&&go({anchorElem:o.current,anchorFlippedOffset:g,floatingElem:n.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:f,verticalGap:8})}else s()},[e,s,t]);return Ot(()=>{let c=t.parentElement,a=()=>{e.getEditorState().read(()=>{d()})};return window.addEventListener("resize",a),c&&c.addEventListener("scroll",a),()=>{window.removeEventListener("resize",a),c&&c.removeEventListener("scroll",a)}},[e,d,t]),Ot(()=>(e.getEditorState().read(()=>{d()}),ga(e.registerUpdateListener(({editorState:c})=>{c.read(()=>{d()})}),e.registerCommand(r5,()=>(d(),!1),n5))),[e,d]),ha("div",{className:"inline-toolbar-popup",ref:o,children:[Le("div",{className:"caret",ref:n}),r?.features&&r.features?.toolbarInline?.groups.map((c,a)=>Le(c5,{anchorElem:t,editor:e,group:c,index:a,toolbarStates:l},c.key))]})}function d5(t,e){let o=Qh(12),[n,r]=i5(!1),l=t5(),s;o[0]!==t?(s=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let p=xa(),h=Ca(t._window),f=t.getRootElement();if(h!==null&&(!pa(p)||f===null||!f.contains(h.anchorNode))){r(!1);return}if(!pa(p))return;if(p.getTextContent()!==""){let _=p.getNodes(),E=!1;for(let R of _)if(o5(R)){r(!0),E=!0;break}E||r(!1)}else r(!1);let g=p.getTextContent().replace(/\n/g,"");if(!p.isCollapsed()&&g===""){r(!1);return}})},o[0]=t,o[1]=s):s=o[1];let i=s,u,d;o[2]!==i?(u=()=>(document.addEventListener("selectionchange",i),document.addEventListener("mouseup",i),()=>{document.removeEventListener("selectionchange",i),document.removeEventListener("mouseup",i)}),d=[i],o[2]=i,o[3]=u,o[4]=d):(u=o[3],d=o[4]),Ot(u,d);let c,a;if(o[5]!==t||o[6]!==i?(c=()=>ga(t.registerUpdateListener(()=>{i()}),t.registerRootListener(()=>{t.getRootElement()===null&&r(!1)})),a=[t,i],o[5]=t,o[6]=i,o[7]=c,o[8]=a):(c=o[7],a=o[8]),Ot(c,a),!n||!l)return null;let m;return o[9]!==e||o[10]!==t?(m=s5(Le(u5,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=m):m=o[11],m}var ba=t=>{let{anchorElem:e}=t,[o]=e5();return d5(o,e)};var m5=A({plugins:[{Component:ba,position:"floatingAnchorElem"}]});import{TableCellNode as n2,TableNode as r2,TableRowNode as l2}from"@lexical/table";import{jsx as ka}from"react/jsx-runtime";import"react";var p5={16:"M7 4h4.5a.5.5 0 0 1 .5.5V6H7zM6 4H4.5a.5.5 0 0 0-.5.5V6h2zm0 3H4v2h2zm0 3H4v1.5a.5.5 0 0 0 .5.5H6zm1 2h4.5a.5.5 0 0 0 .5-.5V10H7zm0-3V7h5v2zM3 4.5A1.5 1.5 0 0 1 4.5 3h7A1.5 1.5 0 0 1 13 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 11.5z",24:"M17.204 6.51A2 2 0 0 1 19 8.5V16l-.011.204a2 2 0 0 1-1.785 1.785L17 18H7l-.204-.01a2 2 0 0 1-1.786-1.786L5 16V8.5a2 2 0 0 1 1.796-1.99L7 6.5h10zM6 16a1 1 0 0 0 1 1h2v-2.5H6zm4-1.5V17h7a1 1 0 0 0 .995-.898L18 16v-1.5zm-4-1h3V11H6zm4-2.5v2.5h8V11zM7 7.5a1 1 0 0 0-.995.897L6 8.5V10h3V7.5zm3 2.5h8V8.5a1 1 0 0 0-1-1h-7z"},$n=({className:t,size:e=24})=>ka("svg",{className:["icon",t].filter(Boolean).join(" "),fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:ka("path",{clipRule:"evenodd",d:p5[e],fill:"currentColor",fillRule:"evenodd"})});import{$convertToMarkdownString as f5}from"@lexical/markdown";import{$createTableCellNode as h5,$createTableNode as g5,$createTableRowNode as x5,$isTableCellNode as _a,$isTableNode as Dn,$isTableRowNode as On,TableCellHeaderStates as Co,TableCellNode as C5,TableNode as b5,TableRowNode as k5}from"@lexical/table";import{$isParagraphNode as _5,$isTextNode as T5}from"lexical";var wa=/^\|(.+)\|\s?$/,w5=/^(\| ?:?-*:? ?)+\|\s?$/,Ea=({allTransformers:t})=>({type:"element",dependencies:[b5,k5,C5],export:e=>{if(!Dn(e))return null;let o=[];for(let n of e.getChildren()){let r=[];if(!On(n))continue;let l=!1;for(let s of n.getChildren())_a(s)&&(r.push(f5(t,s).replace(/\n/g,"\\n").trim()),s.__headerState===Co.ROW&&(l=!0));o.push(`| ${r.join(" | ")} |`),l&&o.push(`| ${r.map(s=>"---").join(" | ")} |`)}return o.join(`
58
- `)},regExp:wa,replace:(e,o,n)=>{let r=n[0];if(!r)return;if(w5.test(r)){let a=e.getPreviousSibling();if(!a||!Dn(a))return;let m=a.getChildren(),p=m[m.length-1];if(!p||!On(p))return;p.getChildren().forEach(h=>{_a(h)&&h.setHeaderStyles(Co.ROW,Co.ROW)}),e.remove();return}let l=Ta(r,t);if(l==null)return;let s=[l],i=e.getPreviousSibling(),u=l.length;for(;i&&!(!_5(i)||i.getChildrenSize()!==1);){let a=i.getFirstChild();if(!T5(a))break;let m=Ta(a.getTextContent(),t);if(m==null)break;u=Math.max(u,m.length),s.unshift(m);let p=i.getPreviousSibling();i.remove(),i=p}let d=g5();for(let a of s){let m=x5();d.append(m);for(let p=0;p<u;p++)m.append(p<a.length?a[p]:Sa("",t))}let c=e.getPreviousSibling();Dn(c)&&E5(c)===u?(c.append(...d.getChildren()),e.remove()):e.replace(d),d.selectEnd()}});function E5(t){let e=t.getFirstChild();return On(e)?e.getChildrenSize():0}var Sa=(t,e)=>{t=t.replace(/\\n/g,`
59
- `);let o=h5(Co.NO_STATUS);return Zt(t,e,o,!1,!0),o},Ta=(t,e)=>{let o=t.match(wa);return!o||!o[1]?null:o[1].split("|").map(n=>Sa(n,e))};import{c as N5}from"react/compiler-runtime";import{jsx as j,jsxs as ye}from"react/jsx-runtime";import{useLexicalComposerContext as Ia}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as L5}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as ya,$deleteTableColumnAtSelection as y5,$deleteTableRowAtSelection as v5,$getNodeTriplet as R5,$getTableCellNodeFromLexicalNode as va,$getTableColumnIndexFromTableCellNode as I5,$getTableNodeFromLexicalNodeOrThrow as De,$getTableRowIndexFromTableCellNode as M5,$insertTableColumnAtSelection as A5,$insertTableRowAtSelection as $5,$isTableCellNode as Ma,$isTableSelection as Ft,$mergeCells as D5,$unmergeCell as O5,getTableElement as Fn,getTableObserverFromTableElement as Pn,TableCellHeaderStates as $e,TableCellNode as F5}from"@lexical/table";import{mergeRegister as P5}from"@lexical/utils";import{useScrollInfo as B5}from"@payloadcms/ui";import{$getSelection as ko,$isElementNode as j5,$isRangeSelection as Bn,$isTextNode as H5,$setSelection as G5,COMMAND_PRIORITY_CRITICAL as U5,getDOMSelection as V5,isDOMNode as W5,SELECTION_CHANGE_COMMAND as z5}from"lexical";import*as jn from"react";import{useCallback as ue,useEffect as ct,useRef as bo,useState as ut}from"react";import{createPortal as Aa}from"react-dom";import{jsx as Na}from"react/jsx-runtime";import"react";var S5={16:"M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2",24:"M7.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m6 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m4.5 1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"},La=({className:t,size:e=24})=>Na("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Na("path",{clipRule:"evenodd",d:S5[e],fill:"currentColor",fillRule:"evenodd"})});function Ra(t){let e=t.getShape();return{columns:e.toX-e.fromX+1,rows:e.toY-e.fromY+1}}function K5(){let t=ko();if(Bn(t)&&!t.isCollapsed()||Ft(t)&&!t.anchor.is(t.focus)||!Bn(t)&&!Ft(t))return!1;let[e]=R5(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function J5(t){let e=t.getLastDescendant();H5(e)?e.select():j5(e)?e.selectEnd():e!==null&&e.selectNext()}function X5({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:n,tableCellNode:r}){let[l]=Ia(),s=bo(null),[i,u]=ut(r),[d,c]=ut({columns:1,rows:1}),[a,m]=ut(!1),[p,h]=ut(!1),{y:f}=B5();ct(()=>l.registerMutationListener(F5,w=>{w.get(i.getKey())==="updated"&&l.getEditorState().read(()=>{u(i.getLatest())})},{skipInitialization:!0}),[l,i]),ct(()=>{l.getEditorState().read(()=>{let w=ko();if(Ft(w)){let v=Ra(w);c(Ra(w)),m(v.columns>1||v.rows>1)}h(K5())})},[l]),ct(()=>{let w=e.current,v=s.current,y=l.getRootElement();if(w!=null&&v!=null&&y!=null){let M=y.getBoundingClientRect(),$=w.getBoundingClientRect();v.style.opacity="1";let D=v.getBoundingClientRect(),F=5,P=$.right+F;if(P+D.width>window.innerWidth||P+D.width>M.right){let J=$.left-D.width-F;P=(J<0?F:J)+window.pageXOffset}v.style.left=`${P+window.pageXOffset}px`;let Y=$.top;if(Y+D.height>window.innerHeight){let J=$.bottom-D.height;Y=J<0?F:J}v.style.top=`${Y}px`}},[e,s,l,f]),ct(()=>{function w(v){s.current!=null&&e.current!=null&&W5(v.target)&&!s.current.contains(v.target)&&!e.current.contains(v.target)&&n(!1)}return window.addEventListener("click",w),()=>window.removeEventListener("click",w)},[n,e]);let g=ue(()=>{l.update(()=>{if(i.isAttached()){let w=De(i),v=Fn(w,l.getElementByKey(w.getKey()));if(v===null)throw new Error("Expected to find tableElement in DOM");let y=Pn(v);y!==null&&y.$clearHighlight(),w.markDirty(),u(i.getLatest())}G5(null)})},[l,i]),_=()=>{l.update(()=>{let w=ko();if(!Ft(w))return;let y=w.getNodes().filter(Ma),M=D5(y);M&&(J5(M),o())})},E=()=>{l.update(()=>{O5()})},R=ue(w=>{l.update(()=>{for(let v=0;v<d.rows;v++)$5(w);o()})},[l,o,d.rows]),b=ue(w=>{l.update(()=>{for(let v=0;v<d.columns;v++)A5(w);o()})},[l,o,d.columns]),x=ue(()=>{l.update(()=>{v5(),o()})},[l,o]),C=ue(()=>{l.update(()=>{De(i).remove(),g(),o()})},[l,i,g,o]),k=ue(()=>{l.update(()=>{y5(),o()})},[l,o]),T=ue(()=>{l.update(()=>{let w=De(i),v=M5(i),[y]=ya(w,null,null),M=new Set,$=i.getHeaderStyles()^$e.ROW;if(y[v])for(let D=0;D<y[v].length;D++){let F=y[v][D];F?.cell&&(M.has(F.cell)||(M.add(F.cell),F.cell.setHeaderStyles($,$e.ROW)))}g(),o()})},[l,i,g,o]),I=ue(()=>{l.update(()=>{let w=De(i),v=I5(i),[y]=ya(w,null,null),M=new Set,$=i.getHeaderStyles()^$e.COLUMN;if(y)for(let D=0;D<y.length;D++){let F=y?.[D]?.[v];F?.cell&&(M.has(F.cell)||(M.add(F.cell),F.cell.setHeaderStyles($,$e.COLUMN)))}g(),o()})},[l,i,g,o]),L=ue(()=>{l.update(()=>{if(i.isAttached()){let w=De(i);w&&w.setRowStriping(!w.getRowStriping())}g(),o()})},[l,i,g,o]),S=ue(()=>{l.update(()=>{if(i.isAttached()){let w=De(i);w&&w.setFrozenColumns(w.getFrozenColumns()===0?1:0)}g(),o()})},[l,i,g,o]),N=null;return t&&(a?N=j("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>_(),type:"button",children:j("span",{className:"text",children:"Merge cells"})}):p&&(N=j("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>E(),type:"button",children:j("span",{className:"text",children:"Unmerge cells"})}))),Aa(ye("div",{className:"table-action-menu-dropdown",onClick:w=>{w.stopPropagation()},ref:s,children:[N?ye(jn.Fragment,{children:[N,j("hr",{})]}):null,j("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>L(),type:"button",children:j("span",{className:"text",children:"Toggle row striping"})}),j("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>S(),type:"button",children:j("span",{className:"text",children:"Toggle first column freeze"})}),j("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>R(!1),type:"button",children:ye("span",{className:"text",children:["Insert ",d.rows===1?"row":`${d.rows} rows`," above"]})}),j("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>R(!0),type:"button",children:ye("span",{className:"text",children:["Insert ",d.rows===1?"row":`${d.rows} rows`," below"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>b(!1),type:"button",children:ye("span",{className:"text",children:["Insert ",d.columns===1?"column":`${d.columns} columns`," ","left"]})}),j("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>b(!0),type:"button",children:ye("span",{className:"text",children:["Insert ",d.columns===1?"column":`${d.columns} columns`," ","right"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>k(),type:"button",children:j("span",{className:"text",children:"Delete column"})}),j("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>x(),type:"button",children:j("span",{className:"text",children:"Delete row"})}),j("button",{className:"item","data-test-id":"table-delete",onClick:()=>C(),type:"button",children:j("span",{className:"text",children:"Delete table"})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-row-header",onClick:()=>T(),type:"button",children:ye("span",{className:"text",children:[(i.__headerState&$e.ROW)===$e.ROW?"Remove":"Add"," ","row header"]})}),j("button",{className:"item","data-test-id":"table-column-header",onClick:()=>I(),type:"button",children:ye("span",{className:"text",children:[(i.__headerState&$e.COLUMN)===$e.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function Z5({anchorElem:t,cellMerge:e}){let[o]=Ia(),n=bo(null),r=bo(null),[l,s]=ut(!1),[i,u]=ut(null),d=ue(()=>{let a=n.current,m=ko(),p=V5(o._window),h=document.activeElement;function f(){a&&(a.classList.remove("table-cell-action-button-container--active"),a.classList.add("table-cell-action-button-container--inactive")),u(null)}if(m==null||a==null)return f();let g=o.getRootElement(),_=null,E=null;if(Bn(m)&&g!==null&&p!==null&&g.contains(p.anchorNode)){let b=va(m.anchor.getNode());if(b==null||(E=o.getElementByKey(b.getKey()),E==null||!b.isAttached()))return f();let x=De(b),C=Fn(x,o.getElementByKey(x.getKey()));if(C===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");_=Pn(C),u(b)}else if(Ft(m)){let b=va(m.anchor.getNode());if(!Ma(b))throw new Error("TableSelection anchorNode must be a TableCellNode");let x=De(b),C=Fn(x,o.getElementByKey(x.getKey()));if(C===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");_=Pn(C),E=o.getElementByKey(b.getKey())}else if(!h)return f();if(_===null||E===null)return f();let R=!_||!_.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",R),a.classList.toggle("table-cell-action-button-container--inactive",!R),R){let b=E.getBoundingClientRect(),x=t.getBoundingClientRect(),C=b.top-x.top,k=b.right-x.left;a.style.transform=`translate(${k}px, ${C}px)`}},[o,t]);ct(()=>{let a,m=()=>{a=void 0,o.getEditorState().read(d)},p=()=>(a===void 0&&(a=setTimeout(m,0)),!1);return P5(o.registerUpdateListener(p),o.registerCommand(z5,p,U5),o.registerRootListener((h,f)=>{f&&f.removeEventListener("pointerup",p),h&&(h.addEventListener("pointerup",p),p())}),()=>clearTimeout(a))});let c=bo(i);return ct(()=>{c.current!==i&&s(!1),c.current=i},[c,i]),j("div",{className:"table-cell-action-button-container",ref:n,children:i!=null&&ye(jn.Fragment,{children:[j("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),s(!l)},ref:r,type:"button",children:j(La,{})}),l&&j(X5,{cellMerge:e,contextRef:r,onClose:()=>s(!1),setIsMenuOpen:s,tableCellNode:i})]})})}var $a=t=>{let e=N5(3),{anchorElem:o}=t,n=L5(),r;return e[0]!==o||e[1]!==n?(r=Aa(n?j(Z5,{anchorElem:o??document.body,cellMerge:!0}):null,o??document.body),e[0]=o,e[1]=n,e[2]=r):r=e[2],r};import{c as Y5}from"react/compiler-runtime";import{jsx as To,jsxs as q5}from"react/jsx-runtime";import{useLexicalComposerContext as Q5}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as eg}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as tg,$getTableNodeFromLexicalNodeOrThrow as Hn,$getTableRowIndexFromTableCellNode as og,$isTableCellNode as Da,$isTableRowNode as ng,getDOMCellFromTarget as rg,getTableElement as lg,TableNode as Oa}from"@lexical/table";import{calculateZoomLevel as Fa,mergeRegister as ig}from"@lexical/utils";import{$getNearestNodeFromDOMNode as Gn,isHTMLElement as sg,SKIP_SCROLL_INTO_VIEW_TAG as Pa}from"lexical";import*as ja from"react";import{useCallback as Pt,useEffect as Un,useRef as _o,useState as dt}from"react";import{createPortal as ag}from"react-dom";var cg=33,Ba=92;function ug({editor:t}){let e=_o(null),o=_o(null),n=_o(null),[r,l]=dt(!1),s=U(),i=_o(null),[u,d]=dt(null),[c,a]=dt(null),[m,p]=dt(!1),[h,f]=dt(null),g=Pt(()=>{a(null),e.current=null,f(null),i.current=null,n.current=null},[]),_=S=>(S.buttons&1)===1;Un(()=>{let S=new Set;return ig(t.registerMutationListener(Oa,N=>{for(let[w,v]of N)v==="destroyed"?S.delete(w):S.add(w);l(S.size>0)}),t.registerNodeTransform(Oa,N=>{if(N.getColWidths())return N;let w=N.getColumnCount(),v=Ba;return N.setColWidths(Array(w).fill(v)),N}))},[t]),Un(()=>{if(!r)return;let S=y=>{let M=y.target;if(sg(M)){if(h){d({x:y.clientX,y:y.clientY});return}if(p(_(y)),!(o.current&&o.current.contains(M))&&e.current!==M){e.current=M;let $=rg(M);$&&c!==$?t.getEditorState().read(()=>{let D=Gn($.elem);if(!D)throw new Error("TableCellResizer: Table cell node not found.");let F=Hn(D),P=lg(F,t.getElementByKey(F.getKey()));if(!P)throw new Error("TableCellResizer: Table element not found.");e.current=M,n.current=P.getBoundingClientRect(),a($)},{editor:t}):$==null&&g()}}},N=y=>{p(!0)},w=y=>{p(!1)},v=t.registerRootListener((y,M)=>{M?.removeEventListener("mousemove",S),M?.removeEventListener("mousedown",N),M?.removeEventListener("mouseup",w),y?.addEventListener("mousemove",S),y?.addEventListener("mousedown",N),y?.addEventListener("mouseup",w)});return()=>{v()}},[c,h,t,r,g]);let E=S=>S==="bottom",R=Pt(S=>{if(!c)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let N=Gn(c.elem);if(!Da(N))throw new Error("TableCellResizer: Table cell node not found.");let w=Hn(N),v=og(N),y=w.getChildren(),$=N.getColSpan()===w.getColumnCount()?v:v+N.getRowSpan()-1;if($>=y.length||$<0)throw new Error("Expected table cell to be inside of table row.");let D=y[$];if(!ng(D))throw new Error("Expected table row");let F=D.getHeight();if(F===void 0){let Y=D.getChildren();F=Math.min(...Y.map(J=>b(J,t)??1/0))}let P=Math.max(F+S,cg);D.setHeight(P)},{tag:Pa})},[c,t]),b=(S,N)=>N.getElementByKey(S.getKey())?.clientHeight,x=(S,N)=>{let w;return N.forEach(v=>{v.forEach((y,M)=>{y.cell===S&&(w=M)})}),w},C=Pt(S=>{if(!c)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let N=Gn(c.elem);if(!Da(N))throw new Error("TableCellResizer: Table cell node not found.");let w=Hn(N),[v]=tg(w,null,null),y=x(N,v);if(y===void 0)throw new Error("TableCellResizer: Table column not found.");let M=w.getColWidths();if(!M)return;let $=M[y];if($===void 0)return;let D=[...M],F=Math.max($+S,Ba);D[y]=F,w.setColWidths(D)},{tag:Pa})},[c,t]),k=Pt(S=>{let N=w=>{if(w.preventDefault(),w.stopPropagation(),!c)throw new Error("TableCellResizer: Expected active cell.");if(i.current){let{x:v,y}=i.current;if(c===null)return;let M=Fa(w.target);if(E(S)){let $=(w.clientY-y)/M;R($)}else{let $=(w.clientX-v)/M;C($)}g(),document.removeEventListener("mouseup",N)}};return N},[c,g,C,R]),T=Pt(S=>N=>{if(N.preventDefault(),N.stopPropagation(),!c)throw new Error("TableCellResizer: Expected active cell.");i.current={x:N.clientX,y:N.clientY},d(i.current),f(S),document.addEventListener("mouseup",k(S))},[c,k]),[I,L]=dt({bottom:null,left:null,right:null,top:null});return Un(()=>{if(c){let{height:S,left:N,top:w,width:v}=c.elem.getBoundingClientRect(),y=Fa(c.elem),M=10,$={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${M}px`,left:`${window.scrollX+N}px`,top:`${window.scrollY+w+S-M/2}px`,width:`${v}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${S}px`,left:`${window.scrollX+N+v-M/2}px`,top:`${window.scrollY+w}px`,width:`${M}px`}},D=n.current;h&&u&&D&&(E(h)?($[h].left=`${window.scrollX+D.left}px`,$[h].top=`${window.scrollY+u.y/y}px`,$[h].height="3px",$[h].width=`${D.width}px`):($[h].top=`${window.scrollY+D.top}px`,$[h].left=`${window.scrollX+u.x/y}px`,$[h].width="3px",$[h].height=`${D.height}px`),$[h].backgroundColor="#adf"),L($)}else L({bottom:null,left:null,right:null,top:null})},[c,h,u]),To("div",{ref:o,children:c!=null&&!m&&q5(ja.Fragment,{children:[To("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("right"),style:I.right||void 0}),To("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("bottom"),style:I.bottom||void 0})]})})}var Ha=()=>{let t=Y5(3),[e]=Q5(),o=eg(),n;return t[0]!==e||t[1]!==o?(n=o?ag(To(ug,{editor:e}),document.body):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],n};import{c as Cg}from"react/compiler-runtime";import{jsx as Vn,jsxs as bg,Fragment as kg}from"react/jsx-runtime";import{useLexicalComposerContext as _g}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as Xa}from"@lexical/react/useLexicalEditable";import{$getTableAndElementByKey as Tg,$getTableColumnIndexFromTableCellNode as wg,$getTableRowIndexFromTableCellNode as Eg,$insertTableColumnAtSelection as Sg,$insertTableRowAtSelection as Ng,$isTableCellNode as Lg,$isTableNode as Va,getTableElement as yg,TableNode as vg}from"@lexical/table";import{$findMatchingParent as Rg,mergeRegister as Ig}from"@lexical/utils";import{$getNearestNodeFromDOMNode as Wa,isHTMLElement as Mg}from"lexical";import{useEffect as za,useMemo as Ag,useRef as Ka,useState as wo}from"react";import"react";import{createPortal as $g}from"react-dom";import{c as hg}from"react/compiler-runtime";import{useEffect as gg,useRef as xg}from"react";var dg="Expected a function",mg=Math.max,pg=Math.min;function fg(t,e,o){let n,r,l=0,s,i=!1,u=!1,d,c,a,m=!0;if(typeof t!="function")throw new TypeError(dg);e=e||0,typeof o=="object"&&(i=!!o.leading,u="maxWait"in o,d=u?mg(o.maxWait||0,e):d,m="trailing"in o?!!o.trailing:m);function p(C){let k=n,T=s;return n=s=void 0,l=C,c=t.apply(T,k),c}function h(C){return l=C,a=setTimeout(_,e),i?p(C):c}function f(C){let k=C-r,T=C-l,I=e-k;return u?pg(I,d-T):I}function g(C){let k=C-r,T=C-l;return r===void 0||k>=e||k<0||u&&T>=d}function _(){let C=Date.now();if(g(C))return E(C);a=setTimeout(_,f(C))}function E(C){return a=void 0,m&&n?p(C):(n=s=void 0,c)}function R(){a!==void 0&&clearTimeout(a),l=0,n=r=s=a=void 0}function b(){return a===void 0?c:E(Date.now())}function x(){let C=Date.now(),k=g(C);if(n=arguments,s=this,r=C,k){if(a===void 0)return h(r);if(u)return clearTimeout(a),a=setTimeout(_,e),p(r)}return a===void 0&&(a=setTimeout(_,e)),c}return x.cancel=R,x.flush=b,x}var Ga=fg;function Ua(t,e,o){let n=hg(6),r=xg(null),l,s;n[0]!==t||n[1]!==o||n[2]!==e?(l=()=>(r.current=Ga(t,e,{maxWait:o}),()=>{r.current?.cancel()}),s=[t,e,o],n[0]=t,n[1]=o,n[2]=e,n[3]=l,n[4]=s):(l=n[3],s=n[4]),gg(l,s);let i;return n[5]===Symbol.for("react.memo_cache_sentinel")?(i=(...d)=>{let c=d;r.current&&r.current(...c)},n[5]=i):i=n[5],i}var Ja=16;function Dg({anchorElem:t}){let[e]=_g(),o=Xa(),n=U(),[r,l]=wo(!1),[s,i]=wo(!1),[u,d]=wo(!1),[c,a]=wo({}),m=Ka(new Set),p=Ka(null),h=Ua(_=>{let{isOutside:E,tableDOMNode:R}=Og(_,n.editorConfig?.lexical);if(E){l(!1),i(!1);return}if(!R)return;p.current=R;let b=null,x=null,C=null;if(e.getEditorState().read(()=>{let $=Wa(R);if(Lg($)){let D=Rg($,F=>Va(F));if(!Va(D))return;if(C=yg(D,e.getElementByKey(D.getKey())),C){let F=D.getChildrenSize(),P=D.getChildAtIndex(0)?.getChildrenSize(),Y=Eg($),J=wg($);Y===F-1?b=$:J===P-1&&(x=$)}}},{editor:e}),!C)return;let k=C.parentElement;if(!k)return;let{bottom:T,height:I,left:L,right:S,width:N,y:w}=C.getBoundingClientRect(),v=!1;k&&k.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(v=k.scrollWidth>k.clientWidth);let{left:y,y:M}=t.getBoundingClientRect();b?(i(!1),l(!0),a({height:Ja,left:v&&k?k.offsetLeft:L-y,top:T-M+5,width:v&&k?k.offsetWidth:N})):x&&(i(!0),l(!1),a({height:I,left:S-y+5,top:w-M,width:Ja}))},50,250),f=Ag(()=>new ResizeObserver(()=>{l(!1),i(!1)}),[]);za(()=>{if(u)return document.addEventListener("mousemove",h),()=>{l(!1),i(!1),document.removeEventListener("mousemove",h)}},[u,h]),za(()=>Ig(e.registerMutationListener(vg,_=>{e.getEditorState().read(()=>{let E=!1;for(let[R,b]of _)switch(b){case"created":{m.current.add(R),E=!0;break}case"destroyed":{m.current.delete(R),E=!0;break}default:break}if(E){f.disconnect();for(let R of m.current){let{tableElement:b}=Tg(R);f.observe(b)}d(m.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let g=_=>{e.update(()=>{p.current&&(Wa(p.current)?.selectEnd(),_?(Ng(),l(!1)):(Sg(),i(!1)))})};return o?bg(kg,{children:[r&&Vn("button",{"aria-label":"Add Row",className:n.editorConfig.lexical.theme.tableAddRows,onClick:()=>g(!0),style:{...c},type:"button"}),s&&Vn("button",{"aria-label":"Add Column",className:n.editorConfig.lexical.theme.tableAddColumns,onClick:()=>g(!1),style:{...c},type:"button"})]}):null}function Og(t,e){let o=t.target;if(Mg(o)){let n=o.closest(`td.${e.theme.tableCell}, th.${e.theme.tableCell}`);return{isOutside:!(n||o.closest(`button.${e.theme.tableAddRows}`)||o.closest(`button.${e.theme.tableAddColumns}`)||o.closest(`div.${e.theme.tableCellResizer}`)),tableDOMNode:n}}else return{isOutside:!0,tableDOMNode:null}}function Za(t){let e=Cg(2),{anchorElem:o}=t,n=o===void 0?document.body:o;if(!Xa())return null;let l;return e[0]!==n?(l=$g(Vn(Dg,{anchorElem:n}),n),e[0]=n,e[1]=l):l=e[1],l}import{jsx as Kn,jsxs as jg}from"react/jsx-runtime";import{useLexicalComposerContext as Hg}from"@lexical/react/LexicalComposerContext";import{TablePlugin as Gg}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as Ug,TableCellNode as Vg,TableNode as Wg,TableRowNode as zg}from"@lexical/table";import{mergeRegister as Kg}from"@lexical/utils";import{$getSelection as Jg,$isRangeSelection as Xg,$setSelection as Zg,COMMAND_PRIORITY_EDITOR as Yg,createCommand as qg}from"lexical";import{createContext as Qg,use as e2,useCallback as oc,useEffect as nc,useMemo as t2,useRef as o2,useState as Eo}from"react";import*as rc from"react";import{jsx as Q,jsxs as ve}from"react/jsx-runtime";import{useCallback as Wn,useEffect as Ya,useRef as zn,useState as Bt}from"react";import*as ec from"react";import{createPortal as Fg}from"react-dom";var qa=10,Qa=7;function Pg(){return ve("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[Q("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"1.5",y:"1.5"}),Q("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"7.5",y:"1.5"})]})}function Bg(){return ve("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[Q("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"1.5"}),Q("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"7.5"})]})}function tc({anchorElem:t,editor:e,isOpen:o,onClose:n,onInsert:r,position:l}){let[s,i]=Bt(0),[u,d]=Bt(0),[c,a]=Bt(""),[m,p]=Bt(""),[h,f]=Bt(null),g=zn(null),_=zn(null),E=zn(null),R=s>0?s:c?parseInt(c,10)||0:5,b=u>0?u:m?parseInt(m,10)||0:5;Ya(()=>{o||(i(0),d(0),a(""),p(""),f(null))},[o]),Ya(()=>{if(!o)return;let L=S=>{if(S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),n()),S.key==="Enter"&&h){S.preventDefault();let N=parseInt(c,10),w=parseInt(m,10);N>0&&w>0&&r(N,w)}};return document.addEventListener("keydown",L,!0),()=>document.removeEventListener("keydown",L,!0)},[o,n,r,h,c,m]);let x=Wn((L,S)=>{L>0&&S>0&&r(L,S)},[r]),C=Wn((L,S)=>{i(L),d(S)},[]),k=Wn(()=>{i(0),d(0)},[]);if(!o||!l||!t)return null;let T=[];for(let L=1;L<=Qa;L++)for(let S=1;S<=qa;S++){let N=S<=R&&L<=b,w=S<=s&&L<=u,v="table-grid-popup__cell";N&&w?v+=" table-grid-popup__cell--hover":N&&(v+=" table-grid-popup__cell--selected"),T.push(Q("div",{"aria-label":`${S} columns, ${L} rows`,className:v,onClick:()=>x(S,L),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),x(S,L))},onMouseEnter:()=>C(S,L),role:"button",tabIndex:-1},`${L}-${S}`))}let I=s>0&&u>0;return Fg(ve(ec.Fragment,{children:[Q("div",{className:"table-grid-popup__backdrop",onClick:n}),Q("div",{className:"table-grid-popup",ref:g,style:{transform:`translate(${l.left}px, ${l.top}px)`},children:ve("div",{className:"table-grid-popup__content",children:[ve("div",{className:"table-grid-popup__header",children:[ve("div",{className:`table-grid-popup__input-group${h==="cols"?" table-grid-popup__input-group--focused":""}`,children:[Q("div",{className:"table-grid-popup__input-icon",children:Q(Pg,{})}),Q("input",{"aria-label":"Columns",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:L=>a(L.target.value),onFocus:()=>f("cols"),placeholder:s>0?String(s):"5",ref:_,type:"number",value:c})]}),Q("span",{className:"table-grid-popup__separator",children:"\xD7"}),ve("div",{className:`table-grid-popup__input-group${h==="rows"?" table-grid-popup__input-group--focused":""}`,children:[Q("div",{className:"table-grid-popup__input-icon",children:Q(Bg,{})}),Q("input",{"aria-label":"Rows",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:L=>p(L.target.value),onFocus:()=>f("rows"),placeholder:u>0?String(u):"5",ref:E,type:"number",value:m})]})]}),ve("div",{className:"table-grid-popup__grid",onMouseLeave:k,children:[T,I&&ve("div",{className:"table-grid-popup__tooltip",style:{left:`calc(${(s-.5)/qa*100}%)`,top:`calc(${(u-1)/Qa*100}%)`},children:[R," \xD7 ",b]})]})]})})]}),t)}var So=qg("OPEN_EMBED_DRAWER_COMMAND"),lc=Qg({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function ic({children:t}){let[e,o]=Eo({cellEditorConfig:null,cellEditorPlugins:null});return Kn(lc,{value:t2(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(n,r)=>{o({cellEditorConfig:n,cellEditorPlugins:r})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var sc=()=>{let[t]=Hg(),e=e2(lc),[o,n]=Eo(!1),[r,l]=Eo(null),s=o2(null),[i,u]=Eo(null);nc(()=>{let a=t.getRootElement();if(a){let m=a.closest(".editor")??null;u(m??a.parentElement)}},[t]),nc(()=>{if(!t.hasNodes([Wg,zg,Vg]))throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return Kg(t.registerCommand(So,()=>{let a=i;if(!a)return!0;let m=a.getBoundingClientRect(),p=null;t.getEditorState().read(()=>{let f=Jg();if(Xg(f)){s.current=f.clone();let g=f.anchor.getNode(),_=t.getElementByKey(g.getKey());if(_){let E=_.getBoundingClientRect();E.height>0&&(p={left:E.left-m.left,top:E.bottom-m.top+8})}}});let h=window.getSelection();if(h&&h.rangeCount>0){let g=h.getRangeAt(0).getBoundingClientRect();g.height>0&&(p={left:g.left-m.left,top:g.bottom-m.top+8})}return p||(p={left:0,top:40}),l(p),n(!0),!0},Yg))},[e,t,i]);let d=oc(()=>{n(!1)},[]),c=oc((a,m)=>{n(!1),t.focus(),t.update(()=>{s.current&&Zg(s.current.clone())},{discrete:!0,skipTransforms:!0}),setTimeout(()=>{t.dispatchCommand(Ug,{columns:String(a),rows:String(m)})},1)},[t]);return jg(rc.Fragment,{children:[Kn(tc,{anchorElem:i,editor:t,isOpen:o,onClose:d,onInsert:c,position:r}),Kn(Gg,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]})};var i2=A({markdownTransformers:[Ea],nodes:[r2,n2,l2],plugins:[{Component:sc,position:"normal"},{Component:Ha,position:"normal"},{Component:$a,position:"floatingAnchorElem"},{Component:Za,position:"floatingAnchorElem"}],providers:[ic],slashMenu:{groups:[X([{Icon:$n,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(So,{})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:$n,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(So,{})}}])]}});import{$isNodeSelection as G2}from"lexical";import{jsx as ac}from"react/jsx-runtime";import"react";var s2="M16.2041 6.01074C17.2128 6.113 18 6.96435 18 8V16L17.9893 16.2041C17.8938 17.1457 17.1457 17.8938 16.2041 17.9893L16 18H8C6.96435 18 6.113 17.2128 6.01074 16.2041L6 16V8C6 6.89543 6.89543 6 8 6H16L16.2041 6.01074ZM8 7C7.44772 7 7 7.44772 7 8V16C7 16.5523 7.44772 17 8 17H16C16.5523 17 17 16.5523 17 16V8C17 7.44772 16.5523 7 16 7H8ZM9.72461 11.582C9.91869 11.4539 10.1827 11.4756 10.3535 11.6465L13.8535 15.1465C14.0488 15.3417 14.0488 15.6583 13.8535 15.8535C13.6583 16.0488 13.3417 16.0488 13.1465 15.8535L10 12.707L8.85352 13.8535C8.65825 14.0488 8.34175 14.0488 8.14648 13.8535C7.95122 13.6583 7.95122 13.3417 8.14648 13.1465L9.64648 11.6465L9.72461 11.582ZM14 8C15.1046 8 16 8.89543 16 10C16 11.1046 15.1046 12 14 12C12.8954 12 12 11.1046 12 10C12 8.89543 12.8954 8 14 8ZM14 9C13.4477 9 13 9.44772 13 10C13 10.5523 13.4477 11 14 11C14.5523 11 15 10.5523 15 10C15 9.44772 14.5523 9 14 9Z",Jn=({className:t})=>ac("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ac("path",{clipRule:"evenodd",d:s2,fill:"currentColor",fillRule:"evenodd"})});import{jsx as pc}from"react/jsx-runtime";import fc from"bson-objectid";import{$applyNodeReplacement as p2}from"lexical";import*as hc from"react";import a2 from"bson-objectid";function No(t,e){if(t.hasAttribute("data-lexical-pending-upload-form-id")){let n=t.getAttribute("data-lexical-pending-upload-form-id");if(n!=null)return{node:e({data:{pending:{formID:n,src:t.getAttribute("src")||""}}})}}if(t.hasAttribute("data-lexical-upload-relation-to")&&t.hasAttribute("data-lexical-upload-id")){let n=t.getAttribute("data-lexical-upload-id"),r=t.getAttribute("data-lexical-upload-relation-to");if(n!=null&&r!=null)return{node:e({data:{fields:{},relationTo:r,value:n}})}}return{node:e({data:{pending:{formID:new a2.default().toHexString(),src:t.getAttribute("src")||""}}})}}import{DecoratorBlockNode as c2}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as u2}from"@lexical/utils";import uc from"bson-objectid";import{$applyNodeReplacement as d2}from"lexical";var jt=class extends c2{__data;constructor({data:e,format:o,key:n}){super(o,n),this.__data=e}static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"upload"}static importDOM(){return{img:e=>({conversion:o=>No(o,cc),priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new uc.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value},n=cc({data:o});return n.setFormat(e.format),n}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return u2(o,e?.theme?.upload),o}decorate(){return null}exportDOM(){let e=document.createElement("img"),o=this.__data;return o.pending?(e.setAttribute("data-lexical-pending-upload-form-id",String(o?.pending?.formID)),e.setAttribute("src",o?.pending?.src||"")):(e.setAttribute("data-lexical-upload-id",String(o?.value)),e.setAttribute("data-lexical-upload-relation-to",o?.relationTo)),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(e){let o=this.getWritable();o.__data=e}updateDOM(){return!1}};function cc({data:t}){return t?.id||(t.id=new uc.default().toHexString()),d2(new jt({data:t}))}import{jsx as dc}from"react/jsx-runtime";import{ShimmerEffect as m2}from"@payloadcms/ui";var mc=()=>dc("div",{className:"lexical-upload",children:dc(m2,{height:"95px",width:"203px"})});var f2=hc.lazy(()=>import("./component-PHZQBOJE.js").then(t=>({default:t.UploadComponent}))),he=class extends jt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:o=>No(o,ge),priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new fc.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value},n=ge({data:o});return n.setFormat(e.format),n}decorate(e,o){return this.__data.pending?pc(mc,{}):pc(f2,{className:o?.theme?.upload??"LexicalEditorTheme__upload",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function ge({data:t}){return t?.id||(t.id=new fc.default().toHexString()),p2(new he({data:t}))}function mt(t){return t instanceof he}import{c as T2}from"react/compiler-runtime";import{jsx as w2}from"react/jsx-runtime";import{useLexicalComposerContext as E2}from"@lexical/react/LexicalComposerContext.js";import{$dfsIterator as Nc,$insertNodeToNearestRoot as Yn,mergeRegister as S2}from"@lexical/utils";import{useBulkUpload as N2,useEffectEvent as L2,useModal as y2}from"@payloadcms/ui";import qn from"bson-objectid";import{$createRangeSelection as v2,$getPreviousSelection as _c,$getSelection as Tc,$isParagraphNode as Qn,$isRangeSelection as wc,$setSelection as R2,COMMAND_PRIORITY_EDITOR as I2,COMMAND_PRIORITY_LOW as Ec,createCommand as M2,DROP_COMMAND as A2,getDOMSelectionFromTarget as $2,isHTMLElement as Sc,PASTE_COMMAND as D2}from"lexical";import{useEffect as O2}from"react";import{c as gc}from"react/compiler-runtime";import{jsx as Xn}from"react/jsx-runtime";import{useLexicalComposerContext as xc}from"@lexical/react/LexicalComposerContext.js";import{toast as h2}from"@payloadcms/ui";import{$getNodeByKey as g2,COMMAND_PRIORITY_EDITOR as Cc}from"lexical";import{useEffect as bc,useState as x2}from"react";var C2=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=g2(o);r&&r.replace(ge({data:{fields:null,relationTo:e,value:n}}))}):t.dispatchCommand(Zn,{fields:null,relationTo:e,value:n})},b2=t=>{let e=gc(13),{enabledCollectionSlugs:o}=t,[n]=xc(),[r,l]=x2(null),s;e[0]!==o?(s={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=s):s=e[1];let{closeListDrawer:i,ListDrawer:u,openListDrawer:d}=At(s),c,a;e[2]!==n||e[3]!==d?(c=()=>n.registerCommand(Qe,f=>(l(f?.replace?f?.replace.nodeKey:null),d(),!0),Cc),a=[n,d],e[2]=n,e[3]=d,e[4]=c,e[5]=a):(c=e[4],a=e[5]),bc(c,a);let m;e[6]!==i||e[7]!==n||e[8]!==r?(m=f=>{let{collectionSlug:g,doc:_}=f;i(),C2({editor:n,relationTo:g,replaceNodeKey:r,value:_.id})},e[6]=i,e[7]=n,e[8]=r,e[9]=m):m=e[9];let p=m,h;return e[10]!==u||e[11]!==p?(h=Xn(u,{onSelect:p}),e[10]=u,e[11]=p,e[12]=h):h=e[12],h},k2=()=>{let t=gc(3),[e]=xc(),o,n;return t[0]!==e?(o=()=>e.registerCommand(Qe,_2,Cc),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),bc(o,n),null},kc=({enabledCollectionSlugs:t})=>t?.length?Xn(b2,{enabledCollectionSlugs:t}):Xn(k2,{});function _2(){return h2.error("No upload collections enabled"),!0}function F2(t){let e=t.target;return!!(Sc(e)&&!e.closest("code, span.editor-image")&&Sc(e.parentElement)&&e.parentElement.closest("div.ContentEditable__root"))}function P2(t){let e,o=$2(t.target);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&o!==null)o.collapse(t.rangeParent,t.rangeOffset||0),e=o.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var Zn=M2("INSERT_UPLOAD_COMMAND"),Lc=t=>{let e=T2(21),{clientProps:o}=t,[n]=E2(),r=o?.disabledCollections,l=o?.enabledCollections,s;e[0]!==r||e[1]!==l?(s={collectionSlugsBlacklist:r,collectionSlugsWhitelist:l,uploads:!0},e[0]=r,e[1]=l,e[2]=s):s=e[2];let{enabledCollectionSlugs:i}=uo(s),{modalSlug:u,setCollectionSlug:d,setInitialForms:c,setOnCancel:a,setOnSuccess:m,setSelectableCollections:p}=N2(),{isModalOpen:h,openModal:f}=y2(),g;e[3]!==u||e[4]!==n||e[5]!==i||e[6]!==h||e[7]!==f||e[8]!==d||e[9]!==c||e[10]!==a||e[11]!==m||e[12]!==p?(g=x=>{let{files:C}=x;if(C?.length!==0&&(c(k=>[...k??[],...C.map(B2)]),!h(u))){if(!i.length||!i[0])return;d(i[0]),p(i),a(()=>{n.update(j2)}),m(k=>{let T=new Map(k.map(H2));n.update(()=>{for(let I of Nc()){let L=I.node;if(mt(L)){let S=L.getData();if(S?.pending){let N=T.get(S.pending?.formID);N&&L.replace(ge({data:{id:new qn.default().toHexString(),fields:{},relationTo:N.collectionSlug,value:N.doc.id}}))}}}})}),f(u)}},e[3]=u,e[4]=n,e[5]=i,e[6]=h,e[7]=f,e[8]=d,e[9]=c,e[10]=a,e[11]=m,e[12]=p,e[13]=g):g=e[13];let _=L2(g),E;e[14]!==n||e[15]!==_?(E=()=>{if(!n.hasNodes([he]))throw new Error("UploadPlugin: UploadNode not registered on editor");return S2(n.registerNodeTransform(he,x=>{let C=x.getData();if(!C?.pending)return;(async function(){let I=null,L=C?.pending?.src,S=C?.pending?.formID;if(L?.startsWith("data:")){let N=L.match(/data:(image\/[a-zA-Z]+);base64,/),w=N?N[1]:"image/png",v=L.replace(/^data:image\/[a-zA-Z]+;base64,/,""),y=atob(v),M=new Array(y.length);for(let F=0;F<y.length;F++)M[F]=y.charCodeAt(F);let $=new Uint8Array(M);I={alt:void 0,file:new File([$],"pasted-image."+w?.split("/",2)[1],{type:w}),formID:S}}else if(L?.startsWith("http")||L?.startsWith("https")){let w=await(await fetch(L)).blob(),v=L.split("/").pop()||"pasted-image"+w.type.split("/",2)[1];I={alt:void 0,file:new File([w],v,{type:w.type}),formID:S}}I&&_({files:[I]})})()}),n.registerCommand(Zn,x=>(n.update(()=>{let C=Tc()||_c();if(wc(C)){let k=ge({data:{id:x.id,fields:x.fields,relationTo:x.relationTo,value:x.value}}),{focus:T}=C,I=T.getNode();Yn(k),Qn(I)&&!I.__first&&I.remove()}}),!0),I2),n.registerCommand(D2,x=>{if(!(x instanceof ClipboardEvent))return!1;let C=x.clipboardData;if(!C?.types?.length||C?.types?.includes("text/html"))return!1;let k=[];return C?.files?.length&&Array.from(C.files).forEach(T=>{k.push({alt:"",file:T,formID:new qn.default().toHexString()})}),k.length?(n.update(()=>{let T=Tc()||_c();if(wc(T))for(let I of k){let L=ge({data:{pending:{formID:I.formID,src:URL.createObjectURL(I.file)}}}),{focus:S}=T,N=S.getNode();Yn(L),Qn(N)&&!N.__first&&N.remove()}}),_({files:k}),!0):!1},Ec),n.registerCommand(A2,x=>{if(!(x instanceof DragEvent))return!1;let C=x.dataTransfer;if(!C?.types?.length)return!1;let k=[];return C?.files?.length&&Array.from(C.files).forEach(T=>{k.push({alt:"",file:T,formID:new qn.default().toHexString()})}),k.length?(x.preventDefault(),x.stopPropagation(),n.update(()=>{if(F2(x)){let T=P2(x),I=v2();T!=null&&I.applyDOMRange(T),R2(I);for(let L of k){let S=ge({data:{pending:{formID:L.formID,src:URL.createObjectURL(L.file)}}}),{focus:N}=I,w=N.getNode();Yn(S),Qn(w)&&!w.__first&&w.remove()}}}),_({files:k}),!0):!1},Ec))},e[14]=n,e[15]=_,e[16]=E):E=e[16];let R;e[17]!==n?(R=[n],e[17]=n,e[18]=R):R=e[18],O2(E,R);let b;return e[19]!==i?(b=w2(kc,{enabledCollectionSlugs:i}),e[19]=i,e[20]=b):b=e[20],b};function B2(t){return{file:t.file,formID:t.formID}}function j2(){for(let t of Nc()){let e=t.node;mt(e)&&e.getData()?.pending&&e.remove()}}function H2(t){return[t.formID,t]}var U2=A({nodes:[he],plugins:[{Component:Lc,position:"normal"}],slashMenu:{groups:[X([{Icon:Jn,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Qe,{replace:!1})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:Jn,isActive:({selection:t})=>{if(!G2(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return mt(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Qe,{replace:!1})}}])]}});import{jsx as tx}from"react/jsx-runtime";import{getFromImportMap as Ic}from"payload/shared";import{useMemo as ox}from"react";import{c as W2}from"react/compiler-runtime";import{jsx as Lo}from"react/jsx-runtime";import{createElement as z2}from"react";import{ShimmerEffect as K2,useConfig as J2}from"@payloadcms/ui";import{lazy as X2,Suspense as Z2,useEffect as Y2,useState as q2}from"react";var yc={block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",inlineBlock:"LexicalEditorTheme__inlineBlock",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",hrSelected:"LexicalEditorTheme__hrSelected",indent:"LexicalEditorTheme__indent",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",placeholder:"LexicalEditorTheme__placeholder",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",root:"LexicalEditorTheme",rtl:"LexicalEditorTheme__rtl",tab:"LexicalEditorTheme__tabNode",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableAlignment:{center:"LexicalEditorTheme__tableAlignmentCenter",right:"LexicalEditorTheme__tableAlignmentRight"},tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableFrozenColumn:"LexicalEditorTheme__tableFrozenColumn",tableRowStriping:"LexicalEditorTheme__tableRowStriping",tableScrollableWrapper:"LexicalEditorTheme__tableScrollableWrapper",tableSelected:"LexicalEditorTheme__tableSelected",tableSelection:"LexicalEditorTheme__tableSelection",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"LexicalEditorTheme__upload"};var er={namespace:"lexical",theme:yc};function vc({config:t,featureClientImportMap:e,featureClientSchemaMap:o,field:n,schemaPath:r,unSanitizedEditorConfig:l}){let s=new Map,i=[];for(let c of l.features){if(!c?.clientFeatureProps?.featureKey||c?.clientFeatureProps?.order===void 0||c?.clientFeatureProps?.order===null){console.warn("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected. Skipping feature.");continue}s.set(c.clientFeatureProps.featureKey,c),i.push(c)}l.features=i,l.features=l.features.sort((c,a)=>c.clientFeatureProps.order-a.clientFeatureProps.order);let u=new Map,d=0;for(let c of l.features){let a=typeof c.feature=="function"?c.feature({config:t,featureClientImportMap:e,featureClientSchemaMap:o,featureProviderMap:s,field:n,resolvedFeatures:u,schemaPath:r,unSanitizedEditorConfig:l}):c.feature;a.key=c.clientFeatureProps.featureKey,a.order=d,u.set(c.clientFeatureProps.featureKey,a),d++}return u}import{deepMerge as V2}from"payload/shared";var Rc=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},o={};if(t.forEach(n=>{n.key==="toolbarFixed"&&n.sanitizedClientFeatureProps?.customGroups&&(o={...o,...n.sanitizedClientFeatureProps.customGroups})}),!t?.size)return e;t.forEach(n=>{if(n.providers?.length&&(e.providers=e.providers.concat(n.providers)),n.enableFormats?.length&&e.enabledFormats.push(...n.enableFormats),n.nodes?.length)for(let r of n.nodes)e.nodes.push(r);if(n.plugins?.length&&n.plugins.forEach((r,l)=>{e.plugins?.push({clientProps:n.sanitizedClientFeatureProps,Component:r.Component,key:n.key+l,position:r.position})}),n.toolbarInline?.groups?.length)for(let r of n.toolbarInline.groups){let l=e.toolbarInline.groups.find(s=>s.key===r.key);l?e.toolbarInline.groups=e.toolbarInline.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarInline?.groups.push(l)}if(n.toolbarFixed?.groups?.length)for(let r of n.toolbarFixed.groups){let l=e.toolbarFixed.groups.find(s=>s.key===r.key);l?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarFixed?.groups.push(l)}if(n.slashMenu?.groups){n.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(n.slashMenu.dynamicGroups));for(let r of n.slashMenu.groups){let l=e.slashMenu.groups.find(s=>s.key===r.key);l?e.slashMenu.groups=e.slashMenu.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.slashMenu.groups.push(l)}}if(n.markdownTransformers?.length)for(let r of n.markdownTransformers)typeof r=="function"?e.markdownTransformers.push(r({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(r);e.enabledFeatures.push(n.key)}),Object.keys(o).length>0&&(e.toolbarFixed.groups=e.toolbarFixed.groups.map(n=>{let r=o[n.key];return r?V2(n,r):n})),e.toolbarInline.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0),e.toolbarFixed.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);for(let n of e.toolbarInline.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);for(let n of e.toolbarFixed.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);return e};function tr(t,e,o,n){return{admin:o,features:Rc(t),lexical:e,resolvedFeatureMap:t,view:n}}var Q2=X2(()=>import("./Field-DXKR3OGV.js").then(t=>({default:t.RichText}))),or=t=>Lo(Fo,{inheritable:!0,views:t.views,children:Lo(ex,{...t})}),ex=t=>{let e=W2(23),{admin:o,clientFeatures:n,featureClientImportMap:r,featureClientSchemaMap:l,field:s,lexicalEditorConfig:i,schemaPath:u,views:d}=t,c;e[0]!==o?(c=o===void 0?{}:o,e[0]=o,e[1]=c):c=e[1];let a=c,m;e[2]!==r?(m=r===void 0?{}:r,e[2]=r,e[3]=m):m=e[3];let p=m,h=i===void 0?er:i,{currentView:f}=Po(),g=d?.[f]?.admin??a,_=d?.[f]?.lexical,E;e[4]!==h||e[5]!==_?(E=typeof _=="function"?_(h):_??h,e[4]=h,e[5]=_,e[6]=E):E=e[6];let R=E,{config:b}=J2(),[x,C]=q2(null),k,T;e[7]!==n||e[8]!==b||e[9]!==f||e[10]!==g||e[11]!==R||e[12]!==p||e[13]!==l||e[14]!==s||e[15]!==x||e[16]!==u||e[17]!==d?(k=()=>{if(x&&x.view===f)return;let L=d?.[f],S=L?.filterFeatures?L.filterFeatures(n):n,N=[];for(let v of Object.values(S))!v.clientFeatureProvider||!v.clientFeatureProps||N.push(v.clientFeatureProvider(v.clientFeatureProps));let w=vc({config:b,featureClientImportMap:p,featureClientSchemaMap:l,field:s,schemaPath:u??s.name,unSanitizedEditorConfig:{features:N,lexical:R}});C(tr(w,R,g,f))},T=[g,n,b,p,l,s,x,R,u,f,d],e[7]=n,e[8]=b,e[9]=f,e[10]=g,e[11]=R,e[12]=p,e[13]=l,e[14]=s,e[15]=x,e[16]=u,e[17]=d,e[18]=k,e[19]=T):(k=e[18],T=e[19]),Y2(k,T);let I;return e[20]!==x||e[21]!==t?(I=Lo(Z2,{fallback:Lo(K2,{height:"35vh"}),children:x&&z2(Q2,{...t,editorConfig:x,key:x.view})}),e[20]=x,e[21]=t,e[22]=I):I=e[22],I};var nx=t=>{let{featureClientSchemaMap:e={},features:o={},field:n,forceRender:r,importMap:l,path:s,permissions:i,readOnly:u,schemaPath:d}=t,{clientFeatures:c,featureClientImportMap:a}=ox(()=>{let m={},p={},h=Object.entries(o).sort(([,f],[,g])=>f.order-g.order);for(let[f,g]of h){if(m[f]={},g.ClientFeature){let _=Ic({importMap:l,PayloadComponent:g.ClientFeature,schemaPath:"lexical-clientComponent",silent:!0});if(_){let E={...g.clientFeatureProps??{},featureKey:g.key,order:g.order};typeof g.ClientFeature=="object"&&g.ClientFeature.clientProps&&(E.clientProps=g.ClientFeature.clientProps),m[f]={clientFeatureProps:E,clientFeatureProvider:_}}}if(g.componentImports&&typeof g.componentImports=="object")for(let[_,E]of Object.entries(g.componentImports)){let R=Ic({importMap:l,PayloadComponent:E,schemaPath:"lexical-clientComponent",silent:!0});R&&(p[`${f}.${_}`]=R)}}return{clientFeatures:m,featureClientImportMap:p}},[o,l]);return tx(or,{clientFeatures:c,featureClientImportMap:a,featureClientSchemaMap:e,field:n,forceRender:r,path:s,permissions:i,readOnly:u,schemaPath:d})};function rx(...t){return t.filter(Boolean).join(" ")}var lx=t=>(e,o,n)=>{let r=t(n);r&&(r.append(...o),e.replace(r),r.select(0,0))};var yo=new WeakMap;function Mc(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function vo(t,e){let o=yo.get(t);if(o===void 0){let n=new Set,r=s=>{o!==void 0&&(o.start=Mc(s))},l=s=>{if(o===void 0)return;let{start:i}=o;if(i===null)return;let u=Mc(s);for(let d of n)u!==null&&d([u[0]-i[0],u[1]-i[1]],s)};t.addEventListener("touchstart",r),t.addEventListener("touchend",l),o={handleTouchend:l,handleTouchstart:r,listeners:n,start:null},yo.set(t,o)}return o.listeners.add(e),()=>{ix(t,e)}}function ix(t,e){let o=yo.get(t);if(o===void 0)return;let{listeners:n}=o;n.delete(e),n.size===0&&(yo.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function sx(t,e){return vo(t,(o,n)=>{let[r,l]=o;r<0&&-r>Math.abs(l)&&e(r,n)})}function ax(t,e){return vo(t,(o,n)=>{let[r,l]=o;r>0&&r>Math.abs(l)&&e(r,n)})}function cx(t,e){return vo(t,(o,n)=>{let[r,l]=o;l<0&&-l>Math.abs(r)&&e(r,n)})}function ux(t,e){return vo(t,(o,n)=>{let[r,l]=o;l>0&&l>Math.abs(r)&&e(r,n)})}import{c as dx}from"react/compiler-runtime";import{jsx as mx}from"react/jsx-runtime";import"react";var px=()=>{let t=dx(2),{EditButton:e}=be(),o;return t[0]!==e?(o=e?mx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as fx}from"react/compiler-runtime";import{jsx as hx}from"react/jsx-runtime";import"react";var gx=()=>{let t=fx(2),{RemoveButton:e}=be(),o;return t[0]!==e?(o=e?hx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as xx}from"react/compiler-runtime";import{jsx as Cx}from"react/jsx-runtime";import"react";var bx=()=>{let t=xx(2),{Label:e}=be(),o;return t[0]!==e?(o=e?Cx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as kx}from"react/compiler-runtime";import{jsx as _x}from"react/jsx-runtime";import"react";var Tx=t=>{let e=kx(3),{children:o}=t,{InlineBlockContainer:n}=be(),r;return e[0]!==n||e[1]!==o?(r=n?_x(n,{children:o}):null,e[0]=n,e[1]=o,e[2]=r):r=e[2],r};import{jsx as wx}from"react/jsx-runtime";import"react";var Ex=t=>{let{children:e,...o}=t,{BlockCollapsible:n}=ae();return n?wx(n,{...o,children:e}):null};import{c as Sx}from"react/compiler-runtime";import{jsx as Nx}from"react/jsx-runtime";import"react";var Lx=()=>{let t=Sx(2),{EditButton:e}=ae(),o;return t[0]!==e?(o=e?Nx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as yx}from"react/compiler-runtime";import{jsx as vx}from"react/jsx-runtime";import"react";var Rx=()=>{let t=yx(2),{RemoveButton:e}=ae(),o;return t[0]!==e?(o=e?vx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{stringify as Ix}from"qs-esm";var Mx=({apiURL:t,depth:e,draft:o,locale:n})=>async({id:l,collectionSlug:s,select:i})=>{let u=Ix({depth:e??0,draft:o??!1,locale:n,select:i},{addQueryPrefix:!0});return await fetch(`${t}/${s}/${l}${u}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(c=>c.json())};var Ac={customEndRegex:{optional:!0,regExp:/[ \t]*```$/},customStartRegex:/^[ \t]*```(\w+)?/,doNotTrimChildren:!0,export:({fields:t})=>!t.code.includes(`
57
+ `,Js="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Xs="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",z0=new RegExp("^[^"+Xs+"]*["+Js+"]"),G0=new RegExp("^[^"+Js+"]*["+Xs+"]"),U0={bold:O.IS_BOLD,code:O.IS_CODE,highlight:O.IS_HIGHLIGHT,italic:O.IS_ITALIC,strikethrough:O.IS_STRIKETHROUGH,subscript:O.IS_SUBSCRIPT,superscript:O.IS_SUPERSCRIPT,underline:O.IS_UNDERLINE},W0={directionless:O.IS_DIRECTIONLESS,unmergeable:O.IS_UNMERGEABLE},V0={center:O.IS_ALIGN_CENTER,end:O.IS_ALIGN_END,justify:O.IS_ALIGN_JUSTIFY,left:O.IS_ALIGN_LEFT,right:O.IS_ALIGN_RIGHT,start:O.IS_ALIGN_START},K0={[O.IS_ALIGN_CENTER]:"center",[O.IS_ALIGN_END]:"end",[O.IS_ALIGN_JUSTIFY]:"justify",[O.IS_ALIGN_LEFT]:"left",[O.IS_ALIGN_RIGHT]:"right",[O.IS_ALIGN_START]:"start"},J0={normal:O.IS_NORMAL,segmented:O.IS_SEGMENTED,token:O.IS_TOKEN},X0={[O.IS_NORMAL]:"normal",[O.IS_SEGMENTED]:"segmented",[O.IS_TOKEN]:"token"};var Ys={text:({node:t})=>{let e=t.text;return t.format&O.IS_BOLD&&(e=Ue("strong",{children:e})),t.format&O.IS_ITALIC&&(e=Ue("em",{children:e})),t.format&O.IS_STRIKETHROUGH&&(e=Ue("span",{style:{textDecoration:"line-through"},children:e})),t.format&O.IS_UNDERLINE&&(e=Ue("span",{style:{textDecoration:"underline"},children:e})),t.format&O.IS_CODE&&(e=Ue("code",{children:e})),t.format&O.IS_SUBSCRIPT&&(e=Ue("sub",{children:e})),t.format&O.IS_SUPERSCRIPT&&(e=Ue("sup",{children:e})),e}};import{jsx as Ot}from"react/jsx-runtime";var Zs={upload:({node:t})=>{let e=t;if(typeof e.value!="object")return null;let o=e.value,n=e.fields?.alt||o?.alt||"",r=o.url;if(!o.mimeType.startsWith("image"))return Ot("a",{href:r,rel:"noopener noreferrer",children:o.filename});if(!o.variants||!Object.keys(o.variants).length)return Ot("img",{alt:n,height:o.height,src:r,width:o.width});let l=[];for(let s in o.variants){let i=o.variants[s];if(!i||!i.width||!i.height||!i.mimeType||!i.filesize||!i.filename||!i.url)continue;let c=i?.url;l.push(Ot("source",{media:`(max-width: ${i.width}px)`,srcSet:c,type:i.mimeType},s))}return l.push(Ot("img",{alt:n,height:o?.height,src:r,width:o?.width},"image")),Ot("picture",{children:l})}};var ut={...Ws,...Ys,...js,...Os,...Ks,...Ps,...Bs,...Us,...zs({}),...Zs,...Vs};import{jsx as xo,Fragment as Y0}from"react/jsx-runtime";import go from"react";function qs(t){if(!!!t?.root?.children?.length)return!1;let o=!1;if(t?.root?.children?.length===1&&t?.root?.children[0]?.type==="paragraph"){let n=t?.root?.children[0];if(!n?.children||n?.children?.length===0)o=!0;else if(n?.children?.length===1){let r=n?.children[0];r?.type==="text"&&(r?.text?.length||(o=!0))}}return!o}function Z0(t){return e=>{let o={...e,isEditor:!1,isJSXConverter:!0};if(t.Component)return t.Component(o);if(t.html){let n=typeof t.html=="function"?t.html(o):t.html;return xo("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function Qs(t){return e=>{if(t.Component){let o={...e,isEditor:!1,isJSXConverter:!0};return t.Component(o)}if(t.Block){let o=e.node,n={childIndex:e.childIndex,converters:e.converters,formData:o.fields??{},isEditor:!1,isJSXConverter:!0,node:o,nodesToJSX:e.nodesToJSX,parent:e.parent};return go.createElement(t.Block,n)}if(t.html){let o={...e,isEditor:!1,isJSXConverter:!0},n=typeof t.html=="function"?t.html(o):t.html;return xo("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function q0(t){let e={};for(let[o,n]of Object.entries(t)){if(!n||typeof n!="object")continue;if(o==="blocks"){e.blocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.blocks[l]=Qs(i))}continue}if(o==="inlineBlocks"){e.inlineBlocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.inlineBlocks[l]=Qs(i))}continue}let r=n;(r.Component||r.html)&&(e[o]=Z0(r))}return e}function ea({converters:t,data:e,disableIndent:o,disableTextAlign:n,nodeMap:r}){if(qs(e)){let l=r?q0(r):void 0,s=l?{...t,...l,blocks:{...t.blocks,...l.blocks},inlineBlocks:{...t.inlineBlocks,...l.inlineBlocks}}:t;return ta({converters:s,disableIndent:o,disableTextAlign:n,nodes:e.root.children,parent:e.root})}return xo(Y0,{})}function ta({converters:t,disableIndent:e,disableTextAlign:o,nodes:n,parent:r}){let l=t.unknown;return n.map((i,c)=>{let u;i.type==="block"?(u=t?.blocks?.[i?.fields?.blockType],!u&&!l&&console.error(`Lexical => JSX converter: Blocks converter: found ${i?.fields?.blockType} block, but no converter is provided`)):i.type==="inlineBlock"?(u=t?.inlineBlocks?.[i?.fields?.blockType],!u&&!l&&console.error(`Lexical => JSX converter: Inline Blocks converter: found ${i?.fields?.blockType} inline block, but no converter is provided`)):u=t[i.type];try{!u&&l&&(u=l);let d;u?d=typeof u=="function"?u({childIndex:c,converters:t,node:i,nodesToJSX:m=>ta({converters:m.converters??t,disableIndent:m.disableIndent??e,disableTextAlign:m.disableTextAlign??o,nodes:m.nodes,parent:m.parent??{...i,parent:r}}),parent:r}):u:d=xo("span",{children:"unknown node"},c);let a={};if(!o&&(!Array.isArray(o)||!o?.includes(i.type))&&"format"in i&&i.format)switch(i.format){case"center":a.textAlign="center";break;case"end":a.textAlign="right";break;case"justify":a.textAlign="justify";break;case"left":break;case"right":a.textAlign="right";break;case"start":a.textAlign="left";break}if(!e&&(!Array.isArray(e)||!e?.includes(i.type))&&"indent"in i&&i.indent&&i.type!=="listitem"&&(a.paddingInlineStart=`${Number(i.indent)*40}px`),go.isValidElement(d)){if(a.textAlign||a.paddingInlineStart){let p={...a,...d?.props?.style??{}};return go.cloneElement(d,{key:c,style:p})}return go.cloneElement(d,{key:c})}return d}catch(d){return console.error("Error converting lexical node to JSX:",d,"node:",i),null}}).filter(Boolean)}function Pn({className:t,converters:e,data:o,disableContainer:n,disableIndent:r,disableTextAlign:l,nodeMap:s}){if(!o)return null;let i=e,c={};i?typeof i=="function"?c=i({defaultConverters:ut}):c=i:c=ut;let u=o&&!Array.isArray(o)&&typeof o=="object"&&"root"in o&&ea({converters:c,data:o,disableIndent:r,disableTextAlign:l,nodeMap:s});return n?oa(Q0,{children:u}):oa("div",{className:t??"payload-richtext",children:u})}function ra(){let t=eh(7),[e]=th(),o;t[0]!==e?(o=()=>e.getEditorState().toJSON(),t[0]=e,t[1]=o):o=t[1];let[n,r]=nh(o),l,s;t[2]!==e?(l=()=>e.registerUpdateListener(c=>{let{editorState:u}=c;r(u.toJSON())}),s=[e],t[2]=e,t[3]=l,t[4]=s):(l=t[3],s=t[4]),oh(l,s);let i;return t[5]!==n?(i=na("div",{className:"debug-jsx-converter",children:na(Pn,{converters:ut,data:n})}),t[5]=n,t[6]=i):i=t[6],i}var rh=A({plugins:[{Component:ra,position:"bottom"}]});var z={amber:{50:"oklch(0.987 0.022 95.277)",100:"oklch(0.962 0.059 95.617)",200:"oklch(0.924 0.12 95.746)",300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",800:"oklch(0.473 0.137 46.201)",900:"oklch(0.414 0.112 45.904)",950:"oklch(0.279 0.077 45.635)"},black:"#000",blue:{50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},current:"currentColor",cyan:{50:"oklch(0.984 0.019 200.873)",100:"oklch(0.956 0.045 203.388)",200:"oklch(0.917 0.08 205.041)",300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)",800:"oklch(0.45 0.085 224.283)",900:"oklch(0.398 0.07 227.392)",950:"oklch(0.302 0.056 229.695)"},emerald:{50:"oklch(0.979 0.021 166.113)",100:"oklch(0.95 0.052 163.051)",200:"oklch(0.905 0.093 164.15)",300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)",800:"oklch(0.432 0.095 166.913)",900:"oklch(0.378 0.077 168.94)",950:"oklch(0.262 0.051 172.552)"},fuchsia:{50:"oklch(0.977 0.017 320.058)",100:"oklch(0.952 0.037 318.852)",200:"oklch(0.903 0.076 319.62)",300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)",800:"oklch(0.452 0.211 324.591)",900:"oklch(0.401 0.17 325.612)",950:"oklch(0.293 0.136 325.661)"},gray:{50:"oklch(0.985 0.002 247.839)",100:"oklch(0.967 0.003 264.542)",200:"oklch(0.928 0.006 264.531)",300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",800:"oklch(0.278 0.033 256.848)",900:"oklch(0.21 0.034 264.665)",950:"oklch(0.13 0.028 261.692)"},green:{50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},indigo:{50:"oklch(0.962 0.018 272.314)",100:"oklch(0.93 0.034 272.788)",200:"oklch(0.87 0.065 274.039)",300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)",800:"oklch(0.398 0.195 277.366)",900:"oklch(0.359 0.144 278.697)",950:"oklch(0.257 0.09 281.288)"},inherit:"inherit",lime:{50:"oklch(0.986 0.031 120.757)",100:"oklch(0.967 0.067 122.328)",200:"oklch(0.938 0.127 124.321)",300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",800:"oklch(0.453 0.124 130.933)",900:"oklch(0.405 0.101 131.063)",950:"oklch(0.274 0.072 132.109)"},neutral:{50:"oklch(0.985 0 0)",100:"oklch(0.97 0 0)",200:"oklch(0.922 0 0)",300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",800:"oklch(0.269 0 0)",900:"oklch(0.205 0 0)",950:"oklch(0.145 0 0)"},orange:{50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},pink:{50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},purple:{50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717)"},red:{50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},rose:{50:"oklch(0.969 0.015 12.422)",100:"oklch(0.941 0.03 12.58)",200:"oklch(0.892 0.058 10.001)",300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)",800:"oklch(0.455 0.188 13.697)",900:"oklch(0.41 0.159 10.272)",950:"oklch(0.271 0.105 12.094)"},sky:{50:"oklch(0.977 0.013 236.62)",100:"oklch(0.951 0.026 236.824)",200:"oklch(0.901 0.058 230.902)",300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)",800:"oklch(0.443 0.11 240.79)",900:"oklch(0.391 0.09 240.876)",950:"oklch(0.293 0.066 243.157)"},slate:{50:"oklch(0.984 0.003 247.858)",100:"oklch(0.968 0.007 247.896)",200:"oklch(0.929 0.013 255.508)",300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",800:"oklch(0.279 0.041 260.031)",900:"oklch(0.208 0.042 265.755)",950:"oklch(0.129 0.042 264.695)"},stone:{50:"oklch(0.985 0.001 106.423)",100:"oklch(0.97 0.001 106.424)",200:"oklch(0.923 0.003 48.717)",300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",800:"oklch(0.268 0.007 34.298)",900:"oklch(0.216 0.006 56.043)",950:"oklch(0.147 0.004 49.25)"},teal:{50:"oklch(0.984 0.014 180.72)",100:"oklch(0.953 0.051 180.801)",200:"oklch(0.91 0.096 180.426)",300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)",800:"oklch(0.437 0.078 188.216)",900:"oklch(0.386 0.063 188.416)",950:"oklch(0.277 0.046 192.524)"},transparent:"transparent",violet:{50:"oklch(0.969 0.016 293.756)",100:"oklch(0.943 0.029 294.588)",200:"oklch(0.894 0.057 293.283)",300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)",800:"oklch(0.432 0.232 292.759)",900:"oklch(0.38 0.189 293.745)",950:"oklch(0.283 0.141 291.089)"},white:"#fff",yellow:{50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"},zinc:{50:"oklch(0.985 0 0)",100:"oklch(0.967 0.001 286.375)",200:"oklch(0.92 0.004 286.32)",300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",800:"oklch(0.274 0.006 286.033)",900:"oklch(0.21 0.006 285.885)",950:"oklch(0.141 0.005 285.823)"}},lh={text:{"text-red":{css:{color:`light-dark(${z.red[600]}, ${z.red[400]})`},label:"Red"},"text-orange":{css:{color:`light-dark(${z.orange[600]}, ${z.orange[400]})`},label:"Orange"},"text-yellow":{css:{color:`light-dark(${z.yellow[700]}, ${z.yellow[300]})`},label:"Yellow"},"text-green":{css:{color:`light-dark(${z.green[700]}, ${z.green[400]})`},label:"Green"},"text-blue":{css:{color:`light-dark(${z.blue[600]}, ${z.blue[400]})`},label:"Blue"},"text-purple":{css:{color:`light-dark(${z.purple[600]}, ${z.purple[400]})`},label:"Purple"},"text-pink":{css:{color:`light-dark(${z.pink[600]}, ${z.pink[400]})`},label:"Pink"}},background:{"bg-red":{css:{"background-color":`light-dark(${z.red[400]}, ${z.red[600]})`},label:"Red"},"bg-orange":{css:{"background-color":`light-dark(${z.orange[400]}, ${z.orange[600]})`},label:"Orange"},"bg-yellow":{css:{"background-color":`light-dark(${z.yellow[300]}, ${z.yellow[700]})`},label:"Yellow"},"bg-green":{css:{"background-color":`light-dark(${z.green[400]}, ${z.green[700]})`},label:"Green"},"bg-blue":{css:{"background-color":`light-dark(${z.blue[400]}, ${z.blue[600]})`},label:"Blue"},"bg-purple":{css:{"background-color":`light-dark(${z.purple[400]}, ${z.purple[600]})`},label:"Purple"},"bg-pink":{css:{"background-color":`light-dark(${z.pink[400]}, ${z.pink[600]})`},label:"Pink"}}};import{$isNodeSelection as Xh}from"lexical";import{jsx as la}from"react/jsx-runtime";import"react";var ih="M9.5 6C9.77614 6 10 6.22386 10 6.5C10 6.77614 9.77614 7 9.5 7H7.5C7.22386 7 7 7.22386 7 7.5V16.5C7 16.7761 7.22386 17 7.5 17H16.5C16.7761 17 17 16.7761 17 16.5V14.5C17 14.2239 17.2239 14 17.5 14C17.7761 14 18 14.2239 18 14.5V16.5C18 17.3284 17.3284 18 16.5 18H7.5C6.67157 18 6 17.3284 6 16.5V7.5C6 6.67157 6.67157 6 7.5 6H9.5ZM17.5 6C17.7761 6 18 6.22386 18 6.5V11.5C18 11.7761 17.7761 12 17.5 12C17.2239 12 17 11.7761 17 11.5V7.70703L12.8535 11.8535C12.6583 12.0488 12.3417 12.0488 12.1465 11.8535C11.9512 11.6583 11.9512 11.3417 12.1465 11.1465L16.293 7H12.5C12.2239 7 12 6.77614 12 6.5C12 6.22386 12.2239 6 12.5 6H17.5Z",Bn=({className:t})=>la("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:la("path",{d:ih,fill:"currentColor"})});import{jsx as dh}from"react/jsx-runtime";import{$applyNodeReplacement as mh}from"lexical";import*as sa from"react";import{DecoratorBlockNode as sh}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as ah}from"@lexical/utils";import{$applyNodeReplacement as ch}from"lexical";function uh(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:ia({relationTo:o,value:e})}:null}var Ft=class extends sh{__data;constructor({data:e,format:o,key:n}){super(o,n),this.__data=e}static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"relationship"}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:uh,priority:2}}}static importJSON(e){let o={relationTo:e.relationTo,value:e.value},n=ia(o);return n.setFormat(e.format),n}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return ah(o,e?.theme?.relationship),o}decorate(e,o){return null}exportDOM(){let e=document.createElement("div");e.setAttribute("data-lexical-relationship-id",String(typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value)),e.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship"}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value}`}setData(e){let o=this.getWritable();o.__data=e}};function ia(t){return ch(new Ft({data:t}))}var ph=sa.lazy(()=>import("./RelationshipComponent-YCPAKOL7.js").then(t=>({default:t.RelationshipComponent})));function fh(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:We({relationTo:o,value:e})}:null}var we=class extends Ft{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:fh,priority:2}}}static importJSON(e){let o={relationTo:e.relationTo,value:e.value},n=We(o);return n.setFormat(e.format),n}decorate(e,o){return dh(ph,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function We(t){return mh(new we({data:t}))}function jn(t){return t instanceof we}import{c as Fh}from"react/compiler-runtime";import{jsx as Ph}from"react/jsx-runtime";import{useLexicalComposerContext as Bh}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as jh}from"@lexical/utils";import{$getPreviousSelection as Hh,$getSelection as zh,$isParagraphNode as Gh,$isRangeSelection as Uh,COMMAND_PRIORITY_EDITOR as Wh,createCommand as Vh}from"lexical";import{useEffect as Kh}from"react";import{c as ua}from"react/compiler-runtime";import{jsx as Hn}from"react/jsx-runtime";import{useLexicalComposerContext as da}from"@lexical/react/LexicalComposerContext.js";import{toast as Nh}from"@payloadcms/ui";import{$getNodeByKey as Lh,COMMAND_PRIORITY_EDITOR as ma}from"lexical";import{useEffect as pa,useState as yh}from"react";import{c as hh}from"react/compiler-runtime";import{jsx as gh}from"react/jsx-runtime";import{useLexicalComposerContext as xh}from"@lexical/react/LexicalComposerContext";import{useListDrawer as Ch,useModal as bh}from"@payloadcms/ui";import{$getNodeByKey as aa,$getPreviousSelection as kh,$getRoot as _h,$getSelection as Th,$isRangeSelection as Eh,$setSelection as wh}from"lexical";import{useEffect as Sh,useState as ca}from"react";var Pt=t=>{let e=hh(23),[o]=xh(),[n,r]=ca(null),[l,s]=ca(!1),[i,c,u]=Ch(t),{closeDrawer:d,drawerSlug:a,isDrawerOpen:p,openDrawer:m}=u,{modalState:f}=bh(),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{let N=Th()??kh();r(N)},e[0]=h):h=e[0];let g=h,C;e[1]!==o||e[2]!==n?(C=()=>{n&&o.update(()=>{if(Eh(n)){let{anchor:N,focus:w}=n;aa(N.key)&&aa(w.key)&&wh(n.clone())}else _h().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=n,e[3]=C):C=e[3];let E=C,L;e[4]!==d?(L=()=>{d()},e[4]=d,e[5]=L):L=e[5];let x=L,b,k;e[6]!==a||e[7]!==f||e[8]!==E||e[9]!==l?(b=()=>{if(!l)return;let N=f[a];N&&!N?.isOpen&&(s(!1),setTimeout(()=>{E()},1))},k=[f,a,E,l],e[6]=a,e[7]=f,e[8]=E,e[9]=l,e[10]=b,e[11]=k):(b=e[10],k=e[11]),Sh(b,k);let _;e[12]!==c?(_=N=>gh(c,{...N,onClick:()=>{g()}}),e[12]=c,e[13]=_):_=e[13];let T;e[14]!==m?(T=()=>{g(),m(),s(!0)},e[14]=m,e[15]=T):T=e[15];let I;return e[16]!==i||e[17]!==x||e[18]!==p||e[19]!==a||e[20]!==_||e[21]!==T?(I={closeListDrawer:x,isListDrawerOpen:p,ListDrawer:i,listDrawerSlug:a,ListDrawerToggler:_,openListDrawer:T},e[16]=i,e[17]=x,e[18]=p,e[19]=a,e[20]=_,e[21]=T,e[22]=I):I=e[22],I};var Rh=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=Lh(o);r&&r.replace(We({relationTo:e,value:n}))}):t.dispatchCommand(zn,{relationTo:e,value:n})},vh=t=>{let e=ua(14),{enabledCollectionSlugs:o}=t,[n]=da(),[r,l]=yh(null),s=o?.[0],i;e[0]!==o||e[1]!==s?(i={collectionSlugs:o,selectedCollection:s},e[0]=o,e[1]=s,e[2]=i):i=e[2];let{closeListDrawer:c,ListDrawer:u,openListDrawer:d}=Pt(i),a,p;e[3]!==n||e[4]!==d?(a=()=>n.registerCommand(et,g=>(l(g?.replace?g?.replace.nodeKey:null),d(),!0),ma),p=[n,d],e[3]=n,e[4]=d,e[5]=a,e[6]=p):(a=e[5],p=e[6]),pa(a,p);let m;e[7]!==c||e[8]!==n||e[9]!==r?(m=g=>{let{collectionSlug:C,doc:E}=g;Rh({editor:n,relationTo:C,replaceNodeKey:r,value:E.id}),c()},e[7]=c,e[8]=n,e[9]=r,e[10]=m):m=e[10];let f=m,h;return e[11]!==u||e[12]!==f?(h=Hn(u,{onSelect:f}),e[11]=u,e[12]=f,e[13]=h):h=e[13],h},Ih=()=>{let t=ua(3),[e]=da(),o,n;return t[0]!==e?(o=()=>e.registerCommand(et,Mh,ma),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),pa(o,n),null},fa=({enabledCollectionSlugs:t})=>t?.length?Hn(vh,{enabledCollectionSlugs:t}):Hn(Ih,{});function Mh(){return Nh.error("No relationship collections enabled"),!0}import{c as Ah}from"react/compiler-runtime";import{useConfig as Dh,useEntityVisibility as $h}from"@payloadcms/ui";import"react";var Co=t=>{let e=Ah(11),{enabledCollectionSlugs:o}=t,{config:n}=Dh(),{collections:r}=n,{visibleEntities:l}=$h(),s,i;if(e[0]!==r||e[1]!==o||e[2]!==l){let u;e[5]!==o||e[6]!==l?(u=a=>{let{slug:p}=a;return o.includes(p)&&(!l?.collections||l.collections.includes(p))},e[5]=o,e[6]=l,e[7]=u):u=e[7];let d=r.filter(u);s=d,i=d.map(Oh),e[0]=r,e[1]=o,e[2]=l,e[3]=s,e[4]=i}else s=e[3],i=e[4];let c;return e[8]!==s||e[9]!==i?(c={enabledCollections:s,enabledCollectionSlugs:i},e[8]=s,e[9]=i,e[10]=c):c=e[10],c};function Oh(t){return t.slug}var zn=Vh("INSERT_RELATIONSHIP_COMMAND"),ha=t=>{let e=Fh(7),{clientProps:o}=t,[n]=Bh(),r;e[0]!==o.enabledCollectionSlugs?(r={enabledCollectionSlugs:o.enabledCollectionSlugs},e[0]=o.enabledCollectionSlugs,e[1]=r):r=e[1];let{enabledCollectionSlugs:l}=Co(r),s,i;e[2]!==n?(s=()=>{if(!n.hasNodes([we]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return n.registerCommand(zn,Jh,Wh)},i=[n],e[2]=n,e[3]=s,e[4]=i):(s=e[3],i=e[4]),Kh(s,i);let c;return e[5]!==l?(c=Ph(fa,{enabledCollectionSlugs:l}),e[5]=l,e[6]=c):c=e[6],c};function Jh(t){let e=zh()||Hh();if(Uh(e)){let o=We(t),{focus:n}=e,r=n.getNode();jh(o),Gh(r)&&!r.__first&&r.remove()}return!0}var Yh=A({nodes:[we],plugins:[{Component:ha,position:"normal"}],slashMenu:{groups:[q([{Icon:Bn,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(et,{replace:!1})}}])]},toolbarFixed:{groups:[be([{ChildComponent:Bn,isActive:({selection:t})=>{if(!Xh(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return jn(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(et,{replace:!1})}}])]}});import{c as M5}from"react/compiler-runtime";import{jsx as he,jsxs as A5}from"react/jsx-runtime";import{useLexicalComposerContext as D5}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as La}from"@lexical/react/useLexicalEditable";import{getTranslation as $5}from"@payloadcms/translations";import{useScrollInfo as O5,useThrottledEffect as F5,useTranslation as ya}from"@payloadcms/ui";import*as Ra from"react";import{useMemo as Eo}from"react";import{jsx as Zh,jsxs as qh}from"react/jsx-runtime";import{Tooltip as Qh,useTranslation as e5}from"@payloadcms/ui";import{$addUpdateTag as t5}from"lexical";import{useCallback as ga,useEffect as o5,useMemo as xa,useRef as n5,useState as r5}from"react";var Gn="toolbar-popup__button",Bt=({active:t=!1,children:e,editor:o,enabled:n=!0,item:r})=>{let{i18n:l}=e5(),{fieldProps:{featureClientSchemaMap:s,schemaPath:i}}=U(),[c,u]=r5(!1),d=n5(null);o5(()=>{d.current?.removeAttribute("data-pressing")},[t]);let a=xa(()=>r.label?typeof r.label=="function"?r.label({featureClientSchemaMap:s,i18n:l,schemaPath:i}):r.label:r.key.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,h=>h.toUpperCase()),[s,l,i,r]),p=xa(()=>[Gn,n?"":"disabled",t?"active":"",r.key?`${Gn}-${r.key}`:""].filter(Boolean).join(" "),[t,n,r.key]),m=ga(()=>{n&&o.focus(()=>{o.update(()=>{t5("toolbar")}),r.onSelect?.({editor:o,isActive:t})})},[o,r,t,n]),f=ga(h=>{h.preventDefault(),h.currentTarget.setAttribute("data-pressing","")},[]);return qh("button",{"aria-label":a,"aria-pressed":r.isActive?t:void 0,className:p,"data-button-key":r.key,disabled:!n,onClick:m,onMouseDown:f,onPointerEnter:()=>u(!0),onPointerLeave:()=>{u(!1),d.current?.removeAttribute("data-pressing")},ref:d,type:"button",children:[Zh(Qh,{className:`${Gn}__tooltip`,show:c,children:a}),e]})};import{c as d5}from"react/compiler-runtime";import{jsx as dt}from"react/jsx-runtime";import m5,{useMemo as p5}from"react";import{useTranslation as f5}from"@payloadcms/ui";import{jsx as Ve,jsxs as Ca}from"react/jsx-runtime";import{Button as l5}from"@payloadcms/ui";import{$addUpdateTag as i5,isDOMNode as s5}from"lexical";import Wn,{useCallback as a5,useEffect as ko,useId as c5,useMemo as ka,useRef as bo,useState as Un}from"react";var ba="toolbar-popup__dropdown-item",_a=Wn.createContext(null);function Ta({active:t,children:e,editor:o,enabled:n,Icon:r,item:l,itemKey:s,tooltip:i}){let c=ka(()=>[ba,n===!1?"disabled":"",t?"active":"",l?.key?`${ba}-${l.key}`:""].filter(Boolean).join(" "),[n,t,l.key]),u=bo(null),d=Wn.use(_a);if(d===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:a}=d;return ko(()=>{u?.current!=null&&a(u)},[u,a]),Ve(l5,{"aria-label":i,buttonStyle:"ghost",className:c,disabled:n===!1,extraButtonProps:{"aria-checked":l.isActive?!!t:void 0,"data-item-key":s,role:l.isActive?"menuitemcheckbox":"menuitem",tabIndex:-1},icon:r,iconPosition:"left",onClick:()=>{n!==!1&&o.focus(()=>{o.update(()=>{i5("toolbar")}),l.onSelect?.({editor:o,isActive:t})})},onMouseDown:p=>{p.preventDefault()},ref:u,tooltip:i,type:"button",children:e})}function u5({id:t,children:e,dropdownKey:o,dropDownRef:n,itemsContainerClassNames:r,onClose:l,shouldAutoFocus:s}){let[i,c]=Un(),[u,d]=Un(),a=a5(f=>{c(h=>h!=null?[...h,f]:[f])},[c]),p=f=>{if(i==null)return;let{key:h}=f,g=i.filter(C=>!C.current?.disabled);["ArrowDown","ArrowUp","Escape"].includes(h)&&f.preventDefault(),h==="Escape"?l():h==="Tab"?setTimeout(()=>l({restoreFocus:!1})):h==="ArrowUp"?d(C=>{if(C==null)return g[0];let E=g.indexOf(C)-1;return g[E===-1?g.length-1:E]}):h==="ArrowDown"&&d(C=>{if(C==null)return g[0];let E=g.indexOf(C);return g[E===g.length-1?0:E+1]})},m=ka(()=>({registerItem:a}),[a]);return ko(()=>{s&&i!=null&&u==null&&d(i.find(f=>!f.current?.disabled)),u!=null&&u?.current!=null&&u.current.focus()},[i,u,s]),Ve(_a,{value:m,children:Ve("div",{className:(r??["toolbar-popup__dropdown-items"]).join(" "),"data-dropdown-key":o,"data-theme":"dark",id:t,onKeyDown:p,popover:"manual",ref:n,role:"menu",tabIndex:-1,children:e})})}function Ea({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:n=!1,dropdownKey:r,Icon:l,itemsContainerClassNames:s,label:i,stopCloseOnClickSelf:c}){let u=bo(null),d=bo(null),a=bo(!1),p=c5(),m=`toolbar-dropdown-${r}-${p}`,[f,h]=Un(!1),g=({restoreFocus:C=!0}={})=>{h(!1),C&&d?.current!=null&&d.current.focus()};return ko(()=>{let C=d.current,E=u.current;if(f&&C!==null&&E!==null){E.matches(":popover-open")||E.showPopover();let L=()=>{let{bottom:x,left:b,top:k}=C.getBoundingClientRect(),_=8,T=5,I=x+T,N=k-E.offsetHeight-T,w=Math.max(_,window.innerHeight-E.offsetHeight-_),y=I+E.offsetHeight+_<=window.innerHeight?I:N>=_?N:I;E.style.position="fixed",E.style.top=`${Math.max(_,Math.min(y,w))}px`,E.style.left=`${Math.max(8,Math.min(b-5,window.innerWidth-E.offsetWidth-20))}px`};return L(),window.addEventListener("resize",L),window.addEventListener("scroll",L,{capture:!0,passive:!0}),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,{capture:!0})}}},[u,d,f]),ko(()=>{let C=d.current;if(C!==null&&f){let E=L=>{let x=L.target;s5(x)&&(c&&u.current&&u.current.contains(x)||C.contains(x)||h(!1))};return document.addEventListener("click",E),()=>{document.removeEventListener("click",E)}}},[u,d,f,c]),Ca(Wn.Fragment,{children:[Ca("button",{"aria-controls":m,"aria-expanded":f,"aria-haspopup":"menu","aria-label":t,className:e+(f?" active":""),"data-dropdown-key":r,disabled:n,onClick:C=>{C.preventDefault(),a.current=!1,h(!f)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a.current=!0,h(!f))},onMouseDown:C=>{C.preventDefault()},ref:d,type:"button",children:[l&&Ve(l,{}),i&&Ve("span",{className:"toolbar-popup__dropdown-label",children:i}),Ve("i",{className:"toolbar-popup__dropdown-caret"})]}),f&&Ve(u5,{dropdownKey:r,dropDownRef:u,id:m,itemsContainerClassNames:s,onClose:g,shouldAutoFocus:a.current,children:o})]})}var Vn="toolbar-popup__dropdown",h5=t=>{let e=d5(15),{active:o,anchorElem:n,editor:r,enabled:l,iconOnly:s,item:i}=t,{i18n:c}=f5(),{fieldProps:u}=U(),{featureClientSchemaMap:d,schemaPath:a}=u;if(i.Component){let m;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==l||e[4]!==i?(m=i?.Component&&dt(i.Component,{active:o,anchorElem:n,editor:r,enabled:l,item:i},i.key),e[0]=o,e[1]=n,e[2]=r,e[3]=l,e[4]=i,e[5]=m):m=e[5],m}let p;if(e[6]!==o||e[7]!==r||e[8]!==l||e[9]!==d||e[10]!==c||e[11]!==s||e[12]!==i||e[13]!==a){let m=i.key,f;i.label&&(m=typeof i.label=="function"?i.label({featureClientSchemaMap:d,i18n:c,schemaPath:a}):i.label),m.length>25?f=m.substring(0,25)+"...":f=m,p=dt(Ta,{active:o,editor:r,enabled:l,Icon:i?.ChildComponent?dt(i.ChildComponent,{}):void 0,item:i,itemKey:i.key,tooltip:s?m:void 0,children:dt("span",{className:"text",children:f})},i.key),e[6]=o,e[7]=r,e[8]=l,e[9]=d,e[10]=c,e[11]=s,e[12]=i,e[13]=a,e[14]=p}else p=e[14];return p},g5=m5.memo(h5),jt=({anchorElem:t,classNames:e,editor:o,group:n,groupState:r,Icon:l,itemsContainerClassNames:s,label:i})=>{let{items:c,key:u}=n,d=p5(()=>c?.length?c.map(a=>dt(g5,{active:r.activeItemKeys.includes(a.key),anchorElem:t,editor:o,enabled:r.enabledItemKeys.includes(a.key),iconOnly:n.iconOnly,item:a},a.key)):null,[c,r.activeItemKeys,r.enabledItemKeys,t,o]);return dt(Ea,{buttonAriaLabel:`${u} dropdown`,buttonClassName:[Vn,`${Vn}-${u}`,...e||[]].filter(Boolean).join(" "),disabled:!r.enabledGroup,dropdownKey:u,Icon:l,itemsContainerClassNames:[`${Vn}-items`,...s||[]],label:i,children:d},u)};import{useEffect as x5}from"react";function _o({toolbarRef:t}){x5(()=>{let e=t.current;if(!e)return;let o,n=()=>Array.from(e.querySelectorAll("button")).filter(c=>!c.closest('[role="menu"]')&&c.closest('[role="toolbar"]')===e),r=()=>{let c=n(),u=c.filter(d=>!d.disabled);(!o||!u.includes(o))&&(o=u[0]);for(let d of c)d.tabIndex=d===o?0:-1},l=c=>{let u=n().find(d=>d===c.target);u&&(o=u,r())},s=c=>{if(c.altKey||c.ctrlKey||c.metaKey||c.shiftKey)return;let u=n().filter(m=>!m.disabled),d=u.findIndex(m=>m===c.target);if(d===-1)return;let a=getComputedStyle(e).direction==="rtl",p;switch(c.key){case"ArrowLeft":p=d+(a?1:-1);break;case"ArrowRight":p=d+(a?-1:1);break;case"End":p=u.length-1;break;case"Home":p=0;break;default:return}c.preventDefault(),c.stopPropagation(),u[(p+u.length)%u.length]?.focus()};r();let i=new MutationObserver(r);return i.observe(e,{attributeFilter:["disabled"],childList:!0,subtree:!0}),e.addEventListener("focusin",l),e.addEventListener("keydown",s),()=>{i.disconnect(),e.removeEventListener("focusin",l),e.removeEventListener("keydown",s)}},[t])}import{mergeRegister as C5}from"@lexical/utils";import{$getSelection as b5}from"lexical";import{useCallback as k5,useDeferredValue as _5,useEffect as T5,useRef as wa,useState as E5}from"react";function w5(t){let e=new Map,o=new Map;if(!t?.length)return{groupStates:o,itemStates:e};for(let n of t){let r=[];for(let l of n.items)e.set(l.key,{active:!1,enabled:!0}),r.push(l.key);o.set(n.key,{activeItemKeys:[],activeItems:[],enabledGroup:!0,enabledItemKeys:r})}return{groupStates:o,itemStates:e}}function To(t,e){let[o,n]=E5(()=>w5(e)),r=_5(o),l=U(),s=wa(l);s.current=l;let i=wa(e);i.current=e;let c=Ar(),u=k5(()=>{t.getEditorState().read(()=>{let d=b5();if(!d)return;let a=i.current;if(!a?.length)return;let p=s.current,m=new Map,f=new Map;for(let h of a){let g=[],C=[],E=[],L=h.type==="dropdown"?h.maxActiveItems??1:void 0;for(let b of h.items){let k=b.isActive?(!L||g.length<L)&&b.isActive({editor:t,editorConfigContext:p,selection:d}):!1,_=b.isEnabled?b.isEnabled({editor:t,editorConfigContext:p,selection:d}):!0;k&&(g.push(b.key),C.push(b)),_&&E.push(b.key),m.set(b.key,{active:k,enabled:_})}let x=h.type==="dropdown"&&h.isEnabled?h.isEnabled({editor:t,editorConfigContext:p,selection:d}):!0;f.set(h.key,{activeItemKeys:g,activeItems:C,enabledGroup:x,enabledItemKeys:E})}n({groupStates:f,itemStates:m})})},[t]);return T5(()=>{c(u);let d=()=>{c(u)},a=C5(t.registerUpdateListener(d));return document.addEventListener("mouseup",d),()=>{a(),document.removeEventListener("mouseup",d)}},[t,c,u]),r}import{c as S5}from"react/compiler-runtime";import{useEffect as N5}from"react";var L5=".fixed-toolbar__scroll",y5=40;function R5({clientWidth:t,deltaMode:e,deltaY:o,isRightToLeft:n}){let r=e===1?o*y5:e===2?o*t:o;return n?-r:r}function Sa(t){if(!(Math.abs(t.deltaY)>Math.abs(t.deltaX)))return;let o=t.target;if(!(o instanceof Element))return;let n=o.closest(L5);!n||!(n.scrollWidth>n.clientWidth)||(t.preventDefault(),n.scrollLeft+=R5({clientWidth:n.clientWidth,deltaMode:t.deltaMode,deltaY:t.deltaY,isRightToLeft:getComputedStyle(n).direction==="rtl"}))}var mt=0;function Na(){let t=S5(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],N5(v5,e)}function v5(){return mt===0&&document.addEventListener("wheel",Sa,{passive:!1}),mt=mt+1,I5}function I5(){mt=mt-1,mt===0&&document.removeEventListener("wheel",Sa)}function P5({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&he(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?he(Bt,{active:t,editor:o,enabled:n,item:r,children:he(r.ChildComponent,{})},r.key):null}function B5({anchorElem:t,editor:e,editorConfig:o,group:n,index:r,toolbarStates:l}){let{i18n:s}=ya(),{fieldProps:{featureClientSchemaMap:i,schemaPath:c}}=U(),u=l.groupStates.get(n.key),d=Eo(()=>{if(n.type!=="dropdown")return;let p=u?.activeItems?.[0];return p?p.ChildComponent:n.ChildComponent},[n,u?.activeItems]),a=Eo(()=>{if(n.type!=="dropdown")return;let p=u?.activeItems;if(!p?.length)return;if(p.length>1)return s.t("lexical:general:toolbarItemsActive",{count:p.length});let m=p[0],f=m.key;return m.label&&(f=typeof m.label=="function"?m.label({featureClientSchemaMap:i,i18n:s,schemaPath:c}):m.label),f.length>25&&(f=f.substring(0,25)+"..."),f},[n,u?.activeItems,s,i,c]);return A5("div",{className:`fixed-toolbar__group fixed-toolbar__group-${n.key}`,"data-toolbar-group-key":n.key,children:[n.type==="dropdown"&&n.items.length&&u?he(jt,{anchorElem:t,editor:e,group:n,groupState:u,Icon:d,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a}):null,n.type==="buttons"&&n.items.length?n.items.map(p=>{let m=l.itemStates.get(p.key);return he(P5,{active:m?.active??!1,anchorElem:t,editor:e,enabled:m?.enabled??!0,item:p},p.key)}):null,r<o.features.toolbarFixed?.groups.length-1&&he("div",{className:"divider"})]},n.key)}function j5({anchorElem:t,clientProps:e,editor:o,editorConfig:n,parentWithFixedToolbar:r}){let l=Ra.useRef(null),s=Eo(()=>({toolbarRef:l}),[]),{fieldProps:i}=U(),{i18n:c}=ya();_o(s);let u=La(),{y:d}=O5();Na();let a=To(o,n?.features?.toolbarFixed?.groups),p=Eo(()=>{if(!r||e?.disableIfParentHasFixedToolbar)return null;let f=r.editorContainerRef.current.previousElementSibling;for(;f;){if(f.classList.contains("fixed-toolbar"))return f;f=f.previousElementSibling}return null},[e?.disableIfParentHasFixedToolbar,r]);return F5(()=>{if(!p)return;let m=l.current;if(!m)return;let f=m.getBoundingClientRect(),h=p.getBoundingClientRect();if(!(f.bottom<h.top||f.top>h.bottom))m.classList.remove("fixed-toolbar"),m.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),p.classList.remove("fixed-toolbar"),p.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!m.classList.contains("fixed-toolbar--overlapping"))return;m.classList.remove("fixed-toolbar--overlapping"),m.classList.add("fixed-toolbar"),p.classList.remove("fixed-toolbar--hide"),p.classList.add("fixed-toolbar")}},50,[l,p,d]),he("div",{"aria-label":$5(i.field.label||i.path,c)||i.path,className:"fixed-toolbar",onFocus:m=>{m.stopPropagation()},ref:l,role:"toolbar",children:u&&he("div",{className:"fixed-toolbar__scroll",tabIndex:-1,children:n?.features&&n.features?.toolbarFixed?.groups.map((m,f)=>he(B5,{anchorElem:t,editor:o,editorConfig:n,group:m,index:f,toolbarStates:a},m.key))})})}var va=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return va(t.parentEditor)}return!1},Ia=t=>{let e=M5(6),{clientProps:o}=t,[n]=D5(),r=U();if(!La())return null;let{editorConfig:s}=r,i=o.applyToFocusedEditor&&r.focusedEditor?.editor||n,c=o.applyToFocusedEditor&&r.focusedEditor?.editorConfig||s,u,d;if(e[0]!==o||e[1]!==i||e[2]!==c||e[3]!==r){d=Symbol.for("react.early_return_sentinel");e:{let a=va(r);if(o?.disableIfParentHasFixedToolbar&&a){d=null;break e}if(!c?.features?.toolbarFixed?.groups?.length){d=null;break e}u=he(j5,{anchorElem:document.body,clientProps:o,editor:i,editorConfig:c,parentWithFixedToolbar:a})}e[0]=o,e[1]=i,e[2]=c,e[3]=r,e[4]=u,e[5]=d}else u=e[4],d=e[5];return d!==Symbol.for("react.early_return_sentinel")?d:u};var H5=A({plugins:[{Component:Ia,position:"aboveContainer"}]});import{c as z5}from"react/compiler-runtime";import{jsx as Se,jsxs as Da}from"react/jsx-runtime";import{useLexicalComposerContext as G5}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as U5}from"@lexical/react/useLexicalEditable";import{mergeRegister as $a}from"@lexical/utils";import{getTranslation as W5}from"@payloadcms/translations";import{useTranslation as V5}from"@payloadcms/ui";import{$getSelection as Oa,$isRangeSelection as Ma,$isTextNode as K5,$onUpdate as J5,COMMAND_PRIORITY_LOW as X5,getDOMSelection as Fa,SELECTION_CHANGE_COMMAND as Y5}from"lexical";import{useCallback as So,useEffect as Ht,useMemo as Pa,useRef as Aa,useState as Z5}from"react";import"react";import{createPortal as q5}from"react-dom";function Kn(t,e){let o=t.getRangeAt(0),n;if(t.anchorNode===e){let r=e;for(;r.firstElementChild!=null;)r=r.firstElementChild;n=r.getBoundingClientRect()}else n=o.getBoundingClientRect();return n}function wo(t){let{alwaysDisplayOnTop:e=!1,anchorElem:o,anchorFlippedOffset:n=0,floatingElem:r,horizontalOffset:l=32,horizontalPosition:s="left",specialHandlingForCaret:i=!1,targetRect:c,verticalGap:u=10}=t,d=o.parentElement;if(c===null||d==null){r.style.opacity="0",r.style.transform="translate(-10000px, -10000px)";return}let a=r.getBoundingClientRect(),p=o.getBoundingClientRect(),m=d.getBoundingClientRect(),f=c.top-a.height-u,h=c.left-l;s==="center"&&(h=c.left+c.width/2-a.width/2);let g=0;return!e&&f<m.top&&!i&&(g=a.height+c.height+u*2,f+=g),s==="center"?h+a.width>m.right?h=m.right-a.width-l:h<m.left&&(h=m.left+l):h+a.width>m.right&&(h=m.right-a.width-l),h-=p.left,r.style.opacity="1",i&&n!==0?(f-=p.bottom-n+a.height-3,r.style.transform=`translate(${h}px, ${f}px) rotate(180deg)`):(f-=p.top,r.style.transform=`translate(${h}px, ${f}px)`),g}function Q5({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&Se(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?Se(Bt,{active:t,editor:o,enabled:n,item:r,children:Se(r.ChildComponent,{})},r.key):null}function eg({anchorElem:t,editor:e,group:o,index:n,toolbarStates:r}){let{editorConfig:l}=U(),s=r.groupStates.get(o.key),i=Pa(()=>o.type!=="dropdown"?void 0:s?.activeItems?.[0]?.ChildComponent??o.ChildComponent,[o,s?.activeItems]);return Da("div",{className:`inline-toolbar-popup__group inline-toolbar-popup__group-${o.key}`,"data-toolbar-group-key":o.key,children:[o.type==="dropdown"&&o.items.length&&s?Se(jt,{anchorElem:t,editor:e,group:o,groupState:s,Icon:i}):null,o.type==="buttons"&&o.items.length?o.items.map(c=>{let u=r.itemStates.get(c.key);return Se(Q5,{active:u?.active??!1,anchorElem:t,editor:e,enabled:u?.enabled??!0,item:c},c.key)}):null,n<l.features.toolbarInline?.groups.length-1&&Se("div",{className:"divider"})]},o.key)}function tg({anchorElem:t,editor:e}){let o=Aa(null),n=Pa(()=>({toolbarRef:o}),[]),{fieldProps:r}=U(),{i18n:l}=V5();_o(n);let s=Aa(null),{editorConfig:i}=U(),c=To(e,i?.features?.toolbarInline?.groups),u=So(()=>{if(o?.current){let m=o.current.style.opacity==="0",f=o.current.style.pointerEvents==="none";m||(o.current.style.opacity="0"),f||(o.current.style.pointerEvents="none")}},[o]),d=So(m=>{if(o?.current&&(m.buttons===1||m.buttons===3)){let f=o.current.style.opacity==="0",h=o.current.style.pointerEvents==="none";if(!f||!h){let g=m.clientX,C=m.clientY,E=document.elementFromPoint(g,C);o.current.contains(E)||u()}}},[u]),a=So(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);Ht(()=>(document.addEventListener("mousemove",d),document.addEventListener("mouseup",a),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a)}),[o,d,a]);let p=So(()=>{let m=Oa(),f=Fa(e._window);if(o.current===null)return;let h=t.querySelector(":scope > .link-editor"),g=h!==null&&"style"in h&&h?.style?.opacity==="1",C=e.getRootElement();if(m!==null&&f!==null&&!f.isCollapsed&&C!==null&&C.contains(f.anchorNode)){let E=Kn(f,C),L=wo({alwaysDisplayOnTop:g,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:E});s.current&&wo({anchorElem:o.current,anchorFlippedOffset:L,floatingElem:s.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:E,verticalGap:8})}else u()},[e,u,t]);return Ht(()=>{let m=t.parentElement,f=()=>{e.getEditorState().read(()=>{p()})};return window.addEventListener("resize",f),m&&m.addEventListener("scroll",f),()=>{window.removeEventListener("resize",f),m&&m.removeEventListener("scroll",f)}},[e,p,t]),Ht(()=>(e.getEditorState().read(()=>{p()}),$a(e.registerUpdateListener(({editorState:m})=>{m.read(()=>{p()})}),e.registerCommand(Y5,()=>(J5(()=>e.read("latest",p)),!1),X5))),[e,p]),Da("div",{"aria-label":W5(r.field.label||r.path,l)||r.path,className:"inline-toolbar-popup",ref:o,role:"toolbar",children:[Se("div",{className:"caret",ref:s}),i?.features&&i.features?.toolbarInline?.groups.map((m,f)=>Se(eg,{anchorElem:t,editor:e,group:m,index:f,toolbarStates:c},m.key))]})}function og(t,e){let o=z5(12),[n,r]=Z5(!1),l=U5(),s;o[0]!==t?(s=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let m=Oa(),f=Fa(t._window),h=t.getRootElement();if(f!==null&&(!Ma(m)||h===null||!h.contains(f.anchorNode))){r(!1);return}if(!Ma(m))return;if(m.getTextContent()!==""){let C=m.getNodes(),E=!1;for(let L of C)if(K5(L)){r(!0),E=!0;break}E||r(!1)}else r(!1);let g=m.getTextContent().replace(/\n/g,"");if(!m.isCollapsed()&&g===""){r(!1);return}})},o[0]=t,o[1]=s):s=o[1];let i=s,c,u;o[2]!==i?(c=()=>(document.addEventListener("selectionchange",i),document.addEventListener("mouseup",i),()=>{document.removeEventListener("selectionchange",i),document.removeEventListener("mouseup",i)}),u=[i],o[2]=i,o[3]=c,o[4]=u):(c=o[3],u=o[4]),Ht(c,u);let d,a;if(o[5]!==t||o[6]!==i?(d=()=>$a(t.registerUpdateListener(()=>{i()}),t.registerRootListener(()=>{t.getRootElement()===null&&r(!1)})),a=[t,i],o[5]=t,o[6]=i,o[7]=d,o[8]=a):(d=o[7],a=o[8]),Ht(d,a),!n||!l)return null;let p;return o[9]!==e||o[10]!==t?(p=q5(Se(tg,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=p):p=o[11],p}var Ba=t=>{let{anchorElem:e}=t,[o]=G5();return og(o,e)};var ng=A({plugins:[{Component:Ba,position:"floatingAnchorElem"}]});import{TableCellNode as q2,TableNode as Q2,TableRowNode as ex}from"@lexical/table";import{jsx as ja}from"react/jsx-runtime";import"react";var rg={16:"M7 4h4.5a.5.5 0 0 1 .5.5V6H7zM6 4H4.5a.5.5 0 0 0-.5.5V6h2zm0 3H4v2h2zm0 3H4v1.5a.5.5 0 0 0 .5.5H6zm1 2h4.5a.5.5 0 0 0 .5-.5V10H7zm0-3V7h5v2zM3 4.5A1.5 1.5 0 0 1 4.5 3h7A1.5 1.5 0 0 1 13 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 11.5z",24:"M17.204 6.51A2 2 0 0 1 19 8.5V16l-.011.204a2 2 0 0 1-1.785 1.785L17 18H7l-.204-.01a2 2 0 0 1-1.786-1.786L5 16V8.5a2 2 0 0 1 1.796-1.99L7 6.5h10zM6 16a1 1 0 0 0 1 1h2v-2.5H6zm4-1.5V17h7a1 1 0 0 0 .995-.898L18 16v-1.5zm-4-1h3V11H6zm4-2.5v2.5h8V11zM7 7.5a1 1 0 0 0-.995.897L6 8.5V10h3V7.5zm3 2.5h8V8.5a1 1 0 0 0-1-1h-7z"},Jn=({className:t,size:e=24})=>ja("svg",{className:["icon",t].filter(Boolean).join(" "),fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:ja("path",{clipRule:"evenodd",d:rg[e],fill:"currentColor",fillRule:"evenodd"})});import{$convertToMarkdownString as lg}from"@lexical/markdown";import{$createTableCellNode as ig,$createTableNode as sg,$createTableRowNode as ag,$isTableCellNode as Ha,$isTableNode as Xn,$isTableRowNode as Yn,TableCellHeaderStates as No,TableCellNode as cg,TableNode as ug,TableRowNode as dg}from"@lexical/table";import{$isParagraphNode as mg,$isTextNode as pg}from"lexical";var Ga=/^\|(.+)\|\s?$/,fg=/^(\| ?:?-*:? ?)+\|\s?$/,Ua=({allTransformers:t})=>({type:"element",dependencies:[ug,dg,cg],export:e=>{if(!Xn(e))return null;let o=[];for(let n of e.getChildren()){let r=[];if(!Yn(n))continue;let l=!1;for(let s of n.getChildren())Ha(s)&&(r.push(lg(t,s).replace(/\n/g,"\\n").trim()),s.__headerState===No.ROW&&(l=!0));o.push(`| ${r.join(" | ")} |`),l&&o.push(`| ${r.map(s=>"---").join(" | ")} |`)}return o.join(`
58
+ `)},regExp:Ga,replace:(e,o,n)=>{let r=n[0];if(!r)return;if(fg.test(r)){let a=e.getPreviousSibling();if(!a||!Xn(a))return;let p=a.getChildren(),m=p[p.length-1];if(!m||!Yn(m))return;m.getChildren().forEach(f=>{Ha(f)&&f.setHeaderStyles(No.ROW,No.ROW)}),e.remove();return}let l=za(r,t);if(l==null)return;let s=[l],i=e.getPreviousSibling(),c=l.length;for(;i&&!(!mg(i)||i.getChildrenSize()!==1);){let a=i.getFirstChild();if(!pg(a))break;let p=za(a.getTextContent(),t);if(p==null)break;c=Math.max(c,p.length),s.unshift(p);let m=i.getPreviousSibling();i.remove(),i=m}let u=sg();for(let a of s){let p=ag();u.append(p);for(let m=0;m<c;m++)p.append(m<a.length?a[m]:Wa("",t))}let d=e.getPreviousSibling();Xn(d)&&hg(d)===c?(d.append(...u.getChildren()),e.remove()):e.replace(u),u.selectEnd()}});function hg(t){let e=t.getFirstChild();return Yn(e)?e.getChildrenSize():0}var Wa=(t,e)=>{t=t.replace(/\\n/g,`
59
+ `);let o=ig(No.NO_STATUS);return oo(t,e,o,!1,!0),o},za=(t,e)=>{let o=t.match(Ga);return!o||!o[1]?null:o[1].split("|").map(n=>Wa(n,e))};import{c as bg}from"react/compiler-runtime";import{jsx as j,jsxs as Ne}from"react/jsx-runtime";import{useLexicalComposerContext as Za}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as kg}from"@lexical/react/useLexicalEditable";import{$computeTableMap as _g,$deleteTableColumnAtSelection as Tg,$deleteTableRowAtSelection as Eg,$getNodeTriplet as wg,$getTableCellNodeFromLexicalNode as Ya,$getTableNodeFromLexicalNodeOrThrow as Me,$getTableRowIndexFromTableCellNode as Sg,$insertTableColumnAtSelection as Ng,$insertTableRowAtSelection as Lg,$isTableCellNode as qa,$isTableSelection as zt,$mergeCells as yg,$setTableColumnIsHeader as Rg,$setTableRowIsHeader as vg,$unmergeCell as Ig,getTableElement as Zn,getTableObserverFromTableElement as qn,TableCellHeaderStates as pt,TableCellNode as Mg}from"@lexical/table";import{mergeRegister as Ag}from"@lexical/utils";import{useScrollInfo as Dg}from"@payloadcms/ui";import{$getSelection as yo,$isElementNode as $g,$isRangeSelection as Qn,$isTextNode as Og,$setSelection as Fg,COMMAND_PRIORITY_CRITICAL as Pg,getDOMSelection as Bg,isDOMNode as jg,SELECTION_CHANGE_COMMAND as Hg}from"lexical";import*as er from"react";import{useCallback as de,useEffect as ft,useRef as Lo,useState as ht}from"react";import{createPortal as Qa}from"react-dom";import{jsx as Va}from"react/jsx-runtime";import"react";var gg={16:"M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2",24:"M7.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m6 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m4.5 1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"},Ka=({className:t,size:e=24})=>Va("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Va("path",{clipRule:"evenodd",d:gg[e],fill:"currentColor",fillRule:"evenodd"})});import{$computeTableCellRectBoundary as xg,$computeTableMap as Cg,$getNodeTriplet as Ja}from"@lexical/table";function Xa({selection:t}){let[e,,o]=Ja(t.anchor),[n]=Ja(t.focus),[r,l,s]=Cg(o,e,n),{maxColumn:i,maxRow:c,minColumn:u,minRow:d}=xg(r,l,s);return{columns:i-u+1,rows:c-d+1}}function zg(){let t=yo();if(Qn(t)&&!t.isCollapsed()||zt(t)&&!t.anchor.is(t.focus)||!Qn(t)&&!zt(t))return!1;let[e]=wg(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function Gg(t){let e=t.getLastDescendant();Og(e)?e.select():$g(e)?e.selectEnd():e!==null&&e.selectNext()}function Ug({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:n,tableCellNode:r}){let[l]=Za(),s=Lo(null),[i,c]=ht(r),[u,d]=ht({columns:1,rows:1}),[a,p]=ht(!1),[m,f]=ht(!1),{y:h}=Dg();ft(()=>l.registerMutationListener(Mg,S=>{S.get(i.getKey())==="updated"&&l.getEditorState().read(()=>{c(i.getLatest())})},{skipInitialization:!0}),[l,i]),ft(()=>{l.getEditorState().read(()=>{let S=yo();if(zt(S)){let R=Xa({selection:S});d(R);let v=S.anchor.is(S.focus);p(!v&&(R.columns>1||R.rows>1))}f(zg())})},[l]),ft(()=>{let S=e.current,R=s.current,v=l.getRootElement();if(S!=null&&R!=null&&v!=null){let D=v.getBoundingClientRect(),F=S.getBoundingClientRect();R.style.opacity="1";let M=R.getBoundingClientRect(),B=5,$=F.right+B;if($+M.width>window.innerWidth||$+M.width>D.right){let V=F.left-M.width-B;$=(V<0?B:V)+window.pageXOffset}R.style.left=`${$+window.pageXOffset}px`;let P=F.top;if(P+M.height>window.innerHeight){let V=F.bottom-M.height;P=V<0?B:V}R.style.top=`${P}px`}},[e,s,l,h]),ft(()=>{function S(R){s.current!=null&&e.current!=null&&jg(R.target)&&!s.current.contains(R.target)&&!e.current.contains(R.target)&&n(!1)}return window.addEventListener("click",S),()=>window.removeEventListener("click",S)},[n,e]);let g=de(()=>{l.update(()=>{if(i.isAttached()){let S=Me(i),R=Zn(S,l.getElementByKey(S.getKey()));if(R===null)throw new Error("Expected to find tableElement in DOM");let v=qn(R);v!==null&&v.$clearHighlight(),S.markDirty(),c(i.getLatest())}Fg(null)})},[l,i]),C=()=>{l.update(()=>{let S=yo();if(!zt(S))return;let v=S.getNodes().filter(qa),D=yg(v);D&&(Gg(D),o())})},E=()=>{l.update(()=>{Ig()}),g()},L=de(S=>{l.update(()=>{for(let R=0;R<u.rows;R++)Lg(S);o()})},[l,o,u.rows]),x=de(S=>{l.update(()=>{for(let R=0;R<u.columns;R++)Ng(S);o()})},[l,o,u.columns]),b=de(()=>{l.update(()=>{Eg(),o()})},[l,o]),k=de(()=>{l.update(()=>{Me(i).remove(),g(),o()})},[l,i,g,o]),_=de(()=>{l.update(()=>{Tg(),o()})},[l,o]),T=de(()=>{l.update(()=>{let S=Me(i),R=Sg(i),v=!i.hasHeaderState(pt.ROW);vg(S,R,v),g(),o()})},[l,i,g,o]),I=de(()=>{l.update(()=>{let S=Me(i),[,R]=_g(S,i,i),v=!i.hasHeaderState(pt.COLUMN);Rg(S,R.startColumn,v),g(),o()})},[l,i,g,o]),N=de(()=>{l.update(()=>{if(i.isAttached()){let S=Me(i);S&&S.setRowStriping(!S.getRowStriping())}g(),o()})},[l,i,g,o]),w=de(()=>{l.update(()=>{if(i.isAttached()){let S=Me(i);S&&S.setFrozenColumns(S.getFrozenColumns()===0?1:0)}g(),o()})},[l,i,g,o]),y=null;return t&&(a?y=j("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>C(),type:"button",children:j("span",{className:"text",children:"Merge cells"})}):m&&(y=j("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>E(),type:"button",children:j("span",{className:"text",children:"Unmerge cells"})}))),Qa(Ne("div",{className:"table-action-menu-dropdown",onClick:S=>{S.stopPropagation()},ref:s,children:[y?Ne(er.Fragment,{children:[y,j("hr",{})]}):null,j("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>N(),type:"button",children:j("span",{className:"text",children:"Toggle row striping"})}),j("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>w(),type:"button",children:j("span",{className:"text",children:"Toggle first column freeze"})}),j("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>L(!1),type:"button",children:Ne("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," above"]})}),j("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>L(!0),type:"button",children:Ne("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," below"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>x(!1),type:"button",children:Ne("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","left"]})}),j("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>x(!0),type:"button",children:Ne("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","right"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>_(),type:"button",children:j("span",{className:"text",children:"Delete column"})}),j("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>b(),type:"button",children:j("span",{className:"text",children:"Delete row"})}),j("button",{className:"item","data-test-id":"table-delete",onClick:()=>k(),type:"button",children:j("span",{className:"text",children:"Delete table"})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-row-header",onClick:()=>T(),type:"button",children:Ne("span",{className:"text",children:[(i.__headerState&pt.ROW)===pt.ROW?"Remove":"Add"," ","row header"]})}),j("button",{className:"item","data-test-id":"table-column-header",onClick:()=>I(),type:"button",children:Ne("span",{className:"text",children:[(i.__headerState&pt.COLUMN)===pt.COLUMN?"Remove":"Add"," ","column header"]})})]}),l.getRootElement()?.closest('dialog, [role="dialog"]')??document.body)}function Wg({anchorElem:t,cellMerge:e}){let[o]=Za(),n=Lo(null),r=Lo(null),[l,s]=ht(!1),[i,c]=ht(null),u=de(()=>{let a=n.current,p=yo(),m=Bg(o._window),f=document.activeElement;function h(){a&&(a.classList.remove("table-cell-action-button-container--active"),a.classList.add("table-cell-action-button-container--inactive")),c(null)}if(p==null||a==null)return h();let g=o.getRootElement(),C=null,E=null;if(Qn(p)&&g!==null&&m!==null&&g.contains(m.anchorNode)){let x=Ya(p.anchor.getNode());if(x==null||(E=o.getElementByKey(x.getKey()),E==null||!x.isAttached()))return h();let b=Me(x),k=Zn(b,o.getElementByKey(b.getKey()));if(k===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");C=qn(k),c(x)}else if(zt(p)){let x=Ya(p.anchor.getNode());if(!qa(x))throw new Error("TableSelection anchorNode must be a TableCellNode");let b=Me(x),k=Zn(b,o.getElementByKey(b.getKey()));if(k===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");C=qn(k),E=o.getElementByKey(x.getKey())}else if(!f)return h();if(C===null||E===null)return h();let L=!C||!C.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",L),a.classList.toggle("table-cell-action-button-container--inactive",!L),L){let x=E.getBoundingClientRect(),b=t.getBoundingClientRect(),k=x.top-b.top,_=x.right-b.left;a.style.transform=`translate(${_}px, ${k}px)`}},[o,t]);ft(()=>{let a,p=()=>{a=void 0,o.getEditorState().read(u)},m=()=>(a===void 0&&(a=setTimeout(p,0)),!1);return Ag(o.registerUpdateListener(m),o.registerCommand(Hg,m,Pg),o.registerRootListener((f,h)=>{h&&h.removeEventListener("pointerup",m),f&&(f.addEventListener("pointerup",m),m())}),()=>clearTimeout(a))});let d=Lo(i);return ft(()=>{d.current!==i&&s(!1),d.current=i},[d,i]),j("div",{className:"table-cell-action-button-container",ref:n,children:i!=null&&Ne(er.Fragment,{children:[j("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),s(!l)},ref:r,type:"button",children:j(Ka,{})}),l&&j(Ug,{cellMerge:e,contextRef:r,onClose:()=>s(!1),setIsMenuOpen:s,tableCellNode:i})]})})}var ec=t=>{let e=bg(3),{anchorElem:o}=t,n=kg(),r;return e[0]!==o||e[1]!==n?(r=Qa(n?j(Wg,{anchorElem:o??document.body,cellMerge:!0}):null,o??document.body),e[0]=o,e[1]=n,e[2]=r):r=e[2],r};import{c as Vg}from"react/compiler-runtime";import{jsx as vo,jsxs as Kg}from"react/jsx-runtime";import{useLexicalComposerContext as Jg}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as Xg}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as Yg,$getTableNodeFromLexicalNodeOrThrow as tr,$getTableRowIndexFromTableCellNode as Zg,$isTableCellNode as tc,$isTableRowNode as qg,getDOMCellFromTarget as Qg,getTableElement as e2,TableNode as oc}from"@lexical/table";import{calculateZoomLevel as nc,mergeRegister as t2}from"@lexical/utils";import{$getNearestNodeFromDOMNode as or,isHTMLElement as o2,SKIP_SCROLL_INTO_VIEW_TAG as rc}from"lexical";import*as ic from"react";import{useCallback as Gt,useEffect as Io,useRef as Ro,useState as Ke}from"react";import{createPortal as n2}from"react-dom";var r2=33,lc=92;function l2({editor:t}){let e=Ro(null),o=Ro(null),n=Ro(null),[r,l]=Ke(!1),s=U(),i=Ro(null),[c,u]=Ke(null),[d,a]=Ke(null),[p,m]=Ke(!1),[f,h]=Ke(null),g=Gt(()=>{a(null),e.current=null,h(null),i.current=null,n.current=null},[]),C=w=>(w.buttons&1)===1;Io(()=>{let w=new Set;return t2(t.registerMutationListener(oc,y=>{for(let[S,R]of y)R==="destroyed"?w.delete(S):w.add(S);l(w.size>0)}),t.registerNodeTransform(oc,y=>{if(y.getColWidths())return y;let S=y.getColumnCount(),R=lc;return y.setColWidths(Array(S).fill(R)),y}))},[t]),Io(()=>{if(!r)return;let w=v=>{let D=v.target;if(o2(D)){if(f){u({x:v.clientX,y:v.clientY});return}if(m(C(v)),!(o.current&&o.current.contains(D))&&e.current!==D){e.current=D;let F=Qg(D);F&&d!==F?t.getEditorState().read(()=>{let M=or(F.elem);if(!M)throw new Error("TableCellResizer: Table cell node not found.");let B=tr(M),$=e2(B,t.getElementByKey(B.getKey()));if(!$)throw new Error("TableCellResizer: Table element not found.");e.current=D,n.current=$.getBoundingClientRect(),a(F)},{editor:t}):F==null&&g()}}},y=v=>{m(!0)},S=v=>{m(!1)},R=t.registerRootListener((v,D)=>{D?.removeEventListener("mousemove",w),D?.removeEventListener("mousedown",y),D?.removeEventListener("mouseup",S),v?.addEventListener("mousemove",w),v?.addEventListener("mousedown",y),v?.addEventListener("mouseup",S)});return()=>{R()}},[d,f,t,r,g]);let E=w=>w==="bottom",L=Gt(w=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let y=or(d.elem);if(!tc(y))throw new Error("TableCellResizer: Table cell node not found.");let S=tr(y),R=Zg(y),v=S.getChildren(),F=y.getColSpan()===S.getColumnCount()?R:R+y.getRowSpan()-1;if(F>=v.length||F<0)throw new Error("Expected table cell to be inside of table row.");let M=v[F];if(!qg(M))throw new Error("Expected table row");let B=M.getHeight();if(B===void 0){let P=M.getChildren();B=Math.min(...P.map(V=>x(V,t)??1/0))}let $=Math.max(B+w,r2);M.setHeight($)},{tag:rc})},[d,t]),x=(w,y)=>y.getElementByKey(w.getKey())?.clientHeight,b=(w,y)=>{let S;return y.forEach(R=>{R.forEach((v,D)=>{v.cell===w&&(S=D)})}),S},k=Gt(w=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let y=or(d.elem);if(!tc(y))throw new Error("TableCellResizer: Table cell node not found.");let S=tr(y),[R]=Yg(S,null,null),v=b(y,R);if(v===void 0)throw new Error("TableCellResizer: Table column not found.");let D=S.getColWidths();if(!D)return;let F=D[v];if(F===void 0)return;let M=[...D],B=Math.max(F+w,lc);M[v]=B,S.setColWidths(M)},{tag:rc})},[d,t]),_=Gt(w=>{let y=S=>{if(S.preventDefault(),S.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");if(i.current){let{x:R,y:v}=i.current;if(d===null)return;let D=nc(S.target);if(E(w)){let F=(S.clientY-v)/D;L(F)}else{let F=(S.clientX-R)/D;k(F)}g(),document.removeEventListener("mouseup",y)}};return y},[d,g,k,L]),T=Gt(w=>y=>{if(y.preventDefault(),y.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");i.current={x:y.clientX,y:y.clientY},u(i.current),h(w),document.addEventListener("mouseup",_(w))},[d,_]),[I,N]=Ke({bottom:null,left:null,right:null,top:null});return Io(()=>{if(d){let{height:w,left:y,top:S,width:R}=d.elem.getBoundingClientRect(),v=nc(d.elem),D=!!t.getRootElement()?.closest('dialog, [role="dialog"]'),F=D?0:window.scrollX,M=D?0:window.scrollY,B=D?"fixed":"absolute",$=10,P={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${$}px`,left:`${F+y}px`,position:B,top:`${M+S+w-$/2}px`,width:`${R}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${w}px`,left:`${F+y+R-$/2}px`,position:B,top:`${M+S}px`,width:`${$}px`}},V=n.current;f&&c&&V&&(E(f)?(P[f].left=`${F+V.left}px`,P[f].top=`${M+c.y/v}px`,P[f].height="3px",P[f].width=`${V.width}px`):(P[f].top=`${M+V.top}px`,P[f].left=`${F+c.x/v}px`,P[f].width="3px",P[f].height=`${V.height}px`),P[f].backgroundColor="#adf"),N(P)}else N({bottom:null,left:null,right:null,top:null})},[d,f,t,c]),vo("div",{ref:o,children:d!=null&&!p&&Kg(ic.Fragment,{children:[vo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("right"),style:I.right||void 0}),vo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("bottom"),style:I.bottom||void 0})]})})}var sc=()=>{let t=Vg(7),[e]=Jg(),o=Xg(),[n,r]=Ke(null),l,s;t[0]!==e?(l=()=>e.registerRootListener(c=>{r(c?.closest('dialog, [role="dialog"]')??document.body)}),s=[e],t[0]=e,t[1]=l,t[2]=s):(l=t[1],s=t[2]),Io(l,s);let i;return t[3]!==e||t[4]!==o||t[5]!==n?(i=o&&n?n2(vo(l2,{editor:e}),n):null,t[3]=e,t[4]=o,t[5]=n,t[6]=i):i=t[6],i};import{c as p2}from"react/compiler-runtime";import{jsx as nr,jsxs as f2,Fragment as h2}from"react/jsx-runtime";import{useLexicalComposerContext as g2}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as hc}from"@lexical/react/useLexicalEditable";import{$getTableAndElementByKey as x2,$getTableColumnIndexFromTableCellNode as C2,$getTableRowIndexFromTableCellNode as b2,$insertTableColumnAtSelection as k2,$insertTableRowAtSelection as _2,$isTableCellNode as T2,$isTableNode as uc,getTableElement as E2,TableNode as w2}from"@lexical/table";import{$findMatchingParent as S2,mergeRegister as N2}from"@lexical/utils";import{$getNearestNodeFromDOMNode as dc,isHTMLElement as L2}from"lexical";import{useEffect as mc,useMemo as y2,useRef as pc,useState as Mo}from"react";import"react";import{createPortal as R2}from"react-dom";import{c as u2}from"react/compiler-runtime";import{useEffect as d2,useRef as m2}from"react";var i2="Expected a function",s2=Math.max,a2=Math.min;function c2(t,e,o){let n,r,l=0,s,i=!1,c=!1,u,d,a,p=!0;if(typeof t!="function")throw new TypeError(i2);e=e||0,typeof o=="object"&&(i=!!o.leading,c="maxWait"in o,u=c?s2(o.maxWait||0,e):u,p="trailing"in o?!!o.trailing:p);function m(k){let _=n,T=s;return n=s=void 0,l=k,d=t.apply(T,_),d}function f(k){return l=k,a=setTimeout(C,e),i?m(k):d}function h(k){let _=k-r,T=k-l,I=e-_;return c?a2(I,u-T):I}function g(k){let _=k-r,T=k-l;return r===void 0||_>=e||_<0||c&&T>=u}function C(){let k=Date.now();if(g(k))return E(k);a=setTimeout(C,h(k))}function E(k){return a=void 0,p&&n?m(k):(n=s=void 0,d)}function L(){a!==void 0&&clearTimeout(a),l=0,n=r=s=a=void 0}function x(){return a===void 0?d:E(Date.now())}function b(){let k=Date.now(),_=g(k);if(n=arguments,s=this,r=k,_){if(a===void 0)return f(r);if(c)return clearTimeout(a),a=setTimeout(C,e),m(r)}return a===void 0&&(a=setTimeout(C,e)),d}return b.cancel=L,b.flush=x,b}var ac=c2;function cc(t,e,o){let n=u2(6),r=m2(null),l,s;n[0]!==t||n[1]!==o||n[2]!==e?(l=()=>(r.current=ac(t,e,{maxWait:o}),()=>{r.current?.cancel()}),s=[t,e,o],n[0]=t,n[1]=o,n[2]=e,n[3]=l,n[4]=s):(l=n[3],s=n[4]),d2(l,s);let i;return n[5]===Symbol.for("react.memo_cache_sentinel")?(i=(...u)=>{let d=u;r.current&&r.current(...d)},n[5]=i):i=n[5],i}var fc=16;function v2({anchorElem:t}){let[e]=g2(),o=hc(),n=U(),[r,l]=Mo(!1),[s,i]=Mo(!1),[c,u]=Mo(!1),[d,a]=Mo({}),p=pc(new Set),m=pc(null),f=cc(C=>{let{isOutside:E,tableDOMNode:L}=I2(C,n.editorConfig?.lexical);if(E){l(!1),i(!1);return}if(!L)return;m.current=L;let x=null,b=null,k=null;if(e.getEditorState().read(()=>{let F=dc(L);if(T2(F)){let M=S2(F,B=>uc(B));if(!uc(M))return;if(k=E2(M,e.getElementByKey(M.getKey())),k){let B=M.getChildrenSize(),$=M.getChildAtIndex(0)?.getChildrenSize(),P=b2(F),V=C2(F);P===B-1?x=F:V===$-1&&(b=F)}}},{editor:e}),!k)return;let _=k.parentElement;if(!_)return;let{bottom:T,height:I,left:N,right:w,width:y,y:S}=k.getBoundingClientRect(),R=!1;_&&_.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(R=_.scrollWidth>_.clientWidth);let{left:v,y:D}=t.getBoundingClientRect();x?(i(!1),l(!0),a({height:fc,left:R&&_?_.offsetLeft:N-v,top:T-D+5,width:R&&_?_.offsetWidth:y})):b&&(i(!0),l(!1),a({height:I,left:w-v+5,top:S-D,width:fc}))},50,250),h=y2(()=>new ResizeObserver(()=>{l(!1),i(!1)}),[]);mc(()=>{if(c)return document.addEventListener("mousemove",f),()=>{l(!1),i(!1),document.removeEventListener("mousemove",f)}},[c,f]),mc(()=>N2(e.registerMutationListener(w2,C=>{e.getEditorState().read(()=>{let E=!1;for(let[L,x]of C)switch(x){case"created":{p.current.add(L),E=!0;break}case"destroyed":{p.current.delete(L),E=!0;break}default:break}if(E){h.disconnect();for(let L of p.current){let{tableElement:x}=x2(L);h.observe(x)}u(p.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,h]);let g=C=>{e.update(()=>{m.current&&(dc(m.current)?.selectEnd(),C?(_2(),l(!1)):(k2(),i(!1)))})};return o?f2(h2,{children:[r&&nr("button",{"aria-label":"Add Row",className:n.editorConfig.lexical.theme.tableAddRows,onClick:()=>g(!0),style:{...d},type:"button"}),s&&nr("button",{"aria-label":"Add Column",className:n.editorConfig.lexical.theme.tableAddColumns,onClick:()=>g(!1),style:{...d},type:"button"})]}):null}function I2(t,e){let o=t.target;if(L2(o)){let n=o.closest(`td.${e.theme.tableCell}, th.${e.theme.tableCell}`);return{isOutside:!(n||o.closest(`button.${e.theme.tableAddRows}`)||o.closest(`button.${e.theme.tableAddColumns}`)||o.closest(`div.${e.theme.tableCellResizer}`)),tableDOMNode:n}}else return{isOutside:!0,tableDOMNode:null}}function gc(t){let e=p2(2),{anchorElem:o}=t,n=o===void 0?document.body:o;if(!hc())return null;let l;return e[0]!==n?(l=R2(nr(v2,{anchorElem:n}),n),e[0]=n,e[1]=l):l=e[1],l}import{jsx as ir,jsxs as $2}from"react/jsx-runtime";import{useLexicalComposerContext as O2}from"@lexical/react/LexicalComposerContext";import{TablePlugin as F2}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as P2,TableCellNode as B2,TableNode as j2,TableRowNode as H2}from"@lexical/table";import{mergeRegister as z2}from"@lexical/utils";import{$getSelection as G2,$isRangeSelection as U2,$setSelection as W2,COMMAND_PRIORITY_EDITOR as V2,createCommand as K2}from"lexical";import{createContext as J2,use as X2,useCallback as Tc,useEffect as Ec,useMemo as Y2,useRef as Z2,useState as Ao}from"react";import*as wc from"react";import{jsx as te,jsxs as Le}from"react/jsx-runtime";import{useCallback as rr,useEffect as xc,useRef as lr,useState as Ut}from"react";import*as kc from"react";import{createPortal as M2}from"react-dom";var Cc=10,bc=7;function A2(){return Le("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[te("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"1.5",y:"1.5"}),te("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"7.5",y:"1.5"})]})}function D2(){return Le("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[te("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"1.5"}),te("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"7.5"})]})}function _c({anchorElem:t,editor:e,isOpen:o,onClose:n,onInsert:r,position:l}){let[s,i]=Ut(0),[c,u]=Ut(0),[d,a]=Ut(""),[p,m]=Ut(""),[f,h]=Ut(null),g=lr(null),C=lr(null),E=lr(null),L=s>0?s:d?parseInt(d,10)||0:5,x=c>0?c:p?parseInt(p,10)||0:5;xc(()=>{o||(i(0),u(0),a(""),m(""),h(null))},[o]),xc(()=>{if(!o)return;let N=w=>{if(w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),n()),w.key==="Enter"&&f){w.preventDefault();let y=parseInt(d,10),S=parseInt(p,10);y>0&&S>0&&r(y,S)}};return document.addEventListener("keydown",N,!0),()=>document.removeEventListener("keydown",N,!0)},[o,n,r,f,d,p]);let b=rr((N,w)=>{N>0&&w>0&&r(N,w)},[r]),k=rr((N,w)=>{i(N),u(w)},[]),_=rr(()=>{i(0),u(0)},[]);if(!o||!l||!t)return null;let T=[];for(let N=1;N<=bc;N++)for(let w=1;w<=Cc;w++){let y=w<=L&&N<=x,S=w<=s&&N<=c,R="table-grid-popup__cell";y&&S?R+=" table-grid-popup__cell--hover":y&&(R+=" table-grid-popup__cell--selected"),T.push(te("div",{"aria-label":`${w} columns, ${N} rows`,className:R,onClick:()=>b(w,N),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),b(w,N))},onMouseEnter:()=>k(w,N),role:"button",tabIndex:-1},`${N}-${w}`))}let I=s>0&&c>0;return M2(Le(kc.Fragment,{children:[te("div",{className:"table-grid-popup__backdrop",onClick:n}),te("div",{className:"table-grid-popup",ref:g,style:{transform:`translate(${l.left}px, ${l.top}px)`},children:Le("div",{className:"table-grid-popup__content",children:[Le("div",{className:"table-grid-popup__header",children:[Le("div",{className:`table-grid-popup__input-group${f==="cols"?" table-grid-popup__input-group--focused":""}`,children:[te("div",{className:"table-grid-popup__input-icon",children:te(A2,{})}),te("input",{"aria-label":"Columns",className:"table-grid-popup__input",min:1,onBlur:()=>h(null),onChange:N=>a(N.target.value),onFocus:()=>h("cols"),placeholder:s>0?String(s):"5",ref:C,type:"number",value:d})]}),te("span",{className:"table-grid-popup__separator",children:"\xD7"}),Le("div",{className:`table-grid-popup__input-group${f==="rows"?" table-grid-popup__input-group--focused":""}`,children:[te("div",{className:"table-grid-popup__input-icon",children:te(D2,{})}),te("input",{"aria-label":"Rows",className:"table-grid-popup__input",min:1,onBlur:()=>h(null),onChange:N=>m(N.target.value),onFocus:()=>h("rows"),placeholder:c>0?String(c):"5",ref:E,type:"number",value:p})]})]}),Le("div",{className:"table-grid-popup__grid",onMouseLeave:_,children:[T,I&&Le("div",{className:"table-grid-popup__tooltip",style:{left:`calc(${(s-.5)/Cc*100}%)`,top:`calc(${(c-1)/bc*100}%)`},children:[L," \xD7 ",x]})]})]})})]}),t)}var Do=K2("OPEN_EMBED_DRAWER_COMMAND"),Sc=J2({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function Nc({children:t}){let[e,o]=Ao({cellEditorConfig:null,cellEditorPlugins:null});return ir(Sc,{value:Y2(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(n,r)=>{o({cellEditorConfig:n,cellEditorPlugins:r})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var Lc=()=>{let[t]=O2(),e=X2(Sc),[o,n]=Ao(!1),[r,l]=Ao(null),s=Z2(null),[i,c]=Ao(null);Ec(()=>{let a=t.getRootElement();if(a){let p=a.closest(".editor")??null;c(p??a.parentElement)}},[t]),Ec(()=>{if(!t.hasNodes([j2,H2,B2]))throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return z2(t.registerCommand(Do,()=>{let a=i;if(!a)return!0;let p=a.getBoundingClientRect(),m=null;t.getEditorState().read(()=>{let h=G2();if(U2(h)){s.current=h.clone();let g=h.anchor.getNode(),C=t.getElementByKey(g.getKey());if(C){let E=C.getBoundingClientRect();E.height>0&&(m={left:E.left-p.left,top:E.bottom-p.top+8})}}});let f=window.getSelection();if(f&&f.rangeCount>0){let g=f.getRangeAt(0).getBoundingClientRect();g.height>0&&(m={left:g.left-p.left,top:g.bottom-p.top+8})}return m||(m={left:0,top:40}),l(m),n(!0),!0},V2))},[e,t,i]);let u=Tc(()=>{n(!1)},[]),d=Tc((a,p)=>{n(!1),t.focus(),t.update(()=>{s.current&&W2(s.current.clone())},{discrete:!0,skipTransforms:!0}),setTimeout(()=>{t.dispatchCommand(P2,{columns:String(a),rows:String(p)})},1)},[t]);return $2(wc.Fragment,{children:[ir(_c,{anchorElem:i,editor:t,isOpen:o,onClose:u,onInsert:d,position:r}),ir(F2,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]})};var tx=A({markdownTransformers:[Ua],nodes:[Q2,q2,ex],plugins:[{Component:Lc,position:"normal"},{Component:sc,position:"normal"},{Component:ec,position:"floatingAnchorElem"},{Component:gc,position:"floatingAnchorElem"}],providers:[Nc],slashMenu:{groups:[q([{Icon:Jn,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(Do,{})}}])]},toolbarFixed:{groups:[be([{ChildComponent:Jn,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(Do,{})}}])]}});import{$isNodeSelection as vx}from"lexical";import{jsx as yc}from"react/jsx-runtime";import"react";var ox="M16.2041 6.01074C17.2128 6.113 18 6.96435 18 8V16L17.9893 16.2041C17.8938 17.1457 17.1457 17.8938 16.2041 17.9893L16 18H8C6.96435 18 6.113 17.2128 6.01074 16.2041L6 16V8C6 6.89543 6.89543 6 8 6H16L16.2041 6.01074ZM8 7C7.44772 7 7 7.44772 7 8V16C7 16.5523 7.44772 17 8 17H16C16.5523 17 17 16.5523 17 16V8C17 7.44772 16.5523 7 16 7H8ZM9.72461 11.582C9.91869 11.4539 10.1827 11.4756 10.3535 11.6465L13.8535 15.1465C14.0488 15.3417 14.0488 15.6583 13.8535 15.8535C13.6583 16.0488 13.3417 16.0488 13.1465 15.8535L10 12.707L8.85352 13.8535C8.65825 14.0488 8.34175 14.0488 8.14648 13.8535C7.95122 13.6583 7.95122 13.3417 8.14648 13.1465L9.64648 11.6465L9.72461 11.582ZM14 8C15.1046 8 16 8.89543 16 10C16 11.1046 15.1046 12 14 12C12.8954 12 12 11.1046 12 10C12 8.89543 12.8954 8 14 8ZM14 9C13.4477 9 13 9.44772 13 10C13 10.5523 13.4477 11 14 11C14.5523 11 15 10.5523 15 10C15 9.44772 14.5523 9 14 9Z",sr=({className:t})=>yc("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:yc("path",{clipRule:"evenodd",d:ox,fill:"currentColor",fillRule:"evenodd"})});import{c as ux}from"react/compiler-runtime";import{jsx as dx}from"react/jsx-runtime";import{useLexicalComposerContext as mx}from"@lexical/react/LexicalComposerContext.js";import{$dfsIterator as Bc,$insertNodeToNearestRoot as ur,mergeRegister as px}from"@lexical/utils";import{useBulkUpload as fx,useEffectEvent as hx,useModal as gx}from"@payloadcms/ui";import dr from"bson-objectid";import{$createRangeSelection as xx,$getPreviousSelection as Dc,$getSelection as $c,$isParagraphNode as mr,$isRangeSelection as Oc,$setSelection as Cx,COMMAND_PRIORITY_EDITOR as bx,COMMAND_PRIORITY_LOW as Fc,createCommand as kx,DROP_COMMAND as _x,getDOMSelectionFromTarget as Tx,isHTMLElement as Pc,PASTE_COMMAND as Ex}from"lexical";import{useEffect as wx}from"react";import{c as Rc}from"react/compiler-runtime";import{jsx as ar}from"react/jsx-runtime";import{useLexicalComposerContext as vc}from"@lexical/react/LexicalComposerContext.js";import{toast as nx}from"@payloadcms/ui";import{$getNodeByKey as rx,COMMAND_PRIORITY_EDITOR as Ic}from"lexical";import{useEffect as Mc,useState as lx}from"react";var ix=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=rx(o);r&&r.replace(ye({data:{fields:null,relationTo:e,value:n}}))}):t.dispatchCommand(cr,{fields:null,relationTo:e,value:n})},sx=t=>{let e=Rc(13),{enabledCollectionSlugs:o}=t,[n]=vc(),[r,l]=lx(null),s;e[0]!==o?(s={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=s):s=e[1];let{closeListDrawer:i,ListDrawer:c,openListDrawer:u}=Pt(s),d,a;e[2]!==n||e[3]!==u?(d=()=>n.registerCommand(tt,h=>(l(h?.replace?h?.replace.nodeKey:null),u(),!0),Ic),a=[n,u],e[2]=n,e[3]=u,e[4]=d,e[5]=a):(d=e[4],a=e[5]),Mc(d,a);let p;e[6]!==i||e[7]!==n||e[8]!==r?(p=h=>{let{collectionSlug:g,doc:C}=h;i(),ix({editor:n,relationTo:g,replaceNodeKey:r,value:C.id})},e[6]=i,e[7]=n,e[8]=r,e[9]=p):p=e[9];let m=p,f;return e[10]!==c||e[11]!==m?(f=ar(c,{onSelect:m}),e[10]=c,e[11]=m,e[12]=f):f=e[12],f},ax=()=>{let t=Rc(3),[e]=vc(),o,n;return t[0]!==e?(o=()=>e.registerCommand(tt,cx,Ic),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Mc(o,n),null},Ac=({enabledCollectionSlugs:t})=>t?.length?ar(sx,{enabledCollectionSlugs:t}):ar(ax,{});function cx(){return nx.error("No upload collections enabled"),!0}function Sx(t){let e=t.target;return!!(Pc(e)&&!e.closest("code, span.editor-image")&&Pc(e.parentElement)&&e.parentElement.closest("div.ContentEditable__root"))}function Nx(t){let e,o=Tx(t.target);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&o!==null)o.collapse(t.rangeParent,t.rangeOffset||0),e=o.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var cr=kx("INSERT_UPLOAD_COMMAND"),jc=t=>{let e=ux(20),{clientProps:o}=t,[n]=mx(),r;e[0]!==o.enabledCollectionSlugs?(r={enabledCollectionSlugs:o.enabledCollectionSlugs},e[0]=o.enabledCollectionSlugs,e[1]=r):r=e[1];let{enabledCollectionSlugs:l}=Co(r),{modalSlug:s,setCollectionSlug:i,setInitialForms:c,setOnCancel:u,setOnSuccess:d,setSelectableCollections:a}=fx(),{isModalOpen:p,openModal:m}=gx(),f;e[2]!==s||e[3]!==n||e[4]!==l||e[5]!==p||e[6]!==m||e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==d||e[11]!==a?(f=L=>{let{files:x}=L;if(x?.length!==0&&(c(b=>[...b??[],...x.map(Lx)]),!p(s))){if(!l.length||!l[0])return;i(l[0]),a(l),u(()=>{n.update(yx)}),d(b=>{let k=new Map(b.map(Rx));n.update(()=>{for(let _ of Bc()){let T=_.node;if(nt(T)){let I=T.getData();if(I?.pending){let N=k.get(I.pending?.formID);N&&T.replace(ye({data:{id:new dr.default().toHexString(),fields:{},relationTo:N.collectionSlug,value:N.doc.id}}))}}}})}),m(s)}},e[2]=s,e[3]=n,e[4]=l,e[5]=p,e[6]=m,e[7]=i,e[8]=c,e[9]=u,e[10]=d,e[11]=a,e[12]=f):f=e[12];let h=hx(f),g;e[13]!==n||e[14]!==h?(g=()=>{if(!n.hasNodes([ot]))throw new Error("UploadPlugin: UploadNode not registered on editor");let L=new WeakSet;return px(n.registerNodeTransform(ot,x=>{let b=x.getData();if(!b?.pending||L.has(b.pending))return;L.add(b.pending),async function(){let T=null,I=b?.pending?.src,N=b?.pending?.formID;if(I?.startsWith("data:")){let w=I.match(/data:(image\/[a-zA-Z]+);base64,/),y=w?w[1]:"image/png",S=I.replace(/^data:image\/[a-zA-Z]+;base64,/,""),R=atob(S),v=new Array(R.length);for(let M=0;M<R.length;M++)v[M]=R.charCodeAt(M);let D=new Uint8Array(v);T={alt:void 0,file:new File([D],"pasted-image."+y?.split("/",2)[1],{type:y}),formID:N}}else if(I?.startsWith("http")||I?.startsWith("https")){let y=await(await fetch(I)).blob(),S=I.split("/").pop()||"pasted-image"+y.type.split("/",2)[1];T={alt:void 0,file:new File([y],S,{type:y.type}),formID:N}}T&&h({files:[T]})}()}),n.registerCommand(cr,x=>(n.update(()=>{let b=$c()||Dc();if(Oc(b)){let k=ye({data:{id:x.id,fields:x.fields,relationTo:x.relationTo,value:x.value}}),{focus:_}=b,T=_.getNode();ur(k),mr(T)&&!T.__first&&T.remove()}}),!0),bx),n.registerCommand(Ex,x=>{if(!(x instanceof ClipboardEvent))return!1;let b=x.clipboardData;if(!b?.types?.length||b?.types?.includes("text/html"))return!1;let k=[];return b?.files?.length&&Array.from(b.files).forEach(_=>{k.push({alt:"",file:_,formID:new dr.default().toHexString()})}),k.length?(n.update(()=>{let _=$c()||Dc();if(Oc(_))for(let T of k){let I=ye({data:{pending:{formID:T.formID,src:URL.createObjectURL(T.file)}}}),{focus:N}=_,w=N.getNode();ur(I),mr(w)&&!w.__first&&w.remove()}}),h({files:k}),!0):!1},Fc),n.registerCommand(_x,x=>{if(!(x instanceof DragEvent))return!1;let b=x.dataTransfer;if(!b?.types?.length)return!1;let k=[];return b?.files?.length&&Array.from(b.files).forEach(_=>{k.push({alt:"",file:_,formID:new dr.default().toHexString()})}),k.length?(x.preventDefault(),x.stopPropagation(),n.update(()=>{if(Sx(x)){let _=Nx(x),T=xx();_!=null&&T.applyDOMRange(_),Cx(T);for(let I of k){let N=ye({data:{pending:{formID:I.formID,src:URL.createObjectURL(I.file)}}}),{focus:w}=T,y=w.getNode();ur(N),mr(y)&&!y.__first&&y.remove()}}}),h({files:k}),!0):!1},Fc))},e[13]=n,e[14]=h,e[15]=g):g=e[15];let C;e[16]!==n?(C=[n],e[16]=n,e[17]=C):C=e[17],wx(g,C);let E;return e[18]!==l?(E=dx(Ac,{enabledCollectionSlugs:l}),e[18]=l,e[19]=E):E=e[19],E};function Lx(t){return{file:t.file,formID:t.formID}}function yx(){for(let t of Bc()){let e=t.node;nt(e)&&e.getData()?.pending&&e.remove()}}function Rx(t){return[t.formID,t]}var Ix=A({nodes:[ot],plugins:[{Component:jc,position:"normal"}],slashMenu:{groups:[q([{Icon:sr,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(tt,{replace:!1})}}])]},toolbarFixed:{groups:[be([{ChildComponent:sr,isActive:({selection:t})=>{if(!vx(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return nt(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(tt,{replace:!1})}}])]}});import{c as Ax}from"react/compiler-runtime";import{jsx as $o}from"react/jsx-runtime";import{createElement as Dx}from"react";import{ShimmerEffect as $x,useConfig as Ox}from"@payloadcms/ui";import{lazy as Fx,Suspense as Px,useEffect as Bx,useState as jx}from"react";var Hc={block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",inlineBlock:"LexicalEditorTheme__inlineBlock",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",hrSelected:"LexicalEditorTheme__hrSelected",indent:"LexicalEditorTheme__indent",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",placeholder:"LexicalEditorTheme__placeholder",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",root:"LexicalEditorTheme",rtl:"LexicalEditorTheme__rtl",tab:"LexicalEditorTheme__tabNode",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableAlignment:{center:"LexicalEditorTheme__tableAlignmentCenter",right:"LexicalEditorTheme__tableAlignmentRight"},tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableFrozenColumn:"LexicalEditorTheme__tableFrozenColumn",tableRowStriping:"LexicalEditorTheme__tableRowStriping",tableScrollableWrapper:"LexicalEditorTheme__tableScrollableWrapper",tableSelected:"LexicalEditorTheme__tableSelected",tableSelection:"LexicalEditorTheme__tableSelection",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"LexicalEditorTheme__upload"};var pr={namespace:"lexical",theme:Hc};function zc({config:t,featureClientImportMap:e,featureClientSchemaMap:o,field:n,schemaPath:r,unSanitizedEditorConfig:l}){let s=new Map,i=[];for(let d of l.features){if(!d?.clientFeatureProps?.featureKey||d?.clientFeatureProps?.order===void 0||d?.clientFeatureProps?.order===null){console.warn("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected. Skipping feature.");continue}s.set(d.clientFeatureProps.featureKey,d),i.push(d)}l.features=i,l.features=l.features.sort((d,a)=>d.clientFeatureProps.order-a.clientFeatureProps.order);let c=new Map,u=0;for(let d of l.features){let a=typeof d.feature=="function"?d.feature({config:t,featureClientImportMap:e,featureClientSchemaMap:o,featureProviderMap:s,field:n,resolvedFeatures:c,schemaPath:r,unSanitizedEditorConfig:l}):d.feature;a.key=d.clientFeatureProps.featureKey,a.order=u,c.set(d.clientFeatureProps.featureKey,a),u++}return c}import{deepMerge as Mx}from"payload/shared";var Gc=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},o={};if(t.forEach(n=>{n.key==="toolbarFixed"&&n.sanitizedClientFeatureProps?.customGroups&&(o={...o,...n.sanitizedClientFeatureProps.customGroups})}),!t?.size)return e;t.forEach(n=>{if(n.providers?.length&&(e.providers=e.providers.concat(n.providers)),n.enableFormats?.length&&e.enabledFormats.push(...n.enableFormats),n.nodes?.length)for(let r of n.nodes)e.nodes.push(r);if(n.plugins?.length&&n.plugins.forEach((r,l)=>{e.plugins?.push({clientProps:n.sanitizedClientFeatureProps,Component:r.Component,key:n.key+l,position:r.position})}),n.toolbarInline?.groups?.length)for(let r of n.toolbarInline.groups){let l=e.toolbarInline.groups.find(s=>s.key===r.key);l?e.toolbarInline.groups=e.toolbarInline.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarInline?.groups.push(l)}if(n.toolbarFixed?.groups?.length)for(let r of n.toolbarFixed.groups){let l=e.toolbarFixed.groups.find(s=>s.key===r.key);l?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarFixed?.groups.push(l)}if(n.slashMenu?.groups){n.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(n.slashMenu.dynamicGroups));for(let r of n.slashMenu.groups){let l=e.slashMenu.groups.find(s=>s.key===r.key);l?e.slashMenu.groups=e.slashMenu.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.slashMenu.groups.push(l)}}if(n.markdownTransformers?.length)for(let r of n.markdownTransformers)typeof r=="function"?e.markdownTransformers.push(r({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(r);e.enabledFeatures.push(n.key)}),Object.keys(o).length>0&&(e.toolbarFixed.groups=e.toolbarFixed.groups.map(n=>{let r=o[n.key];return r?Mx(n,r):n})),e.toolbarInline.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0),e.toolbarFixed.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);for(let n of e.toolbarInline.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);for(let n of e.toolbarFixed.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);return e};function fr(t,e,o,n){return{admin:o,features:Gc(t),lexical:e,resolvedFeatureMap:t,view:n}}var Hx=Fx(()=>import("./Field-MT4FK3IP.js").then(t=>({default:t.RichText}))),zx=t=>$o(Jo,{inheritable:!0,views:t.views,children:$o(Gx,{...t})}),Gx=t=>{let e=Ax(23),{admin:o,clientFeatures:n,featureClientImportMap:r,featureClientSchemaMap:l,field:s,lexicalEditorConfig:i,schemaPath:c,views:u}=t,d;e[0]!==o?(d=o===void 0?{}:o,e[0]=o,e[1]=d):d=e[1];let a=d,p;e[2]!==r?(p=r===void 0?{}:r,e[2]=r,e[3]=p):p=e[3];let m=p,f=i===void 0?pr:i,{currentView:h}=Xo(),g=u?.[h]?.admin??a,C=u?.[h]?.lexical,E;e[4]!==f||e[5]!==C?(E=typeof C=="function"?C(f):C??f,e[4]=f,e[5]=C,e[6]=E):E=e[6];let L=E,{config:x}=Ox(),[b,k]=jx(null),_,T;e[7]!==n||e[8]!==x||e[9]!==h||e[10]!==g||e[11]!==L||e[12]!==m||e[13]!==l||e[14]!==s||e[15]!==b||e[16]!==c||e[17]!==u?(_=()=>{if(b&&b.view===h)return;let N=u?.[h],w=N?.filterFeatures?N.filterFeatures(n):n,y=[];for(let R of Object.values(w))!R.clientFeatureProvider||!R.clientFeatureProps||y.push(R.clientFeatureProvider(R.clientFeatureProps));let S=zc({config:x,featureClientImportMap:m,featureClientSchemaMap:l,field:s,schemaPath:c??s.name,unSanitizedEditorConfig:{features:y,lexical:L}});k(fr(S,L,g,h))},T=[g,n,x,m,l,s,b,L,c,h,u],e[7]=n,e[8]=x,e[9]=h,e[10]=g,e[11]=L,e[12]=m,e[13]=l,e[14]=s,e[15]=b,e[16]=c,e[17]=u,e[18]=_,e[19]=T):(_=e[18],T=e[19]),Bx(_,T);let I;return e[20]!==b||e[21]!==t?(I=$o(Px,{fallback:$o($x,{height:"35vh"}),children:b&&Dx(Hx,{...t,editorConfig:b,key:b.view})}),e[20]=b,e[21]=t,e[22]=I):I=e[22],I};function Ux(...t){return t.filter(Boolean).join(" ")}var Wx=t=>(e,o,n)=>{let r=t(n);r&&(r.append(...o),e.replace(r),r.select(0,0))};var Oo=new WeakMap;function Uc(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function Fo(t,e){let o=Oo.get(t);if(o===void 0){let n=new Set,r=s=>{o!==void 0&&(o.start=Uc(s))},l=s=>{if(o===void 0)return;let{start:i}=o;if(i===null)return;let c=Uc(s);for(let u of n)c!==null&&u([c[0]-i[0],c[1]-i[1]],s)};t.addEventListener("touchstart",r),t.addEventListener("touchend",l),o={handleTouchend:l,handleTouchstart:r,listeners:n,start:null},Oo.set(t,o)}return o.listeners.add(e),()=>{Vx(t,e)}}function Vx(t,e){let o=Oo.get(t);if(o===void 0)return;let{listeners:n}=o;n.delete(e),n.size===0&&(Oo.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function Kx(t,e){return Fo(t,(o,n)=>{let[r,l]=o;r<0&&-r>Math.abs(l)&&e(r,n)})}function Jx(t,e){return Fo(t,(o,n)=>{let[r,l]=o;r>0&&r>Math.abs(l)&&e(r,n)})}function Xx(t,e){return Fo(t,(o,n)=>{let[r,l]=o;l<0&&-l>Math.abs(r)&&e(r,n)})}function Yx(t,e){return Fo(t,(o,n)=>{let[r,l]=o;l>0&&l>Math.abs(r)&&e(r,n)})}import{c as Zx}from"react/compiler-runtime";import{jsx as qx}from"react/jsx-runtime";import"react";var Qx=()=>{let t=Zx(2),{EditButton:e}=xe(),o;return t[0]!==e?(o=e?qx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as eC}from"react/compiler-runtime";import{jsx as tC}from"react/jsx-runtime";import"react";var oC=()=>{let t=eC(2),{RemoveButton:e}=xe(),o;return t[0]!==e?(o=e?tC(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as nC}from"react/compiler-runtime";import{jsx as rC}from"react/jsx-runtime";import"react";var lC=()=>{let t=nC(2),{Label:e}=xe(),o;return t[0]!==e?(o=e?rC(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as iC}from"react/compiler-runtime";import{jsx as sC}from"react/jsx-runtime";import"react";var aC=t=>{let e=iC(3),{children:o}=t,{InlineBlockContainer:n}=xe(),r;return e[0]!==n||e[1]!==o?(r=n?sC(n,{children:o}):null,e[0]=n,e[1]=o,e[2]=r):r=e[2],r};import{jsx as cC}from"react/jsx-runtime";import"react";var uC=t=>{let{children:e,...o}=t,{BlockCollapsible:n}=ae();return n?cC(n,{...o,children:e}):null};import{c as dC}from"react/compiler-runtime";import{jsx as mC}from"react/jsx-runtime";import"react";var pC=()=>{let t=dC(2),{EditButton:e}=ae(),o;return t[0]!==e?(o=e?mC(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as fC}from"react/compiler-runtime";import{jsx as hC}from"react/jsx-runtime";import"react";var gC=()=>{let t=fC(2),{RemoveButton:e}=ae(),o;return t[0]!==e?(o=e?hC(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{stringify as xC}from"qs-esm";var CC=({apiURL:t,depth:e,draft:o,locale:n})=>async({id:l,collectionSlug:s,select:i})=>{let c=xC({depth:e??0,draft:o??!1,locale:n,select:i},{addQueryPrefix:!0});return await fetch(`${t}/${s}/${l}${c}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(d=>d.json())};var Wc={customEndRegex:{optional:!0,regExp:/[ \t]*```$/},customStartRegex:/^[ \t]*```(\w+)?/,doNotTrimChildren:!0,export:({fields:t})=>!t.code.includes(`
60
60
  `)&&!t.language?.length?"```"+t.code+"```":"```"+(t.language||"")+(t.code?`
61
61
  `+t.code:"")+"\n```",import:({children:t,closeMatch:e,openMatch:o})=>{let n=o?.[1];return t.startsWith(`
62
62
  `)&&(t=t.slice(1)),t.endsWith(`
63
63
  `)&&(t=t.slice(0,-1)),!!e&&!t.includes(`
64
- `)&&o?.input?.trim()!=="```"+n?{code:n+(t?.length?t:""),language:""}:{code:t,language:n}}};import{jsx as Ax}from"react/jsx-runtime";import{CodeField as $x,useFormFields as Dx}from"@payloadcms/ui";import{useId as Ox,useMemo as Fx}from"react";var Ro={abap:"ABAP",apex:"Apex",azcli:"Azure CLI",bat:"Batch",bicep:"Bicep",cameligo:"CameLIGO",clojure:"Clojure",coffee:"CoffeeScript",cpp:"C++",csharp:"C#",csp:"CSP",css:"CSS",cypher:"Cypher",dart:"Dart",dockerfile:"Dockerfile",ecl:"ECL",elixir:"Elixir",flow9:"Flow9",freemarker2:"FreeMarker 2",fsharp:"F#",go:"Go",graphql:"GraphQL",handlebars:"Handlebars",hcl:"HCL",html:"HTML",ini:"INI",java:"Java",javascript:"JavaScript",julia:"Julia",kotlin:"Kotlin",less:"Less",lexon:"Lexon",liquid:"Liquid",lua:"Lua",m3:"M3",markdown:"Markdown",mdx:"MDX",mips:"MIPS",msdax:"DAX",mysql:"MySQL","objective-c":"Objective-C",pascal:"Pascal",pascaligo:"PascaLIGO",perl:"Perl",pgsql:"PostgreSQL",php:"PHP",pla:"PLA",plaintext:"Plain Text",postiats:"Postiats",powerquery:"Power Query",powershell:"PowerShell",protobuf:"Protobuf",pug:"Pug",python:"Python",qsharp:"Q#",r:"R",razor:"Razor",redis:"Redis",redshift:"Amazon Redshift",restructuredtext:"reStructuredText",ruby:"Ruby",rust:"Rust",sb:"Small Basic",scala:"Scala",scheme:"Scheme",scss:"SCSS",shell:"Shell",solidity:"Solidity",sophia:"Sophia",sparql:"SPARQL",sql:"SQL",st:"Structured Text",swift:"Swift",systemverilog:"SystemVerilog",tcl:"Tcl",twig:"Twig",typescript:"TypeScript",typespec:"TypeSpec",vb:"Visual Basic",wgsl:"WGSL",xml:"XML",yaml:"YAML"};var Px=({autoComplete:t,field:e,forceRender:o,languages:n=Ro,path:r,permissions:l,readOnly:s,renderedBlocks:i,schemaPath:u,typescript:d,validate:c})=>{let a=Dx(([_])=>_.language),m=a?.value||a?.initialValue||"typescript",p=Ox(),h=n[m],f=Fx(()=>({...e,type:"code",admin:{...e.admin,editorOptions:{},editorProps:{defaultPath:m==="ts"?`file-${e.name}-${p}.tsx`:void 0},language:m}}),[e,m,p]),g=`${e.name}-${m}-${h}`;return f&&Ax($x,{autoComplete:t,field:f,forceRender:o,onMount:(_,E)=>{E.editor.defineTheme("vs-dark",{base:"vs-dark",colors:{"editor.background":"#222222"},inherit:!0,rules:[]}),E.editor.defineTheme("vs",{base:"vs",colors:{"editor.background":"#f5f5f5"},inherit:!0,rules:[]}),E.languages.typescript.typescriptDefaults.setCompilerOptions({allowNonTsExtensions:!0,allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,jsx:E.languages.typescript.JsxEmit.React,moduleResolution:E.languages.typescript.ModuleResolutionKind.NodeJs,noEmit:!0,paths:d?.paths,reactNamespace:"React",target:E.languages.typescript.ScriptTarget[d?.target??"ESNext"],typeRoots:d?.typeRoots??["node_modules/@types"]}),E.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!d?.enableSemanticValidation,noSyntaxValidation:!1}),(async()=>d?.fetchTypes&&Array.isArray(d.fetchTypes)&&d.fetchTypes.length>0&&await Promise.all(d.fetchTypes.map(async b=>{let C=await(await fetch(b.url)).text();E.languages.typescript.typescriptDefaults.addExtraLib(C,b.filePath)})))()},path:r,permissions:l,readOnly:s,renderedBlocks:i,schemaPath:u,validate:c},g)};import{jsx as re,jsxs as jc}from"react/jsx-runtime";import{useLexicalEditable as Jx}from"@lexical/react/useLexicalEditable";import{ChevronIcon as Xx,Combobox as Zx,CopyToClipboard as Yx,PopupList as qx,RenderFields as Qx,useForm as eC,useFormFields as Hc,useTranslation as tC}from"@payloadcms/ui";import oC from"react";import{jsx as $c}from"react/jsx-runtime";import"react";var Bx={16:"M6.646 6.146a.5.5 0 1 0 .708.708l1.5-1.5a.5.5 0 0 0 0-.708l-1.5-1.5a.5.5 0 1 0-.708.708L7.793 5zm-1.292-3a.5.5 0 0 1 0 .708L4.207 5l1.147 1.146a.5.5 0 1 1-.708.708l-1.5-1.5a.5.5 0 0 1 0-.708l1.5-1.5a.5.5 0 0 1 .708 0M10.5 3h1A1.5 1.5 0 0 1 13 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 11.5v-3a.5.5 0 0 1 1 0v3a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 1 0-1",24:"M16.5 6C17.3284 6 18 6.67157 18 7.5V16.5C18 17.3284 17.3284 18 16.5 18H7.5C6.67157 18 6 17.3284 6 16.5V12.5C6 12.2239 6.22386 12 6.5 12C6.77614 12 7 12.2239 7 12.5V16.5C7 16.7761 7.22386 17 7.5 17H16.5C16.7761 17 17 16.7761 17 16.5V7.5C17 7.22386 16.7761 7 16.5 7H15.5C15.2239 7 15 6.77614 15 6.5C15 6.22386 15.2239 6 15.5 6H16.5ZM8.14648 6.14648C8.34175 5.95122 8.65825 5.95122 8.85352 6.14648C9.04878 6.34175 9.04878 6.65825 8.85352 6.85352L7.20703 8.5L8.85352 10.1465C9.04878 10.3417 9.04878 10.6583 8.85352 10.8535C8.65825 11.0488 8.34175 11.0488 8.14648 10.8535L6.14648 8.85352C5.95122 8.65825 5.95122 8.34175 6.14648 8.14648L8.14648 6.14648ZM11.1465 6.14648C11.3417 5.95122 11.6583 5.95122 11.8535 6.14648L13.8535 8.14648C14.0488 8.34175 14.0488 8.65825 13.8535 8.85352L11.8535 10.8535C11.6583 11.0488 11.3417 11.0488 11.1465 10.8535C10.9512 10.6583 10.9512 10.3417 11.1465 10.1465L12.793 8.5L11.1465 6.85352C10.9512 6.65825 10.9512 6.34175 11.1465 6.14648Z"},Dc=({className:t,size:e=24})=>$c("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:$c("path",{clipRule:"evenodd",d:Bx[e],fill:"currentColor",fillRule:"evenodd"})});import{jsx as nr}from"react/jsx-runtime";import"react";import{useCollapsible as Ux}from"@payloadcms/ui";import{jsx as Oc}from"react/jsx-runtime";import"react";var jx="M11.4999 13C11.6325 13 11.7597 13.0527 11.8535 13.1464L14.8535 16.1464C15.0487 16.3417 15.0487 16.6582 14.8535 16.8535C14.6582 17.0487 14.3417 17.0487 14.1464 16.8535L11.4999 14.207L8.85346 16.8535C8.6582 17.0487 8.34169 17.0487 8.14643 16.8535C7.95119 16.6582 7.95119 16.3417 8.14643 16.1464L11.1464 13.1464C11.2402 13.0527 11.3674 13 11.4999 13ZM14.1464 7.14644C14.3417 6.95119 14.6582 6.95118 14.8535 7.14644C15.0487 7.3417 15.0487 7.65821 14.8535 7.85347L11.8535 10.8535C11.7597 10.9472 11.6325 10.9999 11.4999 11C11.3674 10.9999 11.2402 10.9472 11.1464 10.8535L8.14643 7.85347C7.95119 7.65821 7.95119 7.3417 8.14643 7.14644C8.34169 6.9512 8.6582 6.9512 8.85346 7.14644L11.4999 9.79292L14.1464 7.14644Z",Io=({className:t})=>Oc("svg",{className:t,fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Oc("path",{d:jx,fill:"currentColor"})});import{jsx as Fc}from"react/jsx-runtime";import"react";var Hx="M11.5 6C11.6326 6 11.7597 6.05272 11.8535 6.14648L14.8535 9.14648C15.0487 9.34175 15.0487 9.65825 14.8535 9.85352C14.6582 10.0488 14.3417 10.0488 14.1464 9.85352L12 7.70703V16.293L14.1464 14.1465C14.3417 13.9512 14.6582 13.9512 14.8535 14.1465C15.0487 14.3417 15.0487 14.6583 14.8535 14.8535L11.8535 17.8535C11.6582 18.0488 11.3417 18.0488 11.1464 17.8535L8.14645 14.8535C7.95119 14.6583 7.95119 14.3417 8.14645 14.1465C8.34171 13.9512 8.65822 13.9512 8.85348 14.1465L11 16.293V7.70703L8.85348 9.85352C8.65822 10.0488 8.34171 10.0488 8.14645 9.85352C7.95118 9.65825 7.95118 9.34175 8.14645 9.14648L11.1464 6.14648C11.2402 6.05272 11.3674 6 11.5 6Z",Mo=({className:t})=>Fc("svg",{className:t,fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Fc("path",{clipRule:"evenodd",d:Hx,fill:"currentColor",fillRule:"evenodd"})});var Gx="code-block-collapse-button",Pc=()=>{let{isCollapsed:t,toggle:e}=Ux();return nr("button",{className:Gx,onClick:e,type:"button",children:t?nr(Mo,{}):nr(Io,{})})};import{jsx as rr,jsxs as Vx}from"react/jsx-runtime";import{useCollapsible as Wx,useTranslation as zx}from"@payloadcms/ui";import"react";var Kx="code-block-floating-collapse-button",Bc=()=>{let{isCollapsed:t,toggle:e}=Wx(),{t:o}=zx();return Vx("button",{className:Kx,onClick:e,type:"button",children:[t?rr(Mo,{}):rr(Io,{}),rr("span",{children:o(t?"general:expand":"general:collapse")})]})};var Ke="payload-richtext-code-block",nC=t=>{let{languages:e}=t,o=e||Ro,{BlockCollapsible:n,formSchema:r,RemoveButton:l}=ae(),{setModified:s}=eC(),{t:i}=tC(),{codeField:u}=Hc(([h])=>({codeField:h?.code})),{selectedLanguageField:d,setSelectedLanguage:c}=Hc(([h,f])=>({selectedLanguageField:h?.language,setSelectedLanguage:g=>{f({type:"UPDATE",path:"language",value:g}),s(!0)}})),a=o[d?.value],m=Jx(),p=oC.useMemo(()=>Object.entries(o).map(([h,f])=>({name:`${h} ${f}`,Component:re(qx.Button,{active:!1,disabled:!1,onClick:()=>{c(h)},children:re("span",{className:`${Ke}__language-code`,"data-language":h,children:f})})})),[o,c]);return re(n,{Actions:jc("div",{className:`${Ke}__actions`,children:[re(Zx,{"aria-label":i("general:language"),button:jc("div",{className:`${Ke}__language-selector-button`,"data-selected-language":d?.value,children:[re("span",{children:a}),re(Xx,{className:`${Ke}__chevron`})]}),buttonType:"custom",className:`${Ke}__language-selector`,disabled:!m,entries:p,horizontalAlign:"right",minEntriesForSearch:8,searchPlaceholder:i("fields:searchForLanguage"),showScrollbar:!0,size:"large"}),re(Yx,{value:u?.value??""}),re(Pc,{}),m&&re(l,{})]}),className:Ke,collapsibleProps:{AfterCollapsible:re(Bc,{}),disableHeaderToggle:!0,disableToggleIndicator:!0},Pill:re("div",{className:`${Ke}__pill`,children:re(Dc,{})}),showDragHandle:!1,showRowNumber:!1,children:re(Qx,{fields:r,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!m})})};import{c as rC}from"react/compiler-runtime";import{jsx as pt}from"react/jsx-runtime";import{FieldContext as lC,FieldPathContext as Gc,ServerFunctionsContext as Uc,ShimmerEffect as iC,useServerFunctions as sC}from"@payloadcms/ui";import aC,{useEffect as cC,useRef as uC}from"react";var dC=t=>{let e=rC(9),{field:o,initialValue:n,Loading:r,path:l,schemaPath:s,setValue:i,value:u}=t,[d,c]=aC.useState(null),a=sC(),{_internal_renderField:m}=a,[p,h]=s.split(".",2),f=l??(o&&"name"in o?o?.name:"")??"",g;e[0]!==m||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==s?(g=()=>{(async function(){let{Field:I}=await m({field:{...o||{},type:"richText",admin:{...o?.admin||{},hidden:!1}},initialValue:n??void 0,path:l,schemaPath:s});c(I)})()},e[0]=m,e[1]=o,e[2]=n,e[3]=l,e[4]=s,e[5]=g):g=e[5];let _=g,E=uC(!1),R,b;if(e[6]!==_?(R=()=>{E.current||(E.current=!0,_())},b=[_],e[6]=_,e[7]=R,e[8]=b):(R=e[7],b=e[8]),cC(R,b),!d)return typeof r<"u"?r:pt(iC,{});let x={...a,getFormState:async k=>a.getFormState({...k,collectionSlug:p==="collection"?h:void 0,globalSlug:p==="global"?h:void 0})};if(typeof u>"u"&&!i)return pt(Uc,{value:{...x},children:pt(Gc,{value:f,children:d},f)});let C={disabled:!1,formInitializing:!1,formProcessing:!1,formSubmitted:!1,initialValue:u,path:f,setValue:i??mC,showError:!1,value:u};return pt(Uc,{value:{...x},children:pt(Gc,{value:f,children:pt(lC,{value:C,children:d})},f)})};function mC(){}function Vc({nodes:t,text:e}){let o={root:{type:"root",children:[],direction:"ltr",format:"",indent:0,version:1}};return e&&o.root.children.push({type:"paragraph",children:[{type:"text",detail:0,format:0,mode:"normal",style:"",text:e,version:1}],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),t?.length&&o.root.children.push(...t),o.root.children.length===0&&o.root.children.push({type:"paragraph",children:[],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),o}var pC=Vc;export{yt as $createAutoLinkNode,Be as $createBlockNode,ot as $createHorizontalRuleNode,Ct as $createInlineBlockNode,we as $createLinkNode,ze as $createRelationshipNode,ge as $createUploadNode,Se as $isAutoLinkNode,Me as $isBlockNode,Ge as $isHorizontalRuleNode,bt as $isInlineBlockNode,K as $isLinkNode,Sn as $isRelationshipNode,mt as $isUploadNode,hu as AlignFeatureClient,Ee as AutoLinkNode,Ex as BlockCollapsible,Lx as BlockEditButton,ce as BlockNode,Rx as BlockRemoveButton,wu as BlockquoteFeatureClient,Kd as BlocksFeatureClient,_1 as BoldFeatureClient,se as CAN_USE_DOM,Pf as ChecklistFeatureClient,nx as ClientEntryLexicalField,nC as CodeBlockBlockComponent,Px as CodeComponent,m0 as DETAIL_TYPE_TO_DETAIL,a0 as DOUBLE_LINE_BREAK,S0 as DebugJsxConverterFeatureClient,f0 as ELEMENT_FORMAT_TO_TYPE,p0 as ELEMENT_TYPE_TO_FORMAT,eu as ENABLE_SLASH_MENU_COMMAND,Zc as EditorConfigProvider,Oo as FieldsDrawer,qh as FixedToolbarFeatureClient,Lm as HeadingFeatureClient,Km as HorizontalRuleFeatureClient,Te as HorizontalRuleNode,et as INSERT_BLOCK_COMMAND,tt as INSERT_INLINE_BLOCK_COMMAND,i0 as IS_ALL_FORMATTING,cp as IndentFeatureClient,Tx as InlineBlockContainer,px as InlineBlockEditButton,bx as InlineBlockLabel,xt as InlineBlockNode,gx as InlineBlockRemoveButton,L1 as InlineCodeFeatureClient,m5 as InlineToolbarFeatureClient,$1 as ItalicFeatureClient,u0 as LTR_REGEX,yf as LinkFeatureClient,oe as LinkNode,s0 as NON_BREAKING_SPACE,O as NodeFormat,Vf as OrderedListFeatureClient,qf as ParagraphFeatureClient,qc as Point,c0 as RTL_REGEX,tu as Rect,hh as RelationshipFeatureClient,Ne as RelationshipNode,dC as RenderLexical,or as RichTextField,Fo as RichTextViewProvider,j1 as StrikethroughFeatureClient,W1 as SubscriptFeatureClient,Z1 as SuperscriptFeatureClient,h0 as TEXT_MODE_TO_TYPE,d0 as TEXT_TYPE_TO_FORMAT,g0 as TEXT_TYPE_TO_MODE,pe as TOGGLE_LINK_COMMAND,i2 as TableFeatureClient,s1 as TestRecorderFeatureClient,mm as TextStateFeatureClient,$t as ToolbarButton,Dt as ToolbarDropdown,m1 as TreeViewFeatureClient,tm as UnderlineFeatureClient,Zf as UnorderedListFeatureClient,U2 as UploadFeatureClient,he as UploadNode,ux as addSwipeDownListener,sx as addSwipeLeftListener,ax as addSwipeRightListener,cx as addSwipeUpListener,pC as buildDefaultEditorState,Vc as buildEditorState,Ac as codeConverterClient,lx as createBlockNode,A as createClientFeature,N0 as defaultColors,er as defaultEditorLexicalConfig,An as getDOMRangeRect,ou as getEnabledNodes,Mx as getRestPopulateFn,nt as getSelectedNode,Qc as isPoint,rx as joinClasses,tr as sanitizeClientEditorConfig,Rc as sanitizeClientFeatures,go as setFloatingElemPosition,ro as setFloatingElemPositionForLinkEditor,X as slashMenuBasicGroupWithItems,_e as toolbarAddDropdownGroupWithItems,rn as toolbarFeatureButtonsGroupWithItems,Z as toolbarFormatGroupWithItems,te as toolbarTextDropdownGroupWithItems,ae as useBlockComponentContext,U as useEditorConfigContext,be as useInlineBlockComponentContext,Yc as useLexicalDocumentDrawer,Oe as useLexicalDrawer,At as useLexicalListDrawer,Po as useRichTextView};
64
+ `)&&o?.input?.trim()!=="```"+n?{code:n+(t?.length?t:""),language:""}:{code:t,language:n}}};import{jsx as bC}from"react/jsx-runtime";import{CodeField as kC,useFormFields as _C}from"@payloadcms/ui";import{useId as TC,useMemo as EC}from"react";var Po={abap:"ABAP",apex:"Apex",azcli:"Azure CLI",bat:"Batch",bicep:"Bicep",cameligo:"CameLIGO",clojure:"Clojure",coffee:"CoffeeScript",cpp:"C++",csharp:"C#",csp:"CSP",css:"CSS",cypher:"Cypher",dart:"Dart",dockerfile:"Dockerfile",ecl:"ECL",elixir:"Elixir",flow9:"Flow9",freemarker2:"FreeMarker 2",fsharp:"F#",go:"Go",graphql:"GraphQL",handlebars:"Handlebars",hcl:"HCL",html:"HTML",ini:"INI",java:"Java",javascript:"JavaScript",julia:"Julia",kotlin:"Kotlin",less:"Less",lexon:"Lexon",liquid:"Liquid",lua:"Lua",m3:"M3",markdown:"Markdown",mdx:"MDX",mips:"MIPS",msdax:"DAX",mysql:"MySQL","objective-c":"Objective-C",pascal:"Pascal",pascaligo:"PascaLIGO",perl:"Perl",pgsql:"PostgreSQL",php:"PHP",pla:"PLA",plaintext:"Plain Text",postiats:"Postiats",powerquery:"Power Query",powershell:"PowerShell",protobuf:"Protobuf",pug:"Pug",python:"Python",qsharp:"Q#",r:"R",razor:"Razor",redis:"Redis",redshift:"Amazon Redshift",restructuredtext:"reStructuredText",ruby:"Ruby",rust:"Rust",sb:"Small Basic",scala:"Scala",scheme:"Scheme",scss:"SCSS",shell:"Shell",solidity:"Solidity",sophia:"Sophia",sparql:"SPARQL",sql:"SQL",st:"Structured Text",swift:"Swift",systemverilog:"SystemVerilog",tcl:"Tcl",twig:"Twig",typescript:"TypeScript",typespec:"TypeSpec",vb:"Visual Basic",wgsl:"WGSL",xml:"XML",yaml:"YAML"};var wC=({autoComplete:t,field:e,forceRender:o,languages:n=Po,path:r,permissions:l,readOnly:s,renderedBlocks:i,schemaPath:c,typescript:u,validate:d})=>{let a=_C(([C])=>C.language),p=a?.value||a?.initialValue||"typescript",m=TC(),f=n[p],h=EC(()=>({...e,type:"code",admin:{...e.admin,editorOptions:{},editorProps:{defaultPath:p==="ts"?`file-${e.name}-${m}.tsx`:void 0},language:p}}),[e,p,m]),g=`${e.name}-${p}-${f}`;return h&&bC(kC,{autoComplete:t,field:h,forceRender:o,onMount:(C,E)=>{E.editor.defineTheme("vs-dark",{base:"vs-dark",colors:{"editor.background":"#222222"},inherit:!0,rules:[]}),E.editor.defineTheme("vs",{base:"vs",colors:{"editor.background":"#f5f5f5"},inherit:!0,rules:[]}),E.languages.typescript.typescriptDefaults.setCompilerOptions({allowNonTsExtensions:!0,allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,jsx:E.languages.typescript.JsxEmit.React,moduleResolution:E.languages.typescript.ModuleResolutionKind.NodeJs,noEmit:!0,paths:u?.paths,reactNamespace:"React",target:E.languages.typescript.ScriptTarget[u?.target??"ESNext"],typeRoots:u?.typeRoots??["node_modules/@types"]}),E.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!u?.enableSemanticValidation,noSyntaxValidation:!1}),(async()=>u?.fetchTypes&&Array.isArray(u.fetchTypes)&&u.fetchTypes.length>0&&await Promise.all(u.fetchTypes.map(async x=>{let k=await(await fetch(x.url)).text();E.languages.typescript.typescriptDefaults.addExtraLib(k,x.filePath)})))()},path:r,permissions:l,readOnly:s,renderedBlocks:i,schemaPath:c,validate:d},g)};import{jsx as le,jsxs as qc}from"react/jsx-runtime";import{useLexicalEditable as DC}from"@lexical/react/useLexicalEditable";import{ChevronIcon as $C,Combobox as OC,CopyToClipboard as FC,PopupList as PC,RenderFields as BC,useForm as jC,useFormFields as Qc,useTranslation as HC}from"@payloadcms/ui";import zC from"react";import{jsx as Vc}from"react/jsx-runtime";import"react";var SC={16:"M6.646 6.146a.5.5 0 1 0 .708.708l1.5-1.5a.5.5 0 0 0 0-.708l-1.5-1.5a.5.5 0 1 0-.708.708L7.793 5zm-1.292-3a.5.5 0 0 1 0 .708L4.207 5l1.147 1.146a.5.5 0 1 1-.708.708l-1.5-1.5a.5.5 0 0 1 0-.708l1.5-1.5a.5.5 0 0 1 .708 0M10.5 3h1A1.5 1.5 0 0 1 13 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 11.5v-3a.5.5 0 0 1 1 0v3a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 1 0-1",24:"M16.5 6C17.3284 6 18 6.67157 18 7.5V16.5C18 17.3284 17.3284 18 16.5 18H7.5C6.67157 18 6 17.3284 6 16.5V12.5C6 12.2239 6.22386 12 6.5 12C6.77614 12 7 12.2239 7 12.5V16.5C7 16.7761 7.22386 17 7.5 17H16.5C16.7761 17 17 16.7761 17 16.5V7.5C17 7.22386 16.7761 7 16.5 7H15.5C15.2239 7 15 6.77614 15 6.5C15 6.22386 15.2239 6 15.5 6H16.5ZM8.14648 6.14648C8.34175 5.95122 8.65825 5.95122 8.85352 6.14648C9.04878 6.34175 9.04878 6.65825 8.85352 6.85352L7.20703 8.5L8.85352 10.1465C9.04878 10.3417 9.04878 10.6583 8.85352 10.8535C8.65825 11.0488 8.34175 11.0488 8.14648 10.8535L6.14648 8.85352C5.95122 8.65825 5.95122 8.34175 6.14648 8.14648L8.14648 6.14648ZM11.1465 6.14648C11.3417 5.95122 11.6583 5.95122 11.8535 6.14648L13.8535 8.14648C14.0488 8.34175 14.0488 8.65825 13.8535 8.85352L11.8535 10.8535C11.6583 11.0488 11.3417 11.0488 11.1465 10.8535C10.9512 10.6583 10.9512 10.3417 11.1465 10.1465L12.793 8.5L11.1465 6.85352C10.9512 6.65825 10.9512 6.34175 11.1465 6.14648Z"},Kc=({className:t,size:e=24})=>Vc("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Vc("path",{clipRule:"evenodd",d:SC[e],fill:"currentColor",fillRule:"evenodd"})});import{jsx as hr}from"react/jsx-runtime";import"react";import{useCollapsible as RC}from"@payloadcms/ui";import{jsx as Jc}from"react/jsx-runtime";import"react";var NC="M11.4999 13C11.6325 13 11.7597 13.0527 11.8535 13.1464L14.8535 16.1464C15.0487 16.3417 15.0487 16.6582 14.8535 16.8535C14.6582 17.0487 14.3417 17.0487 14.1464 16.8535L11.4999 14.207L8.85346 16.8535C8.6582 17.0487 8.34169 17.0487 8.14643 16.8535C7.95119 16.6582 7.95119 16.3417 8.14643 16.1464L11.1464 13.1464C11.2402 13.0527 11.3674 13 11.4999 13ZM14.1464 7.14644C14.3417 6.95119 14.6582 6.95118 14.8535 7.14644C15.0487 7.3417 15.0487 7.65821 14.8535 7.85347L11.8535 10.8535C11.7597 10.9472 11.6325 10.9999 11.4999 11C11.3674 10.9999 11.2402 10.9472 11.1464 10.8535L8.14643 7.85347C7.95119 7.65821 7.95119 7.3417 8.14643 7.14644C8.34169 6.9512 8.6582 6.9512 8.85346 7.14644L11.4999 9.79292L14.1464 7.14644Z",Bo=({className:t})=>Jc("svg",{className:t,fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Jc("path",{d:NC,fill:"currentColor"})});import{jsx as Xc}from"react/jsx-runtime";import"react";var LC="M11.5 6C11.6326 6 11.7597 6.05272 11.8535 6.14648L14.8535 9.14648C15.0487 9.34175 15.0487 9.65825 14.8535 9.85352C14.6582 10.0488 14.3417 10.0488 14.1464 9.85352L12 7.70703V16.293L14.1464 14.1465C14.3417 13.9512 14.6582 13.9512 14.8535 14.1465C15.0487 14.3417 15.0487 14.6583 14.8535 14.8535L11.8535 17.8535C11.6582 18.0488 11.3417 18.0488 11.1464 17.8535L8.14645 14.8535C7.95119 14.6583 7.95119 14.3417 8.14645 14.1465C8.34171 13.9512 8.65822 13.9512 8.85348 14.1465L11 16.293V7.70703L8.85348 9.85352C8.65822 10.0488 8.34171 10.0488 8.14645 9.85352C7.95118 9.65825 7.95118 9.34175 8.14645 9.14648L11.1464 6.14648C11.2402 6.05272 11.3674 6 11.5 6Z",jo=({className:t})=>Xc("svg",{className:t,fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Xc("path",{clipRule:"evenodd",d:LC,fill:"currentColor",fillRule:"evenodd"})});var yC="code-block-collapse-button",Yc=()=>{let{isCollapsed:t,toggle:e}=RC();return hr("button",{className:yC,onClick:e,type:"button",children:t?hr(jo,{}):hr(Bo,{})})};import{jsx as gr,jsxs as vC}from"react/jsx-runtime";import{useCollapsible as IC,useTranslation as MC}from"@payloadcms/ui";import"react";var AC="code-block-floating-collapse-button",Zc=()=>{let{isCollapsed:t,toggle:e}=IC(),{t:o}=MC();return vC("button",{className:AC,onClick:e,type:"button",children:[t?gr(jo,{}):gr(Bo,{}),gr("span",{children:o(t?"general:expand":"general:collapse")})]})};var Je="payload-richtext-code-block",GC=t=>{let{languages:e}=t,o=e||Po,{BlockCollapsible:n,formSchema:r,RemoveButton:l}=ae(),{setModified:s}=jC(),{t:i}=HC(),{codeField:c}=Qc(([f])=>({codeField:f?.code})),{selectedLanguageField:u,setSelectedLanguage:d}=Qc(([f,h])=>({selectedLanguageField:f?.language,setSelectedLanguage:g=>{h({type:"UPDATE",path:"language",value:g}),s(!0)}})),a=o[u?.value],p=DC(),m=zC.useMemo(()=>Object.entries(o).map(([f,h])=>({name:`${f} ${h}`,Component:le(PC.Button,{active:!1,disabled:!1,onClick:()=>{d(f)},children:le("span",{className:`${Je}__language-code`,"data-language":f,children:h})})})),[o,d]);return le(n,{Actions:qc("div",{className:`${Je}__actions`,children:[le(OC,{"aria-label":i("general:language"),button:qc("div",{className:`${Je}__language-selector-button`,"data-selected-language":u?.value,children:[le("span",{children:a}),le($C,{className:`${Je}__chevron`})]}),buttonType:"custom",className:`${Je}__language-selector`,disabled:!p,entries:m,horizontalAlign:"right",minEntriesForSearch:8,searchPlaceholder:i("fields:searchForLanguage"),showScrollbar:!0,size:"large"}),le(FC,{value:c?.value??""}),le(Yc,{}),p&&le(l,{})]}),className:Je,collapsibleProps:{AfterCollapsible:le(Zc,{}),disableHeaderToggle:!0,disableToggleIndicator:!0},Pill:le("div",{className:`${Je}__pill`,children:le(Kc,{})}),showDragHandle:!1,showRowNumber:!1,children:le(BC,{fields:r,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!p})})};import{c as UC}from"react/compiler-runtime";import{jsx as gt}from"react/jsx-runtime";import{FieldContext as WC,FieldPathContext as eu,ServerFunctionsContext as tu,ShimmerEffect as VC,useServerFunctions as KC}from"@payloadcms/ui";import JC,{useEffect as XC,useRef as YC}from"react";var ZC=t=>{let e=UC(10),{name:o,field:n,initialValue:r,label:l,Loading:s,path:i,schemaPath:c,setValue:u,value:d}=t,[a,p]=JC.useState(null),m=KC(),{_internal_renderField:f}=m,[h,g]=c.split(".",2),C=o!==void 0?o:n?.name,E=l!==void 0?l:n?.label,L=i??C??"",x;e[0]!==f||e[1]!==E||e[2]!==C||e[3]!==r||e[4]!==i||e[5]!==c?(x=()=>{(async function(){let{Field:S}=await f({name:C,hidden:!1,initialValue:r??void 0,label:typeof E=="function"?void 0:E,path:i,schemaPath:c});p(S)})()},e[0]=f,e[1]=E,e[2]=C,e[3]=r,e[4]=i,e[5]=c,e[6]=x):x=e[6];let b=x,k=YC(!1),_,T;if(e[7]!==b?(_=()=>{k.current||(k.current=!0,b())},T=[b],e[7]=b,e[8]=_,e[9]=T):(_=e[8],T=e[9]),XC(_,T),!a)return typeof s<"u"?s:gt(VC,{});let I={...m,getFormState:async w=>m.getFormState({...w,collectionSlug:h==="collection"?g:void 0,globalSlug:h==="global"?g:void 0})};if(typeof d>"u"&&!u)return gt(tu,{value:{...I},children:gt(eu,{value:L,children:a},L)});let N={disabled:!1,formInitializing:!1,formProcessing:!1,formSubmitted:!1,initialValue:d,path:L,setValue:u??qC,showError:!1,value:d};return gt(tu,{value:{...I},children:gt(eu,{value:L,children:gt(WC,{value:N,children:a})},L)})};function qC(){}function ou({nodes:t,text:e}){let o={root:{type:"root",children:[],direction:"ltr",format:"",indent:0,version:1}};return e&&o.root.children.push({type:"paragraph",children:[{type:"text",detail:0,format:0,mode:"normal",style:"",text:e,version:1}],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),t?.length&&o.root.children.push(...t),o.root.children.length===0&&o.root.children.push({type:"paragraph",children:[],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),o}var QC=ou;export{At as $createAutoLinkNode,Fe as $createBlockNode,je as $createHorizontalRuleNode,Tt as $createInlineBlockNode,_e as $createLinkNode,We as $createRelationshipNode,ye as $createUploadNode,Ee as $isAutoLinkNode,Ie as $isBlockNode,He as $isHorizontalRuleNode,Et as $isInlineBlockNode,X as $isLinkNode,jn as $isRelationshipNode,nt as $isUploadNode,vu as AlignFeatureClient,Te as AutoLinkNode,uC as BlockCollapsible,pC as BlockEditButton,ue as BlockNode,gC as BlockRemoveButton,Pu as BlockquoteFeatureClient,hm as BlocksFeatureClient,Gm as BoldFeatureClient,se as CAN_USE_DOM,x0 as ChecklistFeatureClient,GC as CodeBlockBlockComponent,wC as CodeComponent,W0 as DETAIL_TYPE_TO_DETAIL,H0 as DOUBLE_LINE_BREAK,rh as DebugJsxConverterFeatureClient,K0 as ELEMENT_FORMAT_TO_TYPE,V0 as ELEMENT_TYPE_TO_FORMAT,hu as ENABLE_SLASH_MENU_COMMAND,du as EditorConfigProvider,Ko as FieldsDrawer,H5 as FixedToolbarFeatureClient,nf as HeadingFeatureClient,wf as HorizontalRuleFeatureClient,ke as HorizontalRuleNode,rt as INSERT_BLOCK_COMMAND,lt as INSERT_INLINE_BLOCK_COMMAND,B0 as IS_ALL_FORMATTING,zf as IndentFeatureClient,aC as InlineBlockContainer,Qx as InlineBlockEditButton,lC as InlineBlockLabel,_t as InlineBlockNode,oC as InlineBlockRemoveButton,Xm as InlineCodeFeatureClient,ng as InlineToolbarFeatureClient,op as ItalicFeatureClient,G0 as LTR_REGEX,s0 as LinkFeatureClient,ne as LinkNode,j0 as NON_BREAKING_SPACE,O as NodeFormat,E0 as OrderedListFeatureClient,I0 as ParagraphFeatureClient,pu as Point,z0 as RTL_REGEX,gu as Rect,Yh as RelationshipFeatureClient,we as RelationshipNode,ZC as RenderLexical,zx as RichTextField,Jo as RichTextViewProvider,ap as StrikethroughFeatureClient,pp as SubscriptFeatureClient,Cp as SuperscriptFeatureClient,J0 as TEXT_MODE_TO_TYPE,U0 as TEXT_TYPE_TO_FORMAT,X0 as TEXT_TYPE_TO_MODE,fe as TOGGLE_LINK_COMMAND,tx as TableFeatureClient,Rm as TestRecorderFeatureClient,Dp as TextStateFeatureClient,Bt as ToolbarButton,jt as ToolbarDropdown,Dm as TreeViewFeatureClient,Ep as UnderlineFeatureClient,R0 as UnorderedListFeatureClient,Ix as UploadFeatureClient,ot as UploadNode,Yx as addSwipeDownListener,Kx as addSwipeLeftListener,Jx as addSwipeRightListener,Xx as addSwipeUpListener,QC as buildDefaultEditorState,ou as buildEditorState,Wc as codeConverterClient,Wx as createBlockNode,A as createClientFeature,lh as defaultColors,pr as defaultEditorLexicalConfig,Kn as getDOMRangeRect,xu as getEnabledNodes,CC as getRestPopulateFn,it as getSelectedNode,fu as isPoint,Ux as joinClasses,fr as sanitizeClientEditorConfig,Gc as sanitizeClientFeatures,wo as setFloatingElemPosition,mo as setFloatingElemPositionForLinkEditor,q as slashMenuBasicGroupWithItems,be as toolbarAddDropdownGroupWithItems,_n as toolbarFeatureButtonsGroupWithItems,Q as toolbarFormatGroupWithItems,oe as toolbarTextDropdownGroupWithItems,ae as useBlockComponentContext,U as useEditorConfigContext,xe as useInlineBlockComponentContext,mu as useLexicalDocumentDrawer,De as useLexicalDrawer,Pt as useLexicalListDrawer,Xo as useRichTextView};
65
65
  //# sourceMappingURL=index.js.map