commspliant-html-editor 0.0.4 → 0.0.5

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 (411) hide show
  1. package/README.md +57 -4
  2. package/dist/404.html +19 -0
  3. package/dist/assets/index-8mpvnzOy.js +375 -0
  4. package/dist/{commspliant-html-editor.css → assets/index-Cu8klpl0.css} +1 -1
  5. package/dist/index.html +19 -0
  6. package/dist/logo.svg +314 -0
  7. package/package.json +1 -1
  8. package/dist/chrome/ChromeTheme.d.ts +0 -14
  9. package/dist/chrome/ChromeTheme.d.ts.map +0 -1
  10. package/dist/components/Editor.d.ts +0 -3
  11. package/dist/components/Editor.d.ts.map +0 -1
  12. package/dist/components/HtmlSurface.d.ts +0 -9
  13. package/dist/components/HtmlSurface.d.ts.map +0 -1
  14. package/dist/components/MultiPageVisualSurface.d.ts +0 -22
  15. package/dist/components/MultiPageVisualSurface.d.ts.map +0 -1
  16. package/dist/components/VisualSurface.d.ts +0 -14
  17. package/dist/components/VisualSurface.d.ts.map +0 -1
  18. package/dist/core/audio.d.ts +0 -16
  19. package/dist/core/audio.d.ts.map +0 -1
  20. package/dist/core/blockFormat.d.ts +0 -10
  21. package/dist/core/blockFormat.d.ts.map +0 -1
  22. package/dist/core/blocks.d.ts +0 -19
  23. package/dist/core/blocks.d.ts.map +0 -1
  24. package/dist/core/bookmark.d.ts +0 -10
  25. package/dist/core/bookmark.d.ts.map +0 -1
  26. package/dist/core/cellProperties.d.ts +0 -20
  27. package/dist/core/cellProperties.d.ts.map +0 -1
  28. package/dist/core/clearFormatting.d.ts +0 -2
  29. package/dist/core/clearFormatting.d.ts.map +0 -1
  30. package/dist/core/clipboard.d.ts +0 -9
  31. package/dist/core/clipboard.d.ts.map +0 -1
  32. package/dist/core/commandTypes.d.ts +0 -298
  33. package/dist/core/commandTypes.d.ts.map +0 -1
  34. package/dist/core/commands.d.ts +0 -5
  35. package/dist/core/commands.d.ts.map +0 -1
  36. package/dist/core/cssLength.d.ts +0 -13
  37. package/dist/core/cssLength.d.ts.map +0 -1
  38. package/dist/core/customActions.d.ts +0 -12
  39. package/dist/core/customActions.d.ts.map +0 -1
  40. package/dist/core/customCss.d.ts +0 -15
  41. package/dist/core/customCss.d.ts.map +0 -1
  42. package/dist/core/documentStyles.d.ts +0 -4
  43. package/dist/core/documentStyles.d.ts.map +0 -1
  44. package/dist/core/fontFamily.d.ts +0 -40
  45. package/dist/core/fontFamily.d.ts.map +0 -1
  46. package/dist/core/fontSize.d.ts +0 -25
  47. package/dist/core/fontSize.d.ts.map +0 -1
  48. package/dist/core/fontSizeUnits.d.ts +0 -29
  49. package/dist/core/fontSizeUnits.d.ts.map +0 -1
  50. package/dist/core/formatBrush.d.ts +0 -10
  51. package/dist/core/formatBrush.d.ts.map +0 -1
  52. package/dist/core/horizontalRule.d.ts +0 -4
  53. package/dist/core/horizontalRule.d.ts.map +0 -1
  54. package/dist/core/image.d.ts +0 -19
  55. package/dist/core/image.d.ts.map +0 -1
  56. package/dist/core/imageProperties.d.ts +0 -35
  57. package/dist/core/imageProperties.d.ts.map +0 -1
  58. package/dist/core/imageResize.d.ts +0 -18
  59. package/dist/core/imageResize.d.ts.map +0 -1
  60. package/dist/core/imageSize.d.ts +0 -23
  61. package/dist/core/imageSize.d.ts.map +0 -1
  62. package/dist/core/indent.d.ts +0 -7
  63. package/dist/core/indent.d.ts.map +0 -1
  64. package/dist/core/inlineColor.d.ts +0 -23
  65. package/dist/core/inlineColor.d.ts.map +0 -1
  66. package/dist/core/inlineRange.d.ts +0 -10
  67. package/dist/core/inlineRange.d.ts.map +0 -1
  68. package/dist/core/link.d.ts +0 -18
  69. package/dist/core/link.d.ts.map +0 -1
  70. package/dist/core/lists.d.ts +0 -12
  71. package/dist/core/lists.d.ts.map +0 -1
  72. package/dist/core/marks.d.ts +0 -18
  73. package/dist/core/marks.d.ts.map +0 -1
  74. package/dist/core/multiPage.d.ts +0 -10
  75. package/dist/core/multiPage.d.ts.map +0 -1
  76. package/dist/core/page.d.ts +0 -14
  77. package/dist/core/page.d.ts.map +0 -1
  78. package/dist/core/pageAtRule.d.ts +0 -21
  79. package/dist/core/pageAtRule.d.ts.map +0 -1
  80. package/dist/core/pageBackgroundImage.d.ts +0 -16
  81. package/dist/core/pageBackgroundImage.d.ts.map +0 -1
  82. package/dist/core/pageProperties.d.ts +0 -8
  83. package/dist/core/pageProperties.d.ts.map +0 -1
  84. package/dist/core/paragraphBox.d.ts +0 -82
  85. package/dist/core/paragraphBox.d.ts.map +0 -1
  86. package/dist/core/paragraphProperties.d.ts +0 -17
  87. package/dist/core/paragraphProperties.d.ts.map +0 -1
  88. package/dist/core/readAloud.d.ts +0 -11
  89. package/dist/core/readAloud.d.ts.map +0 -1
  90. package/dist/core/rowProperties.d.ts +0 -17
  91. package/dist/core/rowProperties.d.ts.map +0 -1
  92. package/dist/core/selection.d.ts +0 -25
  93. package/dist/core/selection.d.ts.map +0 -1
  94. package/dist/core/table.d.ts +0 -34
  95. package/dist/core/table.d.ts.map +0 -1
  96. package/dist/core/tableGrid.d.ts +0 -40
  97. package/dist/core/tableGrid.d.ts.map +0 -1
  98. package/dist/core/tableProperties.d.ts +0 -18
  99. package/dist/core/tableProperties.d.ts.map +0 -1
  100. package/dist/core/textAlign.d.ts +0 -9
  101. package/dist/core/textAlign.d.ts.map +0 -1
  102. package/dist/core/youtube.d.ts +0 -20
  103. package/dist/core/youtube.d.ts.map +0 -1
  104. package/dist/hooks/useAutoSave.d.ts +0 -9
  105. package/dist/hooks/useAutoSave.d.ts.map +0 -1
  106. package/dist/hooks/useControllableState.d.ts +0 -8
  107. package/dist/hooks/useControllableState.d.ts.map +0 -1
  108. package/dist/i18n/LocaleProvider.d.ts +0 -11
  109. package/dist/i18n/LocaleProvider.d.ts.map +0 -1
  110. package/dist/i18n/en.d.ts +0 -3
  111. package/dist/i18n/en.d.ts.map +0 -1
  112. package/dist/i18n/es.d.ts +0 -3
  113. package/dist/i18n/es.d.ts.map +0 -1
  114. package/dist/i18n/types.d.ts +0 -428
  115. package/dist/i18n/types.d.ts.map +0 -1
  116. package/dist/icons/AlignCenterIcon.d.ts +0 -3
  117. package/dist/icons/AlignCenterIcon.d.ts.map +0 -1
  118. package/dist/icons/AlignJustifyIcon.d.ts +0 -3
  119. package/dist/icons/AlignJustifyIcon.d.ts.map +0 -1
  120. package/dist/icons/AlignLeftIcon.d.ts +0 -3
  121. package/dist/icons/AlignLeftIcon.d.ts.map +0 -1
  122. package/dist/icons/AlignRightIcon.d.ts +0 -3
  123. package/dist/icons/AlignRightIcon.d.ts.map +0 -1
  124. package/dist/icons/AudioIcon.d.ts +0 -3
  125. package/dist/icons/AudioIcon.d.ts.map +0 -1
  126. package/dist/icons/BoldIcon.d.ts +0 -3
  127. package/dist/icons/BoldIcon.d.ts.map +0 -1
  128. package/dist/icons/BookmarkIcon.d.ts +0 -3
  129. package/dist/icons/BookmarkIcon.d.ts.map +0 -1
  130. package/dist/icons/BulletListIcon.d.ts +0 -3
  131. package/dist/icons/BulletListIcon.d.ts.map +0 -1
  132. package/dist/icons/CellPropertiesIcon.d.ts +0 -3
  133. package/dist/icons/CellPropertiesIcon.d.ts.map +0 -1
  134. package/dist/icons/ClearFormattingIcon.d.ts +0 -3
  135. package/dist/icons/ClearFormattingIcon.d.ts.map +0 -1
  136. package/dist/icons/CloseIcon.d.ts +0 -3
  137. package/dist/icons/CloseIcon.d.ts.map +0 -1
  138. package/dist/icons/CommspliantShieldIcon.d.ts +0 -3
  139. package/dist/icons/CommspliantShieldIcon.d.ts.map +0 -1
  140. package/dist/icons/CustomActionIcon.d.ts +0 -3
  141. package/dist/icons/CustomActionIcon.d.ts.map +0 -1
  142. package/dist/icons/CustomCssIcon.d.ts +0 -3
  143. package/dist/icons/CustomCssIcon.d.ts.map +0 -1
  144. package/dist/icons/CustomizeToolbarIcon.d.ts +0 -3
  145. package/dist/icons/CustomizeToolbarIcon.d.ts.map +0 -1
  146. package/dist/icons/DarkModeIcon.d.ts +0 -3
  147. package/dist/icons/DarkModeIcon.d.ts.map +0 -1
  148. package/dist/icons/FontColorIcon.d.ts +0 -3
  149. package/dist/icons/FontColorIcon.d.ts.map +0 -1
  150. package/dist/icons/FontFamilyIcon.d.ts +0 -3
  151. package/dist/icons/FontFamilyIcon.d.ts.map +0 -1
  152. package/dist/icons/FontPropertiesIcon.d.ts +0 -3
  153. package/dist/icons/FontPropertiesIcon.d.ts.map +0 -1
  154. package/dist/icons/FontSizeIcon.d.ts +0 -3
  155. package/dist/icons/FontSizeIcon.d.ts.map +0 -1
  156. package/dist/icons/FormatBrushIcon.d.ts +0 -3
  157. package/dist/icons/FormatBrushIcon.d.ts.map +0 -1
  158. package/dist/icons/FullscreenIcon.d.ts +0 -3
  159. package/dist/icons/FullscreenIcon.d.ts.map +0 -1
  160. package/dist/icons/HighlightColorIcon.d.ts +0 -3
  161. package/dist/icons/HighlightColorIcon.d.ts.map +0 -1
  162. package/dist/icons/HorizontalRuleIcon.d.ts +0 -3
  163. package/dist/icons/HorizontalRuleIcon.d.ts.map +0 -1
  164. package/dist/icons/HtmlIcon.d.ts +0 -3
  165. package/dist/icons/HtmlIcon.d.ts.map +0 -1
  166. package/dist/icons/ImageIcon.d.ts +0 -3
  167. package/dist/icons/ImageIcon.d.ts.map +0 -1
  168. package/dist/icons/IndentIcon.d.ts +0 -3
  169. package/dist/icons/IndentIcon.d.ts.map +0 -1
  170. package/dist/icons/ItalicIcon.d.ts +0 -3
  171. package/dist/icons/ItalicIcon.d.ts.map +0 -1
  172. package/dist/icons/LightModeIcon.d.ts +0 -3
  173. package/dist/icons/LightModeIcon.d.ts.map +0 -1
  174. package/dist/icons/LinkIcon.d.ts +0 -3
  175. package/dist/icons/LinkIcon.d.ts.map +0 -1
  176. package/dist/icons/MenuIcon.d.ts +0 -3
  177. package/dist/icons/MenuIcon.d.ts.map +0 -1
  178. package/dist/icons/MergeCellsIcon.d.ts +0 -3
  179. package/dist/icons/MergeCellsIcon.d.ts.map +0 -1
  180. package/dist/icons/NumberedListIcon.d.ts +0 -3
  181. package/dist/icons/NumberedListIcon.d.ts.map +0 -1
  182. package/dist/icons/OpenIcon.d.ts +0 -3
  183. package/dist/icons/OpenIcon.d.ts.map +0 -1
  184. package/dist/icons/OutdentIcon.d.ts +0 -3
  185. package/dist/icons/OutdentIcon.d.ts.map +0 -1
  186. package/dist/icons/PagePropertiesIcon.d.ts +0 -3
  187. package/dist/icons/PagePropertiesIcon.d.ts.map +0 -1
  188. package/dist/icons/ParagraphPropertiesIcon.d.ts +0 -3
  189. package/dist/icons/ParagraphPropertiesIcon.d.ts.map +0 -1
  190. package/dist/icons/ParagraphStyleIcon.d.ts +0 -3
  191. package/dist/icons/ParagraphStyleIcon.d.ts.map +0 -1
  192. package/dist/icons/PlusIcon.d.ts +0 -3
  193. package/dist/icons/PlusIcon.d.ts.map +0 -1
  194. package/dist/icons/PreviewIcon.d.ts +0 -3
  195. package/dist/icons/PreviewIcon.d.ts.map +0 -1
  196. package/dist/icons/PrintIcon.d.ts +0 -3
  197. package/dist/icons/PrintIcon.d.ts.map +0 -1
  198. package/dist/icons/ReadAloudIcon.d.ts +0 -3
  199. package/dist/icons/ReadAloudIcon.d.ts.map +0 -1
  200. package/dist/icons/RedoIcon.d.ts +0 -3
  201. package/dist/icons/RedoIcon.d.ts.map +0 -1
  202. package/dist/icons/RowPropertiesIcon.d.ts +0 -3
  203. package/dist/icons/RowPropertiesIcon.d.ts.map +0 -1
  204. package/dist/icons/SaveIcon.d.ts +0 -3
  205. package/dist/icons/SaveIcon.d.ts.map +0 -1
  206. package/dist/icons/StrikethroughIcon.d.ts +0 -3
  207. package/dist/icons/StrikethroughIcon.d.ts.map +0 -1
  208. package/dist/icons/TableColumnIcon.d.ts +0 -3
  209. package/dist/icons/TableColumnIcon.d.ts.map +0 -1
  210. package/dist/icons/TableIcon.d.ts +0 -3
  211. package/dist/icons/TableIcon.d.ts.map +0 -1
  212. package/dist/icons/TableRowIcon.d.ts +0 -3
  213. package/dist/icons/TableRowIcon.d.ts.map +0 -1
  214. package/dist/icons/UnderlineIcon.d.ts +0 -3
  215. package/dist/icons/UnderlineIcon.d.ts.map +0 -1
  216. package/dist/icons/UndoIcon.d.ts +0 -3
  217. package/dist/icons/UndoIcon.d.ts.map +0 -1
  218. package/dist/icons/UnmergeCellsIcon.d.ts +0 -3
  219. package/dist/icons/UnmergeCellsIcon.d.ts.map +0 -1
  220. package/dist/icons/VisualIcon.d.ts +0 -3
  221. package/dist/icons/VisualIcon.d.ts.map +0 -1
  222. package/dist/icons/YoutubeIcon.d.ts +0 -3
  223. package/dist/icons/YoutubeIcon.d.ts.map +0 -1
  224. package/dist/icons/index.d.ts +0 -56
  225. package/dist/icons/index.d.ts.map +0 -1
  226. package/dist/icons/types.d.ts +0 -4
  227. package/dist/icons/types.d.ts.map +0 -1
  228. package/dist/index.cjs +0 -96
  229. package/dist/index.d.ts +0 -5
  230. package/dist/index.d.ts.map +0 -1
  231. package/dist/index.js +0 -17163
  232. package/dist/modules/contextMenu/ContextMenu.d.ts +0 -15
  233. package/dist/modules/contextMenu/ContextMenu.d.ts.map +0 -1
  234. package/dist/modules/contextMenu/commands.d.ts +0 -3
  235. package/dist/modules/contextMenu/commands.d.ts.map +0 -1
  236. package/dist/modules/contextMenu/index.d.ts +0 -5
  237. package/dist/modules/contextMenu/index.d.ts.map +0 -1
  238. package/dist/modules/contextMenu/shouldOpenEditorContextMenu.d.ts +0 -6
  239. package/dist/modules/contextMenu/shouldOpenEditorContextMenu.d.ts.map +0 -1
  240. package/dist/modules/file/catalog.d.ts +0 -3
  241. package/dist/modules/file/catalog.d.ts.map +0 -1
  242. package/dist/modules/file/commands.d.ts +0 -3
  243. package/dist/modules/file/commands.d.ts.map +0 -1
  244. package/dist/modules/file/fileDialogs.d.ts +0 -3
  245. package/dist/modules/file/fileDialogs.d.ts.map +0 -1
  246. package/dist/modules/file/htmlFile.d.ts +0 -5
  247. package/dist/modules/file/htmlFile.d.ts.map +0 -1
  248. package/dist/modules/file/index.d.ts +0 -4
  249. package/dist/modules/file/index.d.ts.map +0 -1
  250. package/dist/modules/file/printHtml.d.ts +0 -3
  251. package/dist/modules/file/printHtml.d.ts.map +0 -1
  252. package/dist/modules/file/useHtmlFileDrop.d.ts +0 -14
  253. package/dist/modules/file/useHtmlFileDrop.d.ts.map +0 -1
  254. package/dist/modules/format/ColorField.d.ts +0 -11
  255. package/dist/modules/format/ColorField.d.ts.map +0 -1
  256. package/dist/modules/format/ColorPicker.d.ts +0 -13
  257. package/dist/modules/format/ColorPicker.d.ts.map +0 -1
  258. package/dist/modules/format/ColorSelect.d.ts +0 -16
  259. package/dist/modules/format/ColorSelect.d.ts.map +0 -1
  260. package/dist/modules/format/CustomCssDialog.d.ts +0 -9
  261. package/dist/modules/format/CustomCssDialog.d.ts.map +0 -1
  262. package/dist/modules/format/CustomParagraphStyleDialog.d.ts +0 -21
  263. package/dist/modules/format/CustomParagraphStyleDialog.d.ts.map +0 -1
  264. package/dist/modules/format/FontColorSelect.d.ts +0 -3
  265. package/dist/modules/format/FontColorSelect.d.ts.map +0 -1
  266. package/dist/modules/format/FontFamilyList.d.ts +0 -16
  267. package/dist/modules/format/FontFamilyList.d.ts.map +0 -1
  268. package/dist/modules/format/FontFamilySelect.d.ts +0 -15
  269. package/dist/modules/format/FontFamilySelect.d.ts.map +0 -1
  270. package/dist/modules/format/FontPropertiesDialog.d.ts +0 -24
  271. package/dist/modules/format/FontPropertiesDialog.d.ts.map +0 -1
  272. package/dist/modules/format/FontPropertiesFields.d.ts +0 -12
  273. package/dist/modules/format/FontPropertiesFields.d.ts.map +0 -1
  274. package/dist/modules/format/FontSizeCombobox.d.ts +0 -13
  275. package/dist/modules/format/FontSizeCombobox.d.ts.map +0 -1
  276. package/dist/modules/format/FontSizeSelect.d.ts +0 -3
  277. package/dist/modules/format/FontSizeSelect.d.ts.map +0 -1
  278. package/dist/modules/format/HighlightColorSelect.d.ts +0 -4
  279. package/dist/modules/format/HighlightColorSelect.d.ts.map +0 -1
  280. package/dist/modules/format/LengthField.d.ts +0 -12
  281. package/dist/modules/format/LengthField.d.ts.map +0 -1
  282. package/dist/modules/format/PageAtRuleFields.d.ts +0 -9
  283. package/dist/modules/format/PageAtRuleFields.d.ts.map +0 -1
  284. package/dist/modules/format/PageBackgroundImageFields.d.ts +0 -11
  285. package/dist/modules/format/PageBackgroundImageFields.d.ts.map +0 -1
  286. package/dist/modules/format/PagePropertiesDialog.d.ts +0 -18
  287. package/dist/modules/format/PagePropertiesDialog.d.ts.map +0 -1
  288. package/dist/modules/format/ParagraphPropertiesDialog.d.ts +0 -12
  289. package/dist/modules/format/ParagraphPropertiesDialog.d.ts.map +0 -1
  290. package/dist/modules/format/ParagraphPropertiesFields.d.ts +0 -19
  291. package/dist/modules/format/ParagraphPropertiesFields.d.ts.map +0 -1
  292. package/dist/modules/format/ParagraphStyleList.d.ts +0 -22
  293. package/dist/modules/format/ParagraphStyleList.d.ts.map +0 -1
  294. package/dist/modules/format/ParagraphStyleSelect.d.ts +0 -4
  295. package/dist/modules/format/ParagraphStyleSelect.d.ts.map +0 -1
  296. package/dist/modules/format/ShadowFields.d.ts +0 -8
  297. package/dist/modules/format/ShadowFields.d.ts.map +0 -1
  298. package/dist/modules/format/catalog.d.ts +0 -3
  299. package/dist/modules/format/catalog.d.ts.map +0 -1
  300. package/dist/modules/format/colorModel.d.ts +0 -22
  301. package/dist/modules/format/colorModel.d.ts.map +0 -1
  302. package/dist/modules/format/colorPalette.d.ts +0 -3
  303. package/dist/modules/format/colorPalette.d.ts.map +0 -1
  304. package/dist/modules/format/commands.d.ts +0 -4
  305. package/dist/modules/format/commands.d.ts.map +0 -1
  306. package/dist/modules/format/fontDialog.d.ts +0 -9
  307. package/dist/modules/format/fontDialog.d.ts.map +0 -1
  308. package/dist/modules/format/fontSize.d.ts +0 -2
  309. package/dist/modules/format/fontSize.d.ts.map +0 -1
  310. package/dist/modules/format/index.d.ts +0 -3
  311. package/dist/modules/format/index.d.ts.map +0 -1
  312. package/dist/modules/format/pageDialog.d.ts +0 -9
  313. package/dist/modules/format/pageDialog.d.ts.map +0 -1
  314. package/dist/modules/format/paragraphDialog.d.ts +0 -9
  315. package/dist/modules/format/paragraphDialog.d.ts.map +0 -1
  316. package/dist/modules/history/catalog.d.ts +0 -3
  317. package/dist/modules/history/catalog.d.ts.map +0 -1
  318. package/dist/modules/history/commands.d.ts +0 -4
  319. package/dist/modules/history/commands.d.ts.map +0 -1
  320. package/dist/modules/history/history.d.ts +0 -17
  321. package/dist/modules/history/history.d.ts.map +0 -1
  322. package/dist/modules/history/index.d.ts +0 -5
  323. package/dist/modules/history/index.d.ts.map +0 -1
  324. package/dist/modules/insert/AudioDialog.d.ts +0 -12
  325. package/dist/modules/insert/AudioDialog.d.ts.map +0 -1
  326. package/dist/modules/insert/BookmarkDialog.d.ts +0 -9
  327. package/dist/modules/insert/BookmarkDialog.d.ts.map +0 -1
  328. package/dist/modules/insert/ImageAdvancedFields.d.ts +0 -15
  329. package/dist/modules/insert/ImageAdvancedFields.d.ts.map +0 -1
  330. package/dist/modules/insert/ImageDialog.d.ts +0 -12
  331. package/dist/modules/insert/ImageDialog.d.ts.map +0 -1
  332. package/dist/modules/insert/ImagePropertiesDialog.d.ts +0 -13
  333. package/dist/modules/insert/ImagePropertiesDialog.d.ts.map +0 -1
  334. package/dist/modules/insert/ImagePropertiesFields.d.ts +0 -11
  335. package/dist/modules/insert/ImagePropertiesFields.d.ts.map +0 -1
  336. package/dist/modules/insert/ImageResizeOverlay.d.ts +0 -7
  337. package/dist/modules/insert/ImageResizeOverlay.d.ts.map +0 -1
  338. package/dist/modules/insert/ImageSizeField.d.ts +0 -10
  339. package/dist/modules/insert/ImageSizeField.d.ts.map +0 -1
  340. package/dist/modules/insert/ImageSourcePicker.d.ts +0 -14
  341. package/dist/modules/insert/ImageSourcePicker.d.ts.map +0 -1
  342. package/dist/modules/insert/LinkDialog.d.ts +0 -22
  343. package/dist/modules/insert/LinkDialog.d.ts.map +0 -1
  344. package/dist/modules/insert/YoutubeDialog.d.ts +0 -12
  345. package/dist/modules/insert/YoutubeDialog.d.ts.map +0 -1
  346. package/dist/modules/insert/catalog.d.ts +0 -3
  347. package/dist/modules/insert/catalog.d.ts.map +0 -1
  348. package/dist/modules/insert/commands.d.ts +0 -4
  349. package/dist/modules/insert/commands.d.ts.map +0 -1
  350. package/dist/modules/insert/imagePropertiesDialog.d.ts +0 -9
  351. package/dist/modules/insert/imagePropertiesDialog.d.ts.map +0 -1
  352. package/dist/modules/insert/index.d.ts +0 -3
  353. package/dist/modules/insert/index.d.ts.map +0 -1
  354. package/dist/modules/table/CellPropertiesDialog.d.ts +0 -10
  355. package/dist/modules/table/CellPropertiesDialog.d.ts.map +0 -1
  356. package/dist/modules/table/CellPropertiesFields.d.ts +0 -8
  357. package/dist/modules/table/CellPropertiesFields.d.ts.map +0 -1
  358. package/dist/modules/table/RowPropertiesDialog.d.ts +0 -10
  359. package/dist/modules/table/RowPropertiesDialog.d.ts.map +0 -1
  360. package/dist/modules/table/RowPropertiesFields.d.ts +0 -8
  361. package/dist/modules/table/RowPropertiesFields.d.ts.map +0 -1
  362. package/dist/modules/table/TableDialog.d.ts +0 -9
  363. package/dist/modules/table/TableDialog.d.ts.map +0 -1
  364. package/dist/modules/table/TablePropertiesDialog.d.ts +0 -10
  365. package/dist/modules/table/TablePropertiesDialog.d.ts.map +0 -1
  366. package/dist/modules/table/TablePropertiesFields.d.ts +0 -8
  367. package/dist/modules/table/TablePropertiesFields.d.ts.map +0 -1
  368. package/dist/modules/table/catalog.d.ts +0 -3
  369. package/dist/modules/table/catalog.d.ts.map +0 -1
  370. package/dist/modules/table/commands.d.ts +0 -4
  371. package/dist/modules/table/commands.d.ts.map +0 -1
  372. package/dist/modules/table/index.d.ts +0 -3
  373. package/dist/modules/table/index.d.ts.map +0 -1
  374. package/dist/modules/view/DocumentPreviewDialog.d.ts +0 -7
  375. package/dist/modules/view/DocumentPreviewDialog.d.ts.map +0 -1
  376. package/dist/modules/view/catalog.d.ts +0 -3
  377. package/dist/modules/view/catalog.d.ts.map +0 -1
  378. package/dist/modules/view/commands.d.ts +0 -4
  379. package/dist/modules/view/commands.d.ts.map +0 -1
  380. package/dist/modules/view/darkModePersistence.d.ts +0 -5
  381. package/dist/modules/view/darkModePersistence.d.ts.map +0 -1
  382. package/dist/modules/view/index.d.ts +0 -3
  383. package/dist/modules/view/index.d.ts.map +0 -1
  384. package/dist/modules/view/toolbarPositionPersistence.d.ts +0 -6
  385. package/dist/modules/view/toolbarPositionPersistence.d.ts.map +0 -1
  386. package/dist/toolbar/CustomizeToolbarDialog.d.ts +0 -16
  387. package/dist/toolbar/CustomizeToolbarDialog.d.ts.map +0 -1
  388. package/dist/toolbar/EditorToolbar.d.ts +0 -16
  389. package/dist/toolbar/EditorToolbar.d.ts.map +0 -1
  390. package/dist/toolbar/IconNav.d.ts +0 -12
  391. package/dist/toolbar/IconNav.d.ts.map +0 -1
  392. package/dist/toolbar/MenuBar.d.ts +0 -18
  393. package/dist/toolbar/MenuBar.d.ts.map +0 -1
  394. package/dist/toolbar/Tooltip.d.ts +0 -11
  395. package/dist/toolbar/Tooltip.d.ts.map +0 -1
  396. package/dist/toolbar/allowedChrome.d.ts +0 -4
  397. package/dist/toolbar/allowedChrome.d.ts.map +0 -1
  398. package/dist/toolbar/defaultCatalog.d.ts +0 -4
  399. package/dist/toolbar/defaultCatalog.d.ts.map +0 -1
  400. package/dist/toolbar/defaultLayout.d.ts +0 -3
  401. package/dist/toolbar/defaultLayout.d.ts.map +0 -1
  402. package/dist/toolbar/index.d.ts +0 -10
  403. package/dist/toolbar/index.d.ts.map +0 -1
  404. package/dist/toolbar/resolveChrome.d.ts +0 -12
  405. package/dist/toolbar/resolveChrome.d.ts.map +0 -1
  406. package/dist/toolbar/toolbarCustomization.d.ts +0 -14
  407. package/dist/toolbar/toolbarCustomization.d.ts.map +0 -1
  408. package/dist/toolbar/types.d.ts +0 -65
  409. package/dist/toolbar/types.d.ts.map +0 -1
  410. package/dist/types.d.ts +0 -344
  411. package/dist/types.d.ts.map +0 -1
@@ -0,0 +1,375 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const m of c.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function o(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(s){if(s.ep)return;s.ep=!0;const c=o(s);fetch(s.href,c)}})();var em={exports:{}},Ns={},tm={exports:{}},Fe={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Eh;function lx(){if(Eh)return Fe;Eh=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),m=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),S=Symbol.iterator;function E(M){return M===null||typeof M!="object"?null:(M=S&&M[S]||M["@@iterator"],typeof M=="function"?M:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,P={};function T(M,N,re){this.props=M,this.context=N,this.refs=P,this.updater=re||k}T.prototype.isReactComponent={},T.prototype.setState=function(M,N){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,N,"setState")},T.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function j(){}j.prototype=T.prototype;function F(M,N,re){this.props=M,this.context=N,this.refs=P,this.updater=re||k}var L=F.prototype=new j;L.constructor=F,A(L,T.prototype),L.isPureReactComponent=!0;var H=Array.isArray,z=Object.prototype.hasOwnProperty,q={current:null},G={key:!0,ref:!0,__self:!0,__source:!0};function Q(M,N,re){var fe,ae={},Ce=null,Re=null;if(N!=null)for(fe in N.ref!==void 0&&(Re=N.ref),N.key!==void 0&&(Ce=""+N.key),N)z.call(N,fe)&&!G.hasOwnProperty(fe)&&(ae[fe]=N[fe]);var De=arguments.length-2;if(De===1)ae.children=re;else if(1<De){for(var Be=Array(De),Qe=0;Qe<De;Qe++)Be[Qe]=arguments[Qe+2];ae.children=Be}if(M&&M.defaultProps)for(fe in De=M.defaultProps,De)ae[fe]===void 0&&(ae[fe]=De[fe]);return{$$typeof:e,type:M,key:Ce,ref:Re,props:ae,_owner:q.current}}function $(M,N){return{$$typeof:e,type:M.type,key:N,ref:M.ref,props:M.props,_owner:M._owner}}function V(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function K(M){var N={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(re){return N[re]})}var X=/\/+/g;function de(M,N){return typeof M=="object"&&M!==null&&M.key!=null?K(""+M.key):N.toString(36)}function ce(M,N,re,fe,ae){var Ce=typeof M;(Ce==="undefined"||Ce==="boolean")&&(M=null);var Re=!1;if(M===null)Re=!0;else switch(Ce){case"string":case"number":Re=!0;break;case"object":switch(M.$$typeof){case e:case n:Re=!0}}if(Re)return Re=M,ae=ae(Re),M=fe===""?"."+de(Re,0):fe,H(ae)?(re="",M!=null&&(re=M.replace(X,"$&/")+"/"),ce(ae,N,re,"",function(Qe){return Qe})):ae!=null&&(V(ae)&&(ae=$(ae,re+(!ae.key||Re&&Re.key===ae.key?"":(""+ae.key).replace(X,"$&/")+"/")+M)),N.push(ae)),1;if(Re=0,fe=fe===""?".":fe+":",H(M))for(var De=0;De<M.length;De++){Ce=M[De];var Be=fe+de(Ce,De);Re+=ce(Ce,N,re,Be,ae)}else if(Be=E(M),typeof Be=="function")for(M=Be.call(M),De=0;!(Ce=M.next()).done;)Ce=Ce.value,Be=fe+de(Ce,De++),Re+=ce(Ce,N,re,Be,ae);else if(Ce==="object")throw N=String(M),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.");return Re}function Pe(M,N,re){if(M==null)return M;var fe=[],ae=0;return ce(M,fe,"","",function(Ce){return N.call(re,Ce,ae++)}),fe}function ke(M){if(M._status===-1){var N=M._result;N=N(),N.then(function(re){(M._status===0||M._status===-1)&&(M._status=1,M._result=re)},function(re){(M._status===0||M._status===-1)&&(M._status=2,M._result=re)}),M._status===-1&&(M._status=0,M._result=N)}if(M._status===1)return M._result.default;throw M._result}var je={current:null},Y={transition:null},pe={ReactCurrentDispatcher:je,ReactCurrentBatchConfig:Y,ReactCurrentOwner:q};function J(){throw Error("act(...) is not supported in production builds of React.")}return Fe.Children={map:Pe,forEach:function(M,N,re){Pe(M,function(){N.apply(this,arguments)},re)},count:function(M){var N=0;return Pe(M,function(){N++}),N},toArray:function(M){return Pe(M,function(N){return N})||[]},only:function(M){if(!V(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Fe.Component=T,Fe.Fragment=o,Fe.Profiler=s,Fe.PureComponent=F,Fe.StrictMode=a,Fe.Suspense=y,Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pe,Fe.act=J,Fe.cloneElement=function(M,N,re){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var fe=A({},M.props),ae=M.key,Ce=M.ref,Re=M._owner;if(N!=null){if(N.ref!==void 0&&(Ce=N.ref,Re=q.current),N.key!==void 0&&(ae=""+N.key),M.type&&M.type.defaultProps)var De=M.type.defaultProps;for(Be in N)z.call(N,Be)&&!G.hasOwnProperty(Be)&&(fe[Be]=N[Be]===void 0&&De!==void 0?De[Be]:N[Be])}var Be=arguments.length-2;if(Be===1)fe.children=re;else if(1<Be){De=Array(Be);for(var Qe=0;Qe<Be;Qe++)De[Qe]=arguments[Qe+2];fe.children=De}return{$$typeof:e,type:M.type,key:ae,ref:Ce,props:fe,_owner:Re}},Fe.createContext=function(M){return M={$$typeof:m,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:c,_context:M},M.Consumer=M},Fe.createElement=Q,Fe.createFactory=function(M){var N=Q.bind(null,M);return N.type=M,N},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(M){return{$$typeof:g,render:M}},Fe.isValidElement=V,Fe.lazy=function(M){return{$$typeof:C,_payload:{_status:-1,_result:M},_init:ke}},Fe.memo=function(M,N){return{$$typeof:w,type:M,compare:N===void 0?null:N}},Fe.startTransition=function(M){var N=Y.transition;Y.transition={};try{M()}finally{Y.transition=N}},Fe.unstable_act=J,Fe.useCallback=function(M,N){return je.current.useCallback(M,N)},Fe.useContext=function(M){return je.current.useContext(M)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(M){return je.current.useDeferredValue(M)},Fe.useEffect=function(M,N){return je.current.useEffect(M,N)},Fe.useId=function(){return je.current.useId()},Fe.useImperativeHandle=function(M,N,re){return je.current.useImperativeHandle(M,N,re)},Fe.useInsertionEffect=function(M,N){return je.current.useInsertionEffect(M,N)},Fe.useLayoutEffect=function(M,N){return je.current.useLayoutEffect(M,N)},Fe.useMemo=function(M,N){return je.current.useMemo(M,N)},Fe.useReducer=function(M,N,re){return je.current.useReducer(M,N,re)},Fe.useRef=function(M){return je.current.useRef(M)},Fe.useState=function(M){return je.current.useState(M)},Fe.useSyncExternalStore=function(M,N,re){return je.current.useSyncExternalStore(M,N,re)},Fe.useTransition=function(){return je.current.useTransition()},Fe.version="18.3.1",Fe}var Ah;function Zm(){return Ah||(Ah=1,tm.exports=lx()),tm.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Dh;function sx(){if(Dh)return Ns;Dh=1;var e=Zm(),n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function m(g,y,w){var C,S={},E=null,k=null;w!==void 0&&(E=""+w),y.key!==void 0&&(E=""+y.key),y.ref!==void 0&&(k=y.ref);for(C in y)a.call(y,C)&&!c.hasOwnProperty(C)&&(S[C]=y[C]);if(g&&g.defaultProps)for(C in y=g.defaultProps,y)S[C]===void 0&&(S[C]=y[C]);return{$$typeof:n,type:g,key:E,ref:k,props:S,_owner:s.current}}return Ns.Fragment=o,Ns.jsx=m,Ns.jsxs=m,Ns}var Th;function ux(){return Th||(Th=1,em.exports=sx()),em.exports}var l=ux(),f=Zm(),Xu={},nm={exports:{}},hn={},rm={exports:{}},om={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var jh;function cx(){return jh||(jh=1,(function(e){function n(Y,pe){var J=Y.length;Y.push(pe);e:for(;0<J;){var M=J-1>>>1,N=Y[M];if(0<s(N,pe))Y[M]=pe,Y[J]=N,J=M;else break e}}function o(Y){return Y.length===0?null:Y[0]}function a(Y){if(Y.length===0)return null;var pe=Y[0],J=Y.pop();if(J!==pe){Y[0]=J;e:for(var M=0,N=Y.length,re=N>>>1;M<re;){var fe=2*(M+1)-1,ae=Y[fe],Ce=fe+1,Re=Y[Ce];if(0>s(ae,J))Ce<N&&0>s(Re,ae)?(Y[M]=Re,Y[Ce]=J,M=Ce):(Y[M]=ae,Y[fe]=J,M=fe);else if(Ce<N&&0>s(Re,J))Y[M]=Re,Y[Ce]=J,M=Ce;else break e}}return pe}function s(Y,pe){var J=Y.sortIndex-pe.sortIndex;return J!==0?J:Y.id-pe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var m=Date,g=m.now();e.unstable_now=function(){return m.now()-g}}var y=[],w=[],C=1,S=null,E=3,k=!1,A=!1,P=!1,T=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function L(Y){for(var pe=o(w);pe!==null;){if(pe.callback===null)a(w);else if(pe.startTime<=Y)a(w),pe.sortIndex=pe.expirationTime,n(y,pe);else break;pe=o(w)}}function H(Y){if(P=!1,L(Y),!A)if(o(y)!==null)A=!0,ke(z);else{var pe=o(w);pe!==null&&je(H,pe.startTime-Y)}}function z(Y,pe){A=!1,P&&(P=!1,j(Q),Q=-1),k=!0;var J=E;try{for(L(pe),S=o(y);S!==null&&(!(S.expirationTime>pe)||Y&&!K());){var M=S.callback;if(typeof M=="function"){S.callback=null,E=S.priorityLevel;var N=M(S.expirationTime<=pe);pe=e.unstable_now(),typeof N=="function"?S.callback=N:S===o(y)&&a(y),L(pe)}else a(y);S=o(y)}if(S!==null)var re=!0;else{var fe=o(w);fe!==null&&je(H,fe.startTime-pe),re=!1}return re}finally{S=null,E=J,k=!1}}var q=!1,G=null,Q=-1,$=5,V=-1;function K(){return!(e.unstable_now()-V<$)}function X(){if(G!==null){var Y=e.unstable_now();V=Y;var pe=!0;try{pe=G(!0,Y)}finally{pe?de():(q=!1,G=null)}}else q=!1}var de;if(typeof F=="function")de=function(){F(X)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Pe=ce.port2;ce.port1.onmessage=X,de=function(){Pe.postMessage(null)}}else de=function(){T(X,0)};function ke(Y){G=Y,q||(q=!0,de())}function je(Y,pe){Q=T(function(){Y(e.unstable_now())},pe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Y){Y.callback=null},e.unstable_continueExecution=function(){A||k||(A=!0,ke(z))},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return E},e.unstable_getFirstCallbackNode=function(){return o(y)},e.unstable_next=function(Y){switch(E){case 1:case 2:case 3:var pe=3;break;default:pe=E}var J=E;E=pe;try{return Y()}finally{E=J}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Y,pe){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var J=E;E=Y;try{return pe()}finally{E=J}},e.unstable_scheduleCallback=function(Y,pe,J){var M=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?M+J:M):J=M,Y){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=J+N,Y={id:C++,callback:pe,priorityLevel:Y,startTime:J,expirationTime:N,sortIndex:-1},J>M?(Y.sortIndex=J,n(w,Y),o(y)===null&&Y===o(w)&&(P?(j(Q),Q=-1):P=!0,je(H,J-M))):(Y.sortIndex=N,n(y,Y),A||k||(A=!0,ke(z))),Y},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(Y){var pe=E;return function(){var J=E;E=pe;try{return Y.apply(this,arguments)}finally{E=J}}}})(om)),om}var Nh;function dx(){return Nh||(Nh=1,rm.exports=cx()),rm.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Rh;function mx(){if(Rh)return hn;Rh=1;var e=Zm(),n=dx();function o(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,s={};function c(t,r){m(t,r),m(t+"Capture",r)}function m(t,r){for(s[t]=r,t=0;t<r.length;t++)a.add(r[t])}var g=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,w=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,C={},S={};function E(t){return y.call(S,t)?!0:y.call(C,t)?!1:w.test(t)?S[t]=!0:(C[t]=!0,!1)}function k(t,r,i,u){if(i!==null&&i.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return u?!1:i!==null?!i.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function A(t,r,i,u){if(r===null||typeof r>"u"||k(t,r,i,u))return!0;if(u)return!1;if(i!==null)switch(i.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function P(t,r,i,u,d,p,x){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=u,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=t,this.type=r,this.sanitizeURL=p,this.removeEmptyString=x}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){T[t]=new P(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];T[r]=new P(r,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){T[t]=new P(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){T[t]=new P(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){T[t]=new P(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){T[t]=new P(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){T[t]=new P(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){T[t]=new P(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){T[t]=new P(t,5,!1,t.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function F(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var r=t.replace(j,F);T[r]=new P(r,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(j,F);T[r]=new P(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(j,F);T[r]=new P(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){T[t]=new P(t,1,!1,t.toLowerCase(),null,!1,!1)}),T.xlinkHref=new P("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){T[t]=new P(t,1,!1,t.toLowerCase(),null,!0,!0)});function L(t,r,i,u){var d=T.hasOwnProperty(r)?T[r]:null;(d!==null?d.type!==0:u||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(A(r,i,d,u)&&(i=null),u||d===null?E(r)&&(i===null?t.removeAttribute(r):t.setAttribute(r,""+i)):d.mustUseProperty?t[d.propertyName]=i===null?d.type===3?!1:"":i:(r=d.attributeName,u=d.attributeNamespace,i===null?t.removeAttribute(r):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,u?t.setAttributeNS(u,r,i):t.setAttribute(r,i))))}var H=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,z=Symbol.for("react.element"),q=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),K=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),ce=Symbol.for("react.suspense_list"),Pe=Symbol.for("react.memo"),ke=Symbol.for("react.lazy"),je=Symbol.for("react.offscreen"),Y=Symbol.iterator;function pe(t){return t===null||typeof t!="object"?null:(t=Y&&t[Y]||t["@@iterator"],typeof t=="function"?t:null)}var J=Object.assign,M;function N(t){if(M===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);M=r&&r[1]||""}return`
34
+ `+M+t}var re=!1;function fe(t,r){if(!t||re)return"";re=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(W){var u=W}Reflect.construct(t,[],r)}else{try{r.call()}catch(W){u=W}t.call(r.prototype)}else{try{throw Error()}catch(W){u=W}t()}}catch(W){if(W&&u&&typeof W.stack=="string"){for(var d=W.stack.split(`
35
+ `),p=u.stack.split(`
36
+ `),x=d.length-1,D=p.length-1;1<=x&&0<=D&&d[x]!==p[D];)D--;for(;1<=x&&0<=D;x--,D--)if(d[x]!==p[D]){if(x!==1||D!==1)do if(x--,D--,0>D||d[x]!==p[D]){var R=`
37
+ `+d[x].replace(" at new "," at ");return t.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",t.displayName)),R}while(1<=x&&0<=D);break}}}finally{re=!1,Error.prepareStackTrace=i}return(t=t?t.displayName||t.name:"")?N(t):""}function ae(t){switch(t.tag){case 5:return N(t.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return t=fe(t.type,!1),t;case 11:return t=fe(t.type.render,!1),t;case 1:return t=fe(t.type,!0),t;default:return""}}function Ce(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case G:return"Fragment";case q:return"Portal";case $:return"Profiler";case Q:return"StrictMode";case de:return"Suspense";case ce:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case K:return(t.displayName||"Context")+".Consumer";case V:return(t._context.displayName||"Context")+".Provider";case X:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Pe:return r=t.displayName||null,r!==null?r:Ce(t.type)||"Memo";case ke:r=t._payload,t=t._init;try{return Ce(t(r))}catch{}}return null}function Re(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ce(r);case 8:return r===Q?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function De(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Be(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Qe(t){var r=Be(t)?"checked":"value",i=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),u=""+t[r];if(!t.hasOwnProperty(r)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return d.call(this)},set:function(x){u=""+x,p.call(this,x)}}),Object.defineProperty(t,r,{enumerable:i.enumerable}),{getValue:function(){return u},setValue:function(x){u=""+x},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function un(t){t._valueTracker||(t._valueTracker=Qe(t))}function ut(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var i=r.getValue(),u="";return t&&(u=Be(t)?t.checked?"true":"false":t.value),t=u,t!==i?(r.setValue(t),!0):!1}function wn(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function In(t,r){var i=r.checked;return J({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??t._wrapperState.initialChecked})}function Io(t,r){var i=r.defaultValue==null?"":r.defaultValue,u=r.checked!=null?r.checked:r.defaultChecked;i=De(r.value!=null?r.value:i),t._wrapperState={initialChecked:u,initialValue:i,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function oo(t,r){r=r.checked,r!=null&&L(t,"checked",r,!1)}function Le(t,r){oo(t,r);var i=De(r.value),u=r.type;if(i!=null)u==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+i):t.value!==""+i&&(t.value=""+i);else if(u==="submit"||u==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?Fo(t,r.type,i):r.hasOwnProperty("defaultValue")&&Fo(t,r.type,De(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function Cn(t,r,i){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var u=r.type;if(!(u!=="submit"&&u!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,i||r===t.value||(t.value=r),t.defaultValue=r}i=t.name,i!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,i!==""&&(t.name=i)}function Fo(t,r,i){(r!=="number"||wn(t.ownerDocument)!==t)&&(i==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+i&&(t.defaultValue=""+i))}var or=Array.isArray;function ir(t,r,i,u){if(t=t.options,r){r={};for(var d=0;d<i.length;d++)r["$"+i[d]]=!0;for(i=0;i<t.length;i++)d=r.hasOwnProperty("$"+t[i].value),t[i].selected!==d&&(t[i].selected=d),d&&u&&(t[i].defaultSelected=!0)}else{for(i=""+De(i),r=null,d=0;d<t.length;d++){if(t[d].value===i){t[d].selected=!0,u&&(t[d].defaultSelected=!0);return}r!==null||t[d].disabled||(r=t[d])}r!==null&&(r.selected=!0)}}function ot(t,r){if(r.dangerouslySetInnerHTML!=null)throw Error(o(91));return J({},r,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Bo(t,r){var i=r.value;if(i==null){if(i=r.children,r=r.defaultValue,i!=null){if(r!=null)throw Error(o(92));if(or(i)){if(1<i.length)throw Error(o(93));i=i[0]}r=i}r==null&&(r=""),i=r}t._wrapperState={initialValue:De(i)}}function it(t,r){var i=De(r.value),u=De(r.defaultValue);i!=null&&(i=""+i,i!==t.value&&(t.value=i),r.defaultValue==null&&t.defaultValue!==i&&(t.defaultValue=i)),u!=null&&(t.defaultValue=""+u)}function Nr(t){var r=t.textContent;r===t._wrapperState.initialValue&&r!==""&&r!==null&&(t.value=r)}function tn(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Sn(t,r){return t==null||t==="http://www.w3.org/1999/xhtml"?tn(r):t==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Ht,Oo=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,i,u,d){MSApp.execUnsafeLocalFunction(function(){return t(r,i,u,d)})}:t})(function(t,r){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=r;else{for(Ht=Ht||document.createElement("div"),Ht.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=Ht.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function Mt(t,r){if(r){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=r;return}}t.textContent=r}var Ut={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ar=["Webkit","ms","Moz","O"];Object.keys(Ut).forEach(function(t){ar.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),Ut[r]=Ut[t]})});function Fn(t,r,i){return r==null||typeof r=="boolean"||r===""?"":i||typeof r!="number"||r===0||Ut.hasOwnProperty(t)&&Ut[t]?(""+r).trim():r+"px"}function oe(t,r){t=t.style;for(var i in r)if(r.hasOwnProperty(i)){var u=i.indexOf("--")===0,d=Fn(i,r[i],u);i==="float"&&(i="cssFloat"),u?t.setProperty(i,d):t[i]=d}}var io=J({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ft(t,r){if(r){if(io[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(o(137,t));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(o(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(o(61))}if(r.style!=null&&typeof r.style!="object")throw Error(o(62))}}function wt(t,r){if(t.indexOf("-")===-1)return typeof r.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kn=null;function We(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Bn=null,Pn=null,Kt=null;function B(t){if(t=wo(t)){if(typeof Bn!="function")throw Error(o(280));var r=t.stateNode;r&&(r=Qa(r),Bn(t.stateNode,t.type,r))}}function Rr(t){Pn?Kt?Kt.push(t):Kt=[t]:Pn=t}function Ri(){if(Pn){var t=Pn,r=Kt;if(Kt=Pn=null,B(t),r)for(t=0;t<r.length;t++)B(r[t])}}function lr(t,r){return t(r)}function zo(){}var At=!1;function Je(t,r,i){if(At)return t(r,i);At=!0;try{return lr(t,r,i)}finally{At=!1,(Pn!==null||Kt!==null)&&(zo(),Ri())}}function On(t,r){var i=t.stateNode;if(i===null)return null;var u=Qa(i);if(u===null)return null;i=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(o(231,r,typeof i));return i}var ao=!1;if(g)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){ao=!0}}),window.addEventListener("test",cn,cn),window.removeEventListener("test",cn,cn)}catch{ao=!1}function ue(t,r,i,u,d,p,x,D,R){var W=Array.prototype.slice.call(arguments,3);try{r.apply(i,W)}catch(ee){this.onError(ee)}}var Lr=!1,tt=null,Ho=!1,sr=null,Uo={onError:function(t){Lr=!0,tt=t}};function $t(t,r,i,u,d,p,x,D,R){Lr=!1,tt=null,ue.apply(Uo,arguments)}function _t(t,r,i,u,d,p,x,D,R){if($t.apply(this,arguments),Lr){if(Lr){var W=tt;Lr=!1,tt=null}else throw Error(o(198));Ho||(Ho=!0,sr=W)}}function ct(t){var r=t,i=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(i=r.return),t=r.return;while(t)}return r.tag===3?i:null}function Vt(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function Wt(t){if(ct(t)!==t)throw Error(o(188))}function zn(t){var r=t.alternate;if(!r){if(r=ct(t),r===null)throw Error(o(188));return r!==t?null:t}for(var i=t,u=r;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(u=d.return,u!==null){i=u;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return Wt(d),t;if(p===u)return Wt(d),r;p=p.sibling}throw Error(o(188))}if(i.return!==u.return)i=d,u=p;else{for(var x=!1,D=d.child;D;){if(D===i){x=!0,i=d,u=p;break}if(D===u){x=!0,u=d,i=p;break}D=D.sibling}if(!x){for(D=p.child;D;){if(D===i){x=!0,i=p,u=d;break}if(D===u){x=!0,u=p,i=d;break}D=D.sibling}if(!x)throw Error(o(189))}}if(i.alternate!==u)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?t:r}function Ct(t){return t=zn(t),t!==null?ge(t):null}function ge(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=ge(t);if(r!==null)return r;t=t.sibling}return null}var Ze=n.unstable_scheduleCallback,Hn=n.unstable_cancelCallback,nn=n.unstable_shouldYield,Li=n.unstable_requestPaint,qe=n.unstable_now,Mr=n.unstable_getCurrentPriorityLevel,lo=n.unstable_ImmediatePriority,xa=n.unstable_UserBlockingPriority,_r=n.unstable_NormalPriority,Mi=n.unstable_LowPriority,wa=n.unstable_IdlePriority,Ir=null,Gt=null;function jl(t){if(Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(Ir,t,void 0,(t.current.flags&128)===128)}catch{}}var It=Math.clz32?Math.clz32:Ll,Nl=Math.log,Rl=Math.LN2;function Ll(t){return t>>>=0,t===0?32:31-(Nl(t)/Rl|0)|0}var _i=64,Ko=4194304;function so(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Ii(t,r){var i=t.pendingLanes;if(i===0)return 0;var u=0,d=t.suspendedLanes,p=t.pingedLanes,x=i&268435455;if(x!==0){var D=x&~d;D!==0?u=so(D):(p&=x,p!==0&&(u=so(p)))}else x=i&~d,x!==0?u=so(x):p!==0&&(u=so(p));if(u===0)return 0;if(r!==0&&r!==u&&(r&d)===0&&(d=u&-u,p=r&-r,d>=p||d===16&&(p&4194240)!==0))return r;if((u&4)!==0&&(u|=i&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=u;0<r;)i=31-It(r),d=1<<i,u|=t[i],r&=~d;return u}function Ml(t,r){switch(t){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fi(t,r){for(var i=t.suspendedLanes,u=t.pingedLanes,d=t.expirationTimes,p=t.pendingLanes;0<p;){var x=31-It(p),D=1<<x,R=d[x];R===-1?((D&i)===0||(D&u)!==0)&&(d[x]=Ml(D,r)):R<=r&&(t.expiredLanes|=D),p&=~D}}function Ca(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Sa(){var t=_i;return _i<<=1,(_i&4194240)===0&&(_i=64),t}function ka(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function uo(t,r,i){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-It(r),t[r]=i}function _l(t,r){var i=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var u=t.eventTimes;for(t=t.expirationTimes;0<i;){var d=31-It(i),p=1<<d;r[d]=0,u[d]=-1,t[d]=-1,i&=~p}}function Bi(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var u=31-It(i),d=1<<u;d&r|t[u]&r&&(t[u]|=r),i&=~d}}var ze=0;function Il(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Oi,$o,zi,Fl,Bl,Pa=!1,Fr=[],En=null,Un=null,ur=null,cr=new Map,Vo=new Map,Kn=[],Ea="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Qs(t,r){switch(t){case"focusin":case"focusout":En=null;break;case"dragenter":case"dragleave":Un=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":cr.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(r.pointerId)}}function co(t,r,i,u,d,p){return t===null||t.nativeEvent!==p?(t={blockedOn:r,domEventName:i,eventSystemFlags:u,nativeEvent:p,targetContainers:[d]},r!==null&&(r=wo(r),r!==null&&$o(r)),t):(t.eventSystemFlags|=u,r=t.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),t)}function Gc(t,r,i,u,d){switch(r){case"focusin":return En=co(En,t,r,i,u,d),!0;case"dragenter":return Un=co(Un,t,r,i,u,d),!0;case"mouseover":return ur=co(ur,t,r,i,u,d),!0;case"pointerover":var p=d.pointerId;return cr.set(p,co(cr.get(p)||null,t,r,i,u,d)),!0;case"gotpointercapture":return p=d.pointerId,Vo.set(p,co(Vo.get(p)||null,t,r,i,u,d)),!0}return!1}function Aa(t){var r=yr(t.target);if(r!==null){var i=ct(r);if(i!==null){if(r=i.tag,r===13){if(r=Vt(i),r!==null){t.blockedOn=r,Bl(t.priority,function(){zi(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function dr(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var i=Da(t.domEventName,t.eventSystemFlags,r[0],t.nativeEvent);if(i===null){i=t.nativeEvent;var u=new i.constructor(i.type,i);kn=u,i.target.dispatchEvent(u),kn=null}else return r=wo(i),r!==null&&$o(r),t.blockedOn=i,!1;r.shift()}return!0}function Hi(t,r,i){dr(t)&&i.delete(r)}function An(){Pa=!1,En!==null&&dr(En)&&(En=null),Un!==null&&dr(Un)&&(Un=null),ur!==null&&dr(ur)&&(ur=null),cr.forEach(Hi),Vo.forEach(Hi)}function Br(t,r){t.blockedOn===r&&(t.blockedOn=null,Pa||(Pa=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,An)))}function Dn(t){function r(d){return Br(d,t)}if(0<Fr.length){Br(Fr[0],t);for(var i=1;i<Fr.length;i++){var u=Fr[i];u.blockedOn===t&&(u.blockedOn=null)}}for(En!==null&&Br(En,t),Un!==null&&Br(Un,t),ur!==null&&Br(ur,t),cr.forEach(r),Vo.forEach(r),i=0;i<Kn.length;i++)u=Kn[i],u.blockedOn===t&&(u.blockedOn=null);for(;0<Kn.length&&(i=Kn[0],i.blockedOn===null);)Aa(i),i.blockedOn===null&&Kn.shift()}var mr=H.ReactCurrentBatchConfig,mo=!0;function Ol(t,r,i,u){var d=ze,p=mr.transition;mr.transition=null;try{ze=1,Or(t,r,i,u)}finally{ze=d,mr.transition=p}}function fo(t,r,i,u){var d=ze,p=mr.transition;mr.transition=null;try{ze=4,Or(t,r,i,u)}finally{ze=d,mr.transition=p}}function Or(t,r,i,u){if(mo){var d=Da(t,r,i,u);if(d===null)Ya(t,r,u,Wo,i),Qs(t,u);else if(Gc(d,t,r,i,u))u.stopPropagation();else if(Qs(t,u),r&4&&-1<Ea.indexOf(t)){for(;d!==null;){var p=wo(d);if(p!==null&&Oi(p),p=Da(t,r,i,u),p===null&&Ya(t,r,u,Wo,i),p===d)break;d=p}d!==null&&u.stopPropagation()}else Ya(t,r,u,null,i)}}var Wo=null;function Da(t,r,i,u){if(Wo=null,t=We(u),t=yr(t),t!==null)if(r=ct(t),r===null)t=null;else if(i=r.tag,i===13){if(t=Vt(r),t!==null)return t;t=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null);return Wo=t,null}function Ta(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Mr()){case lo:return 1;case xa:return 4;case _r:case Mi:return 16;case wa:return 536870912;default:return 16}default:return 16}}var $n=null,zl=null,po=null;function gt(){if(po)return po;var t,r=zl,i=r.length,u,d="value"in $n?$n.value:$n.textContent,p=d.length;for(t=0;t<i&&r[t]===d[t];t++);var x=i-t;for(u=1;u<=x&&r[i-u]===d[p-u];u++);return po=d.slice(t,1<u?1-u:void 0)}function zr(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Dt(){return!0}function Ui(){return!1}function Ft(t){function r(i,u,d,p,x){this._reactName=i,this._targetInst=d,this.type=u,this.nativeEvent=p,this.target=x,this.currentTarget=null;for(var D in t)t.hasOwnProperty(D)&&(i=t[D],this[D]=i?i(p):p[D]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Dt:Ui,this.isPropagationStopped=Ui,this}return J(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Dt)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Dt)},persist:function(){},isPersistent:Dt}),r}var Hr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hl=Ft(Hr),Ur=J({},Hr,{view:0,detail:0}),Yc=Ft(Ur),Go,Ul,fr,ho=J({},Ur,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ma,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==fr&&(fr&&t.type==="mousemove"?(Go=t.screenX-fr.screenX,Ul=t.screenY-fr.screenY):Ul=Go=0,fr=t),Go)},movementY:function(t){return"movementY"in t?t.movementY:Ul}}),Ki=Ft(ho),Kl=J({},ho,{dataTransfer:0}),$l=Ft(Kl),ja=J({},Ur,{relatedTarget:0}),$i=Ft(ja),Na=J({},Hr,{animationName:0,elapsedTime:0,pseudoElement:0}),Vl=Ft(Na),Ra=J({},Hr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Wl=Ft(Ra),go=J({},Hr,{data:0}),La=Ft(go),St={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yo={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Gl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yl(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Gl[t])?!!r[t]:!1}function Ma(){return Yl}var Js=J({},Ur,{key:function(t){if(t.key){var r=St[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=zr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Yo[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ma,charCode:function(t){return t.type==="keypress"?zr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ql=Ft(Js),Zs=J({},ho,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xl=Ft(Zs),Ql=J({},Ur,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ma}),eu=Ft(Ql),tu=J({},Hr,{propertyName:0,elapsedTime:0,pseudoElement:0}),nu=Ft(tu),_a=J({},ho,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),ru=Ft(_a),Jl=[9,13,27,32],Vi=g&&"CompositionEvent"in window,qo=null;g&&"documentMode"in document&&(qo=document.documentMode);var ou=g&&"TextEvent"in window&&!qo,Zl=g&&(!Vi||qo&&8<qo&&11>=qo),es=" ",ts=!1;function ns(t,r){switch(t){case"keyup":return Jl.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rs(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var yo=!1;function iu(t,r){switch(t){case"compositionend":return rs(r);case"keypress":return r.which!==32?null:(ts=!0,es);case"textInput":return t=r.data,t===es&&ts?null:t;default:return null}}function au(t,r){if(yo)return t==="compositionend"||!Vi&&ns(t,r)?(t=gt(),po=zl=$n=null,yo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Zl&&r.locale!=="ko"?null:r.data;default:return null}}var lu={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function os(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!lu[t.type]:r==="textarea"}function is(t,r,i,u){Rr(u),r=Xi(r,"onChange"),0<r.length&&(i=new Hl("onChange","change",null,i,u),t.push({event:i,listeners:r}))}var Xo=null,Qo=null;function su(t){cs(t,0)}function Jo(t){var r=Co(t);if(ut(r))return t}function Wi(t,r){if(t==="change")return r}var as=!1;if(g){var Zo;if(g){var Ia="oninput"in document;if(!Ia){var Gi=document.createElement("div");Gi.setAttribute("oninput","return;"),Ia=typeof Gi.oninput=="function"}Zo=Ia}else Zo=!1;as=Zo&&(!document.documentMode||9<document.documentMode)}function ls(){Xo&&(Xo.detachEvent("onpropertychange",pr),Qo=Xo=null)}function pr(t){if(t.propertyName==="value"&&Jo(Qo)){var r=[];is(r,Qo,t,We(t)),Je(su,r)}}function ei(t,r,i){t==="focusin"?(ls(),Xo=r,Qo=i,Xo.attachEvent("onpropertychange",pr)):t==="focusout"&&ls()}function ss(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Jo(Qo)}function qc(t,r){if(t==="click")return Jo(r)}function Fa(t,r){if(t==="input"||t==="change")return Jo(r)}function uu(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var dn=typeof Object.is=="function"?Object.is:uu;function ti(t,r){if(dn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var i=Object.keys(t),u=Object.keys(r);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var d=i[u];if(!y.call(r,d)||!dn(t[d],r[d]))return!1}return!0}function bo(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function et(t,r){var i=bo(t);t=0;for(var u;i;){if(i.nodeType===3){if(u=t+i.textContent.length,t<=r&&u>=r)return{node:i,offset:r-t};t=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=bo(i)}}function cu(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?cu(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function ni(){for(var t=window,r=wn();r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=wn(t.document)}return r}function Oe(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function Ba(t){var r=ni(),i=t.focusedElem,u=t.selectionRange;if(r!==i&&i&&i.ownerDocument&&cu(i.ownerDocument.documentElement,i)){if(u!==null&&Oe(i)){if(r=u.start,t=u.end,t===void 0&&(t=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(t,i.value.length);else if(t=(r=i.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var d=i.textContent.length,p=Math.min(u.start,d);u=u.end===void 0?p:Math.min(u.end,d),!t.extend&&p>u&&(d=u,u=p,p=d),d=et(i,p);var x=et(i,u);d&&x&&(t.rangeCount!==1||t.anchorNode!==d.node||t.anchorOffset!==d.offset||t.focusNode!==x.node||t.focusOffset!==x.offset)&&(r=r.createRange(),r.setStart(d.node,d.offset),t.removeAllRanges(),p>u?(t.addRange(r),t.extend(x.node,x.offset)):(r.setEnd(x.node,x.offset),t.addRange(r)))}}for(r=[],t=i;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<r.length;i++)t=r[i],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var hr=g&&"documentMode"in document&&11>=document.documentMode,Kr=null,Me=null,ri=null,Oa=!1;function Yi(t,r,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Oa||Kr==null||Kr!==wn(u)||(u=Kr,"selectionStart"in u&&Oe(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ri&&ti(ri,u)||(ri=u,u=Xi(Me,"onSelect"),0<u.length&&(r=new Hl("onSelect","select",null,r,i),t.push({event:r,listeners:u}),r.target=Kr)))}function qi(t,r){var i={};return i[t.toLowerCase()]=r.toLowerCase(),i["Webkit"+t]="webkit"+r,i["Moz"+t]="moz"+r,i}var gr={animationend:qi("Animation","AnimationEnd"),animationiteration:qi("Animation","AnimationIteration"),animationstart:qi("Animation","AnimationStart"),transitionend:qi("Transition","TransitionEnd")},oi={},le={};g&&(le=document.createElement("div").style,"AnimationEvent"in window||(delete gr.animationend.animation,delete gr.animationiteration.animation,delete gr.animationstart.animation),"TransitionEvent"in window||delete gr.transitionend.transition);function rn(t){if(oi[t])return oi[t];if(!gr[t])return t;var r=gr[t],i;for(i in r)if(r.hasOwnProperty(i)&&i in le)return oi[t]=r[i];return t}var za=rn("animationend"),Ha=rn("animationiteration"),Ua=rn("animationstart"),Ka=rn("transitionend"),$a=new Map,Va="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ne(t,r){$a.set(t,r),c(r,[t])}for(var Wa=0;Wa<Va.length;Wa++){var $r=Va[Wa],du=$r.toLowerCase(),me=$r[0].toUpperCase()+$r.slice(1);ne(du,"on"+me)}ne(za,"onAnimationEnd"),ne(Ha,"onAnimationIteration"),ne(Ua,"onAnimationStart"),ne("dblclick","onDoubleClick"),ne("focusin","onFocus"),ne("focusout","onBlur"),ne(Ka,"onTransitionEnd"),m("onMouseEnter",["mouseout","mouseover"]),m("onMouseLeave",["mouseout","mouseover"]),m("onPointerEnter",["pointerout","pointerover"]),m("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var on="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mu=new Set("cancel close invalid load scroll toggle".split(" ").concat(on));function us(t,r,i){var u=t.type||"unknown-event";t.currentTarget=i,_t(u,r,void 0,t),t.currentTarget=null}function cs(t,r){r=(r&4)!==0;for(var i=0;i<t.length;i++){var u=t[i],d=u.event;u=u.listeners;e:{var p=void 0;if(r)for(var x=u.length-1;0<=x;x--){var D=u[x],R=D.instance,W=D.currentTarget;if(D=D.listener,R!==p&&d.isPropagationStopped())break e;us(d,D,W),p=R}else for(x=0;x<u.length;x++){if(D=u[x],R=D.instance,W=D.currentTarget,D=D.listener,R!==p&&d.isPropagationStopped())break e;us(d,D,W),p=R}}}if(Ho)throw t=sr,Ho=!1,sr=null,t}function $e(t,r){var i=r[li];i===void 0&&(i=r[li]=new Set);var u=t+"__bubble";i.has(u)||(ds(r,t,2,!1),i.add(u))}function Ga(t,r,i){var u=0;r&&(u|=4),ds(i,t,u,r)}var ii="_reactListening"+Math.random().toString(36).slice(2);function vo(t){if(!t[ii]){t[ii]=!0,a.forEach(function(i){i!=="selectionchange"&&(mu.has(i)||Ga(i,!1,t),Ga(i,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[ii]||(r[ii]=!0,Ga("selectionchange",!1,r))}}function ds(t,r,i,u){switch(Ta(r)){case 1:var d=Ol;break;case 4:d=fo;break;default:d=Or}i=d.bind(null,r,i,t),d=void 0,!ao||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),u?d!==void 0?t.addEventListener(r,i,{capture:!0,passive:d}):t.addEventListener(r,i,!0):d!==void 0?t.addEventListener(r,i,{passive:d}):t.addEventListener(r,i,!1)}function Ya(t,r,i,u,d){var p=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var x=u.tag;if(x===3||x===4){var D=u.stateNode.containerInfo;if(D===d||D.nodeType===8&&D.parentNode===d)break;if(x===4)for(x=u.return;x!==null;){var R=x.tag;if((R===3||R===4)&&(R=x.stateNode.containerInfo,R===d||R.nodeType===8&&R.parentNode===d))return;x=x.return}for(;D!==null;){if(x=yr(D),x===null)return;if(R=x.tag,R===5||R===6){u=p=x;continue e}D=D.parentNode}}u=u.return}Je(function(){var W=p,ee=We(i),te=[];e:{var Z=$a.get(t);if(Z!==void 0){var he=Hl,ve=t;switch(t){case"keypress":if(zr(i)===0)break e;case"keydown":case"keyup":he=ql;break;case"focusin":ve="focus",he=$i;break;case"focusout":ve="blur",he=$i;break;case"beforeblur":case"afterblur":he=$i;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=Ki;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=$l;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=eu;break;case za:case Ha:case Ua:he=Vl;break;case Ka:he=nu;break;case"scroll":he=Yc;break;case"wheel":he=ru;break;case"copy":case"cut":case"paste":he=Wl;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Xl}var xe=(r&4)!==0,pt=!xe&&t==="scroll",O=xe?Z!==null?Z+"Capture":null:Z;xe=[];for(var I=W,U;I!==null;){U=I;var se=U.stateNode;if(U.tag===5&&se!==null&&(U=se,O!==null&&(se=On(I,O),se!=null&&xe.push(ai(I,se,U)))),pt)break;I=I.return}0<xe.length&&(Z=new he(Z,ve,null,i,ee),te.push({event:Z,listeners:xe}))}}if((r&7)===0){e:{if(Z=t==="mouseover"||t==="pointerover",he=t==="mouseout"||t==="pointerout",Z&&i!==kn&&(ve=i.relatedTarget||i.fromElement)&&(yr(ve)||ve[Gn]))break e;if((he||Z)&&(Z=ee.window===ee?ee:(Z=ee.ownerDocument)?Z.defaultView||Z.parentWindow:window,he?(ve=i.relatedTarget||i.toElement,he=W,ve=ve?yr(ve):null,ve!==null&&(pt=ct(ve),ve!==pt||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(he=null,ve=W),he!==ve)){if(xe=Ki,se="onMouseLeave",O="onMouseEnter",I="mouse",(t==="pointerout"||t==="pointerover")&&(xe=Xl,se="onPointerLeave",O="onPointerEnter",I="pointer"),pt=he==null?Z:Co(he),U=ve==null?Z:Co(ve),Z=new xe(se,I+"leave",he,i,ee),Z.target=pt,Z.relatedTarget=U,se=null,yr(ee)===W&&(xe=new xe(O,I+"enter",ve,i,ee),xe.target=U,xe.relatedTarget=pt,se=xe),pt=se,he&&ve)t:{for(xe=he,O=ve,I=0,U=xe;U;U=xo(U))I++;for(U=0,se=O;se;se=xo(se))U++;for(;0<I-U;)xe=xo(xe),I--;for(;0<U-I;)O=xo(O),U--;for(;I--;){if(xe===O||O!==null&&xe===O.alternate)break t;xe=xo(xe),O=xo(O)}xe=null}else xe=null;he!==null&&Qi(te,Z,he,xe,!1),ve!==null&&pt!==null&&Qi(te,pt,ve,xe,!0)}}e:{if(Z=W?Co(W):window,he=Z.nodeName&&Z.nodeName.toLowerCase(),he==="select"||he==="input"&&Z.type==="file")var we=Wi;else if(os(Z))if(as)we=Fa;else{we=ss;var Ee=ei}else(he=Z.nodeName)&&he.toLowerCase()==="input"&&(Z.type==="checkbox"||Z.type==="radio")&&(we=qc);if(we&&(we=we(t,W))){is(te,we,i,ee);break e}Ee&&Ee(t,Z,W),t==="focusout"&&(Ee=Z._wrapperState)&&Ee.controlled&&Z.type==="number"&&Fo(Z,"number",Z.value)}switch(Ee=W?Co(W):window,t){case"focusin":(os(Ee)||Ee.contentEditable==="true")&&(Kr=Ee,Me=W,ri=null);break;case"focusout":ri=Me=Kr=null;break;case"mousedown":Oa=!0;break;case"contextmenu":case"mouseup":case"dragend":Oa=!1,Yi(te,i,ee);break;case"selectionchange":if(hr)break;case"keydown":case"keyup":Yi(te,i,ee)}var Ae;if(Vi)e:{switch(t){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else yo?ns(t,i)&&(Te="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(Te="onCompositionStart");Te&&(Zl&&i.locale!=="ko"&&(yo||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&yo&&(Ae=gt()):($n=ee,zl="value"in $n?$n.value:$n.textContent,yo=!0)),Ee=Xi(W,Te),0<Ee.length&&(Te=new La(Te,t,null,i,ee),te.push({event:Te,listeners:Ee}),Ae?Te.data=Ae:(Ae=rs(i),Ae!==null&&(Te.data=Ae)))),(Ae=ou?iu(t,i):au(t,i))&&(W=Xi(W,"onBeforeInput"),0<W.length&&(ee=new La("onBeforeInput","beforeinput",null,i,ee),te.push({event:ee,listeners:W}),ee.data=Ae))}cs(te,r)})}function ai(t,r,i){return{instance:t,listener:r,currentTarget:i}}function Xi(t,r){for(var i=r+"Capture",u=[];t!==null;){var d=t,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=On(t,i),p!=null&&u.unshift(ai(t,p,d)),p=On(t,r),p!=null&&u.push(ai(t,p,d))),t=t.return}return u}function xo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Qi(t,r,i,u,d){for(var p=r._reactName,x=[];i!==null&&i!==u;){var D=i,R=D.alternate,W=D.stateNode;if(R!==null&&R===u)break;D.tag===5&&W!==null&&(D=W,d?(R=On(i,p),R!=null&&x.unshift(ai(i,R,D))):d||(R=On(i,p),R!=null&&x.push(ai(i,R,D)))),i=i.return}x.length!==0&&t.push({event:r,listeners:x})}var qa=/\r\n?/g,fu=/\u0000|\uFFFD/g;function ms(t){return(typeof t=="string"?t:""+t).replace(qa,`
38
+ `).replace(fu,"")}function Ji(t,r,i){if(r=ms(r),ms(t)!==r&&i)throw Error(o(425))}function Zi(){}var Xa=null,Tn=null;function ea(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ta=typeof setTimeout=="function"?setTimeout:void 0,fs=typeof clearTimeout=="function"?clearTimeout:void 0,ps=typeof Promise=="function"?Promise:void 0,Xc=typeof queueMicrotask=="function"?queueMicrotask:typeof ps<"u"?function(t){return ps.resolve(null).then(t).catch(Qc)}:ta;function Qc(t){setTimeout(function(){throw t})}function Vn(t,r){var i=r,u=0;do{var d=i.nextSibling;if(t.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(u===0){t.removeChild(d),Dn(r);return}u--}else i!=="$"&&i!=="$?"&&i!=="$!"||u++;i=d}while(i);Dn(r)}function Wn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return t}function pu(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"){if(r===0)return t;r--}else i==="/$"&&r++}t=t.previousSibling}return null}var Ue=Math.random().toString(36).slice(2),jn="__reactFiber$"+Ue,Vr="__reactProps$"+Ue,Gn="__reactContainer$"+Ue,li="__reactEvents$"+Ue,hs="__reactListeners$"+Ue,gs="__reactHandles$"+Ue;function yr(t){var r=t[jn];if(r)return r;for(var i=t.parentNode;i;){if(r=i[Gn]||i[jn]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=pu(t);t!==null;){if(i=t[jn])return i;t=pu(t)}return r}t=i,i=t.parentNode}return null}function wo(t){return t=t[jn]||t[Gn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Co(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(o(33))}function Qa(t){return t[Vr]||null}var Wr=[],Gr=-1;function br(t){return{current:t}}function Ge(t){0>Gr||(t.current=Wr[Gr],Wr[Gr]=null,Gr--)}function Ve(t,r){Gr++,Wr[Gr]=t.current,t.current=r}var vr={},Tt=br(vr),Yt=br(!1),So=vr;function si(t,r){var i=t.type.contextTypes;if(!i)return vr;var u=t.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===r)return u.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=r[p];return u&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=d),d}function h(t){return t=t.childContextTypes,t!=null}function v(){Ge(Yt),Ge(Tt)}function _(t,r,i){if(Tt.current!==vr)throw Error(o(168));Ve(Tt,r),Ve(Yt,i)}function ie(t,r,i){var u=t.stateNode;if(r=r.childContextTypes,typeof u.getChildContext!="function")return i;u=u.getChildContext();for(var d in u)if(!(d in r))throw Error(o(108,Re(t)||"Unknown",d));return J({},i,u)}function ye(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||vr,So=Tt.current,Ve(Tt,t),Ve(Yt,Yt.current),!0}function _e(t,r,i){var u=t.stateNode;if(!u)throw Error(o(169));i?(t=ie(t,r,So),u.__reactInternalMemoizedMergedChildContext=t,Ge(Yt),Ge(Tt),Ve(Tt,t)):Ge(Yt),Ve(Yt,i)}var at=null,ui=!1,Jc=!1;function Qf(t){at===null?at=[t]:at.push(t)}function Ev(t){ui=!0,Qf(t)}function ci(){if(!Jc&&at!==null){Jc=!0;var t=0,r=ze;try{var i=at;for(ze=1;t<i.length;t++){var u=i[t];do u=u(!0);while(u!==null)}at=null,ui=!1}catch(d){throw at!==null&&(at=at.slice(t+1)),Ze(lo,ci),d}finally{ze=r,Jc=!1}}return null}var Ja=[],Za=0,hu=null,gu=0,Yn=[],qn=0,na=null,ko=1,Po="";function ra(t,r){Ja[Za++]=gu,Ja[Za++]=hu,hu=t,gu=r}function Jf(t,r,i){Yn[qn++]=ko,Yn[qn++]=Po,Yn[qn++]=na,na=t;var u=ko;t=Po;var d=32-It(u)-1;u&=~(1<<d),i+=1;var p=32-It(r)+d;if(30<p){var x=d-d%5;p=(u&(1<<x)-1).toString(32),u>>=x,d-=x,ko=1<<32-It(r)+d|i<<d|u,Po=p+t}else ko=1<<p|i<<d|u,Po=t}function Zc(t){t.return!==null&&(ra(t,1),Jf(t,1,0))}function ed(t){for(;t===hu;)hu=Ja[--Za],Ja[Za]=null,gu=Ja[--Za],Ja[Za]=null;for(;t===na;)na=Yn[--qn],Yn[qn]=null,Po=Yn[--qn],Yn[qn]=null,ko=Yn[--qn],Yn[qn]=null}var Nn=null,Rn=null,nt=!1,xr=null;function Zf(t,r){var i=Zn(5,null,null,0);i.elementType="DELETED",i.stateNode=r,i.return=t,r=t.deletions,r===null?(t.deletions=[i],t.flags|=16):r.push(i)}function ep(t,r){switch(t.tag){case 5:var i=t.type;return r=r.nodeType!==1||i.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(t.stateNode=r,Nn=t,Rn=Wn(r.firstChild),!0):!1;case 6:return r=t.pendingProps===""||r.nodeType!==3?null:r,r!==null?(t.stateNode=r,Nn=t,Rn=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(i=na!==null?{id:ko,overflow:Po}:null,t.memoizedState={dehydrated:r,treeContext:i,retryLane:1073741824},i=Zn(18,null,null,0),i.stateNode=r,i.return=t,t.child=i,Nn=t,Rn=null,!0):!1;default:return!1}}function td(t){return(t.mode&1)!==0&&(t.flags&128)===0}function nd(t){if(nt){var r=Rn;if(r){var i=r;if(!ep(t,r)){if(td(t))throw Error(o(418));r=Wn(i.nextSibling);var u=Nn;r&&ep(t,r)?Zf(u,i):(t.flags=t.flags&-4097|2,nt=!1,Nn=t)}}else{if(td(t))throw Error(o(418));t.flags=t.flags&-4097|2,nt=!1,Nn=t}}}function tp(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Nn=t}function yu(t){if(t!==Nn)return!1;if(!nt)return tp(t),nt=!0,!1;var r;if((r=t.tag!==3)&&!(r=t.tag!==5)&&(r=t.type,r=r!=="head"&&r!=="body"&&!ea(t.type,t.memoizedProps)),r&&(r=Rn)){if(td(t))throw np(),Error(o(418));for(;r;)Zf(t,r),r=Wn(r.nextSibling)}if(tp(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"){if(r===0){Rn=Wn(t.nextSibling);break e}r--}else i!=="$"&&i!=="$!"&&i!=="$?"||r++}t=t.nextSibling}Rn=null}}else Rn=Nn?Wn(t.stateNode.nextSibling):null;return!0}function np(){for(var t=Rn;t;)t=Wn(t.nextSibling)}function el(){Rn=Nn=null,nt=!1}function rd(t){xr===null?xr=[t]:xr.push(t)}var Av=H.ReactCurrentBatchConfig;function ys(t,r,i){if(t=i.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(o(309));var u=i.stateNode}if(!u)throw Error(o(147,t));var d=u,p=""+t;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===p?r.ref:(r=function(x){var D=d.refs;x===null?delete D[p]:D[p]=x},r._stringRef=p,r)}if(typeof t!="string")throw Error(o(284));if(!i._owner)throw Error(o(290,t))}return t}function bu(t,r){throw t=Object.prototype.toString.call(r),Error(o(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function rp(t){var r=t._init;return r(t._payload)}function op(t){function r(O,I){if(t){var U=O.deletions;U===null?(O.deletions=[I],O.flags|=16):U.push(I)}}function i(O,I){if(!t)return null;for(;I!==null;)r(O,I),I=I.sibling;return null}function u(O,I){for(O=new Map;I!==null;)I.key!==null?O.set(I.key,I):O.set(I.index,I),I=I.sibling;return O}function d(O,I){return O=bi(O,I),O.index=0,O.sibling=null,O}function p(O,I,U){return O.index=U,t?(U=O.alternate,U!==null?(U=U.index,U<I?(O.flags|=2,I):U):(O.flags|=2,I)):(O.flags|=1048576,I)}function x(O){return t&&O.alternate===null&&(O.flags|=2),O}function D(O,I,U,se){return I===null||I.tag!==6?(I=Yd(U,O.mode,se),I.return=O,I):(I=d(I,U),I.return=O,I)}function R(O,I,U,se){var we=U.type;return we===G?ee(O,I,U.props.children,se,U.key):I!==null&&(I.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===ke&&rp(we)===I.type)?(se=d(I,U.props),se.ref=ys(O,I,U),se.return=O,se):(se=Uu(U.type,U.key,U.props,null,O.mode,se),se.ref=ys(O,I,U),se.return=O,se)}function W(O,I,U,se){return I===null||I.tag!==4||I.stateNode.containerInfo!==U.containerInfo||I.stateNode.implementation!==U.implementation?(I=qd(U,O.mode,se),I.return=O,I):(I=d(I,U.children||[]),I.return=O,I)}function ee(O,I,U,se,we){return I===null||I.tag!==7?(I=da(U,O.mode,se,we),I.return=O,I):(I=d(I,U),I.return=O,I)}function te(O,I,U){if(typeof I=="string"&&I!==""||typeof I=="number")return I=Yd(""+I,O.mode,U),I.return=O,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case z:return U=Uu(I.type,I.key,I.props,null,O.mode,U),U.ref=ys(O,null,I),U.return=O,U;case q:return I=qd(I,O.mode,U),I.return=O,I;case ke:var se=I._init;return te(O,se(I._payload),U)}if(or(I)||pe(I))return I=da(I,O.mode,U,null),I.return=O,I;bu(O,I)}return null}function Z(O,I,U,se){var we=I!==null?I.key:null;if(typeof U=="string"&&U!==""||typeof U=="number")return we!==null?null:D(O,I,""+U,se);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case z:return U.key===we?R(O,I,U,se):null;case q:return U.key===we?W(O,I,U,se):null;case ke:return we=U._init,Z(O,I,we(U._payload),se)}if(or(U)||pe(U))return we!==null?null:ee(O,I,U,se,null);bu(O,U)}return null}function he(O,I,U,se,we){if(typeof se=="string"&&se!==""||typeof se=="number")return O=O.get(U)||null,D(I,O,""+se,we);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case z:return O=O.get(se.key===null?U:se.key)||null,R(I,O,se,we);case q:return O=O.get(se.key===null?U:se.key)||null,W(I,O,se,we);case ke:var Ee=se._init;return he(O,I,U,Ee(se._payload),we)}if(or(se)||pe(se))return O=O.get(U)||null,ee(I,O,se,we,null);bu(I,se)}return null}function ve(O,I,U,se){for(var we=null,Ee=null,Ae=I,Te=I=0,Rt=null;Ae!==null&&Te<U.length;Te++){Ae.index>Te?(Rt=Ae,Ae=null):Rt=Ae.sibling;var Ke=Z(O,Ae,U[Te],se);if(Ke===null){Ae===null&&(Ae=Rt);break}t&&Ae&&Ke.alternate===null&&r(O,Ae),I=p(Ke,I,Te),Ee===null?we=Ke:Ee.sibling=Ke,Ee=Ke,Ae=Rt}if(Te===U.length)return i(O,Ae),nt&&ra(O,Te),we;if(Ae===null){for(;Te<U.length;Te++)Ae=te(O,U[Te],se),Ae!==null&&(I=p(Ae,I,Te),Ee===null?we=Ae:Ee.sibling=Ae,Ee=Ae);return nt&&ra(O,Te),we}for(Ae=u(O,Ae);Te<U.length;Te++)Rt=he(Ae,O,Te,U[Te],se),Rt!==null&&(t&&Rt.alternate!==null&&Ae.delete(Rt.key===null?Te:Rt.key),I=p(Rt,I,Te),Ee===null?we=Rt:Ee.sibling=Rt,Ee=Rt);return t&&Ae.forEach(function(vi){return r(O,vi)}),nt&&ra(O,Te),we}function xe(O,I,U,se){var we=pe(U);if(typeof we!="function")throw Error(o(150));if(U=we.call(U),U==null)throw Error(o(151));for(var Ee=we=null,Ae=I,Te=I=0,Rt=null,Ke=U.next();Ae!==null&&!Ke.done;Te++,Ke=U.next()){Ae.index>Te?(Rt=Ae,Ae=null):Rt=Ae.sibling;var vi=Z(O,Ae,Ke.value,se);if(vi===null){Ae===null&&(Ae=Rt);break}t&&Ae&&vi.alternate===null&&r(O,Ae),I=p(vi,I,Te),Ee===null?we=vi:Ee.sibling=vi,Ee=vi,Ae=Rt}if(Ke.done)return i(O,Ae),nt&&ra(O,Te),we;if(Ae===null){for(;!Ke.done;Te++,Ke=U.next())Ke=te(O,Ke.value,se),Ke!==null&&(I=p(Ke,I,Te),Ee===null?we=Ke:Ee.sibling=Ke,Ee=Ke);return nt&&ra(O,Te),we}for(Ae=u(O,Ae);!Ke.done;Te++,Ke=U.next())Ke=he(Ae,O,Te,Ke.value,se),Ke!==null&&(t&&Ke.alternate!==null&&Ae.delete(Ke.key===null?Te:Ke.key),I=p(Ke,I,Te),Ee===null?we=Ke:Ee.sibling=Ke,Ee=Ke);return t&&Ae.forEach(function(ax){return r(O,ax)}),nt&&ra(O,Te),we}function pt(O,I,U,se){if(typeof U=="object"&&U!==null&&U.type===G&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case z:e:{for(var we=U.key,Ee=I;Ee!==null;){if(Ee.key===we){if(we=U.type,we===G){if(Ee.tag===7){i(O,Ee.sibling),I=d(Ee,U.props.children),I.return=O,O=I;break e}}else if(Ee.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===ke&&rp(we)===Ee.type){i(O,Ee.sibling),I=d(Ee,U.props),I.ref=ys(O,Ee,U),I.return=O,O=I;break e}i(O,Ee);break}else r(O,Ee);Ee=Ee.sibling}U.type===G?(I=da(U.props.children,O.mode,se,U.key),I.return=O,O=I):(se=Uu(U.type,U.key,U.props,null,O.mode,se),se.ref=ys(O,I,U),se.return=O,O=se)}return x(O);case q:e:{for(Ee=U.key;I!==null;){if(I.key===Ee)if(I.tag===4&&I.stateNode.containerInfo===U.containerInfo&&I.stateNode.implementation===U.implementation){i(O,I.sibling),I=d(I,U.children||[]),I.return=O,O=I;break e}else{i(O,I);break}else r(O,I);I=I.sibling}I=qd(U,O.mode,se),I.return=O,O=I}return x(O);case ke:return Ee=U._init,pt(O,I,Ee(U._payload),se)}if(or(U))return ve(O,I,U,se);if(pe(U))return xe(O,I,U,se);bu(O,U)}return typeof U=="string"&&U!==""||typeof U=="number"?(U=""+U,I!==null&&I.tag===6?(i(O,I.sibling),I=d(I,U),I.return=O,O=I):(i(O,I),I=Yd(U,O.mode,se),I.return=O,O=I),x(O)):i(O,I)}return pt}var tl=op(!0),ip=op(!1),vu=br(null),xu=null,nl=null,od=null;function id(){od=nl=xu=null}function ad(t){var r=vu.current;Ge(vu),t._currentValue=r}function ld(t,r,i){for(;t!==null;){var u=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),t===i)break;t=t.return}}function rl(t,r){xu=t,od=nl=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(mn=!0),t.firstContext=null)}function Xn(t){var r=t._currentValue;if(od!==t)if(t={context:t,memoizedValue:r,next:null},nl===null){if(xu===null)throw Error(o(308));nl=t,xu.dependencies={lanes:0,firstContext:t}}else nl=nl.next=t;return r}var oa=null;function sd(t){oa===null?oa=[t]:oa.push(t)}function ap(t,r,i,u){var d=r.interleaved;return d===null?(i.next=i,sd(r)):(i.next=d.next,d.next=i),r.interleaved=i,Eo(t,u)}function Eo(t,r){t.lanes|=r;var i=t.alternate;for(i!==null&&(i.lanes|=r),i=t,t=t.return;t!==null;)t.childLanes|=r,i=t.alternate,i!==null&&(i.childLanes|=r),i=t,t=t.return;return i.tag===3?i.stateNode:null}var di=!1;function ud(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lp(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ao(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function mi(t,r,i){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(He&2)!==0){var d=u.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),u.pending=r,Eo(t,i)}return d=u.interleaved,d===null?(r.next=r,sd(u)):(r.next=d.next,d.next=r),u.interleaved=r,Eo(t,i)}function wu(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194240)!==0)){var u=r.lanes;u&=t.pendingLanes,i|=u,r.lanes=i,Bi(t,i)}}function sp(t,r){var i=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var x={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=x:p=p.next=x,i=i.next}while(i!==null);p===null?d=p=r:p=p.next=r}else d=p=r;i={baseState:u.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:u.shared,effects:u.effects},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}function Cu(t,r,i,u){var d=t.updateQueue;di=!1;var p=d.firstBaseUpdate,x=d.lastBaseUpdate,D=d.shared.pending;if(D!==null){d.shared.pending=null;var R=D,W=R.next;R.next=null,x===null?p=W:x.next=W,x=R;var ee=t.alternate;ee!==null&&(ee=ee.updateQueue,D=ee.lastBaseUpdate,D!==x&&(D===null?ee.firstBaseUpdate=W:D.next=W,ee.lastBaseUpdate=R))}if(p!==null){var te=d.baseState;x=0,ee=W=R=null,D=p;do{var Z=D.lane,he=D.eventTime;if((u&Z)===Z){ee!==null&&(ee=ee.next={eventTime:he,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var ve=t,xe=D;switch(Z=r,he=i,xe.tag){case 1:if(ve=xe.payload,typeof ve=="function"){te=ve.call(he,te,Z);break e}te=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=xe.payload,Z=typeof ve=="function"?ve.call(he,te,Z):ve,Z==null)break e;te=J({},te,Z);break e;case 2:di=!0}}D.callback!==null&&D.lane!==0&&(t.flags|=64,Z=d.effects,Z===null?d.effects=[D]:Z.push(D))}else he={eventTime:he,lane:Z,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ee===null?(W=ee=he,R=te):ee=ee.next=he,x|=Z;if(D=D.next,D===null){if(D=d.shared.pending,D===null)break;Z=D,D=Z.next,Z.next=null,d.lastBaseUpdate=Z,d.shared.pending=null}}while(!0);if(ee===null&&(R=te),d.baseState=R,d.firstBaseUpdate=W,d.lastBaseUpdate=ee,r=d.shared.interleaved,r!==null){d=r;do x|=d.lane,d=d.next;while(d!==r)}else p===null&&(d.shared.lanes=0);la|=x,t.lanes=x,t.memoizedState=te}}function up(t,r,i){if(t=r.effects,r.effects=null,t!==null)for(r=0;r<t.length;r++){var u=t[r],d=u.callback;if(d!==null){if(u.callback=null,u=i,typeof d!="function")throw Error(o(191,d));d.call(u)}}}var bs={},Yr=br(bs),vs=br(bs),xs=br(bs);function ia(t){if(t===bs)throw Error(o(174));return t}function cd(t,r){switch(Ve(xs,r),Ve(vs,t),Ve(Yr,bs),t=r.nodeType,t){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:Sn(null,"");break;default:t=t===8?r.parentNode:r,r=t.namespaceURI||null,t=t.tagName,r=Sn(r,t)}Ge(Yr),Ve(Yr,r)}function ol(){Ge(Yr),Ge(vs),Ge(xs)}function cp(t){ia(xs.current);var r=ia(Yr.current),i=Sn(r,t.type);r!==i&&(Ve(vs,t),Ve(Yr,i))}function dd(t){vs.current===t&&(Ge(Yr),Ge(vs))}var lt=br(0);function Su(t){for(var r=t;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var md=[];function fd(){for(var t=0;t<md.length;t++)md[t]._workInProgressVersionPrimary=null;md.length=0}var ku=H.ReactCurrentDispatcher,pd=H.ReactCurrentBatchConfig,aa=0,st=null,kt=null,jt=null,Pu=!1,ws=!1,Cs=0,Dv=0;function qt(){throw Error(o(321))}function hd(t,r){if(r===null)return!1;for(var i=0;i<r.length&&i<t.length;i++)if(!dn(t[i],r[i]))return!1;return!0}function gd(t,r,i,u,d,p){if(aa=p,st=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,ku.current=t===null||t.memoizedState===null?Rv:Lv,t=i(u,d),ws){p=0;do{if(ws=!1,Cs=0,25<=p)throw Error(o(301));p+=1,jt=kt=null,r.updateQueue=null,ku.current=Mv,t=i(u,d)}while(ws)}if(ku.current=Du,r=kt!==null&&kt.next!==null,aa=0,jt=kt=st=null,Pu=!1,r)throw Error(o(300));return t}function yd(){var t=Cs!==0;return Cs=0,t}function qr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?st.memoizedState=jt=t:jt=jt.next=t,jt}function Qn(){if(kt===null){var t=st.alternate;t=t!==null?t.memoizedState:null}else t=kt.next;var r=jt===null?st.memoizedState:jt.next;if(r!==null)jt=r,kt=t;else{if(t===null)throw Error(o(310));kt=t,t={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},jt===null?st.memoizedState=jt=t:jt=jt.next=t}return jt}function Ss(t,r){return typeof r=="function"?r(t):r}function bd(t){var r=Qn(),i=r.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=t;var u=kt,d=u.baseQueue,p=i.pending;if(p!==null){if(d!==null){var x=d.next;d.next=p.next,p.next=x}u.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,u=u.baseState;var D=x=null,R=null,W=p;do{var ee=W.lane;if((aa&ee)===ee)R!==null&&(R=R.next={lane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),u=W.hasEagerState?W.eagerState:t(u,W.action);else{var te={lane:ee,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null};R===null?(D=R=te,x=u):R=R.next=te,st.lanes|=ee,la|=ee}W=W.next}while(W!==null&&W!==p);R===null?x=u:R.next=D,dn(u,r.memoizedState)||(mn=!0),r.memoizedState=u,r.baseState=x,r.baseQueue=R,i.lastRenderedState=u}if(t=i.interleaved,t!==null){d=t;do p=d.lane,st.lanes|=p,la|=p,d=d.next;while(d!==t)}else d===null&&(i.lanes=0);return[r.memoizedState,i.dispatch]}function vd(t){var r=Qn(),i=r.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=t;var u=i.dispatch,d=i.pending,p=r.memoizedState;if(d!==null){i.pending=null;var x=d=d.next;do p=t(p,x.action),x=x.next;while(x!==d);dn(p,r.memoizedState)||(mn=!0),r.memoizedState=p,r.baseQueue===null&&(r.baseState=p),i.lastRenderedState=p}return[p,u]}function dp(){}function mp(t,r){var i=st,u=Qn(),d=r(),p=!dn(u.memoizedState,d);if(p&&(u.memoizedState=d,mn=!0),u=u.queue,xd(hp.bind(null,i,u,t),[t]),u.getSnapshot!==r||p||jt!==null&&jt.memoizedState.tag&1){if(i.flags|=2048,ks(9,pp.bind(null,i,u,d,r),void 0,null),Nt===null)throw Error(o(349));(aa&30)!==0||fp(i,r,d)}return d}function fp(t,r,i){t.flags|=16384,t={getSnapshot:r,value:i},r=st.updateQueue,r===null?(r={lastEffect:null,stores:null},st.updateQueue=r,r.stores=[t]):(i=r.stores,i===null?r.stores=[t]:i.push(t))}function pp(t,r,i,u){r.value=i,r.getSnapshot=u,gp(r)&&yp(t)}function hp(t,r,i){return i(function(){gp(r)&&yp(t)})}function gp(t){var r=t.getSnapshot;t=t.value;try{var i=r();return!dn(t,i)}catch{return!0}}function yp(t){var r=Eo(t,1);r!==null&&kr(r,t,1,-1)}function bp(t){var r=qr();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:t},r.queue=t,t=t.dispatch=Nv.bind(null,st,t),[r.memoizedState,t]}function ks(t,r,i,u){return t={tag:t,create:r,destroy:i,deps:u,next:null},r=st.updateQueue,r===null?(r={lastEffect:null,stores:null},st.updateQueue=r,r.lastEffect=t.next=t):(i=r.lastEffect,i===null?r.lastEffect=t.next=t:(u=i.next,i.next=t,t.next=u,r.lastEffect=t)),t}function vp(){return Qn().memoizedState}function Eu(t,r,i,u){var d=qr();st.flags|=t,d.memoizedState=ks(1|r,i,void 0,u===void 0?null:u)}function Au(t,r,i,u){var d=Qn();u=u===void 0?null:u;var p=void 0;if(kt!==null){var x=kt.memoizedState;if(p=x.destroy,u!==null&&hd(u,x.deps)){d.memoizedState=ks(r,i,p,u);return}}st.flags|=t,d.memoizedState=ks(1|r,i,p,u)}function xp(t,r){return Eu(8390656,8,t,r)}function xd(t,r){return Au(2048,8,t,r)}function wp(t,r){return Au(4,2,t,r)}function Cp(t,r){return Au(4,4,t,r)}function Sp(t,r){if(typeof r=="function")return t=t(),r(t),function(){r(null)};if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function kp(t,r,i){return i=i!=null?i.concat([t]):null,Au(4,4,Sp.bind(null,r,t),i)}function wd(){}function Pp(t,r){var i=Qn();r=r===void 0?null:r;var u=i.memoizedState;return u!==null&&r!==null&&hd(r,u[1])?u[0]:(i.memoizedState=[t,r],t)}function Ep(t,r){var i=Qn();r=r===void 0?null:r;var u=i.memoizedState;return u!==null&&r!==null&&hd(r,u[1])?u[0]:(t=t(),i.memoizedState=[t,r],t)}function Ap(t,r,i){return(aa&21)===0?(t.baseState&&(t.baseState=!1,mn=!0),t.memoizedState=i):(dn(i,r)||(i=Sa(),st.lanes|=i,la|=i,t.baseState=!0),r)}function Tv(t,r){var i=ze;ze=i!==0&&4>i?i:4,t(!0);var u=pd.transition;pd.transition={};try{t(!1),r()}finally{ze=i,pd.transition=u}}function Dp(){return Qn().memoizedState}function jv(t,r,i){var u=gi(t);if(i={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null},Tp(t))jp(r,i);else if(i=ap(t,r,i,u),i!==null){var d=ln();kr(i,t,u,d),Np(i,r,u)}}function Nv(t,r,i){var u=gi(t),d={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null};if(Tp(t))jp(r,d);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=r.lastRenderedReducer,p!==null))try{var x=r.lastRenderedState,D=p(x,i);if(d.hasEagerState=!0,d.eagerState=D,dn(D,x)){var R=r.interleaved;R===null?(d.next=d,sd(r)):(d.next=R.next,R.next=d),r.interleaved=d;return}}catch{}finally{}i=ap(t,r,d,u),i!==null&&(d=ln(),kr(i,t,u,d),Np(i,r,u))}}function Tp(t){var r=t.alternate;return t===st||r!==null&&r===st}function jp(t,r){ws=Pu=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function Np(t,r,i){if((i&4194240)!==0){var u=r.lanes;u&=t.pendingLanes,i|=u,r.lanes=i,Bi(t,i)}}var Du={readContext:Xn,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useInsertionEffect:qt,useLayoutEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useMutableSource:qt,useSyncExternalStore:qt,useId:qt,unstable_isNewReconciler:!1},Rv={readContext:Xn,useCallback:function(t,r){return qr().memoizedState=[t,r===void 0?null:r],t},useContext:Xn,useEffect:xp,useImperativeHandle:function(t,r,i){return i=i!=null?i.concat([t]):null,Eu(4194308,4,Sp.bind(null,r,t),i)},useLayoutEffect:function(t,r){return Eu(4194308,4,t,r)},useInsertionEffect:function(t,r){return Eu(4,2,t,r)},useMemo:function(t,r){var i=qr();return r=r===void 0?null:r,t=t(),i.memoizedState=[t,r],t},useReducer:function(t,r,i){var u=qr();return r=i!==void 0?i(r):r,u.memoizedState=u.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},u.queue=t,t=t.dispatch=jv.bind(null,st,t),[u.memoizedState,t]},useRef:function(t){var r=qr();return t={current:t},r.memoizedState=t},useState:bp,useDebugValue:wd,useDeferredValue:function(t){return qr().memoizedState=t},useTransition:function(){var t=bp(!1),r=t[0];return t=Tv.bind(null,t[1]),qr().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,i){var u=st,d=qr();if(nt){if(i===void 0)throw Error(o(407));i=i()}else{if(i=r(),Nt===null)throw Error(o(349));(aa&30)!==0||fp(u,r,i)}d.memoizedState=i;var p={value:i,getSnapshot:r};return d.queue=p,xp(hp.bind(null,u,p,t),[t]),u.flags|=2048,ks(9,pp.bind(null,u,p,i,r),void 0,null),i},useId:function(){var t=qr(),r=Nt.identifierPrefix;if(nt){var i=Po,u=ko;i=(u&~(1<<32-It(u)-1)).toString(32)+i,r=":"+r+"R"+i,i=Cs++,0<i&&(r+="H"+i.toString(32)),r+=":"}else i=Dv++,r=":"+r+"r"+i.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},Lv={readContext:Xn,useCallback:Pp,useContext:Xn,useEffect:xd,useImperativeHandle:kp,useInsertionEffect:wp,useLayoutEffect:Cp,useMemo:Ep,useReducer:bd,useRef:vp,useState:function(){return bd(Ss)},useDebugValue:wd,useDeferredValue:function(t){var r=Qn();return Ap(r,kt.memoizedState,t)},useTransition:function(){var t=bd(Ss)[0],r=Qn().memoizedState;return[t,r]},useMutableSource:dp,useSyncExternalStore:mp,useId:Dp,unstable_isNewReconciler:!1},Mv={readContext:Xn,useCallback:Pp,useContext:Xn,useEffect:xd,useImperativeHandle:kp,useInsertionEffect:wp,useLayoutEffect:Cp,useMemo:Ep,useReducer:vd,useRef:vp,useState:function(){return vd(Ss)},useDebugValue:wd,useDeferredValue:function(t){var r=Qn();return kt===null?r.memoizedState=t:Ap(r,kt.memoizedState,t)},useTransition:function(){var t=vd(Ss)[0],r=Qn().memoizedState;return[t,r]},useMutableSource:dp,useSyncExternalStore:mp,useId:Dp,unstable_isNewReconciler:!1};function wr(t,r){if(t&&t.defaultProps){r=J({},r),t=t.defaultProps;for(var i in t)r[i]===void 0&&(r[i]=t[i]);return r}return r}function Cd(t,r,i,u){r=t.memoizedState,i=i(u,r),i=i==null?r:J({},r,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var Tu={isMounted:function(t){return(t=t._reactInternals)?ct(t)===t:!1},enqueueSetState:function(t,r,i){t=t._reactInternals;var u=ln(),d=gi(t),p=Ao(u,d);p.payload=r,i!=null&&(p.callback=i),r=mi(t,p,d),r!==null&&(kr(r,t,d,u),wu(r,t,d))},enqueueReplaceState:function(t,r,i){t=t._reactInternals;var u=ln(),d=gi(t),p=Ao(u,d);p.tag=1,p.payload=r,i!=null&&(p.callback=i),r=mi(t,p,d),r!==null&&(kr(r,t,d,u),wu(r,t,d))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var i=ln(),u=gi(t),d=Ao(i,u);d.tag=2,r!=null&&(d.callback=r),r=mi(t,d,u),r!==null&&(kr(r,t,u,i),wu(r,t,u))}};function Rp(t,r,i,u,d,p,x){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,p,x):r.prototype&&r.prototype.isPureReactComponent?!ti(i,u)||!ti(d,p):!0}function Lp(t,r,i){var u=!1,d=vr,p=r.contextType;return typeof p=="object"&&p!==null?p=Xn(p):(d=h(r)?So:Tt.current,u=r.contextTypes,p=(u=u!=null)?si(t,d):vr),r=new r(i,p),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Tu,t.stateNode=r,r._reactInternals=t,u&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=d,t.__reactInternalMemoizedMaskedChildContext=p),r}function Mp(t,r,i,u){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,u),r.state!==t&&Tu.enqueueReplaceState(r,r.state,null)}function Sd(t,r,i,u){var d=t.stateNode;d.props=i,d.state=t.memoizedState,d.refs={},ud(t);var p=r.contextType;typeof p=="object"&&p!==null?d.context=Xn(p):(p=h(r)?So:Tt.current,d.context=si(t,p)),d.state=t.memoizedState,p=r.getDerivedStateFromProps,typeof p=="function"&&(Cd(t,r,p,i),d.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(r=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),r!==d.state&&Tu.enqueueReplaceState(d,d.state,null),Cu(t,i,d,u),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308)}function il(t,r){try{var i="",u=r;do i+=ae(u),u=u.return;while(u);var d=i}catch(p){d=`
39
+ Error generating stack: `+p.message+`
40
+ `+p.stack}return{value:t,source:r,stack:d,digest:null}}function kd(t,r,i){return{value:t,source:null,stack:i??null,digest:r??null}}function Pd(t,r){try{console.error(r.value)}catch(i){setTimeout(function(){throw i})}}var _v=typeof WeakMap=="function"?WeakMap:Map;function _p(t,r,i){i=Ao(-1,i),i.tag=3,i.payload={element:null};var u=r.value;return i.callback=function(){Iu||(Iu=!0,zd=u),Pd(t,r)},i}function Ip(t,r,i){i=Ao(-1,i),i.tag=3;var u=t.type.getDerivedStateFromError;if(typeof u=="function"){var d=r.value;i.payload=function(){return u(d)},i.callback=function(){Pd(t,r)}}var p=t.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){Pd(t,r),typeof u!="function"&&(pi===null?pi=new Set([this]):pi.add(this));var x=r.stack;this.componentDidCatch(r.value,{componentStack:x!==null?x:""})}),i}function Fp(t,r,i){var u=t.pingCache;if(u===null){u=t.pingCache=new _v;var d=new Set;u.set(r,d)}else d=u.get(r),d===void 0&&(d=new Set,u.set(r,d));d.has(i)||(d.add(i),t=qv.bind(null,t,r,i),r.then(t,t))}function Bp(t){do{var r;if((r=t.tag===13)&&(r=t.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return t;t=t.return}while(t!==null);return null}function Op(t,r,i,u,d){return(t.mode&1)===0?(t===r?t.flags|=65536:(t.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(r=Ao(-1,1),r.tag=2,mi(i,r,1))),i.lanes|=1),t):(t.flags|=65536,t.lanes=d,t)}var Iv=H.ReactCurrentOwner,mn=!1;function an(t,r,i,u){r.child=t===null?ip(r,null,i,u):tl(r,t.child,i,u)}function zp(t,r,i,u,d){i=i.render;var p=r.ref;return rl(r,d),u=gd(t,r,i,u,p,d),i=yd(),t!==null&&!mn?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~d,Do(t,r,d)):(nt&&i&&Zc(r),r.flags|=1,an(t,r,u,d),r.child)}function Hp(t,r,i,u,d){if(t===null){var p=i.type;return typeof p=="function"&&!Gd(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(r.tag=15,r.type=p,Up(t,r,p,u,d)):(t=Uu(i.type,null,u,r,r.mode,d),t.ref=r.ref,t.return=r,r.child=t)}if(p=t.child,(t.lanes&d)===0){var x=p.memoizedProps;if(i=i.compare,i=i!==null?i:ti,i(x,u)&&t.ref===r.ref)return Do(t,r,d)}return r.flags|=1,t=bi(p,u),t.ref=r.ref,t.return=r,r.child=t}function Up(t,r,i,u,d){if(t!==null){var p=t.memoizedProps;if(ti(p,u)&&t.ref===r.ref)if(mn=!1,r.pendingProps=u=p,(t.lanes&d)!==0)(t.flags&131072)!==0&&(mn=!0);else return r.lanes=t.lanes,Do(t,r,d)}return Ed(t,r,i,u,d)}function Kp(t,r,i){var u=r.pendingProps,d=u.children,p=t!==null?t.memoizedState:null;if(u.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ve(ll,Ln),Ln|=i;else{if((i&1073741824)===0)return t=p!==null?p.baseLanes|i:i,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:t,cachePool:null,transitions:null},r.updateQueue=null,Ve(ll,Ln),Ln|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=p!==null?p.baseLanes:i,Ve(ll,Ln),Ln|=u}else p!==null?(u=p.baseLanes|i,r.memoizedState=null):u=i,Ve(ll,Ln),Ln|=u;return an(t,r,d,i),r.child}function $p(t,r){var i=r.ref;(t===null&&i!==null||t!==null&&t.ref!==i)&&(r.flags|=512,r.flags|=2097152)}function Ed(t,r,i,u,d){var p=h(i)?So:Tt.current;return p=si(r,p),rl(r,d),i=gd(t,r,i,u,p,d),u=yd(),t!==null&&!mn?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~d,Do(t,r,d)):(nt&&u&&Zc(r),r.flags|=1,an(t,r,i,d),r.child)}function Vp(t,r,i,u,d){if(h(i)){var p=!0;ye(r)}else p=!1;if(rl(r,d),r.stateNode===null)Nu(t,r),Lp(r,i,u),Sd(r,i,u,d),u=!0;else if(t===null){var x=r.stateNode,D=r.memoizedProps;x.props=D;var R=x.context,W=i.contextType;typeof W=="object"&&W!==null?W=Xn(W):(W=h(i)?So:Tt.current,W=si(r,W));var ee=i.getDerivedStateFromProps,te=typeof ee=="function"||typeof x.getSnapshotBeforeUpdate=="function";te||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(D!==u||R!==W)&&Mp(r,x,u,W),di=!1;var Z=r.memoizedState;x.state=Z,Cu(r,u,x,d),R=r.memoizedState,D!==u||Z!==R||Yt.current||di?(typeof ee=="function"&&(Cd(r,i,ee,u),R=r.memoizedState),(D=di||Rp(r,i,D,u,Z,R,W))?(te||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(r.flags|=4194308)):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=R),x.props=u,x.state=R,x.context=W,u=D):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{x=r.stateNode,lp(t,r),D=r.memoizedProps,W=r.type===r.elementType?D:wr(r.type,D),x.props=W,te=r.pendingProps,Z=x.context,R=i.contextType,typeof R=="object"&&R!==null?R=Xn(R):(R=h(i)?So:Tt.current,R=si(r,R));var he=i.getDerivedStateFromProps;(ee=typeof he=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(D!==te||Z!==R)&&Mp(r,x,u,R),di=!1,Z=r.memoizedState,x.state=Z,Cu(r,u,x,d);var ve=r.memoizedState;D!==te||Z!==ve||Yt.current||di?(typeof he=="function"&&(Cd(r,i,he,u),ve=r.memoizedState),(W=di||Rp(r,i,W,u,Z,ve,R)||!1)?(ee||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,ve,R),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,ve,R)),typeof x.componentDidUpdate=="function"&&(r.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof x.componentDidUpdate!="function"||D===t.memoizedProps&&Z===t.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&Z===t.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=ve),x.props=u,x.state=ve,x.context=R,u=W):(typeof x.componentDidUpdate!="function"||D===t.memoizedProps&&Z===t.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&Z===t.memoizedState||(r.flags|=1024),u=!1)}return Ad(t,r,i,u,p,d)}function Ad(t,r,i,u,d,p){$p(t,r);var x=(r.flags&128)!==0;if(!u&&!x)return d&&_e(r,i,!1),Do(t,r,p);u=r.stateNode,Iv.current=r;var D=x&&typeof i.getDerivedStateFromError!="function"?null:u.render();return r.flags|=1,t!==null&&x?(r.child=tl(r,t.child,null,p),r.child=tl(r,null,D,p)):an(t,r,D,p),r.memoizedState=u.state,d&&_e(r,i,!0),r.child}function Wp(t){var r=t.stateNode;r.pendingContext?_(t,r.pendingContext,r.pendingContext!==r.context):r.context&&_(t,r.context,!1),cd(t,r.containerInfo)}function Gp(t,r,i,u,d){return el(),rd(d),r.flags|=256,an(t,r,i,u),r.child}var Dd={dehydrated:null,treeContext:null,retryLane:0};function Td(t){return{baseLanes:t,cachePool:null,transitions:null}}function Yp(t,r,i){var u=r.pendingProps,d=lt.current,p=!1,x=(r.flags&128)!==0,D;if((D=x)||(D=t!==null&&t.memoizedState===null?!1:(d&2)!==0),D?(p=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(d|=1),Ve(lt,d&1),t===null)return nd(r),t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((r.mode&1)===0?r.lanes=1:t.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(x=u.children,t=u.fallback,p?(u=r.mode,p=r.child,x={mode:"hidden",children:x},(u&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=x):p=Ku(x,u,0,null),t=da(t,u,i,null),p.return=r,t.return=r,p.sibling=t,r.child=p,r.child.memoizedState=Td(i),r.memoizedState=Dd,t):jd(r,x));if(d=t.memoizedState,d!==null&&(D=d.dehydrated,D!==null))return Fv(t,r,x,u,D,d,i);if(p){p=u.fallback,x=r.mode,d=t.child,D=d.sibling;var R={mode:"hidden",children:u.children};return(x&1)===0&&r.child!==d?(u=r.child,u.childLanes=0,u.pendingProps=R,r.deletions=null):(u=bi(d,R),u.subtreeFlags=d.subtreeFlags&14680064),D!==null?p=bi(D,p):(p=da(p,x,i,null),p.flags|=2),p.return=r,u.return=r,u.sibling=p,r.child=u,u=p,p=r.child,x=t.child.memoizedState,x=x===null?Td(i):{baseLanes:x.baseLanes|i,cachePool:null,transitions:x.transitions},p.memoizedState=x,p.childLanes=t.childLanes&~i,r.memoizedState=Dd,u}return p=t.child,t=p.sibling,u=bi(p,{mode:"visible",children:u.children}),(r.mode&1)===0&&(u.lanes=i),u.return=r,u.sibling=null,t!==null&&(i=r.deletions,i===null?(r.deletions=[t],r.flags|=16):i.push(t)),r.child=u,r.memoizedState=null,u}function jd(t,r){return r=Ku({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function ju(t,r,i,u){return u!==null&&rd(u),tl(r,t.child,null,i),t=jd(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Fv(t,r,i,u,d,p,x){if(i)return r.flags&256?(r.flags&=-257,u=kd(Error(o(422))),ju(t,r,x,u)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(p=u.fallback,d=r.mode,u=Ku({mode:"visible",children:u.children},d,0,null),p=da(p,d,x,null),p.flags|=2,u.return=r,p.return=r,u.sibling=p,r.child=u,(r.mode&1)!==0&&tl(r,t.child,null,x),r.child.memoizedState=Td(x),r.memoizedState=Dd,p);if((r.mode&1)===0)return ju(t,r,x,null);if(d.data==="$!"){if(u=d.nextSibling&&d.nextSibling.dataset,u)var D=u.dgst;return u=D,p=Error(o(419)),u=kd(p,u,void 0),ju(t,r,x,u)}if(D=(x&t.childLanes)!==0,mn||D){if(u=Nt,u!==null){switch(x&-x){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(u.suspendedLanes|x))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,Eo(t,d),kr(u,t,d,-1))}return Wd(),u=kd(Error(o(421))),ju(t,r,x,u)}return d.data==="$?"?(r.flags|=128,r.child=t.child,r=Xv.bind(null,t),d._reactRetry=r,null):(t=p.treeContext,Rn=Wn(d.nextSibling),Nn=r,nt=!0,xr=null,t!==null&&(Yn[qn++]=ko,Yn[qn++]=Po,Yn[qn++]=na,ko=t.id,Po=t.overflow,na=r),r=jd(r,u.children),r.flags|=4096,r)}function qp(t,r,i){t.lanes|=r;var u=t.alternate;u!==null&&(u.lanes|=r),ld(t.return,r,i)}function Nd(t,r,i,u,d){var p=t.memoizedState;p===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:d}:(p.isBackwards=r,p.rendering=null,p.renderingStartTime=0,p.last=u,p.tail=i,p.tailMode=d)}function Xp(t,r,i){var u=r.pendingProps,d=u.revealOrder,p=u.tail;if(an(t,r,u.children,i),u=lt.current,(u&2)!==0)u=u&1|2,r.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&qp(t,i,r);else if(t.tag===19)qp(t,i,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}u&=1}if(Ve(lt,u),(r.mode&1)===0)r.memoizedState=null;else switch(d){case"forwards":for(i=r.child,d=null;i!==null;)t=i.alternate,t!==null&&Su(t)===null&&(d=i),i=i.sibling;i=d,i===null?(d=r.child,r.child=null):(d=i.sibling,i.sibling=null),Nd(r,!1,d,i,p);break;case"backwards":for(i=null,d=r.child,r.child=null;d!==null;){if(t=d.alternate,t!==null&&Su(t)===null){r.child=d;break}t=d.sibling,d.sibling=i,i=d,d=t}Nd(r,!0,i,null,p);break;case"together":Nd(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Nu(t,r){(r.mode&1)===0&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function Do(t,r,i){if(t!==null&&(r.dependencies=t.dependencies),la|=r.lanes,(i&r.childLanes)===0)return null;if(t!==null&&r.child!==t.child)throw Error(o(153));if(r.child!==null){for(t=r.child,i=bi(t,t.pendingProps),r.child=i,i.return=r;t.sibling!==null;)t=t.sibling,i=i.sibling=bi(t,t.pendingProps),i.return=r;i.sibling=null}return r.child}function Bv(t,r,i){switch(r.tag){case 3:Wp(r),el();break;case 5:cp(r);break;case 1:h(r.type)&&ye(r);break;case 4:cd(r,r.stateNode.containerInfo);break;case 10:var u=r.type._context,d=r.memoizedProps.value;Ve(vu,u._currentValue),u._currentValue=d;break;case 13:if(u=r.memoizedState,u!==null)return u.dehydrated!==null?(Ve(lt,lt.current&1),r.flags|=128,null):(i&r.child.childLanes)!==0?Yp(t,r,i):(Ve(lt,lt.current&1),t=Do(t,r,i),t!==null?t.sibling:null);Ve(lt,lt.current&1);break;case 19:if(u=(i&r.childLanes)!==0,(t.flags&128)!==0){if(u)return Xp(t,r,i);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Ve(lt,lt.current),u)break;return null;case 22:case 23:return r.lanes=0,Kp(t,r,i)}return Do(t,r,i)}var Qp,Rd,Jp,Zp;Qp=function(t,r){for(var i=r.child;i!==null;){if(i.tag===5||i.tag===6)t.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Rd=function(){},Jp=function(t,r,i,u){var d=t.memoizedProps;if(d!==u){t=r.stateNode,ia(Yr.current);var p=null;switch(i){case"input":d=In(t,d),u=In(t,u),p=[];break;case"select":d=J({},d,{value:void 0}),u=J({},u,{value:void 0}),p=[];break;case"textarea":d=ot(t,d),u=ot(t,u),p=[];break;default:typeof d.onClick!="function"&&typeof u.onClick=="function"&&(t.onclick=Zi)}ft(i,u);var x;i=null;for(W in d)if(!u.hasOwnProperty(W)&&d.hasOwnProperty(W)&&d[W]!=null)if(W==="style"){var D=d[W];for(x in D)D.hasOwnProperty(x)&&(i||(i={}),i[x]="")}else W!=="dangerouslySetInnerHTML"&&W!=="children"&&W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&W!=="autoFocus"&&(s.hasOwnProperty(W)?p||(p=[]):(p=p||[]).push(W,null));for(W in u){var R=u[W];if(D=d!=null?d[W]:void 0,u.hasOwnProperty(W)&&R!==D&&(R!=null||D!=null))if(W==="style")if(D){for(x in D)!D.hasOwnProperty(x)||R&&R.hasOwnProperty(x)||(i||(i={}),i[x]="");for(x in R)R.hasOwnProperty(x)&&D[x]!==R[x]&&(i||(i={}),i[x]=R[x])}else i||(p||(p=[]),p.push(W,i)),i=R;else W==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,D=D?D.__html:void 0,R!=null&&D!==R&&(p=p||[]).push(W,R)):W==="children"?typeof R!="string"&&typeof R!="number"||(p=p||[]).push(W,""+R):W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&(s.hasOwnProperty(W)?(R!=null&&W==="onScroll"&&$e("scroll",t),p||D===R||(p=[])):(p=p||[]).push(W,R))}i&&(p=p||[]).push("style",i);var W=p;(r.updateQueue=W)&&(r.flags|=4)}},Zp=function(t,r,i,u){i!==u&&(r.flags|=4)};function Ps(t,r){if(!nt)switch(t.tailMode){case"hidden":r=t.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function Xt(t){var r=t.alternate!==null&&t.alternate.child===t.child,i=0,u=0;if(r)for(var d=t.child;d!==null;)i|=d.lanes|d.childLanes,u|=d.subtreeFlags&14680064,u|=d.flags&14680064,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)i|=d.lanes|d.childLanes,u|=d.subtreeFlags,u|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=u,t.childLanes=i,r}function Ov(t,r,i){var u=r.pendingProps;switch(ed(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(r),null;case 1:return h(r.type)&&v(),Xt(r),null;case 3:return u=r.stateNode,ol(),Ge(Yt),Ge(Tt),fd(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(t===null||t.child===null)&&(yu(r)?r.flags|=4:t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,xr!==null&&(Kd(xr),xr=null))),Rd(t,r),Xt(r),null;case 5:dd(r);var d=ia(xs.current);if(i=r.type,t!==null&&r.stateNode!=null)Jp(t,r,i,u,d),t.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!u){if(r.stateNode===null)throw Error(o(166));return Xt(r),null}if(t=ia(Yr.current),yu(r)){u=r.stateNode,i=r.type;var p=r.memoizedProps;switch(u[jn]=r,u[Vr]=p,t=(r.mode&1)!==0,i){case"dialog":$e("cancel",u),$e("close",u);break;case"iframe":case"object":case"embed":$e("load",u);break;case"video":case"audio":for(d=0;d<on.length;d++)$e(on[d],u);break;case"source":$e("error",u);break;case"img":case"image":case"link":$e("error",u),$e("load",u);break;case"details":$e("toggle",u);break;case"input":Io(u,p),$e("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!p.multiple},$e("invalid",u);break;case"textarea":Bo(u,p),$e("invalid",u)}ft(i,p),d=null;for(var x in p)if(p.hasOwnProperty(x)){var D=p[x];x==="children"?typeof D=="string"?u.textContent!==D&&(p.suppressHydrationWarning!==!0&&Ji(u.textContent,D,t),d=["children",D]):typeof D=="number"&&u.textContent!==""+D&&(p.suppressHydrationWarning!==!0&&Ji(u.textContent,D,t),d=["children",""+D]):s.hasOwnProperty(x)&&D!=null&&x==="onScroll"&&$e("scroll",u)}switch(i){case"input":un(u),Cn(u,p,!0);break;case"textarea":un(u),Nr(u);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(u.onclick=Zi)}u=d,r.updateQueue=u,u!==null&&(r.flags|=4)}else{x=d.nodeType===9?d:d.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=tn(i)),t==="http://www.w3.org/1999/xhtml"?i==="script"?(t=x.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof u.is=="string"?t=x.createElement(i,{is:u.is}):(t=x.createElement(i),i==="select"&&(x=t,u.multiple?x.multiple=!0:u.size&&(x.size=u.size))):t=x.createElementNS(t,i),t[jn]=r,t[Vr]=u,Qp(t,r,!1,!1),r.stateNode=t;e:{switch(x=wt(i,u),i){case"dialog":$e("cancel",t),$e("close",t),d=u;break;case"iframe":case"object":case"embed":$e("load",t),d=u;break;case"video":case"audio":for(d=0;d<on.length;d++)$e(on[d],t);d=u;break;case"source":$e("error",t),d=u;break;case"img":case"image":case"link":$e("error",t),$e("load",t),d=u;break;case"details":$e("toggle",t),d=u;break;case"input":Io(t,u),d=In(t,u),$e("invalid",t);break;case"option":d=u;break;case"select":t._wrapperState={wasMultiple:!!u.multiple},d=J({},u,{value:void 0}),$e("invalid",t);break;case"textarea":Bo(t,u),d=ot(t,u),$e("invalid",t);break;default:d=u}ft(i,d),D=d;for(p in D)if(D.hasOwnProperty(p)){var R=D[p];p==="style"?oe(t,R):p==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&Oo(t,R)):p==="children"?typeof R=="string"?(i!=="textarea"||R!=="")&&Mt(t,R):typeof R=="number"&&Mt(t,""+R):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(s.hasOwnProperty(p)?R!=null&&p==="onScroll"&&$e("scroll",t):R!=null&&L(t,p,R,x))}switch(i){case"input":un(t),Cn(t,u,!1);break;case"textarea":un(t),Nr(t);break;case"option":u.value!=null&&t.setAttribute("value",""+De(u.value));break;case"select":t.multiple=!!u.multiple,p=u.value,p!=null?ir(t,!!u.multiple,p,!1):u.defaultValue!=null&&ir(t,!!u.multiple,u.defaultValue,!0);break;default:typeof d.onClick=="function"&&(t.onclick=Zi)}switch(i){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return Xt(r),null;case 6:if(t&&r.stateNode!=null)Zp(t,r,t.memoizedProps,u);else{if(typeof u!="string"&&r.stateNode===null)throw Error(o(166));if(i=ia(xs.current),ia(Yr.current),yu(r)){if(u=r.stateNode,i=r.memoizedProps,u[jn]=r,(p=u.nodeValue!==i)&&(t=Nn,t!==null))switch(t.tag){case 3:Ji(u.nodeValue,i,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ji(u.nodeValue,i,(t.mode&1)!==0)}p&&(r.flags|=4)}else u=(i.nodeType===9?i:i.ownerDocument).createTextNode(u),u[jn]=r,r.stateNode=u}return Xt(r),null;case 13:if(Ge(lt),u=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(nt&&Rn!==null&&(r.mode&1)!==0&&(r.flags&128)===0)np(),el(),r.flags|=98560,p=!1;else if(p=yu(r),u!==null&&u.dehydrated!==null){if(t===null){if(!p)throw Error(o(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[jn]=r}else el(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Xt(r),p=!1}else xr!==null&&(Kd(xr),xr=null),p=!0;if(!p)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=i,r):(u=u!==null,u!==(t!==null&&t.memoizedState!==null)&&u&&(r.child.flags|=8192,(r.mode&1)!==0&&(t===null||(lt.current&1)!==0?Pt===0&&(Pt=3):Wd())),r.updateQueue!==null&&(r.flags|=4),Xt(r),null);case 4:return ol(),Rd(t,r),t===null&&vo(r.stateNode.containerInfo),Xt(r),null;case 10:return ad(r.type._context),Xt(r),null;case 17:return h(r.type)&&v(),Xt(r),null;case 19:if(Ge(lt),p=r.memoizedState,p===null)return Xt(r),null;if(u=(r.flags&128)!==0,x=p.rendering,x===null)if(u)Ps(p,!1);else{if(Pt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(x=Su(t),x!==null){for(r.flags|=128,Ps(p,!1),u=x.updateQueue,u!==null&&(r.updateQueue=u,r.flags|=4),r.subtreeFlags=0,u=i,i=r.child;i!==null;)p=i,t=u,p.flags&=14680066,x=p.alternate,x===null?(p.childLanes=0,p.lanes=t,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=x.childLanes,p.lanes=x.lanes,p.child=x.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=x.memoizedProps,p.memoizedState=x.memoizedState,p.updateQueue=x.updateQueue,p.type=x.type,t=x.dependencies,p.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),i=i.sibling;return Ve(lt,lt.current&1|2),r.child}t=t.sibling}p.tail!==null&&qe()>sl&&(r.flags|=128,u=!0,Ps(p,!1),r.lanes=4194304)}else{if(!u)if(t=Su(x),t!==null){if(r.flags|=128,u=!0,i=t.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),Ps(p,!0),p.tail===null&&p.tailMode==="hidden"&&!x.alternate&&!nt)return Xt(r),null}else 2*qe()-p.renderingStartTime>sl&&i!==1073741824&&(r.flags|=128,u=!0,Ps(p,!1),r.lanes=4194304);p.isBackwards?(x.sibling=r.child,r.child=x):(i=p.last,i!==null?i.sibling=x:r.child=x,p.last=x)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=qe(),r.sibling=null,i=lt.current,Ve(lt,u?i&1|2:i&1),r):(Xt(r),null);case 22:case 23:return Vd(),u=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==u&&(r.flags|=8192),u&&(r.mode&1)!==0?(Ln&1073741824)!==0&&(Xt(r),r.subtreeFlags&6&&(r.flags|=8192)):Xt(r),null;case 24:return null;case 25:return null}throw Error(o(156,r.tag))}function zv(t,r){switch(ed(r),r.tag){case 1:return h(r.type)&&v(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return ol(),Ge(Yt),Ge(Tt),fd(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return dd(r),null;case 13:if(Ge(lt),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(o(340));el()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Ge(lt),null;case 4:return ol(),null;case 10:return ad(r.type._context),null;case 22:case 23:return Vd(),null;case 24:return null;default:return null}}var Ru=!1,Qt=!1,Hv=typeof WeakSet=="function"?WeakSet:Set,be=null;function al(t,r){var i=t.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(u){dt(t,r,u)}else i.current=null}function Ld(t,r,i){try{i()}catch(u){dt(t,r,u)}}var eh=!1;function Uv(t,r){if(Xa=mo,t=ni(),Oe(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var d=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var x=0,D=-1,R=-1,W=0,ee=0,te=t,Z=null;t:for(;;){for(var he;te!==i||d!==0&&te.nodeType!==3||(D=x+d),te!==p||u!==0&&te.nodeType!==3||(R=x+u),te.nodeType===3&&(x+=te.nodeValue.length),(he=te.firstChild)!==null;)Z=te,te=he;for(;;){if(te===t)break t;if(Z===i&&++W===d&&(D=x),Z===p&&++ee===u&&(R=x),(he=te.nextSibling)!==null)break;te=Z,Z=te.parentNode}te=he}i=D===-1||R===-1?null:{start:D,end:R}}else i=null}i=i||{start:0,end:0}}else i=null;for(Tn={focusedElem:t,selectionRange:i},mo=!1,be=r;be!==null;)if(r=be,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,be=t;else for(;be!==null;){r=be;try{var ve=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var xe=ve.memoizedProps,pt=ve.memoizedState,O=r.stateNode,I=O.getSnapshotBeforeUpdate(r.elementType===r.type?xe:wr(r.type,xe),pt);O.__reactInternalSnapshotBeforeUpdate=I}break;case 3:var U=r.stateNode.containerInfo;U.nodeType===1?U.textContent="":U.nodeType===9&&U.documentElement&&U.removeChild(U.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(se){dt(r,r.return,se)}if(t=r.sibling,t!==null){t.return=r.return,be=t;break}be=r.return}return ve=eh,eh=!1,ve}function Es(t,r,i){var u=r.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var d=u=u.next;do{if((d.tag&t)===t){var p=d.destroy;d.destroy=void 0,p!==void 0&&Ld(r,i,p)}d=d.next}while(d!==u)}}function Lu(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var u=i.create;i.destroy=u()}i=i.next}while(i!==r)}}function Md(t){var r=t.ref;if(r!==null){var i=t.stateNode;switch(t.tag){case 5:t=i;break;default:t=i}typeof r=="function"?r(t):r.current=t}}function th(t){var r=t.alternate;r!==null&&(t.alternate=null,th(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[jn],delete r[Vr],delete r[li],delete r[hs],delete r[gs])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function nh(t){return t.tag===5||t.tag===3||t.tag===4}function rh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||nh(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function _d(t,r,i){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?i.nodeType===8?i.parentNode.insertBefore(t,r):i.insertBefore(t,r):(i.nodeType===8?(r=i.parentNode,r.insertBefore(t,i)):(r=i,r.appendChild(t)),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Zi));else if(u!==4&&(t=t.child,t!==null))for(_d(t,r,i),t=t.sibling;t!==null;)_d(t,r,i),t=t.sibling}function Id(t,r,i){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?i.insertBefore(t,r):i.appendChild(t);else if(u!==4&&(t=t.child,t!==null))for(Id(t,r,i),t=t.sibling;t!==null;)Id(t,r,i),t=t.sibling}var Bt=null,Cr=!1;function fi(t,r,i){for(i=i.child;i!==null;)oh(t,r,i),i=i.sibling}function oh(t,r,i){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(Ir,i)}catch{}switch(i.tag){case 5:Qt||al(i,r);case 6:var u=Bt,d=Cr;Bt=null,fi(t,r,i),Bt=u,Cr=d,Bt!==null&&(Cr?(t=Bt,i=i.stateNode,t.nodeType===8?t.parentNode.removeChild(i):t.removeChild(i)):Bt.removeChild(i.stateNode));break;case 18:Bt!==null&&(Cr?(t=Bt,i=i.stateNode,t.nodeType===8?Vn(t.parentNode,i):t.nodeType===1&&Vn(t,i),Dn(t)):Vn(Bt,i.stateNode));break;case 4:u=Bt,d=Cr,Bt=i.stateNode.containerInfo,Cr=!0,fi(t,r,i),Bt=u,Cr=d;break;case 0:case 11:case 14:case 15:if(!Qt&&(u=i.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){d=u=u.next;do{var p=d,x=p.destroy;p=p.tag,x!==void 0&&((p&2)!==0||(p&4)!==0)&&Ld(i,r,x),d=d.next}while(d!==u)}fi(t,r,i);break;case 1:if(!Qt&&(al(i,r),u=i.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=i.memoizedProps,u.state=i.memoizedState,u.componentWillUnmount()}catch(D){dt(i,r,D)}fi(t,r,i);break;case 21:fi(t,r,i);break;case 22:i.mode&1?(Qt=(u=Qt)||i.memoizedState!==null,fi(t,r,i),Qt=u):fi(t,r,i);break;default:fi(t,r,i)}}function ih(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var i=t.stateNode;i===null&&(i=t.stateNode=new Hv),r.forEach(function(u){var d=Qv.bind(null,t,u);i.has(u)||(i.add(u),u.then(d,d))})}}function Sr(t,r){var i=r.deletions;if(i!==null)for(var u=0;u<i.length;u++){var d=i[u];try{var p=t,x=r,D=x;e:for(;D!==null;){switch(D.tag){case 5:Bt=D.stateNode,Cr=!1;break e;case 3:Bt=D.stateNode.containerInfo,Cr=!0;break e;case 4:Bt=D.stateNode.containerInfo,Cr=!0;break e}D=D.return}if(Bt===null)throw Error(o(160));oh(p,x,d),Bt=null,Cr=!1;var R=d.alternate;R!==null&&(R.return=null),d.return=null}catch(W){dt(d,r,W)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)ah(r,t),r=r.sibling}function ah(t,r){var i=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Sr(r,t),Xr(t),u&4){try{Es(3,t,t.return),Lu(3,t)}catch(xe){dt(t,t.return,xe)}try{Es(5,t,t.return)}catch(xe){dt(t,t.return,xe)}}break;case 1:Sr(r,t),Xr(t),u&512&&i!==null&&al(i,i.return);break;case 5:if(Sr(r,t),Xr(t),u&512&&i!==null&&al(i,i.return),t.flags&32){var d=t.stateNode;try{Mt(d,"")}catch(xe){dt(t,t.return,xe)}}if(u&4&&(d=t.stateNode,d!=null)){var p=t.memoizedProps,x=i!==null?i.memoizedProps:p,D=t.type,R=t.updateQueue;if(t.updateQueue=null,R!==null)try{D==="input"&&p.type==="radio"&&p.name!=null&&oo(d,p),wt(D,x);var W=wt(D,p);for(x=0;x<R.length;x+=2){var ee=R[x],te=R[x+1];ee==="style"?oe(d,te):ee==="dangerouslySetInnerHTML"?Oo(d,te):ee==="children"?Mt(d,te):L(d,ee,te,W)}switch(D){case"input":Le(d,p);break;case"textarea":it(d,p);break;case"select":var Z=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var he=p.value;he!=null?ir(d,!!p.multiple,he,!1):Z!==!!p.multiple&&(p.defaultValue!=null?ir(d,!!p.multiple,p.defaultValue,!0):ir(d,!!p.multiple,p.multiple?[]:"",!1))}d[Vr]=p}catch(xe){dt(t,t.return,xe)}}break;case 6:if(Sr(r,t),Xr(t),u&4){if(t.stateNode===null)throw Error(o(162));d=t.stateNode,p=t.memoizedProps;try{d.nodeValue=p}catch(xe){dt(t,t.return,xe)}}break;case 3:if(Sr(r,t),Xr(t),u&4&&i!==null&&i.memoizedState.isDehydrated)try{Dn(r.containerInfo)}catch(xe){dt(t,t.return,xe)}break;case 4:Sr(r,t),Xr(t);break;case 13:Sr(r,t),Xr(t),d=t.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Od=qe())),u&4&&ih(t);break;case 22:if(ee=i!==null&&i.memoizedState!==null,t.mode&1?(Qt=(W=Qt)||ee,Sr(r,t),Qt=W):Sr(r,t),Xr(t),u&8192){if(W=t.memoizedState!==null,(t.stateNode.isHidden=W)&&!ee&&(t.mode&1)!==0)for(be=t,ee=t.child;ee!==null;){for(te=be=ee;be!==null;){switch(Z=be,he=Z.child,Z.tag){case 0:case 11:case 14:case 15:Es(4,Z,Z.return);break;case 1:al(Z,Z.return);var ve=Z.stateNode;if(typeof ve.componentWillUnmount=="function"){u=Z,i=Z.return;try{r=u,ve.props=r.memoizedProps,ve.state=r.memoizedState,ve.componentWillUnmount()}catch(xe){dt(u,i,xe)}}break;case 5:al(Z,Z.return);break;case 22:if(Z.memoizedState!==null){uh(te);continue}}he!==null?(he.return=Z,be=he):uh(te)}ee=ee.sibling}e:for(ee=null,te=t;;){if(te.tag===5){if(ee===null){ee=te;try{d=te.stateNode,W?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(D=te.stateNode,R=te.memoizedProps.style,x=R!=null&&R.hasOwnProperty("display")?R.display:null,D.style.display=Fn("display",x))}catch(xe){dt(t,t.return,xe)}}}else if(te.tag===6){if(ee===null)try{te.stateNode.nodeValue=W?"":te.memoizedProps}catch(xe){dt(t,t.return,xe)}}else if((te.tag!==22&&te.tag!==23||te.memoizedState===null||te===t)&&te.child!==null){te.child.return=te,te=te.child;continue}if(te===t)break e;for(;te.sibling===null;){if(te.return===null||te.return===t)break e;ee===te&&(ee=null),te=te.return}ee===te&&(ee=null),te.sibling.return=te.return,te=te.sibling}}break;case 19:Sr(r,t),Xr(t),u&4&&ih(t);break;case 21:break;default:Sr(r,t),Xr(t)}}function Xr(t){var r=t.flags;if(r&2){try{e:{for(var i=t.return;i!==null;){if(nh(i)){var u=i;break e}i=i.return}throw Error(o(160))}switch(u.tag){case 5:var d=u.stateNode;u.flags&32&&(Mt(d,""),u.flags&=-33);var p=rh(t);Id(t,p,d);break;case 3:case 4:var x=u.stateNode.containerInfo,D=rh(t);_d(t,D,x);break;default:throw Error(o(161))}}catch(R){dt(t,t.return,R)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Kv(t,r,i){be=t,lh(t)}function lh(t,r,i){for(var u=(t.mode&1)!==0;be!==null;){var d=be,p=d.child;if(d.tag===22&&u){var x=d.memoizedState!==null||Ru;if(!x){var D=d.alternate,R=D!==null&&D.memoizedState!==null||Qt;D=Ru;var W=Qt;if(Ru=x,(Qt=R)&&!W)for(be=d;be!==null;)x=be,R=x.child,x.tag===22&&x.memoizedState!==null?ch(d):R!==null?(R.return=x,be=R):ch(d);for(;p!==null;)be=p,lh(p),p=p.sibling;be=d,Ru=D,Qt=W}sh(t)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,be=p):sh(t)}}function sh(t){for(;be!==null;){var r=be;if((r.flags&8772)!==0){var i=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:Qt||Lu(5,r);break;case 1:var u=r.stateNode;if(r.flags&4&&!Qt)if(i===null)u.componentDidMount();else{var d=r.elementType===r.type?i.memoizedProps:wr(r.type,i.memoizedProps);u.componentDidUpdate(d,i.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var p=r.updateQueue;p!==null&&up(r,p,u);break;case 3:var x=r.updateQueue;if(x!==null){if(i=null,r.child!==null)switch(r.child.tag){case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}up(r,x,i)}break;case 5:var D=r.stateNode;if(i===null&&r.flags&4){i=D;var R=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&i.focus();break;case"img":R.src&&(i.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var W=r.alternate;if(W!==null){var ee=W.memoizedState;if(ee!==null){var te=ee.dehydrated;te!==null&&Dn(te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Qt||r.flags&512&&Md(r)}catch(Z){dt(r,r.return,Z)}}if(r===t){be=null;break}if(i=r.sibling,i!==null){i.return=r.return,be=i;break}be=r.return}}function uh(t){for(;be!==null;){var r=be;if(r===t){be=null;break}var i=r.sibling;if(i!==null){i.return=r.return,be=i;break}be=r.return}}function ch(t){for(;be!==null;){var r=be;try{switch(r.tag){case 0:case 11:case 15:var i=r.return;try{Lu(4,r)}catch(R){dt(r,i,R)}break;case 1:var u=r.stateNode;if(typeof u.componentDidMount=="function"){var d=r.return;try{u.componentDidMount()}catch(R){dt(r,d,R)}}var p=r.return;try{Md(r)}catch(R){dt(r,p,R)}break;case 5:var x=r.return;try{Md(r)}catch(R){dt(r,x,R)}}}catch(R){dt(r,r.return,R)}if(r===t){be=null;break}var D=r.sibling;if(D!==null){D.return=r.return,be=D;break}be=r.return}}var $v=Math.ceil,Mu=H.ReactCurrentDispatcher,Fd=H.ReactCurrentOwner,Jn=H.ReactCurrentBatchConfig,He=0,Nt=null,yt=null,Ot=0,Ln=0,ll=br(0),Pt=0,As=null,la=0,_u=0,Bd=0,Ds=null,fn=null,Od=0,sl=1/0,To=null,Iu=!1,zd=null,pi=null,Fu=!1,hi=null,Bu=0,Ts=0,Hd=null,Ou=-1,zu=0;function ln(){return(He&6)!==0?qe():Ou!==-1?Ou:Ou=qe()}function gi(t){return(t.mode&1)===0?1:(He&2)!==0&&Ot!==0?Ot&-Ot:Av.transition!==null?(zu===0&&(zu=Sa()),zu):(t=ze,t!==0||(t=window.event,t=t===void 0?16:Ta(t.type)),t)}function kr(t,r,i,u){if(50<Ts)throw Ts=0,Hd=null,Error(o(185));uo(t,i,u),((He&2)===0||t!==Nt)&&(t===Nt&&((He&2)===0&&(_u|=i),Pt===4&&yi(t,Ot)),pn(t,u),i===1&&He===0&&(r.mode&1)===0&&(sl=qe()+500,ui&&ci()))}function pn(t,r){var i=t.callbackNode;Fi(t,r);var u=Ii(t,t===Nt?Ot:0);if(u===0)i!==null&&Hn(i),t.callbackNode=null,t.callbackPriority=0;else if(r=u&-u,t.callbackPriority!==r){if(i!=null&&Hn(i),r===1)t.tag===0?Ev(mh.bind(null,t)):Qf(mh.bind(null,t)),Xc(function(){(He&6)===0&&ci()}),i=null;else{switch(Il(u)){case 1:i=lo;break;case 4:i=xa;break;case 16:i=_r;break;case 536870912:i=wa;break;default:i=_r}i=xh(i,dh.bind(null,t))}t.callbackPriority=r,t.callbackNode=i}}function dh(t,r){if(Ou=-1,zu=0,(He&6)!==0)throw Error(o(327));var i=t.callbackNode;if(ul()&&t.callbackNode!==i)return null;var u=Ii(t,t===Nt?Ot:0);if(u===0)return null;if((u&30)!==0||(u&t.expiredLanes)!==0||r)r=Hu(t,u);else{r=u;var d=He;He|=2;var p=ph();(Nt!==t||Ot!==r)&&(To=null,sl=qe()+500,ua(t,r));do try{Gv();break}catch(D){fh(t,D)}while(!0);id(),Mu.current=p,He=d,yt!==null?r=0:(Nt=null,Ot=0,r=Pt)}if(r!==0){if(r===2&&(d=Ca(t),d!==0&&(u=d,r=Ud(t,d))),r===1)throw i=As,ua(t,0),yi(t,u),pn(t,qe()),i;if(r===6)yi(t,u);else{if(d=t.current.alternate,(u&30)===0&&!Vv(d)&&(r=Hu(t,u),r===2&&(p=Ca(t),p!==0&&(u=p,r=Ud(t,p))),r===1))throw i=As,ua(t,0),yi(t,u),pn(t,qe()),i;switch(t.finishedWork=d,t.finishedLanes=u,r){case 0:case 1:throw Error(o(345));case 2:ca(t,fn,To);break;case 3:if(yi(t,u),(u&130023424)===u&&(r=Od+500-qe(),10<r)){if(Ii(t,0)!==0)break;if(d=t.suspendedLanes,(d&u)!==u){ln(),t.pingedLanes|=t.suspendedLanes&d;break}t.timeoutHandle=ta(ca.bind(null,t,fn,To),r);break}ca(t,fn,To);break;case 4:if(yi(t,u),(u&4194240)===u)break;for(r=t.eventTimes,d=-1;0<u;){var x=31-It(u);p=1<<x,x=r[x],x>d&&(d=x),u&=~p}if(u=d,u=qe()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*$v(u/1960))-u,10<u){t.timeoutHandle=ta(ca.bind(null,t,fn,To),u);break}ca(t,fn,To);break;case 5:ca(t,fn,To);break;default:throw Error(o(329))}}}return pn(t,qe()),t.callbackNode===i?dh.bind(null,t):null}function Ud(t,r){var i=Ds;return t.current.memoizedState.isDehydrated&&(ua(t,r).flags|=256),t=Hu(t,r),t!==2&&(r=fn,fn=i,r!==null&&Kd(r)),t}function Kd(t){fn===null?fn=t:fn.push.apply(fn,t)}function Vv(t){for(var r=t;;){if(r.flags&16384){var i=r.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var u=0;u<i.length;u++){var d=i[u],p=d.getSnapshot;d=d.value;try{if(!dn(p(),d))return!1}catch{return!1}}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function yi(t,r){for(r&=~Bd,r&=~_u,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var i=31-It(r),u=1<<i;t[i]=-1,r&=~u}}function mh(t){if((He&6)!==0)throw Error(o(327));ul();var r=Ii(t,0);if((r&1)===0)return pn(t,qe()),null;var i=Hu(t,r);if(t.tag!==0&&i===2){var u=Ca(t);u!==0&&(r=u,i=Ud(t,u))}if(i===1)throw i=As,ua(t,0),yi(t,r),pn(t,qe()),i;if(i===6)throw Error(o(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,ca(t,fn,To),pn(t,qe()),null}function $d(t,r){var i=He;He|=1;try{return t(r)}finally{He=i,He===0&&(sl=qe()+500,ui&&ci())}}function sa(t){hi!==null&&hi.tag===0&&(He&6)===0&&ul();var r=He;He|=1;var i=Jn.transition,u=ze;try{if(Jn.transition=null,ze=1,t)return t()}finally{ze=u,Jn.transition=i,He=r,(He&6)===0&&ci()}}function Vd(){Ln=ll.current,Ge(ll)}function ua(t,r){t.finishedWork=null,t.finishedLanes=0;var i=t.timeoutHandle;if(i!==-1&&(t.timeoutHandle=-1,fs(i)),yt!==null)for(i=yt.return;i!==null;){var u=i;switch(ed(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&v();break;case 3:ol(),Ge(Yt),Ge(Tt),fd();break;case 5:dd(u);break;case 4:ol();break;case 13:Ge(lt);break;case 19:Ge(lt);break;case 10:ad(u.type._context);break;case 22:case 23:Vd()}i=i.return}if(Nt=t,yt=t=bi(t.current,null),Ot=Ln=r,Pt=0,As=null,Bd=_u=la=0,fn=Ds=null,oa!==null){for(r=0;r<oa.length;r++)if(i=oa[r],u=i.interleaved,u!==null){i.interleaved=null;var d=u.next,p=i.pending;if(p!==null){var x=p.next;p.next=d,u.next=x}i.pending=u}oa=null}return t}function fh(t,r){do{var i=yt;try{if(id(),ku.current=Du,Pu){for(var u=st.memoizedState;u!==null;){var d=u.queue;d!==null&&(d.pending=null),u=u.next}Pu=!1}if(aa=0,jt=kt=st=null,ws=!1,Cs=0,Fd.current=null,i===null||i.return===null){Pt=1,As=r,yt=null;break}e:{var p=t,x=i.return,D=i,R=r;if(r=Ot,D.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var W=R,ee=D,te=ee.tag;if((ee.mode&1)===0&&(te===0||te===11||te===15)){var Z=ee.alternate;Z?(ee.updateQueue=Z.updateQueue,ee.memoizedState=Z.memoizedState,ee.lanes=Z.lanes):(ee.updateQueue=null,ee.memoizedState=null)}var he=Bp(x);if(he!==null){he.flags&=-257,Op(he,x,D,p,r),he.mode&1&&Fp(p,W,r),r=he,R=W;var ve=r.updateQueue;if(ve===null){var xe=new Set;xe.add(R),r.updateQueue=xe}else ve.add(R);break e}else{if((r&1)===0){Fp(p,W,r),Wd();break e}R=Error(o(426))}}else if(nt&&D.mode&1){var pt=Bp(x);if(pt!==null){(pt.flags&65536)===0&&(pt.flags|=256),Op(pt,x,D,p,r),rd(il(R,D));break e}}p=R=il(R,D),Pt!==4&&(Pt=2),Ds===null?Ds=[p]:Ds.push(p),p=x;do{switch(p.tag){case 3:p.flags|=65536,r&=-r,p.lanes|=r;var O=_p(p,R,r);sp(p,O);break e;case 1:D=R;var I=p.type,U=p.stateNode;if((p.flags&128)===0&&(typeof I.getDerivedStateFromError=="function"||U!==null&&typeof U.componentDidCatch=="function"&&(pi===null||!pi.has(U)))){p.flags|=65536,r&=-r,p.lanes|=r;var se=Ip(p,D,r);sp(p,se);break e}}p=p.return}while(p!==null)}gh(i)}catch(we){r=we,yt===i&&i!==null&&(yt=i=i.return);continue}break}while(!0)}function ph(){var t=Mu.current;return Mu.current=Du,t===null?Du:t}function Wd(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Nt===null||(la&268435455)===0&&(_u&268435455)===0||yi(Nt,Ot)}function Hu(t,r){var i=He;He|=2;var u=ph();(Nt!==t||Ot!==r)&&(To=null,ua(t,r));do try{Wv();break}catch(d){fh(t,d)}while(!0);if(id(),He=i,Mu.current=u,yt!==null)throw Error(o(261));return Nt=null,Ot=0,Pt}function Wv(){for(;yt!==null;)hh(yt)}function Gv(){for(;yt!==null&&!nn();)hh(yt)}function hh(t){var r=vh(t.alternate,t,Ln);t.memoizedProps=t.pendingProps,r===null?gh(t):yt=r,Fd.current=null}function gh(t){var r=t;do{var i=r.alternate;if(t=r.return,(r.flags&32768)===0){if(i=Ov(i,r,Ln),i!==null){yt=i;return}}else{if(i=zv(i,r),i!==null){i.flags&=32767,yt=i;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Pt=6,yt=null;return}}if(r=r.sibling,r!==null){yt=r;return}yt=r=t}while(r!==null);Pt===0&&(Pt=5)}function ca(t,r,i){var u=ze,d=Jn.transition;try{Jn.transition=null,ze=1,Yv(t,r,i,u)}finally{Jn.transition=d,ze=u}return null}function Yv(t,r,i,u){do ul();while(hi!==null);if((He&6)!==0)throw Error(o(327));i=t.finishedWork;var d=t.finishedLanes;if(i===null)return null;if(t.finishedWork=null,t.finishedLanes=0,i===t.current)throw Error(o(177));t.callbackNode=null,t.callbackPriority=0;var p=i.lanes|i.childLanes;if(_l(t,p),t===Nt&&(yt=Nt=null,Ot=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Fu||(Fu=!0,xh(_r,function(){return ul(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Jn.transition,Jn.transition=null;var x=ze;ze=1;var D=He;He|=4,Fd.current=null,Uv(t,i),ah(i,t),Ba(Tn),mo=!!Xa,Tn=Xa=null,t.current=i,Kv(i),Li(),He=D,ze=x,Jn.transition=p}else t.current=i;if(Fu&&(Fu=!1,hi=t,Bu=d),p=t.pendingLanes,p===0&&(pi=null),jl(i.stateNode),pn(t,qe()),r!==null)for(u=t.onRecoverableError,i=0;i<r.length;i++)d=r[i],u(d.value,{componentStack:d.stack,digest:d.digest});if(Iu)throw Iu=!1,t=zd,zd=null,t;return(Bu&1)!==0&&t.tag!==0&&ul(),p=t.pendingLanes,(p&1)!==0?t===Hd?Ts++:(Ts=0,Hd=t):Ts=0,ci(),null}function ul(){if(hi!==null){var t=Il(Bu),r=Jn.transition,i=ze;try{if(Jn.transition=null,ze=16>t?16:t,hi===null)var u=!1;else{if(t=hi,hi=null,Bu=0,(He&6)!==0)throw Error(o(331));var d=He;for(He|=4,be=t.current;be!==null;){var p=be,x=p.child;if((be.flags&16)!==0){var D=p.deletions;if(D!==null){for(var R=0;R<D.length;R++){var W=D[R];for(be=W;be!==null;){var ee=be;switch(ee.tag){case 0:case 11:case 15:Es(8,ee,p)}var te=ee.child;if(te!==null)te.return=ee,be=te;else for(;be!==null;){ee=be;var Z=ee.sibling,he=ee.return;if(th(ee),ee===W){be=null;break}if(Z!==null){Z.return=he,be=Z;break}be=he}}}var ve=p.alternate;if(ve!==null){var xe=ve.child;if(xe!==null){ve.child=null;do{var pt=xe.sibling;xe.sibling=null,xe=pt}while(xe!==null)}}be=p}}if((p.subtreeFlags&2064)!==0&&x!==null)x.return=p,be=x;else e:for(;be!==null;){if(p=be,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Es(9,p,p.return)}var O=p.sibling;if(O!==null){O.return=p.return,be=O;break e}be=p.return}}var I=t.current;for(be=I;be!==null;){x=be;var U=x.child;if((x.subtreeFlags&2064)!==0&&U!==null)U.return=x,be=U;else e:for(x=I;be!==null;){if(D=be,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Lu(9,D)}}catch(we){dt(D,D.return,we)}if(D===x){be=null;break e}var se=D.sibling;if(se!==null){se.return=D.return,be=se;break e}be=D.return}}if(He=d,ci(),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(Ir,t)}catch{}u=!0}return u}finally{ze=i,Jn.transition=r}}return!1}function yh(t,r,i){r=il(i,r),r=_p(t,r,1),t=mi(t,r,1),r=ln(),t!==null&&(uo(t,1,r),pn(t,r))}function dt(t,r,i){if(t.tag===3)yh(t,t,i);else for(;r!==null;){if(r.tag===3){yh(r,t,i);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(pi===null||!pi.has(u))){t=il(i,t),t=Ip(r,t,1),r=mi(r,t,1),t=ln(),r!==null&&(uo(r,1,t),pn(r,t));break}}r=r.return}}function qv(t,r,i){var u=t.pingCache;u!==null&&u.delete(r),r=ln(),t.pingedLanes|=t.suspendedLanes&i,Nt===t&&(Ot&i)===i&&(Pt===4||Pt===3&&(Ot&130023424)===Ot&&500>qe()-Od?ua(t,0):Bd|=i),pn(t,r)}function bh(t,r){r===0&&((t.mode&1)===0?r=1:(r=Ko,Ko<<=1,(Ko&130023424)===0&&(Ko=4194304)));var i=ln();t=Eo(t,r),t!==null&&(uo(t,r,i),pn(t,i))}function Xv(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),bh(t,i)}function Qv(t,r){var i=0;switch(t.tag){case 13:var u=t.stateNode,d=t.memoizedState;d!==null&&(i=d.retryLane);break;case 19:u=t.stateNode;break;default:throw Error(o(314))}u!==null&&u.delete(r),bh(t,i)}var vh;vh=function(t,r,i){if(t!==null)if(t.memoizedProps!==r.pendingProps||Yt.current)mn=!0;else{if((t.lanes&i)===0&&(r.flags&128)===0)return mn=!1,Bv(t,r,i);mn=(t.flags&131072)!==0}else mn=!1,nt&&(r.flags&1048576)!==0&&Jf(r,gu,r.index);switch(r.lanes=0,r.tag){case 2:var u=r.type;Nu(t,r),t=r.pendingProps;var d=si(r,Tt.current);rl(r,i),d=gd(null,r,u,t,d,i);var p=yd();return r.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,h(u)?(p=!0,ye(r)):p=!1,r.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,ud(r),d.updater=Tu,r.stateNode=d,d._reactInternals=r,Sd(r,u,t,i),r=Ad(null,r,u,!0,p,i)):(r.tag=0,nt&&p&&Zc(r),an(null,r,d,i),r=r.child),r;case 16:u=r.elementType;e:{switch(Nu(t,r),t=r.pendingProps,d=u._init,u=d(u._payload),r.type=u,d=r.tag=Zv(u),t=wr(u,t),d){case 0:r=Ed(null,r,u,t,i);break e;case 1:r=Vp(null,r,u,t,i);break e;case 11:r=zp(null,r,u,t,i);break e;case 14:r=Hp(null,r,u,wr(u.type,t),i);break e}throw Error(o(306,u,""))}return r;case 0:return u=r.type,d=r.pendingProps,d=r.elementType===u?d:wr(u,d),Ed(t,r,u,d,i);case 1:return u=r.type,d=r.pendingProps,d=r.elementType===u?d:wr(u,d),Vp(t,r,u,d,i);case 3:e:{if(Wp(r),t===null)throw Error(o(387));u=r.pendingProps,p=r.memoizedState,d=p.element,lp(t,r),Cu(r,u,null,i);var x=r.memoizedState;if(u=x.element,p.isDehydrated)if(p={element:u,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},r.updateQueue.baseState=p,r.memoizedState=p,r.flags&256){d=il(Error(o(423)),r),r=Gp(t,r,u,i,d);break e}else if(u!==d){d=il(Error(o(424)),r),r=Gp(t,r,u,i,d);break e}else for(Rn=Wn(r.stateNode.containerInfo.firstChild),Nn=r,nt=!0,xr=null,i=ip(r,null,u,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(el(),u===d){r=Do(t,r,i);break e}an(t,r,u,i)}r=r.child}return r;case 5:return cp(r),t===null&&nd(r),u=r.type,d=r.pendingProps,p=t!==null?t.memoizedProps:null,x=d.children,ea(u,d)?x=null:p!==null&&ea(u,p)&&(r.flags|=32),$p(t,r),an(t,r,x,i),r.child;case 6:return t===null&&nd(r),null;case 13:return Yp(t,r,i);case 4:return cd(r,r.stateNode.containerInfo),u=r.pendingProps,t===null?r.child=tl(r,null,u,i):an(t,r,u,i),r.child;case 11:return u=r.type,d=r.pendingProps,d=r.elementType===u?d:wr(u,d),zp(t,r,u,d,i);case 7:return an(t,r,r.pendingProps,i),r.child;case 8:return an(t,r,r.pendingProps.children,i),r.child;case 12:return an(t,r,r.pendingProps.children,i),r.child;case 10:e:{if(u=r.type._context,d=r.pendingProps,p=r.memoizedProps,x=d.value,Ve(vu,u._currentValue),u._currentValue=x,p!==null)if(dn(p.value,x)){if(p.children===d.children&&!Yt.current){r=Do(t,r,i);break e}}else for(p=r.child,p!==null&&(p.return=r);p!==null;){var D=p.dependencies;if(D!==null){x=p.child;for(var R=D.firstContext;R!==null;){if(R.context===u){if(p.tag===1){R=Ao(-1,i&-i),R.tag=2;var W=p.updateQueue;if(W!==null){W=W.shared;var ee=W.pending;ee===null?R.next=R:(R.next=ee.next,ee.next=R),W.pending=R}}p.lanes|=i,R=p.alternate,R!==null&&(R.lanes|=i),ld(p.return,i,r),D.lanes|=i;break}R=R.next}}else if(p.tag===10)x=p.type===r.type?null:p.child;else if(p.tag===18){if(x=p.return,x===null)throw Error(o(341));x.lanes|=i,D=x.alternate,D!==null&&(D.lanes|=i),ld(x,i,r),x=p.sibling}else x=p.child;if(x!==null)x.return=p;else for(x=p;x!==null;){if(x===r){x=null;break}if(p=x.sibling,p!==null){p.return=x.return,x=p;break}x=x.return}p=x}an(t,r,d.children,i),r=r.child}return r;case 9:return d=r.type,u=r.pendingProps.children,rl(r,i),d=Xn(d),u=u(d),r.flags|=1,an(t,r,u,i),r.child;case 14:return u=r.type,d=wr(u,r.pendingProps),d=wr(u.type,d),Hp(t,r,u,d,i);case 15:return Up(t,r,r.type,r.pendingProps,i);case 17:return u=r.type,d=r.pendingProps,d=r.elementType===u?d:wr(u,d),Nu(t,r),r.tag=1,h(u)?(t=!0,ye(r)):t=!1,rl(r,i),Lp(r,u,d),Sd(r,u,d,i),Ad(null,r,u,!0,t,i);case 19:return Xp(t,r,i);case 22:return Kp(t,r,i)}throw Error(o(156,r.tag))};function xh(t,r){return Ze(t,r)}function Jv(t,r,i,u){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zn(t,r,i,u){return new Jv(t,r,i,u)}function Gd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Zv(t){if(typeof t=="function")return Gd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===X)return 11;if(t===Pe)return 14}return 2}function bi(t,r){var i=t.alternate;return i===null?(i=Zn(t.tag,r,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=r,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&14680064,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,r=t.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i}function Uu(t,r,i,u,d,p){var x=2;if(u=t,typeof t=="function")Gd(t)&&(x=1);else if(typeof t=="string")x=5;else e:switch(t){case G:return da(i.children,d,p,r);case Q:x=8,d|=8;break;case $:return t=Zn(12,i,r,d|2),t.elementType=$,t.lanes=p,t;case de:return t=Zn(13,i,r,d),t.elementType=de,t.lanes=p,t;case ce:return t=Zn(19,i,r,d),t.elementType=ce,t.lanes=p,t;case je:return Ku(i,d,p,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case V:x=10;break e;case K:x=9;break e;case X:x=11;break e;case Pe:x=14;break e;case ke:x=16,u=null;break e}throw Error(o(130,t==null?t:typeof t,""))}return r=Zn(x,i,r,d),r.elementType=t,r.type=u,r.lanes=p,r}function da(t,r,i,u){return t=Zn(7,t,u,r),t.lanes=i,t}function Ku(t,r,i,u){return t=Zn(22,t,u,r),t.elementType=je,t.lanes=i,t.stateNode={isHidden:!1},t}function Yd(t,r,i){return t=Zn(6,t,null,r),t.lanes=i,t}function qd(t,r,i){return r=Zn(4,t.children!==null?t.children:[],t.key,r),r.lanes=i,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function ex(t,r,i,u,d){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ka(0),this.expirationTimes=ka(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ka(0),this.identifierPrefix=u,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Xd(t,r,i,u,d,p,x,D,R){return t=new ex(t,r,i,D,R),r===1?(r=1,p===!0&&(r|=8)):r=0,p=Zn(3,null,null,r),t.current=p,p.stateNode=t,p.memoizedState={element:u,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},ud(p),t}function tx(t,r,i){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:u==null?null:""+u,children:t,containerInfo:r,implementation:i}}function wh(t){if(!t)return vr;t=t._reactInternals;e:{if(ct(t)!==t||t.tag!==1)throw Error(o(170));var r=t;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(h(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(o(171))}if(t.tag===1){var i=t.type;if(h(i))return ie(t,i,r)}return r}function Ch(t,r,i,u,d,p,x,D,R){return t=Xd(i,u,!0,t,d,p,x,D,R),t.context=wh(null),i=t.current,u=ln(),d=gi(i),p=Ao(u,d),p.callback=r??null,mi(i,p,d),t.current.lanes=d,uo(t,d,u),pn(t,u),t}function $u(t,r,i,u){var d=r.current,p=ln(),x=gi(d);return i=wh(i),r.context===null?r.context=i:r.pendingContext=i,r=Ao(p,x),r.payload={element:t},u=u===void 0?null:u,u!==null&&(r.callback=u),t=mi(d,r,x),t!==null&&(kr(t,d,x,p),wu(t,d,x)),x}function Vu(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Sh(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<r?i:r}}function Qd(t,r){Sh(t,r),(t=t.alternate)&&Sh(t,r)}function nx(){return null}var kh=typeof reportError=="function"?reportError:function(t){console.error(t)};function Jd(t){this._internalRoot=t}Wu.prototype.render=Jd.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(o(409));$u(t,r,null,null)},Wu.prototype.unmount=Jd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;sa(function(){$u(null,t,null,null)}),r[Gn]=null}};function Wu(t){this._internalRoot=t}Wu.prototype.unstable_scheduleHydration=function(t){if(t){var r=Fl();t={blockedOn:null,target:t,priority:r};for(var i=0;i<Kn.length&&r!==0&&r<Kn[i].priority;i++);Kn.splice(i,0,t),i===0&&Aa(t)}};function Zd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Gu(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Ph(){}function rx(t,r,i,u,d){if(d){if(typeof u=="function"){var p=u;u=function(){var W=Vu(x);p.call(W)}}var x=Ch(r,u,t,0,null,!1,!1,"",Ph);return t._reactRootContainer=x,t[Gn]=x.current,vo(t.nodeType===8?t.parentNode:t),sa(),x}for(;d=t.lastChild;)t.removeChild(d);if(typeof u=="function"){var D=u;u=function(){var W=Vu(R);D.call(W)}}var R=Xd(t,0,!1,null,null,!1,!1,"",Ph);return t._reactRootContainer=R,t[Gn]=R.current,vo(t.nodeType===8?t.parentNode:t),sa(function(){$u(r,R,i,u)}),R}function Yu(t,r,i,u,d){var p=i._reactRootContainer;if(p){var x=p;if(typeof d=="function"){var D=d;d=function(){var R=Vu(x);D.call(R)}}$u(r,x,t,d)}else x=rx(i,r,t,d,u);return Vu(x)}Oi=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var i=so(r.pendingLanes);i!==0&&(Bi(r,i|1),pn(r,qe()),(He&6)===0&&(sl=qe()+500,ci()))}break;case 13:sa(function(){var u=Eo(t,1);if(u!==null){var d=ln();kr(u,t,1,d)}}),Qd(t,1)}},$o=function(t){if(t.tag===13){var r=Eo(t,134217728);if(r!==null){var i=ln();kr(r,t,134217728,i)}Qd(t,134217728)}},zi=function(t){if(t.tag===13){var r=gi(t),i=Eo(t,r);if(i!==null){var u=ln();kr(i,t,r,u)}Qd(t,r)}},Fl=function(){return ze},Bl=function(t,r){var i=ze;try{return ze=t,r()}finally{ze=i}},Bn=function(t,r,i){switch(r){case"input":if(Le(t,i),r=i.name,i.type==="radio"&&r!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<i.length;r++){var u=i[r];if(u!==t&&u.form===t.form){var d=Qa(u);if(!d)throw Error(o(90));ut(u),Le(u,d)}}}break;case"textarea":it(t,i);break;case"select":r=i.value,r!=null&&ir(t,!!i.multiple,r,!1)}},lr=$d,zo=sa;var ox={usingClientEntryPoint:!1,Events:[wo,Co,Qa,Rr,Ri,$d]},js={findFiberByHostInstance:yr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ix={bundleType:js.bundleType,version:js.version,rendererPackageName:js.rendererPackageName,rendererConfig:js.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:H.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Ct(t),t===null?null:t.stateNode},findFiberByHostInstance:js.findFiberByHostInstance||nx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qu.isDisabled&&qu.supportsFiber)try{Ir=qu.inject(ix),Gt=qu}catch{}}return hn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ox,hn.createPortal=function(t,r){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zd(r))throw Error(o(200));return tx(t,r,null,i)},hn.createRoot=function(t,r){if(!Zd(t))throw Error(o(299));var i=!1,u="",d=kh;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onRecoverableError!==void 0&&(d=r.onRecoverableError)),r=Xd(t,1,!1,null,null,i,!1,u,d),t[Gn]=r.current,vo(t.nodeType===8?t.parentNode:t),new Jd(r)},hn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(o(188)):(t=Object.keys(t).join(","),Error(o(268,t)));return t=Ct(r),t=t===null?null:t.stateNode,t},hn.flushSync=function(t){return sa(t)},hn.hydrate=function(t,r,i){if(!Gu(r))throw Error(o(200));return Yu(null,t,r,!0,i)},hn.hydrateRoot=function(t,r,i){if(!Zd(t))throw Error(o(405));var u=i!=null&&i.hydratedSources||null,d=!1,p="",x=kh;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(x=i.onRecoverableError)),r=Ch(r,null,t,1,i??null,d,!1,p,x),t[Gn]=r.current,vo(t),u)for(t=0;t<u.length;t++)i=u[t],d=i._getVersion,d=d(i._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[i,d]:r.mutableSourceEagerHydrationData.push(i,d);return new Wu(r)},hn.render=function(t,r,i){if(!Gu(r))throw Error(o(200));return Yu(null,t,r,!1,i)},hn.unmountComponentAtNode=function(t){if(!Gu(t))throw Error(o(40));return t._reactRootContainer?(sa(function(){Yu(null,null,t,!1,function(){t._reactRootContainer=null,t[Gn]=null})}),!0):!1},hn.unstable_batchedUpdates=$d,hn.unstable_renderSubtreeIntoContainer=function(t,r,i,u){if(!Gu(i))throw Error(o(200));if(t==null||t._reactInternals===void 0)throw Error(o(38));return Yu(t,r,i,!1,u)},hn.version="18.3.1-next-f1338f8080-20240426",hn}var Lh;function Qg(){if(Lh)return nm.exports;Lh=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),nm.exports=mx(),nm.exports}var Mh;function fx(){if(Mh)return Xu;Mh=1;var e=Qg();return Xu.createRoot=e.createRoot,Xu.hydrateRoot=e.hydrateRoot,Xu}var px=fx();function hx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"audio",children:[l.jsx("path",{d:"M9 18V5l12-2v13"}),l.jsx("circle",{cx:"6",cy:"18",r:"3"}),l.jsx("circle",{cx:"18",cy:"16",r:"3"})]})}function ef({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"align-center",children:[l.jsx("path",{d:"M4 6h16"}),l.jsx("path",{d:"M7 12h10"}),l.jsx("path",{d:"M4 18h16"})]})}function Jg({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"align-justify",children:[l.jsx("path",{d:"M4 6h16"}),l.jsx("path",{d:"M4 12h16"}),l.jsx("path",{d:"M4 18h16"})]})}function tf({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"align-left",children:[l.jsx("path",{d:"M4 6h16"}),l.jsx("path",{d:"M4 12h10"}),l.jsx("path",{d:"M4 18h16"})]})}function nf({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"align-right",children:[l.jsx("path",{d:"M4 6h16"}),l.jsx("path",{d:"M10 12h10"}),l.jsx("path",{d:"M4 18h16"})]})}function gx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"bold",children:[l.jsx("path",{d:"M7 5h6.5a3.5 3.5 0 0 1 0 7H7z"}),l.jsx("path",{d:"M7 12h7.5a3.5 3.5 0 0 1 0 7H7z"}),l.jsx("path",{d:"M7 5v14"})]})}function yx({className:e}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"bookmark",children:l.jsx("path",{d:"M6 4h12a1 1 0 0 1 1 1v16l-7-4-7 4V5a1 1 0 0 1 1-1z"})})}function Zg({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"bullet-list",children:[l.jsx("path",{d:"M9 6h12"}),l.jsx("path",{d:"M9 12h12"}),l.jsx("path",{d:"M9 18h12"}),l.jsx("circle",{cx:"4.5",cy:"6",r:"1.2",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"4.5",cy:"12",r:"1.2",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"4.5",cy:"18",r:"1.2",fill:"currentColor",stroke:"none"})]})}function bx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"cell-properties",children:[l.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),l.jsx("path",{d:"M3 12h18"}),l.jsx("path",{d:"M12 4v16"}),l.jsx("rect",{x:"12.5",y:"4.5",width:"8",height:"7",fill:"currentColor",stroke:"none",opacity:"0.25"})]})}function vx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"clear-formatting",children:[l.jsx("path",{d:"M4 5h12"}),l.jsx("path",{d:"M10 5v8"}),l.jsx("path",{d:"m14 15 6 6"}),l.jsx("path",{d:"m20 15-6 6"})]})}function sn({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"close",children:[l.jsx("path",{d:"M18 6L6 18"}),l.jsx("path",{d:"M6 6l12 12"})]})}function _h({className:e}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"comment",children:l.jsx("path",{d:"M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z"})})}function xx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"comments-visible",children:[l.jsx("path",{d:"M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z"}),l.jsx("path",{d:"M8 9h8M8 13h5"})]})}function wx({className:e}){return l.jsx("svg",{className:e,viewBox:"0 0 616.23 542.09",width:"45",height:"40","aria-hidden":"true","data-icon":"commspliant-shield",children:l.jsxs("g",{transform:"translate(129.79555,688.75474)",children:[l.jsx("path",{fill:"#334E68",d:"m 92.41768,-326.31771 a 0.3,0.3 0 0 1 0.48,0.05 q 5.04,8.55 15.34,22.7 5.5,7.55 11.93,14.77 11.84,13.3 12.69,14.16 11.29,11.41 26.17,23.51 c 4.66,3.79 9.84,8.83 15.07,12.39 18.71,12.72 34.7,23.08 52.84,31.97 q 15.29,7.5 16.67,8.12 5.77,2.59 8.73,3.54 c 1.66,0.54 2.74,-0.25 4.17,-0.93 q 27.98,-13.14 49.38,-25.74 21.15,-12.47 41.94,-29.56 1.28,-1.05 12.72,-11.11 c 11.11,-9.78 22.59,-22.12 30.48,-31.94 q 10.87,-13.52 16.67,-23.55 c 3.7,-6.41 7.66,-12.73 10.29,-18.63 q 9.41,-21.06 13.67,-35.18 8.51,-28.19 9.46,-61.31 0.96,-33.72 0.31,-64.55 -0.09,-4.4 2.81,-7.26 5.42,-5.33 7.5,-7.38 c 6.37,-6.25 11.24,-13.29 18.07,-19.23 q 7.84,-6.84 14.74,-16.11 0.14,-0.19 0.39,-0.15 0.61,0.1 0.52,0.7 -0.37,2.69 -0.35,4.95 c 0.37,45.85 0.81,76.35 -0.95,110.71 q -0.66,12.89 -2.71,28.52 -2.84,21.57 -7.17,36.03 -2.02,6.75 -5.4,17.5 c -5.64,17.94 -13.55,35.09 -23.13,50.9 q -1.72,2.86 -12.91,19.22 c -10.81,15.81 -22.83,29.61 -35.06,41.83 q -4.06,4.07 -17.47,16.38 -9.77,8.98 -18.52,15.14 -19.27,13.56 -32.8,21.84 c -8.27,5.05 -17.73,9.75 -26.22,14.7 q -3.66,2.13 -10.7,5.47 -27.19,12.89 -34.36,16.16 -3.92,1.79 -7.2,0.44 -3.47,-1.43 -11.46,-4.85 c -9.07,-3.89 -16.98,-8.27 -24.9,-11.89 -8.4,-3.84 -18.78,-9.89 -28.06,-15.14 q -43.25,-24.5 -76.54,-56.22 -11.98,-11.41 -24.94,-26.56 -12.76,-14.92 -26.13,-34.48 a 0.43,0.44 56.8 0 1 0.13,-0.61 c 12.12,-7.82 23.12,-17.82 33.81,-29.32 z"}),l.jsx("path",{fill:"#334E68",d:"m -128.82232,-375.77771 a 0.96,0.96 0 0 1 -0.8,-1.51 l 28.86,-41.82 a 3.24,3.2 6.2 0 1 1.45,-1.15 q 0.69,-0.27 3.64,-0.32 15.37,-0.27 46.58,-0.45 12.44,-0.07 19.69,-1.84 c 26.32,-6.42 44.55,-29.39 47.76,-55.67 q 1.05,-8.54 0.87,-20.92 c -0.55,-39.95 0.23,-77.15 -0.1,-117.57 a 0.94,0.95 85.4 0 1 0.81,-0.94 c 35.7,-5.08 70.26,-12.78 104.11,-23.86 q 9.4,-3.07 22.28,-7.05 8.6,-2.65 22.1,-7.58 18.33,-6.69 43.02,-16.74 23.04,-9.38 35.12,-15.34 1.17,-0.58 3.29,0.39 c 14.96,6.81 34.27,13.39 42.79,16.68 q 14.24,5.5 27.59,10.33 23.24,8.41 27.7,10.07 2.01,0.75 9.42,3.41 5.07,1.82 9.47,3.13 40.54,12.1 57.07,16.58 2.54,0.68 4.26,0.82 a 0.48,0.48 0 0 1 0.32,0.79 l -33.68,37.82 a 0.58,0.58 0 0 1 -0.68,0.13 q -3.43,-1.67 -5.84,-2.43 -8.74,-2.79 -47.37,-15.63 -8.92,-2.96 -17.51,-6.16 c -17.92,-6.67 -32.21,-11.74 -65.83,-24.24 -2.89,-1.08 -8.28,-3.56 -11.57,-2.33 -11.44,4.27 -27.67,11.24 -40.6,15.93 q -8.12,2.94 -26.33,9.89 c -21.86,8.35 -43.57,14.34 -67.25,21.47 q -20.07,6.03 -48.78,11.52 a 0.71,0.7 84.6 0 0 -0.57,0.7 q 0.1,95.52 0.1,95.57 c -0.53,30.1 -14.63,58.57 -36,79.25 -10.83,10.49 -23.5,17.98 -37.57,23.68 -10.14,4.1 -18.76,4.57 -31.18,4.79 q -3.1,0.05 -86.64,0.6 z"}),l.jsx("path",{fill:"#C9A227",d:"m 169.86768,-422.45771 q 0.04,-0.4 0.24,-0.59 c 3.41,-3.3 5.96,-6.99 9.56,-10.8 q 10.13,-10.72 15.25,-16.65 2.05,-2.38 5.38,-4.3 a 0.68,0.69 53.4 0 1 0.84,0.12 l 49.51,50.92 a 1.06,1.06 0 0 0 1.52,0 q 17.38,-17.8 26.4,-27.94 c 6.36,-7.14 15.04,-14.76 20.1,-20.56 q 10.29,-11.81 17.14,-18.67 7.41,-7.41 17.44,-18.41 13.85,-15.18 23.56,-24.67 c 3.68,-3.59 5.5,-6.17 8.54,-10.08 2.38,-3.06 4.42,-4.87 8.16,-8.31 6.16,-5.66 10.48,-11.49 16.47,-17.22 6.29,-6.03 12.87,-14.23 18.87,-20.24 q 5.56,-5.56 13.49,-14.45 c 6.79,-7.6 12.13,-13.02 18.46,-19.66 4.83,-5.06 9.88,-11.22 15.21,-16.21 a 1.91,1.91 0 0 1 1.3,-0.51 h 28.15 a 0.83,0.83 0 0 1 0.83,0.82 q 0.28,14.3 0.03,31.53 c -0.07,4.93 -1.9,6.19 -5.19,9.51 -5.86,5.92 -12.79,12.1 -18.21,18.16 q -6.63,7.4 -16.64,16.86 c -2.68,2.53 -6.31,6.91 -8.5,9.17 -8.76,9.01 -14.72,16.05 -22.55,23.36 q -1.37,1.28 -9.09,9.75 -4.93,5.41 -24.32,25.01 c -9.96,10.07 -19.18,20.45 -27.83,28.95 q -11.52,11.33 -20.29,20.96 c -19.16,21.01 -41.14,42.93 -58.64,61.61 q -10.7,11.42 -22.21,22 a 1.97,1.94 24 0 1 -1.38,0.52 q -1.9,-0.06 -3.83,-2.08 c -19.01,-19.93 -45.74,-44.39 -67.08,-67.5 q -5.05,-5.47 -10.42,-9.75 -0.31,-0.24 -0.27,-0.65 z"}),l.jsx("path",{fill:"#5B7B9C",d:"m 351.58768,-544.71771 a 0.41,0.41 0 0 1 0.17,0.69 q -15.9,15.29 -29.64,31.76 a 1.16,1.19 33.7 0 1 -1.44,0.3 c -5.87,-3 -10.72,-6.65 -16.97,-10.42 -17.2,-10.37 -38.83,-14.16 -59.18,-13.16 -12.15,0.6 -23.67,3.62 -34.54,8.11 -5.15,2.13 -9.08,4.66 -14.86,8.63 q -14.63,10.05 -22.02,17.75 -6.98,7.27 -17.47,22.45 c -5.11,7.4 -9.03,15.18 -13.55,23.27 q -5.09,9.08 -10.38,20.93 c -4.39,9.81 -8.53,17.45 -13.72,27.5 q -6,11.58 -11.58,19.91 c -6.74,10.09 -11.32,17.91 -17.68,26.12 -4.94,6.38 -10.92,12.4 -15.22,17.55 q -3.48,4.18 -9.33,9.51 c -20.66,18.83 -45.19,33.15 -72.9,38.24 q -15.17,2.79 -26.21,3.08 -22.84,0.6 -52.01,0.23 a 0.29,0.29 0 0 1 -0.24,-0.43 c 6.02,-10.58 11.85,-19.61 23.29,-37.61 q 2.27,-3.58 5.02,-6.38 a 3.39,3.4 24.3 0 1 2.63,-1 q 16.4,1.07 32.77,-1.23 c 15.39,-2.16 29.33,-7.66 42.1,-15.59 q 4.42,-2.75 14.17,-10.6 3.58,-2.89 14.27,-14.03 6.08,-6.33 9.69,-12.1 c 3.25,-5.19 7.59,-10.59 11.55,-17.24 q 16.77,-28.19 29.52,-56.84 c 4.49,-10.08 8.7,-16.87 15.5,-28.37 q 5.49,-9.29 14.18,-21.09 5.94,-8.07 12.61,-14.76 12.65,-12.7 13.8,-13.72 5.51,-4.84 19.01,-13.66 49.89,-32.59 109.07,-20.31 7.95,1.65 15.41,4.34 14.58,5.25 20.68,8.05 c 10.41,4.78 21.11,12.36 31.15,19.28 a 2.65,2.62 70.1 0 0 0.78,0.37 z"}),l.jsx("path",{fill:"#5B7B9C",d:"m 143.16768,-394.65771 q 0.46,0.11 0.45,0.6 -0.03,2.2 0.62,4.89 2.72,11.27 9.81,22.88 7.25,11.89 15.4,22.7 c 4.71,6.26 10.61,13.06 17.11,18.9 9.38,8.42 15.79,14.58 25.02,21.29 q 13.29,9.65 15.1,10.72 10.62,6.29 20.67,12.58 1.94,1.22 4,1.86 a 2.56,2.59 42.2 0 0 1.81,-0.1 c 7.1,-3.08 12.92,-6.7 21.76,-11.78 q 6.63,-3.81 11.42,-7.45 c 4.56,-3.47 9.98,-6.63 14.83,-10.52 q 18.45,-14.82 32.58,-32 6.8,-8.28 11.17,-16.16 c 7.76,-14.01 13.11,-25.52 16.26,-40.82 1.49,-7.23 1.56,-11.99 2.41,-21.26 a 3.66,3.67 70 0 1 1.06,-2.26 q 9.34,-9.27 20.72,-20.12 c 6.47,-6.15 12.23,-13.51 18.33,-19.07 a 0.67,0.67 0 0 1 1.11,0.43 q 1.92,19.96 1.77,37.52 -0.18,19.95 -4.43,40.76 -3.4,16.65 -11.34,32.24 -0.55,1.09 -4.75,9.06 -3,5.69 -5.08,8.85 c -9.56,14.55 -19.75,27.73 -31.99,39.39 q -7.6,7.24 -9.98,9.35 -10.58,9.37 -24.17,18.04 c -4.91,3.14 -9.19,7.11 -13.77,9.89 q -24.03,14.58 -42.68,23.19 -3.32,1.53 -8.02,-0.31 -1.97,-0.78 -11.41,-5.19 c -8.92,-4.17 -16.04,-8.65 -24.58,-13.03 q -6.75,-3.47 -13.06,-7.8 -18.87,-12.96 -21.03,-14.68 -15.47,-12.4 -29.21,-26.05 -5.39,-5.35 -13.86,-16.13 -6.45,-8.2 -14.56,-19.38 c -3.42,-4.72 -6.19,-10.2 -9.49,-14.45 a 1.33,1.32 44.2 0 1 -0.03,-1.59 c 5.8,-7.95 10.64,-13.7 15.23,-21.14 q 8.66,-14.03 14.39,-23.68 a 0.38,0.39 23.4 0 1 0.41,-0.17 z"})]})})}function Cx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"custom-action",children:[l.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),l.jsx("path",{d:"M9 8.5c0-1 .7-1.5 1.5-1.5S12 7.5 12 8.5c0 1.2-3 1.2-3 3.2"}),l.jsx("path",{d:"M10.5 14v.5"}),l.jsx("path",{d:"M15 10v4"}),l.jsx("path",{d:"M13 12h4"})]})}function Sx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"custom-css",children:[l.jsx("path",{d:"M8 6h12"}),l.jsx("path",{d:"M8 12h12"}),l.jsx("path",{d:"M8 18h8"}),l.jsx("path",{d:"M4 6h.01"}),l.jsx("path",{d:"M4 12h.01"}),l.jsx("path",{d:"M4 18h.01"})]})}function kx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"customize-toolbar",children:[l.jsx("rect",{x:"3",y:"4",width:"7",height:"7",rx:"1"}),l.jsx("rect",{x:"14",y:"4",width:"7",height:"7",rx:"1"}),l.jsx("rect",{x:"3",y:"13",width:"7",height:"7",rx:"1"}),l.jsx("rect",{x:"14",y:"13",width:"7",height:"7",rx:"1"})]})}function Px({className:e}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"dark-mode",children:l.jsx("path",{d:"M21 14.5A8.5 8.5 0 1 1 9.5 3 7 7 0 0 0 21 14.5z"})})}function ey({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"font-color",children:[l.jsx("path",{d:"M6 18L12 4l6 14"}),l.jsx("path",{d:"M8.5 13h7"})]})}function Ex({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"font-family",children:[l.jsx("path",{d:"M4 18L9 6l5 12"}),l.jsx("path",{d:"M6.2 13h5.6"}),l.jsx("path",{d:"M16 18V9"}),l.jsx("path",{d:"M16 9h5"})]})}function Ax({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"font-properties",children:[l.jsx("path",{d:"M4 20h4"}),l.jsx("path",{d:"M6 20V6"}),l.jsx("path",{d:"M4 6h4"}),l.jsx("path",{d:"M12 20V9"}),l.jsx("path",{d:"M12 9h8"}),l.jsx("path",{d:"M16 9v11"})]})}function Dx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"font-size",children:[l.jsx("path",{d:"M4 18V8h3"}),l.jsx("path",{d:"M4 8h8"}),l.jsx("path",{d:"M10 8v10"}),l.jsx("path",{d:"M16 18V12h2"}),l.jsx("path",{d:"M16 12h5"}),l.jsx("path",{d:"M19 12v6"})]})}function Tx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"format-brush",children:[l.jsx("path",{d:"m9.06 11.9 8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08"}),l.jsx("path",{d:"M7.07 14.94c-1.66 0-3 1.34-3 3v2.06h2.06c1.66 0 3-1.34 3-3v-2.06Z"}),l.jsx("path",{d:"M7.07 14.94 4.01 18"})]})}function jx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"fullscreen",children:[l.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),l.jsx("path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}),l.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}),l.jsx("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})]})}function ty({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"highlight-color",children:[l.jsx("path",{d:"M15.5 4.5l4 4-9 9H6.5v-4.5z"}),l.jsx("path",{d:"M13.5 6.5l4 4"}),l.jsx("path",{d:"M4 20h8"})]})}function Nx({className:e}){return l.jsx("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"horizontalRule",children:l.jsx("path",{d:"M4 12h16"})})}function Rx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"html",children:[l.jsx("path",{d:"M8 8l-4 4 4 4"}),l.jsx("path",{d:"M16 8l4 4-4 4"})]})}function ny({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"image",children:[l.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),l.jsx("circle",{cx:"8.5",cy:"10",r:"1.5"}),l.jsx("path",{d:"m21 15-4.5-4.5L7 20"})]})}function Lx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"indent",children:[l.jsx("path",{d:"M4 6h16"}),l.jsx("path",{d:"M12 12h8"}),l.jsx("path",{d:"M4 18h16"}),l.jsx("path",{d:"M4 9l4 3-4 3"})]})}function Mx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"italic",children:[l.jsx("path",{d:"M10 4h9"}),l.jsx("path",{d:"M5 20h9"}),l.jsx("path",{d:"M14 4L8 20"})]})}function _x({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"light-mode",children:[l.jsx("circle",{cx:"12",cy:"12",r:"4"}),l.jsx("path",{d:"M12 2v2"}),l.jsx("path",{d:"M12 20v2"}),l.jsx("path",{d:"M4.93 4.93l1.41 1.41"}),l.jsx("path",{d:"M17.66 17.66l1.41 1.41"}),l.jsx("path",{d:"M2 12h2"}),l.jsx("path",{d:"M20 12h2"}),l.jsx("path",{d:"M4.93 19.07l1.41-1.41"}),l.jsx("path",{d:"M17.66 6.34l1.41-1.41"})]})}function Ix({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"link",children:[l.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),l.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}function Fx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"menu",children:[l.jsx("path",{d:"M4 6h16"}),l.jsx("path",{d:"M4 12h16"}),l.jsx("path",{d:"M4 18h16"})]})}function Bx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"merge-cells",children:[l.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),l.jsx("path",{d:"M3 12h5"}),l.jsx("path",{d:"M16 12h5"}),l.jsx("path",{d:"M12 4v16"}),l.jsx("path",{d:"M9 9l3 3-3 3"}),l.jsx("path",{d:"M15 9l-3 3 3 3"})]})}function ry({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"numbered-list",children:[l.jsx("path",{d:"M10 6h11"}),l.jsx("path",{d:"M10 12h11"}),l.jsx("path",{d:"M10 18h11"}),l.jsx("path",{d:"M4 5v3h2"}),l.jsx("path",{d:"M4 11h2l-2 2h2"}),l.jsx("path",{d:"M4 19h2"}),l.jsx("path",{d:"M4 17h2v2"})]})}function Ox({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"open",children:[l.jsx("path",{d:"M3 7h6l2 2h10v3"}),l.jsx("path",{d:"M3 10l2.2 9h13.6L21 10H3z"})]})}function zx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"outdent",children:[l.jsx("path",{d:"M4 6h16"}),l.jsx("path",{d:"M12 12h8"}),l.jsx("path",{d:"M4 18h16"}),l.jsx("path",{d:"M8 9l-4 3 4 3"})]})}function oy({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"page-properties",children:[l.jsx("path",{d:"M6 3h8l6 6v12H6z"}),l.jsx("path",{d:"M14 3v6h6"})]})}function Hx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"paragraph-properties",children:[l.jsx("path",{d:"M13 4H9a4 4 0 0 0 0 8h2"}),l.jsx("path",{d:"M15 4v16"}),l.jsx("path",{d:"M11 4v16"})]})}function Ux({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"preview",children:[l.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),l.jsx("path",{d:"M14 2v6h6"}),l.jsx("path",{d:"M8 13h8"}),l.jsx("path",{d:"M8 17h5"})]})}function Kx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"paragraph-style",children:[l.jsx("path",{d:"M5 6h14"}),l.jsx("path",{d:"M5 10h10"}),l.jsx("path",{d:"M5 14h14"}),l.jsx("path",{d:"M5 18h8"})]})}function $x({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"plus",children:[l.jsx("path",{d:"M12 5v14"}),l.jsx("path",{d:"M5 12h14"})]})}function Vx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"print",children:[l.jsx("path",{d:"M6 9V3h12v6"}),l.jsx("path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}),l.jsx("path",{d:"M6 14h12v8H6z"})]})}function Wx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"read-aloud",children:[l.jsx("path",{d:"M11 5L6 9H2v6h4l5 4V5z"}),l.jsx("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),l.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]})}function Gx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"redo",children:[l.jsx("path",{d:"M21 10H10a5 5 0 0 0 0 10h1"}),l.jsx("path",{d:"M17 6l4 4-4 4"})]})}function Yx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"row-properties",children:[l.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),l.jsx("path",{d:"M3 10h18"}),l.jsx("path",{d:"M3 16h18"}),l.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"5",fill:"currentColor",stroke:"none",opacity:"0.25"})]})}function qx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"save",children:[l.jsx("path",{d:"M5 3h11l5 5v13H5V3z"}),l.jsx("path",{d:"M15 3v6H9V3"}),l.jsx("path",{d:"M8 21v-7h8v7"})]})}function im({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"table-column",children:[l.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),l.jsx("path",{d:"M3 10h18"}),l.jsx("path",{d:"M3 16h18"}),l.jsx("path",{d:"M9 4v16"}),l.jsx("path",{d:"M15 4v16"}),l.jsx("rect",{x:"9.5",y:"5",width:"5",height:"14",fill:"currentColor",stroke:"none",opacity:"0.25"})]})}function Ih({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"table",children:[l.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),l.jsx("path",{d:"M3 10h18"}),l.jsx("path",{d:"M3 16h18"}),l.jsx("path",{d:"M9 4v16"}),l.jsx("path",{d:"M15 4v16"})]})}function am({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"table-row",children:[l.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),l.jsx("path",{d:"M3 10h18"}),l.jsx("path",{d:"M3 16h18"}),l.jsx("rect",{x:"4",y:"10.5",width:"16",height:"5",fill:"currentColor",stroke:"none",opacity:"0.25"})]})}function Xx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"strikethrough",children:[l.jsx("path",{d:"M6 7.5C6 5.5 8 4 12 4s6 1.5 6 3.5-1.8 2.8-6 3.5"}),l.jsx("path",{d:"M6 16.5C6 18.5 8 20 12 20s6-1.5 6-3.5c0-1-.5-1.8-1.8-2.5"}),l.jsx("path",{d:"M4 12h16"})]})}function Qx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"underline",children:[l.jsx("path",{d:"M7 4v8a5 5 0 0 0 10 0V4"}),l.jsx("path",{d:"M5 20h14"})]})}function Jx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"undo",children:[l.jsx("path",{d:"M3 10h11a5 5 0 0 1 0 10h-1"}),l.jsx("path",{d:"M7 6L3 10l4 4"})]})}function Zx({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"unmerge-cells",children:[l.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),l.jsx("path",{d:"M12 4v16"}),l.jsx("path",{d:"M3 12h18"}),l.jsx("path",{d:"M9 9l-3 3 3 3"}),l.jsx("path",{d:"M15 9l3 3-3 3"})]})}function ew({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"visual",children:[l.jsx("path",{d:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function tw({className:e}){return l.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"youtube",children:[l.jsx("rect",{x:"2",y:"5",width:"20",height:"14",rx:"3"}),l.jsx("path",{d:"m10 9 6 3-6 3V9Z",fill:"currentColor",stroke:"none"})]})}const ht="---";function ki(e){return e===ht}function Vs(e){return typeof e=="object"&&e!==null&&"submenu"in e}const rf=new Set(["save","open","print","undo","redo","link","bookmark","horizontalRule","insertPage","visual","html","customizeToolbar","toolbarPositionTop","toolbarPositionLeft","toolbarPositionRight","toolbarPositionBottom","lightMode","darkMode","preview","readAloud","fullscreen","bold","italic","underline","strikethrough","clearFormatting","formatBrush","fontSize","fontFamily","paragraphStyle","fontProperties","customCss","paragraphProperties","pageProperties","imageProperties","fontColor","highlightColor","alignLeft","alignCenter","alignRight","alignJustify","indent","outdent","bulletList","numberedList","table","insertRowBelow","insertRowBefore","deleteRow","insertColumnAfter","insertColumnBefore","deleteColumn","mergeCells","unmergeCells","tableProperties","cellProperties","rowProperties"]),nw=new Set(["file","edit","insert","table","view","format"]),iy="custom",ay="custom";function ly(e){return`custom:${e}`}function rw(e){return e==="menu"||e==="both"}function ow(e){return e==="toolbar"||e==="both"}function sy(e){return e.map(n=>Vs(n)?{submenu:n.submenu,items:sy(n.items)}:n)}function iw(e){return{menus:e.menus.map(n=>({id:n.id,items:sy(n.items)})),iconGroups:e.iconGroups.map(n=>({id:n.id,items:[...n.items]}))}}function uy(e){return ki(e)?!0:Vs(e)?e.items.every(uy):rf.has(e)}function cy(e,n){for(const o of e)if(o===n||Vs(o)&&cy(o.items,n))return!0;return!1}function aw(e){const n=e.tooltip??e.label;return{id:e.id,command:ly(e.id),icon:e.icon??Cx,label:e.label,ariaLabel:e.label,tooltip:n}}function lw(e,n,o,a){if(e.menus[o])a&&!e.menus[o].label&&!nw.has(o)&&(e.menus[o]={...e.menus[o],label:a,ariaLabel:a});else if(o===iy&&!a)e.menus[o]={id:o,labelKey:"menuCustom",ariaKey:"menuCustomAria"};else{const s=a??o;e.menus[o]={id:o,label:s,ariaLabel:s}}n.menus.some(s=>s.id===o)||n.menus.push({id:o,items:[]})}function sw(e,n,o){if(e.groups[o]||(o===ay?e.groups[o]={id:o,labelKey:"toolbarGroupCustom"}:e.groups[o]={id:o,label:o}),!n.iconGroups.some(a=>a.id===o)){const a={id:o,items:[]},s=n.iconGroups.findIndex(c=>c.items.includes("fullscreen"));s===-1?n.iconGroups.push(a):n.iconGroups.splice(s,0,a)}}function uw(e,n,o){var c,m;const a={menus:{...n.menus},submenus:{...n.submenus},groups:{...n.groups},items:{...n.items}},s=iw(o);for(const g of e??[])if(!(rf.has(g.id)||ki(g.id))){if(a.items[g.id]=aw(g),rw(g.showIn)){const y=((c=g.menu)==null?void 0:c.id)??iy;lw(a,s,y,(m=g.menu)==null?void 0:m.label);const w=s.menus.find(C=>C.id===y);if(w&&!cy(w.items,g.id)){const C=w.items[w.items.length-1];C!==void 0&&!ki(C)&&w.items.every(uy)&&w.items.push(ht),w.items.push(g.id)}}if(ow(g.showIn)){const y=g.toolbarGroup??ay;sw(a,s,y);const w=s.iconGroups.find(C=>C.id===y);w&&!w.items.includes(g.id)&&w.items.push(g.id)}}return{catalog:a,layout:s}}function cw(e,n){const o={};for(const a of e??[])rf.has(a.id)||ki(a.id)||(o[ly(a.id)]=()=>a.onAction(n()));return o}function dw(e){return{cut:async()=>{await e.cut()},copy:async()=>{await e.copy()},deleteSelection:()=>{e.deleteSelection()}}}var of=Qg();const mw="_chrome_boy0f_1",fw={chrome:mw},dy=f.createContext(!1);function pw({dark:e,children:n}){return l.jsx(dy.Provider,{value:e,children:n})}function hw(){return f.useContext(dy)}function Sm(e){return{className:fw.chrome,"data-wysiwyg-theme":e?"dark":"light"}}function Xe({children:e}){const n=hw(),o=Sm(n);return of.createPortal(l.jsx("div",{className:o.className,"data-wysiwyg-theme":o["data-wysiwyg-theme"],children:e}),document.body)}function af(e,n){const o=e[n];o==null||o()}const lf={modeVisual:"Visual",modeHtml:"HTML",modeVisualAria:"Switch to visual mode",modeHtmlAria:"Switch to HTML mode",modeFullscreen:"Full screen",modeFullscreenAria:"Toggle full screen",modeLight:"Light mode",modeLightAria:"Switch to light mode",modeDark:"Dark mode",modeDarkAria:"Switch to dark mode",exitFullscreenAria:"Exit full screen",visualEditorAria:"Visual editor",htmlEditorAria:"HTML editor",menuFile:"File",menuFileAria:"File menu",menuEdit:"Edit",menuEditAria:"Edit menu",menuInsert:"Insert",menuInsertAria:"Insert menu",menuView:"View",menuViewAria:"View menu",menuFormat:"Format",menuFormatAria:"Format menu",menuFont:"Fonts",menuFontAria:"Fonts submenu",menuParagraph:"Paragraph",menuParagraphAria:"Paragraph submenu",menuParagraphStyles:"Paragraph styles",menuParagraphStylesAria:"Paragraph styles submenu",menuPage:"Page",menuPageAria:"Page submenu",menuToolbar:"Toolbar",menuToolbarAria:"Toolbar submenu",menuToolbarPosition:"Position",menuToolbarPositionAria:"Toolbar position submenu",toolbarPositionTop:"Top",toolbarPositionTopAria:"Dock toolbar at the top",toolbarPositionLeft:"Left",toolbarPositionLeftAria:"Dock toolbar on the left",toolbarPositionRight:"Right",toolbarPositionRightAria:"Dock toolbar on the right",toolbarPositionBottom:"Bottom",toolbarPositionBottomAria:"Dock toolbar at the bottom",menuImage:"Image",menuImageAria:"Image properties",menuInsertRow:"Row",menuInsertRowAria:"Insert or delete row",menuInsertColumn:"Column",menuInsertColumnAria:"Insert or delete column",menuTable:"Table",menuTableAria:"Table menu",menuCustom:"Custom",menuCustomAria:"Custom menu",menuHamburgerAria:"Open menu",menuCloseAria:"Close menu",menuOverlayAria:"Editor menu",brandMarkAria:"CommsPliant HTML editor",commandSave:"Save",commandSaveAria:"Save as HTML file",commandOpen:"Open",commandOpenAria:"Open HTML file",htmlFileDropOverlay:"Drop HTML file to open",commandPrint:"Print",commandPrintAria:"Print document",commandUndo:"Undo",commandUndoAria:"Undo",commandRedo:"Redo",commandRedoAria:"Redo",commandCut:"Cut",commandCutAria:"Cut",commandCopy:"Copy",commandCopyAria:"Copy",commandDelete:"Delete",commandDeleteAria:"Delete",commandLink:"Link",commandLinkAria:"Link",commandBookmark:"Bookmark",commandBookmarkAria:"Bookmark",commandImage:"Image",commandImageAria:"Insert image",commandAudio:"Audio",commandAudioAria:"Insert audio",commandYoutube:"YouTube video",commandYoutubeAria:"Insert YouTube video",commandImageProperties:"Image properties…",commandImagePropertiesAria:"Image properties",commandTable:"Table",commandTableAria:"Insert table",commandHorizontalRule:"Horizontal line",commandHorizontalRuleAria:"Insert horizontal line",commandInsertPage:"Page",commandInsertPageAria:"Insert new page",commandTableProperties:"Table properties…",commandTablePropertiesAria:"Table properties",commandCellProperties:"Cell properties…",commandCellPropertiesAria:"Cell properties",commandRowProperties:"Row properties…",commandRowPropertiesAria:"Row properties",commandInsertRowBelow:"Add below",commandInsertRowBelowAria:"Add row below",commandInsertRowBefore:"Add before",commandInsertRowBeforeAria:"Add row before",commandDeleteRow:"Delete",commandDeleteRowAria:"Delete row",commandInsertColumnAfter:"Add after",commandInsertColumnAfterAria:"Add column after",commandInsertColumnBefore:"Add before",commandInsertColumnBeforeAria:"Add column before",commandDeleteColumn:"Delete",commandDeleteColumnAria:"Delete column",commandMergeCells:"Merge cells",commandMergeCellsAria:"Merge selected cells",commandUnmergeCells:"Unmerge cells",commandUnmergeCellsAria:"Split merged cells",contextMenuAria:"Editor context menu",commandBold:"Bold",commandBoldAria:"Bold",commandItalic:"Italic",commandItalicAria:"Italic",commandUnderline:"Underline",commandUnderlineAria:"Underline",commandStrikethrough:"Strikethrough",commandStrikethroughAria:"Strikethrough",commandClearFormatting:"Reset formatting",commandClearFormattingAria:"Reset formatting",commandFormatBrush:"Format brush",commandFormatBrushAria:"Copy formatting",commandFontSize:"Font size",commandFontSizeAria:"Font size",commandFontSizeUnitAria:"Font size unit",commandFontFamily:"Font",commandFontFamilyAria:"Font family",commandFontProperties:"Font properties…",commandFontPropertiesAria:"Font properties",commandCustomCss:"Custom CSS",commandCustomCssAria:"Custom CSS",commandParagraphProperties:"Paragraph properties…",commandParagraphPropertiesAria:"Paragraph properties",commandPageProperties:"Page properties…",commandPagePropertiesAria:"Page properties",commandFontColor:"Font color",commandFontColorAria:"Font color",commandHighlightColor:"Highlight color",commandHighlightColorAria:"Highlight color",commandParagraphStyle:"Styles",commandParagraphStyleAria:"Paragraph styles",commandAlignLeft:"Align left",commandAlignLeftAria:"Align left",commandAlignCenter:"Align center",commandAlignCenterAria:"Align center",commandAlignRight:"Align right",commandAlignRightAria:"Align right",commandAlignJustify:"Justify",commandAlignJustifyAria:"Justify",commandIndent:"Increase indent",commandIndentAria:"Increase indent",commandOutdent:"Decrease indent",commandOutdentAria:"Decrease indent",commandBulletList:"Bullet list",commandBulletListAria:"Bullet list",commandNumberedList:"Numbered list",commandNumberedListAria:"Numbered list",commandCustomizeToolbar:"Customize toolbar",commandCustomizeToolbarAria:"Customize toolbar",commandPreview:"Preview",commandPreviewAria:"Preview document",commandReadAloud:"Read aloud",commandReadAloudAria:"Read selection or document aloud",styleParagraph:"Paragraph",styleHeading1:"Heading 1",styleHeading2:"Heading 2",styleHeading3:"Heading 3",styleHeading4:"Heading 4",styleHeading5:"Heading 5",styleHeading6:"Heading 6",styleAddNew:"Add new",styleAddNewAria:"Add new paragraph style",customStyleDialogAddTitle:"Add paragraph style",customStyleDialogEditTitle:"Edit paragraph style",customStyleDialogTabFont:"Font",customStyleDialogTabParagraph:"Paragraph",customStyleDialogName:"Name",customStyleDialogDelete:"Delete",customStyleDialogDeleteConfirm:"Delete this paragraph style?",customStyleDialogCloseAria:"Close",customStyleLoading:"Loading paragraph styles",colorAutomatic:"Automatic",colorNone:"No color",colorCustom:"Custom color",colorHex:"Hex",colorRgbR:"R",colorRgbG:"G",colorRgbB:"B",colorPickFromScreen:"Pick from screen",colorRecent:"Recent colors",fontDialogTitle:"Font properties",fontDialogTabGeneral:"General",fontDialogFamily:"Font",fontFamilyDefault:"Default",fontDialogSize:"Size",fontDialogUnit:"Unit",fontDialogStyle:"Style",fontDialogOk:"OK",fontDialogCancel:"Cancel",linkDialogTitle:"Insert link",linkDialogTabLink:"Link",linkDialogTabBookmark:"Bookmark",linkDialogHref:"URL",linkDialogHoverTitle:"Title",linkDialogTargetBlank:"Open in a new tab",linkDialogTextDecorationNone:"No underline",linkDialogHover:"On hover",linkDialogHoverColor:"Color",linkDialogHoverColorField:"Hover color",linkDialogHoverHtml:"HTML",linkDialogHoverHtmlAria:"Custom hover HTML",linkDialogBookmark:"Bookmark",linkDialogBookmarkEmpty:"No bookmarks in this document.",linkDialogSelect:"Select",bookmarkDialogTitle:"Insert bookmark",bookmarkDialogName:"Bookmark name",bookmarkDialogHelp:"Start with a letter. Use only letters, numbers, hyphens, and underscores. Must be unique in the document.",bookmarkDialogHelpAria:"Bookmark name format",bookmarkDialogCloseAria:"Close",bookmarkDialogErrorEmpty:"Enter a bookmark name.",bookmarkDialogErrorInvalid:"Start with a letter. Use only letters, numbers, hyphens, and underscores.",bookmarkDialogErrorDuplicate:"A bookmark with this name already exists.",customCssDialogTitle:"Custom CSS",customCssDialogField:"CSS",customCssDialogFieldAria:"Custom CSS declarations",customCssDialogCloseAria:"Close",imageDialogTitle:"Insert image",imageDialogSource:"Source",imageDialogFile:"File",imageDialogChooseFile:"Choose file",imageDialogUrl:"Image URL",imageDialogAlt:"Alt text",imageDialogTitleField:"Title",imageDialogCloseAria:"Close",imageDialogErrorEmpty:"Choose a file or enter an image URL.",imageDialogErrorInvalid:"Enter a valid image URL.",imageDialogErrorType:"Use a JPEG, PNG, GIF, WebP, BMP, or AVIF image.",imageDialogErrorTooLarge:"Choose an image smaller than 2 MB.",audioDialogTitle:"Insert audio",audioDialogSource:"Source",audioDialogFile:"File",audioDialogChooseFile:"Choose file",audioDialogUrl:"Audio URL",audioDialogTitleField:"Title",audioDialogCloseAria:"Close",audioDialogErrorEmpty:"Choose a file or enter an audio URL.",audioDialogErrorInvalid:"Enter a valid audio URL.",audioDialogErrorType:"Use an MP3, WAV, OGG, AAC, WebM, or M4A audio file.",audioDialogErrorTooLarge:"Choose an audio file smaller than 5 MB.",youtubeDialogTitle:"Insert YouTube video",youtubeDialogUrl:"YouTube URL",youtubeDialogTitleField:"Title",youtubeDialogCloseAria:"Close",youtubeDialogErrorEmpty:"Enter a YouTube URL.",youtubeDialogErrorInvalid:"Enter a valid YouTube URL.",imagePropertiesDialogTitle:"Image properties",imagePropertiesDialogCloseAria:"Close",imagePropertiesTabAlignment:"Alignment",imagePropertiesTabBorder:"Border & margin",imagePropertiesTabAdvanced:"Advanced",imagePropertiesTabHover:"Hover",imagePropertiesSize:"Size",imagePropertiesSizeMode:"Size mode",imagePropertiesSizeWidth:"Width only",imagePropertiesSizeHeight:"Height only",imagePropertiesSizeLock:"Lock together",imagePropertiesWidth:"Width",imagePropertiesHeight:"Height",imagePropertiesWidthAria:"Image width",imagePropertiesHeightAria:"Image height",imagePropertiesSizeUnitAria:"Image size unit",imagePropertiesFit:"Fit",imagePropertiesFitDefault:"Default",imagePropertiesFitFill:"Fill",imagePropertiesFitContain:"Contain",imagePropertiesFitCover:"Cover",imagePropertiesFitNoneValue:"None",imagePropertiesFitScaleDown:"Scale down",imagePropertiesPosition:"Position",imagePropertiesPositionDefault:"Default",imagePropertiesPositionCenter:"Center",imagePropertiesPositionTop:"Top",imagePropertiesPositionBottom:"Bottom",imagePropertiesPositionLeft:"Left",imagePropertiesPositionRight:"Right",imagePropertiesPositionTopLeft:"Top left",imagePropertiesPositionTopRight:"Top right",imagePropertiesPositionBottomLeft:"Bottom left",imagePropertiesPositionBottomRight:"Bottom right",imagePropertiesRotation:"Rotation",imagePropertiesRotationUnit:"deg",imagePropertiesHoverCss:"Hover CSS",imagePropertiesHoverCssAria:"Custom hover CSS",imagePropertiesHoverHelp:"CSS applied when the pointer is over the image.",imageResizeHandleEastAria:"Resize image width, keep aspect ratio",imageResizeHandleSouthAria:"Resize image height, keep aspect ratio",imageResizeHandleSouthEastAria:"Resize image freely",tableDialogTitle:"Insert table",tableDialogCloseAria:"Close",tableDialogRows:"Rows",tableDialogColumns:"Columns",tableDialogSize:"Size",tableDialogGridAria:"Table size grid",tableDialogInsert:"Insert",tablePropertiesDialogTitle:"Table properties",tablePropertiesDialogCloseAria:"Close",tablePropertiesCollapse:"Border collapse",tablePropertiesCollapseCollapse:"Collapse",tablePropertiesCollapseSeparate:"Separate",tablePropertiesSpacing:"Border spacing",tablePropertiesWidth:"Width",cellPropertiesDialogTitle:"Cell properties",cellPropertiesDialogCloseAria:"Close",cellPropertiesColor:"Text color",cellPropertiesVerticalAlign:"Vertical align",cellPropertiesVerticalAlignDefault:"Default",cellPropertiesVerticalAlignTop:"Top",cellPropertiesVerticalAlignMiddle:"Middle",cellPropertiesVerticalAlignBottom:"Bottom",cellPropertiesVerticalAlignBaseline:"Baseline",cellPropertiesWidth:"Width",cellPropertiesColSpan:"Column span",cellPropertiesRowSpan:"Row span",rowPropertiesDialogTitle:"Row properties",rowPropertiesDialogCloseAria:"Close",rowPropertiesHeight:"Height",paragraphDialogTitle:"Paragraph properties",pageDialogTitle:"Page properties",pageDialogTabBackgroundImage:"Background Image",pageDialogTabPrint:"Print",pageAtRuleSize:"Page size",pageAtRuleSizeAuto:"Auto",pageAtRuleSizeA4:"A4",pageAtRuleSizeLetter:"Letter",pageAtRuleSizeLegal:"Legal",pageAtRuleSizeCustom:"Custom",pageAtRuleWidth:"Width",pageAtRuleHeight:"Height",pageAtRuleOrientation:"Orientation",pageAtRuleOrientationNone:"Default",pageAtRuleOrientationPortrait:"Portrait",pageAtRuleOrientationLandscape:"Landscape",pageAtRuleMargins:"Page margins",pageAtRuleReset:"Reset print settings",pageAtRuleResetAria:"Remove @page print settings from this page",pageBackgroundImagePreview:"Preview",pageBackgroundImagePreviewAlt:"Page background image preview",pageBackgroundImageClear:"Remove background image",pageBackgroundImageCurrent:"Image selected",paragraphDialogTabBorder:"Border",paragraphDialogTabBackground:"Background",paragraphDialogAlignment:"Alignment",paragraphDialogLists:"Lists",paragraphDialogSpacing:"Spacing",paragraphDialogMargin:"Margin",paragraphDialogPadding:"Padding",paragraphDialogLineHeight:"Line height",paragraphDialogLineHeightNormal:"Normal",paragraphDialogLineHeightUnitless:"×",paragraphDialogLinkSides:"Same on all sides",paragraphDialogSideTop:"Top",paragraphDialogSideRight:"Right",paragraphDialogSideBottom:"Bottom",paragraphDialogSideLeft:"Left",paragraphDialogBorder:"Border",paragraphDialogBorderStyle:"Style",paragraphDialogBorderWidth:"Width",paragraphDialogBorderColor:"Color",paragraphDialogBorderRadius:"Corner radius",paragraphDialogBoxShadow:"Box shadow",paragraphDialogShadowOffsetX:"Offset X",paragraphDialogShadowOffsetY:"Offset Y",paragraphDialogShadowBlur:"Blur",paragraphDialogShadowSpread:"Spread",paragraphDialogShadowColor:"Color",paragraphDialogShadowInset:"Inset",paragraphDialogLengthUnitAria:"Unit",paragraphDialogBorderStyleNone:"None",paragraphDialogBorderStyleSolid:"Solid",paragraphDialogBorderStyleDotted:"Dotted",paragraphDialogBorderStyleDashed:"Dashed",paragraphDialogBorderStyleDouble:"Double",paragraphDialogBorderStyleGroove:"Groove",paragraphDialogBorderStyleRidge:"Ridge",paragraphDialogBorderStyleInset:"Inset",paragraphDialogBorderStyleOutset:"Outset",paragraphDialogBackgroundColor:"Background color",paragraphDialogOpacity:"Opacity",fontSizeUnitPt:"pt",fontSizeUnitPx:"px",fontSizeUnitEm:"em",fontSizeUnitRem:"rem",fontSizeUnitPercent:"%",fontSizeUnitPc:"pc",toolbarAria:"Formatting toolbar",toolbarGroupFile:"File",toolbarGroupPrint:"Print",toolbarGroupEdit:"Edit",toolbarGroupInsert:"Insert",toolbarGroupTable:"Table",toolbarGroupFont:"Fonts",toolbarGroupAlign:"Align",toolbarGroupParagraph:"Paragraph",toolbarGroupView:"View",toolbarGroupFullscreen:"Full screen",toolbarGroupCustom:"Custom",customizeToolbarDialogTitle:"Customize toolbar",customizeToolbarDialogReset:"Reset",customizeToolbarDialogClose:"Close",customizeToolbarDialogCloseAria:"Close",customizeToolbarDialogLoading:"Loading toolbar settings",customizeToolbarItemVisible:"Show on toolbar",customizeToolbarDragHandle:"Drag to reorder group",customizeToolbarMoveUp:"Move group up",customizeToolbarMoveDown:"Move group down",previewDialogTitle:"Document preview",previewDialogClose:"Close",previewDialogCloseAria:"Close",commandAddComment:"Add comment",commandAddCommentAria:"Add comment on selection",commandInsertComment:"Comment",commandInsertCommentAria:"Insert comment on selection",showComments:"Show comments",hideComments:"Hide comments",toggleCommentsVisibleAria:"Toggle comment visibility",commentPanelTitle:"Comment",commentReplyPlaceholder:"Write a reply…",commentPost:"Post",commentEmpty:"No messages yet.",commentPanelCloseAria:"Close comment panel"},gw={modeVisual:"Visual",modeHtml:"HTML",modeVisualAria:"Cambiar al modo visual",modeHtmlAria:"Cambiar al modo HTML",modeFullscreen:"Pantalla completa",modeFullscreenAria:"Activar o desactivar pantalla completa",modeLight:"Modo claro",modeLightAria:"Cambiar al modo claro",modeDark:"Modo oscuro",modeDarkAria:"Cambiar al modo oscuro",exitFullscreenAria:"Salir de pantalla completa",visualEditorAria:"Editor visual",htmlEditorAria:"Editor HTML",menuFile:"Archivo",menuFileAria:"Menú Archivo",menuEdit:"Editar",menuEditAria:"Menú Editar",menuInsert:"Insertar",menuInsertAria:"Menú Insertar",menuView:"Vista",menuViewAria:"Menú Vista",menuFormat:"Formato",menuFormatAria:"Menú Formato",menuFont:"Fuentes",menuFontAria:"Submenú Fuentes",menuParagraph:"Párrafo",menuParagraphAria:"Submenú Párrafo",menuParagraphStyles:"Estilos de párrafo",menuParagraphStylesAria:"Submenú Estilos de párrafo",menuPage:"Página",menuPageAria:"Submenú Página",menuToolbar:"Barra de herramientas",menuToolbarAria:"Submenú Barra de herramientas",menuToolbarPosition:"Posición",menuToolbarPositionAria:"Submenú Posición de la barra de herramientas",toolbarPositionTop:"Arriba",toolbarPositionTopAria:"Acoplar la barra de herramientas arriba",toolbarPositionLeft:"Izquierda",toolbarPositionLeftAria:"Acoplar la barra de herramientas a la izquierda",toolbarPositionRight:"Derecha",toolbarPositionRightAria:"Acoplar la barra de herramientas a la derecha",toolbarPositionBottom:"Abajo",toolbarPositionBottomAria:"Acoplar la barra de herramientas abajo",menuImage:"Imagen",menuImageAria:"Propiedades de imagen",menuInsertRow:"Fila",menuInsertRowAria:"Insertar o eliminar fila",menuInsertColumn:"Columna",menuInsertColumnAria:"Insertar o eliminar columna",menuTable:"Tabla",menuTableAria:"Menú Tabla",menuCustom:"Personalizado",menuCustomAria:"Menú personalizado",menuHamburgerAria:"Abrir menú",menuCloseAria:"Cerrar menú",menuOverlayAria:"Menú del editor",brandMarkAria:"Editor HTML de CommsPliant",commandSave:"Guardar",commandSaveAria:"Guardar como archivo HTML",commandOpen:"Abrir",commandOpenAria:"Abrir archivo HTML",htmlFileDropOverlay:"Suelte un archivo HTML para abrirlo",commandPrint:"Imprimir",commandPrintAria:"Imprimir documento",commandUndo:"Deshacer",commandUndoAria:"Deshacer",commandRedo:"Rehacer",commandRedoAria:"Rehacer",commandCut:"Cortar",commandCutAria:"Cortar",commandCopy:"Copiar",commandCopyAria:"Copiar",commandDelete:"Eliminar",commandDeleteAria:"Eliminar",commandLink:"Enlace",commandLinkAria:"Enlace",commandBookmark:"Marcador",commandBookmarkAria:"Marcador",commandImage:"Imagen",commandImageAria:"Insertar imagen",commandAudio:"Audio",commandAudioAria:"Insertar audio",commandYoutube:"Vídeo de YouTube",commandYoutubeAria:"Insertar vídeo de YouTube",commandImageProperties:"Propiedades de imagen…",commandImagePropertiesAria:"Propiedades de imagen",commandTable:"Tabla",commandTableAria:"Insertar tabla",commandHorizontalRule:"Línea horizontal",commandHorizontalRuleAria:"Insertar línea horizontal",commandInsertPage:"Página",commandInsertPageAria:"Insertar página nueva",commandTableProperties:"Propiedades de tabla…",commandTablePropertiesAria:"Propiedades de tabla",commandCellProperties:"Propiedades de celda…",commandCellPropertiesAria:"Propiedades de celda",commandRowProperties:"Propiedades de fila…",commandRowPropertiesAria:"Propiedades de fila",commandInsertRowBelow:"Añadir debajo",commandInsertRowBelowAria:"Añadir fila debajo",commandInsertRowBefore:"Añadir antes",commandInsertRowBeforeAria:"Añadir fila antes",commandDeleteRow:"Eliminar",commandDeleteRowAria:"Eliminar fila",commandInsertColumnAfter:"Añadir después",commandInsertColumnAfterAria:"Añadir columna después",commandInsertColumnBefore:"Añadir antes",commandInsertColumnBeforeAria:"Añadir columna antes",commandDeleteColumn:"Eliminar",commandDeleteColumnAria:"Eliminar columna",commandMergeCells:"Combinar celdas",commandMergeCellsAria:"Combinar las celdas seleccionadas",commandUnmergeCells:"Separar celdas",commandUnmergeCellsAria:"Dividir las celdas combinadas",contextMenuAria:"Menú contextual del editor",commandBold:"Negrita",commandBoldAria:"Negrita",commandItalic:"Cursiva",commandItalicAria:"Cursiva",commandUnderline:"Subrayado",commandUnderlineAria:"Subrayado",commandStrikethrough:"Tachado",commandStrikethroughAria:"Tachado",commandClearFormatting:"Restablecer formato",commandClearFormattingAria:"Restablecer formato",commandFormatBrush:"Copiar formato",commandFormatBrushAria:"Copiar formato",commandFontSize:"Tamaño de fuente",commandFontSizeAria:"Tamaño de fuente",commandFontSizeUnitAria:"Unidad de tamaño de fuente",commandFontFamily:"Fuente",commandFontFamilyAria:"Familia tipográfica",commandFontProperties:"Propiedades de fuente…",commandFontPropertiesAria:"Propiedades de fuente",commandCustomCss:"CSS personalizado",commandCustomCssAria:"CSS personalizado",commandParagraphProperties:"Propiedades de párrafo…",commandParagraphPropertiesAria:"Propiedades de párrafo",commandPageProperties:"Propiedades de página…",commandPagePropertiesAria:"Propiedades de página",commandFontColor:"Color de fuente",commandFontColorAria:"Color de fuente",commandHighlightColor:"Color de resaltado",commandHighlightColorAria:"Color de resaltado",commandParagraphStyle:"Estilos",commandParagraphStyleAria:"Estilos de párrafo",commandAlignLeft:"Alinear a la izquierda",commandAlignLeftAria:"Alinear a la izquierda",commandAlignCenter:"Alinear al centro",commandAlignCenterAria:"Alinear al centro",commandAlignRight:"Alinear a la derecha",commandAlignRightAria:"Alinear a la derecha",commandAlignJustify:"Justificar",commandAlignJustifyAria:"Justificar",commandIndent:"Aumentar sangría",commandIndentAria:"Aumentar sangría",commandOutdent:"Disminuir sangría",commandOutdentAria:"Disminuir sangría",commandBulletList:"Lista con viñetas",commandBulletListAria:"Lista con viñetas",commandNumberedList:"Lista numerada",commandNumberedListAria:"Lista numerada",commandCustomizeToolbar:"Personalizar barra de herramientas",commandCustomizeToolbarAria:"Personalizar barra de herramientas",commandPreview:"Vista previa",commandPreviewAria:"Vista previa del documento",commandReadAloud:"Leer en voz alta",commandReadAloudAria:"Leer la selección o el documento en voz alta",styleParagraph:"Párrafo",styleHeading1:"Encabezado 1",styleHeading2:"Encabezado 2",styleHeading3:"Encabezado 3",styleHeading4:"Encabezado 4",styleHeading5:"Encabezado 5",styleHeading6:"Encabezado 6",styleAddNew:"Añadir nuevo",styleAddNewAria:"Añadir un estilo de párrafo",customStyleDialogAddTitle:"Añadir estilo de párrafo",customStyleDialogEditTitle:"Editar estilo de párrafo",customStyleDialogTabFont:"Fuente",customStyleDialogTabParagraph:"Párrafo",customStyleDialogName:"Nombre",customStyleDialogDelete:"Eliminar",customStyleDialogDeleteConfirm:"¿Eliminar este estilo de párrafo?",customStyleDialogCloseAria:"Cerrar",customStyleLoading:"Cargando estilos de párrafo",colorAutomatic:"Automático",colorNone:"Sin color",colorCustom:"Color personalizado",colorHex:"Hex",colorRgbR:"R",colorRgbG:"G",colorRgbB:"B",colorPickFromScreen:"Seleccionar de la pantalla",colorRecent:"Colores recientes",fontDialogTitle:"Propiedades de fuente",fontDialogTabGeneral:"General",fontDialogFamily:"Fuente",fontFamilyDefault:"Predeterminada",fontDialogSize:"Tamaño",fontDialogUnit:"Unidad",fontDialogStyle:"Estilo",fontDialogOk:"Aceptar",fontDialogCancel:"Cancelar",linkDialogTitle:"Insertar enlace",linkDialogTabLink:"Enlace",linkDialogTabBookmark:"Marcador",linkDialogHref:"URL",linkDialogHoverTitle:"Título",linkDialogTargetBlank:"Abrir en una pestaña nueva",linkDialogTextDecorationNone:"Sin subrayado",linkDialogHover:"Al pasar el cursor",linkDialogHoverColor:"Color",linkDialogHoverColorField:"Color al pasar el cursor",linkDialogHoverHtml:"HTML",linkDialogHoverHtmlAria:"HTML personalizado al pasar el cursor",linkDialogBookmark:"Marcador",linkDialogBookmarkEmpty:"No hay marcadores en este documento.",linkDialogSelect:"Seleccionar",bookmarkDialogTitle:"Insertar marcador",bookmarkDialogName:"Nombre del marcador",bookmarkDialogHelp:"Empieza por una letra. Usa solo letras, números, guiones y guiones bajos. Debe ser único en el documento.",bookmarkDialogHelpAria:"Formato del nombre del marcador",bookmarkDialogCloseAria:"Cerrar",bookmarkDialogErrorEmpty:"Introduce un nombre de marcador.",bookmarkDialogErrorInvalid:"Empieza por una letra. Usa solo letras, números, guiones y guiones bajos.",bookmarkDialogErrorDuplicate:"Ya existe un marcador con este nombre.",customCssDialogTitle:"CSS personalizado",customCssDialogField:"CSS",customCssDialogFieldAria:"Declaraciones CSS personalizadas",customCssDialogCloseAria:"Cerrar",imageDialogTitle:"Insertar imagen",imageDialogSource:"Origen",imageDialogFile:"Archivo",imageDialogChooseFile:"Elegir archivo",imageDialogUrl:"URL de la imagen",imageDialogAlt:"Texto alternativo",imageDialogTitleField:"Título",imageDialogCloseAria:"Cerrar",imageDialogErrorEmpty:"Elige un archivo o introduce una URL de imagen.",imageDialogErrorInvalid:"Introduce una URL de imagen válida.",imageDialogErrorType:"Usa una imagen JPEG, PNG, GIF, WebP, BMP o AVIF.",imageDialogErrorTooLarge:"Elige una imagen de menos de 2 MB.",audioDialogTitle:"Insertar audio",audioDialogSource:"Origen",audioDialogFile:"Archivo",audioDialogChooseFile:"Elegir archivo",audioDialogUrl:"URL del audio",audioDialogTitleField:"Título",audioDialogCloseAria:"Cerrar",audioDialogErrorEmpty:"Elige un archivo o introduce una URL de audio.",audioDialogErrorInvalid:"Introduce una URL de audio válida.",audioDialogErrorType:"Usa un archivo de audio MP3, WAV, OGG, AAC, WebM o M4A.",audioDialogErrorTooLarge:"Elige un archivo de audio de menos de 5 MB.",youtubeDialogTitle:"Insertar vídeo de YouTube",youtubeDialogUrl:"URL de YouTube",youtubeDialogTitleField:"Título",youtubeDialogCloseAria:"Cerrar",youtubeDialogErrorEmpty:"Introduce una URL de YouTube.",youtubeDialogErrorInvalid:"Introduce una URL de YouTube válida.",imagePropertiesDialogTitle:"Propiedades de imagen",imagePropertiesDialogCloseAria:"Cerrar",imagePropertiesTabAlignment:"Alineación",imagePropertiesTabBorder:"Borde y margen",imagePropertiesTabAdvanced:"Avanzado",imagePropertiesTabHover:"Al pasar el puntero",imagePropertiesSize:"Tamaño",imagePropertiesSizeMode:"Modo de tamaño",imagePropertiesSizeWidth:"Solo ancho",imagePropertiesSizeHeight:"Solo alto",imagePropertiesSizeLock:"Bloquear juntos",imagePropertiesWidth:"Ancho",imagePropertiesHeight:"Alto",imagePropertiesWidthAria:"Ancho de la imagen",imagePropertiesHeightAria:"Alto de la imagen",imagePropertiesSizeUnitAria:"Unidad de tamaño de imagen",imagePropertiesFit:"Ajuste",imagePropertiesFitDefault:"Predeterminado",imagePropertiesFitFill:"Rellenar",imagePropertiesFitContain:"Contener",imagePropertiesFitCover:"Cubrir",imagePropertiesFitNoneValue:"Ninguno",imagePropertiesFitScaleDown:"Reducir",imagePropertiesPosition:"Posición",imagePropertiesPositionDefault:"Predeterminada",imagePropertiesPositionCenter:"Centro",imagePropertiesPositionTop:"Arriba",imagePropertiesPositionBottom:"Abajo",imagePropertiesPositionLeft:"Izquierda",imagePropertiesPositionRight:"Derecha",imagePropertiesPositionTopLeft:"Arriba izquierda",imagePropertiesPositionTopRight:"Arriba derecha",imagePropertiesPositionBottomLeft:"Abajo izquierda",imagePropertiesPositionBottomRight:"Abajo derecha",imagePropertiesRotation:"Rotación",imagePropertiesRotationUnit:"deg",imagePropertiesHoverCss:"CSS al pasar el puntero",imagePropertiesHoverCssAria:"CSS personalizado al pasar el puntero",imagePropertiesHoverHelp:"CSS que se aplica cuando el puntero está sobre la imagen.",imageResizeHandleEastAria:"Redimensionar el ancho de la imagen, mantener la proporción",imageResizeHandleSouthAria:"Redimensionar el alto de la imagen, mantener la proporción",imageResizeHandleSouthEastAria:"Redimensionar la imagen sin mantener la proporción",tableDialogTitle:"Insertar tabla",tableDialogCloseAria:"Cerrar",tableDialogRows:"Filas",tableDialogColumns:"Columnas",tableDialogSize:"Tamaño",tableDialogGridAria:"Cuadrícula de tamaño de tabla",tableDialogInsert:"Insertar",tablePropertiesDialogTitle:"Propiedades de tabla",tablePropertiesDialogCloseAria:"Cerrar",tablePropertiesCollapse:"Contracción de bordes",tablePropertiesCollapseCollapse:"Contraídos",tablePropertiesCollapseSeparate:"Separados",tablePropertiesSpacing:"Espaciado de bordes",tablePropertiesWidth:"Ancho",cellPropertiesDialogTitle:"Propiedades de celda",cellPropertiesDialogCloseAria:"Cerrar",cellPropertiesColor:"Color de texto",cellPropertiesVerticalAlign:"Alineación vertical",cellPropertiesVerticalAlignDefault:"Predeterminada",cellPropertiesVerticalAlignTop:"Arriba",cellPropertiesVerticalAlignMiddle:"Centro",cellPropertiesVerticalAlignBottom:"Abajo",cellPropertiesVerticalAlignBaseline:"Línea base",cellPropertiesWidth:"Ancho",cellPropertiesColSpan:"Columnas",cellPropertiesRowSpan:"Filas",rowPropertiesDialogTitle:"Propiedades de fila",rowPropertiesDialogCloseAria:"Cerrar",rowPropertiesHeight:"Alto",paragraphDialogTitle:"Propiedades de párrafo",pageDialogTitle:"Propiedades de página",pageDialogTabBackgroundImage:"Imagen de fondo",pageDialogTabPrint:"Impresión",pageAtRuleSize:"Tamaño de página",pageAtRuleSizeAuto:"Automático",pageAtRuleSizeA4:"A4",pageAtRuleSizeLetter:"Carta",pageAtRuleSizeLegal:"Legal",pageAtRuleSizeCustom:"Personalizado",pageAtRuleWidth:"Ancho",pageAtRuleHeight:"Alto",pageAtRuleOrientation:"Orientación",pageAtRuleOrientationNone:"Predeterminada",pageAtRuleOrientationPortrait:"Vertical",pageAtRuleOrientationLandscape:"Horizontal",pageAtRuleMargins:"Márgenes de página",pageAtRuleReset:"Restablecer impresión",pageAtRuleResetAria:"Quitar la configuración @page de impresión de esta página",pageBackgroundImagePreview:"Vista previa",pageBackgroundImagePreviewAlt:"Vista previa de la imagen de fondo de página",pageBackgroundImageClear:"Quitar imagen de fondo",pageBackgroundImageCurrent:"Imagen seleccionada",paragraphDialogTabBorder:"Borde",paragraphDialogTabBackground:"Fondo",paragraphDialogAlignment:"Alineación",paragraphDialogLists:"Listas",paragraphDialogSpacing:"Espaciado",paragraphDialogMargin:"Margen",paragraphDialogPadding:"Relleno",paragraphDialogLineHeight:"Interlineado",paragraphDialogLineHeightNormal:"Normal",paragraphDialogLineHeightUnitless:"×",paragraphDialogLinkSides:"Igual en todos los lados",paragraphDialogSideTop:"Superior",paragraphDialogSideRight:"Derecho",paragraphDialogSideBottom:"Inferior",paragraphDialogSideLeft:"Izquierdo",paragraphDialogBorder:"Borde",paragraphDialogBorderStyle:"Estilo",paragraphDialogBorderWidth:"Grosor",paragraphDialogBorderColor:"Color",paragraphDialogBorderRadius:"Radio de esquina",paragraphDialogBoxShadow:"Sombra",paragraphDialogShadowOffsetX:"Desplazamiento X",paragraphDialogShadowOffsetY:"Desplazamiento Y",paragraphDialogShadowBlur:"Desenfoque",paragraphDialogShadowSpread:"Extensión",paragraphDialogShadowColor:"Color",paragraphDialogShadowInset:"Interior",paragraphDialogLengthUnitAria:"Unidad",paragraphDialogBorderStyleNone:"Ninguno",paragraphDialogBorderStyleSolid:"Sólido",paragraphDialogBorderStyleDotted:"Punteado",paragraphDialogBorderStyleDashed:"Discontinuo",paragraphDialogBorderStyleDouble:"Doble",paragraphDialogBorderStyleGroove:"Surco",paragraphDialogBorderStyleRidge:"Relieve",paragraphDialogBorderStyleInset:"Hundido",paragraphDialogBorderStyleOutset:"Saliente",paragraphDialogBackgroundColor:"Color de fondo",paragraphDialogOpacity:"Opacidad",fontSizeUnitPt:"pt",fontSizeUnitPx:"px",fontSizeUnitEm:"em",fontSizeUnitRem:"rem",fontSizeUnitPercent:"%",fontSizeUnitPc:"pc",toolbarAria:"Barra de herramientas",toolbarGroupFile:"Archivo",toolbarGroupPrint:"Imprimir",toolbarGroupEdit:"Editar",toolbarGroupInsert:"Insertar",toolbarGroupTable:"Tabla",toolbarGroupFont:"Fuentes",toolbarGroupAlign:"Alinear",toolbarGroupParagraph:"Párrafo",toolbarGroupView:"Vista",toolbarGroupFullscreen:"Pantalla completa",toolbarGroupCustom:"Personalizado",customizeToolbarDialogTitle:"Personalizar barra de herramientas",customizeToolbarDialogReset:"Restablecer",customizeToolbarDialogClose:"Cerrar",customizeToolbarDialogCloseAria:"Cerrar",customizeToolbarDialogLoading:"Cargando la configuración de la barra",customizeToolbarItemVisible:"Mostrar en la barra",customizeToolbarDragHandle:"Arrastrar para reordenar el grupo",customizeToolbarMoveUp:"Mover el grupo hacia arriba",customizeToolbarMoveDown:"Mover el grupo hacia abajo",previewDialogTitle:"Vista previa del documento",previewDialogClose:"Cerrar",previewDialogCloseAria:"Cerrar",commandAddComment:"Añadir comentario",commandAddCommentAria:"Añadir comentario en la selección",commandInsertComment:"Comentario",commandInsertCommentAria:"Insertar comentario en la selección",showComments:"Mostrar comentarios",hideComments:"Ocultar comentarios",toggleCommentsVisibleAria:"Alternar visibilidad de comentarios",commentPanelTitle:"Comentario",commentReplyPlaceholder:"Escribe una respuesta…",commentPost:"Publicar",commentEmpty:"Aún no hay mensajes.",commentPanelCloseAria:"Cerrar panel de comentarios"},yw={en:lf,es:gw},my=f.createContext(e=>lf[e]);function bw({locale:e="en",children:n}){const o=f.useMemo(()=>{const a=yw[e]??lf;return s=>a[s]},[e]);return l.jsx(my.Provider,{value:o,children:n})}function Se(){return f.useContext(my)}const vw="_menu_labh4_1",xw="_item_labh4_17",ww="_separator_labh4_57",lm={menu:vw,item:xw,separator:ww},Qu=8,Cw=[{type:"item",command:"deleteSelection",labelKey:"commandDelete",ariaKey:"commandDeleteAria",enabled:e=>e==="text"||e==="image"},{type:"item",command:"cut",labelKey:"commandCut",ariaKey:"commandCutAria",enabled:e=>e==="text"||e==="image"},{type:"item",command:"copy",labelKey:"commandCopy",ariaKey:"commandCopyAria",enabled:e=>e==="text"||e==="image"},{type:"separator"},{type:"item",command:"openLinkDialog",labelKey:"commandLink",ariaKey:"commandLinkAria",enabled:e=>e!=="image"},{type:"separator"},{type:"item",command:"openFontProperties",labelKey:"commandFontProperties",ariaKey:"commandFontPropertiesAria",enabled:e=>e!=="image"},{type:"item",command:"openParagraphProperties",labelKey:"commandParagraphProperties",ariaKey:"commandParagraphPropertiesAria",enabled:e=>e!=="image"},{type:"item",command:"openImageProperties",labelKey:"commandImageProperties",ariaKey:"commandImagePropertiesAria",enabled:e=>e==="image"},{type:"item",command:"openTableProperties",labelKey:"commandTableProperties",ariaKey:"commandTablePropertiesAria",enabled:(e,n)=>n.inTable},{type:"item",command:"openCellProperties",labelKey:"commandCellProperties",ariaKey:"commandCellPropertiesAria",enabled:(e,n)=>n.inTable},{type:"item",command:"openRowProperties",labelKey:"commandRowProperties",ariaKey:"commandRowPropertiesAria",enabled:(e,n)=>n.inTable},{type:"item",command:"mergeCells",labelKey:"commandMergeCells",ariaKey:"commandMergeCellsAria",enabled:(e,n)=>n.canMergeCells},{type:"item",command:"unmergeCells",labelKey:"commandUnmergeCells",ariaKey:"commandUnmergeCellsAria",enabled:(e,n)=>n.canUnmergeCells}];function Fh(){return'[role="menuitem"]:not(:disabled)'}function Sw({open:e,x:n,y:o,kind:a,inTable:s=!1,canMergeCells:c=!1,canUnmergeCells:m=!1,commands:g,onClose:y}){const w=Se(),C=f.useId(),S=f.useRef(null);if(f.useLayoutEffect(()=>{var j;if(!e)return;const k=S.current;if(!k)return;const A=k.getBoundingClientRect(),P=Math.max(Qu,Math.min(n,window.innerWidth-A.width-Qu)),T=Math.max(Qu,Math.min(o,window.innerHeight-A.height-Qu));k.style.left=`${P}px`,k.style.top=`${T}px`,(j=k.querySelector(Fh()))==null||j.focus()},[e,n,o,a]),f.useEffect(()=>{if(!e)return;const k=j=>{var F;(F=S.current)!=null&&F.contains(j.target)||y()},A=j=>{j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),y())},P=()=>{y()},T=j=>{var F;if((F=S.current)!=null&&F.contains(j.target)){j.preventDefault();return}j.defaultPrevented||y()};return document.addEventListener("pointerdown",k),document.addEventListener("keydown",A,!0),window.addEventListener("scroll",P,!0),document.addEventListener("contextmenu",T),()=>{document.removeEventListener("pointerdown",k),document.removeEventListener("keydown",A,!0),window.removeEventListener("scroll",P,!0),document.removeEventListener("contextmenu",T)}},[e,y]),!e)return null;const E=k=>{var F;if(k.key!=="ArrowDown"&&k.key!=="ArrowUp")return;const A=[...((F=S.current)==null?void 0:F.querySelectorAll(Fh()))??[]];if(A.length===0)return;const P=A.indexOf(document.activeElement),T=k.key==="ArrowDown"?1:-1,j=A[(P+T+A.length)%A.length];k.preventDefault(),j==null||j.focus()};return l.jsx(Xe,{children:l.jsxs("div",{ref:S,className:lm.menu,role:"menu","aria-labelledby":C,style:{left:n,top:o},onMouseDown:k=>k.preventDefault(),onKeyDown:E,children:[l.jsx("span",{id:C,hidden:!0,children:w("contextMenuAria")}),Cw.map((k,A)=>{if(k.type==="separator")return l.jsx("div",{role:"separator",className:lm.separator},`separator-${A}`);const P=k.enabled(a,{inTable:s,canMergeCells:c,canUnmergeCells:m});return l.jsx("button",{type:"button",role:"menuitem",className:lm.item,"aria-label":w(k.ariaKey),disabled:!P,onClick:()=>{P&&(y(),af(g,k.command))},children:w(k.labelKey)},k.command)})]})})}function kw(e){return e==="touch"||e==="pen"}function Pw(e,n){return e.button===2||e.ctrlKey?!0:!kw(n)}const Hs="data-page",vc="data-page-bg",xc="commspliant-background";function eo(e){return e instanceof HTMLElement&&(e.id===xc||e.hasAttribute(vc))}function Ew(e){return e.hasAttribute(Hs)&&e.parentElement?e.parentElement:e}function sf(e){const n=Ew(e),o=new Set,a=[],s=c=>{c instanceof HTMLElement&&eo(c)&&!o.has(c)&&(o.add(c),a.push(c))};s(n.querySelector(`#${xc}`));for(const c of n.querySelectorAll(`[${vc}]`))s(c);return s(n),a}function uf(e){return sf(e)[0]??null}function hc(e){let n=!1;return e.style.width!=="100%"&&(e.style.width="100%",n=!0),e.style.height!=="100%"&&(e.style.height="100%",n=!0),n}function fy(e,n){return e instanceof HTMLElement&&e!==n&&e.parentElement===n&&e.hasAttribute(Hs)}function py(e){return[...e.children].filter(n=>n instanceof HTMLElement)}function Aw(e){return[...e.childNodes].some(n=>n.nodeType===Node.TEXT_NODE&&(n.textContent??"").trim()!=="")}function Ws(e){return py(e).find(o=>o.hasAttribute(Hs))??null}function Dw(e){if(Aw(e))return null;const n=py(e);if(n.length!==1)return null;const o=n[0];return o.tagName.toLowerCase()!=="div"||eo(o)?null:o}function Tw(e){const n=Ws(e);if(n)return hc(n),n;const o=Dw(e);if(o)return o.setAttribute(Hs,""),hc(o),o;const a=document.createElement("div");for(a.setAttribute(Hs,"");e.firstChild;)a.appendChild(e.firstChild);return e.appendChild(a),hc(a),a}function cf(e){return Ws(e)??e}const Bh=["background-color","background-image","background-size","background-position","background-repeat","opacity"];function Oh(e,n,o){const a=(n==null?void 0:n.style.getPropertyValue(o).trim())??"";a?e.style.setProperty(o,a):e.style.removeProperty(o)}function Ic(e){const n=Ws(e),o=n?uf(n):null;if(Oh(e,n,"background-color"),o)for(const a of Bh)a!=="background-color"&&Oh(e,o,a);else for(const a of Bh)a!=="background-color"&&e.style.removeProperty(a)}const km="<!-- wysiwyg-page-separator -->",Pm="data-page-surface";function xi(e){const n=e.trim();return n?n.includes(km)?e.split(km).map(o=>o.trim()):[e]:[""]}function No(e){return e.length===0?"":e.length===1?e[0]??"":e.join(`
41
+ ${km}
42
+ `)}function Em(){return"<p></p>"}function zh(e){return e.length===0?[Em()]:e.map(n=>n.trim())}function gc(e,n){const o=e.querySelector(`[${Pm}][data-page-index="${n}"]`);return o||([...e.querySelectorAll(`[${Pm}]`)][n]??null)}function df(e){return typeof e.text=="function"?e.text():new Promise((n,o)=>{const a=new FileReader;a.onload=()=>n(String(a.result??"")),a.onerror=()=>o(a.error??new Error("Failed to read file")),a.readAsText(e)})}function jw(e){const n=e.name.toLowerCase();return e.type==="text/html"||n.endsWith(".html")||n.endsWith(".htm")}function Ju(e){var a;if(!e)return!1;if(Array.from(e.types??[]).includes("Files")||e.files&&e.files.length>0)return!0;const o=e.items;if(o){for(let s=0;s<o.length;s++)if(((a=o[s])==null?void 0:a.kind)==="file")return!0}return!1}function Nw(e){var a;const n=[],o=e.files;if(o)for(let s=0;s<o.length;s++){const c=((a=o.item)==null?void 0:a.call(o,s))??o[s];c&&n.push(c)}if(n.length===0&&e.items)for(let s=0;s<e.items.length;s++){const c=e.items[s];if((c==null?void 0:c.kind)!=="file")continue;const m=c.getAsFile();m&&n.push(m)}return n}function Rw(e){return e?Nw(e).find(jw)??null:null}const hy={description:"HTML",accept:{"text/html":[".html",".htm"]}},Lw="document.html";function gy(){return window}function yy(e){return e instanceof DOMException&&e.name==="AbortError"}function Mw(e,n){const o=new Blob([e],{type:"text/html;charset=utf-8"}),a=URL.createObjectURL(o),s=document.createElement("a");s.href=a,s.download=n,s.rel="noopener",document.body.append(s),s.click(),s.remove(),URL.revokeObjectURL(a)}function _w(){return new Promise(e=>{const n=document.createElement("input");n.type="file",n.accept=".html,.htm,text/html",n.hidden=!0;const o=a=>{n.remove(),e(a)};n.addEventListener("change",()=>{var s;const a=(s=n.files)==null?void 0:s[0];if(!a){o(null);return}df(a).then(c=>o(c),()=>o(null))}),n.addEventListener("cancel",()=>o(null)),document.body.append(n),n.click()})}async function Iw(e,n=Lw){const o=gy().showSaveFilePicker;if(typeof o=="function"){try{const s=await(await o({suggestedName:n,types:[hy]})).createWritable();await s.write(e),await s.close()}catch(a){if(yy(a))return;throw a}return}Mw(e,n)}async function Fw(){const e=gy().showOpenFilePicker;if(typeof e=="function")try{const[n]=await e({multiple:!1,types:[hy]}),o=await n.getFile();return await df(o)}catch(n){if(yy(n))return null;throw n}return _w()}const Bw=new Set(["span","strong","b","em","i","u","s","strike","del"]);function Ye(e,n){return n?e===n||e.contains(n):!1}function to(e){return Bw.has(e.tagName.toLowerCase())}function Ow(e,n){const o=document.createRange();return o.selectNodeContents(n),e.compareBoundaryPoints(Range.END_TO_START,o)<0&&e.compareBoundaryPoints(Range.START_TO_END,o)>0}function xn(e){const n=e.commonAncestorContainer;if(n.nodeType===Node.TEXT_NODE)return n.nodeValue?[n]:[];const o=[],a=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let s;for(;s=a.nextNode();)s.nodeValue&&Ow(e,s)&&o.push(s);return o}function Zr(e){const n=e.startContainer,o=e.startOffset;if(n.nodeType===Node.TEXT_NODE){const c=n;if(o>0&&o<c.length){const m=c.splitText(o);e.setStart(m,0),e.endContainer===c&&e.setEnd(m,e.endOffset-o)}}const a=e.endContainer,s=e.endOffset;if(a.nodeType===Node.TEXT_NODE){const c=a;s>0&&s<c.length&&(c.splitText(s),e.setEnd(c,c.length))}}function Ti(e){return e.tagName.toLowerCase()!=="span"||e.style.cssText.trim()?!1:(e.removeAttribute("style"),e.attributes.length===0)}function Mn(e){const n=e.parentNode;if(n){for(;e.firstChild;)n.insertBefore(e.firstChild,e);n.removeChild(e)}}function ji(e,n){const o=[...e.childNodes],a=o.indexOf(n);if(a<=-1||o.length===1)return;const s=e.parentNode;if(!s)return;const c=o.slice(0,a),m=o.slice(a+1);if(c.length>0){const g=e.cloneNode(!1);for(const y of c)g.appendChild(y);s.insertBefore(g,e)}if(m.length>0){const g=e.cloneNode(!1);for(const y of m)g.appendChild(y);s.insertBefore(g,e.nextSibling)}}function va(e){if(e.length===0)return;const n=e[0],o=e[e.length-1],a=document.createRange();a.setStart(n,0),a.setEnd(o,o.data.length);const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(a)}function Gs(e,n){const o=e.parentElement;if(o&&o.tagName.toLowerCase()==="span"&&o.childNodes.length===1)return n(o),o;const a=document.createElement("span");return n(a),o==null||o.insertBefore(a,e),a.appendChild(e),a}const Fc="data-wysiwyg-font",zw=[{name:"Arial",family:"Arial, Helvetica, sans-serif"},{name:"Arial Black",family:"'Arial Black', Gadget, sans-serif"},{name:"Comic Sans MS",family:"'Comic Sans MS', Textile, cursive"},{name:"Courier New",family:"'Courier New', Courier, monospace"},{name:"Georgia",family:"Georgia, serif"},{name:"Helvetica",family:"Helvetica, Arial, sans-serif"},{name:"Impact",family:"Impact, Charcoal, sans-serif"},{name:"Lucida Console",family:"'Lucida Console', Monaco, monospace"},{name:"Lucida Sans Unicode",family:"'Lucida Sans Unicode', 'Lucida Grande', sans-serif"},{name:"Palatino Linotype",family:"'Palatino Linotype', Palatino, serif"},{name:"Tahoma",family:"Tahoma, Geneva, sans-serif"},{name:"Times New Roman",family:"'Times New Roman', Times, serif"},{name:"Trebuchet MS",family:"'Trebuchet MS', Helvetica, sans-serif"},{name:"Verdana",family:"Verdana, Geneva, sans-serif"}];function Us(e){return e.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"").toLowerCase()).filter(Boolean).join(",")}function Ys(e,n){return e===n?!0:!e||!n?!1:Us(e)===Us(n)}function by(e=[]){var a;const n=[],o=new Set;for(const s of[...zw,...e]){const c=s.family.trim();if(!c)continue;const m=Us(c);if(o.has(m))continue;o.add(m);const g=(a=s.css)==null?void 0:a.trim();n.push({name:s.name.trim()||c,family:c,...g?{css:g}:{}})}return n}function Hw(e,n){return e?n.find(o=>Ys(o.family,e))??null:null}function Uw(e){try{const n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"}catch{return!1}}function Kw(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function Bc(e){const n=new Set,o=[];for(const a of e){const s=a.trim();!s||!Uw(s)||n.has(s)||(n.add(s),o.push(s))}return o}function $w(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&amp;/g,"&")}const Vw=new RegExp(`<link\\b[^>]*\\b${Fc}\\b[^>]*>`,"gi");function Ci(e){if(!e.includes(Fc))return{hrefs:[],body:e};const n=[],o=e.replace(Vw,a=>{var c,m;const s=((c=a.match(/\bhref\s*=\s*"([^"]*)"/i))==null?void 0:c[1])??((m=a.match(/\bhref\s*=\s*'([^']*)'/i))==null?void 0:m[1]);return s&&n.push($w(s)),""});return{hrefs:Bc(n),body:o}}function Zu(e,n){const o=Bc(n);return o.length===0?e:`${o.map(s=>`<link rel="stylesheet" href="${Kw(s)}" ${Fc}="">`).join("")}${e}`}function Ww(e,n){const o=Us(n);if(!o)return!1;const a=new DOMParser().parseFromString(e,"text/html"),s=a.createTreeWalker(a.body,NodeFilter.SHOW_ELEMENT);let c=s.currentNode;for(;c;){if(c instanceof HTMLElement){const m=c.style.fontFamily;if(m&&Us(m)===o)return!0}c=s.nextNode()}return!1}function ec(e,n,o=[]){const a=Ci(n).hrefs,s=o.filter(c=>c.css&&Ww(e,c.family)).map(c=>c.css??"");return Bc([...a,...s])}function Gw(e,n=[]){const o=Ci(e).hrefs,a=n.map(s=>s.css??"");return Bc([...o,...a])}function Yw(e){return e.nodeType===Node.TEXT_NODE?e.parentElement:e instanceof Element?e:e.parentElement}function vy(e){return e.style.fontFamily.trim()||null}function mf(e,n){let o=Yw(n);for(;o&&o!==e&&o instanceof HTMLElement;){const a=vy(o);if(a)return a;o=o.parentElement}return null}function Am(e){return e instanceof HTMLElement&&vy(e)!==null}function ff(e){e.style.fontFamily="",e.style.removeProperty("font-family")}function qw(e,n){let o=n;for(;o.parentElement&&o.parentElement!==e;){const a=o.parentElement;if(!to(a)||!Am(a)){o=a;continue}if(ji(a,o),Am(a)&&(ff(a),Ti(a))){Mn(a);continue}o=a}}function xy(e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const o=n.getRangeAt(0);return Ye(e,o.commonAncestorContainer)?o:null}function wy(e){const n=xy(e);if(!n)return{value:null,mixed:!1};const o=n.collapsed?[]:xn(n).filter(g=>g.data.length>0),s=(o.length>0?o:[n.startContainer]).map(g=>mf(e,g)),c=s[0]??null;return s.every(g=>Ys(g,c))?{value:c,mixed:!1}:{value:null,mixed:!0}}function Dm(e,n){const o=xy(e);if(!o||o.collapsed)return!1;const a=n!=null&&n.trim()?n.trim():null;Zr(o);const s=xn(o).filter(c=>c.data.length>0);for(const c of s){const m=mf(e,c);if(a===null){if(m===null)continue;qw(e,c);continue}Ys(m,a)||Gs(c,g=>{g.style.fontFamily=a})}return va(s),!0}function Xw(e,n){if(n){if(n.value===null){ff(e);return}e.style.fontFamily=n.value}}function Qw(e){return e!=null}function Jw(e){const n=e.startContainer,o=e.startOffset;if(n.nodeType!==Node.TEXT_NODE)return;const a=n;if(o<=0||o>=a.length)return;const s=a.splitText(o);e.setStart(s,0),e.collapse(!0)}function Zw(e){var a,s,c;let n=e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset===0?e.startContainer:e.startContainer.childNodes[e.startOffset]??e.startContainer.lastChild??e.startContainer;if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset>0){const m=document.createTextNode("");return(a=e.startContainer.parentNode)==null||a.insertBefore(m,e.startContainer.nextSibling),m}if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset===0){const m=document.createTextNode("");return(s=e.startContainer.parentNode)==null||s.insertBefore(m,e.startContainer),m}const o=document.createTextNode("");return n&&n!==e.startContainer?(c=n.parentNode)==null||c.insertBefore(o,n):e.startContainer.appendChild(o),o}function Tm(e,n){let o=n;for(;o.parentElement&&o.parentElement!==e;){const a=o.parentElement;if(!to(a)||!Am(a)){o=a;continue}if(ji(a,o),ff(a),Ti(a)){Mn(a);continue}o=a.isConnected?a:n}return n}function e1(e,n){Jw(n);const o=Zw(n);return Tm(e,o)}function t1(e,n,o){return!!(o&&o.value===null&&mf(e,n))}const n1=`
43
+ @page {
44
+ margin: 0;
45
+ }
46
+ body {
47
+ margin: 0;
48
+ padding: 1.5cm;
49
+ color: #111;
50
+ background: #fff;
51
+ font-family: system-ui, sans-serif;
52
+ font-size: 1rem;
53
+ font-weight: 400;
54
+ line-height: 1.5;
55
+ }
56
+ p {
57
+ margin: 0 0 0.75em;
58
+ }
59
+ p:last-child {
60
+ margin-bottom: 0;
61
+ }
62
+ h1, h2, h3, h4, h5, h6 {
63
+ margin: 1em 0 0.5em;
64
+ font-weight: 600;
65
+ line-height: 1.25;
66
+ color: inherit;
67
+ }
68
+ h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {
69
+ margin-top: 0;
70
+ }
71
+ h1 { font-size: 1.75rem; }
72
+ h2 { font-size: 1.5rem; }
73
+ h3 { font-size: 1.25rem; }
74
+ h4 { font-size: 1.125rem; }
75
+ h5 { font-size: 1rem; }
76
+ h6 { font-size: 0.875rem; }
77
+ ul, ol {
78
+ margin: 0 0 0.75em;
79
+ padding-left: 1.5em;
80
+ }
81
+ li {
82
+ margin: 0.25em 0;
83
+ }
84
+ a {
85
+ color: #06c;
86
+ text-decoration: underline;
87
+ }
88
+ strong, b { font-weight: 700; }
89
+ em, i { font-style: italic; }
90
+ u { text-decoration: underline; }
91
+ s { text-decoration: line-through; }
92
+ blockquote {
93
+ margin: 0 0 0.75em;
94
+ padding: 0 0 0 0.75em;
95
+ border: 0;
96
+ border-left: 3px solid #d0d0d0;
97
+ color: #444;
98
+ }
99
+ code {
100
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
101
+ font-size: 0.875em;
102
+ background: #f4f4f4;
103
+ padding: 0.1em 0.3em;
104
+ border-radius: 3px;
105
+ }
106
+ pre {
107
+ margin: 0 0 0.75em;
108
+ padding: 0.75em;
109
+ overflow: auto;
110
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
111
+ font-size: 0.875rem;
112
+ line-height: 1.5;
113
+ background: #f4f4f4;
114
+ border-radius: 4px;
115
+ }
116
+ pre code {
117
+ background: transparent;
118
+ padding: 0;
119
+ font-size: inherit;
120
+ }
121
+ hr {
122
+ margin: 1em 0;
123
+ border: 0;
124
+ border-top: 1px solid #d0d0d0;
125
+ }
126
+ img {
127
+ max-width: 100%;
128
+ height: auto;
129
+ vertical-align: middle;
130
+ }
131
+ `.trim();function jm(e,n,o="​"){const{hrefs:a,body:s}=Ci(n),c=e.createElement("meta");c.setAttribute("charset","utf-8");const m=e.createElement("title");m.textContent=o;const g=e.createElement("style");g.textContent=n1;const y=a.map(w=>{const C=e.createElement("link");return C.rel="stylesheet",C.href=w,C});e.head.replaceChildren(c,m,g,...y),e.title=o,e.body.innerHTML=s}const pf=["pt","px","em","rem","%"],ha="pt",r1={pt:[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72],px:[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72],em:[.5,.75,1,1.25,1.5,2,2.5,3],rem:[.5,.75,1,1.25,1.5,2,2.5,3],"%":[50,75,100,125,150,200,250,300]},o1={pt:{min:1,max:400},px:{min:1,max:400},em:{min:.1,max:20},rem:{min:.1,max:20},"%":{min:1,max:1e3}},i1=new Set(pf),a1=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(pt|px|em|rem|%|pc|cm|mm|in|ex|ch|q|vw|vh|vmin|vmax)$/i;function Oc(e){return i1.has(e)}function Jt(e){return Math.round(e*100)/100}function Ie(e){const n=Jt(e);return Number.isInteger(n),String(n)}function hf(e,n){return`${Ie(e)}${n}`}function gf(e){const n=e.trim();if(!n)return null;const o=n.match(a1);if(!o)return null;const a=Number(o[1]);if(!Number.isFinite(a))return null;const s=o[2]==="%"?"%":o[2].toLowerCase();return{value:a,unit:s}}function l1(e,n){const o=e.trim();if(!o)return null;const a=gf(o);if(a)return Oc(a.unit)?ga(a.value,a.unit):null;const s=Number(o.replace(",","."));return Number.isFinite(s)?ga(s,n):null}function ga(e,n){if(!Number.isFinite(e)||e<=0)return null;const{min:o,max:a}=o1[n];return{value:Jt(Math.min(a,Math.max(o,e))),unit:n}}function Cy(e,n,o,a){const s=o>0?o:16,c=a>0?a:16;switch(n){case"px":return Jt(e);case"pt":return Jt(e*.75);case"em":return Jt(e/s);case"rem":return Jt(e/c);case"%":return Jt(e/s*100)}}function s1(e,n,o,a){const s=o>0?o:16,c=a>0?a:16;switch(n){case"px":return e;case"pt":return e*(4/3);case"em":return e*s;case"rem":return e*c;case"%":return e/100*s}}function Sy(e,n,o,a,s){if(n===o)return Jt(e);const c=s1(e,n,a,s);return Cy(c,o,a,s)}const yf="pt",u1=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(pt|px|em|rem|%)$/i,c1=/^[+-]?0(?:\.0+)?$/;function Zt(e){return`${Ie(e.value)}${e.unit}`}function en(e){const n=e.trim();if(!n)return null;if(c1.test(n))return{value:0,unit:"px"};const o=n.match(u1);if(!o)return null;const a=Number(o[1]);if(!Number.isFinite(a))return null;const s=o[2]==="%"?"%":o[2].toLowerCase();return Oc(s)?{value:Jt(a),unit:s}:null}function Ks(e,n,o){const a=e.trim();if(!a)return null;const s=en(a);if(s)return!o&&s.value<0?{...s,value:0}:s;const c=Number(a.replace(",","."));return Number.isFinite(c)?!o&&c<0?{value:0,unit:n}:{value:Jt(c),unit:n}:null}function Ni(e){return e.value>=0?e:{value:0,unit:e.unit}}function er(e,n){return e===n?!0:!e||!n?!1:e.value===n.value&&e.unit===n.unit}function tc(e){return{text:e.text,collapsed:e.collapsed,start:e.start,end:e.end}}function d1(e,n){return n?e===n||e.contains(n):!1}function Hh(e,n){var c;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let a=0,s;for(;s=o.nextNode();){if(s===n||n.contains(s)||n.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING)return a;a+=((c=s.textContent)==null?void 0:c.length)??0}return a}function Uh(e,n,o){var c;if(n.nodeType===Node.TEXT_NODE)return Hh(e,n)+o;let a=0;const s=n.childNodes;for(let m=0;m<o&&m<s.length;m+=1)a+=((c=s[m].textContent)==null?void 0:c.length)??0;return Hh(e,n)+a}function Kh(e,n){var m,g;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let a=Math.max(0,n),s,c=null;for(;s=o.nextNode();){c=s;const y=((m=s.textContent)==null?void 0:m.length)??0;if(a<=y)return{node:s,offset:a};a-=y}return c?{node:c,offset:((g=c.textContent)==null?void 0:g.length)??0}:{node:e,offset:e.childNodes.length}}function bf(e,n,o){const a=document.createRange(),s=Kh(e,n),c=Kh(e,o);return a.setStart(s.node,s.offset),a.setEnd(c.node,c.offset),a}function ky(e,n){try{const o=e.commonAncestorContainer;return n===o||n.contains(o)}catch{return!1}}function $h(e,n){return!!(e&&e.mode==="visual"&&e.visualRange&&(!n.visualRange||!e.collapsed&&n.collapsed))}function m1(e,n){return n.mode!=="visual"?null:n.visualRange&&ky(n.visualRange,e)?n.visualRange:bf(e,n.start,n.end)}function Qr(e){var o;if(e.mode==="html"&&e.htmlEl){const a=e.htmlEl.selectionStart,s=e.htmlEl.selectionEnd;return{mode:"html",text:e.htmlEl.value.slice(a,s),collapsed:a===s,start:a,end:s,visualRange:null}}const n=e.visualEl;if(e.mode==="visual"&&n){const a=window.getSelection();if(a&&a.rangeCount>0){const c=a.getRangeAt(0);if(d1(n,c.commonAncestorContainer)){const m=Uh(n,c.startContainer,c.startOffset),g=Uh(n,c.endContainer,c.endOffset);return{mode:"visual",text:c.toString(),collapsed:c.collapsed,start:Math.min(m,g),end:Math.max(m,g),visualRange:c.cloneRange()}}}const s=((o=n.textContent)==null?void 0:o.length)??0;return{mode:"visual",text:"",collapsed:!0,start:s,end:s,visualRange:null}}return{mode:e.mode,text:"",collapsed:!0,start:0,end:0,visualRange:null}}function Vh(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function f1(e){if(e.snapshot.mode==="html"){const c=e.getHtml(),m=e.snapshot.start,g=e.snapshot.end,y=e.asHtml?e.content:Vh(e.content);e.setHtml(c.slice(0,m)+y+c.slice(g));const w=e.htmlEl;if(w){const C=m+y.length;w.focus(),w.setSelectionRange(C,C)}return}const n=e.visualEl;if(!n){const c=e.asHtml?e.content:Vh(e.content);e.setHtml(e.getHtml()+c);return}const a=(e.snapshot.visualRange&&ky(e.snapshot.visualRange,n)?e.snapshot.visualRange:null)??bf(n,e.snapshot.start,e.snapshot.end);if(a.deleteContents(),e.content)if(e.asHtml){const c=a.createContextualFragment(e.content),m=c.lastChild;a.insertNode(c),m&&(a.setStartAfter(m),a.collapse(!0))}else{const c=document.createTextNode(e.content);a.insertNode(c),a.setStartAfter(c),a.collapse(!0)}const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(a),e.setHtml(n.innerHTML)}const vf=new Set(["p","h1","h2","h3","h4","h5","h6","div","li","blockquote"]),Py=new Set(["table","thead","tbody","tr","td","th"]),xf=new Set([...Py,"ul","ol","li","pre","hr"]);function rt(e){return e.tagName.toLowerCase()}function qs(e){return e.nodeType===Node.TEXT_NODE?e.parentElement:e instanceof Element?e:e.parentElement}function wf(e){return e instanceof HTMLElement&&(rt(e)==="ul"||rt(e)==="ol")}function tr(e){return e instanceof HTMLElement&&rt(e)==="li"}function no(e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const o=n.getRangeAt(0);return Ye(e,o.commonAncestorContainer)?o:null}function Cf(e){const n=e.collapsed?[]:xn(e).filter(o=>o.data.length>0);return n.length>0?n:[e.startContainer]}function bl(e,n,o){var y,w,C;if(n.nodeType===Node.TEXT_NODE){const S=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let E=0,k;for(;k=S.nextNode();){if(k===n)return E+o;E+=((y=k.textContent)==null?void 0:y.length)??0}return E}let a=0;const s=n.childNodes;for(let S=0;S<o&&S<s.length;S+=1)a+=((w=s[S].textContent)==null?void 0:w.length)??0;const c=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let m=0,g;for(;g=c.nextNode();){if(n.contains(g)||n.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_FOLLOWING)return m+a;m+=((C=g.textContent)==null?void 0:C.length)??0}return m+a}function Sf(e,n,o){const a=bf(e,n,o),s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(a)}function kl(e,n){const o=no(e);if(!o)return!1;const a=bl(e,o.startContainer,o.startOffset),s=bl(e,o.endContainer,o.endOffset),c=Math.min(a,s),m=Math.max(a,s),g=n();return Sf(e,c,m),g}function kf(e,n){if(rt(e)===n)return e;const o=document.createElement(n);for(const a of[...e.attributes])o.setAttribute(a.name,a.value);for(;e.firstChild;)o.appendChild(e.firstChild);return e.replaceWith(o),o}function Ar(e){var n;(n=e.getAttribute("style"))!=null&&n.trim()||e.removeAttribute("style")}function p1(e,n){let o=qs(n);for(;o&&o!==e;){if(fy(o,e)||eo(o)){o=o.parentElement;continue}const a=rt(o);if(vf.has(a)&&o instanceof HTMLElement)return o;if(Py.has(a)||a==="pre")return null;o=o.parentElement}return null}function Pl(e){const n=no(e);if(!n)return[];const o=new Set,a=[];for(const s of Cf(n)){const c=p1(e,s);c&&!o.has(c)&&(o.add(c),a.push(c))}return a}function Nm(e){if(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.COMMENT_NODE||!(e instanceof Element))return!0;const n=rt(e);return vf.has(n)||xf.has(n)?!1:to(e)||n==="br"||n==="a"||n==="img"||n==="span"}function h1(e,n){let o=qs(n);for(;o&&o!==e;){if(xf.has(rt(o)))return!0;o=o.parentElement}return!1}function g1(e,n){let o=n;for(;o&&o.parentNode!==e;)o=o.parentNode;return o&&o.parentNode===e?o:null}function y1(e,n){const o=[...e.childNodes],a=o.indexOf(n);if(a<0)return[n];let s=a,c=a;for(;s>0&&Nm(o[s-1]);)s-=1;for(;c<o.length-1&&Nm(o[c+1]);)c+=1;return o.slice(s,c+1)}function Rm(e){for(const n of e.childNodes)if(!(n instanceof HTMLElement&&eo(n)))return n;return null}function b1(e,n,o){if(o.startContainer===e){const a=e.childNodes[Math.min(o.startOffset,Math.max(0,e.childNodes.length-1))]??e.firstChild;return a instanceof HTMLElement&&eo(a)?Rm(e):a}return o.startContainer===n&&e!==n?Rm(e):g1(e,o.startContainer)}function v1(e,n){const o=cf(e);if(h1(e,n.startContainer))return null;if(!Rm(o)){const m=document.createElement("p");return m.appendChild(document.createElement("br")),o.appendChild(m),m}const a=b1(o,e,n);if(!a||a instanceof HTMLElement&&eo(a)||a instanceof Element&&xf.has(rt(a))||a instanceof HTMLElement&&vf.has(rt(a))||!Nm(a))return null;const s=y1(o,a),c=document.createElement("p");o.insertBefore(c,s[0]);for(const m of s)c.appendChild(m);return c}function Xs(e){const n=Pl(e);if(n.length>0)return n;const o=no(e);if(!o)return[];const a=v1(e,o);return a?[a]:[]}function vl(e){const n=e.parentElement;return n&&wf(n)?n:null}function Ey(e){if(e.length===0)return[];const n=[[e[0]]];for(let o=1;o<e.length;o+=1){const a=e[o-1],s=e[o];a.parentNode===s.parentNode&&x1(a,s)?n[n.length-1].push(s):n.push([s])}return n}function x1(e,n){var a;let o=e.nextSibling;for(;o;){if(o===n)return!0;if(o.nodeType===Node.TEXT_NODE&&!((a=o.textContent)!=null&&a.trim())){o=o.nextSibling;continue}return!1}return!1}function w1(e){return e.nodeType===Node.TEXT_NODE?e.parentElement:e instanceof Element?e:e.parentElement}function sm(e){const n=e.trim().match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d*\.?\d+))?\s*\)$/i);if(!n)return null;const o=Number(n[1]),a=Number(n[2]),s=Number(n[3]),c=n[4]===void 0?1:Number(n[4]);return[o,a,s,c].every(m=>Number.isFinite(m))?{r:o,g:a,b:s,a:c}:null}function um(e,n,o){const a=s=>Math.max(0,Math.min(255,Math.round(s))).toString(16).padStart(2,"0");return`#${a(e)}${a(n)}${a(o)}`}function cm(e){const n=e.trim().toLowerCase();return/^#[0-9a-f]{6}$/.test(n)?n:/^#[0-9a-f]{3}$/.test(n)?`#${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}`:null}const C1={black:"#000000",silver:"#c0c0c0",gray:"#808080",grey:"#808080",white:"#ffffff",maroon:"#800000",red:"#ff0000",purple:"#800080",fuchsia:"#ff00ff",magenta:"#ff00ff",green:"#008000",lime:"#00ff00",olive:"#808000",yellow:"#ffff00",navy:"#000080",blue:"#0000ff",teal:"#008080",aqua:"#00ffff",cyan:"#00ffff",orange:"#ffa500"};function S1(e){const n=e.trim().toLowerCase();return n===""||n==="transparent"||n==="inherit"||n==="initial"||n==="unset"||n==="currentcolor"||n==="currentColor"}function xt(e){const n=e.trim();if(!n||S1(n))return null;const o=cm(n);if(o)return o;const a=sm(n);if(a)return a.a===0?null:um(a.r,a.g,a.b);const s=C1[n.toLowerCase()];if(s)return s;const c=document.createElement("canvas").getContext("2d");if(!c)return null;c.fillStyle="#010203";try{c.fillStyle=n}catch{return null}const m=String(c.fillStyle);if(m==="#010203"){const y=cm(n);if(y==="#010203")return y;const w=sm(n);return w&&um(w.r,w.g,w.b)==="#010203"?"#010203":n.trim().toLowerCase()==="black"?"#000000":null}if(m.startsWith("#"))return cm(m);const g=sm(m);return!g||g.a===0?null:um(g.r,g.g,g.b)}function Ay(e,n){const o=n==="color"?e.style.color:e.style.backgroundColor;return o?xt(o):null}function wc(e,n,o){let a=w1(n);for(;a&&a!==e&&a instanceof HTMLElement;){const s=Ay(a,o);if(s)return s;a=a.parentElement}return null}function Cc(e,n){return e instanceof HTMLElement?Ay(e,n)!==null:!1}function Pf(e,n){if(n==="color"){e.style.color="",e.style.removeProperty("color");return}e.style.backgroundColor="",e.style.removeProperty("background-color")}function Dy(e,n,o){if(n==="color"){e.style.color=o;return}e.style.backgroundColor=o}function k1(e,n,o){let a=n;for(;a.parentElement&&a.parentElement!==e;){const s=a.parentElement;if(!to(s)||!Cc(s,o)){a=s;continue}if(ji(s,a),Cc(s,o)&&(Pf(s,o),Ti(s))){Mn(s);continue}a=s}}function Ty(e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const o=n.getRangeAt(0);return Ye(e,o.commonAncestorContainer)?o:null}function Sc(e,n){const o=Ty(e);if(!o)return{value:null,mixed:!1};const a=o.collapsed?[]:xn(o).filter(y=>y.data.length>0),c=(a.length>0?a:[o.startContainer]).map(y=>wc(e,y,n)),m=c[0]??null;return c.every(y=>y===m)?{value:m,mixed:!1}:{value:null,mixed:!0}}function Is(e,n,o){const a=Ty(e);if(!a||a.collapsed)return!1;const s=o===null?null:xt(o);if(o!==null&&s===null)return!1;Zr(a);const c=xn(a).filter(m=>m.data.length>0);for(const m of c){const g=wc(e,m,n);if(s===null){if(g===null)continue;k1(e,m,n);continue}g!==s&&Gs(m,y=>{Dy(y,n,s)})}return va(c),!0}function Wh(e,n,o){if(o.value===null){Pf(e,n);return}const a=xt(o.value);a&&Dy(e,n,a)}function P1(e){return!!(e!=null&&e.color||e!=null&&e.backgroundColor)}function E1(e){const n=e.startContainer,o=e.startOffset;if(n.nodeType!==Node.TEXT_NODE)return;const a=n;if(o<=0||o>=a.length)return;const s=a.splitText(o);e.setStart(s,0),e.collapse(!0)}function A1(e){var a,s,c;let n=e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset===0?e.startContainer:e.startContainer.childNodes[e.startOffset]??e.startContainer.lastChild??e.startContainer;if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset>0){const m=document.createTextNode("");return(a=e.startContainer.parentNode)==null||a.insertBefore(m,e.startContainer.nextSibling),m}if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset===0){const m=document.createTextNode("");return(s=e.startContainer.parentNode)==null||s.insertBefore(m,e.startContainer),m}const o=document.createTextNode("");return n&&n!==e.startContainer?(c=n.parentNode)==null||c.insertBefore(o,n):e.startContainer.appendChild(o),o}function jy(e,n,o){let a=n;for(;a.parentElement&&a.parentElement!==e;){const s=a.parentElement;if(!to(s)||!o.some(c=>Cc(s,c))){a=s;continue}ji(s,a);for(const c of o)Cc(s,c)&&Pf(s,c);if(Ti(s)){Mn(s);continue}a=s.isConnected?s:n}return n}function D1(e,n,o){E1(n);const a=A1(n);return jy(e,a,o)}function T1(e,n,o){const a=[];return o!=null&&o.color&&o.color.value===null&&wc(e,n,"color")&&a.push("color"),o!=null&&o.backgroundColor&&o.backgroundColor.value===null&&wc(e,n,"backgroundColor")&&a.push("backgroundColor"),a}const bn=["top","right","bottom","left"],zc=["none","solid","dotted","dashed","double","groove","ridge","inset","outset"],Dr={top:null,right:null,bottom:null,left:null},Ef={style:"none",width:null,color:null},j1=new Set(zc),Gh={value:0,unit:"px"};function N1(){return{margin:{...Dr},padding:{...Dr},lineHeight:null,border:{...Ef},borderRadius:null,boxShadow:null,backgroundColor:null,opacity:null}}function Af(){const e=N1();return{margin:e.margin,marginMixed:!1,padding:e.padding,paddingMixed:!1,lineHeight:e.lineHeight,lineHeightMixed:!1,border:e.border,borderMixed:!1,borderRadius:e.borderRadius,radiusMixed:!1,boxShadow:e.boxShadow,shadowMixed:!1,backgroundColor:e.backgroundColor,backgroundMixed:!1,opacity:e.opacity,opacityMixed:!1}}function Mo(e,n){return bn.every(o=>er(e[o],n[o]))}function Ny(e,n){return e===n?!0:!e||!n||e.kind!==n.kind?!1:e.kind==="normal"||n.kind==="normal"?!0:e.kind==="number"&&n.kind==="number"?e.value===n.value:e.kind==="length"&&n.kind==="length"&&e.value===n.value&&e.unit===n.unit}function Ry(e,n){return e.style===n.style&&er(e.width,n.width)&&e.color===n.color}function Ly(e,n){return e===n?!0:!e||!n?!1:er(e.offsetX,n.offsetX)&&er(e.offsetY,n.offsetY)&&er(e.blur,n.blur)&&er(e.spread,n.spread)&&e.color===n.color&&e.inset===n.inset}function R1(e){return e.kind==="normal"?"normal":e.kind==="number"?Ie(e.value):Zt({value:e.value,unit:e.unit})}function L1(e){const n=e.trim();if(!n)return null;if(n.endsWith("%")){const a=Number(n.slice(0,-1).trim().replace(",","."));return Number.isFinite(a)?Pi(a/100):null}const o=Number(n.replace(",","."));return Number.isFinite(o)?Pi(o):null}function Pi(e){return Jt(Math.min(1,Math.max(0,e)))}function kc(e){return Jt(Pi(e)*100)}function My(e){return Pi(e/100)}function _y(e){return Ie(Pi(e))}function M1(e){const n=e.trim();if(!n)return null;if(n.toLowerCase()==="normal")return{kind:"normal"};if(/^[+]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(n)){const a=Number(n);return!Number.isFinite(a)||a<0?null:{kind:"number",value:Jt(a)}}const o=en(n);return!o||o.value<0?null:{kind:"length",value:o.value,unit:o.unit}}function _1(e,n){const o=[];let a="",s=0;for(const c of e){if(c==="("){s+=1,a+=c;continue}if(c===")"){s=Math.max(0,s-1),a+=c;continue}if(c===n&&s===0){a.trim()&&o.push(a.trim()),a="";continue}a+=c}return a.trim()&&o.push(a.trim()),o}function I1(e){const n=[];let o="",a=0;for(const s of e){if(s==="("){a+=1,o+=s;continue}if(s===")"){a=Math.max(0,a-1),o+=s;continue}if(/\s/.test(s)&&a===0){o&&n.push(o),o="";continue}o+=s}return o&&n.push(o),n}function F1(e){const n=[Zt(e.offsetX),Zt(e.offsetY),Zt(e.blur),Zt(e.spread)];e.color&&n.push(e.color);const o=n.join(" ");return e.inset?`inset ${o}`:o}function B1(e){const n=e.trim();if(!n||n.toLowerCase()==="none")return null;const o=_1(n,",")[0];if(!o)return null;const a=I1(o);let s=!1,c=null;const m=[];for(const g of a){if(g.toLowerCase()==="inset"){s=!0;continue}const y=en(g);if(y){m.push(y);continue}const w=xt(g);if(w){c=w;continue}return null}return m.length<2||m.length>4?null:{offsetX:m[0],offsetY:m[1],blur:m[2]??Gh,spread:m[3]??Gh,color:c,inset:s}}function dl(e,n){return en(e.style.getPropertyValue(n))}function O1(e,n,o,a){const s=o&&a?Ni(o):o,c=s?Zt(s):"";return e.style.getPropertyValue(n)===c?!1:(c?e.style.setProperty(n,c):e.style.removeProperty(n),!0)}function Yh(e,n){return{top:dl(e,`${n}-top`),right:dl(e,`${n}-right`),bottom:dl(e,`${n}-bottom`),left:dl(e,`${n}-left`)}}function qh(e,n,o,a){let s=!1;for(const c of bn)O1(e,`${n}-${c}`,o[c],a)&&(s=!0);return s}function z1(e){const n=e.trim().toLowerCase();return j1.has(n)?n:"none"}function Iy(e){const n=z1(e.style.borderStyle||e.style.borderTopStyle),o=dl(e,"border-width")??dl(e,"border-top-width"),a=e.style.borderColor||e.style.borderTopColor,s=a?xt(a):null;return{style:n,width:o,color:s}}function H1(e,n){const o=Iy(e),a=n.style==="none"?{style:"none",width:null,color:null}:{style:n.style,width:n.width?Ni(n.width):null,color:n.color};return Ry(o,a)?!1:a.style==="none"?(e.style.removeProperty("border"),e.style.removeProperty("border-style"),e.style.removeProperty("border-width"),e.style.removeProperty("border-color"),!0):(e.style.borderStyle=a.style,a.width?e.style.borderWidth=Zt(a.width):e.style.removeProperty("border-width"),a.color?e.style.borderColor=a.color:e.style.removeProperty("border-color"),!0)}function Fy(e){const n=e.style.borderRadius.trim();if(!n)return null;const o=n.split(/\s+/)[0];return en(o)}function U1(e,n){const o=n?Ni(n):null,a=Fy(e);return er(a,o)?!1:(o?e.style.borderRadius=Zt(o):e.style.removeProperty("border-radius"),!0)}function By(e){return B1(e.style.boxShadow)}function K1(e,n){const o=By(e),a=n?{...n,blur:Ni(n.blur)}:null;return Ly(o,a)?!1:(a?e.style.boxShadow=F1(a):e.style.removeProperty("box-shadow"),!0)}function Oy(e){return M1(e.style.lineHeight)}function $1(e,n){const o=Oy(e);return Ny(o,n)?!1:(n?e.style.lineHeight=R1(n):e.style.removeProperty("line-height"),!0)}function zy(e){const n=e.style.backgroundColor;return n?xt(n):null}function V1(e,n){const o=n?xt(n):null;return zy(e)===o?!1:(o?e.style.backgroundColor=o:e.style.removeProperty("background-color"),!0)}function Hy(e){return L1(e.style.opacity)}function W1(e,n){const o=Hy(e),a=n===null?null:Pi(n);return o===a?!1:(a===null?e.style.removeProperty("opacity"):e.style.opacity=_y(a),!0)}function El(e){return{margin:Yh(e,"margin"),padding:Yh(e,"padding"),lineHeight:Oy(e),border:Iy(e),borderRadius:Fy(e),boxShadow:By(e),backgroundColor:zy(e),opacity:Hy(e)}}function Al(e,n){let o=!1;return!n.marginMixed&&qh(e,"margin",n.margin,!1)&&(o=!0),!n.paddingMixed&&qh(e,"padding",n.padding,!0)&&(o=!0),!n.lineHeightMixed&&$1(e,n.lineHeight)&&(o=!0),!n.borderMixed&&H1(e,n.border)&&(o=!0),!n.radiusMixed&&U1(e,n.borderRadius)&&(o=!0),!n.shadowMixed&&K1(e,n.boxShadow)&&(o=!0),!n.backgroundMixed&&V1(e,n.backgroundColor)&&(o=!0),!n.opacityMixed&&W1(e,n.opacity)&&(o=!0),o&&Ar(e),o}function G1(e){const n=Af(),o=Pl(e);if(o.length===0)return n;const a=o.map(El),s=a[0];return{margin:s.margin,marginMixed:a.some(c=>!Mo(c.margin,s.margin)),padding:s.padding,paddingMixed:a.some(c=>!Mo(c.padding,s.padding)),lineHeight:s.lineHeight,lineHeightMixed:a.some(c=>!Ny(c.lineHeight,s.lineHeight)),border:s.border,borderMixed:a.some(c=>!Ry(c.border,s.border)),borderRadius:s.borderRadius,radiusMixed:a.some(c=>!er(c.borderRadius,s.borderRadius)),boxShadow:s.boxShadow,shadowMixed:a.some(c=>!Ly(c.boxShadow,s.boxShadow)),backgroundColor:s.backgroundColor,backgroundMixed:a.some(c=>c.backgroundColor!==s.backgroundColor),opacity:s.opacity,opacityMixed:a.some(c=>c.opacity!==s.opacity)}}function Y1(e,n){return kl(e,()=>{const o=Xs(e);if(o.length===0)return!1;let a=!1;for(const s of o)Al(s,n)&&(a=!0);return a})}const Pc="data-page-at-rule";function ya(){return{sizePreset:"auto",customWidth:null,customHeight:null,orientation:null,margin:{...Dr},marginMixed:!1}}function Df(e){return new DOMParser().parseFromString(`<body>${e}</body>`,"text/html")}function Uy(e){return e.body.innerHTML}function Ky(e){var a;const o=Df(e).querySelector(`style[${Pc}]`);return((a=o==null?void 0:o.textContent)==null?void 0:a.trim())??null}function nc(e,n){const o=new RegExp(`margin-${n}\\s*:\\s*([^;]+)`,"i"),a=e.match(o);return a?en(a[1].trim()):null}function q1(e){const n=e.match(/(?:^|[\s{;])margin\s*:\s*([^;]+)/i);if(!n)return{...Dr};const o=n[1].trim().split(/\s+/).map(g=>en(g)),[a,s=a,c=a,m=s]=o;return{top:a??null,right:s??null,bottom:c??null,left:m??null}}function X1(e){const n=e.match(/(?:^|[\s{;])size\s*:\s*([^;]+)/i);if(!n)return{sizePreset:"auto",customWidth:null,customHeight:null,orientation:null};const o=n[1].trim().toLowerCase();if(o==="auto")return{sizePreset:"auto",customWidth:null,customHeight:null,orientation:null};if(o==="a4")return{sizePreset:"A4",customWidth:null,customHeight:null,orientation:null};if(o==="letter")return{sizePreset:"letter",customWidth:null,customHeight:null,orientation:null};if(o==="legal")return{sizePreset:"legal",customWidth:null,customHeight:null,orientation:null};const a=o.includes("landscape"),s=o.includes("portrait"),c=a?"landscape":s?"portrait":null,g=o.replace(/\b(landscape|portrait)\b/g,"").trim().split(/\s+/).filter(Boolean);if(g.length>=2){const y=en(g[0]),w=en(g[1]);if(y&&w)return{sizePreset:"custom",customWidth:y,customHeight:w,orientation:c}}return{sizePreset:"auto",customWidth:null,customHeight:null,orientation:c}}function Q1(e){const n=ya();if(!e)return n;const o=e.match(/@page\s*\{([^}]*)\}/is);if(!o)return n;const a=o[1],s=X1(a),c={top:nc(a,"top"),right:nc(a,"right"),bottom:nc(a,"bottom"),left:nc(a,"left")},g=bn.some(y=>c[y]!==null)?c:q1(a);return{...s,margin:g,marginMixed:!1}}function $y(e){return Q1(Ky(e))}function J1(e){const n=bn.map(a=>e[a]);if(n.every(a=>a===null))return null;const o=n.map(a=>a?Zt(a):"0");return o[0]===o[1]&&o[1]===o[2]&&o[2]===o[3]?`margin: ${o[0]};`:bn.map(a=>e[a]?`margin-${a}: ${Zt(e[a])};`:null).filter(Boolean).join(" ")}function Z1(e){if(e.sizePreset==="auto"&&!e.orientation)return null;const n=[];return e.sizePreset==="A4"?n.push("A4"):e.sizePreset==="letter"?n.push("letter"):e.sizePreset==="legal"?n.push("legal"):e.sizePreset==="custom"&&e.customWidth&&e.customHeight&&n.push(Zt(e.customWidth),Zt(e.customHeight)),e.orientation&&n.push(e.orientation),n.length===0?null:`size: ${n.join(" ")};`}function eC(e){const n=Z1(e),o=J1(e.margin);return!n&&!o?null:`@page { ${[n,o].filter(Boolean).join(" ")} }`}function tC(e){const n=Df(e);for(const o of n.querySelectorAll(`style[${Pc}]`))o.remove();return Uy(n)}function nC(e,n){const o=Df(e);let a=o.querySelector(`style[${Pc}]`);return a||(a=o.createElement("style"),a.setAttribute(Pc,""),o.body.insertBefore(a,o.body.firstChild)),a.textContent=n,Uy(o)}function rC(e,n){const o=eC(n);return o?nC(e,o):Vy(e)}function Vy(e){return tC(e)}function oC(e){const n=e.map(o=>Ky(o)).filter(o=>!!o);return n.length===0?"":n.join(`
132
+ `)}const iC=1e3;function Wy(){const e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.setAttribute("data-wysiwyg-print",""),e.style.position="fixed",e.style.right="0",e.style.bottom="0",e.style.width="0",e.style.height="0",e.style.border="0",document.body.append(e);const n=e.contentDocument,o=e.contentWindow;return!n||!o?(e.remove(),null):{iframe:e,doc:n,win:o}}function Gy(e,n,o,a){jm(e,a);let s=!1;const c=()=>{s||(s=!0,o.remove())};n.addEventListener("afterprint",c),n.focus(),n.print(),window.setTimeout(c,iC)}function aC(e){const n=Wy();n&&Gy(n.doc,n.win,n.iframe,e)}function lC(e){const n=Wy();if(!n)return;const o=[],a=[];for(const g of e){const y=Ci(g);o.push(...y.hrefs),a.push(y.body)}const s=a.map((g,y)=>`<div style="${y<a.length-1?"page-break-after: always;":""}">${g}</div>`).join(""),c=oC(e),m=[c?`<style>${c}</style>`:"",...Array.from(new Set(o)).map(g=>`<link rel="stylesheet" href="${g}" />`),s].filter(Boolean).join("");Gy(n.doc,n.win,n.iframe,m)}function sC(e){return{save:async()=>{if(e.onSave){const o=e.isMultiPagesEnabled()?e.getAllPagesHtml():e.getHtml();await e.onSave(o);return}const n=e.isMultiPagesEnabled()?e.getActivePageHtml():e.getHtml();await Iw(n)},open:async()=>{const n=e.onOpen?await e.onOpen():await Fw();if(n!==null){if(Array.isArray(n)){e.setHtml(No(n));return}if(e.isMultiPagesEnabled()){e.setHtml(No([n]));return}e.setHtml(n)}},print:()=>{if(e.isMultiPagesEnabled()){lC(e.getAllPagesHtml());return}aC(e.getHtml())}}}function uC(e){return{toggleBold:()=>{e.toggleFontMark("bold")},toggleItalic:()=>{e.toggleFontMark("italic")},toggleUnderline:()=>{e.toggleFontMark("underline")},toggleStrikethrough:()=>{e.toggleFontMark("strikethrough")},clearFormatting:()=>{e.clearFormatting()},toggleFormatBrush:()=>{e.toggleFormatBrush()},setFontSize:(n,o)=>{e.setFontSize(n,o)},setFontSizeUnit:n=>{e.setFontSizeUnit(n)},setFontFamily:n=>{e.setFontFamily(n)},setFontColor:n=>{e.setFontColor(n)},setHighlightColor:n=>{e.setHighlightColor(n)},setParagraphStyle:n=>{e.setParagraphStyle(n)},alignLeft:()=>{e.setTextAlign("left")},alignCenter:()=>{e.setTextAlign("center")},alignRight:()=>{e.setTextAlign("right")},alignJustify:()=>{e.setTextAlign("justify")},indent:()=>{e.indent()},outdent:()=>{e.outdent()},toggleBulletList:()=>{e.toggleList("ul")},toggleNumberedList:()=>{e.toggleList("ol")},openFontProperties:n=>{e.openFontProperties(n??"general")},applyFontProperties:n=>{e.applyFontProperties(n)},openParagraphProperties:n=>{e.openParagraphProperties(n??"general")},applyParagraphProperties:n=>{e.applyParagraphProperties(n)},openPageProperties:n=>{e.openPageProperties(n??"font")},applyPageProperties:n=>{e.applyPageProperties(n)},openCustomParagraphStyleDialog:n=>{e.openCustomParagraphStyleDialog(n)},applyCustomParagraphStyle:n=>{e.applyCustomParagraphStyle(n)},openCustomCss:()=>{e.openCustomCss()},applyCustomCss:n=>{e.applyCustomCss(n)}}}function cC(e){return{isBold:()=>e.isFontMarkActive("bold"),isItalic:()=>e.isFontMarkActive("italic"),isUnderline:()=>e.isFontMarkActive("underline"),isStrikethrough:()=>e.isFontMarkActive("strikethrough"),getFontSize:()=>e.getFontSize(),getFontSizeUnit:()=>e.getFontSizeUnit(),isFontSizeMixed:()=>e.isFontSizeMixed(),getFontFamily:()=>e.getFontFamily(),isFontFamilyMixed:()=>e.isFontFamilyMixed(),getFontFaces:()=>e.getFontFaces(),getFontColor:()=>e.getFontColor(),isFontColorMixed:()=>e.isFontColorMixed(),getHighlightColor:()=>e.getHighlightColor(),isHighlightColorMixed:()=>e.isHighlightColorMixed(),getParagraphStyle:()=>e.getParagraphStyle(),isParagraphStyleMixed:()=>e.isParagraphStyleMixed(),isAlignLeft:()=>e.getTextAlign()==="left"&&!e.isTextAlignMixed(),isAlignCenter:()=>e.getTextAlign()==="center"&&!e.isTextAlignMixed(),isAlignRight:()=>e.getTextAlign()==="right"&&!e.isTextAlignMixed(),isAlignJustify:()=>e.getTextAlign()==="justify"&&!e.isTextAlignMixed(),canOutdent:()=>e.canOutdent(),isBulletList:()=>e.isBulletList(),isNumberedList:()=>e.isNumberedList(),hasTextSelection:()=>e.hasTextSelection(),isFormatBrushActive:()=>e.isFormatBrushActive(),customParagraphStylesEnabled:()=>e.customParagraphStylesEnabled(),getCustomParagraphStyles:()=>e.getCustomParagraphStyles(),isCustomParagraphStylesLoading:()=>e.isCustomParagraphStylesLoading()}}function dC(e){return{undo:()=>{e.undo()},redo:()=>{e.redo()}}}function mC(e){return{canUndo:()=>e.canUndo(),canRedo:()=>e.canRedo()}}function fC(e){return{openLinkDialog:n=>{e.openLinkDialog(n)},applyLink:n=>{e.applyLink(n)},openBookmarkDialog:()=>{e.openBookmarkDialog()},applyBookmark:n=>{e.applyBookmark(n)},openImageDialog:()=>{e.openImageDialog()},applyImage:n=>{e.applyImage(n)},openAudioDialog:()=>{e.openAudioDialog()},applyAudio:n=>{e.applyAudio(n)},openYoutubeDialog:()=>{e.openYoutubeDialog()},applyYoutube:n=>{e.applyYoutube(n)},openImageProperties:n=>{e.openImageProperties(n)},applyImageProperties:n=>{e.applyImageProperties(n)},insertHorizontalRule:()=>{e.insertHorizontalRule()},insertPage:()=>{e.insertPage()}}}function pC(e){return{isLink:()=>e.isLink(),isImageSelected:()=>e.isImageSelected(),isMultiPagesEnabled:()=>e.isMultiPagesEnabled(),canInsertPage:()=>e.isMultiPagesEnabled()&&e.getMode()==="visual"}}function hC(e){return{openTableDialog:()=>{e.openTableDialog()},applyTable:n=>{e.applyTable(n)},openTableProperties:()=>{e.openTableProperties()},applyTableProperties:n=>{e.applyTableProperties(n)},openCellProperties:()=>{e.openCellProperties()},applyCellProperties:n=>{e.applyCellProperties(n)},openRowProperties:()=>{e.openRowProperties()},applyRowProperties:n=>{e.applyRowProperties(n)},insertRowBelow:()=>{e.insertRowBelow()},insertRowBefore:()=>{e.insertRowBefore()},deleteRow:()=>{e.deleteRow()},insertColumnAfter:()=>{e.insertColumnAfter()},insertColumnBefore:()=>{e.insertColumnBefore()},deleteColumn:()=>{e.deleteColumn()},mergeCells:()=>{e.mergeCells()},unmergeCells:()=>{e.unmergeCells()}}}function gC(e){return{isInTable:()=>e.isInTable(),canMergeCells:()=>e.canMergeCells(),canUnmergeCells:()=>e.canUnmergeCells()}}function yC(e){return{setVisualMode:()=>{e.setMode("visual")},setHtmlMode:()=>{e.setMode("html")},toggleFullscreen:()=>{e.setFullscreen(!e.getFullscreen())},openCustomizeToolbar:()=>{e.openCustomizeToolbar()},openDocumentPreview:()=>{e.openDocumentPreview()},toggleReadAloud:()=>{e.toggleReadAloud()},setLightMode:()=>{e.setDarkMode(!1)},setDarkMode:()=>{e.setDarkMode(!0)},setToolbarPositionTop:()=>{e.setToolbarPosition("top")},setToolbarPositionLeft:()=>{e.setToolbarPosition("left")},setToolbarPositionRight:()=>{e.setToolbarPosition("right")},setToolbarPositionBottom:()=>{e.setToolbarPosition("bottom")}}}function bC(e){return{isVisualMode:()=>e.getMode()==="visual",isHtmlMode:()=>e.getMode()==="html",isFullscreen:()=>e.getFullscreen(),isLightMode:()=>!e.getDarkMode(),isDarkMode:()=>e.getDarkMode(),isToolbarPositionTop:()=>e.getToolbarPosition()==="top",isToolbarPositionLeft:()=>e.getToolbarPosition()==="left",isToolbarPositionRight:()=>e.getToolbarPosition()==="right",isToolbarPositionBottom:()=>e.getToolbarPosition()==="bottom",isReadingAloud:()=>e.isReadingAloud(),canReadAloud:()=>e.canReadAloud()}}function vC(e){return{addComment:()=>e.addComment(),toggleCommentsVisible:()=>e.toggleCommentsVisible()}}function xC(e){return{canAddComment:()=>e.canAddComment(),areCommentsVisible:()=>e.areCommentsVisible(),isCommentsEnabled:()=>e.isCommentsEnabled()}}function wC(e){return{...sC(e),...dC(e),...dw(e),...fC(e),...hC(e),...yC(e),...uC(e),...vC(e)}}function CC(e){return{...bC(e),...mC(e),...pC(e),...gC(e),...cC(e),...xC(e)}}function Ec(e){return e.nodeType===Node.TEXT_NODE?e.parentElement:e instanceof Element?e:e.parentElement}function SC(e){const n=e.style.fontSize;if(!n)return null;const o=gf(n);return!o||!Oc(o.unit)?null:{value:o.value,unit:o.unit}}function Yy(e,n){let o=Ec(n);for(;o&&o!==e&&o instanceof HTMLElement;){const a=SC(o);if(a)return a;o=o.parentElement}return null}function kC(e,n){const o=Ec(e)??n,a=parseFloat(getComputedStyle(o).fontSize);return Number.isFinite(a)&&a>0?a:16}function qy(e,n){var c;let o=Ec(n);for(;o&&o!==e;){if(o.style.fontSize){const g=o.parentElement??e,y=parseFloat(getComputedStyle(g).fontSize);return Number.isFinite(y)&&y>0?y:16}o=o.parentElement}const a=((c=Ec(n))==null?void 0:c.parentElement)??e,s=parseFloat(getComputedStyle(a).fontSize);return Number.isFinite(s)&&s>0?s:16}function Xy(e){const n=parseFloat(getComputedStyle(e).fontSize);return Number.isFinite(n)&&n>0?n:16}function PC(e,n){return e===n?!0:!e||!n?!1:e.value===n.value&&e.unit===n.unit}function Xh(e=ha){return{value:null,unit:e,mixed:!1}}function Qy(e,n=ha){const o=window.getSelection();if(!o||o.rangeCount===0)return Xh(n);const a=o.getRangeAt(0);if(!Ye(e,a.commonAncestorContainer))return Xh(n);const s=a.collapsed?[]:xn(a).filter(w=>w.data.length>0),c=s.length>0?s:[a.startContainer],m=c.map(w=>Yy(e,w)),g=m[0];if(m.every(w=>PC(w,g))&&g)return{value:g.value,unit:g.unit,mixed:!1};if(m.every(w=>w===null)){const w=c.map(S=>kC(S,e)),C=w[0];if(w.every(S=>Math.abs(S-C)<.05)){const S=qy(e,c[0]),E=Xy(e);return{value:Cy(C,n,S,E),unit:n,mixed:!1}}return{value:null,unit:n,mixed:!0}}return{value:null,unit:n,mixed:!0}}function EC(e,n){return{parentPx:qy(e,n),rootPx:Xy(e)}}function AC(e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const o=n.getRangeAt(0);return Ye(e,o.commonAncestorContainer)?o:null}function Lm(e,n,o){const a=ga(n,o);if(!a)return!1;const s=AC(e);if(!s||s.collapsed)return!1;const c=hf(a.value,a.unit);Zr(s);const m=xn(s).filter(g=>g.data.length>0);for(const g of m){const y=Yy(e,g);y&&y.value===a.value&&y.unit===a.unit||Gs(g,w=>{w.style.fontSize=c})}return va(m),!0}function DC(e,n){e.style.fontSize=hf(n.value,n.unit)}function TC(e){return e.nodeType===Node.TEXT_NODE?e.parentElement:e instanceof Element?e:e.parentElement}function jC(e){return e.trim().toLowerCase()}function Mm(e){const n={};for(const o of e.split(";")){const a=o.trim();if(!a)continue;const s=a.indexOf(":");if(s<=0)continue;const c=jC(a.slice(0,s)),m=a.slice(s+1).trim();c&&(n[c]=m)}return n}function Jy(e){return Object.entries(e).filter(([n])=>n.trim()).map(([n,o])=>`${n}: ${o}`).join("; ")}function NC(e,n){const o={...e};for(const[a,s]of Object.entries(n))s.trim()?o[a]=s:delete o[a];return o}function RC(e){const n=e.trim();if(!n)return"";const o=n.split(";").map(a=>a.trim()).filter(Boolean);return o.length===0?"":o.map(a=>`${a};`).join(`
133
+ `)}function Hc(e){const n=Mm(e);return Jy(n)}function LC(e,n){let o=TC(n);for(;o&&o!==e&&o instanceof HTMLElement;){const a=o.style.cssText.trim();if(a)return a;o=o.parentElement}return""}function Zy(e){const n=no(e);if(!n)return{value:null,mixed:!1};const o=n.collapsed?[]:xn(n).filter(y=>y.data.length>0),c=(o.length>0?o:[n.startContainer]).map(y=>LC(e,y)).map(y=>y.trim()),m=c[0]??"";return c.every(y=>y===m)?{value:m||null,mixed:!1}:{value:null,mixed:!0}}function eb(e,n){const o=Mm(e.style.cssText),a=Mm(n),s=NC(o,a),c=Jy(s);c?e.style.cssText=c:e.removeAttribute("style")}function tb(e,n){const o=Hc(n);if(!o)return!1;const a=no(e);if(!a||a.collapsed)return!1;Zr(a);const s=xn(a).filter(c=>c.data.length>0);if(s.length===0)return!1;for(const c of s)Gs(c,m=>{eb(m,o),Ti(m)&&Mn(m)});return va(s),!0}function MC(e,n){const o=Hc(n);o&&eb(e,o)}function _C(e){return!!(e&&Hc(e))}const nr=["bold","italic","underline","strikethrough"],ml={bold:new Set(["strong","b"]),italic:new Set(["em","i"]),underline:new Set(["u"]),strikethrough:new Set(["s","strike","del"])},IC=new Set(["underline","line-through","overline"]);function Lo(){return{bold:!1,italic:!1,underline:!1,strikethrough:!1}}function FC(e,n){return nr.every(o=>e[o]===n[o])}function BC(e){return nr.some(n=>e[n]!==void 0)}function nb(e,n){const o={...e};if(!n)return o;for(const a of nr){const s=n[a];s!==void 0&&(o[a]=s)}return o}function OC(e,n,o){const a=e[o]??n[o],s={...e,[o]:!a};return s[o]===n[o]&&delete s[o],s}function Ei(e){return(e.style.textDecorationLine||e.style.textDecoration).split(/\s+/).filter(o=>IC.has(o))}function xl(e,n){if(n.length===0){e.style.textDecorationLine="",e.style.removeProperty("text-decoration-line"),e.style.textDecoration&&(e.style.textDecoration="",e.style.removeProperty("text-decoration"));return}e.style.textDecorationLine=n.join(" ")}function rb(e,n){const o=e,a=e.tagName.toLowerCase();if(n==="bold"){if(ml.bold.has(a))return!0;const m=o.style.fontWeight;if(!m)return null;if(m==="bold"||m==="bolder")return!0;const g=Number(m);return Number.isNaN(g)?m==="normal"||m==="lighter"?!1:null:g>=700}if(n==="italic"){if(ml.italic.has(a))return!0;const m=o.style.fontStyle;return m?m==="italic"||m==="oblique"?!0:m==="normal"?!1:null:null}if(n==="underline"){if(ml.underline.has(a))return!0;const m=o.style.textDecorationLine||o.style.textDecoration;if(!m)return null;if(m==="none")return!1;const g=Ei(o);return g.includes("underline")?!0:g.length>0?!1:null}if(ml.strikethrough.has(a))return!0;const s=o.style.textDecorationLine||o.style.textDecoration;if(!s)return null;if(s==="none")return!1;const c=Ei(o);return c.includes("line-through")?!0:c.length>0?!1:null}function Ac(e,n){return rb(e,n)===!0}function wl(e,n,o){let a=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;a&&a!==e&&a instanceof Element;){const s=rb(a,o);if(s!==null)return s;a=a.parentElement}return!1}function ob(e,n){if(n==="bold"){e.style.fontWeight="700";return}if(n==="italic"){e.style.fontStyle="italic";return}if(n==="underline"){const a=Ei(e);a.includes("underline")||a.push("underline"),xl(e,a);return}const o=Ei(e);o.includes("line-through")||o.push("line-through"),xl(e,o)}function ib(e,n){if(n==="bold"){e.style.fontWeight="",e.style.removeProperty("font-weight");return}if(n==="italic"){e.style.fontStyle="",e.style.removeProperty("font-style");return}if(n==="underline"){xl(e,Ei(e).filter(o=>o!=="underline"));return}xl(e,Ei(e).filter(o=>o!=="line-through"))}function zC(e,n){if(n==="bold"){e.style.fontWeight="400";return}if(n==="italic"){e.style.fontStyle="normal";return}if(n==="underline"){const a=Ei(e).filter(s=>s!=="underline");if(a.length===0){e.style.textDecorationLine="none";return}xl(e,a);return}const o=Ei(e).filter(a=>a!=="line-through");if(o.length===0){e.style.textDecorationLine="none";return}xl(e,o)}function HC(e,n){Gs(e,o=>ob(o,n))}function UC(e,n,o){let a=n;for(;a.parentElement&&a.parentElement!==e;){const s=a.parentElement;if(!to(s)||!Ac(s,o)){a=s;continue}if(ji(s,a),Ac(s,o)){if(ml[o].has(s.tagName.toLowerCase())){Mn(s);continue}if(ib(s,o),Ti(s)){Mn(s);continue}}a=s}}function KC(e,n,o){const a=xn(n).filter(s=>s.data.length>0);return a.length===0?wl(e,n.startContainer,o):a.every(s=>wl(e,s,o))}function $C(e,n,o,a){Zr(n);const s=xn(n).filter(c=>c.data.length>0);for(const c of s)a?wl(e,c,o)||HC(c,o):UC(e,c,o);va(s)}function fl(e){const n=window.getSelection();if(!n||n.rangeCount===0)return Lo();const o=n.getRangeAt(0);if(!Ye(e,o.commonAncestorContainer))return Lo();if(o.collapsed)return _m(e,o);const a=xn(o).filter(c=>c.data.length>0);if(a.length===0)return _m(e,o);const s=Lo();for(const c of nr)s[c]=wl(e,a[0],c);for(let c=1;c<a.length;c+=1)for(const m of nr)s[m]=s[m]&&wl(e,a[c],m);return s}function _m(e,n){const o=Lo();for(const a of nr)o[a]=wl(e,n.startContainer,a);return o}function Im(e,n){const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const a=o.getRangeAt(0);if(!Ye(e,a.commonAncestorContainer)||a.collapsed)return!1;const s=KC(e,a,n);return $C(e,a,n,!s),!0}function VC(e){const n=e.startContainer,o=e.startOffset;if(n.nodeType!==Node.TEXT_NODE)return;const a=n;if(o<=0||o>=a.length)return;const s=a.splitText(o);e.setStart(s,0),e.collapse(!0)}function WC(e,n,o){var c,m,g;VC(n);let a=n.startContainer.nodeType===Node.TEXT_NODE&&n.startOffset===0?n.startContainer:n.startContainer.childNodes[n.startOffset]??n.startContainer.lastChild??n.startContainer;if(n.startContainer.nodeType===Node.TEXT_NODE&&n.startOffset>0){const y=document.createTextNode("");(c=n.startContainer.parentNode)==null||c.insertBefore(y,n.startContainer.nextSibling),a=y}else if(n.startContainer.nodeType===Node.TEXT_NODE&&n.startOffset===0){const y=document.createTextNode("");(m=n.startContainer.parentNode)==null||m.insertBefore(y,n.startContainer),a=y}else{const y=document.createTextNode("");a&&a!==n.startContainer?(g=a.parentNode)==null||g.insertBefore(y,a):n.startContainer.appendChild(y),a=y}let s=a;for(;s.parentElement&&s.parentElement!==e;){const y=s.parentElement;if(!to(y)){s=y;continue}if(!o.some(C=>Ac(y,C))){s=y;continue}ji(y,s);for(const C of o)if(Ac(y,C)){if(ml[C].has(y.tagName.toLowerCase())){Mn(y);break}if(ib(y,C),Ti(y)){Mn(y);break}}s=y.isConnected?y:a}return a}function GC(e,n,o){for(const a of nr)o[a]!==n[a]&&(o[a]?ob(e,a):zC(e,a))}function YC(e,n,o,a,s,c,m){var F,L;const g=window.getSelection();if(!g||g.rangeCount===0)return;const y=g.getRangeAt(0);if(!Ye(e,y.commonAncestorContainer))return;const w=_m(e,y),C=nb(w,o),S=nr.filter(H=>w[H]&&!C[H]),E=T1(e,y.startContainer,s),k=t1(e,y.startContainer,c);let A=null;S.length>0?(A=WC(e,y,S),E.length>0&&jy(e,A,E),k&&Tm(e,A)):E.length>0?(A=D1(e,y,E),k&&Tm(e,A)):k?A=e1(e,y):y.deleteContents();const P=document.createElement("span");GC(P,w,C),a&&DC(P,a),s!=null&&s.color&&Wh(P,"color",s.color),s!=null&&s.backgroundColor&&Wh(P,"backgroundColor",s.backgroundColor),c&&Xw(P,c),m&&MC(P,m),P.textContent=n;const T=P.style.cssText.trim()?P:document.createTextNode(n);A?((F=A.parentNode)==null||F.insertBefore(T,A),A.nodeType===Node.TEXT_NODE&&!A.data&&((L=A.parentNode)==null||L.removeChild(A))):y.insertNode(T);const j=document.createRange();j.selectNodeContents(T),j.collapse(!1),g.removeAllRanges(),g.addRange(j)}const Dc=["p","h1","h2","h3","h4","h5","h6"],qC=new Set(Dc),ab=new Set([...Dc,"div"]),Uc=new Set(["li","ul","ol","td","th","tr","thead","tbody","table","blockquote","pre"]),XC=()=>({tag:null,mixed:!1});function lb(e){return qC.has(e)}function QC(e){return lb(e)?e:e==="div"?"p":null}function JC(e){return e instanceof Element&&Uc.has(rt(e))}function sb(e){return e instanceof HTMLElement&&!eo(e)&&ab.has(rt(e))}function Fm(e){if(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.COMMENT_NODE||!(e instanceof Element))return!0;const n=rt(e);return ab.has(n)||Uc.has(n)?!1:to(e)||n==="br"||n==="a"||n==="img"||n==="span"}function ZC(e,n){let o=qs(n);for(;o&&o!==e;){if(Uc.has(rt(o)))return!0;o=o.parentElement}return!1}function ub(e,n){let o=qs(n);for(;o&&o!==e;){if(fy(o,e)){o=o.parentElement;continue}if(sb(o))return o;if(Uc.has(rt(o)))return null;o=o.parentElement}return null}function e0(e,n){const o=new Set,a=[];for(const s of Cf(n)){const c=ub(e,s);c&&!o.has(c)&&(o.add(c),a.push(c))}return a}function t0(e,n){let o=n;for(;o&&o.parentNode!==e;)o=o.parentNode;return o&&o.parentNode===e?o:null}function n0(e,n){const o=[...e.childNodes],a=o.indexOf(n);if(a<0)return[n];let s=a,c=a;for(;s>0&&Fm(o[s-1]);)s-=1;for(;c<o.length-1&&Fm(o[c+1]);)c+=1;return o.slice(s,c+1)}function Bm(e){for(const n of e.childNodes)if(!(n instanceof HTMLElement&&eo(n)))return n;return null}function r0(e,n,o){if(o.startContainer===e){const a=e.childNodes[Math.min(o.startOffset,Math.max(0,e.childNodes.length-1))]??e.firstChild;return a instanceof HTMLElement&&eo(a)?Bm(e):a}return o.startContainer===n&&e!==n?Bm(e):t0(e,o.startContainer)}function o0(e,n,o){const a=cf(e);if(ZC(e,n.startContainer))return!1;if(!Bm(a)){const g=document.createElement(o);return g.appendChild(document.createElement("br")),a.appendChild(g),!0}const s=r0(a,e,n);if(!s||s instanceof HTMLElement&&eo(s)||JC(s)||sb(s)||!Fm(s))return!1;const c=n0(a,s),m=document.createElement(o);a.insertBefore(m,c[0]);for(const g of c)m.appendChild(g);return!0}function i0(e){const n=no(e);if(!n)return XC();const o=Cf(n).map(s=>{const c=ub(e,s);return c?QC(rt(c)):null}),a=o[0];return o.every(s=>s===a)?{tag:a??null,mixed:!1}:{tag:null,mixed:!0}}function a0(e,n){if(!lb(n))return!1;const o=no(e);if(!o)return!1;const a=bl(e,o.startContainer,o.startOffset),s=bl(e,o.endContainer,o.endOffset),c=Math.min(a,s),m=Math.max(a,s),g=e0(e,o);let y=!1;if(g.length===0)y=o0(e,o,n);else for(const w of g)rt(w)!==n&&(kf(w,n),y=!0);return Sf(e,c,m),y}function Tf(e){if(!tr(e))return null;const n=vl(e);if(!n)return null;const o=rt(n);return o==="ul"||o==="ol"?o:null}function cb(e){const n=Pl(e);if(n.length===0)return{type:null,mixed:!1};const o=n.map(Tf),a=o[0];return o.every(s=>s===a)?{type:a,mixed:!1}:{type:null,mixed:!0}}function l0(e,n,o){const a=[...e.children].filter(s=>wf(s));for(const s of a)n.insertBefore(s,o)}function db(e){const n=vl(e),o=document.createElement("p");for(const w of[...e.attributes])o.setAttribute(w.name,w.value);for(o.style.marginLeft="",Ar(o);e.firstChild&&!wf(e.firstChild);)o.appendChild(e.firstChild);const a=[];let s=e.nextElementSibling;for(;s;)a.push(s),s=s.nextElementSibling;const c=(n==null?void 0:n.parentNode)??e.parentNode;if(!n||!c)return e.replaceWith(o),o;const m=tr(c)?c.parentNode??c:c,g=tr(c)?c.nextSibling:n.nextSibling;e.remove();let y=null;if(a.length>0){y=document.createElement(n.tagName);for(const w of a)y.appendChild(w)}return m.insertBefore(o,g),y&&m.insertBefore(y,o.nextSibling),l0(e,m,o.nextSibling),n.childElementCount===0&&n.remove(),o}function s0(e){if(tr(e))return e;const n=kf(e,"li");return n.style.marginLeft="",Ar(n),n}function mb(e,n){if(e.length===0)return!1;if(e.every(tr)){const c=vl(e[0]);if(c&&e.every(m=>m.parentElement===c)&&[...c.children].every(g=>g instanceof HTMLElement&&e.includes(g)))return rt(c)===n?!1:(kf(c,n),!0)}const o=e[0],a=o.parentNode;if(!a)return!1;const s=document.createElement(n);a.insertBefore(s,o);for(const c of e){const m=tr(c)?vl(c):null;s.appendChild(s0(c)),m&&m!==s&&m.childElementCount===0&&m.remove()}return!0}function fb(e){let n=!1;for(const o of[...e].reverse())tr(o)&&(db(o),n=!0);return n}function u0(e,n){return kl(e,()=>{const o=Xs(e);if(o.length===0)return!1;if(o.every(c=>Tf(c)===n))return fb(o);let s=!1;for(const c of Ey(o))mb(c,n)&&(s=!0);return s})}function c0(e,n){return kl(e,()=>{const o=Xs(e);if(o.length===0)return!1;if(n===null)return fb(o);if(o.every(c=>Tf(c)===n))return!1;let s=!1;for(const c of Ey(o))mb(c,n)&&(s=!0);return s})}const pb=40;function jf(e){const n=e.style.marginLeft;if(!n)return 0;const o=Number.parseFloat(n);return Number.isFinite(o)?o:0}function hb(e,n){if(n<=0){e.style.marginLeft="",Ar(e);return}e.style.marginLeft=`${n}px`}function d0(e){let n=e.previousElementSibling;for(;n;){if(tr(n))return n;n=n.previousElementSibling}return null}function m0(e){for(let n=e.children.length-1;n>=0;n-=1){const o=e.children[n];if(o instanceof HTMLElement&&(rt(o)==="ul"||rt(o)==="ol"))return o}return null}function f0(e){const n=d0(e);if(!n)return!1;const o=vl(e);if(!o)return!1;const a=rt(o)==="ol"?"ol":"ul";let s=m0(n);return(!s||rt(s)!==a)&&(s=document.createElement(a),n.appendChild(s)),s.appendChild(e),!0}function p0(e){const n=vl(e);if(!n)return!1;const o=n.parentElement;if(o&&tr(o)){const a=o.parentElement;return a?(a.insertBefore(e,o.nextSibling),n.childElementCount===0&&n.remove(),!0):!1}return db(e),!0}function h0(e){return Pl(e).some(o=>tr(o)||jf(o)>0)}function g0(e){return kl(e,()=>{const n=Xs(e);if(n.length===0)return!1;let o=!1;for(const a of n){if(tr(a)){f0(a)&&(o=!0);continue}hb(a,jf(a)+pb),o=!0}return o})}function y0(e){return kl(e,()=>{const n=Pl(e);if(n.length===0)return!1;let o=!1;for(const a of[...n].reverse()){if(tr(a)){p0(a)&&(o=!0);continue}const s=jf(a);s<=0||(hb(a,Math.max(0,s-pb)),o=!0)}return o})}const gb=["left","center","right","justify"];function b0(e){const n=e.trim().toLowerCase();return n==="center"?"center":n==="right"||n==="end"?"right":n==="justify"?"justify":"left"}function v0(e){return b0(e.style.textAlign)}function yb(e){const n=Pl(e);if(n.length===0)return no(e)?{align:"left",mixed:!1}:{align:null,mixed:!1};const o=n.map(v0),a=o[0];return o.every(s=>s===a)?{align:a,mixed:!1}:{align:null,mixed:!0}}function bb(e,n){return gb.includes(n)?kl(e,()=>{const o=Xs(e);if(o.length===0)return!1;let a=!1;for(const s of o)s.style.textAlign!==n&&(s.style.textAlign=n,a=!0);return a}):!1}function Fs(){return{...Af(),align:"left",alignMixed:!1,list:null,listMixed:!1}}function Qh(e){const n=G1(e),o=yb(e),a=cb(e);return{...n,align:o.align,alignMixed:o.mixed,list:a.type,listMixed:a.mixed}}function vb(e,n){let o=!1;return!n.alignMixed&&n.align&&bb(e,n.align)&&(o=!0),n.listMixed||c0(e,n.list)&&(o=!0),Y1(e,n)&&(o=!0),o}function x0(e,n){return vb(e,Om(n))}function xb(e){return{align:e.alignMixed?void 0:e.align??"left",list:e.listMixed?void 0:e.list,margin:e.marginMixed?void 0:e.margin,padding:e.paddingMixed?void 0:e.padding,lineHeight:e.lineHeightMixed?void 0:e.lineHeight,border:e.borderMixed?void 0:e.border,borderRadius:e.radiusMixed?void 0:e.borderRadius,boxShadow:e.shadowMixed?void 0:e.boxShadow,backgroundColor:e.backgroundMixed?void 0:e.backgroundColor,opacity:e.opacityMixed?void 0:e.opacity}}function Om(e){const n=Fs();return e?{align:e.align??n.align,alignMixed:e.align===void 0,list:e.list===void 0?n.list:e.list,listMixed:e.list===void 0,margin:e.margin??n.margin,marginMixed:e.margin===void 0,padding:e.padding??n.padding,paddingMixed:e.padding===void 0,lineHeight:e.lineHeight===void 0?n.lineHeight:e.lineHeight,lineHeightMixed:e.lineHeight===void 0,border:e.border??n.border,borderMixed:e.border===void 0,borderRadius:e.borderRadius===void 0?n.borderRadius:e.borderRadius,radiusMixed:e.borderRadius===void 0,boxShadow:e.boxShadow===void 0?n.boxShadow:e.boxShadow,shadowMixed:e.boxShadow===void 0,backgroundColor:e.backgroundColor===void 0?n.backgroundColor:e.backgroundColor,backgroundMixed:e.backgroundColor===void 0,opacity:e.opacity===void 0?n.opacity:e.opacity,opacityMixed:e.opacity===void 0}:{...n,alignMixed:!0,listMixed:!0,marginMixed:!0,paddingMixed:!0,lineHeightMixed:!0,borderMixed:!0,radiusMixed:!0,shadowMixed:!0,backgroundMixed:!0,opacityMixed:!0}}const w0=2*1024*1024,C0="image/jpeg,image/png,image/gif,image/webp,image/bmp,image/avif,.jpg,.jpeg,.png,.gif,.webp,.bmp,.avif",S0=new Set(["image/jpeg","image/jpg","image/png","image/gif","image/webp","image/bmp","image/x-ms-bmp","image/avif"]),k0=new Set(["jpg","jpeg","png","gif","webp","bmp","avif"]),P0=/^data:image\/(?:jpeg|jpg|png|gif|webp|bmp|avif)(?:;charset=[^;,]+)?;base64,/i,E0=/^(javascript|vbscript|file|blob):/i;function A0(e={}){return{src:"",alt:"",title:"",...e}}function Dl(e){const n=e.trim();if(!n)return"empty";if(E0.test(n))return"invalid";if(n.toLowerCase().startsWith("data:"))return P0.test(n)?null:"invalid";if(/^[a-z][a-z0-9+.-]*:/i.test(n)){const o=n.slice(0,n.indexOf(":")).toLowerCase();return o==="http"||o==="https"?null:"invalid"}return null}function D0(e){return e.size>w0?"tooLarge":L0(e)?null:"type"}function T0(e){const n=D0(e);return n?Promise.reject(new Error(n)):new Promise((o,a)=>{const s=new FileReader;s.onload=()=>{const c=String(s.result??"");if(Dl(c)){a(new Error("invalid"));return}o(c)},s.onerror=()=>a(s.error??new Error("Failed to read file")),s.readAsDataURL(e)})}function j0(e,n){e.setAttribute("src",n.src.trim());const o=n.alt.trim(),a=n.title.trim();o?e.setAttribute("alt",o):e.removeAttribute("alt"),a?e.setAttribute("title",a):e.removeAttribute("title"),e.style.maxWidth="100%",e.style.height="auto",N0(e,n.css)}function N0(e,n){if(n)for(const o of n.split(";")){const a=o.trim();if(!a)continue;const s=a.indexOf(":");if(s<=0)continue;const c=a.slice(0,s).trim(),m=a.slice(s+1).trim();c&&m&&e.style.setProperty(c,m)}}function R0(e,n){const o=A0(n);if(Dl(o.src))return!1;const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const s=a.getRangeAt(0);if(!Ye(e,s.commonAncestorContainer))return!1;s.collapsed||s.deleteContents();const c=document.createElement("img");return j0(c,o),s.insertNode(c),s.setStartAfter(c),s.collapse(!0),a.removeAllRanges(),a.addRange(s),!0}function zm(e,n){let o=n;for(;o&&o!==e;){if(o instanceof HTMLImageElement)return o;o=o.parentNode}return null}function dm(e,n){if(!Ye(e,n)||n===e)return!1;const o=document.createRange();o.selectNode(n);const a=window.getSelection();return a?(a.removeAllRanges(),a.addRange(o),!0):!1}function L0(e){const n=e.type.trim().toLowerCase();if(n&&S0.has(n))return!0;const o=M0(e.name);return!!(!n&&o&&k0.has(o))}function M0(e){const n=e.lastIndexOf(".");return n<0||n===e.length-1?"":e.slice(n+1).toLowerCase()}const wb=["%","px","pt","pc","em","rem"],_0="%",I0={"%":[25,50,75,100,125,150,200],px:[50,100,150,200,300,400,600,800],pt:[36,48,72,96,144,192,288],pc:[3,4,6,8,12,16,24],em:[2,4,6,8,12,16,24],rem:[2,4,6,8,12,16,24]},Cl={"%":{min:1,max:1e3},px:{min:1,max:4e3},pt:{min:1,max:3e3},pc:{min:.1,max:250},em:{min:.1,max:200},rem:{min:.1,max:200}},F0=new Set(wb),B0=/^([+]?(?:\d+(?:\.\d+)?|\.\d+))\s*(pt|px|em|rem|%|pc)$/i;function O0(e){return F0.has(e)}function pl(e){return`${Ie(e.value)}${e.unit}`}function Tc(e){const n=e.trim();if(!n||n.toLowerCase()==="auto")return null;const o=n.match(B0);if(!o)return null;const a=Number(o[1]);if(!Number.isFinite(a)||a<=0)return null;const s=o[2]==="%"?"%":o[2].toLowerCase();return O0(s)?Sl(a,s):null}function Jh(e,n){const o=e.trim();if(!o)return null;const a=Tc(o);if(a)return a;const s=Number(o.replace(",","."));return Number.isFinite(s)?Sl(s,n):null}function Sl(e,n){if(!Number.isFinite(e)||e<=0)return null;const{min:o,max:a}=Cl[n];return{value:Jt(Math.min(a,Math.max(o,e))),unit:n}}function Bs(e,n,o){const a=o>0?o:1;if(e==="width"){const c=Sl(n.value/a,n.unit)??n;return{width:n,height:c}}return{width:Sl(n.value*a,n.unit)??n,height:n}}const yc="data-hover-css",Nf=["fill","contain","cover","none","scale-down"],Rf=["center","top","bottom","left","right","top left","top right","bottom left","bottom right"],z0=new Set(Nf),H0=new Set(Rf),Zh="if(this._hp==null)this._hp=this.getAttribute('style')||'';this.setAttribute('style',(this._hp?this._hp+';':'')+(this.getAttribute('data-hover-css')||''))",U0="if(this._hp!=null){this.setAttribute('style',this._hp);this._hp=null}",K0=/^-?[a-z][a-z0-9-]*$/i,$0=/expression\s*\(|javascript:|vbscript:|-moz-binding|\bbehavior\b/i,Hm=/rotate\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*deg\s*\)/i;function Cb(e={}){return{sizeMode:"width",width:null,height:null,align:null,margin:{...Dr},border:{...Ef},borderRadius:null,boxShadow:null,opacity:null,objectFit:null,objectPosition:null,rotateDeg:null,hoverCss:"",...e}}function V0(e){const n=e.naturalWidth,o=e.naturalHeight;return n>0&&o>0?n/o:1}function W0(e,n){const o=e.objectFit;if(o!=="cover"&&o!=="contain"&&o!=="fill"||e.width&&e.height||!e.width&&!e.height)return e;if(e.width){const a=Bs("width",e.width,n);return{...e,sizeMode:"lock",width:a.width,height:a.height}}if(e.height){const a=Bs("height",e.height,n);return{...e,sizeMode:"lock",width:a.width,height:a.height}}return e}function G0(e){const n=[];for(const o of e.split(";")){const a=o.trim();if(!a)continue;const s=a.indexOf(":");if(s<=0)continue;const c=a.slice(0,s).trim().toLowerCase(),m=a.slice(s+1).trim();!c||!m||K0.test(c)&&(c==="behavior"||c.endsWith("binding")||$0.test(m)||n.push(`${c}: ${m}`))}return n.join("; ")}function Si(e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const o=n.getRangeAt(0);if(!Ye(e,o.commonAncestorContainer))return null;if(o.startContainer instanceof HTMLImageElement)return o.startContainer;if(o.startContainer.nodeType===Node.ELEMENT_NODE){const a=o.startContainer.childNodes[o.startOffset];if(a instanceof HTMLImageElement&&Ye(e,a))return a}return zm(e,o.commonAncestorContainer)}function Y0(e){const n=Si(e);return n?Sb(n):null}function Sb(e){const n=El(e),o=Z0(e),a=o==="center"?{...n.margin,left:null,right:null}:n.margin,s=X0(e);return Cb({sizeMode:s.sizeMode,width:s.width,height:s.height,align:o,margin:a,border:n.border,borderRadius:n.borderRadius,boxShadow:n.boxShadow,opacity:n.opacity,objectFit:Pb(e),objectPosition:rS(e),rotateDeg:Eb(e),hoverCss:e.getAttribute(yc)??""})}function kb(e,n){let o=!1;return Q0(e,n)&&(o=!0),Al(e,{margin:n.align==="center"?{...n.margin,left:null,right:null}:n.margin,marginMixed:!1,padding:Dr,paddingMixed:!0,lineHeight:null,lineHeightMixed:!0,border:n.border,borderMixed:!1,borderRadius:n.borderRadius,radiusMixed:!1,boxShadow:n.boxShadow,shadowMixed:!1,backgroundColor:null,backgroundMixed:!0,opacity:n.opacity,opacityMixed:!1})&&(o=!0),eS(e,n.align)&&(o=!0),tS(e,n.objectFit)&&(o=!0),nS(e,n.objectPosition)&&(o=!0),iS(e,n.rotateDeg)&&(o=!0),aS(e,n.hoverCss)&&(o=!0),o}function q0(e,n){const o=Si(e);return o?kb(o,n):!1}function X0(e){const n=Tc(e.style.width),o=Tc(e.style.height);return n&&o?{sizeMode:"lock",width:n,height:o}:o&&!n?{sizeMode:"height",width:null,height:o}:{sizeMode:"width",width:n,height:null}}function Q0(e,n){const o={width:e.style.width,height:e.style.height,maxWidth:e.style.maxWidth},a=J0(n);return a.width?e.style.width=pl(a.width):e.style.removeProperty("width"),a.height?e.style.height=pl(a.height):e.style.height="auto",a.width||a.height?e.style.removeProperty("max-width"):e.style.maxWidth="100%",o.width!==e.style.width||o.height!==e.style.height||o.maxWidth!==e.style.maxWidth}function J0(e){return e.sizeMode==="width"?{sizeMode:"width",width:e.width,height:null}:e.sizeMode==="height"?{sizeMode:"height",width:null,height:e.height}:{sizeMode:"lock",width:e.width,height:e.height}}function Z0(e){const n=e.style.float.trim().toLowerCase();if(n==="left")return"left";if(n==="right")return"right";const o=e.style.display.trim().toLowerCase(),a=e.style.marginLeft.trim().toLowerCase(),s=e.style.marginRight.trim().toLowerCase();return o==="block"&&a==="auto"&&s==="auto"?"center":null}function eS(e,n){const o={float:e.style.float,display:e.style.display,marginLeft:e.style.marginLeft,marginRight:e.style.marginRight};return n==="left"?(e.style.float="left",e.style.removeProperty("display"),e.style.marginLeft.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-left"),e.style.marginRight.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-right")):n==="right"?(e.style.float="right",e.style.removeProperty("display"),e.style.marginLeft.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-left"),e.style.marginRight.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-right")):n==="center"?(e.style.removeProperty("float"),e.style.display="block",e.style.marginLeft="auto",e.style.marginRight="auto"):(e.style.removeProperty("float"),e.style.display.trim().toLowerCase()==="block"&&e.style.removeProperty("display"),e.style.marginLeft.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-left"),e.style.marginRight.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-right")),o.float!==e.style.float||o.display!==e.style.display||o.marginLeft!==e.style.marginLeft||o.marginRight!==e.style.marginRight}function Pb(e){const n=e.style.objectFit.trim().toLowerCase();return z0.has(n)?n:null}function tS(e,n){return Pb(e)===n?!1:(n?e.style.objectFit=n:e.style.removeProperty("object-fit"),!0)}function nS(e,n){const o=(n==null?void 0:n.trim().toLowerCase().replace(/\s+/g," "))||"";return e.style.objectPosition.trim().toLowerCase().replace(/\s+/g," ")===o?!1:(o?e.style.objectPosition=o:e.style.removeProperty("object-position"),!0)}function rS(e){const n=e.style.objectPosition.trim().toLowerCase().replace(/\s+/g," ");return n?(H0.has(n),n):null}function Eb(e){const n=Hm.exec(e.style.transform);if(!n)return null;const o=Number(n[1]);return Number.isFinite(o)?Jt(o):null}function oS(e){const n=e.trim();return n?Hm.test(n)&&n.replace(Hm,"").trim()==="":!0}function iS(e,n){const o=Eb(e),a=n===null||n===0?null:Jt(n);return o===a?!1:a===null?oS(e.style.transform)?(e.style.removeProperty("transform"),!0):!1:(e.style.transform=`rotate(${Ie(a)}deg)`,!0)}function aS(e,n){const o=G0(n),a=e.getAttribute(yc)??"",s=e.getAttribute("onmouseover")??"";return a===o&&(o&&s===Zh||!o&&!s)?!1:o?(e.setAttribute(yc,o),e.setAttribute("onmouseover",Zh),e.setAttribute("onmouseout",U0),!0):(e.removeAttribute(yc),e.removeAttribute("onmouseover"),e.removeAttribute("onmouseout"),!0)}const yl={value:100,unit:"%"},lS=new Set(Nf),sS=new Set(Rf),uS=new Set(["cover","contain","scale-down","none"]),eg={contain:"contain",cover:"cover",auto:"none"},tg={fill:"100% 100%",contain:"contain",cover:"cover",none:"auto","scale-down":"contain"};function Lf(){return{src:null,opacity:null,fit:null,position:null,width:{...yl},height:null}}function Ab(e){return e!=null&&uS.has(e)}function Db(e){const n=e.style.opacity.trim();if(!n)return null;const o=Number(n);return Number.isFinite(o)?Pi(o):null}function cS(e,n){const o=Db(e),a=n===null?null:Pi(n);return o===a?!1:(a===null?e.style.removeProperty("opacity"):e.style.opacity=_y(a),!0)}function Tb(e){const n=e.style.backgroundImage.trim();if(!n||n==="none")return null;const o=/^url\(\s*["']?(.+?)["']?\s*\)$/i.exec(n);return o&&o[1].trim()||null}function dS(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function mS(e,n){const o=Tb(e),a=(n==null?void 0:n.trim())??"",s=a&&Dl(a)===null?a:null;return o===s?!1:(s?e.style.backgroundImage=dS(s):e.style.removeProperty("background-image"),!0)}function jb(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function mm(e){return!e||e==="auto"?null:Tc(e)}function fS(e){return Ab(e.fit)&&e.fit?tg[e.fit]:e.fit==="fill"?tg.fill:e.width&&e.height?`${pl(e.width)} ${pl(e.height)}`:e.width?pl(e.width):e.height?`auto ${pl(e.height)}`:null}function pS(e){const n=jb(e.style.backgroundSize);if(!n)return{fit:null,width:null,height:null};if(n==="100% 100%")return{fit:"fill",width:{...yl},height:{...yl}};if(eg[n])return{fit:eg[n],width:null,height:null};if(lS.has(n))return{fit:n,width:null,height:null};const o=n.split(" ");return o.length===1?{fit:null,width:mm(o[0]),height:null}:o.length===2?{fit:null,width:mm(o[0]),height:mm(o[1])}:{fit:null,width:null,height:null}}function hS(e,n){const o=jb(e.style.backgroundSize),a=fS(n);return o===(a??"")?!1:(a?e.style.backgroundSize=a:e.style.removeProperty("background-size"),!0)}function gS(e){const n=e.style.backgroundPosition.trim().toLowerCase().replace(/\s+/g," ");return n?(sS.has(n),n):null}function yS(e,n){const o=(n==null?void 0:n.trim().toLowerCase().replace(/\s+/g," "))||"";return e.style.backgroundPosition.trim().toLowerCase().replace(/\s+/g," ")===o?!1:(o?e.style.backgroundPosition=o:e.style.removeProperty("background-position"),!0)}function Um(e){let n=!1;return e.id!==xc&&(e.id=xc,n=!0),e.hasAttribute(vc)||(e.setAttribute(vc,""),n=!0),e.getAttribute("contenteditable")!=="false"&&(e.setAttribute("contenteditable","false"),n=!0),n}function Nb(e){const n=e.getAttribute("style");return e.style.position="absolute",e.style.inset="0",e.style.zIndex="-1",e.style.pointerEvents="none",e.style.userSelect="none",e.style.backgroundRepeat="no-repeat",e.getAttribute("style")!==n}function bS(e){const n=sf(e),o=n[0]??null;if(o){let s=Um(o);for(const c of n.slice(1))c.remove(),s=!0;return(o.parentNode!==e||o!==e.firstChild)&&(e.insertBefore(o,e.firstChild),s=!0),{layer:o,changed:s}}const a=document.createElement("div");return Um(a),Nb(a),e.insertBefore(a,e.firstChild),{layer:a,changed:!0}}function vS(e){const n=sf(e);if(n.length===0)return!1;for(const o of n)o.remove();return!0}function ng(e){let n=!1;return uf(e)?(e.style.position!=="relative"&&(e.style.position="relative",n=!0),e.style.isolation!=="isolate"&&(e.style.isolation="isolate",n=!0)):(e.style.position==="relative"&&(e.style.removeProperty("position"),n=!0),e.style.isolation==="isolate"&&(e.style.removeProperty("isolation"),n=!0)),n}function xS(e){const n=uf(e);if(!n)return Lf();const o=pS(n);return{src:Tb(n),opacity:Db(n),fit:o.fit,position:gS(n),width:o.width,height:o.height}}function wS(e,n){var g;const o=((g=n.src)==null?void 0:g.trim())??"";if(!(o.length>0&&Dl(o)===null)){const y=vS(e),w=ng(e);return(y||w)&&Ar(e),y||w}const s=bS(e),c=s.layer;let m=s.changed;return Um(c)&&(m=!0),Nb(c)&&(m=!0),ng(e)&&(m=!0),mS(c,o)&&(m=!0),hS(c,n)&&(m=!0),yS(c,n.position)&&(m=!0),cS(c,n.opacity)&&(m=!0),m&&(Ar(c),Ar(e)),m}function CS(){return{size:null,unit:ha,marks:Lo(),fontFamily:null,fontFamilyMixed:!1,fontColor:null,highlightColor:null,fontColorMixed:!1,highlightColorMixed:!1}}function Km(){return{font:CS(),box:Af(),backgroundImage:Lf(),atRule:ya()}}function SS(e){const n=e.style.fontSize,o=n?gf(n):null,a=o&&Oc(o.unit)?{value:o.value,unit:o.unit}:null,s=`${e.style.textDecorationLine} ${e.style.textDecoration}`.toLowerCase(),c=e.style.fontWeight.trim().toLowerCase(),m={bold:c==="bold"||Number(c)>=700,italic:e.style.fontStyle.trim().toLowerCase()==="italic",underline:/\bunderline\b/.test(s),strikethrough:/\bline-through\b/.test(s)},g=e.style.color,y=e.style.fontFamily.trim();return{size:(a==null?void 0:a.value)??null,unit:(a==null?void 0:a.unit)??ha,marks:m,fontFamily:y||null,fontFamilyMixed:!1,fontColor:g?xt(g):null,highlightColor:null,fontColorMixed:!1,highlightColorMixed:!1}}function kS(e,n){const o=e.style.fontSize,a=n.size===null?null:ga(n.size,n.unit);if(!a)return o?(e.style.removeProperty("font-size"),!0):!1;const s=hf(a.value,a.unit);return o===s?!1:(e.style.fontSize=s,!0)}function PS(e,n){var s;if(n.fontFamilyMixed)return!1;const o=(s=n.fontFamily)!=null&&s.trim()?n.fontFamily.trim():null,a=e.style.fontFamily.trim()||null;return Ys(a,o)?!1:(o?e.style.fontFamily=o:e.style.removeProperty("font-family"),!0)}function ES(e,n){if(n.fontColorMixed)return!1;const o=n.fontColor?xt(n.fontColor):null;return(e.style.color?xt(e.style.color):null)===o?!1:(o?e.style.color=o:e.style.removeProperty("color"),!0)}function AS(e,n){let o=!1;const a=n.bold?"bold":"";e.style.fontWeight!==a&&(a?e.style.fontWeight=a:e.style.removeProperty("font-weight"),o=!0);const s=n.italic?"italic":"";e.style.fontStyle!==s&&(s?e.style.fontStyle=s:e.style.removeProperty("font-style"),o=!0);const c=[];n.underline&&c.push("underline"),n.strikethrough&&c.push("line-through");const m=c.join(" ");return(e.style.textDecorationLine||e.style.textDecoration).trim()!==m&&(m?e.style.textDecoration=m:(e.style.removeProperty("text-decoration"),e.style.removeProperty("text-decoration-line")),o=!0),o}function DS(e,n){let o=!1;return kS(e,n)&&(o=!0),PS(e,n)&&(o=!0),ES(e,n)&&(o=!0),AS(e,n.marks)&&(o=!0),o&&Ar(e),o}function TS(e){const n=e.box;return n.backgroundMixed||n.backgroundColor?n:!e.font.highlightColorMixed&&e.font.highlightColor?{...n,backgroundColor:e.font.highlightColor}:n}function jS(e){const n=Ws(e);if(!n)return Km();const o=El(n);return{font:SS(n),box:{margin:o.margin,marginMixed:!1,padding:o.padding,paddingMixed:!1,lineHeight:o.lineHeight,lineHeightMixed:!1,border:o.border,borderMixed:!1,borderRadius:o.borderRadius,radiusMixed:!1,boxShadow:o.boxShadow,shadowMixed:!1,backgroundColor:o.backgroundColor,backgroundMixed:!1,opacity:o.opacity,opacityMixed:!1},backgroundImage:xS(n),atRule:$y(e.innerHTML)}}function NS(e,n){const o=no(e),a=o?bl(e,o.startContainer,o.startOffset):null,s=o?bl(e,o.endContainer,o.endOffset):null,c=Ws(e),m=Tw(e);hc(m);const g=DS(m,n.font),y=Al(m,TS(n)),w=wS(m,n.backgroundImage);Ic(e);const C=$y(e.innerHTML),S=rC(e.innerHTML,n.atRule);S!==e.innerHTML&&(e.innerHTML=S);const E=JSON.stringify(C)!==JSON.stringify(n.atRule);return a!==null&&s!==null&&Sf(e,Math.min(a,s),Math.max(a,s)),!c||g||y||w||E}function RS(e){const n=Vy(e.innerHTML);return n===e.innerHTML?!1:(e.innerHTML=n,Ic(e),!0)}const Mf="data-hover-html",LS="noopener noreferrer",MS="var n=this._hoverBox;if(!n){n=document.createElement('div');n.style.cssText='position:absolute;z-index:2147483646;background:#fff;border:1px solid #c8c8c8;border-radius:4px;padding:0.35rem 0.5rem;color:#222;max-width:18rem';this._hoverBox=n}n.innerHTML=this.getAttribute('data-hover-html')||'';var r=this.getBoundingClientRect();n.style.left=r.left+window.scrollX+'px';n.style.top=r.bottom+4+window.scrollY+'px';document.body.appendChild(n)",_S="this._hoverBox&&this._hoverBox.remove()",IS=/^(#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+(?:\s*,\s*(?:0|0?\.\d+|1))?\s*\))$/;function Kc(e={}){return{href:"",title:"",targetBlank:!1,textDecorationNone:!1,hoverMode:"color",hoverColor:null,hoverHtml:"",...e}}function FS(e){return e.tagName.toLowerCase()==="a"&&e.hasAttribute("href")}function $s(e,n){let o=n;for(;o&&o!==e;){if(o instanceof Element&&FS(o))return o;o=o.parentNode}return null}function Rb(e){return IS.test(e)}function BS(e){var s;const n=e.getAttribute("onmouseover")??"",o=/this\.style\.color\s*=\s*'([^']+)'/.exec(n),a=((s=o==null?void 0:o[1])==null?void 0:s.trim())??"";return a&&Rb(a)?a:null}function Lb(e){const n=`${e.style.textDecoration} ${e.style.textDecorationLine}`.toLowerCase();return/\bnone\b/.test(n)}function OS(e){const n=e.getAttribute(Mf)??"",o=BS(e);return{href:e.getAttribute("href")??"",title:e.getAttribute("title")??"",targetBlank:e.getAttribute("target")==="_blank",textDecorationNone:Lb(e),hoverMode:n.trim()?"html":"color",hoverColor:o,hoverHtml:n}}function Mb(e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const o=n.getRangeAt(0);if(!Ye(e,o.commonAncestorContainer))return null;const a=$s(e,o.commonAncestorContainer);return a?OS(a):null}function zS(e){return Mb(e)!==null}function HS(e){e.removeAttribute("onmouseover"),e.removeAttribute("onmouseout"),e.removeAttribute(Mf)}function US(e,n){var a;if(HS(e),n.hoverMode==="html"){const s=n.hoverHtml.trim();if(!s)return;e.setAttribute(Mf,s),e.setAttribute("onmouseover",MS),e.setAttribute("onmouseout",_S);return}const o=((a=n.hoverColor)==null?void 0:a.trim())??"";!o||!Rb(o)||(e.setAttribute("onmouseover",`this.style.color='${o}'`),e.setAttribute("onmouseout","this.style.color=''"))}function _f(e,n){const o=Kc(n);e.setAttribute("href",o.href);const a=o.title.trim();a?e.setAttribute("title",a):e.removeAttribute("title"),o.targetBlank?(e.setAttribute("target","_blank"),e.setAttribute("rel",LS)):(e.removeAttribute("target"),e.removeAttribute("rel")),o.textDecorationNone?e.style.textDecoration="none":Lb(e)&&(e.style.removeProperty("text-decoration"),e.style.removeProperty("text-decoration-line")),US(e,o)}function KS(e,n){const o=new Set;for(const a of n){const s=$s(e,a);s&&!o.has(s)&&o.add(s)}for(const a of o)Mn(a)}function $S(e,n,o){Zr(n);const a=xn(n).filter(g=>g.data.length>0);KS(e,a),a.length>0&&va(a);const s=window.getSelection();if(!s||s.rangeCount===0)return!1;const c=s.getRangeAt(0);Zr(c);const m=document.createElement("a");_f(m,o);try{return c.surroundContents(m),!0}catch{const g=c.extractContents();return g.hasChildNodes()?(m.appendChild(g),c.insertNode(m),!0):!1}}function VS(e,n){const o=document.createElement("a");_f(o,n),o.textContent=n.href,e.insertNode(o),e.setStartAfter(o),e.collapse(!0);const a=window.getSelection();return a==null||a.removeAllRanges(),a==null||a.addRange(e),!0}function WS(e,n){const o=n.href.trim();if(!o)return!1;const a=Kc({...n,href:o}),s=window.getSelection();if(!s||s.rangeCount===0)return!1;const c=s.getRangeAt(0);if(!Ye(e,c.commonAncestorContainer))return!1;const m=$s(e,c.startContainer),g=$s(e,c.endContainer);return m&&m===g?(_f(m,a),!0):c.collapsed?VS(c,a):$S(e,c,a)}const GS=/^[A-Za-z][A-Za-z0-9_-]*$/,_b="​";function $m(e){var a;const n=cf(e),o=new Set;for(const s of n.querySelectorAll("[id]")){if(s===n)continue;const c=s.id.trim();c&&o.add(c)}for(const s of n.querySelectorAll("a[name]")){const c=(a=s.getAttribute("name"))==null?void 0:a.trim();c&&o.add(c)}return[...o].sort((s,c)=>s.localeCompare(c)).map(s=>({id:s}))}function YS(e){return new Set($m(e).map(n=>n.id))}function Ib(e,n){const o=e.trim();return o?GS.test(o)?n.has(o)?"duplicate":null:"invalid":"empty"}function rg(e,n){const o=document.createElement("a");o.id=n,o.appendChild(document.createTextNode(_b)),e.insertNode(o),e.setStartAfter(o),e.collapse(!0);const a=window.getSelection();a==null||a.removeAllRanges(),a==null||a.addRange(e)}function qS(e,n){var a;const o=document.createElement("a");o.id=n,o.appendChild(document.createTextNode(_b)),(a=e.parentNode)==null||a.insertBefore(o,e)}function XS(e,n){const o=n.trim();if(Ib(o,YS(e)))return!1;const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const s=a.getRangeAt(0);if(!Ye(e,s.commonAncestorContainer))return!1;const c=$s(e,s.startContainer);if(c)return qS(c,o),!0;if(s.collapsed)return rg(s,o),!0;Zr(s);const m=document.createElement("span");m.id=o;try{return s.surroundContents(m),!0}catch{return rg(s,o),!0}}const Er="data-comment-thread",og="wysiwyg-comment-anchor";function QS(){return`cmt_${crypto.randomUUID()}`}function JS(){return crypto.randomUUID()}const jc=20;function ig(e,n){if(!e)return null;const o=e instanceof Element?e:e.parentElement;if(!o)return null;const a=o.closest(`[${Er}]`);return a instanceof HTMLElement&&Ye(n,a)?a:null}function ag(e,n,o){var E;const a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let s=Math.max(0,n),c=Math.max(n,o),m=null,g=0,y=null,w=0,C;for(;C=a.nextNode();){const k=C,A=((E=k.textContent)==null?void 0:E.length)??0;if(!m&&s<=A&&(m=k,g=s),!y&&c<=A){y=k,w=c;break}s-=A,c-=A}if(!m||!y)return null;const S=document.createRange();return S.setStart(m,g),S.setEnd(y,w),S}function ZS(e,n,o){const a=e.textContent??"",s=a.slice(Math.max(0,n-jc),n),c=a.slice(o,o+jc);return{prefix:s,suffix:c}}function ek(e,n){if(n.mode!=="visual")return null;const o=Si(e);if(o)return{type:"image",elementId:o.id||void 0,src:o.getAttribute("src")??void 0};if(n.collapsed&&!n.text)return null;const{prefix:a,suffix:s}=ZS(e,n.start,n.end);return{type:"text",text:n.text,start:n.start,end:n.end,prefix:a,suffix:s}}function tk(e,n){if(n.mode!=="visual")return null;const o=Si(e);if(o!=null&&o.hasAttribute(Er))return o.getAttribute(Er)??null;if(n.visualRange){const a=ig(n.visualRange.startContainer,e);if(a)return a.getAttribute(Er)??null;const s=ig(n.visualRange.endContainer,e);if(s)return s.getAttribute(Er)??null}return null}function Vm(e,n,o){if(!Ye(e,o.commonAncestorContainer))return!1;Zr(o);const a=document.createElement("span");a.setAttribute(Er,n);try{return o.surroundContents(a),!0}catch{const s=o.toString();if(!s)return!1;const c=document.createElement("span");return c.setAttribute(Er,n),c.textContent=s,o.deleteContents(),o.insertNode(c),!0}}function Fb(e,n){e.setAttribute(Er,n)}function nk(e,n,o){const a=Si(e);return a?(Fb(a,n),!0):o.visualRange?Vm(e,n,o.visualRange):!1}function rk(e,n){if(n.type!=="image")return null;for(const o of e.querySelectorAll("img"))if(n.elementId&&o.id===n.elementId||n.src&&o.getAttribute("src")===n.src)return o;return null}function ok(e,n,o){if(o.type!=="text")return!1;if(o.start!==void 0&&o.end!==void 0){const m=ag(e,o.start,o.end);if(m&&m.toString()===o.text)return Vm(e,n,m)}const a=e.textContent??"",s=o.text;if(!s)return!1;let c=0;for(;c<=a.length;){const m=a.indexOf(s,c);if(m===-1)return!1;const g=m+s.length,y=a.slice(Math.max(0,m-jc),m),w=a.slice(g,g+jc);if(o.prefix!==void 0&&y!==o.prefix){c=m+1;continue}if(o.suffix!==void 0&&w!==o.suffix){c=m+1;continue}const C=ag(e,m,g);return C?Vm(e,n,C):!1}return!1}function ik(e,n){for(const o of n)if(!e.querySelector(`[${Er}="${o.id}"]`)){if(o.anchor.type==="image"){const s=rk(e,o.anchor);s&&Fb(s,o.id);continue}ok(e,o.id,o.anchor)}}function lg(e,n){for(const o of e.querySelectorAll(`[${Er}]`))o instanceof HTMLElement&&(n?o.classList.add(og):o.classList.remove(og))}function ak(e,n){if(!n)return null;const o=n instanceof Element?n:n.parentElement;if(!o)return null;const a=o.closest(`[${Er}]`);return a instanceof HTMLElement&&Ye(e,a)?a:null}function lk(e,n=[]){return{id:QS(),anchor:e,messages:n,createdAt:new Date().toISOString(),resolvedAt:null,resolvedBy:null}}function sk(e,n){return{id:JS(),userId:e.userId,userName:e.userName,message:n.trim(),createdAt:new Date().toISOString()}}function uk(e,n,o){return e.map(a=>a.id===n?{...a,messages:[...a.messages,o]}:a)}function ck(e,n){return e.find(o=>o.id===n)}function Bb(e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const o=n.getRangeAt(0);return Ye(e,o.commonAncestorContainer)?o:null}function dk(e){const n=Bb(e);if(!n||n.collapsed)return null;const o=document.createElement("div");o.appendChild(n.cloneContents());const a=o.innerHTML;if(!a)return null;let s=n.toString();if(!s){const c=o.querySelector("img");s=(c==null?void 0:c.getAttribute("alt"))??(c==null?void 0:c.getAttribute("src"))??""}return{html:a,text:s}}function Ob(e){const n=Bb(e);if(!n||n.collapsed)return!1;n.deleteContents();const o=window.getSelection();return o==null||o.removeAllRanges(),o==null||o.addRange(n),!0}async function mk(e){const n=navigator.clipboard;if(!n)return!1;try{if(typeof ClipboardItem=="function"&&typeof n.write=="function"){const o=new ClipboardItem({"text/plain":new Blob([e.text],{type:"text/plain"}),"text/html":new Blob([e.html],{type:"text/html"})});return await n.write([o]),!0}if(typeof n.writeText=="function")return await n.writeText(e.text),!0}catch{if(typeof n.writeText=="function")try{return await n.writeText(e.text),!0}catch{return!1}return!1}return!1}async function zb(e){const n=dk(e);return n?mk(n):!1}async function fk(e){return await zb(e)?Ob(e):!1}const pk=new Set(["strong","b","em","i","u","s","strike","del"]),hk=["font","font-weight","font-style","font-family","font-size","color","background","background-color","text-decoration","text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness"];function gk(e){for(const n of hk)e.style.removeProperty(n)}function yk(e,n){let o=n;for(;o.parentElement&&o.parentElement!==e;){const a=o.parentElement;if(!to(a)){o=a;continue}if(ji(a,o),pk.has(a.tagName.toLowerCase())){Mn(a);continue}if(gk(a),Ti(a)){Mn(a);continue}o=a.isConnected?a:n}}function bk(e){const n=no(e);if(!n||n.collapsed)return!1;const o=e.innerHTML;Zr(n);const a=xn(n).filter(s=>s.data.length>0);if(a.length===0)return!1;for(const s of a)yk(e,s);return va(a),e.innerHTML!==o}function vk(e,n){return e.start===n.start&&e.end===n.end&&e.collapsed===n.collapsed}function xk(e){const n=fl(e),o=Qy(e),a=wy(e),s=Sc(e,"color"),c=Sc(e,"backgroundColor"),m=Zy(e);return{size:o.mixed?null:o.value,unit:o.unit,marks:n,fontFamily:a.mixed?null:a.value,fontFamilyMixed:a.mixed,fontColor:s.mixed?null:s.value,fontColorMixed:s.mixed,highlightColor:c.mixed?null:c.value,highlightColorMixed:c.mixed,customCss:m.mixed?null:m.value,customCssMixed:m.mixed}}function wk(e,n){n.size!==null&&Lm(e,n.size,n.unit);const o=fl(e);for(const a of nr)n.marks[a]!==o[a]&&Im(e,a);return n.fontFamilyMixed||Dm(e,n.fontFamily),n.fontColorMixed||Is(e,"color",n.fontColor),n.highlightColorMixed||Is(e,"backgroundColor",n.highlightColor),!n.customCssMixed&&n.customCss&&tb(e,n.customCss),!0}function bc(){return typeof window<"u"&&"speechSynthesis"in window}function Ck(e){const n=document.createElement("div");return n.innerHTML=e,(n.innerText??n.textContent??"").trim()}function sg(e,n){const o=e.text.trim();return o||Ck(n)||null}function Sk(e){const n=window.speechSynthesis,o=()=>{e()};return{toggle(a){if(!bc())return;if(n.speaking){n.cancel(),o();return}const s=new SpeechSynthesisUtterance(a);s.onend=o,s.onerror=o,n.speak(s),o()},isSpeaking(){return bc()&&n.speaking},cancel(){bc()&&n.speaking&&(n.cancel(),o())}}}const kk=5*1024*1024,Pk="audio/mpeg,audio/mp3,audio/wav,audio/x-wav,audio/ogg,audio/aac,audio/webm,audio/mp4,audio/x-m4a,.mp3,.wav,.ogg,.aac,.webm,.m4a",Ek=new Set(["audio/mpeg","audio/mp3","audio/wav","audio/x-wav","audio/ogg","audio/aac","audio/webm","audio/mp4","audio/x-m4a"]),Ak=new Set(["mp3","wav","ogg","aac","webm","m4a"]),Dk=/^data:audio\/(?:mpeg|mp3|wav|x-wav|ogg|aac|webm|mp4|x-m4a)(?:;charset=[^;,]+)?;base64,/i,Tk=/^(javascript|vbscript|file|blob):/i;function jk(e={}){return{src:"",title:"",...e}}function If(e){const n=e.trim();if(!n)return"empty";if(Tk.test(n))return"invalid";if(n.toLowerCase().startsWith("data:"))return Dk.test(n)?null:"invalid";if(/^[a-z][a-z0-9+.-]*:/i.test(n)){const o=n.slice(0,n.indexOf(":")).toLowerCase();return o==="http"||o==="https"?null:"invalid"}return null}function Nk(e){return e.size>kk?"tooLarge":Ik(e)?null:"type"}function Rk(e){const n=Nk(e);return n?Promise.reject(new Error(n)):new Promise((o,a)=>{const s=new FileReader;s.onload=()=>{const c=String(s.result??"");if(If(c)){a(new Error("invalid"));return}o(c)},s.onerror=()=>a(s.error??new Error("Failed to read file")),s.readAsDataURL(e)})}function Lk(e,n){e.setAttribute("controls",""),e.setAttribute("src",n.src.trim());const o=n.title.trim();o?e.setAttribute("title",o):e.removeAttribute("title"),e.style.maxWidth="100%",Mk(e,n.css)}function Mk(e,n){if(n)for(const o of n.split(";")){const a=o.trim();if(!a)continue;const s=a.indexOf(":");if(s<=0)continue;const c=a.slice(0,s).trim(),m=a.slice(s+1).trim();c&&m&&e.style.setProperty(c,m)}}function _k(e,n){const o=jk(n);if(If(o.src))return!1;const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const s=a.getRangeAt(0);if(!Ye(e,s.commonAncestorContainer))return!1;s.collapsed||s.deleteContents();const c=document.createElement("audio");return Lk(c,o),s.insertNode(c),s.setStartAfter(c),s.collapse(!0),a.removeAllRanges(),a.addRange(s),!0}function Ik(e){const n=e.type.trim().toLowerCase();if(n&&Ek.has(n))return!0;const o=Fk(e.name);return!!(!n&&o&&Ak.has(o))}function Fk(e){const n=e.lastIndexOf(".");return n<0||n===e.length-1?"":e.slice(n+1).toLowerCase()}const Hb=/^(javascript|vbscript|file|blob):/i,Bk=[/(?:youtube\.com\/watch\?(?:[^&]*&)*v=|youtube\.com\/watch\?v=)([\w-]{11})/i,/youtu\.be\/([\w-]{11})/i,/youtube\.com\/embed\/([\w-]{11})/i,/youtube\.com\/shorts\/([\w-]{11})/i];function Ok(e={}){return{url:"",title:"",...e}}function zk(e={}){return{src:"",title:"",...e}}function $c(e){const n=e.trim();if(!n)return null;for(const o of Bk){const a=n.match(o);if(a!=null&&a[1])return a[1]}return null}function Ub(e){return`https://www.youtube.com/embed/${e}`}function Kb(e){const n=e.trim();return n?Hb.test(n)?"invalid":$c(n)?null:"invalid":"empty"}function Hk(e){const n=e.trim();if(!n)return"empty";if(Hb.test(n))return"invalid";if($c(n))return null;if(n.toLowerCase().startsWith("data:"))return/^data:video\//i.test(n)?null:"invalid";if(/^[a-z][a-z0-9+.-]*:/i.test(n)){const o=n.slice(0,n.indexOf(":")).toLowerCase();return o==="http"||o==="https"?null:"invalid"}return null}function $b(e,n){if(n)for(const o of n.split(";")){const a=o.trim();if(!a)continue;const s=a.indexOf(":");if(s<=0)continue;const c=a.slice(0,s).trim(),m=a.slice(s+1).trim();c&&m&&e.style.setProperty(c,m)}}function Vb(e,n,o){e.setAttribute("src",n),e.setAttribute("frameborder","0"),e.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),e.setAttribute("allowfullscreen","");const a=o.title.trim();a?e.setAttribute("title",a):e.removeAttribute("title"),e.style.maxWidth="100%",e.style.width="560px",e.style.aspectRatio="16 / 9",e.style.border="0",$b(e,o.css)}function Uk(e,n){e.setAttribute("controls",""),e.setAttribute("src",n.src.trim());const o=n.title.trim();o?e.setAttribute("title",o):e.removeAttribute("title"),e.style.maxWidth="100%",$b(e,n.css)}function Kk(e,n){const o=Ok(n);if(Kb(o.url))return!1;const a=$c(o.url);if(!a)return!1;const s=window.getSelection();if(!s||s.rangeCount===0)return!1;const c=s.getRangeAt(0);if(!Ye(e,c.commonAncestorContainer))return!1;c.collapsed||c.deleteContents();const m=document.createElement("iframe");return Vb(m,Ub(a),o),c.insertNode(m),c.setStartAfter(m),c.collapse(!0),s.removeAllRanges(),s.addRange(c),!0}function $k(e,n){const o=zk(n);if(Hk(o.src))return!1;const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const s=a.getRangeAt(0);if(!Ye(e,s.commonAncestorContainer))return!1;s.collapsed||s.deleteContents();const c=$c(o.src);if(c){const m=document.createElement("iframe");Vb(m,Ub(c),{title:o.title,css:o.css}),s.insertNode(m),s.setStartAfter(m)}else{const m=document.createElement("video");Uk(m,o),s.insertNode(m),s.setStartAfter(m)}return s.collapse(!0),a.removeAllRanges(),a.addRange(s),!0}const Vk="1em 0",Wk="1px solid #d0d0d0",Gk=new Set(["p","h1","h2","h3","h4","h5","h6"]),Yk=new Set(["td","th","li","blockquote","pre","table","thead","tbody","tr"]);function qk(e){var c;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const o=n.getRangeAt(0);if(!Ye(e,o.commonAncestorContainer))return!1;o.collapsed||o.deleteContents();const a=Xk(),s=Qk(e,o.startContainer);if(s){const m=Jk(s,o);return(c=s.parentNode)==null||c.insertBefore(a,m),cg(a),!0}return o.insertNode(a),Zk(e,a),nP(a),cg(a),!0}function Xk(){const e=document.createElement("hr");return e.style.margin=Vk,e.style.border="0",e.style.borderTop=Wk,e}function Qk(e,n){let o=qs(n);for(;o&&o!==e;){const a=rt(o);if(Gk.has(a)&&o instanceof HTMLElement)return o;if(Yk.has(a))return null;o=o.parentElement}return null}function Jk(e,n){var c;const o=document.createRange();o.setStart(n.startContainer,n.startOffset),o.setEnd(e,e.childNodes.length);const a=o.extractContents(),s=e.cloneNode(!1);return s.appendChild(a),ug(e),ug(s),(c=e.parentNode)==null||c.insertBefore(s,e.nextSibling),s}function Zk(e,n){for(;;){const o=n.parentElement;if(!o||o===e||!eP(o))return;ji(o,n),Mn(o)}}function eP(e){const n=rt(e);return to(e)||n==="a"}function ug(e){tP(e)&&e.appendChild(document.createElement("br"))}function tP(e){var n;return e.childNodes.length===0||e.childNodes.length===1&&((n=e.firstChild)==null?void 0:n.nodeName)==="BR"?!0:(e.textContent??"").trim().length===0&&e.querySelector("img, table, ul, ol, hr")===null}function nP(e){var o;if(e.nextSibling)return;const n=document.createElement("p");n.appendChild(document.createElement("br")),(o=e.parentNode)==null||o.insertBefore(n,e.nextSibling)}function cg(e){const n=e.nextSibling,o=document.createRange();n instanceof HTMLElement||n?(o.setStart(n,0),o.collapse(!0)):(o.setStartAfter(e),o.collapse(!0));const a=window.getSelection();a&&(a.removeAllRanges(),a.addRange(o))}const _o=16;function dg(e){return Math.min(Cl.px.max,Math.max(_o,e))}function rP(e){return e.width>0&&e.height>0?e.width/e.height:1}function oP(e,n){const o=Math.max(_o,_o*n),a=Math.min(Cl.px.max,Cl.px.max*n),s=Math.min(a,Math.max(o,e));return{width:s,height:s/n}}function iP(e,n){const o=Math.max(_o,_o/n),a=Math.min(Cl.px.max,Cl.px.max/n),s=Math.min(a,Math.max(o,e));return{width:s*n,height:s}}function aP(e,n,o){const a=rP(n);return e==="e"?oP(n.width+o.x,a):e==="s"?iP(n.height+o.y,a):{width:dg(n.width+o.x),height:dg(n.height+o.y)}}function lP(e){const n=e.getBoundingClientRect(),o=e.offsetWidth||n.width,a=e.offsetHeight||n.height;return{width:o>0?o:_o,height:a>0?a:_o}}function sP(e,n,o){const a=Sl(Math.max(_o,n),"px"),s=Sl(Math.max(_o,o),"px");return!a||!s?!1:kb(e,{...Sb(e),sizeMode:"lock",width:a,height:s})}function Vc(e){return{colSpan:Math.max(1,e.colSpan||1),rowSpan:Math.max(1,e.rowSpan||1)}}function ba(e,n,o){const a=Math.max(1,Math.floor(n)),s=Math.max(1,Math.floor(o));a<=1?e.removeAttribute("colspan"):e.colSpan=a,s<=1?e.removeAttribute("rowspan"):e.rowSpan=s}function _n(e){const n=e.rows.length,o=Array.from({length:n},()=>[]),a=[];let s=0;for(let c=0;c<n;c+=1){const m=e.rows[c];let g=0;for(const y of Array.from(m.cells)){for(;o[c][g];)g+=1;const w=Vc(y),C={cell:y,originRow:c,originCol:g,rowSpan:w.rowSpan,colSpan:w.colSpan};a.push(C);for(let S=0;S<w.rowSpan;S+=1){const E=c+S;if(E>=n)break;for(let k=0;k<w.colSpan;k+=1)o[E][g+k]=C}g+=w.colSpan,s=Math.max(s,g)}s=Math.max(s,o[c].length)}return{table:e,slots:o,unique:a,rowCount:n,colCount:s}}function Nc(e,n,o){var a;return((a=e.slots[n])==null?void 0:a[o])??null}function Tr(e,n){return e.unique.find(o=>o.cell===n)??null}function Wb(e,n){return e.originRow<n.minRow||e.originCol<n.minCol||e.originRow+e.rowSpan-1>n.maxRow||e.originCol+e.colSpan-1>n.maxCol}function Gb(e){if(e.length===0)return null;let n=1/0,o=-1/0,a=1/0,s=-1/0;for(const c of e)n=Math.min(n,c.originRow),o=Math.max(o,c.originRow+c.rowSpan-1),a=Math.min(a,c.originCol),s=Math.max(s,c.originCol+c.colSpan-1);return{minRow:n,maxRow:o,minCol:a,maxCol:s}}function uP(e,n){const o=new Set,a=[];for(let s=n.minRow;s<=n.maxRow;s+=1)for(let c=n.minCol;c<=n.maxCol;c+=1){const m=Nc(e,s,c);!m||o.has(m.cell)||(o.add(m.cell),a.push(m.cell))}return a}function Yb(e,n){if(n.minRow>n.maxRow||n.minCol>n.maxCol)return null;const o=Nc(e,n.minRow,n.minCol);if(!o||o.originRow!==n.minRow||o.originCol!==n.minCol)return null;const a=new Set,s=[];for(let c=n.minRow;c<=n.maxRow;c+=1)for(let m=n.minCol;m<=n.maxCol;m+=1){const g=Nc(e,c,m);if(!g||Wb(g,n))return null;a.has(g.cell)||(a.add(g.cell),s.push(g.cell))}return{origin:o,cells:s,colSpan:n.maxCol-n.minCol+1,rowSpan:n.maxRow-n.minRow+1}}function cP(e,n,o,a){const s={minRow:n.originRow,maxRow:n.originRow+a-1,minCol:n.originCol,maxCol:n.originCol+o-1};if(s.maxRow>=e.rowCount||s.maxCol>=e.colCount)return!1;for(let c=s.minRow;c<=s.maxRow;c+=1)for(let m=s.minCol;m<=s.maxCol;m+=1){const g=Nc(e,c,m);if(!g)return!1;if(g.cell!==n.cell&&Wb(g,s))return!1}return!0}const mg=10,hl=1,gl=50,dP="1px solid #000",mP="0.25em",fP=new Set(["td","th"]);function qb(e,n){return Number.isInteger(e)&&Number.isInteger(n)&&e>=hl&&n>=hl&&e<=gl&&n<=gl}function vn(e,n){return Of(e,n,o=>o instanceof HTMLTableElement)}function Rc(e,n){return Of(e,n,o=>kP(o))}function pP(e,n){return Of(e,n,o=>o instanceof HTMLTableRowElement)}function Ff(e){return vn(e,zf(e))}function ro(e){return Rc(e,zf(e))}function Xb(e){return pP(e,zf(e))}function hP(e){const n=[];for(const o of Array.from(e.rows))n.push(...Array.from(o.cells));return n}function Bf(e){const n=window.getSelection();if(!n||n.rangeCount===0)return[];const o=n.getRangeAt(0);if(!Ye(e,o.commonAncestorContainer))return[];const a=Rc(e,o.startContainer),s=Rc(e,o.endContainer);if(!a)return[];if(!s||a===s)return[a];const c=vn(e,a);if(!c||vn(e,s)!==c)return[a];const m=_n(c),g=Tr(m,a),y=Tr(m,s);if(!g||!y)return[a];const w=Gb([g,y]);if(!w)return[a];const C=uP(m,w);return C.length>0?C:[a]}function gP(e,n){if(!qb(n.rows,n.cols))return!1;const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const a=o.getRangeAt(0);if(!Ye(e,a.commonAncestorContainer))return!1;const s=document.createElement("table");s.style.borderCollapse="collapse",s.style.width="100%";const c=document.createElement("tbody");for(let g=0;g<n.rows;g+=1){const y=document.createElement("tr");for(let w=0;w<n.cols;w+=1)y.appendChild(PP("td"));c.appendChild(y)}s.appendChild(c),a.collapsed||a.deleteContents(),a.insertNode(s),TP(e,s);const m=s.querySelector("td, th");return m instanceof HTMLTableCellElement&&yn(m),!0}function Wm(e,n){var S,E,k,A;const o=ro(e);if(!o)return!1;const a=vn(e,o);if(!a)return!1;const s=_n(a),c=Tr(s,o);if(!c)return!1;const m=n==="before"?c.originRow:c.originRow+c.rowSpan,g=new Set;for(const P of s.unique)if(P.originRow<m&&P.originRow+P.rowSpan>m){ba(P.cell,P.colSpan,P.rowSpan+1);for(let T=P.originCol;T<P.originCol+P.colSpan;T+=1)g.add(T)}const y=document.createElement("tr"),w=Math.min(m,s.rowCount-1);for(let P=0;P<s.colCount;P+=1){if(g.has(P))continue;const T=((E=(S=s.slots[w])==null?void 0:S[P])==null?void 0:E.cell)??o;y.appendChild(Hf(T))}if(m>=a.rows.length)(k=a.rows[a.rows.length-1].parentNode)==null||k.appendChild(y);else{const P=a.rows[m];(A=P.parentNode)==null||A.insertBefore(y,P)}const C=AP(y,s.colCount,g,c.originCol);return yn(C||o),!0}function fg(e,n){var w,C,S,E;const o=ro(e);if(!o)return!1;const a=vn(e,o);if(!a)return!1;const s=_n(a),c=Tr(s,o);if(!c)return!1;const m=n==="before"?c.originCol:c.originCol+c.colSpan,g=new Set;for(const k of s.unique)if(k.originCol<m&&k.originCol+k.colSpan>m){ba(k.cell,k.colSpan+1,k.rowSpan);for(let A=k.originRow;A<k.originRow+k.rowSpan;A+=1)g.add(A)}let y=null;for(let k=0;k<s.rowCount;k+=1){if(g.has(k))continue;const A=((C=(w=s.slots[k])==null?void 0:w[Math.min(m,Math.max(0,s.colCount-1))])==null?void 0:C.cell)??((E=(S=s.slots[k])==null?void 0:S[Math.max(0,m-1)])==null?void 0:E.cell)??o,P=Hf(A);Uf(a,k,m,P),k===c.originRow&&(y=P)}return y&&yn(y),!0}function yP(e){var E,k;const n=ro(e);if(!n)return!1;const o=vn(e,n);if(!o)return!1;const a=_n(o),s=Tr(a,n);if(!s)return!1;if(a.rowCount<=1)return Gm(e,o);const c=s.originRow,m=c+1,g=[];for(const A of a.unique)A.originRow<=c&&A.originRow+A.rowSpan>c&&(A.originRow<c?ba(A.cell,A.colSpan,A.rowSpan-1):A.originRow===c&&A.rowSpan>1&&g.push(A));g.sort((A,P)=>A.originCol-P.originCol);for(const A of g)ba(A.cell,A.colSpan,A.rowSpan-1),Uf(o,m,A.originCol,A.cell);const y=s.originCol;o.rows[c].remove();const w=o.rows[Math.min(c,o.rows.length-1)],C=_n(o),S=(k=(E=C.slots[Math.min(c,C.rowCount-1)])==null?void 0:E[Math.min(y,Math.max(0,C.colCount-1))])==null?void 0:k.cell;return S?yn(S):w!=null&&w.cells[0]?yn(w.cells[0]):NP(o),!0}function bP(e){var w,C,S;const n=ro(e);if(!n)return!1;const o=vn(e,n);if(!o)return!1;const a=_n(o),s=Tr(a,n);if(!s)return!1;if(a.colCount<=1)return Gm(e,o);const c=s.originCol,m=s.originRow;for(const E of a.unique)c<E.originCol||c>=E.originCol+E.colSpan||(E.colSpan===1?E.cell.remove():ba(E.cell,E.colSpan-1,E.rowSpan));const g=_n(o);if(g.colCount===0||g.unique.length===0)return Gm(e,o);const y=((C=(w=g.slots[Math.min(m,g.rowCount-1)])==null?void 0:w[Math.min(c,g.colCount-1)])==null?void 0:C.cell)??((S=g.unique[0])==null?void 0:S.cell);return y&&yn(y),!0}function vP(e,n){const o=ro(e);if(!o)return!1;const a=vn(e,o);if(!a)return!1;const s=hP(a),c=s.indexOf(o);if(c<0)return!1;if(n)return c===0?!1:(yn(s[c-1]),{changed:!1});if(c<s.length-1)return yn(s[c+1]),{changed:!1};const m=o.parentElement;if(!Wm(e,"below"))return!1;const g=m instanceof HTMLTableRowElement?m.nextElementSibling:null;return g instanceof HTMLTableRowElement&&g.cells[0]&&yn(g.cells[0]),{changed:!0}}function xP(e,n){return!Ye(e,n)||n===e?!1:(yn(n),!0)}function pg(e){return Qb(e)!==null}function hg(e){const n=ro(e);if(!n)return!1;const o=Vc(n);return o.colSpan>1||o.rowSpan>1}function wP(e){const n=Qb(e);if(!n)return!1;const o=vn(e,n.origin.cell);return o?Jb(o,n):!1}function CP(e){const n=ro(e);if(!n)return!1;const o=vn(e,n);return o?Zb(o,n):!1}function SP(e,n,o){const a=ro(e);if(!a)return!1;const s=vn(e,a);if(!s)return!1;const c=_n(s),m=Tr(c,a);if(!m)return!1;const g=Math.min(c.colCount-m.originCol,Math.max(1,Math.floor(n))),y=Math.min(c.rowCount-m.originRow,Math.max(1,Math.floor(o)));if(g===m.colSpan&&y===m.rowSpan||!cP(c,m,g,y))return!1;if((m.colSpan>1||m.rowSpan>1)&&Zb(s,a),g===1&&y===1)return yn(a),!0;const w=_n(s),C=Yb(w,{minRow:m.originRow,maxRow:m.originRow+y-1,minCol:m.originCol,maxCol:m.originCol+g-1});return C?Jb(s,C):!0}function Of(e,n,o){let a=n;for(;a&&a!==e;){if(a instanceof HTMLElement&&o(a))return a;a=a.parentNode}return null}function kP(e){return fP.has(e.tagName.toLowerCase())}function zf(e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const o=n.getRangeAt(0);return Ye(e,o.commonAncestorContainer)?o.startContainer:null}function Qb(e){const n=Bf(e);if(n.length<2)return null;const o=vn(e,n[0]);if(!o)return null;const a=_n(o),s=[];for(const g of n){const y=Tr(a,g);if(!y)return null;s.push(y)}const c=Gb(s);if(!c)return null;const m=Yb(a,c);return!m||m.cells.length<2?null:m}function Jb(e,n){const o=n.origin.cell,a=_n(e),s=n.cells.map(c=>Tr(a,c)).filter(c=>c!==null).sort((c,m)=>c.originRow-m.originRow||c.originCol-m.originCol);for(const c of s)c.cell!==o&&DP(o,c.cell);ba(o,n.colSpan,n.rowSpan);for(const c of s)c.cell!==o&&c.cell.remove();return yn(o),!0}function Zb(e,n){const o=_n(e),a=Tr(o,n);if(!a||a.colSpan===1&&a.rowSpan===1)return!1;ba(n,1,1);for(let s=a.originRow;s<a.originRow+a.rowSpan;s+=1)for(let c=a.originCol;c<a.originCol+a.colSpan;c+=1)s===a.originRow&&c===a.originCol||Uf(e,s,c,Hf(n));return yn(n),!0}function PP(e){const n=document.createElement(e);return n.style.border=dP,n.style.padding=mP,n.appendChild(document.createElement("br")),n}function Hf(e){const n=e.cloneNode(!1);for(n.removeAttribute("colspan"),n.removeAttribute("rowspan");n.firstChild;)n.removeChild(n.firstChild);return n.appendChild(document.createElement("br")),n}function EP(e,n,o){n>=e.cells.length?e.appendChild(o):e.insertBefore(o,e.cells[n])}function Uf(e,n,o,a){const s=e.rows[n];if(!s)return;const c=_n(e);let m=0;for(const g of Array.from(s.cells)){if(g===a)continue;const y=Tr(c,g);if(!y||y.originCol>=o)break;m+=1}EP(s,m,a)}function AP(e,n,o,a){let s=0;for(let c=0;c<n;c+=1)if(!o.has(c)){if(c>=a)return e.cells[s]??null;s+=1}return e.cells[e.cells.length-1]??null}function gg(e){var n;return e.childNodes.length===0||e.childNodes.length===1&&((n=e.firstChild)==null?void 0:n.nodeName)==="BR"?!0:(e.textContent??"").trim().length===0&&e.querySelector("img, table, ul, ol, hr")===null}function DP(e,n){if(!(e===n||gg(n)))for(gg(e)?e.innerHTML="":e.appendChild(document.createTextNode(" "));n.firstChild;)e.appendChild(n.firstChild)}function TP(e,n){var s;const o=n.parentElement;if(!o||o===e)return;const a=o.tagName.toLowerCase();a==="td"||a==="th"||(a==="p"||/^h[1-6]$/.test(a))&&((s=o.parentNode)==null||s.insertBefore(n,o.nextSibling),jP(o)&&o.remove())}function jP(e){var n;return e.childNodes.length===0||e.childNodes.length===1&&((n=e.firstChild)==null?void 0:n.nodeName)==="BR"?!0:(e.textContent??"").trim().length===0&&e.querySelector("img, table, ul, ol")===null}function Gm(e,n){if(!n.parentNode||!Ye(e,n))return!1;const a=document.createRange();a.setStartBefore(n),a.collapse(!0),n.remove();const s=window.getSelection();return s&&(s.removeAllRanges(),s.addRange(a)),!0}function yn(e){const n=document.createRange();n.selectNodeContents(e),n.collapse(!0);const o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(n))}function NP(e){const n=document.createRange();n.setStartAfter(e),n.collapse(!0);const o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(n))}function RP(e={}){return{border:{...Ef},borderCollapse:"collapse",borderSpacing:null,borderRadius:null,boxShadow:null,width:{value:100,unit:"%"},...e}}function LP(e){const n=El(e);return{border:n.border,borderCollapse:FP(e),borderSpacing:ev(e),borderRadius:n.borderRadius,boxShadow:n.boxShadow,width:en(e.style.width)}}function MP(e,n){let o=Al(e,{margin:{top:null,right:null,bottom:null,left:null},marginMixed:!0,padding:{top:null,right:null,bottom:null,left:null},paddingMixed:!0,lineHeight:null,lineHeightMixed:!0,border:n.border,borderMixed:!1,borderRadius:n.borderRadius,radiusMixed:!1,boxShadow:n.boxShadow,shadowMixed:!1,backgroundColor:null,backgroundMixed:!0,opacity:null,opacityMixed:!0});return BP(e,n.borderCollapse)&&(o=!0),OP(e,n.borderCollapse,n.borderSpacing)&&(o=!0),zP(e,n.width)&&(o=!0),o&&Ar(e),o}function _P(e){const n=Ff(e);return n?LP(n):null}function IP(e,n){const o=Ff(e);return o?MP(o,n):!1}function FP(e){return e.style.borderCollapse.trim().toLowerCase()==="separate"?"separate":"collapse"}function BP(e,n){return e.style.borderCollapse.trim().toLowerCase()===n?!1:(e.style.borderCollapse=n,!0)}function ev(e){const n=e.style.borderSpacing.trim();return n?en(n.split(/\s+/)[0]??""):null}function OP(e,n,o){if(n!=="separate")return e.style.borderSpacing?(e.style.removeProperty("border-spacing"),!0):!1;const a=o?Ni(o):null,s=ev(e);return er(s,a)?!1:(a?e.style.borderSpacing=Zt(a):e.style.removeProperty("border-spacing"),!0)}function zP(e,n){const o=n?Ni(n):null,a=en(e.style.width);return er(a,o)?!1:(o?e.style.width=Zt(o):e.style.removeProperty("width"),!0)}const Wc=["top","middle","bottom","baseline"],HP=new Set(Wc);function UP(e={}){return{backgroundColor:null,color:null,padding:{...Dr},verticalAlign:null,width:null,colSpan:1,rowSpan:1,...e}}function KP(e){const n=El(e);return{backgroundColor:n.backgroundColor,color:tv(e),padding:n.padding,verticalAlign:nv(e),width:en(e.style.width),...Vc(e)}}function $P(e,n){let o=Al(e,{margin:{...Dr},marginMixed:!0,padding:n.padding,paddingMixed:!1,lineHeight:null,lineHeightMixed:!0,border:{style:"none",width:null,color:null},borderMixed:!0,borderRadius:null,radiusMixed:!0,boxShadow:null,shadowMixed:!0,backgroundColor:n.backgroundColor,backgroundMixed:!1,opacity:null,opacityMixed:!0});return GP(e,n.color)&&(o=!0),YP(e,n.verticalAlign)&&(o=!0),qP(e,n.width)&&(o=!0),o&&Ar(e),o}function VP(e){const n=ro(e);return n?KP(n):null}function WP(e,n){const o=Bf(e);if(o.length===0)return!1;let a=!1;for(const c of o)$P(c,n)&&(a=!0);const s=ro(e);if(s){const c=Vc(s);(c.colSpan!==n.colSpan||c.rowSpan!==n.rowSpan)&&SP(e,n.colSpan,n.rowSpan)&&(a=!0)}return a}function tv(e){const n=e.style.color;return n?xt(n):null}function GP(e,n){const o=n?xt(n):null;return tv(e)===o?!1:(o?e.style.color=o:e.style.removeProperty("color"),!0)}function nv(e){const n=e.style.verticalAlign.trim().toLowerCase();return HP.has(n)?n:null}function YP(e,n){return nv(e)===n?!1:(n?e.style.verticalAlign=n:e.style.removeProperty("vertical-align"),!0)}function qP(e,n){const o=n?Ni(n):null,a=en(e.style.width);return er(a,o)?!1:(o?e.style.width=Zt(o):e.style.removeProperty("width"),!0)}const XP=new Set(Wc);function QP(e={}){return{backgroundColor:null,color:null,padding:{...Dr},height:null,verticalAlign:null,...e}}function JP(e){const n=e.cells[0],o=n?El(n).padding:{...Dr};return{backgroundColor:rv(e),color:ov(e),padding:o,height:en(e.style.height),verticalAlign:iv(e)}}function ZP(e,n){let o=!1;nE(e,n.backgroundColor)&&(o=!0),rE(e,n.color)&&(o=!0),iE(e,n.height)&&(o=!0),oE(e,n.verticalAlign)&&(o=!0);for(const a of Array.from(e.cells))Al(a,{margin:{...Dr},marginMixed:!0,padding:n.padding,paddingMixed:!1,lineHeight:null,lineHeightMixed:!0,border:{style:"none",width:null,color:null},borderMixed:!0,borderRadius:null,radiusMixed:!0,boxShadow:null,shadowMixed:!0,backgroundColor:null,backgroundMixed:!0,opacity:null,opacityMixed:!0})&&(o=!0);return o&&Ar(e),o}function eE(e){const n=Xb(e);return n?JP(n):null}function tE(e,n){const o=Xb(e);return o?ZP(o,n):!1}function rv(e){const n=e.style.backgroundColor;return n?xt(n):null}function nE(e,n){const o=n?xt(n):null;return rv(e)===o?!1:(o?e.style.backgroundColor=o:e.style.removeProperty("background-color"),!0)}function ov(e){const n=e.style.color;return n?xt(n):null}function rE(e,n){const o=n?xt(n):null;return ov(e)===o?!1:(o?e.style.color=o:e.style.removeProperty("color"),!0)}function iv(e){const n=e.style.verticalAlign.trim().toLowerCase();return XP.has(n)?n:null}function oE(e,n){return iv(e)===n?!1:(n?e.style.verticalAlign=n:e.style.removeProperty("vertical-align"),!0)}function iE(e,n){const o=n?Ni(n):null,a=en(e.style.height);return er(a,o)?!1:(o?e.style.height=Zt(o):e.style.removeProperty("height"),!0)}const aE=1e3;function lE(e,n){try{Promise.resolve(e(n)).catch(()=>{})}catch{}}function sE({onAutoSave:e,getHtml:n}){const o=f.useRef(e);o.current=e;const a=f.useRef(n);a.current=n;const s=f.useRef(null),c=e!=null;f.useEffect(()=>{if(!c){s.current=null;return}s.current=a.current();const m=window.setInterval(()=>{const g=o.current;if(!g)return;const y=a.current();y!==s.current&&(s.current=y,queueMicrotask(()=>lE(g,y)))},aE);return()=>{window.clearInterval(m)}},[c])}function rc({value:e,defaultValue:n,onChange:o}){const[a,s]=f.useState(n),c=e!==void 0,m=c?e:a,g=f.useCallback(y=>{c||s(y),o==null||o(y)},[c,o]);return[m,g]}const yg=8,bg=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#9900ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#d9d2e9","#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#8e7cc3","#660000","#990000","#b45f06","#bf9000","#38761d","#134f5c","#1155cc","#351c75"],uE=8;let Ym=[];const qm=new Set;function vg(){return Ym}function cE(e){const n=xt(e);n&&(Ym=[n,...Ym.filter(o=>o!==n)].slice(0,uE),qm.forEach(o=>o()))}function dE(e){return qm.add(e),()=>{qm.delete(e)}}function oc(e){const n=xt(e);return n?{r:Number.parseInt(n.slice(1,3),16),g:Number.parseInt(n.slice(3,5),16),b:Number.parseInt(n.slice(5,7),16)}:null}function ma(e,n,o){const a=s=>Math.max(0,Math.min(255,Math.round(s))).toString(16).padStart(2,"0");return`#${a(e)}${a(n)}${a(o)}`}function fm({r:e,g:n,b:o}){const a=e/255,s=n/255,c=o/255,m=Math.max(a,s,c),g=Math.min(a,s,c),y=m-g;let w=0;return y!==0&&(m===a?w=(s-c)/y%6:m===s?w=(c-a)/y+2:w=(a-s)/y+4,w*=60,w<0&&(w+=360)),{h:w,s:m===0?0:y/m,v:m}}function pm({h:e,s:n,v:o}){const a=(e%360+360)%360,s=o*n,c=s*(1-Math.abs(a/60%2-1)),m=o-s;let g=0,y=0,w=0;return a<60?(g=s,y=c):a<120?(g=c,y=s):a<180?(y=s,w=c):a<240?(y=c,w=s):a<300?(g=c,w=s):(g=s,w=c),{r:Math.round((g+m)*255),g:Math.round((y+m)*255),b:Math.round((w+m)*255)}}function av(){return typeof window<"u"&&"EyeDropper"in window}async function mE(){if(!av())return null;const e=window.EyeDropper;try{const n=await new e().open();return xt(n.sRGBHex)}catch{return null}}const fE="_picker_ag1yo_1",pE="_none_ag1yo_12",hE="_customToggle_ag1yo_13",gE="_eyedrop_ag1yo_14",yE="_swatch_ag1yo_48",bE="_field_ag1yo_49",vE="_grid_ag1yo_54",xE="_recents_ag1yo_55",wE="_sectionLabel_ag1yo_84",CE="_custom_ag1yo_13",SE="_sv_ag1yo_95",kE="_svThumb_ag1yo_105",PE="_hue_ag1yo_116",EE="_rgbRow_ag1yo_155",AE="_hexRow_ag1yo_156",zt={picker:fE,none:pE,customToggle:hE,eyedrop:gE,swatch:yE,field:bE,grid:vE,recents:xE,sectionLabel:wE,custom:CE,sv:SE,svThumb:kE,hue:PE,rgbRow:EE,hexRow:AE};function DE(e){if(!/^\d+$/.test(e.trim()))return null;const n=Number(e);return Number.isFinite(n)?Math.max(0,Math.min(255,n)):null}function Kf({value:e,mixed:n=!1,noneLabel:o,ariaLabel:a,disabled:s,menu:c=!1,fallbackCustom:m="#000000",onChange:g,onCommit:y}){const w=Se(),C=f.useId(),S=c?"menuitemradio":"option",E=n?null:e,k=oc(E??m)??{r:0,g:0,b:0},[A,P]=f.useState(!1),[T,j]=f.useState(()=>fm(k)),[F,L]=f.useState(()=>({r:String(k.r),g:String(k.g),b:String(k.b)})),[H,z]=f.useState(()=>ma(k.r,k.g,k.b)),[q,G]=f.useState(()=>[...vg()]),Q=f.useRef(null),$=f.useRef(ma(k.r,k.g,k.b));f.useEffect(()=>dE(()=>G([...vg()])),[]),f.useEffect(()=>{const N=oc(E??m);if(!N)return;const re=fm(N);j(re),L({r:String(N.r),g:String(N.g),b:String(N.b)}),z(ma(N.r,N.g,N.b))},[E,m]);const V=(N,re,fe)=>{N&&($.current=N),fe&&N&&cE(N),g(N),re&&(y==null||y(N))},K=(N,re,fe)=>{const ae=ma(N.r,N.g,N.b);j(fm(N)),L({r:String(N.r),g:String(N.g),b:String(N.b)}),z(ae),V(ae,re,fe)},X=(N,re,fe)=>{const ae=pm(N),Ce=ma(ae.r,ae.g,ae.b);j(N),L({r:String(ae.r),g:String(ae.g),b:String(ae.b)}),z(Ce),V(Ce,re,fe)},de=N=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(N.key))return;const fe=[...N.currentTarget.querySelectorAll("button")],ae=fe.findIndex(De=>De===document.activeElement);if(ae<0)return;N.preventDefault();const Ce=N.key==="ArrowLeft"?-1:N.key==="ArrowRight"?1:N.key==="ArrowUp"?-yg:yg,Re=fe[Math.max(0,Math.min(fe.length-1,ae+Ce))];Re==null||Re.focus()},ce=(N,re)=>{const fe=Q.current;if(!fe||s)return;const ae=fe.getBoundingClientRect(),Ce=Math.max(0,Math.min(1,(N.clientX-ae.left)/ae.width)),Re=Math.max(0,Math.min(1,1-(N.clientY-ae.top)/ae.height));X({h:T.h,s:Ce,v:Re},re,re)},Pe=N=>{s||(N.currentTarget.setPointerCapture(N.pointerId),ce(N,!1))},ke=pm({h:T.h,s:1,v:1}),je=ma(ke.r,ke.g,ke.b),Y=pm(T),pe=ma(Y.r,Y.g,Y.b),J=new Set(bg),M=q.filter(N=>!J.has(N));return l.jsxs("div",{className:zt.picker,role:c?void 0:"listbox","aria-label":a,"data-color-picker":"",children:[l.jsx("button",{type:"button",className:zt.none,role:S,"aria-checked":c?E===null&&!n:void 0,"aria-selected":c?void 0:E===null&&!n,disabled:s,onClick:()=>V(null,!0,!1),children:o}),l.jsx("div",{className:zt.grid,role:c?"group":"none",onKeyDown:de,children:bg.map(N=>{const re=E===N;return l.jsx("button",{type:"button",className:zt.swatch,role:S,"aria-label":N,"aria-checked":c?re:void 0,"aria-selected":c?void 0:re,disabled:s,style:{backgroundColor:N},onMouseDown:fe=>fe.preventDefault(),onClick:()=>V(N,!0,!1)},N)})}),M.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:zt.sectionLabel,children:w("colorRecent")}),l.jsx("div",{className:zt.recents,role:c?"group":"none","aria-label":w("colorRecent"),children:M.map(N=>l.jsx("button",{type:"button",className:zt.swatch,role:S,"aria-label":N,"aria-checked":c?E===N:void 0,"aria-selected":c?void 0:E===N,disabled:s,style:{backgroundColor:N},onMouseDown:re=>re.preventDefault(),onClick:()=>V(N,!0,!1)},N))})]}):null,l.jsx("button",{type:"button",className:zt.customToggle,disabled:s,"aria-expanded":A,onClick:()=>P(N=>!N),children:w("colorCustom")}),A?l.jsxs("div",{className:zt.custom,children:[l.jsx("div",{ref:Q,className:zt.sv,style:{background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${je})`},onPointerDown:Pe,onPointerMove:N=>{N.currentTarget.hasPointerCapture(N.pointerId)&&ce(N,!1)},onPointerUp:N=>{ce(N,!0)},children:l.jsx("span",{className:zt.svThumb,style:{left:`${T.s*100}%`,top:`${(1-T.v)*100}%`}})}),l.jsx("input",{className:zt.hue,type:"range",min:0,max:360,value:Math.round(T.h),disabled:s,"aria-label":w("colorCustom"),onChange:N=>X({...T,h:Number(N.target.value)},!1,!1),onPointerUp:()=>V($.current,!0,!0)}),l.jsx("div",{className:zt.rgbRow,children:["r","g","b"].map(N=>l.jsxs("div",{className:zt.field,children:[l.jsx("label",{htmlFor:`${C}-${N}`,children:w(N==="r"?"colorRgbR":N==="g"?"colorRgbG":"colorRgbB")}),l.jsx("input",{id:`${C}-${N}`,inputMode:"numeric",value:F[N],disabled:s,onChange:re=>{L(fe=>({...fe,[N]:re.target.value}))},onBlur:()=>{const re=DE(F[N]);if(re===null){L({r:String(Y.r),g:String(Y.g),b:String(Y.b)});return}K({...Y,[N]:re},!0,!0)},onKeyDown:re=>{re.key==="Enter"&&re.currentTarget.blur()}})]},N))}),l.jsx("div",{className:zt.hexRow,children:l.jsxs("div",{className:zt.field,children:[l.jsx("label",{htmlFor:`${C}-hex`,children:w("colorHex")}),l.jsx("input",{id:`${C}-hex`,value:H,disabled:s,onChange:N=>z(N.target.value),onBlur:()=>{const N=xt(H);if(!N){z(pe);return}const re=oc(N);re&&K(re,!0,!0)},onKeyDown:N=>{N.key==="Enter"&&N.currentTarget.blur()}})]})}),av()?l.jsx("button",{type:"button",className:zt.eyedrop,disabled:s,onClick:()=>{mE().then(N=>{if(!N)return;const re=oc(N);re&&K(re,!0,!0)})},children:w("colorPickFromScreen")}):null]}):null]})}const TE="_wrap_xzhkl_1",jE="_button_xzhkl_8",NE="_icon_xzhkl_18",RE="_bar_xzhkl_24",LE="_barEmpty_xzhkl_33",ME="_popover_xzhkl_43",fa={wrap:TE,button:jE,icon:NE,bar:RE,barEmpty:LE,popover:ME},_E="_field_1knrr_1",IE="_label_1knrr_8",FE="_button_1knrr_12",BE="_swatch_1knrr_37",OE="_swatchEmpty_1knrr_44",Rs={field:_E,label:IE,button:FE,swatch:BE,swatchEmpty:OE},ic=4;function rr({label:e,noneLabel:n,value:o,mixed:a=!1,disabled:s,fallbackCustom:c,onChange:m}){const g=f.useId(),y=f.useRef(null),w=f.useRef(null),C=f.useRef(null),[S,E]=f.useState(!1),[k,A]=f.useState({top:0,left:0}),P=f.useCallback(()=>{const F=w.current,L=C.current;if(!F)return;const H=F.getBoundingClientRect(),z=(L==null?void 0:L.offsetHeight)??0,q=(L==null?void 0:L.offsetWidth)??240;let G=H.bottom;G+z>window.innerHeight-ic&&(G=Math.max(ic,H.top-z));const Q=Math.min(Math.max(H.left,ic),window.innerWidth-q-ic);A({top:G,left:Q})},[]);f.useLayoutEffect(()=>{if(!S)return;P();const F=()=>P();return window.addEventListener("scroll",F,!0),window.addEventListener("resize",F),()=>{window.removeEventListener("scroll",F,!0),window.removeEventListener("resize",F)}},[S,P]),f.useEffect(()=>{if(!S)return;const F=H=>{var q,G;const z=H.target;(q=y.current)!=null&&q.contains(z)||(G=C.current)!=null&&G.contains(z)||E(!1)},L=H=>{var z;H.key==="Escape"&&(H.preventDefault(),H.stopPropagation(),E(!1),(z=w.current)==null||z.focus())};return document.addEventListener("pointerdown",F),document.addEventListener("keydown",L,!0),()=>{document.removeEventListener("pointerdown",F),document.removeEventListener("keydown",L,!0)}},[S]);const T=`${Rs.swatch}${!o||a?` ${Rs.swatchEmpty}`:""}`,j=o&&!a?{backgroundColor:o}:void 0;return l.jsxs("div",{className:Rs.field,ref:y,children:[l.jsx("span",{className:Rs.label,children:e}),l.jsx("button",{ref:w,type:"button",className:Rs.button,"aria-label":e,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?g:void 0,disabled:s,onClick:()=>E(F=>!F),children:l.jsx("span",{className:T,style:j})}),S?l.jsx(Xe,{children:l.jsx("div",{ref:C,id:g,className:fa.popover,style:{top:k.top,left:k.left,zIndex:1400},children:l.jsx(Kf,{value:o,mixed:a,noneLabel:n,ariaLabel:e,disabled:s,fallbackCustom:c,onChange:m,onCommit:()=>E(!1)})})}):null]})}const hm=[{id:"general",labelKey:"fontDialogTabGeneral",implemented:!0}],zE="_toolbar_2uk4l_1",HE="_menuBar_2uk4l_35",UE="_menuBarDesktop_2uk4l_43",KE="_brandMark_2uk4l_49",$E="_brandMarkIcon_2uk4l_56",VE="_menuBarCompact_2uk4l_68",WE="_menuWrap_2uk4l_91",GE="_menuButton_2uk4l_97",YE="_iconButton_2uk4l_98",qE="_menuItem_2uk4l_99",XE="_hamburgerButton_2uk4l_142",QE="_iconNav_2uk4l_149",JE="_iconNavMain_2uk4l_160",ZE="_iconNavEnd_2uk4l_169",eA="_iconGroup_2uk4l_185",tA="_tooltipTrigger_2uk4l_276",nA="_menu_2uk4l_35",rA="_submenuWrap_2uk4l_304",oA="_submenu_2uk4l_304",iA="_submenuTrigger_2uk4l_314",aA="_menuOverlay_2uk4l_329",lA="_menuOverlayHeader_2uk4l_341",sA="_menuOverlayTitle_2uk4l_351",uA="_menuOverlayBody_2uk4l_357",cA="_menuSeparator_2uk4l_408",dA="_icon_2uk4l_98",mA="_tooltip_2uk4l_276",fA="_tooltipElevated_2uk4l_493",Ne={toolbar:zE,menuBar:HE,menuBarDesktop:UE,brandMark:KE,brandMarkIcon:$E,menuBarCompact:VE,menuWrap:WE,menuButton:GE,iconButton:YE,menuItem:qE,hamburgerButton:XE,iconNav:QE,iconNavMain:JE,iconNavEnd:ZE,iconGroup:eA,tooltipTrigger:tA,menu:nA,submenuWrap:rA,submenu:oA,submenuTrigger:iA,menuOverlay:aA,menuOverlayHeader:lA,menuOverlayTitle:sA,menuOverlayBody:uA,menuSeparator:cA,icon:dA,tooltip:mA,tooltipElevated:fA},pA=400,xg=6,gm=4;function Ai({label:e,children:n,className:o,elevated:a}){const s=f.useRef(null),c=f.useRef(null),m=f.useRef(null),g=f.useRef(!1),y=f.useRef(!1),[w,C]=f.useState(!1),[S,E]=f.useState({top:0,left:0}),k=f.useCallback(()=>{m.current!==null&&(clearTimeout(m.current),m.current=null)},[]),A=f.useCallback(j=>{if(!(g.current||y.current)){k(),C(!1);return}if(j||y.current){k(),C(!0);return}k(),m.current=setTimeout(()=>{m.current=null,C(!0)},pA)},[k]),P=f.useCallback(()=>{const j=s.current,F=c.current;if(!j||!F)return;const L=j.getBoundingClientRect(),H=F.offsetWidth,z=F.offsetHeight;let q=L.bottom+xg;q+z>window.innerHeight-gm&&(q=L.top-xg-z);let G=L.left+L.width/2-H/2;G=Math.min(Math.max(G,gm),window.innerWidth-H-gm),E({top:q,left:G})},[]);f.useEffect(()=>()=>k(),[k]),f.useEffect(()=>{const j=s.current;if(!j)return;const F=()=>{y.current=!0,A(!0)},L=()=>{y.current=!1,A(!1)};return j.addEventListener("focusin",F),j.addEventListener("focusout",L),()=>{j.removeEventListener("focusin",F),j.removeEventListener("focusout",L)}},[A]),f.useLayoutEffect(()=>{if(!w)return;P();const j=()=>P();return window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[w,e,P]);const T=o?`${Ne.tooltipTrigger} ${o}`:Ne.tooltipTrigger;return l.jsxs(l.Fragment,{children:[l.jsx("span",{ref:s,className:T,"data-tooltip-trigger":"",onMouseEnter:()=>{g.current=!0,A(!1)},onMouseLeave:()=>{g.current=!1,A(!1)},children:n}),w?l.jsx(Xe,{children:l.jsx("span",{ref:c,className:a?`${Ne.tooltip} ${Ne.tooltipElevated}`:Ne.tooltip,"data-toolbar-tooltip":"",style:{top:S.top,left:S.left},"aria-hidden":"true",children:e})}):null]})}const hA="_wrap_1097y_1",gA="_wrapToolbar_1097y_7",yA="_field_1097y_12",bA="_trigger_1097y_20",vA="_chevron_1097y_50",xA="_list_1097y_73",wA="_listInline_1097y_88",CA="_option_1097y_96",SA="_separator_1097y_125",Pr={wrap:hA,wrapToolbar:gA,field:yA,trigger:bA,chevron:vA,list:xA,listInline:wA,option:CA,separator:SA};function kA({value:e,mixed:n=!1,fonts:o,disabled:a,listId:s,listRef:c,inline:m,style:g,onSelect:y}){const w=Se(),C=!n&&e===null;return l.jsxs("ul",{ref:c,id:s,className:m?`${Pr.list} ${Pr.listInline}`:Pr.list,role:"listbox","aria-label":w("commandFontFamilyAria"),style:g,children:[l.jsx("li",{role:"presentation",children:l.jsx("button",{type:"button",className:Pr.option,role:"option","aria-checked":C,disabled:a,onMouseDown:S=>S.preventDefault(),onClick:()=>y(null),children:w("fontFamilyDefault")})}),l.jsx("li",{className:Pr.separator,role:"separator"}),o.map(S=>{const E=!n&&Ys(e,S.family);return l.jsx("li",{role:"presentation",children:l.jsx("button",{type:"button",className:Pr.option,role:"option","aria-checked":E,disabled:a,style:{fontFamily:S.family},onMouseDown:k=>k.preventDefault(),onClick:()=>y(S.family),children:S.name})},S.family)})]})}function PA(e,n,o,a){var s;return n?"":e===null?a:((s=Hw(e,o))==null?void 0:s.name)??e}const ac=4;function lv({family:e,mixed:n=!1,fonts:o,disabled:a,tooltip:s,toolbar:c=!1,triggerId:m,onChange:g}){const y=Se(),w=f.useId(),C=f.useRef(null),S=f.useRef(null),E=f.useRef(null),[k,A]=f.useState(!1),[P,T]=f.useState({top:0,left:0,width:0}),j=PA(e,n,o,y("fontFamilyDefault")),F=f.useCallback(()=>{const H=S.current,z=E.current;if(!H)return;const q=H.getBoundingClientRect(),G=(z==null?void 0:z.offsetHeight)??0,Q=Math.max(q.width,(z==null?void 0:z.offsetWidth)??0);let $=q.bottom;$+G>window.innerHeight-ac&&($=Math.max(ac,q.top-G));const V=Math.min(Math.max(q.left,ac),window.innerWidth-Q-ac);T({top:$,left:V,width:Q})},[]);f.useLayoutEffect(()=>{if(!k)return;F();const H=()=>F();return window.addEventListener("scroll",H,!0),window.addEventListener("resize",H),()=>{window.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}},[k,F,o.length]),f.useEffect(()=>{if(!k)return;const H=q=>{var Q,$;const G=q.target;(Q=C.current)!=null&&Q.contains(G)||($=E.current)!=null&&$.contains(G)||A(!1)},z=q=>{q.key==="Escape"&&(q.preventDefault(),q.stopPropagation(),A(!1))};return document.addEventListener("pointerdown",H),document.addEventListener("keydown",z,!0),()=>{document.removeEventListener("pointerdown",H),document.removeEventListener("keydown",z,!0)}},[k]);const L=l.jsxs("div",{className:`${Pr.wrap}${c?` ${Pr.wrapToolbar}`:""}`,ref:C,children:[l.jsxs("div",{className:Pr.field,ref:S,children:[l.jsx("button",{type:"button",id:m,className:Pr.trigger,disabled:a,"aria-label":c?y("commandFontFamilyAria"):void 0,"aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?w:void 0,style:e&&!n?{fontFamily:e}:void 0,onMouseDown:H=>H.preventDefault(),onClick:()=>A(H=>!H),children:j}),l.jsx("span",{className:Pr.chevron,"aria-hidden":"true"})]}),k?l.jsx(Xe,{children:l.jsx(kA,{listRef:E,listId:w,value:n?null:e,mixed:n,fonts:o,disabled:a,style:{top:P.top,left:P.left,minWidth:P.width},onSelect:H=>{g(H),A(!1)}})}):null]});return s?l.jsx(Ai,{label:s,children:L}):L}function EA({commands:e,queries:n,disabled:o}){const a=Se(),s=!!(o||!n.isVisualMode());return l.jsx(lv,{family:n.isFontFamilyMixed()?null:n.getFontFamily(),mixed:n.isFontFamilyMixed(),fonts:n.getFontFaces(),disabled:s,tooltip:a("commandFontFamily"),toolbar:!0,onChange:c=>{e.setFontFamily(c)}})}const AA="_wrap_192bz_1",DA="_wrapToolbar_192bz_9",TA="_field_192bz_14",jA="_input_192bz_22",NA="_toggle_192bz_41",RA="_chevron_192bz_42",LA="_unit_192bz_80",MA="_list_192bz_110",_A="_option_192bz_125",Et={wrap:AA,wrapToolbar:DA,field:TA,input:jA,toggle:NA,chevron:RA,unit:LA,list:MA,option:_A},lc=4,IA={pt:"fontSizeUnitPt",px:"fontSizeUnitPx",em:"fontSizeUnitEm",rem:"fontSizeUnitRem","%":"fontSizeUnitPercent"};function sv({size:e,unit:n,onSizeChange:o,onUnitChange:a,disabled:s,tooltip:c,sizeInputId:m,toolbar:g=!1}){const y=Se(),w=f.useId(),C=f.useRef(null),S=f.useRef(null),E=f.useRef(null),[k,A]=f.useState(()=>e===null?"":Ie(e)),[P,T]=f.useState(!1),[j,F]=f.useState(!1),[L,H]=f.useState({top:0,left:0,width:0});f.useEffect(()=>{P||A(e===null?"":Ie(e))},[e,P]);const z=f.useCallback(()=>{const V=S.current,K=E.current;if(!V)return;const X=V.getBoundingClientRect(),de=(K==null?void 0:K.offsetHeight)??0;let ce=X.bottom;ce+de>window.innerHeight-lc&&(ce=Math.max(lc,X.top-de));const Pe=Math.min(Math.max(X.left,lc),window.innerWidth-Math.max(X.width,72)-lc);H({top:ce,left:Pe,width:X.width})},[]);f.useLayoutEffect(()=>{if(!j)return;z();const V=()=>z();return window.addEventListener("scroll",V,!0),window.addEventListener("resize",V),()=>{window.removeEventListener("scroll",V,!0),window.removeEventListener("resize",V)}},[j,z]),f.useEffect(()=>{if(!j)return;const V=X=>{var ce,Pe;const de=X.target;(ce=C.current)!=null&&ce.contains(de)||(Pe=E.current)!=null&&Pe.contains(de)||F(!1)},K=X=>{X.key==="Escape"&&(X.preventDefault(),X.stopPropagation(),F(!1))};return document.addEventListener("pointerdown",V),document.addEventListener("keydown",K,!0),()=>{document.removeEventListener("pointerdown",V),document.removeEventListener("keydown",K,!0)}},[j]);const q=V=>{const K=l1(V,n);if(!K){A(e===null?"":Ie(e));return}o(K.value,K.unit),A(Ie(K.value))},G=r1[n],Q=j?l.jsx(Xe,{children:l.jsx("ul",{ref:E,className:Et.list,role:"listbox",id:w,style:{top:L.top,left:L.left,minWidth:L.width},children:G.map(V=>l.jsx("li",{role:"presentation",children:l.jsx("button",{type:"button",className:Et.option,role:"option","aria-selected":e===V,onMouseDown:K=>K.preventDefault(),onClick:()=>{o(V,n),A(Ie(V)),F(!1)},children:Ie(V)})},V))})}):null,$=l.jsxs("div",{className:`${Et.wrap}${g?` ${Et.wrapToolbar}`:""}`,ref:C,children:[l.jsxs("div",{className:Et.field,ref:S,children:[l.jsx("input",{id:m,className:Et.input,value:k,disabled:s,"aria-label":y("commandFontSizeAria"),"aria-autocomplete":"list","aria-expanded":j,"aria-controls":w,role:"combobox",inputMode:"decimal",onFocus:()=>T(!0),onBlur:()=>{T(!1),q(k)},onChange:V=>A(V.target.value),onKeyDown:V=>{V.key==="Enter"&&(V.preventDefault(),q(k),F(!1),V.currentTarget.blur()),V.key==="ArrowDown"&&(V.preventDefault(),F(!0))}}),l.jsx("button",{type:"button",className:Et.toggle,tabIndex:-1,disabled:s,"aria-label":y("commandFontSizeAria"),"aria-expanded":j,"aria-controls":w,onMouseDown:V=>V.preventDefault(),onClick:()=>F(V=>!V)})]}),l.jsxs("div",{className:Et.field,children:[l.jsx("select",{className:Et.unit,value:n,disabled:s,"aria-label":y("commandFontSizeUnitAria"),onChange:V=>{a(V.target.value)},children:pf.map(V=>l.jsx("option",{value:V,children:y(IA[V])},V))}),l.jsx("span",{className:Et.chevron,"aria-hidden":"true"})]}),Q]});return c?l.jsx(Ai,{label:c,children:$}):$}const FA="_backdrop_1bzww_1",BA="_dialog_1bzww_12",OA="_dialogWide_1bzww_28",zA="_header_1bzww_32",HA="_tabs_1bzww_39",UA="_tab_1bzww_39",KA="_body_1bzww_71",$A="_field_1bzww_79",VA="_label_1bzww_85",WA="_sizeRow_1bzww_89",GA="_fileRow_1bzww_95",YA="_fileName_1bzww_101",qA="_previewImage_1bzww_108",XA="_marks_1bzww_118",QA="_mark_1bzww_118",JA="_actions_1bzww_133",ZA="_actionsSpread_1bzww_140",eD="_actionsEnd_1bzww_144",tD="_headerRow_1bzww_149",nD="_close_1bzww_161",rD="_nameSection_1bzww_178",oD="_nameInput_1bzww_182",iD="_labelRow_1bzww_199",aD="_help_1bzww_205",lD="_textInput_1bzww_223",sD="_fullSelect_1bzww_235",uD="_error_1bzww_239",cD="_emptyHint_1bzww_244",dD="_action_1bzww_133",mD="_textarea_1bzww_255",fD="_actionDanger_1bzww_269",pD="_confirmBody_1bzww_275",hD="_nestedPanel_1bzww_283",gD="_spinnerWrap_1bzww_294",yD="_spinner_1bzww_294",bD="_actionPrimary_1bzww_329",vD="_iconButton_1bzww_343",xD="_select_1bzww_344",wD="_lengthInput_1bzww_345",CD="_lengthUnit_1bzww_346",SD="_group_1bzww_354",kD="_nestedGroup_1bzww_364",PD="_subLabel_1bzww_374",ED="_iconRow_1bzww_378",AD="_lengthField_1bzww_410",DD="_sideLabel_1bzww_416",TD="_lengthRow_1bzww_420",jD="_sideGrid_1bzww_448",ND="_shadowGrid_1bzww_449",b={backdrop:FA,dialog:BA,dialogWide:OA,header:zA,tabs:HA,tab:UA,body:KA,field:$A,label:VA,sizeRow:WA,fileRow:GA,fileName:YA,previewImage:qA,marks:XA,mark:QA,actions:JA,actionsSpread:ZA,actionsEnd:eD,headerRow:tD,close:nD,nameSection:rD,nameInput:oD,labelRow:iD,help:aD,textInput:lD,fullSelect:sD,error:uD,emptyHint:cD,action:dD,textarea:mD,actionDanger:fD,confirmBody:pD,nestedPanel:hD,spinnerWrap:gD,spinner:yD,actionPrimary:bD,iconButton:vD,select:xD,lengthInput:wD,lengthUnit:CD,group:SD,nestedGroup:kD,subLabel:PD,iconRow:ED,lengthField:AD,sideLabel:DD,lengthRow:TD,sideGrid:jD,shadowGrid:ND},RD={bold:{label:"commandBold"},italic:{label:"commandItalic"},underline:{label:"commandUnderline"},strikethrough:{label:"commandStrikethrough"}};function $f({tab:e,value:n,fonts:o,disabled:a,onTabChange:s,onChange:c}){const m=Se(),g=f.useId(),y=f.useId(),w=o??by(),C=hm.find(S=>S.id===e)??hm[0];return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:b.tabs,role:"tablist","aria-label":m("fontDialogTitle"),children:hm.map(S=>l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":S.id===e,disabled:!S.implemented,onClick:()=>s(S.id),children:m(S.labelKey)},S.id))}),l.jsx("div",{className:b.body,role:"tabpanel",children:C.implemented?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:y,children:m("fontDialogFamily")}),l.jsx(lv,{family:n.fontFamilyMixed?null:n.fontFamily,mixed:n.fontFamilyMixed,fonts:w,disabled:a,triggerId:y,onChange:S=>{c({...n,fontFamily:S,fontFamilyMixed:!1})}})]}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:g,children:m("fontDialogSize")}),l.jsx("div",{className:b.sizeRow,children:l.jsx(sv,{size:n.size,unit:n.unit,sizeInputId:g,disabled:a,onSizeChange:(S,E)=>{c({...n,size:S,unit:E})},onUnitChange:S=>{const E=n.size!==null?Sy(n.size,n.unit,S,16,16):n.size;c({...n,size:E,unit:S})}})})]}),l.jsx("div",{className:b.field,children:l.jsx(rr,{label:m("commandFontColor"),noneLabel:m("colorAutomatic"),value:n.fontColor,mixed:n.fontColorMixed,disabled:a,onChange:S=>{c({...n,fontColor:S,fontColorMixed:!1})}})}),l.jsx("div",{className:b.field,children:l.jsx(rr,{label:m("commandHighlightColor"),noneLabel:m("colorNone"),value:n.highlightColor,mixed:n.highlightColorMixed,disabled:a,fallbackCustom:"#ffff00",onChange:S=>{c({...n,highlightColor:S,highlightColorMixed:!1})}})}),l.jsxs("fieldset",{className:b.marks,children:[l.jsx("legend",{className:b.label,children:m("fontDialogStyle")}),nr.map(S=>l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:n.marks[S],disabled:a,onChange:()=>{c({...n,marks:{...n.marks,[S]:!n.marks[S]}})}}),m(RD[S].label)]},S))]})]}):null})]})}const wg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])';function LD({open:e,tab:n,size:o,unit:a,marks:s,fontFamily:c=null,fontFamilyMixed:m=!1,fontColor:g,fontColorMixed:y=!1,highlightColor:w,highlightColorMixed:C=!1,fonts:S,disabled:E,onTabChange:k,onApply:A,onClose:P}){const T=Se(),j=f.useId(),F=f.useRef(null),[L,H]=f.useState({size:o,unit:a,marks:s,fontFamily:c,fontFamilyMixed:m,fontColor:g,highlightColor:w,fontColorMixed:y,highlightColorMixed:C});return f.useEffect(()=>{e&&H({size:o,unit:a,marks:s,fontFamily:c,fontFamilyMixed:m,fontColor:g,highlightColor:w,fontColorMixed:y,highlightColorMixed:C})},[e,o,a,s,c,m,g,y,w,C]),f.useEffect(()=>{if(!e)return;const z=F.current,q=z==null?void 0:z.querySelector(wg);q==null||q.focus();const G=Q=>{if(Q.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;Q.preventDefault(),Q.stopPropagation(),P();return}if(Q.key!=="Tab"||!z)return;const $=[...z.querySelectorAll(wg)];if($.length===0)return;const V=$[0],K=$[$.length-1];Q.shiftKey&&document.activeElement===V?(Q.preventDefault(),K.focus()):!Q.shiftKey&&document.activeElement===K&&(Q.preventDefault(),V.focus())};return document.addEventListener("keydown",G,!0),()=>document.removeEventListener("keydown",G,!0)},[e,P]),e?l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:P,children:l.jsxs("div",{ref:F,className:b.dialog,role:"dialog","aria-modal":"true","aria-labelledby":j,onMouseDown:z=>z.stopPropagation(),children:[l.jsx("h2",{className:b.header,id:j,children:T("fontDialogTitle")}),l.jsx($f,{tab:n,value:L,fonts:S,disabled:E,onTabChange:k,onChange:H}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:P,children:T("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:E,onClick:()=>A(L),children:T("fontDialogOk")})]})]})})}):null}const MD={pt:"fontSizeUnitPt",px:"fontSizeUnitPx",em:"fontSizeUnitEm",rem:"fontSizeUnitRem","%":"fontSizeUnitPercent"};function Lt({label:e,value:n,disabled:o,allowNegative:a=!1,unitAria:s,inputId:c,onChange:m}){const g=Se(),y=f.useId(),w=c??y,C=(n==null?void 0:n.unit)??yf,[S,E]=f.useState(()=>n?Ie(n.value):""),[k,A]=f.useState(!1);f.useEffect(()=>{k||E(n?Ie(n.value):"")},[n,k]);const P=T=>{const j=T.trim();if(!j){m(null),E("");return}const F=Ks(j,C,a);if(!F){E(n?Ie(n.value):"");return}m(F),E(Ie(F.value))};return l.jsxs("div",{className:b.lengthField,children:[l.jsx("label",{className:b.sideLabel,htmlFor:w,children:e}),l.jsxs("div",{className:b.lengthRow,children:[l.jsx("input",{id:w,className:b.lengthInput,value:S,disabled:o,inputMode:"decimal",onFocus:()=>A(!0),onBlur:()=>{A(!1),P(S)},onChange:T=>E(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),P(S),T.currentTarget.blur())}}),l.jsx("select",{className:b.lengthUnit,value:C,disabled:o,"aria-label":s??g("paragraphDialogLengthUnitAria"),onChange:T=>{const j=T.target.value;if(n){m({value:n.value,unit:j});return}if(S.trim()){const F=Ks(S,j,a);m(F)}},children:pf.map(T=>l.jsx("option",{value:T,children:g(MD[T])},T))})]})]})}function Vf({shadow:e,disabled:n,onChange:o}){const a=Se();return l.jsxs("div",{className:b.shadowGrid,children:[l.jsx(Lt,{label:a("paragraphDialogShadowOffsetX"),value:e.offsetX,disabled:n,allowNegative:!0,onChange:s=>{o({...e,offsetX:s??{value:0,unit:"px"}})}}),l.jsx(Lt,{label:a("paragraphDialogShadowOffsetY"),value:e.offsetY,disabled:n,allowNegative:!0,onChange:s=>{o({...e,offsetY:s??{value:0,unit:"px"}})}}),l.jsx(Lt,{label:a("paragraphDialogShadowBlur"),value:e.blur,disabled:n,onChange:s=>{o({...e,blur:s??{value:0,unit:"px"}})}}),l.jsx(Lt,{label:a("paragraphDialogShadowSpread"),value:e.spread,disabled:n,allowNegative:!0,onChange:s=>{o({...e,spread:s??{value:0,unit:"px"}})}}),l.jsx(rr,{label:a("paragraphDialogShadowColor"),noneLabel:a("colorNone"),value:e.color,disabled:n,onChange:s=>{o({...e,color:s})}}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:e.inset,disabled:n,onChange:()=>{o({...e,inset:!e.inset})}}),a("paragraphDialogShadowInset")]})]})}const uv=[{id:"general",labelKey:"fontDialogTabGeneral",implemented:!0},{id:"spacing",labelKey:"paragraphDialogSpacing",implemented:!0},{id:"border",labelKey:"paragraphDialogTabBorder",implemented:!0},{id:"background",labelKey:"paragraphDialogTabBackground",implemented:!0}],cv=[{id:"spacing",labelKey:"paragraphDialogSpacing",implemented:!0},{id:"border",labelKey:"paragraphDialogTabBorder",implemented:!0},{id:"background",labelKey:"paragraphDialogTabBackground",implemented:!0},{id:"backgroundImage",labelKey:"pageDialogTabBackgroundImage",implemented:!0}],_D={fill:"imagePropertiesFitFill",contain:"imagePropertiesFitContain",cover:"imagePropertiesFitCover",none:"imagePropertiesFitNoneValue","scale-down":"imagePropertiesFitScaleDown"},ID={center:"imagePropertiesPositionCenter",top:"imagePropertiesPositionTop",bottom:"imagePropertiesPositionBottom",left:"imagePropertiesPositionLeft",right:"imagePropertiesPositionRight","top left":"imagePropertiesPositionTopLeft","top right":"imagePropertiesPositionTopRight","bottom left":"imagePropertiesPositionBottomLeft","bottom right":"imagePropertiesPositionBottomRight"};function dv({legendKey:e="imagePropertiesTabAdvanced",value:n,disabled:o,onChange:a}){const s=Se(),c=f.useId(),m=f.useId();return l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:s(e)}),l.jsx(FD,{value:n.opacity,disabled:o,onChange:g=>{a({...n,opacity:g})}}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:c,children:s("imagePropertiesFit")}),l.jsxs("select",{id:c,className:b.select,value:n.fit??"",disabled:o,onChange:g=>{const y=g.target.value;a({...n,fit:y||null})},children:[l.jsx("option",{value:"",children:s("imagePropertiesFitDefault")}),Nf.map(g=>l.jsx("option",{value:g,children:s(_D[g])},g))]})]}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:m,children:s("imagePropertiesPosition")}),l.jsxs("select",{id:m,className:b.select,value:n.position??"",disabled:o,onChange:g=>{a({...n,position:g.target.value||null})},children:[l.jsx("option",{value:"",children:s("imagePropertiesPositionDefault")}),Rf.map(g=>l.jsx("option",{value:g,children:s(ID[g])},g))]})]})]})}function FD({value:e,disabled:n,onChange:o}){const a=Se(),s=f.useId(),c=e===null?null:kc(e),[m,g]=f.useState(()=>c===null?"":Ie(c)),[y,w]=f.useState(!1);f.useEffect(()=>{y||g(c===null?"":Ie(c))},[c,y]);const C=S=>{const E=S.trim();if(!E){o(null),g("");return}const k=Number(E.replace(",","."));if(!Number.isFinite(k)){g(c===null?"":Ie(c));return}const A=My(k);o(A),g(Ie(kc(A)))};return l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:s,children:a("paragraphDialogOpacity")}),l.jsxs("div",{className:b.lengthRow,children:[l.jsx("input",{id:s,className:b.lengthInput,value:m,disabled:n,inputMode:"decimal",onFocus:()=>w(!0),onChange:S=>g(S.target.value),onBlur:()=>{w(!1),C(m)}}),l.jsx("span",{className:b.lengthUnit,"aria-hidden":"true",children:a("fontSizeUnitPercent")})]})]})}const sc=4,BD={pt:"fontSizeUnitPt",px:"fontSizeUnitPx",em:"fontSizeUnitEm",rem:"fontSizeUnitRem","%":"fontSizeUnitPercent",pc:"fontSizeUnitPc"};function Lc({label:e,inputAria:n,value:o,disabled:a,onChange:s}){const c=Se(),m=f.useId(),g=f.useId(),y=f.useRef(null),w=f.useRef(null),C=f.useRef(null),S=(o==null?void 0:o.unit)??_0,[E,k]=f.useState(()=>o?Ie(o.value):""),[A,P]=f.useState(!1),[T,j]=f.useState(!1),[F,L]=f.useState({top:0,left:0,width:0});f.useEffect(()=>{A||k(o?Ie(o.value):"")},[o,A]);const H=f.useCallback(()=>{const $=w.current,V=C.current;if(!$)return;const K=$.getBoundingClientRect(),X=(V==null?void 0:V.offsetHeight)??0;let de=K.bottom;de+X>window.innerHeight-sc&&(de=Math.max(sc,K.top-X));const ce=Math.min(Math.max(K.left,sc),window.innerWidth-Math.max(K.width,72)-sc);L({top:de,left:ce,width:K.width})},[]);f.useLayoutEffect(()=>{if(!T)return;H();const $=()=>H();return window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[T,H]),f.useEffect(()=>{if(!T)return;const $=K=>{var de,ce;const X=K.target;(de=y.current)!=null&&de.contains(X)||(ce=C.current)!=null&&ce.contains(X)||j(!1)},V=K=>{K.key==="Escape"&&(K.preventDefault(),K.stopPropagation(),j(!1))};return document.addEventListener("pointerdown",$),document.addEventListener("keydown",V,!0),()=>{document.removeEventListener("pointerdown",$),document.removeEventListener("keydown",V,!0)}},[T]);const z=$=>{const V=$.trim();if(!V){s(null),k("");return}const K=Jh(V,S);if(!K){k(o?Ie(o.value):"");return}s(K),k(Ie(K.value))},q=I0[S],G=(o==null?void 0:o.value)??null,Q=T?l.jsx(Xe,{children:l.jsx("ul",{ref:C,className:Et.list,role:"listbox",id:m,style:{top:F.top,left:F.left,minWidth:F.width},children:q.map($=>l.jsx("li",{role:"presentation",children:l.jsx("button",{type:"button",className:Et.option,role:"option","aria-selected":G===$,onMouseDown:V=>V.preventDefault(),onClick:()=>{s({value:$,unit:S}),k(Ie($)),j(!1)},children:Ie($)})},$))})}):null;return l.jsxs("div",{className:b.lengthField,children:[l.jsx("label",{className:b.sideLabel,htmlFor:g,children:e}),l.jsxs("div",{className:`${Et.wrap} ${b.lengthRow}`,ref:y,children:[l.jsxs("div",{className:Et.field,ref:w,children:[l.jsx("input",{id:g,className:Et.input,value:E,disabled:a,"aria-label":n,"aria-autocomplete":"list","aria-expanded":T,"aria-controls":m,role:"combobox",inputMode:"decimal",onFocus:()=>P(!0),onBlur:()=>{P(!1),z(E)},onChange:$=>k($.target.value),onKeyDown:$=>{$.key==="Enter"&&($.preventDefault(),z(E),j(!1),$.currentTarget.blur()),$.key==="ArrowDown"&&($.preventDefault(),j(!0))}}),l.jsx("button",{type:"button",className:Et.toggle,tabIndex:-1,disabled:a,"aria-label":n,"aria-expanded":T,"aria-controls":m,onMouseDown:$=>$.preventDefault(),onClick:()=>j($=>!$)})]}),l.jsxs("div",{className:Et.field,children:[l.jsx("select",{className:Et.unit,value:S,disabled:a,"aria-label":c("imagePropertiesSizeUnitAria"),onChange:$=>{const V=$.target.value;if(o){s({value:o.value,unit:V});return}E.trim()&&s(Jh(E,V))},children:wb.map($=>l.jsx("option",{value:$,children:c(BD[$])},$))}),l.jsx("span",{className:Et.chevron,"aria-hidden":"true"})]}),Q]})]})}const OD={empty:"imageDialogErrorEmpty",invalid:"imageDialogErrorInvalid"},zD={type:"imageDialogErrorType",tooLarge:"imageDialogErrorTooLarge"};function mv({src:e,disabled:n,customImagePicker:o,onSrcChange:a,onCustomPick:s,onSourceChange:c}){const m=Se(),g=f.useId(),y=f.useId(),w=f.useRef(null),[C,S]=f.useState(()=>e.startsWith("data:")?"file":e.trim()?"url":"file"),[E,k]=f.useState(()=>e.startsWith("data:")?"":e),[A,P]=f.useState(""),[T,j]=f.useState(null),[F,L]=f.useState(!1);f.useEffect(()=>{c==null||c(C)},[c,C]);const H=C==="file"&&e.startsWith("data:")?e:C==="url"?E:"",z=C==="custom"?null:Dl(H),q=C==="custom"?null:C==="file"&&T?zD[T]:z&&(C==="file"||E.trim().length>0)?OD[z]:null,G=()=>{n||!o||s==null||s()},Q=$=>{var K;const V=(K=$.target.files)==null?void 0:K[0];V&&(L(!0),j(null),T0(V).then(X=>{P(V.name),S("file"),a(X),L(!1)},X=>{const de=X instanceof Error?X.message:"";P(""),S("file"),j(de==="tooLarge"||de==="type"?de:"type"),L(!1),w.current&&(w.current.value="")}))};return l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.subLabel,children:m("imageDialogSource")}),l.jsxs("div",{className:b.sizeRow,role:"radiogroup","aria-label":m("imageDialogSource"),children:[l.jsx("button",{type:"button",className:b.action,role:"radio","aria-checked":C==="file",disabled:n,onClick:()=>S("file"),children:m("imageDialogFile")}),l.jsx("button",{type:"button",className:b.action,role:"radio","aria-checked":C==="url",disabled:n,onClick:()=>S("url"),children:m("imageDialogUrl")}),o?l.jsx("button",{type:"button",className:b.action,role:"radio","aria-checked":C==="custom",disabled:n,onClick:()=>S("custom"),children:o.text}):null]}),C==="file"?l.jsxs("div",{className:b.fileRow,children:[l.jsx("input",{ref:w,type:"file",accept:C0,hidden:!0,disabled:n,"aria-label":m("imageDialogChooseFile"),onChange:Q}),l.jsx("button",{type:"button",className:b.action,disabled:n||F,onClick:()=>{var $;return($=w.current)==null?void 0:$.click()},children:m("imageDialogChooseFile")}),A?l.jsx("span",{className:b.fileName,children:A}):null,e.startsWith("data:")&&!A?l.jsx("span",{className:b.fileName,children:m("pageBackgroundImageCurrent")}):null]}):null,C==="url"?l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:g,children:m("imageDialogUrl")}),l.jsx("input",{id:g,className:b.textInput,value:E,disabled:n,"aria-invalid":q!==null,"aria-describedby":q?y:void 0,onChange:$=>{const V=$.target.value;k(V),a(V.trim())}})]}):null,C==="custom"&&o?l.jsxs("div",{className:b.field,children:[l.jsx("p",{className:b.emptyHint,children:o.description}),l.jsx("button",{type:"button",className:b.action,disabled:n,onClick:G,children:o.buttonCaption})]}):null,q?l.jsx("p",{id:y,className:b.error,children:m(q)}):null]})}function HD(e){return Dl(e.trim())===null}function UD(e){return Ab(e)?{width:null,height:null}:e==="fill"?{width:{...yl},height:{...yl}}:{width:{...yl},height:null}}function KD({value:e,disabled:n,customImagePicker:o,onCustomImagePick:a,onChange:s}){const c=Se(),m=e.src??"",g=(y,w)=>{s({...e,fit:null,[y]:w})};return l.jsxs(l.Fragment,{children:[m?l.jsxs("div",{className:b.field,children:[l.jsx("span",{className:b.label,children:c("pageBackgroundImagePreview")}),l.jsx("img",{className:b.previewImage,src:m,alt:c("pageBackgroundImagePreviewAlt")}),l.jsx("button",{type:"button",className:b.action,disabled:n,onClick:()=>{s({...e,src:null})},children:c("pageBackgroundImageClear")})]}):null,l.jsx(mv,{src:m,disabled:n,customImagePicker:o,onCustomPick:a,onSrcChange:y=>{s({...e,src:y.trim()||null})}}),m?l.jsxs(l.Fragment,{children:[l.jsx(Lc,{label:c("imagePropertiesWidth"),inputAria:c("imagePropertiesWidthAria"),value:e.width,disabled:n,onChange:y=>g("width",y)}),l.jsx(Lc,{label:c("imagePropertiesHeight"),inputAria:c("imagePropertiesHeightAria"),value:e.height,disabled:n,onChange:y=>g("height",y)}),l.jsx(dv,{legendKey:"pageDialogTabBackgroundImage",value:{opacity:e.opacity,fit:e.fit,position:e.position},disabled:n,onChange:y=>{const w=y.fit===e.fit?{width:e.width,height:e.height}:UD(y.fit);s({...e,opacity:y.opacity,fit:y.fit,position:y.position,...w})}})]}):null]})}const $D={left:tf,center:ef,right:nf,justify:Jg},VD={left:{aria:"commandAlignLeftAria"},center:{aria:"commandAlignCenterAria"},right:{aria:"commandAlignRightAria"},justify:{aria:"commandAlignJustifyAria"}},WD={top:"paragraphDialogSideTop",right:"paragraphDialogSideRight",bottom:"paragraphDialogSideBottom",left:"paragraphDialogSideLeft"},GD={none:"paragraphDialogBorderStyleNone",solid:"paragraphDialogBorderStyleSolid",dotted:"paragraphDialogBorderStyleDotted",dashed:"paragraphDialogBorderStyleDashed",double:"paragraphDialogBorderStyleDouble",groove:"paragraphDialogBorderStyleGroove",ridge:"paragraphDialogBorderStyleRidge",inset:"paragraphDialogBorderStyleInset",outset:"paragraphDialogBorderStyleOutset"},YD={pt:"fontSizeUnitPt",px:"fontSizeUnitPx",em:"fontSizeUnitEm",rem:"fontSizeUnitRem","%":"fontSizeUnitPercent"},qD={value:1,unit:"pt"},XD={offsetX:{value:0,unit:"px"},offsetY:{value:4,unit:"px"},blur:{value:8,unit:"px"},spread:{value:0,unit:"px"},color:"#000000",inset:!1};function Ls(e){return{top:e,right:e,bottom:e,left:e}}function Cg(e){for(const n of bn)if(e[n])return e[n];return null}function QD(){const e=[...uv];for(const n of cv)e.some(o=>o.id===n.id)||e.push(n);return e}function Wf({tab:e,value:n,disabled:o,tabs:a,tablistLabelKey:s="paragraphDialogTitle",backgroundImage:c,customImagePicker:m,onCustomImagePick:g,onBackgroundImageChange:y,onTabChange:w,onChange:C}){const S=Se(),E=a?QD().filter(L=>a.includes(L.id)):uv,k=f.useId(),[A,P]=f.useState(()=>Mo(n.margin,Ls(n.margin.top))),[T,j]=f.useState(()=>Mo(n.padding,Ls(n.padding.top))),F=(L,H,z,q)=>{const G=n[L],Q=H?Ls(q):{...G,[z]:q};C({...n,[L]:Q,[`${L}Mixed`]:!1})};return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:b.tabs,role:"tablist","aria-label":S(s),children:E.map(L=>l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":L.id===e,disabled:!L.implemented,onClick:()=>w(L.id),children:S(L.labelKey)},L.id))}),l.jsxs("div",{className:b.body,role:"tabpanel",children:[e==="general"?l.jsxs(l.Fragment,{children:[l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:S("paragraphDialogAlignment")}),l.jsx("div",{className:b.iconRow,role:"radiogroup","aria-label":S("paragraphDialogAlignment"),children:gb.map(L=>{const H=$D[L],z=!n.alignMixed&&n.align===L;return l.jsx("button",{type:"button",className:b.iconButton,role:"radio","aria-checked":z,"aria-label":S(VD[L].aria),disabled:o,onClick:()=>{C({...n,align:L,alignMixed:!1})},children:l.jsx(H,{})},L)})})]}),l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:S("paragraphDialogLists")}),l.jsxs("div",{className:b.iconRow,children:[l.jsx("button",{type:"button",className:b.iconButton,"aria-pressed":!n.listMixed&&n.list==="ul","aria-label":S("commandBulletListAria"),disabled:o,onClick:()=>{const L=!n.listMixed&&n.list==="ul"?null:"ul";C({...n,list:L,listMixed:!1})},children:l.jsx(Zg,{})}),l.jsx("button",{type:"button",className:b.iconButton,"aria-pressed":!n.listMixed&&n.list==="ol","aria-label":S("commandNumberedListAria"),disabled:o,onClick:()=>{const L=!n.listMixed&&n.list==="ol"?null:"ol";C({...n,list:L,listMixed:!1})},children:l.jsx(ry,{})})]})]})]}):null,e==="spacing"?l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:S("paragraphDialogSpacing")}),l.jsx(Sg,{legend:S("paragraphDialogMargin"),sides:n.margin,linked:A,disabled:o,allowNegative:!0,onLinkedChange:L=>{P(L),L&&C({...n,margin:Ls(Cg(n.margin)),marginMixed:!1})},onSideChange:(L,H)=>F("margin",A,L,H)}),l.jsx(Sg,{legend:S("paragraphDialogPadding"),sides:n.padding,linked:T,disabled:o,onLinkedChange:L=>{j(L),L&&C({...n,padding:Ls(Cg(n.padding)),paddingMixed:!1})},onSideChange:(L,H)=>F("padding",T,L,H)}),l.jsx(ZD,{value:n.lineHeight,disabled:o,onChange:L=>{C({...n,lineHeight:L,lineHeightMixed:!1})}})]}):null,e==="border"?l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:S("paragraphDialogBorder")}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:k,children:S("paragraphDialogBorderStyle")}),l.jsx("select",{id:k,className:b.select,value:n.border.style,disabled:o,onChange:L=>{const H=L.target.value;C({...n,border:{style:H,width:H==="none"?null:n.border.width??qD,color:H==="none"?null:n.border.color},borderMixed:!1})},children:zc.map(L=>l.jsx("option",{value:L,children:S(GD[L])},L))})]}),n.border.style!=="none"?l.jsxs(l.Fragment,{children:[l.jsx(Lt,{label:S("paragraphDialogBorderWidth"),value:n.border.width,disabled:o,onChange:L=>{C({...n,border:{...n.border,width:L},borderMixed:!1})}}),l.jsx(rr,{label:S("paragraphDialogBorderColor"),noneLabel:S("colorNone"),value:n.border.color,mixed:n.borderMixed,disabled:o,onChange:L=>{C({...n,border:{...n.border,color:L},borderMixed:!1})}})]}):null,l.jsx(Lt,{label:S("paragraphDialogBorderRadius"),value:n.borderRadius,disabled:o,onChange:L=>{C({...n,borderRadius:L,radiusMixed:!1})}}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:n.boxShadow!==null,disabled:o,onChange:()=>{C({...n,boxShadow:n.boxShadow?null:XD,shadowMixed:!1})}}),S("paragraphDialogBoxShadow")]}),n.boxShadow?l.jsx(Vf,{shadow:n.boxShadow,disabled:o,onChange:L=>{C({...n,boxShadow:L,shadowMixed:!1})}}):null]}):null,e==="background"?l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:S("paragraphDialogTabBackground")}),l.jsx(rr,{label:S("paragraphDialogBackgroundColor"),noneLabel:S("colorNone"),value:n.backgroundColor,mixed:n.backgroundMixed,disabled:o,onChange:L=>{C({...n,backgroundColor:L,backgroundMixed:!1})}}),l.jsx(JD,{value:n.opacity,disabled:o,onChange:L=>{C({...n,opacity:L,opacityMixed:!1})}})]}):null,e==="backgroundImage"&&c&&y?l.jsx(KD,{value:c,disabled:o,customImagePicker:m,onCustomImagePick:g,onChange:y}):null]})]})}function JD({value:e,disabled:n,onChange:o}){const a=Se(),s=f.useId(),c=e===null?null:kc(e),[m,g]=f.useState(()=>c===null?"":Ie(c)),[y,w]=f.useState(!1);f.useEffect(()=>{y||g(c===null?"":Ie(c))},[c,y]);const C=S=>{const E=S.trim();if(!E){o(null),g("");return}const k=Number(E.replace(",","."));if(!Number.isFinite(k)){g(c===null?"":Ie(c));return}const A=My(k);o(A),g(Ie(kc(A)))};return l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:s,children:a("paragraphDialogOpacity")}),l.jsxs("div",{className:b.lengthRow,children:[l.jsx("input",{id:s,className:b.lengthInput,value:m,disabled:n,inputMode:"decimal",onFocus:()=>w(!0),onChange:S=>g(S.target.value),onBlur:()=>{w(!1),C(m)}}),l.jsx("span",{className:b.lengthUnit,"aria-hidden":"true",children:a("fontSizeUnitPercent")})]})]})}function Sg({legend:e,sides:n,linked:o,disabled:a,allowNegative:s=!1,onLinkedChange:c,onSideChange:m}){const g=Se(),y=o?["top"]:bn;return l.jsxs("fieldset",{className:b.nestedGroup,children:[l.jsx("legend",{className:b.subLabel,children:e}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:o,disabled:a,onChange:()=>c(!o)}),g("paragraphDialogLinkSides")]}),l.jsx("div",{className:b.sideGrid,children:y.map(w=>l.jsx(Lt,{label:o?e:g(WD[w]),value:n[w],disabled:a,allowNegative:s,onChange:C=>m(w,C)},w))})]})}function ZD({value:e,disabled:n,onChange:o}){const a=Se(),s=f.useId(),c=eT(e),m=(e==null?void 0:e.kind)==="number"||(e==null?void 0:e.kind)==="length"?e.value:null,[g,y]=f.useState(()=>m===null?"":Ie(m)),w=(e==null?void 0:e.kind)==="length"?e.unit:yf;return l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:s,children:a("paragraphDialogLineHeight")}),l.jsxs("div",{className:b.lengthRow,children:[l.jsx("input",{id:s,className:b.lengthInput,value:c==="normal"?"":g,disabled:n||c==="normal",inputMode:"decimal",onChange:C=>y(C.target.value),onBlur:()=>{const C=g.trim();if(!C){o(null);return}if(c==="number"||c==="empty"){const E=Number(C.replace(",","."));if(!Number.isFinite(E)||E<0){y(m===null?"":Ie(m));return}o({kind:"number",value:E}),y(Ie(E));return}const S=Ks(C,w,!1);if(!S){y(m===null?"":Ie(m));return}o({kind:"length",value:S.value,unit:S.unit}),y(Ie(S.value))}}),l.jsxs("select",{className:b.lengthUnit,value:c==="length"?w:c,disabled:n,"aria-label":a("paragraphDialogLengthUnitAria"),onChange:C=>{const S=C.target.value;if(S==="empty"){o(null),y("");return}if(S==="normal"){o({kind:"normal"}),y("");return}if(S==="number"){const P=Number((g||"1.5").replace(",",".")),T=Number.isFinite(P)&&P>=0?P:1.5;o({kind:"number",value:T}),y(Ie(T));return}const E=S,k=Ks(g||"1",E,!1),A=(k==null?void 0:k.value)??1;o({kind:"length",value:A,unit:E}),y(Ie(A))},children:[l.jsx("option",{value:"empty"}),l.jsx("option",{value:"normal",children:a("paragraphDialogLineHeightNormal")}),l.jsx("option",{value:"number",children:a("paragraphDialogLineHeightUnitless")}),["pt","px","em","rem","%"].map(C=>l.jsx("option",{value:C,children:a(YD[C])},C))]})]})]})}function eT(e){return e?e.kind==="normal"?"normal":e.kind==="number"?"number":"length":"empty"}const kg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])';function tT({open:e,tab:n,value:o,disabled:a,onTabChange:s,onApply:c,onClose:m}){const g=Se(),y=f.useId(),w=f.useRef(null),[C,S]=f.useState(o);return f.useEffect(()=>{e&&S(o)},[e,o]),f.useEffect(()=>{if(!e)return;const E=w.current,k=E==null?void 0:E.querySelector(kg);k==null||k.focus();const A=P=>{if(P.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;P.preventDefault(),P.stopPropagation(),m();return}if(P.key!=="Tab"||!E)return;const T=[...E.querySelectorAll(kg)];if(T.length===0)return;const j=T[0],F=T[T.length-1];P.shiftKey&&document.activeElement===j?(P.preventDefault(),F.focus()):!P.shiftKey&&document.activeElement===F&&(P.preventDefault(),j.focus())};return document.addEventListener("keydown",A,!0),()=>document.removeEventListener("keydown",A,!0)},[e,m]),e?l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:m,children:l.jsxs("div",{ref:w,className:`${b.dialog} ${b.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":y,onMouseDown:E=>E.stopPropagation(),children:[l.jsx("h2",{className:b.header,id:y,children:g("paragraphDialogTitle")}),l.jsx(Wf,{tab:n,value:C,disabled:a,onTabChange:s,onChange:S}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:m,children:g("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:a,onClick:()=>c(C),children:g("fontDialogOk")})]})]})})}):null}const nT=["auto","A4","letter","legal","custom"],rT={auto:"pageAtRuleSizeAuto",A4:"pageAtRuleSizeA4",letter:"pageAtRuleSizeLetter",legal:"pageAtRuleSizeLegal",custom:"pageAtRuleSizeCustom"},oT={top:"paragraphDialogSideTop",right:"paragraphDialogSideRight",bottom:"paragraphDialogSideBottom",left:"paragraphDialogSideLeft"};function Pg(e){return e===null?"":Ie(e.value)}function iT({value:e,disabled:n,onChange:o,onReset:a}){const s=Se(),c=f.useId(),[m,g]=f.useState(!0),y=e??ya(),w=(C,S)=>{if(m){o({...y,margin:{top:S,right:S,bottom:S,left:S},marginMixed:!1});return}o({...y,margin:{...y.margin,[C]:S},marginMixed:!1})};return l.jsxs("div",{className:b.panel,children:[l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:c,children:s("pageAtRuleSize")}),l.jsx("select",{id:c,className:b.select,disabled:n,value:y.sizePreset,onChange:C=>o({...y,sizePreset:C.target.value}),children:nT.map(C=>l.jsx("option",{value:C,children:s(rT[C])},C))})]}),y.sizePreset==="custom"?l.jsxs("div",{className:b.sideGrid,children:[l.jsx(ym,{label:s("pageAtRuleWidth"),value:y.customWidth,disabled:n,onChange:C=>o({...y,customWidth:C})}),l.jsx(ym,{label:s("pageAtRuleHeight"),value:y.customHeight,disabled:n,onChange:C=>o({...y,customHeight:C})})]}):null,l.jsxs("div",{className:b.field,children:[l.jsx("span",{className:b.label,children:s("pageAtRuleOrientation")}),l.jsx("div",{className:b.marks,children:[["none","pageAtRuleOrientationNone"],["portrait","pageAtRuleOrientationPortrait"],["landscape","pageAtRuleOrientationLandscape"]].map(([C,S])=>l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"radio",name:"page-orientation",checked:(y.orientation??"none")===C,disabled:n,onChange:()=>o({...y,orientation:C==="none"?null:C})}),s(S)]},C))})]}),l.jsxs("fieldset",{className:b.nestedGroup,children:[l.jsx("legend",{className:b.subLabel,children:s("pageAtRuleMargins")}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:m,disabled:n,onChange:()=>g(!m)}),s("paragraphDialogLinkSides")]}),l.jsx("div",{className:b.sideGrid,children:(m?["top"]:bn).map(C=>l.jsx(ym,{label:s(m?"pageAtRuleMargins":oT[C]),value:y.margin[C],disabled:n,onChange:S=>w(C,S)},C))})]}),l.jsx("div",{className:b.actions,children:l.jsx("button",{type:"button",className:b.action,disabled:n,"aria-label":s("pageAtRuleResetAria"),onClick:a,children:s("pageAtRuleReset")})})]})}function ym({label:e,value:n,disabled:o,onChange:a}){const s=Se(),c=f.useId(),[m,g]=f.useState(()=>Pg(n)),y=(n==null?void 0:n.unit)??yf;return l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:c,children:e}),l.jsxs("div",{className:b.lengthRow,children:[l.jsx("input",{id:c,className:b.lengthInput,value:m,disabled:o,inputMode:"decimal",onChange:w=>g(w.target.value),onBlur:()=>{const w=m.trim();if(!w){a(null);return}const C=Ks(w,y,!1);if(!C){g(Pg(n));return}a(C),g(Ie(C.value))}}),l.jsxs("select",{className:b.lengthUnit,disabled:o,value:y,"aria-label":s("paragraphDialogLengthUnitAria"),onChange:w=>{const C=w.target.value;n&&a({...n,unit:C})},children:[l.jsx("option",{value:"pt",children:s("fontSizeUnitPt")}),l.jsx("option",{value:"px",children:s("fontSizeUnitPx")}),l.jsx("option",{value:"em",children:s("fontSizeUnitEm")}),l.jsx("option",{value:"rem",children:s("fontSizeUnitRem")}),l.jsx("option",{value:"%",children:s("fontSizeUnitPercent")})]})]})]})}const Eg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])',aT=cv.map(e=>e.id);function lT(e){return{...Fs(),...e}}function sT(e){const{align:n,alignMixed:o,list:a,listMixed:s,...c}=e;return c}function uT({open:e,tab:n,value:o,fonts:a,disabled:s,customImagePicker:c,onCustomImagePick:m,onTabChange:g,onApply:y,onResetAtRule:w,onClose:C}){const S=Se(),E=f.useId(),k=f.useRef(null),[A,P]=f.useState("general"),[T,j]=f.useState("spacing"),[F,L]=f.useState(o.font),[H,z]=f.useState(o.box),[q,G]=f.useState(o.backgroundImage),[Q,$]=f.useState(o.atRule??ya());if(f.useEffect(()=>{e&&(P("general"),j("spacing"),L(o.font),z(o.box),G(o.backgroundImage??Lf()),$(o.atRule??ya()))},[e,o]),f.useEffect(()=>{if(!e)return;const K=k.current,X=K==null?void 0:K.querySelector(Eg);X==null||X.focus();const de=ce=>{if(ce.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;ce.preventDefault(),ce.stopPropagation(),C();return}if(ce.key!=="Tab"||!K)return;const Pe=[...K.querySelectorAll(Eg)];if(Pe.length===0)return;const ke=Pe[0],je=Pe[Pe.length-1];ce.shiftKey&&document.activeElement===ke?(ce.preventDefault(),je.focus()):!ce.shiftKey&&document.activeElement===je&&(ce.preventDefault(),ke.focus())};return document.addEventListener("keydown",de,!0),()=>document.removeEventListener("keydown",de,!0)},[e,C]),!e)return null;const V=S("pageDialogTitle");return l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:C,children:l.jsxs("div",{ref:k,className:`${b.dialog} ${b.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":E,onMouseDown:K=>K.stopPropagation(),children:[l.jsx("h2",{className:b.header,id:E,children:V}),l.jsxs("div",{className:b.tabs,role:"tablist","aria-label":V,children:[l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":n==="font",onClick:()=>g("font"),children:S("customStyleDialogTabFont")}),l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":n==="paragraph",onClick:()=>g("paragraph"),children:S("customStyleDialogTabParagraph")}),l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":n==="print",onClick:()=>g("print"),children:S("pageDialogTabPrint")})]}),n==="font"?l.jsx("div",{className:b.nestedPanel,children:l.jsx($f,{tab:A,value:F,fonts:a,disabled:s,onTabChange:P,onChange:L})}):n==="paragraph"?l.jsx("div",{className:b.nestedPanel,children:l.jsx(Wf,{tab:T,value:lT(H),disabled:s,tabs:aT,tablistLabelKey:"pageDialogTitle",backgroundImage:q,customImagePicker:c,onCustomImagePick:m,onBackgroundImageChange:G,onTabChange:K=>{K!=="general"&&j(K)},onChange:K=>z(sT(K))})}):l.jsx("div",{className:b.nestedPanel,children:l.jsx(iT,{value:Q,disabled:s,onChange:$,onReset:()=>{$(ya()),w==null||w()}})}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:C,children:S("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:s,onClick:()=>y({font:F,box:H,backgroundImage:q,atRule:Q}),children:S("fontDialogOk")})]})]})})})}const Ag='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])';function cT(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`style-${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}`}function Dg(e){return{size:e.size,unit:e.unit,marks:e.marks,fontFamily:e.fontFamily??null,fontFamilyMixed:!1,fontColor:e.fontColor,highlightColor:e.highlightColor,fontColorMixed:!1,highlightColorMixed:!1}}function dT(e){return{size:e.size,unit:e.unit,marks:e.marks,fontFamily:e.fontFamilyMixed?null:e.fontFamily,fontColor:e.fontColorMixed?null:e.fontColor,highlightColor:e.highlightColorMixed?null:e.highlightColor}}function mT({open:e,mode:n,styleId:o,name:a="",font:s,paragraph:c,canDelete:m=!1,busy:g,disabled:y,fonts:w,defaultOuterTab:C="font",onSave:S,onDelete:E,onClose:k}){const A=Se(),P=f.useId(),T=f.useId(),j=f.useRef(null),[F,L]=f.useState(a),[H,z]=f.useState(C),[q,G]=f.useState("general"),[Q,$]=f.useState("general"),[V,K]=f.useState(()=>Dg(s)),[X,de]=f.useState(()=>Om(c)),[ce,Pe]=f.useState(!1);if(f.useEffect(()=>{e&&(L(a),z(C),G("general"),$("general"),K(Dg(s)),de(Om(c)),Pe(!1))},[e,a,s,c,C]),f.useEffect(()=>{if(!e)return;const J=j.current,M=J==null?void 0:J.querySelector(Ag);M==null||M.focus();const N=re=>{if(re.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;if(re.preventDefault(),re.stopPropagation(),ce){Pe(!1);return}k();return}if(re.key!=="Tab"||!J)return;const fe=[...J.querySelectorAll(Ag)];if(fe.length===0)return;const ae=fe[0],Ce=fe[fe.length-1];re.shiftKey&&document.activeElement===ae?(re.preventDefault(),Ce.focus()):!re.shiftKey&&document.activeElement===Ce&&(re.preventDefault(),ae.focus())};return document.addEventListener("keydown",N,!0),()=>document.removeEventListener("keydown",N,!0)},[e,k,ce]),!e)return null;const ke=A(n==="create"?"customStyleDialogAddTitle":"customStyleDialogEditTitle"),je=F.trim().length>0,Y=!!(y||g),pe=()=>{const J=F.trim();J&&S({id:o??cT(),name:J,font:dT(V),paragraph:xb(X)})};return l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:k,children:l.jsxs("div",{ref:j,className:`${b.dialog} ${b.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":P,"aria-busy":g||void 0,onMouseDown:J=>J.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:P,children:ke}),l.jsx("button",{type:"button",className:b.close,"aria-label":A("customStyleDialogCloseAria"),onClick:k,children:l.jsx(sn,{})})]}),ce?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:b.confirmBody,children:A("customStyleDialogDeleteConfirm")}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,disabled:Y,onClick:()=>Pe(!1),children:A("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionDanger}`,disabled:Y||!o,onClick:()=>{o&&(E==null||E(o))},children:A("customStyleDialogDelete")})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:b.nameSection,children:l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:T,children:A("customStyleDialogName")}),l.jsx("input",{id:T,className:b.nameInput,value:F,disabled:Y,onChange:J=>L(J.target.value)})]})}),l.jsxs("div",{className:b.tabs,role:"tablist","aria-label":ke,children:[l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":H==="font",onClick:()=>z("font"),children:A("customStyleDialogTabFont")}),l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":H==="paragraph",onClick:()=>z("paragraph"),children:A("customStyleDialogTabParagraph")})]}),H==="font"?l.jsx("div",{className:b.nestedPanel,children:l.jsx($f,{tab:q,value:V,fonts:w,disabled:Y,onTabChange:G,onChange:K})}):l.jsx("div",{className:b.nestedPanel,children:l.jsx(Wf,{tab:Q,value:X,disabled:Y,onTabChange:$,onChange:de})}),l.jsxs("div",{className:n==="edit"&&m?`${b.actions} ${b.actionsSpread}`:b.actions,children:[n==="edit"&&m?l.jsx("button",{type:"button",className:`${b.action} ${b.actionDanger}`,disabled:Y,onClick:()=>Pe(!0),children:A("customStyleDialogDelete")}):null,l.jsxs("div",{className:b.actionsEnd,children:[l.jsx("button",{type:"button",className:b.action,onClick:k,children:A("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:Y||!je,onClick:pe,children:A("fontDialogOk")})]})]})]})]})})})}const fT='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function pT({open:e,value:n,disabled:o,onApply:a,onClose:s}){const c=Se(),m=f.useId(),g=f.useId(),y=f.useRef(null),w=f.useRef(null),[C,S]=f.useState(n);if(f.useEffect(()=>{e&&S(n)},[e,n]),f.useEffect(()=>{var P;if(!e)return;(P=w.current)==null||P.focus();const k=y.current,A=T=>{if(T.key==="Escape"){T.preventDefault(),T.stopPropagation(),s();return}if(T.key!=="Tab"||!k)return;const j=[...k.querySelectorAll(fT)];if(j.length===0)return;const F=j[0],L=j[j.length-1];T.shiftKey&&document.activeElement===F?(T.preventDefault(),L.focus()):!T.shiftKey&&document.activeElement===L&&(T.preventDefault(),F.focus())};return document.addEventListener("keydown",A,!0),()=>document.removeEventListener("keydown",A,!0)},[e,s]),!e)return null;const E=()=>{o||a(C)};return l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:s,children:l.jsxs("div",{ref:y,className:b.dialog,role:"dialog","aria-modal":"true","aria-labelledby":m,onMouseDown:k=>k.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:m,children:c("customCssDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":c("customCssDialogCloseAria"),onClick:s,children:l.jsx(sn,{})})]}),l.jsx("div",{className:b.body,children:l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:g,children:c("customCssDialogField")}),l.jsx("textarea",{ref:w,id:g,className:b.textarea,value:C,disabled:o,spellCheck:!1,"aria-label":c("customCssDialogFieldAria"),rows:8,onChange:k=>S(k.target.value)})]})}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:s,children:c("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:o,onClick:E,children:c("fontDialogOk")})]})]})})})}const Tg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])',hT={empty:"bookmarkDialogErrorEmpty",invalid:"bookmarkDialogErrorInvalid",duplicate:"bookmarkDialogErrorDuplicate"};function gT({open:e,existingIds:n,disabled:o,onApply:a,onClose:s}){const c=Se(),m=f.useId(),g=f.useId(),y=f.useId(),w=f.useRef(null),[C,S]=f.useState(""),[E,k]=f.useState(!1),A=f.useMemo(()=>new Set(n),[n]),P=Ib(C,A);if(f.useEffect(()=>{e&&(S(""),k(!1))},[e]),f.useEffect(()=>{if(!e)return;const L=w.current,H=L==null?void 0:L.querySelector(Tg);H==null||H.focus();const z=q=>{if(q.key==="Escape"){q.preventDefault(),q.stopPropagation(),s();return}if(q.key!=="Tab"||!L)return;const G=[...L.querySelectorAll(Tg)];if(G.length===0)return;const Q=G[0],$=G[G.length-1];q.shiftKey&&document.activeElement===Q?(q.preventDefault(),$.focus()):!q.shiftKey&&document.activeElement===$&&(q.preventDefault(),Q.focus())};return document.addEventListener("keydown",z,!0),()=>document.removeEventListener("keydown",z,!0)},[e,s]),!e)return null;const T=E||C.trim().length>0?P:null,j=P===null&&!o,F=()=>{k(!0),!(P||o)&&a(C.trim())};return l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:s,children:l.jsxs("div",{ref:w,className:b.dialog,role:"dialog","aria-modal":"true","aria-labelledby":m,onMouseDown:L=>L.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:m,children:c("bookmarkDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":c("bookmarkDialogCloseAria"),onClick:s,children:l.jsx(sn,{})})]}),l.jsx("div",{className:b.body,children:l.jsxs("div",{className:b.field,children:[l.jsxs("div",{className:b.labelRow,children:[l.jsx("label",{className:b.label,htmlFor:g,children:c("bookmarkDialogName")}),l.jsx(Ai,{label:c("bookmarkDialogHelp"),elevated:!0,children:l.jsx("button",{type:"button",className:b.help,"aria-label":c("bookmarkDialogHelpAria"),children:"?"})})]}),l.jsx("input",{id:g,className:b.textInput,value:C,disabled:o,"aria-invalid":T!==null,"aria-describedby":T?y:void 0,onChange:L=>S(L.target.value)}),T?l.jsx("p",{id:y,className:b.error,children:c(hT[T])}):null]})}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:s,children:c("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:!j,onClick:F,children:c("fontDialogOk")})]})]})})})}const jg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([hidden]), select:not([disabled]), textarea:not([disabled])',yT={empty:"audioDialogErrorEmpty",invalid:"audioDialogErrorInvalid"},bT={type:"audioDialogErrorType",tooLarge:"audioDialogErrorTooLarge"};function vT({open:e,disabled:n,customAudioPicker:o,onApply:a,onCustomPick:s,onClose:c}){const m=Se(),g=f.useId(),y=f.useId(),w=f.useId(),C=f.useId(),S=f.useRef(null),E=f.useRef(null),[k,A]=f.useState("file"),[P,T]=f.useState(""),[j,F]=f.useState(""),[L,H]=f.useState(""),[z,q]=f.useState(""),[G,Q]=f.useState(null),[$,V]=f.useState(!1);if(f.useEffect(()=>{e&&(A("file"),T(""),F(""),H(""),q(""),Q(null),V(!1),E.current&&(E.current.value=""))},[e]),f.useEffect(()=>{if(!e)return;const Y=S.current,pe=Y==null?void 0:Y.querySelector(jg);pe==null||pe.focus();const J=M=>{if(M.key==="Escape"){M.preventDefault(),M.stopPropagation(),c();return}if(M.key!=="Tab"||!Y)return;const N=[...Y.querySelectorAll(jg)];if(N.length===0)return;const re=N[0],fe=N[N.length-1];M.shiftKey&&document.activeElement===re?(M.preventDefault(),fe.focus()):!M.shiftKey&&document.activeElement===fe&&(M.preventDefault(),re.focus())};return document.addEventListener("keydown",J,!0),()=>document.removeEventListener("keydown",J,!0)},[e,c]),!e)return null;const K=k==="file"?j:k==="url"?P:"",X=k==="custom"?null:If(K),de=k==="custom"?null:k==="file"&&G?bT[G]:X&&(k==="file"||P.trim().length>0)?yT[X]:null,ce=k!=="custom"&&X===null&&!(k==="file"&&G)&&!n&&!$,Pe=()=>{n||!o||s==null||s()},ke=()=>{ce&&a({src:K.trim(),title:z.trim()})},je=Y=>{var J;const pe=(J=Y.target.files)==null?void 0:J[0];pe&&(V(!0),Q(null),Rk(pe).then(M=>{F(M),H(pe.name),A("file"),V(!1)},M=>{const N=M instanceof Error?M.message:"";F(""),H(""),A("file"),Q(N==="tooLarge"||N==="type"?N:"type"),V(!1),E.current&&(E.current.value="")}))};return l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:c,children:l.jsxs("div",{ref:S,className:b.dialog,role:"dialog","aria-modal":"true","aria-labelledby":g,onMouseDown:Y=>Y.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:g,children:m("audioDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":m("audioDialogCloseAria"),onClick:c,children:l.jsx(sn,{})})]}),l.jsxs("div",{className:b.body,children:[l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.subLabel,children:m("audioDialogSource")}),l.jsxs("div",{className:b.sizeRow,role:"radiogroup","aria-label":m("audioDialogSource"),children:[l.jsx("button",{type:"button",className:b.action,role:"radio","aria-checked":k==="file",disabled:n,onClick:()=>A("file"),children:m("audioDialogFile")}),l.jsx("button",{type:"button",className:b.action,role:"radio","aria-checked":k==="url",disabled:n,onClick:()=>A("url"),children:m("audioDialogUrl")}),o?l.jsx("button",{type:"button",className:b.action,role:"radio","aria-checked":k==="custom",disabled:n,onClick:()=>A("custom"),children:o.text}):null]}),k==="file"?l.jsxs("div",{className:b.fileRow,children:[l.jsx("input",{ref:E,type:"file",accept:Pk,hidden:!0,disabled:n,"aria-label":m("audioDialogChooseFile"),onChange:je}),l.jsx("button",{type:"button",className:b.action,disabled:n||$,onClick:()=>{var Y;return(Y=E.current)==null?void 0:Y.click()},children:m("audioDialogChooseFile")}),L?l.jsx("span",{className:b.fileName,children:L}):null]}):null,k==="url"?l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:y,children:m("audioDialogUrl")}),l.jsx("input",{id:y,className:b.textInput,value:P,disabled:n,"aria-invalid":de!==null,"aria-describedby":de?C:void 0,onChange:Y=>T(Y.target.value)})]}):null,k==="custom"&&o?l.jsxs("div",{className:b.field,children:[l.jsx("p",{className:b.emptyHint,children:o.description}),l.jsx("button",{type:"button",className:b.action,disabled:n,onClick:Pe,children:o.buttonCaption})]}):null]}),k!=="custom"?l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:w,children:m("audioDialogTitleField")}),l.jsx("input",{id:w,className:b.textInput,value:z,disabled:n,onChange:Y=>q(Y.target.value)})]}):null,de?l.jsx("p",{id:C,className:b.error,children:m(de)}):null]}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:c,children:m("fontDialogCancel")}),k!=="custom"?l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:!ce,onClick:ke,children:m("fontDialogOk")}):null]})]})})})}const Ng='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([hidden]), select:not([disabled]), textarea:not([disabled])';function xT({open:e,disabled:n,customImagePicker:o,onApply:a,onCustomPick:s,onClose:c}){const m=Se(),g=f.useId(),y=f.useId(),w=f.useId(),C=f.useRef(null),[S,E]=f.useState(""),[k,A]=f.useState(""),[P,T]=f.useState(""),[j,F]=f.useState("file");if(f.useEffect(()=>{e&&(E(""),A(""),T(""),F("file"))},[e]),f.useEffect(()=>{if(!e)return;const z=C.current,q=z==null?void 0:z.querySelector(Ng);q==null||q.focus();const G=Q=>{if(Q.key==="Escape"){Q.preventDefault(),Q.stopPropagation(),c();return}if(Q.key!=="Tab"||!z)return;const $=[...z.querySelectorAll(Ng)];if($.length===0)return;const V=$[0],K=$[$.length-1];Q.shiftKey&&document.activeElement===V?(Q.preventDefault(),K.focus()):!Q.shiftKey&&document.activeElement===K&&(Q.preventDefault(),V.focus())};return document.addEventListener("keydown",G,!0),()=>document.removeEventListener("keydown",G,!0)},[e,c]),!e)return null;const L=HD(S)&&!n,H=()=>{L&&a({src:S.trim(),alt:k.trim(),title:P.trim()})};return l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:c,children:l.jsxs("div",{ref:C,className:b.dialog,role:"dialog","aria-modal":"true","aria-labelledby":g,onMouseDown:z=>z.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:g,children:m("imageDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":m("imageDialogCloseAria"),onClick:c,children:l.jsx(sn,{})})]}),l.jsxs("div",{className:b.body,children:[l.jsx(mv,{src:S,disabled:n,customImagePicker:o,onCustomPick:s,onSourceChange:F,onSrcChange:E}),j!=="custom"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:y,children:m("imageDialogAlt")}),l.jsx("input",{id:y,className:b.textInput,value:k,disabled:n,onChange:z=>A(z.target.value)})]}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:w,children:m("imageDialogTitleField")}),l.jsx("input",{id:w,className:b.textInput,value:P,disabled:n,onChange:z=>T(z.target.value)})]})]}):null]}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:c,children:m("fontDialogCancel")}),j!=="custom"?l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:!L,onClick:H,children:m("fontDialogOk")}):null]})]})})})}const wT=[{id:"general",labelKey:"fontDialogTabGeneral",implemented:!0},{id:"alignment",labelKey:"imagePropertiesTabAlignment",implemented:!0},{id:"border",labelKey:"imagePropertiesTabBorder",implemented:!0},{id:"advanced",labelKey:"imagePropertiesTabAdvanced",implemented:!0},{id:"hover",labelKey:"imagePropertiesTabHover",implemented:!0}],CT={left:tf,center:ef,right:nf},ST=["left","center","right"],kT={left:"commandAlignLeftAria",center:"commandAlignCenterAria",right:"commandAlignRightAria"},PT=["width","height","lock"],ET={width:"imagePropertiesSizeWidth",height:"imagePropertiesSizeHeight",lock:"imagePropertiesSizeLock"},AT={top:"paragraphDialogSideTop",right:"paragraphDialogSideRight",bottom:"paragraphDialogSideBottom",left:"paragraphDialogSideLeft"},DT={none:"paragraphDialogBorderStyleNone",solid:"paragraphDialogBorderStyleSolid",dotted:"paragraphDialogBorderStyleDotted",dashed:"paragraphDialogBorderStyleDashed",double:"paragraphDialogBorderStyleDouble",groove:"paragraphDialogBorderStyleGroove",ridge:"paragraphDialogBorderStyleRidge",inset:"paragraphDialogBorderStyleInset",outset:"paragraphDialogBorderStyleOutset"},TT={value:1,unit:"pt"},jT={offsetX:{value:0,unit:"px"},offsetY:{value:4,unit:"px"},blur:{value:8,unit:"px"},spread:{value:0,unit:"px"},color:"#000000",inset:!1};function bm(e){return{top:e,right:e,bottom:e,left:e}}function NT(e){for(const n of bn)if(e[n])return e[n];return null}function RT({tab:e,value:n,aspectRatio:o,disabled:a,onTabChange:s,onChange:c}){const m=Se(),g=f.useId(),y=f.useId(),w=f.useId(),[C,S]=f.useState(()=>Mo(n.margin,bm(n.margin.top))),E=n.align==="center",k=(P,T)=>{if(n.sizeMode==="lock"&&T){const j=Bs(P,T,o);c({...n,width:j.width,height:j.height});return}c({...n,[P]:T})},A=P=>{if(P==="width"){c({...n,sizeMode:P,height:null});return}if(P==="height"){c({...n,sizeMode:P,width:null});return}if(n.width){const T=Bs("width",n.width,o);c({...n,sizeMode:P,width:T.width,height:T.height});return}if(n.height){const T=Bs("height",n.height,o);c({...n,sizeMode:P,width:T.width,height:T.height});return}c({...n,sizeMode:P})};return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:b.tabs,role:"tablist","aria-label":m("imagePropertiesDialogTitle"),children:wT.map(P=>l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":P.id===e,disabled:!P.implemented,onClick:()=>s(P.id),children:m(P.labelKey)},P.id))}),l.jsxs("div",{className:b.body,role:"tabpanel",children:[e==="general"?l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:m("imagePropertiesSize")}),l.jsx("div",{className:b.iconRow,role:"radiogroup","aria-label":m("imagePropertiesSizeMode"),children:PT.map(P=>l.jsx("button",{type:"button",className:b.action,role:"radio","aria-checked":n.sizeMode===P,disabled:a,onClick:()=>A(P),children:m(ET[P])},P))}),l.jsx(Lc,{label:m("imagePropertiesWidth"),inputAria:m("imagePropertiesWidthAria"),value:n.width,disabled:a||n.sizeMode==="height",onChange:P=>k("width",P)}),l.jsx(Lc,{label:m("imagePropertiesHeight"),inputAria:m("imagePropertiesHeightAria"),value:n.height,disabled:a||n.sizeMode==="width",onChange:P=>k("height",P)})]}):null,e==="alignment"?l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:m("paragraphDialogAlignment")}),l.jsx("div",{className:b.iconRow,role:"radiogroup","aria-label":m("paragraphDialogAlignment"),children:ST.map(P=>{const T=CT[P];return l.jsx("button",{type:"button",className:b.iconButton,role:"radio","aria-checked":n.align===P,"aria-label":m(kT[P]),disabled:a,onClick:()=>{c({...n,align:n.align===P?null:P})},children:l.jsx(T,{})},P)})})]}):null,e==="border"?l.jsxs(l.Fragment,{children:[l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:m("paragraphDialogMargin")}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:C,disabled:a||E,onChange:()=>{const P=!C;S(P),P&&c({...n,margin:bm(NT(n.margin))})}}),m("paragraphDialogLinkSides")]}),l.jsx("div",{className:b.sideGrid,children:(C?["top"]:bn).map(P=>l.jsx(Lt,{label:m(C?"paragraphDialogMargin":AT[P]),value:n.margin[P],disabled:a||E&&(P==="left"||P==="right"),allowNegative:!0,onChange:T=>{const j=C?bm(T):{...n.margin,[P]:T};c({...n,margin:j})}},P))})]}),l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:m("paragraphDialogBorder")}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:g,children:m("paragraphDialogBorderStyle")}),l.jsx("select",{id:g,className:b.select,value:n.border.style,disabled:a,onChange:P=>{const T=P.target.value;c({...n,border:{style:T,width:T==="none"?null:n.border.width??TT,color:T==="none"?null:n.border.color}})},children:zc.map(P=>l.jsx("option",{value:P,children:m(DT[P])},P))})]}),n.border.style!=="none"?l.jsxs(l.Fragment,{children:[l.jsx(Lt,{label:m("paragraphDialogBorderWidth"),value:n.border.width,disabled:a,onChange:P=>{c({...n,border:{...n.border,width:P}})}}),l.jsx(rr,{label:m("paragraphDialogBorderColor"),noneLabel:m("colorNone"),value:n.border.color,disabled:a,onChange:P=>{c({...n,border:{...n.border,color:P}})}})]}):null,l.jsx(Lt,{label:m("paragraphDialogBorderRadius"),value:n.borderRadius,disabled:a,onChange:P=>{c({...n,borderRadius:P})}}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:n.boxShadow!==null,disabled:a,onChange:()=>{c({...n,boxShadow:n.boxShadow?null:jT})}}),m("paragraphDialogBoxShadow")]}),n.boxShadow?l.jsx(Vf,{shadow:n.boxShadow,disabled:a,onChange:P=>{c({...n,boxShadow:P})}}):null]})]}):null,e==="advanced"?l.jsxs(l.Fragment,{children:[l.jsx(dv,{value:{opacity:n.opacity,fit:n.objectFit,position:n.objectPosition},disabled:a,onChange:P=>{c(W0({...n,opacity:P.opacity,objectFit:P.fit,objectPosition:P.position},o))}}),l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:m("imagePropertiesRotation")}),l.jsx("div",{className:b.field,children:l.jsxs("div",{className:b.lengthRow,children:[l.jsx("input",{id:y,className:b.lengthInput,value:n.rotateDeg===null?"":Ie(n.rotateDeg),disabled:a,inputMode:"decimal","aria-label":m("imagePropertiesRotation"),onChange:P=>{const T=P.target.value.trim();if(!T){c({...n,rotateDeg:null});return}const j=Number(T.replace(",","."));Number.isFinite(j)&&c({...n,rotateDeg:j})}}),l.jsx("span",{className:b.lengthUnit,"aria-hidden":"true",children:m("imagePropertiesRotationUnit")})]})})]})]}):null,e==="hover"?l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:m("imagePropertiesTabHover")}),l.jsx("p",{className:b.emptyHint,children:m("imagePropertiesHoverHelp")}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:w,children:m("imagePropertiesHoverCss")}),l.jsx("textarea",{id:w,className:b.textarea,value:n.hoverCss,disabled:a,spellCheck:!1,"aria-label":m("imagePropertiesHoverCssAria"),onChange:P=>{c({...n,hoverCss:P.target.value})}})]})]}):null]})]})}const Rg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function LT({open:e,tab:n,value:o,aspectRatio:a=1,disabled:s,onTabChange:c,onApply:m,onClose:g}){const y=Se(),w=f.useId(),C=f.useRef(null),[S,E]=f.useState(o);return f.useEffect(()=>{e&&E(o)},[e,o]),f.useEffect(()=>{if(!e)return;const k=C.current,A=k==null?void 0:k.querySelector(Rg);A==null||A.focus();const P=T=>{if(T.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;T.preventDefault(),T.stopPropagation(),g();return}if(T.key!=="Tab"||!k)return;const j=[...k.querySelectorAll(Rg)];if(j.length===0)return;const F=j[0],L=j[j.length-1];T.shiftKey&&document.activeElement===F?(T.preventDefault(),L.focus()):!T.shiftKey&&document.activeElement===L&&(T.preventDefault(),F.focus())};return document.addEventListener("keydown",P,!0),()=>document.removeEventListener("keydown",P,!0)},[e,g]),e?l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:g,children:l.jsxs("div",{ref:C,className:`${b.dialog} ${b.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":w,onMouseDown:k=>k.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:w,children:y("imagePropertiesDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":y("imagePropertiesDialogCloseAria"),onClick:g,children:l.jsx(sn,{})})]}),l.jsx(RT,{tab:n,value:S,aspectRatio:a,disabled:s,onTabChange:c,onChange:E}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:g,children:y("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:s,onClick:()=>m(S),children:y("fontDialogOk")})]})]})})}):null}const MT="_frame_bwkh8_1",_T="_handle_bwkh8_9",IT="_handleEast_bwkh8_29",FT="_handleSouth_bwkh8_37",BT="_handleSouthEast_bwkh8_45",Os={frame:MT,handle:_T,handleEast:IT,handleSouth:FT,handleSouthEast:BT};function Ms(e){const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}const OT=[{handle:"e",className:Os.handleEast,cursor:"e-resize",ariaKey:"imageResizeHandleEastAria"},{handle:"s",className:Os.handleSouth,cursor:"s-resize",ariaKey:"imageResizeHandleSouthAria"},{handle:"se",className:Os.handleSouthEast,cursor:"se-resize",ariaKey:"imageResizeHandleSouthEastAria"}];function vm(e){return!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY)?null:{x:e.clientX,y:e.clientY}}function zT({img:e,onResize:n,onResizeEnd:o}){const a=Se(),s=f.useRef(null),c=f.useRef(e),m=f.useRef(n),g=f.useRef(o),y=f.useRef(null);c.current=e,m.current=n,g.current=o;const w=j=>{const F=s.current;F&&(F.style.left=`${j.left}px`,F.style.top=`${j.top}px`,F.style.width=`${j.width}px`,F.style.height=`${j.height}px`)};f.useLayoutEffect(()=>{w(Ms(e));const j=()=>{e.isConnected&&w(Ms(e))};return window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[e]);const C=(j,F)=>{const L=y.current,H=c.current;if(!L||!H)return;const z=aP(L.handle,L.start,{x:j-L.originX,y:F-L.originY});m.current(z.width,z.height),H.isConnected&&w(Ms(H))},S=()=>{if(!y.current)return;y.current=null;const j=c.current;g.current(),j!=null&&j.isConnected&&w(Ms(j))};f.useLayoutEffect(()=>{const j=L=>{if(!y.current)return;const H=vm(L);H&&C(H.x,H.y)},F=()=>{S()};return document.addEventListener("pointermove",j),document.addEventListener("pointerup",F),document.addEventListener("pointercancel",F),document.addEventListener("mousemove",j),document.addEventListener("mouseup",F),()=>{document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",F)}},[]);const E=(j,F)=>{const L=vm(F);L&&(y.current={handle:j,start:lP(c.current),originX:L.x,originY:L.y})},k=j=>F=>{F.preventDefault(),F.stopPropagation(),E(j,F);try{F.currentTarget.setPointerCapture(F.pointerId)}catch{}},A=j=>F=>{F.preventDefault(),F.stopPropagation(),E(j,F)},P=j=>{const F=vm(j);F&&C(F.x,F.y)};if(!e.isConnected)return null;const T=Ms(e);return of.createPortal(l.jsx("div",{ref:s,className:Os.frame,"data-image-resize-overlay":"",style:{left:T.left,top:T.top,width:T.width,height:T.height},children:OT.map(j=>l.jsx("button",{type:"button",className:`${Os.handle} ${j.className}`,style:{cursor:j.cursor},"aria-label":a(j.ariaKey),"data-resize-handle":j.handle,onPointerDown:k(j.handle),onPointerMove:P,onPointerUp:S,onPointerCancel:S,onMouseDown:A(j.handle),onMouseMove:P,onMouseUp:S},j.handle))}),document.body)}const Lg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function HT({open:e,tab:n,href:o,title:a,targetBlank:s,textDecorationNone:c,hoverMode:m,hoverColor:g,hoverHtml:y,bookmarks:w,selectedBookmarkId:C,disabled:S,onTabChange:E,onApply:k,onClose:A}){const P=Se(),T=f.useId(),j=f.useId(),F=f.useId(),L=f.useId(),H=f.useId(),z=f.useRef(null),[q,G]=f.useState(o),[Q,$]=f.useState(a),[V,K]=f.useState(s),[X,de]=f.useState(c),[ce,Pe]=f.useState(m),[ke,je]=f.useState(g),[Y,pe]=f.useState(y),[J,M]=f.useState(C);if(f.useEffect(()=>{e&&(G(o),$(a),K(s),de(c),Pe(m),je(g),pe(y),M(C))},[e,o,a,s,c,m,g,y,C]),f.useEffect(()=>{if(!e)return;const ae=z.current,Ce=ae==null?void 0:ae.querySelector(Lg);Ce==null||Ce.focus();const Re=De=>{if(De.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;De.preventDefault(),De.stopPropagation(),A();return}if(De.key!=="Tab"||!ae)return;const Be=[...ae.querySelectorAll(Lg)];if(Be.length===0)return;const Qe=Be[0],un=Be[Be.length-1];De.shiftKey&&document.activeElement===Qe?(De.preventDefault(),un.focus()):!De.shiftKey&&document.activeElement===un&&(De.preventDefault(),Qe.focus())};return document.addEventListener("keydown",Re,!0),()=>document.removeEventListener("keydown",Re,!0)},[e,A,n,ce]),!e)return null;const N=()=>Kc({title:Q,targetBlank:V,textDecorationNone:X,hoverMode:ce,hoverColor:ke,hoverHtml:Y}),re=()=>{const ae=q.trim();!ae||S||k({...N(),href:ae})},fe=()=>{!J||S||k({...N(),href:`#${J}`})};return l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:A,children:l.jsxs("div",{ref:z,className:b.dialog,role:"dialog","aria-modal":"true","aria-labelledby":T,onMouseDown:ae=>ae.stopPropagation(),children:[l.jsx("h2",{className:b.header,id:T,children:P("linkDialogTitle")}),l.jsxs("div",{className:b.tabs,role:"tablist","aria-label":P("linkDialogTitle"),children:[l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":n==="link",onClick:()=>E("link"),children:P("linkDialogTabLink")}),l.jsx("button",{type:"button",className:b.tab,role:"tab","aria-selected":n==="bookmark",onClick:()=>E("bookmark"),children:P("linkDialogTabBookmark")})]}),l.jsxs("div",{className:b.body,role:"tabpanel",children:[n==="link"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:j,children:P("linkDialogHref")}),l.jsx("input",{id:j,className:b.textInput,value:q,disabled:S,onChange:ae=>G(ae.target.value)})]}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:F,children:P("linkDialogHoverTitle")}),l.jsx("input",{id:F,className:b.textInput,value:Q,disabled:S,onChange:ae=>$(ae.target.value)})]}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:V,disabled:S,onChange:ae=>K(ae.target.checked)}),P("linkDialogTargetBlank")]})]}):w.length===0?l.jsx("p",{className:b.emptyHint,children:P("linkDialogBookmarkEmpty")}):l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:L,children:P("linkDialogBookmark")}),l.jsxs("select",{id:L,className:`${b.select} ${b.fullSelect}`,value:J,disabled:S,onChange:ae=>M(ae.target.value),children:[l.jsx("option",{value:""}),w.map(ae=>l.jsx("option",{value:ae.id,children:ae.id},ae.id))]})]}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:X,disabled:S,onChange:ae=>de(ae.target.checked)}),P("linkDialogTextDecorationNone")]}),l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.subLabel,children:P("linkDialogHover")}),l.jsxs("div",{className:b.sizeRow,role:"group","aria-label":P("linkDialogHover"),children:[l.jsx("button",{type:"button",className:b.action,"aria-pressed":ce==="color",disabled:S,onClick:()=>Pe("color"),children:P("linkDialogHoverColor")}),l.jsx("button",{type:"button",className:b.action,"aria-pressed":ce==="html",disabled:S,onClick:()=>Pe("html"),children:P("linkDialogHoverHtml")})]}),ce==="color"?l.jsx(rr,{label:P("linkDialogHoverColorField"),noneLabel:P("colorNone"),value:ke,disabled:S,onChange:je}):l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:H,children:P("linkDialogHoverHtmlAria")}),l.jsx("textarea",{id:H,className:b.textarea,value:Y,disabled:S,spellCheck:!1,onChange:ae=>pe(ae.target.value)})]})]})]}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,disabled:S||!J,onClick:fe,children:P("linkDialogSelect")}),l.jsx("button",{type:"button",className:b.action,onClick:A,children:P("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:S||!q.trim(),onClick:re,children:P("fontDialogOk")})]})]})})})}const Mg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([hidden]), select:not([disabled]), textarea:not([disabled])',_g={empty:"youtubeDialogErrorEmpty",invalid:"youtubeDialogErrorInvalid"};function UT({open:e,disabled:n,customVideoPicker:o,onApply:a,onCustomPick:s,onClose:c}){const m=Se(),g=f.useId(),y=f.useId(),w=f.useId(),C=f.useId(),S=f.useRef(null),[E,k]=f.useState("url"),[A,P]=f.useState(""),[T,j]=f.useState("");if(f.useEffect(()=>{e&&(k("url"),P(""),j(""))},[e]),f.useEffect(()=>{if(!e)return;const G=S.current,Q=G==null?void 0:G.querySelector(Mg);Q==null||Q.focus();const $=V=>{if(V.key==="Escape"){V.preventDefault(),V.stopPropagation(),c();return}if(V.key!=="Tab"||!G)return;const K=[...G.querySelectorAll(Mg)];if(K.length===0)return;const X=K[0],de=K[K.length-1];V.shiftKey&&document.activeElement===X?(V.preventDefault(),de.focus()):!V.shiftKey&&document.activeElement===de&&(V.preventDefault(),X.focus())};return document.addEventListener("keydown",$,!0),()=>document.removeEventListener("keydown",$,!0)},[e,c]),!e)return null;const F=E==="custom"?null:Kb(A),L=E==="custom"?null:F&&A.trim().length>0?_g[F]:F==="empty"&&A.trim().length===0?null:F?_g[F]:null,H=E!=="custom"&&F===null&&!n&&A.trim().length>0,z=()=>{n||!o||s==null||s()},q=()=>{H&&a({url:A.trim(),title:T.trim()})};return l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:c,children:l.jsxs("div",{ref:S,className:b.dialog,role:"dialog","aria-modal":"true","aria-labelledby":g,onMouseDown:G=>G.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:g,children:m("youtubeDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":m("youtubeDialogCloseAria"),onClick:c,children:l.jsx(sn,{})})]}),l.jsxs("div",{className:b.body,children:[l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.subLabel,children:m("audioDialogSource")}),l.jsxs("div",{className:b.sizeRow,role:"radiogroup","aria-label":m("audioDialogSource"),children:[l.jsx("button",{type:"button",className:b.action,role:"radio","aria-checked":E==="url",disabled:n,onClick:()=>k("url"),children:m("youtubeDialogUrl")}),o?l.jsx("button",{type:"button",className:b.action,role:"radio","aria-checked":E==="custom",disabled:n,onClick:()=>k("custom"),children:o.text}):null]}),E==="url"?l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:y,children:m("youtubeDialogUrl")}),l.jsx("input",{id:y,className:b.textInput,value:A,disabled:n,"aria-invalid":L!==null,"aria-describedby":L?C:void 0,onChange:G=>P(G.target.value)})]}):null,E==="custom"&&o?l.jsxs("div",{className:b.field,children:[l.jsx("p",{className:b.emptyHint,children:o.description}),l.jsx("button",{type:"button",className:b.action,disabled:n,onClick:z,children:o.buttonCaption})]}):null]}),E!=="custom"?l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:w,children:m("youtubeDialogTitleField")}),l.jsx("input",{id:w,className:b.textInput,value:T,disabled:n,onChange:G=>j(G.target.value)})]}):null,L?l.jsx("p",{id:C,className:b.error,children:m(L)}):null]}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:c,children:m("fontDialogCancel")}),E!=="custom"?l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:!H,onClick:q,children:m("fontDialogOk")}):null]})]})})})}const KT="_grid_1bpma_1",$T="_cell_1bpma_8",VT="_sizeLabel_1bpma_27",WT="_sizeFields_1bpma_33",GT="_numberInput_1bpma_37",cl={grid:KT,cell:$T,sizeLabel:VT,sizeFields:WT,numberInput:GT},Ig='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([hidden]), select:not([disabled])',wi={rows:3,cols:3};function YT({open:e,disabled:n,onApply:o,onClose:a}){const s=Se(),c=f.useId(),m=f.useId(),g=f.useId(),y=f.useRef(null),[w,C]=f.useState(wi.rows),[S,E]=f.useState(wi.cols),[k,A]=f.useState(String(wi.rows)),[P,T]=f.useState(String(wi.cols)),[j,F]=f.useState(!1);if(f.useEffect(()=>{e&&(C(wi.rows),E(wi.cols),A(String(wi.rows)),T(String(wi.cols)),F(!1))},[e]),f.useEffect(()=>{if(!e)return;const $=y.current,V=$==null?void 0:$.querySelector(Ig);V==null||V.focus();const K=X=>{if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),a();return}if(X.key!=="Tab"||!$)return;const de=[...$.querySelectorAll(Ig)];if(de.length===0)return;const ce=de[0],Pe=de[de.length-1];X.shiftKey&&document.activeElement===ce?(X.preventDefault(),Pe.focus()):!X.shiftKey&&document.activeElement===Pe&&(X.preventDefault(),ce.focus())};return document.addEventListener("keydown",K,!0),()=>document.removeEventListener("keydown",K,!0)},[e,a]),!e)return null;const H=qb(w,S)&&!n,z=($,V)=>{const K=Math.min(gl,Math.max(hl,$)),X=Math.min(gl,Math.max(hl,V));C(K),E(X),A(String(K)),T(String(X))},q=($,V)=>{const K=Number.parseInt($,10);if(!Number.isFinite(K)){V==="rows"?A(String(w)):T(String(S));return}F(!0),V==="rows"?z(K,S):z(w,K)},G=($,V)=>{const K=$.replace(/\D/g,"");if(V==="rows"?A(K):T(K),K==="")return;const X=Number.parseInt(K,10);Number.isFinite(X)&&(F(!0),V==="rows"?z(X,S):z(w,X))},Q=$=>{($.key==="e"||$.key==="E"||$.key==="+"||$.key==="-"||$.key===".")&&$.preventDefault()};return l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:a,children:l.jsxs("div",{ref:y,className:b.dialog,role:"dialog","aria-modal":"true","aria-labelledby":c,onMouseDown:$=>$.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:c,children:s("tableDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":s("tableDialogCloseAria"),onClick:a,children:l.jsx(sn,{})})]}),l.jsxs("div",{className:b.body,children:[l.jsx("div",{className:cl.grid,role:"grid","aria-label":s("tableDialogGridAria"),onMouseLeave:()=>{},children:Array.from({length:mg},($,V)=>Array.from({length:mg},(K,X)=>{const de=V+1,ce=X+1,Pe=de<=w&&ce<=S;return l.jsx("button",{type:"button",className:cl.cell,role:"gridcell","data-active":Pe?"true":void 0,"aria-label":`${de} × ${ce}`,"aria-pressed":Pe&&de===w&&ce===S,disabled:n,onMouseEnter:()=>{j||z(de,ce)},onClick:()=>{F(!0),z(de,ce)}},`${de}-${ce}`)}))}),l.jsxs("p",{className:cl.sizeLabel,children:[s("tableDialogSize"),": ",w," × ",S]}),l.jsxs("div",{className:`${b.sizeRow} ${cl.sizeFields}`,children:[l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:m,children:s("tableDialogRows")}),l.jsx("input",{id:m,className:cl.numberInput,type:"number",inputMode:"numeric",min:hl,max:gl,step:1,value:k,disabled:n,onKeyDown:Q,onChange:$=>G($.target.value,"rows"),onBlur:()=>q(k,"rows")})]}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:g,children:s("tableDialogColumns")}),l.jsx("input",{id:g,className:cl.numberInput,type:"number",inputMode:"numeric",min:hl,max:gl,step:1,value:P,disabled:n,onKeyDown:Q,onChange:$=>G($.target.value,"cols"),onBlur:()=>q(P,"cols")})]})]})]}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:a,children:s("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:!H,onClick:()=>{H&&o({rows:w,cols:S})},children:s("tableDialogInsert")})]})]})})})}const qT={none:"paragraphDialogBorderStyleNone",solid:"paragraphDialogBorderStyleSolid",dotted:"paragraphDialogBorderStyleDotted",dashed:"paragraphDialogBorderStyleDashed",double:"paragraphDialogBorderStyleDouble",groove:"paragraphDialogBorderStyleGroove",ridge:"paragraphDialogBorderStyleRidge",inset:"paragraphDialogBorderStyleInset",outset:"paragraphDialogBorderStyleOutset"},XT={value:1,unit:"pt"},QT={offsetX:{value:0,unit:"px"},offsetY:{value:4,unit:"px"},blur:{value:8,unit:"px"},spread:{value:0,unit:"px"},color:"#000000",inset:!1};function JT({value:e,disabled:n,onChange:o}){const a=Se(),s=f.useId(),c=f.useId();return l.jsxs("div",{className:b.body,children:[l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:a("tablePropertiesWidth")}),l.jsx(Lt,{label:a("tablePropertiesWidth"),value:e.width,disabled:n,onChange:m=>o({...e,width:m})}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:s,children:a("tablePropertiesCollapse")}),l.jsxs("select",{id:s,className:b.select,value:e.borderCollapse,disabled:n,onChange:m=>{const g=m.target.value==="separate"?"separate":"collapse";o({...e,borderCollapse:g,borderSpacing:g==="separate"?e.borderSpacing:null})},children:[l.jsx("option",{value:"collapse",children:a("tablePropertiesCollapseCollapse")}),l.jsx("option",{value:"separate",children:a("tablePropertiesCollapseSeparate")})]})]}),e.borderCollapse==="separate"?l.jsx(Lt,{label:a("tablePropertiesSpacing"),value:e.borderSpacing,disabled:n,onChange:m=>o({...e,borderSpacing:m})}):null]}),l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:a("paragraphDialogBorder")}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:c,children:a("paragraphDialogBorderStyle")}),l.jsx("select",{id:c,className:b.select,value:e.border.style,disabled:n,onChange:m=>{const g=m.target.value;o({...e,border:{style:g,width:g==="none"?null:e.border.width??XT,color:g==="none"?null:e.border.color}})},children:zc.map(m=>l.jsx("option",{value:m,children:a(qT[m])},m))})]}),e.border.style!=="none"?l.jsxs(l.Fragment,{children:[l.jsx(Lt,{label:a("paragraphDialogBorderWidth"),value:e.border.width,disabled:n,onChange:m=>o({...e,border:{...e.border,width:m}})}),l.jsx(rr,{label:a("paragraphDialogBorderColor"),noneLabel:a("colorNone"),value:e.border.color,disabled:n,onChange:m=>o({...e,border:{...e.border,color:m}})})]}):null,l.jsx(Lt,{label:a("paragraphDialogBorderRadius"),value:e.borderRadius,disabled:n,onChange:m=>o({...e,borderRadius:m})}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:e.boxShadow!==null,disabled:n,onChange:()=>{o({...e,boxShadow:e.boxShadow?null:QT})}}),a("paragraphDialogBoxShadow")]}),e.boxShadow?l.jsx(Vf,{shadow:e.boxShadow,disabled:n,onChange:m=>o({...e,boxShadow:m})}):null]})]})}const Fg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function ZT({open:e,value:n,disabled:o,onApply:a,onClose:s}){const c=Se(),m=f.useId(),g=f.useRef(null),[y,w]=f.useState(n);return f.useEffect(()=>{e&&w(n)},[e,n]),f.useEffect(()=>{if(!e)return;const C=g.current,S=C==null?void 0:C.querySelector(Fg);S==null||S.focus();const E=k=>{if(k.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;k.preventDefault(),k.stopPropagation(),s();return}if(k.key!=="Tab"||!C)return;const A=[...C.querySelectorAll(Fg)];if(A.length===0)return;const P=A[0],T=A[A.length-1];k.shiftKey&&document.activeElement===P?(k.preventDefault(),T.focus()):!k.shiftKey&&document.activeElement===T&&(k.preventDefault(),P.focus())};return document.addEventListener("keydown",E,!0),()=>document.removeEventListener("keydown",E,!0)},[e,s]),e?l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:s,children:l.jsxs("div",{ref:g,className:`${b.dialog} ${b.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":m,onMouseDown:C=>C.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:m,children:c("tablePropertiesDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":c("tablePropertiesDialogCloseAria"),onClick:s,children:l.jsx(sn,{})})]}),l.jsx(JT,{value:y,disabled:o,onChange:w}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:s,children:c("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:o,onClick:()=>a(y),children:c("fontDialogOk")})]})]})})}):null}const ej={top:"paragraphDialogSideTop",right:"paragraphDialogSideRight",bottom:"paragraphDialogSideBottom",left:"paragraphDialogSideLeft"},tj={top:"cellPropertiesVerticalAlignTop",middle:"cellPropertiesVerticalAlignMiddle",bottom:"cellPropertiesVerticalAlignBottom",baseline:"cellPropertiesVerticalAlignBaseline"};function uc(e){return{top:e,right:e,bottom:e,left:e}}function xm(e){for(const n of bn)if(e[n])return e[n];return null}function nj({value:e,disabled:n,onChange:o}){const a=Se(),s=f.useId(),c=f.useId(),m=f.useId(),[g,y]=f.useState(()=>Mo(e.padding,uc(xm(e.padding))));return f.useEffect(()=>{y(Mo(e.padding,uc(xm(e.padding))))},[e.padding]),l.jsxs("div",{className:b.body,children:[l.jsx(rr,{label:a("paragraphDialogBackgroundColor"),noneLabel:a("colorNone"),value:e.backgroundColor,disabled:n,onChange:w=>o({...e,backgroundColor:w})}),l.jsx(rr,{label:a("cellPropertiesColor"),noneLabel:a("colorNone"),value:e.color,disabled:n,onChange:w=>o({...e,color:w})}),l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:a("paragraphDialogPadding")}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:g,disabled:n,onChange:()=>{const w=!g;y(w),w&&o({...e,padding:uc(xm(e.padding))})}}),a("paragraphDialogLinkSides")]}),l.jsx("div",{className:b.sideGrid,children:(g?["top"]:bn).map(w=>l.jsx(Lt,{label:a(g?"paragraphDialogPadding":ej[w]),value:e.padding[w],disabled:n,onChange:C=>{const S=g?uc(C):{...e.padding,[w]:C};o({...e,padding:S})}},w))})]}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:s,children:a("cellPropertiesVerticalAlign")}),l.jsxs("select",{id:s,className:b.select,value:e.verticalAlign??"",disabled:n,onChange:w=>{const C=w.target.value;o({...e,verticalAlign:C||null})},children:[l.jsx("option",{value:"",children:a("cellPropertiesVerticalAlignDefault")}),Wc.map(w=>l.jsx("option",{value:w,children:a(tj[w])},w))]})]}),l.jsx(Lt,{label:a("cellPropertiesWidth"),value:e.width,disabled:n,onChange:w=>o({...e,width:w})}),l.jsxs("div",{className:b.sizeRow,children:[l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:c,children:a("cellPropertiesColSpan")}),l.jsx("input",{id:c,className:b.lengthInput,type:"number",inputMode:"numeric",min:1,step:1,value:e.colSpan,disabled:n,onChange:w=>{const C=Number.parseInt(w.target.value,10);o({...e,colSpan:Number.isFinite(C)?Math.max(1,C):1})}})]}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:m,children:a("cellPropertiesRowSpan")}),l.jsx("input",{id:m,className:b.lengthInput,type:"number",inputMode:"numeric",min:1,step:1,value:e.rowSpan,disabled:n,onChange:w=>{const C=Number.parseInt(w.target.value,10);o({...e,rowSpan:Number.isFinite(C)?Math.max(1,C):1})}})]})]})]})}const Bg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function rj({open:e,value:n,disabled:o,onApply:a,onClose:s}){const c=Se(),m=f.useId(),g=f.useRef(null),[y,w]=f.useState(n);return f.useEffect(()=>{e&&w(n)},[e,n]),f.useEffect(()=>{if(!e)return;const C=g.current,S=C==null?void 0:C.querySelector(Bg);S==null||S.focus();const E=k=>{if(k.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;k.preventDefault(),k.stopPropagation(),s();return}if(k.key!=="Tab"||!C)return;const A=[...C.querySelectorAll(Bg)];if(A.length===0)return;const P=A[0],T=A[A.length-1];k.shiftKey&&document.activeElement===P?(k.preventDefault(),T.focus()):!k.shiftKey&&document.activeElement===T&&(k.preventDefault(),P.focus())};return document.addEventListener("keydown",E,!0),()=>document.removeEventListener("keydown",E,!0)},[e,s]),e?l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:s,children:l.jsxs("div",{ref:g,className:`${b.dialog} ${b.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":m,onMouseDown:C=>C.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:m,children:c("cellPropertiesDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":c("cellPropertiesDialogCloseAria"),onClick:s,children:l.jsx(sn,{})})]}),l.jsx(nj,{value:y,disabled:o,onChange:w}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:s,children:c("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:o,onClick:()=>a(y),children:c("fontDialogOk")})]})]})})}):null}const oj={top:"paragraphDialogSideTop",right:"paragraphDialogSideRight",bottom:"paragraphDialogSideBottom",left:"paragraphDialogSideLeft"},ij={top:"cellPropertiesVerticalAlignTop",middle:"cellPropertiesVerticalAlignMiddle",bottom:"cellPropertiesVerticalAlignBottom",baseline:"cellPropertiesVerticalAlignBaseline"};function cc(e){return{top:e,right:e,bottom:e,left:e}}function wm(e){for(const n of bn)if(e[n])return e[n];return null}function aj({value:e,disabled:n,onChange:o}){const a=Se(),s=f.useId(),[c,m]=f.useState(()=>Mo(e.padding,cc(wm(e.padding))));return f.useEffect(()=>{m(Mo(e.padding,cc(wm(e.padding))))},[e.padding]),l.jsxs("div",{className:b.body,children:[l.jsx(rr,{label:a("paragraphDialogBackgroundColor"),noneLabel:a("colorNone"),value:e.backgroundColor,disabled:n,onChange:g=>o({...e,backgroundColor:g})}),l.jsx(rr,{label:a("cellPropertiesColor"),noneLabel:a("colorNone"),value:e.color,disabled:n,onChange:g=>o({...e,color:g})}),l.jsxs("fieldset",{className:b.group,children:[l.jsx("legend",{className:b.label,children:a("paragraphDialogPadding")}),l.jsxs("label",{className:b.mark,children:[l.jsx("input",{type:"checkbox",checked:c,disabled:n,onChange:()=>{const g=!c;m(g),g&&o({...e,padding:cc(wm(e.padding))})}}),a("paragraphDialogLinkSides")]}),l.jsx("div",{className:b.sideGrid,children:(c?["top"]:bn).map(g=>l.jsx(Lt,{label:a(c?"paragraphDialogPadding":oj[g]),value:e.padding[g],disabled:n,onChange:y=>{const w=c?cc(y):{...e.padding,[g]:y};o({...e,padding:w})}},g))})]}),l.jsxs("div",{className:b.field,children:[l.jsx("label",{className:b.label,htmlFor:s,children:a("cellPropertiesVerticalAlign")}),l.jsxs("select",{id:s,className:b.select,value:e.verticalAlign??"",disabled:n,onChange:g=>{const y=g.target.value;o({...e,verticalAlign:y||null})},children:[l.jsx("option",{value:"",children:a("cellPropertiesVerticalAlignDefault")}),Wc.map(g=>l.jsx("option",{value:g,children:a(ij[g])},g))]})]}),l.jsx(Lt,{label:a("rowPropertiesHeight"),value:e.height,disabled:n,onChange:g=>o({...e,height:g})})]})}const Og='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function lj({open:e,value:n,disabled:o,onApply:a,onClose:s}){const c=Se(),m=f.useId(),g=f.useRef(null),[y,w]=f.useState(n);return f.useEffect(()=>{e&&w(n)},[e,n]),f.useEffect(()=>{if(!e)return;const C=g.current,S=C==null?void 0:C.querySelector(Og);S==null||S.focus();const E=k=>{if(k.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;k.preventDefault(),k.stopPropagation(),s();return}if(k.key!=="Tab"||!C)return;const A=[...C.querySelectorAll(Og)];if(A.length===0)return;const P=A[0],T=A[A.length-1];k.shiftKey&&document.activeElement===P?(k.preventDefault(),T.focus()):!k.shiftKey&&document.activeElement===T&&(k.preventDefault(),P.focus())};return document.addEventListener("keydown",E,!0),()=>document.removeEventListener("keydown",E,!0)},[e,s]),e?l.jsx(Xe,{children:l.jsx("div",{className:b.backdrop,role:"presentation",onMouseDown:s,children:l.jsxs("div",{ref:g,className:`${b.dialog} ${b.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":m,onMouseDown:C=>C.stopPropagation(),children:[l.jsxs("div",{className:b.headerRow,children:[l.jsx("h2",{className:b.header,id:m,children:c("rowPropertiesDialogTitle")}),l.jsx("button",{type:"button",className:b.close,"aria-label":c("rowPropertiesDialogCloseAria"),onClick:s,children:l.jsx(sn,{})})]}),l.jsx(aj,{value:y,disabled:o,onChange:w}),l.jsxs("div",{className:b.actions,children:[l.jsx("button",{type:"button",className:b.action,onClick:s,children:c("fontDialogCancel")}),l.jsx("button",{type:"button",className:`${b.action} ${b.actionPrimary}`,disabled:o,onClick:()=>a(y),children:c("fontDialogOk")})]})]})})}):null}const sj="_backdrop_9d3gw_1",uj="_dialog_9d3gw_12",cj="_headerRow_9d3gw_29",dj="_header_9d3gw_29",mj="_close_9d3gw_44",fj="_body_9d3gw_66",pj="_frame_9d3gw_75",hj="_actions_9d3gw_83",gj="_action_9d3gw_83",jo={backdrop:sj,dialog:uj,headerRow:cj,header:dj,close:mj,body:fj,frame:pj,actions:hj,action:gj},zg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])';function yj({open:e,html:n,onClose:o}){const a=Se(),s=f.useId(),c=f.useRef(null),m=f.useRef(null);return f.useEffect(()=>{if(!e)return;const g=c.current,y=g==null?void 0:g.querySelector(zg);y==null||y.focus();const w=C=>{if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),o();return}if(C.key!=="Tab"||!g)return;const S=[...g.querySelectorAll(zg)];if(S.length===0)return;const E=S[0],k=S[S.length-1];C.shiftKey&&document.activeElement===E?(C.preventDefault(),k.focus()):!C.shiftKey&&document.activeElement===k&&(C.preventDefault(),E.focus())};return document.addEventListener("keydown",w,!0),()=>document.removeEventListener("keydown",w,!0)},[e,o]),f.useEffect(()=>{var y;if(!e)return;const g=(y=m.current)==null?void 0:y.contentDocument;g&&jm(g,n,a("previewDialogTitle"))},[e,n,a]),e?l.jsx(Xe,{children:l.jsx("div",{className:jo.backdrop,role:"presentation",onMouseDown:o,children:l.jsxs("div",{ref:c,className:jo.dialog,role:"dialog","aria-modal":"true","aria-labelledby":s,onMouseDown:g=>g.stopPropagation(),children:[l.jsxs("div",{className:jo.headerRow,children:[l.jsx("h2",{className:jo.header,id:s,children:a("previewDialogTitle")}),l.jsx("button",{type:"button",className:jo.close,"aria-label":a("previewDialogCloseAria"),onClick:o,children:l.jsx(sn,{})})]}),l.jsx("div",{className:jo.body,children:l.jsx("iframe",{ref:m,className:jo.frame,title:a("previewDialogTitle"),sandbox:"allow-same-origin",tabIndex:-1,onLoad:()=>{var y;const g=(y=m.current)==null?void 0:y.contentDocument;g&&jm(g,n,a("previewDialogTitle"))}})}),l.jsx("div",{className:jo.actions,children:l.jsx("button",{type:"button",className:jo.action,onClick:o,children:a("previewDialogClose")})})]})})}):null}const fv="commspliant-html-editor.darkMode";function bj(e){return typeof e=="boolean"?e:null}function Hg(){try{const e=localStorage.getItem(fv);return e?bj(JSON.parse(e)):null}catch{return null}}function vj(e){try{localStorage.setItem(fv,JSON.stringify(e))}catch{}}const pv="commspliant-html-editor.toolbarPosition",xj=["top","left","right","bottom"];function hv(e){return typeof e=="string"&&xj.includes(e)?e:null}function Ug(){try{const e=localStorage.getItem(pv);return e?hv(JSON.parse(e)):null}catch{return null}}function wj(e){try{localStorage.setItem(pv,JSON.stringify(e))}catch{}}const Cj="_panel_6xdnw_1",Sj="_header_6xdnw_17",kj="_title_6xdnw_26",Pj="_close_6xdnw_32",Ej="_messages_6xdnw_48",Aj="_empty_6xdnw_57",Dj="_message_6xdnw_48",Tj="_messageHeader_6xdnw_69",jj="_author_6xdnw_77",Nj="_time_6xdnw_81",Rj="_body_6xdnw_86",Lj="_reply_6xdnw_92",Mj="_input_6xdnw_100",_j="_post_6xdnw_111",gn={panel:Cj,header:Sj,title:kj,close:Pj,messages:Ej,empty:Aj,message:Dj,messageHeader:Tj,author:jj,time:Nj,body:Rj,reply:Lj,input:Mj,post:_j};function Ij(e,n){const o=new Date(e);return Number.isNaN(o.getTime())?e:new Intl.DateTimeFormat(n,{dateStyle:"medium",timeStyle:"short"}).format(o)}function Fj({thread:e,locale:n,disabled:o,commentAuthor:a,onPost:s,onClose:c}){const m=Se(),[g,y]=f.useState(""),w=!o&&a&&g.trim().length>0,C=f.useMemo(()=>(e==null?void 0:e.messages)??[],[e==null?void 0:e.messages]);if(!e)return null;const S=()=>{const E=g.trim();!E||!w||(s(E),y(""))};return of.createPortal(l.jsxs("div",{className:gn.panel,role:"dialog","aria-label":m("commentPanelTitle"),children:[l.jsxs("div",{className:gn.header,children:[l.jsx("h2",{className:gn.title,children:m("commentPanelTitle")}),l.jsx("button",{type:"button",className:gn.close,onClick:c,"aria-label":m("commentPanelCloseAria"),children:l.jsx(sn,{})})]}),l.jsx("div",{className:gn.messages,children:C.length===0?l.jsx("p",{className:gn.empty,children:m("commentEmpty")}):C.map(E=>l.jsxs("article",{className:gn.message,children:[l.jsxs("header",{className:gn.messageHeader,children:[l.jsx("span",{className:gn.author,children:E.userName}),l.jsx("time",{className:gn.time,dateTime:E.createdAt,children:Ij(E.createdAt,n)})]}),l.jsx("p",{className:gn.body,children:E.message})]},E.id))}),l.jsxs("div",{className:gn.reply,children:[l.jsx("textarea",{className:gn.input,value:g,onChange:E=>y(E.target.value),placeholder:m("commentReplyPlaceholder"),rows:3,disabled:o||!a}),l.jsx("button",{type:"button",className:gn.post,onClick:S,disabled:!w,children:m("commentPost")})]})]}),document.body)}function Bj({enabled:e,onHtml:n}){const[o,a]=f.useState(!1),s=f.useRef(0),c=f.useRef(e),m=f.useRef(n);c.current=e,m.current=n;const g=f.useCallback(()=>{s.current=0,a(!1)},[]);f.useEffect(()=>{e||g()},[e,g]);const y=f.useCallback(E=>{!c.current||!Ju(E.dataTransfer)||(E.preventDefault(),s.current+=1,a(!0))},[]),w=f.useCallback(E=>{!c.current||!Ju(E.dataTransfer)||(E.preventDefault(),E.dataTransfer&&(E.dataTransfer.dropEffect="copy"))},[]),C=f.useCallback(E=>{if(!c.current||!Ju(E.dataTransfer))return;const k=E.relatedTarget;k instanceof Node&&E.currentTarget.contains(k)||(s.current=Math.max(0,s.current-1),s.current===0&&a(!1))},[]),S=f.useCallback(E=>{if(!c.current||!Ju(E.dataTransfer))return;E.preventDefault(),g();const k=Rw(E.dataTransfer);k&&df(k).then(A=>{c.current&&m.current(A)},()=>{})},[g]);return{dragging:o,onDragEnter:y,onDragOver:w,onDragLeave:C,onDrop:S}}const Oj={menus:{edit:{id:"edit",labelKey:"menuEdit",ariaKey:"menuEditAria"}},submenus:{page:{id:"page",labelKey:"menuPage",ariaKey:"menuPageAria"}},groups:{edit:{id:"edit",labelKey:"toolbarGroupEdit"}},items:{undo:{id:"undo",command:"undo",icon:Jx,labelKey:"commandUndo",ariaKey:"commandUndoAria",enabled:"canUndo"},redo:{id:"redo",command:"redo",icon:Gx,labelKey:"commandRedo",ariaKey:"commandRedoAria",enabled:"canRedo"},pageProperties:{id:"pageProperties",command:"openPageProperties",icon:oy,labelKey:"commandPageProperties",ariaKey:"commandPagePropertiesAria",enabled:"isVisualMode"}}},zj=400,Kg=100;function Hj(e){let n=[],o=e,a=[],s=!1,c=!1,m=0;function g(){n.length<=Kg||n.splice(0,n.length-Kg)}function y(k){n.push(k),g()}function w(k,A){if(s){o=k,s=!1;return}if(k===o)return;const P=Date.now(),T=(A==null?void 0:A.coalesce)===!0;if(T&&c&&P-m<zj){o=k,m=P;return}y(o),o=k,a=[],m=P,c=T}function C(){return n.length===0?null:(c=!1,a.push(o),o=n.pop(),o)}function S(){return a.length===0?null:(c=!1,y(o),o=a.pop(),o)}function E(k){if(s){o=k,s=!1;return}k!==o&&(y(o),o=k,a=[],c=!1)}return{record:w,undo:C,redo:S,canUndo:()=>n.length>0,canRedo:()=>a.length>0,syncExternal:E,markApplying:()=>{s=!0}}}function Di(e,n){return n?n.label?n.label:n.labelKey?e(n.labelKey):"":""}function Mc(e,n){return n?n.ariaLabel?n.ariaLabel:n.ariaKey?e(n.ariaKey):Di(e,n):""}const Jr="fullscreen",Xm="commspliant-html-editor.toolbarCustomization";function Qm(e){const n=e.filter(o=>o!==Jr);return e.includes(Jr)?[...n,Jr]:n}function Gf(e,n){if(!n||n.length===0)return Qm(e);const o=new Set(e),a=n.filter(m=>o.has(m)),s=new Set(a),c=[...a];for(let m=0;m<e.length;m++){const g=e[m];if(s.has(g))continue;let y=0;for(let w=m-1;w>=0;w--){const C=e[w],S=c.indexOf(C);if(S>=0){y=S+1;break}}c.splice(y,0,g),s.add(g)}return Qm(c)}function Uj(e,n){const o=new Map(e.map(m=>[m.id,m])),a=Gf(e.map(m=>m.id),n==null?void 0:n.groupOrder),s=new Set((n==null?void 0:n.hiddenItemIds)??[]),c=[];for(const m of a){const g=o.get(m);if(!g)continue;const y=g.items.filter(w=>!s.has(w));y.length!==0&&c.push({id:m,items:y})}return c}function Kj(e){if(e==null||typeof e!="object")return null;const n=e,o=Array.isArray(n.groupOrder)?n.groupOrder.filter(s=>typeof s=="string"):[],a=Array.isArray(n.hiddenItemIds)?[...new Set(n.hiddenItemIds.filter(s=>typeof s=="string"))]:[];return o.length===0&&a.length===0?null:{groupOrder:o,hiddenItemIds:a}}function $j(){try{const e=localStorage.getItem(Xm);return e?Kj(JSON.parse(e)):null}catch{return null}}function Vj(e){try{if(!e){localStorage.removeItem(Xm);return}localStorage.setItem(Xm,JSON.stringify(e))}catch{}}function Yf(e,n){return Gf(n.map(o=>o.id),e==null?void 0:e.groupOrder)}function Wj(e,n,o,a){const s=new Set((e==null?void 0:e.hiddenItemIds)??[]);return a?s.delete(o):s.add(o),{groupOrder:Yf(e,n),hiddenItemIds:[...s]}}function gv(e,n,o,a){const s=Yf(e,n),c=[...(e==null?void 0:e.hiddenItemIds)??[]];if(o===Jr||a===Jr)return{groupOrder:s,hiddenItemIds:c};const m=s.indexOf(o),g=s.indexOf(a);if(m<0||g<0||m===g)return{groupOrder:s,hiddenItemIds:c};const y=[...s],[w]=y.splice(m,1);return y.splice(g,0,w),{groupOrder:Qm(y),hiddenItemIds:c}}function $g(e,n,o,a){const s=Yf(e,n),c=s.filter(y=>y!==Jr),m=c.indexOf(o),g=m+a;return m<0||g<0||g>=c.length?{groupOrder:s,hiddenItemIds:[...(e==null?void 0:e.hiddenItemIds)??[]]}:gv(e,n,o,c[g])}const Gj="_backdrop_1dasl_1",Yj="_dialog_1dasl_12",qj="_header_1dasl_28",Xj="_body_1dasl_35",Qj="_group_1dasl_43",Jj="_groupDragging_1dasl_49",Zj="_groupDropTarget_1dasl_53",eN="_groupHeader_1dasl_58",tN="_groupTitle_1dasl_66",nN="_dragHandle_1dasl_71",rN="_moveButton_1dasl_72",oN="_items_1dasl_113",iN="_item_1dasl_113",aN="_itemIcon_1dasl_129",lN="_itemTitle_1dasl_138",sN="_itemCheckbox_1dasl_145",uN="_actions_1dasl_149",cN="_action_1dasl_149",dN="_spinnerWrap_1dasl_184",mN="_spinner_1dasl_184",mt={backdrop:Gj,dialog:Yj,header:qj,body:Xj,group:Qj,groupDragging:Jj,groupDropTarget:Zj,groupHeader:eN,groupTitle:tN,dragHandle:nN,moveButton:rN,items:oN,item:iN,itemIcon:aN,itemTitle:lN,itemCheckbox:sN,actions:uN,action:cN,spinnerWrap:dN,spinner:mN},Vg='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])';function fN(){return l.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",fill:"currentColor",children:[l.jsx("circle",{cx:"5",cy:"4",r:"1.2"}),l.jsx("circle",{cx:"11",cy:"4",r:"1.2"}),l.jsx("circle",{cx:"5",cy:"8",r:"1.2"}),l.jsx("circle",{cx:"11",cy:"8",r:"1.2"}),l.jsx("circle",{cx:"5",cy:"12",r:"1.2"}),l.jsx("circle",{cx:"11",cy:"12",r:"1.2"})]})}function pN({open:e,catalog:n,groups:o,settings:a,loading:s=!1,busy:c=!1,disabled:m,onChange:g,onReset:y,onClose:w}){const C=Se(),S=f.useId(),E=f.useRef(null),[k,A]=f.useState(null),[P,T]=f.useState(null),j=Gf(o.map(K=>K.id),a==null?void 0:a.groupOrder),F=new Set((a==null?void 0:a.hiddenItemIds)??[]),L=new Map(o.map(K=>[K.id,K])),H=j.map(K=>L.get(K)).filter(K=>!!K),z=m||c||s;if(f.useEffect(()=>{e||(A(null),T(null))},[e]),f.useEffect(()=>{if(!e)return;const K=E.current,X=K==null?void 0:K.querySelector(Vg);X==null||X.focus();const de=ce=>{if(ce.key==="Escape"){ce.preventDefault(),ce.stopPropagation(),w();return}if(ce.key!=="Tab"||!K)return;const Pe=[...K.querySelectorAll(Vg)];if(Pe.length===0)return;const ke=Pe[0],je=Pe[Pe.length-1];ce.shiftKey&&document.activeElement===ke?(ce.preventDefault(),je.focus()):!ce.shiftKey&&document.activeElement===je&&(ce.preventDefault(),ke.focus())};return document.addEventListener("keydown",de,!0),()=>document.removeEventListener("keydown",de,!0)},[e,w]),!e)return null;const q=H.map(K=>K.id).filter(K=>K!==Jr),G=(K,X)=>{if(z||X===Jr){K.preventDefault();return}K.dataTransfer.setData("text/plain",X),K.dataTransfer.effectAllowed="move",A(X)},Q=(K,X)=>{z||X===Jr||!k||k===X||(K.preventDefault(),K.dataTransfer&&(K.dataTransfer.dropEffect="move"),T(X))},$=(K,X)=>{var ce;K.preventDefault();const de=((ce=K.dataTransfer)==null?void 0:ce.getData("text/plain"))||k;A(null),T(null),!(!de||de===X||z)&&g(gv(a,o,de,X))},V=()=>{A(null),T(null)};return l.jsx(Xe,{children:l.jsx("div",{className:mt.backdrop,role:"presentation",onMouseDown:w,children:l.jsxs("div",{ref:E,className:mt.dialog,role:"dialog","aria-modal":"true","aria-labelledby":S,"aria-busy":s||c?!0:void 0,onMouseDown:K=>K.stopPropagation(),children:[l.jsx("h2",{className:mt.header,id:S,children:C("customizeToolbarDialogTitle")}),l.jsx("div",{className:mt.body,children:s?l.jsx("div",{className:mt.spinnerWrap,role:"status","aria-live":"polite","aria-label":C("customizeToolbarDialogLoading"),children:l.jsx("span",{className:mt.spinner,"aria-hidden":"true"})}):H.map(K=>{const X=n.groups[K.id],de=X?Di(C,X):K.id,ce=K.id===Jr,Pe=q.indexOf(K.id);return l.jsxs("section",{className:[mt.group,k===K.id?mt.groupDragging:"",P===K.id?mt.groupDropTarget:""].filter(Boolean).join(" "),"data-toolbar-customize-group":K.id,"aria-label":de,onDragOver:ke=>Q(ke,K.id),onDrop:ke=>$(ke,K.id),onDragLeave:()=>{P===K.id&&T(null)},children:[l.jsxs("div",{className:mt.groupHeader,children:[l.jsx("button",{type:"button",className:mt.dragHandle,draggable:!z&&!ce,disabled:z||ce,"aria-label":C("customizeToolbarDragHandle"),onDragStart:ke=>G(ke,K.id),onDragEnd:V,children:l.jsx(fN,{})}),l.jsx("span",{className:mt.groupTitle,children:de}),l.jsx("button",{type:"button",className:mt.moveButton,disabled:z||ce||Pe<=0,"aria-label":C("customizeToolbarMoveUp"),onClick:()=>g($g(a,o,K.id,-1)),children:"↑"}),l.jsx("button",{type:"button",className:mt.moveButton,disabled:z||ce||Pe<0||Pe>=q.length-1,"aria-label":C("customizeToolbarMoveDown"),onClick:()=>g($g(a,o,K.id,1)),children:"↓"})]}),l.jsx("div",{className:mt.items,children:K.items.map(ke=>{const je=n.items[ke];if(!je)return null;const Y=je.icon,pe=Di(C,je),J=`${S}-${K.id}-${ke}`,M=!F.has(ke);return l.jsxs("label",{className:mt.item,htmlFor:J,children:[l.jsx("span",{className:mt.itemIcon,"aria-hidden":"true",children:Y?l.jsx(Y,{}):pe.slice(0,2)}),l.jsx("span",{className:mt.itemTitle,children:pe}),l.jsx("input",{id:J,className:mt.itemCheckbox,type:"checkbox",checked:M,disabled:z,"aria-label":`${pe}: ${C("customizeToolbarItemVisible")}`,onChange:N=>g(Wj(a,o,ke,N.target.checked))})]},ke)})})]},K.id)})}),l.jsxs("div",{className:mt.actions,children:[l.jsx("button",{type:"button",className:mt.action,disabled:z,onClick:y,children:C("customizeToolbarDialogReset")}),l.jsx("button",{type:"button",className:mt.action,"aria-label":C("customizeToolbarDialogCloseAria"),onClick:w,children:C("customizeToolbarDialogClose")})]})]})})})}function hN(e,n){if(!n)return e;const o=n.menus,a=n.toolbar;if(o===void 0&&a===void 0)return e;const s=o===void 0?e.menus:e.menus.filter(m=>o.includes(m.id)),c=a===void 0?e.iconGroups:e.iconGroups.map(m=>({id:m.id,items:m.items.filter(g=>a.includes(g))})).filter(m=>m.items.length>0);return{menus:s,iconGroups:c}}const gN={menus:{file:{id:"file",labelKey:"menuFile",ariaKey:"menuFileAria"}},groups:{file:{id:"file",labelKey:"toolbarGroupFile"},print:{id:"print",labelKey:"toolbarGroupPrint"}},items:{save:{id:"save",command:"save",icon:qx,labelKey:"commandSave",ariaKey:"commandSaveAria"},open:{id:"open",command:"open",icon:Ox,labelKey:"commandOpen",ariaKey:"commandOpenAria"},print:{id:"print",command:"print",icon:Vx,labelKey:"commandPrint",ariaKey:"commandPrintAria"}}},dc=4;function yv({icon:e,value:n,mixed:o,noneKey:a,labelKey:s,ariaKey:c,fallbackCustom:m,disabled:g,onChange:y}){const w=Se(),C=f.useId(),S=f.useRef(null),E=f.useRef(null),k=f.useRef(null),[A,P]=f.useState(!1),[T,j]=f.useState({top:0,left:0}),F=f.useCallback(()=>{const G=E.current,Q=k.current;if(!G)return;const $=G.getBoundingClientRect(),V=(Q==null?void 0:Q.offsetHeight)??0,K=(Q==null?void 0:Q.offsetWidth)??200;let X=$.bottom;X+V>window.innerHeight-dc&&(X=Math.max(dc,$.top-V));const de=Math.min(Math.max($.left,dc),window.innerWidth-K-dc);j({top:X,left:de})},[]);f.useLayoutEffect(()=>{if(!A)return;F();const G=()=>F();return window.addEventListener("scroll",G,!0),window.addEventListener("resize",G),()=>{window.removeEventListener("scroll",G,!0),window.removeEventListener("resize",G)}},[A,F]),f.useEffect(()=>{if(!A)return;const G=$=>{var K,X;const V=$.target;(K=S.current)!=null&&K.contains(V)||(X=k.current)!=null&&X.contains(V)||P(!1)},Q=$=>{var V;$.key==="Escape"&&($.preventDefault(),$.stopPropagation(),P(!1),(V=E.current)==null||V.focus())};return document.addEventListener("pointerdown",G),document.addEventListener("keydown",Q,!0),()=>{document.removeEventListener("pointerdown",G),document.removeEventListener("keydown",Q,!0)}},[A]);const L=G=>{y(G)},H=`${fa.bar}${!n||o?` ${fa.barEmpty}`:""}`,z=n&&!o?{backgroundColor:n}:void 0,q=l.jsxs("div",{className:fa.wrap,ref:S,children:[l.jsxs("button",{ref:E,type:"button",className:`${Ne.iconButton} ${fa.button}`,"aria-label":w(c),"aria-expanded":A,"aria-haspopup":"listbox","aria-controls":A?C:void 0,disabled:g,onMouseDown:G=>G.preventDefault(),onClick:()=>P(G=>!G),children:[l.jsx(e,{className:`${Ne.icon} ${fa.icon}`}),l.jsx("span",{className:H,style:z})]}),A?l.jsx(Xe,{children:l.jsx("div",{ref:k,id:C,className:fa.popover,style:{top:T.top,left:T.left},children:l.jsx(Kf,{value:n,mixed:o,noneLabel:w(a),ariaLabel:w(c),disabled:g,fallbackCustom:m,onChange:L,onCommit:()=>P(!1)})})}):null]});return l.jsx(Ai,{label:w(s),children:q})}function yN({commands:e,queries:n,disabled:o}){return l.jsx(yv,{icon:ey,value:n.getFontColor(),mixed:n.isFontColorMixed(),noneKey:"colorAutomatic",labelKey:"commandFontColor",ariaKey:"commandFontColorAria",disabled:!!(o||!n.isVisualMode()),onChange:a=>e.setFontColor(a)})}function bN({commands:e,queries:n,disabled:o}){const a=Se(),s=!!(o||!n.isVisualMode());return l.jsx(sv,{size:n.getFontSize(),unit:n.getFontSizeUnit(),disabled:s,tooltip:a("commandFontSize"),toolbar:!0,onSizeChange:(c,m)=>{e.setFontSize(c,m)},onUnitChange:c=>{e.setFontSizeUnit(c)}})}function vN({commands:e,queries:n,disabled:o}){return l.jsx(yv,{icon:ty,value:n.getHighlightColor(),mixed:n.isHighlightColorMixed(),noneKey:"colorNone",labelKey:"commandHighlightColor",ariaKey:"commandHighlightColorAria",fallbackCustom:"#ffff00",disabled:!!(o||!n.isVisualMode()),onChange:a=>e.setHighlightColor(a)})}function xN({commands:e,queries:n,disabled:o,onMenuClose:a}){const s=Se(),c=!!(o||!n.isVisualMode());return l.jsx(Kf,{value:n.getHighlightColor(),mixed:n.isHighlightColorMixed(),noneLabel:s("colorNone"),ariaLabel:s("commandHighlightColorAria"),disabled:c,menu:!0,fallbackCustom:"#ffff00",onChange:m=>e.setHighlightColor(m),onCommit:()=>a==null?void 0:a()})}const wN="_wrap_2cawp_1",CN="_wrapToolbar_2cawp_7",SN="_field_2cawp_12",kN="_trigger_2cawp_20",PN="_chevron_2cawp_46",EN="_list_2cawp_69",AN="_option_2cawp_84",DN="_separator_2cawp_113",Ro={wrap:wN,wrapToolbar:CN,field:SN,trigger:kN,chevron:PN,list:EN,option:AN,separator:DN},Jm={p:"styleParagraph",h1:"styleHeading1",h2:"styleHeading2",h3:"styleHeading3",h4:"styleHeading4",h5:"styleHeading5",h6:"styleHeading6"},TN={p:{fontSize:"1rem",fontWeight:"400"},h1:{fontSize:"1.75rem",fontWeight:"600"},h2:{fontSize:"1.5rem",fontWeight:"600"},h3:{fontSize:"1.25rem",fontWeight:"600"},h4:{fontSize:"1.125rem",fontWeight:"600"},h5:{fontSize:"1rem",fontWeight:"600"},h6:{fontSize:"0.875rem",fontWeight:"600"}};function Wg(){const e=Se();return l.jsx("div",{className:b.spinnerWrap,role:"status","aria-live":"polite","aria-label":e("customStyleLoading"),children:l.jsx("span",{className:b.spinner,"aria-hidden":"true"})})}function bv({value:e,mixed:n=!1,disabled:o,menu:a=!1,listId:s,listRef:c,style:m,customStylesEnabled:g=!1,customStyles:y=[],customStylesLoading:w=!1,onSelect:C,onSelectCustom:S,onAddNew:E}){const k=Se(),A=n?null:e,P=g,T=!!(a&&g&&E);return a?l.jsxs(l.Fragment,{children:[Dc.map(j=>l.jsx("button",{type:"button",className:Ne.menuItem,role:"menuitemradio","aria-checked":A===j,disabled:o,onMouseDown:F=>F.preventDefault(),onClick:()=>C(j),children:k(Jm[j])},j)),P?l.jsx("div",{role:"separator",className:Ne.menuSeparator}):null,P&&w?l.jsx(Wg,{}):null,P&&!w?y.map(j=>l.jsx("button",{type:"button",className:Ne.menuItem,role:"menuitem",disabled:o,onMouseDown:F=>F.preventDefault(),onClick:()=>S==null?void 0:S(j.id),children:j.name},j.id)):null,T?l.jsxs(l.Fragment,{children:[P&&(w||y.length>0)?l.jsx("div",{role:"separator",className:Ne.menuSeparator}):null,l.jsxs("button",{type:"button",className:Ne.menuItem,role:"menuitem","aria-label":k("styleAddNewAria"),disabled:o,onMouseDown:j=>j.preventDefault(),onClick:()=>E==null?void 0:E(),children:[l.jsx($x,{className:Ne.icon}),k("styleAddNew")]})]}):null]}):l.jsxs("ul",{ref:c,className:Ro.list,role:"listbox",id:s,style:m,"aria-label":k("commandParagraphStyleAria"),"aria-busy":P&&w?!0:void 0,children:[Dc.map(j=>l.jsx("li",{role:"presentation",children:l.jsx("button",{type:"button",className:Ro.option,role:"option","aria-selected":A===j,disabled:o,style:TN[j],onMouseDown:F=>F.preventDefault(),onClick:()=>C(j),children:k(Jm[j])})},j)),P&&(w||y.length>0)?l.jsx("li",{role:"separator",className:Ro.separator}):null,P&&w?l.jsx("li",{role:"presentation",children:l.jsx(Wg,{})}):null,P&&!w?y.map(j=>l.jsx("li",{role:"presentation",children:l.jsx("button",{type:"button",className:Ro.option,role:"option","aria-selected":!1,disabled:o,onMouseDown:F=>F.preventDefault(),onClick:()=>S==null?void 0:S(j.id),children:j.name})},j.id)):null]})}const mc=4;function jN({commands:e,queries:n,disabled:o}){const a=Se(),s=f.useId(),c=f.useRef(null),m=f.useRef(null),g=f.useRef(null),[y,w]=f.useState(!1),[C,S]=f.useState({top:0,left:0,width:0}),E=!!(o||!n.isVisualMode()),k=n.isParagraphStyleMixed(),A=k?null:n.getParagraphStyle(),P=A?a(Jm[A]):"",T=n.customParagraphStylesEnabled(),j=T?n.getCustomParagraphStyles():[],F=T&&n.isCustomParagraphStylesLoading(),L=f.useCallback(()=>{const z=m.current,q=g.current;if(!z)return;const G=z.getBoundingClientRect(),Q=(q==null?void 0:q.offsetHeight)??0,$=Math.max(G.width,(q==null?void 0:q.offsetWidth)??0);let V=G.bottom;V+Q>window.innerHeight-mc&&(V=Math.max(mc,G.top-Q));const K=Math.min(Math.max(G.left,mc),window.innerWidth-$-mc);S({top:V,left:K,width:$})},[]);f.useLayoutEffect(()=>{if(!y)return;L();const z=()=>L();return window.addEventListener("scroll",z,!0),window.addEventListener("resize",z),()=>{window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[y,L,j.length,F]),f.useEffect(()=>{if(!y)return;const z=G=>{var $,V;const Q=G.target;($=c.current)!=null&&$.contains(Q)||(V=g.current)!=null&&V.contains(Q)||w(!1)},q=G=>{G.key==="Escape"&&(G.preventDefault(),G.stopPropagation(),w(!1))};return document.addEventListener("pointerdown",z),document.addEventListener("keydown",q,!0),()=>{document.removeEventListener("pointerdown",z),document.removeEventListener("keydown",q,!0)}},[y]);const H=l.jsxs("div",{className:`${Ro.wrap} ${Ro.wrapToolbar}`,ref:c,children:[l.jsxs("div",{className:Ro.field,ref:m,children:[l.jsx("button",{type:"button",className:Ro.trigger,disabled:E,"aria-label":a("commandParagraphStyleAria"),"aria-haspopup":"listbox","aria-expanded":y,"aria-controls":y?s:void 0,onMouseDown:z=>z.preventDefault(),onClick:()=>w(z=>!z),children:P}),l.jsx("span",{className:Ro.chevron,"aria-hidden":"true"})]}),y?l.jsx(Xe,{children:l.jsx(bv,{listRef:g,listId:s,value:A,mixed:k,disabled:E,customStylesEnabled:T,customStyles:j,customStylesLoading:F,style:{top:C.top,left:C.left,minWidth:C.width},onSelect:z=>{e.setParagraphStyle(z),w(!1)},onSelectCustom:z=>{e.applyCustomParagraphStyle(z),w(!1)}})}):null]});return l.jsx(Ai,{label:a("commandParagraphStyle"),children:H})}function NN({commands:e,queries:n,disabled:o,onMenuClose:a}){const s=!!(o||!n.isVisualMode()),c=n.isParagraphStyleMixed(),m=c?null:n.getParagraphStyle(),g=n.customParagraphStylesEnabled(),y=g?n.getCustomParagraphStyles():[],w=g&&n.isCustomParagraphStylesLoading();return l.jsx(bv,{menu:!0,value:m,mixed:c,disabled:s,customStylesEnabled:g,customStyles:y,customStylesLoading:w,onSelect:C=>{e.setParagraphStyle(C),a==null||a()},onSelectCustom:C=>{e.openCustomParagraphStyleDialog(C),a==null||a()},onAddNew:()=>{e.openCustomParagraphStyleDialog(),a==null||a()}})}const RN={menus:{format:{id:"format",labelKey:"menuFormat",ariaKey:"menuFormatAria"}},submenus:{paragraphStyles:{id:"paragraphStyles",labelKey:"menuParagraphStyles",ariaKey:"menuParagraphStylesAria",panel:NN,enabled:"isVisualMode"},font:{id:"font",labelKey:"menuFont",ariaKey:"menuFontAria"},highlightColor:{id:"highlightColor",labelKey:"commandHighlightColor",ariaKey:"commandHighlightColorAria",panel:xN,enabled:"isVisualMode"},paragraph:{id:"paragraph",labelKey:"menuParagraph",ariaKey:"menuParagraphAria"}},groups:{font:{id:"font",labelKey:"toolbarGroupFont"},align:{id:"align",labelKey:"toolbarGroupAlign"},paragraph:{id:"paragraph",labelKey:"toolbarGroupParagraph"}},items:{fontFamily:{id:"fontFamily",widget:EA,icon:Ex,labelKey:"commandFontFamily",ariaKey:"commandFontFamilyAria",enabled:"isVisualMode"},paragraphStyle:{id:"paragraphStyle",widget:jN,icon:Kx,labelKey:"commandParagraphStyle",ariaKey:"commandParagraphStyleAria",enabled:"isVisualMode"},fontSize:{id:"fontSize",widget:bN,icon:Dx,labelKey:"commandFontSize",ariaKey:"commandFontSizeAria",enabled:"isVisualMode"},fontProperties:{id:"fontProperties",command:"openFontProperties",icon:Ax,labelKey:"commandFontProperties",ariaKey:"commandFontPropertiesAria",enabled:"isVisualMode"},customCss:{id:"customCss",command:"openCustomCss",icon:Sx,labelKey:"commandCustomCss",ariaKey:"commandCustomCssAria",enabled:"isVisualMode"},paragraphProperties:{id:"paragraphProperties",command:"openParagraphProperties",icon:Hx,labelKey:"commandParagraphProperties",ariaKey:"commandParagraphPropertiesAria",enabled:"isVisualMode"},imageProperties:{id:"imageProperties",command:"openImageProperties",icon:ny,labelKey:"menuImage",ariaKey:"menuImageAria",enabled:"isImageSelected"},fontColor:{id:"fontColor",widget:yN,icon:ey,labelKey:"commandFontColor",ariaKey:"commandFontColorAria",enabled:"isVisualMode"},highlightColor:{id:"highlightColor",widget:vN,icon:ty,labelKey:"commandHighlightColor",ariaKey:"commandHighlightColorAria",enabled:"isVisualMode"},bold:{id:"bold",command:"toggleBold",icon:gx,labelKey:"commandBold",ariaKey:"commandBoldAria",active:"isBold",enabled:"isVisualMode",toggle:!0},italic:{id:"italic",command:"toggleItalic",icon:Mx,labelKey:"commandItalic",ariaKey:"commandItalicAria",active:"isItalic",enabled:"isVisualMode",toggle:!0},underline:{id:"underline",command:"toggleUnderline",icon:Qx,labelKey:"commandUnderline",ariaKey:"commandUnderlineAria",active:"isUnderline",enabled:"isVisualMode",toggle:!0},strikethrough:{id:"strikethrough",command:"toggleStrikethrough",icon:Xx,labelKey:"commandStrikethrough",ariaKey:"commandStrikethroughAria",active:"isStrikethrough",enabled:"isVisualMode",toggle:!0},clearFormatting:{id:"clearFormatting",command:"clearFormatting",icon:vx,labelKey:"commandClearFormatting",ariaKey:"commandClearFormattingAria",enabled:"hasTextSelection"},formatBrush:{id:"formatBrush",command:"toggleFormatBrush",icon:Tx,labelKey:"commandFormatBrush",ariaKey:"commandFormatBrushAria",active:"isFormatBrushActive",enabled:"isVisualMode",toggle:!0},alignLeft:{id:"alignLeft",command:"alignLeft",icon:tf,labelKey:"commandAlignLeft",ariaKey:"commandAlignLeftAria",active:"isAlignLeft",enabled:"isVisualMode"},alignCenter:{id:"alignCenter",command:"alignCenter",icon:ef,labelKey:"commandAlignCenter",ariaKey:"commandAlignCenterAria",active:"isAlignCenter",enabled:"isVisualMode"},alignRight:{id:"alignRight",command:"alignRight",icon:nf,labelKey:"commandAlignRight",ariaKey:"commandAlignRightAria",active:"isAlignRight",enabled:"isVisualMode"},alignJustify:{id:"alignJustify",command:"alignJustify",icon:Jg,labelKey:"commandAlignJustify",ariaKey:"commandAlignJustifyAria",active:"isAlignJustify",enabled:"isVisualMode"},indent:{id:"indent",command:"indent",icon:Lx,labelKey:"commandIndent",ariaKey:"commandIndentAria",enabled:"isVisualMode"},outdent:{id:"outdent",command:"outdent",icon:zx,labelKey:"commandOutdent",ariaKey:"commandOutdentAria",enabled:"canOutdent"},bulletList:{id:"bulletList",command:"toggleBulletList",icon:Zg,labelKey:"commandBulletList",ariaKey:"commandBulletListAria",active:"isBulletList",enabled:"isVisualMode",toggle:!0},numberedList:{id:"numberedList",command:"toggleNumberedList",icon:ry,labelKey:"commandNumberedList",ariaKey:"commandNumberedListAria",active:"isNumberedList",enabled:"isVisualMode",toggle:!0}}},LN={menus:{insert:{id:"insert",labelKey:"menuInsert",ariaKey:"menuInsertAria"}},groups:{insert:{id:"insert",labelKey:"toolbarGroupInsert"}},items:{link:{id:"link",command:"openLinkDialog",icon:Ix,labelKey:"commandLink",ariaKey:"commandLinkAria",enabled:"isVisualMode",active:"isLink",toggle:!0},bookmark:{id:"bookmark",command:"openBookmarkDialog",icon:yx,labelKey:"commandBookmark",ariaKey:"commandBookmarkAria",enabled:"isVisualMode"},image:{id:"image",command:"openImageDialog",icon:ny,labelKey:"commandImage",ariaKey:"commandImageAria",enabled:"isVisualMode"},audio:{id:"audio",command:"openAudioDialog",icon:hx,labelKey:"commandAudio",ariaKey:"commandAudioAria",enabled:"isVisualMode"},youtube:{id:"youtube",command:"openYoutubeDialog",icon:tw,labelKey:"commandYoutube",ariaKey:"commandYoutubeAria",enabled:"isVisualMode"},horizontalRule:{id:"horizontalRule",command:"insertHorizontalRule",icon:Nx,labelKey:"commandHorizontalRule",ariaKey:"commandHorizontalRuleAria",enabled:"isVisualMode"},insertPage:{id:"insertPage",command:"insertPage",icon:oy,labelKey:"commandInsertPage",ariaKey:"commandInsertPageAria",enabled:"canInsertPage"}}},MN={menus:{table:{id:"table",labelKey:"menuTable",ariaKey:"menuTableAria"}},submenus:{insertRow:{id:"insertRow",labelKey:"menuInsertRow",ariaKey:"menuInsertRowAria",enabled:"isInTable"},insertColumn:{id:"insertColumn",labelKey:"menuInsertColumn",ariaKey:"menuInsertColumnAria",enabled:"isInTable"}},groups:{table:{id:"table",labelKey:"toolbarGroupTable"}},items:{table:{id:"table",command:"openTableDialog",icon:Ih,labelKey:"commandTable",ariaKey:"commandTableAria",enabled:"isVisualMode"},insertRowBelow:{id:"insertRowBelow",command:"insertRowBelow",icon:am,labelKey:"commandInsertRowBelow",ariaKey:"commandInsertRowBelowAria",enabled:"isInTable"},insertRowBefore:{id:"insertRowBefore",command:"insertRowBefore",icon:am,labelKey:"commandInsertRowBefore",ariaKey:"commandInsertRowBeforeAria",enabled:"isInTable"},deleteRow:{id:"deleteRow",command:"deleteRow",icon:am,labelKey:"commandDeleteRow",ariaKey:"commandDeleteRowAria",enabled:"isInTable"},insertColumnAfter:{id:"insertColumnAfter",command:"insertColumnAfter",icon:im,labelKey:"commandInsertColumnAfter",ariaKey:"commandInsertColumnAfterAria",enabled:"isInTable"},insertColumnBefore:{id:"insertColumnBefore",command:"insertColumnBefore",icon:im,labelKey:"commandInsertColumnBefore",ariaKey:"commandInsertColumnBeforeAria",enabled:"isInTable"},deleteColumn:{id:"deleteColumn",command:"deleteColumn",icon:im,labelKey:"commandDeleteColumn",ariaKey:"commandDeleteColumnAria",enabled:"isInTable"},mergeCells:{id:"mergeCells",command:"mergeCells",icon:Bx,labelKey:"commandMergeCells",ariaKey:"commandMergeCellsAria",enabled:"canMergeCells"},unmergeCells:{id:"unmergeCells",command:"unmergeCells",icon:Zx,labelKey:"commandUnmergeCells",ariaKey:"commandUnmergeCellsAria",enabled:"canUnmergeCells"},tableProperties:{id:"tableProperties",command:"openTableProperties",icon:Ih,labelKey:"commandTableProperties",ariaKey:"commandTablePropertiesAria",enabled:"isInTable"},cellProperties:{id:"cellProperties",command:"openCellProperties",icon:bx,labelKey:"commandCellProperties",ariaKey:"commandCellPropertiesAria",enabled:"isInTable"},rowProperties:{id:"rowProperties",command:"openRowProperties",icon:Yx,labelKey:"commandRowProperties",ariaKey:"commandRowPropertiesAria",enabled:"isInTable"}}},_N={menus:{view:{id:"view",labelKey:"menuView",ariaKey:"menuViewAria"}},submenus:{toolbar:{id:"toolbar",labelKey:"menuToolbar",ariaKey:"menuToolbarAria"},toolbarPosition:{id:"toolbarPosition",labelKey:"menuToolbarPosition",ariaKey:"menuToolbarPositionAria"}},groups:{view:{id:"view",labelKey:"toolbarGroupView"},fullscreen:{id:"fullscreen",labelKey:"toolbarGroupFullscreen"}},items:{visual:{id:"visual",command:"setVisualMode",icon:ew,labelKey:"modeVisual",ariaKey:"modeVisualAria",active:"isVisualMode"},html:{id:"html",command:"setHtmlMode",icon:Rx,labelKey:"modeHtml",ariaKey:"modeHtmlAria",active:"isHtmlMode"},customizeToolbar:{id:"customizeToolbar",command:"openCustomizeToolbar",icon:kx,labelKey:"commandCustomizeToolbar",ariaKey:"commandCustomizeToolbarAria"},toolbarPositionTop:{id:"toolbarPositionTop",command:"setToolbarPositionTop",labelKey:"toolbarPositionTop",ariaKey:"toolbarPositionTopAria",active:"isToolbarPositionTop"},toolbarPositionLeft:{id:"toolbarPositionLeft",command:"setToolbarPositionLeft",labelKey:"toolbarPositionLeft",ariaKey:"toolbarPositionLeftAria",active:"isToolbarPositionLeft"},toolbarPositionRight:{id:"toolbarPositionRight",command:"setToolbarPositionRight",labelKey:"toolbarPositionRight",ariaKey:"toolbarPositionRightAria",active:"isToolbarPositionRight"},toolbarPositionBottom:{id:"toolbarPositionBottom",command:"setToolbarPositionBottom",labelKey:"toolbarPositionBottom",ariaKey:"toolbarPositionBottomAria",active:"isToolbarPositionBottom"},lightMode:{id:"lightMode",command:"setLightMode",icon:_x,labelKey:"modeLight",ariaKey:"modeLightAria",active:"isLightMode"},darkMode:{id:"darkMode",command:"setDarkMode",icon:Px,labelKey:"modeDark",ariaKey:"modeDarkAria",active:"isDarkMode"},preview:{id:"preview",command:"openDocumentPreview",icon:Ux,labelKey:"commandPreview",ariaKey:"commandPreviewAria"},readAloud:{id:"readAloud",command:"toggleReadAloud",icon:Wx,labelKey:"commandReadAloud",ariaKey:"commandReadAloudAria",active:"isReadingAloud",toggle:!0,enabled:"canReadAloud"},fullscreen:{id:"fullscreen",command:"toggleFullscreen",icon:jx,labelKey:"modeFullscreen",ariaKey:"modeFullscreenAria",active:"isFullscreen",toggle:!0}}};function IN(...e){return{menus:Object.assign({},...e.map(n=>n.menus)),submenus:Object.assign({},...e.map(n=>n.submenus??{})),groups:Object.assign({},...e.map(n=>n.groups)),items:Object.assign({},...e.map(n=>n.items))}}const FN=IN(gN,Oj,LN,MN,_N,RN),BN={menus:[{id:"file",items:["save","open",ht,"print"]},{id:"edit",items:["undo","redo",ht,{submenu:"page",items:["pageProperties"]}]},{id:"insert",items:["link","bookmark",ht,"image","audio","youtube","table","horizontalRule","insertComment","insertPage"]},{id:"table",items:["table",ht,{submenu:"insertRow",items:["insertRowBelow","insertRowBefore","deleteRow"]},{submenu:"insertColumn",items:["insertColumnAfter","insertColumnBefore","deleteColumn"]},ht,"mergeCells","unmergeCells",ht,"tableProperties","cellProperties","rowProperties"]},{id:"view",items:["visual","html",ht,{submenu:"toolbar",items:["customizeToolbar",ht,{submenu:"toolbarPosition",items:["toolbarPositionTop","toolbarPositionLeft","toolbarPositionRight","toolbarPositionBottom"]}]},ht,"lightMode","darkMode",ht,"toggleCommentsVisible","preview","readAloud","fullscreen"]},{id:"format",items:[{submenu:"paragraphStyles",items:[]},ht,{submenu:"font",items:["fontProperties","customCss",ht,{submenu:"highlightColor",items:[]},ht,"bold","italic","underline","strikethrough"]},ht,"clearFormatting",ht,{submenu:"paragraph",items:["paragraphProperties",ht,"alignLeft","alignCenter","alignRight","alignJustify",ht,"indent","outdent",ht,"bulletList","numberedList"]},ht,"imageProperties"]}],iconGroups:[{id:"file",items:["save","open"]},{id:"print",items:["print"]},{id:"edit",items:["undo","redo"]},{id:"insert",items:["link","bookmark","image","table","horizontalRule","addComment"]},{id:"table",items:["mergeCells","unmergeCells"]},{id:"font",items:["fontFamily","paragraphStyle","fontSize","fontColor","highlightColor","customCss","formatBrush","bold","italic","underline","strikethrough","clearFormatting"]},{id:"align",items:["alignLeft","alignCenter","alignRight","alignJustify"]},{id:"paragraph",items:["indent","outdent","bulletList","numberedList"]},{id:"view",items:["visual","html","preview","readAloud","toggleCommentsVisible"]},{id:"fullscreen",items:["fullscreen"]}]},Gg={items:{addComment:{id:"addComment",command:"addComment",icon:_h,labelKey:"commandAddComment",ariaKey:"commandAddCommentAria",enabled:"canAddComment"},insertComment:{id:"insertComment",command:"addComment",icon:_h,labelKey:"commandInsertComment",ariaKey:"commandInsertCommentAria",enabled:"canAddComment"},toggleCommentsVisible:{id:"toggleCommentsVisible",command:"toggleCommentsVisible",icon:xx,labelKey:"showComments",ariaKey:"toggleCommentsVisibleAria",toggle:!0,active:"areCommentsVisible"}}},ON=["addComment","insertComment","toggleCommentsVisible"],zN=new Set(["insert","view"]);function vv(e,n){return n.disabled?!0:n.readOnly?n.enableComments?!ON.includes(e):!0:!1}function HN(e,n){return n.disabled?!0:n.readOnly?n.enableComments?!zN.has(e):!0:!1}function UN(e,n){const o=n?"hideComments":"showComments",a=Gg.items.toggleCommentsVisible;return{...e,items:{...e.items,...Gg.items,toggleCommentsVisible:a&&{...a,labelKey:o}}}}function KN(e){return{...e,menus:e.menus.map(n=>{if(n.id==="insert"){const o=[...n.items],a=o.indexOf("insertPage"),s=a===-1?o.length:a;return o.includes("insertComment")||o.splice(s,0,"insertComment"),{...n,items:o}}if(n.id==="view"){const o=[...n.items],a=o.indexOf("preview"),s=a===-1?o.length:a;return o.includes("toggleCommentsVisible")||o.splice(s,0,"toggleCommentsVisible"),{...n,items:o}}return n}),iconGroups:e.iconGroups.map(n=>n.id==="insert"&&!n.items.includes("addComment")?{...n,items:[...n.items,"addComment"]}:n.id==="view"&&!n.items.includes("toggleCommentsVisible")?{...n,items:[...n.items,"toggleCommentsVisible"]}:n)}}const fc="fullscreen";function $N(e){const n=[];let o=null;for(const a of e){const s=a.items.filter(c=>c!==fc);s.length>0&&n.push({id:a.id,items:s}),a.items.includes(fc)&&(o={id:fc,items:[fc]})}return{main:n,trailing:o}}function VN({groups:e,catalog:n,commands:o,queries:a,disabled:s,chromeLock:c}){const m=Se(),{main:g,trailing:y}=$N(e),w=C=>{const S=n.groups[C.id];return l.jsx("div",{className:Ne.iconGroup,role:"group","aria-label":S?Di(m,S):void 0,"data-toolbar-group":C.id,children:C.items.map(E=>{const k=n.items[E];if(!k)return null;const A=k.enabled?!a[k.enabled]():!1;if(k.widget){const F=k.widget;return l.jsx(F,{commands:o,queries:a,disabled:s||A},E)}if(!k.icon||!k.command)return null;const P=k.icon,T=k.command,j=k.active?a[k.active]():void 0;return l.jsx(Ai,{label:k.tooltip??Di(m,k),children:l.jsx("button",{type:"button",className:Ne.iconButton,"aria-label":Mc(m,k),"aria-pressed":j,disabled:s||(c?vv(E,c):!1)||A,onPointerDown:F=>F.preventDefault(),onMouseDown:F=>F.preventDefault(),onClick:()=>{af(o,T)},children:l.jsx(P,{className:Ne.icon})})},E)})},C.id)};return l.jsxs("div",{className:Ne.iconNav,role:"toolbar","aria-label":m("toolbarAria"),children:[g.length>0?l.jsx("div",{className:Ne.iconNavMain,children:g.map(w)}):null,y?l.jsx("div",{className:Ne.iconNavEnd,children:w(y)}):null]})}const WN=["--wysiwyg-menu-color","--wysiwyg-menu-background","--wysiwyg-menu-font-size","--wysiwyg-menu-font-family"];function GN(e){const n={};for(const o of WN){const a=getComputedStyle(e).getPropertyValue(o).trim();if(a){n[o]=a;continue}let s=e;for(;s;){const c=s.style.getPropertyValue(o).trim();if(c){n[o]=c;break}s=s.parentElement}}return n}function YN({menus:e,catalog:n,commands:o,queries:a,disabled:s,chromeLock:c,compact:m,openMenuId:g,onOpenMenuIdChange:y}){const w=Se(),[C,S]=f.useState(!1),[E,k]=f.useState({}),A=f.useRef(null),P=f.useRef(null),T=f.useRef(null),j=f.useRef(null),F=f.useCallback(()=>{S(!1),y(null)},[y]);f.useLayoutEffect(()=>{!C||!A.current||k(GN(A.current))},[C]),f.useEffect(()=>{var H;C&&((H=T.current)==null||H.focus())},[C]),f.useEffect(()=>{if(!C)return;const H=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=H}},[C]),f.useEffect(()=>{if(!C)return;const H=q=>{var G;if(q.key==="Escape"){if(q.preventDefault(),q.stopPropagation(),g){y(null);return}F(),(G=P.current)==null||G.focus()}},z=q=>{var G;j.current&&!j.current.contains(q.target)&&(F(),(G=P.current)==null||G.focus())};return document.addEventListener("keydown",H,!0),document.addEventListener("pointerdown",z),()=>{document.removeEventListener("keydown",H,!0),document.removeEventListener("pointerdown",z)}},[C,g,y,F]);const L=H=>e.map(z=>{const q=n.menus[z.id];return q?l.jsx(XN,{def:q,itemIds:z.items,catalog:n,commands:o,queries:a,disabled:s,chromeLock:c,variant:H,open:(H==="overlay"||!C)&&g===z.id,onOpenChange:G=>y(G?z.id:null),onItemRun:H==="overlay"?()=>{var G;F(),(G=P.current)==null||G.focus()}:void 0},`${H}-${z.id}`):null});return l.jsxs("div",{className:Ne.menuBar,ref:A,children:[l.jsx(Ai,{label:w("brandMarkAria"),children:l.jsx("span",{className:Ne.brandMark,role:"img","aria-label":w("brandMarkAria"),children:l.jsx(wx,{className:Ne.brandMarkIcon})})}),l.jsx("div",{className:Ne.menuBarCompact,hidden:m===void 0?void 0:!m,children:l.jsx(Ai,{label:w("menuHamburgerAria"),children:l.jsx("button",{ref:P,type:"button",className:`${Ne.menuButton} ${Ne.hamburgerButton}`,"aria-haspopup":"dialog","aria-expanded":C,"aria-label":w("menuHamburgerAria"),disabled:s||(c==null?void 0:c.readOnly)&&!(c!=null&&c.enableComments),onClick:()=>{if(C){F();return}y(null),S(!0)},children:l.jsx(Fx,{className:Ne.icon})})})}),l.jsx("div",{className:Ne.menuBarDesktop,hidden:m===void 0?void 0:m,children:L("dropdown")}),C?l.jsx(Xe,{children:l.jsx("div",{className:Ne.toolbar,"data-menu-overlay-portal":"",style:E,children:l.jsxs("div",{ref:j,className:Ne.menuOverlay,role:"dialog","aria-modal":"true","aria-label":w("menuOverlayAria"),children:[l.jsxs("div",{className:Ne.menuOverlayHeader,children:[l.jsx("span",{className:Ne.menuOverlayTitle,children:w("menuOverlayAria")}),l.jsx("button",{ref:T,type:"button",className:Ne.iconButton,"aria-label":w("menuCloseAria"),onClick:()=>{var H;F(),(H=P.current)==null||H.focus()},children:l.jsx(sn,{className:Ne.icon})})]}),l.jsx("div",{className:Ne.menuOverlayBody,children:L("overlay")})]})})}):null]})}function _c(e,n){var o,a;if(ki(e))return!1;if(Vs(e)){const s=(o=n.submenus)==null?void 0:o[e.submenu];return s?s.panel?!0:e.items.some(c=>_c(c,n)):!1}return!!((a=n.items[e])!=null&&a.command)}function qN(e,n,o){if(!ki(e[n])||!e.slice(n+1).some(c=>_c(c,o)))return!1;let s=!1;for(let c=n-1;c>=0;c--){const m=e[c];if(ki(m)){s=!0;continue}if(_c(m,o))return!s}return!1}function XN({def:e,itemIds:n,catalog:o,commands:a,queries:s,disabled:c,chromeLock:m,variant:g,open:y,onOpenChange:w,onItemRun:C}){const S=Se(),E=f.useRef(null),k=g==="overlay"?`overlay-${e.id}-menu`:`${e.id}-menu`,[A,P]=f.useState(null);f.useEffect(()=>{y||P(null)},[y]),f.useEffect(()=>{if(!y||g==="overlay")return;const j=L=>{E.current&&!E.current.contains(L.target)&&w(!1)},F=L=>{if(L.key==="Escape"){if(L.preventDefault(),L.stopPropagation(),A){P(null);return}w(!1)}};return document.addEventListener("pointerdown",j),document.addEventListener("keydown",F,!0),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("keydown",F,!0)}},[y,A,w,g]);const T=()=>{w(!1),C==null||C()};return l.jsxs("div",{className:Ne.menuWrap,ref:E,children:[l.jsx("button",{type:"button",className:Ne.menuButton,"aria-haspopup":"menu","aria-expanded":y,"aria-controls":k,"aria-label":Mc(S,e),disabled:c||(m?HN(e.id,m):!1),onClick:()=>w(!y),children:Di(S,e)}),y?l.jsx("div",{className:Ne.menu,role:"menu",id:k,children:l.jsx(xv,{entries:n,catalog:o,commands:a,queries:s,disabled:c,chromeLock:m,variant:g,onClose:T,openSubmenuId:A,onOpenSubmenuIdChange:P})}):null]})}function xv({entries:e,catalog:n,commands:o,queries:a,disabled:s,chromeLock:c,variant:m,onClose:g,openSubmenuId:y,onOpenSubmenuIdChange:w}){return l.jsx(l.Fragment,{children:e.map((C,S)=>{if(ki(C))return qN(e,S,n)?l.jsx("div",{role:"separator",className:Ne.menuSeparator},`separator-${S}`):null;if(Vs(C))return l.jsx(JN,{entry:C,catalog:n,commands:o,queries:a,disabled:s,chromeLock:c,variant:m,onClose:g,open:y===C.submenu,onOpenChange:k=>w==null?void 0:w(k?C.submenu:null)},`submenu-${C.submenu}-${S}`);const E=n.items[C];return!E||!E.command?null:l.jsx(QN,{item:E,commands:o,queries:a,disabled:s,chromeLock:c,onClose:g},C)})})}function QN({item:e,commands:n,queries:o,disabled:a,chromeLock:s,onClose:c}){const m=Se();if(!e.command)return null;const g=e.icon,y=e.command,w=e.active?o[e.active]():void 0,C=e.enabled?!o[e.enabled]():!1,S=e.toggle?"menuitemcheckbox":e.active?"menuitemradio":"menuitem";return l.jsxs("button",{type:"button",role:S,className:Ne.menuItem,"aria-checked":w,disabled:a||(s?vv(e.id,s):!1)||C,onClick:()=>{c(),af(n,y)},children:[g?l.jsx(g,{className:Ne.icon}):null,Di(m,e)]})}function JN({entry:e,catalog:n,commands:o,queries:a,disabled:s,chromeLock:c,variant:m,onClose:g,open:y,onOpenChange:w}){var q;const C=Se(),S=f.useRef(null),E=f.useRef(null),[k,A]=f.useState(null),P=(q=n.submenus)==null?void 0:q[e.submenu],T=m==="overlay"?`overlay-${e.submenu}-submenu`:`${e.submenu}-submenu`,j=P==null?void 0:P.panel,F=P!=null&&P.enabled?!a[P.enabled]():!1,L=m==="overlay";if(f.useEffect(()=>{y||A(null)},[y]),!P||!j&&!e.items.some(G=>_c(G,n)))return null;const H=G=>{(G.key==="ArrowRight"||G.key==="Enter"||G.key===" ")&&(G.preventDefault(),G.stopPropagation(),w(!0),requestAnimationFrame(()=>{var $;const Q=($=E.current)==null?void 0:$.querySelector('[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]');Q==null||Q.focus()}))},z=G=>{var Q;G.key==="ArrowLeft"&&(G.preventDefault(),G.stopPropagation(),w(!1),(Q=S.current)==null||Q.focus())};return l.jsxs("div",{className:Ne.submenuWrap,onMouseEnter:L?void 0:()=>w(!0),onMouseLeave:L?void 0:()=>w(!1),children:[l.jsx("button",{ref:S,type:"button",role:"menuitem",className:`${Ne.menuItem} ${Ne.submenuTrigger}`,"aria-haspopup":"menu","aria-expanded":y,"aria-controls":T,"aria-label":Mc(C,P),disabled:s||F||(c==null?void 0:c.readOnly)&&!(c!=null&&c.enableComments),onClick:()=>w(L?!y:!0),onKeyDown:H,children:Di(C,P)}),y?l.jsx("div",{ref:E,className:`${Ne.menu} ${Ne.submenu}`,role:"menu",id:T,"aria-label":Mc(C,P),onKeyDown:z,children:j?l.jsx(j,{commands:o,queries:a,disabled:s||F,onMenuClose:g}):l.jsx(xv,{entries:e.items,catalog:n,commands:o,queries:a,disabled:s,chromeLock:c,variant:m,onClose:g,openSubmenuId:k,onOpenSubmenuIdChange:A})}):null]})}function Cm({catalog:e,layout:n,commands:o,queries:a,disabled:s,chromeLock:c,menuVisible:m=!0,toolbarVisible:g=!0,compact:y,position:w="top"}){const[C,S]=f.useState(null);return!m&&!g?null:l.jsxs("div",{className:Ne.toolbar,"data-compact":y?"":void 0,"data-toolbar-position":w,children:[m?l.jsx(YN,{menus:n.menus,catalog:e,commands:o,queries:a,disabled:s,chromeLock:c,compact:y,openMenuId:C,onOpenMenuIdChange:S}):null,g?l.jsx(VN,{groups:n.iconGroups,catalog:e,commands:o,queries:a,disabled:s,chromeLock:c}):null]})}const ZN="_root_e4cee_1",e2="_fullscreen_e4cee_36",t2="_exitFullscreen_e4cee_48",n2="_exitFullscreenIcon_e4cee_79",r2="_menuChrome_e4cee_94",o2="_body_e4cee_105",i2="_iconChrome_e4cee_135",a2="_workspace_e4cee_179",l2="_htmlFileDropOverlay_e4cee_191",s2="_surface_e4cee_205",u2="_visual_e4cee_212",c2="_multiPageContainer_e4cee_235",d2="_pageBlock_e4cee_242",m2="_pageGap_e4cee_248",f2="_pageSurface_e4cee_254",p2="_html_e4cee_191",vt={root:ZN,fullscreen:e2,exitFullscreen:t2,exitFullscreenIcon:n2,menuChrome:r2,body:o2,iconChrome:i2,workspace:a2,htmlFileDropOverlay:l2,surface:s2,visual:u2,multiPageContainer:c2,pageBlock:d2,pageGap:m2,pageSurface:f2,html:p2},h2=f.forwardRef(function({html:n,onChange:o,placeholder:a,disabled:s},c){const m=Se();return l.jsx("textarea",{ref:c,className:`${vt.surface} ${vt.html}`,value:n,onChange:g=>o(g.target.value),placeholder:a,disabled:s,"aria-label":m("htmlEditorAria"),spellCheck:!1})}),g2=f.forwardRef(function({html:n,onChange:o,placeholder:a,disabled:s,onBeforeInput:c,onPointerDown:m,onMouseUp:g,onContextMenu:y},w){const C=Se(),S=f.useRef(null),E=f.useRef(c);E.current=c;const k=A=>{S.current=A,typeof w=="function"?w(A):w&&(w.current=A)};return f.useLayoutEffect(()=>{const A=S.current;A&&(A.innerHTML!==n&&(A.innerHTML=n),Ic(A))},[n]),f.useLayoutEffect(()=>{const A=S.current;if(!A)return;const P=T=>{var j;(j=E.current)==null||j.call(E,T)};return A.addEventListener("beforeinput",P),()=>A.removeEventListener("beforeinput",P)},[]),l.jsx("div",{ref:k,className:`${vt.surface} ${vt.visual}`,contentEditable:!s,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":C("visualEditorAria"),"aria-disabled":s||void 0,"data-placeholder":a,onPointerDown:m,onMouseUp:g,onContextMenu:y,onInput:A=>{o(A.currentTarget.innerHTML)}})}),y2=f.forwardRef(function({pages:n,activePageIndex:o,onActivePageIndexChange:a,onPageChange:s,placeholder:c,disabled:m,onBeforeInput:g,onPointerDown:y,onMouseUp:w,onContextMenu:C},S){const E=Se(),k=f.useRef(null),A=f.useRef(o);A.current=o;const P=f.useRef(g);P.current=g;const T=f.useRef(n);T.current=n,f.useImperativeHandle(S,()=>({getContainer:()=>k.current,getActivePageRoot:()=>{const L=k.current;return L?gc(L,A.current):null},getActivePageIndex:()=>A.current,flushPageHtml:L=>{var z;const H=k.current;return H?((z=gc(H,L))==null?void 0:z.innerHTML)??null:null}}));const j=f.useCallback((L,H)=>{const z=Ci(H).body;L.innerHTML!==z&&(L.innerHTML=z),Ic(L)},[]);f.useLayoutEffect(()=>{const L=k.current;if(L)for(let H=0;H<n.length;H+=1){const z=gc(L,H);z&&j(z,n[H]??"")}},[n,j]),f.useLayoutEffect(()=>{const L=k.current;if(!L)return;const H=z=>{var q;(q=P.current)==null||q.call(P,z)};return L.addEventListener("beforeinput",H),()=>L.removeEventListener("beforeinput",H)},[]);const F=L=>{L!==o&&a(L)};return l.jsx("div",{ref:k,className:vt.multiPageContainer,children:n.map((L,H)=>l.jsxs("div",{className:vt.pageBlock,children:[H>0?l.jsx("div",{className:vt.pageGap,"aria-hidden":"true"}):null,l.jsx("div",{className:`${vt.surface} ${vt.visual} ${vt.pageSurface}`,[Pm]:"","data-page-index":H,contentEditable:!m,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":E("visualEditorAria"),"aria-disabled":m||void 0,"data-placeholder":H===0?c:void 0,onFocus:()=>F(H),onPointerDown:y,onMouseUp:w,onContextMenu:C,onInput:z=>{s(H,z.currentTarget.innerHTML)}})]},H))})});function b2({value:e,defaultValue:n="",onChange:o,onAutoSave:a,onSave:s,onOpen:c,mode:m,defaultMode:g="visual",onModeChange:y,fullscreen:w,defaultFullscreen:C=!1,onFullscreenChange:S,placeholder:E,disabled:k,readOnly:A=!1,className:P,locale:T="en",toolbarBackground:j,menuColor:F,menuBackground:L,menuFontSize:H,menuFontFamily:z,border:q,menuVisible:G=!0,toolbarVisible:Q=!0,allowedChrome:$,customActions:V,customFonts:K,transformHtml:X,loadCustomParagraphStyles:de,onSaveCustomParagraphStyle:ce,onDeleteCustomParagraphStyle:Pe,customImagePicker:ke,disableBuiltinImageInsert:je,customAudioPicker:Y,disableBuiltinAudioInsert:pe,customVideoPicker:J,disableBuiltinVideoInsert:M,disableHtmlFileDrop:N=!1,toolbarCustomization:re,darkMode:fe=!1,darkModePersistence:ae,toolbarPosition:Ce="top",toolbarPositionPersistence:Re,enableMultiPages:De=!1,pages:Be,defaultPages:Qe,onPagesChange:un,enableComments:ut=!1,commentAuthor:wn,comments:In,defaultComments:Io=[],onCommentsChange:oo}){const Le=!!(k||A),Cn=!!k,Fo=zh(Qe??(n.trim()?[n]:[Em()])),or=De?No(Fo):n,ir=De&&Be!==void 0?No(zh(Be)):e,[ot,Bo]=rc({value:ir,defaultValue:or,onChange:De?void 0:o}),[it,Nr]=rc({value:m,defaultValue:g,onChange:y}),[tn,Sn]=rc({value:w,defaultValue:C,onChange:S}),[Ht,Oo]=f.useState(!0),[Mt,Ut]=f.useState(null),[ar,Fn]=rc({value:In,defaultValue:Io,onChange:oo}),oe=f.useRef(null),io=f.useRef(null),ft=f.useRef(null),wt=f.useRef(De);wt.current=De;const kn=f.useRef(ut);kn.current=ut;const We=f.useRef(A);We.current=A;const Bn=f.useRef(Le);Bn.current=Le;const Pn=f.useRef(Ht);Pn.current=Ht;const Kt=f.useRef(ar);Kt.current=ar;const B=f.useRef(un);B.current=un;const[Rr,Ri]=f.useState(0),lr=f.useRef(Rr);lr.current=Rr;const zo=f.useRef(null);zo.current===null&&(zo.current=Hj(ot));const At=zo.current,Je=f.useRef(ot);Je.current=ot;const On=f.useRef(!0),ao=f.useRef(""),cn=f.useRef(null),ue=f.useRef(it);ue.current=it;const Lr=f.useRef(tn);Lr.current=tn;const tt=f.useRef(null),[,Ho]=f.useState(0),sr=f.useRef(null);sr.current===null&&(sr.current=Sk(()=>{Ho(h=>h+1)}));const Uo=f.useRef(X);Uo.current=X;const $t=f.useRef({}),_t=f.useRef(null),ct=f.useRef(null),Vt=f.useRef(null),Wt=f.useRef(null),zn=f.useRef(null),Ct=f.useRef(null),[ge,Ze]=f.useState(Lo),Hn=f.useRef(ge);Hn.current=ge;const nn=f.useRef(ha),[Li,qe]=f.useState({value:null,unit:ha,mixed:!1}),Mr=f.useRef(Li);Mr.current=Li;const[lo,xa]=f.useState({value:null,mixed:!1}),_r=f.useRef(lo);_r.current=lo;const[Mi,wa]=f.useState({value:null,mixed:!1}),Ir=f.useRef(Mi);Ir.current=Mi;const[Gt,jl]=f.useState({value:null,mixed:!1}),It=f.useRef(Gt);It.current=Gt;const[Nl,Rl]=f.useState({tag:null,mixed:!1}),Ll=f.useRef(Nl);Ll.current=Nl;const[_i,Ko]=f.useState({align:"left",mixed:!1}),so=f.useRef(_i);so.current=_i;const[Ii,Ml]=f.useState({type:null,mixed:!1}),Fi=f.useRef(Ii);Fi.current=Ii;const[Ca,Sa]=f.useState(!1),ka=f.useRef(Ca);ka.current=Ca;const[uo,_l]=f.useState(!1),Bi=f.useRef(uo);Bi.current=uo;const[ze,Il]=f.useState(!1),Oi=f.useRef(ze);Oi.current=ze;const $o=f.useRef(null),zi=f.useRef(null),[Fl,Bl]=f.useState(!1),Pa=f.useRef(Fl);Pa.current=Fl;const[Fr,En]=f.useState({open:!1,tab:"general"}),[Un,ur]=f.useState(!1),[cr,Vo]=f.useState({open:!1,html:""}),[Kn,Ea]=f.useState(null),[Qs,co]=f.useState(!1),[Gc,Aa]=f.useState(!1),[dr,Hi]=f.useState(()=>ae?fe:Hg()??fe),[An,Br]=f.useState(()=>Re?Ce:Ug()??Ce),[Dn,mr]=f.useState({open:!1,tab:"general",value:Fs()}),[mo,Ol]=f.useState({open:!1,value:""}),[fo,Or]=f.useState({open:!1,tab:"font",value:Km()}),[Wo,Da]=f.useState([]),[Ta,$n]=f.useState(!1),[zl,po]=f.useState(!1),[gt,zr]=f.useState({open:!1}),[Dt,Ui]=f.useState({open:!1,tab:"link",href:"",title:"",targetBlank:!1,textDecorationNone:!1,hoverMode:"color",hoverColor:null,hoverHtml:"",bookmarks:[],selectedBookmarkId:""}),[Ft,Hr]=f.useState({open:!1,existingIds:[]}),[Hl,Ur]=f.useState({open:!1}),[Yc,Go]=f.useState({open:!1}),[Ul,fr]=f.useState({open:!1}),[ho,Ki]=f.useState({open:!1,tab:"general",value:Cb(),aspectRatio:1}),[Kl,$l]=f.useState({open:!1}),[ja,$i]=f.useState({open:!1,value:RP()}),[Na,Vl]=f.useState({open:!1,value:UP()}),[Ra,Wl]=f.useState({open:!1,value:QP()}),[go,La]=f.useState({open:!1,x:0,y:0,kind:"caret",inTable:!1,canMergeCells:!1,canUnmergeCells:!1}),[St,Yo]=f.useState(null),Gl=f.useRef(St);Gl.current=St;const[Yl,Ma]=f.useState(!1),Js=f.useRef(Yl);Js.current=Yl;const[ql,Zs]=f.useState(!1),Xl=f.useRef(ql);Xl.current=ql;const[Ql,eu]=f.useState(!1),tu=f.useRef(Ql);tu.current=Ql;const nu=f.useRef(void 0),_a=f.useRef(Wo);_a.current=Wo;const ru=f.useRef(Ta);ru.current=Ta;const Jl=!!(de&&ce),Vi=f.useRef(Jl);Vi.current=Jl;const qo=f.useRef(de);qo.current=de;const ou=f.useRef(ce);ou.current=ce;const Zl=f.useRef(Pe);Zl.current=Pe;const es=f.useRef(s);es.current=s;const ts=f.useRef(c);ts.current=c;const ns=f.useRef(ke);ns.current=ke;const rs=f.useRef(Y);rs.current=Y;const yo=f.useRef(J);yo.current=J;const iu=f.useRef(re);iu.current=re;const au=f.useRef(ae);au.current=ae;const lu=f.useRef(Re);lu.current=Re;const os=f.useRef(dr);os.current=dr;const is=f.useRef(An);is.current=An;const Xo=f.useRef(je);Xo.current=je;const Qo=f.useRef(pe);Qo.current=pe;const su=f.useRef(M);su.current=M;const Jo=f.useRef(0),Wi=f.useRef(0),as=f.useRef(0),Zo=f.useRef(0),Ia=f.useRef(0),Gi=f.useRef(0),ls=f.useRef(0),pr=f.useMemo(()=>by(K),[K]),ei=f.useRef(pr);ei.current=pr;const ss=f.useMemo(()=>Gw(ot,pr).join(`
134
+ `),[ot,pr]),qc=f.useMemo(()=>xi(ot).map(h=>Ci(h).body),[ot]);f.useEffect(()=>{const v=(ss?ss.split(`
135
+ `):[]).map(_=>{const ie=document.createElement("link");return ie.rel="stylesheet",ie.href=_,ie.setAttribute(Fc,""),document.head.append(ie),ie});return()=>{for(const _ of v)_.remove()}},[ss]);const Fa=f.useCallback(async()=>{const h=qo.current;if(!h)return;const v=++Jo.current;$n(!0);try{const _=await h();if(v!==Jo.current)return;Da(_)}catch{}finally{v===Jo.current&&$n(!1)}},[]);f.useEffect(()=>{if(!de||!ce){Da([]),$n(!1);return}Fa()},[de,ce,Fa]);const uu=f.useCallback(async h=>{Ea(h);const v=iu.current;if(v!=null&&v.load&&v.save){const _=++as.current;Aa(!0);try{await v.save(h)}catch{}finally{_===as.current&&Aa(!1)}return}Vj(h)},[]);f.useEffect(()=>{const h=re;if(!(h!=null&&h.load)||!h.save){Ea($j()),co(!1),Aa(!1);return}const v=++Wi.current;return co(!0),(async()=>{try{const _=await h.load();if(v!==Wi.current)return;Ea(_)}catch{if(v!==Wi.current)return;Ea(null)}finally{v===Wi.current&&co(!1)}})(),()=>{Wi.current+=1}},[re]);const dn=f.useCallback(async h=>{Hi(h);const v=au.current;if(v!=null&&v.load&&v.save){const _=++Ia.current;try{await v.save(h)}catch{}finally{if(_!==Ia.current)return}return}vj(h)},[]);f.useEffect(()=>{const h=ae;if(!(h!=null&&h.load)||!h.save){Hi(Hg()??fe);return}const v=++Zo.current;return(async()=>{try{const _=await h.load();if(v!==Zo.current)return;Hi(typeof _=="boolean"?_:fe)}catch{if(v!==Zo.current)return;Hi(fe)}})(),()=>{Zo.current+=1}},[ae,fe]);const ti=f.useCallback(async h=>{Br(h);const v=lu.current;if(v!=null&&v.load&&v.save){const _=++ls.current;try{await v.save(h)}catch{}finally{if(_!==ls.current)return}return}wj(h)},[]);f.useEffect(()=>{const h=Re;if(!(h!=null&&h.load)||!h.save){Br(Ug()??Ce);return}const v=++Gi.current;return(async()=>{try{const _=await h.load();if(v!==Gi.current)return;Br(hv(_)??Ce)}catch{if(v!==Gi.current)return;Br(Ce)}})(),()=>{Gi.current+=1}},[Re,Ce]);const bo=f.useCallback(h=>{var _,ie;const v=((_=Uo.current)==null?void 0:_.call(Uo,h))??h;return v!==Je.current&&(On.current=!0),Bo(v),wt.current&&((ie=B.current)==null||ie.call(B,xi(v),lr.current)),v},[Bo]),et=f.useCallback((h,v)=>{const _=bo(h);return At.record(_,{coalesce:v}),_},[bo,At]),cu=f.useCallback(h=>{if(wt.current){const v=xi(Je.current),_=lr.current,ie=[...v];ie[_]=h,et(No(ie),!1);return}et(h,!1)},[et]),ni=Bj({enabled:!Le&&!N,onHtml:cu}),Oe=f.useCallback((h,v)=>et(Zu(h,ec(h,Je.current,ei.current)),v),[et]),Ba=f.useCallback((h,v)=>Zu(h,ec(h,v,ei.current)),[]),hr=f.useCallback(()=>{const h=io.current;return(h==null?void 0:h.getContainer())?xi(Je.current).map((ie,ye)=>{const _e=h==null?void 0:h.flushPageHtml(ye);return _e===null?ie:Ba(_e,ie)}):xi(Je.current)},[Ba]),Kr=f.useCallback((h,v,_)=>{const ie=xi(Je.current),ye=[...ie];ye[h]=Ba(v,ie[h]??""),et(No(ye),_)},[et,Ba]),Me=f.useCallback((h,v)=>{var ie;if(!wt.current){Oe(h.innerHTML,v);return}const _=(ie=io.current)==null?void 0:ie.getContainer();if(!_){Oe(h.innerHTML,v);return}for(let ye=0;ye<xi(Je.current).length;ye+=1)if(gc(_,ye)===h){Kr(ye,h.innerHTML,v);return}Oe(h.innerHTML,v)},[Kr,Oe]),ri=f.useCallback((h,v)=>{We.current||Me(h,v)},[Me]),Oa=f.useCallback(()=>{const h=wt.current?hr():xi(Je.current);return h[lr.current]??h[0]??""},[hr]),Yi=f.useCallback(()=>wt.current?hr():[Je.current],[hr]),qi=f.useCallback(()=>{if(!wt.current||ue.current!=="visual")return;const h=hr(),v=lr.current+1,_=[...h];_.splice(v,0,Em()),et(No(_),!1),Ri(v)},[hr,et]),gr=f.useCallback(()=>{const h=At.undo();h!==null&&(At.markApplying(),bo(h))},[bo,At]),oi=f.useCallback(()=>{const h=At.redo();h!==null&&(At.markApplying(),bo(h))},[bo,At]);f.useEffect(()=>{At.syncExternal(ot)},[ot,At]);const le=f.useCallback(()=>{tt.current=Qr({mode:ue.current,visualEl:oe.current,htmlEl:ft.current})},[]),rn=f.useCallback(h=>{if(!h||ue.current!=="visual"){Ma(!1),Zs(!1),eu(!1);return}Ma(Ff(h)!==null),Zs(pg(h)),eu(hg(h))},[]),za=f.useCallback(()=>{const h=Qr({mode:ue.current,visualEl:oe.current,htmlEl:ft.current}),v=tt.current;$h(v,h)||(tt.current=h)},[]),Ha=f.useCallback(()=>{const h=oe.current;if(ue.current!=="visual"||!h){qe({value:null,unit:nn.current,mixed:!1});return}const v=Qy(h,nn.current);_t.current&&(v.value=_t.current.value,v.unit=_t.current.unit,v.mixed=!1),nn.current=v.unit,qe(_=>_.value===v.value&&_.unit===v.unit&&_.mixed===v.mixed?_:v)},[]),Ua=f.useCallback(()=>{const h=oe.current;if(ue.current!=="visual"||!h){xa({value:null,mixed:!1});return}const v=wy(h);ct.current&&(v.value=ct.current.value,v.mixed=!1),xa(_=>_.value===v.value&&_.mixed===v.mixed?_:v)},[]),Ka=f.useCallback(()=>{const h=oe.current;if(ue.current!=="visual"||!h){wa({value:null,mixed:!1}),jl({value:null,mixed:!1});return}const v=Sc(h,"color");Vt.current&&(v.value=Vt.current.value,v.mixed=!1);const _=Sc(h,"backgroundColor");Wt.current&&(_.value=Wt.current.value,_.mixed=!1),wa(ie=>ie.value===v.value&&ie.mixed===v.mixed?ie:v),jl(ie=>ie.value===_.value&&ie.mixed===_.mixed?ie:_)},[]),$a=f.useCallback(()=>{const h=oe.current;if(ue.current!=="visual"||!h){Rl({tag:null,mixed:!1});return}const v=i0(h);Rl(_=>_.tag===v.tag&&_.mixed===v.mixed?_:v)},[]),Va=f.useCallback(()=>{const h=oe.current;if(ue.current!=="visual"||!h){Ko({align:null,mixed:!1}),Ml({type:null,mixed:!1}),Sa(!1),Bl(!1);return}const v=yb(h);Ko(_e=>_e.align===v.align&&_e.mixed===v.mixed?_e:v);const _=cb(h);Ml(_e=>_e.type===_.type&&_e.mixed===_.mixed?_e:_);const ie=h0(h);Sa(_e=>_e===ie?_e:ie);const ye=zS(h);Bl(_e=>_e===ye?_e:ye)},[]),ne=f.useCallback(()=>{const h=oe.current;if(ue.current!=="visual"||!h){Ze(Lo()),_l(!1),Ha(),Ua(),Ka(),$a(),Va();return}const v=tt.current,_=!!(v&&!v.collapsed);_l(ye=>ye===_?ye:_);const ie=nb(fl(h),$t.current);Ze(ye=>FC(ye,ie)?ye:ie),Ha(),Ua(),Ka(),$a(),Va()},[Ha,Ua,Ka,$a,Va]),Wa=f.useCallback(()=>{const h=tt.current,v=Ct.current;!v||!h||h.collapsed&&h.start===v.start&&h.end===v.end||($t.current={},_t.current=null,ct.current=null,Vt.current=null,Wt.current=null,zn.current=null,Ct.current=null)},[]);f.useEffect(()=>{On.current=!0},[ot]),f.useEffect(()=>{if(it==="visual"){ne();return}$t.current={},_t.current=null,ct.current=null,Vt.current=null,Wt.current=null,zn.current=null,Ct.current=null,Ze(Lo()),qe({value:null,unit:nn.current,mixed:!1}),xa({value:null,mixed:!1}),wa({value:null,mixed:!1}),jl({value:null,mixed:!1}),Rl({tag:null,mixed:!1}),Ko({align:null,mixed:!1}),Ml({type:null,mixed:!1}),Sa(!1),_l(!1)},[it,ne]);const $r=f.useCallback((h,v,_)=>{f1({snapshot:h,visualEl:oe.current,htmlEl:ft.current,getHtml:()=>ue.current==="visual"&&oe.current?oe.current.innerHTML:Je.current,setHtml:ie=>{if(ue.current==="visual"){Oe(Ci(ie).body,!1);return}et(ie,!1)},content:v,asHtml:_})},[et,Oe]),du=f.useCallback(h=>{if(ue.current==="visual"&&h==="html"){if(wt.current){const v=No(hr());v!==Je.current&&et(v,!0)}else if(oe.current){const v=oe.current.innerHTML,_=Zu(v,ec(v,Je.current,ei.current));_!==Je.current&&et(_,!0)}}Nr(h)},[et,Nr,hr]);f.useEffect(()=>{if(!tn)return;const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}},[tn]),f.useEffect(()=>{if(!tn)return;const h=v=>{v.key==="Escape"&&(v.defaultPrevented||Fr.open||mo.open||Dn.open||fo.open||Kl.open||ja.open||Na.open||Ra.open||Un||cr.open||(v.preventDefault(),Sn(!1)))};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[tn,Sn,Fr.open,mo.open,Dn.open,fo.open,Kl.open,ja.open,Na.open,Ra.open,Un,cr.open]),f.useEffect(()=>{const h=()=>{if(ue.current!=="visual"||!oe.current)return;const v=window.getSelection();if(!v||v.rangeCount===0)return;const _=v.anchorNode;!_||!oe.current.contains(_)&&oe.current!==_||cn.current===null&&(cn.current=window.requestAnimationFrame(()=>{cn.current=null;const ie=oe.current;!ie||ue.current!=="visual"||(le(),Wa(),ne(),Yo(Si(ie)),rn(ie))}))};return document.addEventListener("selectionchange",h),()=>{document.removeEventListener("selectionchange",h),cn.current!==null&&(window.cancelAnimationFrame(cn.current),cn.current=null)}},[le,Wa,ne,rn]),f.useEffect(()=>{if(it!=="html")return;const h=ft.current;if(!h)return;const v=()=>le();return h.addEventListener("select",v),h.addEventListener("keyup",v),h.addEventListener("mouseup",v),()=>{h.removeEventListener("select",v),h.removeEventListener("keyup",v),h.removeEventListener("mouseup",v)}},[it,le]),f.useLayoutEffect(()=>{if(it!=="visual"||Le){Yo(null);return}const h=oe.current;if(!h)return;const v=Si(h);Yo(_=>v||(_&&_.isConnected&&h.contains(_)?_:null))},[ot,it,Le]);const me=f.useCallback(h=>{const v=Qr({mode:"visual",visualEl:h,htmlEl:ft.current}),_=tt.current,ie=$h(_,v)?_:v.visualRange?v:_??v;tt.current=ie,h.focus();const ye=m1(h,ie);if(ye){const _e=window.getSelection();try{_e==null||_e.removeAllRanges(),_e==null||_e.addRange(ye),tt.current={...ie,visualRange:ye}}catch{}}return tt.current??ie},[]),on=f.useCallback(()=>{$o.current=null,zi.current=null,Il(!1)},[]),mu=f.useCallback(()=>{if(!Oi.current||!$o.current||!zi.current||ue.current!=="visual")return;const h=oe.current;if(!h)return;le();const v=tt.current;!v||v.collapsed||vk(v,zi.current)||(me(h),wk(h,$o.current),Me(h,!1),le(),ne(),on())},[le,me,Oe,ne,on]),us=f.useCallback(()=>{if(ue.current!=="visual"){on();return}if(Oi.current){on();return}const h=oe.current;if(!h){on();return}const v=me(h);if(v.collapsed){on();return}$o.current=xk(h),zi.current={...v},Il(!0),le()},[on,me,le]),cs=f.useCallback(()=>{mu()},[mu]);f.useEffect(()=>{(it!=="visual"||Le)&&on()},[it,Le,on]);const $e=f.useCallback((h,v)=>{if(ue.current!=="visual")return;const _=oe.current;if(!_)return;const ie=v??nn.current,ye=ga(h,ie);if(!ye)return;nn.current=ye.unit;const _e=me(_);if(_e.collapsed){_t.current=ye,Ct.current={start:_e.start,end:_e.end},ne();return}_t.current=null,Lm(_,ye.value,ye.unit)&&(Me(_,!1),le(),ne())},[me,Oe,le,ne]),Ga=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(!v)return;const _=me(v);if(_.collapsed){ct.current={value:h},Ct.current={start:_.start,end:_.end},ne();return}ct.current=null,Dm(v,h)&&(Me(v,!1),le(),ne())},[me,Oe,le,ne]),ii=f.useCallback((h,v)=>{if(ue.current!=="visual")return;const _=oe.current;if(!_)return;const ie=me(_),ye=h==="color"?Vt:Wt;if(ie.collapsed){ye.current={value:v},Ct.current={start:ie.start,end:ie.end},ne();return}ye.current=null,Is(_,h,v)&&(Me(_,!1),le(),ne())},[me,Oe,le,ne]),vo=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(!v)return;const _=me(v);if(En({open:!1,tab:"general"}),_.collapsed){if(h.size!==null){const at=ga(h.size,h.unit);at&&(_t.current=at,nn.current=at.unit)}const ye=fl(v),_e={};for(const at of nr)h.marks[at]!==ye[at]&&(_e[at]=h.marks[at]);$t.current=_e,h.fontColorMixed||(Vt.current={value:h.fontColor}),h.highlightColorMixed||(Wt.current={value:h.highlightColor}),h.fontFamilyMixed||(ct.current={value:h.fontFamily}),Ct.current={start:_.start,end:_.end},ne();return}if($t.current={},_t.current=null,ct.current=null,Vt.current=null,Wt.current=null,Ct.current=null,h.size!==null){const ye=ga(h.size,h.unit);ye&&(nn.current=ye.unit,Lm(v,ye.value,ye.unit))}const ie=fl(v);for(const ye of nr)h.marks[ye]!==ie[ye]&&Im(v,ye);h.fontFamilyMixed||Dm(v,h.fontFamily),h.fontColorMixed||Is(v,"color",h.fontColor),h.highlightColorMixed||Is(v,"backgroundColor",h.highlightColor),Me(v,!1),le(),ne()},[me,Oe,le,ne]),ds=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),mr(_=>({..._,open:!1})),!vb(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),Ya=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(!v)return;const _=me(v);if(Ol(ie=>({...ie,open:!1})),!Hc(h)){le(),ne();return}if(_.collapsed){zn.current=h,Ct.current={start:_.start,end:_.end},ne();return}if(zn.current=null,!tb(v,h)){le(),ne();return}Me(v,!1),le(),ne()},[me,Oe,le,ne]),ai=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),Or(_=>({..._,open:!1})),!NS(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),Xi=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),Ui(_=>({..._,open:!1})),!WS(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),xo=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),Hr(_=>({..._,open:!1})),!XS(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),Qi=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),Ur({open:!1}),!R0(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),qa=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),Go({open:!1}),!_k(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),fu=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),fr({open:!1}),!Kk(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),ms=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),$l({open:!1}),!gP(v,h)){le(),ne();return}Me(v,!1),le(),ne(),rn(v)}},[me,Oe,le,ne,rn]),Ji=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),$i(_=>({..._,open:!1})),!IP(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),Zi=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),Vl(_=>({..._,open:!1})),!WP(v,h)){le(),ne();return}Me(v,!1),le(),ne(),rn(v)}},[me,Oe,le,ne,rn]),Xa=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),Wl(_=>({..._,open:!1})),!tE(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),Tn=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),!h(v)){le(),ne();return}Me(v,!1),le(),ne(),rn(v)}},[me,Oe,le,ne,rn]),ea=f.useCallback(h=>{Qi({src:h.src,alt:h.alt??"",title:h.title??"",css:h.css})},[Qi]),ta=f.useCallback(h=>{qa({src:h.src,title:h.title??"",css:h.css})},[qa]),fs=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),fr({open:!1}),!$k(v,{src:h.src,title:h.title??"",css:h.css})){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),ps=f.useCallback(h=>{if(ue.current!=="visual")return;const v=oe.current;if(v){if(me(v),Ki(_=>({..._,open:!1})),!q0(v,h)){le(),ne();return}Me(v,!1),le(),ne()}},[me,Oe,le,ne]),Xc=f.useCallback((h,v)=>{St!=null&&St.isConnected&&sP(St,h,v)},[St]),Qc=f.useCallback(()=>{const h=oe.current;!h||!(St!=null&&St.isConnected)||(Me(h,!1),dm(h,St),le(),ne())},[St,Oe,le,ne]),Vn=f.useCallback(()=>{if(wt.current){if(ue.current==="visual"){const h=hr(),v=No(h);if(v!==Je.current)return et(v,!0)}return Je.current}if(ue.current==="visual"&&oe.current){const h=oe.current.innerHTML,v=Zu(h,ec(h,Je.current,ei.current));if(v!==Je.current)return et(v,!0)}return Je.current},[et]),Wn=f.useCallback(()=>{if(!On.current&&ao.current)return ao.current;const h=JSON.stringify(Yi());return ao.current=h,On.current=!1,h},[Yi]),pu=f.useCallback(()=>wt.current?Wn():Vn(),[Vn,Wn]);sE({onAutoSave:a?()=>{const h=wt.current?JSON.parse(Wn()):Vn();return a(h)}:void 0,getHtml:pu}),f.useEffect(()=>()=>{var h;(h=sr.current)==null||h.cancel()},[]);const Ue=f.useMemo(()=>({getHtml:Vn,setHtml:h=>{et(h,!1)},getMode:()=>ue.current,setMode:du,getFullscreen:()=>Lr.current,setFullscreen:Sn,getDarkMode:()=>os.current,setDarkMode:h=>{dn(h)},getToolbarPosition:()=>is.current,setToolbarPosition:h=>{ti(h)},openCustomizeToolbar:()=>{ur(!0)},openDocumentPreview:()=>{Vo({open:!0,html:Vn()})},toggleReadAloud:()=>{const h=sr.current;if(!h)return;const v=tt.current??Qr({mode:ue.current,visualEl:oe.current,htmlEl:ft.current}),_=sg(tc(v),Vn());_&&h.toggle(_)},isReadingAloud:()=>{var h;return((h=sr.current)==null?void 0:h.isSpeaking())??!1},canReadAloud:()=>{if(!bc())return!1;const h=tt.current??Qr({mode:ue.current,visualEl:oe.current,htmlEl:ft.current});return sg(tc(h),Vn())!==null},undo:gr,redo:oi,canUndo:()=>At.canUndo(),canRedo:()=>At.canRedo(),getSelection:()=>{const h=tt.current??Qr({mode:ue.current,visualEl:oe.current,htmlEl:ft.current});return tc(h)},insertText:h=>{const v=tt.current??Qr({mode:ue.current,visualEl:oe.current,htmlEl:ft.current});$r(v,h,!1)},insertHtml:(h,v)=>{const _=tt.current??Qr({mode:ue.current,visualEl:oe.current,htmlEl:ft.current}),ie=v===void 0;$r(_,ie?h:v,ie)},toggleFontMark:h=>{if(ue.current!=="visual")return;const v=oe.current;if(!v)return;const _=me(v);if(_.collapsed){const ie=fl(v);$t.current=OC($t.current,ie,h),Ct.current={start:_.start,end:_.end},ne();return}$t.current={},Ct.current=null,Im(v,h)&&(Me(v,!1),le(),ne())},clearFormatting:()=>{if(ue.current!=="visual")return;const h=oe.current;!h||me(h).collapsed||($t.current={},_t.current=null,ct.current=null,Vt.current=null,Wt.current=null,zn.current=null,Ct.current=null,bk(h)&&(Me(h,!1),le(),ne()))},toggleFormatBrush:us,isFormatBrushActive:()=>Oi.current,isFontMarkActive:h=>Hn.current[h],hasTextSelection:()=>ue.current==="visual"&&Bi.current,setFontSize:(h,v)=>{$e(h,v)},setFontSizeUnit:h=>{var at;const v=oe.current,_=Mr.current;if(ue.current!=="visual"||!v||_.value===null||_.mixed){nn.current=h,qe(ui=>({...ui,unit:h}));return}const ie=me(v),ye=EC(v,((at=ie.visualRange)==null?void 0:at.startContainer)??v),_e=Sy(_.value,_.unit,h,ye.parentPx,ye.rootPx);$e(_e,h)},getFontSize:()=>Mr.current.value,getFontSizeUnit:()=>Mr.current.unit,isFontSizeMixed:()=>Mr.current.mixed,setFontFamily:h=>{Ga(h)},getFontFamily:()=>_r.current.value,isFontFamilyMixed:()=>_r.current.mixed,getFontFaces:()=>ei.current,setFontColor:h=>{ii("color",h)},setHighlightColor:h=>{ii("backgroundColor",h)},getFontColor:()=>Ir.current.value,isFontColorMixed:()=>Ir.current.mixed,getHighlightColor:()=>It.current.value,isHighlightColorMixed:()=>It.current.mixed,setParagraphStyle:h=>{if(ue.current!=="visual")return;const v=oe.current;v&&(me(v),a0(v,h)&&(Me(v,!1),le(),ne()))},getParagraphStyle:()=>Ll.current.tag,isParagraphStyleMixed:()=>Ll.current.mixed,setTextAlign:h=>{if(ue.current!=="visual")return;const v=oe.current;v&&(me(v),bb(v,h)&&(Me(v,!1),le(),ne()))},getTextAlign:()=>so.current.align,isTextAlignMixed:()=>so.current.mixed,indent:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&(me(h),g0(h)&&(Me(h,!1),le(),ne()))},outdent:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&(me(h),y0(h)&&(Me(h,!1),le(),ne()))},canOutdent:()=>ue.current==="visual"&&ka.current,toggleList:h=>{if(ue.current!=="visual")return;const v=oe.current;v&&(me(v),u0(v,h)&&(Me(v,!1),le(),ne()))},isBulletList:()=>Fi.current.type==="ul"&&!Fi.current.mixed,isNumberedList:()=>Fi.current.type==="ol"&&!Fi.current.mixed,openFontProperties:h=>{ue.current==="visual"&&En({open:!0,tab:h??"general"})},applyFontProperties:h=>{vo(h)},openCustomCss:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&me(h);const v=h?Zy(h):{value:null,mixed:!1},_=v.mixed||!v.value?"":RC(v.value);Ol({open:!0,value:_})},applyCustomCss:h=>{Ya(h)},openParagraphProperties:h=>{if(ue.current!=="visual")return;const v=oe.current;v&&me(v),mr({open:!0,tab:h??"general",value:v?Qh(v):Fs()})},applyParagraphProperties:h=>{ds(h)},openPageProperties:h=>{if(ue.current!=="visual")return;const v=oe.current;v&&me(v),Or({open:!0,tab:h??"font",value:v?jS(v):Km()})},applyPageProperties:h=>{ai(h)},openCustomParagraphStyleDialog:h=>{if(ue.current!=="visual"||!Vi.current)return;if(h){const _=_a.current.find(ie=>ie.id===h);if(!_)return;zr({open:!0,mode:"edit",style:_});return}const v=oe.current;v&&me(v),zr({open:!0,mode:"create",font:{size:Mr.current.mixed?null:Mr.current.value,unit:Mr.current.unit,marks:{...Hn.current},fontFamily:_r.current.mixed?null:_r.current.value,fontColor:Ir.current.mixed?null:Ir.current.value,highlightColor:It.current.mixed?null:It.current.value},paragraph:xb(v?Qh(v):Fs())})},applyCustomParagraphStyle:h=>{const v=_a.current.find(ie=>ie.id===h);if(!v||(vo({size:v.font.size,unit:v.font.unit,marks:v.font.marks,fontFamily:v.font.fontFamily??null,fontFamilyMixed:!1,fontColor:v.font.fontColor,highlightColor:v.font.highlightColor,fontColorMixed:!1,highlightColorMixed:!1}),!v.paragraph))return;const _=oe.current;!_||ue.current!=="visual"||(me(_),x0(_,v.paragraph)&&(Me(_,!1),le(),ne()))},customParagraphStylesEnabled:()=>Vi.current,getCustomParagraphStyles:()=>_a.current,isCustomParagraphStylesLoading:()=>ru.current,openLinkDialog:h=>{if(ue.current!=="visual")return;const v=oe.current;v&&me(v);const _=v?Mb(v):Kc(),ie=v?$m(v):[],ye=(_==null?void 0:_.href)??"",_e=ye.startsWith("#")?ye.slice(1):"",at=ie.some(ui=>ui.id===_e)?_e:"";Ui({open:!0,tab:h??"link",href:ye,title:(_==null?void 0:_.title)??"",targetBlank:(_==null?void 0:_.targetBlank)??!1,textDecorationNone:(_==null?void 0:_.textDecorationNone)??!1,hoverMode:(_==null?void 0:_.hoverMode)??"color",hoverColor:(_==null?void 0:_.hoverColor)??null,hoverHtml:(_==null?void 0:_.hoverHtml)??"",bookmarks:ie,selectedBookmarkId:at})},applyLink:h=>{Xi(h)},openBookmarkDialog:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&me(h),Hr({open:!0,existingIds:h?$m(h).map(v=>v.id):[]})},applyBookmark:h=>{xo(h)},openImageDialog:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&me(h);const v=ns.current;if(Xo.current&&v){v.onPick(ea);return}Ur({open:!0})},applyImage:h=>{Qi(h)},openAudioDialog:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&me(h);const v=rs.current;if(Qo.current&&v){v.onPick(ta);return}Go({open:!0})},applyAudio:h=>{qa(h)},openYoutubeDialog:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&me(h);const v=yo.current;if(su.current&&v){v.onPick(fs);return}fr({open:!0})},applyYoutube:h=>{fu(h)},openImageProperties:h=>{if(ue.current!=="visual")return;const v=oe.current;if(!v)return;me(v);const _=Si(v),ie=Y0(v);!_||!ie||Ki({open:!0,tab:h??"general",value:ie,aspectRatio:V0(_)})},applyImageProperties:h=>{ps(h)},insertHorizontalRule:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&(me(h),qk(h)&&(Me(h,!1),le(),ne()))},insertPage:()=>{qi()},isMultiPagesEnabled:()=>wt.current,getActivePageHtml:()=>Oa(),getAllPagesHtml:()=>Yi(),openTableDialog:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&me(h),$l({open:!0})},applyTable:h=>{ms(h)},openTableProperties:()=>{if(ue.current!=="visual")return;const h=oe.current;if(!h)return;me(h);const v=_P(h);v&&$i({open:!0,value:v})},applyTableProperties:h=>{Ji(h)},openCellProperties:()=>{if(ue.current!=="visual")return;const h=oe.current;if(!h)return;me(h);const v=VP(h);v&&Vl({open:!0,value:v})},applyCellProperties:h=>{Zi(h)},openRowProperties:()=>{if(ue.current!=="visual")return;const h=oe.current;if(!h)return;me(h);const v=eE(h);v&&Wl({open:!0,value:v})},applyRowProperties:h=>{Xa(h)},insertRowBelow:()=>{Tn(h=>Wm(h,"below"))},insertRowBefore:()=>{Tn(h=>Wm(h,"before"))},deleteRow:()=>{Tn(h=>yP(h))},insertColumnAfter:()=>{Tn(h=>fg(h,"after"))},insertColumnBefore:()=>{Tn(h=>fg(h,"before"))},deleteColumn:()=>{Tn(h=>bP(h))},mergeCells:()=>{Tn(h=>wP(h))},unmergeCells:()=>{Tn(h=>CP(h))},cut:async()=>{if(ue.current!=="visual")return;const h=oe.current;h&&(me(h),await fk(h)&&(Me(h,!1),le(),ne()))},copy:async()=>{if(ue.current!=="visual")return;const h=oe.current;h&&(me(h),await zb(h))},deleteSelection:()=>{if(ue.current!=="visual")return;const h=oe.current;h&&(me(h),Ob(h)&&(Me(h,!1),le(),ne()))},addComment:()=>{if(!kn.current||k||ue.current!=="visual")return;const h=oe.current;if(!h)return;const v=me(h),_=tk(h,v);if(_){Ut(_);return}const ie=ek(h,v);if(!ie)return;const ye=lk(ie);nk(h,ye.id,v)&&(ri(h,!1),Fn([...Kt.current,ye]),Ut(ye.id),le())},toggleCommentsVisible:()=>{Oo(h=>{const v=!h,_=oe.current;return _&&lg(_,v),v})},areCommentsVisible:()=>Pn.current,canAddComment:()=>!kn.current||k||ue.current!=="visual"?!1:Bi.current||Gl.current!==null,isCommentsEnabled:()=>kn.current,getCommentThreads:()=>Kt.current,setCommentThreads:h=>Fn(h),openCommentThread:h=>Ut(h),isContentLocked:()=>Bn.current,isLink:()=>Pa.current,isImageSelected:()=>ue.current==="visual"&&Gl.current!==null,isInTable:()=>ue.current==="visual"&&Js.current,canMergeCells:()=>ue.current==="visual"&&Xl.current,canUnmergeCells:()=>ue.current==="visual"&&tu.current,...s!=null?{onSave:h=>es.current(h)}:{},...c!=null?{onOpen:()=>ts.current()}:{}}),[et,Oe,Me,ri,du,Sn,dn,ti,$r,gr,oi,le,ne,me,$e,Ga,ii,vo,Ya,ds,ai,Xi,xo,Qi,qa,fu,ps,ms,Ji,Zi,Xa,Tn,ea,ta,fs,Vn,Oa,Yi,qi,us,s,c,k,Fn]),jn=f.useCallback(()=>{const h=tt.current??Qr({mode:ue.current,visualEl:oe.current,htmlEl:ft.current});return{mode:h.mode,selection:tc(h),getHtml:Ue.getHtml,setHtml:v=>{et(v,!1)},insertText:v=>$r(h,v,!1),insertHtml:(v,_)=>{const ie=_===void 0;$r(h,ie?v:_,ie)}}},[$r,Ue.getHtml,et]),{catalog:Vr,layout:Gn}=f.useMemo(()=>uw(V,FN,BN),[V]),li=f.useMemo(()=>hN(Gn,$),[Gn,$]),hs=f.useMemo(()=>({...li,iconGroups:Uj(li.iconGroups,Kn)}),[li,Kn]),gs=f.useMemo(()=>ut?UN(Vr,Ht):Vr,[Vr,ut,Ht]),yr=f.useMemo(()=>ut?KN(hs):hs,[hs,ut]),wo=f.useMemo(()=>({disabled:Cn,readOnly:A,enableComments:ut}),[Cn,A,ut]),Co=f.useMemo(()=>Mt?ck(ar,Mt):null,[Mt,ar]),Qa=f.useCallback(h=>{if(!Mt||!wn||k)return;const v=sk(wn,h);Fn(uk(Kt.current,Mt,v))},[Mt,wn,k,Fn]),Wr=f.useMemo(()=>({...wC(Ue),...cw(V,jn)}),[Ue,V,jn]),Gr=f.useMemo(()=>CC(Ue),[Ue,ge,Li,lo,Mi,Gt,Nl,Wo,Ta,Jl,pr,St,Yl,ql,Ql,uo,ze,dr,An]),br=f.useCallback(h=>{if(Le||h.inputType!=="insertText"&&h.inputType!=="insertReplacementText"||!h.data||!BC($t.current)&&!_t.current&&!Qw(ct.current)&&!P1({color:Vt.current,backgroundColor:Wt.current})&&!_C(zn.current))return;const v=oe.current;v&&(h.preventDefault(),YC(v,h.data,$t.current,_t.current,{color:Vt.current,backgroundColor:Wt.current},ct.current,zn.current),$t.current={},_t.current=null,ct.current=null,Vt.current=null,Wt.current=null,zn.current=null,Ct.current=null,Me(v,!0),le(),ne())},[Le,Oe,le,ne]),Ge=f.useCallback(h=>{if(Le||!Pw(h,nu.current))return;h.preventDefault(),h.stopPropagation();const v=oe.current;if(!v)return;me(v);const _=zm(v,h.target),ie=Rc(v,h.target);ie&&!Bf(v).includes(ie)&&xP(v,ie);const ye={inTable:vn(v,h.target)!==null,canMergeCells:pg(v),canUnmergeCells:hg(v)};if(_){dm(v,_),le(),Yo(_),La({open:!0,x:h.clientX,y:h.clientY,kind:"image",...ye,inTable:vn(v,_)!==null});return}const _e=Qr({mode:"visual",visualEl:v,htmlEl:ft.current});tt.current=_e,La({open:!0,x:h.clientX,y:h.clientY,kind:_e.collapsed?"caret":"text",...ye})},[Le,le,me]),Ve=f.useCallback(h=>{if(nu.current=h.pointerType,k)return;const v=oe.current;if(!v)return;if(kn.current&&Pn.current){const ie=ak(v,h.target);if(ie){const ye=ie.getAttribute("data-comment-thread");ye&&Ut(ye);return}}if(Le&&!kn.current)return;const _=zm(v,h.target);if(!_){Yo(null);return}h.preventDefault(),dm(v,_),le(),Yo(_)},[k,Le,le]);f.useEffect(()=>{if(!ut||it!=="visual")return;const h=oe.current;h&&(ik(h,ar),lg(h,Ht))},[ut,it,ar,Ht,ot]);const vr=f.useCallback(h=>{if(Le)return;if(h.key==="Tab"&&!h.ctrlKey&&!h.metaKey&&!h.altKey){if(ue.current!=="visual")return;const _=oe.current;if(!_)return;const ie=h.target;if(!(ie instanceof Node)||!_.contains(ie))return;me(_);const ye=vP(_,h.shiftKey);if(!ye)return;h.preventDefault(),typeof ye=="object"&&ye.changed&&Me(_,!1),le(),ne(),rn(_);return}if(!(h.ctrlKey||h.metaKey))return;const v=h.key.toLowerCase();if(v==="z"&&!h.shiftKey){h.preventDefault(),gr();return}if(v==="z"&&h.shiftKey||v==="y"){h.preventDefault(),oi();return}if(v==="b"&&!h.shiftKey){h.preventDefault(),Ue.toggleFontMark("bold");return}if(v==="i"&&!h.shiftKey){h.preventDefault(),Ue.toggleFontMark("italic");return}if(v==="u"&&!h.shiftKey){h.preventDefault(),Ue.toggleFontMark("underline");return}if(v==="x"&&h.shiftKey){h.preventDefault(),Ue.toggleFontMark("strikethrough");return}v==="p"&&!h.shiftKey&&(h.preventDefault(),Wr.print())},[Le,gr,oi,Ue,Wr,me,Oe,le,ne,rn]),Tt=f.useCallback(h=>{if(h.key==="Escape"&&Mt){h.preventDefault(),Ut(null);return}vr(h)},[Mt,vr]),Yt=[vt.root,Sm(dr).className,tn?vt.fullscreen:"",P].filter(Boolean).join(" "),So=v2({toolbarBackground:j,menuColor:F,menuBackground:L,menuFontSize:H,menuFontFamily:z,border:q}),si=Sm(dr)["data-wysiwyg-theme"];return l.jsx(bw,{locale:T,children:l.jsx(pw,{dark:dr,children:l.jsxs("div",{className:Yt,style:So,"data-fullscreen":tn?"":void 0,"data-wysiwyg-theme":si,"data-toolbar-position":An,"data-comments-visible":ut&&Ht?"":void 0,onKeyDown:Tt,children:[G?l.jsx("div",{className:vt.menuChrome,onPointerDownCapture:za,children:l.jsx(Cm,{catalog:gs,layout:yr,commands:Wr,queries:Gr,disabled:Cn,chromeLock:wo,menuVisible:!0,toolbarVisible:!1})}):null,l.jsxs("div",{className:vt.body,"data-icon-dock":Q?An:void 0,children:[Q&&(An==="top"||An==="left")?l.jsx("div",{className:vt.iconChrome,onPointerDownCapture:za,children:l.jsx(Cm,{catalog:gs,layout:yr,commands:Wr,queries:Gr,disabled:Cn,chromeLock:wo,menuVisible:!1,toolbarVisible:!0,position:An})}):null,l.jsxs("div",{className:vt.workspace,onDragEnter:ni.onDragEnter,onDragOver:ni.onDragOver,onDragLeave:ni.onDragLeave,onDrop:ni.onDrop,children:[it==="visual"?De?l.jsx(y2,{ref:io,pages:qc,activePageIndex:Rr,onActivePageIndexChange:h=>{var _;Ri(h);const v=(_=io.current)==null?void 0:_.getActivePageRoot();v instanceof HTMLDivElement&&(oe.current=v)},onPageChange:(h,v)=>Kr(h,v,!0),onBeforeInput:br,onPointerDown:h=>{h.currentTarget instanceof HTMLDivElement&&(oe.current=h.currentTarget),Ve(h)},onMouseUp:cs,onContextMenu:Ge,placeholder:E,disabled:Le}):l.jsx(g2,{ref:oe,html:Ci(ot).body,onChange:h=>Oe(h,!0),onBeforeInput:br,onPointerDown:Ve,onMouseUp:cs,onContextMenu:Ge,placeholder:E,disabled:Le}):l.jsx(h2,{ref:ft,html:ot,onChange:h=>et(h,!0),placeholder:E,disabled:Le}),ni.dragging?l.jsx(w2,{}):null]}),Q&&(An==="bottom"||An==="right")?l.jsx("div",{className:vt.iconChrome,onPointerDownCapture:za,children:l.jsx(Cm,{catalog:gs,layout:yr,commands:Wr,queries:Gr,disabled:Cn,chromeLock:wo,menuVisible:!1,toolbarVisible:!0,position:An})}):null]}),tn?l.jsx(x2,{onClick:()=>Sn(!1)}):null,l.jsx(pN,{open:Un,catalog:Vr,groups:li.iconGroups,settings:Kn,loading:Qs,busy:Gc,disabled:Le,onChange:h=>{uu(h)},onReset:()=>{uu(null)},onClose:()=>ur(!1)}),l.jsx(yj,{open:cr.open,html:cr.html,onClose:()=>Vo({open:!1,html:cr.html})}),l.jsx(LD,{open:Fr.open,tab:Fr.tab,size:Li.value,unit:Li.unit,marks:ge,fontFamily:lo.value,fontFamilyMixed:lo.mixed,fontColor:Mi.value,fontColorMixed:Mi.mixed,highlightColor:Gt.value,highlightColorMixed:Gt.mixed,fonts:pr,disabled:Le,onTabChange:h=>En({open:!0,tab:h}),onApply:h=>Ue.applyFontProperties(h),onClose:()=>En({open:!1,tab:Fr.tab})}),l.jsx(tT,{open:Dn.open,tab:Dn.tab,value:Dn.value,disabled:Le,onTabChange:h=>mr({...Dn,open:!0,tab:h}),onApply:h=>Ue.applyParagraphProperties(h),onClose:()=>mr({...Dn,open:!1})}),l.jsx(pT,{open:mo.open,value:mo.value,disabled:Le,onApply:h=>Ue.applyCustomCss(h),onClose:()=>Ol(h=>({...h,open:!1}))}),l.jsx(uT,{open:fo.open,tab:fo.tab,value:fo.value,fonts:pr,disabled:Le,customImagePicker:ke,onCustomImagePick:()=>{ke==null||ke.onPick(h=>{Or(v=>({...v,tab:"paragraph",value:{...v.value,backgroundImage:{...v.value.backgroundImage,src:h.src}}}))})},onTabChange:h=>Or({...fo,open:!0,tab:h}),onApply:h=>Ue.applyPageProperties(h),onResetAtRule:()=>{const h=oe.current;!h||ue.current!=="visual"||RS(h)&&(Me(h,!1),Or(v=>({...v,value:{...v.value,atRule:ya()}})))},onClose:()=>Or({...fo,open:!1})}),l.jsx(mT,{open:gt.open,mode:gt.open?gt.mode:"create",styleId:gt.open&&gt.mode==="edit"?gt.style.id:void 0,name:gt.open&&gt.mode==="edit"?gt.style.name:"",font:gt.open?gt.mode==="edit"?gt.style.font:gt.font:{size:null,unit:ha,marks:Lo(),fontFamily:null,fontColor:null,highlightColor:null},paragraph:gt.open?gt.mode==="edit"?gt.style.paragraph:gt.paragraph:void 0,canDelete:!!Pe,fonts:pr,busy:zl,disabled:Le,onSave:async h=>{const v=ou.current;if(v){po(!0);try{await v(h),zr({open:!1}),await Fa()}finally{po(!1)}}},onDelete:async h=>{const v=Zl.current;if(v){po(!0);try{await v(h),zr({open:!1}),await Fa()}finally{po(!1)}}},onClose:()=>zr({open:!1})}),l.jsx(HT,{open:Dt.open,tab:Dt.tab,href:Dt.href,title:Dt.title,targetBlank:Dt.targetBlank,textDecorationNone:Dt.textDecorationNone,hoverMode:Dt.hoverMode,hoverColor:Dt.hoverColor,hoverHtml:Dt.hoverHtml,bookmarks:Dt.bookmarks,selectedBookmarkId:Dt.selectedBookmarkId,disabled:Le,onTabChange:h=>Ui({...Dt,open:!0,tab:h}),onApply:h=>Ue.applyLink(h),onClose:()=>Ui({...Dt,open:!1})}),l.jsx(gT,{open:Ft.open,existingIds:Ft.existingIds,disabled:Le,onApply:h=>Ue.applyBookmark(h),onClose:()=>Hr({...Ft,open:!1})}),l.jsx(xT,{open:Hl.open,disabled:Le,customImagePicker:ke,onApply:h=>Ue.applyImage(h),onCustomPick:()=>{Ur({open:!1}),ke==null||ke.onPick(ea)},onClose:()=>Ur({open:!1})}),l.jsx(vT,{open:Yc.open,disabled:Le,customAudioPicker:Y,onApply:h=>Ue.applyAudio(h),onCustomPick:()=>{Go({open:!1}),Y==null||Y.onPick(ta)},onClose:()=>Go({open:!1})}),l.jsx(UT,{open:Ul.open,disabled:Le,customVideoPicker:J,onApply:h=>Ue.applyYoutube(h),onCustomPick:()=>{fr({open:!1}),J==null||J.onPick(fs)},onClose:()=>fr({open:!1})}),l.jsx(LT,{open:ho.open,tab:ho.tab,value:ho.value,aspectRatio:ho.aspectRatio,disabled:Le,onTabChange:h=>Ki(v=>({...v,tab:h})),onApply:h=>Ue.applyImageProperties(h),onClose:()=>Ki(h=>({...h,open:!1}))}),l.jsx(YT,{open:Kl.open,disabled:Le,onApply:h=>Ue.applyTable(h),onClose:()=>$l({open:!1})}),l.jsx(ZT,{open:ja.open,value:ja.value,disabled:Le,onApply:h=>Ue.applyTableProperties(h),onClose:()=>$i(h=>({...h,open:!1}))}),l.jsx(rj,{open:Na.open,value:Na.value,disabled:Le,onApply:h=>Ue.applyCellProperties(h),onClose:()=>Vl(h=>({...h,open:!1}))}),l.jsx(lj,{open:Ra.open,value:Ra.value,disabled:Le,onApply:h=>Ue.applyRowProperties(h),onClose:()=>Wl(h=>({...h,open:!1}))}),it==="visual"&&!Le&&(St!=null&&St.isConnected)?l.jsx(zT,{img:St,onResize:Xc,onResizeEnd:Qc}):null,ut&&Ht&&Co?l.jsx(Fj,{thread:Co,locale:T,disabled:k,commentAuthor:wn,onPost:Qa,onClose:()=>Ut(null)}):null,l.jsx(Sw,{open:go.open,x:go.x,y:go.y,kind:go.kind,inTable:go.inTable,canMergeCells:go.canMergeCells,canUnmergeCells:go.canUnmergeCells,commands:Wr,onClose:()=>La(h=>({...h,open:!1}))})]})})})}function v2({toolbarBackground:e,menuColor:n,menuBackground:o,menuFontSize:a,menuFontFamily:s,border:c}){const m={};return e&&(m["--wysiwyg-toolbar-background"]=e),n&&(m["--wysiwyg-menu-color"]=n),o&&(m["--wysiwyg-menu-background"]=o),a&&(m["--wysiwyg-menu-font-size"]=a),s&&(m["--wysiwyg-menu-font-family"]=s),c==="none"?(m["--wysiwyg-border-width"]="0",m["--wysiwyg-border-radius"]="0",m["--wysiwyg-border-shadow"]="none"):c&&(c.width&&(m["--wysiwyg-border-width"]=c.width),c.color&&(m["--wysiwyg-border-color"]=c.color),c.radius&&(m["--wysiwyg-border-radius"]=c.radius),c.shadow&&(m["--wysiwyg-border-shadow"]=c.shadow)),Object.keys(m).length?m:void 0}function x2({onClick:e}){const n=Se();return l.jsx("button",{type:"button",className:vt.exitFullscreen,"aria-label":n("exitFullscreenAria"),onClick:e,children:l.jsx(sn,{className:vt.exitFullscreenIcon})})}function w2(){const e=Se();return l.jsx("div",{className:vt.htmlFileDropOverlay,"aria-hidden":"true",children:e("htmlFileDropOverlay")})}const C2={en:{brandWordmark:"HTML editor Playground",brandHomeAria:"CommsPliant home",sectionPlayground:"Playground",playgroundOpen:"Expand",playgroundClose:"Collapse",playgroundResizeAria:"Resize playground",lede:"Switch between Visual and HTML modes.",placeholder:"Start writing…",languageAria:"Language",localeEn:"English",localeEs:"Español",chromeAria:"Editor chrome",menuVisible:"Menu",toolbarVisible:"Toolbar",fullscreen:"Full screen",allowedChromeAria:"Allowed chrome",allowedChromeAll:"All",allowedChromeFileEdit:"File and Edit",allowedChromeFormat:"Format only",readOnlyAria:"Read only",readOnly:"Read only",readOnlyOff:"Editable",htmlFileDropAria:"HTML file drop",htmlFileDropAllowed:"Drop allowed",htmlFileDropDisabled:"Drop disabled",autoSaveAria:"Auto save",autoSaveOn:"On",autoSaveOff:"Off",autoSaveLast:"Last auto save",autoSaveNever:"Never",fileCallbacksAria:"Save and open",fileCallbacksLocal:"Local file",fileCallbacksHost:"Host callbacks",fileCallbacksLastSave:"Last host save",fileCallbacksNever:"Never",fileCallbacksStored:"Mock storage has a document",fileCallbacksEmpty:"Mock storage is empty (Open loads a sample)",multiPagesAria:"Multi-page editing",multiPagesOff:"Single page",multiPagesOn:"Multi-page",commentsAria:"Comments",commentsOff:"Off",commentsOn:"On",commentsHint:"Select text or an image, then Add comment.",commentsThreadCount:"{count} comment thread(s)",customActionsAria:"Custom actions",customActionsOn:"On",customActionsOff:"Off",appearanceMenuAria:"Menu appearance",menuDefault:"Menu default",menuExample:"Menu example",appearanceBorderAria:"Editor border",borderDefault:"Border default",borderNone:"No border",borderRounded:"Rounded border",appearanceFontsAria:"Document fonts",fontsDefault:"Web-safe fonts",fontsGoogle:"Google fonts",customParagraphStylesAria:"Custom paragraph styles",customParagraphStylesOn:"On",customParagraphStylesOff:"Off",appearanceImageAria:"Image picker",imagePickerDefault:"Built-in insert",imagePickerCustom:"Custom picker tab",imagePickerDirect:"Custom picker only",appearanceToolbarAria:"Toolbar settings",toolbarPersistBrowser:"Browser storage",toolbarPersistApi:"API storage",appearanceDarkModeAria:"Dark mode settings",appearanceDarkModeInitialAria:"Initial chrome theme",darkModeInitialLight:"Start light",darkModeInitialDark:"Start dark",darkModePersistBrowser:"Browser storage",darkModePersistApi:"API storage",appearanceToolbarPositionAria:"Toolbar position",appearanceToolbarPositionInitialAria:"Initial toolbar dock",toolbarPositionTop:"Top",toolbarPositionLeft:"Left",toolbarPositionRight:"Right",toolbarPositionBottom:"Bottom",toolbarPositionPersistBrowser:"Browser storage",toolbarPositionPersistApi:"API storage",imagePickerTab:"Gallery",imagePickerDescription:"Choose an image from the sample gallery.",imagePickerButton:"Open gallery",imageGalleryTitle:"Sample gallery",imageGalleryCancel:"Cancel",imageGalleryMountain:"Mountain",imageGalleryLake:"Lake",menuTools:"Tools",commandAi:"AI",aiDialogTitle:"AI generated text",aiHtmlLabel:"HTML",aiFormattedLabel:"Formatted text (optional)",aiSample:"<p>This is the AI generated example text</p>",aiOk:"OK",aiCancel:"Cancel",codeExamplesLink:"Code examples",codeExamplesClose:"Close",chromeExampleBody:"Show or hide the menu bar and icon toolbar, and control the full-screen overlay from the host.",allowedChromeExampleBody:"Pass allowedChrome to show only the menus and icon-toolbar buttons the host allows. The two lists are independent. Omit the prop to show everything. Customize toolbar and persistence still apply on the allowed toolbar subset.",readOnlyExampleBody:"Lock both editing surfaces and all menus and toolbar buttons from the host. Default is false. Same lock as disabled.",htmlFileDropExampleBody:"Dropping an HTML file onto the document replaces it, the same as File → Open. Set disableHtmlFileDrop to ignore drops. File → Open is unchanged.",autoSaveExampleBody:"Pass onAutoSave to persist the document HTML. The editor polls every second and calls the callback only when the HTML changed. Omit the prop to disable. The callback is not awaited, so editing is not blocked.",fileCallbacksExampleBody:"By default, File → Save and Open use the built-in local HTML file picker. Pass onSave and/or onOpen to delegate to the host instead. The two props are independent. HTML file drag-drop is unchanged.",multiPagesExampleBody:"Set enableMultiPages to edit multiple independent HTML pages in visual mode. Host onSave, onOpen, and onAutoSave receive all pages as a string array. Built-in file save/open still operate on the focused page only. HTML source mode shows all pages separated by <!-- wysiwyg-page-separator -->.",commentsExampleBody:"Set enableComments to add comment threads anchored with data-comment-thread markers. Pass commentAuthor for posting identity and onCommentsChange to persist CommentThread[] separately from document HTML. Use stripCommentAnchors(html) for sanitized publish HTML. In readOnly mode, comment operations fire onCommentsChange only.",customActionsExampleBody:"Pass a customActions array to add host buttons, menu items, or both. Labels and tooltips are your copy — the library does not translate them.",menuExampleBody:"Restyle the dropdown menu bar only — not the icon toolbar. Load any custom webfont on the host page before passing its family name.",borderExampleBody:"Set the outer editor box. Use “none” to remove width, radius and shadow. Object fields are independent; omitted fields keep the defaults. Ignored in full screen.",fontsExampleBody:"Pass customFonts to append host faces after the built-in web-safe list. Optional css is a stylesheet URL. When a webfont is used, its stylesheet link is prepended to exported HTML.",customParagraphStylesExampleBody:"Pass loadCustomParagraphStyles and onSaveCustomParagraphStyle to persist host-defined styles under Format → Paragraph styles and the toolbar style dropdown. Custom styles and Add new stay hidden unless both callbacks are set. The Delete button is shown only when onDeleteCustomParagraphStyle is set.",imageExampleBody:"Pass customImagePicker to add a third Insert image source. Set disableBuiltinImageInsert to skip the built-in dialog and open your picker immediately.",audioExampleBody:"Pass customAudioPicker to add a third Insert audio source. Set disableBuiltinAudioInsert to skip the built-in dialog and open your picker immediately.",youtubeExampleBody:"Pass customVideoPicker to add a third Insert YouTube video source. Set disableBuiltinVideoInsert to skip the built-in dialog and open your picker immediately.",appearanceAudioAria:"Audio picker",audioPickerDefault:"Built-in insert",audioPickerCustom:"Custom picker tab",audioPickerDirect:"Custom picker only",audioPickerTab:"Library",audioPickerDescription:"Choose audio from the sample library.",audioPickerButton:"Open library",audioGalleryTitle:"Sample audio library",audioGalleryCancel:"Cancel",audioGalleryIntro:"Intro track",audioGalleryOutro:"Outro track",appearanceVideoAria:"YouTube video picker",videoPickerDefault:"Built-in insert",videoPickerCustom:"Custom picker tab",videoPickerDirect:"Custom picker only",videoPickerTab:"Library",videoPickerDescription:"Choose a video from the sample library.",videoPickerButton:"Open library",videoGalleryTitle:"Sample video library",videoGalleryCancel:"Cancel",videoGalleryYoutube:"YouTube sample",videoGalleryHosted:"Hosted MP4 sample",toolbarExampleBody:"Omit toolbarCustomization to persist layout in localStorage. Pass load and save to store it on the host, including async APIs.",darkModeExampleBody:"darkMode is the initial chrome theme when nothing is persisted (default false, light). Omit darkModePersistence to persist View → Light mode / Dark mode in localStorage. Pass load and save to store it on the host. Visual and HTML surfaces stay unchanged.",toolbarPositionExampleBody:"toolbarPosition is the initial icon-toolbar dock when nothing is persisted (default top). The menu bar stays at the top. Omit toolbarPositionPersistence to persist View → Toolbar → Position in localStorage. Pass load and save to store it on the host. Top and bottom wrap; left and right stay a single column.",languageExampleBody:"Pass locale to switch library chrome between English and Spanish. Document content is not translated.",footerGithub:"GitHub:",footerGithubLink:"commspliant/html-editor",footerBroughtBy:"Brought to you by CommsPliant Communication",navAria:"Playground sections",navPlayground:"Playground",navDocumentation:"Documentation"},es:{brandWordmark:"Playground del editor HTML",brandHomeAria:"Inicio de CommsPliant",sectionPlayground:"Playground",playgroundOpen:"Expandir",playgroundClose:"Contraer",playgroundResizeAria:"Redimensionar el playground",lede:"Cambia entre los modos Visual y HTML.",placeholder:"Empieza a escribir…",languageAria:"Idioma",localeEn:"English",localeEs:"Español",chromeAria:"Chrome del editor",menuVisible:"Menú",toolbarVisible:"Barra de herramientas",fullscreen:"Pantalla completa",allowedChromeAria:"Chrome permitido",allowedChromeAll:"Todo",allowedChromeFileEdit:"Archivo y Editar",allowedChromeFormat:"Solo Formato",readOnlyAria:"Solo lectura",readOnly:"Solo lectura",readOnlyOff:"Editable",htmlFileDropAria:"Soltar archivo HTML",htmlFileDropAllowed:"Soltar permitido",htmlFileDropDisabled:"Soltar desactivado",autoSaveAria:"Autoguardado",autoSaveOn:"Activado",autoSaveOff:"Desactivado",autoSaveLast:"Último autoguardado",autoSaveNever:"Nunca",fileCallbacksAria:"Guardar y abrir",fileCallbacksLocal:"Archivo local",fileCallbacksHost:"Callbacks del anfitrión",fileCallbacksLastSave:"Último guardado del anfitrión",fileCallbacksNever:"Nunca",fileCallbacksStored:"El almacenamiento simulado tiene un documento",fileCallbacksEmpty:"El almacenamiento simulado está vacío (Abrir carga un ejemplo)",multiPagesAria:"Edición multipágina",multiPagesOff:"Una página",multiPagesOn:"Multipágina",commentsAria:"Comentarios",commentsOff:"Desactivado",commentsOn:"Activado",commentsHint:"Selecciona texto o una imagen y usa Añadir comentario.",commentsThreadCount:"{count} hilo(s) de comentarios",customActionsAria:"Acciones personalizadas",customActionsOn:"Activado",customActionsOff:"Desactivado",appearanceMenuAria:"Apariencia del menú",menuDefault:"Menú predeterminado",menuExample:"Menú de ejemplo",appearanceBorderAria:"Borde del editor",borderDefault:"Borde predeterminado",borderNone:"Sin borde",borderRounded:"Borde redondeado",appearanceFontsAria:"Fuentes del documento",fontsDefault:"Fuentes web",fontsGoogle:"Fuentes de Google",customParagraphStylesAria:"Estilos de párrafo personalizados",customParagraphStylesOn:"Activado",customParagraphStylesOff:"Desactivado",appearanceImageAria:"Selector de imagen",imagePickerDefault:"Inserción integrada",imagePickerCustom:"Pestaña de selector",imagePickerDirect:"Solo selector",appearanceToolbarAria:"Configuración de la barra",toolbarPersistBrowser:"Almacenamiento del navegador",toolbarPersistApi:"Almacenamiento API",appearanceDarkModeAria:"Configuración del modo oscuro",appearanceDarkModeInitialAria:"Tema inicial del chrome",darkModeInitialLight:"Iniciar claro",darkModeInitialDark:"Iniciar oscuro",darkModePersistBrowser:"Almacenamiento del navegador",darkModePersistApi:"Almacenamiento API",appearanceToolbarPositionAria:"Posición de la barra",appearanceToolbarPositionInitialAria:"Acoplamiento inicial de la barra",toolbarPositionTop:"Arriba",toolbarPositionLeft:"Izquierda",toolbarPositionRight:"Derecha",toolbarPositionBottom:"Abajo",toolbarPositionPersistBrowser:"Almacenamiento del navegador",toolbarPositionPersistApi:"Almacenamiento API",imagePickerTab:"Galería",imagePickerDescription:"Elige una imagen de la galería de ejemplo.",imagePickerButton:"Abrir galería",imageGalleryTitle:"Galería de ejemplo",imageGalleryCancel:"Cancelar",imageGalleryMountain:"Montaña",imageGalleryLake:"Lago",menuTools:"Herramientas",commandAi:"IA",aiDialogTitle:"Texto generado por IA",aiHtmlLabel:"HTML",aiFormattedLabel:"Texto con formato (opcional)",aiSample:"<p>Este es el texto de ejemplo generado por IA</p>",aiOk:"Aceptar",aiCancel:"Cancelar",codeExamplesLink:"Ejemplos de código",codeExamplesClose:"Cerrar",chromeExampleBody:"Muestra u oculta la barra de menú y la barra de iconos, y controla la pantalla completa desde la aplicación anfitriona.",allowedChromeExampleBody:"Pasa allowedChrome para mostrar solo los menús y botones de la barra que el anfitrión permite. Las dos listas son independientes. Omite la propiedad para mostrar todo. Personalizar la barra y la persistencia siguen aplicándose al subconjunto permitido.",readOnlyExampleBody:"Bloquea ambas superficies de edición y todos los menús y botones de la barra desde la aplicación anfitriona. El valor predeterminado es false. El mismo bloqueo que disabled.",htmlFileDropExampleBody:"Soltar un archivo HTML sobre el documento lo reemplaza, igual que Archivo → Abrir. Con disableHtmlFileDrop se ignoran las sueltas. Archivo → Abrir no cambia.",autoSaveExampleBody:"Pasa onAutoSave para persistir el HTML del documento. El editor consulta cada segundo y llama al callback solo si el HTML cambió. Omite la propiedad para desactivarlo. El callback no se espera, así que la edición no se bloquea.",fileCallbacksExampleBody:"Por defecto, Archivo → Guardar y Abrir usan el selector de archivo HTML integrado. Pasa onSave y/o onOpen para delegar en el anfitrión. Las dos propiedades son independientes. Soltar un archivo HTML no cambia.",multiPagesExampleBody:"Con enableMultiPages puedes editar varias páginas HTML independientes en modo visual. Los callbacks del anfitrión onSave, onOpen y onAutoSave reciben todas las páginas como un array de cadenas. Guardar/abrir integrado sigue operando solo en la página activa. El modo HTML muestra todas las páginas separadas por <!-- wysiwyg-page-separator -->.",commentsExampleBody:"Con enableComments puedes añadir hilos de comentarios anclados con data-comment-thread. Pasa commentAuthor para la identidad al publicar y onCommentsChange para persistir CommentThread[] aparte del HTML del documento. Usa stripCommentAnchors(html) para HTML publicado sin anclajes. En modo readOnly, las operaciones de comentarios solo disparan onCommentsChange.",customActionsExampleBody:"Pasa un array customActions para añadir botones y elementos de menú de la aplicación. Las etiquetas y descripciones emergentes son tu texto: la biblioteca no las traduce.",menuExampleBody:"Cambia solo el estilo de la barra de menús desplegables, no la barra de iconos. Carga cualquier fuente web en la página anfitriona antes de pasar su familia.",borderExampleBody:"Define el recuadro exterior del editor. Usa “none” para quitar grosor, radio y sombra. Los campos del objeto son independientes; los omitidos conservan los valores predeterminados. Se ignora en pantalla completa.",fontsExampleBody:"Pasa customFonts para añadir fuentes de la aplicación después de la lista web segura. El css opcional es una URL de hoja de estilos. Si se usa una webfont, su enlace se antepone al HTML exportado.",customParagraphStylesExampleBody:"Pasa loadCustomParagraphStyles y onSaveCustomParagraphStyle para persistir estilos definidos por el anfitrión en Formato → Estilos de párrafo y el desplegable de estilo. Los estilos personalizados y Añadir nuevo se ocultan salvo que ambos callbacks estén definidos. El botón Eliminar solo aparece si se pasa onDeleteCustomParagraphStyle.",imageExampleBody:"Pasa customImagePicker para añadir una tercera fuente de inserción de imágenes. Con disableBuiltinImageInsert se omite el diálogo integrado y se abre tu selector de inmediato.",audioExampleBody:"Pasa customAudioPicker para añadir una tercera fuente de inserción de audio. Con disableBuiltinAudioInsert se omite el diálogo integrado y se abre tu selector de inmediato.",youtubeExampleBody:"Pasa customVideoPicker para añadir una tercera fuente de inserción de vídeo de YouTube. Con disableBuiltinVideoInsert se omite el diálogo integrado y se abre tu selector de inmediato.",appearanceAudioAria:"Selector de audio",audioPickerDefault:"Inserción integrada",audioPickerCustom:"Pestaña de selector",audioPickerDirect:"Solo selector",audioPickerTab:"Biblioteca",audioPickerDescription:"Elige audio de la biblioteca de ejemplo.",audioPickerButton:"Abrir biblioteca",audioGalleryTitle:"Biblioteca de audio de ejemplo",audioGalleryCancel:"Cancelar",audioGalleryIntro:"Pista intro",audioGalleryOutro:"Pista outro",appearanceVideoAria:"Selector de vídeo de YouTube",videoPickerDefault:"Inserción integrada",videoPickerCustom:"Pestaña de selector",videoPickerDirect:"Solo selector",videoPickerTab:"Biblioteca",videoPickerDescription:"Elige un vídeo de la biblioteca de ejemplo.",videoPickerButton:"Abrir biblioteca",videoGalleryTitle:"Biblioteca de vídeo de ejemplo",videoGalleryCancel:"Cancelar",videoGalleryYoutube:"Ejemplo de YouTube",videoGalleryHosted:"Ejemplo MP4 alojado",toolbarExampleBody:"Omite toolbarCustomization para guardar el diseño en localStorage. Pasa load y save para almacenarlo en el anfitrión, incluidas las APIs asíncronas.",darkModeExampleBody:"darkMode es el tema inicial del chrome cuando no hay nada persistido (false por defecto, claro). Omite darkModePersistence para guardar Vista → Modo claro / Modo oscuro en localStorage. Pasa load y save para almacenarlo en el anfitrión. Las superficies Visual y HTML no cambian.",toolbarPositionExampleBody:"toolbarPosition es el acoplamiento inicial de la barra de iconos cuando no hay nada persistido (arriba por defecto). La barra de menú se queda arriba. Omite toolbarPositionPersistence para guardar Vista → Barra de herramientas → Posición en localStorage. Pasa load y save para almacenarlo en el anfitrión. Arriba y abajo envuelven; izquierda y derecha se quedan en una sola columna.",languageExampleBody:"Pasa locale para cambiar el chrome de la biblioteca entre inglés y español. El contenido del documento no se traduce.",footerGithub:"GitHub:",footerGithubLink:"commspliant/html-editor",footerBroughtBy:"Presentado por CommsPliant Communication",navAria:"Secciones del playground",navPlayground:"Playground",navDocumentation:"Documentación"}},S2={chrome:{titleKey:"chromeAria",bodyKey:"chromeExampleBody",snippets:[`import { useState } from 'react'
136
+ import { Editor } from 'commspliant-html-editor'
137
+
138
+ export function App() {
139
+ const [fullscreen, setFullscreen] = useState(false)
140
+
141
+ return (
142
+ <Editor
143
+ menuVisible
144
+ toolbarVisible
145
+ fullscreen={fullscreen}
146
+ onFullscreenChange={setFullscreen}
147
+ />
148
+ )
149
+ }`,`import { Editor } from 'commspliant-html-editor'
150
+
151
+ <Editor menuVisible={false} toolbarVisible={false} />`]},allowedChrome:{titleKey:"allowedChromeAria",bodyKey:"allowedChromeExampleBody",snippets:[`import { Editor, type AllowedChrome } from 'commspliant-html-editor'
152
+
153
+ const allowedChrome: AllowedChrome = {
154
+ menus: ['file', 'edit'],
155
+ toolbar: ['save', 'open', 'print', 'undo', 'redo'],
156
+ }
157
+
158
+ <Editor allowedChrome={allowedChrome} />`,`import { Editor } from 'commspliant-html-editor'
159
+
160
+ <Editor />`]},readOnly:{titleKey:"readOnlyAria",bodyKey:"readOnlyExampleBody",snippets:[`import { Editor } from 'commspliant-html-editor'
161
+
162
+ <Editor readOnly defaultValue="<p>Hello</p>" />`]},htmlFileDrop:{titleKey:"htmlFileDropAria",bodyKey:"htmlFileDropExampleBody",snippets:[`import { Editor } from 'commspliant-html-editor'
163
+
164
+ <Editor disableHtmlFileDrop />`]},autoSave:{titleKey:"autoSaveAria",bodyKey:"autoSaveExampleBody",snippets:[`import { Editor } from 'commspliant-html-editor'
165
+
166
+ <Editor
167
+ defaultValue="<p>Hello</p>"
168
+ onAutoSave={(html) => {
169
+ void fetch('/save', { method: 'POST', body: html })
170
+ }}
171
+ />`]},fileCallbacks:{titleKey:"fileCallbacksAria",bodyKey:"fileCallbacksExampleBody",snippets:[`import { Editor } from 'commspliant-html-editor'
172
+
173
+ <Editor
174
+ defaultValue="<p>Hello</p>"
175
+ onSave={async (html) => {
176
+ await fetch('/api/documents/current', { method: 'PUT', body: html })
177
+ }}
178
+ onOpen={async () => {
179
+ const response = await fetch('/api/documents/current')
180
+ if (!response.ok) return null
181
+ return response.text()
182
+ }}
183
+ />`]},multiPages:{titleKey:"multiPagesAria",bodyKey:"multiPagesExampleBody",snippets:[`import { useState } from 'react'
184
+ import { Editor } from 'commspliant-html-editor'
185
+
186
+ export function MultiPageEditor() {
187
+ const [pages, setPages] = useState(['<p>Page one</p>', '<p>Page two</p>'])
188
+
189
+ return (
190
+ <Editor
191
+ enableMultiPages
192
+ pages={pages}
193
+ onPagesChange={(nextPages) => setPages(nextPages)}
194
+ onSave={async (payload) => {
195
+ if (Array.isArray(payload)) {
196
+ await fetch('/api/documents/current/pages', {
197
+ method: 'PUT',
198
+ body: JSON.stringify(payload),
199
+ })
200
+ }
201
+ }}
202
+ onOpen={async () => {
203
+ const response = await fetch('/api/documents/current/pages')
204
+ if (!response.ok) return null
205
+ return response.json() as Promise<string[]>
206
+ }}
207
+ />
208
+ )
209
+ }`]},comments:{titleKey:"commentsAria",bodyKey:"commentsExampleBody",snippets:[`import { useState } from 'react'
210
+ import { Editor, stripCommentAnchors, type CommentThread } from 'commspliant-html-editor'
211
+
212
+ export function CommentingEditor() {
213
+ const [comments, setComments] = useState<CommentThread[]>([])
214
+
215
+ return (
216
+ <Editor
217
+ enableComments
218
+ commentAuthor={{ userId: 'u1', userName: 'Reviewer' }}
219
+ comments={comments}
220
+ onCommentsChange={setComments}
221
+ onChange={(html) => {
222
+ const publishHtml = stripCommentAnchors(html)
223
+ // persist publishHtml separately from comments
224
+ }}
225
+ />
226
+ )
227
+ }`]},customActions:{titleKey:"customActionsAria",bodyKey:"customActionsExampleBody",snippets:[`import { Editor, type CustomAction } from 'commspliant-html-editor'
228
+
229
+ const insertStamp: CustomAction = {
230
+ id: 'stamp',
231
+ label: 'Stamp',
232
+ showIn: 'both',
233
+ menu: { id: 'tools', label: 'Tools' },
234
+ onAction: (api) => {
235
+ api.insertHtml('<p>[stamp]</p>')
236
+ },
237
+ }
238
+
239
+ <Editor customActions={[insertStamp]} />`]},menu:{titleKey:"appearanceMenuAria",bodyKey:"menuExampleBody",snippets:[`import { Editor } from 'commspliant-html-editor'
240
+
241
+ <Editor
242
+ menuColor="#1e3a5f"
243
+ menuBackground="#fef3c7"
244
+ menuFontSize="1.05rem"
245
+ menuFontFamily="Georgia, serif"
246
+ />`]},border:{titleKey:"appearanceBorderAria",bodyKey:"borderExampleBody",snippets:[`import { Editor } from 'commspliant-html-editor'
247
+
248
+ <Editor border="none" />`,`import { Editor, type EditorBorder } from 'commspliant-html-editor'
249
+
250
+ const border: EditorBorder = {
251
+ width: '2px',
252
+ color: '#2563eb',
253
+ radius: '12px',
254
+ shadow: '0 8px 24px rgb(0 0 0 / 15%)',
255
+ }
256
+
257
+ <Editor border={border} />`]},fonts:{titleKey:"appearanceFontsAria",bodyKey:"fontsExampleBody",snippets:[`import { Editor, type CustomFont } from 'commspliant-html-editor'
258
+
259
+ const customFonts: CustomFont[] = [
260
+ {
261
+ name: 'Roboto',
262
+ family: 'Roboto, sans-serif',
263
+ css: 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap',
264
+ },
265
+ ]
266
+
267
+ <Editor customFonts={customFonts} />`]},customParagraphStyles:{titleKey:"customParagraphStylesAria",bodyKey:"customParagraphStylesExampleBody",snippets:[`import { Editor, type CustomParagraphStyle } from 'commspliant-html-editor'
268
+
269
+ let stored: CustomParagraphStyle[] = []
270
+
271
+ <Editor
272
+ loadCustomParagraphStyles={async () => stored.map((style) => ({ ...style }))}
273
+ onSaveCustomParagraphStyle={async (style) => {
274
+ const index = stored.findIndex((item) => item.id === style.id)
275
+ if (index >= 0) stored[index] = style
276
+ else stored = [...stored, style]
277
+ }}
278
+ onDeleteCustomParagraphStyle={async (id) => {
279
+ stored = stored.filter((style) => style.id !== id)
280
+ }}
281
+ />`]},image:{titleKey:"appearanceImageAria",bodyKey:"imageExampleBody",snippets:[`import { Editor, type CustomImagePicker } from 'commspliant-html-editor'
282
+
283
+ const gallery: CustomImagePicker = {
284
+ text: 'Gallery',
285
+ description: 'Choose from your media library.',
286
+ buttonCaption: 'Open gallery',
287
+ onPick: (insertImage) => {
288
+ insertImage({
289
+ src: '/photo.jpg',
290
+ alt: 'Lake',
291
+ css: 'width: 200px; border-radius: 8px',
292
+ })
293
+ },
294
+ }
295
+
296
+ <Editor customImagePicker={gallery} />`,`import { Editor } from 'commspliant-html-editor'
297
+
298
+ <Editor customImagePicker={gallery} disableBuiltinImageInsert />`]},audio:{titleKey:"appearanceAudioAria",bodyKey:"audioExampleBody",snippets:[`import { Editor, type CustomAudioPicker } from 'commspliant-html-editor'
299
+
300
+ const library: CustomAudioPicker = {
301
+ text: 'Library',
302
+ description: 'Choose from your audio library.',
303
+ buttonCaption: 'Open library',
304
+ onPick: (insertAudio) => {
305
+ insertAudio({
306
+ src: '/intro.mp3',
307
+ title: 'Intro',
308
+ })
309
+ },
310
+ }
311
+
312
+ <Editor customAudioPicker={library} />`,`import { Editor } from 'commspliant-html-editor'
313
+
314
+ <Editor customAudioPicker={library} disableBuiltinAudioInsert />`]},youtube:{titleKey:"appearanceVideoAria",bodyKey:"youtubeExampleBody",snippets:[`import { Editor, type CustomVideoPicker } from 'commspliant-html-editor'
315
+
316
+ const library: CustomVideoPicker = {
317
+ text: 'Library',
318
+ description: 'Choose from your video library.',
319
+ buttonCaption: 'Open library',
320
+ onPick: (insertVideo) => {
321
+ insertVideo({
322
+ src: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
323
+ title: 'Demo',
324
+ })
325
+ },
326
+ }
327
+
328
+ <Editor customVideoPicker={library} />`,`import { Editor } from 'commspliant-html-editor'
329
+
330
+ <Editor customVideoPicker={library} disableBuiltinVideoInsert />`]},toolbar:{titleKey:"appearanceToolbarAria",bodyKey:"toolbarExampleBody",snippets:[`import { Editor, type ToolbarCustomizationPersistence } from 'commspliant-html-editor'
331
+
332
+ let stored = null
333
+
334
+ const toolbarCustomization: ToolbarCustomizationPersistence = {
335
+ load: async () => stored,
336
+ save: async (settings) => {
337
+ stored = settings
338
+ },
339
+ }
340
+
341
+ <Editor toolbarCustomization={toolbarCustomization} />`,`import { Editor } from 'commspliant-html-editor'
342
+
343
+ <Editor />`]},darkMode:{titleKey:"appearanceDarkModeAria",bodyKey:"darkModeExampleBody",snippets:[`import { Editor, type DarkModePersistence } from 'commspliant-html-editor'
344
+
345
+ let stored = null
346
+
347
+ const darkModePersistence: DarkModePersistence = {
348
+ load: async () => stored,
349
+ save: async (darkMode) => {
350
+ stored = darkMode
351
+ },
352
+ }
353
+
354
+ <Editor darkMode={false} darkModePersistence={darkModePersistence} />`,`import { Editor } from 'commspliant-html-editor'
355
+
356
+ <Editor />`]},toolbarPosition:{titleKey:"appearanceToolbarPositionAria",bodyKey:"toolbarPositionExampleBody",snippets:[`import { Editor, type ToolbarPositionPersistence } from 'commspliant-html-editor'
357
+
358
+ let stored = null
359
+
360
+ const toolbarPositionPersistence: ToolbarPositionPersistence = {
361
+ load: async () => stored,
362
+ save: async (position) => {
363
+ stored = position
364
+ },
365
+ }
366
+
367
+ <Editor toolbarPosition="top" toolbarPositionPersistence={toolbarPositionPersistence} />`,`import { Editor } from 'commspliant-html-editor'
368
+
369
+ <Editor toolbarPosition="left" />`]},language:{titleKey:"languageAria",bodyKey:"languageExampleBody",snippets:[`import { Editor } from 'commspliant-html-editor'
370
+
371
+ <Editor locale="en" />`,`import { Editor } from 'commspliant-html-editor'
372
+
373
+ <Editor locale="es" />`]}};function k2({blockId:e,messages:n,onClose:o}){const a=S2[e],s=n[a.titleKey],c=n[a.bodyKey];return l.jsx("div",{className:"ai-dialog-backdrop",onClick:o,onKeyDown:m=>{m.key==="Escape"&&o()},children:l.jsxs("div",{className:"ai-dialog code-example-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-example-title",onClick:m=>m.stopPropagation(),children:[l.jsx("h2",{id:"code-example-title",className:"ai-dialog-title",children:s}),l.jsx("p",{className:"code-example-body",children:c}),a.snippets.map(m=>l.jsx("pre",{className:"code-example-pre",children:l.jsx("code",{children:m})},m)),l.jsx("div",{className:"ai-dialog-actions",children:l.jsx("button",{type:"button",className:"ai-dialog-button",onClick:o,children:n.codeExamplesClose})})]})})}const P2="# commspliant-html-editor\n\n**Try it out here:** [https://htmleditor.commspliant.com/](https://htmleditor.commspliant.com/)\n\n[![WYSIWYG editor screenshot](screenshot.png)](https://htmleditor.commspliant.com/)\n\nReusable React + TypeScript editor with two base modes: **Visual** (`contenteditable`) and **HTML** (plain-text source). Downstream apps import the package; they do not copy source.\n\n## Install\n\n```bash\nnpm install commspliant-html-editor\n```\n\n## Usage\n\nPeer dependencies: `react` and `react-dom` (^18).\n\n```tsx\nimport { useState } from 'react'\nimport { Editor } from 'commspliant-html-editor'\nimport 'commspliant-html-editor/styles.css'\n\nexport function App() {\n const [fullscreen, setFullscreen] = useState(false)\n\n return (\n <div style={{ height: '100%' }}>\n <Editor\n defaultValue=\"<p>Hello <strong>world</strong></p>\"\n placeholder=\"Start writing…\"\n fullscreen={fullscreen}\n onFullscreenChange={setFullscreen}\n />\n </div>\n )\n}\n```\n\nGive the editor a parent with a definite height (`height: 100%` on a sized ancestor, or `flex: 1; min-height: 0` in a column flex). The in-page editor fills that height: the document well scrolls and the menu and toolbar stay visible. Full screen does not need a sized parent; it covers the viewport.\n\n### Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `value` | `string` | — | Controlled HTML document |\n| `defaultValue` | `string` | `''` | Initial HTML when uncontrolled |\n| `onChange` | `(html: string) => void` | — | Fires when either surface edits the document |\n| `onAutoSave` | `(html: string \\| string[]) => void` | — | Polls every 1s; calls only when the document HTML changed. See [Auto save](#auto-save) |\n| `onSave` | `(html: string \\| string[]) => void` | — | File → Save host callback. See [Save and open](#save-and-open) |\n| `onOpen` | `() => string \\| string[] \\| null` | — | File → Open host callback. See [Save and open](#save-and-open) |\n| `mode` | `'visual' \\| 'html'` | — | Controlled mode |\n| `defaultMode` | `'visual' \\| 'html'` | `'visual'` | Initial mode when uncontrolled |\n| `onModeChange` | `(mode: EditorMode) => void` | — | Fires when the built-in Visual / HTML toggle is used |\n| `fullscreen` | `boolean` | — | Controlled full-screen overlay |\n| `defaultFullscreen` | `boolean` | `false` | Initial overlay when uncontrolled |\n| `onFullscreenChange` | `(fullscreen: boolean) => void` | — | Fires when full screen is entered or exited |\n| `placeholder` | `string` | — | Empty-state hint |\n| `disabled` | `boolean` | `false` | Same lock as `readOnly`. Either prop being true locks the editor |\n| `readOnly` | `boolean` | `false` | Locks document editing. When `enableComments` is also true, comment chrome stays available and `onCommentsChange` still fires; anchor writes do not call `onChange`. See [Comments](#comments) |\n| `className` | `string` | — | Extra class on the editor root |\n| `locale` | `'en' \\| 'es'` | `'en'` | Library chrome language. Document content is not translated |\n| `toolbarBackground` | `string` | `#f0f0f0` | CSS color for the icon toolbar row. Omit to use the default light gray |\n| `menuColor` | `string` | `#444` | CSS color for menu bar text and dropdown items |\n| `menuBackground` | `string` | `#fff` | CSS color for the menu bar and dropdown panel |\n| `menuFontSize` | `string` | `0.875rem` | CSS font-size for menu triggers and items. Omit to use the default |\n| `menuFontFamily` | `string` | inherit | CSS font-family for menus. Omit to inherit `system-ui, sans-serif`. Load webfonts on the host page before passing a custom family |\n| `border` | `'none' \\| EditorBorder` | `1px` `#d0d0d0`, radius `6px` | Outer editor box. `'none'` removes width, radius, and shadow. Object fields (`width`, `color`, `radius`, `shadow`) are independent; omitted fields keep the defaults |\n| `menuVisible` | `boolean` | `true` | Show the dropdown menu bar. Set `false` to hide it |\n| `toolbarVisible` | `boolean` | `true` | Show the icon toolbar. Set `false` to hide it |\n| `allowedChrome` | `AllowedChrome` | — | Host allowlist of menus and icon-toolbar buttons. Omit to show everything. See [Allowed chrome](#allowed-chrome) |\n| `toolbarPosition` | `'top' \\| 'left' \\| 'right' \\| 'bottom'` | `'top'` | Initial icon-toolbar dock when nothing is persisted. See [Toolbar position](#toolbar-position) |\n| `toolbarPositionPersistence` | `ToolbarPositionPersistence` | — | Host load/save for the icon-toolbar dock. Omit to persist in `localStorage`. See [Toolbar position](#toolbar-position) |\n| `customActions` | `CustomAction[]` | — | Host-defined menu items and/or toolbar buttons. See [Custom actions](#custom-actions) |\n| `customFonts` | `CustomFont[]` | — | Extra document font faces after the built-in web-safe list. See [Custom fonts](#custom-fonts) |\n| `loadCustomParagraphStyles` | `() => CustomParagraphStyle[] \\| Promise<…>` | — | Load host-persisted custom paragraph styles. See [Custom paragraph styles](#custom-paragraph-styles) |\n| `onSaveCustomParagraphStyle` | `(style: CustomParagraphStyle) => void` | — | Persist a created or edited custom paragraph style. Custom styles stay hidden unless this and `loadCustomParagraphStyles` are both set |\n| `onDeleteCustomParagraphStyle` | `(id: string) => void` | — | Persist deletion of a custom paragraph style. The Delete button is shown only when this is set |\n| `transformHtml` | `(html: string) => string` | — | Optional map over document HTML before it is stored and passed to `onChange`. See [Transform HTML](#transform-html) |\n| `customImagePicker` | `CustomImagePicker` | — | Optional third Insert image source. See [Custom image picker](#custom-image-picker) |\n| `disableBuiltinImageInsert` | `boolean` | `false` | Skip the Insert image dialog and call `customImagePicker.onPick` from the toolbar or Insert menu |\n| `customAudioPicker` | `CustomAudioPicker` | — | Optional third Insert audio source. See [Custom audio picker](#custom-audio-picker) |\n| `disableBuiltinAudioInsert` | `boolean` | `false` | Skip the Insert audio dialog and call `customAudioPicker.onPick` from the Insert menu |\n| `customVideoPicker` | `CustomVideoPicker` | — | Optional third Insert YouTube video source. See [Custom video picker](#custom-video-picker) |\n| `disableBuiltinVideoInsert` | `boolean` | `false` | Skip the Insert YouTube video dialog and call `customVideoPicker.onPick` from the Insert menu |\n| `disableHtmlFileDrop` | `boolean` | `false` | When true, dropping an HTML file on the editor does not replace the document. File → Open is unchanged |\n| `enableMultiPages` | `boolean` | `false` | When true, edit multiple independent HTML pages in visual mode. See [Multi-page editing](#multi-page-editing) |\n| `pages` | `string[]` | — | Controlled page HTML strings when `enableMultiPages` is true |\n| `defaultPages` | `string[]` | — | Initial pages when uncontrolled and `enableMultiPages` is true |\n| `onPagesChange` | `(pages: string[], activePageIndex: number) => void` | — | Fires when any page changes while multi-page mode is enabled |\n| `enableComments` | `boolean` | `false` | When true, comment chrome and thread state are enabled. See [Comments](#comments) |\n| `commentAuthor` | `CommentAuthor` | — | `{ userId, userName }` identity for posting messages in the comment panel |\n| `comments` | `CommentThread[]` | — | Controlled comment thread array (metadata separate from document HTML) |\n| `defaultComments` | `CommentThread[]` | `[]` | Initial threads when uncontrolled |\n| `onCommentsChange` | `(threads: CommentThread[]) => void` | — | Fires when comment threads change |\n| `toolbarCustomization` | `ToolbarCustomizationPersistence` | — | Host load/save for icon-toolbar layout. Omit to persist in `localStorage`. See [Customize toolbar](#customize-toolbar) |\n| `darkMode` | `boolean` | `false` | Initial chrome theme when nothing is persisted (`true` = dark). See [Dark mode](#dark-mode) |\n| `darkModePersistence` | `DarkModePersistence` | — | Host load/save for the chrome theme. Omit to persist in `localStorage`. See [Dark mode](#dark-mode) |\n\n`mode`, `value`, and `fullscreen` are optional. Omit them for internal state; pass them to control from the parent. Chrome includes a File menu (Save, Load, and Print), an Edit menu (Undo, Redo, and Page properties), an Insert menu (Link, Bookmark, Image, Audio, YouTube video, Table, and Horizontal line), a Table menu (Insert table, row and column items, Merge cells, Unmerge cells, and table/cell/row properties), a View menu (Visual, HTML, Toolbar customize and position, Light/Dark mode, Preview, Read aloud, and Full screen), and a Format menu (paragraph styles, font, clear formatting, paragraph, and image properties), unless `menuVisible` is `false`. The icon toolbar has File (Save and Load), Print, Edit (Undo and Redo), Insert (Link, Bookmark, Image, Table, and Horizontal line), Table (Merge cells and Unmerge cells), Font, Align, Paragraph, and View (Visual | HTML | Preview | Read aloud) groups, with Full screen pinned last, unless `toolbarVisible` is `false`. Hide both to drop the chrome slot entirely. View → Toolbar → Position docks the icon toolbar (the menu bar stays at the top). Top and bottom wrap onto multiple rows when they cannot fit on one line; Full screen stays last, pinned to the right of the first row. Left and right stay a single column and grow the editor instead of wrapping into extra columns. Full screen covers the host page with a fixed overlay; an X control (and Escape) returns to the in-page layout. Visual and HTML mode stay independent of the overlay. By default, Save writes the current document to an HTML file and Load replaces it from an HTML file; pass `onSave` and/or `onOpen` to delegate to host callbacks instead (see [Save and open](#save-and-open)). Dropping an `.html` / `.htm` file onto the document surface does the same as Load, unless `disableHtmlFileDrop` is set. Print opens the browser print dialog for the document HTML only (not the editor chrome). Preview (View menu and View icon group) opens a large dialog with a scrollable rendering of the current document HTML. Read aloud (View menu and View icon group) uses the browser’s built-in speech synthesis to read the current selection, or the full document when nothing is selected; click again to stop. Undo and Redo walk document HTML history; they are grayed out when there is nothing to undo or redo. The File, Edit, and Insert menu items use the same icons as the toolbar buttons where both exist. Link wraps the selection (or inserts the URL as the visible text at the caret) in an `<a href>` tag; an optional title becomes the native hover tooltip, and opening in a new tab sets `target=\"_blank\"`. Bookmark inserts a named destination (`id`) at the caret or around the selection. Audio and YouTube video are available from the Insert menu only (no toolbar buttons). Horizontal line inserts an `<hr>` at the caret.\n\n`menuColor`, `menuBackground`, `menuFontSize`, and `menuFontFamily` restyle the dropdown menu bar and panels only — not the icon toolbar. `border` is the outer editor box and is ignored in fullscreen. Custom menu fonts must already be available on the page.\n\nThe toolbar Font dropdown lists web-safe faces (Arial, Georgia, Times New Roman, and the rest of the usual stacks). Choose **Default** to clear an authored `font-family` so the text inherits. Applied faces are written as inline `style=\"font-family: …\"` on the selection (or the page shell from Page properties).\n\n### Custom CSS\n\nFormat → Font → **Custom CSS** (and the Custom CSS icon in the Font toolbar group) opens a dialog with a multi-line textarea. With text selected or the caret inside styled text, existing inline CSS is pre-filled — one declaration per line, split at each `;`. On **OK**, declarations are merged onto the current inline styles (matching property names are overridden; others are kept). Use an empty value (e.g. `color:`) to remove a property. The result is stored as compressed one-line inline CSS on a `<span>`. With only a caret (no selection), the CSS applies to the next characters you type. An empty textarea is a no-op. Visual mode only.\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor />\n// Format → Font → Custom CSS, or the Custom CSS toolbar button\n```\n\n### Page properties\n\nEdit → Page → **Page properties** opens a dialog with **Font**, **Paragraph**, and **Print** tabs. Paragraph sub-tabs include **Spacing**, **Border**, **Background** (fill color and page opacity), and **Background Image**. The **Print** tab edits `@page` size, orientation, and margins.\n\nThe first time page properties are applied, content is wrapped in a single `<div data-page>` shell with `width: 100%` and `height: 100%`. Background **color** is written on that shell. Background **image** uses the same file, URL, or custom picker as Insert → Image, plus independent width and height (default width `100%`, height unset), and opacity, fit, and position controls (the same options as Image properties → Advanced). Rotation is not supported for page backgrounds. Width and height write `background-size`; keyword fit values (`cover`, `contain`) replace those dimensions.\n\nWhen a background image is set, a single managed first child `<div id=\"commspliant-background\" data-page-bg contenteditable=\"false\">` holds the image layer so image opacity does not fade page text. If that id already exists in the editor, it is reused and extras are removed. The layer sits behind content (`z-index: -1`) so the document stays editable:\n\n```html\n<div data-page style=\"width:100%;height:100%;position:relative;isolation:isolate;background-color:#fff\">\n <div id=\"commspliant-background\" data-page-bg contenteditable=\"false\"\n style=\"position:absolute;inset:0;z-index:-1;pointer-events:none;user-select:none;background-image:url(&quot;https://example.com/bg.png&quot;);background-size:cover;background-position:center;background-repeat:no-repeat;opacity:0.9\"></div>\n <p>Hello</p>\n</div>\n```\n\nThe visual editor holder mirrors the shell fill and background image for display only; serialized `value` HTML is unchanged by that paint step.\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor />\n// Edit → Page → Page properties → Paragraph → Background Image\n```\n\n### Editor chrome\n\nShow or hide the menu bar and icon toolbar, and control the full-screen overlay from the host. View → Toolbar → Position docks the icon toolbar; the menu bar stays at the top. Top and bottom wrap onto multiple rows when they cannot fit on one line; Full screen stays last, pinned to the right of the first row. Left and right stay a single column.\n\nOn the visual surface, a mouse right-click opens the editor context menu (cut, copy, font and paragraph properties, and table items — including merge and unmerge — when the caret is in a table). A touch or pen long-press does not; phones keep the native selection handles and OS Copy / Paste callout so text can be selected.\n\n```tsx\nimport { useState } from 'react'\nimport { Editor } from 'commspliant-html-editor'\n\nexport function App() {\n const [fullscreen, setFullscreen] = useState(false)\n\n return (\n <Editor\n menuVisible\n toolbarVisible\n fullscreen={fullscreen}\n onFullscreenChange={setFullscreen}\n />\n )\n}\n```\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor menuVisible={false} toolbarVisible={false} />\n```\n\n### Allowed chrome\n\nPass `allowedChrome` to show only the menus and icon-toolbar buttons the host allows. Omit the prop (or either field) to leave that surface unfiltered.\n\nThe two lists are independent: hiding the File menu does not hide Save on the toolbar, and hiding the Print button does not hide File → Print. `menus` is top-level menu ids only: `file`, `edit`, `insert`, `table`, `view`, and `format` (plus any custom menu id from `customActions`). `toolbar` is icon-toolbar item ids:\n\n`save`, `open`, `print`, `undo`, `redo`, `link`, `bookmark`, `image`, `table`, `horizontalRule`, `mergeCells`, `unmergeCells`, `fontFamily`, `paragraphStyle`, `fontSize`, `fontColor`, `highlightColor`, `customCss`, `formatBrush`, `bold`, `italic`, `underline`, `strikethrough`, `clearFormatting`, `alignLeft`, `alignCenter`, `alignRight`, `alignJustify`, `indent`, `outdent`, `bulletList`, `numberedList`, `visual`, `html`, `preview`, `readAloud`, `fullscreen`\n\nThe **Format brush** icon (`formatBrush`) is toolbar-only. Select source text, click the brush to copy inline character formatting (bold, italic, underline, strikethrough, font, size, color, highlight, custom CSS), then select target text to apply. Click the brush again or click it without a selection to cancel.\n\nIf `toolbar` is set, custom action ids must be listed to appear on the icon bar.\n\nEmpty arrays hide that surface (`menus: []` shows no dropdowns; `toolbar: []` shows no icons). The right-click context menu is not filtered. Commands stay registered; this only hides chrome.\n\nPage properties (including the Print / `@page` tab) live under **Edit → Page**. Hosts that allow only `format` in `allowedChrome` will not show Page properties unless `edit` is included too.\n\nView → Toolbar → Customize toolbar and its persistence still work as they do today, on the allowed toolbar subset. The dialog lists only allowed icon-toolbar items.\n\n```tsx\nimport { Editor, type AllowedChrome } from 'commspliant-html-editor'\n\nconst allowedChrome: AllowedChrome = {\n menus: ['file', 'edit'],\n toolbar: ['save', 'open', 'print', 'undo', 'redo'],\n}\n\n<Editor allowedChrome={allowedChrome} />\n```\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor />\n```\n\n### Toolbar position\n\nView → Toolbar → Position docks the **icon toolbar** (Top, Left, Right, or Bottom). The dropdown menu bar stays at the top.\n\n`toolbarPosition` is the initial dock when nothing is persisted. Default `'top'`. Choosing a position in the menu updates the live layout and persistence.\n\nTop and bottom wrap onto extra rows when the icons cannot fit on one line. Left and right stay a **single column**: extra icons grow the editor instead of wrapping into a second column.\n\nOmit `toolbarPositionPersistence` to persist that choice in the browser (`localStorage`). Pass `load` and `save` to store it on the host. Both may be async. `load` may return `null` to fall back to `toolbarPosition`.\n\n```tsx\nimport { Editor, type ToolbarPositionPersistence } from 'commspliant-html-editor'\n\nlet stored = null\n\nconst toolbarPositionPersistence: ToolbarPositionPersistence = {\n load: async () => stored,\n save: async (position) => {\n stored = position\n },\n}\n\n<Editor toolbarPosition=\"top\" toolbarPositionPersistence={toolbarPositionPersistence} />\n```\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor toolbarPosition=\"left\" />\n```\n\n### Read only\n\nLock both editing surfaces and all menus and toolbar buttons from the host. Default is `false`. Same lock as `disabled`.\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor readOnly defaultValue=\"<p>Hello</p>\" />\n```\n\n### HTML file drop\n\nDropping an HTML file onto the document (visual or HTML mode) replaces the current document, the same as File → Open. Default is allowed. Set `disableHtmlFileDrop` to ignore drops; Open is unchanged.\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor disableHtmlFileDrop />\n```\n\n### Menu appearance\n\nRestyle the dropdown menu bar only — not the icon toolbar. Load any custom webfont on the host page before passing its family name.\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor\n menuColor=\"#1e3a5f\"\n menuBackground=\"#fef3c7\"\n menuFontSize=\"1.05rem\"\n menuFontFamily=\"Georgia, serif\"\n/>\n```\n\n### Editor border\n\nSet the outer editor box. Use `\"none\"` to remove width, radius and shadow. Object fields are independent; omitted fields keep the defaults. Ignored in full screen.\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor border=\"none\" />\n```\n\n```tsx\nimport { Editor, type EditorBorder } from 'commspliant-html-editor'\n\nconst border: EditorBorder = {\n width: '2px',\n color: '#2563eb',\n radius: '12px',\n shadow: '0 8px 24px rgb(0 0 0 / 15%)',\n}\n\n<Editor border={border} />\n```\n\n### Locale\n\nPass `locale` to switch library chrome between English and Spanish. Document content is not translated.\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor locale=\"en\" />\n```\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor locale=\"es\" />\n```\n\n### Custom fonts\n\nPass `customFonts` to append host faces after the built-in list. Duplicate `family` values are ignored. Optional `css` is a stylesheet URL (Google Fonts CSS, or a host file with `@font-face`) — not a raw `.woff2`. The editor loads those stylesheets for the picker preview. When a webfont is used in the document, its `<link rel=\"stylesheet\">` is prepended to the HTML `onChange` receives, so the snippet still loads the face outside the editor.\n\n```tsx\n<Editor\n customFonts={[\n {\n name: 'Roboto',\n family: 'Roboto, sans-serif',\n css: 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap',\n },\n ]}\n/>\n```\n\n### Custom paragraph styles\n\nPass `loadCustomParagraphStyles` and `onSaveCustomParagraphStyle` to persist host-defined styles under Format → Paragraph styles and the toolbar style dropdown. Built-in Paragraph and H1–H6 stay available either way. Custom styles and **Add new** stay hidden unless both callbacks are set. `load` runs on mount and again after save or delete (it may be async; the UI shows a spinner). The Delete button is shown only when `onDeleteCustomParagraphStyle` is set. Hosts usually persist what the dialog saves rather than hand-authoring styles.\n\n```tsx\nimport { Editor, type CustomParagraphStyle } from 'commspliant-html-editor'\n\nlet stored: CustomParagraphStyle[] = []\n\n<Editor\n loadCustomParagraphStyles={async () => stored.map((style) => ({ ...style }))}\n onSaveCustomParagraphStyle={async (style) => {\n const index = stored.findIndex((item) => item.id === style.id)\n if (index >= 0) stored[index] = style\n else stored = [...stored, style]\n }}\n onDeleteCustomParagraphStyle={async (id) => {\n stored = stored.filter((style) => style.id !== id)\n }}\n/>\n```\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Stable id. The dialog assigns one on create |\n| `name` | `string` | Visible name. Always trimmed and non-empty on save |\n| `font` | `CustomParagraphStyleFont` | Size, unit, marks, family, and colors captured by the dialog |\n| `paragraph` | `CustomParagraphStyleParagraph` | Optional paragraph box: align, list, margin, padding, line-height, border, radius, shadow, background, opacity |\n\nOmit all three props to keep only the built-in styles.\n\n### Transform HTML\n\nPass `transformHtml` to sanitize or enhance the document on every write: visual typing and paste, HTML-source edits, Load, dropped HTML files, inserts, and `setHtml`. The result is what the editor stores and what `onChange` receives. Inbound `value` / `defaultValue` are not transformed — sanitize those before passing if needed.\n\n```tsx\n<Editor\n defaultValue=\"<p>Hello</p>\"\n transformHtml={(html) => html.replace(/<script[\\s\\S]*?<\\/script>/gi, '')}\n/>\n```\n\nKeep the callback idempotent. If it rewrites markup on every keystroke (pretty-print, wrap tags), the visual surface resyncs `innerHTML` and the caret may jump. Prefer stripping disallowed tags over format-on-type.\n\n### Auto save\n\nPass `onAutoSave` to persist the document HTML from the host. The editor polls every second and calls the callback only when that HTML changed since the last auto-save. Omit the prop to disable (the default). The callback is not awaited, so a slow or failing save does not block editing.\n\nThe HTML is the same string `onChange` receives (after `transformHtml`, with font stylesheet links when a custom face is used). The initial document is not treated as a change.\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor\n defaultValue=\"<p>Hello</p>\"\n onAutoSave={(html) => {\n void fetch('/save', { method: 'POST', body: html })\n }}\n/>\n```\n\n### Save and open\n\nBy default, File → Save and the Save toolbar button write the document to a local HTML file (browser save picker or download). File → Open and the Open toolbar button load from a local HTML file. Omit both callbacks to keep that behavior.\n\nPass `onSave` to persist through the host instead of the built-in file picker. It receives the current document HTML (same as `onChange`, after `transformHtml`) and is awaited.\n\nPass `onOpen` to load through the host instead of the built-in file picker. Return document HTML to replace the editor, or `null` to cancel. The callback is awaited. HTML file drag-drop is unchanged — it still reads a local file and does not call `onOpen`.\n\nThe two props are independent: set only `onSave` to keep Open on the local picker, or only `onOpen` to keep Save on the local picker.\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor\n defaultValue=\"<p>Hello</p>\"\n onSave={async (html) => {\n await fetch('/api/documents/current', { method: 'PUT', body: html })\n }}\n onOpen={async () => {\n const response = await fetch('/api/documents/current')\n if (!response.ok) return null\n return response.text()\n }}\n/>\n```\n\n### Multi-page editing\n\nSet `enableMultiPages` to edit several independent HTML pages in visual mode. Pages appear stacked with toolbar-colored gaps between them. Use Insert → Page to add a page after the focused one. Edit → Page → Page properties includes a Print tab for `@page` size, orientation, and margins; Reset removes the print rule from the active page.\n\nWhen multi-page mode is off (default), behavior is unchanged.\n\n**HTML source mode** shows all pages in one textarea, separated by:\n\n```html\n<!-- wysiwyg-page-separator -->\n```\n\n**Persistence:**\n\n- Built-in File → Save / Open operate on the **focused page only** (single `.html` file).\n- Host `onSave`, `onOpen`, and `onAutoSave` receive **all pages** as a `string[]` when `enableMultiPages` is true.\n- Use `onPagesChange` for controlled multi-page state. Export helpers: `splitPagesFromHtml`, `joinPagesToHtml`, and `PAGE_SEPARATOR` from the package.\n\n```tsx\nimport { useState } from 'react'\nimport { Editor } from 'commspliant-html-editor'\n\nexport function MultiPageEditor() {\n const [pages, setPages] = useState(['<p>Page one</p>', '<p>Page two</p>'])\n\n return (\n <Editor\n enableMultiPages\n pages={pages}\n onPagesChange={(nextPages) => setPages(nextPages)}\n onSave={async (payload) => {\n if (Array.isArray(payload)) {\n await fetch('/api/documents/pages', {\n method: 'PUT',\n body: JSON.stringify(payload),\n })\n }\n }}\n />\n )\n}\n```\n\n### Comments\n\nSet `enableComments` to add lightweight comment threads anchored in the document with `data-comment-thread` markers. Thread metadata (`CommentThread[]`) is separate from document HTML — use `comments` / `onCommentsChange` to persist it.\n\n- **Add comment** (toolbar Insert group and Insert → Comment) wraps the selection or marks the selected image, then opens the comment panel.\n- **Show/Hide comments** (View menu and View icon group) toggles highlight styling only; thread data and anchors remain.\n- **`commentAuthor`** (`{ userId, userName }`) is required to enable Post in the panel.\n\n**Sanitized HTML:** export `stripCommentAnchors` from the package to remove comment-only spans and attributes for published document HTML:\n\n```tsx\nimport { Editor, stripCommentAnchors } from 'commspliant-html-editor'\n\n// Editor HTML may include anchors:\n// <p>Price was <span data-comment-thread=\"cmt_…\">£150</span> last week.</p>\n\nconst clean = stripCommentAnchors(html)\n// <p>Price was £150 last week.</p>\n```\n\n**Read-only documents:** with `readOnly` and `enableComments`, users can still add and reply to comments. Anchor DOM updates fire `onCommentsChange` only — not `onChange`. Supply `value` and `comments` on load; the editor re-applies anchors for highlights.\n\n```tsx\nimport { useState } from 'react'\nimport { Editor, type CommentThread } from 'commspliant-html-editor'\n\nexport function ReviewEditor() {\n const [comments, setComments] = useState<CommentThread[]>([])\n\n return (\n <Editor\n value=\"<p>Immutable version</p>\"\n readOnly\n enableComments\n commentAuthor={{ userId: 'u1', userName: 'Reviewer' }}\n comments={comments}\n onCommentsChange={setComments}\n />\n )\n}\n```\n\n### Custom actions\n\nPass a `customActions` array to add host buttons, menu items, or both. Labels and tooltips are your copy — the library does not translate them.\n\n```tsx\nimport { Editor, type CustomAction } from 'commspliant-html-editor'\n\nconst insertStamp: CustomAction = {\n id: 'stamp',\n label: 'Stamp',\n showIn: 'both',\n menu: { id: 'tools', label: 'Tools' },\n onAction: (api) => {\n api.insertHtml('<p>[stamp]</p>')\n },\n}\n\n<Editor customActions={[insertStamp]} />\n```\n\nEach object:\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Stable id. Must not collide with catalog item ids (see [Allowed chrome](#allowed-chrome)) |\n| `label` | `string` | Menu item text; also the toolbar tooltip and accessible name when those are omitted |\n| `tooltip` | `string` | Toolbar tooltip. Defaults to `label` |\n| `icon` | React component | Optional 16×16 icon. Omit to use the built-in custom-action icon |\n| `showIn` | `'menu'` \\| `'toolbar'` \\| `'both'` | Which chrome surfaces show the action |\n| `menu` | `{ id?: string; label?: string }` | Menu placement. Built-in ids: `file`, `edit`, `insert`, `view`, `format`. Other ids create a new top-level menu. Default id: `custom` |\n| `toolbarGroup` | `string` | Icon group. Built-in ids: `file`, `edit`, `insert`, `view`. Other ids create a group before Full screen. Default: `custom` |\n| `onAction` | `(api: CustomActionApi) => void` | Called when the item is activated |\n\n**Placement**\n\n- New top-level menu: `{ menu: { id: 'tools', label: 'Tools' } }`\n- Item in an existing menu: `{ menu: { id: 'file' } }`\n- Existing toolbar group: `{ toolbarGroup: 'file' }`\n- Array order is the order inside the target menu or group\n- `showIn: 'menu'` skips the toolbar; `'toolbar'` skips the menu\n\nWhen the action runs, `onAction` receives a snapshot of the caret or selection plus edit helpers. You choose the outcome:\n\n| Method | Effect |\n| --- | --- |\n| `api.selection.text` | Selected plain text, or `''` if the caret is collapsed |\n| `api.selection.start` / `end` | Offsets (visual: `textContent`; HTML mode: textarea indices) |\n| `api.insertHtml(html, formattedText?)` | Insert HTML at the caret, or replace the selection. Pass `formattedText` to insert visible text instead of parsing markup |\n| `api.insertText(text)` | Insert formatted text at the caret, or replace the selection |\n| `api.setHtml(html)` | Replace the entire document |\n| `api.getHtml()` | Current document HTML |\n\nThe snapshot is taken before chrome steals focus, so a host dialog can call `insertHtml` later and still hit the original caret or selection.\n\nBoth modes share one HTML string. Switching Visual → HTML flushes the contenteditable markup into the textarea; switching back mounts that string into the visual surface.\n\n### Custom image picker\n\nPass `customImagePicker` to add a third Insert image source. Labels are your copy — the library does not translate them. When the host finishes picking, call the `insertImage` function received by `onPick`.\n\n```tsx\nimport { Editor, type CustomImagePicker } from 'commspliant-html-editor'\n\nconst gallery: CustomImagePicker = {\n text: 'Gallery',\n description: 'Choose from your media library.',\n buttonCaption: 'Open gallery',\n onPick: (insertImage) => {\n openHostGallery().then((picked) => {\n insertImage({\n src: picked.url,\n alt: picked.alt,\n title: picked.title,\n css: 'width: 200px; border-radius: 8px',\n })\n })\n },\n}\n\n<Editor customImagePicker={gallery} />\n```\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `text` | `string` | Third source / navigation button label |\n| `description` | `string` | Shown on the custom source panel |\n| `buttonCaption` | `string` | Caption of the button that starts the host picker |\n| `onPick` | `(insertImage) => void` | Called when that button is clicked. Call `insertImage` with a URL or raster data URL, plus optional `alt`, `title`, and inline `css` |\n\nOmit `customImagePicker` to keep File and URL only. Set `disableBuiltinImageInsert` to skip the dialog: Insert → Image and the toolbar Image button call `onPick` immediately.\n\n```tsx\n<Editor customImagePicker={gallery} disableBuiltinImageInsert />\n```\n\n`insertImage` uses the same insert path as File and URL: an `<img>` with inline `max-width: 100%; height: auto`, then any host `css`. `src` must be `http(s)`, a relative path, or a raster `data:` URL.\n\n`onPick` from Page properties (Edit → Page → Page properties → Background Image) leaves the editor dialog open so the picked URL can fill the draft. If your picker is a modal overlay, give it a `z-index` above editor dialogs (`1200`).\n\n### Custom audio picker\n\nPass `customAudioPicker` to add a third Insert audio source. Labels are your copy — the library does not translate them. When the host finishes picking, call the `insertAudio` function received by `onPick`.\n\n```tsx\nimport { Editor, type CustomAudioPicker } from 'commspliant-html-editor'\n\nconst library: CustomAudioPicker = {\n text: 'Library',\n description: 'Choose from your audio library.',\n buttonCaption: 'Open library',\n onPick: (insertAudio) => {\n openHostLibrary().then((picked) => {\n insertAudio({\n src: picked.url,\n title: picked.title,\n css: 'width: 100%',\n })\n })\n },\n}\n\n<Editor customAudioPicker={library} />\n```\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `text` | `string` | Third source / navigation button label |\n| `description` | `string` | Shown on the custom source panel |\n| `buttonCaption` | `string` | Caption of the button that starts the host picker |\n| `onPick` | `(insertAudio) => void` | Called when that button is clicked. Call `insertAudio` with a URL or audio `data:` URL, plus optional `title` and inline `css` |\n\nOmit `customAudioPicker` to keep File and URL only. Set `disableBuiltinAudioInsert` to skip the dialog: Insert → Audio calls `onPick` immediately.\n\n```tsx\n<Editor customAudioPicker={library} disableBuiltinAudioInsert />\n```\n\n`insertAudio` uses the same insert path as File and URL: an `<audio controls>` with inline `max-width: 100%`, then any host `css`. `src` must be `http(s)`, a relative path, or an audio `data:` URL.\n\n### Custom video picker\n\nPass `customVideoPicker` to add a third Insert YouTube video source. Labels are your copy — the library does not translate them. When the host finishes picking, call the `insertVideo` function received by `onPick`.\n\n```tsx\nimport { Editor, type CustomVideoPicker } from 'commspliant-html-editor'\n\nconst library: CustomVideoPicker = {\n text: 'Library',\n description: 'Choose from your video library.',\n buttonCaption: 'Open library',\n onPick: (insertVideo) => {\n openHostLibrary().then((picked) => {\n insertVideo({\n src: picked.url,\n title: picked.title,\n css: 'max-width: 100%',\n })\n })\n },\n}\n\n<Editor customVideoPicker={library} />\n```\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `text` | `string` | Third source / navigation button label |\n| `description` | `string` | Shown on the custom source panel |\n| `buttonCaption` | `string` | Caption of the button that starts the host picker |\n| `onPick` | `(insertVideo) => void` | Called when that button is clicked. Call `insertVideo` when the host picker finishes |\n\nOmit `customVideoPicker` to keep URL only. Set `disableBuiltinVideoInsert` to skip the dialog: Insert → YouTube video calls `onPick` immediately.\n\n```tsx\n<Editor customVideoPicker={library} disableBuiltinVideoInsert />\n```\n\nThe built-in dialog accepts YouTube watch, embed, shorts, and `youtu.be` URLs and inserts an `<iframe>` embed with inline sizing. From the host picker, a YouTube URL inserts the same iframe; other `http(s)` video URLs insert a `<video controls>` element. Both use inline styles in the serialized HTML.\n\n### Customize toolbar\n\nView → Toolbar → Customize toolbar shows every icon-toolbar group (or only the items in `allowedChrome.toolbar` when that list is set). Uncheck an item to hide it on the icon toolbar (menus stay the same). Drag groups — not individual buttons — to reorder them. Full screen stays pinned last. Reset restores the library default.\n\nOmit `toolbarCustomization` to persist that layout in the browser (`localStorage`). Pass `load` and `save` to store it on the host. Both may be async; the dialog shows a loader while they run.\n\n```tsx\nimport { Editor, type ToolbarCustomizationPersistence } from 'commspliant-html-editor'\n\nlet stored = null\n\nconst toolbarCustomization: ToolbarCustomizationPersistence = {\n load: async () => stored,\n save: async (settings) => {\n stored = settings\n },\n}\n\n<Editor toolbarCustomization={toolbarCustomization} />\n```\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor />\n```\n\nNew toolbar buttons and groups belong in the feature catalog and default icon layout. The customize dialog reads that merged layout, so they appear automatically. Saved settings merge with the current default: unknown ids are ignored, and new ids show (visible, in default-relative order).\n\n### Dark mode\n\nView → Light mode / Dark mode restyles editor chrome (menus, icon toolbar, buttons, dialogs, and popups). The Visual and HTML document surfaces stay as they are.\n\n`darkMode` is the initial theme when nothing is persisted. Default `false` (light). Choosing Light or Dark in the View menu updates the live chrome and persistence.\n\nOmit `darkModePersistence` to persist that choice in the browser (`localStorage`). Pass `load` and `save` to store it on the host. Both may be async. `load` may return `null` to fall back to `darkMode`.\n\n```tsx\nimport { Editor, type DarkModePersistence } from 'commspliant-html-editor'\n\nlet stored = null\n\nconst darkModePersistence: DarkModePersistence = {\n load: async () => stored,\n save: async (darkMode) => {\n stored = darkMode\n },\n}\n\n<Editor darkMode={false} darkModePersistence={darkModePersistence} />\n```\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n\n<Editor />\n```\n\n### Style isolation\n\nThe shipped CSS resets inherited styles on the editor root and restyles chrome and the visual document so typical host-page rules (`p`, `button`, `textarea`, inherited typography) do not restyle the editor. Pass `className` on the root to override that look on purpose. Isolation is not a hard boundary: high-specificity host selectors or `!important` can still win.\n\n## Development\n\n```bash\nmake install # npm install\nmake dev # playground at the Vite dev server\nmake build # static playground to dist/ (index.html for hosting)\nmake build-lib # library to dist/ (es, cjs, types, CSS)\nmake preview # serve dist/ locally\nmake test # vitest\nmake storybook # Storybook on port 6006\nmake publish # library to dist/, then npm publish\n```\n\n`make build` and `make build-lib` both write to `dist/` and overwrite each other. Use `make build` for the hosted demo; use `make build-lib` when packaging the library. `make publish` always runs `make build-lib` first so the playground build is not uploaded. You must be logged in (`npm login`) with 2FA enabled.\n\n- `src/` is the library. Public exports live in `src/index.ts`.\n- `playground/` is a consumer app: it imports `commspliant-html-editor` the same way other projects will. No editor logic belongs there.\n- Stories (`*.stories.tsx`) sit next to public UI and are the visual contract.\n- Tests (`*.test.ts(x)`) sit next to modules.\n\nThe live demo is the playground static build. DigitalOcean App Platform defaults (`npm run build`, output `dist`) match this. Deploy a **static site** from the repo root with:\n\n- **Build command:** `npm run build` (or leave the Node default)\n- **Output directory:** `dist` (not `playground/dist`)\n- **Source directory:** `/`\n- **Node:** 18+ (this repo pins 20 via `.nvmrc`; set `NODE_VERSION=20` if the build image ignores it)\n\n```tsx\nimport { Editor } from 'commspliant-html-editor'\n```\n\n[Brought to you by CommsPliant Communication](https://commspliant.com/)\n";function _s(e){const n=[],o=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\))/g;let a=0,s,c=0;for(;(s=o.exec(e))!==null;){s.index>a&&n.push(e.slice(a,s.index));const m=s[0];if(m.startsWith("**"))n.push(l.jsx("strong",{children:m.slice(2,-2)},c));else if(m.startsWith("`"))n.push(l.jsx("code",{children:m.slice(1,-1)},c));else{const g=m.match(/^\[([^\]]+)\]\(([^)]+)\)$/);g&&n.push(l.jsx("a",{href:g[2],target:"_blank",rel:"noopener noreferrer",children:g[1]},c))}c+=1,a=s.index+m.length}return a<e.length&&n.push(e.slice(a)),n}function Yg(e){const n=e.replace(/^\|/,"").replace(/\|$/,""),o=[];let a="";for(let s=0;s<n.length;s+=1)n[s]==="\\"&&n[s+1]==="|"?(a+="|",s+=1):n[s]==="|"?(o.push(a.trim()),a=""):a+=n[s];return o.push(a.trim()),o}function E2(e){return/^\|?\s*:?-{3,}/.test(e)}function qg(e){const n=e.replace(/\r\n/g,`
374
+ `).split(`
375
+ `),o=[];let a=0,s=0;for(;a<n.length;){const c=n[a];if(c.trim()===""){a+=1;continue}const m=c.match(/^(#{1,3})\s+(.*)$/);if(m){const y=m[1].length,w=`h${y}`;o.push(l.jsx(w,{className:`docs-h${y}`,children:_s(m[2])},s)),s+=1,a+=1;continue}if(c.trimStart().startsWith("|")){const y=[];for(;a<n.length&&n[a].trimStart().startsWith("|");)y.push(n[a]),a+=1;const w=y.filter(C=>!E2(C));if(w.length>0){const C=Yg(w[0]),S=w.slice(1).map(Yg);o.push(l.jsx("div",{className:"docs-table-wrap",children:l.jsxs("table",{className:"docs-table",children:[l.jsx("thead",{children:l.jsx("tr",{children:C.map(E=>l.jsx("th",{children:_s(E)},E))})}),l.jsx("tbody",{children:S.map(E=>l.jsx("tr",{children:E.map((k,A)=>l.jsx("td",{children:_s(k)},`${A}-${k}`))},E.join("|")))})]})},s)),s+=1}continue}if(/^\s*[-*]\s+/.test(c)||/^\s*\d+\.\s+/.test(c)){const y=[],w=/^\s*\d+\.\s+/.test(c);for(;a<n.length&&(w?/^\s*\d+\.\s+/.test(n[a]):/^\s*[-*]\s+/.test(n[a]));)y.push(n[a].replace(/^\s*(?:[-*]|\d+\.)\s+/,"")),a+=1;const C=w?"ol":"ul";o.push(l.jsx(C,{className:"docs-list",children:y.map(S=>l.jsx("li",{children:_s(S)},S))},s)),s+=1;continue}const g=[];for(;a<n.length&&n[a].trim()!==""&&!n[a].match(/^(#{1,3})\s+/)&&!n[a].trimStart().startsWith("|")&&!/^\s*[-*]\s+/.test(n[a])&&!/^\s*\d+\.\s+/.test(n[a]);)g.push(n[a]),a+=1;o.push(l.jsx("p",{className:"docs-p",children:_s(g.join(" "))},s)),s+=1}return o}function A2({markdown:e}){const n=[],o=/```(\w*)\n([\s\S]*?)```/g;let a=0,s,c=0;for(;(s=o.exec(e))!==null;)s.index>a&&(n.push(l.jsx(f.Fragment,{children:qg(e.slice(a,s.index))},`t-${c}`)),c+=1),n.push(l.jsx("pre",{className:"code-example-pre docs-pre",children:l.jsx("code",{children:s[2].replace(/\n$/,"")})},`c-${c}`)),c+=1,a=s.index+s[0].length;return a<e.length&&n.push(l.jsx(f.Fragment,{children:qg(e.slice(a))},`t-${c}`)),l.jsx("div",{className:"docs-markdown",children:n})}function D2({label:e}){return l.jsx("section",{className:"docs-page","aria-label":e,children:l.jsx("article",{className:"docs-article",children:l.jsx(A2,{markdown:P2})})})}const T2="<p>Sample document from mock host storage</p>",j2="<p>Hello <strong>world</strong></p>",N2='<p>Price was <strong>£150</strong> last week. Select text or the image below, then use <strong>Add comment</strong>.</p><p><img src="https://picsum.photos/seed/wysiwyg-comments/320/180" alt="Sample diagram" width="320" height="180"></p>',R2={menus:["file","edit"],toolbar:["save","open","print","undo","redo"]},L2={menus:["format"],toolbar:["fontFamily","paragraphStyle","fontSize","fontColor","highlightColor","bold","italic","underline","strikethrough","clearFormatting","alignLeft","alignCenter","alignRight","alignJustify","indent","outdent","bulletList","numberedList"]},M2=[{src:"https://picsum.photos/id/1015/400/300",altKey:"imageGalleryMountain"},{src:"https://picsum.photos/id/1016/400/300",altKey:"imageGalleryLake"}],_2=[{src:"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",titleKey:"audioGalleryIntro"},{src:"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3",titleKey:"audioGalleryOutro"}],I2=[{src:"https://www.youtube.com/watch?v=dQw4w9WgXcQ",titleKey:"videoGalleryYoutube"},{src:"https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",titleKey:"videoGalleryHosted"}],qf=800,Tl=800;let pa=[];function jr(e){return new Promise(n=>{setTimeout(n,e)})}async function F2(){return await jr(qf),pa.map(e=>({...e,font:{...e.font,marks:{...e.font.marks}}}))}async function B2(e){await jr(qf);const n=pa.findIndex(o=>o.id===e.id);if(n>=0){pa[n]=e;return}pa=[...pa,e]}async function O2(e){await jr(qf),pa=pa.filter(n=>n.id!==e)}let wv=null;async function z2(){return await jr(Tl),wv}async function H2(e){await jr(Tl),wv=e}let Cv=null;async function U2(){return await jr(Tl),Cv}async function K2(e){await jr(Tl),Cv=e}let Sv=null;async function $2(){return await jr(Tl),Sv}async function V2(e){await jr(Tl),Sv=e}const kv=400;let Xf=null;async function W2(e){await jr(kv),Xf=e}async function G2(){return await jr(kv),Xf??T2}const Y2={menuColor:"#1e3a5f",menuBackground:"#fef3c7",menuFontSize:"1.05rem",menuFontFamily:"Georgia, serif"},q2={width:"2px",color:"#2563eb",radius:"12px",shadow:"0 8px 24px rgb(0 0 0 / 15%)"},X2=280,zs=200,Xg=16;function pc(e,n){const o=Math.max(zs,n*.5);return Math.min(o,Math.max(zs,e))}function bt({label:e,examplesLabel:n,onOpenExamples:o}){return l.jsxs("div",{className:"control-group-heading",children:[l.jsx("span",{className:"control-group-label",children:e}),l.jsx("button",{type:"button",className:"code-examples-link",onClick:o,children:n})]})}const Q2=[{name:"Roboto",family:"Roboto, sans-serif",css:"https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap"},{name:"Pacifico",family:"Pacifico, cursive",css:"https://fonts.googleapis.com/css2?family=Pacifico&display=swap"},{name:"Source Serif 4",family:'"Source Serif 4", serif',css:"https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,700&display=swap"}];function J2(){var Ct;const[e,n]=f.useState(!1),[o,a]=f.useState(X2),[s,c]=f.useState(!1),[m,g]=f.useState("en"),[y,w]=f.useState(!0),[C,S]=f.useState(!0),[E,k]=f.useState("all"),[A,P]=f.useState(!1),[T,j]=f.useState(!1),[F,L]=f.useState(!1),[H,z]=f.useState(!1),[q,G]=f.useState(null),[Q,$]=f.useState("local"),[V,K]=f.useState(!1),[X,de]=f.useState(!0),[ce,Pe]=f.useState([]),[ke,je]=f.useState(null),[Y,pe]=f.useState(()=>Xf!==null),[J,M]=f.useState(!0),[N,re]=f.useState(!0),[fe,ae]=f.useState("default"),[Ce,Re]=f.useState("default"),[De,Be]=f.useState(!1),[Qe,un]=f.useState("default"),[ut,wn]=f.useState("default"),[In,Io]=f.useState("default"),[oo,Le]=f.useState("browser"),[Cn,Fo]=f.useState("browser"),[or,ir]=f.useState(!1),[ot,Bo]=f.useState("browser"),[it,Nr]=f.useState("top"),[tn,Sn]=f.useState(null),[Ht,Oo]=f.useState(null),[Mt,Ut]=f.useState(null),[ar,Fn]=f.useState(null),[oe,io]=f.useState(""),[ft,wt]=f.useState(""),[kn,We]=f.useState(null),[Bn,Pn]=f.useState("playground"),Kt=f.useRef(null),B=C2[m],Rr=(Ct=Kt.current)==null?void 0:Ct.getBoundingClientRect().width,Ri=Math.max(zs,(Rr&&Rr>0?Rr:800)*.5),lr=f.useCallback(ge=>{const Ze=Kt.current;if(!Ze)return;const Hn=Ze.getBoundingClientRect();a(pc(ge-Hn.left,Hn.width))},[]),zo=ge=>{e&&(ge.preventDefault(),ge.currentTarget.setPointerCapture(ge.pointerId),c(!0),lr(ge.clientX))},At=ge=>{ge.currentTarget.hasPointerCapture(ge.pointerId)&&lr(ge.clientX)},Je=ge=>{ge.currentTarget.hasPointerCapture(ge.pointerId)&&(ge.currentTarget.releasePointerCapture(ge.pointerId),c(!1))},On=ge=>{var Hn;if(!e)return;const Ze=((Hn=Kt.current)==null?void 0:Hn.getBoundingClientRect().width)??o*2;ge.key==="ArrowLeft"?(ge.preventDefault(),a(nn=>pc(nn-Xg,Ze))):ge.key==="ArrowRight"?(ge.preventDefault(),a(nn=>pc(nn+Xg,Ze))):ge.key==="Home"?(ge.preventDefault(),a(zs)):ge.key==="End"&&(ge.preventDefault(),a(pc(Ze*.5,Ze)))},ao=f.useMemo(()=>{if(E==="fileEdit")return R2;if(E==="format")return L2},[E]),cn=f.useMemo(()=>[{id:"ai",label:B.commandAi,showIn:"both",menu:{id:"tools",label:B.menuTools},onAction:ge=>{Fn(ge),io(B.aiSample),wt("")}}],[B]),ue=f.useMemo(()=>{if(Qe!=="default")return{text:B.imagePickerTab,description:B.imagePickerDescription,buttonCaption:B.imagePickerButton,onPick:ge=>{Sn(()=>ge)}}},[Qe,B]),Lr=f.useMemo(()=>{if(ut!=="default")return{text:B.audioPickerTab,description:B.audioPickerDescription,buttonCaption:B.audioPickerButton,onPick:ge=>{Oo(()=>ge)}}},[ut,B]),tt=f.useMemo(()=>{if(In!=="default")return{text:B.videoPickerTab,description:B.videoPickerDescription,buttonCaption:B.videoPickerButton,onPick:ge=>{Ut(()=>ge)}}},[In,B]),Ho=f.useMemo(()=>{if(oo==="api")return{load:z2,save:H2}},[oo]),sr=f.useMemo(()=>{if(Cn==="api")return{load:U2,save:K2}},[Cn]),Uo=f.useMemo(()=>{if(ot==="api")return{load:$2,save:V2}},[ot]),$t=f.useCallback(ge=>{G(Date.now())},[]),_t=f.useCallback(async ge=>{await W2(ge),je(Date.now()),pe(!0)},[]),ct=f.useCallback(async()=>G2(),[]),Vt=q==null?B.autoSaveNever:new Date(q).toLocaleString(m,{dateStyle:"medium",timeStyle:"medium"}),Wt=ke==null?B.fileCallbacksNever:new Date(ke).toLocaleString(m,{dateStyle:"medium",timeStyle:"medium"}),zn=Y?B.fileCallbacksStored:B.fileCallbacksEmpty;return l.jsxs("main",{className:"page",children:[l.jsxs("header",{className:"page-header",children:[l.jsxs("a",{className:"page-brand",href:"https://commspliant.com/",target:"_blank",rel:"noopener noreferrer","aria-label":B.brandHomeAria,children:[l.jsx("img",{className:"page-logo",src:"/logo.svg",alt:"",width:"109",height:"28"}),l.jsx("span",{className:"page-wordmark",children:B.brandWordmark})]}),l.jsxs("nav",{className:"page-nav","aria-label":B.navAria,children:[l.jsx("button",{type:"button",className:"page-nav-button","aria-current":Bn==="playground"?"page":void 0,"aria-pressed":Bn==="playground",onClick:()=>Pn("playground"),children:B.navPlayground}),l.jsx("button",{type:"button",className:"page-nav-button","aria-current":Bn==="documentation"?"page":void 0,"aria-pressed":Bn==="documentation",onClick:()=>Pn("documentation"),children:B.navDocumentation})]})]}),Bn==="documentation"?l.jsx(D2,{label:B.navDocumentation}):l.jsxs("div",{ref:Kt,className:s?"workspace workspace-resizing":"workspace",children:[l.jsxs("aside",{className:e?"sidebar":"sidebar sidebar-collapsed",style:e?{width:o}:void 0,"aria-label":B.sectionPlayground,children:[l.jsxs("div",{className:"sidebar-header",children:[e?l.jsx("h1",{className:"sidebar-title",children:B.sectionPlayground}):l.jsx("span",{className:"sidebar-rail-title",children:B.sectionPlayground}),l.jsx("button",{type:"button",className:"locale-toggle-button sidebar-toggle","aria-expanded":e,"aria-controls":e?"playground-controls":void 0,"aria-label":e?B.playgroundClose:B.playgroundOpen,onClick:()=>n(ge=>!ge),children:e?B.playgroundClose:"›"})]}),e?l.jsxs("div",{id:"playground-controls",className:"sidebar-body",children:[l.jsxs("div",{className:"header-controls",children:[l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.chromeAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("chrome")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.chromeAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":y,onClick:()=>w(ge=>!ge),children:B.menuVisible}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":C,onClick:()=>S(ge=>!ge),children:B.toolbarVisible}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":A,onClick:()=>P(ge=>!ge),children:B.fullscreen})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.allowedChromeAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("allowedChrome")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.allowedChromeAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":E==="all",onClick:()=>k("all"),children:B.allowedChromeAll}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":E==="fileEdit",onClick:()=>k("fileEdit"),children:B.allowedChromeFileEdit}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":E==="format",onClick:()=>k("format"),children:B.allowedChromeFormat})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.readOnlyAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("readOnly")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.readOnlyAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":!T,onClick:()=>j(!1),children:B.readOnlyOff}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":T,onClick:()=>j(!0),children:B.readOnly})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.htmlFileDropAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("htmlFileDrop")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.htmlFileDropAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":!F,onClick:()=>L(!1),children:B.htmlFileDropAllowed}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":F,onClick:()=>L(!0),children:B.htmlFileDropDisabled})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.multiPagesAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("multiPages")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.multiPagesAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":!V,onClick:()=>K(!1),children:B.multiPagesOff}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":V,onClick:()=>K(!0),children:B.multiPagesOn})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.commentsAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("comments")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.commentsAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":!X,onClick:()=>de(!1),children:B.commentsOff}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":X,onClick:()=>de(!0),children:B.commentsOn})]}),X?l.jsx("p",{className:"control-group-status",children:B.commentsHint}):null,X&&ce.length>0?l.jsx("p",{className:"control-group-status",children:B.commentsThreadCount.replace("{count}",String(ce.length))}):null]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.fileCallbacksAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("fileCallbacks")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.fileCallbacksAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Q==="local",onClick:()=>$("local"),children:B.fileCallbacksLocal}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Q==="host",onClick:()=>$("host"),children:B.fileCallbacksHost})]}),Q==="host"?l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"control-group-status",children:[B.fileCallbacksLastSave,": ",Wt]}),l.jsx("p",{className:"control-group-status",children:zn})]}):null]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.autoSaveAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("autoSave")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.autoSaveAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":!H,onClick:()=>z(!1),children:B.autoSaveOff}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":H,onClick:()=>z(!0),children:B.autoSaveOn})]}),l.jsxs("p",{className:"control-group-status",children:[B.autoSaveLast,": ",Vt]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.customActionsAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("customActions")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.customActionsAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":!J,onClick:()=>M(!1),children:B.customActionsOff}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":J,onClick:()=>M(!0),children:B.customActionsOn})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.appearanceMenuAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("menu")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceMenuAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":fe==="default",onClick:()=>ae("default"),children:B.menuDefault}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":fe==="example",onClick:()=>ae("example"),children:B.menuExample})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.appearanceBorderAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("border")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceBorderAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Ce==="default",onClick:()=>Re("default"),children:B.borderDefault}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Ce==="none",onClick:()=>Re("none"),children:B.borderNone}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Ce==="rounded",onClick:()=>Re("rounded"),children:B.borderRounded})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.appearanceFontsAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("fonts")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceFontsAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":!De,onClick:()=>Be(!1),children:B.fontsDefault}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":De,onClick:()=>Be(!0),children:B.fontsGoogle})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.customParagraphStylesAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("customParagraphStyles")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.customParagraphStylesAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":!N,onClick:()=>re(!1),children:B.customParagraphStylesOff}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":N,onClick:()=>re(!0),children:B.customParagraphStylesOn})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.appearanceImageAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("image")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceImageAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Qe==="default",onClick:()=>un("default"),children:B.imagePickerDefault}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Qe==="custom",onClick:()=>un("custom"),children:B.imagePickerCustom}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Qe==="direct",onClick:()=>un("direct"),children:B.imagePickerDirect})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.appearanceAudioAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("audio")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceAudioAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":ut==="default",onClick:()=>wn("default"),children:B.audioPickerDefault}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":ut==="custom",onClick:()=>wn("custom"),children:B.audioPickerCustom}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":ut==="direct",onClick:()=>wn("direct"),children:B.audioPickerDirect})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.appearanceVideoAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("youtube")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceVideoAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":In==="default",onClick:()=>Io("default"),children:B.videoPickerDefault}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":In==="custom",onClick:()=>Io("custom"),children:B.videoPickerCustom}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":In==="direct",onClick:()=>Io("direct"),children:B.videoPickerDirect})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.appearanceToolbarAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("toolbar")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceToolbarAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":oo==="browser",onClick:()=>Le("browser"),children:B.toolbarPersistBrowser}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":oo==="api",onClick:()=>Le("api"),children:B.toolbarPersistApi})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.appearanceDarkModeAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("darkMode")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceDarkModeInitialAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":!or,onClick:()=>ir(!1),children:B.darkModeInitialLight}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":or,onClick:()=>ir(!0),children:B.darkModeInitialDark})]}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceDarkModeAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Cn==="browser",onClick:()=>Fo("browser"),children:B.darkModePersistBrowser}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":Cn==="api",onClick:()=>Fo("api"),children:B.darkModePersistApi})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.appearanceToolbarPositionAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("toolbarPosition")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceToolbarPositionInitialAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":it==="top",onClick:()=>Nr("top"),children:B.toolbarPositionTop}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":it==="left",onClick:()=>Nr("left"),children:B.toolbarPositionLeft}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":it==="right",onClick:()=>Nr("right"),children:B.toolbarPositionRight}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":it==="bottom",onClick:()=>Nr("bottom"),children:B.toolbarPositionBottom})]}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.appearanceToolbarPositionAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":ot==="browser",onClick:()=>Bo("browser"),children:B.toolbarPositionPersistBrowser}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":ot==="api",onClick:()=>Bo("api"),children:B.toolbarPositionPersistApi})]})]}),l.jsxs("div",{className:"control-group",children:[l.jsx(bt,{label:B.languageAria,examplesLabel:B.codeExamplesLink,onOpenExamples:()=>We("language")}),l.jsxs("div",{className:"locale-toggle",role:"group","aria-label":B.languageAria,children:[l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":m==="en",onClick:()=>g("en"),children:B.localeEn}),l.jsx("button",{type:"button",className:"locale-toggle-button","aria-pressed":m==="es",onClick:()=>g("es"),children:B.localeEs})]})]})]}),l.jsx("p",{className:"lede",children:B.lede})]}):null]}),e?l.jsx("div",{className:"sidebar-splitter",role:"separator","aria-orientation":"vertical","aria-label":B.playgroundResizeAria,"aria-valuenow":Math.round(o),"aria-valuemin":zs,"aria-valuemax":Math.round(Ri),tabIndex:0,onPointerDown:zo,onPointerMove:At,onPointerUp:Je,onPointerCancel:Je,onKeyDown:On}):null,l.jsx("section",{className:"editor-pane",children:l.jsx("div",{className:"editor-slot",children:l.jsx(b2,{locale:m,menuVisible:y,toolbarVisible:C,allowedChrome:ao,fullscreen:A,onFullscreenChange:P,readOnly:T,disableHtmlFileDrop:F,enableMultiPages:V,enableComments:X,commentAuthor:X?{userId:"playground",userName:"Playground user"}:void 0,comments:X?ce:void 0,onCommentsChange:X?Pe:void 0,onAutoSave:H?$t:void 0,onSave:Q==="host"?_t:void 0,onOpen:Q==="host"?ct:void 0,...fe==="example"?Y2:{},border:Ce==="none"?"none":Ce==="rounded"?q2:void 0,defaultValue:X?N2:j2,placeholder:B.placeholder,customActions:J?cn:void 0,customFonts:De?Q2:void 0,customImagePicker:ue,disableBuiltinImageInsert:Qe==="direct",customAudioPicker:Lr,disableBuiltinAudioInsert:ut==="direct",customVideoPicker:tt,disableBuiltinVideoInsert:In==="direct",toolbarCustomization:Ho,darkMode:or,darkModePersistence:sr,toolbarPosition:it,toolbarPositionPersistence:Uo,loadCustomParagraphStyles:N?F2:void 0,onSaveCustomParagraphStyle:N?B2:void 0,onDeleteCustomParagraphStyle:N?O2:void 0},X?"comments-demo":"default-demo")})})]}),kn?l.jsx(k2,{blockId:kn,messages:B,onClose:()=>We(null)}):null,Ht?l.jsx("div",{className:"ai-dialog-backdrop",children:l.jsxs("div",{className:"ai-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"audio-gallery-title",children:[l.jsx("h2",{id:"audio-gallery-title",className:"ai-dialog-title",children:B.audioGalleryTitle}),l.jsx("div",{className:"image-gallery",children:_2.map(ge=>{const Ze=B[ge.titleKey];return l.jsx("button",{type:"button",className:"image-gallery-item",onClick:()=>{Ht({src:ge.src,title:Ze}),Oo(null)},children:l.jsx("span",{children:Ze})},ge.src)})}),l.jsx("div",{className:"ai-dialog-actions",children:l.jsx("button",{type:"button",className:"ai-dialog-button",onClick:()=>{Oo(null)},children:B.audioGalleryCancel})})]})}):null,Mt?l.jsx("div",{className:"ai-dialog-backdrop",children:l.jsxs("div",{className:"ai-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"video-gallery-title",children:[l.jsx("h2",{id:"video-gallery-title",className:"ai-dialog-title",children:B.videoGalleryTitle}),l.jsx("div",{className:"image-gallery",children:I2.map(ge=>{const Ze=B[ge.titleKey];return l.jsx("button",{type:"button",className:"image-gallery-item",onClick:()=>{Mt({src:ge.src,title:Ze}),Ut(null)},children:l.jsx("span",{children:Ze})},ge.src)})}),l.jsx("div",{className:"ai-dialog-actions",children:l.jsx("button",{type:"button",className:"ai-dialog-button",onClick:()=>{Ut(null)},children:B.videoGalleryCancel})})]})}):null,tn?l.jsx("div",{className:"ai-dialog-backdrop",children:l.jsxs("div",{className:"ai-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"image-gallery-title",children:[l.jsx("h2",{id:"image-gallery-title",className:"ai-dialog-title",children:B.imageGalleryTitle}),l.jsx("div",{className:"image-gallery",children:M2.map(ge=>{const Ze=B[ge.altKey];return l.jsxs("button",{type:"button",className:"image-gallery-item",onClick:()=>{tn({src:ge.src,alt:Ze,title:Ze,css:"width: 200px; border-radius: 8px"}),Sn(null)},children:[l.jsx("img",{src:ge.src,alt:Ze}),l.jsx("span",{children:Ze})]},ge.src)})}),l.jsx("div",{className:"ai-dialog-actions",children:l.jsx("button",{type:"button",className:"ai-dialog-button",onClick:()=>{Sn(null)},children:B.imageGalleryCancel})})]})}):null,ar?l.jsx("div",{className:"ai-dialog-backdrop",children:l.jsxs("div",{className:"ai-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"ai-dialog-title",children:[l.jsx("h2",{id:"ai-dialog-title",className:"ai-dialog-title",children:B.aiDialogTitle}),l.jsxs("label",{className:"ai-dialog-field",children:[l.jsx("span",{children:B.aiHtmlLabel}),l.jsx("textarea",{className:"ai-dialog-text",value:oe,onChange:ge=>io(ge.target.value)})]}),l.jsxs("label",{className:"ai-dialog-field",children:[l.jsx("span",{children:B.aiFormattedLabel}),l.jsx("textarea",{className:"ai-dialog-text ai-dialog-text-optional",value:ft,onChange:ge=>wt(ge.target.value)})]}),l.jsxs("div",{className:"ai-dialog-actions",children:[l.jsx("button",{type:"button",className:"ai-dialog-button",onClick:()=>{Fn(null)},children:B.aiCancel}),l.jsx("button",{type:"button",className:"ai-dialog-button ai-dialog-button-primary",onClick:()=>{ar.insertHtml(oe,ft.trim()?ft:void 0),Fn(null)},children:B.aiOk})]})]})}):null,l.jsxs("footer",{className:"page-footer",children:[l.jsxs("span",{children:[B.footerGithub," ",l.jsx("a",{href:"https://github.com/commspliant/html-editor",target:"_blank",rel:"noopener noreferrer",children:B.footerGithubLink})]}),l.jsx("span",{className:"page-footer-separator","aria-hidden":"true",children:"·"}),l.jsx("a",{href:"https://commspliant.com/",target:"_blank",rel:"noopener noreferrer",children:B.footerBroughtBy})]})]})}const Pv=document.getElementById("root");if(!Pv)throw new Error("Root element not found");px.createRoot(Pv).render(l.jsx(f.StrictMode,{children:l.jsx(J2,{})}));